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 * Exposes the state of pending inbound HTLCs.
605 * At a high level, an HTLC being forwarded from one Lightning node to another Lightning node goes
606 * through the following states in the state machine:
607 * - Announced for addition by the originating node through the update_add_htlc message.
608 * - Added to the commitment transaction of the receiving node and originating node in turn
609 * through the exchange of commitment_signed and revoke_and_ack messages.
610 * - Announced for resolution (fulfillment or failure) by the receiving node through either one of
611 * the update_fulfill_htlc, update_fail_htlc, and update_fail_malformed_htlc messages.
612 * - Removed from the commitment transaction of the originating node and receiving node in turn
613 * through the exchange of commitment_signed and revoke_and_ack messages.
615 * This can be used to inspect what next message an HTLC is waiting for to advance its state.
617 typedef enum LDKInboundHTLCStateDetails {
619 * We have added this HTLC in our commitment transaction by receiving commitment_signed and
620 * returning revoke_and_ack. We are awaiting the appropriate revoke_and_ack's from the remote
621 * before this HTLC is included on the remote commitment transaction.
623 LDKInboundHTLCStateDetails_AwaitingRemoteRevokeToAdd,
625 * This HTLC has been included in the commitment_signed and revoke_and_ack messages on both sides
626 * and is included in both commitment transactions.
628 * This HTLC is now safe to either forward or be claimed as a payment by us. The HTLC will
629 * remain in this state until the forwarded upstream HTLC has been resolved and we resolve this
630 * HTLC correspondingly, or until we claim it as a payment. If it is part of a multipart
631 * payment, it will only be claimed together with other required parts.
633 LDKInboundHTLCStateDetails_Committed,
635 * We have received the preimage for this HTLC and it is being removed by fulfilling it with
636 * update_fulfill_htlc. This HTLC is still on both commitment transactions, but we are awaiting
637 * the appropriate revoke_and_ack's from the remote before this HTLC is removed from the remote
638 * commitment transaction after update_fulfill_htlc.
640 LDKInboundHTLCStateDetails_AwaitingRemoteRevokeToRemoveFulfill,
642 * The HTLC is being removed by failing it with update_fail_htlc or update_fail_malformed_htlc.
643 * This HTLC is still on both commitment transactions, but we are awaiting the appropriate
644 * revoke_and_ack's from the remote before this HTLC is removed from the remote commitment
647 LDKInboundHTLCStateDetails_AwaitingRemoteRevokeToRemoveFail,
649 * Must be last for serialization purposes
651 LDKInboundHTLCStateDetails_Sentinel,
652 } LDKInboundHTLCStateDetails;
655 * An enum representing the available verbosity levels of the logger.
657 typedef enum LDKLevel {
659 * Designates extremely verbose information, including gossip-induced messages
663 * Designates very low priority, often extremely verbose, information
667 * Designates lower priority information
671 * Designates useful information
675 * Designates hazardous situations
679 * Designates very serious errors
683 * Must be last for serialization purposes
689 * An enum representing the possible Bitcoin or test networks which we can run on
691 typedef enum LDKNetwork {
693 * The main Bitcoin blockchain.
697 * The testnet3 blockchain.
701 * A local test blockchain.
705 * A blockchain on which blocks are signed instead of mined.
709 * Must be last for serialization purposes
715 * Exposes the state of pending outbound HTLCs.
717 * At a high level, an HTLC being forwarded from one Lightning node to another Lightning node goes
718 * through the following states in the state machine:
719 * - Announced for addition by the originating node through the update_add_htlc message.
720 * - Added to the commitment transaction of the receiving node and originating node in turn
721 * through the exchange of commitment_signed and revoke_and_ack messages.
722 * - Announced for resolution (fulfillment or failure) by the receiving node through either one of
723 * the update_fulfill_htlc, update_fail_htlc, and update_fail_malformed_htlc messages.
724 * - Removed from the commitment transaction of the originating node and receiving node in turn
725 * through the exchange of commitment_signed and revoke_and_ack messages.
727 * This can be used to inspect what next message an HTLC is waiting for to advance its state.
729 typedef enum LDKOutboundHTLCStateDetails {
731 * We are awaiting the appropriate revoke_and_ack's from the remote before the HTLC is added
732 * on the remote's commitment transaction after update_add_htlc.
734 LDKOutboundHTLCStateDetails_AwaitingRemoteRevokeToAdd,
736 * The HTLC has been added to the remote's commitment transaction by sending commitment_signed
737 * and receiving revoke_and_ack in return.
739 * The HTLC will remain in this state until the remote node resolves the HTLC, or until we
740 * unilaterally close the channel due to a timeout with an uncooperative remote node.
742 LDKOutboundHTLCStateDetails_Committed,
744 * The HTLC has been fulfilled successfully by the remote with a preimage in update_fulfill_htlc,
745 * and we removed the HTLC from our commitment transaction by receiving commitment_signed and
746 * returning revoke_and_ack. We are awaiting the appropriate revoke_and_ack's from the remote
747 * for the removal from its commitment transaction.
749 LDKOutboundHTLCStateDetails_AwaitingRemoteRevokeToRemoveSuccess,
751 * The HTLC has been failed by the remote with update_fail_htlc or update_fail_malformed_htlc,
752 * and we removed the HTLC from our commitment transaction by receiving commitment_signed and
753 * returning revoke_and_ack. We are awaiting the appropriate revoke_and_ack's from the remote
754 * for the removal from its commitment transaction.
756 LDKOutboundHTLCStateDetails_AwaitingRemoteRevokeToRemoveFailure,
758 * Must be last for serialization purposes
760 LDKOutboundHTLCStateDetails_Sentinel,
761 } LDKOutboundHTLCStateDetails;
764 * The reason the payment failed. Used in [`Event::PaymentFailed`].
766 typedef enum LDKPaymentFailureReason {
768 * The intended recipient rejected our payment.
770 LDKPaymentFailureReason_RecipientRejected,
772 * The user chose to abandon this payment by calling [`ChannelManager::abandon_payment`].
774 * [`ChannelManager::abandon_payment`]: crate::ln::channelmanager::ChannelManager::abandon_payment
776 LDKPaymentFailureReason_UserAbandoned,
778 * We exhausted all of our retry attempts while trying to send the payment, or we
779 * exhausted the [`Retry::Timeout`] if the user set one. If at any point a retry
780 * attempt failed while being forwarded along the path, an [`Event::PaymentPathFailed`] will
781 * have come before this.
783 * [`Retry::Timeout`]: crate::ln::channelmanager::Retry::Timeout
785 LDKPaymentFailureReason_RetriesExhausted,
787 * The payment expired while retrying, based on the provided
788 * [`PaymentParameters::expiry_time`].
790 * [`PaymentParameters::expiry_time`]: crate::routing::router::PaymentParameters::expiry_time
792 LDKPaymentFailureReason_PaymentExpired,
794 * We failed to find a route while retrying the payment.
796 * Note that this generally indicates that we've exhausted the available set of possible
797 * routes - we tried the payment over a few routes but were not able to find any further
798 * candidate routes beyond those.
800 LDKPaymentFailureReason_RouteNotFound,
802 * This error should generally never happen. This likely means that there is a problem with
805 LDKPaymentFailureReason_UnexpectedError,
807 * Must be last for serialization purposes
809 LDKPaymentFailureReason_Sentinel,
810 } LDKPaymentFailureReason;
813 * Specifies the recipient of an invoice.
815 * This indicates to [`NodeSigner::sign_invoice`] what node secret key should be used to sign
818 typedef enum LDKRecipient {
820 * The invoice should be signed with the local node secret key.
824 * The invoice should be signed with the phantom node secret key. This secret key must be the
825 * same for all nodes participating in the [phantom node payment].
827 * [phantom node payment]: PhantomKeysManager
829 LDKRecipient_PhantomNode,
831 * Must be last for serialization purposes
833 LDKRecipient_Sentinel,
837 * Indicates an immediate error on [`ChannelManager::send_payment`]. Further errors may be
838 * surfaced later via [`Event::PaymentPathFailed`] and [`Event::PaymentFailed`].
840 * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
841 * [`Event::PaymentPathFailed`]: crate::events::Event::PaymentPathFailed
842 * [`Event::PaymentFailed`]: crate::events::Event::PaymentFailed
844 typedef enum LDKRetryableSendFailure {
846 * The provided [`PaymentParameters::expiry_time`] indicated that the payment has expired. Note
847 * that this error is *not* caused by [`Retry::Timeout`].
849 * [`PaymentParameters::expiry_time`]: crate::routing::router::PaymentParameters::expiry_time
851 LDKRetryableSendFailure_PaymentExpired,
853 * We were unable to find a route to the destination.
855 LDKRetryableSendFailure_RouteNotFound,
857 * Indicates that a payment for the provided [`PaymentId`] is already in-flight and has not
858 * yet completed (i.e. generated an [`Event::PaymentSent`] or [`Event::PaymentFailed`]).
860 * [`PaymentId`]: crate::ln::channelmanager::PaymentId
861 * [`Event::PaymentSent`]: crate::events::Event::PaymentSent
862 * [`Event::PaymentFailed`]: crate::events::Event::PaymentFailed
864 LDKRetryableSendFailure_DuplicatePayment,
866 * Must be last for serialization purposes
868 LDKRetryableSendFailure_Sentinel,
869 } LDKRetryableSendFailure;
872 * Represents an error returned from libsecp256k1 during validation of some secp256k1 data
874 typedef enum LDKSecp256k1Error {
876 * Signature failed verification
878 LDKSecp256k1Error_IncorrectSignature,
880 * Badly sized message ("messages" are actually fixed-sized digests; see the MESSAGE_SIZE constant)
882 LDKSecp256k1Error_InvalidMessage,
886 LDKSecp256k1Error_InvalidPublicKey,
890 LDKSecp256k1Error_InvalidSignature,
894 LDKSecp256k1Error_InvalidSecretKey,
898 LDKSecp256k1Error_InvalidSharedSecret,
902 LDKSecp256k1Error_InvalidRecoveryId,
904 * Invalid tweak for add_assign or mul_assign
906 LDKSecp256k1Error_InvalidTweak,
908 * Didn't pass enough memory to context creation with preallocated memory
910 LDKSecp256k1Error_NotEnoughMemory,
912 * Bad set of public keys.
914 LDKSecp256k1Error_InvalidPublicKeySum,
916 * The only valid parity values are 0 or 1.
918 LDKSecp256k1Error_InvalidParityValue,
920 * Must be last for serialization purposes
922 LDKSecp256k1Error_Sentinel,
926 * A `short_channel_id` construction error
928 typedef enum LDKShortChannelIdError {
930 * Block height too high
932 LDKShortChannelIdError_BlockOverflow,
936 LDKShortChannelIdError_TxIndexOverflow,
938 * Vout index too high
940 LDKShortChannelIdError_VoutIndexOverflow,
942 * Must be last for serialization purposes
944 LDKShortChannelIdError_Sentinel,
945 } LDKShortChannelIdError;
948 * SI prefixes for the human readable part
950 typedef enum LDKSiPrefix {
968 * Must be last for serialization purposes
970 LDKSiPrefix_Sentinel,
974 * [`SocketAddress`] error variants
976 typedef enum LDKSocketAddressParseError {
978 * Socket address (IPv4/IPv6) parsing error
980 LDKSocketAddressParseError_SocketAddrParse,
982 * Invalid input format
984 LDKSocketAddressParseError_InvalidInput,
988 LDKSocketAddressParseError_InvalidPort,
990 * Invalid onion v3 address
992 LDKSocketAddressParseError_InvalidOnionV3,
994 * Must be last for serialization purposes
996 LDKSocketAddressParseError_Sentinel,
997 } LDKSocketAddressParseError;
1000 * An error when accessing the chain via [`UtxoLookup`].
1002 typedef enum LDKUtxoLookupError {
1004 * The requested chain is unknown.
1006 LDKUtxoLookupError_UnknownChain,
1008 * The requested transaction doesn't exist or hasn't confirmed.
1010 LDKUtxoLookupError_UnknownTx,
1012 * Must be last for serialization purposes
1014 LDKUtxoLookupError_Sentinel,
1015 } LDKUtxoLookupError;
1018 * A Rust str object, ie a reference to a UTF8-valid string.
1019 * This is *not* null-terminated so cannot be used directly as a C string!
1021 typedef struct LDKStr {
1023 * A pointer to the string's bytes, in UTF8 encoding
1025 const uint8_t *chars;
1027 * The number of bytes (not characters!) pointed to by `chars`
1031 * Whether the data pointed to by `chars` should be freed or not.
1033 bool chars_is_owned;
1037 * A 16-byte byte array.
1039 typedef struct LDKSixteenBytes {
1047 * Unsigned, 128-bit integer.
1049 * Because LLVM implements an incorrect ABI for 128-bit integers, a wrapper type is defined here.
1050 * See https://github.com/rust-lang/rust/issues/54341 for more details.
1052 typedef struct LDKU128 {
1054 * The 128-bit integer, as 16 little-endian bytes
1056 uint8_t le_bytes[16];
1060 * Integer in the range `0..=16`
1062 typedef struct LDKWitnessVersion {
1064 } LDKWitnessVersion;
1067 * A dynamically-allocated array of u8s of arbitrary size.
1068 * This corresponds to std::vector in C++
1070 typedef struct LDKCVec_u8Z {
1072 * The elements in the array.
1073 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
1077 * The number of elements pointed to by `data`.
1083 * A segregated witness version byte and script bytes
1085 typedef struct LDKWitnessProgram {
1086 struct LDKWitnessVersion version;
1087 struct LDKCVec_u8Z program;
1088 } LDKWitnessProgram;
1091 * A "slice" referencing some byte array. This is simply a length-tagged pointer which does not
1092 * own the memory pointed to by data.
1094 typedef struct LDKu8slice {
1096 * A pointer to the byte buffer
1098 const uint8_t *data;
1100 * The number of bytes pointed to by `data`.
1106 * Represents a scalar value between zero and the secp256k1 curve order, in big endian.
1108 typedef struct LDKBigEndianScalar {
1110 * The bytes of the scalar value.
1112 uint8_t big_endian_bytes[32];
1113 } LDKBigEndianScalar;
1116 * Arbitrary 32 bytes, which could represent one of a few different things. You probably want to
1117 * look up the corresponding function in rust-lightning's docs.
1119 typedef struct LDKThirtyTwoBytes {
1121 * The thirty-two bytes
1124 } LDKThirtyTwoBytes;
1127 * Represents an error returned from the bech32 library during validation of some bech32 data
1129 typedef enum LDKBech32Error_Tag {
1131 * String does not contain the separator character
1133 LDKBech32Error_MissingSeparator,
1135 * The checksum does not match the rest of the data
1137 LDKBech32Error_InvalidChecksum,
1139 * The data or human-readable part is too long or too short
1141 LDKBech32Error_InvalidLength,
1143 * Some part of the string contains an invalid character
1145 LDKBech32Error_InvalidChar,
1147 * Some part of the data has an invalid value
1149 LDKBech32Error_InvalidData,
1151 * The bit conversion failed due to a padding issue
1153 LDKBech32Error_InvalidPadding,
1155 * The whole string must be of one case
1157 LDKBech32Error_MixedCase,
1159 * Must be last for serialization purposes
1161 LDKBech32Error_Sentinel,
1162 } LDKBech32Error_Tag;
1164 typedef struct LDKBech32Error {
1165 LDKBech32Error_Tag tag;
1168 uint32_t invalid_char;
1171 uint8_t invalid_data;
1177 * A serialized transaction, in (pointer, length) form.
1179 * This type optionally owns its own memory, and thus the semantics around access change based on
1180 * the `data_is_owned` flag. If `data_is_owned` is set, you must call `Transaction_free` to free
1181 * the underlying buffer before the object goes out of scope. If `data_is_owned` is not set, any
1182 * access to the buffer after the scope in which the object was provided to you is invalid. eg,
1183 * access after you return from the call in which a `!data_is_owned` `Transaction` is provided to
1184 * you would be invalid.
1186 * Note that, while it may change in the future, because transactions on the Rust side are stored
1187 * in a deserialized form, all `Transaction`s generated on the Rust side will have `data_is_owned`
1188 * set. Similarly, while it may change in the future, all `Transaction`s you pass to Rust may have
1189 * `data_is_owned` either set or unset at your discretion.
1191 typedef struct LDKTransaction {
1193 * The serialized transaction data.
1195 * This is non-const for your convenience, an object passed to Rust is never written to.
1199 * The length of the serialized transaction
1203 * Whether the data pointed to by `data` should be freed or not.
1209 * A serialized witness.
1211 typedef struct LDKWitness {
1213 * The serialized transaction data.
1215 * This is non-const for your convenience, an object passed to Rust is never written to.
1219 * The length of the serialized transaction
1223 * Whether the data pointed to by `data` should be freed or not.
1229 * An input to a transaction.
1231 * This contains the witness, the scriptSig and the previous outpoint and represents a single
1232 * input to a transaction
1234 typedef struct LDKTxIn {
1236 * The witness which includes any signatures required to spend a segwit output.
1238 struct LDKWitness witness;
1240 * The script_sig which includes signatures requires to spend a pre-segwit output (or a
1241 * P2SH-wrapped segwit output).
1243 struct LDKCVec_u8Z script_sig;
1245 * The sequence number of the transaction input
1249 * The txid of the transaction being spent.
1251 struct LDKThirtyTwoBytes previous_txid;
1253 * The output index of the transaction being spent.
1255 uint32_t previous_vout;
1259 * A transaction output including a scriptPubKey and value.
1260 * This type *does* own its own memory, so must be free'd appropriately.
1262 typedef struct LDKTxOut {
1264 * The script_pubkey in this output
1266 struct LDKCVec_u8Z script_pubkey;
1268 * The value, in satoshis, of this output
1276 * Builds a [`Refund`] for the \"offer for money\" flow.
1278 * See [module-level documentation] for usage.
1280 * [module-level documentation]: self
1282 typedef struct MUST_USE_STRUCT LDKRefundMaybeWithDerivedMetadataBuilder {
1284 * A pointer to the opaque Rust object.
1285 * Nearly everywhere, inner must be non-null, however in places where
1286 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1288 LDKnativeRefundMaybeWithDerivedMetadataBuilder *inner;
1290 * Indicates that this is the only struct which contains the same pointer.
1291 * Rust functions which take ownership of an object provided via an argument require
1292 * this to be true and invalidate the object pointed to by inner.
1295 } LDKRefundMaybeWithDerivedMetadataBuilder;
1298 * The contents of CResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ
1300 typedef union LDKCResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZPtr {
1302 * A pointer to the contents in the success state.
1303 * Reading from this pointer when `result_ok` is not set is undefined.
1305 struct LDKRefundMaybeWithDerivedMetadataBuilder *result;
1307 * A pointer to the contents in the error state.
1308 * Reading from this pointer when `result_ok` is set is undefined.
1310 enum LDKBolt12SemanticError *err;
1311 } LDKCResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZPtr;
1314 * A CResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ represents the result of a fallible operation,
1315 * containing a crate::lightning::offers::refund::RefundMaybeWithDerivedMetadataBuilder on success and a crate::lightning::offers::parse::Bolt12SemanticError on failure.
1316 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1318 typedef struct LDKCResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ {
1320 * The contents of this CResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ, accessible via either
1321 * `err` or `result` depending on the state of `result_ok`.
1323 union LDKCResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZPtr contents;
1325 * Whether this CResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ represents a success state.
1328 } LDKCResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ;
1333 * A `Refund` is a request to send an [`Bolt12Invoice`] without a preceding [`Offer`].
1335 * Typically, after an invoice is paid, the recipient may publish a refund allowing the sender to
1336 * recoup their funds. A refund may be used more generally as an \"offer for money\", such as with a
1339 * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice
1340 * [`Offer`]: crate::offers::offer::Offer
1342 typedef struct MUST_USE_STRUCT LDKRefund {
1344 * A pointer to the opaque Rust object.
1345 * Nearly everywhere, inner must be non-null, however in places where
1346 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1348 LDKnativeRefund *inner;
1350 * Indicates that this is the only struct which contains the same pointer.
1351 * Rust functions which take ownership of an object provided via an argument require
1352 * this to be true and invalidate the object pointed to by inner.
1358 * The contents of CResult_RefundBolt12SemanticErrorZ
1360 typedef union LDKCResult_RefundBolt12SemanticErrorZPtr {
1362 * A pointer to the contents in the success state.
1363 * Reading from this pointer when `result_ok` is not set is undefined.
1365 struct LDKRefund *result;
1367 * A pointer to the contents in the error state.
1368 * Reading from this pointer when `result_ok` is set is undefined.
1370 enum LDKBolt12SemanticError *err;
1371 } LDKCResult_RefundBolt12SemanticErrorZPtr;
1374 * A CResult_RefundBolt12SemanticErrorZ represents the result of a fallible operation,
1375 * containing a crate::lightning::offers::refund::Refund on success and a crate::lightning::offers::parse::Bolt12SemanticError on failure.
1376 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1378 typedef struct LDKCResult_RefundBolt12SemanticErrorZ {
1380 * The contents of this CResult_RefundBolt12SemanticErrorZ, accessible via either
1381 * `err` or `result` depending on the state of `result_ok`.
1383 union LDKCResult_RefundBolt12SemanticErrorZPtr contents;
1385 * Whether this CResult_RefundBolt12SemanticErrorZ represents a success state.
1388 } LDKCResult_RefundBolt12SemanticErrorZ;
1391 * An enum which can either contain a u64 or not
1393 typedef enum LDKCOption_u64Z_Tag {
1395 * When we're in this state, this COption_u64Z contains a u64
1397 LDKCOption_u64Z_Some,
1399 * When we're in this state, this COption_u64Z contains nothing
1401 LDKCOption_u64Z_None,
1403 * Must be last for serialization purposes
1405 LDKCOption_u64Z_Sentinel,
1406 } LDKCOption_u64Z_Tag;
1408 typedef struct LDKCOption_u64Z {
1409 LDKCOption_u64Z_Tag tag;
1420 * Onion messages and payments can be sent and received to blinded paths, which serve to hide the
1421 * identity of the recipient.
1423 typedef struct MUST_USE_STRUCT LDKBlindedPath {
1425 * A pointer to the opaque Rust object.
1426 * Nearly everywhere, inner must be non-null, however in places where
1427 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1429 LDKnativeBlindedPath *inner;
1431 * Indicates that this is the only struct which contains the same pointer.
1432 * Rust functions which take ownership of an object provided via an argument require
1433 * this to be true and invalidate the object pointed to by inner.
1439 * A dynamically-allocated array of crate::lightning::blinded_path::BlindedPaths of arbitrary size.
1440 * This corresponds to std::vector in C++
1442 typedef struct LDKCVec_BlindedPathZ {
1444 * The elements in the array.
1445 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
1447 struct LDKBlindedPath *data;
1449 * The number of elements pointed to by `data`.
1452 } LDKCVec_BlindedPathZ;
1457 * Error when parsing a bech32 encoded message using [`str::parse`].
1459 typedef struct MUST_USE_STRUCT LDKBolt12ParseError {
1461 * A pointer to the opaque Rust object.
1462 * Nearly everywhere, inner must be non-null, however in places where
1463 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1465 LDKnativeBolt12ParseError *inner;
1467 * Indicates that this is the only struct which contains the same pointer.
1468 * Rust functions which take ownership of an object provided via an argument require
1469 * this to be true and invalidate the object pointed to by inner.
1472 } LDKBolt12ParseError;
1475 * The contents of CResult_RefundBolt12ParseErrorZ
1477 typedef union LDKCResult_RefundBolt12ParseErrorZPtr {
1479 * A pointer to the contents in the success state.
1480 * Reading from this pointer when `result_ok` is not set is undefined.
1482 struct LDKRefund *result;
1484 * A pointer to the contents in the error state.
1485 * Reading from this pointer when `result_ok` is set is undefined.
1487 struct LDKBolt12ParseError *err;
1488 } LDKCResult_RefundBolt12ParseErrorZPtr;
1491 * A CResult_RefundBolt12ParseErrorZ represents the result of a fallible operation,
1492 * containing a crate::lightning::offers::refund::Refund on success and a crate::lightning::offers::parse::Bolt12ParseError on failure.
1493 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1495 typedef struct LDKCResult_RefundBolt12ParseErrorZ {
1497 * The contents of this CResult_RefundBolt12ParseErrorZ, accessible via either
1498 * `err` or `result` depending on the state of `result_ok`.
1500 union LDKCResult_RefundBolt12ParseErrorZPtr contents;
1502 * Whether this CResult_RefundBolt12ParseErrorZ represents a success state.
1505 } LDKCResult_RefundBolt12ParseErrorZ;
1508 * Strategies available to retry payment path failures.
1510 typedef enum LDKRetry_Tag {
1512 * Max number of attempts to retry payment.
1514 * Each attempt may be multiple HTLCs along multiple paths if the router decides to split up a
1515 * retry, and may retry multiple failed HTLCs at once if they failed around the same time and
1516 * were retried along a route from a single call to [`Router::find_route_with_id`].
1520 * Time elapsed before abandoning retries for a payment. At least one attempt at payment is made;
1521 * see [`PaymentParameters::expiry_time`] to avoid any attempt at payment after a specific time.
1523 * [`PaymentParameters::expiry_time`]: crate::routing::router::PaymentParameters::expiry_time
1527 * Must be last for serialization purposes
1532 typedef struct MUST_USE_STRUCT LDKRetry {
1545 * An error in decoding a message or struct.
1547 typedef enum LDKDecodeError_Tag {
1549 * A version byte specified something we don't know how to handle.
1551 * Includes unknown realm byte in an onion hop data packet.
1553 LDKDecodeError_UnknownVersion,
1555 * Unknown feature mandating we fail to parse message (e.g., TLV with an even, unknown type)
1557 LDKDecodeError_UnknownRequiredFeature,
1559 * Value was invalid.
1561 * For example, a byte which was supposed to be a bool was something other than a 0
1562 * or 1, a public key/private key/signature was invalid, text wasn't UTF-8, TLV was
1563 * syntactically incorrect, etc.
1565 LDKDecodeError_InvalidValue,
1567 * The buffer to be read was too short.
1569 LDKDecodeError_ShortRead,
1571 * A length descriptor in the packet didn't describe the later data correctly.
1573 LDKDecodeError_BadLengthDescriptor,
1575 * Error from [`std::io`].
1579 * The message included zlib-compressed values, which we don't support.
1581 LDKDecodeError_UnsupportedCompression,
1583 * Value is validly encoded but is dangerous to use.
1585 * This is used for things like [`ChannelManager`] deserialization where we want to ensure
1586 * that we don't use a [`ChannelManager`] which is in out of sync with the [`ChannelMonitor`].
1587 * This indicates that there is a critical implementation flaw in the storage implementation
1588 * and it's unsafe to continue.
1590 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
1591 * [`ChannelMonitor`]: crate::chain::channelmonitor::ChannelMonitor
1593 LDKDecodeError_DangerousValue,
1595 * Must be last for serialization purposes
1597 LDKDecodeError_Sentinel,
1598 } LDKDecodeError_Tag;
1600 typedef struct MUST_USE_STRUCT LDKDecodeError {
1601 LDKDecodeError_Tag tag;
1610 * The contents of CResult_RetryDecodeErrorZ
1612 typedef union LDKCResult_RetryDecodeErrorZPtr {
1614 * A pointer to the contents in the success state.
1615 * Reading from this pointer when `result_ok` is not set is undefined.
1617 struct LDKRetry *result;
1619 * A pointer to the contents in the error state.
1620 * Reading from this pointer when `result_ok` is set is undefined.
1622 struct LDKDecodeError *err;
1623 } LDKCResult_RetryDecodeErrorZPtr;
1626 * A CResult_RetryDecodeErrorZ represents the result of a fallible operation,
1627 * containing a crate::lightning::ln::outbound_payment::Retry on success and a crate::lightning::ln::msgs::DecodeError on failure.
1628 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1630 typedef struct LDKCResult_RetryDecodeErrorZ {
1632 * The contents of this CResult_RetryDecodeErrorZ, accessible via either
1633 * `err` or `result` depending on the state of `result_ok`.
1635 union LDKCResult_RetryDecodeErrorZPtr contents;
1637 * Whether this CResult_RetryDecodeErrorZ represents a success state.
1640 } LDKCResult_RetryDecodeErrorZ;
1645 * A script pubkey for shutting down a channel as defined by [BOLT #2].
1647 * [BOLT #2]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md
1649 typedef struct MUST_USE_STRUCT LDKShutdownScript {
1651 * A pointer to the opaque Rust object.
1652 * Nearly everywhere, inner must be non-null, however in places where
1653 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1655 LDKnativeShutdownScript *inner;
1657 * Indicates that this is the only struct which contains the same pointer.
1658 * Rust functions which take ownership of an object provided via an argument require
1659 * this to be true and invalidate the object pointed to by inner.
1662 } LDKShutdownScript;
1665 * Indicates an error on the client's part (usually some variant of attempting to use too-low or
1668 typedef enum LDKAPIError_Tag {
1670 * Indicates the API was wholly misused (see err for more). Cases where these can be returned
1671 * are documented, but generally indicates some precondition of a function was violated.
1673 LDKAPIError_APIMisuseError,
1675 * Due to a high feerate, we were unable to complete the request.
1676 * For example, this may be returned if the feerate implies we cannot open a channel at the
1677 * requested value, but opening a larger channel would succeed.
1679 LDKAPIError_FeeRateTooHigh,
1681 * A malformed Route was provided (eg overflowed value, node id mismatch, overly-looped route,
1682 * too-many-hops, etc).
1684 LDKAPIError_InvalidRoute,
1686 * We were unable to complete the request as the Channel required to do so is unable to
1687 * complete the request (or was not found). This can take many forms, including disconnected
1688 * peer, channel at capacity, channel shutting down, etc.
1690 LDKAPIError_ChannelUnavailable,
1692 * An attempt to call [`chain::Watch::watch_channel`]/[`chain::Watch::update_channel`]
1693 * returned a [`ChannelMonitorUpdateStatus::InProgress`] indicating the persistence of a
1694 * monitor update is awaiting async resolution. Once it resolves the attempted action should
1695 * complete automatically.
1697 * [`chain::Watch::watch_channel`]: crate::chain::Watch::watch_channel
1698 * [`chain::Watch::update_channel`]: crate::chain::Watch::update_channel
1699 * [`ChannelMonitorUpdateStatus::InProgress`]: crate::chain::ChannelMonitorUpdateStatus::InProgress
1701 LDKAPIError_MonitorUpdateInProgress,
1703 * [`SignerProvider::get_shutdown_scriptpubkey`] returned a shutdown scriptpubkey incompatible
1704 * with the channel counterparty as negotiated in [`InitFeatures`].
1706 * Using a SegWit v0 script should resolve this issue. If you cannot, you won't be able to open
1707 * a channel or cooperatively close one with this peer (and will have to force-close instead).
1709 * [`SignerProvider::get_shutdown_scriptpubkey`]: crate::sign::SignerProvider::get_shutdown_scriptpubkey
1710 * [`InitFeatures`]: crate::ln::features::InitFeatures
1712 LDKAPIError_IncompatibleShutdownScript,
1714 * Must be last for serialization purposes
1716 LDKAPIError_Sentinel,
1719 typedef struct LDKAPIError_LDKAPIMisuseError_Body {
1721 * A human-readable error message
1724 } LDKAPIError_LDKAPIMisuseError_Body;
1726 typedef struct LDKAPIError_LDKFeeRateTooHigh_Body {
1728 * A human-readable error message
1732 * The feerate which was too high.
1735 } LDKAPIError_LDKFeeRateTooHigh_Body;
1737 typedef struct LDKAPIError_LDKInvalidRoute_Body {
1739 * A human-readable error message
1742 } LDKAPIError_LDKInvalidRoute_Body;
1744 typedef struct LDKAPIError_LDKChannelUnavailable_Body {
1746 * A human-readable error message
1749 } LDKAPIError_LDKChannelUnavailable_Body;
1751 typedef struct LDKAPIError_LDKIncompatibleShutdownScript_Body {
1753 * The incompatible shutdown script.
1755 struct LDKShutdownScript script;
1756 } LDKAPIError_LDKIncompatibleShutdownScript_Body;
1758 typedef struct MUST_USE_STRUCT LDKAPIError {
1759 LDKAPIError_Tag tag;
1761 LDKAPIError_LDKAPIMisuseError_Body api_misuse_error;
1762 LDKAPIError_LDKFeeRateTooHigh_Body fee_rate_too_high;
1763 LDKAPIError_LDKInvalidRoute_Body invalid_route;
1764 LDKAPIError_LDKChannelUnavailable_Body channel_unavailable;
1765 LDKAPIError_LDKIncompatibleShutdownScript_Body incompatible_shutdown_script;
1770 * The contents of CResult_NoneAPIErrorZ
1772 typedef union LDKCResult_NoneAPIErrorZPtr {
1774 * Note that this value is always NULL, as there are no contents in the OK variant
1778 * A pointer to the contents in the error state.
1779 * Reading from this pointer when `result_ok` is set is undefined.
1781 struct LDKAPIError *err;
1782 } LDKCResult_NoneAPIErrorZPtr;
1785 * A CResult_NoneAPIErrorZ represents the result of a fallible operation,
1786 * containing a () on success and a crate::lightning::util::errors::APIError on failure.
1787 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1789 typedef struct LDKCResult_NoneAPIErrorZ {
1791 * The contents of this CResult_NoneAPIErrorZ, accessible via either
1792 * `err` or `result` depending on the state of `result_ok`.
1794 union LDKCResult_NoneAPIErrorZPtr contents;
1796 * Whether this CResult_NoneAPIErrorZ represents a success state.
1799 } LDKCResult_NoneAPIErrorZ;
1802 * A dynamically-allocated array of crate::c_types::derived::CResult_NoneAPIErrorZs of arbitrary size.
1803 * This corresponds to std::vector in C++
1805 typedef struct LDKCVec_CResult_NoneAPIErrorZZ {
1807 * The elements in the array.
1808 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
1810 struct LDKCResult_NoneAPIErrorZ *data;
1812 * The number of elements pointed to by `data`.
1815 } LDKCVec_CResult_NoneAPIErrorZZ;
1818 * A dynamically-allocated array of crate::lightning::util::errors::APIErrors of arbitrary size.
1819 * This corresponds to std::vector in C++
1821 typedef struct LDKCVec_APIErrorZ {
1823 * The elements in the array.
1824 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
1826 struct LDKAPIError *data;
1828 * The number of elements pointed to by `data`.
1831 } LDKCVec_APIErrorZ;
1834 * An enum which can either contain a crate::c_types::ThirtyTwoBytes or not
1836 typedef enum LDKCOption_ThirtyTwoBytesZ_Tag {
1838 * When we're in this state, this COption_ThirtyTwoBytesZ contains a crate::c_types::ThirtyTwoBytes
1840 LDKCOption_ThirtyTwoBytesZ_Some,
1842 * When we're in this state, this COption_ThirtyTwoBytesZ contains nothing
1844 LDKCOption_ThirtyTwoBytesZ_None,
1846 * Must be last for serialization purposes
1848 LDKCOption_ThirtyTwoBytesZ_Sentinel,
1849 } LDKCOption_ThirtyTwoBytesZ_Tag;
1851 typedef struct LDKCOption_ThirtyTwoBytesZ {
1852 LDKCOption_ThirtyTwoBytesZ_Tag tag;
1855 struct LDKThirtyTwoBytes some;
1858 } LDKCOption_ThirtyTwoBytesZ;
1861 * An enum which can either contain a crate::c_types::derived::CVec_u8Z or not
1863 typedef enum LDKCOption_CVec_u8ZZ_Tag {
1865 * When we're in this state, this COption_CVec_u8ZZ contains a crate::c_types::derived::CVec_u8Z
1867 LDKCOption_CVec_u8ZZ_Some,
1869 * When we're in this state, this COption_CVec_u8ZZ contains nothing
1871 LDKCOption_CVec_u8ZZ_None,
1873 * Must be last for serialization purposes
1875 LDKCOption_CVec_u8ZZ_Sentinel,
1876 } LDKCOption_CVec_u8ZZ_Tag;
1878 typedef struct LDKCOption_CVec_u8ZZ {
1879 LDKCOption_CVec_u8ZZ_Tag tag;
1882 struct LDKCVec_u8Z some;
1885 } LDKCOption_CVec_u8ZZ;
1890 * Information which is provided, encrypted, to the payment recipient when sending HTLCs.
1892 * This should generally be constructed with data communicated to us from the recipient (via a
1893 * BOLT11 or BOLT12 invoice).
1895 typedef struct MUST_USE_STRUCT LDKRecipientOnionFields {
1897 * A pointer to the opaque Rust object.
1898 * Nearly everywhere, inner must be non-null, however in places where
1899 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1901 LDKnativeRecipientOnionFields *inner;
1903 * Indicates that this is the only struct which contains the same pointer.
1904 * Rust functions which take ownership of an object provided via an argument require
1905 * this to be true and invalidate the object pointed to by inner.
1908 } LDKRecipientOnionFields;
1911 * The contents of CResult_RecipientOnionFieldsDecodeErrorZ
1913 typedef union LDKCResult_RecipientOnionFieldsDecodeErrorZPtr {
1915 * A pointer to the contents in the success state.
1916 * Reading from this pointer when `result_ok` is not set is undefined.
1918 struct LDKRecipientOnionFields *result;
1920 * A pointer to the contents in the error state.
1921 * Reading from this pointer when `result_ok` is set is undefined.
1923 struct LDKDecodeError *err;
1924 } LDKCResult_RecipientOnionFieldsDecodeErrorZPtr;
1927 * A CResult_RecipientOnionFieldsDecodeErrorZ represents the result of a fallible operation,
1928 * containing a crate::lightning::ln::outbound_payment::RecipientOnionFields on success and a crate::lightning::ln::msgs::DecodeError on failure.
1929 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1931 typedef struct LDKCResult_RecipientOnionFieldsDecodeErrorZ {
1933 * The contents of this CResult_RecipientOnionFieldsDecodeErrorZ, accessible via either
1934 * `err` or `result` depending on the state of `result_ok`.
1936 union LDKCResult_RecipientOnionFieldsDecodeErrorZPtr contents;
1938 * Whether this CResult_RecipientOnionFieldsDecodeErrorZ represents a success state.
1941 } LDKCResult_RecipientOnionFieldsDecodeErrorZ;
1944 * A tuple of 2 elements. See the individual fields for the types contained.
1946 typedef struct LDKC2Tuple_u64CVec_u8ZZ {
1948 * The element at position 0
1952 * The element at position 1
1954 struct LDKCVec_u8Z b;
1955 } LDKC2Tuple_u64CVec_u8ZZ;
1958 * A dynamically-allocated array of crate::c_types::derived::C2Tuple_u64CVec_u8ZZs of arbitrary size.
1959 * This corresponds to std::vector in C++
1961 typedef struct LDKCVec_C2Tuple_u64CVec_u8ZZZ {
1963 * The elements in the array.
1964 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
1966 struct LDKC2Tuple_u64CVec_u8ZZ *data;
1968 * The number of elements pointed to by `data`.
1971 } LDKCVec_C2Tuple_u64CVec_u8ZZZ;
1974 * The contents of CResult_RecipientOnionFieldsNoneZ
1976 typedef union LDKCResult_RecipientOnionFieldsNoneZPtr {
1978 * A pointer to the contents in the success state.
1979 * Reading from this pointer when `result_ok` is not set is undefined.
1981 struct LDKRecipientOnionFields *result;
1983 * Note that this value is always NULL, as there are no contents in the Err variant
1986 } LDKCResult_RecipientOnionFieldsNoneZPtr;
1989 * A CResult_RecipientOnionFieldsNoneZ represents the result of a fallible operation,
1990 * containing a crate::lightning::ln::outbound_payment::RecipientOnionFields on success and a () on failure.
1991 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1993 typedef struct LDKCResult_RecipientOnionFieldsNoneZ {
1995 * The contents of this CResult_RecipientOnionFieldsNoneZ, accessible via either
1996 * `err` or `result` depending on the state of `result_ok`.
1998 union LDKCResult_RecipientOnionFieldsNoneZPtr contents;
2000 * Whether this CResult_RecipientOnionFieldsNoneZ represents a success state.
2003 } LDKCResult_RecipientOnionFieldsNoneZ;
2008 * A semantically valid [`Bolt12Invoice`] that hasn't been signed.
2012 * This is serialized as a TLV stream, which includes TLV records from the originating message. As
2013 * such, it may include unknown, odd TLV records.
2015 typedef struct MUST_USE_STRUCT LDKUnsignedBolt12Invoice {
2017 * A pointer to the opaque Rust object.
2018 * Nearly everywhere, inner must be non-null, however in places where
2019 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2021 LDKnativeUnsignedBolt12Invoice *inner;
2023 * Indicates that this is the only struct which contains the same pointer.
2024 * Rust functions which take ownership of an object provided via an argument require
2025 * this to be true and invalidate the object pointed to by inner.
2028 } LDKUnsignedBolt12Invoice;
2031 * The contents of CResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ
2033 typedef union LDKCResult_UnsignedBolt12InvoiceBolt12SemanticErrorZPtr {
2035 * A pointer to the contents in the success state.
2036 * Reading from this pointer when `result_ok` is not set is undefined.
2038 struct LDKUnsignedBolt12Invoice *result;
2040 * A pointer to the contents in the error state.
2041 * Reading from this pointer when `result_ok` is set is undefined.
2043 enum LDKBolt12SemanticError *err;
2044 } LDKCResult_UnsignedBolt12InvoiceBolt12SemanticErrorZPtr;
2047 * A CResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ represents the result of a fallible operation,
2048 * containing a crate::lightning::offers::invoice::UnsignedBolt12Invoice on success and a crate::lightning::offers::parse::Bolt12SemanticError on failure.
2049 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
2051 typedef struct LDKCResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ {
2053 * The contents of this CResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ, accessible via either
2054 * `err` or `result` depending on the state of `result_ok`.
2056 union LDKCResult_UnsignedBolt12InvoiceBolt12SemanticErrorZPtr contents;
2058 * Whether this CResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ represents a success state.
2061 } LDKCResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ;
2066 * A `Bolt12Invoice` is a payment request, typically corresponding to an [`Offer`] or a [`Refund`].
2068 * An invoice may be sent in response to an [`InvoiceRequest`] in the case of an offer or sent
2069 * directly after scanning a refund. It includes all the information needed to pay a recipient.
2071 * [`Offer`]: crate::offers::offer::Offer
2072 * [`Refund`]: crate::offers::refund::Refund
2073 * [`InvoiceRequest`]: crate::offers::invoice_request::InvoiceRequest
2075 typedef struct MUST_USE_STRUCT LDKBolt12Invoice {
2077 * A pointer to the opaque Rust object.
2078 * Nearly everywhere, inner must be non-null, however in places where
2079 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2081 LDKnativeBolt12Invoice *inner;
2083 * Indicates that this is the only struct which contains the same pointer.
2084 * Rust functions which take ownership of an object provided via an argument require
2085 * this to be true and invalidate the object pointed to by inner.
2091 * The contents of CResult_Bolt12InvoiceBolt12SemanticErrorZ
2093 typedef union LDKCResult_Bolt12InvoiceBolt12SemanticErrorZPtr {
2095 * A pointer to the contents in the success state.
2096 * Reading from this pointer when `result_ok` is not set is undefined.
2098 struct LDKBolt12Invoice *result;
2100 * A pointer to the contents in the error state.
2101 * Reading from this pointer when `result_ok` is set is undefined.
2103 enum LDKBolt12SemanticError *err;
2104 } LDKCResult_Bolt12InvoiceBolt12SemanticErrorZPtr;
2107 * A CResult_Bolt12InvoiceBolt12SemanticErrorZ represents the result of a fallible operation,
2108 * containing a crate::lightning::offers::invoice::Bolt12Invoice on success and a crate::lightning::offers::parse::Bolt12SemanticError on failure.
2109 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
2111 typedef struct LDKCResult_Bolt12InvoiceBolt12SemanticErrorZ {
2113 * The contents of this CResult_Bolt12InvoiceBolt12SemanticErrorZ, accessible via either
2114 * `err` or `result` depending on the state of `result_ok`.
2116 union LDKCResult_Bolt12InvoiceBolt12SemanticErrorZPtr contents;
2118 * Whether this CResult_Bolt12InvoiceBolt12SemanticErrorZ represents a success state.
2121 } LDKCResult_Bolt12InvoiceBolt12SemanticErrorZ;
2124 * Represents a secp256k1 Schnorr signature serialized as two 32-byte numbers
2126 typedef struct LDKSchnorrSignature {
2128 * The bytes of the signature as two 32-byte numbers
2130 uint8_t compact_form[64];
2131 } LDKSchnorrSignature;
2134 * The contents of CResult_SchnorrSignatureNoneZ
2136 typedef union LDKCResult_SchnorrSignatureNoneZPtr {
2138 * A pointer to the contents in the success state.
2139 * Reading from this pointer when `result_ok` is not set is undefined.
2141 struct LDKSchnorrSignature *result;
2143 * Note that this value is always NULL, as there are no contents in the Err variant
2146 } LDKCResult_SchnorrSignatureNoneZPtr;
2149 * A CResult_SchnorrSignatureNoneZ represents the result of a fallible operation,
2150 * containing a crate::c_types::SchnorrSignature on success and a () on failure.
2151 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
2153 typedef struct LDKCResult_SchnorrSignatureNoneZ {
2155 * The contents of this CResult_SchnorrSignatureNoneZ, accessible via either
2156 * `err` or `result` depending on the state of `result_ok`.
2158 union LDKCResult_SchnorrSignatureNoneZPtr contents;
2160 * Whether this CResult_SchnorrSignatureNoneZ represents a success state.
2163 } LDKCResult_SchnorrSignatureNoneZ;
2166 * A dynamically-allocated array of crate::c_types::ThirtyTwoBytess of arbitrary size.
2167 * This corresponds to std::vector in C++
2169 typedef struct LDKCVec_ThirtyTwoBytesZ {
2171 * The elements in the array.
2172 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
2174 struct LDKThirtyTwoBytes *data;
2176 * The number of elements pointed to by `data`.
2179 } LDKCVec_ThirtyTwoBytesZ;
2182 * An enum which can either contain a crate::c_types::derived::CVec_ThirtyTwoBytesZ or not
2184 typedef enum LDKCOption_CVec_ThirtyTwoBytesZZ_Tag {
2186 * When we're in this state, this COption_CVec_ThirtyTwoBytesZZ contains a crate::c_types::derived::CVec_ThirtyTwoBytesZ
2188 LDKCOption_CVec_ThirtyTwoBytesZZ_Some,
2190 * When we're in this state, this COption_CVec_ThirtyTwoBytesZZ contains nothing
2192 LDKCOption_CVec_ThirtyTwoBytesZZ_None,
2194 * Must be last for serialization purposes
2196 LDKCOption_CVec_ThirtyTwoBytesZZ_Sentinel,
2197 } LDKCOption_CVec_ThirtyTwoBytesZZ_Tag;
2199 typedef struct LDKCOption_CVec_ThirtyTwoBytesZZ {
2200 LDKCOption_CVec_ThirtyTwoBytesZZ_Tag tag;
2203 struct LDKCVec_ThirtyTwoBytesZ some;
2206 } LDKCOption_CVec_ThirtyTwoBytesZZ;
2209 * A 3-byte byte array.
2211 typedef struct LDKThreeBytes {
2219 * The minimum amount required for an item in an [`Offer`], denominated in either bitcoin or
2222 typedef enum LDKAmount_Tag {
2224 * An amount of bitcoin.
2228 * An amount of currency specified using ISO 4712.
2232 * Must be last for serialization purposes
2237 typedef struct LDKAmount_LDKBitcoin_Body {
2239 * The amount in millisatoshi.
2241 uint64_t amount_msats;
2242 } LDKAmount_LDKBitcoin_Body;
2244 typedef struct LDKAmount_LDKCurrency_Body {
2246 * The currency that the amount is denominated in.
2248 struct LDKThreeBytes iso4217_code;
2250 * The amount in the currency unit adjusted by the ISO 4712 exponent (e.g., USD cents).
2253 } LDKAmount_LDKCurrency_Body;
2255 typedef struct MUST_USE_STRUCT LDKAmount {
2258 LDKAmount_LDKBitcoin_Body bitcoin;
2259 LDKAmount_LDKCurrency_Body currency;
2264 * An enum which can either contain a crate::lightning::offers::offer::Amount or not
2266 typedef enum LDKCOption_AmountZ_Tag {
2268 * When we're in this state, this COption_AmountZ contains a crate::lightning::offers::offer::Amount
2270 LDKCOption_AmountZ_Some,
2272 * When we're in this state, this COption_AmountZ contains nothing
2274 LDKCOption_AmountZ_None,
2276 * Must be last for serialization purposes
2278 LDKCOption_AmountZ_Sentinel,
2279 } LDKCOption_AmountZ_Tag;
2281 typedef struct LDKCOption_AmountZ {
2282 LDKCOption_AmountZ_Tag tag;
2285 struct LDKAmount some;
2288 } LDKCOption_AmountZ;
2291 * Quantity of items supported by an [`Offer`].
2293 typedef enum LDKQuantity_Tag {
2295 * Up to a specific number of items (inclusive). Use when more than one item can be requested
2296 * but is limited (e.g., because of per customer or inventory limits).
2298 * May be used with `NonZeroU64::new(1)` but prefer to use [`Quantity::One`] if only one item
2301 LDKQuantity_Bounded,
2303 * One or more items. Use when more than one item can be requested without any limit.
2305 LDKQuantity_Unbounded,
2307 * Only one item. Use when only a single item can be requested.
2311 * Must be last for serialization purposes
2313 LDKQuantity_Sentinel,
2316 typedef struct MUST_USE_STRUCT LDKQuantity {
2317 LDKQuantity_Tag tag;
2326 * An enum which can either contain a crate::lightning::offers::offer::Quantity or not
2328 typedef enum LDKCOption_QuantityZ_Tag {
2330 * When we're in this state, this COption_QuantityZ contains a crate::lightning::offers::offer::Quantity
2332 LDKCOption_QuantityZ_Some,
2334 * When we're in this state, this COption_QuantityZ contains nothing
2336 LDKCOption_QuantityZ_None,
2338 * Must be last for serialization purposes
2340 LDKCOption_QuantityZ_Sentinel,
2341 } LDKCOption_QuantityZ_Tag;
2343 typedef struct LDKCOption_QuantityZ {
2344 LDKCOption_QuantityZ_Tag tag;
2347 struct LDKQuantity some;
2350 } LDKCOption_QuantityZ;
2353 * The contents of CResult_ThirtyTwoBytesNoneZ
2355 typedef union LDKCResult_ThirtyTwoBytesNoneZPtr {
2357 * A pointer to the contents in the success state.
2358 * Reading from this pointer when `result_ok` is not set is undefined.
2360 struct LDKThirtyTwoBytes *result;
2362 * Note that this value is always NULL, as there are no contents in the Err variant
2365 } LDKCResult_ThirtyTwoBytesNoneZPtr;
2368 * A CResult_ThirtyTwoBytesNoneZ represents the result of a fallible operation,
2369 * containing a crate::c_types::ThirtyTwoBytes on success and a () on failure.
2370 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
2372 typedef struct LDKCResult_ThirtyTwoBytesNoneZ {
2374 * The contents of this CResult_ThirtyTwoBytesNoneZ, accessible via either
2375 * `err` or `result` depending on the state of `result_ok`.
2377 union LDKCResult_ThirtyTwoBytesNoneZPtr contents;
2379 * Whether this CResult_ThirtyTwoBytesNoneZ represents a success state.
2382 } LDKCResult_ThirtyTwoBytesNoneZ;
2387 * Information needed to route a payment across a [`BlindedPath`].
2389 typedef struct MUST_USE_STRUCT LDKBlindedPayInfo {
2391 * A pointer to the opaque Rust object.
2392 * Nearly everywhere, inner must be non-null, however in places where
2393 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2395 LDKnativeBlindedPayInfo *inner;
2397 * Indicates that this is the only struct which contains the same pointer.
2398 * Rust functions which take ownership of an object provided via an argument require
2399 * this to be true and invalidate the object pointed to by inner.
2402 } LDKBlindedPayInfo;
2405 * The contents of CResult_BlindedPayInfoDecodeErrorZ
2407 typedef union LDKCResult_BlindedPayInfoDecodeErrorZPtr {
2409 * A pointer to the contents in the success state.
2410 * Reading from this pointer when `result_ok` is not set is undefined.
2412 struct LDKBlindedPayInfo *result;
2414 * A pointer to the contents in the error state.
2415 * Reading from this pointer when `result_ok` is set is undefined.
2417 struct LDKDecodeError *err;
2418 } LDKCResult_BlindedPayInfoDecodeErrorZPtr;
2421 * A CResult_BlindedPayInfoDecodeErrorZ represents the result of a fallible operation,
2422 * containing a crate::lightning::offers::invoice::BlindedPayInfo on success and a crate::lightning::ln::msgs::DecodeError on failure.
2423 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
2425 typedef struct LDKCResult_BlindedPayInfoDecodeErrorZ {
2427 * The contents of this CResult_BlindedPayInfoDecodeErrorZ, accessible via either
2428 * `err` or `result` depending on the state of `result_ok`.
2430 union LDKCResult_BlindedPayInfoDecodeErrorZPtr contents;
2432 * Whether this CResult_BlindedPayInfoDecodeErrorZ represents a success state.
2435 } LDKCResult_BlindedPayInfoDecodeErrorZ;
2440 * Information about a spendable output to a P2WSH script.
2442 * See [`SpendableOutputDescriptor::DelayedPaymentOutput`] for more details on how to spend this.
2444 typedef struct MUST_USE_STRUCT LDKDelayedPaymentOutputDescriptor {
2446 * A pointer to the opaque Rust object.
2447 * Nearly everywhere, inner must be non-null, however in places where
2448 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2450 LDKnativeDelayedPaymentOutputDescriptor *inner;
2452 * Indicates that this is the only struct which contains the same pointer.
2453 * Rust functions which take ownership of an object provided via an argument require
2454 * this to be true and invalidate the object pointed to by inner.
2457 } LDKDelayedPaymentOutputDescriptor;
2460 * The contents of CResult_DelayedPaymentOutputDescriptorDecodeErrorZ
2462 typedef union LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZPtr {
2464 * A pointer to the contents in the success state.
2465 * Reading from this pointer when `result_ok` is not set is undefined.
2467 struct LDKDelayedPaymentOutputDescriptor *result;
2469 * A pointer to the contents in the error state.
2470 * Reading from this pointer when `result_ok` is set is undefined.
2472 struct LDKDecodeError *err;
2473 } LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZPtr;
2476 * A CResult_DelayedPaymentOutputDescriptorDecodeErrorZ represents the result of a fallible operation,
2477 * containing a crate::lightning::sign::DelayedPaymentOutputDescriptor on success and a crate::lightning::ln::msgs::DecodeError on failure.
2478 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
2480 typedef struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ {
2482 * The contents of this CResult_DelayedPaymentOutputDescriptorDecodeErrorZ, accessible via either
2483 * `err` or `result` depending on the state of `result_ok`.
2485 union LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZPtr contents;
2487 * Whether this CResult_DelayedPaymentOutputDescriptorDecodeErrorZ represents a success state.
2490 } LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ;
2495 * Information about a spendable output to our \"payment key\".
2497 * See [`SpendableOutputDescriptor::StaticPaymentOutput`] for more details on how to spend this.
2499 typedef struct MUST_USE_STRUCT LDKStaticPaymentOutputDescriptor {
2501 * A pointer to the opaque Rust object.
2502 * Nearly everywhere, inner must be non-null, however in places where
2503 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2505 LDKnativeStaticPaymentOutputDescriptor *inner;
2507 * Indicates that this is the only struct which contains the same pointer.
2508 * Rust functions which take ownership of an object provided via an argument require
2509 * this to be true and invalidate the object pointed to by inner.
2512 } LDKStaticPaymentOutputDescriptor;
2515 * The contents of CResult_StaticPaymentOutputDescriptorDecodeErrorZ
2517 typedef union LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZPtr {
2519 * A pointer to the contents in the success state.
2520 * Reading from this pointer when `result_ok` is not set is undefined.
2522 struct LDKStaticPaymentOutputDescriptor *result;
2524 * A pointer to the contents in the error state.
2525 * Reading from this pointer when `result_ok` is set is undefined.
2527 struct LDKDecodeError *err;
2528 } LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZPtr;
2531 * A CResult_StaticPaymentOutputDescriptorDecodeErrorZ represents the result of a fallible operation,
2532 * containing a crate::lightning::sign::StaticPaymentOutputDescriptor on success and a crate::lightning::ln::msgs::DecodeError on failure.
2533 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
2535 typedef struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ {
2537 * The contents of this CResult_StaticPaymentOutputDescriptorDecodeErrorZ, accessible via either
2538 * `err` or `result` depending on the state of `result_ok`.
2540 union LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZPtr contents;
2542 * Whether this CResult_StaticPaymentOutputDescriptorDecodeErrorZ represents a success state.
2545 } LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ;
2550 * A reference to a transaction output.
2552 * Differs from bitcoin::blockdata::transaction::OutPoint as the index is a u16 instead of u32
2553 * due to LN's restrictions on index values. Should reduce (possibly) unsafe conversions this way.
2555 typedef struct MUST_USE_STRUCT LDKOutPoint {
2557 * A pointer to the opaque Rust object.
2558 * Nearly everywhere, inner must be non-null, however in places where
2559 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2561 LDKnativeOutPoint *inner;
2563 * Indicates that this is the only struct which contains the same pointer.
2564 * Rust functions which take ownership of an object provided via an argument require
2565 * this to be true and invalidate the object pointed to by inner.
2571 * Describes the necessary information to spend a spendable output.
2573 * When on-chain outputs are created by LDK (which our counterparty is not able to claim at any
2574 * point in the future) a [`SpendableOutputs`] event is generated which you must track and be able
2575 * to spend on-chain. The information needed to do this is provided in this enum, including the
2576 * outpoint describing which `txid` and output `index` is available, the full output which exists
2577 * at that `txid`/`index`, and any keys or other information required to sign.
2579 * [`SpendableOutputs`]: crate::events::Event::SpendableOutputs
2581 typedef enum LDKSpendableOutputDescriptor_Tag {
2583 * An output to a script which was provided via [`SignerProvider`] directly, either from
2584 * [`get_destination_script`] or [`get_shutdown_scriptpubkey`], thus you should already
2585 * know how to spend it. No secret keys are provided as LDK was never given any key.
2586 * These may include outputs from a transaction punishing our counterparty or claiming an HTLC
2587 * on-chain using the payment preimage or after it has timed out.
2589 * [`get_shutdown_scriptpubkey`]: SignerProvider::get_shutdown_scriptpubkey
2590 * [`get_destination_script`]: SignerProvider::get_shutdown_scriptpubkey
2592 LDKSpendableOutputDescriptor_StaticOutput,
2594 * An output to a P2WSH script which can be spent with a single signature after an `OP_CSV`
2597 * The witness in the spending input should be:
2599 * <BIP 143 signature> <empty vector> (MINIMALIF standard rule) <provided witnessScript>
2602 * Note that the `nSequence` field in the spending input must be set to
2603 * [`DelayedPaymentOutputDescriptor::to_self_delay`] (which means the transaction is not
2604 * broadcastable until at least [`DelayedPaymentOutputDescriptor::to_self_delay`] blocks after
2605 * the outpoint confirms, see [BIP
2606 * 68](https://github.com/bitcoin/bips/blob/master/bip-0068.mediawiki)). Also note that LDK
2607 * won't generate a [`SpendableOutputDescriptor`] until the corresponding block height
2610 * These are generally the result of a \"revocable\" output to us, spendable only by us unless
2611 * it is an output from an old state which we broadcast (which should never happen).
2613 * To derive the delayed payment key which is used to sign this input, you must pass the
2614 * holder [`InMemorySigner::delayed_payment_base_key`] (i.e., the private key which corresponds to the
2615 * [`ChannelPublicKeys::delayed_payment_basepoint`] in [`ChannelSigner::pubkeys`]) and the provided
2616 * [`DelayedPaymentOutputDescriptor::per_commitment_point`] to [`chan_utils::derive_private_key`]. The DelayedPaymentKey can be
2617 * generated without the secret key using [`DelayedPaymentKey::from_basepoint`] and only the
2618 * [`ChannelPublicKeys::delayed_payment_basepoint`] which appears in [`ChannelSigner::pubkeys`].
2620 * To derive the [`DelayedPaymentOutputDescriptor::revocation_pubkey`] provided here (which is
2621 * used in the witness script generation), you must pass the counterparty
2622 * [`ChannelPublicKeys::revocation_basepoint`] (which appears in the call to
2623 * [`ChannelSigner::provide_channel_parameters`]) and the provided
2624 * [`DelayedPaymentOutputDescriptor::per_commitment_point`] to
2625 * [`RevocationKey`].
2627 * The witness script which is hashed and included in the output `script_pubkey` may be
2628 * regenerated by passing the [`DelayedPaymentOutputDescriptor::revocation_pubkey`] (derived
2629 * as explained above), our delayed payment pubkey (derived as explained above), and the
2630 * [`DelayedPaymentOutputDescriptor::to_self_delay`] contained here to
2631 * [`chan_utils::get_revokeable_redeemscript`].
2633 LDKSpendableOutputDescriptor_DelayedPaymentOutput,
2635 * An output spendable exclusively by our payment key (i.e., the private key that corresponds
2636 * to the `payment_point` in [`ChannelSigner::pubkeys`]). The output type depends on the
2637 * channel type negotiated.
2639 * On an anchor outputs channel, the witness in the spending input is:
2641 * <BIP 143 signature> <witness script>
2646 * <BIP 143 signature> <payment key>
2649 * These are generally the result of our counterparty having broadcast the current state,
2650 * allowing us to claim the non-HTLC-encumbered outputs immediately, or after one confirmation
2651 * in the case of anchor outputs channels.
2653 LDKSpendableOutputDescriptor_StaticPaymentOutput,
2655 * Must be last for serialization purposes
2657 LDKSpendableOutputDescriptor_Sentinel,
2658 } LDKSpendableOutputDescriptor_Tag;
2660 typedef struct LDKSpendableOutputDescriptor_LDKStaticOutput_Body {
2662 * The outpoint which is spendable.
2664 struct LDKOutPoint outpoint;
2666 * The output which is referenced by the given outpoint.
2668 struct LDKTxOut output;
2670 * The `channel_keys_id` for the channel which this output came from.
2672 * For channels which were generated on LDK 0.0.119 or later, this is the value which was
2673 * passed to the [`SignerProvider::get_destination_script`] call which provided this
2676 * For channels which were generated prior to LDK 0.0.119, no such argument existed,
2677 * however this field may still be filled in if such data is available.
2679 * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
2681 struct LDKThirtyTwoBytes channel_keys_id;
2682 } LDKSpendableOutputDescriptor_LDKStaticOutput_Body;
2684 typedef struct MUST_USE_STRUCT LDKSpendableOutputDescriptor {
2685 LDKSpendableOutputDescriptor_Tag tag;
2687 LDKSpendableOutputDescriptor_LDKStaticOutput_Body static_output;
2689 struct LDKDelayedPaymentOutputDescriptor delayed_payment_output;
2692 struct LDKStaticPaymentOutputDescriptor static_payment_output;
2695 } LDKSpendableOutputDescriptor;
2698 * The contents of CResult_SpendableOutputDescriptorDecodeErrorZ
2700 typedef union LDKCResult_SpendableOutputDescriptorDecodeErrorZPtr {
2702 * A pointer to the contents in the success state.
2703 * Reading from this pointer when `result_ok` is not set is undefined.
2705 struct LDKSpendableOutputDescriptor *result;
2707 * A pointer to the contents in the error state.
2708 * Reading from this pointer when `result_ok` is set is undefined.
2710 struct LDKDecodeError *err;
2711 } LDKCResult_SpendableOutputDescriptorDecodeErrorZPtr;
2714 * A CResult_SpendableOutputDescriptorDecodeErrorZ represents the result of a fallible operation,
2715 * containing a crate::lightning::sign::SpendableOutputDescriptor on success and a crate::lightning::ln::msgs::DecodeError on failure.
2716 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
2718 typedef struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ {
2720 * The contents of this CResult_SpendableOutputDescriptorDecodeErrorZ, accessible via either
2721 * `err` or `result` depending on the state of `result_ok`.
2723 union LDKCResult_SpendableOutputDescriptorDecodeErrorZPtr contents;
2725 * Whether this CResult_SpendableOutputDescriptorDecodeErrorZ represents a success state.
2728 } LDKCResult_SpendableOutputDescriptorDecodeErrorZ;
2731 * A dynamically-allocated array of crate::lightning::sign::SpendableOutputDescriptors of arbitrary size.
2732 * This corresponds to std::vector in C++
2734 typedef struct LDKCVec_SpendableOutputDescriptorZ {
2736 * The elements in the array.
2737 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
2739 struct LDKSpendableOutputDescriptor *data;
2741 * The number of elements pointed to by `data`.
2744 } LDKCVec_SpendableOutputDescriptorZ;
2747 * A dynamically-allocated array of crate::c_types::TxOuts of arbitrary size.
2748 * This corresponds to std::vector in C++
2750 typedef struct LDKCVec_TxOutZ {
2752 * The elements in the array.
2753 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
2755 struct LDKTxOut *data;
2757 * The number of elements pointed to by `data`.
2763 * An enum which can either contain a u32 or not
2765 typedef enum LDKCOption_u32Z_Tag {
2767 * When we're in this state, this COption_u32Z contains a u32
2769 LDKCOption_u32Z_Some,
2771 * When we're in this state, this COption_u32Z contains nothing
2773 LDKCOption_u32Z_None,
2775 * Must be last for serialization purposes
2777 LDKCOption_u32Z_Sentinel,
2778 } LDKCOption_u32Z_Tag;
2780 typedef struct LDKCOption_u32Z {
2781 LDKCOption_u32Z_Tag tag;
2790 * A tuple of 2 elements. See the individual fields for the types contained.
2792 typedef struct LDKC2Tuple_CVec_u8Zu64Z {
2794 * The element at position 0
2796 struct LDKCVec_u8Z a;
2798 * The element at position 1
2801 } LDKC2Tuple_CVec_u8Zu64Z;
2804 * The contents of CResult_C2Tuple_CVec_u8Zu64ZNoneZ
2806 typedef union LDKCResult_C2Tuple_CVec_u8Zu64ZNoneZPtr {
2808 * A pointer to the contents in the success state.
2809 * Reading from this pointer when `result_ok` is not set is undefined.
2811 struct LDKC2Tuple_CVec_u8Zu64Z *result;
2813 * Note that this value is always NULL, as there are no contents in the Err variant
2816 } LDKCResult_C2Tuple_CVec_u8Zu64ZNoneZPtr;
2819 * A CResult_C2Tuple_CVec_u8Zu64ZNoneZ represents the result of a fallible operation,
2820 * containing a crate::c_types::derived::C2Tuple_CVec_u8Zu64Z on success and a () on failure.
2821 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
2823 typedef struct LDKCResult_C2Tuple_CVec_u8Zu64ZNoneZ {
2825 * The contents of this CResult_C2Tuple_CVec_u8Zu64ZNoneZ, accessible via either
2826 * `err` or `result` depending on the state of `result_ok`.
2828 union LDKCResult_C2Tuple_CVec_u8Zu64ZNoneZPtr contents;
2830 * Whether this CResult_C2Tuple_CVec_u8Zu64ZNoneZ represents a success state.
2833 } LDKCResult_C2Tuple_CVec_u8Zu64ZNoneZ;
2838 * The parameters required to derive a channel signer via [`SignerProvider`].
2840 typedef struct MUST_USE_STRUCT LDKChannelDerivationParameters {
2842 * A pointer to the opaque Rust object.
2843 * Nearly everywhere, inner must be non-null, however in places where
2844 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2846 LDKnativeChannelDerivationParameters *inner;
2848 * Indicates that this is the only struct which contains the same pointer.
2849 * Rust functions which take ownership of an object provided via an argument require
2850 * this to be true and invalidate the object pointed to by inner.
2853 } LDKChannelDerivationParameters;
2856 * The contents of CResult_ChannelDerivationParametersDecodeErrorZ
2858 typedef union LDKCResult_ChannelDerivationParametersDecodeErrorZPtr {
2860 * A pointer to the contents in the success state.
2861 * Reading from this pointer when `result_ok` is not set is undefined.
2863 struct LDKChannelDerivationParameters *result;
2865 * A pointer to the contents in the error state.
2866 * Reading from this pointer when `result_ok` is set is undefined.
2868 struct LDKDecodeError *err;
2869 } LDKCResult_ChannelDerivationParametersDecodeErrorZPtr;
2872 * A CResult_ChannelDerivationParametersDecodeErrorZ represents the result of a fallible operation,
2873 * containing a crate::lightning::sign::ChannelDerivationParameters on success and a crate::lightning::ln::msgs::DecodeError on failure.
2874 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
2876 typedef struct LDKCResult_ChannelDerivationParametersDecodeErrorZ {
2878 * The contents of this CResult_ChannelDerivationParametersDecodeErrorZ, accessible via either
2879 * `err` or `result` depending on the state of `result_ok`.
2881 union LDKCResult_ChannelDerivationParametersDecodeErrorZPtr contents;
2883 * Whether this CResult_ChannelDerivationParametersDecodeErrorZ represents a success state.
2886 } LDKCResult_ChannelDerivationParametersDecodeErrorZ;
2891 * A descriptor used to sign for a commitment transaction's HTLC output.
2893 typedef struct MUST_USE_STRUCT LDKHTLCDescriptor {
2895 * A pointer to the opaque Rust object.
2896 * Nearly everywhere, inner must be non-null, however in places where
2897 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2899 LDKnativeHTLCDescriptor *inner;
2901 * Indicates that this is the only struct which contains the same pointer.
2902 * Rust functions which take ownership of an object provided via an argument require
2903 * this to be true and invalidate the object pointed to by inner.
2906 } LDKHTLCDescriptor;
2909 * The contents of CResult_HTLCDescriptorDecodeErrorZ
2911 typedef union LDKCResult_HTLCDescriptorDecodeErrorZPtr {
2913 * A pointer to the contents in the success state.
2914 * Reading from this pointer when `result_ok` is not set is undefined.
2916 struct LDKHTLCDescriptor *result;
2918 * A pointer to the contents in the error state.
2919 * Reading from this pointer when `result_ok` is set is undefined.
2921 struct LDKDecodeError *err;
2922 } LDKCResult_HTLCDescriptorDecodeErrorZPtr;
2925 * A CResult_HTLCDescriptorDecodeErrorZ represents the result of a fallible operation,
2926 * containing a crate::lightning::sign::HTLCDescriptor on success and a crate::lightning::ln::msgs::DecodeError on failure.
2927 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
2929 typedef struct LDKCResult_HTLCDescriptorDecodeErrorZ {
2931 * The contents of this CResult_HTLCDescriptorDecodeErrorZ, accessible via either
2932 * `err` or `result` depending on the state of `result_ok`.
2934 union LDKCResult_HTLCDescriptorDecodeErrorZPtr contents;
2936 * Whether this CResult_HTLCDescriptorDecodeErrorZ represents a success state.
2939 } LDKCResult_HTLCDescriptorDecodeErrorZ;
2942 * The contents of CResult_NoneNoneZ
2944 typedef union LDKCResult_NoneNoneZPtr {
2946 * Note that this value is always NULL, as there are no contents in the OK variant
2950 * Note that this value is always NULL, as there are no contents in the Err variant
2953 } LDKCResult_NoneNoneZPtr;
2956 * A CResult_NoneNoneZ represents the result of a fallible operation,
2957 * containing a () on success and a () on failure.
2958 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
2960 typedef struct LDKCResult_NoneNoneZ {
2962 * The contents of this CResult_NoneNoneZ, accessible via either
2963 * `err` or `result` depending on the state of `result_ok`.
2965 union LDKCResult_NoneNoneZPtr contents;
2967 * Whether this CResult_NoneNoneZ represents a success state.
2970 } LDKCResult_NoneNoneZ;
2973 * Represents a valid secp256k1 public key serialized in "compressed form" as a 33 byte array.
2975 typedef struct LDKPublicKey {
2977 * The bytes of the public key
2979 uint8_t compressed_form[33];
2983 * The contents of CResult_PublicKeyNoneZ
2985 typedef union LDKCResult_PublicKeyNoneZPtr {
2987 * A pointer to the contents in the success state.
2988 * Reading from this pointer when `result_ok` is not set is undefined.
2990 struct LDKPublicKey *result;
2992 * Note that this value is always NULL, as there are no contents in the Err variant
2995 } LDKCResult_PublicKeyNoneZPtr;
2998 * A CResult_PublicKeyNoneZ represents the result of a fallible operation,
2999 * containing a crate::c_types::PublicKey on success and a () on failure.
3000 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
3002 typedef struct LDKCResult_PublicKeyNoneZ {
3004 * The contents of this CResult_PublicKeyNoneZ, accessible via either
3005 * `err` or `result` depending on the state of `result_ok`.
3007 union LDKCResult_PublicKeyNoneZPtr contents;
3009 * Whether this CResult_PublicKeyNoneZ represents a success state.
3012 } LDKCResult_PublicKeyNoneZ;
3015 * An enum which can either contain a crate::c_types::BigEndianScalar or not
3017 typedef enum LDKCOption_BigEndianScalarZ_Tag {
3019 * When we're in this state, this COption_BigEndianScalarZ contains a crate::c_types::BigEndianScalar
3021 LDKCOption_BigEndianScalarZ_Some,
3023 * When we're in this state, this COption_BigEndianScalarZ contains nothing
3025 LDKCOption_BigEndianScalarZ_None,
3027 * Must be last for serialization purposes
3029 LDKCOption_BigEndianScalarZ_Sentinel,
3030 } LDKCOption_BigEndianScalarZ_Tag;
3032 typedef struct LDKCOption_BigEndianScalarZ {
3033 LDKCOption_BigEndianScalarZ_Tag tag;
3036 struct LDKBigEndianScalar some;
3039 } LDKCOption_BigEndianScalarZ;
3042 * Integer in the range `0..32`
3044 typedef struct LDKU5 {
3049 * A dynamically-allocated array of crate::c_types::U5s of arbitrary size.
3050 * This corresponds to std::vector in C++
3052 typedef struct LDKCVec_U5Z {
3054 * The elements in the array.
3055 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
3059 * The number of elements pointed to by `data`.
3065 * Represents a secp256k1 signature serialized as two 32-byte numbers as well as a tag which
3066 * allows recovering the exact public key which created the signature given the message.
3068 typedef struct LDKRecoverableSignature {
3070 * The bytes of the signature in "compact" form plus a "Recovery ID" which allows for
3073 uint8_t serialized_form[68];
3074 } LDKRecoverableSignature;
3077 * The contents of CResult_RecoverableSignatureNoneZ
3079 typedef union LDKCResult_RecoverableSignatureNoneZPtr {
3081 * A pointer to the contents in the success state.
3082 * Reading from this pointer when `result_ok` is not set is undefined.
3084 struct LDKRecoverableSignature *result;
3086 * Note that this value is always NULL, as there are no contents in the Err variant
3089 } LDKCResult_RecoverableSignatureNoneZPtr;
3092 * A CResult_RecoverableSignatureNoneZ represents the result of a fallible operation,
3093 * containing a crate::c_types::RecoverableSignature on success and a () on failure.
3094 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
3096 typedef struct LDKCResult_RecoverableSignatureNoneZ {
3098 * The contents of this CResult_RecoverableSignatureNoneZ, accessible via either
3099 * `err` or `result` depending on the state of `result_ok`.
3101 union LDKCResult_RecoverableSignatureNoneZPtr contents;
3103 * Whether this CResult_RecoverableSignatureNoneZ represents a success state.
3106 } LDKCResult_RecoverableSignatureNoneZ;
3109 * Represents a secp256k1 ECDSA signature serialized as two 32-byte numbers
3111 typedef struct LDKECDSASignature {
3113 * The bytes of the signature in "compact" form
3115 uint8_t compact_form[64];
3116 } LDKECDSASignature;
3119 * The contents of CResult_ECDSASignatureNoneZ
3121 typedef union LDKCResult_ECDSASignatureNoneZPtr {
3123 * A pointer to the contents in the success state.
3124 * Reading from this pointer when `result_ok` is not set is undefined.
3126 struct LDKECDSASignature *result;
3128 * Note that this value is always NULL, as there are no contents in the Err variant
3131 } LDKCResult_ECDSASignatureNoneZPtr;
3134 * A CResult_ECDSASignatureNoneZ represents the result of a fallible operation,
3135 * containing a crate::c_types::ECDSASignature on success and a () on failure.
3136 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
3138 typedef struct LDKCResult_ECDSASignatureNoneZ {
3140 * The contents of this CResult_ECDSASignatureNoneZ, accessible via either
3141 * `err` or `result` depending on the state of `result_ok`.
3143 union LDKCResult_ECDSASignatureNoneZPtr contents;
3145 * Whether this CResult_ECDSASignatureNoneZ represents a success state.
3148 } LDKCResult_ECDSASignatureNoneZ;
3151 * The contents of CResult_TransactionNoneZ
3153 typedef union LDKCResult_TransactionNoneZPtr {
3155 * A pointer to the contents in the success state.
3156 * Reading from this pointer when `result_ok` is not set is undefined.
3158 struct LDKTransaction *result;
3160 * Note that this value is always NULL, as there are no contents in the Err variant
3163 } LDKCResult_TransactionNoneZPtr;
3166 * A CResult_TransactionNoneZ represents the result of a fallible operation,
3167 * containing a crate::c_types::Transaction on success and a () on failure.
3168 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
3170 typedef struct LDKCResult_TransactionNoneZ {
3172 * The contents of this CResult_TransactionNoneZ, accessible via either
3173 * `err` or `result` depending on the state of `result_ok`.
3175 union LDKCResult_TransactionNoneZPtr contents;
3177 * Whether this CResult_TransactionNoneZ represents a success state.
3180 } LDKCResult_TransactionNoneZ;
3183 * A dynamically-allocated array of crate::c_types::ECDSASignatures of arbitrary size.
3184 * This corresponds to std::vector in C++
3186 typedef struct LDKCVec_ECDSASignatureZ {
3188 * The elements in the array.
3189 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
3191 struct LDKECDSASignature *data;
3193 * The number of elements pointed to by `data`.
3196 } LDKCVec_ECDSASignatureZ;
3199 * A tuple of 2 elements. See the individual fields for the types contained.
3201 typedef struct LDKC2Tuple_ECDSASignatureCVec_ECDSASignatureZZ {
3203 * The element at position 0
3205 struct LDKECDSASignature a;
3207 * The element at position 1
3209 struct LDKCVec_ECDSASignatureZ b;
3210 } LDKC2Tuple_ECDSASignatureCVec_ECDSASignatureZZ;
3213 * The contents of CResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ
3215 typedef union LDKCResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZPtr {
3217 * A pointer to the contents in the success state.
3218 * Reading from this pointer when `result_ok` is not set is undefined.
3220 struct LDKC2Tuple_ECDSASignatureCVec_ECDSASignatureZZ *result;
3222 * Note that this value is always NULL, as there are no contents in the Err variant
3225 } LDKCResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZPtr;
3228 * A CResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ represents the result of a fallible operation,
3229 * containing a crate::c_types::derived::C2Tuple_ECDSASignatureCVec_ECDSASignatureZZ on success and a () on failure.
3230 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
3232 typedef struct LDKCResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ {
3234 * The contents of this CResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ, accessible via either
3235 * `err` or `result` depending on the state of `result_ok`.
3237 union LDKCResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZPtr contents;
3239 * Whether this CResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ represents a success state.
3242 } LDKCResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ;
3247 * This class tracks the per-transaction information needed to build a commitment transaction and will
3248 * actually build it and sign. It is used for holder transactions that we sign only when needed
3249 * and for transactions we sign for the counterparty.
3251 * This class can be used inside a signer implementation to generate a signature given the relevant
3254 typedef struct MUST_USE_STRUCT LDKCommitmentTransaction {
3256 * A pointer to the opaque Rust object.
3257 * Nearly everywhere, inner must be non-null, however in places where
3258 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3260 LDKnativeCommitmentTransaction *inner;
3262 * Indicates that this is the only struct which contains the same pointer.
3263 * Rust functions which take ownership of an object provided via an argument require
3264 * this to be true and invalidate the object pointed to by inner.
3267 } LDKCommitmentTransaction;
3272 * Information needed to build and sign a holder's commitment transaction.
3274 * The transaction is only signed once we are ready to broadcast.
3276 typedef struct MUST_USE_STRUCT LDKHolderCommitmentTransaction {
3278 * A pointer to the opaque Rust object.
3279 * Nearly everywhere, inner must be non-null, however in places where
3280 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3282 LDKnativeHolderCommitmentTransaction *inner;
3284 * Indicates that this is the only struct which contains the same pointer.
3285 * Rust functions which take ownership of an object provided via an argument require
3286 * this to be true and invalidate the object pointed to by inner.
3289 } LDKHolderCommitmentTransaction;
3294 * Information about an HTLC as it appears in a commitment transaction
3296 typedef struct MUST_USE_STRUCT LDKHTLCOutputInCommitment {
3298 * A pointer to the opaque Rust object.
3299 * Nearly everywhere, inner must be non-null, however in places where
3300 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3302 LDKnativeHTLCOutputInCommitment *inner;
3304 * Indicates that this is the only struct which contains the same pointer.
3305 * Rust functions which take ownership of an object provided via an argument require
3306 * this to be true and invalidate the object pointed to by inner.
3309 } LDKHTLCOutputInCommitment;
3314 * This class tracks the per-transaction information needed to build a closing transaction and will
3315 * actually build it and sign.
3317 * This class can be used inside a signer implementation to generate a signature given the relevant
3320 typedef struct MUST_USE_STRUCT LDKClosingTransaction {
3322 * A pointer to the opaque Rust object.
3323 * Nearly everywhere, inner must be non-null, however in places where
3324 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3326 LDKnativeClosingTransaction *inner;
3328 * Indicates that this is the only struct which contains the same pointer.
3329 * Rust functions which take ownership of an object provided via an argument require
3330 * this to be true and invalidate the object pointed to by inner.
3333 } LDKClosingTransaction;
3338 * The unsigned part of a [`channel_announcement`] message.
3340 * [`channel_announcement`]: https://github.com/lightning/bolts/blob/master/07-routing-gossip.md#the-channel_announcement-message
3342 typedef struct MUST_USE_STRUCT LDKUnsignedChannelAnnouncement {
3344 * A pointer to the opaque Rust object.
3345 * Nearly everywhere, inner must be non-null, however in places where
3346 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3348 LDKnativeUnsignedChannelAnnouncement *inner;
3350 * Indicates that this is the only struct which contains the same pointer.
3351 * Rust functions which take ownership of an object provided via an argument require
3352 * this to be true and invalidate the object pointed to by inner.
3355 } LDKUnsignedChannelAnnouncement;
3360 * One counterparty's public keys which do not change over the life of a channel.
3362 typedef struct MUST_USE_STRUCT LDKChannelPublicKeys {
3364 * A pointer to the opaque Rust object.
3365 * Nearly everywhere, inner must be non-null, however in places where
3366 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3368 LDKnativeChannelPublicKeys *inner;
3370 * Indicates that this is the only struct which contains the same pointer.
3371 * Rust functions which take ownership of an object provided via an argument require
3372 * this to be true and invalidate the object pointed to by inner.
3375 } LDKChannelPublicKeys;
3380 * Per-channel data used to build transactions in conjunction with the per-commitment data (CommitmentTransaction).
3381 * The fields are organized by holder/counterparty.
3383 * Normally, this is converted to the broadcaster/countersignatory-organized DirectedChannelTransactionParameters
3384 * before use, via the as_holder_broadcastable and as_counterparty_broadcastable functions.
3386 typedef struct MUST_USE_STRUCT LDKChannelTransactionParameters {
3388 * A pointer to the opaque Rust object.
3389 * Nearly everywhere, inner must be non-null, however in places where
3390 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3392 LDKnativeChannelTransactionParameters *inner;
3394 * Indicates that this is the only struct which contains the same pointer.
3395 * Rust functions which take ownership of an object provided via an argument require
3396 * this to be true and invalidate the object pointed to by inner.
3399 } LDKChannelTransactionParameters;
3402 * A trait to handle Lightning channel key material without concretizing the channel type or
3403 * the signature mechanism.
3405 typedef struct LDKChannelSigner {
3407 * An opaque pointer which is passed to your function implementations as an argument.
3408 * This has no meaning in the LDK, and can be NULL or any other value.
3412 * Gets the per-commitment point for a specific commitment number
3414 * Note that the commitment number starts at `(1 << 48) - 1` and counts backwards.
3416 struct LDKPublicKey (*get_per_commitment_point)(const void *this_arg, uint64_t idx);
3418 * Gets the commitment secret for a specific commitment number as part of the revocation process
3420 * An external signer implementation should error here if the commitment was already signed
3421 * and should refuse to sign it in the future.
3423 * May be called more than once for the same index.
3425 * Note that the commitment number starts at `(1 << 48) - 1` and counts backwards.
3427 struct LDKThirtyTwoBytes (*release_commitment_secret)(const void *this_arg, uint64_t idx);
3429 * Validate the counterparty's signatures on the holder commitment transaction and HTLCs.
3431 * This is required in order for the signer to make sure that releasing a commitment
3432 * secret won't leave us without a broadcastable holder transaction.
3433 * Policy checks should be implemented in this function, including checking the amount
3434 * sent to us and checking the HTLCs.
3436 * The preimages of outbound HTLCs that were fulfilled since the last commitment are provided.
3437 * A validating signer should ensure that an HTLC output is removed only when the matching
3438 * preimage is provided, or when the value to holder is restored.
3440 * Note that all the relevant preimages will be provided, but there may also be additional
3441 * irrelevant or duplicate preimages.
3443 struct LDKCResult_NoneNoneZ (*validate_holder_commitment)(const void *this_arg, const struct LDKHolderCommitmentTransaction *NONNULL_PTR holder_tx, struct LDKCVec_ThirtyTwoBytesZ outbound_htlc_preimages);
3445 * Validate the counterparty's revocation.
3447 * This is required in order for the signer to make sure that the state has moved
3448 * forward and it is safe to sign the next counterparty commitment.
3450 struct LDKCResult_NoneNoneZ (*validate_counterparty_revocation)(const void *this_arg, uint64_t idx, const uint8_t (*secret)[32]);
3452 * Returns the holder's channel public keys and basepoints.
3454 struct LDKChannelPublicKeys pubkeys;
3456 * Fill in the pubkeys field as a reference to it will be given to Rust after this returns
3457 * Note that this takes a pointer to this object, not the this_ptr like other methods do
3458 * This function pointer may be NULL if pubkeys is filled in when this object is created and never needs updating.
3460 void (*set_pubkeys)(const struct LDKChannelSigner*NONNULL_PTR );
3462 * Returns an arbitrary identifier describing the set of keys which are provided back to you in
3463 * some [`SpendableOutputDescriptor`] types. This should be sufficient to identify this
3464 * [`EcdsaChannelSigner`] object uniquely and lookup or re-derive its keys.
3466 struct LDKThirtyTwoBytes (*channel_keys_id)(const void *this_arg);
3468 * Set the counterparty static channel data, including basepoints,
3469 * `counterparty_selected`/`holder_selected_contest_delay` and funding outpoint.
3471 * This data is static, and will never change for a channel once set. For a given [`ChannelSigner`]
3472 * instance, LDK will call this method exactly once - either immediately after construction
3473 * (not including if done via [`SignerProvider::read_chan_signer`]) or when the funding
3474 * information has been generated.
3476 * channel_parameters.is_populated() MUST be true.
3478 void (*provide_channel_parameters)(void *this_arg, const struct LDKChannelTransactionParameters *NONNULL_PTR channel_parameters);
3480 * Frees any resources associated with this object given its this_arg pointer.
3481 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
3483 void (*free)(void *this_arg);
3487 * A trait to sign Lightning channel transactions as described in
3488 * [BOLT 3](https://github.com/lightning/bolts/blob/master/03-transactions.md).
3490 * Signing services could be implemented on a hardware wallet and should implement signing
3491 * policies in order to be secure. Please refer to the [VLS Policy
3492 * Controls](https://gitlab.com/lightning-signer/validating-lightning-signer/-/blob/main/docs/policy-controls.md)
3493 * for an example of such policies.
3495 typedef struct LDKEcdsaChannelSigner {
3497 * An opaque pointer which is passed to your function implementations as an argument.
3498 * This has no meaning in the LDK, and can be NULL or any other value.
3502 * Create a signature for a counterparty's commitment transaction and associated HTLC transactions.
3504 * Note that if signing fails or is rejected, the channel will be force-closed.
3506 * Policy checks should be implemented in this function, including checking the amount
3507 * sent to us and checking the HTLCs.
3509 * The preimages of outbound and inbound HTLCs that were fulfilled since the last commitment
3510 * are provided. A validating signer should ensure that an outbound HTLC output is removed
3511 * only when the matching preimage is provided and after the corresponding inbound HTLC has
3512 * been removed for forwarded payments.
3514 * Note that all the relevant preimages will be provided, but there may also be additional
3515 * irrelevant or duplicate preimages.
3517 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);
3519 * Creates a signature for a holder's commitment transaction.
3521 * This will be called
3522 * - with a non-revoked `commitment_tx`.
3523 * - with the latest `commitment_tx` when we initiate a force-close.
3525 * This may be called multiple times for the same transaction.
3527 * An external signer implementation should check that the commitment has not been revoked.
3529 * An `Err` can be returned to signal that the signer is unavailable/cannot produce a valid
3530 * signature and should be retried later. Once the signer is ready to provide a signature after
3531 * previously returning an `Err`, [`ChannelMonitor::signer_unblocked`] must be called on its
3534 * [`ChannelMonitor::signer_unblocked`]: crate::chain::channelmonitor::ChannelMonitor::signer_unblocked
3536 struct LDKCResult_ECDSASignatureNoneZ (*sign_holder_commitment)(const void *this_arg, const struct LDKHolderCommitmentTransaction *NONNULL_PTR commitment_tx);
3538 * Create a signature for the given input in a transaction spending an HTLC transaction output
3539 * or a commitment transaction `to_local` output when our counterparty broadcasts an old state.
3541 * A justice transaction may claim multiple outputs at the same time if timelocks are
3542 * similar, but only a signature for the input at index `input` should be signed for here.
3543 * It may be called multiple times for same output(s) if a fee-bump is needed with regards
3544 * to an upcoming timelock expiration.
3546 * Amount is value of the output spent by this input, committed to in the BIP 143 signature.
3548 * `per_commitment_key` is revocation secret which was provided by our counterparty when they
3549 * revoked the state which they eventually broadcast. It's not a _holder_ secret key and does
3550 * not allow the spending of any funds by itself (you need our holder `revocation_secret` to do
3553 * An `Err` can be returned to signal that the signer is unavailable/cannot produce a valid
3554 * signature and should be retried later. Once the signer is ready to provide a signature after
3555 * previously returning an `Err`, [`ChannelMonitor::signer_unblocked`] must be called on its
3558 * [`ChannelMonitor::signer_unblocked`]: crate::chain::channelmonitor::ChannelMonitor::signer_unblocked
3560 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]);
3562 * Create a signature for the given input in a transaction spending a commitment transaction
3563 * HTLC output when our counterparty broadcasts an old state.
3565 * A justice transaction may claim multiple outputs at the same time if timelocks are
3566 * similar, but only a signature for the input at index `input` should be signed for here.
3567 * It may be called multiple times for same output(s) if a fee-bump is needed with regards
3568 * to an upcoming timelock expiration.
3570 * `amount` is the value of the output spent by this input, committed to in the BIP 143
3573 * `per_commitment_key` is revocation secret which was provided by our counterparty when they
3574 * revoked the state which they eventually broadcast. It's not a _holder_ secret key and does
3575 * not allow the spending of any funds by itself (you need our holder revocation_secret to do
3578 * `htlc` holds HTLC elements (hash, timelock), thus changing the format of the witness script
3579 * (which is committed to in the BIP 143 signatures).
3581 * An `Err` can be returned to signal that the signer is unavailable/cannot produce a valid
3582 * signature and should be retried later. Once the signer is ready to provide a signature after
3583 * previously returning an `Err`, [`ChannelMonitor::signer_unblocked`] must be called on its
3586 * [`ChannelMonitor::signer_unblocked`]: crate::chain::channelmonitor::ChannelMonitor::signer_unblocked
3588 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);
3590 * Computes the signature for a commitment transaction's HTLC output used as an input within
3591 * `htlc_tx`, which spends the commitment transaction at index `input`. The signature returned
3592 * must be be computed using [`EcdsaSighashType::All`].
3594 * Note that this may be called for HTLCs in the penultimate commitment transaction if a
3595 * [`ChannelMonitor`] [replica](https://github.com/lightningdevkit/rust-lightning/blob/main/GLOSSARY.md#monitor-replicas)
3596 * broadcasts it before receiving the update for the latest commitment transaction.
3598 * An `Err` can be returned to signal that the signer is unavailable/cannot produce a valid
3599 * signature and should be retried later. Once the signer is ready to provide a signature after
3600 * previously returning an `Err`, [`ChannelMonitor::signer_unblocked`] must be called on its
3603 * [`EcdsaSighashType::All`]: bitcoin::sighash::EcdsaSighashType::All
3604 * [`ChannelMonitor`]: crate::chain::channelmonitor::ChannelMonitor
3605 * [`ChannelMonitor::signer_unblocked`]: crate::chain::channelmonitor::ChannelMonitor::signer_unblocked
3607 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);
3609 * Create a signature for a claiming transaction for a HTLC output on a counterparty's commitment
3610 * transaction, either offered or received.
3612 * Such a transaction may claim multiples offered outputs at same time if we know the
3613 * preimage for each when we create it, but only the input at index `input` should be
3614 * signed for here. It may be called multiple times for same output(s) if a fee-bump is
3615 * needed with regards to an upcoming timelock expiration.
3617 * `witness_script` is either an offered or received script as defined in BOLT3 for HTLC
3620 * `amount` is value of the output spent by this input, committed to in the BIP 143 signature.
3622 * `per_commitment_point` is the dynamic point corresponding to the channel state
3623 * detected onchain. It has been generated by our counterparty and is used to derive
3624 * channel state keys, which are then included in the witness script and committed to in the
3625 * BIP 143 signature.
3627 * An `Err` can be returned to signal that the signer is unavailable/cannot produce a valid
3628 * signature and should be retried later. Once the signer is ready to provide a signature after
3629 * previously returning an `Err`, [`ChannelMonitor::signer_unblocked`] must be called on its
3632 * [`ChannelMonitor::signer_unblocked`]: crate::chain::channelmonitor::ChannelMonitor::signer_unblocked
3634 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);
3636 * Create a signature for a (proposed) closing transaction.
3638 * Note that, due to rounding, there may be one \"missing\" satoshi, and either party may have
3639 * chosen to forgo their output as dust.
3641 struct LDKCResult_ECDSASignatureNoneZ (*sign_closing_transaction)(const void *this_arg, const struct LDKClosingTransaction *NONNULL_PTR closing_tx);
3643 * Computes the signature for a commitment transaction's anchor output used as an
3644 * input within `anchor_tx`, which spends the commitment transaction, at index `input`.
3646 * An `Err` can be returned to signal that the signer is unavailable/cannot produce a valid
3647 * signature and should be retried later. Once the signer is ready to provide a signature after
3648 * previously returning an `Err`, [`ChannelMonitor::signer_unblocked`] must be called on its
3651 * [`ChannelMonitor::signer_unblocked`]: crate::chain::channelmonitor::ChannelMonitor::signer_unblocked
3653 struct LDKCResult_ECDSASignatureNoneZ (*sign_holder_anchor_input)(const void *this_arg, struct LDKTransaction anchor_tx, uintptr_t input);
3655 * Signs a channel announcement message with our funding key proving it comes from one of the
3656 * channel participants.
3658 * Channel announcements also require a signature from each node's network key. Our node
3659 * signature is computed through [`NodeSigner::sign_gossip_message`].
3661 * Note that if this fails or is rejected, the channel will not be publicly announced and
3662 * our counterparty may (though likely will not) close the channel on us for violating the
3665 * [`NodeSigner::sign_gossip_message`]: crate::sign::NodeSigner::sign_gossip_message
3667 struct LDKCResult_ECDSASignatureNoneZ (*sign_channel_announcement_with_funding_key)(const void *this_arg, const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR msg);
3669 * Implementation of ChannelSigner for this object.
3671 struct LDKChannelSigner ChannelSigner;
3673 * Frees any resources associated with this object given its this_arg pointer.
3674 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
3676 void (*free)(void *this_arg);
3677 } LDKEcdsaChannelSigner;
3680 * A writeable signer.
3682 * There will always be two instances of a signer per channel, one occupied by the
3683 * [`ChannelManager`] and another by the channel's [`ChannelMonitor`].
3685 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
3686 * [`ChannelMonitor`]: crate::chain::channelmonitor::ChannelMonitor
3688 typedef struct LDKWriteableEcdsaChannelSigner {
3690 * An opaque pointer which is passed to your function implementations as an argument.
3691 * This has no meaning in the LDK, and can be NULL or any other value.
3695 * Implementation of EcdsaChannelSigner for this object.
3697 struct LDKEcdsaChannelSigner EcdsaChannelSigner;
3699 * Serialize the object into a byte array
3701 struct LDKCVec_u8Z (*write)(const void *this_arg);
3703 * Called, if set, after this WriteableEcdsaChannelSigner has been cloned into a duplicate object.
3704 * The new WriteableEcdsaChannelSigner is provided, and should be mutated as needed to perform a
3705 * deep copy of the object pointed to by this_arg or avoid any double-freeing.
3707 void (*cloned)(struct LDKWriteableEcdsaChannelSigner *NONNULL_PTR new_WriteableEcdsaChannelSigner);
3709 * Frees any resources associated with this object given its this_arg pointer.
3710 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
3712 void (*free)(void *this_arg);
3713 } LDKWriteableEcdsaChannelSigner;
3716 * The contents of CResult_WriteableEcdsaChannelSignerDecodeErrorZ
3718 typedef union LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZPtr {
3720 * A pointer to the contents in the success state.
3721 * Reading from this pointer when `result_ok` is not set is undefined.
3723 struct LDKWriteableEcdsaChannelSigner *result;
3725 * A pointer to the contents in the error state.
3726 * Reading from this pointer when `result_ok` is set is undefined.
3728 struct LDKDecodeError *err;
3729 } LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZPtr;
3732 * A CResult_WriteableEcdsaChannelSignerDecodeErrorZ represents the result of a fallible operation,
3733 * containing a crate::lightning::sign::ecdsa::WriteableEcdsaChannelSigner on success and a crate::lightning::ln::msgs::DecodeError on failure.
3734 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
3736 typedef struct LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ {
3738 * The contents of this CResult_WriteableEcdsaChannelSignerDecodeErrorZ, accessible via either
3739 * `err` or `result` depending on the state of `result_ok`.
3741 union LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZPtr contents;
3743 * Whether this CResult_WriteableEcdsaChannelSignerDecodeErrorZ represents a success state.
3746 } LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ;
3749 * The contents of CResult_CVec_u8ZNoneZ
3751 typedef union LDKCResult_CVec_u8ZNoneZPtr {
3753 * A pointer to the contents in the success state.
3754 * Reading from this pointer when `result_ok` is not set is undefined.
3756 struct LDKCVec_u8Z *result;
3758 * Note that this value is always NULL, as there are no contents in the Err variant
3761 } LDKCResult_CVec_u8ZNoneZPtr;
3764 * A CResult_CVec_u8ZNoneZ represents the result of a fallible operation,
3765 * containing a crate::c_types::derived::CVec_u8Z on success and a () on failure.
3766 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
3768 typedef struct LDKCResult_CVec_u8ZNoneZ {
3770 * The contents of this CResult_CVec_u8ZNoneZ, accessible via either
3771 * `err` or `result` depending on the state of `result_ok`.
3773 union LDKCResult_CVec_u8ZNoneZPtr contents;
3775 * Whether this CResult_CVec_u8ZNoneZ represents a success state.
3778 } LDKCResult_CVec_u8ZNoneZ;
3781 * The contents of CResult_ShutdownScriptNoneZ
3783 typedef union LDKCResult_ShutdownScriptNoneZPtr {
3785 * A pointer to the contents in the success state.
3786 * Reading from this pointer when `result_ok` is not set is undefined.
3788 struct LDKShutdownScript *result;
3790 * Note that this value is always NULL, as there are no contents in the Err variant
3793 } LDKCResult_ShutdownScriptNoneZPtr;
3796 * A CResult_ShutdownScriptNoneZ represents the result of a fallible operation,
3797 * containing a crate::lightning::ln::script::ShutdownScript on success and a () on failure.
3798 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
3800 typedef struct LDKCResult_ShutdownScriptNoneZ {
3802 * The contents of this CResult_ShutdownScriptNoneZ, accessible via either
3803 * `err` or `result` depending on the state of `result_ok`.
3805 union LDKCResult_ShutdownScriptNoneZPtr contents;
3807 * Whether this CResult_ShutdownScriptNoneZ represents a success state.
3810 } LDKCResult_ShutdownScriptNoneZ;
3813 * An enum which can either contain a u16 or not
3815 typedef enum LDKCOption_u16Z_Tag {
3817 * When we're in this state, this COption_u16Z contains a u16
3819 LDKCOption_u16Z_Some,
3821 * When we're in this state, this COption_u16Z contains nothing
3823 LDKCOption_u16Z_None,
3825 * Must be last for serialization purposes
3827 LDKCOption_u16Z_Sentinel,
3828 } LDKCOption_u16Z_Tag;
3830 typedef struct LDKCOption_u16Z {
3831 LDKCOption_u16Z_Tag tag;
3840 * An enum which can either contain a bool or not
3842 typedef enum LDKCOption_boolZ_Tag {
3844 * When we're in this state, this COption_boolZ contains a bool
3846 LDKCOption_boolZ_Some,
3848 * When we're in this state, this COption_boolZ contains nothing
3850 LDKCOption_boolZ_None,
3852 * Must be last for serialization purposes
3854 LDKCOption_boolZ_Sentinel,
3855 } LDKCOption_boolZ_Tag;
3857 typedef struct LDKCOption_boolZ {
3858 LDKCOption_boolZ_Tag tag;
3867 * The contents of CResult_WitnessNoneZ
3869 typedef union LDKCResult_WitnessNoneZPtr {
3871 * A pointer to the contents in the success state.
3872 * Reading from this pointer when `result_ok` is not set is undefined.
3874 struct LDKWitness *result;
3876 * Note that this value is always NULL, as there are no contents in the Err variant
3879 } LDKCResult_WitnessNoneZPtr;
3882 * A CResult_WitnessNoneZ represents the result of a fallible operation,
3883 * containing a crate::c_types::Witness on success and a () on failure.
3884 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
3886 typedef struct LDKCResult_WitnessNoneZ {
3888 * The contents of this CResult_WitnessNoneZ, accessible via either
3889 * `err` or `result` depending on the state of `result_ok`.
3891 union LDKCResult_WitnessNoneZPtr contents;
3893 * Whether this CResult_WitnessNoneZ represents a success state.
3896 } LDKCResult_WitnessNoneZ;
3901 * A simple implementation of [`WriteableEcdsaChannelSigner`] that just keeps the private keys in memory.
3903 * This implementation performs no policy checks and is insufficient by itself as
3904 * a secure external signer.
3906 typedef struct MUST_USE_STRUCT LDKInMemorySigner {
3908 * A pointer to the opaque Rust object.
3909 * Nearly everywhere, inner must be non-null, however in places where
3910 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3912 LDKnativeInMemorySigner *inner;
3914 * Indicates that this is the only struct which contains the same pointer.
3915 * Rust functions which take ownership of an object provided via an argument require
3916 * this to be true and invalidate the object pointed to by inner.
3919 } LDKInMemorySigner;
3922 * The contents of CResult_InMemorySignerDecodeErrorZ
3924 typedef union LDKCResult_InMemorySignerDecodeErrorZPtr {
3926 * A pointer to the contents in the success state.
3927 * Reading from this pointer when `result_ok` is not set is undefined.
3929 struct LDKInMemorySigner *result;
3931 * A pointer to the contents in the error state.
3932 * Reading from this pointer when `result_ok` is set is undefined.
3934 struct LDKDecodeError *err;
3935 } LDKCResult_InMemorySignerDecodeErrorZPtr;
3938 * A CResult_InMemorySignerDecodeErrorZ represents the result of a fallible operation,
3939 * containing a crate::lightning::sign::InMemorySigner on success and a crate::lightning::ln::msgs::DecodeError on failure.
3940 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
3942 typedef struct LDKCResult_InMemorySignerDecodeErrorZ {
3944 * The contents of this CResult_InMemorySignerDecodeErrorZ, accessible via either
3945 * `err` or `result` depending on the state of `result_ok`.
3947 union LDKCResult_InMemorySignerDecodeErrorZPtr contents;
3949 * Whether this CResult_InMemorySignerDecodeErrorZ represents a success state.
3952 } LDKCResult_InMemorySignerDecodeErrorZ;
3957 * A [`CandidateRouteHop::FirstHop`] entry.
3959 typedef struct MUST_USE_STRUCT LDKFirstHopCandidate {
3961 * A pointer to the opaque Rust object.
3962 * Nearly everywhere, inner must be non-null, however in places where
3963 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3965 LDKnativeFirstHopCandidate *inner;
3967 * Indicates that this is the only struct which contains the same pointer.
3968 * Rust functions which take ownership of an object provided via an argument require
3969 * this to be true and invalidate the object pointed to by inner.
3972 } LDKFirstHopCandidate;
3977 * A [`CandidateRouteHop::PublicHop`] entry.
3979 typedef struct MUST_USE_STRUCT LDKPublicHopCandidate {
3981 * A pointer to the opaque Rust object.
3982 * Nearly everywhere, inner must be non-null, however in places where
3983 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3985 LDKnativePublicHopCandidate *inner;
3987 * Indicates that this is the only struct which contains the same pointer.
3988 * Rust functions which take ownership of an object provided via an argument require
3989 * this to be true and invalidate the object pointed to by inner.
3992 } LDKPublicHopCandidate;
3997 * A [`CandidateRouteHop::PrivateHop`] entry.
3999 typedef struct MUST_USE_STRUCT LDKPrivateHopCandidate {
4001 * A pointer to the opaque Rust object.
4002 * Nearly everywhere, inner must be non-null, however in places where
4003 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4005 LDKnativePrivateHopCandidate *inner;
4007 * Indicates that this is the only struct which contains the same pointer.
4008 * Rust functions which take ownership of an object provided via an argument require
4009 * this to be true and invalidate the object pointed to by inner.
4012 } LDKPrivateHopCandidate;
4017 * A [`CandidateRouteHop::Blinded`] entry.
4019 typedef struct MUST_USE_STRUCT LDKBlindedPathCandidate {
4021 * A pointer to the opaque Rust object.
4022 * Nearly everywhere, inner must be non-null, however in places where
4023 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4025 LDKnativeBlindedPathCandidate *inner;
4027 * Indicates that this is the only struct which contains the same pointer.
4028 * Rust functions which take ownership of an object provided via an argument require
4029 * this to be true and invalidate the object pointed to by inner.
4032 } LDKBlindedPathCandidate;
4037 * A [`CandidateRouteHop::OneHopBlinded`] entry.
4039 typedef struct MUST_USE_STRUCT LDKOneHopBlindedPathCandidate {
4041 * A pointer to the opaque Rust object.
4042 * Nearly everywhere, inner must be non-null, however in places where
4043 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4045 LDKnativeOneHopBlindedPathCandidate *inner;
4047 * Indicates that this is the only struct which contains the same pointer.
4048 * Rust functions which take ownership of an object provided via an argument require
4049 * this to be true and invalidate the object pointed to by inner.
4052 } LDKOneHopBlindedPathCandidate;
4055 * A wrapper around the various hop representations.
4057 * Can be used to examine the properties of a hop,
4058 * potentially to decide whether to include it in a route.
4060 typedef enum LDKCandidateRouteHop_Tag {
4062 * A hop from the payer, where the outbound liquidity is known.
4064 LDKCandidateRouteHop_FirstHop,
4066 * A hop found in the [`ReadOnlyNetworkGraph`].
4068 LDKCandidateRouteHop_PublicHop,
4070 * A private hop communicated by the payee, generally via a BOLT 11 invoice.
4072 * Because BOLT 11 route hints can take multiple hops to get to the destination, this may not
4073 * terminate at the payee.
4075 LDKCandidateRouteHop_PrivateHop,
4077 * A blinded path which starts with an introduction point and ultimately terminates with the
4080 * Because we don't know the payee's identity, [`CandidateRouteHop::target`] will return
4081 * `None` in this state.
4083 * Because blinded paths are \"all or nothing\", and we cannot use just one part of a blinded
4084 * path, the full path is treated as a single [`CandidateRouteHop`].
4086 LDKCandidateRouteHop_Blinded,
4088 * Similar to [`Self::Blinded`], but the path here only has one hop.
4090 * While we treat this similarly to [`CandidateRouteHop::Blinded`] in many respects (e.g.
4091 * returning `None` from [`CandidateRouteHop::target`]), in this case we do actually know the
4092 * payee's identity - it's the introduction point!
4094 * [`BlindedPayInfo`] provided for 1-hop blinded paths is ignored because it is meant to apply
4095 * to the hops *between* the introduction node and the destination.
4097 * This primarily exists to track that we need to included a blinded path at the end of our
4098 * [`Route`], even though it doesn't actually add an additional hop in the payment.
4100 LDKCandidateRouteHop_OneHopBlinded,
4102 * Must be last for serialization purposes
4104 LDKCandidateRouteHop_Sentinel,
4105 } LDKCandidateRouteHop_Tag;
4107 typedef struct MUST_USE_STRUCT LDKCandidateRouteHop {
4108 LDKCandidateRouteHop_Tag tag;
4111 struct LDKFirstHopCandidate first_hop;
4114 struct LDKPublicHopCandidate public_hop;
4117 struct LDKPrivateHopCandidate private_hop;
4120 struct LDKBlindedPathCandidate blinded;
4123 struct LDKOneHopBlindedPathCandidate one_hop_blinded;
4126 } LDKCandidateRouteHop;
4131 * Proposed use of a channel passed as a parameter to [`ScoreLookUp::channel_penalty_msat`].
4133 typedef struct MUST_USE_STRUCT LDKChannelUsage {
4135 * A pointer to the opaque Rust object.
4136 * Nearly everywhere, inner must be non-null, however in places where
4137 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4139 LDKnativeChannelUsage *inner;
4141 * Indicates that this is the only struct which contains the same pointer.
4142 * Rust functions which take ownership of an object provided via an argument require
4143 * this to be true and invalidate the object pointed to by inner.
4151 * Parameters for configuring [`ProbabilisticScorer`].
4153 * Used to configure base, liquidity, and amount penalties, the sum of which comprises the channel
4154 * penalty (i.e., the amount in msats willing to be paid to avoid routing through the channel).
4156 * The penalty applied to any channel by the [`ProbabilisticScorer`] is the sum of each of the
4159 typedef struct MUST_USE_STRUCT LDKProbabilisticScoringFeeParameters {
4161 * A pointer to the opaque Rust object.
4162 * Nearly everywhere, inner must be non-null, however in places where
4163 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4165 LDKnativeProbabilisticScoringFeeParameters *inner;
4167 * Indicates that this is the only struct which contains the same pointer.
4168 * Rust functions which take ownership of an object provided via an argument require
4169 * this to be true and invalidate the object pointed to by inner.
4172 } LDKProbabilisticScoringFeeParameters;
4175 * An interface used to score payment channels for path finding.
4177 * `ScoreLookUp` is used to determine the penalty for a given channel.
4179 * Scoring is in terms of fees willing to be paid in order to avoid routing through a channel.
4181 typedef struct LDKScoreLookUp {
4183 * An opaque pointer which is passed to your function implementations as an argument.
4184 * This has no meaning in the LDK, and can be NULL or any other value.
4188 * Returns the fee in msats willing to be paid to avoid routing `send_amt_msat` through the
4189 * given channel in the direction from `source` to `target`.
4191 * The channel's capacity (less any other MPP parts that are also being considered for use in
4192 * the same payment) is given by `capacity_msat`. It may be determined from various sources
4193 * such as a chain data, network gossip, or invoice hints. For invoice hints, a capacity near
4194 * [`u64::max_value`] is given to indicate sufficient capacity for the invoice's full amount.
4195 * Thus, implementations should be overflow-safe.
4197 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);
4199 * Frees any resources associated with this object given its this_arg pointer.
4200 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
4202 void (*free)(void *this_arg);
4208 * A path in a [`Route`] to the payment recipient. Must always be at least length one.
4209 * If no [`Path::blinded_tail`] is present, then [`Path::hops`] length may be up to 19.
4211 typedef struct MUST_USE_STRUCT LDKPath {
4213 * A pointer to the opaque Rust object.
4214 * Nearly everywhere, inner must be non-null, however in places where
4215 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4217 LDKnativePath *inner;
4219 * Indicates that this is the only struct which contains the same pointer.
4220 * Rust functions which take ownership of an object provided via an argument require
4221 * this to be true and invalidate the object pointed to by inner.
4227 * `ScoreUpdate` is used to update the scorer's internal state after a payment attempt.
4229 typedef struct LDKScoreUpdate {
4231 * An opaque pointer which is passed to your function implementations as an argument.
4232 * This has no meaning in the LDK, and can be NULL or any other value.
4236 * Handles updating channel penalties after failing to route through a channel.
4238 void (*payment_path_failed)(void *this_arg, const struct LDKPath *NONNULL_PTR path, uint64_t short_channel_id, uint64_t duration_since_epoch);
4240 * Handles updating channel penalties after successfully routing along a path.
4242 void (*payment_path_successful)(void *this_arg, const struct LDKPath *NONNULL_PTR path, uint64_t duration_since_epoch);
4244 * Handles updating channel penalties after a probe over the given path failed.
4246 void (*probe_failed)(void *this_arg, const struct LDKPath *NONNULL_PTR path, uint64_t short_channel_id, uint64_t duration_since_epoch);
4248 * Handles updating channel penalties after a probe over the given path succeeded.
4250 void (*probe_successful)(void *this_arg, const struct LDKPath *NONNULL_PTR path, uint64_t duration_since_epoch);
4252 * Scorers may wish to reduce their certainty of channel liquidity information over time.
4253 * Thus, this method is provided to allow scorers to observe the passage of time - the holder
4254 * of this object should call this method regularly (generally via the
4255 * `lightning-background-processor` crate).
4257 void (*time_passed)(void *this_arg, uint64_t duration_since_epoch);
4259 * Frees any resources associated with this object given its this_arg pointer.
4260 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
4262 void (*free)(void *this_arg);
4266 * A scorer that is accessed under a lock.
4268 * Needed so that calls to [`ScoreLookUp::channel_penalty_msat`] in [`find_route`] can be made while
4269 * having shared ownership of a scorer but without requiring internal locking in [`ScoreUpdate`]
4270 * implementations. Internal locking would be detrimental to route finding performance and could
4271 * result in [`ScoreLookUp::channel_penalty_msat`] returning a different value for the same channel.
4273 * [`find_route`]: crate::routing::router::find_route
4275 typedef struct LDKLockableScore {
4277 * An opaque pointer which is passed to your function implementations as an argument.
4278 * This has no meaning in the LDK, and can be NULL or any other value.
4282 * Returns read locked scorer.
4284 struct LDKScoreLookUp (*read_lock)(const void *this_arg);
4286 * Returns write locked scorer.
4288 struct LDKScoreUpdate (*write_lock)(const void *this_arg);
4290 * Frees any resources associated with this object given its this_arg pointer.
4291 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
4293 void (*free)(void *this_arg);
4297 * Refers to a scorer that is accessible under lock and also writeable to disk
4299 * We need this trait to be able to pass in a scorer to `lightning-background-processor` that will enable us to
4300 * use the Persister to persist it.
4302 typedef struct LDKWriteableScore {
4304 * An opaque pointer which is passed to your function implementations as an argument.
4305 * This has no meaning in the LDK, and can be NULL or any other value.
4309 * Implementation of LockableScore for this object.
4311 struct LDKLockableScore LockableScore;
4313 * Serialize the object into a byte array
4315 struct LDKCVec_u8Z (*write)(const void *this_arg);
4317 * Frees any resources associated with this object given its this_arg pointer.
4318 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
4320 void (*free)(void *this_arg);
4321 } LDKWriteableScore;
4324 * An enum which can either contain a crate::lightning::routing::scoring::WriteableScore or not
4326 typedef enum LDKCOption_WriteableScoreZ_Tag {
4328 * When we're in this state, this COption_WriteableScoreZ contains a crate::lightning::routing::scoring::WriteableScore
4330 LDKCOption_WriteableScoreZ_Some,
4332 * When we're in this state, this COption_WriteableScoreZ contains nothing
4334 LDKCOption_WriteableScoreZ_None,
4336 * Must be last for serialization purposes
4338 LDKCOption_WriteableScoreZ_Sentinel,
4339 } LDKCOption_WriteableScoreZ_Tag;
4341 typedef struct LDKCOption_WriteableScoreZ {
4342 LDKCOption_WriteableScoreZ_Tag tag;
4345 struct LDKWriteableScore some;
4348 } LDKCOption_WriteableScoreZ;
4351 * The contents of CResult_NoneIOErrorZ
4353 typedef union LDKCResult_NoneIOErrorZPtr {
4355 * Note that this value is always NULL, as there are no contents in the OK variant
4359 * A pointer to the contents in the error state.
4360 * Reading from this pointer when `result_ok` is set is undefined.
4362 enum LDKIOError *err;
4363 } LDKCResult_NoneIOErrorZPtr;
4366 * A CResult_NoneIOErrorZ represents the result of a fallible operation,
4367 * containing a () on success and a crate::c_types::IOError on failure.
4368 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4370 typedef struct LDKCResult_NoneIOErrorZ {
4372 * The contents of this CResult_NoneIOErrorZ, accessible via either
4373 * `err` or `result` depending on the state of `result_ok`.
4375 union LDKCResult_NoneIOErrorZPtr contents;
4377 * Whether this CResult_NoneIOErrorZ represents a success state.
4380 } LDKCResult_NoneIOErrorZ;
4385 * Details of a channel, as returned by [`ChannelManager::list_channels`] and [`ChannelManager::list_usable_channels`]
4387 * [`ChannelManager::list_channels`]: crate::ln::channelmanager::ChannelManager::list_channels
4388 * [`ChannelManager::list_usable_channels`]: crate::ln::channelmanager::ChannelManager::list_usable_channels
4390 typedef struct MUST_USE_STRUCT LDKChannelDetails {
4392 * A pointer to the opaque Rust object.
4393 * Nearly everywhere, inner must be non-null, however in places where
4394 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4396 LDKnativeChannelDetails *inner;
4398 * Indicates that this is the only struct which contains the same pointer.
4399 * Rust functions which take ownership of an object provided via an argument require
4400 * this to be true and invalidate the object pointed to by inner.
4403 } LDKChannelDetails;
4406 * A dynamically-allocated array of crate::lightning::ln::channel_state::ChannelDetailss of arbitrary size.
4407 * This corresponds to std::vector in C++
4409 typedef struct LDKCVec_ChannelDetailsZ {
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 LDKChannelDetails *data;
4416 * The number of elements pointed to by `data`.
4419 } LDKCVec_ChannelDetailsZ;
4424 * A route directs a payment from the sender (us) to the recipient. If the recipient supports MPP,
4425 * it can take multiple paths. Each path is composed of one or more hops through the network.
4427 typedef struct MUST_USE_STRUCT LDKRoute {
4429 * A pointer to the opaque Rust object.
4430 * Nearly everywhere, inner must be non-null, however in places where
4431 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4433 LDKnativeRoute *inner;
4435 * Indicates that this is the only struct which contains the same pointer.
4436 * Rust functions which take ownership of an object provided via an argument require
4437 * this to be true and invalidate the object pointed to by inner.
4445 * An Err type for failure to process messages.
4447 typedef struct MUST_USE_STRUCT LDKLightningError {
4449 * A pointer to the opaque Rust object.
4450 * Nearly everywhere, inner must be non-null, however in places where
4451 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4453 LDKnativeLightningError *inner;
4455 * Indicates that this is the only struct which contains the same pointer.
4456 * Rust functions which take ownership of an object provided via an argument require
4457 * this to be true and invalidate the object pointed to by inner.
4460 } LDKLightningError;
4463 * The contents of CResult_RouteLightningErrorZ
4465 typedef union LDKCResult_RouteLightningErrorZPtr {
4467 * A pointer to the contents in the success state.
4468 * Reading from this pointer when `result_ok` is not set is undefined.
4470 struct LDKRoute *result;
4472 * A pointer to the contents in the error state.
4473 * Reading from this pointer when `result_ok` is set is undefined.
4475 struct LDKLightningError *err;
4476 } LDKCResult_RouteLightningErrorZPtr;
4479 * A CResult_RouteLightningErrorZ represents the result of a fallible operation,
4480 * containing a crate::lightning::routing::router::Route on success and a crate::lightning::ln::msgs::LightningError on failure.
4481 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4483 typedef struct LDKCResult_RouteLightningErrorZ {
4485 * The contents of this CResult_RouteLightningErrorZ, accessible via either
4486 * `err` or `result` depending on the state of `result_ok`.
4488 union LDKCResult_RouteLightningErrorZPtr contents;
4490 * Whether this CResult_RouteLightningErrorZ represents a success state.
4493 } LDKCResult_RouteLightningErrorZ;
4496 * A tuple of 2 elements. See the individual fields for the types contained.
4498 typedef struct LDKC2Tuple_BlindedPayInfoBlindedPathZ {
4500 * The element at position 0
4502 struct LDKBlindedPayInfo a;
4504 * The element at position 1
4506 struct LDKBlindedPath b;
4507 } LDKC2Tuple_BlindedPayInfoBlindedPathZ;
4510 * A dynamically-allocated array of crate::c_types::derived::C2Tuple_BlindedPayInfoBlindedPathZs of arbitrary size.
4511 * This corresponds to std::vector in C++
4513 typedef struct LDKCVec_C2Tuple_BlindedPayInfoBlindedPathZZ {
4515 * The elements in the array.
4516 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
4518 struct LDKC2Tuple_BlindedPayInfoBlindedPathZ *data;
4520 * The number of elements pointed to by `data`.
4523 } LDKCVec_C2Tuple_BlindedPayInfoBlindedPathZZ;
4526 * The contents of CResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ
4528 typedef union LDKCResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZPtr {
4530 * A pointer to the contents in the success state.
4531 * Reading from this pointer when `result_ok` is not set is undefined.
4533 struct LDKCVec_C2Tuple_BlindedPayInfoBlindedPathZZ *result;
4535 * Note that this value is always NULL, as there are no contents in the Err variant
4538 } LDKCResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZPtr;
4541 * A CResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ represents the result of a fallible operation,
4542 * containing a crate::c_types::derived::CVec_C2Tuple_BlindedPayInfoBlindedPathZZ on success and a () on failure.
4543 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4545 typedef struct LDKCResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ {
4547 * The contents of this CResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ, accessible via either
4548 * `err` or `result` depending on the state of `result_ok`.
4550 union LDKCResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZPtr contents;
4552 * Whether this CResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ represents a success state.
4555 } LDKCResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ;
4558 * A dynamically-allocated array of crate::c_types::PublicKeys of arbitrary size.
4559 * This corresponds to std::vector in C++
4561 typedef struct LDKCVec_PublicKeyZ {
4563 * The elements in the array.
4564 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
4566 struct LDKPublicKey *data;
4568 * The number of elements pointed to by `data`.
4571 } LDKCVec_PublicKeyZ;
4576 * A path for sending an [`OnionMessage`].
4578 typedef struct MUST_USE_STRUCT LDKOnionMessagePath {
4580 * A pointer to the opaque Rust object.
4581 * Nearly everywhere, inner must be non-null, however in places where
4582 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4584 LDKnativeOnionMessagePath *inner;
4586 * Indicates that this is the only struct which contains the same pointer.
4587 * Rust functions which take ownership of an object provided via an argument require
4588 * this to be true and invalidate the object pointed to by inner.
4591 } LDKOnionMessagePath;
4594 * The contents of CResult_OnionMessagePathNoneZ
4596 typedef union LDKCResult_OnionMessagePathNoneZPtr {
4598 * A pointer to the contents in the success state.
4599 * Reading from this pointer when `result_ok` is not set is undefined.
4601 struct LDKOnionMessagePath *result;
4603 * Note that this value is always NULL, as there are no contents in the Err variant
4606 } LDKCResult_OnionMessagePathNoneZPtr;
4609 * A CResult_OnionMessagePathNoneZ represents the result of a fallible operation,
4610 * containing a crate::lightning::onion_message::messenger::OnionMessagePath on success and a () on failure.
4611 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4613 typedef struct LDKCResult_OnionMessagePathNoneZ {
4615 * The contents of this CResult_OnionMessagePathNoneZ, accessible via either
4616 * `err` or `result` depending on the state of `result_ok`.
4618 union LDKCResult_OnionMessagePathNoneZPtr contents;
4620 * Whether this CResult_OnionMessagePathNoneZ represents a success state.
4623 } LDKCResult_OnionMessagePathNoneZ;
4626 * The contents of CResult_CVec_BlindedPathZNoneZ
4628 typedef union LDKCResult_CVec_BlindedPathZNoneZPtr {
4630 * A pointer to the contents in the success state.
4631 * Reading from this pointer when `result_ok` is not set is undefined.
4633 struct LDKCVec_BlindedPathZ *result;
4635 * Note that this value is always NULL, as there are no contents in the Err variant
4638 } LDKCResult_CVec_BlindedPathZNoneZPtr;
4641 * A CResult_CVec_BlindedPathZNoneZ represents the result of a fallible operation,
4642 * containing a crate::c_types::derived::CVec_BlindedPathZ on success and a () on failure.
4643 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4645 typedef struct LDKCResult_CVec_BlindedPathZNoneZ {
4647 * The contents of this CResult_CVec_BlindedPathZNoneZ, accessible via either
4648 * `err` or `result` depending on the state of `result_ok`.
4650 union LDKCResult_CVec_BlindedPathZNoneZPtr contents;
4652 * Whether this CResult_CVec_BlindedPathZNoneZ represents a success state.
4655 } LDKCResult_CVec_BlindedPathZNoneZ;
4660 * A data structure for tracking in-flight HTLCs. May be used during pathfinding to account for
4661 * in-use channel liquidity.
4663 typedef struct MUST_USE_STRUCT LDKInFlightHtlcs {
4665 * A pointer to the opaque Rust object.
4666 * Nearly everywhere, inner must be non-null, however in places where
4667 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4669 LDKnativeInFlightHtlcs *inner;
4671 * Indicates that this is the only struct which contains the same pointer.
4672 * Rust functions which take ownership of an object provided via an argument require
4673 * this to be true and invalidate the object pointed to by inner.
4679 * The contents of CResult_InFlightHtlcsDecodeErrorZ
4681 typedef union LDKCResult_InFlightHtlcsDecodeErrorZPtr {
4683 * A pointer to the contents in the success state.
4684 * Reading from this pointer when `result_ok` is not set is undefined.
4686 struct LDKInFlightHtlcs *result;
4688 * A pointer to the contents in the error state.
4689 * Reading from this pointer when `result_ok` is set is undefined.
4691 struct LDKDecodeError *err;
4692 } LDKCResult_InFlightHtlcsDecodeErrorZPtr;
4695 * A CResult_InFlightHtlcsDecodeErrorZ represents the result of a fallible operation,
4696 * containing a crate::lightning::routing::router::InFlightHtlcs on success and a crate::lightning::ln::msgs::DecodeError on failure.
4697 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4699 typedef struct LDKCResult_InFlightHtlcsDecodeErrorZ {
4701 * The contents of this CResult_InFlightHtlcsDecodeErrorZ, accessible via either
4702 * `err` or `result` depending on the state of `result_ok`.
4704 union LDKCResult_InFlightHtlcsDecodeErrorZPtr contents;
4706 * Whether this CResult_InFlightHtlcsDecodeErrorZ represents a success state.
4709 } LDKCResult_InFlightHtlcsDecodeErrorZ;
4714 * A hop in a route, and additional metadata about it. \"Hop\" is defined as a node and the channel
4717 typedef struct MUST_USE_STRUCT LDKRouteHop {
4719 * A pointer to the opaque Rust object.
4720 * Nearly everywhere, inner must be non-null, however in places where
4721 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4723 LDKnativeRouteHop *inner;
4725 * Indicates that this is the only struct which contains the same pointer.
4726 * Rust functions which take ownership of an object provided via an argument require
4727 * this to be true and invalidate the object pointed to by inner.
4733 * The contents of CResult_RouteHopDecodeErrorZ
4735 typedef union LDKCResult_RouteHopDecodeErrorZPtr {
4737 * A pointer to the contents in the success state.
4738 * Reading from this pointer when `result_ok` is not set is undefined.
4740 struct LDKRouteHop *result;
4742 * A pointer to the contents in the error state.
4743 * Reading from this pointer when `result_ok` is set is undefined.
4745 struct LDKDecodeError *err;
4746 } LDKCResult_RouteHopDecodeErrorZPtr;
4749 * A CResult_RouteHopDecodeErrorZ represents the result of a fallible operation,
4750 * containing a crate::lightning::routing::router::RouteHop on success and a crate::lightning::ln::msgs::DecodeError on failure.
4751 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4753 typedef struct LDKCResult_RouteHopDecodeErrorZ {
4755 * The contents of this CResult_RouteHopDecodeErrorZ, accessible via either
4756 * `err` or `result` depending on the state of `result_ok`.
4758 union LDKCResult_RouteHopDecodeErrorZPtr contents;
4760 * Whether this CResult_RouteHopDecodeErrorZ represents a success state.
4763 } LDKCResult_RouteHopDecodeErrorZ;
4768 * An encrypted payload and node id corresponding to a hop in a payment or onion message path, to
4769 * be encoded in the sender's onion packet. These hops cannot be identified by outside observers
4770 * and thus can be used to hide the identity of the recipient.
4772 typedef struct MUST_USE_STRUCT LDKBlindedHop {
4774 * A pointer to the opaque Rust object.
4775 * Nearly everywhere, inner must be non-null, however in places where
4776 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4778 LDKnativeBlindedHop *inner;
4780 * Indicates that this is the only struct which contains the same pointer.
4781 * Rust functions which take ownership of an object provided via an argument require
4782 * this to be true and invalidate the object pointed to by inner.
4788 * A dynamically-allocated array of crate::lightning::blinded_path::BlindedHops of arbitrary size.
4789 * This corresponds to std::vector in C++
4791 typedef struct LDKCVec_BlindedHopZ {
4793 * The elements in the array.
4794 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
4796 struct LDKBlindedHop *data;
4798 * The number of elements pointed to by `data`.
4801 } LDKCVec_BlindedHopZ;
4806 * The blinded portion of a [`Path`], if we're routing to a recipient who provided blinded paths in
4807 * their [`Bolt12Invoice`].
4809 * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice
4811 typedef struct MUST_USE_STRUCT LDKBlindedTail {
4813 * A pointer to the opaque Rust object.
4814 * Nearly everywhere, inner must be non-null, however in places where
4815 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4817 LDKnativeBlindedTail *inner;
4819 * Indicates that this is the only struct which contains the same pointer.
4820 * Rust functions which take ownership of an object provided via an argument require
4821 * this to be true and invalidate the object pointed to by inner.
4827 * The contents of CResult_BlindedTailDecodeErrorZ
4829 typedef union LDKCResult_BlindedTailDecodeErrorZPtr {
4831 * A pointer to the contents in the success state.
4832 * Reading from this pointer when `result_ok` is not set is undefined.
4834 struct LDKBlindedTail *result;
4836 * A pointer to the contents in the error state.
4837 * Reading from this pointer when `result_ok` is set is undefined.
4839 struct LDKDecodeError *err;
4840 } LDKCResult_BlindedTailDecodeErrorZPtr;
4843 * A CResult_BlindedTailDecodeErrorZ represents the result of a fallible operation,
4844 * containing a crate::lightning::routing::router::BlindedTail on success and a crate::lightning::ln::msgs::DecodeError on failure.
4845 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4847 typedef struct LDKCResult_BlindedTailDecodeErrorZ {
4849 * The contents of this CResult_BlindedTailDecodeErrorZ, accessible via either
4850 * `err` or `result` depending on the state of `result_ok`.
4852 union LDKCResult_BlindedTailDecodeErrorZPtr contents;
4854 * Whether this CResult_BlindedTailDecodeErrorZ represents a success state.
4857 } LDKCResult_BlindedTailDecodeErrorZ;
4860 * A dynamically-allocated array of crate::lightning::routing::router::RouteHops of arbitrary size.
4861 * This corresponds to std::vector in C++
4863 typedef struct LDKCVec_RouteHopZ {
4865 * The elements in the array.
4866 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
4868 struct LDKRouteHop *data;
4870 * The number of elements pointed to by `data`.
4873 } LDKCVec_RouteHopZ;
4876 * A dynamically-allocated array of crate::lightning::routing::router::Paths of arbitrary size.
4877 * This corresponds to std::vector in C++
4879 typedef struct LDKCVec_PathZ {
4881 * The elements in the array.
4882 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
4884 struct LDKPath *data;
4886 * The number of elements pointed to by `data`.
4892 * The contents of CResult_RouteDecodeErrorZ
4894 typedef union LDKCResult_RouteDecodeErrorZPtr {
4896 * A pointer to the contents in the success state.
4897 * Reading from this pointer when `result_ok` is not set is undefined.
4899 struct LDKRoute *result;
4901 * A pointer to the contents in the error state.
4902 * Reading from this pointer when `result_ok` is set is undefined.
4904 struct LDKDecodeError *err;
4905 } LDKCResult_RouteDecodeErrorZPtr;
4908 * A CResult_RouteDecodeErrorZ represents the result of a fallible operation,
4909 * containing a crate::lightning::routing::router::Route on success and a crate::lightning::ln::msgs::DecodeError on failure.
4910 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4912 typedef struct LDKCResult_RouteDecodeErrorZ {
4914 * The contents of this CResult_RouteDecodeErrorZ, accessible via either
4915 * `err` or `result` depending on the state of `result_ok`.
4917 union LDKCResult_RouteDecodeErrorZPtr contents;
4919 * Whether this CResult_RouteDecodeErrorZ represents a success state.
4922 } LDKCResult_RouteDecodeErrorZ;
4927 * Parameters needed to find a [`Route`].
4929 * Passed to [`find_route`] and [`build_route_from_hops`].
4931 typedef struct MUST_USE_STRUCT LDKRouteParameters {
4933 * A pointer to the opaque Rust object.
4934 * Nearly everywhere, inner must be non-null, however in places where
4935 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4937 LDKnativeRouteParameters *inner;
4939 * Indicates that this is the only struct which contains the same pointer.
4940 * Rust functions which take ownership of an object provided via an argument require
4941 * this to be true and invalidate the object pointed to by inner.
4944 } LDKRouteParameters;
4947 * The contents of CResult_RouteParametersDecodeErrorZ
4949 typedef union LDKCResult_RouteParametersDecodeErrorZPtr {
4951 * A pointer to the contents in the success state.
4952 * Reading from this pointer when `result_ok` is not set is undefined.
4954 struct LDKRouteParameters *result;
4956 * A pointer to the contents in the error state.
4957 * Reading from this pointer when `result_ok` is set is undefined.
4959 struct LDKDecodeError *err;
4960 } LDKCResult_RouteParametersDecodeErrorZPtr;
4963 * A CResult_RouteParametersDecodeErrorZ represents the result of a fallible operation,
4964 * containing a crate::lightning::routing::router::RouteParameters on success and a crate::lightning::ln::msgs::DecodeError on failure.
4965 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4967 typedef struct LDKCResult_RouteParametersDecodeErrorZ {
4969 * The contents of this CResult_RouteParametersDecodeErrorZ, accessible via either
4970 * `err` or `result` depending on the state of `result_ok`.
4972 union LDKCResult_RouteParametersDecodeErrorZPtr contents;
4974 * Whether this CResult_RouteParametersDecodeErrorZ represents a success state.
4977 } LDKCResult_RouteParametersDecodeErrorZ;
4980 * A dynamically-allocated array of u64s of arbitrary size.
4981 * This corresponds to std::vector in C++
4983 typedef struct LDKCVec_u64Z {
4985 * The elements in the array.
4986 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
4990 * The number of elements pointed to by `data`.
4998 * Information used to route a payment.
5000 typedef struct MUST_USE_STRUCT LDKPaymentParameters {
5002 * A pointer to the opaque Rust object.
5003 * Nearly everywhere, inner must be non-null, however in places where
5004 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5006 LDKnativePaymentParameters *inner;
5008 * Indicates that this is the only struct which contains the same pointer.
5009 * Rust functions which take ownership of an object provided via an argument require
5010 * this to be true and invalidate the object pointed to by inner.
5013 } LDKPaymentParameters;
5016 * The contents of CResult_PaymentParametersDecodeErrorZ
5018 typedef union LDKCResult_PaymentParametersDecodeErrorZPtr {
5020 * A pointer to the contents in the success state.
5021 * Reading from this pointer when `result_ok` is not set is undefined.
5023 struct LDKPaymentParameters *result;
5025 * A pointer to the contents in the error state.
5026 * Reading from this pointer when `result_ok` is set is undefined.
5028 struct LDKDecodeError *err;
5029 } LDKCResult_PaymentParametersDecodeErrorZPtr;
5032 * A CResult_PaymentParametersDecodeErrorZ represents the result of a fallible operation,
5033 * containing a crate::lightning::routing::router::PaymentParameters on success and a crate::lightning::ln::msgs::DecodeError on failure.
5034 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5036 typedef struct LDKCResult_PaymentParametersDecodeErrorZ {
5038 * The contents of this CResult_PaymentParametersDecodeErrorZ, accessible via either
5039 * `err` or `result` depending on the state of `result_ok`.
5041 union LDKCResult_PaymentParametersDecodeErrorZPtr contents;
5043 * Whether this CResult_PaymentParametersDecodeErrorZ represents a success state.
5046 } LDKCResult_PaymentParametersDecodeErrorZ;
5051 * A list of hops along a payment path terminating with a channel to the recipient.
5053 typedef struct MUST_USE_STRUCT LDKRouteHint {
5055 * A pointer to the opaque Rust object.
5056 * Nearly everywhere, inner must be non-null, however in places where
5057 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5059 LDKnativeRouteHint *inner;
5061 * Indicates that this is the only struct which contains the same pointer.
5062 * Rust functions which take ownership of an object provided via an argument require
5063 * this to be true and invalidate the object pointed to by inner.
5069 * A dynamically-allocated array of crate::lightning::routing::router::RouteHints of arbitrary size.
5070 * This corresponds to std::vector in C++
5072 typedef struct LDKCVec_RouteHintZ {
5074 * The elements in the array.
5075 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
5077 struct LDKRouteHint *data;
5079 * The number of elements pointed to by `data`.
5082 } LDKCVec_RouteHintZ;
5087 * A channel descriptor for a hop along a payment path.
5089 * While this generally comes from BOLT 11's `r` field, this struct includes more fields than are
5090 * available in BOLT 11. Thus, encoding and decoding this via `lightning-invoice` is lossy, as
5091 * fields not supported in BOLT 11 will be stripped.
5093 typedef struct MUST_USE_STRUCT LDKRouteHintHop {
5095 * A pointer to the opaque Rust object.
5096 * Nearly everywhere, inner must be non-null, however in places where
5097 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5099 LDKnativeRouteHintHop *inner;
5101 * Indicates that this is the only struct which contains the same pointer.
5102 * Rust functions which take ownership of an object provided via an argument require
5103 * this to be true and invalidate the object pointed to by inner.
5109 * A dynamically-allocated array of crate::lightning::routing::router::RouteHintHops of arbitrary size.
5110 * This corresponds to std::vector in C++
5112 typedef struct LDKCVec_RouteHintHopZ {
5114 * The elements in the array.
5115 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
5117 struct LDKRouteHintHop *data;
5119 * The number of elements pointed to by `data`.
5122 } LDKCVec_RouteHintHopZ;
5125 * The contents of CResult_RouteHintDecodeErrorZ
5127 typedef union LDKCResult_RouteHintDecodeErrorZPtr {
5129 * A pointer to the contents in the success state.
5130 * Reading from this pointer when `result_ok` is not set is undefined.
5132 struct LDKRouteHint *result;
5134 * A pointer to the contents in the error state.
5135 * Reading from this pointer when `result_ok` is set is undefined.
5137 struct LDKDecodeError *err;
5138 } LDKCResult_RouteHintDecodeErrorZPtr;
5141 * A CResult_RouteHintDecodeErrorZ represents the result of a fallible operation,
5142 * containing a crate::lightning::routing::router::RouteHint on success and a crate::lightning::ln::msgs::DecodeError on failure.
5143 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5145 typedef struct LDKCResult_RouteHintDecodeErrorZ {
5147 * The contents of this CResult_RouteHintDecodeErrorZ, accessible via either
5148 * `err` or `result` depending on the state of `result_ok`.
5150 union LDKCResult_RouteHintDecodeErrorZPtr contents;
5152 * Whether this CResult_RouteHintDecodeErrorZ represents a success state.
5155 } LDKCResult_RouteHintDecodeErrorZ;
5158 * The contents of CResult_RouteHintHopDecodeErrorZ
5160 typedef union LDKCResult_RouteHintHopDecodeErrorZPtr {
5162 * A pointer to the contents in the success state.
5163 * Reading from this pointer when `result_ok` is not set is undefined.
5165 struct LDKRouteHintHop *result;
5167 * A pointer to the contents in the error state.
5168 * Reading from this pointer when `result_ok` is set is undefined.
5170 struct LDKDecodeError *err;
5171 } LDKCResult_RouteHintHopDecodeErrorZPtr;
5174 * A CResult_RouteHintHopDecodeErrorZ represents the result of a fallible operation,
5175 * containing a crate::lightning::routing::router::RouteHintHop on success and a crate::lightning::ln::msgs::DecodeError on failure.
5176 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5178 typedef struct LDKCResult_RouteHintHopDecodeErrorZ {
5180 * The contents of this CResult_RouteHintHopDecodeErrorZ, accessible via either
5181 * `err` or `result` depending on the state of `result_ok`.
5183 union LDKCResult_RouteHintHopDecodeErrorZPtr contents;
5185 * Whether this CResult_RouteHintHopDecodeErrorZ represents a success state.
5188 } LDKCResult_RouteHintHopDecodeErrorZ;
5193 * [`ScoreLookUp`] implementation that uses a fixed penalty.
5195 typedef struct MUST_USE_STRUCT LDKFixedPenaltyScorer {
5197 * A pointer to the opaque Rust object.
5198 * Nearly everywhere, inner must be non-null, however in places where
5199 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5201 LDKnativeFixedPenaltyScorer *inner;
5203 * Indicates that this is the only struct which contains the same pointer.
5204 * Rust functions which take ownership of an object provided via an argument require
5205 * this to be true and invalidate the object pointed to by inner.
5208 } LDKFixedPenaltyScorer;
5211 * The contents of CResult_FixedPenaltyScorerDecodeErrorZ
5213 typedef union LDKCResult_FixedPenaltyScorerDecodeErrorZPtr {
5215 * A pointer to the contents in the success state.
5216 * Reading from this pointer when `result_ok` is not set is undefined.
5218 struct LDKFixedPenaltyScorer *result;
5220 * A pointer to the contents in the error state.
5221 * Reading from this pointer when `result_ok` is set is undefined.
5223 struct LDKDecodeError *err;
5224 } LDKCResult_FixedPenaltyScorerDecodeErrorZPtr;
5227 * A CResult_FixedPenaltyScorerDecodeErrorZ represents the result of a fallible operation,
5228 * containing a crate::lightning::routing::scoring::FixedPenaltyScorer on success and a crate::lightning::ln::msgs::DecodeError on failure.
5229 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5231 typedef struct LDKCResult_FixedPenaltyScorerDecodeErrorZ {
5233 * The contents of this CResult_FixedPenaltyScorerDecodeErrorZ, accessible via either
5234 * `err` or `result` depending on the state of `result_ok`.
5236 union LDKCResult_FixedPenaltyScorerDecodeErrorZPtr contents;
5238 * Whether this CResult_FixedPenaltyScorerDecodeErrorZ represents a success state.
5241 } LDKCResult_FixedPenaltyScorerDecodeErrorZ;
5246 * Represents the compressed public key of a node
5248 typedef struct MUST_USE_STRUCT LDKNodeId {
5250 * A pointer to the opaque Rust object.
5251 * Nearly everywhere, inner must be non-null, however in places where
5252 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5254 LDKnativeNodeId *inner;
5256 * Indicates that this is the only struct which contains the same pointer.
5257 * Rust functions which take ownership of an object provided via an argument require
5258 * this to be true and invalidate the object pointed to by inner.
5264 * A dynamically-allocated array of crate::lightning::routing::gossip::NodeIds of arbitrary size.
5265 * This corresponds to std::vector in C++
5267 typedef struct LDKCVec_NodeIdZ {
5269 * The elements in the array.
5270 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
5272 struct LDKNodeId *data;
5274 * The number of elements pointed to by `data`.
5280 * A tuple of 2 elements. See the individual fields for the types contained.
5282 typedef struct LDKC2Tuple_u64u64Z {
5284 * The element at position 0
5288 * The element at position 1
5291 } LDKC2Tuple_u64u64Z;
5294 * An enum which can either contain a crate::c_types::derived::C2Tuple_u64u64Z or not
5296 typedef enum LDKCOption_C2Tuple_u64u64ZZ_Tag {
5298 * When we're in this state, this COption_C2Tuple_u64u64ZZ contains a crate::c_types::derived::C2Tuple_u64u64Z
5300 LDKCOption_C2Tuple_u64u64ZZ_Some,
5302 * When we're in this state, this COption_C2Tuple_u64u64ZZ contains nothing
5304 LDKCOption_C2Tuple_u64u64ZZ_None,
5306 * Must be last for serialization purposes
5308 LDKCOption_C2Tuple_u64u64ZZ_Sentinel,
5309 } LDKCOption_C2Tuple_u64u64ZZ_Tag;
5311 typedef struct LDKCOption_C2Tuple_u64u64ZZ {
5312 LDKCOption_C2Tuple_u64u64ZZ_Tag tag;
5315 struct LDKC2Tuple_u64u64Z some;
5318 } LDKCOption_C2Tuple_u64u64ZZ;
5323 typedef struct LDKThirtyTwoU16s {
5325 * The thirty-two 16-bit integers
5331 * A tuple of 2 elements. See the individual fields for the types contained.
5333 typedef struct LDKC2Tuple_Z {
5335 * The element at position 0
5337 struct LDKThirtyTwoU16s a;
5339 * The element at position 1
5341 struct LDKThirtyTwoU16s b;
5345 * A tuple of 2 elements. See the individual fields for the types contained.
5347 typedef struct LDKC2Tuple__u1632_u1632Z {
5349 * The element at position 0
5351 struct LDKThirtyTwoU16s a;
5353 * The element at position 1
5355 struct LDKThirtyTwoU16s b;
5356 } LDKC2Tuple__u1632_u1632Z;
5359 * An enum which can either contain a crate::c_types::derived::C2Tuple__u1632_u1632Z or not
5361 typedef enum LDKCOption_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ_Tag {
5363 * When we're in this state, this COption_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ contains a crate::c_types::derived::C2Tuple__u1632_u1632Z
5365 LDKCOption_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ_Some,
5367 * When we're in this state, this COption_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ contains nothing
5369 LDKCOption_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ_None,
5371 * Must be last for serialization purposes
5373 LDKCOption_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ_Sentinel,
5374 } LDKCOption_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ_Tag;
5376 typedef struct LDKCOption_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ {
5377 LDKCOption_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ_Tag tag;
5380 struct LDKC2Tuple__u1632_u1632Z some;
5383 } LDKCOption_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ;
5386 * An enum which can either contain a f64 or not
5388 typedef enum LDKCOption_f64Z_Tag {
5390 * When we're in this state, this COption_f64Z contains a f64
5392 LDKCOption_f64Z_Some,
5394 * When we're in this state, this COption_f64Z contains nothing
5396 LDKCOption_f64Z_None,
5398 * Must be last for serialization purposes
5400 LDKCOption_f64Z_Sentinel,
5401 } LDKCOption_f64Z_Tag;
5403 typedef struct LDKCOption_f64Z {
5404 LDKCOption_f64Z_Tag tag;
5415 * A Record, unit of logging output with Metadata to enable filtering
5416 * Module_path, file, line to inform on log's source
5418 typedef struct MUST_USE_STRUCT LDKRecord {
5420 * A pointer to the opaque Rust object.
5421 * Nearly everywhere, inner must be non-null, however in places where
5422 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5424 LDKnativeRecord *inner;
5426 * Indicates that this is the only struct which contains the same pointer.
5427 * Rust functions which take ownership of an object provided via an argument require
5428 * this to be true and invalidate the object pointed to by inner.
5434 * A trait encapsulating the operations required of a logger.
5436 typedef struct LDKLogger {
5438 * An opaque pointer which is passed to your function implementations as an argument.
5439 * This has no meaning in the LDK, and can be NULL or any other value.
5443 * Logs the [`Record`].
5445 void (*log)(const void *this_arg, struct LDKRecord record);
5447 * Frees any resources associated with this object given its this_arg pointer.
5448 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
5450 void (*free)(void *this_arg);
5456 * Represents the network as nodes and channels between them
5458 typedef struct MUST_USE_STRUCT LDKNetworkGraph {
5460 * A pointer to the opaque Rust object.
5461 * Nearly everywhere, inner must be non-null, however in places where
5462 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5464 LDKnativeNetworkGraph *inner;
5466 * Indicates that this is the only struct which contains the same pointer.
5467 * Rust functions which take ownership of an object provided via an argument require
5468 * this to be true and invalidate the object pointed to by inner.
5476 * [`ScoreLookUp`] implementation using channel success probability distributions.
5478 * Channels are tracked with upper and lower liquidity bounds - when an HTLC fails at a channel,
5479 * we learn that the upper-bound on the available liquidity is lower than the amount of the HTLC.
5480 * When a payment is forwarded through a channel (but fails later in the route), we learn the
5481 * lower-bound on the channel's available liquidity must be at least the value of the HTLC.
5483 * These bounds are then used to determine a success probability using the formula from
5484 * *Optimally Reliable & Cheap Payment Flows on the Lightning Network* by Rene Pickhardt
5485 * and Stefan Richter [[1]] (i.e. `(upper_bound - payment_amount) / (upper_bound - lower_bound)`).
5487 * This probability is combined with the [`liquidity_penalty_multiplier_msat`] and
5488 * [`liquidity_penalty_amount_multiplier_msat`] parameters to calculate a concrete penalty in
5489 * milli-satoshis. The penalties, when added across all hops, have the property of being linear in
5490 * terms of the entire path's success probability. This allows the router to directly compare
5491 * penalties for different paths. See the documentation of those parameters for the exact formulas.
5493 * The liquidity bounds are decayed by halving them every [`liquidity_offset_half_life`].
5495 * Further, we track the history of our upper and lower liquidity bounds for each channel,
5496 * allowing us to assign a second penalty (using [`historical_liquidity_penalty_multiplier_msat`]
5497 * and [`historical_liquidity_penalty_amount_multiplier_msat`]) based on the same probability
5498 * formula, but using the history of a channel rather than our latest estimates for the liquidity
5501 * [1]: https://arxiv.org/abs/2107.05322
5502 * [`liquidity_penalty_multiplier_msat`]: ProbabilisticScoringFeeParameters::liquidity_penalty_multiplier_msat
5503 * [`liquidity_penalty_amount_multiplier_msat`]: ProbabilisticScoringFeeParameters::liquidity_penalty_amount_multiplier_msat
5504 * [`liquidity_offset_half_life`]: ProbabilisticScoringDecayParameters::liquidity_offset_half_life
5505 * [`historical_liquidity_penalty_multiplier_msat`]: ProbabilisticScoringFeeParameters::historical_liquidity_penalty_multiplier_msat
5506 * [`historical_liquidity_penalty_amount_multiplier_msat`]: ProbabilisticScoringFeeParameters::historical_liquidity_penalty_amount_multiplier_msat
5508 typedef struct MUST_USE_STRUCT LDKProbabilisticScorer {
5510 * A pointer to the opaque Rust object.
5511 * Nearly everywhere, inner must be non-null, however in places where
5512 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5514 LDKnativeProbabilisticScorer *inner;
5516 * Indicates that this is the only struct which contains the same pointer.
5517 * Rust functions which take ownership of an object provided via an argument require
5518 * this to be true and invalidate the object pointed to by inner.
5521 } LDKProbabilisticScorer;
5524 * The contents of CResult_ProbabilisticScorerDecodeErrorZ
5526 typedef union LDKCResult_ProbabilisticScorerDecodeErrorZPtr {
5528 * A pointer to the contents in the success state.
5529 * Reading from this pointer when `result_ok` is not set is undefined.
5531 struct LDKProbabilisticScorer *result;
5533 * A pointer to the contents in the error state.
5534 * Reading from this pointer when `result_ok` is set is undefined.
5536 struct LDKDecodeError *err;
5537 } LDKCResult_ProbabilisticScorerDecodeErrorZPtr;
5540 * A CResult_ProbabilisticScorerDecodeErrorZ represents the result of a fallible operation,
5541 * containing a crate::lightning::routing::scoring::ProbabilisticScorer on success and a crate::lightning::ln::msgs::DecodeError on failure.
5542 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5544 typedef struct LDKCResult_ProbabilisticScorerDecodeErrorZ {
5546 * The contents of this CResult_ProbabilisticScorerDecodeErrorZ, accessible via either
5547 * `err` or `result` depending on the state of `result_ok`.
5549 union LDKCResult_ProbabilisticScorerDecodeErrorZPtr contents;
5551 * Whether this CResult_ProbabilisticScorerDecodeErrorZ represents a success state.
5554 } LDKCResult_ProbabilisticScorerDecodeErrorZ;
5559 * The best known block as identified by its hash and height.
5561 typedef struct MUST_USE_STRUCT LDKBestBlock {
5563 * A pointer to the opaque Rust object.
5564 * Nearly everywhere, inner must be non-null, however in places where
5565 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5567 LDKnativeBestBlock *inner;
5569 * Indicates that this is the only struct which contains the same pointer.
5570 * Rust functions which take ownership of an object provided via an argument require
5571 * this to be true and invalidate the object pointed to by inner.
5577 * The contents of CResult_BestBlockDecodeErrorZ
5579 typedef union LDKCResult_BestBlockDecodeErrorZPtr {
5581 * A pointer to the contents in the success state.
5582 * Reading from this pointer when `result_ok` is not set is undefined.
5584 struct LDKBestBlock *result;
5586 * A pointer to the contents in the error state.
5587 * Reading from this pointer when `result_ok` is set is undefined.
5589 struct LDKDecodeError *err;
5590 } LDKCResult_BestBlockDecodeErrorZPtr;
5593 * A CResult_BestBlockDecodeErrorZ represents the result of a fallible operation,
5594 * containing a crate::lightning::chain::BestBlock on success and a crate::lightning::ln::msgs::DecodeError on failure.
5595 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5597 typedef struct LDKCResult_BestBlockDecodeErrorZ {
5599 * The contents of this CResult_BestBlockDecodeErrorZ, accessible via either
5600 * `err` or `result` depending on the state of `result_ok`.
5602 union LDKCResult_BestBlockDecodeErrorZPtr contents;
5604 * Whether this CResult_BestBlockDecodeErrorZ represents a success state.
5607 } LDKCResult_BestBlockDecodeErrorZ;
5610 * A tuple of 2 elements. See the individual fields for the types contained.
5612 typedef struct LDKC2Tuple_usizeTransactionZ {
5614 * The element at position 0
5618 * The element at position 1
5620 struct LDKTransaction b;
5621 } LDKC2Tuple_usizeTransactionZ;
5624 * A dynamically-allocated array of crate::c_types::derived::C2Tuple_usizeTransactionZs of arbitrary size.
5625 * This corresponds to std::vector in C++
5627 typedef struct LDKCVec_C2Tuple_usizeTransactionZZ {
5629 * The elements in the array.
5630 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
5632 struct LDKC2Tuple_usizeTransactionZ *data;
5634 * The number of elements pointed to by `data`.
5637 } LDKCVec_C2Tuple_usizeTransactionZZ;
5640 * A tuple of 3 elements. See the individual fields for the types contained.
5642 typedef struct LDKC3Tuple_ThirtyTwoBytesu32COption_ThirtyTwoBytesZZ {
5644 * The element at position 0
5646 struct LDKThirtyTwoBytes a;
5648 * The element at position 1
5652 * The element at position 2
5654 struct LDKCOption_ThirtyTwoBytesZ c;
5655 } LDKC3Tuple_ThirtyTwoBytesu32COption_ThirtyTwoBytesZZ;
5658 * A dynamically-allocated array of crate::c_types::derived::C3Tuple_ThirtyTwoBytesu32COption_ThirtyTwoBytesZZs of arbitrary size.
5659 * This corresponds to std::vector in C++
5661 typedef struct LDKCVec_C3Tuple_ThirtyTwoBytesu32COption_ThirtyTwoBytesZZZ {
5663 * The elements in the array.
5664 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
5666 struct LDKC3Tuple_ThirtyTwoBytesu32COption_ThirtyTwoBytesZZ *data;
5668 * The number of elements pointed to by `data`.
5671 } LDKCVec_C3Tuple_ThirtyTwoBytesu32COption_ThirtyTwoBytesZZZ;
5674 * The contents of CResult_ChannelMonitorUpdateStatusNoneZ
5676 typedef union LDKCResult_ChannelMonitorUpdateStatusNoneZPtr {
5678 * A pointer to the contents in the success state.
5679 * Reading from this pointer when `result_ok` is not set is undefined.
5681 enum LDKChannelMonitorUpdateStatus *result;
5683 * Note that this value is always NULL, as there are no contents in the Err variant
5686 } LDKCResult_ChannelMonitorUpdateStatusNoneZPtr;
5689 * A CResult_ChannelMonitorUpdateStatusNoneZ represents the result of a fallible operation,
5690 * containing a crate::lightning::chain::ChannelMonitorUpdateStatus on success and a () on failure.
5691 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5693 typedef struct LDKCResult_ChannelMonitorUpdateStatusNoneZ {
5695 * The contents of this CResult_ChannelMonitorUpdateStatusNoneZ, accessible via either
5696 * `err` or `result` depending on the state of `result_ok`.
5698 union LDKCResult_ChannelMonitorUpdateStatusNoneZPtr contents;
5700 * Whether this CResult_ChannelMonitorUpdateStatusNoneZ represents a success state.
5703 } LDKCResult_ChannelMonitorUpdateStatusNoneZ;
5708 * Simple structure sent back by `chain::Watch` when an HTLC from a forward channel is detected on
5709 * chain. Used to update the corresponding HTLC in the backward channel. Failing to pass the
5710 * preimage claim backward will lead to loss of funds.
5712 typedef struct MUST_USE_STRUCT LDKHTLCUpdate {
5714 * A pointer to the opaque Rust object.
5715 * Nearly everywhere, inner must be non-null, however in places where
5716 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5718 LDKnativeHTLCUpdate *inner;
5720 * Indicates that this is the only struct which contains the same pointer.
5721 * Rust functions which take ownership of an object provided via an argument require
5722 * this to be true and invalidate the object pointed to by inner.
5730 * Struct to `Display` fields in a safe way using `PrintableString`
5732 typedef struct MUST_USE_STRUCT LDKUntrustedString {
5734 * A pointer to the opaque Rust object.
5735 * Nearly everywhere, inner must be non-null, however in places where
5736 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5738 LDKnativeUntrustedString *inner;
5740 * Indicates that this is the only struct which contains the same pointer.
5741 * Rust functions which take ownership of an object provided via an argument require
5742 * this to be true and invalidate the object pointed to by inner.
5745 } LDKUntrustedString;
5748 * The reason the channel was closed. See individual variants for more details.
5750 typedef enum LDKClosureReason_Tag {
5752 * Closure generated from receiving a peer error message.
5754 * Our counterparty may have broadcasted their latest commitment state, and we have
5757 LDKClosureReason_CounterpartyForceClosed,
5759 * Closure generated from [`ChannelManager::force_close_channel`], called by the user.
5761 * [`ChannelManager::force_close_channel`]: crate::ln::channelmanager::ChannelManager::force_close_channel.
5763 LDKClosureReason_HolderForceClosed,
5765 * The channel was closed after negotiating a cooperative close and we've now broadcasted
5766 * the cooperative close transaction. Note the shutdown may have been initiated by us.
5768 * This was only set in versions of LDK prior to 0.0.122.
5770 LDKClosureReason_LegacyCooperativeClosure,
5772 * The channel was closed after negotiating a cooperative close and we've now broadcasted
5773 * the cooperative close transaction. This indicates that the shutdown was initiated by our
5776 * In rare cases where we initiated closure immediately prior to shutting down without
5777 * persisting, this value may be provided for channels we initiated closure for.
5779 LDKClosureReason_CounterpartyInitiatedCooperativeClosure,
5781 * The channel was closed after negotiating a cooperative close and we've now broadcasted
5782 * the cooperative close transaction. This indicates that the shutdown was initiated by us.
5784 LDKClosureReason_LocallyInitiatedCooperativeClosure,
5786 * A commitment transaction was confirmed on chain, closing the channel. Most likely this
5787 * commitment transaction came from our counterparty, but it may also have come from
5788 * a copy of our own `ChannelMonitor`.
5790 LDKClosureReason_CommitmentTxConfirmed,
5792 * The funding transaction failed to confirm in a timely manner on an inbound channel.
5794 LDKClosureReason_FundingTimedOut,
5796 * Closure generated from processing an event, likely a HTLC forward/relay/reception.
5798 LDKClosureReason_ProcessingError,
5800 * The peer disconnected prior to funding completing. In this case the spec mandates that we
5801 * forget the channel entirely - we can attempt again if the peer reconnects.
5803 * This includes cases where we restarted prior to funding completion, including prior to the
5804 * initial [`ChannelMonitor`] persistence completing.
5806 * In LDK versions prior to 0.0.107 this could also occur if we were unable to connect to the
5807 * peer because of mutual incompatibility between us and our channel counterparty.
5809 * [`ChannelMonitor`]: crate::chain::channelmonitor::ChannelMonitor
5811 LDKClosureReason_DisconnectedPeer,
5813 * Closure generated from `ChannelManager::read` if the [`ChannelMonitor`] is newer than
5814 * the [`ChannelManager`] deserialized.
5816 * [`ChannelMonitor`]: crate::chain::channelmonitor::ChannelMonitor
5817 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
5819 LDKClosureReason_OutdatedChannelManager,
5821 * The counterparty requested a cooperative close of a channel that had not been funded yet.
5822 * The channel has been immediately closed.
5824 LDKClosureReason_CounterpartyCoopClosedUnfundedChannel,
5826 * Another channel in the same funding batch closed before the funding transaction
5827 * was ready to be broadcast.
5829 LDKClosureReason_FundingBatchClosure,
5831 * One of our HTLCs timed out in a channel, causing us to force close the channel.
5833 LDKClosureReason_HTLCsTimedOut,
5835 * Must be last for serialization purposes
5837 LDKClosureReason_Sentinel,
5838 } LDKClosureReason_Tag;
5840 typedef struct LDKClosureReason_LDKCounterpartyForceClosed_Body {
5842 * The error which the peer sent us.
5844 * Be careful about printing the peer_msg, a well-crafted message could exploit
5845 * a security vulnerability in the terminal emulator or the logging subsystem.
5846 * To be safe, use `Display` on `UntrustedString`
5848 * [`UntrustedString`]: crate::util::string::UntrustedString
5850 struct LDKUntrustedString peer_msg;
5851 } LDKClosureReason_LDKCounterpartyForceClosed_Body;
5853 typedef struct LDKClosureReason_LDKProcessingError_Body {
5855 * A developer-readable error message which we generated.
5858 } LDKClosureReason_LDKProcessingError_Body;
5860 typedef struct MUST_USE_STRUCT LDKClosureReason {
5861 LDKClosureReason_Tag tag;
5863 LDKClosureReason_LDKCounterpartyForceClosed_Body counterparty_force_closed;
5864 LDKClosureReason_LDKProcessingError_Body processing_error;
5871 * A unique 32-byte identifier for a channel.
5872 * Depending on how the ID is generated, several varieties are distinguished
5873 * (but all are stored as 32 bytes):
5874 * _v1_ and _temporary_.
5875 * A _v1_ channel ID is generated based on funding tx outpoint (txid & index).
5876 * A _temporary_ ID is generated randomly.
5877 * (Later revocation-point-based _v2_ is a possibility.)
5878 * The variety (context) is not stored, it is relevant only at creation.
5880 typedef struct MUST_USE_STRUCT LDKChannelId {
5882 * A pointer to the opaque Rust object.
5883 * Nearly everywhere, inner must be non-null, however in places where
5884 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5886 LDKnativeChannelId *inner;
5888 * Indicates that this is the only struct which contains the same pointer.
5889 * Rust functions which take ownership of an object provided via an argument require
5890 * this to be true and invalidate the object pointed to by inner.
5896 * An event to be processed by the ChannelManager.
5898 typedef enum LDKMonitorEvent_Tag {
5900 * A monitor event containing an HTLCUpdate.
5902 LDKMonitorEvent_HTLCEvent,
5904 * Indicates we broadcasted the channel's latest commitment transaction and thus closed the
5905 * channel. Holds information about the channel and why it was closed.
5907 LDKMonitorEvent_HolderForceClosedWithInfo,
5909 * Indicates we broadcasted the channel's latest commitment transaction and thus closed the
5912 LDKMonitorEvent_HolderForceClosed,
5914 * Indicates a [`ChannelMonitor`] update has completed. See
5915 * [`ChannelMonitorUpdateStatus::InProgress`] for more information on how this is used.
5917 * [`ChannelMonitorUpdateStatus::InProgress`]: super::ChannelMonitorUpdateStatus::InProgress
5919 LDKMonitorEvent_Completed,
5921 * Must be last for serialization purposes
5923 LDKMonitorEvent_Sentinel,
5924 } LDKMonitorEvent_Tag;
5926 typedef struct LDKMonitorEvent_LDKHolderForceClosedWithInfo_Body {
5928 * The reason the channel was closed.
5930 struct LDKClosureReason reason;
5932 * The funding outpoint of the channel.
5934 struct LDKOutPoint outpoint;
5936 * The channel ID of the channel.
5938 struct LDKChannelId channel_id;
5939 } LDKMonitorEvent_LDKHolderForceClosedWithInfo_Body;
5941 typedef struct LDKMonitorEvent_LDKCompleted_Body {
5943 * The funding outpoint of the [`ChannelMonitor`] that was updated
5945 struct LDKOutPoint funding_txo;
5947 * The channel ID of the channel associated with the [`ChannelMonitor`]
5949 struct LDKChannelId channel_id;
5951 * The Update ID from [`ChannelMonitorUpdate::update_id`] which was applied or
5952 * [`ChannelMonitor::get_latest_update_id`].
5954 * Note that this should only be set to a given update's ID if all previous updates for the
5955 * same [`ChannelMonitor`] have been applied and persisted.
5957 uint64_t monitor_update_id;
5958 } LDKMonitorEvent_LDKCompleted_Body;
5960 typedef struct MUST_USE_STRUCT LDKMonitorEvent {
5961 LDKMonitorEvent_Tag tag;
5964 struct LDKHTLCUpdate htlc_event;
5966 LDKMonitorEvent_LDKHolderForceClosedWithInfo_Body holder_force_closed_with_info;
5968 struct LDKOutPoint holder_force_closed;
5970 LDKMonitorEvent_LDKCompleted_Body completed;
5975 * A dynamically-allocated array of crate::lightning::chain::channelmonitor::MonitorEvents of arbitrary size.
5976 * This corresponds to std::vector in C++
5978 typedef struct LDKCVec_MonitorEventZ {
5980 * The elements in the array.
5981 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
5983 struct LDKMonitorEvent *data;
5985 * The number of elements pointed to by `data`.
5988 } LDKCVec_MonitorEventZ;
5991 * A tuple of 4 elements. See the individual fields for the types contained.
5993 typedef struct LDKC4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ {
5995 * The element at position 0
5997 struct LDKOutPoint a;
5999 * The element at position 1
6001 struct LDKChannelId b;
6003 * The element at position 2
6005 struct LDKCVec_MonitorEventZ c;
6007 * The element at position 3
6009 struct LDKPublicKey d;
6010 } LDKC4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ;
6013 * A dynamically-allocated array of crate::c_types::derived::C4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZs of arbitrary size.
6014 * This corresponds to std::vector in C++
6016 typedef struct LDKCVec_C4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZZ {
6018 * The elements in the array.
6019 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
6021 struct LDKC4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ *data;
6023 * The number of elements pointed to by `data`.
6026 } LDKCVec_C4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZZ;
6031 * Features used within an `init` message.
6033 typedef struct MUST_USE_STRUCT LDKInitFeatures {
6035 * A pointer to the opaque Rust object.
6036 * Nearly everywhere, inner must be non-null, however in places where
6037 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6039 LDKnativeInitFeatures *inner;
6041 * Indicates that this is the only struct which contains the same pointer.
6042 * Rust functions which take ownership of an object provided via an argument require
6043 * this to be true and invalidate the object pointed to by inner.
6049 * The contents of CResult_InitFeaturesDecodeErrorZ
6051 typedef union LDKCResult_InitFeaturesDecodeErrorZPtr {
6053 * A pointer to the contents in the success state.
6054 * Reading from this pointer when `result_ok` is not set is undefined.
6056 struct LDKInitFeatures *result;
6058 * A pointer to the contents in the error state.
6059 * Reading from this pointer when `result_ok` is set is undefined.
6061 struct LDKDecodeError *err;
6062 } LDKCResult_InitFeaturesDecodeErrorZPtr;
6065 * A CResult_InitFeaturesDecodeErrorZ represents the result of a fallible operation,
6066 * containing a crate::lightning::ln::features::InitFeatures on success and a crate::lightning::ln::msgs::DecodeError on failure.
6067 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6069 typedef struct LDKCResult_InitFeaturesDecodeErrorZ {
6071 * The contents of this CResult_InitFeaturesDecodeErrorZ, accessible via either
6072 * `err` or `result` depending on the state of `result_ok`.
6074 union LDKCResult_InitFeaturesDecodeErrorZPtr contents;
6076 * Whether this CResult_InitFeaturesDecodeErrorZ represents a success state.
6079 } LDKCResult_InitFeaturesDecodeErrorZ;
6084 * Features used within a `channel_announcement` message.
6086 typedef struct MUST_USE_STRUCT LDKChannelFeatures {
6088 * A pointer to the opaque Rust object.
6089 * Nearly everywhere, inner must be non-null, however in places where
6090 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6092 LDKnativeChannelFeatures *inner;
6094 * Indicates that this is the only struct which contains the same pointer.
6095 * Rust functions which take ownership of an object provided via an argument require
6096 * this to be true and invalidate the object pointed to by inner.
6099 } LDKChannelFeatures;
6102 * The contents of CResult_ChannelFeaturesDecodeErrorZ
6104 typedef union LDKCResult_ChannelFeaturesDecodeErrorZPtr {
6106 * A pointer to the contents in the success state.
6107 * Reading from this pointer when `result_ok` is not set is undefined.
6109 struct LDKChannelFeatures *result;
6111 * A pointer to the contents in the error state.
6112 * Reading from this pointer when `result_ok` is set is undefined.
6114 struct LDKDecodeError *err;
6115 } LDKCResult_ChannelFeaturesDecodeErrorZPtr;
6118 * A CResult_ChannelFeaturesDecodeErrorZ represents the result of a fallible operation,
6119 * containing a crate::lightning::ln::features::ChannelFeatures on success and a crate::lightning::ln::msgs::DecodeError on failure.
6120 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6122 typedef struct LDKCResult_ChannelFeaturesDecodeErrorZ {
6124 * The contents of this CResult_ChannelFeaturesDecodeErrorZ, accessible via either
6125 * `err` or `result` depending on the state of `result_ok`.
6127 union LDKCResult_ChannelFeaturesDecodeErrorZPtr contents;
6129 * Whether this CResult_ChannelFeaturesDecodeErrorZ represents a success state.
6132 } LDKCResult_ChannelFeaturesDecodeErrorZ;
6137 * Features used within a `node_announcement` message.
6139 typedef struct MUST_USE_STRUCT LDKNodeFeatures {
6141 * A pointer to the opaque Rust object.
6142 * Nearly everywhere, inner must be non-null, however in places where
6143 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6145 LDKnativeNodeFeatures *inner;
6147 * Indicates that this is the only struct which contains the same pointer.
6148 * Rust functions which take ownership of an object provided via an argument require
6149 * this to be true and invalidate the object pointed to by inner.
6155 * The contents of CResult_NodeFeaturesDecodeErrorZ
6157 typedef union LDKCResult_NodeFeaturesDecodeErrorZPtr {
6159 * A pointer to the contents in the success state.
6160 * Reading from this pointer when `result_ok` is not set is undefined.
6162 struct LDKNodeFeatures *result;
6164 * A pointer to the contents in the error state.
6165 * Reading from this pointer when `result_ok` is set is undefined.
6167 struct LDKDecodeError *err;
6168 } LDKCResult_NodeFeaturesDecodeErrorZPtr;
6171 * A CResult_NodeFeaturesDecodeErrorZ represents the result of a fallible operation,
6172 * containing a crate::lightning::ln::features::NodeFeatures on success and a crate::lightning::ln::msgs::DecodeError on failure.
6173 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6175 typedef struct LDKCResult_NodeFeaturesDecodeErrorZ {
6177 * The contents of this CResult_NodeFeaturesDecodeErrorZ, accessible via either
6178 * `err` or `result` depending on the state of `result_ok`.
6180 union LDKCResult_NodeFeaturesDecodeErrorZPtr contents;
6182 * Whether this CResult_NodeFeaturesDecodeErrorZ represents a success state.
6185 } LDKCResult_NodeFeaturesDecodeErrorZ;
6190 * Features used within an invoice.
6192 typedef struct MUST_USE_STRUCT LDKBolt11InvoiceFeatures {
6194 * A pointer to the opaque Rust object.
6195 * Nearly everywhere, inner must be non-null, however in places where
6196 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6198 LDKnativeBolt11InvoiceFeatures *inner;
6200 * Indicates that this is the only struct which contains the same pointer.
6201 * Rust functions which take ownership of an object provided via an argument require
6202 * this to be true and invalidate the object pointed to by inner.
6205 } LDKBolt11InvoiceFeatures;
6208 * The contents of CResult_Bolt11InvoiceFeaturesDecodeErrorZ
6210 typedef union LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZPtr {
6212 * A pointer to the contents in the success state.
6213 * Reading from this pointer when `result_ok` is not set is undefined.
6215 struct LDKBolt11InvoiceFeatures *result;
6217 * A pointer to the contents in the error state.
6218 * Reading from this pointer when `result_ok` is set is undefined.
6220 struct LDKDecodeError *err;
6221 } LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZPtr;
6224 * A CResult_Bolt11InvoiceFeaturesDecodeErrorZ represents the result of a fallible operation,
6225 * containing a crate::lightning::ln::features::Bolt11InvoiceFeatures on success and a crate::lightning::ln::msgs::DecodeError on failure.
6226 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6228 typedef struct LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZ {
6230 * The contents of this CResult_Bolt11InvoiceFeaturesDecodeErrorZ, accessible via either
6231 * `err` or `result` depending on the state of `result_ok`.
6233 union LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZPtr contents;
6235 * Whether this CResult_Bolt11InvoiceFeaturesDecodeErrorZ represents a success state.
6238 } LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZ;
6243 * Features used within an `invoice`.
6245 typedef struct MUST_USE_STRUCT LDKBolt12InvoiceFeatures {
6247 * A pointer to the opaque Rust object.
6248 * Nearly everywhere, inner must be non-null, however in places where
6249 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6251 LDKnativeBolt12InvoiceFeatures *inner;
6253 * Indicates that this is the only struct which contains the same pointer.
6254 * Rust functions which take ownership of an object provided via an argument require
6255 * this to be true and invalidate the object pointed to by inner.
6258 } LDKBolt12InvoiceFeatures;
6261 * The contents of CResult_Bolt12InvoiceFeaturesDecodeErrorZ
6263 typedef union LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZPtr {
6265 * A pointer to the contents in the success state.
6266 * Reading from this pointer when `result_ok` is not set is undefined.
6268 struct LDKBolt12InvoiceFeatures *result;
6270 * A pointer to the contents in the error state.
6271 * Reading from this pointer when `result_ok` is set is undefined.
6273 struct LDKDecodeError *err;
6274 } LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZPtr;
6277 * A CResult_Bolt12InvoiceFeaturesDecodeErrorZ represents the result of a fallible operation,
6278 * containing a crate::lightning::ln::features::Bolt12InvoiceFeatures on success and a crate::lightning::ln::msgs::DecodeError on failure.
6279 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6281 typedef struct LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZ {
6283 * The contents of this CResult_Bolt12InvoiceFeaturesDecodeErrorZ, accessible via either
6284 * `err` or `result` depending on the state of `result_ok`.
6286 union LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZPtr contents;
6288 * Whether this CResult_Bolt12InvoiceFeaturesDecodeErrorZ represents a success state.
6291 } LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZ;
6296 * Features used within BOLT 4 encrypted_data_tlv and BOLT 12 blinded_payinfo
6298 typedef struct MUST_USE_STRUCT LDKBlindedHopFeatures {
6300 * A pointer to the opaque Rust object.
6301 * Nearly everywhere, inner must be non-null, however in places where
6302 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6304 LDKnativeBlindedHopFeatures *inner;
6306 * Indicates that this is the only struct which contains the same pointer.
6307 * Rust functions which take ownership of an object provided via an argument require
6308 * this to be true and invalidate the object pointed to by inner.
6311 } LDKBlindedHopFeatures;
6314 * The contents of CResult_BlindedHopFeaturesDecodeErrorZ
6316 typedef union LDKCResult_BlindedHopFeaturesDecodeErrorZPtr {
6318 * A pointer to the contents in the success state.
6319 * Reading from this pointer when `result_ok` is not set is undefined.
6321 struct LDKBlindedHopFeatures *result;
6323 * A pointer to the contents in the error state.
6324 * Reading from this pointer when `result_ok` is set is undefined.
6326 struct LDKDecodeError *err;
6327 } LDKCResult_BlindedHopFeaturesDecodeErrorZPtr;
6330 * A CResult_BlindedHopFeaturesDecodeErrorZ represents the result of a fallible operation,
6331 * containing a crate::lightning::ln::features::BlindedHopFeatures on success and a crate::lightning::ln::msgs::DecodeError on failure.
6332 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6334 typedef struct LDKCResult_BlindedHopFeaturesDecodeErrorZ {
6336 * The contents of this CResult_BlindedHopFeaturesDecodeErrorZ, accessible via either
6337 * `err` or `result` depending on the state of `result_ok`.
6339 union LDKCResult_BlindedHopFeaturesDecodeErrorZPtr contents;
6341 * Whether this CResult_BlindedHopFeaturesDecodeErrorZ represents a success state.
6344 } LDKCResult_BlindedHopFeaturesDecodeErrorZ;
6349 * Features used within the channel_type field in an OpenChannel message.
6351 * A channel is always of some known \"type\", describing the transaction formats used and the exact
6352 * semantics of our interaction with our peer.
6354 * Note that because a channel is a specific type which is proposed by the opener and accepted by
6355 * the counterparty, only required features are allowed here.
6357 * This is serialized differently from other feature types - it is not prefixed by a length, and
6358 * thus must only appear inside a TLV where its length is known in advance.
6360 typedef struct MUST_USE_STRUCT LDKChannelTypeFeatures {
6362 * A pointer to the opaque Rust object.
6363 * Nearly everywhere, inner must be non-null, however in places where
6364 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6366 LDKnativeChannelTypeFeatures *inner;
6368 * Indicates that this is the only struct which contains the same pointer.
6369 * Rust functions which take ownership of an object provided via an argument require
6370 * this to be true and invalidate the object pointed to by inner.
6373 } LDKChannelTypeFeatures;
6376 * The contents of CResult_ChannelTypeFeaturesDecodeErrorZ
6378 typedef union LDKCResult_ChannelTypeFeaturesDecodeErrorZPtr {
6380 * A pointer to the contents in the success state.
6381 * Reading from this pointer when `result_ok` is not set is undefined.
6383 struct LDKChannelTypeFeatures *result;
6385 * A pointer to the contents in the error state.
6386 * Reading from this pointer when `result_ok` is set is undefined.
6388 struct LDKDecodeError *err;
6389 } LDKCResult_ChannelTypeFeaturesDecodeErrorZPtr;
6392 * A CResult_ChannelTypeFeaturesDecodeErrorZ represents the result of a fallible operation,
6393 * containing a crate::lightning::ln::features::ChannelTypeFeatures on success and a crate::lightning::ln::msgs::DecodeError on failure.
6394 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6396 typedef struct LDKCResult_ChannelTypeFeaturesDecodeErrorZ {
6398 * The contents of this CResult_ChannelTypeFeaturesDecodeErrorZ, accessible via either
6399 * `err` or `result` depending on the state of `result_ok`.
6401 union LDKCResult_ChannelTypeFeaturesDecodeErrorZPtr contents;
6403 * Whether this CResult_ChannelTypeFeaturesDecodeErrorZ represents a success state.
6406 } LDKCResult_ChannelTypeFeaturesDecodeErrorZ;
6411 * An identifier for an [`Offer`] built using [`DerivedMetadata`].
6413 typedef struct MUST_USE_STRUCT LDKOfferId {
6415 * A pointer to the opaque Rust object.
6416 * Nearly everywhere, inner must be non-null, however in places where
6417 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6419 LDKnativeOfferId *inner;
6421 * Indicates that this is the only struct which contains the same pointer.
6422 * Rust functions which take ownership of an object provided via an argument require
6423 * this to be true and invalidate the object pointed to by inner.
6429 * The contents of CResult_OfferIdDecodeErrorZ
6431 typedef union LDKCResult_OfferIdDecodeErrorZPtr {
6433 * A pointer to the contents in the success state.
6434 * Reading from this pointer when `result_ok` is not set is undefined.
6436 struct LDKOfferId *result;
6438 * A pointer to the contents in the error state.
6439 * Reading from this pointer when `result_ok` is set is undefined.
6441 struct LDKDecodeError *err;
6442 } LDKCResult_OfferIdDecodeErrorZPtr;
6445 * A CResult_OfferIdDecodeErrorZ represents the result of a fallible operation,
6446 * containing a crate::lightning::offers::offer::OfferId on success and a crate::lightning::ln::msgs::DecodeError on failure.
6447 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6449 typedef struct LDKCResult_OfferIdDecodeErrorZ {
6451 * The contents of this CResult_OfferIdDecodeErrorZ, accessible via either
6452 * `err` or `result` depending on the state of `result_ok`.
6454 union LDKCResult_OfferIdDecodeErrorZPtr contents;
6456 * Whether this CResult_OfferIdDecodeErrorZ represents a success state.
6459 } LDKCResult_OfferIdDecodeErrorZ;
6462 * The contents of CResult_NoneBolt12SemanticErrorZ
6464 typedef union LDKCResult_NoneBolt12SemanticErrorZPtr {
6466 * Note that this value is always NULL, as there are no contents in the OK variant
6470 * A pointer to the contents in the error state.
6471 * Reading from this pointer when `result_ok` is set is undefined.
6473 enum LDKBolt12SemanticError *err;
6474 } LDKCResult_NoneBolt12SemanticErrorZPtr;
6477 * A CResult_NoneBolt12SemanticErrorZ represents the result of a fallible operation,
6478 * containing a () on success and a crate::lightning::offers::parse::Bolt12SemanticError on failure.
6479 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6481 typedef struct LDKCResult_NoneBolt12SemanticErrorZ {
6483 * The contents of this CResult_NoneBolt12SemanticErrorZ, accessible via either
6484 * `err` or `result` depending on the state of `result_ok`.
6486 union LDKCResult_NoneBolt12SemanticErrorZPtr contents;
6488 * Whether this CResult_NoneBolt12SemanticErrorZ represents a success state.
6491 } LDKCResult_NoneBolt12SemanticErrorZ;
6496 * An `Offer` is a potentially long-lived proposal for payment of a good or service.
6498 * An offer is a precursor to an [`InvoiceRequest`]. A merchant publishes an offer from which a
6499 * customer may request an [`Bolt12Invoice`] for a specific quantity and using an amount sufficient
6500 * to cover that quantity (i.e., at least `quantity * amount`). See [`Offer::amount`].
6502 * Offers may be denominated in currency other than bitcoin but are ultimately paid using the
6505 * Through the use of [`BlindedPath`]s, offers provide recipient privacy.
6507 * [`InvoiceRequest`]: crate::offers::invoice_request::InvoiceRequest
6508 * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice
6510 typedef struct MUST_USE_STRUCT LDKOffer {
6512 * A pointer to the opaque Rust object.
6513 * Nearly everywhere, inner must be non-null, however in places where
6514 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6516 LDKnativeOffer *inner;
6518 * Indicates that this is the only struct which contains the same pointer.
6519 * Rust functions which take ownership of an object provided via an argument require
6520 * this to be true and invalidate the object pointed to by inner.
6526 * The contents of CResult_OfferBolt12SemanticErrorZ
6528 typedef union LDKCResult_OfferBolt12SemanticErrorZPtr {
6530 * A pointer to the contents in the success state.
6531 * Reading from this pointer when `result_ok` is not set is undefined.
6533 struct LDKOffer *result;
6535 * A pointer to the contents in the error state.
6536 * Reading from this pointer when `result_ok` is set is undefined.
6538 enum LDKBolt12SemanticError *err;
6539 } LDKCResult_OfferBolt12SemanticErrorZPtr;
6542 * A CResult_OfferBolt12SemanticErrorZ represents the result of a fallible operation,
6543 * containing a crate::lightning::offers::offer::Offer on success and a crate::lightning::offers::parse::Bolt12SemanticError on failure.
6544 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6546 typedef struct LDKCResult_OfferBolt12SemanticErrorZ {
6548 * The contents of this CResult_OfferBolt12SemanticErrorZ, accessible via either
6549 * `err` or `result` depending on the state of `result_ok`.
6551 union LDKCResult_OfferBolt12SemanticErrorZPtr contents;
6553 * Whether this CResult_OfferBolt12SemanticErrorZ represents a success state.
6556 } LDKCResult_OfferBolt12SemanticErrorZ;
6561 * Builds an [`InvoiceRequest`] from an [`Offer`] for the \"offer to be paid\" flow.
6563 * See [module-level documentation] for usage.
6565 * [module-level documentation]: self
6567 typedef struct MUST_USE_STRUCT LDKInvoiceRequestWithDerivedPayerIdBuilder {
6569 * A pointer to the opaque Rust object.
6570 * Nearly everywhere, inner must be non-null, however in places where
6571 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6573 LDKnativeInvoiceRequestWithDerivedPayerIdBuilder *inner;
6575 * Indicates that this is the only struct which contains the same pointer.
6576 * Rust functions which take ownership of an object provided via an argument require
6577 * this to be true and invalidate the object pointed to by inner.
6580 } LDKInvoiceRequestWithDerivedPayerIdBuilder;
6583 * The contents of CResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ
6585 typedef union LDKCResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZPtr {
6587 * A pointer to the contents in the success state.
6588 * Reading from this pointer when `result_ok` is not set is undefined.
6590 struct LDKInvoiceRequestWithDerivedPayerIdBuilder *result;
6592 * A pointer to the contents in the error state.
6593 * Reading from this pointer when `result_ok` is set is undefined.
6595 enum LDKBolt12SemanticError *err;
6596 } LDKCResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZPtr;
6599 * A CResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ represents the result of a fallible operation,
6600 * containing a crate::lightning::offers::invoice_request::InvoiceRequestWithDerivedPayerIdBuilder on success and a crate::lightning::offers::parse::Bolt12SemanticError on failure.
6601 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6603 typedef struct LDKCResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ {
6605 * The contents of this CResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ, accessible via either
6606 * `err` or `result` depending on the state of `result_ok`.
6608 union LDKCResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZPtr contents;
6610 * Whether this CResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ represents a success state.
6613 } LDKCResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ;
6618 * Builds an [`InvoiceRequest`] from an [`Offer`] for the \"offer to be paid\" flow.
6620 * See [module-level documentation] for usage.
6622 * [module-level documentation]: self
6624 typedef struct MUST_USE_STRUCT LDKInvoiceRequestWithExplicitPayerIdBuilder {
6626 * A pointer to the opaque Rust object.
6627 * Nearly everywhere, inner must be non-null, however in places where
6628 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6630 LDKnativeInvoiceRequestWithExplicitPayerIdBuilder *inner;
6632 * Indicates that this is the only struct which contains the same pointer.
6633 * Rust functions which take ownership of an object provided via an argument require
6634 * this to be true and invalidate the object pointed to by inner.
6637 } LDKInvoiceRequestWithExplicitPayerIdBuilder;
6640 * The contents of CResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ
6642 typedef union LDKCResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZPtr {
6644 * A pointer to the contents in the success state.
6645 * Reading from this pointer when `result_ok` is not set is undefined.
6647 struct LDKInvoiceRequestWithExplicitPayerIdBuilder *result;
6649 * A pointer to the contents in the error state.
6650 * Reading from this pointer when `result_ok` is set is undefined.
6652 enum LDKBolt12SemanticError *err;
6653 } LDKCResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZPtr;
6656 * A CResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ represents the result of a fallible operation,
6657 * containing a crate::lightning::offers::invoice_request::InvoiceRequestWithExplicitPayerIdBuilder on success and a crate::lightning::offers::parse::Bolt12SemanticError on failure.
6658 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6660 typedef struct LDKCResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ {
6662 * The contents of this CResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ, accessible via either
6663 * `err` or `result` depending on the state of `result_ok`.
6665 union LDKCResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZPtr contents;
6667 * Whether this CResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ represents a success state.
6670 } LDKCResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ;
6673 * The contents of CResult_OfferBolt12ParseErrorZ
6675 typedef union LDKCResult_OfferBolt12ParseErrorZPtr {
6677 * A pointer to the contents in the success state.
6678 * Reading from this pointer when `result_ok` is not set is undefined.
6680 struct LDKOffer *result;
6682 * A pointer to the contents in the error state.
6683 * Reading from this pointer when `result_ok` is set is undefined.
6685 struct LDKBolt12ParseError *err;
6686 } LDKCResult_OfferBolt12ParseErrorZPtr;
6689 * A CResult_OfferBolt12ParseErrorZ represents the result of a fallible operation,
6690 * containing a crate::lightning::offers::offer::Offer on success and a crate::lightning::offers::parse::Bolt12ParseError on failure.
6691 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6693 typedef struct LDKCResult_OfferBolt12ParseErrorZ {
6695 * The contents of this CResult_OfferBolt12ParseErrorZ, accessible via either
6696 * `err` or `result` depending on the state of `result_ok`.
6698 union LDKCResult_OfferBolt12ParseErrorZPtr contents;
6700 * Whether this CResult_OfferBolt12ParseErrorZ represents a success state.
6703 } LDKCResult_OfferBolt12ParseErrorZ;
6706 * The contents of CResult_NodeIdDecodeErrorZ
6708 typedef union LDKCResult_NodeIdDecodeErrorZPtr {
6710 * A pointer to the contents in the success state.
6711 * Reading from this pointer when `result_ok` is not set is undefined.
6713 struct LDKNodeId *result;
6715 * A pointer to the contents in the error state.
6716 * Reading from this pointer when `result_ok` is set is undefined.
6718 struct LDKDecodeError *err;
6719 } LDKCResult_NodeIdDecodeErrorZPtr;
6722 * A CResult_NodeIdDecodeErrorZ represents the result of a fallible operation,
6723 * containing a crate::lightning::routing::gossip::NodeId on success and a crate::lightning::ln::msgs::DecodeError on failure.
6724 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6726 typedef struct LDKCResult_NodeIdDecodeErrorZ {
6728 * The contents of this CResult_NodeIdDecodeErrorZ, accessible via either
6729 * `err` or `result` depending on the state of `result_ok`.
6731 union LDKCResult_NodeIdDecodeErrorZPtr contents;
6733 * Whether this CResult_NodeIdDecodeErrorZ represents a success state.
6736 } LDKCResult_NodeIdDecodeErrorZ;
6739 * The contents of CResult_PublicKeySecp256k1ErrorZ
6741 typedef union LDKCResult_PublicKeySecp256k1ErrorZPtr {
6743 * A pointer to the contents in the success state.
6744 * Reading from this pointer when `result_ok` is not set is undefined.
6746 struct LDKPublicKey *result;
6748 * A pointer to the contents in the error state.
6749 * Reading from this pointer when `result_ok` is set is undefined.
6751 enum LDKSecp256k1Error *err;
6752 } LDKCResult_PublicKeySecp256k1ErrorZPtr;
6755 * A CResult_PublicKeySecp256k1ErrorZ represents the result of a fallible operation,
6756 * containing a crate::c_types::PublicKey on success and a crate::c_types::Secp256k1Error on failure.
6757 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6759 typedef struct LDKCResult_PublicKeySecp256k1ErrorZ {
6761 * The contents of this CResult_PublicKeySecp256k1ErrorZ, accessible via either
6762 * `err` or `result` depending on the state of `result_ok`.
6764 union LDKCResult_PublicKeySecp256k1ErrorZPtr contents;
6766 * Whether this CResult_PublicKeySecp256k1ErrorZ represents a success state.
6769 } LDKCResult_PublicKeySecp256k1ErrorZ;
6774 * A [`channel_update`] message to be sent to or received from a peer.
6776 * [`channel_update`]: https://github.com/lightning/bolts/blob/master/07-routing-gossip.md#the-channel_update-message
6778 typedef struct MUST_USE_STRUCT LDKChannelUpdate {
6780 * A pointer to the opaque Rust object.
6781 * Nearly everywhere, inner must be non-null, however in places where
6782 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6784 LDKnativeChannelUpdate *inner;
6786 * Indicates that this is the only struct which contains the same pointer.
6787 * Rust functions which take ownership of an object provided via an argument require
6788 * this to be true and invalidate the object pointed to by inner.
6794 * Update to the [`NetworkGraph`] based on payment failure information conveyed via the Onion
6795 * return packet by a node along the route. See [BOLT #4] for details.
6797 * [BOLT #4]: https://github.com/lightning/bolts/blob/master/04-onion-routing.md
6799 typedef enum LDKNetworkUpdate_Tag {
6801 * An error indicating a `channel_update` messages should be applied via
6802 * [`NetworkGraph::update_channel`].
6804 LDKNetworkUpdate_ChannelUpdateMessage,
6806 * An error indicating that a channel failed to route a payment, which should be applied via
6807 * [`NetworkGraph::channel_failed_permanent`] if permanent.
6809 LDKNetworkUpdate_ChannelFailure,
6811 * An error indicating that a node failed to route a payment, which should be applied via
6812 * [`NetworkGraph::node_failed_permanent`] if permanent.
6814 LDKNetworkUpdate_NodeFailure,
6816 * Must be last for serialization purposes
6818 LDKNetworkUpdate_Sentinel,
6819 } LDKNetworkUpdate_Tag;
6821 typedef struct LDKNetworkUpdate_LDKChannelUpdateMessage_Body {
6823 * The update to apply via [`NetworkGraph::update_channel`].
6825 struct LDKChannelUpdate msg;
6826 } LDKNetworkUpdate_LDKChannelUpdateMessage_Body;
6828 typedef struct LDKNetworkUpdate_LDKChannelFailure_Body {
6830 * The short channel id of the closed channel.
6832 uint64_t short_channel_id;
6834 * Whether the channel should be permanently removed or temporarily disabled until a new
6835 * `channel_update` message is received.
6838 } LDKNetworkUpdate_LDKChannelFailure_Body;
6840 typedef struct LDKNetworkUpdate_LDKNodeFailure_Body {
6842 * The node id of the failed node.
6844 struct LDKPublicKey node_id;
6846 * Whether the node should be permanently removed from consideration or can be restored
6847 * when a new `channel_update` message is received.
6850 } LDKNetworkUpdate_LDKNodeFailure_Body;
6852 typedef struct MUST_USE_STRUCT LDKNetworkUpdate {
6853 LDKNetworkUpdate_Tag tag;
6855 LDKNetworkUpdate_LDKChannelUpdateMessage_Body channel_update_message;
6856 LDKNetworkUpdate_LDKChannelFailure_Body channel_failure;
6857 LDKNetworkUpdate_LDKNodeFailure_Body node_failure;
6862 * An enum which can either contain a crate::lightning::routing::gossip::NetworkUpdate or not
6864 typedef enum LDKCOption_NetworkUpdateZ_Tag {
6866 * When we're in this state, this COption_NetworkUpdateZ contains a crate::lightning::routing::gossip::NetworkUpdate
6868 LDKCOption_NetworkUpdateZ_Some,
6870 * When we're in this state, this COption_NetworkUpdateZ contains nothing
6872 LDKCOption_NetworkUpdateZ_None,
6874 * Must be last for serialization purposes
6876 LDKCOption_NetworkUpdateZ_Sentinel,
6877 } LDKCOption_NetworkUpdateZ_Tag;
6879 typedef struct LDKCOption_NetworkUpdateZ {
6880 LDKCOption_NetworkUpdateZ_Tag tag;
6883 struct LDKNetworkUpdate some;
6886 } LDKCOption_NetworkUpdateZ;
6889 * The contents of CResult_COption_NetworkUpdateZDecodeErrorZ
6891 typedef union LDKCResult_COption_NetworkUpdateZDecodeErrorZPtr {
6893 * A pointer to the contents in the success state.
6894 * Reading from this pointer when `result_ok` is not set is undefined.
6896 struct LDKCOption_NetworkUpdateZ *result;
6898 * A pointer to the contents in the error state.
6899 * Reading from this pointer when `result_ok` is set is undefined.
6901 struct LDKDecodeError *err;
6902 } LDKCResult_COption_NetworkUpdateZDecodeErrorZPtr;
6905 * A CResult_COption_NetworkUpdateZDecodeErrorZ represents the result of a fallible operation,
6906 * containing a crate::c_types::derived::COption_NetworkUpdateZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
6907 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6909 typedef struct LDKCResult_COption_NetworkUpdateZDecodeErrorZ {
6911 * The contents of this CResult_COption_NetworkUpdateZDecodeErrorZ, accessible via either
6912 * `err` or `result` depending on the state of `result_ok`.
6914 union LDKCResult_COption_NetworkUpdateZDecodeErrorZPtr contents;
6916 * Whether this CResult_COption_NetworkUpdateZDecodeErrorZ represents a success state.
6919 } LDKCResult_COption_NetworkUpdateZDecodeErrorZ;
6922 * The contents of CResult_TxOutUtxoLookupErrorZ
6924 typedef union LDKCResult_TxOutUtxoLookupErrorZPtr {
6926 * A pointer to the contents in the success state.
6927 * Reading from this pointer when `result_ok` is not set is undefined.
6929 struct LDKTxOut *result;
6931 * A pointer to the contents in the error state.
6932 * Reading from this pointer when `result_ok` is set is undefined.
6934 enum LDKUtxoLookupError *err;
6935 } LDKCResult_TxOutUtxoLookupErrorZPtr;
6938 * A CResult_TxOutUtxoLookupErrorZ represents the result of a fallible operation,
6939 * containing a crate::c_types::TxOut on success and a crate::lightning::routing::utxo::UtxoLookupError on failure.
6940 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6942 typedef struct LDKCResult_TxOutUtxoLookupErrorZ {
6944 * The contents of this CResult_TxOutUtxoLookupErrorZ, accessible via either
6945 * `err` or `result` depending on the state of `result_ok`.
6947 union LDKCResult_TxOutUtxoLookupErrorZPtr contents;
6949 * Whether this CResult_TxOutUtxoLookupErrorZ represents a success state.
6952 } LDKCResult_TxOutUtxoLookupErrorZ;
6957 * Represents a future resolution of a [`UtxoLookup::get_utxo`] query resolving async.
6959 * See [`UtxoResult::Async`] and [`UtxoFuture::resolve`] for more info.
6961 typedef struct MUST_USE_STRUCT LDKUtxoFuture {
6963 * A pointer to the opaque Rust object.
6964 * Nearly everywhere, inner must be non-null, however in places where
6965 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6967 LDKnativeUtxoFuture *inner;
6969 * Indicates that this is the only struct which contains the same pointer.
6970 * Rust functions which take ownership of an object provided via an argument require
6971 * this to be true and invalidate the object pointed to by inner.
6977 * The result of a [`UtxoLookup::get_utxo`] call. A call may resolve either synchronously,
6978 * returning the `Sync` variant, or asynchronously, returning an [`UtxoFuture`] in the `Async`
6981 typedef enum LDKUtxoResult_Tag {
6983 * A result which was resolved synchronously. It either includes a [`TxOut`] for the output
6984 * requested or a [`UtxoLookupError`].
6988 * A result which will be resolved asynchronously. It includes a [`UtxoFuture`], a `clone` of
6989 * which you must keep locally and call [`UtxoFuture::resolve`] on once the lookup completes.
6991 * Note that in order to avoid runaway memory usage, the number of parallel checks is limited,
6992 * but only fairly loosely. Because a pending checks block all message processing, leaving
6993 * checks pending for an extended time may cause DoS of other functions. It is recommended you
6994 * keep a tight timeout on lookups, on the order of a few seconds.
6996 LDKUtxoResult_Async,
6998 * Must be last for serialization purposes
7000 LDKUtxoResult_Sentinel,
7001 } LDKUtxoResult_Tag;
7003 typedef struct MUST_USE_STRUCT LDKUtxoResult {
7004 LDKUtxoResult_Tag tag;
7007 struct LDKCResult_TxOutUtxoLookupErrorZ sync;
7010 struct LDKUtxoFuture async;
7016 * The `UtxoLookup` trait defines behavior for accessing on-chain UTXOs.
7018 typedef struct LDKUtxoLookup {
7020 * An opaque pointer which is passed to your function implementations as an argument.
7021 * This has no meaning in the LDK, and can be NULL or any other value.
7025 * Returns the transaction output of a funding transaction encoded by [`short_channel_id`].
7026 * Returns an error if `chain_hash` is for a different chain or if such a transaction output is
7029 * [`short_channel_id`]: https://github.com/lightning/bolts/blob/master/07-routing-gossip.md#definition-of-short_channel_id
7031 struct LDKUtxoResult (*get_utxo)(const void *this_arg, const uint8_t (*chain_hash)[32], uint64_t short_channel_id);
7033 * Frees any resources associated with this object given its this_arg pointer.
7034 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
7036 void (*free)(void *this_arg);
7040 * An enum which can either contain a crate::lightning::routing::utxo::UtxoLookup or not
7042 typedef enum LDKCOption_UtxoLookupZ_Tag {
7044 * When we're in this state, this COption_UtxoLookupZ contains a crate::lightning::routing::utxo::UtxoLookup
7046 LDKCOption_UtxoLookupZ_Some,
7048 * When we're in this state, this COption_UtxoLookupZ contains nothing
7050 LDKCOption_UtxoLookupZ_None,
7052 * Must be last for serialization purposes
7054 LDKCOption_UtxoLookupZ_Sentinel,
7055 } LDKCOption_UtxoLookupZ_Tag;
7057 typedef struct LDKCOption_UtxoLookupZ {
7058 LDKCOption_UtxoLookupZ_Tag tag;
7061 struct LDKUtxoLookup some;
7064 } LDKCOption_UtxoLookupZ;
7067 * The contents of CResult_NoneLightningErrorZ
7069 typedef union LDKCResult_NoneLightningErrorZPtr {
7071 * Note that this value is always NULL, as there are no contents in the OK variant
7075 * A pointer to the contents in the error state.
7076 * Reading from this pointer when `result_ok` is set is undefined.
7078 struct LDKLightningError *err;
7079 } LDKCResult_NoneLightningErrorZPtr;
7082 * A CResult_NoneLightningErrorZ represents the result of a fallible operation,
7083 * containing a () on success and a crate::lightning::ln::msgs::LightningError on failure.
7084 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7086 typedef struct LDKCResult_NoneLightningErrorZ {
7088 * The contents of this CResult_NoneLightningErrorZ, accessible via either
7089 * `err` or `result` depending on the state of `result_ok`.
7091 union LDKCResult_NoneLightningErrorZPtr contents;
7093 * Whether this CResult_NoneLightningErrorZ represents a success state.
7096 } LDKCResult_NoneLightningErrorZ;
7099 * The contents of CResult_boolLightningErrorZ
7101 typedef union LDKCResult_boolLightningErrorZPtr {
7103 * A pointer to the contents in the success state.
7104 * Reading from this pointer when `result_ok` is not set is undefined.
7108 * A pointer to the contents in the error state.
7109 * Reading from this pointer when `result_ok` is set is undefined.
7111 struct LDKLightningError *err;
7112 } LDKCResult_boolLightningErrorZPtr;
7115 * A CResult_boolLightningErrorZ represents the result of a fallible operation,
7116 * containing a bool on success and a crate::lightning::ln::msgs::LightningError on failure.
7117 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7119 typedef struct LDKCResult_boolLightningErrorZ {
7121 * The contents of this CResult_boolLightningErrorZ, accessible via either
7122 * `err` or `result` depending on the state of `result_ok`.
7124 union LDKCResult_boolLightningErrorZPtr contents;
7126 * Whether this CResult_boolLightningErrorZ represents a success state.
7129 } LDKCResult_boolLightningErrorZ;
7134 * A [`channel_announcement`] message to be sent to or received from a peer.
7136 * [`channel_announcement`]: https://github.com/lightning/bolts/blob/master/07-routing-gossip.md#the-channel_announcement-message
7138 typedef struct MUST_USE_STRUCT LDKChannelAnnouncement {
7140 * A pointer to the opaque Rust object.
7141 * Nearly everywhere, inner must be non-null, however in places where
7142 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7144 LDKnativeChannelAnnouncement *inner;
7146 * Indicates that this is the only struct which contains the same pointer.
7147 * Rust functions which take ownership of an object provided via an argument require
7148 * this to be true and invalidate the object pointed to by inner.
7151 } LDKChannelAnnouncement;
7154 * A tuple of 3 elements. See the individual fields for the types contained.
7156 typedef struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ {
7158 * The element at position 0
7160 struct LDKChannelAnnouncement a;
7162 * The element at position 1
7164 struct LDKChannelUpdate b;
7166 * The element at position 2
7168 struct LDKChannelUpdate c;
7169 } LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ;
7172 * An enum which can either contain a crate::c_types::derived::C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ or not
7174 typedef enum LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_Tag {
7176 * When we're in this state, this COption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ contains a crate::c_types::derived::C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ
7178 LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_Some,
7180 * When we're in this state, this COption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ contains nothing
7182 LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_None,
7184 * Must be last for serialization purposes
7186 LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_Sentinel,
7187 } LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_Tag;
7189 typedef struct LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ {
7190 LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_Tag tag;
7193 struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ some;
7196 } LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ;
7201 * An [`accept_channel`] message to be sent to or received from a peer.
7203 * Used in V1 channel establishment
7205 * [`accept_channel`]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md#the-accept_channel-message
7207 typedef struct MUST_USE_STRUCT LDKAcceptChannel {
7209 * A pointer to the opaque Rust object.
7210 * Nearly everywhere, inner must be non-null, however in places where
7211 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7213 LDKnativeAcceptChannel *inner;
7215 * Indicates that this is the only struct which contains the same pointer.
7216 * Rust functions which take ownership of an object provided via an argument require
7217 * this to be true and invalidate the object pointed to by inner.
7225 * An accept_channel2 message to be sent by or received from the channel accepter.
7227 * Used in V2 channel establishment
7230 typedef struct MUST_USE_STRUCT LDKAcceptChannelV2 {
7232 * A pointer to the opaque Rust object.
7233 * Nearly everywhere, inner must be non-null, however in places where
7234 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7236 LDKnativeAcceptChannelV2 *inner;
7238 * Indicates that this is the only struct which contains the same pointer.
7239 * Rust functions which take ownership of an object provided via an argument require
7240 * this to be true and invalidate the object pointed to by inner.
7243 } LDKAcceptChannelV2;
7248 * An [`open_channel`] message to be sent to or received from a peer.
7250 * Used in V1 channel establishment
7252 * [`open_channel`]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md#the-open_channel-message
7254 typedef struct MUST_USE_STRUCT LDKOpenChannel {
7256 * A pointer to the opaque Rust object.
7257 * Nearly everywhere, inner must be non-null, however in places where
7258 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7260 LDKnativeOpenChannel *inner;
7262 * Indicates that this is the only struct which contains the same pointer.
7263 * Rust functions which take ownership of an object provided via an argument require
7264 * this to be true and invalidate the object pointed to by inner.
7272 * An open_channel2 message to be sent by or received from the channel initiator.
7274 * Used in V2 channel establishment
7277 typedef struct MUST_USE_STRUCT LDKOpenChannelV2 {
7279 * A pointer to the opaque Rust object.
7280 * Nearly everywhere, inner must be non-null, however in places where
7281 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7283 LDKnativeOpenChannelV2 *inner;
7285 * Indicates that this is the only struct which contains the same pointer.
7286 * Rust functions which take ownership of an object provided via an argument require
7287 * this to be true and invalidate the object pointed to by inner.
7295 * A [`funding_created`] message to be sent to or received from a peer.
7297 * Used in V1 channel establishment
7299 * [`funding_created`]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md#the-funding_created-message
7301 typedef struct MUST_USE_STRUCT LDKFundingCreated {
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 LDKnativeFundingCreated *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.
7314 } LDKFundingCreated;
7319 * A [`funding_signed`] message to be sent to or received from a peer.
7321 * Used in V1 channel establishment
7323 * [`funding_signed`]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md#the-funding_signed-message
7325 typedef struct MUST_USE_STRUCT LDKFundingSigned {
7327 * A pointer to the opaque Rust object.
7328 * Nearly everywhere, inner must be non-null, however in places where
7329 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7331 LDKnativeFundingSigned *inner;
7333 * Indicates that this is the only struct which contains the same pointer.
7334 * Rust functions which take ownership of an object provided via an argument require
7335 * this to be true and invalidate the object pointed to by inner.
7343 * An stfu (quiescence) message to be sent by or received from the stfu initiator.
7345 typedef struct MUST_USE_STRUCT LDKStfu {
7347 * A pointer to the opaque Rust object.
7348 * Nearly everywhere, inner must be non-null, however in places where
7349 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7351 LDKnativeStfu *inner;
7353 * Indicates that this is the only struct which contains the same pointer.
7354 * Rust functions which take ownership of an object provided via an argument require
7355 * this to be true and invalidate the object pointed to by inner.
7363 * A splice message to be sent by or received from the stfu initiator (splice initiator).
7365 typedef struct MUST_USE_STRUCT LDKSplice {
7367 * A pointer to the opaque Rust object.
7368 * Nearly everywhere, inner must be non-null, however in places where
7369 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7371 LDKnativeSplice *inner;
7373 * Indicates that this is the only struct which contains the same pointer.
7374 * Rust functions which take ownership of an object provided via an argument require
7375 * this to be true and invalidate the object pointed to by inner.
7383 * A splice_ack message to be received by or sent to the splice initiator.
7386 typedef struct MUST_USE_STRUCT LDKSpliceAck {
7388 * A pointer to the opaque Rust object.
7389 * Nearly everywhere, inner must be non-null, however in places where
7390 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7392 LDKnativeSpliceAck *inner;
7394 * Indicates that this is the only struct which contains the same pointer.
7395 * Rust functions which take ownership of an object provided via an argument require
7396 * this to be true and invalidate the object pointed to by inner.
7404 * A splice_locked message to be sent to or received from a peer.
7407 typedef struct MUST_USE_STRUCT LDKSpliceLocked {
7409 * A pointer to the opaque Rust object.
7410 * Nearly everywhere, inner must be non-null, however in places where
7411 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7413 LDKnativeSpliceLocked *inner;
7415 * Indicates that this is the only struct which contains the same pointer.
7416 * Rust functions which take ownership of an object provided via an argument require
7417 * this to be true and invalidate the object pointed to by inner.
7425 * A tx_add_input message for adding an input during interactive transaction construction
7428 typedef struct MUST_USE_STRUCT LDKTxAddInput {
7430 * A pointer to the opaque Rust object.
7431 * Nearly everywhere, inner must be non-null, however in places where
7432 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7434 LDKnativeTxAddInput *inner;
7436 * Indicates that this is the only struct which contains the same pointer.
7437 * Rust functions which take ownership of an object provided via an argument require
7438 * this to be true and invalidate the object pointed to by inner.
7446 * A tx_add_output message for adding an output during interactive transaction construction.
7449 typedef struct MUST_USE_STRUCT LDKTxAddOutput {
7451 * A pointer to the opaque Rust object.
7452 * Nearly everywhere, inner must be non-null, however in places where
7453 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7455 LDKnativeTxAddOutput *inner;
7457 * Indicates that this is the only struct which contains the same pointer.
7458 * Rust functions which take ownership of an object provided via an argument require
7459 * this to be true and invalidate the object pointed to by inner.
7467 * A tx_remove_input message for removing an input during interactive transaction construction.
7470 typedef struct MUST_USE_STRUCT LDKTxRemoveInput {
7472 * A pointer to the opaque Rust object.
7473 * Nearly everywhere, inner must be non-null, however in places where
7474 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7476 LDKnativeTxRemoveInput *inner;
7478 * Indicates that this is the only struct which contains the same pointer.
7479 * Rust functions which take ownership of an object provided via an argument require
7480 * this to be true and invalidate the object pointed to by inner.
7488 * A tx_remove_output message for removing an output during interactive transaction construction.
7491 typedef struct MUST_USE_STRUCT LDKTxRemoveOutput {
7493 * A pointer to the opaque Rust object.
7494 * Nearly everywhere, inner must be non-null, however in places where
7495 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7497 LDKnativeTxRemoveOutput *inner;
7499 * Indicates that this is the only struct which contains the same pointer.
7500 * Rust functions which take ownership of an object provided via an argument require
7501 * this to be true and invalidate the object pointed to by inner.
7504 } LDKTxRemoveOutput;
7509 * A tx_complete message signalling the conclusion of a peer's transaction contributions during
7510 * interactive transaction construction.
7513 typedef struct MUST_USE_STRUCT LDKTxComplete {
7515 * A pointer to the opaque Rust object.
7516 * Nearly everywhere, inner must be non-null, however in places where
7517 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7519 LDKnativeTxComplete *inner;
7521 * Indicates that this is the only struct which contains the same pointer.
7522 * Rust functions which take ownership of an object provided via an argument require
7523 * this to be true and invalidate the object pointed to by inner.
7531 * A tx_signatures message containing the sender's signatures for a transaction constructed with
7532 * interactive transaction construction.
7535 typedef struct MUST_USE_STRUCT LDKTxSignatures {
7537 * A pointer to the opaque Rust object.
7538 * Nearly everywhere, inner must be non-null, however in places where
7539 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7541 LDKnativeTxSignatures *inner;
7543 * Indicates that this is the only struct which contains the same pointer.
7544 * Rust functions which take ownership of an object provided via an argument require
7545 * this to be true and invalidate the object pointed to by inner.
7553 * A tx_init_rbf message which initiates a replacement of the transaction after it's been
7557 typedef struct MUST_USE_STRUCT LDKTxInitRbf {
7559 * A pointer to the opaque Rust object.
7560 * Nearly everywhere, inner must be non-null, however in places where
7561 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7563 LDKnativeTxInitRbf *inner;
7565 * Indicates that this is the only struct which contains the same pointer.
7566 * Rust functions which take ownership of an object provided via an argument require
7567 * this to be true and invalidate the object pointed to by inner.
7575 * A tx_ack_rbf message which acknowledges replacement of the transaction after it's been
7579 typedef struct MUST_USE_STRUCT LDKTxAckRbf {
7581 * A pointer to the opaque Rust object.
7582 * Nearly everywhere, inner must be non-null, however in places where
7583 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7585 LDKnativeTxAckRbf *inner;
7587 * Indicates that this is the only struct which contains the same pointer.
7588 * Rust functions which take ownership of an object provided via an argument require
7589 * this to be true and invalidate the object pointed to by inner.
7597 * A tx_abort message which signals the cancellation of an in-progress transaction negotiation.
7600 typedef struct MUST_USE_STRUCT LDKTxAbort {
7602 * A pointer to the opaque Rust object.
7603 * Nearly everywhere, inner must be non-null, however in places where
7604 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7606 LDKnativeTxAbort *inner;
7608 * Indicates that this is the only struct which contains the same pointer.
7609 * Rust functions which take ownership of an object provided via an argument require
7610 * this to be true and invalidate the object pointed to by inner.
7618 * A [`channel_ready`] message to be sent to or received from a peer.
7620 * [`channel_ready`]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md#the-channel_ready-message
7622 typedef struct MUST_USE_STRUCT LDKChannelReady {
7624 * A pointer to the opaque Rust object.
7625 * Nearly everywhere, inner must be non-null, however in places where
7626 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7628 LDKnativeChannelReady *inner;
7630 * Indicates that this is the only struct which contains the same pointer.
7631 * Rust functions which take ownership of an object provided via an argument require
7632 * this to be true and invalidate the object pointed to by inner.
7640 * An [`announcement_signatures`] message to be sent to or received from a peer.
7642 * [`announcement_signatures`]: https://github.com/lightning/bolts/blob/master/07-routing-gossip.md#the-announcement_signatures-message
7644 typedef struct MUST_USE_STRUCT LDKAnnouncementSignatures {
7646 * A pointer to the opaque Rust object.
7647 * Nearly everywhere, inner must be non-null, however in places where
7648 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7650 LDKnativeAnnouncementSignatures *inner;
7652 * Indicates that this is the only struct which contains the same pointer.
7653 * Rust functions which take ownership of an object provided via an argument require
7654 * this to be true and invalidate the object pointed to by inner.
7657 } LDKAnnouncementSignatures;
7662 * Struct used to return values from [`RevokeAndACK`] messages, containing a bunch of commitment
7663 * transaction updates if they were pending.
7665 typedef struct MUST_USE_STRUCT LDKCommitmentUpdate {
7667 * A pointer to the opaque Rust object.
7668 * Nearly everywhere, inner must be non-null, however in places where
7669 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7671 LDKnativeCommitmentUpdate *inner;
7673 * Indicates that this is the only struct which contains the same pointer.
7674 * Rust functions which take ownership of an object provided via an argument require
7675 * this to be true and invalidate the object pointed to by inner.
7678 } LDKCommitmentUpdate;
7683 * A [`revoke_and_ack`] message to be sent to or received from a peer.
7685 * [`revoke_and_ack`]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md#completing-the-transition-to-the-updated-state-revoke_and_ack
7687 typedef struct MUST_USE_STRUCT LDKRevokeAndACK {
7689 * A pointer to the opaque Rust object.
7690 * Nearly everywhere, inner must be non-null, however in places where
7691 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7693 LDKnativeRevokeAndACK *inner;
7695 * Indicates that this is the only struct which contains the same pointer.
7696 * Rust functions which take ownership of an object provided via an argument require
7697 * this to be true and invalidate the object pointed to by inner.
7705 * A [`closing_signed`] message to be sent to or received from a peer.
7707 * [`closing_signed`]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md#closing-negotiation-closing_signed
7709 typedef struct MUST_USE_STRUCT LDKClosingSigned {
7711 * A pointer to the opaque Rust object.
7712 * Nearly everywhere, inner must be non-null, however in places where
7713 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7715 LDKnativeClosingSigned *inner;
7717 * Indicates that this is the only struct which contains the same pointer.
7718 * Rust functions which take ownership of an object provided via an argument require
7719 * this to be true and invalidate the object pointed to by inner.
7727 * A [`shutdown`] message to be sent to or received from a peer.
7729 * [`shutdown`]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md#closing-initiation-shutdown
7731 typedef struct MUST_USE_STRUCT LDKShutdown {
7733 * A pointer to the opaque Rust object.
7734 * Nearly everywhere, inner must be non-null, however in places where
7735 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7737 LDKnativeShutdown *inner;
7739 * Indicates that this is the only struct which contains the same pointer.
7740 * Rust functions which take ownership of an object provided via an argument require
7741 * this to be true and invalidate the object pointed to by inner.
7749 * A [`channel_reestablish`] message to be sent to or received from a peer.
7751 * [`channel_reestablish`]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md#message-retransmission
7753 typedef struct MUST_USE_STRUCT LDKChannelReestablish {
7755 * A pointer to the opaque Rust object.
7756 * Nearly everywhere, inner must be non-null, however in places where
7757 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7759 LDKnativeChannelReestablish *inner;
7761 * Indicates that this is the only struct which contains the same pointer.
7762 * Rust functions which take ownership of an object provided via an argument require
7763 * this to be true and invalidate the object pointed to by inner.
7766 } LDKChannelReestablish;
7771 * A [`node_announcement`] message to be sent to or received from a peer.
7773 * [`node_announcement`]: https://github.com/lightning/bolts/blob/master/07-routing-gossip.md#the-node_announcement-message
7775 typedef struct MUST_USE_STRUCT LDKNodeAnnouncement {
7777 * A pointer to the opaque Rust object.
7778 * Nearly everywhere, inner must be non-null, however in places where
7779 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7781 LDKnativeNodeAnnouncement *inner;
7783 * Indicates that this is the only struct which contains the same pointer.
7784 * Rust functions which take ownership of an object provided via an argument require
7785 * this to be true and invalidate the object pointed to by inner.
7788 } LDKNodeAnnouncement;
7793 * An [`error`] message to be sent to or received from a peer.
7795 * [`error`]: https://github.com/lightning/bolts/blob/master/01-messaging.md#the-error-and-warning-messages
7797 typedef struct MUST_USE_STRUCT LDKErrorMessage {
7799 * A pointer to the opaque Rust object.
7800 * Nearly everywhere, inner must be non-null, however in places where
7801 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7803 LDKnativeErrorMessage *inner;
7805 * Indicates that this is the only struct which contains the same pointer.
7806 * Rust functions which take ownership of an object provided via an argument require
7807 * this to be true and invalidate the object pointed to by inner.
7815 * A [`warning`] message to be sent to or received from a peer.
7817 * [`warning`]: https://github.com/lightning/bolts/blob/master/01-messaging.md#the-error-and-warning-messages
7819 typedef struct MUST_USE_STRUCT LDKWarningMessage {
7821 * A pointer to the opaque Rust object.
7822 * Nearly everywhere, inner must be non-null, however in places where
7823 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7825 LDKnativeWarningMessage *inner;
7827 * Indicates that this is the only struct which contains the same pointer.
7828 * Rust functions which take ownership of an object provided via an argument require
7829 * this to be true and invalidate the object pointed to by inner.
7832 } LDKWarningMessage;
7835 * Used to put an error message in a [`LightningError`].
7837 typedef enum LDKErrorAction_Tag {
7839 * The peer took some action which made us think they were useless. Disconnect them.
7841 LDKErrorAction_DisconnectPeer,
7843 * The peer did something incorrect. Tell them without closing any channels and disconnect them.
7845 LDKErrorAction_DisconnectPeerWithWarning,
7847 * The peer did something harmless that we weren't able to process, just log and ignore
7849 LDKErrorAction_IgnoreError,
7851 * The peer did something harmless that we weren't able to meaningfully process.
7852 * If the error is logged, log it at the given level.
7854 LDKErrorAction_IgnoreAndLog,
7856 * The peer provided us with a gossip message which we'd already seen. In most cases this
7857 * should be ignored, but it may result in the message being forwarded if it is a duplicate of
7858 * our own channel announcements.
7860 LDKErrorAction_IgnoreDuplicateGossip,
7862 * The peer did something incorrect. Tell them.
7864 LDKErrorAction_SendErrorMessage,
7866 * The peer did something incorrect. Tell them without closing any channels.
7868 LDKErrorAction_SendWarningMessage,
7870 * Must be last for serialization purposes
7872 LDKErrorAction_Sentinel,
7873 } LDKErrorAction_Tag;
7875 typedef struct LDKErrorAction_LDKDisconnectPeer_Body {
7877 * An error message which we should make an effort to send before we disconnect.
7879 * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
7881 struct LDKErrorMessage msg;
7882 } LDKErrorAction_LDKDisconnectPeer_Body;
7884 typedef struct LDKErrorAction_LDKDisconnectPeerWithWarning_Body {
7886 * A warning message which we should make an effort to send before we disconnect.
7888 struct LDKWarningMessage msg;
7889 } LDKErrorAction_LDKDisconnectPeerWithWarning_Body;
7891 typedef struct LDKErrorAction_LDKSendErrorMessage_Body {
7893 * The message to send.
7895 struct LDKErrorMessage msg;
7896 } LDKErrorAction_LDKSendErrorMessage_Body;
7898 typedef struct LDKErrorAction_LDKSendWarningMessage_Body {
7900 * The message to send.
7902 struct LDKWarningMessage msg;
7904 * The peer may have done something harmless that we weren't able to meaningfully process,
7905 * though we should still tell them about it.
7906 * If this event is logged, log it at the given level.
7908 enum LDKLevel log_level;
7909 } LDKErrorAction_LDKSendWarningMessage_Body;
7911 typedef struct MUST_USE_STRUCT LDKErrorAction {
7912 LDKErrorAction_Tag tag;
7914 LDKErrorAction_LDKDisconnectPeer_Body disconnect_peer;
7915 LDKErrorAction_LDKDisconnectPeerWithWarning_Body disconnect_peer_with_warning;
7917 enum LDKLevel ignore_and_log;
7919 LDKErrorAction_LDKSendErrorMessage_Body send_error_message;
7920 LDKErrorAction_LDKSendWarningMessage_Body send_warning_message;
7927 * A [`query_channel_range`] message is used to query a peer for channel
7928 * UTXOs in a range of blocks. The recipient of a query makes a best
7929 * effort to reply to the query using one or more [`ReplyChannelRange`]
7932 * [`query_channel_range`]: https://github.com/lightning/bolts/blob/master/07-routing-gossip.md#the-query_channel_range-and-reply_channel_range-messages
7934 typedef struct MUST_USE_STRUCT LDKQueryChannelRange {
7936 * A pointer to the opaque Rust object.
7937 * Nearly everywhere, inner must be non-null, however in places where
7938 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7940 LDKnativeQueryChannelRange *inner;
7942 * Indicates that this is the only struct which contains the same pointer.
7943 * Rust functions which take ownership of an object provided via an argument require
7944 * this to be true and invalidate the object pointed to by inner.
7947 } LDKQueryChannelRange;
7952 * A [`query_short_channel_ids`] message is used to query a peer for
7953 * routing gossip messages related to one or more `short_channel_id`s.
7955 * The query recipient will reply with the latest, if available,
7956 * [`ChannelAnnouncement`], [`ChannelUpdate`] and [`NodeAnnouncement`] messages
7957 * it maintains for the requested `short_channel_id`s followed by a
7958 * [`ReplyShortChannelIdsEnd`] message. The `short_channel_id`s sent in
7959 * this query are encoded. We only support `encoding_type=0` uncompressed
7960 * serialization and do not support `encoding_type=1` zlib serialization.
7962 * [`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
7964 typedef struct MUST_USE_STRUCT LDKQueryShortChannelIds {
7966 * A pointer to the opaque Rust object.
7967 * Nearly everywhere, inner must be non-null, however in places where
7968 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7970 LDKnativeQueryShortChannelIds *inner;
7972 * Indicates that this is the only struct which contains the same pointer.
7973 * Rust functions which take ownership of an object provided via an argument require
7974 * this to be true and invalidate the object pointed to by inner.
7977 } LDKQueryShortChannelIds;
7982 * A [`reply_channel_range`] message is a reply to a [`QueryChannelRange`]
7985 * Multiple `reply_channel_range` messages can be sent in reply
7986 * to a single [`QueryChannelRange`] message. The query recipient makes a
7987 * best effort to respond based on their local network view which may
7988 * not be a perfect view of the network. The `short_channel_id`s in the
7989 * reply are encoded. We only support `encoding_type=0` uncompressed
7990 * serialization and do not support `encoding_type=1` zlib serialization.
7992 * [`reply_channel_range`]: https://github.com/lightning/bolts/blob/master/07-routing-gossip.md#the-query_channel_range-and-reply_channel_range-messages
7994 typedef struct MUST_USE_STRUCT LDKReplyChannelRange {
7996 * A pointer to the opaque Rust object.
7997 * Nearly everywhere, inner must be non-null, however in places where
7998 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8000 LDKnativeReplyChannelRange *inner;
8002 * Indicates that this is the only struct which contains the same pointer.
8003 * Rust functions which take ownership of an object provided via an argument require
8004 * this to be true and invalidate the object pointed to by inner.
8007 } LDKReplyChannelRange;
8012 * A [`gossip_timestamp_filter`] message is used by a node to request
8013 * gossip relay for messages in the requested time range when the
8014 * `gossip_queries` feature has been negotiated.
8016 * [`gossip_timestamp_filter`]: https://github.com/lightning/bolts/blob/master/07-routing-gossip.md#the-gossip_timestamp_filter-message
8018 typedef struct MUST_USE_STRUCT LDKGossipTimestampFilter {
8020 * A pointer to the opaque Rust object.
8021 * Nearly everywhere, inner must be non-null, however in places where
8022 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8024 LDKnativeGossipTimestampFilter *inner;
8026 * Indicates that this is the only struct which contains the same pointer.
8027 * Rust functions which take ownership of an object provided via an argument require
8028 * this to be true and invalidate the object pointed to by inner.
8031 } LDKGossipTimestampFilter;
8034 * An event generated by ChannelManager which indicates a message should be sent to a peer (or
8035 * broadcast to most peers).
8036 * These events are handled by PeerManager::process_events if you are using a PeerManager.
8038 typedef enum LDKMessageSendEvent_Tag {
8040 * Used to indicate that we've accepted a channel open and should send the accept_channel
8041 * message provided to the given peer.
8043 LDKMessageSendEvent_SendAcceptChannel,
8045 * Used to indicate that we've accepted a V2 channel open and should send the accept_channel2
8046 * message provided to the given peer.
8048 LDKMessageSendEvent_SendAcceptChannelV2,
8050 * Used to indicate that we've initiated a channel open and should send the open_channel
8051 * message provided to the given peer.
8053 LDKMessageSendEvent_SendOpenChannel,
8055 * Used to indicate that we've initiated a V2 channel open and should send the open_channel2
8056 * message provided to the given peer.
8058 LDKMessageSendEvent_SendOpenChannelV2,
8060 * Used to indicate that a funding_created message should be sent to the peer with the given node_id.
8062 LDKMessageSendEvent_SendFundingCreated,
8064 * Used to indicate that a funding_signed message should be sent to the peer with the given node_id.
8066 LDKMessageSendEvent_SendFundingSigned,
8068 * Used to indicate that a stfu message should be sent to the peer with the given node id.
8070 LDKMessageSendEvent_SendStfu,
8072 * Used to indicate that a splice message should be sent to the peer with the given node id.
8074 LDKMessageSendEvent_SendSplice,
8076 * Used to indicate that a splice_ack message should be sent to the peer with the given node id.
8078 LDKMessageSendEvent_SendSpliceAck,
8080 * Used to indicate that a splice_locked message should be sent to the peer with the given node id.
8082 LDKMessageSendEvent_SendSpliceLocked,
8084 * Used to indicate that a tx_add_input message should be sent to the peer with the given node_id.
8086 LDKMessageSendEvent_SendTxAddInput,
8088 * Used to indicate that a tx_add_output message should be sent to the peer with the given node_id.
8090 LDKMessageSendEvent_SendTxAddOutput,
8092 * Used to indicate that a tx_remove_input message should be sent to the peer with the given node_id.
8094 LDKMessageSendEvent_SendTxRemoveInput,
8096 * Used to indicate that a tx_remove_output message should be sent to the peer with the given node_id.
8098 LDKMessageSendEvent_SendTxRemoveOutput,
8100 * Used to indicate that a tx_complete message should be sent to the peer with the given node_id.
8102 LDKMessageSendEvent_SendTxComplete,
8104 * Used to indicate that a tx_signatures message should be sent to the peer with the given node_id.
8106 LDKMessageSendEvent_SendTxSignatures,
8108 * Used to indicate that a tx_init_rbf message should be sent to the peer with the given node_id.
8110 LDKMessageSendEvent_SendTxInitRbf,
8112 * Used to indicate that a tx_ack_rbf message should be sent to the peer with the given node_id.
8114 LDKMessageSendEvent_SendTxAckRbf,
8116 * Used to indicate that a tx_abort message should be sent to the peer with the given node_id.
8118 LDKMessageSendEvent_SendTxAbort,
8120 * Used to indicate that a channel_ready message should be sent to the peer with the given node_id.
8122 LDKMessageSendEvent_SendChannelReady,
8124 * Used to indicate that an announcement_signatures message should be sent to the peer with the given node_id.
8126 LDKMessageSendEvent_SendAnnouncementSignatures,
8128 * Used to indicate that a series of HTLC update messages, as well as a commitment_signed
8129 * message should be sent to the peer with the given node_id.
8131 LDKMessageSendEvent_UpdateHTLCs,
8133 * Used to indicate that a revoke_and_ack message should be sent to the peer with the given node_id.
8135 LDKMessageSendEvent_SendRevokeAndACK,
8137 * Used to indicate that a closing_signed message should be sent to the peer with the given node_id.
8139 LDKMessageSendEvent_SendClosingSigned,
8141 * Used to indicate that a shutdown message should be sent to the peer with the given node_id.
8143 LDKMessageSendEvent_SendShutdown,
8145 * Used to indicate that a channel_reestablish message should be sent to the peer with the given node_id.
8147 LDKMessageSendEvent_SendChannelReestablish,
8149 * Used to send a channel_announcement and channel_update to a specific peer, likely on
8150 * initial connection to ensure our peers know about our channels.
8152 LDKMessageSendEvent_SendChannelAnnouncement,
8154 * Used to indicate that a channel_announcement and channel_update should be broadcast to all
8155 * peers (except the peer with node_id either msg.contents.node_id_1 or msg.contents.node_id_2).
8157 * Note that after doing so, you very likely (unless you did so very recently) want to
8158 * broadcast a node_announcement (e.g. via [`PeerManager::broadcast_node_announcement`]). This
8159 * ensures that any nodes which see our channel_announcement also have a relevant
8160 * node_announcement, including relevant feature flags which may be important for routing
8163 * [`PeerManager::broadcast_node_announcement`]: crate::ln::peer_handler::PeerManager::broadcast_node_announcement
8165 LDKMessageSendEvent_BroadcastChannelAnnouncement,
8167 * Used to indicate that a channel_update should be broadcast to all peers.
8169 LDKMessageSendEvent_BroadcastChannelUpdate,
8171 * Used to indicate that a node_announcement should be broadcast to all peers.
8173 LDKMessageSendEvent_BroadcastNodeAnnouncement,
8175 * Used to indicate that a channel_update should be sent to a single peer.
8176 * In contrast to [`Self::BroadcastChannelUpdate`], this is used when the channel is a
8177 * private channel and we shouldn't be informing all of our peers of channel parameters.
8179 LDKMessageSendEvent_SendChannelUpdate,
8181 * Broadcast an error downstream to be handled
8183 LDKMessageSendEvent_HandleError,
8185 * Query a peer for channels with funding transaction UTXOs in a block range.
8187 LDKMessageSendEvent_SendChannelRangeQuery,
8189 * Request routing gossip messages from a peer for a list of channels identified by
8190 * their short_channel_ids.
8192 LDKMessageSendEvent_SendShortIdsQuery,
8194 * Sends a reply to a channel range query. This may be one of several SendReplyChannelRange events
8195 * emitted during processing of the query.
8197 LDKMessageSendEvent_SendReplyChannelRange,
8199 * Sends a timestamp filter for inbound gossip. This should be sent on each new connection to
8200 * enable receiving gossip messages from the peer.
8202 LDKMessageSendEvent_SendGossipTimestampFilter,
8204 * Must be last for serialization purposes
8206 LDKMessageSendEvent_Sentinel,
8207 } LDKMessageSendEvent_Tag;
8209 typedef struct LDKMessageSendEvent_LDKSendAcceptChannel_Body {
8211 * The node_id of the node which should receive this message
8213 struct LDKPublicKey node_id;
8215 * The message which should be sent.
8217 struct LDKAcceptChannel msg;
8218 } LDKMessageSendEvent_LDKSendAcceptChannel_Body;
8220 typedef struct LDKMessageSendEvent_LDKSendAcceptChannelV2_Body {
8222 * The node_id of the node which should receive this message
8224 struct LDKPublicKey node_id;
8226 * The message which should be sent.
8228 struct LDKAcceptChannelV2 msg;
8229 } LDKMessageSendEvent_LDKSendAcceptChannelV2_Body;
8231 typedef struct LDKMessageSendEvent_LDKSendOpenChannel_Body {
8233 * The node_id of the node which should receive this message
8235 struct LDKPublicKey node_id;
8237 * The message which should be sent.
8239 struct LDKOpenChannel msg;
8240 } LDKMessageSendEvent_LDKSendOpenChannel_Body;
8242 typedef struct LDKMessageSendEvent_LDKSendOpenChannelV2_Body {
8244 * The node_id of the node which should receive this message
8246 struct LDKPublicKey node_id;
8248 * The message which should be sent.
8250 struct LDKOpenChannelV2 msg;
8251 } LDKMessageSendEvent_LDKSendOpenChannelV2_Body;
8253 typedef struct LDKMessageSendEvent_LDKSendFundingCreated_Body {
8255 * The node_id of the node which should receive this message
8257 struct LDKPublicKey node_id;
8259 * The message which should be sent.
8261 struct LDKFundingCreated msg;
8262 } LDKMessageSendEvent_LDKSendFundingCreated_Body;
8264 typedef struct LDKMessageSendEvent_LDKSendFundingSigned_Body {
8266 * The node_id of the node which should receive this message
8268 struct LDKPublicKey node_id;
8270 * The message which should be sent.
8272 struct LDKFundingSigned msg;
8273 } LDKMessageSendEvent_LDKSendFundingSigned_Body;
8275 typedef struct LDKMessageSendEvent_LDKSendStfu_Body {
8277 * The node_id of the node which should receive this message
8279 struct LDKPublicKey node_id;
8281 * The message which should be sent.
8284 } LDKMessageSendEvent_LDKSendStfu_Body;
8286 typedef struct LDKMessageSendEvent_LDKSendSplice_Body {
8288 * The node_id of the node which should receive this message
8290 struct LDKPublicKey node_id;
8292 * The message which should be sent.
8294 struct LDKSplice msg;
8295 } LDKMessageSendEvent_LDKSendSplice_Body;
8297 typedef struct LDKMessageSendEvent_LDKSendSpliceAck_Body {
8299 * The node_id of the node which should receive this message
8301 struct LDKPublicKey node_id;
8303 * The message which should be sent.
8305 struct LDKSpliceAck msg;
8306 } LDKMessageSendEvent_LDKSendSpliceAck_Body;
8308 typedef struct LDKMessageSendEvent_LDKSendSpliceLocked_Body {
8310 * The node_id of the node which should receive this message
8312 struct LDKPublicKey node_id;
8314 * The message which should be sent.
8316 struct LDKSpliceLocked msg;
8317 } LDKMessageSendEvent_LDKSendSpliceLocked_Body;
8319 typedef struct LDKMessageSendEvent_LDKSendTxAddInput_Body {
8321 * The node_id of the node which should receive this message
8323 struct LDKPublicKey node_id;
8325 * The message which should be sent.
8327 struct LDKTxAddInput msg;
8328 } LDKMessageSendEvent_LDKSendTxAddInput_Body;
8330 typedef struct LDKMessageSendEvent_LDKSendTxAddOutput_Body {
8332 * The node_id of the node which should receive this message
8334 struct LDKPublicKey node_id;
8336 * The message which should be sent.
8338 struct LDKTxAddOutput msg;
8339 } LDKMessageSendEvent_LDKSendTxAddOutput_Body;
8341 typedef struct LDKMessageSendEvent_LDKSendTxRemoveInput_Body {
8343 * The node_id of the node which should receive this message
8345 struct LDKPublicKey node_id;
8347 * The message which should be sent.
8349 struct LDKTxRemoveInput msg;
8350 } LDKMessageSendEvent_LDKSendTxRemoveInput_Body;
8352 typedef struct LDKMessageSendEvent_LDKSendTxRemoveOutput_Body {
8354 * The node_id of the node which should receive this message
8356 struct LDKPublicKey node_id;
8358 * The message which should be sent.
8360 struct LDKTxRemoveOutput msg;
8361 } LDKMessageSendEvent_LDKSendTxRemoveOutput_Body;
8363 typedef struct LDKMessageSendEvent_LDKSendTxComplete_Body {
8365 * The node_id of the node which should receive this message
8367 struct LDKPublicKey node_id;
8369 * The message which should be sent.
8371 struct LDKTxComplete msg;
8372 } LDKMessageSendEvent_LDKSendTxComplete_Body;
8374 typedef struct LDKMessageSendEvent_LDKSendTxSignatures_Body {
8376 * The node_id of the node which should receive this message
8378 struct LDKPublicKey node_id;
8380 * The message which should be sent.
8382 struct LDKTxSignatures msg;
8383 } LDKMessageSendEvent_LDKSendTxSignatures_Body;
8385 typedef struct LDKMessageSendEvent_LDKSendTxInitRbf_Body {
8387 * The node_id of the node which should receive this message
8389 struct LDKPublicKey node_id;
8391 * The message which should be sent.
8393 struct LDKTxInitRbf msg;
8394 } LDKMessageSendEvent_LDKSendTxInitRbf_Body;
8396 typedef struct LDKMessageSendEvent_LDKSendTxAckRbf_Body {
8398 * The node_id of the node which should receive this message
8400 struct LDKPublicKey node_id;
8402 * The message which should be sent.
8404 struct LDKTxAckRbf msg;
8405 } LDKMessageSendEvent_LDKSendTxAckRbf_Body;
8407 typedef struct LDKMessageSendEvent_LDKSendTxAbort_Body {
8409 * The node_id of the node which should receive this message
8411 struct LDKPublicKey node_id;
8413 * The message which should be sent.
8415 struct LDKTxAbort msg;
8416 } LDKMessageSendEvent_LDKSendTxAbort_Body;
8418 typedef struct LDKMessageSendEvent_LDKSendChannelReady_Body {
8420 * The node_id of the node which should receive these message(s)
8422 struct LDKPublicKey node_id;
8424 * The channel_ready message which should be sent.
8426 struct LDKChannelReady msg;
8427 } LDKMessageSendEvent_LDKSendChannelReady_Body;
8429 typedef struct LDKMessageSendEvent_LDKSendAnnouncementSignatures_Body {
8431 * The node_id of the node which should receive these message(s)
8433 struct LDKPublicKey node_id;
8435 * The announcement_signatures message which should be sent.
8437 struct LDKAnnouncementSignatures msg;
8438 } LDKMessageSendEvent_LDKSendAnnouncementSignatures_Body;
8440 typedef struct LDKMessageSendEvent_LDKUpdateHTLCs_Body {
8442 * The node_id of the node which should receive these message(s)
8444 struct LDKPublicKey node_id;
8446 * The update messages which should be sent. ALL messages in the struct should be sent!
8448 struct LDKCommitmentUpdate updates;
8449 } LDKMessageSendEvent_LDKUpdateHTLCs_Body;
8451 typedef struct LDKMessageSendEvent_LDKSendRevokeAndACK_Body {
8453 * The node_id of the node which should receive this message
8455 struct LDKPublicKey node_id;
8457 * The message which should be sent.
8459 struct LDKRevokeAndACK msg;
8460 } LDKMessageSendEvent_LDKSendRevokeAndACK_Body;
8462 typedef struct LDKMessageSendEvent_LDKSendClosingSigned_Body {
8464 * The node_id of the node which should receive this message
8466 struct LDKPublicKey node_id;
8468 * The message which should be sent.
8470 struct LDKClosingSigned msg;
8471 } LDKMessageSendEvent_LDKSendClosingSigned_Body;
8473 typedef struct LDKMessageSendEvent_LDKSendShutdown_Body {
8475 * The node_id of the node which should receive this message
8477 struct LDKPublicKey node_id;
8479 * The message which should be sent.
8481 struct LDKShutdown msg;
8482 } LDKMessageSendEvent_LDKSendShutdown_Body;
8484 typedef struct LDKMessageSendEvent_LDKSendChannelReestablish_Body {
8486 * The node_id of the node which should receive this message
8488 struct LDKPublicKey node_id;
8490 * The message which should be sent.
8492 struct LDKChannelReestablish msg;
8493 } LDKMessageSendEvent_LDKSendChannelReestablish_Body;
8495 typedef struct LDKMessageSendEvent_LDKSendChannelAnnouncement_Body {
8497 * The node_id of the node which should receive this message
8499 struct LDKPublicKey node_id;
8501 * The channel_announcement which should be sent.
8503 struct LDKChannelAnnouncement msg;
8505 * The followup channel_update which should be sent.
8507 struct LDKChannelUpdate update_msg;
8508 } LDKMessageSendEvent_LDKSendChannelAnnouncement_Body;
8510 typedef struct LDKMessageSendEvent_LDKBroadcastChannelAnnouncement_Body {
8512 * The channel_announcement which should be sent.
8514 struct LDKChannelAnnouncement msg;
8516 * The followup channel_update which should be sent.
8518 * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
8520 struct LDKChannelUpdate update_msg;
8521 } LDKMessageSendEvent_LDKBroadcastChannelAnnouncement_Body;
8523 typedef struct LDKMessageSendEvent_LDKBroadcastChannelUpdate_Body {
8525 * The channel_update which should be sent.
8527 struct LDKChannelUpdate msg;
8528 } LDKMessageSendEvent_LDKBroadcastChannelUpdate_Body;
8530 typedef struct LDKMessageSendEvent_LDKBroadcastNodeAnnouncement_Body {
8532 * The node_announcement which should be sent.
8534 struct LDKNodeAnnouncement msg;
8535 } LDKMessageSendEvent_LDKBroadcastNodeAnnouncement_Body;
8537 typedef struct LDKMessageSendEvent_LDKSendChannelUpdate_Body {
8539 * The node_id of the node which should receive this message
8541 struct LDKPublicKey node_id;
8543 * The channel_update which should be sent.
8545 struct LDKChannelUpdate msg;
8546 } LDKMessageSendEvent_LDKSendChannelUpdate_Body;
8548 typedef struct LDKMessageSendEvent_LDKHandleError_Body {
8550 * The node_id of the node which should receive this message
8552 struct LDKPublicKey node_id;
8554 * The action which should be taken.
8556 struct LDKErrorAction action;
8557 } LDKMessageSendEvent_LDKHandleError_Body;
8559 typedef struct LDKMessageSendEvent_LDKSendChannelRangeQuery_Body {
8561 * The node_id of this message recipient
8563 struct LDKPublicKey node_id;
8565 * The query_channel_range which should be sent.
8567 struct LDKQueryChannelRange msg;
8568 } LDKMessageSendEvent_LDKSendChannelRangeQuery_Body;
8570 typedef struct LDKMessageSendEvent_LDKSendShortIdsQuery_Body {
8572 * The node_id of this message recipient
8574 struct LDKPublicKey node_id;
8576 * The query_short_channel_ids which should be sent.
8578 struct LDKQueryShortChannelIds msg;
8579 } LDKMessageSendEvent_LDKSendShortIdsQuery_Body;
8581 typedef struct LDKMessageSendEvent_LDKSendReplyChannelRange_Body {
8583 * The node_id of this message recipient
8585 struct LDKPublicKey node_id;
8587 * The reply_channel_range which should be sent.
8589 struct LDKReplyChannelRange msg;
8590 } LDKMessageSendEvent_LDKSendReplyChannelRange_Body;
8592 typedef struct LDKMessageSendEvent_LDKSendGossipTimestampFilter_Body {
8594 * The node_id of this message recipient
8596 struct LDKPublicKey node_id;
8598 * The gossip_timestamp_filter which should be sent.
8600 struct LDKGossipTimestampFilter msg;
8601 } LDKMessageSendEvent_LDKSendGossipTimestampFilter_Body;
8603 typedef struct MUST_USE_STRUCT LDKMessageSendEvent {
8604 LDKMessageSendEvent_Tag tag;
8606 LDKMessageSendEvent_LDKSendAcceptChannel_Body send_accept_channel;
8607 LDKMessageSendEvent_LDKSendAcceptChannelV2_Body send_accept_channel_v2;
8608 LDKMessageSendEvent_LDKSendOpenChannel_Body send_open_channel;
8609 LDKMessageSendEvent_LDKSendOpenChannelV2_Body send_open_channel_v2;
8610 LDKMessageSendEvent_LDKSendFundingCreated_Body send_funding_created;
8611 LDKMessageSendEvent_LDKSendFundingSigned_Body send_funding_signed;
8612 LDKMessageSendEvent_LDKSendStfu_Body send_stfu;
8613 LDKMessageSendEvent_LDKSendSplice_Body send_splice;
8614 LDKMessageSendEvent_LDKSendSpliceAck_Body send_splice_ack;
8615 LDKMessageSendEvent_LDKSendSpliceLocked_Body send_splice_locked;
8616 LDKMessageSendEvent_LDKSendTxAddInput_Body send_tx_add_input;
8617 LDKMessageSendEvent_LDKSendTxAddOutput_Body send_tx_add_output;
8618 LDKMessageSendEvent_LDKSendTxRemoveInput_Body send_tx_remove_input;
8619 LDKMessageSendEvent_LDKSendTxRemoveOutput_Body send_tx_remove_output;
8620 LDKMessageSendEvent_LDKSendTxComplete_Body send_tx_complete;
8621 LDKMessageSendEvent_LDKSendTxSignatures_Body send_tx_signatures;
8622 LDKMessageSendEvent_LDKSendTxInitRbf_Body send_tx_init_rbf;
8623 LDKMessageSendEvent_LDKSendTxAckRbf_Body send_tx_ack_rbf;
8624 LDKMessageSendEvent_LDKSendTxAbort_Body send_tx_abort;
8625 LDKMessageSendEvent_LDKSendChannelReady_Body send_channel_ready;
8626 LDKMessageSendEvent_LDKSendAnnouncementSignatures_Body send_announcement_signatures;
8627 LDKMessageSendEvent_LDKUpdateHTLCs_Body update_htl_cs;
8628 LDKMessageSendEvent_LDKSendRevokeAndACK_Body send_revoke_and_ack;
8629 LDKMessageSendEvent_LDKSendClosingSigned_Body send_closing_signed;
8630 LDKMessageSendEvent_LDKSendShutdown_Body send_shutdown;
8631 LDKMessageSendEvent_LDKSendChannelReestablish_Body send_channel_reestablish;
8632 LDKMessageSendEvent_LDKSendChannelAnnouncement_Body send_channel_announcement;
8633 LDKMessageSendEvent_LDKBroadcastChannelAnnouncement_Body broadcast_channel_announcement;
8634 LDKMessageSendEvent_LDKBroadcastChannelUpdate_Body broadcast_channel_update;
8635 LDKMessageSendEvent_LDKBroadcastNodeAnnouncement_Body broadcast_node_announcement;
8636 LDKMessageSendEvent_LDKSendChannelUpdate_Body send_channel_update;
8637 LDKMessageSendEvent_LDKHandleError_Body handle_error;
8638 LDKMessageSendEvent_LDKSendChannelRangeQuery_Body send_channel_range_query;
8639 LDKMessageSendEvent_LDKSendShortIdsQuery_Body send_short_ids_query;
8640 LDKMessageSendEvent_LDKSendReplyChannelRange_Body send_reply_channel_range;
8641 LDKMessageSendEvent_LDKSendGossipTimestampFilter_Body send_gossip_timestamp_filter;
8643 } LDKMessageSendEvent;
8646 * A dynamically-allocated array of crate::lightning::events::MessageSendEvents of arbitrary size.
8647 * This corresponds to std::vector in C++
8649 typedef struct LDKCVec_MessageSendEventZ {
8651 * The elements in the array.
8652 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
8654 struct LDKMessageSendEvent *data;
8656 * The number of elements pointed to by `data`.
8659 } LDKCVec_MessageSendEventZ;
8664 * Details about one direction of a channel as received within a [`ChannelUpdate`].
8666 typedef struct MUST_USE_STRUCT LDKChannelUpdateInfo {
8668 * A pointer to the opaque Rust object.
8669 * Nearly everywhere, inner must be non-null, however in places where
8670 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8672 LDKnativeChannelUpdateInfo *inner;
8674 * Indicates that this is the only struct which contains the same pointer.
8675 * Rust functions which take ownership of an object provided via an argument require
8676 * this to be true and invalidate the object pointed to by inner.
8679 } LDKChannelUpdateInfo;
8682 * The contents of CResult_ChannelUpdateInfoDecodeErrorZ
8684 typedef union LDKCResult_ChannelUpdateInfoDecodeErrorZPtr {
8686 * A pointer to the contents in the success state.
8687 * Reading from this pointer when `result_ok` is not set is undefined.
8689 struct LDKChannelUpdateInfo *result;
8691 * A pointer to the contents in the error state.
8692 * Reading from this pointer when `result_ok` is set is undefined.
8694 struct LDKDecodeError *err;
8695 } LDKCResult_ChannelUpdateInfoDecodeErrorZPtr;
8698 * A CResult_ChannelUpdateInfoDecodeErrorZ represents the result of a fallible operation,
8699 * containing a crate::lightning::routing::gossip::ChannelUpdateInfo on success and a crate::lightning::ln::msgs::DecodeError on failure.
8700 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8702 typedef struct LDKCResult_ChannelUpdateInfoDecodeErrorZ {
8704 * The contents of this CResult_ChannelUpdateInfoDecodeErrorZ, accessible via either
8705 * `err` or `result` depending on the state of `result_ok`.
8707 union LDKCResult_ChannelUpdateInfoDecodeErrorZPtr contents;
8709 * Whether this CResult_ChannelUpdateInfoDecodeErrorZ represents a success state.
8712 } LDKCResult_ChannelUpdateInfoDecodeErrorZ;
8717 * Details about a channel (both directions).
8718 * Received within a channel announcement.
8720 typedef struct MUST_USE_STRUCT LDKChannelInfo {
8722 * A pointer to the opaque Rust object.
8723 * Nearly everywhere, inner must be non-null, however in places where
8724 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8726 LDKnativeChannelInfo *inner;
8728 * Indicates that this is the only struct which contains the same pointer.
8729 * Rust functions which take ownership of an object provided via an argument require
8730 * this to be true and invalidate the object pointed to by inner.
8736 * The contents of CResult_ChannelInfoDecodeErrorZ
8738 typedef union LDKCResult_ChannelInfoDecodeErrorZPtr {
8740 * A pointer to the contents in the success state.
8741 * Reading from this pointer when `result_ok` is not set is undefined.
8743 struct LDKChannelInfo *result;
8745 * A pointer to the contents in the error state.
8746 * Reading from this pointer when `result_ok` is set is undefined.
8748 struct LDKDecodeError *err;
8749 } LDKCResult_ChannelInfoDecodeErrorZPtr;
8752 * A CResult_ChannelInfoDecodeErrorZ represents the result of a fallible operation,
8753 * containing a crate::lightning::routing::gossip::ChannelInfo on success and a crate::lightning::ln::msgs::DecodeError on failure.
8754 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8756 typedef struct LDKCResult_ChannelInfoDecodeErrorZ {
8758 * The contents of this CResult_ChannelInfoDecodeErrorZ, accessible via either
8759 * `err` or `result` depending on the state of `result_ok`.
8761 union LDKCResult_ChannelInfoDecodeErrorZPtr contents;
8763 * Whether this CResult_ChannelInfoDecodeErrorZ represents a success state.
8766 } LDKCResult_ChannelInfoDecodeErrorZ;
8771 * Fees for routing via a given channel or a node
8773 typedef struct MUST_USE_STRUCT LDKRoutingFees {
8775 * A pointer to the opaque Rust object.
8776 * Nearly everywhere, inner must be non-null, however in places where
8777 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8779 LDKnativeRoutingFees *inner;
8781 * Indicates that this is the only struct which contains the same pointer.
8782 * Rust functions which take ownership of an object provided via an argument require
8783 * this to be true and invalidate the object pointed to by inner.
8789 * The contents of CResult_RoutingFeesDecodeErrorZ
8791 typedef union LDKCResult_RoutingFeesDecodeErrorZPtr {
8793 * A pointer to the contents in the success state.
8794 * Reading from this pointer when `result_ok` is not set is undefined.
8796 struct LDKRoutingFees *result;
8798 * A pointer to the contents in the error state.
8799 * Reading from this pointer when `result_ok` is set is undefined.
8801 struct LDKDecodeError *err;
8802 } LDKCResult_RoutingFeesDecodeErrorZPtr;
8805 * A CResult_RoutingFeesDecodeErrorZ represents the result of a fallible operation,
8806 * containing a crate::lightning::routing::gossip::RoutingFees on success and a crate::lightning::ln::msgs::DecodeError on failure.
8807 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8809 typedef struct LDKCResult_RoutingFeesDecodeErrorZ {
8811 * The contents of this CResult_RoutingFeesDecodeErrorZ, accessible via either
8812 * `err` or `result` depending on the state of `result_ok`.
8814 union LDKCResult_RoutingFeesDecodeErrorZPtr contents;
8816 * Whether this CResult_RoutingFeesDecodeErrorZ represents a success state.
8819 } LDKCResult_RoutingFeesDecodeErrorZ;
8822 * A 4-byte byte array.
8824 typedef struct LDKFourBytes {
8832 * A 12-byte byte array.
8834 typedef struct LDKTwelveBytes {
8844 * Represents a hostname for serialization purposes.
8845 * Only the character set and length will be validated.
8846 * The character set consists of ASCII alphanumeric characters, hyphens, and periods.
8847 * Its length is guaranteed to be representable by a single byte.
8848 * This serialization is used by [`BOLT 7`] hostnames.
8850 * [`BOLT 7`]: https://github.com/lightning/bolts/blob/master/07-routing-gossip.md
8852 typedef struct MUST_USE_STRUCT LDKHostname {
8854 * A pointer to the opaque Rust object.
8855 * Nearly everywhere, inner must be non-null, however in places where
8856 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8858 LDKnativeHostname *inner;
8860 * Indicates that this is the only struct which contains the same pointer.
8861 * Rust functions which take ownership of an object provided via an argument require
8862 * this to be true and invalidate the object pointed to by inner.
8868 * An address which can be used to connect to a remote peer.
8870 typedef enum LDKSocketAddress_Tag {
8872 * An IPv4 address and port on which the peer is listening.
8874 LDKSocketAddress_TcpIpV4,
8876 * An IPv6 address and port on which the peer is listening.
8878 LDKSocketAddress_TcpIpV6,
8880 * An old-style Tor onion address/port on which the peer is listening.
8882 * This field is deprecated and the Tor network generally no longer supports V2 Onion
8883 * addresses. Thus, the details are not parsed here.
8885 LDKSocketAddress_OnionV2,
8887 * A new-style Tor onion address/port on which the peer is listening.
8889 * To create the human-readable \"hostname\", concatenate the ED25519 pubkey, checksum, and version,
8890 * wrap as base32 and append \".onion\".
8892 LDKSocketAddress_OnionV3,
8894 * A hostname/port on which the peer is listening.
8896 LDKSocketAddress_Hostname,
8898 * Must be last for serialization purposes
8900 LDKSocketAddress_Sentinel,
8901 } LDKSocketAddress_Tag;
8903 typedef struct LDKSocketAddress_LDKTcpIpV4_Body {
8905 * The 4-byte IPv4 address
8907 struct LDKFourBytes addr;
8909 * The port on which the node is listening
8912 } LDKSocketAddress_LDKTcpIpV4_Body;
8914 typedef struct LDKSocketAddress_LDKTcpIpV6_Body {
8916 * The 16-byte IPv6 address
8918 struct LDKSixteenBytes addr;
8920 * The port on which the node is listening
8923 } LDKSocketAddress_LDKTcpIpV6_Body;
8925 typedef struct LDKSocketAddress_LDKOnionV3_Body {
8927 * The ed25519 long-term public key of the peer
8929 struct LDKThirtyTwoBytes ed25519_pubkey;
8931 * The checksum of the pubkey and version, as included in the onion address
8935 * The version byte, as defined by the Tor Onion v3 spec.
8939 * The port on which the node is listening
8942 } LDKSocketAddress_LDKOnionV3_Body;
8944 typedef struct LDKSocketAddress_LDKHostname_Body {
8946 * The hostname on which the node is listening.
8948 struct LDKHostname hostname;
8950 * The port on which the node is listening.
8953 } LDKSocketAddress_LDKHostname_Body;
8955 typedef struct MUST_USE_STRUCT LDKSocketAddress {
8956 LDKSocketAddress_Tag tag;
8958 LDKSocketAddress_LDKTcpIpV4_Body tcp_ip_v4;
8959 LDKSocketAddress_LDKTcpIpV6_Body tcp_ip_v6;
8961 struct LDKTwelveBytes onion_v2;
8963 LDKSocketAddress_LDKOnionV3_Body onion_v3;
8964 LDKSocketAddress_LDKHostname_Body hostname;
8969 * A dynamically-allocated array of crate::lightning::ln::msgs::SocketAddresss of arbitrary size.
8970 * This corresponds to std::vector in C++
8972 typedef struct LDKCVec_SocketAddressZ {
8974 * The elements in the array.
8975 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
8977 struct LDKSocketAddress *data;
8979 * The number of elements pointed to by `data`.
8982 } LDKCVec_SocketAddressZ;
8987 * Information received in the latest node_announcement from this node.
8989 typedef struct MUST_USE_STRUCT LDKNodeAnnouncementInfo {
8991 * A pointer to the opaque Rust object.
8992 * Nearly everywhere, inner must be non-null, however in places where
8993 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8995 LDKnativeNodeAnnouncementInfo *inner;
8997 * Indicates that this is the only struct which contains the same pointer.
8998 * Rust functions which take ownership of an object provided via an argument require
8999 * this to be true and invalidate the object pointed to by inner.
9002 } LDKNodeAnnouncementInfo;
9005 * The contents of CResult_NodeAnnouncementInfoDecodeErrorZ
9007 typedef union LDKCResult_NodeAnnouncementInfoDecodeErrorZPtr {
9009 * A pointer to the contents in the success state.
9010 * Reading from this pointer when `result_ok` is not set is undefined.
9012 struct LDKNodeAnnouncementInfo *result;
9014 * A pointer to the contents in the error state.
9015 * Reading from this pointer when `result_ok` is set is undefined.
9017 struct LDKDecodeError *err;
9018 } LDKCResult_NodeAnnouncementInfoDecodeErrorZPtr;
9021 * A CResult_NodeAnnouncementInfoDecodeErrorZ represents the result of a fallible operation,
9022 * containing a crate::lightning::routing::gossip::NodeAnnouncementInfo on success and a crate::lightning::ln::msgs::DecodeError on failure.
9023 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9025 typedef struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ {
9027 * The contents of this CResult_NodeAnnouncementInfoDecodeErrorZ, accessible via either
9028 * `err` or `result` depending on the state of `result_ok`.
9030 union LDKCResult_NodeAnnouncementInfoDecodeErrorZPtr contents;
9032 * Whether this CResult_NodeAnnouncementInfoDecodeErrorZ represents a success state.
9035 } LDKCResult_NodeAnnouncementInfoDecodeErrorZ;
9040 * A user-defined name for a node, which may be used when displaying the node in a graph.
9042 * Since node aliases are provided by third parties, they are a potential avenue for injection
9043 * attacks. Care must be taken when processing.
9045 typedef struct MUST_USE_STRUCT LDKNodeAlias {
9047 * A pointer to the opaque Rust object.
9048 * Nearly everywhere, inner must be non-null, however in places where
9049 * the Rust equivalent takes an Option, it may be set to null to indicate None.
9051 LDKnativeNodeAlias *inner;
9053 * Indicates that this is the only struct which contains the same pointer.
9054 * Rust functions which take ownership of an object provided via an argument require
9055 * this to be true and invalidate the object pointed to by inner.
9061 * The contents of CResult_NodeAliasDecodeErrorZ
9063 typedef union LDKCResult_NodeAliasDecodeErrorZPtr {
9065 * A pointer to the contents in the success state.
9066 * Reading from this pointer when `result_ok` is not set is undefined.
9068 struct LDKNodeAlias *result;
9070 * A pointer to the contents in the error state.
9071 * Reading from this pointer when `result_ok` is set is undefined.
9073 struct LDKDecodeError *err;
9074 } LDKCResult_NodeAliasDecodeErrorZPtr;
9077 * A CResult_NodeAliasDecodeErrorZ represents the result of a fallible operation,
9078 * containing a crate::lightning::routing::gossip::NodeAlias on success and a crate::lightning::ln::msgs::DecodeError on failure.
9079 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9081 typedef struct LDKCResult_NodeAliasDecodeErrorZ {
9083 * The contents of this CResult_NodeAliasDecodeErrorZ, accessible via either
9084 * `err` or `result` depending on the state of `result_ok`.
9086 union LDKCResult_NodeAliasDecodeErrorZPtr contents;
9088 * Whether this CResult_NodeAliasDecodeErrorZ represents a success state.
9091 } LDKCResult_NodeAliasDecodeErrorZ;
9096 * Details about a node in the network, known from the network announcement.
9098 typedef struct MUST_USE_STRUCT LDKNodeInfo {
9100 * A pointer to the opaque Rust object.
9101 * Nearly everywhere, inner must be non-null, however in places where
9102 * the Rust equivalent takes an Option, it may be set to null to indicate None.
9104 LDKnativeNodeInfo *inner;
9106 * Indicates that this is the only struct which contains the same pointer.
9107 * Rust functions which take ownership of an object provided via an argument require
9108 * this to be true and invalidate the object pointed to by inner.
9114 * The contents of CResult_NodeInfoDecodeErrorZ
9116 typedef union LDKCResult_NodeInfoDecodeErrorZPtr {
9118 * A pointer to the contents in the success state.
9119 * Reading from this pointer when `result_ok` is not set is undefined.
9121 struct LDKNodeInfo *result;
9123 * A pointer to the contents in the error state.
9124 * Reading from this pointer when `result_ok` is set is undefined.
9126 struct LDKDecodeError *err;
9127 } LDKCResult_NodeInfoDecodeErrorZPtr;
9130 * A CResult_NodeInfoDecodeErrorZ represents the result of a fallible operation,
9131 * containing a crate::lightning::routing::gossip::NodeInfo on success and a crate::lightning::ln::msgs::DecodeError on failure.
9132 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9134 typedef struct LDKCResult_NodeInfoDecodeErrorZ {
9136 * The contents of this CResult_NodeInfoDecodeErrorZ, accessible via either
9137 * `err` or `result` depending on the state of `result_ok`.
9139 union LDKCResult_NodeInfoDecodeErrorZPtr contents;
9141 * Whether this CResult_NodeInfoDecodeErrorZ represents a success state.
9144 } LDKCResult_NodeInfoDecodeErrorZ;
9147 * The contents of CResult_NetworkGraphDecodeErrorZ
9149 typedef union LDKCResult_NetworkGraphDecodeErrorZPtr {
9151 * A pointer to the contents in the success state.
9152 * Reading from this pointer when `result_ok` is not set is undefined.
9154 struct LDKNetworkGraph *result;
9156 * A pointer to the contents in the error state.
9157 * Reading from this pointer when `result_ok` is set is undefined.
9159 struct LDKDecodeError *err;
9160 } LDKCResult_NetworkGraphDecodeErrorZPtr;
9163 * A CResult_NetworkGraphDecodeErrorZ represents the result of a fallible operation,
9164 * containing a crate::lightning::routing::gossip::NetworkGraph on success and a crate::lightning::ln::msgs::DecodeError on failure.
9165 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9167 typedef struct LDKCResult_NetworkGraphDecodeErrorZ {
9169 * The contents of this CResult_NetworkGraphDecodeErrorZ, accessible via either
9170 * `err` or `result` depending on the state of `result_ok`.
9172 union LDKCResult_NetworkGraphDecodeErrorZPtr contents;
9174 * Whether this CResult_NetworkGraphDecodeErrorZ represents a success state.
9177 } LDKCResult_NetworkGraphDecodeErrorZ;
9180 * An enum which can either contain a crate::c_types::derived::CVec_SocketAddressZ or not
9182 typedef enum LDKCOption_CVec_SocketAddressZZ_Tag {
9184 * When we're in this state, this COption_CVec_SocketAddressZZ contains a crate::c_types::derived::CVec_SocketAddressZ
9186 LDKCOption_CVec_SocketAddressZZ_Some,
9188 * When we're in this state, this COption_CVec_SocketAddressZZ contains nothing
9190 LDKCOption_CVec_SocketAddressZZ_None,
9192 * Must be last for serialization purposes
9194 LDKCOption_CVec_SocketAddressZZ_Sentinel,
9195 } LDKCOption_CVec_SocketAddressZZ_Tag;
9197 typedef struct LDKCOption_CVec_SocketAddressZZ {
9198 LDKCOption_CVec_SocketAddressZZ_Tag tag;
9201 struct LDKCVec_SocketAddressZ some;
9204 } LDKCOption_CVec_SocketAddressZZ;
9207 * The contents of CResult_u64ShortChannelIdErrorZ
9209 typedef union LDKCResult_u64ShortChannelIdErrorZPtr {
9211 * A pointer to the contents in the success state.
9212 * Reading from this pointer when `result_ok` is not set is undefined.
9216 * A pointer to the contents in the error state.
9217 * Reading from this pointer when `result_ok` is set is undefined.
9219 enum LDKShortChannelIdError *err;
9220 } LDKCResult_u64ShortChannelIdErrorZPtr;
9223 * A CResult_u64ShortChannelIdErrorZ represents the result of a fallible operation,
9224 * containing a u64 on success and a crate::lightning::util::scid_utils::ShortChannelIdError on failure.
9225 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9227 typedef struct LDKCResult_u64ShortChannelIdErrorZ {
9229 * The contents of this CResult_u64ShortChannelIdErrorZ, accessible via either
9230 * `err` or `result` depending on the state of `result_ok`.
9232 union LDKCResult_u64ShortChannelIdErrorZPtr contents;
9234 * Whether this CResult_u64ShortChannelIdErrorZ represents a success state.
9237 } LDKCResult_u64ShortChannelIdErrorZ;
9242 * Information about an incoming HTLC, including the [`PendingHTLCRouting`] describing where it
9245 typedef struct MUST_USE_STRUCT LDKPendingHTLCInfo {
9247 * A pointer to the opaque Rust object.
9248 * Nearly everywhere, inner must be non-null, however in places where
9249 * the Rust equivalent takes an Option, it may be set to null to indicate None.
9251 LDKnativePendingHTLCInfo *inner;
9253 * Indicates that this is the only struct which contains the same pointer.
9254 * Rust functions which take ownership of an object provided via an argument require
9255 * this to be true and invalidate the object pointed to by inner.
9258 } LDKPendingHTLCInfo;
9263 * Invalid inbound onion payment.
9265 typedef struct MUST_USE_STRUCT LDKInboundHTLCErr {
9267 * A pointer to the opaque Rust object.
9268 * Nearly everywhere, inner must be non-null, however in places where
9269 * the Rust equivalent takes an Option, it may be set to null to indicate None.
9271 LDKnativeInboundHTLCErr *inner;
9273 * Indicates that this is the only struct which contains the same pointer.
9274 * Rust functions which take ownership of an object provided via an argument require
9275 * this to be true and invalidate the object pointed to by inner.
9278 } LDKInboundHTLCErr;
9281 * The contents of CResult_PendingHTLCInfoInboundHTLCErrZ
9283 typedef union LDKCResult_PendingHTLCInfoInboundHTLCErrZPtr {
9285 * A pointer to the contents in the success state.
9286 * Reading from this pointer when `result_ok` is not set is undefined.
9288 struct LDKPendingHTLCInfo *result;
9290 * A pointer to the contents in the error state.
9291 * Reading from this pointer when `result_ok` is set is undefined.
9293 struct LDKInboundHTLCErr *err;
9294 } LDKCResult_PendingHTLCInfoInboundHTLCErrZPtr;
9297 * A CResult_PendingHTLCInfoInboundHTLCErrZ represents the result of a fallible operation,
9298 * containing a crate::lightning::ln::channelmanager::PendingHTLCInfo on success and a crate::lightning::ln::onion_payment::InboundHTLCErr on failure.
9299 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9301 typedef struct LDKCResult_PendingHTLCInfoInboundHTLCErrZ {
9303 * The contents of this CResult_PendingHTLCInfoInboundHTLCErrZ, accessible via either
9304 * `err` or `result` depending on the state of `result_ok`.
9306 union LDKCResult_PendingHTLCInfoInboundHTLCErrZPtr contents;
9308 * Whether this CResult_PendingHTLCInfoInboundHTLCErrZ represents a success state.
9311 } LDKCResult_PendingHTLCInfoInboundHTLCErrZ;
9314 * A dynamically-allocated array of crate::lightning::ln::chan_utils::HTLCOutputInCommitments of arbitrary size.
9315 * This corresponds to std::vector in C++
9317 typedef struct LDKCVec_HTLCOutputInCommitmentZ {
9319 * The elements in the array.
9320 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
9322 struct LDKHTLCOutputInCommitment *data;
9324 * The number of elements pointed to by `data`.
9327 } LDKCVec_HTLCOutputInCommitmentZ;
9330 * A dynamically-allocated array of crate::lightning::sign::HTLCDescriptors of arbitrary size.
9331 * This corresponds to std::vector in C++
9333 typedef struct LDKCVec_HTLCDescriptorZ {
9335 * The elements in the array.
9336 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
9338 struct LDKHTLCDescriptor *data;
9340 * The number of elements pointed to by `data`.
9343 } LDKCVec_HTLCDescriptorZ;
9348 * An unspent transaction output that is available to spend resulting from a successful
9349 * [`CoinSelection`] attempt.
9351 typedef struct MUST_USE_STRUCT LDKUtxo {
9353 * A pointer to the opaque Rust object.
9354 * Nearly everywhere, inner must be non-null, however in places where
9355 * the Rust equivalent takes an Option, it may be set to null to indicate None.
9357 LDKnativeUtxo *inner;
9359 * Indicates that this is the only struct which contains the same pointer.
9360 * Rust functions which take ownership of an object provided via an argument require
9361 * this to be true and invalidate the object pointed to by inner.
9367 * A dynamically-allocated array of crate::lightning::events::bump_transaction::Utxos of arbitrary size.
9368 * This corresponds to std::vector in C++
9370 typedef struct LDKCVec_UtxoZ {
9372 * The elements in the array.
9373 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
9375 struct LDKUtxo *data;
9377 * The number of elements pointed to by `data`.
9383 * An enum which can either contain a crate::c_types::TxOut or not
9385 typedef enum LDKCOption_TxOutZ_Tag {
9387 * When we're in this state, this COption_TxOutZ contains a crate::c_types::TxOut
9389 LDKCOption_TxOutZ_Some,
9391 * When we're in this state, this COption_TxOutZ contains nothing
9393 LDKCOption_TxOutZ_None,
9395 * Must be last for serialization purposes
9397 LDKCOption_TxOutZ_Sentinel,
9398 } LDKCOption_TxOutZ_Tag;
9400 typedef struct LDKCOption_TxOutZ {
9401 LDKCOption_TxOutZ_Tag tag;
9404 struct LDKTxOut some;
9407 } LDKCOption_TxOutZ;
9412 * An input that must be included in a transaction when performing coin selection through
9413 * [`CoinSelectionSource::select_confirmed_utxos`]. It is guaranteed to be a SegWit input, so it
9414 * must have an empty [`TxIn::script_sig`] when spent.
9416 typedef struct MUST_USE_STRUCT LDKInput {
9418 * A pointer to the opaque Rust object.
9419 * Nearly everywhere, inner must be non-null, however in places where
9420 * the Rust equivalent takes an Option, it may be set to null to indicate None.
9422 LDKnativeInput *inner;
9424 * Indicates that this is the only struct which contains the same pointer.
9425 * Rust functions which take ownership of an object provided via an argument require
9426 * this to be true and invalidate the object pointed to by inner.
9432 * A dynamically-allocated array of crate::lightning::events::bump_transaction::Inputs of arbitrary size.
9433 * This corresponds to std::vector in C++
9435 typedef struct LDKCVec_InputZ {
9437 * The elements in the array.
9438 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
9440 struct LDKInput *data;
9442 * The number of elements pointed to by `data`.
9450 * The result of a successful coin selection attempt for a transaction requiring additional UTXOs
9451 * to cover its fees.
9453 typedef struct MUST_USE_STRUCT LDKCoinSelection {
9455 * A pointer to the opaque Rust object.
9456 * Nearly everywhere, inner must be non-null, however in places where
9457 * the Rust equivalent takes an Option, it may be set to null to indicate None.
9459 LDKnativeCoinSelection *inner;
9461 * Indicates that this is the only struct which contains the same pointer.
9462 * Rust functions which take ownership of an object provided via an argument require
9463 * this to be true and invalidate the object pointed to by inner.
9469 * The contents of CResult_CoinSelectionNoneZ
9471 typedef union LDKCResult_CoinSelectionNoneZPtr {
9473 * A pointer to the contents in the success state.
9474 * Reading from this pointer when `result_ok` is not set is undefined.
9476 struct LDKCoinSelection *result;
9478 * Note that this value is always NULL, as there are no contents in the Err variant
9481 } LDKCResult_CoinSelectionNoneZPtr;
9484 * A CResult_CoinSelectionNoneZ represents the result of a fallible operation,
9485 * containing a crate::lightning::events::bump_transaction::CoinSelection on success and a () on failure.
9486 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9488 typedef struct LDKCResult_CoinSelectionNoneZ {
9490 * The contents of this CResult_CoinSelectionNoneZ, accessible via either
9491 * `err` or `result` depending on the state of `result_ok`.
9493 union LDKCResult_CoinSelectionNoneZPtr contents;
9495 * Whether this CResult_CoinSelectionNoneZ represents a success state.
9498 } LDKCResult_CoinSelectionNoneZ;
9501 * The contents of CResult_CVec_UtxoZNoneZ
9503 typedef union LDKCResult_CVec_UtxoZNoneZPtr {
9505 * A pointer to the contents in the success state.
9506 * Reading from this pointer when `result_ok` is not set is undefined.
9508 struct LDKCVec_UtxoZ *result;
9510 * Note that this value is always NULL, as there are no contents in the Err variant
9513 } LDKCResult_CVec_UtxoZNoneZPtr;
9516 * A CResult_CVec_UtxoZNoneZ represents the result of a fallible operation,
9517 * containing a crate::c_types::derived::CVec_UtxoZ on success and a () on failure.
9518 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9520 typedef struct LDKCResult_CVec_UtxoZNoneZ {
9522 * The contents of this CResult_CVec_UtxoZNoneZ, accessible via either
9523 * `err` or `result` depending on the state of `result_ok`.
9525 union LDKCResult_CVec_UtxoZNoneZPtr contents;
9527 * Whether this CResult_CVec_UtxoZNoneZ represents a success state.
9530 } LDKCResult_CVec_UtxoZNoneZ;
9535 * An unknown payment context.
9537 typedef struct MUST_USE_STRUCT LDKUnknownPaymentContext {
9539 * A pointer to the opaque Rust object.
9540 * Nearly everywhere, inner must be non-null, however in places where
9541 * the Rust equivalent takes an Option, it may be set to null to indicate None.
9543 LDKnativeUnknownPaymentContext *inner;
9545 * Indicates that this is the only struct which contains the same pointer.
9546 * Rust functions which take ownership of an object provided via an argument require
9547 * this to be true and invalidate the object pointed to by inner.
9550 } LDKUnknownPaymentContext;
9555 * The context of a payment made for an invoice requested from a BOLT 12 [`Offer`].
9557 * [`Offer`]: crate::offers::offer::Offer
9559 typedef struct MUST_USE_STRUCT LDKBolt12OfferContext {
9561 * A pointer to the opaque Rust object.
9562 * Nearly everywhere, inner must be non-null, however in places where
9563 * the Rust equivalent takes an Option, it may be set to null to indicate None.
9565 LDKnativeBolt12OfferContext *inner;
9567 * Indicates that this is the only struct which contains the same pointer.
9568 * Rust functions which take ownership of an object provided via an argument require
9569 * this to be true and invalidate the object pointed to by inner.
9572 } LDKBolt12OfferContext;
9577 * The context of a payment made for an invoice sent for a BOLT 12 [`Refund`].
9579 * [`Refund`]: crate::offers::refund::Refund
9581 typedef struct MUST_USE_STRUCT LDKBolt12RefundContext {
9583 * A pointer to the opaque Rust object.
9584 * Nearly everywhere, inner must be non-null, however in places where
9585 * the Rust equivalent takes an Option, it may be set to null to indicate None.
9587 LDKnativeBolt12RefundContext *inner;
9589 * Indicates that this is the only struct which contains the same pointer.
9590 * Rust functions which take ownership of an object provided via an argument require
9591 * this to be true and invalidate the object pointed to by inner.
9594 } LDKBolt12RefundContext;
9597 * The context of an inbound payment, which is included in a [`BlindedPath`] via [`ReceiveTlvs`]
9598 * and surfaced in [`PaymentPurpose`].
9600 * [`BlindedPath`]: crate::blinded_path::BlindedPath
9601 * [`PaymentPurpose`]: crate::events::PaymentPurpose
9603 typedef enum LDKPaymentContext_Tag {
9605 * The payment context was unknown.
9607 LDKPaymentContext_Unknown,
9609 * The payment was made for an invoice requested from a BOLT 12 [`Offer`].
9611 * [`Offer`]: crate::offers::offer::Offer
9613 LDKPaymentContext_Bolt12Offer,
9615 * The payment was made for an invoice sent for a BOLT 12 [`Refund`].
9617 * [`Refund`]: crate::offers::refund::Refund
9619 LDKPaymentContext_Bolt12Refund,
9621 * Must be last for serialization purposes
9623 LDKPaymentContext_Sentinel,
9624 } LDKPaymentContext_Tag;
9626 typedef struct MUST_USE_STRUCT LDKPaymentContext {
9627 LDKPaymentContext_Tag tag;
9630 struct LDKUnknownPaymentContext unknown;
9633 struct LDKBolt12OfferContext bolt12_offer;
9636 struct LDKBolt12RefundContext bolt12_refund;
9639 } LDKPaymentContext;
9642 * An enum which can either contain a crate::lightning::blinded_path::payment::PaymentContext or not
9644 typedef enum LDKCOption_PaymentContextZ_Tag {
9646 * When we're in this state, this COption_PaymentContextZ contains a crate::lightning::blinded_path::payment::PaymentContext
9648 LDKCOption_PaymentContextZ_Some,
9650 * When we're in this state, this COption_PaymentContextZ contains nothing
9652 LDKCOption_PaymentContextZ_None,
9654 * Must be last for serialization purposes
9656 LDKCOption_PaymentContextZ_Sentinel,
9657 } LDKCOption_PaymentContextZ_Tag;
9659 typedef struct LDKCOption_PaymentContextZ {
9660 LDKCOption_PaymentContextZ_Tag tag;
9663 struct LDKPaymentContext some;
9666 } LDKCOption_PaymentContextZ;
9669 * A tuple of 2 elements. See the individual fields for the types contained.
9671 typedef struct LDKC2Tuple_u64u16Z {
9673 * The element at position 0
9677 * The element at position 1
9680 } LDKC2Tuple_u64u16Z;
9683 * An enum which can either contain a crate::c_types::derived::C2Tuple_u64u16Z or not
9685 typedef enum LDKCOption_C2Tuple_u64u16ZZ_Tag {
9687 * When we're in this state, this COption_C2Tuple_u64u16ZZ contains a crate::c_types::derived::C2Tuple_u64u16Z
9689 LDKCOption_C2Tuple_u64u16ZZ_Some,
9691 * When we're in this state, this COption_C2Tuple_u64u16ZZ contains nothing
9693 LDKCOption_C2Tuple_u64u16ZZ_None,
9695 * Must be last for serialization purposes
9697 LDKCOption_C2Tuple_u64u16ZZ_Sentinel,
9698 } LDKCOption_C2Tuple_u64u16ZZ_Tag;
9700 typedef struct LDKCOption_C2Tuple_u64u16ZZ {
9701 LDKCOption_C2Tuple_u64u16ZZ_Tag tag;
9704 struct LDKC2Tuple_u64u16Z some;
9707 } LDKCOption_C2Tuple_u64u16ZZ;
9710 * The contents of CResult_ChannelIdAPIErrorZ
9712 typedef union LDKCResult_ChannelIdAPIErrorZPtr {
9714 * A pointer to the contents in the success state.
9715 * Reading from this pointer when `result_ok` is not set is undefined.
9717 struct LDKChannelId *result;
9719 * A pointer to the contents in the error state.
9720 * Reading from this pointer when `result_ok` is set is undefined.
9722 struct LDKAPIError *err;
9723 } LDKCResult_ChannelIdAPIErrorZPtr;
9726 * A CResult_ChannelIdAPIErrorZ represents the result of a fallible operation,
9727 * containing a crate::lightning::ln::types::ChannelId on success and a crate::lightning::util::errors::APIError on failure.
9728 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9730 typedef struct LDKCResult_ChannelIdAPIErrorZ {
9732 * The contents of this CResult_ChannelIdAPIErrorZ, accessible via either
9733 * `err` or `result` depending on the state of `result_ok`.
9735 union LDKCResult_ChannelIdAPIErrorZPtr contents;
9737 * Whether this CResult_ChannelIdAPIErrorZ represents a success state.
9740 } LDKCResult_ChannelIdAPIErrorZ;
9743 * Used by [`ChannelManager::list_recent_payments`] to express the status of recent payments.
9744 * These include payments that have yet to find a successful path, or have unresolved HTLCs.
9746 typedef enum LDKRecentPaymentDetails_Tag {
9748 * When an invoice was requested and thus a payment has not yet been sent.
9750 LDKRecentPaymentDetails_AwaitingInvoice,
9752 * When a payment is still being sent and awaiting successful delivery.
9754 LDKRecentPaymentDetails_Pending,
9756 * When a pending payment is fulfilled, we continue tracking it until all pending HTLCs have
9757 * been resolved. Upon receiving [`Event::PaymentSent`], we delay for a few minutes before the
9758 * payment is removed from tracking.
9760 LDKRecentPaymentDetails_Fulfilled,
9762 * After a payment's retries are exhausted per the provided [`Retry`], or it is explicitly
9763 * abandoned via [`ChannelManager::abandon_payment`], it is marked as abandoned until all
9764 * pending HTLCs for this payment resolve and an [`Event::PaymentFailed`] is generated.
9766 LDKRecentPaymentDetails_Abandoned,
9768 * Must be last for serialization purposes
9770 LDKRecentPaymentDetails_Sentinel,
9771 } LDKRecentPaymentDetails_Tag;
9773 typedef struct LDKRecentPaymentDetails_LDKAwaitingInvoice_Body {
9775 * A user-provided identifier in [`ChannelManager::send_payment`] used to uniquely identify
9776 * a payment and ensure idempotency in LDK.
9778 struct LDKThirtyTwoBytes payment_id;
9779 } LDKRecentPaymentDetails_LDKAwaitingInvoice_Body;
9781 typedef struct LDKRecentPaymentDetails_LDKPending_Body {
9783 * A user-provided identifier in [`ChannelManager::send_payment`] used to uniquely identify
9784 * a payment and ensure idempotency in LDK.
9786 struct LDKThirtyTwoBytes payment_id;
9788 * Hash of the payment that is currently being sent but has yet to be fulfilled or
9791 struct LDKThirtyTwoBytes payment_hash;
9793 * Total amount (in msat, excluding fees) across all paths for this payment,
9794 * not just the amount currently inflight.
9796 uint64_t total_msat;
9797 } LDKRecentPaymentDetails_LDKPending_Body;
9799 typedef struct LDKRecentPaymentDetails_LDKFulfilled_Body {
9801 * A user-provided identifier in [`ChannelManager::send_payment`] used to uniquely identify
9802 * a payment and ensure idempotency in LDK.
9804 struct LDKThirtyTwoBytes payment_id;
9806 * Hash of the payment that was claimed. `None` for serializations of [`ChannelManager`]
9807 * made before LDK version 0.0.104.
9809 struct LDKCOption_ThirtyTwoBytesZ payment_hash;
9810 } LDKRecentPaymentDetails_LDKFulfilled_Body;
9812 typedef struct LDKRecentPaymentDetails_LDKAbandoned_Body {
9814 * A user-provided identifier in [`ChannelManager::send_payment`] used to uniquely identify
9815 * a payment and ensure idempotency in LDK.
9817 struct LDKThirtyTwoBytes payment_id;
9819 * Hash of the payment that we have given up trying to send.
9821 struct LDKThirtyTwoBytes payment_hash;
9822 } LDKRecentPaymentDetails_LDKAbandoned_Body;
9824 typedef struct MUST_USE_STRUCT LDKRecentPaymentDetails {
9825 LDKRecentPaymentDetails_Tag tag;
9827 LDKRecentPaymentDetails_LDKAwaitingInvoice_Body awaiting_invoice;
9828 LDKRecentPaymentDetails_LDKPending_Body pending;
9829 LDKRecentPaymentDetails_LDKFulfilled_Body fulfilled;
9830 LDKRecentPaymentDetails_LDKAbandoned_Body abandoned;
9832 } LDKRecentPaymentDetails;
9835 * A dynamically-allocated array of crate::lightning::ln::channelmanager::RecentPaymentDetailss of arbitrary size.
9836 * This corresponds to std::vector in C++
9838 typedef struct LDKCVec_RecentPaymentDetailsZ {
9840 * The elements in the array.
9841 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
9843 struct LDKRecentPaymentDetails *data;
9845 * The number of elements pointed to by `data`.
9848 } LDKCVec_RecentPaymentDetailsZ;
9851 * If a payment fails to send with [`ChannelManager::send_payment_with_route`], it can be in one
9852 * of several states. This enum is returned as the Err() type describing which state the payment
9853 * is in, see the description of individual enum states for more.
9855 * [`ChannelManager::send_payment_with_route`]: crate::ln::channelmanager::ChannelManager::send_payment_with_route
9857 typedef enum LDKPaymentSendFailure_Tag {
9859 * A parameter which was passed to send_payment was invalid, preventing us from attempting to
9860 * send the payment at all.
9862 * You can freely resend the payment in full (with the parameter error fixed).
9864 * Because the payment failed outright, no payment tracking is done and no
9865 * [`Event::PaymentPathFailed`] or [`Event::PaymentFailed`] events will be generated.
9867 * [`Event::PaymentPathFailed`]: crate::events::Event::PaymentPathFailed
9868 * [`Event::PaymentFailed`]: crate::events::Event::PaymentFailed
9870 LDKPaymentSendFailure_ParameterError,
9872 * A parameter in a single path which was passed to send_payment was invalid, preventing us
9873 * from attempting to send the payment at all.
9875 * You can freely resend the payment in full (with the parameter error fixed).
9877 * Because the payment failed outright, no payment tracking is done and no
9878 * [`Event::PaymentPathFailed`] or [`Event::PaymentFailed`] events will be generated.
9880 * The results here are ordered the same as the paths in the route object which was passed to
9883 * [`Event::PaymentPathFailed`]: crate::events::Event::PaymentPathFailed
9884 * [`Event::PaymentFailed`]: crate::events::Event::PaymentFailed
9886 LDKPaymentSendFailure_PathParameterError,
9888 * All paths which were attempted failed to send, with no channel state change taking place.
9889 * You can freely resend the payment in full (though you probably want to do so over different
9890 * paths than the ones selected).
9892 * Because the payment failed outright, no payment tracking is done and no
9893 * [`Event::PaymentPathFailed`] or [`Event::PaymentFailed`] events will be generated.
9895 * [`Event::PaymentPathFailed`]: crate::events::Event::PaymentPathFailed
9896 * [`Event::PaymentFailed`]: crate::events::Event::PaymentFailed
9898 LDKPaymentSendFailure_AllFailedResendSafe,
9900 * Indicates that a payment for the provided [`PaymentId`] is already in-flight and has not
9901 * yet completed (i.e. generated an [`Event::PaymentSent`] or [`Event::PaymentFailed`]).
9903 * [`PaymentId`]: crate::ln::channelmanager::PaymentId
9904 * [`Event::PaymentSent`]: crate::events::Event::PaymentSent
9905 * [`Event::PaymentFailed`]: crate::events::Event::PaymentFailed
9907 LDKPaymentSendFailure_DuplicatePayment,
9909 * Some paths that were attempted failed to send, though some paths may have succeeded. At least
9910 * some paths have irrevocably committed to the HTLC.
9912 * The results here are ordered the same as the paths in the route object that was passed to
9915 * Any entries that contain `Err(APIError::MonitorUpdateInprogress)` will send once a
9916 * [`MonitorEvent::Completed`] is provided for the next-hop channel with the latest update_id.
9918 * [`MonitorEvent::Completed`]: crate::chain::channelmonitor::MonitorEvent::Completed
9920 LDKPaymentSendFailure_PartialFailure,
9922 * Must be last for serialization purposes
9924 LDKPaymentSendFailure_Sentinel,
9925 } LDKPaymentSendFailure_Tag;
9927 typedef struct LDKPaymentSendFailure_LDKPartialFailure_Body {
9929 * The errors themselves, in the same order as the paths from the route.
9931 struct LDKCVec_CResult_NoneAPIErrorZZ results;
9933 * If some paths failed without irrevocably committing to the new HTLC(s), this will
9934 * contain a [`RouteParameters`] object for the failing paths.
9936 * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
9938 struct LDKRouteParameters failed_paths_retry;
9940 * The payment id for the payment, which is now at least partially pending.
9942 struct LDKThirtyTwoBytes payment_id;
9943 } LDKPaymentSendFailure_LDKPartialFailure_Body;
9945 typedef struct MUST_USE_STRUCT LDKPaymentSendFailure {
9946 LDKPaymentSendFailure_Tag tag;
9949 struct LDKAPIError parameter_error;
9952 struct LDKCVec_CResult_NoneAPIErrorZZ path_parameter_error;
9955 struct LDKCVec_APIErrorZ all_failed_resend_safe;
9957 LDKPaymentSendFailure_LDKPartialFailure_Body partial_failure;
9959 } LDKPaymentSendFailure;
9962 * The contents of CResult_NonePaymentSendFailureZ
9964 typedef union LDKCResult_NonePaymentSendFailureZPtr {
9966 * Note that this value is always NULL, as there are no contents in the OK variant
9970 * A pointer to the contents in the error state.
9971 * Reading from this pointer when `result_ok` is set is undefined.
9973 struct LDKPaymentSendFailure *err;
9974 } LDKCResult_NonePaymentSendFailureZPtr;
9977 * A CResult_NonePaymentSendFailureZ represents the result of a fallible operation,
9978 * containing a () on success and a crate::lightning::ln::outbound_payment::PaymentSendFailure on failure.
9979 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9981 typedef struct LDKCResult_NonePaymentSendFailureZ {
9983 * The contents of this CResult_NonePaymentSendFailureZ, accessible via either
9984 * `err` or `result` depending on the state of `result_ok`.
9986 union LDKCResult_NonePaymentSendFailureZPtr contents;
9988 * Whether this CResult_NonePaymentSendFailureZ represents a success state.
9991 } LDKCResult_NonePaymentSendFailureZ;
9994 * The contents of CResult_NoneRetryableSendFailureZ
9996 typedef union LDKCResult_NoneRetryableSendFailureZPtr {
9998 * Note that this value is always NULL, as there are no contents in the OK variant
10002 * A pointer to the contents in the error state.
10003 * Reading from this pointer when `result_ok` is set is undefined.
10005 enum LDKRetryableSendFailure *err;
10006 } LDKCResult_NoneRetryableSendFailureZPtr;
10009 * A CResult_NoneRetryableSendFailureZ represents the result of a fallible operation,
10010 * containing a () on success and a crate::lightning::ln::outbound_payment::RetryableSendFailure on failure.
10011 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10013 typedef struct LDKCResult_NoneRetryableSendFailureZ {
10015 * The contents of this CResult_NoneRetryableSendFailureZ, accessible via either
10016 * `err` or `result` depending on the state of `result_ok`.
10018 union LDKCResult_NoneRetryableSendFailureZPtr contents;
10020 * Whether this CResult_NoneRetryableSendFailureZ represents a success state.
10023 } LDKCResult_NoneRetryableSendFailureZ;
10026 * The contents of CResult_ThirtyTwoBytesPaymentSendFailureZ
10028 typedef union LDKCResult_ThirtyTwoBytesPaymentSendFailureZPtr {
10030 * A pointer to the contents in the success state.
10031 * Reading from this pointer when `result_ok` is not set is undefined.
10033 struct LDKThirtyTwoBytes *result;
10035 * A pointer to the contents in the error state.
10036 * Reading from this pointer when `result_ok` is set is undefined.
10038 struct LDKPaymentSendFailure *err;
10039 } LDKCResult_ThirtyTwoBytesPaymentSendFailureZPtr;
10042 * A CResult_ThirtyTwoBytesPaymentSendFailureZ represents the result of a fallible operation,
10043 * containing a crate::c_types::ThirtyTwoBytes on success and a crate::lightning::ln::outbound_payment::PaymentSendFailure on failure.
10044 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10046 typedef struct LDKCResult_ThirtyTwoBytesPaymentSendFailureZ {
10048 * The contents of this CResult_ThirtyTwoBytesPaymentSendFailureZ, accessible via either
10049 * `err` or `result` depending on the state of `result_ok`.
10051 union LDKCResult_ThirtyTwoBytesPaymentSendFailureZPtr contents;
10053 * Whether this CResult_ThirtyTwoBytesPaymentSendFailureZ represents a success state.
10056 } LDKCResult_ThirtyTwoBytesPaymentSendFailureZ;
10059 * The contents of CResult_ThirtyTwoBytesRetryableSendFailureZ
10061 typedef union LDKCResult_ThirtyTwoBytesRetryableSendFailureZPtr {
10063 * A pointer to the contents in the success state.
10064 * Reading from this pointer when `result_ok` is not set is undefined.
10066 struct LDKThirtyTwoBytes *result;
10068 * A pointer to the contents in the error state.
10069 * Reading from this pointer when `result_ok` is set is undefined.
10071 enum LDKRetryableSendFailure *err;
10072 } LDKCResult_ThirtyTwoBytesRetryableSendFailureZPtr;
10075 * A CResult_ThirtyTwoBytesRetryableSendFailureZ represents the result of a fallible operation,
10076 * containing a crate::c_types::ThirtyTwoBytes on success and a crate::lightning::ln::outbound_payment::RetryableSendFailure on failure.
10077 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10079 typedef struct LDKCResult_ThirtyTwoBytesRetryableSendFailureZ {
10081 * The contents of this CResult_ThirtyTwoBytesRetryableSendFailureZ, accessible via either
10082 * `err` or `result` depending on the state of `result_ok`.
10084 union LDKCResult_ThirtyTwoBytesRetryableSendFailureZPtr contents;
10086 * Whether this CResult_ThirtyTwoBytesRetryableSendFailureZ represents a success state.
10089 } LDKCResult_ThirtyTwoBytesRetryableSendFailureZ;
10092 * A tuple of 2 elements. See the individual fields for the types contained.
10094 typedef struct LDKC2Tuple_ThirtyTwoBytesThirtyTwoBytesZ {
10096 * The element at position 0
10098 struct LDKThirtyTwoBytes a;
10100 * The element at position 1
10102 struct LDKThirtyTwoBytes b;
10103 } LDKC2Tuple_ThirtyTwoBytesThirtyTwoBytesZ;
10106 * The contents of CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ
10108 typedef union LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZPtr {
10110 * A pointer to the contents in the success state.
10111 * Reading from this pointer when `result_ok` is not set is undefined.
10113 struct LDKC2Tuple_ThirtyTwoBytesThirtyTwoBytesZ *result;
10115 * A pointer to the contents in the error state.
10116 * Reading from this pointer when `result_ok` is set is undefined.
10118 struct LDKPaymentSendFailure *err;
10119 } LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZPtr;
10122 * A CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ represents the result of a fallible operation,
10123 * containing a crate::c_types::derived::C2Tuple_ThirtyTwoBytesThirtyTwoBytesZ on success and a crate::lightning::ln::outbound_payment::PaymentSendFailure on failure.
10124 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10126 typedef struct LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ {
10128 * The contents of this CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ, accessible via either
10129 * `err` or `result` depending on the state of `result_ok`.
10131 union LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZPtr contents;
10133 * Whether this CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ represents a success state.
10136 } LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ;
10139 * A dynamically-allocated array of crate::c_types::derived::C2Tuple_ThirtyTwoBytesThirtyTwoBytesZs of arbitrary size.
10140 * This corresponds to std::vector in C++
10142 typedef struct LDKCVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZ {
10144 * The elements in the array.
10145 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
10147 struct LDKC2Tuple_ThirtyTwoBytesThirtyTwoBytesZ *data;
10149 * The number of elements pointed to by `data`.
10152 } LDKCVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZ;
10155 * Indicates that we failed to send a payment probe. Further errors may be surfaced later via
10156 * [`Event::ProbeFailed`].
10158 * [`Event::ProbeFailed`]: crate::events::Event::ProbeFailed
10160 typedef enum LDKProbeSendFailure_Tag {
10162 * We were unable to find a route to the destination.
10164 LDKProbeSendFailure_RouteNotFound,
10166 * We failed to send the payment probes.
10168 LDKProbeSendFailure_SendingFailed,
10170 * Must be last for serialization purposes
10172 LDKProbeSendFailure_Sentinel,
10173 } LDKProbeSendFailure_Tag;
10175 typedef struct MUST_USE_STRUCT LDKProbeSendFailure {
10176 LDKProbeSendFailure_Tag tag;
10179 struct LDKPaymentSendFailure sending_failed;
10182 } LDKProbeSendFailure;
10185 * The contents of CResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ
10187 typedef union LDKCResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZPtr {
10189 * A pointer to the contents in the success state.
10190 * Reading from this pointer when `result_ok` is not set is undefined.
10192 struct LDKCVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZ *result;
10194 * A pointer to the contents in the error state.
10195 * Reading from this pointer when `result_ok` is set is undefined.
10197 struct LDKProbeSendFailure *err;
10198 } LDKCResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZPtr;
10201 * A CResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ represents the result of a fallible operation,
10202 * containing a crate::c_types::derived::CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZ on success and a crate::lightning::ln::outbound_payment::ProbeSendFailure on failure.
10203 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10205 typedef struct LDKCResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ {
10207 * The contents of this CResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ, accessible via either
10208 * `err` or `result` depending on the state of `result_ok`.
10210 union LDKCResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZPtr contents;
10212 * Whether this CResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ represents a success state.
10215 } LDKCResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ;
10218 * A tuple of 2 elements. See the individual fields for the types contained.
10220 typedef struct LDKC2Tuple_ChannelIdPublicKeyZ {
10222 * The element at position 0
10224 struct LDKChannelId a;
10226 * The element at position 1
10228 struct LDKPublicKey b;
10229 } LDKC2Tuple_ChannelIdPublicKeyZ;
10232 * A dynamically-allocated array of crate::c_types::derived::C2Tuple_ChannelIdPublicKeyZs of arbitrary size.
10233 * This corresponds to std::vector in C++
10235 typedef struct LDKCVec_C2Tuple_ChannelIdPublicKeyZZ {
10237 * The elements in the array.
10238 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
10240 struct LDKC2Tuple_ChannelIdPublicKeyZ *data;
10242 * The number of elements pointed to by `data`.
10245 } LDKCVec_C2Tuple_ChannelIdPublicKeyZZ;
10248 * A dynamically-allocated array of crate::lightning::ln::types::ChannelIds of arbitrary size.
10249 * This corresponds to std::vector in C++
10251 typedef struct LDKCVec_ChannelIdZ {
10253 * The elements in the array.
10254 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
10256 struct LDKChannelId *data;
10258 * The number of elements pointed to by `data`.
10261 } LDKCVec_ChannelIdZ;
10266 * Builds an [`Offer`] for the \"offer to be paid\" flow.
10268 * See [module-level documentation] for usage.
10270 * [module-level documentation]: self
10272 typedef struct MUST_USE_STRUCT LDKOfferWithDerivedMetadataBuilder {
10274 * A pointer to the opaque Rust object.
10275 * Nearly everywhere, inner must be non-null, however in places where
10276 * the Rust equivalent takes an Option, it may be set to null to indicate None.
10278 LDKnativeOfferWithDerivedMetadataBuilder *inner;
10280 * Indicates that this is the only struct which contains the same pointer.
10281 * Rust functions which take ownership of an object provided via an argument require
10282 * this to be true and invalidate the object pointed to by inner.
10285 } LDKOfferWithDerivedMetadataBuilder;
10288 * The contents of CResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ
10290 typedef union LDKCResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZPtr {
10292 * A pointer to the contents in the success state.
10293 * Reading from this pointer when `result_ok` is not set is undefined.
10295 struct LDKOfferWithDerivedMetadataBuilder *result;
10297 * A pointer to the contents in the error state.
10298 * Reading from this pointer when `result_ok` is set is undefined.
10300 enum LDKBolt12SemanticError *err;
10301 } LDKCResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZPtr;
10304 * A CResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ represents the result of a fallible operation,
10305 * containing a crate::lightning::offers::offer::OfferWithDerivedMetadataBuilder on success and a crate::lightning::offers::parse::Bolt12SemanticError on failure.
10306 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10308 typedef struct LDKCResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ {
10310 * The contents of this CResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ, accessible via either
10311 * `err` or `result` depending on the state of `result_ok`.
10313 union LDKCResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZPtr contents;
10315 * Whether this CResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ represents a success state.
10318 } LDKCResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ;
10321 * An enum which can either contain a crate::c_types::Str or not
10323 typedef enum LDKCOption_StrZ_Tag {
10325 * When we're in this state, this COption_StrZ contains a crate::c_types::Str
10327 LDKCOption_StrZ_Some,
10329 * When we're in this state, this COption_StrZ contains nothing
10331 LDKCOption_StrZ_None,
10333 * Must be last for serialization purposes
10335 LDKCOption_StrZ_Sentinel,
10336 } LDKCOption_StrZ_Tag;
10338 typedef struct LDKCOption_StrZ {
10339 LDKCOption_StrZ_Tag tag;
10342 struct LDKStr some;
10348 * The contents of CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ
10350 typedef union LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZPtr {
10352 * A pointer to the contents in the success state.
10353 * Reading from this pointer when `result_ok` is not set is undefined.
10355 struct LDKC2Tuple_ThirtyTwoBytesThirtyTwoBytesZ *result;
10357 * Note that this value is always NULL, as there are no contents in the Err variant
10360 } LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZPtr;
10363 * A CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ represents the result of a fallible operation,
10364 * containing a crate::c_types::derived::C2Tuple_ThirtyTwoBytesThirtyTwoBytesZ on success and a () on failure.
10365 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10367 typedef struct LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ {
10369 * The contents of this CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ, accessible via either
10370 * `err` or `result` depending on the state of `result_ok`.
10372 union LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZPtr contents;
10374 * Whether this CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ represents a success state.
10377 } LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ;
10380 * The contents of CResult_ThirtyTwoBytesAPIErrorZ
10382 typedef union LDKCResult_ThirtyTwoBytesAPIErrorZPtr {
10384 * A pointer to the contents in the success state.
10385 * Reading from this pointer when `result_ok` is not set is undefined.
10387 struct LDKThirtyTwoBytes *result;
10389 * A pointer to the contents in the error state.
10390 * Reading from this pointer when `result_ok` is set is undefined.
10392 struct LDKAPIError *err;
10393 } LDKCResult_ThirtyTwoBytesAPIErrorZPtr;
10396 * A CResult_ThirtyTwoBytesAPIErrorZ represents the result of a fallible operation,
10397 * containing a crate::c_types::ThirtyTwoBytes on success and a crate::lightning::util::errors::APIError on failure.
10398 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10400 typedef struct LDKCResult_ThirtyTwoBytesAPIErrorZ {
10402 * The contents of this CResult_ThirtyTwoBytesAPIErrorZ, accessible via either
10403 * `err` or `result` depending on the state of `result_ok`.
10405 union LDKCResult_ThirtyTwoBytesAPIErrorZPtr contents;
10407 * Whether this CResult_ThirtyTwoBytesAPIErrorZ represents a success state.
10410 } LDKCResult_ThirtyTwoBytesAPIErrorZ;
10415 * An `InvoiceRequest` is a request for a [`Bolt12Invoice`] formulated from an [`Offer`].
10417 * An offer may provide choices such as quantity, amount, chain, features, etc. An invoice request
10418 * specifies these such that its recipient can send an invoice for payment.
10420 * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice
10421 * [`Offer`]: crate::offers::offer::Offer
10423 typedef struct MUST_USE_STRUCT LDKInvoiceRequest {
10425 * A pointer to the opaque Rust object.
10426 * Nearly everywhere, inner must be non-null, however in places where
10427 * the Rust equivalent takes an Option, it may be set to null to indicate None.
10429 LDKnativeInvoiceRequest *inner;
10431 * Indicates that this is the only struct which contains the same pointer.
10432 * Rust functions which take ownership of an object provided via an argument require
10433 * this to be true and invalidate the object pointed to by inner.
10436 } LDKInvoiceRequest;
10441 * An error in response to an [`InvoiceRequest`] or an [`Bolt12Invoice`].
10443 * [`InvoiceRequest`]: crate::offers::invoice_request::InvoiceRequest
10444 * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice
10446 typedef struct MUST_USE_STRUCT LDKInvoiceError {
10448 * A pointer to the opaque Rust object.
10449 * Nearly everywhere, inner must be non-null, however in places where
10450 * the Rust equivalent takes an Option, it may be set to null to indicate None.
10452 LDKnativeInvoiceError *inner;
10454 * Indicates that this is the only struct which contains the same pointer.
10455 * Rust functions which take ownership of an object provided via an argument require
10456 * this to be true and invalidate the object pointed to by inner.
10462 * Possible BOLT 12 Offers messages sent and received via an [`OnionMessage`].
10464 * [`OnionMessage`]: crate::ln::msgs::OnionMessage
10466 typedef enum LDKOffersMessage_Tag {
10468 * A request for a [`Bolt12Invoice`] for a particular [`Offer`].
10470 * [`Offer`]: crate::offers::offer::Offer
10472 LDKOffersMessage_InvoiceRequest,
10474 * A [`Bolt12Invoice`] sent in response to an [`InvoiceRequest`] or a [`Refund`].
10476 * [`Refund`]: crate::offers::refund::Refund
10478 LDKOffersMessage_Invoice,
10480 * An error from handling an [`OffersMessage`].
10482 LDKOffersMessage_InvoiceError,
10484 * Must be last for serialization purposes
10486 LDKOffersMessage_Sentinel,
10487 } LDKOffersMessage_Tag;
10489 typedef struct MUST_USE_STRUCT LDKOffersMessage {
10490 LDKOffersMessage_Tag tag;
10493 struct LDKInvoiceRequest invoice_request;
10496 struct LDKBolt12Invoice invoice;
10499 struct LDKInvoiceError invoice_error;
10502 } LDKOffersMessage;
10505 * An enum which can either contain a crate::lightning::onion_message::offers::OffersMessage or not
10507 typedef enum LDKCOption_OffersMessageZ_Tag {
10509 * When we're in this state, this COption_OffersMessageZ contains a crate::lightning::onion_message::offers::OffersMessage
10511 LDKCOption_OffersMessageZ_Some,
10513 * When we're in this state, this COption_OffersMessageZ contains nothing
10515 LDKCOption_OffersMessageZ_None,
10517 * Must be last for serialization purposes
10519 LDKCOption_OffersMessageZ_Sentinel,
10520 } LDKCOption_OffersMessageZ_Tag;
10522 typedef struct LDKCOption_OffersMessageZ {
10523 LDKCOption_OffersMessageZ_Tag tag;
10526 struct LDKOffersMessage some;
10529 } LDKCOption_OffersMessageZ;
10532 * The destination of an onion message.
10534 typedef enum LDKDestination_Tag {
10536 * We're sending this onion message to a node.
10538 LDKDestination_Node,
10540 * We're sending this onion message to a blinded path.
10542 LDKDestination_BlindedPath,
10544 * Must be last for serialization purposes
10546 LDKDestination_Sentinel,
10547 } LDKDestination_Tag;
10549 typedef struct MUST_USE_STRUCT LDKDestination {
10550 LDKDestination_Tag tag;
10553 struct LDKPublicKey node;
10556 struct LDKBlindedPath blinded_path;
10562 * A tuple of 3 elements. See the individual fields for the types contained.
10564 typedef struct LDKC3Tuple_OffersMessageDestinationBlindedPathZ {
10566 * The element at position 0
10568 struct LDKOffersMessage a;
10570 * The element at position 1
10572 struct LDKDestination b;
10574 * The element at position 2
10576 struct LDKBlindedPath c;
10577 } LDKC3Tuple_OffersMessageDestinationBlindedPathZ;
10580 * A dynamically-allocated array of crate::c_types::derived::C3Tuple_OffersMessageDestinationBlindedPathZs of arbitrary size.
10581 * This corresponds to std::vector in C++
10583 typedef struct LDKCVec_C3Tuple_OffersMessageDestinationBlindedPathZZ {
10585 * The elements in the array.
10586 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
10588 struct LDKC3Tuple_OffersMessageDestinationBlindedPathZ *data;
10590 * The number of elements pointed to by `data`.
10593 } LDKCVec_C3Tuple_OffersMessageDestinationBlindedPathZZ;
10598 * Route hints used in constructing invoices for [phantom node payents].
10600 * [phantom node payments]: crate::sign::PhantomKeysManager
10602 typedef struct MUST_USE_STRUCT LDKPhantomRouteHints {
10604 * A pointer to the opaque Rust object.
10605 * Nearly everywhere, inner must be non-null, however in places where
10606 * the Rust equivalent takes an Option, it may be set to null to indicate None.
10608 LDKnativePhantomRouteHints *inner;
10610 * Indicates that this is the only struct which contains the same pointer.
10611 * Rust functions which take ownership of an object provided via an argument require
10612 * this to be true and invalidate the object pointed to by inner.
10615 } LDKPhantomRouteHints;
10618 * The contents of CResult_PhantomRouteHintsDecodeErrorZ
10620 typedef union LDKCResult_PhantomRouteHintsDecodeErrorZPtr {
10622 * A pointer to the contents in the success state.
10623 * Reading from this pointer when `result_ok` is not set is undefined.
10625 struct LDKPhantomRouteHints *result;
10627 * A pointer to the contents in the error state.
10628 * Reading from this pointer when `result_ok` is set is undefined.
10630 struct LDKDecodeError *err;
10631 } LDKCResult_PhantomRouteHintsDecodeErrorZPtr;
10634 * A CResult_PhantomRouteHintsDecodeErrorZ represents the result of a fallible operation,
10635 * containing a crate::lightning::ln::channelmanager::PhantomRouteHints on success and a crate::lightning::ln::msgs::DecodeError on failure.
10636 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10638 typedef struct LDKCResult_PhantomRouteHintsDecodeErrorZ {
10640 * The contents of this CResult_PhantomRouteHintsDecodeErrorZ, accessible via either
10641 * `err` or `result` depending on the state of `result_ok`.
10643 union LDKCResult_PhantomRouteHintsDecodeErrorZPtr contents;
10645 * Whether this CResult_PhantomRouteHintsDecodeErrorZ represents a success state.
10648 } LDKCResult_PhantomRouteHintsDecodeErrorZ;
10653 * Information used to forward or fail this HTLC that is being forwarded within a blinded path.
10655 typedef struct MUST_USE_STRUCT LDKBlindedForward {
10657 * A pointer to the opaque Rust object.
10658 * Nearly everywhere, inner must be non-null, however in places where
10659 * the Rust equivalent takes an Option, it may be set to null to indicate None.
10661 LDKnativeBlindedForward *inner;
10663 * Indicates that this is the only struct which contains the same pointer.
10664 * Rust functions which take ownership of an object provided via an argument require
10665 * this to be true and invalidate the object pointed to by inner.
10668 } LDKBlindedForward;
10671 * The contents of CResult_BlindedForwardDecodeErrorZ
10673 typedef union LDKCResult_BlindedForwardDecodeErrorZPtr {
10675 * A pointer to the contents in the success state.
10676 * Reading from this pointer when `result_ok` is not set is undefined.
10678 struct LDKBlindedForward *result;
10680 * A pointer to the contents in the error state.
10681 * Reading from this pointer when `result_ok` is set is undefined.
10683 struct LDKDecodeError *err;
10684 } LDKCResult_BlindedForwardDecodeErrorZPtr;
10687 * A CResult_BlindedForwardDecodeErrorZ represents the result of a fallible operation,
10688 * containing a crate::lightning::ln::channelmanager::BlindedForward on success and a crate::lightning::ln::msgs::DecodeError on failure.
10689 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10691 typedef struct LDKCResult_BlindedForwardDecodeErrorZ {
10693 * The contents of this CResult_BlindedForwardDecodeErrorZ, accessible via either
10694 * `err` or `result` depending on the state of `result_ok`.
10696 union LDKCResult_BlindedForwardDecodeErrorZPtr contents;
10698 * Whether this CResult_BlindedForwardDecodeErrorZ represents a success state.
10701 } LDKCResult_BlindedForwardDecodeErrorZ;
10706 * BOLT 4 onion packet including hop data for the next peer.
10708 typedef struct MUST_USE_STRUCT LDKOnionPacket {
10710 * A pointer to the opaque Rust object.
10711 * Nearly everywhere, inner must be non-null, however in places where
10712 * the Rust equivalent takes an Option, it may be set to null to indicate None.
10714 LDKnativeOnionPacket *inner;
10716 * Indicates that this is the only struct which contains the same pointer.
10717 * Rust functions which take ownership of an object provided via an argument require
10718 * this to be true and invalidate the object pointed to by inner.
10726 * Information communicated in the onion to the recipient for multi-part tracking and proof that
10727 * the payment is associated with an invoice.
10729 typedef struct MUST_USE_STRUCT LDKFinalOnionHopData {
10731 * A pointer to the opaque Rust object.
10732 * Nearly everywhere, inner must be non-null, however in places where
10733 * the Rust equivalent takes an Option, it may be set to null to indicate None.
10735 LDKnativeFinalOnionHopData *inner;
10737 * Indicates that this is the only struct which contains the same pointer.
10738 * Rust functions which take ownership of an object provided via an argument require
10739 * this to be true and invalidate the object pointed to by inner.
10742 } LDKFinalOnionHopData;
10745 * Information about where a received HTLC('s onion) has indicated the HTLC should go.
10747 typedef enum LDKPendingHTLCRouting_Tag {
10749 * An HTLC which should be forwarded on to another node.
10751 LDKPendingHTLCRouting_Forward,
10753 * The onion indicates that this is a payment for an invoice (supposedly) generated by us.
10755 * Note that at this point, we have not checked that the invoice being paid was actually
10756 * generated by us, but rather it's claiming to pay an invoice of ours.
10758 LDKPendingHTLCRouting_Receive,
10760 * The onion indicates that this is for payment to us but which contains the preimage for
10761 * claiming included, and is unrelated to any invoice we'd previously generated (aka a
10762 * \"keysend\" or \"spontaneous\" payment).
10764 LDKPendingHTLCRouting_ReceiveKeysend,
10766 * Must be last for serialization purposes
10768 LDKPendingHTLCRouting_Sentinel,
10769 } LDKPendingHTLCRouting_Tag;
10771 typedef struct LDKPendingHTLCRouting_LDKForward_Body {
10773 * The onion which should be included in the forwarded HTLC, telling the next hop what to
10774 * do with the HTLC.
10776 struct LDKOnionPacket onion_packet;
10778 * The short channel ID of the channel which we were instructed to forward this HTLC to.
10780 * This could be a real on-chain SCID, an SCID alias, or some other SCID which has meaning
10781 * to the receiving node, such as one returned from
10782 * [`ChannelManager::get_intercept_scid`] or [`ChannelManager::get_phantom_scid`].
10784 uint64_t short_channel_id;
10786 * Set if this HTLC is being forwarded within a blinded path.
10788 * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
10790 struct LDKBlindedForward blinded;
10791 } LDKPendingHTLCRouting_LDKForward_Body;
10793 typedef struct LDKPendingHTLCRouting_LDKReceive_Body {
10795 * Information about the amount the sender intended to pay and (potential) proof that this
10796 * is a payment for an invoice we generated. This proof of payment is is also used for
10797 * linking MPP parts of a larger payment.
10799 struct LDKFinalOnionHopData payment_data;
10801 * Additional data which we (allegedly) instructed the sender to include in the onion.
10803 * For HTLCs received by LDK, this will ultimately be exposed in
10804 * [`Event::PaymentClaimable::onion_fields`] as
10805 * [`RecipientOnionFields::payment_metadata`].
10807 struct LDKCOption_CVec_u8ZZ payment_metadata;
10809 * The context of the payment included by the recipient in a blinded path, or `None` if a
10810 * blinded path was not used.
10812 * Used in part to determine the [`events::PaymentPurpose`].
10814 struct LDKCOption_PaymentContextZ payment_context;
10816 * CLTV expiry of the received HTLC.
10818 * Used to track when we should expire pending HTLCs that go unclaimed.
10820 uint32_t incoming_cltv_expiry;
10822 * If the onion had forwarding instructions to one of our phantom node SCIDs, this will
10823 * provide the onion shared secret used to decrypt the next level of forwarding
10826 * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
10828 struct LDKThirtyTwoBytes phantom_shared_secret;
10830 * Custom TLVs which were set by the sender.
10832 * For HTLCs received by LDK, this will ultimately be exposed in
10833 * [`Event::PaymentClaimable::onion_fields`] as
10834 * [`RecipientOnionFields::custom_tlvs`].
10836 struct LDKCVec_C2Tuple_u64CVec_u8ZZZ custom_tlvs;
10838 * Set if this HTLC is the final hop in a multi-hop blinded path.
10840 bool requires_blinded_error;
10841 } LDKPendingHTLCRouting_LDKReceive_Body;
10843 typedef struct LDKPendingHTLCRouting_LDKReceiveKeysend_Body {
10845 * Information about the amount the sender intended to pay and possibly a token to
10846 * associate MPP parts of a larger payment.
10848 * This will only be filled in if receiving MPP keysend payments is enabled, and it being
10849 * present will cause deserialization to fail on versions of LDK prior to 0.0.116.
10851 * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
10853 struct LDKFinalOnionHopData payment_data;
10855 * Preimage for this onion payment. This preimage is provided by the sender and will be
10856 * used to settle the spontaneous payment.
10858 struct LDKThirtyTwoBytes payment_preimage;
10860 * Additional data which we (allegedly) instructed the sender to include in the onion.
10862 * For HTLCs received by LDK, this will ultimately bubble back up as
10863 * [`RecipientOnionFields::payment_metadata`].
10865 struct LDKCOption_CVec_u8ZZ payment_metadata;
10867 * CLTV expiry of the received HTLC.
10869 * Used to track when we should expire pending HTLCs that go unclaimed.
10871 uint32_t incoming_cltv_expiry;
10873 * Custom TLVs which were set by the sender.
10875 * For HTLCs received by LDK, these will ultimately bubble back up as
10876 * [`RecipientOnionFields::custom_tlvs`].
10878 struct LDKCVec_C2Tuple_u64CVec_u8ZZZ custom_tlvs;
10880 * Set if this HTLC is the final hop in a multi-hop blinded path.
10882 bool requires_blinded_error;
10883 } LDKPendingHTLCRouting_LDKReceiveKeysend_Body;
10885 typedef struct MUST_USE_STRUCT LDKPendingHTLCRouting {
10886 LDKPendingHTLCRouting_Tag tag;
10888 LDKPendingHTLCRouting_LDKForward_Body forward;
10889 LDKPendingHTLCRouting_LDKReceive_Body receive;
10890 LDKPendingHTLCRouting_LDKReceiveKeysend_Body receive_keysend;
10892 } LDKPendingHTLCRouting;
10895 * The contents of CResult_PendingHTLCRoutingDecodeErrorZ
10897 typedef union LDKCResult_PendingHTLCRoutingDecodeErrorZPtr {
10899 * A pointer to the contents in the success state.
10900 * Reading from this pointer when `result_ok` is not set is undefined.
10902 struct LDKPendingHTLCRouting *result;
10904 * A pointer to the contents in the error state.
10905 * Reading from this pointer when `result_ok` is set is undefined.
10907 struct LDKDecodeError *err;
10908 } LDKCResult_PendingHTLCRoutingDecodeErrorZPtr;
10911 * A CResult_PendingHTLCRoutingDecodeErrorZ represents the result of a fallible operation,
10912 * containing a crate::lightning::ln::channelmanager::PendingHTLCRouting on success and a crate::lightning::ln::msgs::DecodeError on failure.
10913 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10915 typedef struct LDKCResult_PendingHTLCRoutingDecodeErrorZ {
10917 * The contents of this CResult_PendingHTLCRoutingDecodeErrorZ, accessible via either
10918 * `err` or `result` depending on the state of `result_ok`.
10920 union LDKCResult_PendingHTLCRoutingDecodeErrorZPtr contents;
10922 * Whether this CResult_PendingHTLCRoutingDecodeErrorZ represents a success state.
10925 } LDKCResult_PendingHTLCRoutingDecodeErrorZ;
10928 * The contents of CResult_PendingHTLCInfoDecodeErrorZ
10930 typedef union LDKCResult_PendingHTLCInfoDecodeErrorZPtr {
10932 * A pointer to the contents in the success state.
10933 * Reading from this pointer when `result_ok` is not set is undefined.
10935 struct LDKPendingHTLCInfo *result;
10937 * A pointer to the contents in the error state.
10938 * Reading from this pointer when `result_ok` is set is undefined.
10940 struct LDKDecodeError *err;
10941 } LDKCResult_PendingHTLCInfoDecodeErrorZPtr;
10944 * A CResult_PendingHTLCInfoDecodeErrorZ represents the result of a fallible operation,
10945 * containing a crate::lightning::ln::channelmanager::PendingHTLCInfo on success and a crate::lightning::ln::msgs::DecodeError on failure.
10946 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10948 typedef struct LDKCResult_PendingHTLCInfoDecodeErrorZ {
10950 * The contents of this CResult_PendingHTLCInfoDecodeErrorZ, accessible via either
10951 * `err` or `result` depending on the state of `result_ok`.
10953 union LDKCResult_PendingHTLCInfoDecodeErrorZPtr contents;
10955 * Whether this CResult_PendingHTLCInfoDecodeErrorZ represents a success state.
10958 } LDKCResult_PendingHTLCInfoDecodeErrorZ;
10961 * The contents of CResult_BlindedFailureDecodeErrorZ
10963 typedef union LDKCResult_BlindedFailureDecodeErrorZPtr {
10965 * A pointer to the contents in the success state.
10966 * Reading from this pointer when `result_ok` is not set is undefined.
10968 enum LDKBlindedFailure *result;
10970 * A pointer to the contents in the error state.
10971 * Reading from this pointer when `result_ok` is set is undefined.
10973 struct LDKDecodeError *err;
10974 } LDKCResult_BlindedFailureDecodeErrorZPtr;
10977 * A CResult_BlindedFailureDecodeErrorZ represents the result of a fallible operation,
10978 * containing a crate::lightning::ln::channelmanager::BlindedFailure on success and a crate::lightning::ln::msgs::DecodeError on failure.
10979 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10981 typedef struct LDKCResult_BlindedFailureDecodeErrorZ {
10983 * The contents of this CResult_BlindedFailureDecodeErrorZ, accessible via either
10984 * `err` or `result` depending on the state of `result_ok`.
10986 union LDKCResult_BlindedFailureDecodeErrorZPtr contents;
10988 * Whether this CResult_BlindedFailureDecodeErrorZ represents a success state.
10991 } LDKCResult_BlindedFailureDecodeErrorZ;
10996 * A ChannelMonitor handles chain events (blocks connected and disconnected) and generates
10997 * on-chain transactions to ensure no loss of funds occurs.
10999 * You MUST ensure that no ChannelMonitors for a given channel anywhere contain out-of-date
11000 * information and are actively monitoring the chain.
11002 * Note that the deserializer is only implemented for (BlockHash, ChannelMonitor), which
11003 * tells you the last block hash which was block_connect()ed. You MUST rescan any blocks along
11004 * the \"reorg path\" (ie disconnecting blocks until you find a common ancestor from both the
11005 * returned block hash and the the current chain and then reconnecting blocks to get to the
11006 * best chain) upon deserializing the object!
11008 typedef struct MUST_USE_STRUCT LDKChannelMonitor {
11010 * A pointer to the opaque Rust object.
11011 * Nearly everywhere, inner must be non-null, however in places where
11012 * the Rust equivalent takes an Option, it may be set to null to indicate None.
11014 LDKnativeChannelMonitor *inner;
11016 * Indicates that this is the only struct which contains the same pointer.
11017 * Rust functions which take ownership of an object provided via an argument require
11018 * this to be true and invalidate the object pointed to by inner.
11021 } LDKChannelMonitor;
11024 * A dynamically-allocated array of crate::lightning::chain::channelmonitor::ChannelMonitors of arbitrary size.
11025 * This corresponds to std::vector in C++
11027 typedef struct LDKCVec_ChannelMonitorZ {
11029 * The elements in the array.
11030 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
11032 struct LDKChannelMonitor *data;
11034 * The number of elements pointed to by `data`.
11037 } LDKCVec_ChannelMonitorZ;
11042 * An update generated by the underlying channel itself which contains some new information the
11043 * [`ChannelMonitor`] should be made aware of.
11045 * Because this represents only a small number of updates to the underlying state, it is generally
11046 * much smaller than a full [`ChannelMonitor`]. However, for large single commitment transaction
11047 * updates (e.g. ones during which there are hundreds of HTLCs pending on the commitment
11048 * transaction), a single update may reach upwards of 1 MiB in serialized size.
11050 typedef struct MUST_USE_STRUCT LDKChannelMonitorUpdate {
11052 * A pointer to the opaque Rust object.
11053 * Nearly everywhere, inner must be non-null, however in places where
11054 * the Rust equivalent takes an Option, it may be set to null to indicate None.
11056 LDKnativeChannelMonitorUpdate *inner;
11058 * Indicates that this is the only struct which contains the same pointer.
11059 * Rust functions which take ownership of an object provided via an argument require
11060 * this to be true and invalidate the object pointed to by inner.
11063 } LDKChannelMonitorUpdate;
11066 * The `Watch` trait defines behavior for watching on-chain activity pertaining to channels as
11067 * blocks are connected and disconnected.
11069 * Each channel is associated with a [`ChannelMonitor`]. Implementations of this trait are
11070 * responsible for maintaining a set of monitors such that they can be updated as channel state
11071 * changes. On each update, *all copies* of a [`ChannelMonitor`] must be updated and the update
11072 * persisted to disk to ensure that the latest [`ChannelMonitor`] state can be reloaded if the
11073 * application crashes.
11075 * See method documentation and [`ChannelMonitorUpdateStatus`] for specific requirements.
11077 typedef struct LDKWatch {
11079 * An opaque pointer which is passed to your function implementations as an argument.
11080 * This has no meaning in the LDK, and can be NULL or any other value.
11084 * Watches a channel identified by `funding_txo` using `monitor`.
11086 * Implementations are responsible for watching the chain for the funding transaction along
11087 * with any spends of outputs returned by [`get_outputs_to_watch`]. In practice, this means
11088 * calling [`block_connected`] and [`block_disconnected`] on the monitor.
11090 * A return of `Err(())` indicates that the channel should immediately be force-closed without
11091 * broadcasting the funding transaction.
11093 * If the given `funding_txo` has previously been registered via `watch_channel`, `Err(())`
11094 * must be returned.
11096 * [`get_outputs_to_watch`]: channelmonitor::ChannelMonitor::get_outputs_to_watch
11097 * [`block_connected`]: channelmonitor::ChannelMonitor::block_connected
11098 * [`block_disconnected`]: channelmonitor::ChannelMonitor::block_disconnected
11100 struct LDKCResult_ChannelMonitorUpdateStatusNoneZ (*watch_channel)(const void *this_arg, struct LDKOutPoint funding_txo, struct LDKChannelMonitor monitor);
11102 * Updates a channel identified by `funding_txo` by applying `update` to its monitor.
11104 * Implementations must call [`ChannelMonitor::update_monitor`] with the given update. This
11105 * may fail (returning an `Err(())`), in which case this should return
11106 * [`ChannelMonitorUpdateStatus::InProgress`] (and the update should never complete). This
11107 * generally implies the channel has been closed (either by the funding outpoint being spent
11108 * on-chain or the [`ChannelMonitor`] having decided to do so and broadcasted a transaction),
11109 * and the [`ChannelManager`] state will be updated once it sees the funding spend on-chain.
11111 * In general, persistence failures should be retried after returning
11112 * [`ChannelMonitorUpdateStatus::InProgress`] and eventually complete. If a failure truly
11113 * cannot be retried, the node should shut down immediately after returning
11114 * [`ChannelMonitorUpdateStatus::UnrecoverableError`], see its documentation for more info.
11116 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
11118 enum LDKChannelMonitorUpdateStatus (*update_channel)(const void *this_arg, struct LDKOutPoint funding_txo, const struct LDKChannelMonitorUpdate *NONNULL_PTR update);
11120 * Returns any monitor events since the last call. Subsequent calls must only return new
11123 * Note that after any block- or transaction-connection calls to a [`ChannelMonitor`], no
11124 * further events may be returned here until the [`ChannelMonitor`] has been fully persisted
11127 * For details on asynchronous [`ChannelMonitor`] updating and returning
11128 * [`MonitorEvent::Completed`] here, see [`ChannelMonitorUpdateStatus::InProgress`].
11130 struct LDKCVec_C4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZZ (*release_pending_monitor_events)(const void *this_arg);
11132 * Frees any resources associated with this object given its this_arg pointer.
11133 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
11135 void (*free)(void *this_arg);
11139 * A dynamically-allocated array of crate::c_types::Transactions of arbitrary size.
11140 * This corresponds to std::vector in C++
11142 typedef struct LDKCVec_TransactionZ {
11144 * The elements in the array.
11145 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
11147 struct LDKTransaction *data;
11149 * The number of elements pointed to by `data`.
11152 } LDKCVec_TransactionZ;
11155 * An interface to send a transaction to the Bitcoin network.
11157 typedef struct LDKBroadcasterInterface {
11159 * An opaque pointer which is passed to your function implementations as an argument.
11160 * This has no meaning in the LDK, and can be NULL or any other value.
11164 * Sends a list of transactions out to (hopefully) be mined.
11165 * This only needs to handle the actual broadcasting of transactions, LDK will automatically
11166 * rebroadcast transactions that haven't made it into a block.
11168 * In some cases LDK may attempt to broadcast a transaction which double-spends another
11169 * and this isn't a bug and can be safely ignored.
11171 * If more than one transaction is given, these transactions should be considered to be a
11172 * package and broadcast together. Some of the transactions may or may not depend on each other,
11173 * be sure to manage both cases correctly.
11175 * Bitcoin transaction packages are defined in BIP 331 and here:
11176 * <https://github.com/bitcoin/bitcoin/blob/master/doc/policy/packages.md>
11178 void (*broadcast_transactions)(const void *this_arg, struct LDKCVec_TransactionZ txs);
11180 * Frees any resources associated with this object given its this_arg pointer.
11181 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
11183 void (*free)(void *this_arg);
11184 } LDKBroadcasterInterface;
11187 * A trait that describes a source of entropy.
11189 typedef struct LDKEntropySource {
11191 * An opaque pointer which is passed to your function implementations as an argument.
11192 * This has no meaning in the LDK, and can be NULL or any other value.
11196 * Gets a unique, cryptographically-secure, random 32-byte value. This method must return a
11197 * different value each time it is called.
11199 struct LDKThirtyTwoBytes (*get_secure_random_bytes)(const void *this_arg);
11201 * Frees any resources associated with this object given its this_arg pointer.
11202 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
11204 void (*free)(void *this_arg);
11205 } LDKEntropySource;
11210 * A semantically valid [`InvoiceRequest`] that hasn't been signed.
11214 * This is serialized as a TLV stream, which includes TLV records from the originating message. As
11215 * such, it may include unknown, odd TLV records.
11217 typedef struct MUST_USE_STRUCT LDKUnsignedInvoiceRequest {
11219 * A pointer to the opaque Rust object.
11220 * Nearly everywhere, inner must be non-null, however in places where
11221 * the Rust equivalent takes an Option, it may be set to null to indicate None.
11223 LDKnativeUnsignedInvoiceRequest *inner;
11225 * Indicates that this is the only struct which contains the same pointer.
11226 * Rust functions which take ownership of an object provided via an argument require
11227 * this to be true and invalidate the object pointed to by inner.
11230 } LDKUnsignedInvoiceRequest;
11235 * The unsigned part of a [`channel_update`] message.
11237 * [`channel_update`]: https://github.com/lightning/bolts/blob/master/07-routing-gossip.md#the-channel_update-message
11239 typedef struct MUST_USE_STRUCT LDKUnsignedChannelUpdate {
11241 * A pointer to the opaque Rust object.
11242 * Nearly everywhere, inner must be non-null, however in places where
11243 * the Rust equivalent takes an Option, it may be set to null to indicate None.
11245 LDKnativeUnsignedChannelUpdate *inner;
11247 * Indicates that this is the only struct which contains the same pointer.
11248 * Rust functions which take ownership of an object provided via an argument require
11249 * this to be true and invalidate the object pointed to by inner.
11252 } LDKUnsignedChannelUpdate;
11257 * The unsigned part of a [`node_announcement`] message.
11259 * [`node_announcement`]: https://github.com/lightning/bolts/blob/master/07-routing-gossip.md#the-node_announcement-message
11261 typedef struct MUST_USE_STRUCT LDKUnsignedNodeAnnouncement {
11263 * A pointer to the opaque Rust object.
11264 * Nearly everywhere, inner must be non-null, however in places where
11265 * the Rust equivalent takes an Option, it may be set to null to indicate None.
11267 LDKnativeUnsignedNodeAnnouncement *inner;
11269 * Indicates that this is the only struct which contains the same pointer.
11270 * Rust functions which take ownership of an object provided via an argument require
11271 * this to be true and invalidate the object pointed to by inner.
11274 } LDKUnsignedNodeAnnouncement;
11277 * Represents the set of gossip messages that require a signature from a node's identity key.
11279 typedef enum LDKUnsignedGossipMessage_Tag {
11281 * An unsigned channel announcement.
11283 LDKUnsignedGossipMessage_ChannelAnnouncement,
11285 * An unsigned channel update.
11287 LDKUnsignedGossipMessage_ChannelUpdate,
11289 * An unsigned node announcement.
11291 LDKUnsignedGossipMessage_NodeAnnouncement,
11293 * Must be last for serialization purposes
11295 LDKUnsignedGossipMessage_Sentinel,
11296 } LDKUnsignedGossipMessage_Tag;
11298 typedef struct MUST_USE_STRUCT LDKUnsignedGossipMessage {
11299 LDKUnsignedGossipMessage_Tag tag;
11302 struct LDKUnsignedChannelAnnouncement channel_announcement;
11305 struct LDKUnsignedChannelUpdate channel_update;
11308 struct LDKUnsignedNodeAnnouncement node_announcement;
11311 } LDKUnsignedGossipMessage;
11314 * A trait that can handle cryptographic operations at the scope level of a node.
11316 typedef struct LDKNodeSigner {
11318 * An opaque pointer which is passed to your function implementations as an argument.
11319 * This has no meaning in the LDK, and can be NULL or any other value.
11323 * Get secret key material as bytes for use in encrypting and decrypting inbound payment data.
11325 * If the implementor of this trait supports [phantom node payments], then every node that is
11326 * intended to be included in the phantom invoice route hints must return the same value from
11329 * This method must return the same value each time it is called.
11331 * [phantom node payments]: PhantomKeysManager
11333 struct LDKThirtyTwoBytes (*get_inbound_payment_key_material)(const void *this_arg);
11335 * Get node id based on the provided [`Recipient`].
11337 * This method must return the same value each time it is called with a given [`Recipient`]
11340 * Errors if the [`Recipient`] variant is not supported by the implementation.
11342 struct LDKCResult_PublicKeyNoneZ (*get_node_id)(const void *this_arg, enum LDKRecipient recipient);
11344 * Gets the ECDH shared secret of our node secret and `other_key`, multiplying by `tweak` if
11345 * one is provided. Note that this tweak can be applied to `other_key` instead of our node
11346 * secret, though this is less efficient.
11348 * Note that if this fails while attempting to forward an HTLC, LDK will panic. The error
11349 * should be resolved to allow LDK to resume forwarding HTLCs.
11351 * Errors if the [`Recipient`] variant is not supported by the implementation.
11353 struct LDKCResult_ThirtyTwoBytesNoneZ (*ecdh)(const void *this_arg, enum LDKRecipient recipient, struct LDKPublicKey other_key, struct LDKCOption_BigEndianScalarZ tweak);
11357 * By parameterizing by the raw invoice bytes instead of the hash, we allow implementors of
11358 * this trait to parse the invoice and make sure they're signing what they expect, rather than
11359 * blindly signing the hash.
11361 * The `hrp_bytes` are ASCII bytes, while the `invoice_data` is base32.
11363 * The secret key used to sign the invoice is dependent on the [`Recipient`].
11365 * Errors if the [`Recipient`] variant is not supported by the implementation.
11367 struct LDKCResult_RecoverableSignatureNoneZ (*sign_invoice)(const void *this_arg, struct LDKu8slice hrp_bytes, struct LDKCVec_U5Z invoice_data, enum LDKRecipient recipient);
11369 * Signs the [`TaggedHash`] of a BOLT 12 invoice request.
11371 * May be called by a function passed to [`UnsignedInvoiceRequest::sign`] where
11372 * `invoice_request` is the callee.
11374 * Implementors may check that the `invoice_request` is expected rather than blindly signing
11375 * the tagged hash. An `Ok` result should sign `invoice_request.tagged_hash().as_digest()` with
11376 * the node's signing key or an ephemeral key to preserve privacy, whichever is associated with
11377 * [`UnsignedInvoiceRequest::payer_id`].
11379 * [`TaggedHash`]: crate::offers::merkle::TaggedHash
11381 struct LDKCResult_SchnorrSignatureNoneZ (*sign_bolt12_invoice_request)(const void *this_arg, const struct LDKUnsignedInvoiceRequest *NONNULL_PTR invoice_request);
11383 * Signs the [`TaggedHash`] of a BOLT 12 invoice.
11385 * May be called by a function passed to [`UnsignedBolt12Invoice::sign`] where `invoice` is the
11388 * Implementors may check that the `invoice` is expected rather than blindly signing the tagged
11389 * hash. An `Ok` result should sign `invoice.tagged_hash().as_digest()` with the node's signing
11390 * key or an ephemeral key to preserve privacy, whichever is associated with
11391 * [`UnsignedBolt12Invoice::signing_pubkey`].
11393 * [`TaggedHash`]: crate::offers::merkle::TaggedHash
11395 struct LDKCResult_SchnorrSignatureNoneZ (*sign_bolt12_invoice)(const void *this_arg, const struct LDKUnsignedBolt12Invoice *NONNULL_PTR invoice);
11397 * Sign a gossip message.
11399 * Note that if this fails, LDK may panic and the message will not be broadcast to the network
11400 * or a possible channel counterparty. If LDK panics, the error should be resolved to allow the
11401 * message to be broadcast, as otherwise it may prevent one from receiving funds over the
11402 * corresponding channel.
11404 struct LDKCResult_ECDSASignatureNoneZ (*sign_gossip_message)(const void *this_arg, struct LDKUnsignedGossipMessage msg);
11406 * Frees any resources associated with this object given its this_arg pointer.
11407 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
11409 void (*free)(void *this_arg);
11413 * A trait that can return signer instances for individual channels.
11415 typedef struct LDKSignerProvider {
11417 * An opaque pointer which is passed to your function implementations as an argument.
11418 * This has no meaning in the LDK, and can be NULL or any other value.
11422 * Generates a unique `channel_keys_id` that can be used to obtain a [`Self::EcdsaSigner`] through
11423 * [`SignerProvider::derive_channel_signer`]. The `user_channel_id` is provided to allow
11424 * implementations of [`SignerProvider`] to maintain a mapping between itself and the generated
11425 * `channel_keys_id`.
11427 * This method must return a different value each time it is called.
11429 struct LDKThirtyTwoBytes (*generate_channel_keys_id)(const void *this_arg, bool inbound, uint64_t channel_value_satoshis, struct LDKU128 user_channel_id);
11431 * Derives the private key material backing a `Signer`.
11433 * To derive a new `Signer`, a fresh `channel_keys_id` should be obtained through
11434 * [`SignerProvider::generate_channel_keys_id`]. Otherwise, an existing `Signer` can be
11435 * re-derived from its `channel_keys_id`, which can be obtained through its trait method
11436 * [`ChannelSigner::channel_keys_id`].
11438 struct LDKWriteableEcdsaChannelSigner (*derive_channel_signer)(const void *this_arg, uint64_t channel_value_satoshis, struct LDKThirtyTwoBytes channel_keys_id);
11440 * Reads a [`Signer`] for this [`SignerProvider`] from the given input stream.
11441 * This is only called during deserialization of other objects which contain
11442 * [`WriteableEcdsaChannelSigner`]-implementing objects (i.e., [`ChannelMonitor`]s and [`ChannelManager`]s).
11443 * The bytes are exactly those which `<Self::Signer as Writeable>::write()` writes, and
11444 * contain no versioning scheme. You may wish to include your own version prefix and ensure
11445 * you've read all of the provided bytes to ensure no corruption occurred.
11447 * This method is slowly being phased out -- it will only be called when reading objects
11448 * written by LDK versions prior to 0.0.113.
11450 * [`Signer`]: Self::EcdsaSigner
11451 * [`ChannelMonitor`]: crate::chain::channelmonitor::ChannelMonitor
11452 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
11454 struct LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ (*read_chan_signer)(const void *this_arg, struct LDKu8slice reader);
11456 * Get a script pubkey which we send funds to when claiming on-chain contestable outputs.
11458 * If this function returns an error, this will result in a channel failing to open.
11460 * This method should return a different value each time it is called, to avoid linking
11461 * on-chain funds across channels as controlled to the same user. `channel_keys_id` may be
11462 * used to derive a unique value for each channel.
11464 struct LDKCResult_CVec_u8ZNoneZ (*get_destination_script)(const void *this_arg, struct LDKThirtyTwoBytes channel_keys_id);
11466 * Get a script pubkey which we will send funds to when closing a channel.
11468 * If this function returns an error, this will result in a channel failing to open or close.
11469 * In the event of a failure when the counterparty is initiating a close, this can result in a
11470 * channel force close.
11472 * This method should return a different value each time it is called, to avoid linking
11473 * on-chain funds across channels as controlled to the same user.
11475 struct LDKCResult_ShutdownScriptNoneZ (*get_shutdown_scriptpubkey)(const void *this_arg);
11477 * Frees any resources associated with this object given its this_arg pointer.
11478 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
11480 void (*free)(void *this_arg);
11481 } LDKSignerProvider;
11484 * A trait which should be implemented to provide feerate information on a number of time
11487 * If access to a local mempool is not feasible, feerate estimates should be fetched from a set of
11488 * third-parties hosting them. Note that this enables them to affect the propagation of your
11489 * pre-signed transactions at any time and therefore endangers the safety of channels funds. It
11490 * should be considered carefully as a deployment.
11492 * Note that all of the functions implemented here *must* be reentrant-safe (obviously - they're
11493 * called from inside the library in response to chain events, P2P events, or timer events).
11495 * LDK may generate a substantial number of fee-estimation calls in some cases. You should
11496 * pre-calculate and cache the fee estimate results to ensure you don't substantially slow HTLC
11499 typedef struct LDKFeeEstimator {
11501 * An opaque pointer which is passed to your function implementations as an argument.
11502 * This has no meaning in the LDK, and can be NULL or any other value.
11506 * Gets estimated satoshis of fee required per 1000 Weight-Units.
11508 * LDK will wrap this method and ensure that the value returned is no smaller than 253
11509 * (ie 1 satoshi-per-byte rounded up to ensure later round-downs don't put us below 1 satoshi-per-byte).
11511 * The following unit conversions can be used to convert to sats/KW:
11512 * * satoshis-per-byte * 250
11513 * * satoshis-per-kbyte / 4
11515 uint32_t (*get_est_sat_per_1000_weight)(const void *this_arg, enum LDKConfirmationTarget confirmation_target);
11517 * Frees any resources associated with this object given its this_arg pointer.
11518 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
11520 void (*free)(void *this_arg);
11526 * Data to construct a [`BlindedHop`] for receiving a payment. This payload is custom to LDK and
11527 * may not be valid if received by another lightning implementation.
11529 typedef struct MUST_USE_STRUCT LDKReceiveTlvs {
11531 * A pointer to the opaque Rust object.
11532 * Nearly everywhere, inner must be non-null, however in places where
11533 * the Rust equivalent takes an Option, it may be set to null to indicate None.
11535 LDKnativeReceiveTlvs *inner;
11537 * Indicates that this is the only struct which contains the same pointer.
11538 * Rust functions which take ownership of an object provided via an argument require
11539 * this to be true and invalidate the object pointed to by inner.
11545 * A trait defining behavior for routing an [`OnionMessage`].
11547 typedef struct LDKMessageRouter {
11549 * An opaque pointer which is passed to your function implementations as an argument.
11550 * This has no meaning in the LDK, and can be NULL or any other value.
11554 * Returns a route for sending an [`OnionMessage`] to the given [`Destination`].
11556 struct LDKCResult_OnionMessagePathNoneZ (*find_path)(const void *this_arg, struct LDKPublicKey sender, struct LDKCVec_PublicKeyZ peers, struct LDKDestination destination);
11558 * Creates [`BlindedPath`]s to the `recipient` node. The nodes in `peers` are assumed to be
11559 * direct peers with the `recipient`.
11561 struct LDKCResult_CVec_BlindedPathZNoneZ (*create_blinded_paths)(const void *this_arg, struct LDKPublicKey recipient, struct LDKCVec_PublicKeyZ peers);
11563 * Frees any resources associated with this object given its this_arg pointer.
11564 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
11566 void (*free)(void *this_arg);
11567 } LDKMessageRouter;
11570 * A trait defining behavior for routing a payment.
11572 typedef struct LDKRouter {
11574 * An opaque pointer which is passed to your function implementations as an argument.
11575 * This has no meaning in the LDK, and can be NULL or any other value.
11579 * Finds a [`Route`] for a payment between the given `payer` and a payee.
11581 * The `payee` and the payment's value are given in [`RouteParameters::payment_params`]
11582 * and [`RouteParameters::final_value_msat`], respectively.
11584 * Note that first_hops (or a relevant inner pointer) may be NULL or all-0s to represent None
11586 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);
11588 * Finds a [`Route`] for a payment between the given `payer` and a payee.
11590 * The `payee` and the payment's value are given in [`RouteParameters::payment_params`]
11591 * and [`RouteParameters::final_value_msat`], respectively.
11593 * Includes a [`PaymentHash`] and a [`PaymentId`] to be able to correlate the request with a specific
11596 * Note that first_hops (or a relevant inner pointer) may be NULL or all-0s to represent None
11598 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);
11600 * Creates [`BlindedPath`]s for payment to the `recipient` node. The channels in `first_hops`
11601 * are assumed to be with the `recipient`'s peers. The payment secret and any constraints are
11604 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);
11606 * Implementation of MessageRouter for this object.
11608 struct LDKMessageRouter MessageRouter;
11610 * Frees any resources associated with this object given its this_arg pointer.
11611 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
11613 void (*free)(void *this_arg);
11619 * A lightning node's channel state machine and payment management logic, which facilitates
11620 * sending, forwarding, and receiving payments through lightning channels.
11622 * [`ChannelManager`] is parameterized by a number of components to achieve this.
11623 * - [`chain::Watch`] (typically [`ChainMonitor`]) for on-chain monitoring and enforcement of each
11625 * - [`BroadcasterInterface`] for broadcasting transactions related to opening, funding, and
11627 * - [`EntropySource`] for providing random data needed for cryptographic operations
11628 * - [`NodeSigner`] for cryptographic operations scoped to the node
11629 * - [`SignerProvider`] for providing signers whose operations are scoped to individual channels
11630 * - [`FeeEstimator`] to determine transaction fee rates needed to have a transaction mined in a
11632 * - [`Router`] for finding payment paths when initiating and retrying payments
11633 * - [`Logger`] for logging operational information of varying degrees
11635 * Additionally, it implements the following traits:
11636 * - [`ChannelMessageHandler`] to handle off-chain channel activity from peers
11637 * - [`MessageSendEventsProvider`] to similarly send such messages to peers
11638 * - [`OffersMessageHandler`] for BOLT 12 message handling and sending
11639 * - [`EventsProvider`] to generate user-actionable [`Event`]s
11640 * - [`chain::Listen`] and [`chain::Confirm`] for notification of on-chain activity
11642 * Thus, [`ChannelManager`] is typically used to parameterize a [`MessageHandler`] and an
11643 * [`OnionMessenger`]. The latter is required to support BOLT 12 functionality.
11645 * # `ChannelManager` vs `ChannelMonitor`
11647 * It's important to distinguish between the *off-chain* management and *on-chain* enforcement of
11648 * lightning channels. [`ChannelManager`] exchanges messages with peers to manage the off-chain
11649 * state of each channel. During this process, it generates a [`ChannelMonitor`] for each channel
11650 * and a [`ChannelMonitorUpdate`] for each relevant change, notifying its parameterized
11651 * [`chain::Watch`] of them.
11653 * An implementation of [`chain::Watch`], such as [`ChainMonitor`], is responsible for aggregating
11654 * these [`ChannelMonitor`]s and applying any [`ChannelMonitorUpdate`]s to them. It then monitors
11655 * for any pertinent on-chain activity, enforcing claims as needed.
11657 * This division of off-chain management and on-chain enforcement allows for interesting node
11658 * setups. For instance, on-chain enforcement could be moved to a separate host or have added
11659 * redundancy, possibly as a watchtower. See [`chain::Watch`] for the relevant interface.
11663 * Use [`ChannelManager::new`] with the most recent [`BlockHash`] when creating a fresh instance.
11664 * Otherwise, if restarting, construct [`ChannelManagerReadArgs`] with the necessary parameters and
11665 * references to any deserialized [`ChannelMonitor`]s that were previously persisted. Use this to
11666 * deserialize the [`ChannelManager`] and feed it any new chain data since it was last online, as
11667 * detailed in the [`ChannelManagerReadArgs`] documentation.
11670 * use bitcoin::BlockHash;
11671 * use bitcoin::network::constants::Network;
11672 * use lightning::chain::BestBlock;
11673 * # use lightning::chain::channelmonitor::ChannelMonitor;
11674 * use lightning::ln::channelmanager::{ChainParameters, ChannelManager, ChannelManagerReadArgs};
11675 * # use lightning::routing::gossip::NetworkGraph;
11676 * use lightning::util::config::UserConfig;
11677 * use lightning::util::ser::ReadableArgs;
11679 * # fn read_channel_monitors() -> Vec<ChannelMonitor<lightning::sign::InMemorySigner>> { vec![] }
11682 * # L: lightning::util::logger::Logger,
11683 * # ES: lightning::sign::EntropySource,
11684 * # S: for <'b> lightning::routing::scoring::LockableScore<'b, ScoreLookUp = SL>,
11685 * # SL: lightning::routing::scoring::ScoreLookUp<ScoreParams = SP>,
11687 * # R: lightning::io::Read,
11689 * # fee_estimator: &dyn lightning::chain::chaininterface::FeeEstimator,
11690 * # chain_monitor: &dyn lightning::chain::Watch<lightning::sign::InMemorySigner>,
11691 * # tx_broadcaster: &dyn lightning::chain::chaininterface::BroadcasterInterface,
11692 * # router: &lightning::routing::router::DefaultRouter<&NetworkGraph<&'a L>, &'a L, &ES, &S, SP, SL>,
11694 * # entropy_source: &ES,
11695 * # node_signer: &dyn lightning::sign::NodeSigner,
11696 * # signer_provider: &lightning::sign::DynSignerProvider,
11697 * # best_block: lightning::chain::BestBlock,
11698 * # current_timestamp: u32,
11700 * # ) -> Result<(), lightning::ln::msgs::DecodeError> {
11701 * // Fresh start with no channels
11702 * let params = ChainParameters {
11703 * network: Network::Bitcoin,
11706 * let default_config = UserConfig::default();
11707 * let channel_manager = ChannelManager::new(
11708 * fee_estimator, chain_monitor, tx_broadcaster, router, logger, entropy_source, node_signer,
11709 * signer_provider, default_config, params, current_timestamp
11712 * // Restart from deserialized data
11713 * let mut channel_monitors = read_channel_monitors();
11714 * let args = ChannelManagerReadArgs::new(
11715 * entropy_source, node_signer, signer_provider, fee_estimator, chain_monitor, tx_broadcaster,
11716 * router, logger, default_config, channel_monitors.iter_mut().collect()
11718 * let (block_hash, channel_manager) =
11719 * <(BlockHash, ChannelManager<_, _, _, _, _, _, _, _>)>::read(&mut reader, args)?;
11721 * // Update the ChannelManager and ChannelMonitors with the latest chain data
11724 * // Move the monitors to the ChannelManager's chain::Watch parameter
11725 * for monitor in channel_monitors {
11726 * chain_monitor.watch_channel(monitor.get_funding_txo().0, monitor);
11734 * The following is required for [`ChannelManager`] to function properly:
11735 * - Handle messages from peers using its [`ChannelMessageHandler`] implementation (typically
11736 * called by [`PeerManager::read_event`] when processing network I/O)
11737 * - Send messages to peers obtained via its [`MessageSendEventsProvider`] implementation
11738 * (typically initiated when [`PeerManager::process_events`] is called)
11739 * - Feed on-chain activity using either its [`chain::Listen`] or [`chain::Confirm`] implementation
11740 * as documented by those traits
11741 * - Perform any periodic channel and payment checks by calling [`timer_tick_occurred`] roughly
11743 * - Persist to disk whenever [`get_and_clear_needs_persistence`] returns `true` using a
11744 * [`Persister`] such as a [`KVStore`] implementation
11745 * - Handle [`Event`]s obtained via its [`EventsProvider`] implementation
11747 * The [`Future`] returned by [`get_event_or_persistence_needed_future`] is useful in determining
11748 * when the last two requirements need to be checked.
11750 * The [`lightning-block-sync`] and [`lightning-transaction-sync`] crates provide utilities that
11751 * simplify feeding in on-chain activity using the [`chain::Listen`] and [`chain::Confirm`] traits,
11752 * respectively. The remaining requirements can be met using the [`lightning-background-processor`]
11753 * crate. For languages other than Rust, the availability of similar utilities may vary.
11757 * [`ChannelManager`]'s primary function involves managing a channel state. Without channels,
11758 * payments can't be sent. Use [`list_channels`] or [`list_usable_channels`] for a snapshot of the
11759 * currently open channels.
11762 * # use lightning::ln::channelmanager::AChannelManager;
11764 * # fn example<T: AChannelManager>(channel_manager: T) {
11765 * # let channel_manager = channel_manager.get_cm();
11766 * let channels = channel_manager.list_usable_channels();
11767 * for details in channels {
11768 * println!(\"{:?}\", details);
11773 * Each channel is identified using a [`ChannelId`], which will change throughout the channel's
11774 * life cycle. Additionally, channels are assigned a `user_channel_id`, which is given in
11775 * [`Event`]s associated with the channel and serves as a fixed identifier but is otherwise unused
11776 * by [`ChannelManager`].
11778 * ## Opening Channels
11780 * To an open a channel with a peer, call [`create_channel`]. This will initiate the process of
11781 * opening an outbound channel, which requires self-funding when handling
11782 * [`Event::FundingGenerationReady`].
11785 * # use bitcoin::{ScriptBuf, Transaction};
11786 * # use bitcoin::secp256k1::PublicKey;
11787 * # use lightning::ln::channelmanager::AChannelManager;
11788 * # use lightning::events::{Event, EventsProvider};
11791 * # fn create_funding_transaction(
11792 * # &self, _amount_sats: u64, _output_script: ScriptBuf
11793 * # ) -> Transaction;
11796 * # fn example<T: AChannelManager, W: Wallet>(channel_manager: T, wallet: W, peer_id: PublicKey) {
11797 * # let channel_manager = channel_manager.get_cm();
11798 * let value_sats = 1_000_000;
11799 * let push_msats = 10_000_000;
11800 * match channel_manager.create_channel(peer_id, value_sats, push_msats, 42, None, None) {
11801 * Ok(channel_id) => println!(\"Opening channel {}\", channel_id),
11802 * Err(e) => println!(\"Error opening channel: {:?}\", e),
11805 * // On the event processing thread once the peer has responded
11806 * channel_manager.process_pending_events(&|event| match event {
11807 * Event::FundingGenerationReady {
11808 * temporary_channel_id, counterparty_node_id, channel_value_satoshis, output_script,
11809 * user_channel_id, ..
11811 * assert_eq!(user_channel_id, 42);
11812 * let funding_transaction = wallet.create_funding_transaction(
11813 * channel_value_satoshis, output_script
11815 * match channel_manager.funding_transaction_generated(
11816 * &temporary_channel_id, &counterparty_node_id, funding_transaction
11818 * Ok(()) => println!(\"Funding channel {}\", temporary_channel_id),
11819 * Err(e) => println!(\"Error funding channel {}: {:?}\", temporary_channel_id, e),
11822 * Event::ChannelPending { channel_id, user_channel_id, former_temporary_channel_id, .. } => {
11823 * assert_eq!(user_channel_id, 42);
11825 * \"Channel {} now {} pending (funding transaction has been broadcasted)\", channel_id,
11826 * former_temporary_channel_id.unwrap()
11829 * Event::ChannelReady { channel_id, user_channel_id, .. } => {
11830 * assert_eq!(user_channel_id, 42);
11831 * println!(\"Channel {} ready\", channel_id);
11839 * ## Accepting Channels
11841 * Inbound channels are initiated by peers and are automatically accepted unless [`ChannelManager`]
11842 * has [`UserConfig::manually_accept_inbound_channels`] set. In that case, the channel may be
11843 * either accepted or rejected when handling [`Event::OpenChannelRequest`].
11846 * # use bitcoin::secp256k1::PublicKey;
11847 * # use lightning::ln::channelmanager::AChannelManager;
11848 * # use lightning::events::{Event, EventsProvider};
11850 * # fn is_trusted(counterparty_node_id: PublicKey) -> bool {
11852 * # unimplemented!()
11855 * # fn example<T: AChannelManager>(channel_manager: T) {
11856 * # let channel_manager = channel_manager.get_cm();
11857 * channel_manager.process_pending_events(&|event| match event {
11858 * Event::OpenChannelRequest { temporary_channel_id, counterparty_node_id, .. } => {
11859 * if !is_trusted(counterparty_node_id) {
11860 * match channel_manager.force_close_without_broadcasting_txn(
11861 * &temporary_channel_id, &counterparty_node_id
11863 * Ok(()) => println!(\"Rejecting channel {}\", temporary_channel_id),
11864 * Err(e) => println!(\"Error rejecting channel {}: {:?}\", temporary_channel_id, e),
11869 * let user_channel_id = 43;
11870 * match channel_manager.accept_inbound_channel(
11871 * &temporary_channel_id, &counterparty_node_id, user_channel_id
11873 * Ok(()) => println!(\"Accepting channel {}\", temporary_channel_id),
11874 * Err(e) => println!(\"Error accepting channel {}: {:?}\", temporary_channel_id, e),
11883 * ## Closing Channels
11885 * There are two ways to close a channel: either cooperatively using [`close_channel`] or
11886 * unilaterally using [`force_close_broadcasting_latest_txn`]. The former is ideal as it makes for
11887 * lower fees and immediate access to funds. However, the latter may be necessary if the
11888 * counterparty isn't behaving properly or has gone offline. [`Event::ChannelClosed`] is generated
11889 * once the channel has been closed successfully.
11892 * # use bitcoin::secp256k1::PublicKey;
11893 * # use lightning::ln::types::ChannelId;
11894 * # use lightning::ln::channelmanager::AChannelManager;
11895 * # use lightning::events::{Event, EventsProvider};
11897 * # fn example<T: AChannelManager>(
11898 * # channel_manager: T, channel_id: ChannelId, counterparty_node_id: PublicKey
11900 * # let channel_manager = channel_manager.get_cm();
11901 * match channel_manager.close_channel(&channel_id, &counterparty_node_id) {
11902 * Ok(()) => println!(\"Closing channel {}\", channel_id),
11903 * Err(e) => println!(\"Error closing channel {}: {:?}\", channel_id, e),
11906 * // On the event processing thread
11907 * channel_manager.process_pending_events(&|event| match event {
11908 * Event::ChannelClosed { channel_id, user_channel_id, .. } => {
11909 * assert_eq!(user_channel_id, 42);
11910 * println!(\"Channel {} closed\", channel_id);
11920 * [`ChannelManager`] is responsible for sending, forwarding, and receiving payments through its
11921 * channels. A payment is typically initiated from a [BOLT 11] invoice or a [BOLT 12] offer, though
11922 * spontaneous (i.e., keysend) payments are also possible. Incoming payments don't require
11923 * maintaining any additional state as [`ChannelManager`] can reconstruct the [`PaymentPreimage`]
11924 * from the [`PaymentSecret`]. Sending payments, however, require tracking in order to retry failed
11927 * After a payment is initiated, it will appear in [`list_recent_payments`] until a short time
11928 * after either an [`Event::PaymentSent`] or [`Event::PaymentFailed`] is handled. Failed HTLCs
11929 * for a payment will be retried according to the payment's [`Retry`] strategy or until
11930 * [`abandon_payment`] is called.
11932 * ## BOLT 11 Invoices
11934 * The [`lightning-invoice`] crate is useful for creating BOLT 11 invoices. Specifically, use the
11935 * functions in its `utils` module for constructing invoices that are compatible with
11936 * [`ChannelManager`]. These functions serve as a convenience for building invoices with the
11937 * [`PaymentHash`] and [`PaymentSecret`] returned from [`create_inbound_payment`]. To provide your
11938 * own [`PaymentHash`], use [`create_inbound_payment_for_hash`] or the corresponding functions in
11939 * the [`lightning-invoice`] `utils` module.
11941 * [`ChannelManager`] generates an [`Event::PaymentClaimable`] once the full payment has been
11942 * received. Call [`claim_funds`] to release the [`PaymentPreimage`], which in turn will result in
11943 * an [`Event::PaymentClaimed`].
11946 * # use lightning::events::{Event, EventsProvider, PaymentPurpose};
11947 * # use lightning::ln::channelmanager::AChannelManager;
11949 * # fn example<T: AChannelManager>(channel_manager: T) {
11950 * # let channel_manager = channel_manager.get_cm();
11951 * // Or use utils::create_invoice_from_channelmanager
11952 * let known_payment_hash = match channel_manager.create_inbound_payment(
11953 * Some(10_000_000), 3600, None
11955 * Ok((payment_hash, _payment_secret)) => {
11956 * println!(\"Creating inbound payment {}\", payment_hash);
11959 * Err(()) => panic!(\"Error creating inbound payment\"),
11962 * // On the event processing thread
11963 * channel_manager.process_pending_events(&|event| match event {
11964 * Event::PaymentClaimable { payment_hash, purpose, .. } => match purpose {
11965 * PaymentPurpose::Bolt11InvoicePayment { payment_preimage: Some(payment_preimage), .. } => {
11966 * assert_eq!(payment_hash, known_payment_hash);
11967 * println!(\"Claiming payment {}\", payment_hash);
11968 * channel_manager.claim_funds(payment_preimage);
11970 * PaymentPurpose::Bolt11InvoicePayment { payment_preimage: None, .. } => {
11971 * println!(\"Unknown payment hash: {}\", payment_hash);
11973 * PaymentPurpose::SpontaneousPayment(payment_preimage) => {
11974 * assert_ne!(payment_hash, known_payment_hash);
11975 * println!(\"Claiming spontaneous payment {}\", payment_hash);
11976 * channel_manager.claim_funds(payment_preimage);
11981 * Event::PaymentClaimed { payment_hash, amount_msat, .. } => {
11982 * assert_eq!(payment_hash, known_payment_hash);
11983 * println!(\"Claimed {} msats\", amount_msat);
11991 * For paying an invoice, [`lightning-invoice`] provides a `payment` module with convenience
11992 * functions for use with [`send_payment`].
11995 * # use lightning::events::{Event, EventsProvider};
11996 * # use lightning::ln::types::PaymentHash;
11997 * # use lightning::ln::channelmanager::{AChannelManager, PaymentId, RecentPaymentDetails, RecipientOnionFields, Retry};
11998 * # use lightning::routing::router::RouteParameters;
12000 * # fn example<T: AChannelManager>(
12001 * # channel_manager: T, payment_hash: PaymentHash, recipient_onion: RecipientOnionFields,
12002 * # route_params: RouteParameters, retry: Retry
12004 * # let channel_manager = channel_manager.get_cm();
12005 * // let (payment_hash, recipient_onion, route_params) =
12006 * // payment::payment_parameters_from_invoice(&invoice);
12007 * let payment_id = PaymentId([42; 32]);
12008 * match channel_manager.send_payment(
12009 * payment_hash, recipient_onion, payment_id, route_params, retry
12011 * Ok(()) => println!(\"Sending payment with hash {}\", payment_hash),
12012 * Err(e) => println!(\"Failed sending payment with hash {}: {:?}\", payment_hash, e),
12015 * let expected_payment_id = payment_id;
12016 * let expected_payment_hash = payment_hash;
12018 * channel_manager.list_recent_payments().iter().find(|details| matches!(
12020 * RecentPaymentDetails::Pending {
12021 * payment_id: expected_payment_id,
12022 * payment_hash: expected_payment_hash,
12028 * // On the event processing thread
12029 * channel_manager.process_pending_events(&|event| match event {
12030 * Event::PaymentSent { payment_hash, .. } => println!(\"Paid {}\", payment_hash),
12031 * Event::PaymentFailed { payment_hash, .. } => println!(\"Failed paying {}\", payment_hash),
12038 * ## BOLT 12 Offers
12040 * The [`offers`] module is useful for creating BOLT 12 offers. An [`Offer`] is a precursor to a
12041 * [`Bolt12Invoice`], which must first be requested by the payer. The interchange of these messages
12042 * as defined in the specification is handled by [`ChannelManager`] and its implementation of
12043 * [`OffersMessageHandler`]. However, this only works with an [`Offer`] created using a builder
12044 * returned by [`create_offer_builder`]. With this approach, BOLT 12 offers and invoices are
12045 * stateless just as BOLT 11 invoices are.
12048 * # use lightning::events::{Event, EventsProvider, PaymentPurpose};
12049 * # use lightning::ln::channelmanager::AChannelManager;
12050 * # use lightning::offers::parse::Bolt12SemanticError;
12052 * # fn example<T: AChannelManager>(channel_manager: T) -> Result<(), Bolt12SemanticError> {
12053 * # let channel_manager = channel_manager.get_cm();
12054 * let offer = channel_manager
12055 * .create_offer_builder()?
12057 * # // Needed for compiling for c_bindings
12058 * # let builder: lightning::offers::offer::OfferBuilder<_, _> = offer.into();
12059 * # let offer = builder
12060 * .description(\"coffee\".to_string())
12061 * .amount_msats(10_000_000)
12063 * let bech32_offer = offer.to_string();
12065 * // On the event processing thread
12066 * channel_manager.process_pending_events(&|event| match event {
12067 * Event::PaymentClaimable { payment_hash, purpose, .. } => match purpose {
12068 * PaymentPurpose::Bolt12OfferPayment { payment_preimage: Some(payment_preimage), .. } => {
12069 * println!(\"Claiming payment {}\", payment_hash);
12070 * channel_manager.claim_funds(payment_preimage);
12072 * PaymentPurpose::Bolt12OfferPayment { payment_preimage: None, .. } => {
12073 * println!(\"Unknown payment hash: {}\", payment_hash);
12078 * Event::PaymentClaimed { payment_hash, amount_msat, .. } => {
12079 * println!(\"Claimed {} msats\", amount_msat);
12088 * Use [`pay_for_offer`] to initiated payment, which sends an [`InvoiceRequest`] for an [`Offer`]
12089 * and pays the [`Bolt12Invoice`] response. In addition to success and failure events,
12090 * [`ChannelManager`] may also generate an [`Event::InvoiceRequestFailed`].
12093 * # use lightning::events::{Event, EventsProvider};
12094 * # use lightning::ln::channelmanager::{AChannelManager, PaymentId, RecentPaymentDetails, Retry};
12095 * # use lightning::offers::offer::Offer;
12097 * # fn example<T: AChannelManager>(
12098 * # channel_manager: T, offer: &Offer, quantity: Option<u64>, amount_msats: Option<u64>,
12099 * # payer_note: Option<String>, retry: Retry, max_total_routing_fee_msat: Option<u64>
12101 * # let channel_manager = channel_manager.get_cm();
12102 * let payment_id = PaymentId([42; 32]);
12103 * match channel_manager.pay_for_offer(
12104 * offer, quantity, amount_msats, payer_note, payment_id, retry, max_total_routing_fee_msat
12106 * Ok(()) => println!(\"Requesting invoice for offer\"),
12107 * Err(e) => println!(\"Unable to request invoice for offer: {:?}\", e),
12110 * // First the payment will be waiting on an invoice
12111 * let expected_payment_id = payment_id;
12113 * channel_manager.list_recent_payments().iter().find(|details| matches!(
12115 * RecentPaymentDetails::AwaitingInvoice { payment_id: expected_payment_id }
12119 * // Once the invoice is received, a payment will be sent
12121 * channel_manager.list_recent_payments().iter().find(|details| matches!(
12123 * RecentPaymentDetails::Pending { payment_id: expected_payment_id, .. }
12127 * // On the event processing thread
12128 * channel_manager.process_pending_events(&|event| match event {
12129 * Event::PaymentSent { payment_id: Some(payment_id), .. } => println!(\"Paid {}\", payment_id),
12130 * Event::PaymentFailed { payment_id, .. } => println!(\"Failed paying {}\", payment_id),
12131 * Event::InvoiceRequestFailed { payment_id, .. } => println!(\"Failed paying {}\", payment_id),
12138 * ## BOLT 12 Refunds
12140 * A [`Refund`] is a request for an invoice to be paid. Like *paying* for an [`Offer`], *creating*
12141 * a [`Refund`] involves maintaining state since it represents a future outbound payment.
12142 * Therefore, use [`create_refund_builder`] when creating one, otherwise [`ChannelManager`] will
12143 * refuse to pay any corresponding [`Bolt12Invoice`] that it receives.
12146 * # use core::time::Duration;
12147 * # use lightning::events::{Event, EventsProvider};
12148 * # use lightning::ln::channelmanager::{AChannelManager, PaymentId, RecentPaymentDetails, Retry};
12149 * # use lightning::offers::parse::Bolt12SemanticError;
12151 * # fn example<T: AChannelManager>(
12152 * # channel_manager: T, amount_msats: u64, absolute_expiry: Duration, retry: Retry,
12153 * # max_total_routing_fee_msat: Option<u64>
12154 * # ) -> Result<(), Bolt12SemanticError> {
12155 * # let channel_manager = channel_manager.get_cm();
12156 * let payment_id = PaymentId([42; 32]);
12157 * let refund = channel_manager
12158 * .create_refund_builder(
12159 * amount_msats, absolute_expiry, payment_id, retry, max_total_routing_fee_msat
12162 * # // Needed for compiling for c_bindings
12163 * # let builder: lightning::offers::refund::RefundBuilder<_> = refund.into();
12164 * # let refund = builder
12165 * .description(\"coffee\".to_string())
12166 * .payer_note(\"refund for order 1234\".to_string())
12168 * let bech32_refund = refund.to_string();
12170 * // First the payment will be waiting on an invoice
12171 * let expected_payment_id = payment_id;
12173 * channel_manager.list_recent_payments().iter().find(|details| matches!(
12175 * RecentPaymentDetails::AwaitingInvoice { payment_id: expected_payment_id }
12179 * // Once the invoice is received, a payment will be sent
12181 * channel_manager.list_recent_payments().iter().find(|details| matches!(
12183 * RecentPaymentDetails::Pending { payment_id: expected_payment_id, .. }
12187 * // On the event processing thread
12188 * channel_manager.process_pending_events(&|event| match event {
12189 * Event::PaymentSent { payment_id: Some(payment_id), .. } => println!(\"Paid {}\", payment_id),
12190 * Event::PaymentFailed { payment_id, .. } => println!(\"Failed paying {}\", payment_id),
12198 * Use [`request_refund_payment`] to send a [`Bolt12Invoice`] for receiving the refund. Similar to
12199 * *creating* an [`Offer`], this is stateless as it represents an inbound payment.
12202 * # use lightning::events::{Event, EventsProvider, PaymentPurpose};
12203 * # use lightning::ln::channelmanager::AChannelManager;
12204 * # use lightning::offers::refund::Refund;
12206 * # fn example<T: AChannelManager>(channel_manager: T, refund: &Refund) {
12207 * # let channel_manager = channel_manager.get_cm();
12208 * let known_payment_hash = match channel_manager.request_refund_payment(refund) {
12210 * let payment_hash = invoice.payment_hash();
12211 * println!(\"Requesting refund payment {}\", payment_hash);
12214 * Err(e) => panic!(\"Unable to request payment for refund: {:?}\", e),
12217 * // On the event processing thread
12218 * channel_manager.process_pending_events(&|event| match event {
12219 * Event::PaymentClaimable { payment_hash, purpose, .. } => match purpose {
12220 * \tPaymentPurpose::Bolt12RefundPayment { payment_preimage: Some(payment_preimage), .. } => {
12221 * assert_eq!(payment_hash, known_payment_hash);
12222 * println!(\"Claiming payment {}\", payment_hash);
12223 * channel_manager.claim_funds(payment_preimage);
12225 * \tPaymentPurpose::Bolt12RefundPayment { payment_preimage: None, .. } => {
12226 * println!(\"Unknown payment hash: {}\", payment_hash);
12231 * Event::PaymentClaimed { payment_hash, amount_msat, .. } => {
12232 * assert_eq!(payment_hash, known_payment_hash);
12233 * println!(\"Claimed {} msats\", amount_msat);
12243 * Implements [`Writeable`] to write out all channel state to disk. Implies [`peer_disconnected`] for
12244 * all peers during write/read (though does not modify this instance, only the instance being
12245 * serialized). This will result in any channels which have not yet exchanged [`funding_created`] (i.e.,
12246 * called [`funding_transaction_generated`] for outbound channels) being closed.
12248 * Note that you can be a bit lazier about writing out `ChannelManager` than you can be with
12249 * [`ChannelMonitor`]. With [`ChannelMonitor`] you MUST durably write each
12250 * [`ChannelMonitorUpdate`] before returning from
12251 * [`chain::Watch::watch_channel`]/[`update_channel`] or before completing async writes. With
12252 * `ChannelManager`s, writing updates happens out-of-band (and will prevent any other
12253 * `ChannelManager` operations from occurring during the serialization process). If the
12254 * deserialized version is out-of-date compared to the [`ChannelMonitor`] passed by reference to
12255 * [`read`], those channels will be force-closed based on the `ChannelMonitor` state and no funds
12256 * will be lost (modulo on-chain transaction fees).
12258 * Note that the deserializer is only implemented for `(`[`BlockHash`]`, `[`ChannelManager`]`)`, which
12259 * tells you the last block hash which was connected. You should get the best block tip before using the manager.
12260 * See [`chain::Listen`] and [`chain::Confirm`] for more details.
12262 * # `ChannelUpdate` Messages
12264 * Note that `ChannelManager` is responsible for tracking liveness of its channels and generating
12265 * [`ChannelUpdate`] messages informing peers that the channel is temporarily disabled. To avoid
12266 * spam due to quick disconnection/reconnection, updates are not sent until the channel has been
12267 * offline for a full minute. In order to track this, you must call
12268 * [`timer_tick_occurred`] roughly once per minute, though it doesn't have to be perfect.
12272 * To avoid trivial DoS issues, `ChannelManager` limits the number of inbound connections and
12273 * inbound channels without confirmed funding transactions. This may result in nodes which we do
12274 * not have a channel with being unable to connect to us or open new channels with us if we have
12275 * many peers with unfunded channels.
12277 * Because it is an indication of trust, inbound channels which we've accepted as 0conf are
12278 * exempted from the count of unfunded channels. Similarly, outbound channels and connections are
12279 * never limited. Please ensure you limit the count of such channels yourself.
12283 * Rather than using a plain `ChannelManager`, it is preferable to use either a [`SimpleArcChannelManager`]
12284 * a [`SimpleRefChannelManager`], for conciseness. See their documentation for more details, but
12285 * essentially you should default to using a [`SimpleRefChannelManager`], and use a
12286 * [`SimpleArcChannelManager`] when you require a `ChannelManager` with a static lifetime, such as when
12287 * you're using lightning-net-tokio.
12289 * [`ChainMonitor`]: crate::chain::chainmonitor::ChainMonitor
12290 * [`MessageHandler`]: crate::ln::peer_handler::MessageHandler
12291 * [`OnionMessenger`]: crate::onion_message::messenger::OnionMessenger
12292 * [`PeerManager::read_event`]: crate::ln::peer_handler::PeerManager::read_event
12293 * [`PeerManager::process_events`]: crate::ln::peer_handler::PeerManager::process_events
12294 * [`timer_tick_occurred`]: Self::timer_tick_occurred
12295 * [`get_and_clear_needs_persistence`]: Self::get_and_clear_needs_persistence
12296 * [`Persister`]: crate::util::persist::Persister
12297 * [`KVStore`]: crate::util::persist::KVStore
12298 * [`get_event_or_persistence_needed_future`]: Self::get_event_or_persistence_needed_future
12299 * [`lightning-block-sync`]: https://docs.rs/lightning_block_sync/latest/lightning_block_sync
12300 * [`lightning-transaction-sync`]: https://docs.rs/lightning_transaction_sync/latest/lightning_transaction_sync
12301 * [`lightning-background-processor`]: https://docs.rs/lightning_background_processor/lightning_background_processor
12302 * [`list_channels`]: Self::list_channels
12303 * [`list_usable_channels`]: Self::list_usable_channels
12304 * [`create_channel`]: Self::create_channel
12305 * [`close_channel`]: Self::force_close_broadcasting_latest_txn
12306 * [`force_close_broadcasting_latest_txn`]: Self::force_close_broadcasting_latest_txn
12307 * [BOLT 11]: https://github.com/lightning/bolts/blob/master/11-payment-encoding.md
12308 * [BOLT 12]: https://github.com/rustyrussell/lightning-rfc/blob/guilt/offers/12-offer-encoding.md
12309 * [`list_recent_payments`]: Self::list_recent_payments
12310 * [`abandon_payment`]: Self::abandon_payment
12311 * [`lightning-invoice`]: https://docs.rs/lightning_invoice/latest/lightning_invoice
12312 * [`create_inbound_payment`]: Self::create_inbound_payment
12313 * [`create_inbound_payment_for_hash`]: Self::create_inbound_payment_for_hash
12314 * [`claim_funds`]: Self::claim_funds
12315 * [`send_payment`]: Self::send_payment
12316 * [`offers`]: crate::offers
12317 * [`create_offer_builder`]: Self::create_offer_builder
12318 * [`pay_for_offer`]: Self::pay_for_offer
12319 * [`InvoiceRequest`]: crate::offers::invoice_request::InvoiceRequest
12320 * [`create_refund_builder`]: Self::create_refund_builder
12321 * [`request_refund_payment`]: Self::request_refund_payment
12322 * [`peer_disconnected`]: msgs::ChannelMessageHandler::peer_disconnected
12323 * [`funding_created`]: msgs::FundingCreated
12324 * [`funding_transaction_generated`]: Self::funding_transaction_generated
12325 * [`BlockHash`]: bitcoin::hash_types::BlockHash
12326 * [`update_channel`]: chain::Watch::update_channel
12327 * [`ChannelUpdate`]: msgs::ChannelUpdate
12328 * [`read`]: ReadableArgs::read
12330 typedef struct MUST_USE_STRUCT LDKChannelManager {
12332 * A pointer to the opaque Rust object.
12333 * Nearly everywhere, inner must be non-null, however in places where
12334 * the Rust equivalent takes an Option, it may be set to null to indicate None.
12336 LDKnativeChannelManager *inner;
12338 * Indicates that this is the only struct which contains the same pointer.
12339 * Rust functions which take ownership of an object provided via an argument require
12340 * this to be true and invalidate the object pointed to by inner.
12343 } LDKChannelManager;
12346 * A tuple of 2 elements. See the individual fields for the types contained.
12348 typedef struct LDKC2Tuple_ThirtyTwoBytesChannelManagerZ {
12350 * The element at position 0
12352 struct LDKThirtyTwoBytes a;
12354 * The element at position 1
12356 struct LDKChannelManager b;
12357 } LDKC2Tuple_ThirtyTwoBytesChannelManagerZ;
12360 * The contents of CResult_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ
12362 typedef union LDKCResult_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZPtr {
12364 * A pointer to the contents in the success state.
12365 * Reading from this pointer when `result_ok` is not set is undefined.
12367 struct LDKC2Tuple_ThirtyTwoBytesChannelManagerZ *result;
12369 * A pointer to the contents in the error state.
12370 * Reading from this pointer when `result_ok` is set is undefined.
12372 struct LDKDecodeError *err;
12373 } LDKCResult_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZPtr;
12376 * A CResult_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ represents the result of a fallible operation,
12377 * containing a crate::c_types::derived::C2Tuple_ThirtyTwoBytesChannelManagerZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
12378 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
12380 typedef struct LDKCResult_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ {
12382 * The contents of this CResult_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ, accessible via either
12383 * `err` or `result` depending on the state of `result_ok`.
12385 union LDKCResult_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZPtr contents;
12387 * Whether this CResult_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ represents a success state.
12390 } LDKCResult_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ;
12393 * Options for how to set the max dust exposure allowed on a channel. See
12394 * [`ChannelConfig::max_dust_htlc_exposure`] for details.
12396 typedef enum LDKMaxDustHTLCExposure_Tag {
12398 * This sets a fixed limit on the total dust exposure in millisatoshis. Setting this too low
12399 * may prevent the sending or receipt of low-value HTLCs on high-traffic nodes, however this
12400 * limit is very important to prevent stealing of large amounts of dust HTLCs by miners
12401 * through [fee griefing
12402 * attacks](https://lists.linuxfoundation.org/pipermail/lightning-dev/2020-May/002714.html).
12404 * Note that if the feerate increases significantly, without a manual increase
12405 * to this maximum the channel may be unable to send/receive HTLCs between the maximum dust
12406 * exposure and the new minimum value for HTLCs to be economically viable to claim.
12408 LDKMaxDustHTLCExposure_FixedLimitMsat,
12410 * This sets a multiplier on the [`ConfirmationTarget::OnChainSweep`] feerate (in sats/KW) to
12411 * determine the maximum allowed dust exposure. If this variant is used then the maximum dust
12412 * exposure in millisatoshis is calculated as:
12413 * `feerate_per_kw * value`. For example, with our default value
12414 * `FeeRateMultiplier(10_000)`:
12416 * - For the minimum fee rate of 1 sat/vByte (250 sat/KW, although the minimum
12417 * defaults to 253 sats/KW for rounding, see [`FeeEstimator`]), the max dust exposure would
12418 * be 253 * 10_000 = 2,530,000 msats.
12419 * - For a fee rate of 30 sat/vByte (7500 sat/KW), the max dust exposure would be
12420 * 7500 * 50_000 = 75,000,000 msats (0.00075 BTC).
12422 * Note, if you're using a third-party fee estimator, this may leave you more exposed to a
12423 * fee griefing attack, where your fee estimator may purposely overestimate the fee rate,
12424 * causing you to accept more dust HTLCs than you would otherwise.
12426 * This variant is primarily meant to serve pre-anchor channels, as HTLC fees being included
12427 * on HTLC outputs means your channel may be subject to more dust exposure in the event of
12428 * increases in fee rate.
12430 * # Backwards Compatibility
12431 * This variant only became available in LDK 0.0.116, so if you downgrade to a prior version
12432 * by default this will be set to a [`Self::FixedLimitMsat`] of 5,000,000 msat.
12434 * [`FeeEstimator`]: crate::chain::chaininterface::FeeEstimator
12435 * [`ConfirmationTarget::OnChainSweep`]: crate::chain::chaininterface::ConfirmationTarget::OnChainSweep
12437 LDKMaxDustHTLCExposure_FeeRateMultiplier,
12439 * Must be last for serialization purposes
12441 LDKMaxDustHTLCExposure_Sentinel,
12442 } LDKMaxDustHTLCExposure_Tag;
12444 typedef struct MUST_USE_STRUCT LDKMaxDustHTLCExposure {
12445 LDKMaxDustHTLCExposure_Tag tag;
12448 uint64_t fixed_limit_msat;
12451 uint64_t fee_rate_multiplier;
12454 } LDKMaxDustHTLCExposure;
12457 * The contents of CResult_MaxDustHTLCExposureDecodeErrorZ
12459 typedef union LDKCResult_MaxDustHTLCExposureDecodeErrorZPtr {
12461 * A pointer to the contents in the success state.
12462 * Reading from this pointer when `result_ok` is not set is undefined.
12464 struct LDKMaxDustHTLCExposure *result;
12466 * A pointer to the contents in the error state.
12467 * Reading from this pointer when `result_ok` is set is undefined.
12469 struct LDKDecodeError *err;
12470 } LDKCResult_MaxDustHTLCExposureDecodeErrorZPtr;
12473 * A CResult_MaxDustHTLCExposureDecodeErrorZ represents the result of a fallible operation,
12474 * containing a crate::lightning::util::config::MaxDustHTLCExposure on success and a crate::lightning::ln::msgs::DecodeError on failure.
12475 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
12477 typedef struct LDKCResult_MaxDustHTLCExposureDecodeErrorZ {
12479 * The contents of this CResult_MaxDustHTLCExposureDecodeErrorZ, accessible via either
12480 * `err` or `result` depending on the state of `result_ok`.
12482 union LDKCResult_MaxDustHTLCExposureDecodeErrorZPtr contents;
12484 * Whether this CResult_MaxDustHTLCExposureDecodeErrorZ represents a success state.
12487 } LDKCResult_MaxDustHTLCExposureDecodeErrorZ;
12492 * Options which apply on a per-channel basis and may change at runtime or based on negotiation
12493 * with our counterparty.
12495 typedef struct MUST_USE_STRUCT LDKChannelConfig {
12497 * A pointer to the opaque Rust object.
12498 * Nearly everywhere, inner must be non-null, however in places where
12499 * the Rust equivalent takes an Option, it may be set to null to indicate None.
12501 LDKnativeChannelConfig *inner;
12503 * Indicates that this is the only struct which contains the same pointer.
12504 * Rust functions which take ownership of an object provided via an argument require
12505 * this to be true and invalidate the object pointed to by inner.
12508 } LDKChannelConfig;
12511 * The contents of CResult_ChannelConfigDecodeErrorZ
12513 typedef union LDKCResult_ChannelConfigDecodeErrorZPtr {
12515 * A pointer to the contents in the success state.
12516 * Reading from this pointer when `result_ok` is not set is undefined.
12518 struct LDKChannelConfig *result;
12520 * A pointer to the contents in the error state.
12521 * Reading from this pointer when `result_ok` is set is undefined.
12523 struct LDKDecodeError *err;
12524 } LDKCResult_ChannelConfigDecodeErrorZPtr;
12527 * A CResult_ChannelConfigDecodeErrorZ represents the result of a fallible operation,
12528 * containing a crate::lightning::util::config::ChannelConfig on success and a crate::lightning::ln::msgs::DecodeError on failure.
12529 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
12531 typedef struct LDKCResult_ChannelConfigDecodeErrorZ {
12533 * The contents of this CResult_ChannelConfigDecodeErrorZ, accessible via either
12534 * `err` or `result` depending on the state of `result_ok`.
12536 union LDKCResult_ChannelConfigDecodeErrorZPtr contents;
12538 * Whether this CResult_ChannelConfigDecodeErrorZ represents a success state.
12541 } LDKCResult_ChannelConfigDecodeErrorZ;
12544 * An enum which can either contain a crate::lightning::util::config::MaxDustHTLCExposure or not
12546 typedef enum LDKCOption_MaxDustHTLCExposureZ_Tag {
12548 * When we're in this state, this COption_MaxDustHTLCExposureZ contains a crate::lightning::util::config::MaxDustHTLCExposure
12550 LDKCOption_MaxDustHTLCExposureZ_Some,
12552 * When we're in this state, this COption_MaxDustHTLCExposureZ contains nothing
12554 LDKCOption_MaxDustHTLCExposureZ_None,
12556 * Must be last for serialization purposes
12558 LDKCOption_MaxDustHTLCExposureZ_Sentinel,
12559 } LDKCOption_MaxDustHTLCExposureZ_Tag;
12561 typedef struct LDKCOption_MaxDustHTLCExposureZ {
12562 LDKCOption_MaxDustHTLCExposureZ_Tag tag;
12565 struct LDKMaxDustHTLCExposure some;
12568 } LDKCOption_MaxDustHTLCExposureZ;
12571 * An enum which can either contain a crate::lightning::util::errors::APIError or not
12573 typedef enum LDKCOption_APIErrorZ_Tag {
12575 * When we're in this state, this COption_APIErrorZ contains a crate::lightning::util::errors::APIError
12577 LDKCOption_APIErrorZ_Some,
12579 * When we're in this state, this COption_APIErrorZ contains nothing
12581 LDKCOption_APIErrorZ_None,
12583 * Must be last for serialization purposes
12585 LDKCOption_APIErrorZ_Sentinel,
12586 } LDKCOption_APIErrorZ_Tag;
12588 typedef struct LDKCOption_APIErrorZ {
12589 LDKCOption_APIErrorZ_Tag tag;
12592 struct LDKAPIError some;
12595 } LDKCOption_APIErrorZ;
12598 * The contents of CResult_COption_APIErrorZDecodeErrorZ
12600 typedef union LDKCResult_COption_APIErrorZDecodeErrorZPtr {
12602 * A pointer to the contents in the success state.
12603 * Reading from this pointer when `result_ok` is not set is undefined.
12605 struct LDKCOption_APIErrorZ *result;
12607 * A pointer to the contents in the error state.
12608 * Reading from this pointer when `result_ok` is set is undefined.
12610 struct LDKDecodeError *err;
12611 } LDKCResult_COption_APIErrorZDecodeErrorZPtr;
12614 * A CResult_COption_APIErrorZDecodeErrorZ represents the result of a fallible operation,
12615 * containing a crate::c_types::derived::COption_APIErrorZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
12616 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
12618 typedef struct LDKCResult_COption_APIErrorZDecodeErrorZ {
12620 * The contents of this CResult_COption_APIErrorZDecodeErrorZ, accessible via either
12621 * `err` or `result` depending on the state of `result_ok`.
12623 union LDKCResult_COption_APIErrorZDecodeErrorZPtr contents;
12625 * Whether this CResult_COption_APIErrorZDecodeErrorZ represents a success state.
12628 } LDKCResult_COption_APIErrorZDecodeErrorZ;
12631 * The contents of CResult_ChannelMonitorUpdateDecodeErrorZ
12633 typedef union LDKCResult_ChannelMonitorUpdateDecodeErrorZPtr {
12635 * A pointer to the contents in the success state.
12636 * Reading from this pointer when `result_ok` is not set is undefined.
12638 struct LDKChannelMonitorUpdate *result;
12640 * A pointer to the contents in the error state.
12641 * Reading from this pointer when `result_ok` is set is undefined.
12643 struct LDKDecodeError *err;
12644 } LDKCResult_ChannelMonitorUpdateDecodeErrorZPtr;
12647 * A CResult_ChannelMonitorUpdateDecodeErrorZ represents the result of a fallible operation,
12648 * containing a crate::lightning::chain::channelmonitor::ChannelMonitorUpdate on success and a crate::lightning::ln::msgs::DecodeError on failure.
12649 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
12651 typedef struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ {
12653 * The contents of this CResult_ChannelMonitorUpdateDecodeErrorZ, accessible via either
12654 * `err` or `result` depending on the state of `result_ok`.
12656 union LDKCResult_ChannelMonitorUpdateDecodeErrorZPtr contents;
12658 * Whether this CResult_ChannelMonitorUpdateDecodeErrorZ represents a success state.
12661 } LDKCResult_ChannelMonitorUpdateDecodeErrorZ;
12664 * An enum which can either contain a crate::lightning::chain::channelmonitor::MonitorEvent or not
12666 typedef enum LDKCOption_MonitorEventZ_Tag {
12668 * When we're in this state, this COption_MonitorEventZ contains a crate::lightning::chain::channelmonitor::MonitorEvent
12670 LDKCOption_MonitorEventZ_Some,
12672 * When we're in this state, this COption_MonitorEventZ contains nothing
12674 LDKCOption_MonitorEventZ_None,
12676 * Must be last for serialization purposes
12678 LDKCOption_MonitorEventZ_Sentinel,
12679 } LDKCOption_MonitorEventZ_Tag;
12681 typedef struct LDKCOption_MonitorEventZ {
12682 LDKCOption_MonitorEventZ_Tag tag;
12685 struct LDKMonitorEvent some;
12688 } LDKCOption_MonitorEventZ;
12691 * The contents of CResult_COption_MonitorEventZDecodeErrorZ
12693 typedef union LDKCResult_COption_MonitorEventZDecodeErrorZPtr {
12695 * A pointer to the contents in the success state.
12696 * Reading from this pointer when `result_ok` is not set is undefined.
12698 struct LDKCOption_MonitorEventZ *result;
12700 * A pointer to the contents in the error state.
12701 * Reading from this pointer when `result_ok` is set is undefined.
12703 struct LDKDecodeError *err;
12704 } LDKCResult_COption_MonitorEventZDecodeErrorZPtr;
12707 * A CResult_COption_MonitorEventZDecodeErrorZ represents the result of a fallible operation,
12708 * containing a crate::c_types::derived::COption_MonitorEventZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
12709 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
12711 typedef struct LDKCResult_COption_MonitorEventZDecodeErrorZ {
12713 * The contents of this CResult_COption_MonitorEventZDecodeErrorZ, accessible via either
12714 * `err` or `result` depending on the state of `result_ok`.
12716 union LDKCResult_COption_MonitorEventZDecodeErrorZPtr contents;
12718 * Whether this CResult_COption_MonitorEventZDecodeErrorZ represents a success state.
12721 } LDKCResult_COption_MonitorEventZDecodeErrorZ;
12724 * The contents of CResult_HTLCUpdateDecodeErrorZ
12726 typedef union LDKCResult_HTLCUpdateDecodeErrorZPtr {
12728 * A pointer to the contents in the success state.
12729 * Reading from this pointer when `result_ok` is not set is undefined.
12731 struct LDKHTLCUpdate *result;
12733 * A pointer to the contents in the error state.
12734 * Reading from this pointer when `result_ok` is set is undefined.
12736 struct LDKDecodeError *err;
12737 } LDKCResult_HTLCUpdateDecodeErrorZPtr;
12740 * A CResult_HTLCUpdateDecodeErrorZ represents the result of a fallible operation,
12741 * containing a crate::lightning::chain::channelmonitor::HTLCUpdate on success and a crate::lightning::ln::msgs::DecodeError on failure.
12742 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
12744 typedef struct LDKCResult_HTLCUpdateDecodeErrorZ {
12746 * The contents of this CResult_HTLCUpdateDecodeErrorZ, accessible via either
12747 * `err` or `result` depending on the state of `result_ok`.
12749 union LDKCResult_HTLCUpdateDecodeErrorZPtr contents;
12751 * Whether this CResult_HTLCUpdateDecodeErrorZ represents a success state.
12754 } LDKCResult_HTLCUpdateDecodeErrorZ;
12757 * A tuple of 2 elements. See the individual fields for the types contained.
12759 typedef struct LDKC2Tuple_OutPointCVec_u8ZZ {
12761 * The element at position 0
12763 struct LDKOutPoint a;
12765 * The element at position 1
12767 struct LDKCVec_u8Z b;
12768 } LDKC2Tuple_OutPointCVec_u8ZZ;
12771 * A tuple of 2 elements. See the individual fields for the types contained.
12773 typedef struct LDKC2Tuple_u32CVec_u8ZZ {
12775 * The element at position 0
12779 * The element at position 1
12781 struct LDKCVec_u8Z b;
12782 } LDKC2Tuple_u32CVec_u8ZZ;
12785 * A dynamically-allocated array of crate::c_types::derived::C2Tuple_u32CVec_u8ZZs of arbitrary size.
12786 * This corresponds to std::vector in C++
12788 typedef struct LDKCVec_C2Tuple_u32CVec_u8ZZZ {
12790 * The elements in the array.
12791 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
12793 struct LDKC2Tuple_u32CVec_u8ZZ *data;
12795 * The number of elements pointed to by `data`.
12798 } LDKCVec_C2Tuple_u32CVec_u8ZZZ;
12801 * A tuple of 2 elements. See the individual fields for the types contained.
12803 typedef struct LDKC2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZ {
12805 * The element at position 0
12807 struct LDKThirtyTwoBytes a;
12809 * The element at position 1
12811 struct LDKCVec_C2Tuple_u32CVec_u8ZZZ b;
12812 } LDKC2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZ;
12815 * A dynamically-allocated array of crate::c_types::derived::C2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZs of arbitrary size.
12816 * This corresponds to std::vector in C++
12818 typedef struct LDKCVec_C2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZZ {
12820 * The elements in the array.
12821 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
12823 struct LDKC2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZ *data;
12825 * The number of elements pointed to by `data`.
12828 } LDKCVec_C2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZZ;
12831 * A dynamically-allocated array of crate::lightning::ln::chan_utils::CommitmentTransactions of arbitrary size.
12832 * This corresponds to std::vector in C++
12834 typedef struct LDKCVec_CommitmentTransactionZ {
12836 * The elements in the array.
12837 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
12839 struct LDKCommitmentTransaction *data;
12841 * The number of elements pointed to by `data`.
12844 } LDKCVec_CommitmentTransactionZ;
12847 * A tuple of 2 elements. See the individual fields for the types contained.
12849 typedef struct LDKC2Tuple_u32TxOutZ {
12851 * The element at position 0
12855 * The element at position 1
12858 } LDKC2Tuple_u32TxOutZ;
12861 * A dynamically-allocated array of crate::c_types::derived::C2Tuple_u32TxOutZs of arbitrary size.
12862 * This corresponds to std::vector in C++
12864 typedef struct LDKCVec_C2Tuple_u32TxOutZZ {
12866 * The elements in the array.
12867 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
12869 struct LDKC2Tuple_u32TxOutZ *data;
12871 * The number of elements pointed to by `data`.
12874 } LDKCVec_C2Tuple_u32TxOutZZ;
12877 * A tuple of 2 elements. See the individual fields for the types contained.
12879 typedef struct LDKC2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32TxOutZZZ {
12881 * The element at position 0
12883 struct LDKThirtyTwoBytes a;
12885 * The element at position 1
12887 struct LDKCVec_C2Tuple_u32TxOutZZ b;
12888 } LDKC2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32TxOutZZZ;
12891 * A dynamically-allocated array of crate::c_types::derived::C2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32TxOutZZZs of arbitrary size.
12892 * This corresponds to std::vector in C++
12894 typedef struct LDKCVec_TransactionOutputsZ {
12896 * The elements in the array.
12897 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
12899 struct LDKC2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32TxOutZZZ *data;
12901 * The number of elements pointed to by `data`.
12904 } LDKCVec_TransactionOutputsZ;
12907 * Details about the balance(s) available for spending once the channel appears on chain.
12909 * See [`ChannelMonitor::get_claimable_balances`] for more details on when these will or will not
12912 typedef enum LDKBalance_Tag {
12914 * The channel is not yet closed (or the commitment or closing transaction has not yet
12915 * appeared in a block). The given balance is claimable (less on-chain fees) if the channel is
12916 * force-closed now.
12918 LDKBalance_ClaimableOnChannelClose,
12920 * The channel has been closed, and the given balance is ours but awaiting confirmations until
12921 * we consider it spendable.
12923 LDKBalance_ClaimableAwaitingConfirmations,
12925 * The channel has been closed, and the given balance should be ours but awaiting spending
12926 * transaction confirmation. If the spending transaction does not confirm in time, it is
12927 * possible our counterparty can take the funds by broadcasting an HTLC timeout on-chain.
12929 * Once the spending transaction confirms, before it has reached enough confirmations to be
12930 * considered safe from chain reorganizations, the balance will instead be provided via
12931 * [`Balance::ClaimableAwaitingConfirmations`].
12933 LDKBalance_ContentiousClaimable,
12935 * HTLCs which we sent to our counterparty which are claimable after a timeout (less on-chain
12936 * fees) if the counterparty does not know the preimage for the HTLCs. These are somewhat
12937 * likely to be claimed by our counterparty before we do.
12939 LDKBalance_MaybeTimeoutClaimableHTLC,
12941 * HTLCs which we received from our counterparty which are claimable with a preimage which we
12942 * do not currently have. This will only be claimable if we receive the preimage from the node
12943 * to which we forwarded this HTLC before the timeout.
12945 LDKBalance_MaybePreimageClaimableHTLC,
12947 * The channel has been closed, and our counterparty broadcasted a revoked commitment
12950 * Thus, we're able to claim all outputs in the commitment transaction, one of which has the
12951 * following amount.
12953 LDKBalance_CounterpartyRevokedOutputClaimable,
12955 * Must be last for serialization purposes
12957 LDKBalance_Sentinel,
12960 typedef struct LDKBalance_LDKClaimableOnChannelClose_Body {
12962 * The amount available to claim, in satoshis, excluding the on-chain fees which will be
12963 * required to do so.
12965 uint64_t amount_satoshis;
12966 } LDKBalance_LDKClaimableOnChannelClose_Body;
12968 typedef struct LDKBalance_LDKClaimableAwaitingConfirmations_Body {
12970 * The amount available to claim, in satoshis, possibly excluding the on-chain fees which
12971 * were spent in broadcasting the transaction.
12973 uint64_t amount_satoshis;
12975 * The height at which an [`Event::SpendableOutputs`] event will be generated for this
12978 uint32_t confirmation_height;
12979 } LDKBalance_LDKClaimableAwaitingConfirmations_Body;
12981 typedef struct LDKBalance_LDKContentiousClaimable_Body {
12983 * The amount available to claim, in satoshis, excluding the on-chain fees which will be
12984 * required to do so.
12986 uint64_t amount_satoshis;
12988 * The height at which the counterparty may be able to claim the balance if we have not
12991 uint32_t timeout_height;
12993 * The payment hash that locks this HTLC.
12995 struct LDKThirtyTwoBytes payment_hash;
12997 * The preimage that can be used to claim this HTLC.
12999 struct LDKThirtyTwoBytes payment_preimage;
13000 } LDKBalance_LDKContentiousClaimable_Body;
13002 typedef struct LDKBalance_LDKMaybeTimeoutClaimableHTLC_Body {
13004 * The amount potentially available to claim, in satoshis, excluding the on-chain fees
13005 * which will be required to do so.
13007 uint64_t amount_satoshis;
13009 * The height at which we will be able to claim the balance if our counterparty has not
13012 uint32_t claimable_height;
13014 * The payment hash whose preimage our counterparty needs to claim this HTLC.
13016 struct LDKThirtyTwoBytes payment_hash;
13017 } LDKBalance_LDKMaybeTimeoutClaimableHTLC_Body;
13019 typedef struct LDKBalance_LDKMaybePreimageClaimableHTLC_Body {
13021 * The amount potentially available to claim, in satoshis, excluding the on-chain fees
13022 * which will be required to do so.
13024 uint64_t amount_satoshis;
13026 * The height at which our counterparty will be able to claim the balance if we have not
13027 * yet received the preimage and claimed it ourselves.
13029 uint32_t expiry_height;
13031 * The payment hash whose preimage we need to claim this HTLC.
13033 struct LDKThirtyTwoBytes payment_hash;
13034 } LDKBalance_LDKMaybePreimageClaimableHTLC_Body;
13036 typedef struct LDKBalance_LDKCounterpartyRevokedOutputClaimable_Body {
13038 * The amount, in satoshis, of the output which we can claim.
13040 * Note that for outputs from HTLC balances this may be excluding some on-chain fees that
13041 * were already spent.
13043 uint64_t amount_satoshis;
13044 } LDKBalance_LDKCounterpartyRevokedOutputClaimable_Body;
13046 typedef struct MUST_USE_STRUCT LDKBalance {
13047 LDKBalance_Tag tag;
13049 LDKBalance_LDKClaimableOnChannelClose_Body claimable_on_channel_close;
13050 LDKBalance_LDKClaimableAwaitingConfirmations_Body claimable_awaiting_confirmations;
13051 LDKBalance_LDKContentiousClaimable_Body contentious_claimable;
13052 LDKBalance_LDKMaybeTimeoutClaimableHTLC_Body maybe_timeout_claimable_htlc;
13053 LDKBalance_LDKMaybePreimageClaimableHTLC_Body maybe_preimage_claimable_htlc;
13054 LDKBalance_LDKCounterpartyRevokedOutputClaimable_Body counterparty_revoked_output_claimable;
13059 * A dynamically-allocated array of crate::lightning::chain::channelmonitor::Balances of arbitrary size.
13060 * This corresponds to std::vector in C++
13062 typedef struct LDKCVec_BalanceZ {
13064 * The elements in the array.
13065 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
13067 struct LDKBalance *data;
13069 * The number of elements pointed to by `data`.
13072 } LDKCVec_BalanceZ;
13075 * A tuple of 2 elements. See the individual fields for the types contained.
13077 typedef struct LDKC2Tuple_ThirtyTwoBytesChannelMonitorZ {
13079 * The element at position 0
13081 struct LDKThirtyTwoBytes a;
13083 * The element at position 1
13085 struct LDKChannelMonitor b;
13086 } LDKC2Tuple_ThirtyTwoBytesChannelMonitorZ;
13089 * The contents of CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ
13091 typedef union LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZPtr {
13093 * A pointer to the contents in the success state.
13094 * Reading from this pointer when `result_ok` is not set is undefined.
13096 struct LDKC2Tuple_ThirtyTwoBytesChannelMonitorZ *result;
13098 * A pointer to the contents in the error state.
13099 * Reading from this pointer when `result_ok` is set is undefined.
13101 struct LDKDecodeError *err;
13102 } LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZPtr;
13105 * A CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ represents the result of a fallible operation,
13106 * containing a crate::c_types::derived::C2Tuple_ThirtyTwoBytesChannelMonitorZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
13107 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
13109 typedef struct LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ {
13111 * The contents of this CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ, accessible via either
13112 * `err` or `result` depending on the state of `result_ok`.
13114 union LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZPtr contents;
13116 * Whether this CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ represents a success state.
13119 } LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ;
13122 * Defines a type identifier for sending messages over the wire.
13124 * Messages implementing this trait specify a type and must be [`Writeable`].
13126 typedef struct LDKType {
13128 * An opaque pointer which is passed to your function implementations as an argument.
13129 * This has no meaning in the LDK, and can be NULL or any other value.
13133 * Returns the type identifying the message payload.
13135 uint16_t (*type_id)(const void *this_arg);
13137 * Return a human-readable "debug" string describing this object
13139 struct LDKStr (*debug_str)(const void *this_arg);
13141 * Serialize the object into a byte array
13143 struct LDKCVec_u8Z (*write)(const void *this_arg);
13145 * Called, if set, after this Type has been cloned into a duplicate object.
13146 * The new Type is provided, and should be mutated as needed to perform a
13147 * deep copy of the object pointed to by this_arg or avoid any double-freeing.
13149 void (*cloned)(struct LDKType *NONNULL_PTR new_Type);
13151 * Frees any resources associated with this object given its this_arg pointer.
13152 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
13154 void (*free)(void *this_arg);
13158 * A tuple of 2 elements. See the individual fields for the types contained.
13160 typedef struct LDKC2Tuple_PublicKeyTypeZ {
13162 * The element at position 0
13164 struct LDKPublicKey a;
13166 * The element at position 1
13169 } LDKC2Tuple_PublicKeyTypeZ;
13172 * A dynamically-allocated array of crate::c_types::derived::C2Tuple_PublicKeyTypeZs of arbitrary size.
13173 * This corresponds to std::vector in C++
13175 typedef struct LDKCVec_C2Tuple_PublicKeyTypeZZ {
13177 * The elements in the array.
13178 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
13180 struct LDKC2Tuple_PublicKeyTypeZ *data;
13182 * The number of elements pointed to by `data`.
13185 } LDKCVec_C2Tuple_PublicKeyTypeZZ;
13188 * A tuple of 2 elements. See the individual fields for the types contained.
13190 typedef struct LDKC2Tuple_PublicKeyCVec_SocketAddressZZ {
13192 * The element at position 0
13194 struct LDKPublicKey a;
13196 * The element at position 1
13198 struct LDKCVec_SocketAddressZ b;
13199 } LDKC2Tuple_PublicKeyCVec_SocketAddressZZ;
13202 * A dynamically-allocated array of crate::c_types::derived::C2Tuple_PublicKeyCVec_SocketAddressZZs of arbitrary size.
13203 * This corresponds to std::vector in C++
13205 typedef struct LDKCVec_C2Tuple_PublicKeyCVec_SocketAddressZZZ {
13207 * The elements in the array.
13208 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
13210 struct LDKC2Tuple_PublicKeyCVec_SocketAddressZZ *data;
13212 * The number of elements pointed to by `data`.
13215 } LDKCVec_C2Tuple_PublicKeyCVec_SocketAddressZZZ;
13218 * The contents of an onion message.
13220 typedef struct LDKOnionMessageContents {
13222 * An opaque pointer which is passed to your function implementations as an argument.
13223 * This has no meaning in the LDK, and can be NULL or any other value.
13227 * Returns the TLV type identifying the message contents. MUST be >= 64.
13229 uint64_t (*tlv_type)(const void *this_arg);
13231 * Serialize the object into a byte array
13233 struct LDKCVec_u8Z (*write)(const void *this_arg);
13235 * Return a human-readable "debug" string describing this object
13237 struct LDKStr (*debug_str)(const void *this_arg);
13239 * Called, if set, after this OnionMessageContents has been cloned into a duplicate object.
13240 * The new OnionMessageContents is provided, and should be mutated as needed to perform a
13241 * deep copy of the object pointed to by this_arg or avoid any double-freeing.
13243 void (*cloned)(struct LDKOnionMessageContents *NONNULL_PTR new_OnionMessageContents);
13245 * Frees any resources associated with this object given its this_arg pointer.
13246 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
13248 void (*free)(void *this_arg);
13249 } LDKOnionMessageContents;
13252 * An enum which can either contain a crate::lightning::onion_message::packet::OnionMessageContents or not
13254 typedef enum LDKCOption_OnionMessageContentsZ_Tag {
13256 * When we're in this state, this COption_OnionMessageContentsZ contains a crate::lightning::onion_message::packet::OnionMessageContents
13258 LDKCOption_OnionMessageContentsZ_Some,
13260 * When we're in this state, this COption_OnionMessageContentsZ contains nothing
13262 LDKCOption_OnionMessageContentsZ_None,
13264 * Must be last for serialization purposes
13266 LDKCOption_OnionMessageContentsZ_Sentinel,
13267 } LDKCOption_OnionMessageContentsZ_Tag;
13269 typedef struct LDKCOption_OnionMessageContentsZ {
13270 LDKCOption_OnionMessageContentsZ_Tag tag;
13273 struct LDKOnionMessageContents some;
13276 } LDKCOption_OnionMessageContentsZ;
13279 * The contents of CResult_COption_OnionMessageContentsZDecodeErrorZ
13281 typedef union LDKCResult_COption_OnionMessageContentsZDecodeErrorZPtr {
13283 * A pointer to the contents in the success state.
13284 * Reading from this pointer when `result_ok` is not set is undefined.
13286 struct LDKCOption_OnionMessageContentsZ *result;
13288 * A pointer to the contents in the error state.
13289 * Reading from this pointer when `result_ok` is set is undefined.
13291 struct LDKDecodeError *err;
13292 } LDKCResult_COption_OnionMessageContentsZDecodeErrorZPtr;
13295 * A CResult_COption_OnionMessageContentsZDecodeErrorZ represents the result of a fallible operation,
13296 * containing a crate::c_types::derived::COption_OnionMessageContentsZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
13297 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
13299 typedef struct LDKCResult_COption_OnionMessageContentsZDecodeErrorZ {
13301 * The contents of this CResult_COption_OnionMessageContentsZDecodeErrorZ, accessible via either
13302 * `err` or `result` depending on the state of `result_ok`.
13304 union LDKCResult_COption_OnionMessageContentsZDecodeErrorZPtr contents;
13306 * Whether this CResult_COption_OnionMessageContentsZDecodeErrorZ represents a success state.
13309 } LDKCResult_COption_OnionMessageContentsZDecodeErrorZ;
13312 * A tuple of 3 elements. See the individual fields for the types contained.
13314 typedef struct LDKC3Tuple_OnionMessageContentsDestinationBlindedPathZ {
13316 * The element at position 0
13318 struct LDKOnionMessageContents a;
13320 * The element at position 1
13322 struct LDKDestination b;
13324 * The element at position 2
13326 struct LDKBlindedPath c;
13327 } LDKC3Tuple_OnionMessageContentsDestinationBlindedPathZ;
13330 * A dynamically-allocated array of crate::c_types::derived::C3Tuple_OnionMessageContentsDestinationBlindedPathZs of arbitrary size.
13331 * This corresponds to std::vector in C++
13333 typedef struct LDKCVec_C3Tuple_OnionMessageContentsDestinationBlindedPathZZ {
13335 * The elements in the array.
13336 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
13338 struct LDKC3Tuple_OnionMessageContentsDestinationBlindedPathZ *data;
13340 * The number of elements pointed to by `data`.
13343 } LDKCVec_C3Tuple_OnionMessageContentsDestinationBlindedPathZZ;
13346 * An enum which can either contain a crate::lightning::ln::wire::Type or not
13348 typedef enum LDKCOption_TypeZ_Tag {
13350 * When we're in this state, this COption_TypeZ contains a crate::lightning::ln::wire::Type
13352 LDKCOption_TypeZ_Some,
13354 * When we're in this state, this COption_TypeZ contains nothing
13356 LDKCOption_TypeZ_None,
13358 * Must be last for serialization purposes
13360 LDKCOption_TypeZ_Sentinel,
13361 } LDKCOption_TypeZ_Tag;
13363 typedef struct LDKCOption_TypeZ {
13364 LDKCOption_TypeZ_Tag tag;
13367 struct LDKType some;
13370 } LDKCOption_TypeZ;
13373 * The contents of CResult_COption_TypeZDecodeErrorZ
13375 typedef union LDKCResult_COption_TypeZDecodeErrorZPtr {
13377 * A pointer to the contents in the success state.
13378 * Reading from this pointer when `result_ok` is not set is undefined.
13380 struct LDKCOption_TypeZ *result;
13382 * A pointer to the contents in the error state.
13383 * Reading from this pointer when `result_ok` is set is undefined.
13385 struct LDKDecodeError *err;
13386 } LDKCResult_COption_TypeZDecodeErrorZPtr;
13389 * A CResult_COption_TypeZDecodeErrorZ represents the result of a fallible operation,
13390 * containing a crate::c_types::derived::COption_TypeZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
13391 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
13393 typedef struct LDKCResult_COption_TypeZDecodeErrorZ {
13395 * The contents of this CResult_COption_TypeZDecodeErrorZ, accessible via either
13396 * `err` or `result` depending on the state of `result_ok`.
13398 union LDKCResult_COption_TypeZDecodeErrorZPtr contents;
13400 * Whether this CResult_COption_TypeZDecodeErrorZ represents a success state.
13403 } LDKCResult_COption_TypeZDecodeErrorZ;
13406 * An enum which can either contain a crate::lightning::ln::msgs::SocketAddress or not
13408 typedef enum LDKCOption_SocketAddressZ_Tag {
13410 * When we're in this state, this COption_SocketAddressZ contains a crate::lightning::ln::msgs::SocketAddress
13412 LDKCOption_SocketAddressZ_Some,
13414 * When we're in this state, this COption_SocketAddressZ contains nothing
13416 LDKCOption_SocketAddressZ_None,
13418 * Must be last for serialization purposes
13420 LDKCOption_SocketAddressZ_Sentinel,
13421 } LDKCOption_SocketAddressZ_Tag;
13423 typedef struct LDKCOption_SocketAddressZ {
13424 LDKCOption_SocketAddressZ_Tag tag;
13427 struct LDKSocketAddress some;
13430 } LDKCOption_SocketAddressZ;
13435 * Details of a connected peer as returned by [`PeerManager::list_peers`].
13437 typedef struct MUST_USE_STRUCT LDKPeerDetails {
13439 * A pointer to the opaque Rust object.
13440 * Nearly everywhere, inner must be non-null, however in places where
13441 * the Rust equivalent takes an Option, it may be set to null to indicate None.
13443 LDKnativePeerDetails *inner;
13445 * Indicates that this is the only struct which contains the same pointer.
13446 * Rust functions which take ownership of an object provided via an argument require
13447 * this to be true and invalidate the object pointed to by inner.
13453 * A dynamically-allocated array of crate::lightning::ln::peer_handler::PeerDetailss of arbitrary size.
13454 * This corresponds to std::vector in C++
13456 typedef struct LDKCVec_PeerDetailsZ {
13458 * The elements in the array.
13459 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
13461 struct LDKPeerDetails *data;
13463 * The number of elements pointed to by `data`.
13466 } LDKCVec_PeerDetailsZ;
13471 * Error for PeerManager errors. If you get one of these, you must disconnect the socket and
13472 * generate no further read_event/write_buffer_space_avail/socket_disconnected calls for the
13475 typedef struct MUST_USE_STRUCT LDKPeerHandleError {
13477 * A pointer to the opaque Rust object.
13478 * Nearly everywhere, inner must be non-null, however in places where
13479 * the Rust equivalent takes an Option, it may be set to null to indicate None.
13481 LDKnativePeerHandleError *inner;
13483 * Indicates that this is the only struct which contains the same pointer.
13484 * Rust functions which take ownership of an object provided via an argument require
13485 * this to be true and invalidate the object pointed to by inner.
13488 } LDKPeerHandleError;
13491 * The contents of CResult_CVec_u8ZPeerHandleErrorZ
13493 typedef union LDKCResult_CVec_u8ZPeerHandleErrorZPtr {
13495 * A pointer to the contents in the success state.
13496 * Reading from this pointer when `result_ok` is not set is undefined.
13498 struct LDKCVec_u8Z *result;
13500 * A pointer to the contents in the error state.
13501 * Reading from this pointer when `result_ok` is set is undefined.
13503 struct LDKPeerHandleError *err;
13504 } LDKCResult_CVec_u8ZPeerHandleErrorZPtr;
13507 * A CResult_CVec_u8ZPeerHandleErrorZ represents the result of a fallible operation,
13508 * containing a crate::c_types::derived::CVec_u8Z on success and a crate::lightning::ln::peer_handler::PeerHandleError on failure.
13509 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
13511 typedef struct LDKCResult_CVec_u8ZPeerHandleErrorZ {
13513 * The contents of this CResult_CVec_u8ZPeerHandleErrorZ, accessible via either
13514 * `err` or `result` depending on the state of `result_ok`.
13516 union LDKCResult_CVec_u8ZPeerHandleErrorZPtr contents;
13518 * Whether this CResult_CVec_u8ZPeerHandleErrorZ represents a success state.
13521 } LDKCResult_CVec_u8ZPeerHandleErrorZ;
13524 * The contents of CResult_NonePeerHandleErrorZ
13526 typedef union LDKCResult_NonePeerHandleErrorZPtr {
13528 * Note that this value is always NULL, as there are no contents in the OK variant
13532 * A pointer to the contents in the error state.
13533 * Reading from this pointer when `result_ok` is set is undefined.
13535 struct LDKPeerHandleError *err;
13536 } LDKCResult_NonePeerHandleErrorZPtr;
13539 * A CResult_NonePeerHandleErrorZ represents the result of a fallible operation,
13540 * containing a () on success and a crate::lightning::ln::peer_handler::PeerHandleError on failure.
13541 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
13543 typedef struct LDKCResult_NonePeerHandleErrorZ {
13545 * The contents of this CResult_NonePeerHandleErrorZ, accessible via either
13546 * `err` or `result` depending on the state of `result_ok`.
13548 union LDKCResult_NonePeerHandleErrorZPtr contents;
13550 * Whether this CResult_NonePeerHandleErrorZ represents a success state.
13553 } LDKCResult_NonePeerHandleErrorZ;
13556 * The contents of CResult_boolPeerHandleErrorZ
13558 typedef union LDKCResult_boolPeerHandleErrorZPtr {
13560 * A pointer to the contents in the success state.
13561 * Reading from this pointer when `result_ok` is not set is undefined.
13565 * A pointer to the contents in the error state.
13566 * Reading from this pointer when `result_ok` is set is undefined.
13568 struct LDKPeerHandleError *err;
13569 } LDKCResult_boolPeerHandleErrorZPtr;
13572 * A CResult_boolPeerHandleErrorZ represents the result of a fallible operation,
13573 * containing a bool on success and a crate::lightning::ln::peer_handler::PeerHandleError on failure.
13574 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
13576 typedef struct LDKCResult_boolPeerHandleErrorZ {
13578 * The contents of this CResult_boolPeerHandleErrorZ, accessible via either
13579 * `err` or `result` depending on the state of `result_ok`.
13581 union LDKCResult_boolPeerHandleErrorZPtr contents;
13583 * Whether this CResult_boolPeerHandleErrorZ represents a success state.
13586 } LDKCResult_boolPeerHandleErrorZ;
13589 * All-encompassing standard error type that processing can return
13591 typedef enum LDKGraphSyncError_Tag {
13593 * Error trying to read the update data, typically due to an erroneous data length indication
13594 * that is greater than the actual amount of data provided
13596 LDKGraphSyncError_DecodeError,
13598 * Error applying the patch to the network graph, usually the result of updates that are too
13599 * old or missing prerequisite data to the application of updates out of order
13601 LDKGraphSyncError_LightningError,
13603 * Must be last for serialization purposes
13605 LDKGraphSyncError_Sentinel,
13606 } LDKGraphSyncError_Tag;
13608 typedef struct MUST_USE_STRUCT LDKGraphSyncError {
13609 LDKGraphSyncError_Tag tag;
13612 struct LDKDecodeError decode_error;
13615 struct LDKLightningError lightning_error;
13618 } LDKGraphSyncError;
13621 * The contents of CResult_u32GraphSyncErrorZ
13623 typedef union LDKCResult_u32GraphSyncErrorZPtr {
13625 * A pointer to the contents in the success state.
13626 * Reading from this pointer when `result_ok` is not set is undefined.
13630 * A pointer to the contents in the error state.
13631 * Reading from this pointer when `result_ok` is set is undefined.
13633 struct LDKGraphSyncError *err;
13634 } LDKCResult_u32GraphSyncErrorZPtr;
13637 * A CResult_u32GraphSyncErrorZ represents the result of a fallible operation,
13638 * containing a u32 on success and a crate::lightning_rapid_gossip_sync::GraphSyncError on failure.
13639 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
13641 typedef struct LDKCResult_u32GraphSyncErrorZ {
13643 * The contents of this CResult_u32GraphSyncErrorZ, accessible via either
13644 * `err` or `result` depending on the state of `result_ok`.
13646 union LDKCResult_u32GraphSyncErrorZPtr contents;
13648 * Whether this CResult_u32GraphSyncErrorZ represents a success state.
13651 } LDKCResult_u32GraphSyncErrorZ;
13654 * The contents of CResult_CVec_u8ZIOErrorZ
13656 typedef union LDKCResult_CVec_u8ZIOErrorZPtr {
13658 * A pointer to the contents in the success state.
13659 * Reading from this pointer when `result_ok` is not set is undefined.
13661 struct LDKCVec_u8Z *result;
13663 * A pointer to the contents in the error state.
13664 * Reading from this pointer when `result_ok` is set is undefined.
13666 enum LDKIOError *err;
13667 } LDKCResult_CVec_u8ZIOErrorZPtr;
13670 * A CResult_CVec_u8ZIOErrorZ represents the result of a fallible operation,
13671 * containing a crate::c_types::derived::CVec_u8Z on success and a crate::c_types::IOError on failure.
13672 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
13674 typedef struct LDKCResult_CVec_u8ZIOErrorZ {
13676 * The contents of this CResult_CVec_u8ZIOErrorZ, accessible via either
13677 * `err` or `result` depending on the state of `result_ok`.
13679 union LDKCResult_CVec_u8ZIOErrorZPtr contents;
13681 * Whether this CResult_CVec_u8ZIOErrorZ represents a success state.
13684 } LDKCResult_CVec_u8ZIOErrorZ;
13687 * A dynamically-allocated array of crate::c_types::Strs of arbitrary size.
13688 * This corresponds to std::vector in C++
13690 typedef struct LDKCVec_StrZ {
13692 * The elements in the array.
13693 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
13695 struct LDKStr *data;
13697 * The number of elements pointed to by `data`.
13703 * The contents of CResult_CVec_StrZIOErrorZ
13705 typedef union LDKCResult_CVec_StrZIOErrorZPtr {
13707 * A pointer to the contents in the success state.
13708 * Reading from this pointer when `result_ok` is not set is undefined.
13710 struct LDKCVec_StrZ *result;
13712 * A pointer to the contents in the error state.
13713 * Reading from this pointer when `result_ok` is set is undefined.
13715 enum LDKIOError *err;
13716 } LDKCResult_CVec_StrZIOErrorZPtr;
13719 * A CResult_CVec_StrZIOErrorZ represents the result of a fallible operation,
13720 * containing a crate::c_types::derived::CVec_StrZ on success and a crate::c_types::IOError on failure.
13721 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
13723 typedef struct LDKCResult_CVec_StrZIOErrorZ {
13725 * The contents of this CResult_CVec_StrZIOErrorZ, accessible via either
13726 * `err` or `result` depending on the state of `result_ok`.
13728 union LDKCResult_CVec_StrZIOErrorZPtr contents;
13730 * Whether this CResult_CVec_StrZIOErrorZ represents a success state.
13733 } LDKCResult_CVec_StrZIOErrorZ;
13736 * A dynamically-allocated array of crate::c_types::derived::C2Tuple_ThirtyTwoBytesChannelMonitorZs of arbitrary size.
13737 * This corresponds to std::vector in C++
13739 typedef struct LDKCVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZ {
13741 * The elements in the array.
13742 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
13744 struct LDKC2Tuple_ThirtyTwoBytesChannelMonitorZ *data;
13746 * The number of elements pointed to by `data`.
13749 } LDKCVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZ;
13752 * The contents of CResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ
13754 typedef union LDKCResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZPtr {
13756 * A pointer to the contents in the success state.
13757 * Reading from this pointer when `result_ok` is not set is undefined.
13759 struct LDKCVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZ *result;
13761 * A pointer to the contents in the error state.
13762 * Reading from this pointer when `result_ok` is set is undefined.
13764 enum LDKIOError *err;
13765 } LDKCResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZPtr;
13768 * A CResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ represents the result of a fallible operation,
13769 * containing a crate::c_types::derived::CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZ on success and a crate::c_types::IOError on failure.
13770 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
13772 typedef struct LDKCResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ {
13774 * The contents of this CResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ, accessible via either
13775 * `err` or `result` depending on the state of `result_ok`.
13777 union LDKCResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZPtr contents;
13779 * Whether this CResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ represents a success state.
13782 } LDKCResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ;
13785 * The contents of CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ
13787 typedef union LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZPtr {
13789 * A pointer to the contents in the success state.
13790 * Reading from this pointer when `result_ok` is not set is undefined.
13792 struct LDKC2Tuple_ThirtyTwoBytesChannelMonitorZ *result;
13794 * A pointer to the contents in the error state.
13795 * Reading from this pointer when `result_ok` is set is undefined.
13797 enum LDKIOError *err;
13798 } LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZPtr;
13801 * A CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ represents the result of a fallible operation,
13802 * containing a crate::c_types::derived::C2Tuple_ThirtyTwoBytesChannelMonitorZ on success and a crate::c_types::IOError on failure.
13803 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
13805 typedef struct LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ {
13807 * The contents of this CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ, accessible via either
13808 * `err` or `result` depending on the state of `result_ok`.
13810 union LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZPtr contents;
13812 * Whether this CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ represents a success state.
13815 } LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ;
13818 * The contents of CResult_UnsignedInvoiceRequestBolt12SemanticErrorZ
13820 typedef union LDKCResult_UnsignedInvoiceRequestBolt12SemanticErrorZPtr {
13822 * A pointer to the contents in the success state.
13823 * Reading from this pointer when `result_ok` is not set is undefined.
13825 struct LDKUnsignedInvoiceRequest *result;
13827 * A pointer to the contents in the error state.
13828 * Reading from this pointer when `result_ok` is set is undefined.
13830 enum LDKBolt12SemanticError *err;
13831 } LDKCResult_UnsignedInvoiceRequestBolt12SemanticErrorZPtr;
13834 * A CResult_UnsignedInvoiceRequestBolt12SemanticErrorZ represents the result of a fallible operation,
13835 * containing a crate::lightning::offers::invoice_request::UnsignedInvoiceRequest on success and a crate::lightning::offers::parse::Bolt12SemanticError on failure.
13836 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
13838 typedef struct LDKCResult_UnsignedInvoiceRequestBolt12SemanticErrorZ {
13840 * The contents of this CResult_UnsignedInvoiceRequestBolt12SemanticErrorZ, accessible via either
13841 * `err` or `result` depending on the state of `result_ok`.
13843 union LDKCResult_UnsignedInvoiceRequestBolt12SemanticErrorZPtr contents;
13845 * Whether this CResult_UnsignedInvoiceRequestBolt12SemanticErrorZ represents a success state.
13848 } LDKCResult_UnsignedInvoiceRequestBolt12SemanticErrorZ;
13851 * The contents of CResult_InvoiceRequestBolt12SemanticErrorZ
13853 typedef union LDKCResult_InvoiceRequestBolt12SemanticErrorZPtr {
13855 * A pointer to the contents in the success state.
13856 * Reading from this pointer when `result_ok` is not set is undefined.
13858 struct LDKInvoiceRequest *result;
13860 * A pointer to the contents in the error state.
13861 * Reading from this pointer when `result_ok` is set is undefined.
13863 enum LDKBolt12SemanticError *err;
13864 } LDKCResult_InvoiceRequestBolt12SemanticErrorZPtr;
13867 * A CResult_InvoiceRequestBolt12SemanticErrorZ represents the result of a fallible operation,
13868 * containing a crate::lightning::offers::invoice_request::InvoiceRequest on success and a crate::lightning::offers::parse::Bolt12SemanticError on failure.
13869 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
13871 typedef struct LDKCResult_InvoiceRequestBolt12SemanticErrorZ {
13873 * The contents of this CResult_InvoiceRequestBolt12SemanticErrorZ, accessible via either
13874 * `err` or `result` depending on the state of `result_ok`.
13876 union LDKCResult_InvoiceRequestBolt12SemanticErrorZPtr contents;
13878 * Whether this CResult_InvoiceRequestBolt12SemanticErrorZ represents a success state.
13881 } LDKCResult_InvoiceRequestBolt12SemanticErrorZ;
13884 * Represents a valid secp256k1 secret key serialized as a 32 byte array.
13886 typedef struct LDKSecretKey {
13888 * The bytes of the secret key
13894 * An enum which can either contain a crate::c_types::SecretKey or not
13896 typedef enum LDKCOption_SecretKeyZ_Tag {
13898 * When we're in this state, this COption_SecretKeyZ contains a crate::c_types::SecretKey
13900 LDKCOption_SecretKeyZ_Some,
13902 * When we're in this state, this COption_SecretKeyZ contains nothing
13904 LDKCOption_SecretKeyZ_None,
13906 * Must be last for serialization purposes
13908 LDKCOption_SecretKeyZ_Sentinel,
13909 } LDKCOption_SecretKeyZ_Tag;
13911 typedef struct LDKCOption_SecretKeyZ {
13912 LDKCOption_SecretKeyZ_Tag tag;
13915 struct LDKSecretKey some;
13918 } LDKCOption_SecretKeyZ;
13923 * Builds a [`Bolt12Invoice`] from either:
13924 * - an [`InvoiceRequest`] for the \"offer to be paid\" flow or
13925 * - a [`Refund`] for the \"offer for money\" flow.
13927 * See [module-level documentation] for usage.
13929 * [`InvoiceRequest`]: crate::offers::invoice_request::InvoiceRequest
13930 * [`Refund`]: crate::offers::refund::Refund
13931 * [module-level documentation]: self
13933 typedef struct MUST_USE_STRUCT LDKInvoiceWithExplicitSigningPubkeyBuilder {
13935 * A pointer to the opaque Rust object.
13936 * Nearly everywhere, inner must be non-null, however in places where
13937 * the Rust equivalent takes an Option, it may be set to null to indicate None.
13939 LDKnativeInvoiceWithExplicitSigningPubkeyBuilder *inner;
13941 * Indicates that this is the only struct which contains the same pointer.
13942 * Rust functions which take ownership of an object provided via an argument require
13943 * this to be true and invalidate the object pointed to by inner.
13946 } LDKInvoiceWithExplicitSigningPubkeyBuilder;
13949 * The contents of CResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ
13951 typedef union LDKCResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZPtr {
13953 * A pointer to the contents in the success state.
13954 * Reading from this pointer when `result_ok` is not set is undefined.
13956 struct LDKInvoiceWithExplicitSigningPubkeyBuilder *result;
13958 * A pointer to the contents in the error state.
13959 * Reading from this pointer when `result_ok` is set is undefined.
13961 enum LDKBolt12SemanticError *err;
13962 } LDKCResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZPtr;
13965 * A CResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ represents the result of a fallible operation,
13966 * containing a crate::lightning::offers::invoice::InvoiceWithExplicitSigningPubkeyBuilder on success and a crate::lightning::offers::parse::Bolt12SemanticError on failure.
13967 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
13969 typedef struct LDKCResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ {
13971 * The contents of this CResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ, accessible via either
13972 * `err` or `result` depending on the state of `result_ok`.
13974 union LDKCResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZPtr contents;
13976 * Whether this CResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ represents a success state.
13979 } LDKCResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ;
13984 * An [`InvoiceRequest`] that has been verified by [`InvoiceRequest::verify`] and exposes different
13985 * ways to respond depending on whether the signing keys were derived.
13987 typedef struct MUST_USE_STRUCT LDKVerifiedInvoiceRequest {
13989 * A pointer to the opaque Rust object.
13990 * Nearly everywhere, inner must be non-null, however in places where
13991 * the Rust equivalent takes an Option, it may be set to null to indicate None.
13993 LDKnativeVerifiedInvoiceRequest *inner;
13995 * Indicates that this is the only struct which contains the same pointer.
13996 * Rust functions which take ownership of an object provided via an argument require
13997 * this to be true and invalidate the object pointed to by inner.
14000 } LDKVerifiedInvoiceRequest;
14003 * The contents of CResult_VerifiedInvoiceRequestNoneZ
14005 typedef union LDKCResult_VerifiedInvoiceRequestNoneZPtr {
14007 * A pointer to the contents in the success state.
14008 * Reading from this pointer when `result_ok` is not set is undefined.
14010 struct LDKVerifiedInvoiceRequest *result;
14012 * Note that this value is always NULL, as there are no contents in the Err variant
14015 } LDKCResult_VerifiedInvoiceRequestNoneZPtr;
14018 * A CResult_VerifiedInvoiceRequestNoneZ represents the result of a fallible operation,
14019 * containing a crate::lightning::offers::invoice_request::VerifiedInvoiceRequest on success and a () on failure.
14020 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
14022 typedef struct LDKCResult_VerifiedInvoiceRequestNoneZ {
14024 * The contents of this CResult_VerifiedInvoiceRequestNoneZ, accessible via either
14025 * `err` or `result` depending on the state of `result_ok`.
14027 union LDKCResult_VerifiedInvoiceRequestNoneZPtr contents;
14029 * Whether this CResult_VerifiedInvoiceRequestNoneZ represents a success state.
14032 } LDKCResult_VerifiedInvoiceRequestNoneZ;
14037 * Builds a [`Bolt12Invoice`] from either:
14038 * - an [`InvoiceRequest`] for the \"offer to be paid\" flow or
14039 * - a [`Refund`] for the \"offer for money\" flow.
14041 * See [module-level documentation] for usage.
14043 * [`InvoiceRequest`]: crate::offers::invoice_request::InvoiceRequest
14044 * [`Refund`]: crate::offers::refund::Refund
14045 * [module-level documentation]: self
14047 typedef struct MUST_USE_STRUCT LDKInvoiceWithDerivedSigningPubkeyBuilder {
14049 * A pointer to the opaque Rust object.
14050 * Nearly everywhere, inner must be non-null, however in places where
14051 * the Rust equivalent takes an Option, it may be set to null to indicate None.
14053 LDKnativeInvoiceWithDerivedSigningPubkeyBuilder *inner;
14055 * Indicates that this is the only struct which contains the same pointer.
14056 * Rust functions which take ownership of an object provided via an argument require
14057 * this to be true and invalidate the object pointed to by inner.
14060 } LDKInvoiceWithDerivedSigningPubkeyBuilder;
14063 * The contents of CResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ
14065 typedef union LDKCResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZPtr {
14067 * A pointer to the contents in the success state.
14068 * Reading from this pointer when `result_ok` is not set is undefined.
14070 struct LDKInvoiceWithDerivedSigningPubkeyBuilder *result;
14072 * A pointer to the contents in the error state.
14073 * Reading from this pointer when `result_ok` is set is undefined.
14075 enum LDKBolt12SemanticError *err;
14076 } LDKCResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZPtr;
14079 * A CResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ represents the result of a fallible operation,
14080 * containing a crate::lightning::offers::invoice::InvoiceWithDerivedSigningPubkeyBuilder on success and a crate::lightning::offers::parse::Bolt12SemanticError on failure.
14081 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
14083 typedef struct LDKCResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ {
14085 * The contents of this CResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ, accessible via either
14086 * `err` or `result` depending on the state of `result_ok`.
14088 union LDKCResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZPtr contents;
14090 * Whether this CResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ represents a success state.
14093 } LDKCResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ;
14098 * Fields sent in an [`InvoiceRequest`] message to include in [`PaymentContext::Bolt12Offer`].
14100 * [`PaymentContext::Bolt12Offer`]: crate::blinded_path::payment::PaymentContext::Bolt12Offer
14102 typedef struct MUST_USE_STRUCT LDKInvoiceRequestFields {
14104 * A pointer to the opaque Rust object.
14105 * Nearly everywhere, inner must be non-null, however in places where
14106 * the Rust equivalent takes an Option, it may be set to null to indicate None.
14108 LDKnativeInvoiceRequestFields *inner;
14110 * Indicates that this is the only struct which contains the same pointer.
14111 * Rust functions which take ownership of an object provided via an argument require
14112 * this to be true and invalidate the object pointed to by inner.
14115 } LDKInvoiceRequestFields;
14118 * The contents of CResult_InvoiceRequestFieldsDecodeErrorZ
14120 typedef union LDKCResult_InvoiceRequestFieldsDecodeErrorZPtr {
14122 * A pointer to the contents in the success state.
14123 * Reading from this pointer when `result_ok` is not set is undefined.
14125 struct LDKInvoiceRequestFields *result;
14127 * A pointer to the contents in the error state.
14128 * Reading from this pointer when `result_ok` is set is undefined.
14130 struct LDKDecodeError *err;
14131 } LDKCResult_InvoiceRequestFieldsDecodeErrorZPtr;
14134 * A CResult_InvoiceRequestFieldsDecodeErrorZ represents the result of a fallible operation,
14135 * containing a crate::lightning::offers::invoice_request::InvoiceRequestFields on success and a crate::lightning::ln::msgs::DecodeError on failure.
14136 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
14138 typedef struct LDKCResult_InvoiceRequestFieldsDecodeErrorZ {
14140 * The contents of this CResult_InvoiceRequestFieldsDecodeErrorZ, accessible via either
14141 * `err` or `result` depending on the state of `result_ok`.
14143 union LDKCResult_InvoiceRequestFieldsDecodeErrorZPtr contents;
14145 * Whether this CResult_InvoiceRequestFieldsDecodeErrorZ represents a success state.
14148 } LDKCResult_InvoiceRequestFieldsDecodeErrorZ;
14151 * A dynamically-allocated array of crate::c_types::Witnesss of arbitrary size.
14152 * This corresponds to std::vector in C++
14154 typedef struct LDKCVec_WitnessZ {
14156 * The elements in the array.
14157 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
14159 struct LDKWitness *data;
14161 * The number of elements pointed to by `data`.
14164 } LDKCVec_WitnessZ;
14167 * An enum which can either contain a crate::c_types::ECDSASignature or not
14169 typedef enum LDKCOption_ECDSASignatureZ_Tag {
14171 * When we're in this state, this COption_ECDSASignatureZ contains a crate::c_types::ECDSASignature
14173 LDKCOption_ECDSASignatureZ_Some,
14175 * When we're in this state, this COption_ECDSASignatureZ contains nothing
14177 LDKCOption_ECDSASignatureZ_None,
14179 * Must be last for serialization purposes
14181 LDKCOption_ECDSASignatureZ_Sentinel,
14182 } LDKCOption_ECDSASignatureZ_Tag;
14184 typedef struct LDKCOption_ECDSASignatureZ {
14185 LDKCOption_ECDSASignatureZ_Tag tag;
14188 struct LDKECDSASignature some;
14191 } LDKCOption_ECDSASignatureZ;
14194 * An enum which can either contain a i64 or not
14196 typedef enum LDKCOption_i64Z_Tag {
14198 * When we're in this state, this COption_i64Z contains a i64
14200 LDKCOption_i64Z_Some,
14202 * When we're in this state, this COption_i64Z contains nothing
14204 LDKCOption_i64Z_None,
14206 * Must be last for serialization purposes
14208 LDKCOption_i64Z_Sentinel,
14209 } LDKCOption_i64Z_Tag;
14211 typedef struct LDKCOption_i64Z {
14212 LDKCOption_i64Z_Tag tag;
14221 * The contents of CResult_SocketAddressDecodeErrorZ
14223 typedef union LDKCResult_SocketAddressDecodeErrorZPtr {
14225 * A pointer to the contents in the success state.
14226 * Reading from this pointer when `result_ok` is not set is undefined.
14228 struct LDKSocketAddress *result;
14230 * A pointer to the contents in the error state.
14231 * Reading from this pointer when `result_ok` is set is undefined.
14233 struct LDKDecodeError *err;
14234 } LDKCResult_SocketAddressDecodeErrorZPtr;
14237 * A CResult_SocketAddressDecodeErrorZ represents the result of a fallible operation,
14238 * containing a crate::lightning::ln::msgs::SocketAddress on success and a crate::lightning::ln::msgs::DecodeError on failure.
14239 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
14241 typedef struct LDKCResult_SocketAddressDecodeErrorZ {
14243 * The contents of this CResult_SocketAddressDecodeErrorZ, accessible via either
14244 * `err` or `result` depending on the state of `result_ok`.
14246 union LDKCResult_SocketAddressDecodeErrorZPtr contents;
14248 * Whether this CResult_SocketAddressDecodeErrorZ represents a success state.
14251 } LDKCResult_SocketAddressDecodeErrorZ;
14254 * The contents of CResult_SocketAddressSocketAddressParseErrorZ
14256 typedef union LDKCResult_SocketAddressSocketAddressParseErrorZPtr {
14258 * A pointer to the contents in the success state.
14259 * Reading from this pointer when `result_ok` is not set is undefined.
14261 struct LDKSocketAddress *result;
14263 * A pointer to the contents in the error state.
14264 * Reading from this pointer when `result_ok` is set is undefined.
14266 enum LDKSocketAddressParseError *err;
14267 } LDKCResult_SocketAddressSocketAddressParseErrorZPtr;
14270 * A CResult_SocketAddressSocketAddressParseErrorZ represents the result of a fallible operation,
14271 * containing a crate::lightning::ln::msgs::SocketAddress on success and a crate::lightning::ln::msgs::SocketAddressParseError on failure.
14272 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
14274 typedef struct LDKCResult_SocketAddressSocketAddressParseErrorZ {
14276 * The contents of this CResult_SocketAddressSocketAddressParseErrorZ, accessible via either
14277 * `err` or `result` depending on the state of `result_ok`.
14279 union LDKCResult_SocketAddressSocketAddressParseErrorZPtr contents;
14281 * Whether this CResult_SocketAddressSocketAddressParseErrorZ represents a success state.
14284 } LDKCResult_SocketAddressSocketAddressParseErrorZ;
14289 * An [`update_add_htlc`] message to be sent to or received from a peer.
14291 * [`update_add_htlc`]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md#adding-an-htlc-update_add_htlc
14293 typedef struct MUST_USE_STRUCT LDKUpdateAddHTLC {
14295 * A pointer to the opaque Rust object.
14296 * Nearly everywhere, inner must be non-null, however in places where
14297 * the Rust equivalent takes an Option, it may be set to null to indicate None.
14299 LDKnativeUpdateAddHTLC *inner;
14301 * Indicates that this is the only struct which contains the same pointer.
14302 * Rust functions which take ownership of an object provided via an argument require
14303 * this to be true and invalidate the object pointed to by inner.
14306 } LDKUpdateAddHTLC;
14309 * A dynamically-allocated array of crate::lightning::ln::msgs::UpdateAddHTLCs of arbitrary size.
14310 * This corresponds to std::vector in C++
14312 typedef struct LDKCVec_UpdateAddHTLCZ {
14314 * The elements in the array.
14315 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
14317 struct LDKUpdateAddHTLC *data;
14319 * The number of elements pointed to by `data`.
14322 } LDKCVec_UpdateAddHTLCZ;
14327 * An [`update_fulfill_htlc`] message to be sent to or received from a peer.
14329 * [`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
14331 typedef struct MUST_USE_STRUCT LDKUpdateFulfillHTLC {
14333 * A pointer to the opaque Rust object.
14334 * Nearly everywhere, inner must be non-null, however in places where
14335 * the Rust equivalent takes an Option, it may be set to null to indicate None.
14337 LDKnativeUpdateFulfillHTLC *inner;
14339 * Indicates that this is the only struct which contains the same pointer.
14340 * Rust functions which take ownership of an object provided via an argument require
14341 * this to be true and invalidate the object pointed to by inner.
14344 } LDKUpdateFulfillHTLC;
14347 * A dynamically-allocated array of crate::lightning::ln::msgs::UpdateFulfillHTLCs of arbitrary size.
14348 * This corresponds to std::vector in C++
14350 typedef struct LDKCVec_UpdateFulfillHTLCZ {
14352 * The elements in the array.
14353 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
14355 struct LDKUpdateFulfillHTLC *data;
14357 * The number of elements pointed to by `data`.
14360 } LDKCVec_UpdateFulfillHTLCZ;
14365 * An [`update_fail_htlc`] message to be sent to or received from a peer.
14367 * [`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
14369 typedef struct MUST_USE_STRUCT LDKUpdateFailHTLC {
14371 * A pointer to the opaque Rust object.
14372 * Nearly everywhere, inner must be non-null, however in places where
14373 * the Rust equivalent takes an Option, it may be set to null to indicate None.
14375 LDKnativeUpdateFailHTLC *inner;
14377 * Indicates that this is the only struct which contains the same pointer.
14378 * Rust functions which take ownership of an object provided via an argument require
14379 * this to be true and invalidate the object pointed to by inner.
14382 } LDKUpdateFailHTLC;
14385 * A dynamically-allocated array of crate::lightning::ln::msgs::UpdateFailHTLCs of arbitrary size.
14386 * This corresponds to std::vector in C++
14388 typedef struct LDKCVec_UpdateFailHTLCZ {
14390 * The elements in the array.
14391 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
14393 struct LDKUpdateFailHTLC *data;
14395 * The number of elements pointed to by `data`.
14398 } LDKCVec_UpdateFailHTLCZ;
14403 * An [`update_fail_malformed_htlc`] message to be sent to or received from a peer.
14405 * [`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
14407 typedef struct MUST_USE_STRUCT LDKUpdateFailMalformedHTLC {
14409 * A pointer to the opaque Rust object.
14410 * Nearly everywhere, inner must be non-null, however in places where
14411 * the Rust equivalent takes an Option, it may be set to null to indicate None.
14413 LDKnativeUpdateFailMalformedHTLC *inner;
14415 * Indicates that this is the only struct which contains the same pointer.
14416 * Rust functions which take ownership of an object provided via an argument require
14417 * this to be true and invalidate the object pointed to by inner.
14420 } LDKUpdateFailMalformedHTLC;
14423 * A dynamically-allocated array of crate::lightning::ln::msgs::UpdateFailMalformedHTLCs of arbitrary size.
14424 * This corresponds to std::vector in C++
14426 typedef struct LDKCVec_UpdateFailMalformedHTLCZ {
14428 * The elements in the array.
14429 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
14431 struct LDKUpdateFailMalformedHTLC *data;
14433 * The number of elements pointed to by `data`.
14436 } LDKCVec_UpdateFailMalformedHTLCZ;
14439 * The contents of CResult_AcceptChannelDecodeErrorZ
14441 typedef union LDKCResult_AcceptChannelDecodeErrorZPtr {
14443 * A pointer to the contents in the success state.
14444 * Reading from this pointer when `result_ok` is not set is undefined.
14446 struct LDKAcceptChannel *result;
14448 * A pointer to the contents in the error state.
14449 * Reading from this pointer when `result_ok` is set is undefined.
14451 struct LDKDecodeError *err;
14452 } LDKCResult_AcceptChannelDecodeErrorZPtr;
14455 * A CResult_AcceptChannelDecodeErrorZ represents the result of a fallible operation,
14456 * containing a crate::lightning::ln::msgs::AcceptChannel on success and a crate::lightning::ln::msgs::DecodeError on failure.
14457 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
14459 typedef struct LDKCResult_AcceptChannelDecodeErrorZ {
14461 * The contents of this CResult_AcceptChannelDecodeErrorZ, accessible via either
14462 * `err` or `result` depending on the state of `result_ok`.
14464 union LDKCResult_AcceptChannelDecodeErrorZPtr contents;
14466 * Whether this CResult_AcceptChannelDecodeErrorZ represents a success state.
14469 } LDKCResult_AcceptChannelDecodeErrorZ;
14472 * The contents of CResult_AcceptChannelV2DecodeErrorZ
14474 typedef union LDKCResult_AcceptChannelV2DecodeErrorZPtr {
14476 * A pointer to the contents in the success state.
14477 * Reading from this pointer when `result_ok` is not set is undefined.
14479 struct LDKAcceptChannelV2 *result;
14481 * A pointer to the contents in the error state.
14482 * Reading from this pointer when `result_ok` is set is undefined.
14484 struct LDKDecodeError *err;
14485 } LDKCResult_AcceptChannelV2DecodeErrorZPtr;
14488 * A CResult_AcceptChannelV2DecodeErrorZ represents the result of a fallible operation,
14489 * containing a crate::lightning::ln::msgs::AcceptChannelV2 on success and a crate::lightning::ln::msgs::DecodeError on failure.
14490 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
14492 typedef struct LDKCResult_AcceptChannelV2DecodeErrorZ {
14494 * The contents of this CResult_AcceptChannelV2DecodeErrorZ, accessible via either
14495 * `err` or `result` depending on the state of `result_ok`.
14497 union LDKCResult_AcceptChannelV2DecodeErrorZPtr contents;
14499 * Whether this CResult_AcceptChannelV2DecodeErrorZ represents a success state.
14502 } LDKCResult_AcceptChannelV2DecodeErrorZ;
14505 * The contents of CResult_StfuDecodeErrorZ
14507 typedef union LDKCResult_StfuDecodeErrorZPtr {
14509 * A pointer to the contents in the success state.
14510 * Reading from this pointer when `result_ok` is not set is undefined.
14512 struct LDKStfu *result;
14514 * A pointer to the contents in the error state.
14515 * Reading from this pointer when `result_ok` is set is undefined.
14517 struct LDKDecodeError *err;
14518 } LDKCResult_StfuDecodeErrorZPtr;
14521 * A CResult_StfuDecodeErrorZ represents the result of a fallible operation,
14522 * containing a crate::lightning::ln::msgs::Stfu on success and a crate::lightning::ln::msgs::DecodeError on failure.
14523 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
14525 typedef struct LDKCResult_StfuDecodeErrorZ {
14527 * The contents of this CResult_StfuDecodeErrorZ, accessible via either
14528 * `err` or `result` depending on the state of `result_ok`.
14530 union LDKCResult_StfuDecodeErrorZPtr contents;
14532 * Whether this CResult_StfuDecodeErrorZ represents a success state.
14535 } LDKCResult_StfuDecodeErrorZ;
14538 * The contents of CResult_SpliceDecodeErrorZ
14540 typedef union LDKCResult_SpliceDecodeErrorZPtr {
14542 * A pointer to the contents in the success state.
14543 * Reading from this pointer when `result_ok` is not set is undefined.
14545 struct LDKSplice *result;
14547 * A pointer to the contents in the error state.
14548 * Reading from this pointer when `result_ok` is set is undefined.
14550 struct LDKDecodeError *err;
14551 } LDKCResult_SpliceDecodeErrorZPtr;
14554 * A CResult_SpliceDecodeErrorZ represents the result of a fallible operation,
14555 * containing a crate::lightning::ln::msgs::Splice on success and a crate::lightning::ln::msgs::DecodeError on failure.
14556 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
14558 typedef struct LDKCResult_SpliceDecodeErrorZ {
14560 * The contents of this CResult_SpliceDecodeErrorZ, accessible via either
14561 * `err` or `result` depending on the state of `result_ok`.
14563 union LDKCResult_SpliceDecodeErrorZPtr contents;
14565 * Whether this CResult_SpliceDecodeErrorZ represents a success state.
14568 } LDKCResult_SpliceDecodeErrorZ;
14571 * The contents of CResult_SpliceAckDecodeErrorZ
14573 typedef union LDKCResult_SpliceAckDecodeErrorZPtr {
14575 * A pointer to the contents in the success state.
14576 * Reading from this pointer when `result_ok` is not set is undefined.
14578 struct LDKSpliceAck *result;
14580 * A pointer to the contents in the error state.
14581 * Reading from this pointer when `result_ok` is set is undefined.
14583 struct LDKDecodeError *err;
14584 } LDKCResult_SpliceAckDecodeErrorZPtr;
14587 * A CResult_SpliceAckDecodeErrorZ represents the result of a fallible operation,
14588 * containing a crate::lightning::ln::msgs::SpliceAck on success and a crate::lightning::ln::msgs::DecodeError on failure.
14589 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
14591 typedef struct LDKCResult_SpliceAckDecodeErrorZ {
14593 * The contents of this CResult_SpliceAckDecodeErrorZ, accessible via either
14594 * `err` or `result` depending on the state of `result_ok`.
14596 union LDKCResult_SpliceAckDecodeErrorZPtr contents;
14598 * Whether this CResult_SpliceAckDecodeErrorZ represents a success state.
14601 } LDKCResult_SpliceAckDecodeErrorZ;
14604 * The contents of CResult_SpliceLockedDecodeErrorZ
14606 typedef union LDKCResult_SpliceLockedDecodeErrorZPtr {
14608 * A pointer to the contents in the success state.
14609 * Reading from this pointer when `result_ok` is not set is undefined.
14611 struct LDKSpliceLocked *result;
14613 * A pointer to the contents in the error state.
14614 * Reading from this pointer when `result_ok` is set is undefined.
14616 struct LDKDecodeError *err;
14617 } LDKCResult_SpliceLockedDecodeErrorZPtr;
14620 * A CResult_SpliceLockedDecodeErrorZ represents the result of a fallible operation,
14621 * containing a crate::lightning::ln::msgs::SpliceLocked on success and a crate::lightning::ln::msgs::DecodeError on failure.
14622 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
14624 typedef struct LDKCResult_SpliceLockedDecodeErrorZ {
14626 * The contents of this CResult_SpliceLockedDecodeErrorZ, accessible via either
14627 * `err` or `result` depending on the state of `result_ok`.
14629 union LDKCResult_SpliceLockedDecodeErrorZPtr contents;
14631 * Whether this CResult_SpliceLockedDecodeErrorZ represents a success state.
14634 } LDKCResult_SpliceLockedDecodeErrorZ;
14637 * The contents of CResult_TxAddInputDecodeErrorZ
14639 typedef union LDKCResult_TxAddInputDecodeErrorZPtr {
14641 * A pointer to the contents in the success state.
14642 * Reading from this pointer when `result_ok` is not set is undefined.
14644 struct LDKTxAddInput *result;
14646 * A pointer to the contents in the error state.
14647 * Reading from this pointer when `result_ok` is set is undefined.
14649 struct LDKDecodeError *err;
14650 } LDKCResult_TxAddInputDecodeErrorZPtr;
14653 * A CResult_TxAddInputDecodeErrorZ represents the result of a fallible operation,
14654 * containing a crate::lightning::ln::msgs::TxAddInput on success and a crate::lightning::ln::msgs::DecodeError on failure.
14655 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
14657 typedef struct LDKCResult_TxAddInputDecodeErrorZ {
14659 * The contents of this CResult_TxAddInputDecodeErrorZ, accessible via either
14660 * `err` or `result` depending on the state of `result_ok`.
14662 union LDKCResult_TxAddInputDecodeErrorZPtr contents;
14664 * Whether this CResult_TxAddInputDecodeErrorZ represents a success state.
14667 } LDKCResult_TxAddInputDecodeErrorZ;
14670 * The contents of CResult_TxAddOutputDecodeErrorZ
14672 typedef union LDKCResult_TxAddOutputDecodeErrorZPtr {
14674 * A pointer to the contents in the success state.
14675 * Reading from this pointer when `result_ok` is not set is undefined.
14677 struct LDKTxAddOutput *result;
14679 * A pointer to the contents in the error state.
14680 * Reading from this pointer when `result_ok` is set is undefined.
14682 struct LDKDecodeError *err;
14683 } LDKCResult_TxAddOutputDecodeErrorZPtr;
14686 * A CResult_TxAddOutputDecodeErrorZ represents the result of a fallible operation,
14687 * containing a crate::lightning::ln::msgs::TxAddOutput on success and a crate::lightning::ln::msgs::DecodeError on failure.
14688 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
14690 typedef struct LDKCResult_TxAddOutputDecodeErrorZ {
14692 * The contents of this CResult_TxAddOutputDecodeErrorZ, accessible via either
14693 * `err` or `result` depending on the state of `result_ok`.
14695 union LDKCResult_TxAddOutputDecodeErrorZPtr contents;
14697 * Whether this CResult_TxAddOutputDecodeErrorZ represents a success state.
14700 } LDKCResult_TxAddOutputDecodeErrorZ;
14703 * The contents of CResult_TxRemoveInputDecodeErrorZ
14705 typedef union LDKCResult_TxRemoveInputDecodeErrorZPtr {
14707 * A pointer to the contents in the success state.
14708 * Reading from this pointer when `result_ok` is not set is undefined.
14710 struct LDKTxRemoveInput *result;
14712 * A pointer to the contents in the error state.
14713 * Reading from this pointer when `result_ok` is set is undefined.
14715 struct LDKDecodeError *err;
14716 } LDKCResult_TxRemoveInputDecodeErrorZPtr;
14719 * A CResult_TxRemoveInputDecodeErrorZ represents the result of a fallible operation,
14720 * containing a crate::lightning::ln::msgs::TxRemoveInput on success and a crate::lightning::ln::msgs::DecodeError on failure.
14721 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
14723 typedef struct LDKCResult_TxRemoveInputDecodeErrorZ {
14725 * The contents of this CResult_TxRemoveInputDecodeErrorZ, accessible via either
14726 * `err` or `result` depending on the state of `result_ok`.
14728 union LDKCResult_TxRemoveInputDecodeErrorZPtr contents;
14730 * Whether this CResult_TxRemoveInputDecodeErrorZ represents a success state.
14733 } LDKCResult_TxRemoveInputDecodeErrorZ;
14736 * The contents of CResult_TxRemoveOutputDecodeErrorZ
14738 typedef union LDKCResult_TxRemoveOutputDecodeErrorZPtr {
14740 * A pointer to the contents in the success state.
14741 * Reading from this pointer when `result_ok` is not set is undefined.
14743 struct LDKTxRemoveOutput *result;
14745 * A pointer to the contents in the error state.
14746 * Reading from this pointer when `result_ok` is set is undefined.
14748 struct LDKDecodeError *err;
14749 } LDKCResult_TxRemoveOutputDecodeErrorZPtr;
14752 * A CResult_TxRemoveOutputDecodeErrorZ represents the result of a fallible operation,
14753 * containing a crate::lightning::ln::msgs::TxRemoveOutput on success and a crate::lightning::ln::msgs::DecodeError on failure.
14754 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
14756 typedef struct LDKCResult_TxRemoveOutputDecodeErrorZ {
14758 * The contents of this CResult_TxRemoveOutputDecodeErrorZ, accessible via either
14759 * `err` or `result` depending on the state of `result_ok`.
14761 union LDKCResult_TxRemoveOutputDecodeErrorZPtr contents;
14763 * Whether this CResult_TxRemoveOutputDecodeErrorZ represents a success state.
14766 } LDKCResult_TxRemoveOutputDecodeErrorZ;
14769 * The contents of CResult_TxCompleteDecodeErrorZ
14771 typedef union LDKCResult_TxCompleteDecodeErrorZPtr {
14773 * A pointer to the contents in the success state.
14774 * Reading from this pointer when `result_ok` is not set is undefined.
14776 struct LDKTxComplete *result;
14778 * A pointer to the contents in the error state.
14779 * Reading from this pointer when `result_ok` is set is undefined.
14781 struct LDKDecodeError *err;
14782 } LDKCResult_TxCompleteDecodeErrorZPtr;
14785 * A CResult_TxCompleteDecodeErrorZ represents the result of a fallible operation,
14786 * containing a crate::lightning::ln::msgs::TxComplete on success and a crate::lightning::ln::msgs::DecodeError on failure.
14787 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
14789 typedef struct LDKCResult_TxCompleteDecodeErrorZ {
14791 * The contents of this CResult_TxCompleteDecodeErrorZ, accessible via either
14792 * `err` or `result` depending on the state of `result_ok`.
14794 union LDKCResult_TxCompleteDecodeErrorZPtr contents;
14796 * Whether this CResult_TxCompleteDecodeErrorZ represents a success state.
14799 } LDKCResult_TxCompleteDecodeErrorZ;
14802 * The contents of CResult_TxSignaturesDecodeErrorZ
14804 typedef union LDKCResult_TxSignaturesDecodeErrorZPtr {
14806 * A pointer to the contents in the success state.
14807 * Reading from this pointer when `result_ok` is not set is undefined.
14809 struct LDKTxSignatures *result;
14811 * A pointer to the contents in the error state.
14812 * Reading from this pointer when `result_ok` is set is undefined.
14814 struct LDKDecodeError *err;
14815 } LDKCResult_TxSignaturesDecodeErrorZPtr;
14818 * A CResult_TxSignaturesDecodeErrorZ represents the result of a fallible operation,
14819 * containing a crate::lightning::ln::msgs::TxSignatures on success and a crate::lightning::ln::msgs::DecodeError on failure.
14820 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
14822 typedef struct LDKCResult_TxSignaturesDecodeErrorZ {
14824 * The contents of this CResult_TxSignaturesDecodeErrorZ, accessible via either
14825 * `err` or `result` depending on the state of `result_ok`.
14827 union LDKCResult_TxSignaturesDecodeErrorZPtr contents;
14829 * Whether this CResult_TxSignaturesDecodeErrorZ represents a success state.
14832 } LDKCResult_TxSignaturesDecodeErrorZ;
14835 * The contents of CResult_TxInitRbfDecodeErrorZ
14837 typedef union LDKCResult_TxInitRbfDecodeErrorZPtr {
14839 * A pointer to the contents in the success state.
14840 * Reading from this pointer when `result_ok` is not set is undefined.
14842 struct LDKTxInitRbf *result;
14844 * A pointer to the contents in the error state.
14845 * Reading from this pointer when `result_ok` is set is undefined.
14847 struct LDKDecodeError *err;
14848 } LDKCResult_TxInitRbfDecodeErrorZPtr;
14851 * A CResult_TxInitRbfDecodeErrorZ represents the result of a fallible operation,
14852 * containing a crate::lightning::ln::msgs::TxInitRbf on success and a crate::lightning::ln::msgs::DecodeError on failure.
14853 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
14855 typedef struct LDKCResult_TxInitRbfDecodeErrorZ {
14857 * The contents of this CResult_TxInitRbfDecodeErrorZ, accessible via either
14858 * `err` or `result` depending on the state of `result_ok`.
14860 union LDKCResult_TxInitRbfDecodeErrorZPtr contents;
14862 * Whether this CResult_TxInitRbfDecodeErrorZ represents a success state.
14865 } LDKCResult_TxInitRbfDecodeErrorZ;
14868 * The contents of CResult_TxAckRbfDecodeErrorZ
14870 typedef union LDKCResult_TxAckRbfDecodeErrorZPtr {
14872 * A pointer to the contents in the success state.
14873 * Reading from this pointer when `result_ok` is not set is undefined.
14875 struct LDKTxAckRbf *result;
14877 * A pointer to the contents in the error state.
14878 * Reading from this pointer when `result_ok` is set is undefined.
14880 struct LDKDecodeError *err;
14881 } LDKCResult_TxAckRbfDecodeErrorZPtr;
14884 * A CResult_TxAckRbfDecodeErrorZ represents the result of a fallible operation,
14885 * containing a crate::lightning::ln::msgs::TxAckRbf on success and a crate::lightning::ln::msgs::DecodeError on failure.
14886 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
14888 typedef struct LDKCResult_TxAckRbfDecodeErrorZ {
14890 * The contents of this CResult_TxAckRbfDecodeErrorZ, accessible via either
14891 * `err` or `result` depending on the state of `result_ok`.
14893 union LDKCResult_TxAckRbfDecodeErrorZPtr contents;
14895 * Whether this CResult_TxAckRbfDecodeErrorZ represents a success state.
14898 } LDKCResult_TxAckRbfDecodeErrorZ;
14901 * The contents of CResult_TxAbortDecodeErrorZ
14903 typedef union LDKCResult_TxAbortDecodeErrorZPtr {
14905 * A pointer to the contents in the success state.
14906 * Reading from this pointer when `result_ok` is not set is undefined.
14908 struct LDKTxAbort *result;
14910 * A pointer to the contents in the error state.
14911 * Reading from this pointer when `result_ok` is set is undefined.
14913 struct LDKDecodeError *err;
14914 } LDKCResult_TxAbortDecodeErrorZPtr;
14917 * A CResult_TxAbortDecodeErrorZ represents the result of a fallible operation,
14918 * containing a crate::lightning::ln::msgs::TxAbort on success and a crate::lightning::ln::msgs::DecodeError on failure.
14919 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
14921 typedef struct LDKCResult_TxAbortDecodeErrorZ {
14923 * The contents of this CResult_TxAbortDecodeErrorZ, accessible via either
14924 * `err` or `result` depending on the state of `result_ok`.
14926 union LDKCResult_TxAbortDecodeErrorZPtr contents;
14928 * Whether this CResult_TxAbortDecodeErrorZ represents a success state.
14931 } LDKCResult_TxAbortDecodeErrorZ;
14934 * The contents of CResult_AnnouncementSignaturesDecodeErrorZ
14936 typedef union LDKCResult_AnnouncementSignaturesDecodeErrorZPtr {
14938 * A pointer to the contents in the success state.
14939 * Reading from this pointer when `result_ok` is not set is undefined.
14941 struct LDKAnnouncementSignatures *result;
14943 * A pointer to the contents in the error state.
14944 * Reading from this pointer when `result_ok` is set is undefined.
14946 struct LDKDecodeError *err;
14947 } LDKCResult_AnnouncementSignaturesDecodeErrorZPtr;
14950 * A CResult_AnnouncementSignaturesDecodeErrorZ represents the result of a fallible operation,
14951 * containing a crate::lightning::ln::msgs::AnnouncementSignatures on success and a crate::lightning::ln::msgs::DecodeError on failure.
14952 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
14954 typedef struct LDKCResult_AnnouncementSignaturesDecodeErrorZ {
14956 * The contents of this CResult_AnnouncementSignaturesDecodeErrorZ, accessible via either
14957 * `err` or `result` depending on the state of `result_ok`.
14959 union LDKCResult_AnnouncementSignaturesDecodeErrorZPtr contents;
14961 * Whether this CResult_AnnouncementSignaturesDecodeErrorZ represents a success state.
14964 } LDKCResult_AnnouncementSignaturesDecodeErrorZ;
14967 * The contents of CResult_ChannelReestablishDecodeErrorZ
14969 typedef union LDKCResult_ChannelReestablishDecodeErrorZPtr {
14971 * A pointer to the contents in the success state.
14972 * Reading from this pointer when `result_ok` is not set is undefined.
14974 struct LDKChannelReestablish *result;
14976 * A pointer to the contents in the error state.
14977 * Reading from this pointer when `result_ok` is set is undefined.
14979 struct LDKDecodeError *err;
14980 } LDKCResult_ChannelReestablishDecodeErrorZPtr;
14983 * A CResult_ChannelReestablishDecodeErrorZ represents the result of a fallible operation,
14984 * containing a crate::lightning::ln::msgs::ChannelReestablish on success and a crate::lightning::ln::msgs::DecodeError on failure.
14985 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
14987 typedef struct LDKCResult_ChannelReestablishDecodeErrorZ {
14989 * The contents of this CResult_ChannelReestablishDecodeErrorZ, accessible via either
14990 * `err` or `result` depending on the state of `result_ok`.
14992 union LDKCResult_ChannelReestablishDecodeErrorZPtr contents;
14994 * Whether this CResult_ChannelReestablishDecodeErrorZ represents a success state.
14997 } LDKCResult_ChannelReestablishDecodeErrorZ;
15000 * The contents of CResult_ClosingSignedDecodeErrorZ
15002 typedef union LDKCResult_ClosingSignedDecodeErrorZPtr {
15004 * A pointer to the contents in the success state.
15005 * Reading from this pointer when `result_ok` is not set is undefined.
15007 struct LDKClosingSigned *result;
15009 * A pointer to the contents in the error state.
15010 * Reading from this pointer when `result_ok` is set is undefined.
15012 struct LDKDecodeError *err;
15013 } LDKCResult_ClosingSignedDecodeErrorZPtr;
15016 * A CResult_ClosingSignedDecodeErrorZ represents the result of a fallible operation,
15017 * containing a crate::lightning::ln::msgs::ClosingSigned on success and a crate::lightning::ln::msgs::DecodeError on failure.
15018 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
15020 typedef struct LDKCResult_ClosingSignedDecodeErrorZ {
15022 * The contents of this CResult_ClosingSignedDecodeErrorZ, accessible via either
15023 * `err` or `result` depending on the state of `result_ok`.
15025 union LDKCResult_ClosingSignedDecodeErrorZPtr contents;
15027 * Whether this CResult_ClosingSignedDecodeErrorZ represents a success state.
15030 } LDKCResult_ClosingSignedDecodeErrorZ;
15035 * The minimum and maximum fees which the sender is willing to place on the closing transaction.
15037 * This is provided in [`ClosingSigned`] by both sides to indicate the fee range they are willing
15040 typedef struct MUST_USE_STRUCT LDKClosingSignedFeeRange {
15042 * A pointer to the opaque Rust object.
15043 * Nearly everywhere, inner must be non-null, however in places where
15044 * the Rust equivalent takes an Option, it may be set to null to indicate None.
15046 LDKnativeClosingSignedFeeRange *inner;
15048 * Indicates that this is the only struct which contains the same pointer.
15049 * Rust functions which take ownership of an object provided via an argument require
15050 * this to be true and invalidate the object pointed to by inner.
15053 } LDKClosingSignedFeeRange;
15056 * The contents of CResult_ClosingSignedFeeRangeDecodeErrorZ
15058 typedef union LDKCResult_ClosingSignedFeeRangeDecodeErrorZPtr {
15060 * A pointer to the contents in the success state.
15061 * Reading from this pointer when `result_ok` is not set is undefined.
15063 struct LDKClosingSignedFeeRange *result;
15065 * A pointer to the contents in the error state.
15066 * Reading from this pointer when `result_ok` is set is undefined.
15068 struct LDKDecodeError *err;
15069 } LDKCResult_ClosingSignedFeeRangeDecodeErrorZPtr;
15072 * A CResult_ClosingSignedFeeRangeDecodeErrorZ represents the result of a fallible operation,
15073 * containing a crate::lightning::ln::msgs::ClosingSignedFeeRange on success and a crate::lightning::ln::msgs::DecodeError on failure.
15074 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
15076 typedef struct LDKCResult_ClosingSignedFeeRangeDecodeErrorZ {
15078 * The contents of this CResult_ClosingSignedFeeRangeDecodeErrorZ, accessible via either
15079 * `err` or `result` depending on the state of `result_ok`.
15081 union LDKCResult_ClosingSignedFeeRangeDecodeErrorZPtr contents;
15083 * Whether this CResult_ClosingSignedFeeRangeDecodeErrorZ represents a success state.
15086 } LDKCResult_ClosingSignedFeeRangeDecodeErrorZ;
15091 * A [`commitment_signed`] message to be sent to or received from a peer.
15093 * [`commitment_signed`]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md#committing-updates-so-far-commitment_signed
15095 typedef struct MUST_USE_STRUCT LDKCommitmentSigned {
15097 * A pointer to the opaque Rust object.
15098 * Nearly everywhere, inner must be non-null, however in places where
15099 * the Rust equivalent takes an Option, it may be set to null to indicate None.
15101 LDKnativeCommitmentSigned *inner;
15103 * Indicates that this is the only struct which contains the same pointer.
15104 * Rust functions which take ownership of an object provided via an argument require
15105 * this to be true and invalidate the object pointed to by inner.
15108 } LDKCommitmentSigned;
15111 * The contents of CResult_CommitmentSignedDecodeErrorZ
15113 typedef union LDKCResult_CommitmentSignedDecodeErrorZPtr {
15115 * A pointer to the contents in the success state.
15116 * Reading from this pointer when `result_ok` is not set is undefined.
15118 struct LDKCommitmentSigned *result;
15120 * A pointer to the contents in the error state.
15121 * Reading from this pointer when `result_ok` is set is undefined.
15123 struct LDKDecodeError *err;
15124 } LDKCResult_CommitmentSignedDecodeErrorZPtr;
15127 * A CResult_CommitmentSignedDecodeErrorZ represents the result of a fallible operation,
15128 * containing a crate::lightning::ln::msgs::CommitmentSigned on success and a crate::lightning::ln::msgs::DecodeError on failure.
15129 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
15131 typedef struct LDKCResult_CommitmentSignedDecodeErrorZ {
15133 * The contents of this CResult_CommitmentSignedDecodeErrorZ, accessible via either
15134 * `err` or `result` depending on the state of `result_ok`.
15136 union LDKCResult_CommitmentSignedDecodeErrorZPtr contents;
15138 * Whether this CResult_CommitmentSignedDecodeErrorZ represents a success state.
15141 } LDKCResult_CommitmentSignedDecodeErrorZ;
15144 * The contents of CResult_FundingCreatedDecodeErrorZ
15146 typedef union LDKCResult_FundingCreatedDecodeErrorZPtr {
15148 * A pointer to the contents in the success state.
15149 * Reading from this pointer when `result_ok` is not set is undefined.
15151 struct LDKFundingCreated *result;
15153 * A pointer to the contents in the error state.
15154 * Reading from this pointer when `result_ok` is set is undefined.
15156 struct LDKDecodeError *err;
15157 } LDKCResult_FundingCreatedDecodeErrorZPtr;
15160 * A CResult_FundingCreatedDecodeErrorZ represents the result of a fallible operation,
15161 * containing a crate::lightning::ln::msgs::FundingCreated on success and a crate::lightning::ln::msgs::DecodeError on failure.
15162 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
15164 typedef struct LDKCResult_FundingCreatedDecodeErrorZ {
15166 * The contents of this CResult_FundingCreatedDecodeErrorZ, accessible via either
15167 * `err` or `result` depending on the state of `result_ok`.
15169 union LDKCResult_FundingCreatedDecodeErrorZPtr contents;
15171 * Whether this CResult_FundingCreatedDecodeErrorZ represents a success state.
15174 } LDKCResult_FundingCreatedDecodeErrorZ;
15177 * The contents of CResult_FundingSignedDecodeErrorZ
15179 typedef union LDKCResult_FundingSignedDecodeErrorZPtr {
15181 * A pointer to the contents in the success state.
15182 * Reading from this pointer when `result_ok` is not set is undefined.
15184 struct LDKFundingSigned *result;
15186 * A pointer to the contents in the error state.
15187 * Reading from this pointer when `result_ok` is set is undefined.
15189 struct LDKDecodeError *err;
15190 } LDKCResult_FundingSignedDecodeErrorZPtr;
15193 * A CResult_FundingSignedDecodeErrorZ represents the result of a fallible operation,
15194 * containing a crate::lightning::ln::msgs::FundingSigned on success and a crate::lightning::ln::msgs::DecodeError on failure.
15195 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
15197 typedef struct LDKCResult_FundingSignedDecodeErrorZ {
15199 * The contents of this CResult_FundingSignedDecodeErrorZ, accessible via either
15200 * `err` or `result` depending on the state of `result_ok`.
15202 union LDKCResult_FundingSignedDecodeErrorZPtr contents;
15204 * Whether this CResult_FundingSignedDecodeErrorZ represents a success state.
15207 } LDKCResult_FundingSignedDecodeErrorZ;
15210 * The contents of CResult_ChannelReadyDecodeErrorZ
15212 typedef union LDKCResult_ChannelReadyDecodeErrorZPtr {
15214 * A pointer to the contents in the success state.
15215 * Reading from this pointer when `result_ok` is not set is undefined.
15217 struct LDKChannelReady *result;
15219 * A pointer to the contents in the error state.
15220 * Reading from this pointer when `result_ok` is set is undefined.
15222 struct LDKDecodeError *err;
15223 } LDKCResult_ChannelReadyDecodeErrorZPtr;
15226 * A CResult_ChannelReadyDecodeErrorZ represents the result of a fallible operation,
15227 * containing a crate::lightning::ln::msgs::ChannelReady on success and a crate::lightning::ln::msgs::DecodeError on failure.
15228 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
15230 typedef struct LDKCResult_ChannelReadyDecodeErrorZ {
15232 * The contents of this CResult_ChannelReadyDecodeErrorZ, accessible via either
15233 * `err` or `result` depending on the state of `result_ok`.
15235 union LDKCResult_ChannelReadyDecodeErrorZPtr contents;
15237 * Whether this CResult_ChannelReadyDecodeErrorZ represents a success state.
15240 } LDKCResult_ChannelReadyDecodeErrorZ;
15245 * An [`init`] message to be sent to or received from a peer.
15247 * [`init`]: https://github.com/lightning/bolts/blob/master/01-messaging.md#the-init-message
15249 typedef struct MUST_USE_STRUCT LDKInit {
15251 * A pointer to the opaque Rust object.
15252 * Nearly everywhere, inner must be non-null, however in places where
15253 * the Rust equivalent takes an Option, it may be set to null to indicate None.
15255 LDKnativeInit *inner;
15257 * Indicates that this is the only struct which contains the same pointer.
15258 * Rust functions which take ownership of an object provided via an argument require
15259 * this to be true and invalidate the object pointed to by inner.
15265 * The contents of CResult_InitDecodeErrorZ
15267 typedef union LDKCResult_InitDecodeErrorZPtr {
15269 * A pointer to the contents in the success state.
15270 * Reading from this pointer when `result_ok` is not set is undefined.
15272 struct LDKInit *result;
15274 * A pointer to the contents in the error state.
15275 * Reading from this pointer when `result_ok` is set is undefined.
15277 struct LDKDecodeError *err;
15278 } LDKCResult_InitDecodeErrorZPtr;
15281 * A CResult_InitDecodeErrorZ represents the result of a fallible operation,
15282 * containing a crate::lightning::ln::msgs::Init on success and a crate::lightning::ln::msgs::DecodeError on failure.
15283 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
15285 typedef struct LDKCResult_InitDecodeErrorZ {
15287 * The contents of this CResult_InitDecodeErrorZ, accessible via either
15288 * `err` or `result` depending on the state of `result_ok`.
15290 union LDKCResult_InitDecodeErrorZPtr contents;
15292 * Whether this CResult_InitDecodeErrorZ represents a success state.
15295 } LDKCResult_InitDecodeErrorZ;
15298 * The contents of CResult_OpenChannelDecodeErrorZ
15300 typedef union LDKCResult_OpenChannelDecodeErrorZPtr {
15302 * A pointer to the contents in the success state.
15303 * Reading from this pointer when `result_ok` is not set is undefined.
15305 struct LDKOpenChannel *result;
15307 * A pointer to the contents in the error state.
15308 * Reading from this pointer when `result_ok` is set is undefined.
15310 struct LDKDecodeError *err;
15311 } LDKCResult_OpenChannelDecodeErrorZPtr;
15314 * A CResult_OpenChannelDecodeErrorZ represents the result of a fallible operation,
15315 * containing a crate::lightning::ln::msgs::OpenChannel on success and a crate::lightning::ln::msgs::DecodeError on failure.
15316 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
15318 typedef struct LDKCResult_OpenChannelDecodeErrorZ {
15320 * The contents of this CResult_OpenChannelDecodeErrorZ, accessible via either
15321 * `err` or `result` depending on the state of `result_ok`.
15323 union LDKCResult_OpenChannelDecodeErrorZPtr contents;
15325 * Whether this CResult_OpenChannelDecodeErrorZ represents a success state.
15328 } LDKCResult_OpenChannelDecodeErrorZ;
15331 * The contents of CResult_OpenChannelV2DecodeErrorZ
15333 typedef union LDKCResult_OpenChannelV2DecodeErrorZPtr {
15335 * A pointer to the contents in the success state.
15336 * Reading from this pointer when `result_ok` is not set is undefined.
15338 struct LDKOpenChannelV2 *result;
15340 * A pointer to the contents in the error state.
15341 * Reading from this pointer when `result_ok` is set is undefined.
15343 struct LDKDecodeError *err;
15344 } LDKCResult_OpenChannelV2DecodeErrorZPtr;
15347 * A CResult_OpenChannelV2DecodeErrorZ represents the result of a fallible operation,
15348 * containing a crate::lightning::ln::msgs::OpenChannelV2 on success and a crate::lightning::ln::msgs::DecodeError on failure.
15349 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
15351 typedef struct LDKCResult_OpenChannelV2DecodeErrorZ {
15353 * The contents of this CResult_OpenChannelV2DecodeErrorZ, accessible via either
15354 * `err` or `result` depending on the state of `result_ok`.
15356 union LDKCResult_OpenChannelV2DecodeErrorZPtr contents;
15358 * Whether this CResult_OpenChannelV2DecodeErrorZ represents a success state.
15361 } LDKCResult_OpenChannelV2DecodeErrorZ;
15364 * The contents of CResult_RevokeAndACKDecodeErrorZ
15366 typedef union LDKCResult_RevokeAndACKDecodeErrorZPtr {
15368 * A pointer to the contents in the success state.
15369 * Reading from this pointer when `result_ok` is not set is undefined.
15371 struct LDKRevokeAndACK *result;
15373 * A pointer to the contents in the error state.
15374 * Reading from this pointer when `result_ok` is set is undefined.
15376 struct LDKDecodeError *err;
15377 } LDKCResult_RevokeAndACKDecodeErrorZPtr;
15380 * A CResult_RevokeAndACKDecodeErrorZ represents the result of a fallible operation,
15381 * containing a crate::lightning::ln::msgs::RevokeAndACK on success and a crate::lightning::ln::msgs::DecodeError on failure.
15382 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
15384 typedef struct LDKCResult_RevokeAndACKDecodeErrorZ {
15386 * The contents of this CResult_RevokeAndACKDecodeErrorZ, accessible via either
15387 * `err` or `result` depending on the state of `result_ok`.
15389 union LDKCResult_RevokeAndACKDecodeErrorZPtr contents;
15391 * Whether this CResult_RevokeAndACKDecodeErrorZ represents a success state.
15394 } LDKCResult_RevokeAndACKDecodeErrorZ;
15397 * The contents of CResult_ShutdownDecodeErrorZ
15399 typedef union LDKCResult_ShutdownDecodeErrorZPtr {
15401 * A pointer to the contents in the success state.
15402 * Reading from this pointer when `result_ok` is not set is undefined.
15404 struct LDKShutdown *result;
15406 * A pointer to the contents in the error state.
15407 * Reading from this pointer when `result_ok` is set is undefined.
15409 struct LDKDecodeError *err;
15410 } LDKCResult_ShutdownDecodeErrorZPtr;
15413 * A CResult_ShutdownDecodeErrorZ represents the result of a fallible operation,
15414 * containing a crate::lightning::ln::msgs::Shutdown on success and a crate::lightning::ln::msgs::DecodeError on failure.
15415 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
15417 typedef struct LDKCResult_ShutdownDecodeErrorZ {
15419 * The contents of this CResult_ShutdownDecodeErrorZ, accessible via either
15420 * `err` or `result` depending on the state of `result_ok`.
15422 union LDKCResult_ShutdownDecodeErrorZPtr contents;
15424 * Whether this CResult_ShutdownDecodeErrorZ represents a success state.
15427 } LDKCResult_ShutdownDecodeErrorZ;
15430 * The contents of CResult_UpdateFailHTLCDecodeErrorZ
15432 typedef union LDKCResult_UpdateFailHTLCDecodeErrorZPtr {
15434 * A pointer to the contents in the success state.
15435 * Reading from this pointer when `result_ok` is not set is undefined.
15437 struct LDKUpdateFailHTLC *result;
15439 * A pointer to the contents in the error state.
15440 * Reading from this pointer when `result_ok` is set is undefined.
15442 struct LDKDecodeError *err;
15443 } LDKCResult_UpdateFailHTLCDecodeErrorZPtr;
15446 * A CResult_UpdateFailHTLCDecodeErrorZ represents the result of a fallible operation,
15447 * containing a crate::lightning::ln::msgs::UpdateFailHTLC on success and a crate::lightning::ln::msgs::DecodeError on failure.
15448 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
15450 typedef struct LDKCResult_UpdateFailHTLCDecodeErrorZ {
15452 * The contents of this CResult_UpdateFailHTLCDecodeErrorZ, accessible via either
15453 * `err` or `result` depending on the state of `result_ok`.
15455 union LDKCResult_UpdateFailHTLCDecodeErrorZPtr contents;
15457 * Whether this CResult_UpdateFailHTLCDecodeErrorZ represents a success state.
15460 } LDKCResult_UpdateFailHTLCDecodeErrorZ;
15463 * The contents of CResult_UpdateFailMalformedHTLCDecodeErrorZ
15465 typedef union LDKCResult_UpdateFailMalformedHTLCDecodeErrorZPtr {
15467 * A pointer to the contents in the success state.
15468 * Reading from this pointer when `result_ok` is not set is undefined.
15470 struct LDKUpdateFailMalformedHTLC *result;
15472 * A pointer to the contents in the error state.
15473 * Reading from this pointer when `result_ok` is set is undefined.
15475 struct LDKDecodeError *err;
15476 } LDKCResult_UpdateFailMalformedHTLCDecodeErrorZPtr;
15479 * A CResult_UpdateFailMalformedHTLCDecodeErrorZ represents the result of a fallible operation,
15480 * containing a crate::lightning::ln::msgs::UpdateFailMalformedHTLC on success and a crate::lightning::ln::msgs::DecodeError on failure.
15481 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
15483 typedef struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ {
15485 * The contents of this CResult_UpdateFailMalformedHTLCDecodeErrorZ, accessible via either
15486 * `err` or `result` depending on the state of `result_ok`.
15488 union LDKCResult_UpdateFailMalformedHTLCDecodeErrorZPtr contents;
15490 * Whether this CResult_UpdateFailMalformedHTLCDecodeErrorZ represents a success state.
15493 } LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ;
15498 * An [`update_fee`] message to be sent to or received from a peer
15500 * [`update_fee`]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md#updating-fees-update_fee
15502 typedef struct MUST_USE_STRUCT LDKUpdateFee {
15504 * A pointer to the opaque Rust object.
15505 * Nearly everywhere, inner must be non-null, however in places where
15506 * the Rust equivalent takes an Option, it may be set to null to indicate None.
15508 LDKnativeUpdateFee *inner;
15510 * Indicates that this is the only struct which contains the same pointer.
15511 * Rust functions which take ownership of an object provided via an argument require
15512 * this to be true and invalidate the object pointed to by inner.
15518 * The contents of CResult_UpdateFeeDecodeErrorZ
15520 typedef union LDKCResult_UpdateFeeDecodeErrorZPtr {
15522 * A pointer to the contents in the success state.
15523 * Reading from this pointer when `result_ok` is not set is undefined.
15525 struct LDKUpdateFee *result;
15527 * A pointer to the contents in the error state.
15528 * Reading from this pointer when `result_ok` is set is undefined.
15530 struct LDKDecodeError *err;
15531 } LDKCResult_UpdateFeeDecodeErrorZPtr;
15534 * A CResult_UpdateFeeDecodeErrorZ represents the result of a fallible operation,
15535 * containing a crate::lightning::ln::msgs::UpdateFee on success and a crate::lightning::ln::msgs::DecodeError on failure.
15536 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
15538 typedef struct LDKCResult_UpdateFeeDecodeErrorZ {
15540 * The contents of this CResult_UpdateFeeDecodeErrorZ, accessible via either
15541 * `err` or `result` depending on the state of `result_ok`.
15543 union LDKCResult_UpdateFeeDecodeErrorZPtr contents;
15545 * Whether this CResult_UpdateFeeDecodeErrorZ represents a success state.
15548 } LDKCResult_UpdateFeeDecodeErrorZ;
15551 * The contents of CResult_UpdateFulfillHTLCDecodeErrorZ
15553 typedef union LDKCResult_UpdateFulfillHTLCDecodeErrorZPtr {
15555 * A pointer to the contents in the success state.
15556 * Reading from this pointer when `result_ok` is not set is undefined.
15558 struct LDKUpdateFulfillHTLC *result;
15560 * A pointer to the contents in the error state.
15561 * Reading from this pointer when `result_ok` is set is undefined.
15563 struct LDKDecodeError *err;
15564 } LDKCResult_UpdateFulfillHTLCDecodeErrorZPtr;
15567 * A CResult_UpdateFulfillHTLCDecodeErrorZ represents the result of a fallible operation,
15568 * containing a crate::lightning::ln::msgs::UpdateFulfillHTLC on success and a crate::lightning::ln::msgs::DecodeError on failure.
15569 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
15571 typedef struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ {
15573 * The contents of this CResult_UpdateFulfillHTLCDecodeErrorZ, accessible via either
15574 * `err` or `result` depending on the state of `result_ok`.
15576 union LDKCResult_UpdateFulfillHTLCDecodeErrorZPtr contents;
15578 * Whether this CResult_UpdateFulfillHTLCDecodeErrorZ represents a success state.
15581 } LDKCResult_UpdateFulfillHTLCDecodeErrorZ;
15584 * The contents of CResult_OnionPacketDecodeErrorZ
15586 typedef union LDKCResult_OnionPacketDecodeErrorZPtr {
15588 * A pointer to the contents in the success state.
15589 * Reading from this pointer when `result_ok` is not set is undefined.
15591 struct LDKOnionPacket *result;
15593 * A pointer to the contents in the error state.
15594 * Reading from this pointer when `result_ok` is set is undefined.
15596 struct LDKDecodeError *err;
15597 } LDKCResult_OnionPacketDecodeErrorZPtr;
15600 * A CResult_OnionPacketDecodeErrorZ represents the result of a fallible operation,
15601 * containing a crate::lightning::ln::msgs::OnionPacket on success and a crate::lightning::ln::msgs::DecodeError on failure.
15602 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
15604 typedef struct LDKCResult_OnionPacketDecodeErrorZ {
15606 * The contents of this CResult_OnionPacketDecodeErrorZ, accessible via either
15607 * `err` or `result` depending on the state of `result_ok`.
15609 union LDKCResult_OnionPacketDecodeErrorZPtr contents;
15611 * Whether this CResult_OnionPacketDecodeErrorZ represents a success state.
15614 } LDKCResult_OnionPacketDecodeErrorZ;
15617 * The contents of CResult_UpdateAddHTLCDecodeErrorZ
15619 typedef union LDKCResult_UpdateAddHTLCDecodeErrorZPtr {
15621 * A pointer to the contents in the success state.
15622 * Reading from this pointer when `result_ok` is not set is undefined.
15624 struct LDKUpdateAddHTLC *result;
15626 * A pointer to the contents in the error state.
15627 * Reading from this pointer when `result_ok` is set is undefined.
15629 struct LDKDecodeError *err;
15630 } LDKCResult_UpdateAddHTLCDecodeErrorZPtr;
15633 * A CResult_UpdateAddHTLCDecodeErrorZ represents the result of a fallible operation,
15634 * containing a crate::lightning::ln::msgs::UpdateAddHTLC on success and a crate::lightning::ln::msgs::DecodeError on failure.
15635 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
15637 typedef struct LDKCResult_UpdateAddHTLCDecodeErrorZ {
15639 * The contents of this CResult_UpdateAddHTLCDecodeErrorZ, accessible via either
15640 * `err` or `result` depending on the state of `result_ok`.
15642 union LDKCResult_UpdateAddHTLCDecodeErrorZPtr contents;
15644 * Whether this CResult_UpdateAddHTLCDecodeErrorZ represents a success state.
15647 } LDKCResult_UpdateAddHTLCDecodeErrorZ;
15652 * An onion message to be sent to or received from a peer.
15655 typedef struct MUST_USE_STRUCT LDKOnionMessage {
15657 * A pointer to the opaque Rust object.
15658 * Nearly everywhere, inner must be non-null, however in places where
15659 * the Rust equivalent takes an Option, it may be set to null to indicate None.
15661 LDKnativeOnionMessage *inner;
15663 * Indicates that this is the only struct which contains the same pointer.
15664 * Rust functions which take ownership of an object provided via an argument require
15665 * this to be true and invalidate the object pointed to by inner.
15671 * The contents of CResult_OnionMessageDecodeErrorZ
15673 typedef union LDKCResult_OnionMessageDecodeErrorZPtr {
15675 * A pointer to the contents in the success state.
15676 * Reading from this pointer when `result_ok` is not set is undefined.
15678 struct LDKOnionMessage *result;
15680 * A pointer to the contents in the error state.
15681 * Reading from this pointer when `result_ok` is set is undefined.
15683 struct LDKDecodeError *err;
15684 } LDKCResult_OnionMessageDecodeErrorZPtr;
15687 * A CResult_OnionMessageDecodeErrorZ represents the result of a fallible operation,
15688 * containing a crate::lightning::ln::msgs::OnionMessage on success and a crate::lightning::ln::msgs::DecodeError on failure.
15689 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
15691 typedef struct LDKCResult_OnionMessageDecodeErrorZ {
15693 * The contents of this CResult_OnionMessageDecodeErrorZ, accessible via either
15694 * `err` or `result` depending on the state of `result_ok`.
15696 union LDKCResult_OnionMessageDecodeErrorZPtr contents;
15698 * Whether this CResult_OnionMessageDecodeErrorZ represents a success state.
15701 } LDKCResult_OnionMessageDecodeErrorZ;
15704 * The contents of CResult_FinalOnionHopDataDecodeErrorZ
15706 typedef union LDKCResult_FinalOnionHopDataDecodeErrorZPtr {
15708 * A pointer to the contents in the success state.
15709 * Reading from this pointer when `result_ok` is not set is undefined.
15711 struct LDKFinalOnionHopData *result;
15713 * A pointer to the contents in the error state.
15714 * Reading from this pointer when `result_ok` is set is undefined.
15716 struct LDKDecodeError *err;
15717 } LDKCResult_FinalOnionHopDataDecodeErrorZPtr;
15720 * A CResult_FinalOnionHopDataDecodeErrorZ represents the result of a fallible operation,
15721 * containing a crate::lightning::ln::msgs::FinalOnionHopData on success and a crate::lightning::ln::msgs::DecodeError on failure.
15722 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
15724 typedef struct LDKCResult_FinalOnionHopDataDecodeErrorZ {
15726 * The contents of this CResult_FinalOnionHopDataDecodeErrorZ, accessible via either
15727 * `err` or `result` depending on the state of `result_ok`.
15729 union LDKCResult_FinalOnionHopDataDecodeErrorZPtr contents;
15731 * Whether this CResult_FinalOnionHopDataDecodeErrorZ represents a success state.
15734 } LDKCResult_FinalOnionHopDataDecodeErrorZ;
15739 * A [`ping`] message to be sent to or received from a peer.
15741 * [`ping`]: https://github.com/lightning/bolts/blob/master/01-messaging.md#the-ping-and-pong-messages
15743 typedef struct MUST_USE_STRUCT LDKPing {
15745 * A pointer to the opaque Rust object.
15746 * Nearly everywhere, inner must be non-null, however in places where
15747 * the Rust equivalent takes an Option, it may be set to null to indicate None.
15749 LDKnativePing *inner;
15751 * Indicates that this is the only struct which contains the same pointer.
15752 * Rust functions which take ownership of an object provided via an argument require
15753 * this to be true and invalidate the object pointed to by inner.
15759 * The contents of CResult_PingDecodeErrorZ
15761 typedef union LDKCResult_PingDecodeErrorZPtr {
15763 * A pointer to the contents in the success state.
15764 * Reading from this pointer when `result_ok` is not set is undefined.
15766 struct LDKPing *result;
15768 * A pointer to the contents in the error state.
15769 * Reading from this pointer when `result_ok` is set is undefined.
15771 struct LDKDecodeError *err;
15772 } LDKCResult_PingDecodeErrorZPtr;
15775 * A CResult_PingDecodeErrorZ represents the result of a fallible operation,
15776 * containing a crate::lightning::ln::msgs::Ping on success and a crate::lightning::ln::msgs::DecodeError on failure.
15777 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
15779 typedef struct LDKCResult_PingDecodeErrorZ {
15781 * The contents of this CResult_PingDecodeErrorZ, accessible via either
15782 * `err` or `result` depending on the state of `result_ok`.
15784 union LDKCResult_PingDecodeErrorZPtr contents;
15786 * Whether this CResult_PingDecodeErrorZ represents a success state.
15789 } LDKCResult_PingDecodeErrorZ;
15794 * A [`pong`] message to be sent to or received from a peer.
15796 * [`pong`]: https://github.com/lightning/bolts/blob/master/01-messaging.md#the-ping-and-pong-messages
15798 typedef struct MUST_USE_STRUCT LDKPong {
15800 * A pointer to the opaque Rust object.
15801 * Nearly everywhere, inner must be non-null, however in places where
15802 * the Rust equivalent takes an Option, it may be set to null to indicate None.
15804 LDKnativePong *inner;
15806 * Indicates that this is the only struct which contains the same pointer.
15807 * Rust functions which take ownership of an object provided via an argument require
15808 * this to be true and invalidate the object pointed to by inner.
15814 * The contents of CResult_PongDecodeErrorZ
15816 typedef union LDKCResult_PongDecodeErrorZPtr {
15818 * A pointer to the contents in the success state.
15819 * Reading from this pointer when `result_ok` is not set is undefined.
15821 struct LDKPong *result;
15823 * A pointer to the contents in the error state.
15824 * Reading from this pointer when `result_ok` is set is undefined.
15826 struct LDKDecodeError *err;
15827 } LDKCResult_PongDecodeErrorZPtr;
15830 * A CResult_PongDecodeErrorZ represents the result of a fallible operation,
15831 * containing a crate::lightning::ln::msgs::Pong on success and a crate::lightning::ln::msgs::DecodeError on failure.
15832 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
15834 typedef struct LDKCResult_PongDecodeErrorZ {
15836 * The contents of this CResult_PongDecodeErrorZ, accessible via either
15837 * `err` or `result` depending on the state of `result_ok`.
15839 union LDKCResult_PongDecodeErrorZPtr contents;
15841 * Whether this CResult_PongDecodeErrorZ represents a success state.
15844 } LDKCResult_PongDecodeErrorZ;
15847 * The contents of CResult_UnsignedChannelAnnouncementDecodeErrorZ
15849 typedef union LDKCResult_UnsignedChannelAnnouncementDecodeErrorZPtr {
15851 * A pointer to the contents in the success state.
15852 * Reading from this pointer when `result_ok` is not set is undefined.
15854 struct LDKUnsignedChannelAnnouncement *result;
15856 * A pointer to the contents in the error state.
15857 * Reading from this pointer when `result_ok` is set is undefined.
15859 struct LDKDecodeError *err;
15860 } LDKCResult_UnsignedChannelAnnouncementDecodeErrorZPtr;
15863 * A CResult_UnsignedChannelAnnouncementDecodeErrorZ represents the result of a fallible operation,
15864 * containing a crate::lightning::ln::msgs::UnsignedChannelAnnouncement on success and a crate::lightning::ln::msgs::DecodeError on failure.
15865 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
15867 typedef struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ {
15869 * The contents of this CResult_UnsignedChannelAnnouncementDecodeErrorZ, accessible via either
15870 * `err` or `result` depending on the state of `result_ok`.
15872 union LDKCResult_UnsignedChannelAnnouncementDecodeErrorZPtr contents;
15874 * Whether this CResult_UnsignedChannelAnnouncementDecodeErrorZ represents a success state.
15877 } LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ;
15880 * The contents of CResult_ChannelAnnouncementDecodeErrorZ
15882 typedef union LDKCResult_ChannelAnnouncementDecodeErrorZPtr {
15884 * A pointer to the contents in the success state.
15885 * Reading from this pointer when `result_ok` is not set is undefined.
15887 struct LDKChannelAnnouncement *result;
15889 * A pointer to the contents in the error state.
15890 * Reading from this pointer when `result_ok` is set is undefined.
15892 struct LDKDecodeError *err;
15893 } LDKCResult_ChannelAnnouncementDecodeErrorZPtr;
15896 * A CResult_ChannelAnnouncementDecodeErrorZ represents the result of a fallible operation,
15897 * containing a crate::lightning::ln::msgs::ChannelAnnouncement on success and a crate::lightning::ln::msgs::DecodeError on failure.
15898 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
15900 typedef struct LDKCResult_ChannelAnnouncementDecodeErrorZ {
15902 * The contents of this CResult_ChannelAnnouncementDecodeErrorZ, accessible via either
15903 * `err` or `result` depending on the state of `result_ok`.
15905 union LDKCResult_ChannelAnnouncementDecodeErrorZPtr contents;
15907 * Whether this CResult_ChannelAnnouncementDecodeErrorZ represents a success state.
15910 } LDKCResult_ChannelAnnouncementDecodeErrorZ;
15913 * The contents of CResult_UnsignedChannelUpdateDecodeErrorZ
15915 typedef union LDKCResult_UnsignedChannelUpdateDecodeErrorZPtr {
15917 * A pointer to the contents in the success state.
15918 * Reading from this pointer when `result_ok` is not set is undefined.
15920 struct LDKUnsignedChannelUpdate *result;
15922 * A pointer to the contents in the error state.
15923 * Reading from this pointer when `result_ok` is set is undefined.
15925 struct LDKDecodeError *err;
15926 } LDKCResult_UnsignedChannelUpdateDecodeErrorZPtr;
15929 * A CResult_UnsignedChannelUpdateDecodeErrorZ represents the result of a fallible operation,
15930 * containing a crate::lightning::ln::msgs::UnsignedChannelUpdate on success and a crate::lightning::ln::msgs::DecodeError on failure.
15931 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
15933 typedef struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ {
15935 * The contents of this CResult_UnsignedChannelUpdateDecodeErrorZ, accessible via either
15936 * `err` or `result` depending on the state of `result_ok`.
15938 union LDKCResult_UnsignedChannelUpdateDecodeErrorZPtr contents;
15940 * Whether this CResult_UnsignedChannelUpdateDecodeErrorZ represents a success state.
15943 } LDKCResult_UnsignedChannelUpdateDecodeErrorZ;
15946 * The contents of CResult_ChannelUpdateDecodeErrorZ
15948 typedef union LDKCResult_ChannelUpdateDecodeErrorZPtr {
15950 * A pointer to the contents in the success state.
15951 * Reading from this pointer when `result_ok` is not set is undefined.
15953 struct LDKChannelUpdate *result;
15955 * A pointer to the contents in the error state.
15956 * Reading from this pointer when `result_ok` is set is undefined.
15958 struct LDKDecodeError *err;
15959 } LDKCResult_ChannelUpdateDecodeErrorZPtr;
15962 * A CResult_ChannelUpdateDecodeErrorZ represents the result of a fallible operation,
15963 * containing a crate::lightning::ln::msgs::ChannelUpdate on success and a crate::lightning::ln::msgs::DecodeError on failure.
15964 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
15966 typedef struct LDKCResult_ChannelUpdateDecodeErrorZ {
15968 * The contents of this CResult_ChannelUpdateDecodeErrorZ, accessible via either
15969 * `err` or `result` depending on the state of `result_ok`.
15971 union LDKCResult_ChannelUpdateDecodeErrorZPtr contents;
15973 * Whether this CResult_ChannelUpdateDecodeErrorZ represents a success state.
15976 } LDKCResult_ChannelUpdateDecodeErrorZ;
15979 * The contents of CResult_ErrorMessageDecodeErrorZ
15981 typedef union LDKCResult_ErrorMessageDecodeErrorZPtr {
15983 * A pointer to the contents in the success state.
15984 * Reading from this pointer when `result_ok` is not set is undefined.
15986 struct LDKErrorMessage *result;
15988 * A pointer to the contents in the error state.
15989 * Reading from this pointer when `result_ok` is set is undefined.
15991 struct LDKDecodeError *err;
15992 } LDKCResult_ErrorMessageDecodeErrorZPtr;
15995 * A CResult_ErrorMessageDecodeErrorZ represents the result of a fallible operation,
15996 * containing a crate::lightning::ln::msgs::ErrorMessage on success and a crate::lightning::ln::msgs::DecodeError on failure.
15997 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
15999 typedef struct LDKCResult_ErrorMessageDecodeErrorZ {
16001 * The contents of this CResult_ErrorMessageDecodeErrorZ, accessible via either
16002 * `err` or `result` depending on the state of `result_ok`.
16004 union LDKCResult_ErrorMessageDecodeErrorZPtr contents;
16006 * Whether this CResult_ErrorMessageDecodeErrorZ represents a success state.
16009 } LDKCResult_ErrorMessageDecodeErrorZ;
16012 * The contents of CResult_WarningMessageDecodeErrorZ
16014 typedef union LDKCResult_WarningMessageDecodeErrorZPtr {
16016 * A pointer to the contents in the success state.
16017 * Reading from this pointer when `result_ok` is not set is undefined.
16019 struct LDKWarningMessage *result;
16021 * A pointer to the contents in the error state.
16022 * Reading from this pointer when `result_ok` is set is undefined.
16024 struct LDKDecodeError *err;
16025 } LDKCResult_WarningMessageDecodeErrorZPtr;
16028 * A CResult_WarningMessageDecodeErrorZ represents the result of a fallible operation,
16029 * containing a crate::lightning::ln::msgs::WarningMessage on success and a crate::lightning::ln::msgs::DecodeError on failure.
16030 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
16032 typedef struct LDKCResult_WarningMessageDecodeErrorZ {
16034 * The contents of this CResult_WarningMessageDecodeErrorZ, accessible via either
16035 * `err` or `result` depending on the state of `result_ok`.
16037 union LDKCResult_WarningMessageDecodeErrorZPtr contents;
16039 * Whether this CResult_WarningMessageDecodeErrorZ represents a success state.
16042 } LDKCResult_WarningMessageDecodeErrorZ;
16045 * The contents of CResult_UnsignedNodeAnnouncementDecodeErrorZ
16047 typedef union LDKCResult_UnsignedNodeAnnouncementDecodeErrorZPtr {
16049 * A pointer to the contents in the success state.
16050 * Reading from this pointer when `result_ok` is not set is undefined.
16052 struct LDKUnsignedNodeAnnouncement *result;
16054 * A pointer to the contents in the error state.
16055 * Reading from this pointer when `result_ok` is set is undefined.
16057 struct LDKDecodeError *err;
16058 } LDKCResult_UnsignedNodeAnnouncementDecodeErrorZPtr;
16061 * A CResult_UnsignedNodeAnnouncementDecodeErrorZ represents the result of a fallible operation,
16062 * containing a crate::lightning::ln::msgs::UnsignedNodeAnnouncement on success and a crate::lightning::ln::msgs::DecodeError on failure.
16063 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
16065 typedef struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ {
16067 * The contents of this CResult_UnsignedNodeAnnouncementDecodeErrorZ, accessible via either
16068 * `err` or `result` depending on the state of `result_ok`.
16070 union LDKCResult_UnsignedNodeAnnouncementDecodeErrorZPtr contents;
16072 * Whether this CResult_UnsignedNodeAnnouncementDecodeErrorZ represents a success state.
16075 } LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ;
16078 * The contents of CResult_NodeAnnouncementDecodeErrorZ
16080 typedef union LDKCResult_NodeAnnouncementDecodeErrorZPtr {
16082 * A pointer to the contents in the success state.
16083 * Reading from this pointer when `result_ok` is not set is undefined.
16085 struct LDKNodeAnnouncement *result;
16087 * A pointer to the contents in the error state.
16088 * Reading from this pointer when `result_ok` is set is undefined.
16090 struct LDKDecodeError *err;
16091 } LDKCResult_NodeAnnouncementDecodeErrorZPtr;
16094 * A CResult_NodeAnnouncementDecodeErrorZ represents the result of a fallible operation,
16095 * containing a crate::lightning::ln::msgs::NodeAnnouncement on success and a crate::lightning::ln::msgs::DecodeError on failure.
16096 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
16098 typedef struct LDKCResult_NodeAnnouncementDecodeErrorZ {
16100 * The contents of this CResult_NodeAnnouncementDecodeErrorZ, accessible via either
16101 * `err` or `result` depending on the state of `result_ok`.
16103 union LDKCResult_NodeAnnouncementDecodeErrorZPtr contents;
16105 * Whether this CResult_NodeAnnouncementDecodeErrorZ represents a success state.
16108 } LDKCResult_NodeAnnouncementDecodeErrorZ;
16111 * The contents of CResult_QueryShortChannelIdsDecodeErrorZ
16113 typedef union LDKCResult_QueryShortChannelIdsDecodeErrorZPtr {
16115 * A pointer to the contents in the success state.
16116 * Reading from this pointer when `result_ok` is not set is undefined.
16118 struct LDKQueryShortChannelIds *result;
16120 * A pointer to the contents in the error state.
16121 * Reading from this pointer when `result_ok` is set is undefined.
16123 struct LDKDecodeError *err;
16124 } LDKCResult_QueryShortChannelIdsDecodeErrorZPtr;
16127 * A CResult_QueryShortChannelIdsDecodeErrorZ represents the result of a fallible operation,
16128 * containing a crate::lightning::ln::msgs::QueryShortChannelIds on success and a crate::lightning::ln::msgs::DecodeError on failure.
16129 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
16131 typedef struct LDKCResult_QueryShortChannelIdsDecodeErrorZ {
16133 * The contents of this CResult_QueryShortChannelIdsDecodeErrorZ, accessible via either
16134 * `err` or `result` depending on the state of `result_ok`.
16136 union LDKCResult_QueryShortChannelIdsDecodeErrorZPtr contents;
16138 * Whether this CResult_QueryShortChannelIdsDecodeErrorZ represents a success state.
16141 } LDKCResult_QueryShortChannelIdsDecodeErrorZ;
16146 * A [`reply_short_channel_ids_end`] message is sent as a reply to a
16147 * message. The query recipient makes a best
16148 * effort to respond based on their local network view which may not be
16149 * a perfect view of the network.
16151 * [`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
16153 typedef struct MUST_USE_STRUCT LDKReplyShortChannelIdsEnd {
16155 * A pointer to the opaque Rust object.
16156 * Nearly everywhere, inner must be non-null, however in places where
16157 * the Rust equivalent takes an Option, it may be set to null to indicate None.
16159 LDKnativeReplyShortChannelIdsEnd *inner;
16161 * Indicates that this is the only struct which contains the same pointer.
16162 * Rust functions which take ownership of an object provided via an argument require
16163 * this to be true and invalidate the object pointed to by inner.
16166 } LDKReplyShortChannelIdsEnd;
16169 * The contents of CResult_ReplyShortChannelIdsEndDecodeErrorZ
16171 typedef union LDKCResult_ReplyShortChannelIdsEndDecodeErrorZPtr {
16173 * A pointer to the contents in the success state.
16174 * Reading from this pointer when `result_ok` is not set is undefined.
16176 struct LDKReplyShortChannelIdsEnd *result;
16178 * A pointer to the contents in the error state.
16179 * Reading from this pointer when `result_ok` is set is undefined.
16181 struct LDKDecodeError *err;
16182 } LDKCResult_ReplyShortChannelIdsEndDecodeErrorZPtr;
16185 * A CResult_ReplyShortChannelIdsEndDecodeErrorZ represents the result of a fallible operation,
16186 * containing a crate::lightning::ln::msgs::ReplyShortChannelIdsEnd on success and a crate::lightning::ln::msgs::DecodeError on failure.
16187 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
16189 typedef struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ {
16191 * The contents of this CResult_ReplyShortChannelIdsEndDecodeErrorZ, accessible via either
16192 * `err` or `result` depending on the state of `result_ok`.
16194 union LDKCResult_ReplyShortChannelIdsEndDecodeErrorZPtr contents;
16196 * Whether this CResult_ReplyShortChannelIdsEndDecodeErrorZ represents a success state.
16199 } LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ;
16202 * The contents of CResult_QueryChannelRangeDecodeErrorZ
16204 typedef union LDKCResult_QueryChannelRangeDecodeErrorZPtr {
16206 * A pointer to the contents in the success state.
16207 * Reading from this pointer when `result_ok` is not set is undefined.
16209 struct LDKQueryChannelRange *result;
16211 * A pointer to the contents in the error state.
16212 * Reading from this pointer when `result_ok` is set is undefined.
16214 struct LDKDecodeError *err;
16215 } LDKCResult_QueryChannelRangeDecodeErrorZPtr;
16218 * A CResult_QueryChannelRangeDecodeErrorZ represents the result of a fallible operation,
16219 * containing a crate::lightning::ln::msgs::QueryChannelRange on success and a crate::lightning::ln::msgs::DecodeError on failure.
16220 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
16222 typedef struct LDKCResult_QueryChannelRangeDecodeErrorZ {
16224 * The contents of this CResult_QueryChannelRangeDecodeErrorZ, accessible via either
16225 * `err` or `result` depending on the state of `result_ok`.
16227 union LDKCResult_QueryChannelRangeDecodeErrorZPtr contents;
16229 * Whether this CResult_QueryChannelRangeDecodeErrorZ represents a success state.
16232 } LDKCResult_QueryChannelRangeDecodeErrorZ;
16235 * The contents of CResult_ReplyChannelRangeDecodeErrorZ
16237 typedef union LDKCResult_ReplyChannelRangeDecodeErrorZPtr {
16239 * A pointer to the contents in the success state.
16240 * Reading from this pointer when `result_ok` is not set is undefined.
16242 struct LDKReplyChannelRange *result;
16244 * A pointer to the contents in the error state.
16245 * Reading from this pointer when `result_ok` is set is undefined.
16247 struct LDKDecodeError *err;
16248 } LDKCResult_ReplyChannelRangeDecodeErrorZPtr;
16251 * A CResult_ReplyChannelRangeDecodeErrorZ represents the result of a fallible operation,
16252 * containing a crate::lightning::ln::msgs::ReplyChannelRange on success and a crate::lightning::ln::msgs::DecodeError on failure.
16253 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
16255 typedef struct LDKCResult_ReplyChannelRangeDecodeErrorZ {
16257 * The contents of this CResult_ReplyChannelRangeDecodeErrorZ, accessible via either
16258 * `err` or `result` depending on the state of `result_ok`.
16260 union LDKCResult_ReplyChannelRangeDecodeErrorZPtr contents;
16262 * Whether this CResult_ReplyChannelRangeDecodeErrorZ represents a success state.
16265 } LDKCResult_ReplyChannelRangeDecodeErrorZ;
16268 * The contents of CResult_GossipTimestampFilterDecodeErrorZ
16270 typedef union LDKCResult_GossipTimestampFilterDecodeErrorZPtr {
16272 * A pointer to the contents in the success state.
16273 * Reading from this pointer when `result_ok` is not set is undefined.
16275 struct LDKGossipTimestampFilter *result;
16277 * A pointer to the contents in the error state.
16278 * Reading from this pointer when `result_ok` is set is undefined.
16280 struct LDKDecodeError *err;
16281 } LDKCResult_GossipTimestampFilterDecodeErrorZPtr;
16284 * A CResult_GossipTimestampFilterDecodeErrorZ represents the result of a fallible operation,
16285 * containing a crate::lightning::ln::msgs::GossipTimestampFilter on success and a crate::lightning::ln::msgs::DecodeError on failure.
16286 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
16288 typedef struct LDKCResult_GossipTimestampFilterDecodeErrorZ {
16290 * The contents of this CResult_GossipTimestampFilterDecodeErrorZ, accessible via either
16291 * `err` or `result` depending on the state of `result_ok`.
16293 union LDKCResult_GossipTimestampFilterDecodeErrorZPtr contents;
16295 * Whether this CResult_GossipTimestampFilterDecodeErrorZ represents a success state.
16298 } LDKCResult_GossipTimestampFilterDecodeErrorZ;
16301 * A dynamically-allocated array of crate::lightning::ln::channelmanager::PhantomRouteHintss of arbitrary size.
16302 * This corresponds to std::vector in C++
16304 typedef struct LDKCVec_PhantomRouteHintsZ {
16306 * The elements in the array.
16307 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
16309 struct LDKPhantomRouteHints *data;
16311 * The number of elements pointed to by `data`.
16314 } LDKCVec_PhantomRouteHintsZ;
16319 * Represents a syntactically and semantically correct lightning BOLT11 invoice.
16321 * There are three ways to construct a `Bolt11Invoice`:
16322 * 1. using [`InvoiceBuilder`]
16323 * 2. using [`Bolt11Invoice::from_signed`]
16324 * 3. using `str::parse::<Bolt11Invoice>(&str)` (see [`Bolt11Invoice::from_str`])
16326 * [`Bolt11Invoice::from_str`]: crate::Bolt11Invoice#impl-FromStr
16328 typedef struct MUST_USE_STRUCT LDKBolt11Invoice {
16330 * A pointer to the opaque Rust object.
16331 * Nearly everywhere, inner must be non-null, however in places where
16332 * the Rust equivalent takes an Option, it may be set to null to indicate None.
16334 LDKnativeBolt11Invoice *inner;
16336 * Indicates that this is the only struct which contains the same pointer.
16337 * Rust functions which take ownership of an object provided via an argument require
16338 * this to be true and invalidate the object pointed to by inner.
16341 } LDKBolt11Invoice;
16344 * When signing using a fallible method either an user-supplied `SignError` or a [`CreationError`]
16347 typedef enum LDKSignOrCreationError_Tag {
16349 * An error occurred during signing
16351 LDKSignOrCreationError_SignError,
16353 * An error occurred while building the transaction
16355 LDKSignOrCreationError_CreationError,
16357 * Must be last for serialization purposes
16359 LDKSignOrCreationError_Sentinel,
16360 } LDKSignOrCreationError_Tag;
16362 typedef struct MUST_USE_STRUCT LDKSignOrCreationError {
16363 LDKSignOrCreationError_Tag tag;
16366 enum LDKCreationError creation_error;
16369 } LDKSignOrCreationError;
16372 * The contents of CResult_Bolt11InvoiceSignOrCreationErrorZ
16374 typedef union LDKCResult_Bolt11InvoiceSignOrCreationErrorZPtr {
16376 * A pointer to the contents in the success state.
16377 * Reading from this pointer when `result_ok` is not set is undefined.
16379 struct LDKBolt11Invoice *result;
16381 * A pointer to the contents in the error state.
16382 * Reading from this pointer when `result_ok` is set is undefined.
16384 struct LDKSignOrCreationError *err;
16385 } LDKCResult_Bolt11InvoiceSignOrCreationErrorZPtr;
16388 * A CResult_Bolt11InvoiceSignOrCreationErrorZ represents the result of a fallible operation,
16389 * containing a crate::lightning_invoice::Bolt11Invoice on success and a crate::lightning_invoice::SignOrCreationError on failure.
16390 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
16392 typedef struct LDKCResult_Bolt11InvoiceSignOrCreationErrorZ {
16394 * The contents of this CResult_Bolt11InvoiceSignOrCreationErrorZ, accessible via either
16395 * `err` or `result` depending on the state of `result_ok`.
16397 union LDKCResult_Bolt11InvoiceSignOrCreationErrorZPtr contents;
16399 * Whether this CResult_Bolt11InvoiceSignOrCreationErrorZ represents a success state.
16402 } LDKCResult_Bolt11InvoiceSignOrCreationErrorZ;
16405 * An enum which can either contain a crate::lightning::ln::channel_state::InboundHTLCStateDetails or not
16407 typedef enum LDKCOption_InboundHTLCStateDetailsZ_Tag {
16409 * When we're in this state, this COption_InboundHTLCStateDetailsZ contains a crate::lightning::ln::channel_state::InboundHTLCStateDetails
16411 LDKCOption_InboundHTLCStateDetailsZ_Some,
16413 * When we're in this state, this COption_InboundHTLCStateDetailsZ contains nothing
16415 LDKCOption_InboundHTLCStateDetailsZ_None,
16417 * Must be last for serialization purposes
16419 LDKCOption_InboundHTLCStateDetailsZ_Sentinel,
16420 } LDKCOption_InboundHTLCStateDetailsZ_Tag;
16422 typedef struct LDKCOption_InboundHTLCStateDetailsZ {
16423 LDKCOption_InboundHTLCStateDetailsZ_Tag tag;
16426 enum LDKInboundHTLCStateDetails some;
16429 } LDKCOption_InboundHTLCStateDetailsZ;
16432 * The contents of CResult_COption_InboundHTLCStateDetailsZDecodeErrorZ
16434 typedef union LDKCResult_COption_InboundHTLCStateDetailsZDecodeErrorZPtr {
16436 * A pointer to the contents in the success state.
16437 * Reading from this pointer when `result_ok` is not set is undefined.
16439 struct LDKCOption_InboundHTLCStateDetailsZ *result;
16441 * A pointer to the contents in the error state.
16442 * Reading from this pointer when `result_ok` is set is undefined.
16444 struct LDKDecodeError *err;
16445 } LDKCResult_COption_InboundHTLCStateDetailsZDecodeErrorZPtr;
16448 * A CResult_COption_InboundHTLCStateDetailsZDecodeErrorZ represents the result of a fallible operation,
16449 * containing a crate::c_types::derived::COption_InboundHTLCStateDetailsZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
16450 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
16452 typedef struct LDKCResult_COption_InboundHTLCStateDetailsZDecodeErrorZ {
16454 * The contents of this CResult_COption_InboundHTLCStateDetailsZDecodeErrorZ, accessible via either
16455 * `err` or `result` depending on the state of `result_ok`.
16457 union LDKCResult_COption_InboundHTLCStateDetailsZDecodeErrorZPtr contents;
16459 * Whether this CResult_COption_InboundHTLCStateDetailsZDecodeErrorZ represents a success state.
16462 } LDKCResult_COption_InboundHTLCStateDetailsZDecodeErrorZ;
16467 * Exposes details around pending inbound HTLCs.
16469 typedef struct MUST_USE_STRUCT LDKInboundHTLCDetails {
16471 * A pointer to the opaque Rust object.
16472 * Nearly everywhere, inner must be non-null, however in places where
16473 * the Rust equivalent takes an Option, it may be set to null to indicate None.
16475 LDKnativeInboundHTLCDetails *inner;
16477 * Indicates that this is the only struct which contains the same pointer.
16478 * Rust functions which take ownership of an object provided via an argument require
16479 * this to be true and invalidate the object pointed to by inner.
16482 } LDKInboundHTLCDetails;
16485 * The contents of CResult_InboundHTLCDetailsDecodeErrorZ
16487 typedef union LDKCResult_InboundHTLCDetailsDecodeErrorZPtr {
16489 * A pointer to the contents in the success state.
16490 * Reading from this pointer when `result_ok` is not set is undefined.
16492 struct LDKInboundHTLCDetails *result;
16494 * A pointer to the contents in the error state.
16495 * Reading from this pointer when `result_ok` is set is undefined.
16497 struct LDKDecodeError *err;
16498 } LDKCResult_InboundHTLCDetailsDecodeErrorZPtr;
16501 * A CResult_InboundHTLCDetailsDecodeErrorZ represents the result of a fallible operation,
16502 * containing a crate::lightning::ln::channel_state::InboundHTLCDetails on success and a crate::lightning::ln::msgs::DecodeError on failure.
16503 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
16505 typedef struct LDKCResult_InboundHTLCDetailsDecodeErrorZ {
16507 * The contents of this CResult_InboundHTLCDetailsDecodeErrorZ, accessible via either
16508 * `err` or `result` depending on the state of `result_ok`.
16510 union LDKCResult_InboundHTLCDetailsDecodeErrorZPtr contents;
16512 * Whether this CResult_InboundHTLCDetailsDecodeErrorZ represents a success state.
16515 } LDKCResult_InboundHTLCDetailsDecodeErrorZ;
16518 * An enum which can either contain a crate::lightning::ln::channel_state::OutboundHTLCStateDetails or not
16520 typedef enum LDKCOption_OutboundHTLCStateDetailsZ_Tag {
16522 * When we're in this state, this COption_OutboundHTLCStateDetailsZ contains a crate::lightning::ln::channel_state::OutboundHTLCStateDetails
16524 LDKCOption_OutboundHTLCStateDetailsZ_Some,
16526 * When we're in this state, this COption_OutboundHTLCStateDetailsZ contains nothing
16528 LDKCOption_OutboundHTLCStateDetailsZ_None,
16530 * Must be last for serialization purposes
16532 LDKCOption_OutboundHTLCStateDetailsZ_Sentinel,
16533 } LDKCOption_OutboundHTLCStateDetailsZ_Tag;
16535 typedef struct LDKCOption_OutboundHTLCStateDetailsZ {
16536 LDKCOption_OutboundHTLCStateDetailsZ_Tag tag;
16539 enum LDKOutboundHTLCStateDetails some;
16542 } LDKCOption_OutboundHTLCStateDetailsZ;
16545 * The contents of CResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ
16547 typedef union LDKCResult_COption_OutboundHTLCStateDetailsZDecodeErrorZPtr {
16549 * A pointer to the contents in the success state.
16550 * Reading from this pointer when `result_ok` is not set is undefined.
16552 struct LDKCOption_OutboundHTLCStateDetailsZ *result;
16554 * A pointer to the contents in the error state.
16555 * Reading from this pointer when `result_ok` is set is undefined.
16557 struct LDKDecodeError *err;
16558 } LDKCResult_COption_OutboundHTLCStateDetailsZDecodeErrorZPtr;
16561 * A CResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ represents the result of a fallible operation,
16562 * containing a crate::c_types::derived::COption_OutboundHTLCStateDetailsZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
16563 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
16565 typedef struct LDKCResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ {
16567 * The contents of this CResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ, accessible via either
16568 * `err` or `result` depending on the state of `result_ok`.
16570 union LDKCResult_COption_OutboundHTLCStateDetailsZDecodeErrorZPtr contents;
16572 * Whether this CResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ represents a success state.
16575 } LDKCResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ;
16580 * Exposes details around pending outbound HTLCs.
16582 typedef struct MUST_USE_STRUCT LDKOutboundHTLCDetails {
16584 * A pointer to the opaque Rust object.
16585 * Nearly everywhere, inner must be non-null, however in places where
16586 * the Rust equivalent takes an Option, it may be set to null to indicate None.
16588 LDKnativeOutboundHTLCDetails *inner;
16590 * Indicates that this is the only struct which contains the same pointer.
16591 * Rust functions which take ownership of an object provided via an argument require
16592 * this to be true and invalidate the object pointed to by inner.
16595 } LDKOutboundHTLCDetails;
16598 * The contents of CResult_OutboundHTLCDetailsDecodeErrorZ
16600 typedef union LDKCResult_OutboundHTLCDetailsDecodeErrorZPtr {
16602 * A pointer to the contents in the success state.
16603 * Reading from this pointer when `result_ok` is not set is undefined.
16605 struct LDKOutboundHTLCDetails *result;
16607 * A pointer to the contents in the error state.
16608 * Reading from this pointer when `result_ok` is set is undefined.
16610 struct LDKDecodeError *err;
16611 } LDKCResult_OutboundHTLCDetailsDecodeErrorZPtr;
16614 * A CResult_OutboundHTLCDetailsDecodeErrorZ represents the result of a fallible operation,
16615 * containing a crate::lightning::ln::channel_state::OutboundHTLCDetails on success and a crate::lightning::ln::msgs::DecodeError on failure.
16616 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
16618 typedef struct LDKCResult_OutboundHTLCDetailsDecodeErrorZ {
16620 * The contents of this CResult_OutboundHTLCDetailsDecodeErrorZ, accessible via either
16621 * `err` or `result` depending on the state of `result_ok`.
16623 union LDKCResult_OutboundHTLCDetailsDecodeErrorZPtr contents;
16625 * Whether this CResult_OutboundHTLCDetailsDecodeErrorZ represents a success state.
16628 } LDKCResult_OutboundHTLCDetailsDecodeErrorZ;
16633 * Information needed for constructing an invoice route hint for this channel.
16635 typedef struct MUST_USE_STRUCT LDKCounterpartyForwardingInfo {
16637 * A pointer to the opaque Rust object.
16638 * Nearly everywhere, inner must be non-null, however in places where
16639 * the Rust equivalent takes an Option, it may be set to null to indicate None.
16641 LDKnativeCounterpartyForwardingInfo *inner;
16643 * Indicates that this is the only struct which contains the same pointer.
16644 * Rust functions which take ownership of an object provided via an argument require
16645 * this to be true and invalidate the object pointed to by inner.
16648 } LDKCounterpartyForwardingInfo;
16651 * The contents of CResult_CounterpartyForwardingInfoDecodeErrorZ
16653 typedef union LDKCResult_CounterpartyForwardingInfoDecodeErrorZPtr {
16655 * A pointer to the contents in the success state.
16656 * Reading from this pointer when `result_ok` is not set is undefined.
16658 struct LDKCounterpartyForwardingInfo *result;
16660 * A pointer to the contents in the error state.
16661 * Reading from this pointer when `result_ok` is set is undefined.
16663 struct LDKDecodeError *err;
16664 } LDKCResult_CounterpartyForwardingInfoDecodeErrorZPtr;
16667 * A CResult_CounterpartyForwardingInfoDecodeErrorZ represents the result of a fallible operation,
16668 * containing a crate::lightning::ln::channel_state::CounterpartyForwardingInfo on success and a crate::lightning::ln::msgs::DecodeError on failure.
16669 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
16671 typedef struct LDKCResult_CounterpartyForwardingInfoDecodeErrorZ {
16673 * The contents of this CResult_CounterpartyForwardingInfoDecodeErrorZ, accessible via either
16674 * `err` or `result` depending on the state of `result_ok`.
16676 union LDKCResult_CounterpartyForwardingInfoDecodeErrorZPtr contents;
16678 * Whether this CResult_CounterpartyForwardingInfoDecodeErrorZ represents a success state.
16681 } LDKCResult_CounterpartyForwardingInfoDecodeErrorZ;
16686 * Channel parameters which apply to our counterparty. These are split out from [`ChannelDetails`]
16687 * to better separate parameters.
16689 typedef struct MUST_USE_STRUCT LDKChannelCounterparty {
16691 * A pointer to the opaque Rust object.
16692 * Nearly everywhere, inner must be non-null, however in places where
16693 * the Rust equivalent takes an Option, it may be set to null to indicate None.
16695 LDKnativeChannelCounterparty *inner;
16697 * Indicates that this is the only struct which contains the same pointer.
16698 * Rust functions which take ownership of an object provided via an argument require
16699 * this to be true and invalidate the object pointed to by inner.
16702 } LDKChannelCounterparty;
16705 * The contents of CResult_ChannelCounterpartyDecodeErrorZ
16707 typedef union LDKCResult_ChannelCounterpartyDecodeErrorZPtr {
16709 * A pointer to the contents in the success state.
16710 * Reading from this pointer when `result_ok` is not set is undefined.
16712 struct LDKChannelCounterparty *result;
16714 * A pointer to the contents in the error state.
16715 * Reading from this pointer when `result_ok` is set is undefined.
16717 struct LDKDecodeError *err;
16718 } LDKCResult_ChannelCounterpartyDecodeErrorZPtr;
16721 * A CResult_ChannelCounterpartyDecodeErrorZ represents the result of a fallible operation,
16722 * containing a crate::lightning::ln::channel_state::ChannelCounterparty on success and a crate::lightning::ln::msgs::DecodeError on failure.
16723 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
16725 typedef struct LDKCResult_ChannelCounterpartyDecodeErrorZ {
16727 * The contents of this CResult_ChannelCounterpartyDecodeErrorZ, accessible via either
16728 * `err` or `result` depending on the state of `result_ok`.
16730 union LDKCResult_ChannelCounterpartyDecodeErrorZPtr contents;
16732 * Whether this CResult_ChannelCounterpartyDecodeErrorZ represents a success state.
16735 } LDKCResult_ChannelCounterpartyDecodeErrorZ;
16738 * An enum which can either contain a crate::lightning::ln::channel_state::ChannelShutdownState or not
16740 typedef enum LDKCOption_ChannelShutdownStateZ_Tag {
16742 * When we're in this state, this COption_ChannelShutdownStateZ contains a crate::lightning::ln::channel_state::ChannelShutdownState
16744 LDKCOption_ChannelShutdownStateZ_Some,
16746 * When we're in this state, this COption_ChannelShutdownStateZ contains nothing
16748 LDKCOption_ChannelShutdownStateZ_None,
16750 * Must be last for serialization purposes
16752 LDKCOption_ChannelShutdownStateZ_Sentinel,
16753 } LDKCOption_ChannelShutdownStateZ_Tag;
16755 typedef struct LDKCOption_ChannelShutdownStateZ {
16756 LDKCOption_ChannelShutdownStateZ_Tag tag;
16759 enum LDKChannelShutdownState some;
16762 } LDKCOption_ChannelShutdownStateZ;
16765 * A dynamically-allocated array of crate::lightning::ln::channel_state::InboundHTLCDetailss of arbitrary size.
16766 * This corresponds to std::vector in C++
16768 typedef struct LDKCVec_InboundHTLCDetailsZ {
16770 * The elements in the array.
16771 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
16773 struct LDKInboundHTLCDetails *data;
16775 * The number of elements pointed to by `data`.
16778 } LDKCVec_InboundHTLCDetailsZ;
16781 * A dynamically-allocated array of crate::lightning::ln::channel_state::OutboundHTLCDetailss of arbitrary size.
16782 * This corresponds to std::vector in C++
16784 typedef struct LDKCVec_OutboundHTLCDetailsZ {
16786 * The elements in the array.
16787 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
16789 struct LDKOutboundHTLCDetails *data;
16791 * The number of elements pointed to by `data`.
16794 } LDKCVec_OutboundHTLCDetailsZ;
16797 * The contents of CResult_ChannelDetailsDecodeErrorZ
16799 typedef union LDKCResult_ChannelDetailsDecodeErrorZPtr {
16801 * A pointer to the contents in the success state.
16802 * Reading from this pointer when `result_ok` is not set is undefined.
16804 struct LDKChannelDetails *result;
16806 * A pointer to the contents in the error state.
16807 * Reading from this pointer when `result_ok` is set is undefined.
16809 struct LDKDecodeError *err;
16810 } LDKCResult_ChannelDetailsDecodeErrorZPtr;
16813 * A CResult_ChannelDetailsDecodeErrorZ represents the result of a fallible operation,
16814 * containing a crate::lightning::ln::channel_state::ChannelDetails on success and a crate::lightning::ln::msgs::DecodeError on failure.
16815 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
16817 typedef struct LDKCResult_ChannelDetailsDecodeErrorZ {
16819 * The contents of this CResult_ChannelDetailsDecodeErrorZ, accessible via either
16820 * `err` or `result` depending on the state of `result_ok`.
16822 union LDKCResult_ChannelDetailsDecodeErrorZPtr contents;
16824 * Whether this CResult_ChannelDetailsDecodeErrorZ represents a success state.
16827 } LDKCResult_ChannelDetailsDecodeErrorZ;
16830 * The contents of CResult_ChannelShutdownStateDecodeErrorZ
16832 typedef union LDKCResult_ChannelShutdownStateDecodeErrorZPtr {
16834 * A pointer to the contents in the success state.
16835 * Reading from this pointer when `result_ok` is not set is undefined.
16837 enum LDKChannelShutdownState *result;
16839 * A pointer to the contents in the error state.
16840 * Reading from this pointer when `result_ok` is set is undefined.
16842 struct LDKDecodeError *err;
16843 } LDKCResult_ChannelShutdownStateDecodeErrorZPtr;
16846 * A CResult_ChannelShutdownStateDecodeErrorZ represents the result of a fallible operation,
16847 * containing a crate::lightning::ln::channel_state::ChannelShutdownState on success and a crate::lightning::ln::msgs::DecodeError on failure.
16848 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
16850 typedef struct LDKCResult_ChannelShutdownStateDecodeErrorZ {
16852 * The contents of this CResult_ChannelShutdownStateDecodeErrorZ, accessible via either
16853 * `err` or `result` depending on the state of `result_ok`.
16855 union LDKCResult_ChannelShutdownStateDecodeErrorZPtr contents;
16857 * Whether this CResult_ChannelShutdownStateDecodeErrorZ represents a success state.
16860 } LDKCResult_ChannelShutdownStateDecodeErrorZ;
16865 * A simple future which can complete once, and calls some callback(s) when it does so.
16867 typedef struct MUST_USE_STRUCT LDKFuture {
16869 * A pointer to the opaque Rust object.
16870 * Nearly everywhere, inner must be non-null, however in places where
16871 * the Rust equivalent takes an Option, it may be set to null to indicate None.
16873 LDKnativeFuture *inner;
16875 * Indicates that this is the only struct which contains the same pointer.
16876 * Rust functions which take ownership of an object provided via an argument require
16877 * this to be true and invalidate the object pointed to by inner.
16883 * A dynamically-allocated array of crate::lightning::util::wakers::Futures of arbitrary size.
16884 * This corresponds to std::vector in C++
16886 typedef struct LDKCVec_FutureZ {
16888 * The elements in the array.
16889 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
16891 struct LDKFuture *data;
16893 * The number of elements pointed to by `data`.
16899 * The contents of CResult_OffersMessageDecodeErrorZ
16901 typedef union LDKCResult_OffersMessageDecodeErrorZPtr {
16903 * A pointer to the contents in the success state.
16904 * Reading from this pointer when `result_ok` is not set is undefined.
16906 struct LDKOffersMessage *result;
16908 * A pointer to the contents in the error state.
16909 * Reading from this pointer when `result_ok` is set is undefined.
16911 struct LDKDecodeError *err;
16912 } LDKCResult_OffersMessageDecodeErrorZPtr;
16915 * A CResult_OffersMessageDecodeErrorZ represents the result of a fallible operation,
16916 * containing a crate::lightning::onion_message::offers::OffersMessage on success and a crate::lightning::ln::msgs::DecodeError on failure.
16917 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
16919 typedef struct LDKCResult_OffersMessageDecodeErrorZ {
16921 * The contents of this CResult_OffersMessageDecodeErrorZ, accessible via either
16922 * `err` or `result` depending on the state of `result_ok`.
16924 union LDKCResult_OffersMessageDecodeErrorZPtr contents;
16926 * Whether this CResult_OffersMessageDecodeErrorZ represents a success state.
16929 } LDKCResult_OffersMessageDecodeErrorZ;
16932 * An enum which can either contain a crate::lightning::ln::chan_utils::HTLCClaim or not
16934 typedef enum LDKCOption_HTLCClaimZ_Tag {
16936 * When we're in this state, this COption_HTLCClaimZ contains a crate::lightning::ln::chan_utils::HTLCClaim
16938 LDKCOption_HTLCClaimZ_Some,
16940 * When we're in this state, this COption_HTLCClaimZ contains nothing
16942 LDKCOption_HTLCClaimZ_None,
16944 * Must be last for serialization purposes
16946 LDKCOption_HTLCClaimZ_Sentinel,
16947 } LDKCOption_HTLCClaimZ_Tag;
16949 typedef struct LDKCOption_HTLCClaimZ {
16950 LDKCOption_HTLCClaimZ_Tag tag;
16953 enum LDKHTLCClaim some;
16956 } LDKCOption_HTLCClaimZ;
16961 * Implements the per-commitment secret storage scheme from
16962 * [BOLT 3](https://github.com/lightning/bolts/blob/dcbf8583976df087c79c3ce0b535311212e6812d/03-transactions.md#efficient-per-commitment-secret-storage).
16964 * Allows us to keep track of all of the revocation secrets of our counterparty in just 50*32 bytes
16967 typedef struct MUST_USE_STRUCT LDKCounterpartyCommitmentSecrets {
16969 * A pointer to the opaque Rust object.
16970 * Nearly everywhere, inner must be non-null, however in places where
16971 * the Rust equivalent takes an Option, it may be set to null to indicate None.
16973 LDKnativeCounterpartyCommitmentSecrets *inner;
16975 * Indicates that this is the only struct which contains the same pointer.
16976 * Rust functions which take ownership of an object provided via an argument require
16977 * this to be true and invalidate the object pointed to by inner.
16980 } LDKCounterpartyCommitmentSecrets;
16983 * The contents of CResult_CounterpartyCommitmentSecretsDecodeErrorZ
16985 typedef union LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZPtr {
16987 * A pointer to the contents in the success state.
16988 * Reading from this pointer when `result_ok` is not set is undefined.
16990 struct LDKCounterpartyCommitmentSecrets *result;
16992 * A pointer to the contents in the error state.
16993 * Reading from this pointer when `result_ok` is set is undefined.
16995 struct LDKDecodeError *err;
16996 } LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZPtr;
16999 * A CResult_CounterpartyCommitmentSecretsDecodeErrorZ represents the result of a fallible operation,
17000 * containing a crate::lightning::ln::chan_utils::CounterpartyCommitmentSecrets on success and a crate::lightning::ln::msgs::DecodeError on failure.
17001 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
17003 typedef struct LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ {
17005 * The contents of this CResult_CounterpartyCommitmentSecretsDecodeErrorZ, accessible via either
17006 * `err` or `result` depending on the state of `result_ok`.
17008 union LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZPtr contents;
17010 * Whether this CResult_CounterpartyCommitmentSecretsDecodeErrorZ represents a success state.
17013 } LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ;
17018 * The set of public keys which are used in the creation of one commitment transaction.
17019 * These are derived from the channel base keys and per-commitment data.
17021 * A broadcaster key is provided from potential broadcaster of the computed transaction.
17022 * A countersignatory key is coming from a protocol participant unable to broadcast the
17025 * These keys are assumed to be good, either because the code derived them from
17026 * channel basepoints via the new function, or they were obtained via
17027 * CommitmentTransaction.trust().keys() because we trusted the source of the
17028 * pre-calculated keys.
17030 typedef struct MUST_USE_STRUCT LDKTxCreationKeys {
17032 * A pointer to the opaque Rust object.
17033 * Nearly everywhere, inner must be non-null, however in places where
17034 * the Rust equivalent takes an Option, it may be set to null to indicate None.
17036 LDKnativeTxCreationKeys *inner;
17038 * Indicates that this is the only struct which contains the same pointer.
17039 * Rust functions which take ownership of an object provided via an argument require
17040 * this to be true and invalidate the object pointed to by inner.
17043 } LDKTxCreationKeys;
17046 * The contents of CResult_TxCreationKeysDecodeErrorZ
17048 typedef union LDKCResult_TxCreationKeysDecodeErrorZPtr {
17050 * A pointer to the contents in the success state.
17051 * Reading from this pointer when `result_ok` is not set is undefined.
17053 struct LDKTxCreationKeys *result;
17055 * A pointer to the contents in the error state.
17056 * Reading from this pointer when `result_ok` is set is undefined.
17058 struct LDKDecodeError *err;
17059 } LDKCResult_TxCreationKeysDecodeErrorZPtr;
17062 * A CResult_TxCreationKeysDecodeErrorZ represents the result of a fallible operation,
17063 * containing a crate::lightning::ln::chan_utils::TxCreationKeys on success and a crate::lightning::ln::msgs::DecodeError on failure.
17064 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
17066 typedef struct LDKCResult_TxCreationKeysDecodeErrorZ {
17068 * The contents of this CResult_TxCreationKeysDecodeErrorZ, accessible via either
17069 * `err` or `result` depending on the state of `result_ok`.
17071 union LDKCResult_TxCreationKeysDecodeErrorZPtr contents;
17073 * Whether this CResult_TxCreationKeysDecodeErrorZ represents a success state.
17076 } LDKCResult_TxCreationKeysDecodeErrorZ;
17079 * The contents of CResult_ChannelPublicKeysDecodeErrorZ
17081 typedef union LDKCResult_ChannelPublicKeysDecodeErrorZPtr {
17083 * A pointer to the contents in the success state.
17084 * Reading from this pointer when `result_ok` is not set is undefined.
17086 struct LDKChannelPublicKeys *result;
17088 * A pointer to the contents in the error state.
17089 * Reading from this pointer when `result_ok` is set is undefined.
17091 struct LDKDecodeError *err;
17092 } LDKCResult_ChannelPublicKeysDecodeErrorZPtr;
17095 * A CResult_ChannelPublicKeysDecodeErrorZ represents the result of a fallible operation,
17096 * containing a crate::lightning::ln::chan_utils::ChannelPublicKeys on success and a crate::lightning::ln::msgs::DecodeError on failure.
17097 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
17099 typedef struct LDKCResult_ChannelPublicKeysDecodeErrorZ {
17101 * The contents of this CResult_ChannelPublicKeysDecodeErrorZ, accessible via either
17102 * `err` or `result` depending on the state of `result_ok`.
17104 union LDKCResult_ChannelPublicKeysDecodeErrorZPtr contents;
17106 * Whether this CResult_ChannelPublicKeysDecodeErrorZ represents a success state.
17109 } LDKCResult_ChannelPublicKeysDecodeErrorZ;
17112 * The contents of CResult_HTLCOutputInCommitmentDecodeErrorZ
17114 typedef union LDKCResult_HTLCOutputInCommitmentDecodeErrorZPtr {
17116 * A pointer to the contents in the success state.
17117 * Reading from this pointer when `result_ok` is not set is undefined.
17119 struct LDKHTLCOutputInCommitment *result;
17121 * A pointer to the contents in the error state.
17122 * Reading from this pointer when `result_ok` is set is undefined.
17124 struct LDKDecodeError *err;
17125 } LDKCResult_HTLCOutputInCommitmentDecodeErrorZPtr;
17128 * A CResult_HTLCOutputInCommitmentDecodeErrorZ represents the result of a fallible operation,
17129 * containing a crate::lightning::ln::chan_utils::HTLCOutputInCommitment on success and a crate::lightning::ln::msgs::DecodeError on failure.
17130 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
17132 typedef struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ {
17134 * The contents of this CResult_HTLCOutputInCommitmentDecodeErrorZ, accessible via either
17135 * `err` or `result` depending on the state of `result_ok`.
17137 union LDKCResult_HTLCOutputInCommitmentDecodeErrorZPtr contents;
17139 * Whether this CResult_HTLCOutputInCommitmentDecodeErrorZ represents a success state.
17142 } LDKCResult_HTLCOutputInCommitmentDecodeErrorZ;
17147 * Late-bound per-channel counterparty data used to build transactions.
17149 typedef struct MUST_USE_STRUCT LDKCounterpartyChannelTransactionParameters {
17151 * A pointer to the opaque Rust object.
17152 * Nearly everywhere, inner must be non-null, however in places where
17153 * the Rust equivalent takes an Option, it may be set to null to indicate None.
17155 LDKnativeCounterpartyChannelTransactionParameters *inner;
17157 * Indicates that this is the only struct which contains the same pointer.
17158 * Rust functions which take ownership of an object provided via an argument require
17159 * this to be true and invalidate the object pointed to by inner.
17162 } LDKCounterpartyChannelTransactionParameters;
17165 * The contents of CResult_CounterpartyChannelTransactionParametersDecodeErrorZ
17167 typedef union LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZPtr {
17169 * A pointer to the contents in the success state.
17170 * Reading from this pointer when `result_ok` is not set is undefined.
17172 struct LDKCounterpartyChannelTransactionParameters *result;
17174 * A pointer to the contents in the error state.
17175 * Reading from this pointer when `result_ok` is set is undefined.
17177 struct LDKDecodeError *err;
17178 } LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZPtr;
17181 * A CResult_CounterpartyChannelTransactionParametersDecodeErrorZ represents the result of a fallible operation,
17182 * containing a crate::lightning::ln::chan_utils::CounterpartyChannelTransactionParameters on success and a crate::lightning::ln::msgs::DecodeError on failure.
17183 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
17185 typedef struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ {
17187 * The contents of this CResult_CounterpartyChannelTransactionParametersDecodeErrorZ, accessible via either
17188 * `err` or `result` depending on the state of `result_ok`.
17190 union LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZPtr contents;
17192 * Whether this CResult_CounterpartyChannelTransactionParametersDecodeErrorZ represents a success state.
17195 } LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ;
17198 * The contents of CResult_ChannelTransactionParametersDecodeErrorZ
17200 typedef union LDKCResult_ChannelTransactionParametersDecodeErrorZPtr {
17202 * A pointer to the contents in the success state.
17203 * Reading from this pointer when `result_ok` is not set is undefined.
17205 struct LDKChannelTransactionParameters *result;
17207 * A pointer to the contents in the error state.
17208 * Reading from this pointer when `result_ok` is set is undefined.
17210 struct LDKDecodeError *err;
17211 } LDKCResult_ChannelTransactionParametersDecodeErrorZPtr;
17214 * A CResult_ChannelTransactionParametersDecodeErrorZ represents the result of a fallible operation,
17215 * containing a crate::lightning::ln::chan_utils::ChannelTransactionParameters on success and a crate::lightning::ln::msgs::DecodeError on failure.
17216 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
17218 typedef struct LDKCResult_ChannelTransactionParametersDecodeErrorZ {
17220 * The contents of this CResult_ChannelTransactionParametersDecodeErrorZ, accessible via either
17221 * `err` or `result` depending on the state of `result_ok`.
17223 union LDKCResult_ChannelTransactionParametersDecodeErrorZPtr contents;
17225 * Whether this CResult_ChannelTransactionParametersDecodeErrorZ represents a success state.
17228 } LDKCResult_ChannelTransactionParametersDecodeErrorZ;
17231 * The contents of CResult_HolderCommitmentTransactionDecodeErrorZ
17233 typedef union LDKCResult_HolderCommitmentTransactionDecodeErrorZPtr {
17235 * A pointer to the contents in the success state.
17236 * Reading from this pointer when `result_ok` is not set is undefined.
17238 struct LDKHolderCommitmentTransaction *result;
17240 * A pointer to the contents in the error state.
17241 * Reading from this pointer when `result_ok` is set is undefined.
17243 struct LDKDecodeError *err;
17244 } LDKCResult_HolderCommitmentTransactionDecodeErrorZPtr;
17247 * A CResult_HolderCommitmentTransactionDecodeErrorZ represents the result of a fallible operation,
17248 * containing a crate::lightning::ln::chan_utils::HolderCommitmentTransaction on success and a crate::lightning::ln::msgs::DecodeError on failure.
17249 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
17251 typedef struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ {
17253 * The contents of this CResult_HolderCommitmentTransactionDecodeErrorZ, accessible via either
17254 * `err` or `result` depending on the state of `result_ok`.
17256 union LDKCResult_HolderCommitmentTransactionDecodeErrorZPtr contents;
17258 * Whether this CResult_HolderCommitmentTransactionDecodeErrorZ represents a success state.
17261 } LDKCResult_HolderCommitmentTransactionDecodeErrorZ;
17266 * A pre-built Bitcoin commitment transaction and its txid.
17268 typedef struct MUST_USE_STRUCT LDKBuiltCommitmentTransaction {
17270 * A pointer to the opaque Rust object.
17271 * Nearly everywhere, inner must be non-null, however in places where
17272 * the Rust equivalent takes an Option, it may be set to null to indicate None.
17274 LDKnativeBuiltCommitmentTransaction *inner;
17276 * Indicates that this is the only struct which contains the same pointer.
17277 * Rust functions which take ownership of an object provided via an argument require
17278 * this to be true and invalidate the object pointed to by inner.
17281 } LDKBuiltCommitmentTransaction;
17284 * The contents of CResult_BuiltCommitmentTransactionDecodeErrorZ
17286 typedef union LDKCResult_BuiltCommitmentTransactionDecodeErrorZPtr {
17288 * A pointer to the contents in the success state.
17289 * Reading from this pointer when `result_ok` is not set is undefined.
17291 struct LDKBuiltCommitmentTransaction *result;
17293 * A pointer to the contents in the error state.
17294 * Reading from this pointer when `result_ok` is set is undefined.
17296 struct LDKDecodeError *err;
17297 } LDKCResult_BuiltCommitmentTransactionDecodeErrorZPtr;
17300 * A CResult_BuiltCommitmentTransactionDecodeErrorZ represents the result of a fallible operation,
17301 * containing a crate::lightning::ln::chan_utils::BuiltCommitmentTransaction on success and a crate::lightning::ln::msgs::DecodeError on failure.
17302 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
17304 typedef struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ {
17306 * The contents of this CResult_BuiltCommitmentTransactionDecodeErrorZ, accessible via either
17307 * `err` or `result` depending on the state of `result_ok`.
17309 union LDKCResult_BuiltCommitmentTransactionDecodeErrorZPtr contents;
17311 * Whether this CResult_BuiltCommitmentTransactionDecodeErrorZ represents a success state.
17314 } LDKCResult_BuiltCommitmentTransactionDecodeErrorZ;
17319 * A wrapper on ClosingTransaction indicating that the built bitcoin
17320 * transaction is trusted.
17322 * See trust() and verify() functions on CommitmentTransaction.
17324 * This structure implements Deref.
17326 typedef struct MUST_USE_STRUCT LDKTrustedClosingTransaction {
17328 * A pointer to the opaque Rust object.
17329 * Nearly everywhere, inner must be non-null, however in places where
17330 * the Rust equivalent takes an Option, it may be set to null to indicate None.
17332 LDKnativeTrustedClosingTransaction *inner;
17334 * Indicates that this is the only struct which contains the same pointer.
17335 * Rust functions which take ownership of an object provided via an argument require
17336 * this to be true and invalidate the object pointed to by inner.
17339 } LDKTrustedClosingTransaction;
17342 * The contents of CResult_TrustedClosingTransactionNoneZ
17344 typedef union LDKCResult_TrustedClosingTransactionNoneZPtr {
17346 * A pointer to the contents in the success state.
17347 * Reading from this pointer when `result_ok` is not set is undefined.
17349 struct LDKTrustedClosingTransaction *result;
17351 * Note that this value is always NULL, as there are no contents in the Err variant
17354 } LDKCResult_TrustedClosingTransactionNoneZPtr;
17357 * A CResult_TrustedClosingTransactionNoneZ represents the result of a fallible operation,
17358 * containing a crate::lightning::ln::chan_utils::TrustedClosingTransaction on success and a () on failure.
17359 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
17361 typedef struct LDKCResult_TrustedClosingTransactionNoneZ {
17363 * The contents of this CResult_TrustedClosingTransactionNoneZ, accessible via either
17364 * `err` or `result` depending on the state of `result_ok`.
17366 union LDKCResult_TrustedClosingTransactionNoneZPtr contents;
17368 * Whether this CResult_TrustedClosingTransactionNoneZ represents a success state.
17371 } LDKCResult_TrustedClosingTransactionNoneZ;
17374 * The contents of CResult_CommitmentTransactionDecodeErrorZ
17376 typedef union LDKCResult_CommitmentTransactionDecodeErrorZPtr {
17378 * A pointer to the contents in the success state.
17379 * Reading from this pointer when `result_ok` is not set is undefined.
17381 struct LDKCommitmentTransaction *result;
17383 * A pointer to the contents in the error state.
17384 * Reading from this pointer when `result_ok` is set is undefined.
17386 struct LDKDecodeError *err;
17387 } LDKCResult_CommitmentTransactionDecodeErrorZPtr;
17390 * A CResult_CommitmentTransactionDecodeErrorZ represents the result of a fallible operation,
17391 * containing a crate::lightning::ln::chan_utils::CommitmentTransaction on success and a crate::lightning::ln::msgs::DecodeError on failure.
17392 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
17394 typedef struct LDKCResult_CommitmentTransactionDecodeErrorZ {
17396 * The contents of this CResult_CommitmentTransactionDecodeErrorZ, accessible via either
17397 * `err` or `result` depending on the state of `result_ok`.
17399 union LDKCResult_CommitmentTransactionDecodeErrorZPtr contents;
17401 * Whether this CResult_CommitmentTransactionDecodeErrorZ represents a success state.
17404 } LDKCResult_CommitmentTransactionDecodeErrorZ;
17409 * A wrapper on CommitmentTransaction indicating that the derived fields (the built bitcoin
17410 * transaction and the transaction creation keys) are trusted.
17412 * See trust() and verify() functions on CommitmentTransaction.
17414 * This structure implements Deref.
17416 typedef struct MUST_USE_STRUCT LDKTrustedCommitmentTransaction {
17418 * A pointer to the opaque Rust object.
17419 * Nearly everywhere, inner must be non-null, however in places where
17420 * the Rust equivalent takes an Option, it may be set to null to indicate None.
17422 LDKnativeTrustedCommitmentTransaction *inner;
17424 * Indicates that this is the only struct which contains the same pointer.
17425 * Rust functions which take ownership of an object provided via an argument require
17426 * this to be true and invalidate the object pointed to by inner.
17429 } LDKTrustedCommitmentTransaction;
17432 * The contents of CResult_TrustedCommitmentTransactionNoneZ
17434 typedef union LDKCResult_TrustedCommitmentTransactionNoneZPtr {
17436 * A pointer to the contents in the success state.
17437 * Reading from this pointer when `result_ok` is not set is undefined.
17439 struct LDKTrustedCommitmentTransaction *result;
17441 * Note that this value is always NULL, as there are no contents in the Err variant
17444 } LDKCResult_TrustedCommitmentTransactionNoneZPtr;
17447 * A CResult_TrustedCommitmentTransactionNoneZ represents the result of a fallible operation,
17448 * containing a crate::lightning::ln::chan_utils::TrustedCommitmentTransaction on success and a () on failure.
17449 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
17451 typedef struct LDKCResult_TrustedCommitmentTransactionNoneZ {
17453 * The contents of this CResult_TrustedCommitmentTransactionNoneZ, accessible via either
17454 * `err` or `result` depending on the state of `result_ok`.
17456 union LDKCResult_TrustedCommitmentTransactionNoneZPtr contents;
17458 * Whether this CResult_TrustedCommitmentTransactionNoneZ represents a success state.
17461 } LDKCResult_TrustedCommitmentTransactionNoneZ;
17464 * The contents of CResult_CVec_ECDSASignatureZNoneZ
17466 typedef union LDKCResult_CVec_ECDSASignatureZNoneZPtr {
17468 * A pointer to the contents in the success state.
17469 * Reading from this pointer when `result_ok` is not set is undefined.
17471 struct LDKCVec_ECDSASignatureZ *result;
17473 * Note that this value is always NULL, as there are no contents in the Err variant
17476 } LDKCResult_CVec_ECDSASignatureZNoneZPtr;
17479 * A CResult_CVec_ECDSASignatureZNoneZ represents the result of a fallible operation,
17480 * containing a crate::c_types::derived::CVec_ECDSASignatureZ on success and a () on failure.
17481 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
17483 typedef struct LDKCResult_CVec_ECDSASignatureZNoneZ {
17485 * The contents of this CResult_CVec_ECDSASignatureZNoneZ, accessible via either
17486 * `err` or `result` depending on the state of `result_ok`.
17488 union LDKCResult_CVec_ECDSASignatureZNoneZPtr contents;
17490 * Whether this CResult_CVec_ECDSASignatureZNoneZ represents a success state.
17493 } LDKCResult_CVec_ECDSASignatureZNoneZ;
17496 * An enum which can either contain a usize or not
17498 typedef enum LDKCOption_usizeZ_Tag {
17500 * When we're in this state, this COption_usizeZ contains a usize
17502 LDKCOption_usizeZ_Some,
17504 * When we're in this state, this COption_usizeZ contains nothing
17506 LDKCOption_usizeZ_None,
17508 * Must be last for serialization purposes
17510 LDKCOption_usizeZ_Sentinel,
17511 } LDKCOption_usizeZ_Tag;
17513 typedef struct LDKCOption_usizeZ {
17514 LDKCOption_usizeZ_Tag tag;
17520 } LDKCOption_usizeZ;
17523 * The contents of CResult_ShutdownScriptDecodeErrorZ
17525 typedef union LDKCResult_ShutdownScriptDecodeErrorZPtr {
17527 * A pointer to the contents in the success state.
17528 * Reading from this pointer when `result_ok` is not set is undefined.
17530 struct LDKShutdownScript *result;
17532 * A pointer to the contents in the error state.
17533 * Reading from this pointer when `result_ok` is set is undefined.
17535 struct LDKDecodeError *err;
17536 } LDKCResult_ShutdownScriptDecodeErrorZPtr;
17539 * A CResult_ShutdownScriptDecodeErrorZ represents the result of a fallible operation,
17540 * containing a crate::lightning::ln::script::ShutdownScript on success and a crate::lightning::ln::msgs::DecodeError on failure.
17541 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
17543 typedef struct LDKCResult_ShutdownScriptDecodeErrorZ {
17545 * The contents of this CResult_ShutdownScriptDecodeErrorZ, accessible via either
17546 * `err` or `result` depending on the state of `result_ok`.
17548 union LDKCResult_ShutdownScriptDecodeErrorZPtr contents;
17550 * Whether this CResult_ShutdownScriptDecodeErrorZ represents a success state.
17553 } LDKCResult_ShutdownScriptDecodeErrorZ;
17558 * An error occurring when converting from [`ScriptBuf`] to [`ShutdownScript`].
17560 typedef struct MUST_USE_STRUCT LDKInvalidShutdownScript {
17562 * A pointer to the opaque Rust object.
17563 * Nearly everywhere, inner must be non-null, however in places where
17564 * the Rust equivalent takes an Option, it may be set to null to indicate None.
17566 LDKnativeInvalidShutdownScript *inner;
17568 * Indicates that this is the only struct which contains the same pointer.
17569 * Rust functions which take ownership of an object provided via an argument require
17570 * this to be true and invalidate the object pointed to by inner.
17573 } LDKInvalidShutdownScript;
17576 * The contents of CResult_ShutdownScriptInvalidShutdownScriptZ
17578 typedef union LDKCResult_ShutdownScriptInvalidShutdownScriptZPtr {
17580 * A pointer to the contents in the success state.
17581 * Reading from this pointer when `result_ok` is not set is undefined.
17583 struct LDKShutdownScript *result;
17585 * A pointer to the contents in the error state.
17586 * Reading from this pointer when `result_ok` is set is undefined.
17588 struct LDKInvalidShutdownScript *err;
17589 } LDKCResult_ShutdownScriptInvalidShutdownScriptZPtr;
17592 * A CResult_ShutdownScriptInvalidShutdownScriptZ represents the result of a fallible operation,
17593 * containing a crate::lightning::ln::script::ShutdownScript on success and a crate::lightning::ln::script::InvalidShutdownScript on failure.
17594 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
17596 typedef struct LDKCResult_ShutdownScriptInvalidShutdownScriptZ {
17598 * The contents of this CResult_ShutdownScriptInvalidShutdownScriptZ, accessible via either
17599 * `err` or `result` depending on the state of `result_ok`.
17601 union LDKCResult_ShutdownScriptInvalidShutdownScriptZPtr contents;
17603 * Whether this CResult_ShutdownScriptInvalidShutdownScriptZ represents a success state.
17606 } LDKCResult_ShutdownScriptInvalidShutdownScriptZ;
17609 * Some information provided on receipt of payment depends on whether the payment received is a
17610 * spontaneous payment or a \"conventional\" lightning payment that's paying an invoice.
17612 typedef enum LDKPaymentPurpose_Tag {
17614 * A payment for a BOLT 11 invoice.
17616 LDKPaymentPurpose_Bolt11InvoicePayment,
17618 * A payment for a BOLT 12 [`Offer`].
17620 * [`Offer`]: crate::offers::offer::Offer
17622 LDKPaymentPurpose_Bolt12OfferPayment,
17624 * A payment for a BOLT 12 [`Refund`].
17626 * [`Refund`]: crate::offers::refund::Refund
17628 LDKPaymentPurpose_Bolt12RefundPayment,
17630 * Because this is a spontaneous payment, the payer generated their own preimage rather than us
17631 * (the payee) providing a preimage.
17633 LDKPaymentPurpose_SpontaneousPayment,
17635 * Must be last for serialization purposes
17637 LDKPaymentPurpose_Sentinel,
17638 } LDKPaymentPurpose_Tag;
17640 typedef struct LDKPaymentPurpose_LDKBolt11InvoicePayment_Body {
17642 * The preimage to the payment_hash, if the payment hash (and secret) were fetched via
17643 * [`ChannelManager::create_inbound_payment`]. When handling [`Event::PaymentClaimable`],
17644 * this can be passed directly to [`ChannelManager::claim_funds`] to claim the payment. No
17645 * action is needed when seen in [`Event::PaymentClaimed`].
17647 * [`ChannelManager::create_inbound_payment`]: crate::ln::channelmanager::ChannelManager::create_inbound_payment
17648 * [`ChannelManager::claim_funds`]: crate::ln::channelmanager::ChannelManager::claim_funds
17650 struct LDKCOption_ThirtyTwoBytesZ payment_preimage;
17652 * The \"payment secret\". This authenticates the sender to the recipient, preventing a
17653 * number of deanonymization attacks during the routing process.
17654 * It is provided here for your reference, however its accuracy is enforced directly by
17655 * [`ChannelManager`] using the values you previously provided to
17656 * [`ChannelManager::create_inbound_payment`] or
17657 * [`ChannelManager::create_inbound_payment_for_hash`].
17659 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
17660 * [`ChannelManager::create_inbound_payment`]: crate::ln::channelmanager::ChannelManager::create_inbound_payment
17661 * [`ChannelManager::create_inbound_payment_for_hash`]: crate::ln::channelmanager::ChannelManager::create_inbound_payment_for_hash
17663 struct LDKThirtyTwoBytes payment_secret;
17664 } LDKPaymentPurpose_LDKBolt11InvoicePayment_Body;
17666 typedef struct LDKPaymentPurpose_LDKBolt12OfferPayment_Body {
17668 * The preimage to the payment hash. When handling [`Event::PaymentClaimable`], this can be
17669 * passed directly to [`ChannelManager::claim_funds`], if provided. No action is needed
17670 * when seen in [`Event::PaymentClaimed`].
17672 * [`ChannelManager::claim_funds`]: crate::ln::channelmanager::ChannelManager::claim_funds
17674 struct LDKCOption_ThirtyTwoBytesZ payment_preimage;
17676 * The secret used to authenticate the sender to the recipient, preventing a number of
17677 * de-anonymization attacks while routing a payment.
17679 * See [`PaymentPurpose::Bolt11InvoicePayment::payment_secret`] for further details.
17681 struct LDKThirtyTwoBytes payment_secret;
17683 * The context of the payment such as information about the corresponding [`Offer`] and
17684 * [`InvoiceRequest`].
17686 * [`Offer`]: crate::offers::offer::Offer
17687 * [`InvoiceRequest`]: crate::offers::invoice_request::InvoiceRequest
17689 struct LDKBolt12OfferContext payment_context;
17690 } LDKPaymentPurpose_LDKBolt12OfferPayment_Body;
17692 typedef struct LDKPaymentPurpose_LDKBolt12RefundPayment_Body {
17694 * The preimage to the payment hash. When handling [`Event::PaymentClaimable`], this can be
17695 * passed directly to [`ChannelManager::claim_funds`], if provided. No action is needed
17696 * when seen in [`Event::PaymentClaimed`].
17698 * [`ChannelManager::claim_funds`]: crate::ln::channelmanager::ChannelManager::claim_funds
17700 struct LDKCOption_ThirtyTwoBytesZ payment_preimage;
17702 * The secret used to authenticate the sender to the recipient, preventing a number of
17703 * de-anonymization attacks while routing a payment.
17705 * See [`PaymentPurpose::Bolt11InvoicePayment::payment_secret`] for further details.
17707 struct LDKThirtyTwoBytes payment_secret;
17709 * The context of the payment such as information about the corresponding [`Refund`].
17711 * [`Refund`]: crate::offers::refund::Refund
17713 struct LDKBolt12RefundContext payment_context;
17714 } LDKPaymentPurpose_LDKBolt12RefundPayment_Body;
17716 typedef struct MUST_USE_STRUCT LDKPaymentPurpose {
17717 LDKPaymentPurpose_Tag tag;
17719 LDKPaymentPurpose_LDKBolt11InvoicePayment_Body bolt11_invoice_payment;
17720 LDKPaymentPurpose_LDKBolt12OfferPayment_Body bolt12_offer_payment;
17721 LDKPaymentPurpose_LDKBolt12RefundPayment_Body bolt12_refund_payment;
17723 struct LDKThirtyTwoBytes spontaneous_payment;
17726 } LDKPaymentPurpose;
17729 * The contents of CResult_PaymentPurposeDecodeErrorZ
17731 typedef union LDKCResult_PaymentPurposeDecodeErrorZPtr {
17733 * A pointer to the contents in the success state.
17734 * Reading from this pointer when `result_ok` is not set is undefined.
17736 struct LDKPaymentPurpose *result;
17738 * A pointer to the contents in the error state.
17739 * Reading from this pointer when `result_ok` is set is undefined.
17741 struct LDKDecodeError *err;
17742 } LDKCResult_PaymentPurposeDecodeErrorZPtr;
17745 * A CResult_PaymentPurposeDecodeErrorZ represents the result of a fallible operation,
17746 * containing a crate::lightning::events::PaymentPurpose on success and a crate::lightning::ln::msgs::DecodeError on failure.
17747 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
17749 typedef struct LDKCResult_PaymentPurposeDecodeErrorZ {
17751 * The contents of this CResult_PaymentPurposeDecodeErrorZ, accessible via either
17752 * `err` or `result` depending on the state of `result_ok`.
17754 union LDKCResult_PaymentPurposeDecodeErrorZPtr contents;
17756 * Whether this CResult_PaymentPurposeDecodeErrorZ represents a success state.
17759 } LDKCResult_PaymentPurposeDecodeErrorZ;
17764 * Information about an HTLC that is part of a payment that can be claimed.
17766 typedef struct MUST_USE_STRUCT LDKClaimedHTLC {
17768 * A pointer to the opaque Rust object.
17769 * Nearly everywhere, inner must be non-null, however in places where
17770 * the Rust equivalent takes an Option, it may be set to null to indicate None.
17772 LDKnativeClaimedHTLC *inner;
17774 * Indicates that this is the only struct which contains the same pointer.
17775 * Rust functions which take ownership of an object provided via an argument require
17776 * this to be true and invalidate the object pointed to by inner.
17782 * The contents of CResult_ClaimedHTLCDecodeErrorZ
17784 typedef union LDKCResult_ClaimedHTLCDecodeErrorZPtr {
17786 * A pointer to the contents in the success state.
17787 * Reading from this pointer when `result_ok` is not set is undefined.
17789 struct LDKClaimedHTLC *result;
17791 * A pointer to the contents in the error state.
17792 * Reading from this pointer when `result_ok` is set is undefined.
17794 struct LDKDecodeError *err;
17795 } LDKCResult_ClaimedHTLCDecodeErrorZPtr;
17798 * A CResult_ClaimedHTLCDecodeErrorZ represents the result of a fallible operation,
17799 * containing a crate::lightning::events::ClaimedHTLC on success and a crate::lightning::ln::msgs::DecodeError on failure.
17800 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
17802 typedef struct LDKCResult_ClaimedHTLCDecodeErrorZ {
17804 * The contents of this CResult_ClaimedHTLCDecodeErrorZ, accessible via either
17805 * `err` or `result` depending on the state of `result_ok`.
17807 union LDKCResult_ClaimedHTLCDecodeErrorZPtr contents;
17809 * Whether this CResult_ClaimedHTLCDecodeErrorZ represents a success state.
17812 } LDKCResult_ClaimedHTLCDecodeErrorZ;
17815 * When the payment path failure took place and extra details about it. [`PathFailure::OnPath`] may
17816 * contain a [`NetworkUpdate`] that needs to be applied to the [`NetworkGraph`].
17818 * [`NetworkUpdate`]: crate::routing::gossip::NetworkUpdate
17819 * [`NetworkGraph`]: crate::routing::gossip::NetworkGraph
17821 typedef enum LDKPathFailure_Tag {
17823 * We failed to initially send the payment and no HTLC was committed to. Contains the relevant
17826 LDKPathFailure_InitialSend,
17828 * A hop on the path failed to forward our payment.
17830 LDKPathFailure_OnPath,
17832 * Must be last for serialization purposes
17834 LDKPathFailure_Sentinel,
17835 } LDKPathFailure_Tag;
17837 typedef struct LDKPathFailure_LDKInitialSend_Body {
17839 * The error surfaced from initial send.
17841 struct LDKAPIError err;
17842 } LDKPathFailure_LDKInitialSend_Body;
17844 typedef struct LDKPathFailure_LDKOnPath_Body {
17846 * If present, this [`NetworkUpdate`] should be applied to the [`NetworkGraph`] so that routing
17847 * decisions can take into account the update.
17849 * [`NetworkUpdate`]: crate::routing::gossip::NetworkUpdate
17850 * [`NetworkGraph`]: crate::routing::gossip::NetworkGraph
17852 struct LDKCOption_NetworkUpdateZ network_update;
17853 } LDKPathFailure_LDKOnPath_Body;
17855 typedef struct MUST_USE_STRUCT LDKPathFailure {
17856 LDKPathFailure_Tag tag;
17858 LDKPathFailure_LDKInitialSend_Body initial_send;
17859 LDKPathFailure_LDKOnPath_Body on_path;
17864 * An enum which can either contain a crate::lightning::events::PathFailure or not
17866 typedef enum LDKCOption_PathFailureZ_Tag {
17868 * When we're in this state, this COption_PathFailureZ contains a crate::lightning::events::PathFailure
17870 LDKCOption_PathFailureZ_Some,
17872 * When we're in this state, this COption_PathFailureZ contains nothing
17874 LDKCOption_PathFailureZ_None,
17876 * Must be last for serialization purposes
17878 LDKCOption_PathFailureZ_Sentinel,
17879 } LDKCOption_PathFailureZ_Tag;
17881 typedef struct LDKCOption_PathFailureZ {
17882 LDKCOption_PathFailureZ_Tag tag;
17885 struct LDKPathFailure some;
17888 } LDKCOption_PathFailureZ;
17891 * The contents of CResult_COption_PathFailureZDecodeErrorZ
17893 typedef union LDKCResult_COption_PathFailureZDecodeErrorZPtr {
17895 * A pointer to the contents in the success state.
17896 * Reading from this pointer when `result_ok` is not set is undefined.
17898 struct LDKCOption_PathFailureZ *result;
17900 * A pointer to the contents in the error state.
17901 * Reading from this pointer when `result_ok` is set is undefined.
17903 struct LDKDecodeError *err;
17904 } LDKCResult_COption_PathFailureZDecodeErrorZPtr;
17907 * A CResult_COption_PathFailureZDecodeErrorZ represents the result of a fallible operation,
17908 * containing a crate::c_types::derived::COption_PathFailureZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
17909 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
17911 typedef struct LDKCResult_COption_PathFailureZDecodeErrorZ {
17913 * The contents of this CResult_COption_PathFailureZDecodeErrorZ, accessible via either
17914 * `err` or `result` depending on the state of `result_ok`.
17916 union LDKCResult_COption_PathFailureZDecodeErrorZPtr contents;
17918 * Whether this CResult_COption_PathFailureZDecodeErrorZ represents a success state.
17921 } LDKCResult_COption_PathFailureZDecodeErrorZ;
17924 * An enum which can either contain a crate::lightning::events::ClosureReason or not
17926 typedef enum LDKCOption_ClosureReasonZ_Tag {
17928 * When we're in this state, this COption_ClosureReasonZ contains a crate::lightning::events::ClosureReason
17930 LDKCOption_ClosureReasonZ_Some,
17932 * When we're in this state, this COption_ClosureReasonZ contains nothing
17934 LDKCOption_ClosureReasonZ_None,
17936 * Must be last for serialization purposes
17938 LDKCOption_ClosureReasonZ_Sentinel,
17939 } LDKCOption_ClosureReasonZ_Tag;
17941 typedef struct LDKCOption_ClosureReasonZ {
17942 LDKCOption_ClosureReasonZ_Tag tag;
17945 struct LDKClosureReason some;
17948 } LDKCOption_ClosureReasonZ;
17951 * The contents of CResult_COption_ClosureReasonZDecodeErrorZ
17953 typedef union LDKCResult_COption_ClosureReasonZDecodeErrorZPtr {
17955 * A pointer to the contents in the success state.
17956 * Reading from this pointer when `result_ok` is not set is undefined.
17958 struct LDKCOption_ClosureReasonZ *result;
17960 * A pointer to the contents in the error state.
17961 * Reading from this pointer when `result_ok` is set is undefined.
17963 struct LDKDecodeError *err;
17964 } LDKCResult_COption_ClosureReasonZDecodeErrorZPtr;
17967 * A CResult_COption_ClosureReasonZDecodeErrorZ represents the result of a fallible operation,
17968 * containing a crate::c_types::derived::COption_ClosureReasonZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
17969 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
17971 typedef struct LDKCResult_COption_ClosureReasonZDecodeErrorZ {
17973 * The contents of this CResult_COption_ClosureReasonZDecodeErrorZ, accessible via either
17974 * `err` or `result` depending on the state of `result_ok`.
17976 union LDKCResult_COption_ClosureReasonZDecodeErrorZPtr contents;
17978 * Whether this CResult_COption_ClosureReasonZDecodeErrorZ represents a success state.
17981 } LDKCResult_COption_ClosureReasonZDecodeErrorZ;
17984 * Intended destination of a failed HTLC as indicated in [`Event::HTLCHandlingFailed`].
17986 typedef enum LDKHTLCDestination_Tag {
17988 * We tried forwarding to a channel but failed to do so. An example of such an instance is when
17989 * there is insufficient capacity in our outbound channel.
17991 LDKHTLCDestination_NextHopChannel,
17993 * Scenario where we are unsure of the next node to forward the HTLC to.
17995 LDKHTLCDestination_UnknownNextHop,
17997 * We couldn't forward to the outgoing scid. An example would be attempting to send a duplicate
18000 LDKHTLCDestination_InvalidForward,
18002 * We couldn't decode the incoming onion to obtain the forwarding details.
18004 LDKHTLCDestination_InvalidOnion,
18006 * Failure scenario where an HTLC may have been forwarded to be intended for us,
18007 * but is invalid for some reason, so we reject it.
18009 * Some of the reasons may include:
18011 * * Excess HTLCs for a payment that we have already fully received, over-paying for the
18013 * * The counterparty node modified the HTLC in transit,
18014 * * A probing attack where an intermediary node is trying to detect if we are the ultimate
18015 * recipient for a payment.
18017 LDKHTLCDestination_FailedPayment,
18019 * Must be last for serialization purposes
18021 LDKHTLCDestination_Sentinel,
18022 } LDKHTLCDestination_Tag;
18024 typedef struct LDKHTLCDestination_LDKNextHopChannel_Body {
18026 * The `node_id` of the next node. For backwards compatibility, this field is
18027 * marked as optional, versions prior to 0.0.110 may not always be able to provide
18028 * counterparty node information.
18030 * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
18032 struct LDKPublicKey node_id;
18034 * The outgoing `channel_id` between us and the next node.
18036 struct LDKChannelId channel_id;
18037 } LDKHTLCDestination_LDKNextHopChannel_Body;
18039 typedef struct LDKHTLCDestination_LDKUnknownNextHop_Body {
18041 * Short channel id we are requesting to forward an HTLC to.
18043 uint64_t requested_forward_scid;
18044 } LDKHTLCDestination_LDKUnknownNextHop_Body;
18046 typedef struct LDKHTLCDestination_LDKInvalidForward_Body {
18048 * Short channel id we are requesting to forward an HTLC to.
18050 uint64_t requested_forward_scid;
18051 } LDKHTLCDestination_LDKInvalidForward_Body;
18053 typedef struct LDKHTLCDestination_LDKFailedPayment_Body {
18055 * The payment hash of the payment we attempted to process.
18057 struct LDKThirtyTwoBytes payment_hash;
18058 } LDKHTLCDestination_LDKFailedPayment_Body;
18060 typedef struct MUST_USE_STRUCT LDKHTLCDestination {
18061 LDKHTLCDestination_Tag tag;
18063 LDKHTLCDestination_LDKNextHopChannel_Body next_hop_channel;
18064 LDKHTLCDestination_LDKUnknownNextHop_Body unknown_next_hop;
18065 LDKHTLCDestination_LDKInvalidForward_Body invalid_forward;
18066 LDKHTLCDestination_LDKFailedPayment_Body failed_payment;
18068 } LDKHTLCDestination;
18071 * An enum which can either contain a crate::lightning::events::HTLCDestination or not
18073 typedef enum LDKCOption_HTLCDestinationZ_Tag {
18075 * When we're in this state, this COption_HTLCDestinationZ contains a crate::lightning::events::HTLCDestination
18077 LDKCOption_HTLCDestinationZ_Some,
18079 * When we're in this state, this COption_HTLCDestinationZ contains nothing
18081 LDKCOption_HTLCDestinationZ_None,
18083 * Must be last for serialization purposes
18085 LDKCOption_HTLCDestinationZ_Sentinel,
18086 } LDKCOption_HTLCDestinationZ_Tag;
18088 typedef struct LDKCOption_HTLCDestinationZ {
18089 LDKCOption_HTLCDestinationZ_Tag tag;
18092 struct LDKHTLCDestination some;
18095 } LDKCOption_HTLCDestinationZ;
18098 * The contents of CResult_COption_HTLCDestinationZDecodeErrorZ
18100 typedef union LDKCResult_COption_HTLCDestinationZDecodeErrorZPtr {
18102 * A pointer to the contents in the success state.
18103 * Reading from this pointer when `result_ok` is not set is undefined.
18105 struct LDKCOption_HTLCDestinationZ *result;
18107 * A pointer to the contents in the error state.
18108 * Reading from this pointer when `result_ok` is set is undefined.
18110 struct LDKDecodeError *err;
18111 } LDKCResult_COption_HTLCDestinationZDecodeErrorZPtr;
18114 * A CResult_COption_HTLCDestinationZDecodeErrorZ represents the result of a fallible operation,
18115 * containing a crate::c_types::derived::COption_HTLCDestinationZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
18116 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
18118 typedef struct LDKCResult_COption_HTLCDestinationZDecodeErrorZ {
18120 * The contents of this CResult_COption_HTLCDestinationZDecodeErrorZ, accessible via either
18121 * `err` or `result` depending on the state of `result_ok`.
18123 union LDKCResult_COption_HTLCDestinationZDecodeErrorZPtr contents;
18125 * Whether this CResult_COption_HTLCDestinationZDecodeErrorZ represents a success state.
18128 } LDKCResult_COption_HTLCDestinationZDecodeErrorZ;
18131 * The contents of CResult_PaymentFailureReasonDecodeErrorZ
18133 typedef union LDKCResult_PaymentFailureReasonDecodeErrorZPtr {
18135 * A pointer to the contents in the success state.
18136 * Reading from this pointer when `result_ok` is not set is undefined.
18138 enum LDKPaymentFailureReason *result;
18140 * A pointer to the contents in the error state.
18141 * Reading from this pointer when `result_ok` is set is undefined.
18143 struct LDKDecodeError *err;
18144 } LDKCResult_PaymentFailureReasonDecodeErrorZPtr;
18147 * A CResult_PaymentFailureReasonDecodeErrorZ represents the result of a fallible operation,
18148 * containing a crate::lightning::events::PaymentFailureReason on success and a crate::lightning::ln::msgs::DecodeError on failure.
18149 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
18151 typedef struct LDKCResult_PaymentFailureReasonDecodeErrorZ {
18153 * The contents of this CResult_PaymentFailureReasonDecodeErrorZ, accessible via either
18154 * `err` or `result` depending on the state of `result_ok`.
18156 union LDKCResult_PaymentFailureReasonDecodeErrorZPtr contents;
18158 * Whether this CResult_PaymentFailureReasonDecodeErrorZ represents a success state.
18161 } LDKCResult_PaymentFailureReasonDecodeErrorZ;
18164 * An enum which can either contain a crate::c_types::U128 or not
18166 typedef enum LDKCOption_U128Z_Tag {
18168 * When we're in this state, this COption_U128Z contains a crate::c_types::U128
18170 LDKCOption_U128Z_Some,
18172 * When we're in this state, this COption_U128Z contains nothing
18174 LDKCOption_U128Z_None,
18176 * Must be last for serialization purposes
18178 LDKCOption_U128Z_Sentinel,
18179 } LDKCOption_U128Z_Tag;
18181 typedef struct LDKCOption_U128Z {
18182 LDKCOption_U128Z_Tag tag;
18185 struct LDKU128 some;
18188 } LDKCOption_U128Z;
18191 * A dynamically-allocated array of crate::lightning::events::ClaimedHTLCs of arbitrary size.
18192 * This corresponds to std::vector in C++
18194 typedef struct LDKCVec_ClaimedHTLCZ {
18196 * The elements in the array.
18197 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
18199 struct LDKClaimedHTLC *data;
18201 * The number of elements pointed to by `data`.
18204 } LDKCVec_ClaimedHTLCZ;
18207 * An enum which can either contain a crate::lightning::events::PaymentFailureReason or not
18209 typedef enum LDKCOption_PaymentFailureReasonZ_Tag {
18211 * When we're in this state, this COption_PaymentFailureReasonZ contains a crate::lightning::events::PaymentFailureReason
18213 LDKCOption_PaymentFailureReasonZ_Some,
18215 * When we're in this state, this COption_PaymentFailureReasonZ contains nothing
18217 LDKCOption_PaymentFailureReasonZ_None,
18219 * Must be last for serialization purposes
18221 LDKCOption_PaymentFailureReasonZ_Sentinel,
18222 } LDKCOption_PaymentFailureReasonZ_Tag;
18224 typedef struct LDKCOption_PaymentFailureReasonZ {
18225 LDKCOption_PaymentFailureReasonZ_Tag tag;
18228 enum LDKPaymentFailureReason some;
18231 } LDKCOption_PaymentFailureReasonZ;
18236 * A descriptor used to sign for a commitment transaction's anchor output.
18238 typedef struct MUST_USE_STRUCT LDKAnchorDescriptor {
18240 * A pointer to the opaque Rust object.
18241 * Nearly everywhere, inner must be non-null, however in places where
18242 * the Rust equivalent takes an Option, it may be set to null to indicate None.
18244 LDKnativeAnchorDescriptor *inner;
18246 * Indicates that this is the only struct which contains the same pointer.
18247 * Rust functions which take ownership of an object provided via an argument require
18248 * this to be true and invalidate the object pointed to by inner.
18251 } LDKAnchorDescriptor;
18254 * Represents the different types of transactions, originating from LDK, to be bumped.
18256 typedef enum LDKBumpTransactionEvent_Tag {
18258 * Indicates that a channel featuring anchor outputs is to be closed by broadcasting the local
18259 * commitment transaction. Since commitment transactions have a static feerate pre-agreed upon,
18260 * they may need additional fees to be attached through a child transaction using the popular
18261 * [Child-Pays-For-Parent](https://bitcoinops.org/en/topics/cpfp) fee bumping technique. This
18262 * child transaction must include the anchor input described within `anchor_descriptor` along
18263 * with additional inputs to meet the target feerate. Failure to meet the target feerate
18264 * decreases the confirmation odds of the transaction package (which includes the commitment
18265 * and child anchor transactions), possibly resulting in a loss of funds. Once the transaction
18266 * is constructed, it must be fully signed for and broadcast by the consumer of the event
18267 * along with the `commitment_tx` enclosed. Note that the `commitment_tx` must always be
18268 * broadcast first, as the child anchor transaction depends on it.
18270 * The consumer should be able to sign for any of the additional inputs included within the
18271 * child anchor transaction. To sign its anchor input, an [`EcdsaChannelSigner`] should be
18272 * re-derived through [`AnchorDescriptor::derive_channel_signer`]. The anchor input signature
18273 * can be computed with [`EcdsaChannelSigner::sign_holder_anchor_input`], which can then be
18274 * provided to [`build_anchor_input_witness`] along with the `funding_pubkey` to obtain the
18275 * full witness required to spend.
18277 * It is possible to receive more than one instance of this event if a valid child anchor
18278 * transaction is never broadcast or is but not with a sufficient fee to be mined. Care should
18279 * be taken by the consumer of the event to ensure any future iterations of the child anchor
18280 * transaction adhere to the [Replace-By-Fee
18281 * rules](https://github.com/bitcoin/bitcoin/blob/master/doc/policy/mempool-replacements.md)
18282 * for fee bumps to be accepted into the mempool, and eventually the chain. As the frequency of
18283 * these events is not user-controlled, users may ignore/drop the event if they are no longer
18284 * able to commit external confirmed funds to the child anchor transaction.
18286 * The set of `pending_htlcs` on the commitment transaction to be broadcast can be inspected to
18287 * determine whether a significant portion of the channel's funds are allocated to HTLCs,
18288 * enabling users to make their own decisions regarding the importance of the commitment
18289 * transaction's confirmation. Note that this is not required, but simply exists as an option
18290 * for users to override LDK's behavior. On commitments with no HTLCs (indicated by those with
18291 * an empty `pending_htlcs`), confirmation of the commitment transaction can be considered to
18294 * [`EcdsaChannelSigner`]: crate::sign::ecdsa::EcdsaChannelSigner
18295 * [`EcdsaChannelSigner::sign_holder_anchor_input`]: crate::sign::ecdsa::EcdsaChannelSigner::sign_holder_anchor_input
18296 * [`build_anchor_input_witness`]: crate::ln::chan_utils::build_anchor_input_witness
18298 LDKBumpTransactionEvent_ChannelClose,
18300 * Indicates that a channel featuring anchor outputs has unilaterally closed on-chain by a
18301 * holder commitment transaction and its HTLC(s) need to be resolved on-chain. With the
18302 * zero-HTLC-transaction-fee variant of anchor outputs, the pre-signed HTLC
18303 * transactions have a zero fee, thus requiring additional inputs and/or outputs to be attached
18304 * for a timely confirmation within the chain. These additional inputs and/or outputs must be
18305 * appended to the resulting HTLC transaction to meet the target feerate. Failure to meet the
18306 * target feerate decreases the confirmation odds of the transaction, possibly resulting in a
18307 * loss of funds. Once the transaction meets the target feerate, it must be signed for and
18308 * broadcast by the consumer of the event.
18310 * The consumer should be able to sign for any of the non-HTLC inputs added to the resulting
18311 * HTLC transaction. To sign HTLC inputs, an [`EcdsaChannelSigner`] should be re-derived
18312 * through [`HTLCDescriptor::derive_channel_signer`]. Each HTLC input's signature can be
18313 * computed with [`EcdsaChannelSigner::sign_holder_htlc_transaction`], which can then be
18314 * provided to [`HTLCDescriptor::tx_input_witness`] to obtain the fully signed witness required
18317 * It is possible to receive more than one instance of this event if a valid HTLC transaction
18318 * is never broadcast or is but not with a sufficient fee to be mined. Care should be taken by
18319 * the consumer of the event to ensure any future iterations of the HTLC transaction adhere to
18320 * the [Replace-By-Fee
18321 * rules](https://github.com/bitcoin/bitcoin/blob/master/doc/policy/mempool-replacements.md)
18322 * for fee bumps to be accepted into the mempool, and eventually the chain. As the frequency of
18323 * these events is not user-controlled, users may ignore/drop the event if either they are no
18324 * longer able to commit external confirmed funds to the HTLC transaction or the fee committed
18325 * to the HTLC transaction is greater in value than the HTLCs being claimed.
18327 * [`EcdsaChannelSigner`]: crate::sign::ecdsa::EcdsaChannelSigner
18328 * [`EcdsaChannelSigner::sign_holder_htlc_transaction`]: crate::sign::ecdsa::EcdsaChannelSigner::sign_holder_htlc_transaction
18330 LDKBumpTransactionEvent_HTLCResolution,
18332 * Must be last for serialization purposes
18334 LDKBumpTransactionEvent_Sentinel,
18335 } LDKBumpTransactionEvent_Tag;
18337 typedef struct LDKBumpTransactionEvent_LDKChannelClose_Body {
18339 * The `channel_id` of the channel which has been closed.
18341 struct LDKChannelId channel_id;
18343 * Counterparty in the closed channel.
18345 struct LDKPublicKey counterparty_node_id;
18347 * The unique identifier for the claim of the anchor output in the commitment transaction.
18349 * The identifier must map to the set of external UTXOs assigned to the claim, such that
18350 * they can be reused when a new claim with the same identifier needs to be made, resulting
18351 * in a fee-bumping attempt.
18353 struct LDKThirtyTwoBytes claim_id;
18355 * The target feerate that the transaction package, which consists of the commitment
18356 * transaction and the to-be-crafted child anchor transaction, must meet.
18358 uint32_t package_target_feerate_sat_per_1000_weight;
18360 * The channel's commitment transaction to bump the fee of. This transaction should be
18361 * broadcast along with the anchor transaction constructed as a result of consuming this
18364 struct LDKTransaction commitment_tx;
18366 * The absolute fee in satoshis of the commitment transaction. This can be used along the
18367 * with weight of the commitment transaction to determine its feerate.
18369 uint64_t commitment_tx_fee_satoshis;
18371 * The descriptor to sign the anchor input of the anchor transaction constructed as a
18372 * result of consuming this event.
18374 struct LDKAnchorDescriptor anchor_descriptor;
18376 * The set of pending HTLCs on the commitment transaction that need to be resolved once the
18377 * commitment transaction confirms.
18379 struct LDKCVec_HTLCOutputInCommitmentZ pending_htlcs;
18380 } LDKBumpTransactionEvent_LDKChannelClose_Body;
18382 typedef struct LDKBumpTransactionEvent_LDKHTLCResolution_Body {
18384 * The `channel_id` of the channel which has been closed.
18386 struct LDKChannelId channel_id;
18388 * Counterparty in the closed channel.
18390 struct LDKPublicKey counterparty_node_id;
18392 * The unique identifier for the claim of the HTLCs in the confirmed commitment
18395 * The identifier must map to the set of external UTXOs assigned to the claim, such that
18396 * they can be reused when a new claim with the same identifier needs to be made, resulting
18397 * in a fee-bumping attempt.
18399 struct LDKThirtyTwoBytes claim_id;
18401 * The target feerate that the resulting HTLC transaction must meet.
18403 uint32_t target_feerate_sat_per_1000_weight;
18405 * The set of pending HTLCs on the confirmed commitment that need to be claimed, preferably
18406 * by the same transaction.
18408 struct LDKCVec_HTLCDescriptorZ htlc_descriptors;
18410 * The locktime required for the resulting HTLC transaction.
18412 uint32_t tx_lock_time;
18413 } LDKBumpTransactionEvent_LDKHTLCResolution_Body;
18415 typedef struct MUST_USE_STRUCT LDKBumpTransactionEvent {
18416 LDKBumpTransactionEvent_Tag tag;
18418 LDKBumpTransactionEvent_LDKChannelClose_Body channel_close;
18419 LDKBumpTransactionEvent_LDKHTLCResolution_Body htlc_resolution;
18421 } LDKBumpTransactionEvent;
18424 * An Event which you should probably take some action in response to.
18426 * Note that while Writeable and Readable are implemented for Event, you probably shouldn't use
18427 * them directly as they don't round-trip exactly (for example FundingGenerationReady is never
18428 * written as it makes no sense to respond to it after reconnecting to peers).
18430 typedef enum LDKEvent_Tag {
18432 * Used to indicate that the client should generate a funding transaction with the given
18433 * parameters and then call [`ChannelManager::funding_transaction_generated`].
18434 * Generated in [`ChannelManager`] message handling.
18435 * Note that *all inputs* in the funding transaction must spend SegWit outputs or your
18436 * counterparty can steal your funds!
18438 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
18439 * [`ChannelManager::funding_transaction_generated`]: crate::ln::channelmanager::ChannelManager::funding_transaction_generated
18441 LDKEvent_FundingGenerationReady,
18443 * Indicates that we've been offered a payment and it needs to be claimed via calling
18444 * [`ChannelManager::claim_funds`] with the preimage given in [`PaymentPurpose`].
18446 * Note that if the preimage is not known, you should call
18447 * [`ChannelManager::fail_htlc_backwards`] or [`ChannelManager::fail_htlc_backwards_with_reason`]
18448 * to free up resources for this HTLC and avoid network congestion.
18450 * If [`Event::PaymentClaimable::onion_fields`] is `Some`, and includes custom TLVs with even type
18451 * numbers, you should use [`ChannelManager::fail_htlc_backwards_with_reason`] with
18452 * [`FailureCode::InvalidOnionPayload`] if you fail to understand and handle the contents, or
18453 * [`ChannelManager::claim_funds_with_known_custom_tlvs`] upon successful handling.
18454 * If you don't intend to check for custom TLVs, you can simply use
18455 * [`ChannelManager::claim_funds`], which will automatically fail back even custom TLVs.
18457 * If you fail to call [`ChannelManager::claim_funds`],
18458 * [`ChannelManager::claim_funds_with_known_custom_tlvs`],
18459 * [`ChannelManager::fail_htlc_backwards`], or
18460 * [`ChannelManager::fail_htlc_backwards_with_reason`] within the HTLC's timeout, the HTLC will
18461 * be automatically failed.
18464 * LDK will not stop an inbound payment from being paid multiple times, so multiple
18465 * `PaymentClaimable` events may be generated for the same payment. In such a case it is
18466 * polite (and required in the lightning specification) to fail the payment the second time
18467 * and give the sender their money back rather than accepting double payment.
18470 * This event used to be called `PaymentReceived` in LDK versions 0.0.112 and earlier.
18472 * [`ChannelManager::claim_funds`]: crate::ln::channelmanager::ChannelManager::claim_funds
18473 * [`ChannelManager::claim_funds_with_known_custom_tlvs`]: crate::ln::channelmanager::ChannelManager::claim_funds_with_known_custom_tlvs
18474 * [`FailureCode::InvalidOnionPayload`]: crate::ln::channelmanager::FailureCode::InvalidOnionPayload
18475 * [`ChannelManager::fail_htlc_backwards`]: crate::ln::channelmanager::ChannelManager::fail_htlc_backwards
18476 * [`ChannelManager::fail_htlc_backwards_with_reason`]: crate::ln::channelmanager::ChannelManager::fail_htlc_backwards_with_reason
18478 LDKEvent_PaymentClaimable,
18480 * Indicates a payment has been claimed and we've received money!
18482 * This most likely occurs when [`ChannelManager::claim_funds`] has been called in response
18483 * to an [`Event::PaymentClaimable`]. However, if we previously crashed during a
18484 * [`ChannelManager::claim_funds`] call you may see this event without a corresponding
18485 * [`Event::PaymentClaimable`] event.
18488 * LDK will not stop an inbound payment from being paid multiple times, so multiple
18489 * `PaymentClaimable` events may be generated for the same payment. If you then call
18490 * [`ChannelManager::claim_funds`] twice for the same [`Event::PaymentClaimable`] you may get
18491 * multiple `PaymentClaimed` events.
18493 * [`ChannelManager::claim_funds`]: crate::ln::channelmanager::ChannelManager::claim_funds
18495 LDKEvent_PaymentClaimed,
18497 * Indicates that a peer connection with a node is needed in order to send an [`OnionMessage`].
18499 * Typically, this happens when a [`MessageRouter`] is unable to find a complete path to a
18500 * [`Destination`]. Once a connection is established, any messages buffered by an
18501 * [`OnionMessageHandler`] may be sent.
18503 * This event will not be generated for onion message forwards; only for sends including
18504 * replies. Handlers should connect to the node otherwise any buffered messages may be lost.
18506 * [`OnionMessage`]: msgs::OnionMessage
18507 * [`MessageRouter`]: crate::onion_message::messenger::MessageRouter
18508 * [`Destination`]: crate::onion_message::messenger::Destination
18509 * [`OnionMessageHandler`]: crate::ln::msgs::OnionMessageHandler
18511 LDKEvent_ConnectionNeeded,
18513 * Indicates a request for an invoice failed to yield a response in a reasonable amount of time
18514 * or was explicitly abandoned by [`ChannelManager::abandon_payment`]. This may be for an
18515 * [`InvoiceRequest`] sent for an [`Offer`] or for a [`Refund`] that hasn't been redeemed.
18517 * [`ChannelManager::abandon_payment`]: crate::ln::channelmanager::ChannelManager::abandon_payment
18518 * [`InvoiceRequest`]: crate::offers::invoice_request::InvoiceRequest
18519 * [`Offer`]: crate::offers::offer::Offer
18520 * [`Refund`]: crate::offers::refund::Refund
18522 LDKEvent_InvoiceRequestFailed,
18524 * Indicates an outbound payment we made succeeded (i.e. it made it all the way to its target
18525 * and we got back the payment preimage for it).
18527 * Note for MPP payments: in rare cases, this event may be preceded by a `PaymentPathFailed`
18528 * event. In this situation, you SHOULD treat this payment as having succeeded.
18530 LDKEvent_PaymentSent,
18532 * Indicates an outbound payment failed. Individual [`Event::PaymentPathFailed`] events
18533 * provide failure information for each path attempt in the payment, including retries.
18535 * This event is provided once there are no further pending HTLCs for the payment and the
18536 * payment is no longer retryable, due either to the [`Retry`] provided or
18537 * [`ChannelManager::abandon_payment`] having been called for the corresponding payment.
18539 * In exceedingly rare cases, it is possible that an [`Event::PaymentFailed`] is generated for
18540 * a payment after an [`Event::PaymentSent`] event for this same payment has already been
18541 * received and processed. In this case, the [`Event::PaymentFailed`] event MUST be ignored,
18542 * and the payment MUST be treated as having succeeded.
18544 * [`Retry`]: crate::ln::channelmanager::Retry
18545 * [`ChannelManager::abandon_payment`]: crate::ln::channelmanager::ChannelManager::abandon_payment
18547 LDKEvent_PaymentFailed,
18549 * Indicates that a path for an outbound payment was successful.
18551 * Always generated after [`Event::PaymentSent`] and thus useful for scoring channels. See
18552 * [`Event::PaymentSent`] for obtaining the payment preimage.
18554 LDKEvent_PaymentPathSuccessful,
18556 * Indicates an outbound HTLC we sent failed, likely due to an intermediary node being unable to
18559 * Note that this does *not* indicate that all paths for an MPP payment have failed, see
18560 * [`Event::PaymentFailed`].
18562 * See [`ChannelManager::abandon_payment`] for giving up on this payment before its retries have
18565 * [`ChannelManager::abandon_payment`]: crate::ln::channelmanager::ChannelManager::abandon_payment
18567 LDKEvent_PaymentPathFailed,
18569 * Indicates that a probe payment we sent returned successful, i.e., only failed at the destination.
18571 LDKEvent_ProbeSuccessful,
18573 * Indicates that a probe payment we sent failed at an intermediary node on the path.
18575 LDKEvent_ProbeFailed,
18577 * Used to indicate that [`ChannelManager::process_pending_htlc_forwards`] should be called at
18578 * a time in the future.
18580 * [`ChannelManager::process_pending_htlc_forwards`]: crate::ln::channelmanager::ChannelManager::process_pending_htlc_forwards
18582 LDKEvent_PendingHTLCsForwardable,
18584 * Used to indicate that we've intercepted an HTLC forward. This event will only be generated if
18585 * you've encoded an intercept scid in the receiver's invoice route hints using
18586 * [`ChannelManager::get_intercept_scid`] and have set [`UserConfig::accept_intercept_htlcs`].
18588 * [`ChannelManager::forward_intercepted_htlc`] or
18589 * [`ChannelManager::fail_intercepted_htlc`] MUST be called in response to this event. See
18590 * their docs for more information.
18592 * [`ChannelManager::get_intercept_scid`]: crate::ln::channelmanager::ChannelManager::get_intercept_scid
18593 * [`UserConfig::accept_intercept_htlcs`]: crate::util::config::UserConfig::accept_intercept_htlcs
18594 * [`ChannelManager::forward_intercepted_htlc`]: crate::ln::channelmanager::ChannelManager::forward_intercepted_htlc
18595 * [`ChannelManager::fail_intercepted_htlc`]: crate::ln::channelmanager::ChannelManager::fail_intercepted_htlc
18597 LDKEvent_HTLCIntercepted,
18599 * Used to indicate that an output which you should know how to spend was confirmed on chain
18600 * and is now spendable.
18602 * Such an output will *never* be spent directly by LDK, and are not at risk of your
18603 * counterparty spending them due to some kind of timeout. Thus, you need to store them
18604 * somewhere and spend them when you create on-chain transactions.
18606 * You may hand them to the [`OutputSweeper`] utility which will store and (re-)generate spending
18607 * transactions for you.
18609 * [`OutputSweeper`]: crate::util::sweep::OutputSweeper
18611 LDKEvent_SpendableOutputs,
18613 * This event is generated when a payment has been successfully forwarded through us and a
18614 * forwarding fee earned.
18616 LDKEvent_PaymentForwarded,
18618 * Used to indicate that a channel with the given `channel_id` is being opened and pending
18619 * confirmation on-chain.
18621 * This event is emitted when the funding transaction has been signed and is broadcast to the
18622 * network. For 0conf channels it will be immediately followed by the corresponding
18623 * [`Event::ChannelReady`] event.
18625 LDKEvent_ChannelPending,
18627 * Used to indicate that a channel with the given `channel_id` is ready to
18628 * be used. This event is emitted either when the funding transaction has been confirmed
18629 * on-chain, or, in case of a 0conf channel, when both parties have confirmed the channel
18632 LDKEvent_ChannelReady,
18634 * Used to indicate that a channel that got past the initial handshake with the given `channel_id` is in the
18635 * process of closure. This includes previously opened channels, and channels that time out from not being funded.
18637 * Note that this event is only triggered for accepted channels: if the
18638 * [`UserConfig::manually_accept_inbound_channels`] config flag is set to true and the channel is
18639 * rejected, no `ChannelClosed` event will be sent.
18641 * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
18642 * [`UserConfig::manually_accept_inbound_channels`]: crate::util::config::UserConfig::manually_accept_inbound_channels
18644 LDKEvent_ChannelClosed,
18646 * Used to indicate to the user that they can abandon the funding transaction and recycle the
18647 * inputs for another purpose.
18649 * This event is not guaranteed to be generated for channels that are closed due to a restart.
18651 LDKEvent_DiscardFunding,
18653 * Indicates a request to open a new channel by a peer.
18655 * To accept the request, call [`ChannelManager::accept_inbound_channel`]. To reject the request,
18656 * call [`ChannelManager::force_close_without_broadcasting_txn`]. Note that a ['ChannelClosed`]
18657 * event will _not_ be triggered if the channel is rejected.
18659 * The event is only triggered when a new open channel request is received and the
18660 * [`UserConfig::manually_accept_inbound_channels`] config flag is set to true.
18662 * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
18663 * [`ChannelManager::force_close_without_broadcasting_txn`]: crate::ln::channelmanager::ChannelManager::force_close_without_broadcasting_txn
18664 * [`UserConfig::manually_accept_inbound_channels`]: crate::util::config::UserConfig::manually_accept_inbound_channels
18666 LDKEvent_OpenChannelRequest,
18668 * Indicates that the HTLC was accepted, but could not be processed when or after attempting to
18671 * Some scenarios where this event may be sent include:
18672 * * Insufficient capacity in the outbound channel
18673 * * While waiting to forward the HTLC, the channel it is meant to be forwarded through closes
18674 * * When an unknown SCID is requested for forwarding a payment.
18675 * * Expected MPP amount has already been reached
18676 * * The HTLC has timed out
18678 * This event, however, does not get generated if an HTLC fails to meet the forwarding
18679 * requirements (i.e. insufficient fees paid, or a CLTV that is too soon).
18681 LDKEvent_HTLCHandlingFailed,
18683 * Indicates that a transaction originating from LDK needs to have its fee bumped. This event
18684 * requires confirmed external funds to be readily available to spend.
18686 * LDK does not currently generate this event unless the
18687 * [`ChannelHandshakeConfig::negotiate_anchors_zero_fee_htlc_tx`] config flag is set to true.
18688 * It is limited to the scope of channels with anchor outputs.
18690 * [`ChannelHandshakeConfig::negotiate_anchors_zero_fee_htlc_tx`]: crate::util::config::ChannelHandshakeConfig::negotiate_anchors_zero_fee_htlc_tx
18692 LDKEvent_BumpTransaction,
18694 * Must be last for serialization purposes
18699 typedef struct LDKEvent_LDKFundingGenerationReady_Body {
18701 * The random channel_id we picked which you'll need to pass into
18702 * [`ChannelManager::funding_transaction_generated`].
18704 * [`ChannelManager::funding_transaction_generated`]: crate::ln::channelmanager::ChannelManager::funding_transaction_generated
18706 struct LDKChannelId temporary_channel_id;
18708 * The counterparty's node_id, which you'll need to pass back into
18709 * [`ChannelManager::funding_transaction_generated`].
18711 * [`ChannelManager::funding_transaction_generated`]: crate::ln::channelmanager::ChannelManager::funding_transaction_generated
18713 struct LDKPublicKey counterparty_node_id;
18715 * The value, in satoshis, that the output should have.
18717 uint64_t channel_value_satoshis;
18719 * The script which should be used in the transaction output.
18721 struct LDKCVec_u8Z output_script;
18723 * The `user_channel_id` value passed in to [`ChannelManager::create_channel`] for outbound
18724 * channels, or to [`ChannelManager::accept_inbound_channel`] for inbound channels if
18725 * [`UserConfig::manually_accept_inbound_channels`] config flag is set to true. Otherwise
18726 * `user_channel_id` will be randomized for an inbound channel. This may be zero for objects
18727 * serialized with LDK versions prior to 0.0.113.
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;
18734 } LDKEvent_LDKFundingGenerationReady_Body;
18736 typedef struct LDKEvent_LDKPaymentClaimable_Body {
18738 * The node that will receive the payment after it has been claimed.
18739 * This is useful to identify payments received via [phantom nodes].
18740 * This field will always be filled in when the event was generated by LDK versions
18741 * 0.0.113 and above.
18743 * [phantom nodes]: crate::sign::PhantomKeysManager
18745 * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
18747 struct LDKPublicKey receiver_node_id;
18749 * The hash for which the preimage should be handed to the ChannelManager. Note that LDK will
18750 * not stop you from registering duplicate payment hashes for inbound payments.
18752 struct LDKThirtyTwoBytes payment_hash;
18754 * The fields in the onion which were received with each HTLC. Only fields which were
18755 * identical in each HTLC involved in the payment will be included here.
18757 * Payments received on LDK versions prior to 0.0.115 will have this field unset.
18759 * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
18761 struct LDKRecipientOnionFields onion_fields;
18763 * The value, in thousandths of a satoshi, that this payment is claimable for. May be greater
18764 * than the invoice amount.
18766 * May be less than the invoice amount if [`ChannelConfig::accept_underpaying_htlcs`] is set
18767 * and the previous hop took an extra fee.
18770 * If [`ChannelConfig::accept_underpaying_htlcs`] is set and you claim without verifying this
18771 * field, you may lose money!
18773 * [`ChannelConfig::accept_underpaying_htlcs`]: crate::util::config::ChannelConfig::accept_underpaying_htlcs
18775 uint64_t amount_msat;
18777 * The value, in thousands of a satoshi, that was skimmed off of this payment as an extra fee
18778 * taken by our channel counterparty.
18780 * Will always be 0 unless [`ChannelConfig::accept_underpaying_htlcs`] is set.
18782 * [`ChannelConfig::accept_underpaying_htlcs`]: crate::util::config::ChannelConfig::accept_underpaying_htlcs
18784 uint64_t counterparty_skimmed_fee_msat;
18786 * Information for claiming this received payment, based on whether the purpose of the
18787 * payment is to pay an invoice or to send a spontaneous payment.
18789 struct LDKPaymentPurpose purpose;
18791 * The `channel_id` indicating over which channel we received the payment.
18793 * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
18795 struct LDKChannelId via_channel_id;
18797 * The `user_channel_id` indicating over which channel we received the payment.
18799 struct LDKCOption_U128Z via_user_channel_id;
18801 * The block height at which this payment will be failed back and will no longer be
18802 * eligible for claiming.
18804 * Prior to this height, a call to [`ChannelManager::claim_funds`] is guaranteed to
18805 * succeed, however you should wait for [`Event::PaymentClaimed`] to be sure.
18807 * [`ChannelManager::claim_funds`]: crate::ln::channelmanager::ChannelManager::claim_funds
18809 struct LDKCOption_u32Z claim_deadline;
18810 } LDKEvent_LDKPaymentClaimable_Body;
18812 typedef struct LDKEvent_LDKPaymentClaimed_Body {
18814 * The node that received the payment.
18815 * This is useful to identify payments which were received via [phantom nodes].
18816 * This field will always be filled in when the event was generated by LDK versions
18817 * 0.0.113 and above.
18819 * [phantom nodes]: crate::sign::PhantomKeysManager
18821 * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
18823 struct LDKPublicKey receiver_node_id;
18825 * The payment hash of the claimed payment. Note that LDK will not stop you from
18826 * registering duplicate payment hashes for inbound payments.
18828 struct LDKThirtyTwoBytes payment_hash;
18830 * The value, in thousandths of a satoshi, that this payment is for. May be greater than the
18833 uint64_t amount_msat;
18835 * The purpose of the claimed payment, i.e. whether the payment was for an invoice or a
18836 * spontaneous payment.
18838 struct LDKPaymentPurpose purpose;
18840 * The HTLCs that comprise the claimed payment. This will be empty for events serialized prior
18841 * to LDK version 0.0.117.
18843 struct LDKCVec_ClaimedHTLCZ htlcs;
18845 * The sender-intended sum total of all the MPP parts. This will be `None` for events
18846 * serialized prior to LDK version 0.0.117.
18848 struct LDKCOption_u64Z sender_intended_total_msat;
18849 } LDKEvent_LDKPaymentClaimed_Body;
18851 typedef struct LDKEvent_LDKConnectionNeeded_Body {
18853 * The node id for the node needing a connection.
18855 struct LDKPublicKey node_id;
18857 * Sockets for connecting to the node.
18859 struct LDKCVec_SocketAddressZ addresses;
18860 } LDKEvent_LDKConnectionNeeded_Body;
18862 typedef struct LDKEvent_LDKInvoiceRequestFailed_Body {
18864 * The `payment_id` to have been associated with payment for the requested invoice.
18866 struct LDKThirtyTwoBytes payment_id;
18867 } LDKEvent_LDKInvoiceRequestFailed_Body;
18869 typedef struct LDKEvent_LDKPaymentSent_Body {
18871 * The `payment_id` passed to [`ChannelManager::send_payment`].
18873 * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
18875 struct LDKCOption_ThirtyTwoBytesZ payment_id;
18877 * The preimage to the hash given to ChannelManager::send_payment.
18878 * Note that this serves as a payment receipt, if you wish to have such a thing, you must
18879 * store it somehow!
18881 struct LDKThirtyTwoBytes payment_preimage;
18883 * The hash that was given to [`ChannelManager::send_payment`].
18885 * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
18887 struct LDKThirtyTwoBytes payment_hash;
18889 * The total fee which was spent at intermediate hops in this payment, across all paths.
18891 * Note that, like [`Route::get_total_fees`] this does *not* include any potential
18892 * overpayment to the recipient node.
18894 * If the recipient or an intermediate node misbehaves and gives us free money, this may
18895 * overstate the amount paid, though this is unlikely.
18897 * [`Route::get_total_fees`]: crate::routing::router::Route::get_total_fees
18899 struct LDKCOption_u64Z fee_paid_msat;
18900 } LDKEvent_LDKPaymentSent_Body;
18902 typedef struct LDKEvent_LDKPaymentFailed_Body {
18904 * The `payment_id` passed to [`ChannelManager::send_payment`].
18906 * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
18908 struct LDKThirtyTwoBytes payment_id;
18910 * The hash that was given to [`ChannelManager::send_payment`].
18912 * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
18914 struct LDKThirtyTwoBytes payment_hash;
18916 * The reason the payment failed. This is only `None` for events generated or serialized
18917 * by versions prior to 0.0.115.
18919 struct LDKCOption_PaymentFailureReasonZ reason;
18920 } LDKEvent_LDKPaymentFailed_Body;
18922 typedef struct LDKEvent_LDKPaymentPathSuccessful_Body {
18924 * The `payment_id` passed to [`ChannelManager::send_payment`].
18926 * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
18928 struct LDKThirtyTwoBytes payment_id;
18930 * The hash that was given to [`ChannelManager::send_payment`].
18932 * This will be `Some` for all payments which completed on LDK 0.0.104 or later.
18934 * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
18936 struct LDKCOption_ThirtyTwoBytesZ payment_hash;
18938 * The payment path that was successful.
18940 * May contain a closed channel if the HTLC sent along the path was fulfilled on chain.
18942 struct LDKPath path;
18943 } LDKEvent_LDKPaymentPathSuccessful_Body;
18945 typedef struct LDKEvent_LDKPaymentPathFailed_Body {
18947 * The `payment_id` passed to [`ChannelManager::send_payment`].
18949 * This will be `Some` for all payment paths which failed on LDK 0.0.103 or later.
18951 * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
18952 * [`ChannelManager::abandon_payment`]: crate::ln::channelmanager::ChannelManager::abandon_payment
18954 struct LDKCOption_ThirtyTwoBytesZ payment_id;
18956 * The hash that was given to [`ChannelManager::send_payment`].
18958 * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
18960 struct LDKThirtyTwoBytes payment_hash;
18962 * Indicates the payment was rejected for some reason by the recipient. This implies that
18963 * the payment has failed, not just the route in question. If this is not set, the payment may
18964 * be retried via a different route.
18966 bool payment_failed_permanently;
18968 * Extra error details based on the failure type. May contain an update that needs to be
18969 * applied to the [`NetworkGraph`].
18971 * [`NetworkGraph`]: crate::routing::gossip::NetworkGraph
18973 struct LDKPathFailure failure;
18975 * The payment path that failed.
18977 struct LDKPath path;
18979 * The channel responsible for the failed payment path.
18981 * Note that for route hints or for the first hop in a path this may be an SCID alias and
18982 * may not refer to a channel in the public network graph. These aliases may also collide
18983 * with channels in the public network graph.
18985 * If this is `Some`, then the corresponding channel should be avoided when the payment is
18986 * retried. May be `None` for older [`Event`] serializations.
18988 struct LDKCOption_u64Z short_channel_id;
18989 } LDKEvent_LDKPaymentPathFailed_Body;
18991 typedef struct LDKEvent_LDKProbeSuccessful_Body {
18993 * The id returned by [`ChannelManager::send_probe`].
18995 * [`ChannelManager::send_probe`]: crate::ln::channelmanager::ChannelManager::send_probe
18997 struct LDKThirtyTwoBytes payment_id;
18999 * The hash generated by [`ChannelManager::send_probe`].
19001 * [`ChannelManager::send_probe`]: crate::ln::channelmanager::ChannelManager::send_probe
19003 struct LDKThirtyTwoBytes payment_hash;
19005 * The payment path that was successful.
19007 struct LDKPath path;
19008 } LDKEvent_LDKProbeSuccessful_Body;
19010 typedef struct LDKEvent_LDKProbeFailed_Body {
19012 * The id returned by [`ChannelManager::send_probe`].
19014 * [`ChannelManager::send_probe`]: crate::ln::channelmanager::ChannelManager::send_probe
19016 struct LDKThirtyTwoBytes payment_id;
19018 * The hash generated by [`ChannelManager::send_probe`].
19020 * [`ChannelManager::send_probe`]: crate::ln::channelmanager::ChannelManager::send_probe
19022 struct LDKThirtyTwoBytes payment_hash;
19024 * The payment path that failed.
19026 struct LDKPath path;
19028 * The channel responsible for the failed probe.
19030 * Note that for route hints or for the first hop in a path this may be an SCID alias and
19031 * may not refer to a channel in the public network graph. These aliases may also collide
19032 * with channels in the public network graph.
19034 struct LDKCOption_u64Z short_channel_id;
19035 } LDKEvent_LDKProbeFailed_Body;
19037 typedef struct LDKEvent_LDKPendingHTLCsForwardable_Body {
19039 * The minimum amount of time that should be waited prior to calling
19040 * process_pending_htlc_forwards. To increase the effort required to correlate payments,
19041 * you should wait a random amount of time in roughly the range (now + time_forwardable,
19042 * now + 5*time_forwardable).
19044 uint64_t time_forwardable;
19045 } LDKEvent_LDKPendingHTLCsForwardable_Body;
19047 typedef struct LDKEvent_LDKHTLCIntercepted_Body {
19049 * An id to help LDK identify which HTLC is being forwarded or failed.
19051 struct LDKThirtyTwoBytes intercept_id;
19053 * The fake scid that was programmed as the next hop's scid, generated using
19054 * [`ChannelManager::get_intercept_scid`].
19056 * [`ChannelManager::get_intercept_scid`]: crate::ln::channelmanager::ChannelManager::get_intercept_scid
19058 uint64_t requested_next_hop_scid;
19060 * The payment hash used for this HTLC.
19062 struct LDKThirtyTwoBytes payment_hash;
19064 * How many msats were received on the inbound edge of this HTLC.
19066 uint64_t inbound_amount_msat;
19068 * How many msats the payer intended to route to the next node. Depending on the reason you are
19069 * intercepting this payment, you might take a fee by forwarding less than this amount.
19070 * Forwarding less than this amount may break compatibility with LDK versions prior to 0.0.116.
19072 * Note that LDK will NOT check that expected fees were factored into this value. You MUST
19073 * check that whatever fee you want has been included here or subtract it as required. Further,
19074 * LDK will not stop you from forwarding more than you received.
19076 uint64_t expected_outbound_amount_msat;
19077 } LDKEvent_LDKHTLCIntercepted_Body;
19079 typedef struct LDKEvent_LDKSpendableOutputs_Body {
19081 * The outputs which you should store as spendable by you.
19083 struct LDKCVec_SpendableOutputDescriptorZ outputs;
19085 * The `channel_id` indicating which channel the spendable outputs belong to.
19087 * This will always be `Some` for events generated by LDK versions 0.0.117 and above.
19089 * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
19091 struct LDKChannelId channel_id;
19092 } LDKEvent_LDKSpendableOutputs_Body;
19094 typedef struct LDKEvent_LDKPaymentForwarded_Body {
19096 * The channel id of the incoming channel between the previous node and us.
19098 * This is only `None` for events generated or serialized by versions prior to 0.0.107.
19100 * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
19102 struct LDKChannelId prev_channel_id;
19104 * The channel id of the outgoing channel between the next node and us.
19106 * This is only `None` for events generated or serialized by versions prior to 0.0.107.
19108 * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
19110 struct LDKChannelId next_channel_id;
19112 * The `user_channel_id` of the incoming channel between the previous node and us.
19114 * This is only `None` for events generated or serialized by versions prior to 0.0.122.
19116 struct LDKCOption_U128Z prev_user_channel_id;
19118 * The `user_channel_id` of the outgoing channel between the next node and us.
19120 * This will be `None` if the payment was settled via an on-chain transaction. See the
19121 * caveat described for the `total_fee_earned_msat` field. Moreover it will be `None` for
19122 * events generated or serialized by versions prior to 0.0.122.
19124 struct LDKCOption_U128Z next_user_channel_id;
19126 * The total fee, in milli-satoshis, which was earned as a result of the payment.
19128 * Note that if we force-closed the channel over which we forwarded an HTLC while the HTLC
19129 * was pending, the amount the next hop claimed will have been rounded down to the nearest
19130 * whole satoshi. Thus, the fee calculated here may be higher than expected as we still
19131 * claimed the full value in millisatoshis from the source. In this case,
19132 * `claim_from_onchain_tx` will be set.
19134 * If the channel which sent us the payment has been force-closed, we will claim the funds
19135 * via an on-chain transaction. In that case we do not yet know the on-chain transaction
19136 * fees which we will spend and will instead set this to `None`. It is possible duplicate
19137 * `PaymentForwarded` events are generated for the same payment iff `total_fee_earned_msat` is
19140 struct LDKCOption_u64Z total_fee_earned_msat;
19142 * The share of the total fee, in milli-satoshis, which was withheld in addition to the
19145 * This will only be `Some` if we forwarded an intercepted HTLC with less than the
19146 * expected amount. This means our counterparty accepted to receive less than the invoice
19147 * amount, e.g., by claiming the payment featuring a corresponding
19148 * [`PaymentClaimable::counterparty_skimmed_fee_msat`].
19150 * Will also always be `None` for events serialized with LDK prior to version 0.0.122.
19152 * The caveat described above the `total_fee_earned_msat` field applies here as well.
19154 * [`PaymentClaimable::counterparty_skimmed_fee_msat`]: Self::PaymentClaimable::counterparty_skimmed_fee_msat
19156 struct LDKCOption_u64Z skimmed_fee_msat;
19158 * If this is `true`, the forwarded HTLC was claimed by our counterparty via an on-chain
19161 bool claim_from_onchain_tx;
19163 * The final amount forwarded, in milli-satoshis, after the fee is deducted.
19165 * The caveat described above the `total_fee_earned_msat` field applies here as well.
19167 struct LDKCOption_u64Z outbound_amount_forwarded_msat;
19168 } LDKEvent_LDKPaymentForwarded_Body;
19170 typedef struct LDKEvent_LDKChannelPending_Body {
19172 * The `channel_id` of the channel that is pending confirmation.
19174 struct LDKChannelId channel_id;
19176 * The `user_channel_id` value passed in to [`ChannelManager::create_channel`] for outbound
19177 * channels, or to [`ChannelManager::accept_inbound_channel`] for inbound channels if
19178 * [`UserConfig::manually_accept_inbound_channels`] config flag is set to true. Otherwise
19179 * `user_channel_id` will be randomized for an inbound channel.
19181 * [`ChannelManager::create_channel`]: crate::ln::channelmanager::ChannelManager::create_channel
19182 * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
19183 * [`UserConfig::manually_accept_inbound_channels`]: crate::util::config::UserConfig::manually_accept_inbound_channels
19185 struct LDKU128 user_channel_id;
19187 * The `temporary_channel_id` this channel used to be known by during channel establishment.
19189 * Will be `None` for channels created prior to LDK version 0.0.115.
19191 * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
19193 struct LDKChannelId former_temporary_channel_id;
19195 * The `node_id` of the channel counterparty.
19197 struct LDKPublicKey counterparty_node_id;
19199 * The outpoint of the channel's funding transaction.
19201 struct LDKOutPoint funding_txo;
19203 * The features that this channel will operate with.
19205 * Will be `None` for channels created prior to LDK version 0.0.122.
19207 * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
19209 struct LDKChannelTypeFeatures channel_type;
19210 } LDKEvent_LDKChannelPending_Body;
19212 typedef struct LDKEvent_LDKChannelReady_Body {
19214 * The `channel_id` of the channel that is ready.
19216 struct LDKChannelId channel_id;
19218 * The `user_channel_id` value passed in to [`ChannelManager::create_channel`] for outbound
19219 * channels, or to [`ChannelManager::accept_inbound_channel`] for inbound channels if
19220 * [`UserConfig::manually_accept_inbound_channels`] config flag is set to true. Otherwise
19221 * `user_channel_id` will be randomized for an inbound channel.
19223 * [`ChannelManager::create_channel`]: crate::ln::channelmanager::ChannelManager::create_channel
19224 * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
19225 * [`UserConfig::manually_accept_inbound_channels`]: crate::util::config::UserConfig::manually_accept_inbound_channels
19227 struct LDKU128 user_channel_id;
19229 * The `node_id` of the channel counterparty.
19231 struct LDKPublicKey counterparty_node_id;
19233 * The features that this channel will operate with.
19235 struct LDKChannelTypeFeatures channel_type;
19236 } LDKEvent_LDKChannelReady_Body;
19238 typedef struct LDKEvent_LDKChannelClosed_Body {
19240 * The `channel_id` of the channel which has been closed. Note that on-chain transactions
19241 * resolving the channel are likely still awaiting confirmation.
19243 struct LDKChannelId channel_id;
19245 * The `user_channel_id` value passed in to [`ChannelManager::create_channel`] for outbound
19246 * channels, or to [`ChannelManager::accept_inbound_channel`] for inbound channels if
19247 * [`UserConfig::manually_accept_inbound_channels`] config flag is set to true. Otherwise
19248 * `user_channel_id` will be randomized for inbound channels.
19249 * This may be zero for inbound channels serialized prior to 0.0.113 and will always be
19250 * zero for objects serialized with LDK versions prior to 0.0.102.
19252 * [`ChannelManager::create_channel`]: crate::ln::channelmanager::ChannelManager::create_channel
19253 * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
19254 * [`UserConfig::manually_accept_inbound_channels`]: crate::util::config::UserConfig::manually_accept_inbound_channels
19256 struct LDKU128 user_channel_id;
19258 * The reason the channel was closed.
19260 struct LDKClosureReason reason;
19262 * Counterparty in the closed channel.
19264 * This field will be `None` for objects serialized prior to LDK 0.0.117.
19266 * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
19268 struct LDKPublicKey counterparty_node_id;
19270 * Channel capacity of the closing channel (sats).
19272 * This field will be `None` for objects serialized prior to LDK 0.0.117.
19274 struct LDKCOption_u64Z channel_capacity_sats;
19276 * The original channel funding TXO; this helps checking for the existence and confirmation
19277 * status of the closing tx.
19278 * Note that for instances serialized in v0.0.119 or prior this will be missing (None).
19280 * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
19282 struct LDKOutPoint channel_funding_txo;
19283 } LDKEvent_LDKChannelClosed_Body;
19285 typedef struct LDKEvent_LDKDiscardFunding_Body {
19287 * The channel_id of the channel which has been closed.
19289 struct LDKChannelId channel_id;
19291 * The full transaction received from the user
19293 struct LDKTransaction transaction;
19294 } LDKEvent_LDKDiscardFunding_Body;
19296 typedef struct LDKEvent_LDKOpenChannelRequest_Body {
19298 * The temporary channel ID of the channel requested to be opened.
19300 * When responding to the request, the `temporary_channel_id` should be passed
19301 * back to the ChannelManager through [`ChannelManager::accept_inbound_channel`] to accept,
19302 * or through [`ChannelManager::force_close_without_broadcasting_txn`] to reject.
19304 * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
19305 * [`ChannelManager::force_close_without_broadcasting_txn`]: crate::ln::channelmanager::ChannelManager::force_close_without_broadcasting_txn
19307 struct LDKChannelId temporary_channel_id;
19309 * The node_id of the counterparty requesting to open the channel.
19311 * When responding to the request, the `counterparty_node_id` should be passed
19312 * back to the `ChannelManager` through [`ChannelManager::accept_inbound_channel`] to
19313 * accept the request, or through [`ChannelManager::force_close_without_broadcasting_txn`] to reject the
19316 * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
19317 * [`ChannelManager::force_close_without_broadcasting_txn`]: crate::ln::channelmanager::ChannelManager::force_close_without_broadcasting_txn
19319 struct LDKPublicKey counterparty_node_id;
19321 * The channel value of the requested channel.
19323 uint64_t funding_satoshis;
19325 * Our starting balance in the channel if the request is accepted, in milli-satoshi.
19327 uint64_t push_msat;
19329 * The features that this channel will operate with. If you reject the channel, a
19330 * well-behaved counterparty may automatically re-attempt the channel with a new set of
19333 * Note that if [`ChannelTypeFeatures::supports_scid_privacy`] returns true on this type,
19334 * the resulting [`ChannelManager`] will not be readable by versions of LDK prior to
19337 * Furthermore, note that if [`ChannelTypeFeatures::supports_zero_conf`] returns true on this type,
19338 * the resulting [`ChannelManager`] will not be readable by versions of LDK prior to
19339 * 0.0.107. Channels setting this type also need to get manually accepted via
19340 * [`crate::ln::channelmanager::ChannelManager::accept_inbound_channel_from_trusted_peer_0conf`],
19341 * or will be rejected otherwise.
19343 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
19345 struct LDKChannelTypeFeatures channel_type;
19346 } LDKEvent_LDKOpenChannelRequest_Body;
19348 typedef struct LDKEvent_LDKHTLCHandlingFailed_Body {
19350 * The channel over which the HTLC was received.
19352 struct LDKChannelId prev_channel_id;
19354 * Destination of the HTLC that failed to be processed.
19356 struct LDKHTLCDestination failed_next_destination;
19357 } LDKEvent_LDKHTLCHandlingFailed_Body;
19359 typedef struct MUST_USE_STRUCT LDKEvent {
19362 LDKEvent_LDKFundingGenerationReady_Body funding_generation_ready;
19363 LDKEvent_LDKPaymentClaimable_Body payment_claimable;
19364 LDKEvent_LDKPaymentClaimed_Body payment_claimed;
19365 LDKEvent_LDKConnectionNeeded_Body connection_needed;
19366 LDKEvent_LDKInvoiceRequestFailed_Body invoice_request_failed;
19367 LDKEvent_LDKPaymentSent_Body payment_sent;
19368 LDKEvent_LDKPaymentFailed_Body payment_failed;
19369 LDKEvent_LDKPaymentPathSuccessful_Body payment_path_successful;
19370 LDKEvent_LDKPaymentPathFailed_Body payment_path_failed;
19371 LDKEvent_LDKProbeSuccessful_Body probe_successful;
19372 LDKEvent_LDKProbeFailed_Body probe_failed;
19373 LDKEvent_LDKPendingHTLCsForwardable_Body pending_htl_cs_forwardable;
19374 LDKEvent_LDKHTLCIntercepted_Body htlc_intercepted;
19375 LDKEvent_LDKSpendableOutputs_Body spendable_outputs;
19376 LDKEvent_LDKPaymentForwarded_Body payment_forwarded;
19377 LDKEvent_LDKChannelPending_Body channel_pending;
19378 LDKEvent_LDKChannelReady_Body channel_ready;
19379 LDKEvent_LDKChannelClosed_Body channel_closed;
19380 LDKEvent_LDKDiscardFunding_Body discard_funding;
19381 LDKEvent_LDKOpenChannelRequest_Body open_channel_request;
19382 LDKEvent_LDKHTLCHandlingFailed_Body htlc_handling_failed;
19384 struct LDKBumpTransactionEvent bump_transaction;
19390 * An enum which can either contain a crate::lightning::events::Event or not
19392 typedef enum LDKCOption_EventZ_Tag {
19394 * When we're in this state, this COption_EventZ contains a crate::lightning::events::Event
19396 LDKCOption_EventZ_Some,
19398 * When we're in this state, this COption_EventZ contains nothing
19400 LDKCOption_EventZ_None,
19402 * Must be last for serialization purposes
19404 LDKCOption_EventZ_Sentinel,
19405 } LDKCOption_EventZ_Tag;
19407 typedef struct LDKCOption_EventZ {
19408 LDKCOption_EventZ_Tag tag;
19411 struct LDKEvent some;
19414 } LDKCOption_EventZ;
19417 * The contents of CResult_COption_EventZDecodeErrorZ
19419 typedef union LDKCResult_COption_EventZDecodeErrorZPtr {
19421 * A pointer to the contents in the success state.
19422 * Reading from this pointer when `result_ok` is not set is undefined.
19424 struct LDKCOption_EventZ *result;
19426 * A pointer to the contents in the error state.
19427 * Reading from this pointer when `result_ok` is set is undefined.
19429 struct LDKDecodeError *err;
19430 } LDKCResult_COption_EventZDecodeErrorZPtr;
19433 * A CResult_COption_EventZDecodeErrorZ represents the result of a fallible operation,
19434 * containing a crate::c_types::derived::COption_EventZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
19435 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
19437 typedef struct LDKCResult_COption_EventZDecodeErrorZ {
19439 * The contents of this CResult_COption_EventZDecodeErrorZ, accessible via either
19440 * `err` or `result` depending on the state of `result_ok`.
19442 union LDKCResult_COption_EventZDecodeErrorZPtr contents;
19444 * Whether this CResult_COption_EventZDecodeErrorZ represents a success state.
19447 } LDKCResult_COption_EventZDecodeErrorZ;
19450 * Sub-errors which don't have specific information in them use this type.
19452 typedef struct LDKError {
19454 * Zero-Sized_types aren't consistent across Rust/C/C++, so we add some size here
19460 * Errors that indicate what is wrong with the invoice. They have some granularity for debug
19461 * reasons, but should generally result in an \"invalid BOLT11 invoice\" message for the user.
19463 typedef enum LDKBolt11ParseError_Tag {
19464 LDKBolt11ParseError_Bech32Error,
19465 LDKBolt11ParseError_ParseAmountError,
19466 LDKBolt11ParseError_MalformedSignature,
19467 LDKBolt11ParseError_BadPrefix,
19468 LDKBolt11ParseError_UnknownCurrency,
19469 LDKBolt11ParseError_UnknownSiPrefix,
19470 LDKBolt11ParseError_MalformedHRP,
19471 LDKBolt11ParseError_TooShortDataPart,
19472 LDKBolt11ParseError_UnexpectedEndOfTaggedFields,
19473 LDKBolt11ParseError_DescriptionDecodeError,
19474 LDKBolt11ParseError_PaddingError,
19475 LDKBolt11ParseError_IntegerOverflowError,
19476 LDKBolt11ParseError_InvalidSegWitProgramLength,
19477 LDKBolt11ParseError_InvalidPubKeyHashLength,
19478 LDKBolt11ParseError_InvalidScriptHashLength,
19479 LDKBolt11ParseError_InvalidRecoveryId,
19480 LDKBolt11ParseError_InvalidSliceLength,
19482 * Not an error, but used internally to signal that a part of the invoice should be ignored
19483 * according to BOLT11
19485 LDKBolt11ParseError_Skip,
19487 * Must be last for serialization purposes
19489 LDKBolt11ParseError_Sentinel,
19490 } LDKBolt11ParseError_Tag;
19492 typedef struct MUST_USE_STRUCT LDKBolt11ParseError {
19493 LDKBolt11ParseError_Tag tag;
19496 struct LDKBech32Error bech32_error;
19499 struct LDKError parse_amount_error;
19502 enum LDKSecp256k1Error malformed_signature;
19505 struct LDKError description_decode_error;
19508 struct LDKStr invalid_slice_length;
19511 } LDKBolt11ParseError;
19514 * The contents of CResult_SiPrefixBolt11ParseErrorZ
19516 typedef union LDKCResult_SiPrefixBolt11ParseErrorZPtr {
19518 * A pointer to the contents in the success state.
19519 * Reading from this pointer when `result_ok` is not set is undefined.
19521 enum LDKSiPrefix *result;
19523 * A pointer to the contents in the error state.
19524 * Reading from this pointer when `result_ok` is set is undefined.
19526 struct LDKBolt11ParseError *err;
19527 } LDKCResult_SiPrefixBolt11ParseErrorZPtr;
19530 * A CResult_SiPrefixBolt11ParseErrorZ represents the result of a fallible operation,
19531 * containing a crate::lightning_invoice::SiPrefix on success and a crate::lightning_invoice::Bolt11ParseError on failure.
19532 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
19534 typedef struct LDKCResult_SiPrefixBolt11ParseErrorZ {
19536 * The contents of this CResult_SiPrefixBolt11ParseErrorZ, accessible via either
19537 * `err` or `result` depending on the state of `result_ok`.
19539 union LDKCResult_SiPrefixBolt11ParseErrorZPtr contents;
19541 * Whether this CResult_SiPrefixBolt11ParseErrorZ represents a success state.
19544 } LDKCResult_SiPrefixBolt11ParseErrorZ;
19547 * Indicates that something went wrong while parsing or validating the invoice. Parsing errors
19548 * should be mostly seen as opaque and are only there for debugging reasons. Semantic errors
19549 * like wrong signatures, missing fields etc. could mean that someone tampered with the invoice.
19551 typedef enum LDKParseOrSemanticError_Tag {
19553 * The invoice couldn't be decoded
19555 LDKParseOrSemanticError_ParseError,
19557 * The invoice could be decoded but violates the BOLT11 standard
19559 LDKParseOrSemanticError_SemanticError,
19561 * Must be last for serialization purposes
19563 LDKParseOrSemanticError_Sentinel,
19564 } LDKParseOrSemanticError_Tag;
19566 typedef struct MUST_USE_STRUCT LDKParseOrSemanticError {
19567 LDKParseOrSemanticError_Tag tag;
19570 struct LDKBolt11ParseError parse_error;
19573 enum LDKBolt11SemanticError semantic_error;
19576 } LDKParseOrSemanticError;
19579 * The contents of CResult_Bolt11InvoiceParseOrSemanticErrorZ
19581 typedef union LDKCResult_Bolt11InvoiceParseOrSemanticErrorZPtr {
19583 * A pointer to the contents in the success state.
19584 * Reading from this pointer when `result_ok` is not set is undefined.
19586 struct LDKBolt11Invoice *result;
19588 * A pointer to the contents in the error state.
19589 * Reading from this pointer when `result_ok` is set is undefined.
19591 struct LDKParseOrSemanticError *err;
19592 } LDKCResult_Bolt11InvoiceParseOrSemanticErrorZPtr;
19595 * A CResult_Bolt11InvoiceParseOrSemanticErrorZ represents the result of a fallible operation,
19596 * containing a crate::lightning_invoice::Bolt11Invoice on success and a crate::lightning_invoice::ParseOrSemanticError on failure.
19597 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
19599 typedef struct LDKCResult_Bolt11InvoiceParseOrSemanticErrorZ {
19601 * The contents of this CResult_Bolt11InvoiceParseOrSemanticErrorZ, accessible via either
19602 * `err` or `result` depending on the state of `result_ok`.
19604 union LDKCResult_Bolt11InvoiceParseOrSemanticErrorZPtr contents;
19606 * Whether this CResult_Bolt11InvoiceParseOrSemanticErrorZ represents a success state.
19609 } LDKCResult_Bolt11InvoiceParseOrSemanticErrorZ;
19614 * Represents a signed [`RawBolt11Invoice`] with cached hash. The signature is not checked and may be
19618 * The hash has to be either from the deserialized invoice or from the serialized [`RawBolt11Invoice`].
19620 typedef struct MUST_USE_STRUCT LDKSignedRawBolt11Invoice {
19622 * A pointer to the opaque Rust object.
19623 * Nearly everywhere, inner must be non-null, however in places where
19624 * the Rust equivalent takes an Option, it may be set to null to indicate None.
19626 LDKnativeSignedRawBolt11Invoice *inner;
19628 * Indicates that this is the only struct which contains the same pointer.
19629 * Rust functions which take ownership of an object provided via an argument require
19630 * this to be true and invalidate the object pointed to by inner.
19633 } LDKSignedRawBolt11Invoice;
19636 * The contents of CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ
19638 typedef union LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZPtr {
19640 * A pointer to the contents in the success state.
19641 * Reading from this pointer when `result_ok` is not set is undefined.
19643 struct LDKSignedRawBolt11Invoice *result;
19645 * A pointer to the contents in the error state.
19646 * Reading from this pointer when `result_ok` is set is undefined.
19648 struct LDKBolt11ParseError *err;
19649 } LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZPtr;
19652 * A CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ represents the result of a fallible operation,
19653 * containing a crate::lightning_invoice::SignedRawBolt11Invoice on success and a crate::lightning_invoice::Bolt11ParseError on failure.
19654 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
19656 typedef struct LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZ {
19658 * The contents of this CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ, accessible via either
19659 * `err` or `result` depending on the state of `result_ok`.
19661 union LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZPtr contents;
19663 * Whether this CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ represents a success state.
19666 } LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZ;
19671 * Represents an syntactically correct [`Bolt11Invoice`] for a payment on the lightning network,
19672 * but without the signature information.
19673 * Decoding and encoding should not lead to information loss but may lead to different hashes.
19675 * For methods without docs see the corresponding methods in [`Bolt11Invoice`].
19677 typedef struct MUST_USE_STRUCT LDKRawBolt11Invoice {
19679 * A pointer to the opaque Rust object.
19680 * Nearly everywhere, inner must be non-null, however in places where
19681 * the Rust equivalent takes an Option, it may be set to null to indicate None.
19683 LDKnativeRawBolt11Invoice *inner;
19685 * Indicates that this is the only struct which contains the same pointer.
19686 * Rust functions which take ownership of an object provided via an argument require
19687 * this to be true and invalidate the object pointed to by inner.
19690 } LDKRawBolt11Invoice;
19695 * Recoverable signature
19697 typedef struct MUST_USE_STRUCT LDKBolt11InvoiceSignature {
19699 * A pointer to the opaque Rust object.
19700 * Nearly everywhere, inner must be non-null, however in places where
19701 * the Rust equivalent takes an Option, it may be set to null to indicate None.
19703 LDKnativeBolt11InvoiceSignature *inner;
19705 * Indicates that this is the only struct which contains the same pointer.
19706 * Rust functions which take ownership of an object provided via an argument require
19707 * this to be true and invalidate the object pointed to by inner.
19710 } LDKBolt11InvoiceSignature;
19713 * A tuple of 3 elements. See the individual fields for the types contained.
19715 typedef struct LDKC3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ {
19717 * The element at position 0
19719 struct LDKRawBolt11Invoice a;
19721 * The element at position 1
19723 struct LDKThirtyTwoBytes b;
19725 * The element at position 2
19727 struct LDKBolt11InvoiceSignature c;
19728 } LDKC3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ;
19735 typedef struct MUST_USE_STRUCT LDKPayeePubKey {
19737 * A pointer to the opaque Rust object.
19738 * Nearly everywhere, inner must be non-null, however in places where
19739 * the Rust equivalent takes an Option, it may be set to null to indicate None.
19741 LDKnativePayeePubKey *inner;
19743 * Indicates that this is the only struct which contains the same pointer.
19744 * Rust functions which take ownership of an object provided via an argument require
19745 * this to be true and invalidate the object pointed to by inner.
19751 * The contents of CResult_PayeePubKeySecp256k1ErrorZ
19753 typedef union LDKCResult_PayeePubKeySecp256k1ErrorZPtr {
19755 * A pointer to the contents in the success state.
19756 * Reading from this pointer when `result_ok` is not set is undefined.
19758 struct LDKPayeePubKey *result;
19760 * A pointer to the contents in the error state.
19761 * Reading from this pointer when `result_ok` is set is undefined.
19763 enum LDKSecp256k1Error *err;
19764 } LDKCResult_PayeePubKeySecp256k1ErrorZPtr;
19767 * A CResult_PayeePubKeySecp256k1ErrorZ represents the result of a fallible operation,
19768 * containing a crate::lightning_invoice::PayeePubKey on success and a crate::c_types::Secp256k1Error on failure.
19769 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
19771 typedef struct LDKCResult_PayeePubKeySecp256k1ErrorZ {
19773 * The contents of this CResult_PayeePubKeySecp256k1ErrorZ, accessible via either
19774 * `err` or `result` depending on the state of `result_ok`.
19776 union LDKCResult_PayeePubKeySecp256k1ErrorZPtr contents;
19778 * Whether this CResult_PayeePubKeySecp256k1ErrorZ represents a success state.
19781 } LDKCResult_PayeePubKeySecp256k1ErrorZ;
19786 * Private routing information
19789 * The encoded route has to be <1024 5bit characters long (<=639 bytes or <=12 hops)
19792 typedef struct MUST_USE_STRUCT LDKPrivateRoute {
19794 * A pointer to the opaque Rust object.
19795 * Nearly everywhere, inner must be non-null, however in places where
19796 * the Rust equivalent takes an Option, it may be set to null to indicate None.
19798 LDKnativePrivateRoute *inner;
19800 * Indicates that this is the only struct which contains the same pointer.
19801 * Rust functions which take ownership of an object provided via an argument require
19802 * this to be true and invalidate the object pointed to by inner.
19808 * A dynamically-allocated array of crate::lightning_invoice::PrivateRoutes of arbitrary size.
19809 * This corresponds to std::vector in C++
19811 typedef struct LDKCVec_PrivateRouteZ {
19813 * The elements in the array.
19814 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
19816 struct LDKPrivateRoute *data;
19818 * The number of elements pointed to by `data`.
19821 } LDKCVec_PrivateRouteZ;
19826 * A timestamp that refers to a date after 1 January 1970.
19830 * The Unix timestamp representing the stored time has to be positive and no greater than
19831 * [`MAX_TIMESTAMP`].
19833 typedef struct MUST_USE_STRUCT LDKPositiveTimestamp {
19835 * A pointer to the opaque Rust object.
19836 * Nearly everywhere, inner must be non-null, however in places where
19837 * the Rust equivalent takes an Option, it may be set to null to indicate None.
19839 LDKnativePositiveTimestamp *inner;
19841 * Indicates that this is the only struct which contains the same pointer.
19842 * Rust functions which take ownership of an object provided via an argument require
19843 * this to be true and invalidate the object pointed to by inner.
19846 } LDKPositiveTimestamp;
19849 * The contents of CResult_PositiveTimestampCreationErrorZ
19851 typedef union LDKCResult_PositiveTimestampCreationErrorZPtr {
19853 * A pointer to the contents in the success state.
19854 * Reading from this pointer when `result_ok` is not set is undefined.
19856 struct LDKPositiveTimestamp *result;
19858 * A pointer to the contents in the error state.
19859 * Reading from this pointer when `result_ok` is set is undefined.
19861 enum LDKCreationError *err;
19862 } LDKCResult_PositiveTimestampCreationErrorZPtr;
19865 * A CResult_PositiveTimestampCreationErrorZ represents the result of a fallible operation,
19866 * containing a crate::lightning_invoice::PositiveTimestamp on success and a crate::lightning_invoice::CreationError on failure.
19867 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
19869 typedef struct LDKCResult_PositiveTimestampCreationErrorZ {
19871 * The contents of this CResult_PositiveTimestampCreationErrorZ, accessible via either
19872 * `err` or `result` depending on the state of `result_ok`.
19874 union LDKCResult_PositiveTimestampCreationErrorZPtr contents;
19876 * Whether this CResult_PositiveTimestampCreationErrorZ represents a success state.
19879 } LDKCResult_PositiveTimestampCreationErrorZ;
19882 * The contents of CResult_NoneBolt11SemanticErrorZ
19884 typedef union LDKCResult_NoneBolt11SemanticErrorZPtr {
19886 * Note that this value is always NULL, as there are no contents in the OK variant
19890 * A pointer to the contents in the error state.
19891 * Reading from this pointer when `result_ok` is set is undefined.
19893 enum LDKBolt11SemanticError *err;
19894 } LDKCResult_NoneBolt11SemanticErrorZPtr;
19897 * A CResult_NoneBolt11SemanticErrorZ represents the result of a fallible operation,
19898 * containing a () on success and a crate::lightning_invoice::Bolt11SemanticError on failure.
19899 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
19901 typedef struct LDKCResult_NoneBolt11SemanticErrorZ {
19903 * The contents of this CResult_NoneBolt11SemanticErrorZ, accessible via either
19904 * `err` or `result` depending on the state of `result_ok`.
19906 union LDKCResult_NoneBolt11SemanticErrorZPtr contents;
19908 * Whether this CResult_NoneBolt11SemanticErrorZ represents a success state.
19911 } LDKCResult_NoneBolt11SemanticErrorZ;
19914 * The contents of CResult_Bolt11InvoiceBolt11SemanticErrorZ
19916 typedef union LDKCResult_Bolt11InvoiceBolt11SemanticErrorZPtr {
19918 * A pointer to the contents in the success state.
19919 * Reading from this pointer when `result_ok` is not set is undefined.
19921 struct LDKBolt11Invoice *result;
19923 * A pointer to the contents in the error state.
19924 * Reading from this pointer when `result_ok` is set is undefined.
19926 enum LDKBolt11SemanticError *err;
19927 } LDKCResult_Bolt11InvoiceBolt11SemanticErrorZPtr;
19930 * A CResult_Bolt11InvoiceBolt11SemanticErrorZ represents the result of a fallible operation,
19931 * containing a crate::lightning_invoice::Bolt11Invoice on success and a crate::lightning_invoice::Bolt11SemanticError on failure.
19932 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
19934 typedef struct LDKCResult_Bolt11InvoiceBolt11SemanticErrorZ {
19936 * The contents of this CResult_Bolt11InvoiceBolt11SemanticErrorZ, accessible via either
19937 * `err` or `result` depending on the state of `result_ok`.
19939 union LDKCResult_Bolt11InvoiceBolt11SemanticErrorZPtr contents;
19941 * Whether this CResult_Bolt11InvoiceBolt11SemanticErrorZ represents a success state.
19944 } LDKCResult_Bolt11InvoiceBolt11SemanticErrorZ;
19949 * Description string
19952 * The description can be at most 639 __bytes__ long
19954 typedef struct MUST_USE_STRUCT LDKDescription {
19956 * A pointer to the opaque Rust object.
19957 * Nearly everywhere, inner must be non-null, however in places where
19958 * the Rust equivalent takes an Option, it may be set to null to indicate None.
19960 LDKnativeDescription *inner;
19962 * Indicates that this is the only struct which contains the same pointer.
19963 * Rust functions which take ownership of an object provided via an argument require
19964 * this to be true and invalidate the object pointed to by inner.
19970 * The contents of CResult_DescriptionCreationErrorZ
19972 typedef union LDKCResult_DescriptionCreationErrorZPtr {
19974 * A pointer to the contents in the success state.
19975 * Reading from this pointer when `result_ok` is not set is undefined.
19977 struct LDKDescription *result;
19979 * A pointer to the contents in the error state.
19980 * Reading from this pointer when `result_ok` is set is undefined.
19982 enum LDKCreationError *err;
19983 } LDKCResult_DescriptionCreationErrorZPtr;
19986 * A CResult_DescriptionCreationErrorZ represents the result of a fallible operation,
19987 * containing a crate::lightning_invoice::Description on success and a crate::lightning_invoice::CreationError on failure.
19988 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
19990 typedef struct LDKCResult_DescriptionCreationErrorZ {
19992 * The contents of this CResult_DescriptionCreationErrorZ, accessible via either
19993 * `err` or `result` depending on the state of `result_ok`.
19995 union LDKCResult_DescriptionCreationErrorZPtr contents;
19997 * Whether this CResult_DescriptionCreationErrorZ represents a success state.
20000 } LDKCResult_DescriptionCreationErrorZ;
20003 * The contents of CResult_PrivateRouteCreationErrorZ
20005 typedef union LDKCResult_PrivateRouteCreationErrorZPtr {
20007 * A pointer to the contents in the success state.
20008 * Reading from this pointer when `result_ok` is not set is undefined.
20010 struct LDKPrivateRoute *result;
20012 * A pointer to the contents in the error state.
20013 * Reading from this pointer when `result_ok` is set is undefined.
20015 enum LDKCreationError *err;
20016 } LDKCResult_PrivateRouteCreationErrorZPtr;
20019 * A CResult_PrivateRouteCreationErrorZ represents the result of a fallible operation,
20020 * containing a crate::lightning_invoice::PrivateRoute on success and a crate::lightning_invoice::CreationError on failure.
20021 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
20023 typedef struct LDKCResult_PrivateRouteCreationErrorZ {
20025 * The contents of this CResult_PrivateRouteCreationErrorZ, accessible via either
20026 * `err` or `result` depending on the state of `result_ok`.
20028 union LDKCResult_PrivateRouteCreationErrorZPtr contents;
20030 * Whether this CResult_PrivateRouteCreationErrorZ represents a success state.
20033 } LDKCResult_PrivateRouteCreationErrorZ;
20036 * The contents of CResult_OutPointDecodeErrorZ
20038 typedef union LDKCResult_OutPointDecodeErrorZPtr {
20040 * A pointer to the contents in the success state.
20041 * Reading from this pointer when `result_ok` is not set is undefined.
20043 struct LDKOutPoint *result;
20045 * A pointer to the contents in the error state.
20046 * Reading from this pointer when `result_ok` is set is undefined.
20048 struct LDKDecodeError *err;
20049 } LDKCResult_OutPointDecodeErrorZPtr;
20052 * A CResult_OutPointDecodeErrorZ represents the result of a fallible operation,
20053 * containing a crate::lightning::chain::transaction::OutPoint on success and a crate::lightning::ln::msgs::DecodeError on failure.
20054 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
20056 typedef struct LDKCResult_OutPointDecodeErrorZ {
20058 * The contents of this CResult_OutPointDecodeErrorZ, accessible via either
20059 * `err` or `result` depending on the state of `result_ok`.
20061 union LDKCResult_OutPointDecodeErrorZPtr contents;
20063 * Whether this CResult_OutPointDecodeErrorZ represents a success state.
20066 } LDKCResult_OutPointDecodeErrorZ;
20071 * Lightning TLV uses a custom variable-length integer called `BigSize`. It is similar to Bitcoin's
20072 * variable-length integers except that it is serialized in big-endian instead of little-endian.
20074 * Like Bitcoin's variable-length integer, it exhibits ambiguity in that certain values can be
20075 * encoded in several different ways, which we must check for at deserialization-time. Thus, if
20076 * you're looking for an example of a variable-length integer to use for your own project, move
20077 * along, this is a rather poor design.
20079 typedef struct MUST_USE_STRUCT LDKBigSize {
20081 * A pointer to the opaque Rust object.
20082 * Nearly everywhere, inner must be non-null, however in places where
20083 * the Rust equivalent takes an Option, it may be set to null to indicate None.
20085 LDKnativeBigSize *inner;
20087 * Indicates that this is the only struct which contains the same pointer.
20088 * Rust functions which take ownership of an object provided via an argument require
20089 * this to be true and invalidate the object pointed to by inner.
20095 * The contents of CResult_BigSizeDecodeErrorZ
20097 typedef union LDKCResult_BigSizeDecodeErrorZPtr {
20099 * A pointer to the contents in the success state.
20100 * Reading from this pointer when `result_ok` is not set is undefined.
20102 struct LDKBigSize *result;
20104 * A pointer to the contents in the error state.
20105 * Reading from this pointer when `result_ok` is set is undefined.
20107 struct LDKDecodeError *err;
20108 } LDKCResult_BigSizeDecodeErrorZPtr;
20111 * A CResult_BigSizeDecodeErrorZ represents the result of a fallible operation,
20112 * containing a crate::lightning::util::ser::BigSize on success and a crate::lightning::ln::msgs::DecodeError on failure.
20113 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
20115 typedef struct LDKCResult_BigSizeDecodeErrorZ {
20117 * The contents of this CResult_BigSizeDecodeErrorZ, accessible via either
20118 * `err` or `result` depending on the state of `result_ok`.
20120 union LDKCResult_BigSizeDecodeErrorZPtr contents;
20122 * Whether this CResult_BigSizeDecodeErrorZ represents a success state.
20125 } LDKCResult_BigSizeDecodeErrorZ;
20128 * The contents of CResult_HostnameDecodeErrorZ
20130 typedef union LDKCResult_HostnameDecodeErrorZPtr {
20132 * A pointer to the contents in the success state.
20133 * Reading from this pointer when `result_ok` is not set is undefined.
20135 struct LDKHostname *result;
20137 * A pointer to the contents in the error state.
20138 * Reading from this pointer when `result_ok` is set is undefined.
20140 struct LDKDecodeError *err;
20141 } LDKCResult_HostnameDecodeErrorZPtr;
20144 * A CResult_HostnameDecodeErrorZ represents the result of a fallible operation,
20145 * containing a crate::lightning::util::ser::Hostname on success and a crate::lightning::ln::msgs::DecodeError on failure.
20146 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
20148 typedef struct LDKCResult_HostnameDecodeErrorZ {
20150 * The contents of this CResult_HostnameDecodeErrorZ, accessible via either
20151 * `err` or `result` depending on the state of `result_ok`.
20153 union LDKCResult_HostnameDecodeErrorZPtr contents;
20155 * Whether this CResult_HostnameDecodeErrorZ represents a success state.
20158 } LDKCResult_HostnameDecodeErrorZ;
20163 * A wrapper for a `Transaction` which can only be constructed with [`TransactionU16LenLimited::new`]
20164 * if the `Transaction`'s consensus-serialized length is <= u16::MAX.
20166 * Use [`TransactionU16LenLimited::into_transaction`] to convert into the contained `Transaction`.
20168 typedef struct MUST_USE_STRUCT LDKTransactionU16LenLimited {
20170 * A pointer to the opaque Rust object.
20171 * Nearly everywhere, inner must be non-null, however in places where
20172 * the Rust equivalent takes an Option, it may be set to null to indicate None.
20174 LDKnativeTransactionU16LenLimited *inner;
20176 * Indicates that this is the only struct which contains the same pointer.
20177 * Rust functions which take ownership of an object provided via an argument require
20178 * this to be true and invalidate the object pointed to by inner.
20181 } LDKTransactionU16LenLimited;
20184 * The contents of CResult_TransactionU16LenLimitedNoneZ
20186 typedef union LDKCResult_TransactionU16LenLimitedNoneZPtr {
20188 * A pointer to the contents in the success state.
20189 * Reading from this pointer when `result_ok` is not set is undefined.
20191 struct LDKTransactionU16LenLimited *result;
20193 * Note that this value is always NULL, as there are no contents in the Err variant
20196 } LDKCResult_TransactionU16LenLimitedNoneZPtr;
20199 * A CResult_TransactionU16LenLimitedNoneZ represents the result of a fallible operation,
20200 * containing a crate::lightning::util::ser::TransactionU16LenLimited on success and a () on failure.
20201 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
20203 typedef struct LDKCResult_TransactionU16LenLimitedNoneZ {
20205 * The contents of this CResult_TransactionU16LenLimitedNoneZ, accessible via either
20206 * `err` or `result` depending on the state of `result_ok`.
20208 union LDKCResult_TransactionU16LenLimitedNoneZPtr contents;
20210 * Whether this CResult_TransactionU16LenLimitedNoneZ represents a success state.
20213 } LDKCResult_TransactionU16LenLimitedNoneZ;
20216 * The contents of CResult_TransactionU16LenLimitedDecodeErrorZ
20218 typedef union LDKCResult_TransactionU16LenLimitedDecodeErrorZPtr {
20220 * A pointer to the contents in the success state.
20221 * Reading from this pointer when `result_ok` is not set is undefined.
20223 struct LDKTransactionU16LenLimited *result;
20225 * A pointer to the contents in the error state.
20226 * Reading from this pointer when `result_ok` is set is undefined.
20228 struct LDKDecodeError *err;
20229 } LDKCResult_TransactionU16LenLimitedDecodeErrorZPtr;
20232 * A CResult_TransactionU16LenLimitedDecodeErrorZ represents the result of a fallible operation,
20233 * containing a crate::lightning::util::ser::TransactionU16LenLimited on success and a crate::lightning::ln::msgs::DecodeError on failure.
20234 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
20236 typedef struct LDKCResult_TransactionU16LenLimitedDecodeErrorZ {
20238 * The contents of this CResult_TransactionU16LenLimitedDecodeErrorZ, accessible via either
20239 * `err` or `result` depending on the state of `result_ok`.
20241 union LDKCResult_TransactionU16LenLimitedDecodeErrorZPtr contents;
20243 * Whether this CResult_TransactionU16LenLimitedDecodeErrorZ represents a success state.
20246 } LDKCResult_TransactionU16LenLimitedDecodeErrorZ;
20249 * The contents of CResult_UntrustedStringDecodeErrorZ
20251 typedef union LDKCResult_UntrustedStringDecodeErrorZPtr {
20253 * A pointer to the contents in the success state.
20254 * Reading from this pointer when `result_ok` is not set is undefined.
20256 struct LDKUntrustedString *result;
20258 * A pointer to the contents in the error state.
20259 * Reading from this pointer when `result_ok` is set is undefined.
20261 struct LDKDecodeError *err;
20262 } LDKCResult_UntrustedStringDecodeErrorZPtr;
20265 * A CResult_UntrustedStringDecodeErrorZ represents the result of a fallible operation,
20266 * containing a crate::lightning::util::string::UntrustedString on success and a crate::lightning::ln::msgs::DecodeError on failure.
20267 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
20269 typedef struct LDKCResult_UntrustedStringDecodeErrorZ {
20271 * The contents of this CResult_UntrustedStringDecodeErrorZ, accessible via either
20272 * `err` or `result` depending on the state of `result_ok`.
20274 union LDKCResult_UntrustedStringDecodeErrorZPtr contents;
20276 * Whether this CResult_UntrustedStringDecodeErrorZ represents a success state.
20279 } LDKCResult_UntrustedStringDecodeErrorZ;
20282 * The contents of CResult_ChannelIdDecodeErrorZ
20284 typedef union LDKCResult_ChannelIdDecodeErrorZPtr {
20286 * A pointer to the contents in the success state.
20287 * Reading from this pointer when `result_ok` is not set is undefined.
20289 struct LDKChannelId *result;
20291 * A pointer to the contents in the error state.
20292 * Reading from this pointer when `result_ok` is set is undefined.
20294 struct LDKDecodeError *err;
20295 } LDKCResult_ChannelIdDecodeErrorZPtr;
20298 * A CResult_ChannelIdDecodeErrorZ represents the result of a fallible operation,
20299 * containing a crate::lightning::ln::types::ChannelId on success and a crate::lightning::ln::msgs::DecodeError on failure.
20300 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
20302 typedef struct LDKCResult_ChannelIdDecodeErrorZ {
20304 * The contents of this CResult_ChannelIdDecodeErrorZ, accessible via either
20305 * `err` or `result` depending on the state of `result_ok`.
20307 union LDKCResult_ChannelIdDecodeErrorZPtr contents;
20309 * Whether this CResult_ChannelIdDecodeErrorZ represents a success state.
20312 } LDKCResult_ChannelIdDecodeErrorZ;
20315 * A tuple of 2 elements. See the individual fields for the types contained.
20317 typedef struct LDKC2Tuple__u832u16Z {
20319 * The element at position 0
20321 struct LDKThirtyTwoBytes a;
20323 * The element at position 1
20326 } LDKC2Tuple__u832u16Z;
20331 * Parameters for relaying over a given [`BlindedHop`].
20333 * [`BlindedHop`]: crate::blinded_path::BlindedHop
20335 typedef struct MUST_USE_STRUCT LDKPaymentRelay {
20337 * A pointer to the opaque Rust object.
20338 * Nearly everywhere, inner must be non-null, however in places where
20339 * the Rust equivalent takes an Option, it may be set to null to indicate None.
20341 LDKnativePaymentRelay *inner;
20343 * Indicates that this is the only struct which contains the same pointer.
20344 * Rust functions which take ownership of an object provided via an argument require
20345 * this to be true and invalidate the object pointed to by inner.
20351 * The contents of CResult_PaymentRelayDecodeErrorZ
20353 typedef union LDKCResult_PaymentRelayDecodeErrorZPtr {
20355 * A pointer to the contents in the success state.
20356 * Reading from this pointer when `result_ok` is not set is undefined.
20358 struct LDKPaymentRelay *result;
20360 * A pointer to the contents in the error state.
20361 * Reading from this pointer when `result_ok` is set is undefined.
20363 struct LDKDecodeError *err;
20364 } LDKCResult_PaymentRelayDecodeErrorZPtr;
20367 * A CResult_PaymentRelayDecodeErrorZ represents the result of a fallible operation,
20368 * containing a crate::lightning::blinded_path::payment::PaymentRelay on success and a crate::lightning::ln::msgs::DecodeError on failure.
20369 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
20371 typedef struct LDKCResult_PaymentRelayDecodeErrorZ {
20373 * The contents of this CResult_PaymentRelayDecodeErrorZ, accessible via either
20374 * `err` or `result` depending on the state of `result_ok`.
20376 union LDKCResult_PaymentRelayDecodeErrorZPtr contents;
20378 * Whether this CResult_PaymentRelayDecodeErrorZ represents a success state.
20381 } LDKCResult_PaymentRelayDecodeErrorZ;
20386 * Constraints for relaying over a given [`BlindedHop`].
20388 * [`BlindedHop`]: crate::blinded_path::BlindedHop
20390 typedef struct MUST_USE_STRUCT LDKPaymentConstraints {
20392 * A pointer to the opaque Rust object.
20393 * Nearly everywhere, inner must be non-null, however in places where
20394 * the Rust equivalent takes an Option, it may be set to null to indicate None.
20396 LDKnativePaymentConstraints *inner;
20398 * Indicates that this is the only struct which contains the same pointer.
20399 * Rust functions which take ownership of an object provided via an argument require
20400 * this to be true and invalidate the object pointed to by inner.
20403 } LDKPaymentConstraints;
20406 * The contents of CResult_PaymentConstraintsDecodeErrorZ
20408 typedef union LDKCResult_PaymentConstraintsDecodeErrorZPtr {
20410 * A pointer to the contents in the success state.
20411 * Reading from this pointer when `result_ok` is not set is undefined.
20413 struct LDKPaymentConstraints *result;
20415 * A pointer to the contents in the error state.
20416 * Reading from this pointer when `result_ok` is set is undefined.
20418 struct LDKDecodeError *err;
20419 } LDKCResult_PaymentConstraintsDecodeErrorZPtr;
20422 * A CResult_PaymentConstraintsDecodeErrorZ represents the result of a fallible operation,
20423 * containing a crate::lightning::blinded_path::payment::PaymentConstraints on success and a crate::lightning::ln::msgs::DecodeError on failure.
20424 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
20426 typedef struct LDKCResult_PaymentConstraintsDecodeErrorZ {
20428 * The contents of this CResult_PaymentConstraintsDecodeErrorZ, accessible via either
20429 * `err` or `result` depending on the state of `result_ok`.
20431 union LDKCResult_PaymentConstraintsDecodeErrorZPtr contents;
20433 * Whether this CResult_PaymentConstraintsDecodeErrorZ represents a success state.
20436 } LDKCResult_PaymentConstraintsDecodeErrorZ;
20439 * The contents of CResult_PaymentContextDecodeErrorZ
20441 typedef union LDKCResult_PaymentContextDecodeErrorZPtr {
20443 * A pointer to the contents in the success state.
20444 * Reading from this pointer when `result_ok` is not set is undefined.
20446 struct LDKPaymentContext *result;
20448 * A pointer to the contents in the error state.
20449 * Reading from this pointer when `result_ok` is set is undefined.
20451 struct LDKDecodeError *err;
20452 } LDKCResult_PaymentContextDecodeErrorZPtr;
20455 * A CResult_PaymentContextDecodeErrorZ represents the result of a fallible operation,
20456 * containing a crate::lightning::blinded_path::payment::PaymentContext on success and a crate::lightning::ln::msgs::DecodeError on failure.
20457 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
20459 typedef struct LDKCResult_PaymentContextDecodeErrorZ {
20461 * The contents of this CResult_PaymentContextDecodeErrorZ, accessible via either
20462 * `err` or `result` depending on the state of `result_ok`.
20464 union LDKCResult_PaymentContextDecodeErrorZPtr contents;
20466 * Whether this CResult_PaymentContextDecodeErrorZ represents a success state.
20469 } LDKCResult_PaymentContextDecodeErrorZ;
20472 * The contents of CResult_UnknownPaymentContextDecodeErrorZ
20474 typedef union LDKCResult_UnknownPaymentContextDecodeErrorZPtr {
20476 * A pointer to the contents in the success state.
20477 * Reading from this pointer when `result_ok` is not set is undefined.
20479 struct LDKUnknownPaymentContext *result;
20481 * A pointer to the contents in the error state.
20482 * Reading from this pointer when `result_ok` is set is undefined.
20484 struct LDKDecodeError *err;
20485 } LDKCResult_UnknownPaymentContextDecodeErrorZPtr;
20488 * A CResult_UnknownPaymentContextDecodeErrorZ represents the result of a fallible operation,
20489 * containing a crate::lightning::blinded_path::payment::UnknownPaymentContext on success and a crate::lightning::ln::msgs::DecodeError on failure.
20490 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
20492 typedef struct LDKCResult_UnknownPaymentContextDecodeErrorZ {
20494 * The contents of this CResult_UnknownPaymentContextDecodeErrorZ, accessible via either
20495 * `err` or `result` depending on the state of `result_ok`.
20497 union LDKCResult_UnknownPaymentContextDecodeErrorZPtr contents;
20499 * Whether this CResult_UnknownPaymentContextDecodeErrorZ represents a success state.
20502 } LDKCResult_UnknownPaymentContextDecodeErrorZ;
20505 * The contents of CResult_Bolt12OfferContextDecodeErrorZ
20507 typedef union LDKCResult_Bolt12OfferContextDecodeErrorZPtr {
20509 * A pointer to the contents in the success state.
20510 * Reading from this pointer when `result_ok` is not set is undefined.
20512 struct LDKBolt12OfferContext *result;
20514 * A pointer to the contents in the error state.
20515 * Reading from this pointer when `result_ok` is set is undefined.
20517 struct LDKDecodeError *err;
20518 } LDKCResult_Bolt12OfferContextDecodeErrorZPtr;
20521 * A CResult_Bolt12OfferContextDecodeErrorZ represents the result of a fallible operation,
20522 * containing a crate::lightning::blinded_path::payment::Bolt12OfferContext on success and a crate::lightning::ln::msgs::DecodeError on failure.
20523 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
20525 typedef struct LDKCResult_Bolt12OfferContextDecodeErrorZ {
20527 * The contents of this CResult_Bolt12OfferContextDecodeErrorZ, accessible via either
20528 * `err` or `result` depending on the state of `result_ok`.
20530 union LDKCResult_Bolt12OfferContextDecodeErrorZPtr contents;
20532 * Whether this CResult_Bolt12OfferContextDecodeErrorZ represents a success state.
20535 } LDKCResult_Bolt12OfferContextDecodeErrorZ;
20538 * The contents of CResult_Bolt12RefundContextDecodeErrorZ
20540 typedef union LDKCResult_Bolt12RefundContextDecodeErrorZPtr {
20542 * A pointer to the contents in the success state.
20543 * Reading from this pointer when `result_ok` is not set is undefined.
20545 struct LDKBolt12RefundContext *result;
20547 * A pointer to the contents in the error state.
20548 * Reading from this pointer when `result_ok` is set is undefined.
20550 struct LDKDecodeError *err;
20551 } LDKCResult_Bolt12RefundContextDecodeErrorZPtr;
20554 * A CResult_Bolt12RefundContextDecodeErrorZ represents the result of a fallible operation,
20555 * containing a crate::lightning::blinded_path::payment::Bolt12RefundContext on success and a crate::lightning::ln::msgs::DecodeError on failure.
20556 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
20558 typedef struct LDKCResult_Bolt12RefundContextDecodeErrorZ {
20560 * The contents of this CResult_Bolt12RefundContextDecodeErrorZ, accessible via either
20561 * `err` or `result` depending on the state of `result_ok`.
20563 union LDKCResult_Bolt12RefundContextDecodeErrorZPtr contents;
20565 * Whether this CResult_Bolt12RefundContextDecodeErrorZ represents a success state.
20568 } LDKCResult_Bolt12RefundContextDecodeErrorZ;
20571 * The contents of CResult_StrSecp256k1ErrorZ
20573 typedef union LDKCResult_StrSecp256k1ErrorZPtr {
20575 * A pointer to the contents in the success state.
20576 * Reading from this pointer when `result_ok` is not set is undefined.
20578 struct LDKStr *result;
20580 * A pointer to the contents in the error state.
20581 * Reading from this pointer when `result_ok` is set is undefined.
20583 enum LDKSecp256k1Error *err;
20584 } LDKCResult_StrSecp256k1ErrorZPtr;
20587 * A CResult_StrSecp256k1ErrorZ represents the result of a fallible operation,
20588 * containing a crate::c_types::Str on success and a crate::c_types::Secp256k1Error on failure.
20589 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
20591 typedef struct LDKCResult_StrSecp256k1ErrorZ {
20593 * The contents of this CResult_StrSecp256k1ErrorZ, accessible via either
20594 * `err` or `result` depending on the state of `result_ok`.
20596 union LDKCResult_StrSecp256k1ErrorZPtr contents;
20598 * Whether this CResult_StrSecp256k1ErrorZ represents a success state.
20601 } LDKCResult_StrSecp256k1ErrorZ;
20604 * A tuple of 3 elements. See the individual fields for the types contained.
20606 typedef struct LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ {
20608 * The element at position 0
20610 struct LDKThirtyTwoBytes a;
20612 * The element at position 1
20614 struct LDKRecipientOnionFields b;
20616 * The element at position 2
20618 struct LDKRouteParameters c;
20619 } LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ;
20622 * The contents of CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ
20624 typedef union LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZPtr {
20626 * A pointer to the contents in the success state.
20627 * Reading from this pointer when `result_ok` is not set is undefined.
20629 struct LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ *result;
20631 * Note that this value is always NULL, as there are no contents in the Err variant
20634 } LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZPtr;
20637 * A CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ represents the result of a fallible operation,
20638 * containing a crate::c_types::derived::C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ on success and a () on failure.
20639 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
20641 typedef struct LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ {
20643 * The contents of this CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ, accessible via either
20644 * `err` or `result` depending on the state of `result_ok`.
20646 union LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZPtr contents;
20648 * Whether this CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ represents a success state.
20651 } LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ;
20654 * A tuple of 3 elements. See the individual fields for the types contained.
20656 typedef struct LDKC3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ {
20658 * The element at position 0
20660 struct LDKPublicKey a;
20662 * The element at position 1
20664 struct LDKOnionMessage b;
20666 * The element at position 2
20668 struct LDKCOption_CVec_SocketAddressZZ c;
20669 } LDKC3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ;
20672 * Errors that may occur when [sending an onion message].
20674 * [sending an onion message]: OnionMessenger::send_onion_message
20676 typedef enum LDKSendError_Tag {
20678 * Errored computing onion message packet keys.
20680 LDKSendError_Secp256k1,
20682 * Because implementations such as Eclair will drop onion messages where the message packet
20683 * exceeds 32834 bytes, we refuse to send messages where the packet exceeds this size.
20685 LDKSendError_TooBigPacket,
20687 * The provided [`Destination`] was an invalid [`BlindedPath`] due to not having any blinded
20690 LDKSendError_TooFewBlindedHops,
20692 * The first hop is not a peer and doesn't have a known [`SocketAddress`].
20694 LDKSendError_InvalidFirstHop,
20696 * A path from the sender to the destination could not be found by the [`MessageRouter`].
20698 LDKSendError_PathNotFound,
20700 * Onion message contents must have a TLV type >= 64.
20702 LDKSendError_InvalidMessage,
20704 * Our next-hop peer's buffer was full or our total outbound buffer was full.
20706 LDKSendError_BufferFull,
20708 * Failed to retrieve our node id from the provided [`NodeSigner`].
20710 * [`NodeSigner`]: crate::sign::NodeSigner
20712 LDKSendError_GetNodeIdFailed,
20714 * The provided [`Destination`] has a blinded path with an unresolved introduction node. An
20715 * attempt to resolve it in the [`MessageRouter`] when finding an [`OnionMessagePath`] likely
20718 LDKSendError_UnresolvedIntroductionNode,
20720 * We attempted to send to a blinded path where we are the introduction node, and failed to
20721 * advance the blinded path to make the second hop the new introduction node. Either
20722 * [`NodeSigner::ecdh`] failed, we failed to tweak the current blinding point to get the
20723 * new blinding point, or we were attempting to send to ourselves.
20725 LDKSendError_BlindedPathAdvanceFailed,
20727 * Must be last for serialization purposes
20729 LDKSendError_Sentinel,
20730 } LDKSendError_Tag;
20732 typedef struct MUST_USE_STRUCT LDKSendError {
20733 LDKSendError_Tag tag;
20736 enum LDKSecp256k1Error secp256k1;
20739 struct LDKPublicKey invalid_first_hop;
20745 * The contents of CResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ
20747 typedef union LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZPtr {
20749 * A pointer to the contents in the success state.
20750 * Reading from this pointer when `result_ok` is not set is undefined.
20752 struct LDKC3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ *result;
20754 * A pointer to the contents in the error state.
20755 * Reading from this pointer when `result_ok` is set is undefined.
20757 struct LDKSendError *err;
20758 } LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZPtr;
20761 * A CResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ represents the result of a fallible operation,
20762 * containing a crate::c_types::derived::C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ on success and a crate::lightning::onion_message::messenger::SendError on failure.
20763 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
20765 typedef struct LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ {
20767 * The contents of this CResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ, accessible via either
20768 * `err` or `result` depending on the state of `result_ok`.
20770 union LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZPtr contents;
20772 * Whether this CResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ represents a success state.
20775 } LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ;
20778 * The next hop to forward an onion message along its path.
20780 * Note that payment blinded paths always specify their next hop using an explicit node id.
20782 typedef enum LDKNextMessageHop_Tag {
20784 * The node id of the next hop.
20786 LDKNextMessageHop_NodeId,
20788 * The short channel id leading to the next hop.
20790 LDKNextMessageHop_ShortChannelId,
20792 * Must be last for serialization purposes
20794 LDKNextMessageHop_Sentinel,
20795 } LDKNextMessageHop_Tag;
20797 typedef struct MUST_USE_STRUCT LDKNextMessageHop {
20798 LDKNextMessageHop_Tag tag;
20801 struct LDKPublicKey node_id;
20804 uint64_t short_channel_id;
20807 } LDKNextMessageHop;
20810 * The contents of an [`OnionMessage`] as read from the wire.
20812 * [`OnionMessage`]: crate::ln::msgs::OnionMessage
20814 typedef enum LDKParsedOnionMessageContents_Tag {
20816 * A message related to BOLT 12 Offers.
20818 LDKParsedOnionMessageContents_Offers,
20820 * A custom onion message specified by the user.
20822 LDKParsedOnionMessageContents_Custom,
20824 * Must be last for serialization purposes
20826 LDKParsedOnionMessageContents_Sentinel,
20827 } LDKParsedOnionMessageContents_Tag;
20829 typedef struct MUST_USE_STRUCT LDKParsedOnionMessageContents {
20830 LDKParsedOnionMessageContents_Tag tag;
20833 struct LDKOffersMessage offers;
20836 struct LDKOnionMessageContents custom;
20839 } LDKParsedOnionMessageContents;
20842 * A processed incoming onion message, containing either a Forward (another onion message)
20843 * or a Receive payload with decrypted contents.
20845 typedef enum LDKPeeledOnion_Tag {
20847 * Forwarded onion, with the next node id and a new onion
20849 LDKPeeledOnion_Forward,
20851 * Received onion message, with decrypted contents, path_id, and reply path
20853 LDKPeeledOnion_Receive,
20855 * Must be last for serialization purposes
20857 LDKPeeledOnion_Sentinel,
20858 } LDKPeeledOnion_Tag;
20860 typedef struct LDKPeeledOnion_LDKForward_Body {
20861 struct LDKNextMessageHop _0;
20862 struct LDKOnionMessage _1;
20863 } LDKPeeledOnion_LDKForward_Body;
20865 typedef struct LDKPeeledOnion_LDKReceive_Body {
20866 struct LDKParsedOnionMessageContents _0;
20869 * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
20871 struct LDKThirtyTwoBytes _1;
20874 * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
20876 struct LDKBlindedPath _2;
20877 } LDKPeeledOnion_LDKReceive_Body;
20879 typedef struct MUST_USE_STRUCT LDKPeeledOnion {
20880 LDKPeeledOnion_Tag tag;
20882 LDKPeeledOnion_LDKForward_Body forward;
20883 LDKPeeledOnion_LDKReceive_Body receive;
20888 * The contents of CResult_PeeledOnionNoneZ
20890 typedef union LDKCResult_PeeledOnionNoneZPtr {
20892 * A pointer to the contents in the success state.
20893 * Reading from this pointer when `result_ok` is not set is undefined.
20895 struct LDKPeeledOnion *result;
20897 * Note that this value is always NULL, as there are no contents in the Err variant
20900 } LDKCResult_PeeledOnionNoneZPtr;
20903 * A CResult_PeeledOnionNoneZ represents the result of a fallible operation,
20904 * containing a crate::lightning::onion_message::messenger::PeeledOnion on success and a () on failure.
20905 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
20907 typedef struct LDKCResult_PeeledOnionNoneZ {
20909 * The contents of this CResult_PeeledOnionNoneZ, accessible via either
20910 * `err` or `result` depending on the state of `result_ok`.
20912 union LDKCResult_PeeledOnionNoneZPtr contents;
20914 * Whether this CResult_PeeledOnionNoneZ represents a success state.
20917 } LDKCResult_PeeledOnionNoneZ;
20920 * Result of successfully [sending an onion message].
20922 * [sending an onion message]: OnionMessenger::send_onion_message
20924 typedef enum LDKSendSuccess_Tag {
20926 * The message was buffered and will be sent once it is processed by
20927 * [`OnionMessageHandler::next_onion_message_for_peer`].
20929 LDKSendSuccess_Buffered,
20931 * The message was buffered and will be sent once the node is connected as a peer and it is
20932 * processed by [`OnionMessageHandler::next_onion_message_for_peer`].
20934 LDKSendSuccess_BufferedAwaitingConnection,
20936 * Must be last for serialization purposes
20938 LDKSendSuccess_Sentinel,
20939 } LDKSendSuccess_Tag;
20941 typedef struct MUST_USE_STRUCT LDKSendSuccess {
20942 LDKSendSuccess_Tag tag;
20945 struct LDKPublicKey buffered_awaiting_connection;
20951 * The contents of CResult_SendSuccessSendErrorZ
20953 typedef union LDKCResult_SendSuccessSendErrorZPtr {
20955 * A pointer to the contents in the success state.
20956 * Reading from this pointer when `result_ok` is not set is undefined.
20958 struct LDKSendSuccess *result;
20960 * A pointer to the contents in the error state.
20961 * Reading from this pointer when `result_ok` is set is undefined.
20963 struct LDKSendError *err;
20964 } LDKCResult_SendSuccessSendErrorZPtr;
20967 * A CResult_SendSuccessSendErrorZ represents the result of a fallible operation,
20968 * containing a crate::lightning::onion_message::messenger::SendSuccess on success and a crate::lightning::onion_message::messenger::SendError on failure.
20969 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
20971 typedef struct LDKCResult_SendSuccessSendErrorZ {
20973 * The contents of this CResult_SendSuccessSendErrorZ, accessible via either
20974 * `err` or `result` depending on the state of `result_ok`.
20976 union LDKCResult_SendSuccessSendErrorZPtr contents;
20978 * Whether this CResult_SendSuccessSendErrorZ represents a success state.
20981 } LDKCResult_SendSuccessSendErrorZ;
20984 * The contents of CResult_BlindedPathNoneZ
20986 typedef union LDKCResult_BlindedPathNoneZPtr {
20988 * A pointer to the contents in the success state.
20989 * Reading from this pointer when `result_ok` is not set is undefined.
20991 struct LDKBlindedPath *result;
20993 * Note that this value is always NULL, as there are no contents in the Err variant
20996 } LDKCResult_BlindedPathNoneZPtr;
20999 * A CResult_BlindedPathNoneZ represents the result of a fallible operation,
21000 * containing a crate::lightning::blinded_path::BlindedPath on success and a () on failure.
21001 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
21003 typedef struct LDKCResult_BlindedPathNoneZ {
21005 * The contents of this CResult_BlindedPathNoneZ, accessible via either
21006 * `err` or `result` depending on the state of `result_ok`.
21008 union LDKCResult_BlindedPathNoneZPtr contents;
21010 * Whether this CResult_BlindedPathNoneZ represents a success state.
21013 } LDKCResult_BlindedPathNoneZ;
21016 * The contents of CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ
21018 typedef union LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZPtr {
21020 * A pointer to the contents in the success state.
21021 * Reading from this pointer when `result_ok` is not set is undefined.
21023 struct LDKC2Tuple_BlindedPayInfoBlindedPathZ *result;
21025 * Note that this value is always NULL, as there are no contents in the Err variant
21028 } LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZPtr;
21031 * A CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ represents the result of a fallible operation,
21032 * containing a crate::c_types::derived::C2Tuple_BlindedPayInfoBlindedPathZ on success and a () on failure.
21033 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
21035 typedef struct LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ {
21037 * The contents of this CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ, accessible via either
21038 * `err` or `result` depending on the state of `result_ok`.
21040 union LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZPtr contents;
21042 * Whether this CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ represents a success state.
21045 } LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ;
21050 * An intermediate node, its outbound channel, and relay parameters.
21052 typedef struct MUST_USE_STRUCT LDKForwardNode {
21054 * A pointer to the opaque Rust object.
21055 * Nearly everywhere, inner must be non-null, however in places where
21056 * the Rust equivalent takes an Option, it may be set to null to indicate None.
21058 LDKnativeForwardNode *inner;
21060 * Indicates that this is the only struct which contains the same pointer.
21061 * Rust functions which take ownership of an object provided via an argument require
21062 * this to be true and invalidate the object pointed to by inner.
21068 * A dynamically-allocated array of crate::lightning::blinded_path::payment::ForwardNodes of arbitrary size.
21069 * This corresponds to std::vector in C++
21071 typedef struct LDKCVec_ForwardNodeZ {
21073 * The elements in the array.
21074 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
21076 struct LDKForwardNode *data;
21078 * The number of elements pointed to by `data`.
21081 } LDKCVec_ForwardNodeZ;
21084 * The contents of CResult_BlindedPathDecodeErrorZ
21086 typedef union LDKCResult_BlindedPathDecodeErrorZPtr {
21088 * A pointer to the contents in the success state.
21089 * Reading from this pointer when `result_ok` is not set is undefined.
21091 struct LDKBlindedPath *result;
21093 * A pointer to the contents in the error state.
21094 * Reading from this pointer when `result_ok` is set is undefined.
21096 struct LDKDecodeError *err;
21097 } LDKCResult_BlindedPathDecodeErrorZPtr;
21100 * A CResult_BlindedPathDecodeErrorZ represents the result of a fallible operation,
21101 * containing a crate::lightning::blinded_path::BlindedPath on success and a crate::lightning::ln::msgs::DecodeError on failure.
21102 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
21104 typedef struct LDKCResult_BlindedPathDecodeErrorZ {
21106 * The contents of this CResult_BlindedPathDecodeErrorZ, accessible via either
21107 * `err` or `result` depending on the state of `result_ok`.
21109 union LDKCResult_BlindedPathDecodeErrorZPtr contents;
21111 * Whether this CResult_BlindedPathDecodeErrorZ represents a success state.
21114 } LDKCResult_BlindedPathDecodeErrorZ;
21117 * The contents of CResult_BlindedHopDecodeErrorZ
21119 typedef union LDKCResult_BlindedHopDecodeErrorZPtr {
21121 * A pointer to the contents in the success state.
21122 * Reading from this pointer when `result_ok` is not set is undefined.
21124 struct LDKBlindedHop *result;
21126 * A pointer to the contents in the error state.
21127 * Reading from this pointer when `result_ok` is set is undefined.
21129 struct LDKDecodeError *err;
21130 } LDKCResult_BlindedHopDecodeErrorZPtr;
21133 * A CResult_BlindedHopDecodeErrorZ represents the result of a fallible operation,
21134 * containing a crate::lightning::blinded_path::BlindedHop on success and a crate::lightning::ln::msgs::DecodeError on failure.
21135 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
21137 typedef struct LDKCResult_BlindedHopDecodeErrorZ {
21139 * The contents of this CResult_BlindedHopDecodeErrorZ, accessible via either
21140 * `err` or `result` depending on the state of `result_ok`.
21142 union LDKCResult_BlindedHopDecodeErrorZPtr contents;
21144 * Whether this CResult_BlindedHopDecodeErrorZ represents a success state.
21147 } LDKCResult_BlindedHopDecodeErrorZ;
21150 * The contents of CResult_InvoiceErrorDecodeErrorZ
21152 typedef union LDKCResult_InvoiceErrorDecodeErrorZPtr {
21154 * A pointer to the contents in the success state.
21155 * Reading from this pointer when `result_ok` is not set is undefined.
21157 struct LDKInvoiceError *result;
21159 * A pointer to the contents in the error state.
21160 * Reading from this pointer when `result_ok` is set is undefined.
21162 struct LDKDecodeError *err;
21163 } LDKCResult_InvoiceErrorDecodeErrorZPtr;
21166 * A CResult_InvoiceErrorDecodeErrorZ represents the result of a fallible operation,
21167 * containing a crate::lightning::offers::invoice_error::InvoiceError on success and a crate::lightning::ln::msgs::DecodeError on failure.
21168 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
21170 typedef struct LDKCResult_InvoiceErrorDecodeErrorZ {
21172 * The contents of this CResult_InvoiceErrorDecodeErrorZ, accessible via either
21173 * `err` or `result` depending on the state of `result_ok`.
21175 union LDKCResult_InvoiceErrorDecodeErrorZPtr contents;
21177 * Whether this CResult_InvoiceErrorDecodeErrorZ represents a success state.
21180 } LDKCResult_InvoiceErrorDecodeErrorZ;
21185 * The state of a spendable output currently tracked by an [`OutputSweeper`].
21187 typedef struct MUST_USE_STRUCT LDKTrackedSpendableOutput {
21189 * A pointer to the opaque Rust object.
21190 * Nearly everywhere, inner must be non-null, however in places where
21191 * the Rust equivalent takes an Option, it may be set to null to indicate None.
21193 LDKnativeTrackedSpendableOutput *inner;
21195 * Indicates that this is the only struct which contains the same pointer.
21196 * Rust functions which take ownership of an object provided via an argument require
21197 * this to be true and invalidate the object pointed to by inner.
21200 } LDKTrackedSpendableOutput;
21203 * The contents of CResult_TrackedSpendableOutputDecodeErrorZ
21205 typedef union LDKCResult_TrackedSpendableOutputDecodeErrorZPtr {
21207 * A pointer to the contents in the success state.
21208 * Reading from this pointer when `result_ok` is not set is undefined.
21210 struct LDKTrackedSpendableOutput *result;
21212 * A pointer to the contents in the error state.
21213 * Reading from this pointer when `result_ok` is set is undefined.
21215 struct LDKDecodeError *err;
21216 } LDKCResult_TrackedSpendableOutputDecodeErrorZPtr;
21219 * A CResult_TrackedSpendableOutputDecodeErrorZ represents the result of a fallible operation,
21220 * containing a crate::lightning::util::sweep::TrackedSpendableOutput on success and a crate::lightning::ln::msgs::DecodeError on failure.
21221 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
21223 typedef struct LDKCResult_TrackedSpendableOutputDecodeErrorZ {
21225 * The contents of this CResult_TrackedSpendableOutputDecodeErrorZ, accessible via either
21226 * `err` or `result` depending on the state of `result_ok`.
21228 union LDKCResult_TrackedSpendableOutputDecodeErrorZPtr contents;
21230 * Whether this CResult_TrackedSpendableOutputDecodeErrorZ represents a success state.
21233 } LDKCResult_TrackedSpendableOutputDecodeErrorZ;
21236 * The current status of the output spend.
21238 typedef enum LDKOutputSpendStatus_Tag {
21240 * The output is tracked but an initial spending transaction hasn't been generated and
21243 LDKOutputSpendStatus_PendingInitialBroadcast,
21245 * A transaction spending the output has been broadcasted but is pending its first confirmation on-chain.
21247 LDKOutputSpendStatus_PendingFirstConfirmation,
21249 * A transaction spending the output has been confirmed on-chain but will be tracked until it
21250 * reaches [`ANTI_REORG_DELAY`] confirmations.
21252 LDKOutputSpendStatus_PendingThresholdConfirmations,
21254 * Must be last for serialization purposes
21256 LDKOutputSpendStatus_Sentinel,
21257 } LDKOutputSpendStatus_Tag;
21259 typedef struct LDKOutputSpendStatus_LDKPendingInitialBroadcast_Body {
21261 * The height at which we will first generate and broadcast a spending transaction.
21263 struct LDKCOption_u32Z delayed_until_height;
21264 } LDKOutputSpendStatus_LDKPendingInitialBroadcast_Body;
21266 typedef struct LDKOutputSpendStatus_LDKPendingFirstConfirmation_Body {
21268 * The hash of the chain tip when we first broadcast a transaction spending this output.
21270 struct LDKThirtyTwoBytes first_broadcast_hash;
21272 * The best height when we last broadcast a transaction spending this output.
21274 uint32_t latest_broadcast_height;
21276 * The transaction spending this output we last broadcasted.
21278 struct LDKTransaction latest_spending_tx;
21279 } LDKOutputSpendStatus_LDKPendingFirstConfirmation_Body;
21281 typedef struct LDKOutputSpendStatus_LDKPendingThresholdConfirmations_Body {
21283 * The hash of the chain tip when we first broadcast a transaction spending this output.
21285 struct LDKThirtyTwoBytes first_broadcast_hash;
21287 * The best height when we last broadcast a transaction spending this output.
21289 uint32_t latest_broadcast_height;
21291 * The transaction spending this output we saw confirmed on-chain.
21293 struct LDKTransaction latest_spending_tx;
21295 * The height at which the spending transaction was confirmed.
21297 uint32_t confirmation_height;
21299 * The hash of the block in which the spending transaction was confirmed.
21301 struct LDKThirtyTwoBytes confirmation_hash;
21302 } LDKOutputSpendStatus_LDKPendingThresholdConfirmations_Body;
21304 typedef struct MUST_USE_STRUCT LDKOutputSpendStatus {
21305 LDKOutputSpendStatus_Tag tag;
21307 LDKOutputSpendStatus_LDKPendingInitialBroadcast_Body pending_initial_broadcast;
21308 LDKOutputSpendStatus_LDKPendingFirstConfirmation_Body pending_first_confirmation;
21309 LDKOutputSpendStatus_LDKPendingThresholdConfirmations_Body pending_threshold_confirmations;
21311 } LDKOutputSpendStatus;
21314 * The contents of CResult_OutputSpendStatusDecodeErrorZ
21316 typedef union LDKCResult_OutputSpendStatusDecodeErrorZPtr {
21318 * A pointer to the contents in the success state.
21319 * Reading from this pointer when `result_ok` is not set is undefined.
21321 struct LDKOutputSpendStatus *result;
21323 * A pointer to the contents in the error state.
21324 * Reading from this pointer when `result_ok` is set is undefined.
21326 struct LDKDecodeError *err;
21327 } LDKCResult_OutputSpendStatusDecodeErrorZPtr;
21330 * A CResult_OutputSpendStatusDecodeErrorZ represents the result of a fallible operation,
21331 * containing a crate::lightning::util::sweep::OutputSpendStatus on success and a crate::lightning::ln::msgs::DecodeError on failure.
21332 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
21334 typedef struct LDKCResult_OutputSpendStatusDecodeErrorZ {
21336 * The contents of this CResult_OutputSpendStatusDecodeErrorZ, accessible via either
21337 * `err` or `result` depending on the state of `result_ok`.
21339 union LDKCResult_OutputSpendStatusDecodeErrorZPtr contents;
21341 * Whether this CResult_OutputSpendStatusDecodeErrorZ represents a success state.
21344 } LDKCResult_OutputSpendStatusDecodeErrorZ;
21349 * A transaction output watched by a [`ChannelMonitor`] for spends on-chain.
21351 * Used to convey to a [`Filter`] such an output with a given spending condition. Any transaction
21352 * spending the output must be given to [`ChannelMonitor::block_connected`] either directly or via
21353 * [`Confirm::transactions_confirmed`].
21355 * If `block_hash` is `Some`, this indicates the output was created in the corresponding block and
21356 * may have been spent there. See [`Filter::register_output`] for details.
21358 * [`ChannelMonitor`]: channelmonitor::ChannelMonitor
21359 * [`ChannelMonitor::block_connected`]: channelmonitor::ChannelMonitor::block_connected
21361 typedef struct MUST_USE_STRUCT LDKWatchedOutput {
21363 * A pointer to the opaque Rust object.
21364 * Nearly everywhere, inner must be non-null, however in places where
21365 * the Rust equivalent takes an Option, it may be set to null to indicate None.
21367 LDKnativeWatchedOutput *inner;
21369 * Indicates that this is the only struct which contains the same pointer.
21370 * Rust functions which take ownership of an object provided via an argument require
21371 * this to be true and invalidate the object pointed to by inner.
21374 } LDKWatchedOutput;
21377 * The `Filter` trait defines behavior for indicating chain activity of interest pertaining to
21380 * This is useful in order to have a [`Watch`] implementation convey to a chain source which
21381 * transactions to be notified of. Notification may take the form of pre-filtering blocks or, in
21382 * the case of [BIP 157]/[BIP 158], only fetching a block if the compact filter matches. If
21383 * receiving full blocks from a chain source, any further filtering is unnecessary.
21385 * After an output has been registered, subsequent block retrievals from the chain source must not
21386 * exclude any transactions matching the new criteria nor any in-block descendants of such
21389 * Note that use as part of a [`Watch`] implementation involves reentrancy. Therefore, the `Filter`
21390 * should not block on I/O. Implementations should instead queue the newly monitored data to be
21391 * processed later. Then, in order to block until the data has been processed, any [`Watch`]
21392 * invocation that has called the `Filter` must return [`InProgress`].
21394 * [`InProgress`]: ChannelMonitorUpdateStatus::InProgress
21395 * [BIP 157]: https://github.com/bitcoin/bips/blob/master/bip-0157.mediawiki
21396 * [BIP 158]: https://github.com/bitcoin/bips/blob/master/bip-0158.mediawiki
21398 typedef struct LDKFilter {
21400 * An opaque pointer which is passed to your function implementations as an argument.
21401 * This has no meaning in the LDK, and can be NULL or any other value.
21405 * Registers interest in a transaction with `txid` and having an output with `script_pubkey` as
21406 * a spending condition.
21408 void (*register_tx)(const void *this_arg, const uint8_t (*txid)[32], struct LDKu8slice script_pubkey);
21410 * Registers interest in spends of a transaction output.
21412 * Note that this method might be called during processing of a new block. You therefore need
21413 * to ensure that also dependent output spents within an already connected block are correctly
21414 * handled, e.g., by re-scanning the block in question whenever new outputs have been
21415 * registered mid-processing.
21417 void (*register_output)(const void *this_arg, struct LDKWatchedOutput output);
21419 * Frees any resources associated with this object given its this_arg pointer.
21420 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
21422 void (*free)(void *this_arg);
21426 * An enum which can either contain a crate::lightning::chain::Filter or not
21428 typedef enum LDKCOption_FilterZ_Tag {
21430 * When we're in this state, this COption_FilterZ contains a crate::lightning::chain::Filter
21432 LDKCOption_FilterZ_Some,
21434 * When we're in this state, this COption_FilterZ contains nothing
21436 LDKCOption_FilterZ_None,
21438 * Must be last for serialization purposes
21440 LDKCOption_FilterZ_Sentinel,
21441 } LDKCOption_FilterZ_Tag;
21443 typedef struct LDKCOption_FilterZ {
21444 LDKCOption_FilterZ_Tag tag;
21447 struct LDKFilter some;
21450 } LDKCOption_FilterZ;
21453 * A dynamically-allocated array of crate::lightning::util::sweep::TrackedSpendableOutputs of arbitrary size.
21454 * This corresponds to std::vector in C++
21456 typedef struct LDKCVec_TrackedSpendableOutputZ {
21458 * The elements in the array.
21459 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
21461 struct LDKTrackedSpendableOutput *data;
21463 * The number of elements pointed to by `data`.
21466 } LDKCVec_TrackedSpendableOutputZ;
21469 * A helper trait that describes an on-chain wallet capable of returning a (change) destination
21472 typedef struct LDKChangeDestinationSource {
21474 * An opaque pointer which is passed to your function implementations as an argument.
21475 * This has no meaning in the LDK, and can be NULL or any other value.
21479 * Returns a script pubkey which can be used as a change destination for
21480 * [`OutputSpender::spend_spendable_outputs`].
21482 * This method should return a different value each time it is called, to avoid linking
21483 * on-chain funds controlled to the same user.
21485 struct LDKCResult_CVec_u8ZNoneZ (*get_change_destination_script)(const void *this_arg);
21487 * Frees any resources associated with this object given its this_arg pointer.
21488 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
21490 void (*free)(void *this_arg);
21491 } LDKChangeDestinationSource;
21494 * Provides an interface that allows storage and retrieval of persisted values that are associated
21497 * In order to avoid collisions the key space is segmented based on the given `primary_namespace`s
21498 * and `secondary_namespace`s. Implementations of this trait are free to handle them in different
21499 * ways, as long as per-namespace key uniqueness is asserted.
21501 * Keys and namespaces are required to be valid ASCII strings in the range of
21502 * [`KVSTORE_NAMESPACE_KEY_ALPHABET`] and no longer than [`KVSTORE_NAMESPACE_KEY_MAX_LEN`]. Empty
21503 * primary namespaces and secondary namespaces (`\"\"`) are assumed to be a valid, however, if
21504 * `primary_namespace` is empty, `secondary_namespace` is required to be empty, too. This means
21505 * that concerns should always be separated by primary namespace first, before secondary
21506 * namespaces are used. While the number of primary namespaces will be relatively small and is
21507 * determined at compile time, there may be many secondary namespaces per primary namespace. Note
21508 * that per-namespace uniqueness needs to also hold for keys *and* namespaces in any given
21509 * namespace, i.e., conflicts between keys and equally named
21510 * primary namespaces/secondary namespaces must be avoided.
21512 * **Note:** Users migrating custom persistence backends from the pre-v0.0.117 `KVStorePersister`
21513 * interface can use a concatenation of `[{primary_namespace}/[{secondary_namespace}/]]{key}` to
21514 * recover a `key` compatible with the data model previously assumed by `KVStorePersister::persist`.
21516 typedef struct LDKKVStore {
21518 * An opaque pointer which is passed to your function implementations as an argument.
21519 * This has no meaning in the LDK, and can be NULL or any other value.
21523 * Returns the data stored for the given `primary_namespace`, `secondary_namespace`, and
21526 * Returns an [`ErrorKind::NotFound`] if the given `key` could not be found in the given
21527 * `primary_namespace` and `secondary_namespace`.
21529 * [`ErrorKind::NotFound`]: io::ErrorKind::NotFound
21531 struct LDKCResult_CVec_u8ZIOErrorZ (*read)(const void *this_arg, struct LDKStr primary_namespace, struct LDKStr secondary_namespace, struct LDKStr key);
21533 * Persists the given data under the given `key`.
21535 * Will create the given `primary_namespace` and `secondary_namespace` if not already present
21538 struct LDKCResult_NoneIOErrorZ (*write)(const void *this_arg, struct LDKStr primary_namespace, struct LDKStr secondary_namespace, struct LDKStr key, struct LDKu8slice buf);
21540 * Removes any data that had previously been persisted under the given `key`.
21542 * If the `lazy` flag is set to `true`, the backend implementation might choose to lazily
21543 * remove the given `key` at some point in time after the method returns, e.g., as part of an
21544 * eventual batch deletion of multiple keys. As a consequence, subsequent calls to
21545 * [`KVStore::list`] might include the removed key until the changes are actually persisted.
21547 * Note that while setting the `lazy` flag reduces the I/O burden of multiple subsequent
21548 * `remove` calls, it also influences the atomicity guarantees as lazy `remove`s could
21549 * potentially get lost on crash after the method returns. Therefore, this flag should only be
21550 * set for `remove` operations that can be safely replayed at a later time.
21552 * Returns successfully if no data will be stored for the given `primary_namespace`,
21553 * `secondary_namespace`, and `key`, independently of whether it was present before its
21554 * invokation or not.
21556 struct LDKCResult_NoneIOErrorZ (*remove)(const void *this_arg, struct LDKStr primary_namespace, struct LDKStr secondary_namespace, struct LDKStr key, bool lazy);
21558 * Returns a list of keys that are stored under the given `secondary_namespace` in
21559 * `primary_namespace`.
21561 * Returns the keys in arbitrary order, so users requiring a particular order need to sort the
21562 * returned keys. Returns an empty list if `primary_namespace` or `secondary_namespace` is unknown.
21564 struct LDKCResult_CVec_StrZIOErrorZ (*list)(const void *this_arg, struct LDKStr primary_namespace, struct LDKStr secondary_namespace);
21566 * Frees any resources associated with this object given its this_arg pointer.
21567 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
21569 void (*free)(void *this_arg);
21573 * A trait that describes a wallet capable of creating a spending [`Transaction`] from a set of
21574 * [`SpendableOutputDescriptor`]s.
21576 typedef struct LDKOutputSpender {
21578 * An opaque pointer which is passed to your function implementations as an argument.
21579 * This has no meaning in the LDK, and can be NULL or any other value.
21583 * Creates a [`Transaction`] which spends the given descriptors to the given outputs, plus an
21584 * output to the given change destination (if sufficient change value remains). The
21585 * transaction will have a feerate, at least, of the given value.
21587 * The `locktime` argument is used to set the transaction's locktime. If `None`, the
21588 * transaction will have a locktime of 0. It it recommended to set this to the current block
21589 * height to avoid fee sniping, unless you have some specific reason to use a different
21592 * Returns `Err(())` if the output value is greater than the input value minus required fee,
21593 * if a descriptor was duplicated, or if an output descriptor `script_pubkey`
21594 * does not match the one we can spend.
21596 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);
21598 * Frees any resources associated with this object given its this_arg pointer.
21599 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
21601 void (*free)(void *this_arg);
21602 } LDKOutputSpender;
21607 * A utility that keeps track of [`SpendableOutputDescriptor`]s, persists them in a given
21608 * [`KVStore`] and regularly retries sweeping them based on a callback given to the constructor
21611 * Users should call [`Self::track_spendable_outputs`] for any [`SpendableOutputDescriptor`]s received via [`Event::SpendableOutputs`].
21613 * This needs to be notified of chain state changes either via its [`Listen`] or [`Confirm`]
21614 * implementation and hence has to be connected with the utilized chain data sources.
21616 * If chain data is provided via the [`Confirm`] interface or via filtered blocks, users are
21617 * required to give their chain data sources (i.e., [`Filter`] implementation) to the respective
21620 * [`Event::SpendableOutputs`]: crate::events::Event::SpendableOutputs
21622 typedef struct MUST_USE_STRUCT LDKOutputSweeper {
21624 * A pointer to the opaque Rust object.
21625 * Nearly everywhere, inner must be non-null, however in places where
21626 * the Rust equivalent takes an Option, it may be set to null to indicate None.
21628 LDKnativeOutputSweeper *inner;
21630 * Indicates that this is the only struct which contains the same pointer.
21631 * Rust functions which take ownership of an object provided via an argument require
21632 * this to be true and invalidate the object pointed to by inner.
21635 } LDKOutputSweeper;
21638 * The contents of CResult_OutputSweeperDecodeErrorZ
21640 typedef union LDKCResult_OutputSweeperDecodeErrorZPtr {
21642 * A pointer to the contents in the success state.
21643 * Reading from this pointer when `result_ok` is not set is undefined.
21645 struct LDKOutputSweeper *result;
21647 * A pointer to the contents in the error state.
21648 * Reading from this pointer when `result_ok` is set is undefined.
21650 struct LDKDecodeError *err;
21651 } LDKCResult_OutputSweeperDecodeErrorZPtr;
21654 * A CResult_OutputSweeperDecodeErrorZ represents the result of a fallible operation,
21655 * containing a crate::lightning::util::sweep::OutputSweeper on success and a crate::lightning::ln::msgs::DecodeError on failure.
21656 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
21658 typedef struct LDKCResult_OutputSweeperDecodeErrorZ {
21660 * The contents of this CResult_OutputSweeperDecodeErrorZ, accessible via either
21661 * `err` or `result` depending on the state of `result_ok`.
21663 union LDKCResult_OutputSweeperDecodeErrorZPtr contents;
21665 * Whether this CResult_OutputSweeperDecodeErrorZ represents a success state.
21668 } LDKCResult_OutputSweeperDecodeErrorZ;
21671 * A tuple of 2 elements. See the individual fields for the types contained.
21673 typedef struct LDKC2Tuple_BestBlockOutputSweeperZ {
21675 * The element at position 0
21677 struct LDKBestBlock a;
21679 * The element at position 1
21681 struct LDKOutputSweeper b;
21682 } LDKC2Tuple_BestBlockOutputSweeperZ;
21685 * The contents of CResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ
21687 typedef union LDKCResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZPtr {
21689 * A pointer to the contents in the success state.
21690 * Reading from this pointer when `result_ok` is not set is undefined.
21692 struct LDKC2Tuple_BestBlockOutputSweeperZ *result;
21694 * A pointer to the contents in the error state.
21695 * Reading from this pointer when `result_ok` is set is undefined.
21697 struct LDKDecodeError *err;
21698 } LDKCResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZPtr;
21701 * A CResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ represents the result of a fallible operation,
21702 * containing a crate::c_types::derived::C2Tuple_BestBlockOutputSweeperZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
21703 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
21705 typedef struct LDKCResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ {
21707 * The contents of this CResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ, accessible via either
21708 * `err` or `result` depending on the state of `result_ok`.
21710 union LDKCResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZPtr contents;
21712 * Whether this CResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ represents a success state.
21715 } LDKCResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ;
21720 * Base key used in conjunction with a `per_commitment_point` to generate a [`DelayedPaymentKey`].
21722 * The delayed payment key is used to pay the commitment state broadcaster their
21723 * non-HTLC-encumbered funds after a delay to give their counterparty a chance to punish if the
21724 * state broadcasted was previously revoked.
21726 typedef struct MUST_USE_STRUCT LDKDelayedPaymentBasepoint {
21728 * A pointer to the opaque Rust object.
21729 * Nearly everywhere, inner must be non-null, however in places where
21730 * the Rust equivalent takes an Option, it may be set to null to indicate None.
21732 LDKnativeDelayedPaymentBasepoint *inner;
21734 * Indicates that this is the only struct which contains the same pointer.
21735 * Rust functions which take ownership of an object provided via an argument require
21736 * this to be true and invalidate the object pointed to by inner.
21739 } LDKDelayedPaymentBasepoint;
21742 * The contents of CResult_DelayedPaymentBasepointDecodeErrorZ
21744 typedef union LDKCResult_DelayedPaymentBasepointDecodeErrorZPtr {
21746 * A pointer to the contents in the success state.
21747 * Reading from this pointer when `result_ok` is not set is undefined.
21749 struct LDKDelayedPaymentBasepoint *result;
21751 * A pointer to the contents in the error state.
21752 * Reading from this pointer when `result_ok` is set is undefined.
21754 struct LDKDecodeError *err;
21755 } LDKCResult_DelayedPaymentBasepointDecodeErrorZPtr;
21758 * A CResult_DelayedPaymentBasepointDecodeErrorZ represents the result of a fallible operation,
21759 * containing a crate::lightning::ln::channel_keys::DelayedPaymentBasepoint on success and a crate::lightning::ln::msgs::DecodeError on failure.
21760 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
21762 typedef struct LDKCResult_DelayedPaymentBasepointDecodeErrorZ {
21764 * The contents of this CResult_DelayedPaymentBasepointDecodeErrorZ, accessible via either
21765 * `err` or `result` depending on the state of `result_ok`.
21767 union LDKCResult_DelayedPaymentBasepointDecodeErrorZPtr contents;
21769 * Whether this CResult_DelayedPaymentBasepointDecodeErrorZ represents a success state.
21772 } LDKCResult_DelayedPaymentBasepointDecodeErrorZ;
21777 * A derived key built from a [`DelayedPaymentBasepoint`] and `per_commitment_point`.
21779 * The delayed payment key is used to pay the commitment state broadcaster their
21780 * non-HTLC-encumbered funds after a delay. This delay gives their counterparty a chance to
21781 * punish and claim all the channel funds if the state broadcasted was previously revoked.
21783 * [See the BOLT specs]
21784 * (https://github.com/lightning/bolts/blob/master/03-transactions.md#localpubkey-local_htlcpubkey-remote_htlcpubkey-local_delayedpubkey-and-remote_delayedpubkey-derivation)
21785 * for more information on key derivation details.
21787 typedef struct MUST_USE_STRUCT LDKDelayedPaymentKey {
21789 * A pointer to the opaque Rust object.
21790 * Nearly everywhere, inner must be non-null, however in places where
21791 * the Rust equivalent takes an Option, it may be set to null to indicate None.
21793 LDKnativeDelayedPaymentKey *inner;
21795 * Indicates that this is the only struct which contains the same pointer.
21796 * Rust functions which take ownership of an object provided via an argument require
21797 * this to be true and invalidate the object pointed to by inner.
21800 } LDKDelayedPaymentKey;
21803 * The contents of CResult_DelayedPaymentKeyDecodeErrorZ
21805 typedef union LDKCResult_DelayedPaymentKeyDecodeErrorZPtr {
21807 * A pointer to the contents in the success state.
21808 * Reading from this pointer when `result_ok` is not set is undefined.
21810 struct LDKDelayedPaymentKey *result;
21812 * A pointer to the contents in the error state.
21813 * Reading from this pointer when `result_ok` is set is undefined.
21815 struct LDKDecodeError *err;
21816 } LDKCResult_DelayedPaymentKeyDecodeErrorZPtr;
21819 * A CResult_DelayedPaymentKeyDecodeErrorZ represents the result of a fallible operation,
21820 * containing a crate::lightning::ln::channel_keys::DelayedPaymentKey on success and a crate::lightning::ln::msgs::DecodeError on failure.
21821 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
21823 typedef struct LDKCResult_DelayedPaymentKeyDecodeErrorZ {
21825 * The contents of this CResult_DelayedPaymentKeyDecodeErrorZ, accessible via either
21826 * `err` or `result` depending on the state of `result_ok`.
21828 union LDKCResult_DelayedPaymentKeyDecodeErrorZPtr contents;
21830 * Whether this CResult_DelayedPaymentKeyDecodeErrorZ represents a success state.
21833 } LDKCResult_DelayedPaymentKeyDecodeErrorZ;
21838 * Base key used in conjunction with a `per_commitment_point` to generate an [`HtlcKey`].
21840 * HTLC keys are used to ensure only the recipient of an HTLC can claim it on-chain with the HTLC
21841 * preimage and that only the sender of an HTLC can claim it on-chain after it has timed out.
21842 * Thus, both channel counterparties' HTLC keys will appears in each HTLC output's script.
21844 typedef struct MUST_USE_STRUCT LDKHtlcBasepoint {
21846 * A pointer to the opaque Rust object.
21847 * Nearly everywhere, inner must be non-null, however in places where
21848 * the Rust equivalent takes an Option, it may be set to null to indicate None.
21850 LDKnativeHtlcBasepoint *inner;
21852 * Indicates that this is the only struct which contains the same pointer.
21853 * Rust functions which take ownership of an object provided via an argument require
21854 * this to be true and invalidate the object pointed to by inner.
21857 } LDKHtlcBasepoint;
21860 * The contents of CResult_HtlcBasepointDecodeErrorZ
21862 typedef union LDKCResult_HtlcBasepointDecodeErrorZPtr {
21864 * A pointer to the contents in the success state.
21865 * Reading from this pointer when `result_ok` is not set is undefined.
21867 struct LDKHtlcBasepoint *result;
21869 * A pointer to the contents in the error state.
21870 * Reading from this pointer when `result_ok` is set is undefined.
21872 struct LDKDecodeError *err;
21873 } LDKCResult_HtlcBasepointDecodeErrorZPtr;
21876 * A CResult_HtlcBasepointDecodeErrorZ represents the result of a fallible operation,
21877 * containing a crate::lightning::ln::channel_keys::HtlcBasepoint on success and a crate::lightning::ln::msgs::DecodeError on failure.
21878 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
21880 typedef struct LDKCResult_HtlcBasepointDecodeErrorZ {
21882 * The contents of this CResult_HtlcBasepointDecodeErrorZ, accessible via either
21883 * `err` or `result` depending on the state of `result_ok`.
21885 union LDKCResult_HtlcBasepointDecodeErrorZPtr contents;
21887 * Whether this CResult_HtlcBasepointDecodeErrorZ represents a success state.
21890 } LDKCResult_HtlcBasepointDecodeErrorZ;
21895 * A derived key built from a [`HtlcBasepoint`] and `per_commitment_point`.
21897 * HTLC keys are used to ensure only the recipient of an HTLC can claim it on-chain with the HTLC
21898 * preimage and that only the sender of an HTLC can claim it on-chain after it has timed out.
21899 * Thus, both channel counterparties' HTLC keys will appears in each HTLC output's script.
21901 * [See the BOLT specs]
21902 * (https://github.com/lightning/bolts/blob/master/03-transactions.md#localpubkey-local_htlcpubkey-remote_htlcpubkey-local_delayedpubkey-and-remote_delayedpubkey-derivation)
21903 * for more information on key derivation details.
21905 typedef struct MUST_USE_STRUCT LDKHtlcKey {
21907 * A pointer to the opaque Rust object.
21908 * Nearly everywhere, inner must be non-null, however in places where
21909 * the Rust equivalent takes an Option, it may be set to null to indicate None.
21911 LDKnativeHtlcKey *inner;
21913 * Indicates that this is the only struct which contains the same pointer.
21914 * Rust functions which take ownership of an object provided via an argument require
21915 * this to be true and invalidate the object pointed to by inner.
21921 * The contents of CResult_HtlcKeyDecodeErrorZ
21923 typedef union LDKCResult_HtlcKeyDecodeErrorZPtr {
21925 * A pointer to the contents in the success state.
21926 * Reading from this pointer when `result_ok` is not set is undefined.
21928 struct LDKHtlcKey *result;
21930 * A pointer to the contents in the error state.
21931 * Reading from this pointer when `result_ok` is set is undefined.
21933 struct LDKDecodeError *err;
21934 } LDKCResult_HtlcKeyDecodeErrorZPtr;
21937 * A CResult_HtlcKeyDecodeErrorZ represents the result of a fallible operation,
21938 * containing a crate::lightning::ln::channel_keys::HtlcKey on success and a crate::lightning::ln::msgs::DecodeError on failure.
21939 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
21941 typedef struct LDKCResult_HtlcKeyDecodeErrorZ {
21943 * The contents of this CResult_HtlcKeyDecodeErrorZ, accessible via either
21944 * `err` or `result` depending on the state of `result_ok`.
21946 union LDKCResult_HtlcKeyDecodeErrorZPtr contents;
21948 * Whether this CResult_HtlcKeyDecodeErrorZ represents a success state.
21951 } LDKCResult_HtlcKeyDecodeErrorZ;
21956 * 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.
21957 * A watcher can be given a [RevocationBasepoint] to generate per commitment [RevocationKey] to create justice transactions.
21959 typedef struct MUST_USE_STRUCT LDKRevocationBasepoint {
21961 * A pointer to the opaque Rust object.
21962 * Nearly everywhere, inner must be non-null, however in places where
21963 * the Rust equivalent takes an Option, it may be set to null to indicate None.
21965 LDKnativeRevocationBasepoint *inner;
21967 * Indicates that this is the only struct which contains the same pointer.
21968 * Rust functions which take ownership of an object provided via an argument require
21969 * this to be true and invalidate the object pointed to by inner.
21972 } LDKRevocationBasepoint;
21975 * The contents of CResult_RevocationBasepointDecodeErrorZ
21977 typedef union LDKCResult_RevocationBasepointDecodeErrorZPtr {
21979 * A pointer to the contents in the success state.
21980 * Reading from this pointer when `result_ok` is not set is undefined.
21982 struct LDKRevocationBasepoint *result;
21984 * A pointer to the contents in the error state.
21985 * Reading from this pointer when `result_ok` is set is undefined.
21987 struct LDKDecodeError *err;
21988 } LDKCResult_RevocationBasepointDecodeErrorZPtr;
21991 * A CResult_RevocationBasepointDecodeErrorZ represents the result of a fallible operation,
21992 * containing a crate::lightning::ln::channel_keys::RevocationBasepoint on success and a crate::lightning::ln::msgs::DecodeError on failure.
21993 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
21995 typedef struct LDKCResult_RevocationBasepointDecodeErrorZ {
21997 * The contents of this CResult_RevocationBasepointDecodeErrorZ, accessible via either
21998 * `err` or `result` depending on the state of `result_ok`.
22000 union LDKCResult_RevocationBasepointDecodeErrorZPtr contents;
22002 * Whether this CResult_RevocationBasepointDecodeErrorZ represents a success state.
22005 } LDKCResult_RevocationBasepointDecodeErrorZ;
22010 * The revocation key is used to allow a channel party to revoke their state - giving their
22011 * counterparty the required material to claim all of their funds if they broadcast that state.
22013 * Each commitment transaction has a revocation key based on the basepoint and
22014 * per_commitment_point which is used in both commitment and HTLC transactions.
22016 * See [the BOLT spec for derivation details]
22017 * (https://github.com/lightning/bolts/blob/master/03-transactions.md#revocationpubkey-derivation)
22019 typedef struct MUST_USE_STRUCT LDKRevocationKey {
22021 * A pointer to the opaque Rust object.
22022 * Nearly everywhere, inner must be non-null, however in places where
22023 * the Rust equivalent takes an Option, it may be set to null to indicate None.
22025 LDKnativeRevocationKey *inner;
22027 * Indicates that this is the only struct which contains the same pointer.
22028 * Rust functions which take ownership of an object provided via an argument require
22029 * this to be true and invalidate the object pointed to by inner.
22032 } LDKRevocationKey;
22035 * The contents of CResult_RevocationKeyDecodeErrorZ
22037 typedef union LDKCResult_RevocationKeyDecodeErrorZPtr {
22039 * A pointer to the contents in the success state.
22040 * Reading from this pointer when `result_ok` is not set is undefined.
22042 struct LDKRevocationKey *result;
22044 * A pointer to the contents in the error state.
22045 * Reading from this pointer when `result_ok` is set is undefined.
22047 struct LDKDecodeError *err;
22048 } LDKCResult_RevocationKeyDecodeErrorZPtr;
22051 * A CResult_RevocationKeyDecodeErrorZ represents the result of a fallible operation,
22052 * containing a crate::lightning::ln::channel_keys::RevocationKey on success and a crate::lightning::ln::msgs::DecodeError on failure.
22053 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
22055 typedef struct LDKCResult_RevocationKeyDecodeErrorZ {
22057 * The contents of this CResult_RevocationKeyDecodeErrorZ, accessible via either
22058 * `err` or `result` depending on the state of `result_ok`.
22060 union LDKCResult_RevocationKeyDecodeErrorZPtr contents;
22062 * Whether this CResult_RevocationKeyDecodeErrorZ represents a success state.
22065 } LDKCResult_RevocationKeyDecodeErrorZ;
22070 * A read-only reference to a current ChannelMonitor.
22072 * Note that this holds a mutex in [`ChainMonitor`] and may block other events until it is
22075 typedef struct MUST_USE_STRUCT LDKLockedChannelMonitor {
22077 * A pointer to the opaque Rust object.
22078 * Nearly everywhere, inner must be non-null, however in places where
22079 * the Rust equivalent takes an Option, it may be set to null to indicate None.
22081 LDKnativeLockedChannelMonitor *inner;
22083 * Indicates that this is the only struct which contains the same pointer.
22084 * Rust functions which take ownership of an object provided via an argument require
22085 * this to be true and invalidate the object pointed to by inner.
22088 } LDKLockedChannelMonitor;
22091 * The contents of CResult_LockedChannelMonitorNoneZ
22093 typedef union LDKCResult_LockedChannelMonitorNoneZPtr {
22095 * A pointer to the contents in the success state.
22096 * Reading from this pointer when `result_ok` is not set is undefined.
22098 struct LDKLockedChannelMonitor *result;
22100 * Note that this value is always NULL, as there are no contents in the Err variant
22103 } LDKCResult_LockedChannelMonitorNoneZPtr;
22106 * A CResult_LockedChannelMonitorNoneZ represents the result of a fallible operation,
22107 * containing a crate::lightning::chain::chainmonitor::LockedChannelMonitor on success and a () on failure.
22108 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
22110 typedef struct LDKCResult_LockedChannelMonitorNoneZ {
22112 * The contents of this CResult_LockedChannelMonitorNoneZ, accessible via either
22113 * `err` or `result` depending on the state of `result_ok`.
22115 union LDKCResult_LockedChannelMonitorNoneZPtr contents;
22117 * Whether this CResult_LockedChannelMonitorNoneZ represents a success state.
22120 } LDKCResult_LockedChannelMonitorNoneZ;
22123 * A tuple of 2 elements. See the individual fields for the types contained.
22125 typedef struct LDKC2Tuple_OutPointChannelIdZ {
22127 * The element at position 0
22129 struct LDKOutPoint a;
22131 * The element at position 1
22133 struct LDKChannelId b;
22134 } LDKC2Tuple_OutPointChannelIdZ;
22137 * A dynamically-allocated array of crate::c_types::derived::C2Tuple_OutPointChannelIdZs of arbitrary size.
22138 * This corresponds to std::vector in C++
22140 typedef struct LDKCVec_C2Tuple_OutPointChannelIdZZ {
22142 * The elements in the array.
22143 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
22145 struct LDKC2Tuple_OutPointChannelIdZ *data;
22147 * The number of elements pointed to by `data`.
22150 } LDKCVec_C2Tuple_OutPointChannelIdZZ;
22155 * An opaque identifier describing a specific [`Persist`] method call.
22157 typedef struct MUST_USE_STRUCT LDKMonitorUpdateId {
22159 * A pointer to the opaque Rust object.
22160 * Nearly everywhere, inner must be non-null, however in places where
22161 * the Rust equivalent takes an Option, it may be set to null to indicate None.
22163 LDKnativeMonitorUpdateId *inner;
22165 * Indicates that this is the only struct which contains the same pointer.
22166 * Rust functions which take ownership of an object provided via an argument require
22167 * this to be true and invalidate the object pointed to by inner.
22170 } LDKMonitorUpdateId;
22173 * A dynamically-allocated array of crate::lightning::chain::chainmonitor::MonitorUpdateIds of arbitrary size.
22174 * This corresponds to std::vector in C++
22176 typedef struct LDKCVec_MonitorUpdateIdZ {
22178 * The elements in the array.
22179 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
22181 struct LDKMonitorUpdateId *data;
22183 * The number of elements pointed to by `data`.
22186 } LDKCVec_MonitorUpdateIdZ;
22189 * A tuple of 2 elements. See the individual fields for the types contained.
22191 typedef struct LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ {
22193 * The element at position 0
22195 struct LDKOutPoint a;
22197 * The element at position 1
22199 struct LDKCVec_MonitorUpdateIdZ b;
22200 } LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ;
22203 * A dynamically-allocated array of crate::c_types::derived::C2Tuple_OutPointCVec_MonitorUpdateIdZZs of arbitrary size.
22204 * This corresponds to std::vector in C++
22206 typedef struct LDKCVec_C2Tuple_OutPointCVec_MonitorUpdateIdZZZ {
22208 * The elements in the array.
22209 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
22211 struct LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ *data;
22213 * The number of elements pointed to by `data`.
22216 } LDKCVec_C2Tuple_OutPointCVec_MonitorUpdateIdZZZ;
22219 * Trait that handles persisting a [`ChannelManager`], [`NetworkGraph`], and [`WriteableScore`] to disk.
22221 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
22223 typedef struct LDKPersister {
22225 * An opaque pointer which is passed to your function implementations as an argument.
22226 * This has no meaning in the LDK, and can be NULL or any other value.
22230 * Persist the given ['ChannelManager'] to disk, returning an error if persistence failed.
22232 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
22234 struct LDKCResult_NoneIOErrorZ (*persist_manager)(const void *this_arg, const struct LDKChannelManager *NONNULL_PTR channel_manager);
22236 * Persist the given [`NetworkGraph`] to disk, returning an error if persistence failed.
22238 struct LDKCResult_NoneIOErrorZ (*persist_graph)(const void *this_arg, const struct LDKNetworkGraph *NONNULL_PTR network_graph);
22240 * Persist the given [`WriteableScore`] to disk, returning an error if persistence failed.
22242 struct LDKCResult_NoneIOErrorZ (*persist_scorer)(const void *this_arg, const struct LDKWriteableScore *NONNULL_PTR scorer);
22244 * Frees any resources associated with this object given its this_arg pointer.
22245 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
22247 void (*free)(void *this_arg);
22253 * Implements [`Persist`] in a way that writes and reads both [`ChannelMonitor`]s and
22254 * [`ChannelMonitorUpdate`]s.
22258 * The main benefit this provides over the [`KVStore`]'s [`Persist`] implementation is decreased
22259 * I/O bandwidth and storage churn, at the expense of more IOPS (including listing, reading, and
22260 * deleting) and complexity. This is because it writes channel monitor differential updates,
22261 * whereas the other (default) implementation rewrites the entire monitor on each update. For
22262 * routing nodes, updates can happen many times per second to a channel, and monitors can be tens
22263 * of megabytes (or more). Updates can be as small as a few hundred bytes.
22265 * Note that monitors written with `MonitorUpdatingPersister` are _not_ backward-compatible with
22266 * the default [`KVStore`]'s [`Persist`] implementation. They have a prepended byte sequence,
22267 * [`MONITOR_UPDATING_PERSISTER_PREPEND_SENTINEL`], applied to prevent deserialization with other
22268 * persisters. This is because monitors written by this struct _may_ have unapplied updates. In
22269 * order to downgrade, you must ensure that all updates are applied to the monitor, and remove the
22272 * # Storing monitors
22274 * Monitors are stored by implementing the [`Persist`] trait, which has two functions:
22276 * - [`Persist::persist_new_channel`], which persists whole [`ChannelMonitor`]s.
22277 * - [`Persist::update_persisted_channel`], which persists only a [`ChannelMonitorUpdate`]
22279 * Whole [`ChannelMonitor`]s are stored in the [`CHANNEL_MONITOR_PERSISTENCE_PRIMARY_NAMESPACE`],
22280 * using the familiar encoding of an [`OutPoint`] (for example, `[SOME-64-CHAR-HEX-STRING]_1`).
22282 * Each [`ChannelMonitorUpdate`] is stored in a dynamic secondary namespace, as follows:
22284 * - primary namespace: [`CHANNEL_MONITOR_UPDATE_PERSISTENCE_PRIMARY_NAMESPACE`]
22285 * - secondary namespace: [the monitor's encoded outpoint name]
22287 * Under that secondary namespace, each update is stored with a number string, like `21`, which
22288 * represents its `update_id` value.
22290 * For example, consider this channel, named for its transaction ID and index, or [`OutPoint`]:
22292 * - Transaction ID: `deadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeef`
22295 * Full channel monitors would be stored at a single key:
22297 * `[CHANNEL_MONITOR_PERSISTENCE_PRIMARY_NAMESPACE]/deadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeef_1`
22299 * Updates would be stored as follows (with `/` delimiting primary_namespace/secondary_namespace/key):
22302 * [CHANNEL_MONITOR_UPDATE_PERSISTENCE_PRIMARY_NAMESPACE]/deadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeef_1/1
22303 * [CHANNEL_MONITOR_UPDATE_PERSISTENCE_PRIMARY_NAMESPACE]/deadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeef_1/2
22304 * [CHANNEL_MONITOR_UPDATE_PERSISTENCE_PRIMARY_NAMESPACE]/deadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeef_1/3
22308 * # Reading channel state from storage
22310 * Channel state can be reconstructed by calling
22311 * [`MonitorUpdatingPersister::read_all_channel_monitors_with_updates`]. Alternatively, users can
22312 * list channel monitors themselves and load channels individually using
22313 * [`MonitorUpdatingPersister::read_channel_monitor_with_updates`].
22315 * ## EXTREMELY IMPORTANT
22317 * It is extremely important that your [`KVStore::read`] implementation uses the
22318 * [`io::ErrorKind::NotFound`] variant correctly: that is, when a file is not found, and _only_ in
22319 * that circumstance (not when there is really a permissions error, for example). This is because
22320 * neither channel monitor reading function lists updates. Instead, either reads the monitor, and
22321 * using its stored `update_id`, synthesizes update storage keys, and tries them in sequence until
22322 * one is not found. All _other_ errors will be bubbled up in the function's [`Result`].
22324 * # Pruning stale channel updates
22326 * Stale updates are pruned when the consolidation threshold is reached according to `maximum_pending_updates`.
22327 * Monitor updates in the range between the latest `update_id` and `update_id - maximum_pending_updates`
22329 * The `lazy` flag is used on the [`KVStore::remove`] method, so there are no guarantees that the deletions
22330 * will complete. However, stale updates are not a problem for data integrity, since updates are
22331 * only read that are higher than the stored [`ChannelMonitor`]'s `update_id`.
22333 * If you have many stale updates stored (such as after a crash with pending lazy deletes), and
22334 * would like to get rid of them, consider using the
22335 * [`MonitorUpdatingPersister::cleanup_stale_updates`] function.
22337 typedef struct MUST_USE_STRUCT LDKMonitorUpdatingPersister {
22339 * A pointer to the opaque Rust object.
22340 * Nearly everywhere, inner must be non-null, however in places where
22341 * the Rust equivalent takes an Option, it may be set to null to indicate None.
22343 LDKnativeMonitorUpdatingPersister *inner;
22345 * Indicates that this is the only struct which contains the same pointer.
22346 * Rust functions which take ownership of an object provided via an argument require
22347 * this to be true and invalidate the object pointed to by inner.
22350 } LDKMonitorUpdatingPersister;
22353 * `Persist` defines behavior for persisting channel monitors: this could mean
22354 * writing once to disk, and/or uploading to one or more backup services.
22356 * Persistence can happen in one of two ways - synchronously completing before the trait method
22357 * calls return or asynchronously in the background.
22359 * # For those implementing synchronous persistence
22361 * * If persistence completes fully (including any relevant `fsync()` calls), the implementation
22362 * should return [`ChannelMonitorUpdateStatus::Completed`], indicating normal channel operation
22365 * * If persistence fails for some reason, implementations should consider returning
22366 * [`ChannelMonitorUpdateStatus::InProgress`] and retry all pending persistence operations in
22367 * the background with [`ChainMonitor::list_pending_monitor_updates`] and
22368 * [`ChainMonitor::get_monitor`].
22370 * Once a full [`ChannelMonitor`] has been persisted, all pending updates for that channel can
22371 * be marked as complete via [`ChainMonitor::channel_monitor_updated`].
22373 * If at some point no further progress can be made towards persisting the pending updates, the
22374 * node should simply shut down.
22376 * * If the persistence has failed and cannot be retried further (e.g. because of an outage),
22377 * [`ChannelMonitorUpdateStatus::UnrecoverableError`] can be used, though this will result in
22378 * an immediate panic and future operations in LDK generally failing.
22380 * # For those implementing asynchronous persistence
22382 * All calls should generally spawn a background task and immediately return
22383 * [`ChannelMonitorUpdateStatus::InProgress`]. Once the update completes,
22384 * [`ChainMonitor::channel_monitor_updated`] should be called with the corresponding
22385 * [`MonitorUpdateId`].
22387 * Note that unlike the direct [`chain::Watch`] interface,
22388 * [`ChainMonitor::channel_monitor_updated`] must be called once for *each* update which occurs.
22390 * If at some point no further progress can be made towards persisting a pending update, the node
22391 * should simply shut down. Until then, the background task should either loop indefinitely, or
22392 * persistence should be regularly retried with [`ChainMonitor::list_pending_monitor_updates`]
22393 * and [`ChainMonitor::get_monitor`] (note that if a full monitor is persisted all pending
22394 * monitor updates may be marked completed).
22396 * # Using remote watchtowers
22398 * Watchtowers may be updated as a part of an implementation of this trait, utilizing the async
22399 * update process described above while the watchtower is being updated. The following methods are
22400 * provided for bulding transactions for a watchtower:
22401 * [`ChannelMonitor::initial_counterparty_commitment_tx`],
22402 * [`ChannelMonitor::counterparty_commitment_txs_from_update`],
22403 * [`ChannelMonitor::sign_to_local_justice_tx`], [`TrustedCommitmentTransaction::revokeable_output_index`],
22404 * [`TrustedCommitmentTransaction::build_to_local_justice_tx`].
22406 * [`TrustedCommitmentTransaction::revokeable_output_index`]: crate::ln::chan_utils::TrustedCommitmentTransaction::revokeable_output_index
22407 * [`TrustedCommitmentTransaction::build_to_local_justice_tx`]: crate::ln::chan_utils::TrustedCommitmentTransaction::build_to_local_justice_tx
22409 typedef struct LDKPersist {
22411 * An opaque pointer which is passed to your function implementations as an argument.
22412 * This has no meaning in the LDK, and can be NULL or any other value.
22416 * Persist a new channel's data in response to a [`chain::Watch::watch_channel`] call. This is
22417 * called by [`ChannelManager`] for new channels, or may be called directly, e.g. on startup.
22419 * The data can be stored any way you want, but the identifier provided by LDK is the
22420 * channel's outpoint (and it is up to you to maintain a correct mapping between the outpoint
22421 * and the stored channel data). Note that you **must** persist every new monitor to disk.
22423 * The `update_id` is used to identify this call to [`ChainMonitor::channel_monitor_updated`],
22424 * if you return [`ChannelMonitorUpdateStatus::InProgress`].
22426 * See [`Writeable::write`] on [`ChannelMonitor`] for writing out a `ChannelMonitor`
22427 * and [`ChannelMonitorUpdateStatus`] for requirements when returning errors.
22429 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
22430 * [`Writeable::write`]: crate::util::ser::Writeable::write
22432 enum LDKChannelMonitorUpdateStatus (*persist_new_channel)(const void *this_arg, struct LDKOutPoint channel_funding_outpoint, const struct LDKChannelMonitor *NONNULL_PTR data, struct LDKMonitorUpdateId update_id);
22434 * Update one channel's data. The provided [`ChannelMonitor`] has already applied the given
22437 * Note that on every update, you **must** persist either the [`ChannelMonitorUpdate`] or the
22438 * updated monitor itself to disk/backups. See the [`Persist`] trait documentation for more
22441 * During blockchain synchronization operations, and in some rare cases, this may be called with
22442 * no [`ChannelMonitorUpdate`], in which case the full [`ChannelMonitor`] needs to be persisted.
22443 * Note that after the full [`ChannelMonitor`] is persisted any previous
22444 * [`ChannelMonitorUpdate`]s which were persisted should be discarded - they can no longer be
22445 * applied to the persisted [`ChannelMonitor`] as they were already applied.
22447 * If an implementer chooses to persist the updates only, they need to make
22448 * sure that all the updates are applied to the `ChannelMonitors` *before*
22449 * the set of channel monitors is given to the `ChannelManager`
22450 * deserialization routine. See [`ChannelMonitor::update_monitor`] for
22451 * applying a monitor update to a monitor. If full `ChannelMonitors` are
22452 * persisted, then there is no need to persist individual updates.
22454 * Note that there could be a performance tradeoff between persisting complete
22455 * channel monitors on every update vs. persisting only updates and applying
22456 * them in batches. The size of each monitor grows `O(number of state updates)`
22457 * whereas updates are small and `O(1)`.
22459 * The `update_id` is used to identify this call to [`ChainMonitor::channel_monitor_updated`],
22460 * if you return [`ChannelMonitorUpdateStatus::InProgress`].
22462 * See [`Writeable::write`] on [`ChannelMonitor`] for writing out a `ChannelMonitor`,
22463 * [`Writeable::write`] on [`ChannelMonitorUpdate`] for writing out an update, and
22464 * [`ChannelMonitorUpdateStatus`] for requirements when returning errors.
22466 * [`Writeable::write`]: crate::util::ser::Writeable::write
22468 * Note that update (or a relevant inner pointer) may be NULL or all-0s to represent None
22470 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);
22472 * Prevents the channel monitor from being loaded on startup.
22474 * Archiving the data in a backup location (rather than deleting it fully) is useful for
22475 * hedging against data loss in case of unexpected failure.
22477 void (*archive_persisted_channel)(const void *this_arg, struct LDKOutPoint channel_funding_outpoint);
22479 * Frees any resources associated with this object given its this_arg pointer.
22480 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
22482 void (*free)(void *this_arg);
22488 * A string that displays only printable characters, replacing control characters with
22489 * [`core::char::REPLACEMENT_CHARACTER`].
22491 typedef struct MUST_USE_STRUCT LDKPrintableString {
22493 * A pointer to the opaque Rust object.
22494 * Nearly everywhere, inner must be non-null, however in places where
22495 * the Rust equivalent takes an Option, it may be set to null to indicate None.
22497 LDKnativePrintableString *inner;
22499 * Indicates that this is the only struct which contains the same pointer.
22500 * Rust functions which take ownership of an object provided via an argument require
22501 * this to be true and invalidate the object pointed to by inner.
22504 } LDKPrintableString;
22507 * The `Listen` trait is used to notify when blocks have been connected or disconnected from the
22510 * Useful when needing to replay chain data upon startup or as new chain events occur. Clients
22511 * sourcing chain data using a block-oriented API should prefer this interface over [`Confirm`].
22512 * Such clients fetch the entire header chain whereas clients using [`Confirm`] only fetch headers
22515 * By using [`Listen::filtered_block_connected`] this interface supports clients fetching the
22516 * entire header chain and only blocks with matching transaction data using BIP 157 filters or
22517 * other similar filtering.
22519 typedef struct LDKListen {
22521 * An opaque pointer which is passed to your function implementations as an argument.
22522 * This has no meaning in the LDK, and can be NULL or any other value.
22526 * Notifies the listener that a block was added at the given height, with the transaction data
22527 * possibly filtered.
22529 void (*filtered_block_connected)(const void *this_arg, const uint8_t (*header)[80], struct LDKCVec_C2Tuple_usizeTransactionZZ txdata, uint32_t height);
22531 * Notifies the listener that a block was added at the given height.
22533 void (*block_connected)(const void *this_arg, struct LDKu8slice block, uint32_t height);
22535 * Notifies the listener that a block was removed at the given height.
22537 void (*block_disconnected)(const void *this_arg, const uint8_t (*header)[80], uint32_t height);
22539 * Frees any resources associated with this object given its this_arg pointer.
22540 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
22542 void (*free)(void *this_arg);
22546 * The `Confirm` trait is used to notify LDK when relevant transactions have been confirmed on
22547 * chain or unconfirmed during a chain reorganization.
22549 * Clients sourcing chain data using a transaction-oriented API should prefer this interface over
22550 * [`Listen`]. For instance, an Electrum-based transaction sync implementation may implement
22551 * [`Filter`] to subscribe to relevant transactions and unspent outputs it should monitor for
22552 * on-chain activity. Then, it needs to notify LDK via this interface upon observing any changes
22553 * with reference to the confirmation status of the monitored objects.
22556 * The intended use is as follows:
22557 * - Call [`transactions_confirmed`] to notify LDK whenever any of the registered transactions or
22558 * outputs are, respectively, confirmed or spent on chain.
22559 * - Call [`transaction_unconfirmed`] to notify LDK whenever any transaction returned by
22560 * [`get_relevant_txids`] is no longer confirmed in the block with the given block hash.
22561 * - Call [`best_block_updated`] to notify LDK whenever a new chain tip becomes available.
22565 * Clients must call these methods in chain order. Specifically:
22566 * - Transactions which are confirmed in a particular block must be given before transactions
22567 * confirmed in a later block.
22568 * - Dependent transactions within the same block must be given in topological order, possibly in
22570 * - All unconfirmed transactions must be given after the original confirmations and before *any*
22571 * reconfirmations, i.e., [`transactions_confirmed`] and [`transaction_unconfirmed`] calls should
22572 * never be interleaved, but always conduced *en bloc*.
22573 * - Any reconfirmed transactions need to be explicitly unconfirmed before they are reconfirmed
22574 * in regard to the new block.
22576 * See individual method documentation for further details.
22578 * [`transactions_confirmed`]: Self::transactions_confirmed
22579 * [`transaction_unconfirmed`]: Self::transaction_unconfirmed
22580 * [`best_block_updated`]: Self::best_block_updated
22581 * [`get_relevant_txids`]: Self::get_relevant_txids
22583 typedef struct LDKConfirm {
22585 * An opaque pointer which is passed to your function implementations as an argument.
22586 * This has no meaning in the LDK, and can be NULL or any other value.
22590 * Notifies LDK of transactions confirmed in a block with a given header and height.
22592 * Must be called for any transactions registered by [`Filter::register_tx`] or any
22593 * transactions spending an output registered by [`Filter::register_output`]. Such transactions
22594 * appearing in the same block do not need to be included in the same call; instead, multiple
22595 * calls with additional transactions may be made so long as they are made in [chain order].
22597 * May be called before or after [`best_block_updated`] for the corresponding block. However,
22598 * in the event of a chain reorganization, it must not be called with a `header` that is no
22599 * longer in the chain as of the last call to [`best_block_updated`].
22601 * [chain order]: Confirm#order
22602 * [`best_block_updated`]: Self::best_block_updated
22604 void (*transactions_confirmed)(const void *this_arg, const uint8_t (*header)[80], struct LDKCVec_C2Tuple_usizeTransactionZZ txdata, uint32_t height);
22606 * Notifies LDK of a transaction that is no longer confirmed as result of a chain reorganization.
22608 * Must be called for any transaction returned by [`get_relevant_txids`] if it has been
22609 * reorganized out of the best chain or if it is no longer confirmed in the block with the
22610 * given block hash. Once called, the given transaction will not be returned
22611 * by [`get_relevant_txids`], unless it has been reconfirmed via [`transactions_confirmed`].
22613 * [`get_relevant_txids`]: Self::get_relevant_txids
22614 * [`transactions_confirmed`]: Self::transactions_confirmed
22616 void (*transaction_unconfirmed)(const void *this_arg, const uint8_t (*txid)[32]);
22618 * Notifies LDK of an update to the best header connected at the given height.
22620 * Must be called whenever a new chain tip becomes available. May be skipped for intermediary
22623 void (*best_block_updated)(const void *this_arg, const uint8_t (*header)[80], uint32_t height);
22625 * Returns transactions that must be monitored for reorganization out of the chain along
22626 * with the height and the hash of the block as part of which it had been previously confirmed.
22628 * Note that the returned `Option<BlockHash>` might be `None` for channels created with LDK
22629 * 0.0.112 and prior, in which case you need to manually track previous confirmations.
22631 * Will include any transactions passed to [`transactions_confirmed`] that have insufficient
22632 * confirmations to be safe from a chain reorganization. Will not include any transactions
22633 * passed to [`transaction_unconfirmed`], unless later reconfirmed.
22635 * Must be called to determine the subset of transactions that must be monitored for
22636 * reorganization. Will be idempotent between calls but may change as a result of calls to the
22637 * other interface methods. Thus, this is useful to determine which transactions must be
22638 * given to [`transaction_unconfirmed`].
22640 * If any of the returned transactions are confirmed in a block other than the one with the
22641 * given hash at the given height, they need to be unconfirmed and reconfirmed via
22642 * [`transaction_unconfirmed`] and [`transactions_confirmed`], respectively.
22644 * [`transactions_confirmed`]: Self::transactions_confirmed
22645 * [`transaction_unconfirmed`]: Self::transaction_unconfirmed
22647 struct LDKCVec_C3Tuple_ThirtyTwoBytesu32COption_ThirtyTwoBytesZZZ (*get_relevant_txids)(const void *this_arg);
22649 * Frees any resources associated with this object given its this_arg pointer.
22650 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
22652 void (*free)(void *this_arg);
22656 * A `enum` signalling to the [`OutputSweeper`] that it should delay spending an output until a
22657 * future block height is reached.
22659 typedef enum LDKSpendingDelay_Tag {
22661 * A relative delay indicating we shouldn't spend the output before `cur_height + num_blocks`
22664 LDKSpendingDelay_Relative,
22666 * An absolute delay indicating we shouldn't spend the output before `height` is reached.
22668 LDKSpendingDelay_Absolute,
22670 * Must be last for serialization purposes
22672 LDKSpendingDelay_Sentinel,
22673 } LDKSpendingDelay_Tag;
22675 typedef struct LDKSpendingDelay_LDKRelative_Body {
22677 * The number of blocks until we'll generate and broadcast the spending transaction.
22679 uint32_t num_blocks;
22680 } LDKSpendingDelay_LDKRelative_Body;
22682 typedef struct LDKSpendingDelay_LDKAbsolute_Body {
22684 * The height at which we'll generate and broadcast the spending transaction.
22687 } LDKSpendingDelay_LDKAbsolute_Body;
22689 typedef struct MUST_USE_STRUCT LDKSpendingDelay {
22690 LDKSpendingDelay_Tag tag;
22692 LDKSpendingDelay_LDKRelative_Body relative;
22693 LDKSpendingDelay_LDKAbsolute_Body absolute;
22695 } LDKSpendingDelay;
22698 * A callback which is called when a [`Future`] completes.
22700 * Note that this MUST NOT call back into LDK directly, it must instead schedule actions to be
22701 * taken later. Rust users should use the [`std::future::Future`] implementation for [`Future`]
22704 * Note that the [`std::future::Future`] implementation may only work for runtimes which schedule
22705 * futures when they receive a wake, rather than immediately executing them.
22707 typedef struct LDKFutureCallback {
22709 * An opaque pointer which is passed to your function implementations as an argument.
22710 * This has no meaning in the LDK, and can be NULL or any other value.
22714 * The method which is called.
22716 void (*call)(const void *this_arg);
22718 * Frees any resources associated with this object given its this_arg pointer.
22719 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
22721 void (*free)(void *this_arg);
22722 } LDKFutureCallback;
22727 * A struct which can be used to select across many [`Future`]s at once without relying on a full
22730 typedef struct MUST_USE_STRUCT LDKSleeper {
22732 * A pointer to the opaque Rust object.
22733 * Nearly everywhere, inner must be non-null, however in places where
22734 * the Rust equivalent takes an Option, it may be set to null to indicate None.
22736 LDKnativeSleeper *inner;
22738 * Indicates that this is the only struct which contains the same pointer.
22739 * Rust functions which take ownership of an object provided via an argument require
22740 * this to be true and invalidate the object pointed to by inner.
22748 * Configuration we set when applicable.
22750 * Default::default() provides sane defaults.
22752 typedef struct MUST_USE_STRUCT LDKChannelHandshakeConfig {
22754 * A pointer to the opaque Rust object.
22755 * Nearly everywhere, inner must be non-null, however in places where
22756 * the Rust equivalent takes an Option, it may be set to null to indicate None.
22758 LDKnativeChannelHandshakeConfig *inner;
22760 * Indicates that this is the only struct which contains the same pointer.
22761 * Rust functions which take ownership of an object provided via an argument require
22762 * this to be true and invalidate the object pointed to by inner.
22765 } LDKChannelHandshakeConfig;
22770 * Optional channel limits which are applied during channel creation.
22772 * These limits are only applied to our counterparty's limits, not our own.
22774 * Use 0/`<type>::max_value()` as appropriate to skip checking.
22776 * Provides sane defaults for most configurations.
22778 * Most additional limits are disabled except those with which specify a default in individual
22779 * field documentation. Note that this may result in barely-usable channels, but since they
22780 * are applied mostly only to incoming channels that's not much of a problem.
22782 typedef struct MUST_USE_STRUCT LDKChannelHandshakeLimits {
22784 * A pointer to the opaque Rust object.
22785 * Nearly everywhere, inner must be non-null, however in places where
22786 * the Rust equivalent takes an Option, it may be set to null to indicate None.
22788 LDKnativeChannelHandshakeLimits *inner;
22790 * Indicates that this is the only struct which contains the same pointer.
22791 * Rust functions which take ownership of an object provided via an argument require
22792 * this to be true and invalidate the object pointed to by inner.
22795 } LDKChannelHandshakeLimits;
22800 * A parallel struct to [`ChannelConfig`] to define partial updates.
22802 typedef struct MUST_USE_STRUCT LDKChannelConfigUpdate {
22804 * A pointer to the opaque Rust object.
22805 * Nearly everywhere, inner must be non-null, however in places where
22806 * the Rust equivalent takes an Option, it may be set to null to indicate None.
22808 LDKnativeChannelConfigUpdate *inner;
22810 * Indicates that this is the only struct which contains the same pointer.
22811 * Rust functions which take ownership of an object provided via an argument require
22812 * this to be true and invalidate the object pointed to by inner.
22815 } LDKChannelConfigUpdate;
22820 * Top-level config which holds ChannelHandshakeLimits and ChannelConfig.
22822 * Default::default() provides sane defaults for most configurations
22823 * (but currently with 0 relay fees!)
22825 typedef struct MUST_USE_STRUCT LDKUserConfig {
22827 * A pointer to the opaque Rust object.
22828 * Nearly everywhere, inner must be non-null, however in places where
22829 * the Rust equivalent takes an Option, it may be set to null to indicate None.
22831 LDKnativeUserConfig *inner;
22833 * Indicates that this is the only struct which contains the same pointer.
22834 * Rust functions which take ownership of an object provided via an argument require
22835 * this to be true and invalidate the object pointed to by inner.
22843 * An implementation of [`chain::Watch`] for monitoring channels.
22845 * Connected and disconnected blocks must be provided to `ChainMonitor` as documented by
22846 * [`chain::Watch`]. May be used in conjunction with [`ChannelManager`] to monitor channels locally
22847 * or used independently to monitor channels remotely. See the [module-level documentation] for
22850 * Note that `ChainMonitor` should regularly trigger rebroadcasts/fee bumps of pending claims from
22851 * a force-closed channel. This is crucial in preventing certain classes of pinning attacks,
22852 * detecting substantial mempool feerate changes between blocks, and ensuring reliability if
22853 * broadcasting fails. We recommend invoking this every 30 seconds, or lower if running in an
22854 * environment with spotty connections, like on mobile.
22856 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
22857 * [module-level documentation]: crate::chain::chainmonitor
22858 * [`rebroadcast_pending_claims`]: Self::rebroadcast_pending_claims
22860 typedef struct MUST_USE_STRUCT LDKChainMonitor {
22862 * A pointer to the opaque Rust object.
22863 * Nearly everywhere, inner must be non-null, however in places where
22864 * the Rust equivalent takes an Option, it may be set to null to indicate None.
22866 LDKnativeChainMonitor *inner;
22868 * Indicates that this is the only struct which contains the same pointer.
22869 * Rust functions which take ownership of an object provided via an argument require
22870 * this to be true and invalidate the object pointed to by inner.
22876 * A trait implemented for objects handling events from [`EventsProvider`].
22878 * An async variation also exists for implementations of [`EventsProvider`] that support async
22879 * event handling. The async event handler should satisfy the generic bounds: `F:
22880 * core::future::Future, H: Fn(Event) -> F`.
22882 typedef struct LDKEventHandler {
22884 * An opaque pointer which is passed to your function implementations as an argument.
22885 * This has no meaning in the LDK, and can be NULL or any other value.
22889 * Handles the given [`Event`].
22891 * See [`EventsProvider`] for details that must be considered when implementing this method.
22893 void (*handle_event)(const void *this_arg, struct LDKEvent event);
22895 * Frees any resources associated with this object given its this_arg pointer.
22896 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
22898 void (*free)(void *this_arg);
22902 * A trait indicating an object may generate events.
22904 * Events are processed by passing an [`EventHandler`] to [`process_pending_events`].
22906 * Implementations of this trait may also feature an async version of event handling, as shown with
22907 * [`ChannelManager::process_pending_events_async`] and
22908 * [`ChainMonitor::process_pending_events_async`].
22912 * When using this trait, [`process_pending_events`] will call [`handle_event`] for each pending
22913 * event since the last invocation.
22915 * In order to ensure no [`Event`]s are lost, implementors of this trait will persist [`Event`]s
22916 * and replay any unhandled events on startup. An [`Event`] is considered handled when
22917 * [`process_pending_events`] returns, thus handlers MUST fully handle [`Event`]s and persist any
22918 * relevant changes to disk *before* returning.
22920 * Further, because an application may crash between an [`Event`] being handled and the
22921 * implementor of this trait being re-serialized, [`Event`] handling must be idempotent - in
22922 * effect, [`Event`]s may be replayed.
22924 * Note, handlers may call back into the provider and thus deadlocking must be avoided. Be sure to
22925 * consult the provider's documentation on the implication of processing events and how a handler
22926 * may safely use the provider (e.g., see [`ChannelManager::process_pending_events`] and
22927 * [`ChainMonitor::process_pending_events`]).
22929 * (C-not implementable) As there is likely no reason for a user to implement this trait on their
22932 * [`process_pending_events`]: Self::process_pending_events
22933 * [`handle_event`]: EventHandler::handle_event
22934 * [`ChannelManager::process_pending_events`]: crate::ln::channelmanager::ChannelManager#method.process_pending_events
22935 * [`ChainMonitor::process_pending_events`]: crate::chain::chainmonitor::ChainMonitor#method.process_pending_events
22936 * [`ChannelManager::process_pending_events_async`]: crate::ln::channelmanager::ChannelManager::process_pending_events_async
22937 * [`ChainMonitor::process_pending_events_async`]: crate::chain::chainmonitor::ChainMonitor::process_pending_events_async
22939 typedef struct LDKEventsProvider {
22941 * An opaque pointer which is passed to your function implementations as an argument.
22942 * This has no meaning in the LDK, and can be NULL or any other value.
22946 * Processes any events generated since the last call using the given event handler.
22948 * See the trait-level documentation for requirements.
22950 void (*process_pending_events)(const void *this_arg, struct LDKEventHandler handler);
22952 * Frees any resources associated with this object given its this_arg pointer.
22953 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
22955 void (*free)(void *this_arg);
22956 } LDKEventsProvider;
22959 * This enum is used to specify which error data to send to peers when failing back an HTLC
22960 * using [`ChannelManager::fail_htlc_backwards_with_reason`].
22962 * For more info on failure codes, see <https://github.com/lightning/bolts/blob/master/04-onion-routing.md#failure-messages>.
22964 typedef enum LDKFailureCode_Tag {
22966 * We had a temporary error processing the payment. Useful if no other error codes fit
22967 * and you want to indicate that the payer may want to retry.
22969 LDKFailureCode_TemporaryNodeFailure,
22971 * We have a required feature which was not in this onion. For example, you may require
22972 * some additional metadata that was not provided with this payment.
22974 LDKFailureCode_RequiredNodeFeatureMissing,
22976 * You may wish to use this when a `payment_preimage` is unknown, or the CLTV expiry of
22977 * the HTLC is too close to the current block height for safe handling.
22978 * Using this failure code in [`ChannelManager::fail_htlc_backwards_with_reason`] is
22979 * equivalent to calling [`ChannelManager::fail_htlc_backwards`].
22981 LDKFailureCode_IncorrectOrUnknownPaymentDetails,
22983 * We failed to process the payload after the onion was decrypted. You may wish to
22984 * use this when receiving custom HTLC TLVs with even type numbers that you don't recognize.
22986 * If available, the tuple data may include the type number and byte offset in the
22987 * decrypted byte stream where the failure occurred.
22989 LDKFailureCode_InvalidOnionPayload,
22991 * Must be last for serialization purposes
22993 LDKFailureCode_Sentinel,
22994 } LDKFailureCode_Tag;
22996 typedef struct MUST_USE_STRUCT LDKFailureCode {
22997 LDKFailureCode_Tag tag;
23000 struct LDKCOption_C2Tuple_u64u16ZZ invalid_onion_payload;
23008 * Chain-related parameters used to construct a new `ChannelManager`.
23010 * Typically, the block-specific parameters are derived from the best block hash for the network,
23011 * as a newly constructed `ChannelManager` will not have created any channels yet. These parameters
23012 * are not needed when deserializing a previously constructed `ChannelManager`.
23014 typedef struct MUST_USE_STRUCT LDKChainParameters {
23016 * A pointer to the opaque Rust object.
23017 * Nearly everywhere, inner must be non-null, however in places where
23018 * the Rust equivalent takes an Option, it may be set to null to indicate None.
23020 LDKnativeChainParameters *inner;
23022 * Indicates that this is the only struct which contains the same pointer.
23023 * Rust functions which take ownership of an object provided via an argument require
23024 * this to be true and invalidate the object pointed to by inner.
23027 } LDKChainParameters;
23030 * A trait indicating an object may generate message send events
23032 typedef struct LDKMessageSendEventsProvider {
23034 * An opaque pointer which is passed to your function implementations as an argument.
23035 * This has no meaning in the LDK, and can be NULL or any other value.
23039 * Gets the list of pending events which were generated by previous actions, clearing the list
23042 struct LDKCVec_MessageSendEventZ (*get_and_clear_pending_msg_events)(const void *this_arg);
23044 * Frees any resources associated with this object given its this_arg pointer.
23045 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
23047 void (*free)(void *this_arg);
23048 } LDKMessageSendEventsProvider;
23051 * A trait to describe an object which can receive channel messages.
23053 * Messages MAY be called in parallel when they originate from different `their_node_ids`, however
23054 * they MUST NOT be called in parallel when the two calls have the same `their_node_id`.
23056 typedef struct LDKChannelMessageHandler {
23058 * An opaque pointer which is passed to your function implementations as an argument.
23059 * This has no meaning in the LDK, and can be NULL or any other value.
23063 * Handle an incoming `open_channel` message from the given peer.
23065 void (*handle_open_channel)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKOpenChannel *NONNULL_PTR msg);
23067 * Handle an incoming `open_channel2` message from the given peer.
23069 void (*handle_open_channel_v2)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKOpenChannelV2 *NONNULL_PTR msg);
23071 * Handle an incoming `accept_channel` message from the given peer.
23073 void (*handle_accept_channel)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKAcceptChannel *NONNULL_PTR msg);
23075 * Handle an incoming `accept_channel2` message from the given peer.
23077 void (*handle_accept_channel_v2)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKAcceptChannelV2 *NONNULL_PTR msg);
23079 * Handle an incoming `funding_created` message from the given peer.
23081 void (*handle_funding_created)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKFundingCreated *NONNULL_PTR msg);
23083 * Handle an incoming `funding_signed` message from the given peer.
23085 void (*handle_funding_signed)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKFundingSigned *NONNULL_PTR msg);
23087 * Handle an incoming `channel_ready` message from the given peer.
23089 void (*handle_channel_ready)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKChannelReady *NONNULL_PTR msg);
23091 * Handle an incoming `shutdown` message from the given peer.
23093 void (*handle_shutdown)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKShutdown *NONNULL_PTR msg);
23095 * Handle an incoming `closing_signed` message from the given peer.
23097 void (*handle_closing_signed)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKClosingSigned *NONNULL_PTR msg);
23099 * Handle an incoming `stfu` message from the given peer.
23101 void (*handle_stfu)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKStfu *NONNULL_PTR msg);
23103 * Handle an incoming `tx_add_input message` from the given peer.
23105 void (*handle_tx_add_input)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKTxAddInput *NONNULL_PTR msg);
23107 * Handle an incoming `tx_add_output` message from the given peer.
23109 void (*handle_tx_add_output)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKTxAddOutput *NONNULL_PTR msg);
23111 * Handle an incoming `tx_remove_input` message from the given peer.
23113 void (*handle_tx_remove_input)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKTxRemoveInput *NONNULL_PTR msg);
23115 * Handle an incoming `tx_remove_output` message from the given peer.
23117 void (*handle_tx_remove_output)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKTxRemoveOutput *NONNULL_PTR msg);
23119 * Handle an incoming `tx_complete message` from the given peer.
23121 void (*handle_tx_complete)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKTxComplete *NONNULL_PTR msg);
23123 * Handle an incoming `tx_signatures` message from the given peer.
23125 void (*handle_tx_signatures)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKTxSignatures *NONNULL_PTR msg);
23127 * Handle an incoming `tx_init_rbf` message from the given peer.
23129 void (*handle_tx_init_rbf)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKTxInitRbf *NONNULL_PTR msg);
23131 * Handle an incoming `tx_ack_rbf` message from the given peer.
23133 void (*handle_tx_ack_rbf)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKTxAckRbf *NONNULL_PTR msg);
23135 * Handle an incoming `tx_abort message` from the given peer.
23137 void (*handle_tx_abort)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKTxAbort *NONNULL_PTR msg);
23139 * Handle an incoming `update_add_htlc` message from the given peer.
23141 void (*handle_update_add_htlc)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKUpdateAddHTLC *NONNULL_PTR msg);
23143 * Handle an incoming `update_fulfill_htlc` message from the given peer.
23145 void (*handle_update_fulfill_htlc)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKUpdateFulfillHTLC *NONNULL_PTR msg);
23147 * Handle an incoming `update_fail_htlc` message from the given peer.
23149 void (*handle_update_fail_htlc)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKUpdateFailHTLC *NONNULL_PTR msg);
23151 * Handle an incoming `update_fail_malformed_htlc` message from the given peer.
23153 void (*handle_update_fail_malformed_htlc)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR msg);
23155 * Handle an incoming `commitment_signed` message from the given peer.
23157 void (*handle_commitment_signed)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKCommitmentSigned *NONNULL_PTR msg);
23159 * Handle an incoming `revoke_and_ack` message from the given peer.
23161 void (*handle_revoke_and_ack)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKRevokeAndACK *NONNULL_PTR msg);
23163 * Handle an incoming `update_fee` message from the given peer.
23165 void (*handle_update_fee)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKUpdateFee *NONNULL_PTR msg);
23167 * Handle an incoming `announcement_signatures` message from the given peer.
23169 void (*handle_announcement_signatures)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKAnnouncementSignatures *NONNULL_PTR msg);
23171 * Indicates a connection to the peer failed/an existing connection was lost.
23173 void (*peer_disconnected)(const void *this_arg, struct LDKPublicKey their_node_id);
23175 * Handle a peer reconnecting, possibly generating `channel_reestablish` message(s).
23177 * May return an `Err(())` if the features the peer supports are not sufficient to communicate
23178 * with us. Implementors should be somewhat conservative about doing so, however, as other
23179 * message handlers may still wish to communicate with this peer.
23181 struct LDKCResult_NoneNoneZ (*peer_connected)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKInit *NONNULL_PTR msg, bool inbound);
23183 * Handle an incoming `channel_reestablish` message from the given peer.
23185 void (*handle_channel_reestablish)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKChannelReestablish *NONNULL_PTR msg);
23187 * Handle an incoming `channel_update` message from the given peer.
23189 void (*handle_channel_update)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKChannelUpdate *NONNULL_PTR msg);
23191 * Handle an incoming `error` message from the given peer.
23193 void (*handle_error)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKErrorMessage *NONNULL_PTR msg);
23195 * Gets the node feature flags which this handler itself supports. All available handlers are
23196 * queried similarly and their feature flags are OR'd together to form the [`NodeFeatures`]
23197 * which are broadcasted in our [`NodeAnnouncement`] message.
23199 struct LDKNodeFeatures (*provided_node_features)(const void *this_arg);
23201 * Gets the init feature flags which should be sent to the given peer. All available handlers
23202 * are queried similarly and their feature flags are OR'd together to form the [`InitFeatures`]
23203 * which are sent in our [`Init`] message.
23205 * Note that this method is called before [`Self::peer_connected`].
23207 struct LDKInitFeatures (*provided_init_features)(const void *this_arg, struct LDKPublicKey their_node_id);
23209 * Gets the chain hashes for this `ChannelMessageHandler` indicating which chains it supports.
23211 * If it's `None`, then no particular network chain hash compatibility will be enforced when
23212 * connecting to peers.
23214 struct LDKCOption_CVec_ThirtyTwoBytesZZ (*get_chain_hashes)(const void *this_arg);
23216 * Implementation of MessageSendEventsProvider for this object.
23218 struct LDKMessageSendEventsProvider MessageSendEventsProvider;
23220 * Frees any resources associated with this object given its this_arg pointer.
23221 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
23223 void (*free)(void *this_arg);
23224 } LDKChannelMessageHandler;
23227 * A handler for an [`OnionMessage`] containing a BOLT 12 Offers message as its payload.
23229 * [`OnionMessage`]: crate::ln::msgs::OnionMessage
23231 typedef struct LDKOffersMessageHandler {
23233 * An opaque pointer which is passed to your function implementations as an argument.
23234 * This has no meaning in the LDK, and can be NULL or any other value.
23238 * Handles the given message by either responding with an [`Bolt12Invoice`], sending a payment,
23239 * or replying with an error.
23241 * The returned [`OffersMessage`], if any, is enqueued to be sent by [`OnionMessenger`].
23243 * [`OnionMessenger`]: crate::onion_message::messenger::OnionMessenger
23245 struct LDKCOption_OffersMessageZ (*handle_message)(const void *this_arg, struct LDKOffersMessage message);
23247 * Releases any [`OffersMessage`]s that need to be sent.
23249 * Typically, this is used for messages initiating a payment flow rather than in response to
23250 * another message. The latter should use the return value of [`Self::handle_message`].
23252 struct LDKCVec_C3Tuple_OffersMessageDestinationBlindedPathZZ (*release_pending_messages)(const void *this_arg);
23254 * Frees any resources associated with this object given its this_arg pointer.
23255 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
23257 void (*free)(void *this_arg);
23258 } LDKOffersMessageHandler;
23261 * An interface for looking up the node id of a channel counterparty for the purpose of forwarding
23262 * an [`OnionMessage`].
23264 * [`OnionMessage`]: crate::ln::msgs::OnionMessage
23266 typedef struct LDKNodeIdLookUp {
23268 * An opaque pointer which is passed to your function implementations as an argument.
23269 * This has no meaning in the LDK, and can be NULL or any other value.
23273 * Returns the node id of the forwarding node's channel counterparty with `short_channel_id`.
23275 * Here, the forwarding node is referring to the node of the [`OnionMessenger`] parameterized
23276 * by the [`NodeIdLookUp`] and the counterparty to one of that node's peers.
23278 * [`OnionMessenger`]: crate::onion_message::messenger::OnionMessenger
23280 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
23282 struct LDKPublicKey (*next_node_id)(const void *this_arg, uint64_t short_channel_id);
23284 * Frees any resources associated with this object given its this_arg pointer.
23285 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
23287 void (*free)(void *this_arg);
23293 * Arguments for the creation of a ChannelManager that are not deserialized.
23295 * At a high-level, the process for deserializing a ChannelManager and resuming normal operation
23297 * 1) Deserialize all stored [`ChannelMonitor`]s.
23298 * 2) Deserialize the [`ChannelManager`] by filling in this struct and calling:
23299 * `<(BlockHash, ChannelManager)>::read(reader, args)`
23300 * This may result in closing some channels if the [`ChannelMonitor`] is newer than the stored
23301 * [`ChannelManager`] state to ensure no loss of funds. Thus, transactions may be broadcasted.
23302 * 3) If you are not fetching full blocks, register all relevant [`ChannelMonitor`] outpoints the
23303 * same way you would handle a [`chain::Filter`] call using
23304 * [`ChannelMonitor::get_outputs_to_watch`] and [`ChannelMonitor::get_funding_txo`].
23305 * 4) Reconnect blocks on your [`ChannelMonitor`]s.
23306 * 5) Disconnect/connect blocks on the [`ChannelManager`].
23307 * 6) Re-persist the [`ChannelMonitor`]s to ensure the latest state is on disk.
23308 * Note that if you're using a [`ChainMonitor`] for your [`chain::Watch`] implementation, you
23309 * will likely accomplish this as a side-effect of calling [`chain::Watch::watch_channel`] in
23311 * 7) Move the [`ChannelMonitor`]s into your local [`chain::Watch`]. If you're using a
23312 * [`ChainMonitor`], this is done by calling [`chain::Watch::watch_channel`].
23314 * Note that the ordering of #4-7 is not of importance, however all four must occur before you
23315 * call any other methods on the newly-deserialized [`ChannelManager`].
23317 * Note that because some channels may be closed during deserialization, it is critical that you
23318 * always deserialize only the latest version of a ChannelManager and ChannelMonitors available to
23319 * you. If you deserialize an old ChannelManager (during which force-closure transactions may be
23320 * broadcast), and then later deserialize a newer version of the same ChannelManager (which will
23321 * not force-close the same channels but consider them live), you may end up revoking a state for
23322 * which you've already broadcasted the transaction.
23324 * [`ChainMonitor`]: crate::chain::chainmonitor::ChainMonitor
23326 typedef struct MUST_USE_STRUCT LDKChannelManagerReadArgs {
23328 * A pointer to the opaque Rust object.
23329 * Nearly everywhere, inner must be non-null, however in places where
23330 * the Rust equivalent takes an Option, it may be set to null to indicate None.
23332 LDKnativeChannelManagerReadArgs *inner;
23334 * Indicates that this is the only struct which contains the same pointer.
23335 * Rust functions which take ownership of an object provided via an argument require
23336 * this to be true and invalidate the object pointed to by inner.
23339 } LDKChannelManagerReadArgs;
23344 * A set of keys that were HKDF-expanded from an initial call to
23345 * [`NodeSigner::get_inbound_payment_key_material`].
23347 * [`NodeSigner::get_inbound_payment_key_material`]: crate::sign::NodeSigner::get_inbound_payment_key_material
23349 typedef struct MUST_USE_STRUCT LDKExpandedKey {
23351 * A pointer to the opaque Rust object.
23352 * Nearly everywhere, inner must be non-null, however in places where
23353 * the Rust equivalent takes an Option, it may be set to null to indicate None.
23355 LDKnativeExpandedKey *inner;
23357 * Indicates that this is the only struct which contains the same pointer.
23358 * Rust functions which take ownership of an object provided via an argument require
23359 * this to be true and invalidate the object pointed to by inner.
23367 * Contains fields that are both common to [`open_channel`] and `open_channel2` messages.
23369 * [`open_channel`]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md#the-open_channel-message
23371 typedef struct MUST_USE_STRUCT LDKCommonOpenChannelFields {
23373 * A pointer to the opaque Rust object.
23374 * Nearly everywhere, inner must be non-null, however in places where
23375 * the Rust equivalent takes an Option, it may be set to null to indicate None.
23377 LDKnativeCommonOpenChannelFields *inner;
23379 * Indicates that this is the only struct which contains the same pointer.
23380 * Rust functions which take ownership of an object provided via an argument require
23381 * this to be true and invalidate the object pointed to by inner.
23384 } LDKCommonOpenChannelFields;
23389 * Contains fields that are both common to [`accept_channel`] and `accept_channel2` messages.
23391 * [`accept_channel`]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md#the-accept_channel-message
23393 typedef struct MUST_USE_STRUCT LDKCommonAcceptChannelFields {
23395 * A pointer to the opaque Rust object.
23396 * Nearly everywhere, inner must be non-null, however in places where
23397 * the Rust equivalent takes an Option, it may be set to null to indicate None.
23399 LDKnativeCommonAcceptChannelFields *inner;
23401 * Indicates that this is the only struct which contains the same pointer.
23402 * Rust functions which take ownership of an object provided via an argument require
23403 * this to be true and invalidate the object pointed to by inner.
23406 } LDKCommonAcceptChannelFields;
23411 * Packet of hop data for next peer
23413 typedef struct MUST_USE_STRUCT LDKPacket {
23415 * A pointer to the opaque Rust object.
23416 * Nearly everywhere, inner must be non-null, however in places where
23417 * the Rust equivalent takes an Option, it may be set to null to indicate None.
23419 LDKnativePacket *inner;
23421 * Indicates that this is the only struct which contains the same pointer.
23422 * Rust functions which take ownership of an object provided via an argument require
23423 * this to be true and invalidate the object pointed to by inner.
23429 * A trait to describe an object which can receive routing messages.
23431 * # Implementor DoS Warnings
23433 * For messages enabled with the `gossip_queries` feature there are potential DoS vectors when
23434 * handling inbound queries. Implementors using an on-disk network graph should be aware of
23435 * repeated disk I/O for queries accessing different parts of the network graph.
23437 typedef struct LDKRoutingMessageHandler {
23439 * An opaque pointer which is passed to your function implementations as an argument.
23440 * This has no meaning in the LDK, and can be NULL or any other value.
23444 * Handle an incoming `node_announcement` message, returning `true` if it should be forwarded on,
23445 * `false` or returning an `Err` otherwise.
23447 struct LDKCResult_boolLightningErrorZ (*handle_node_announcement)(const void *this_arg, const struct LDKNodeAnnouncement *NONNULL_PTR msg);
23449 * Handle a `channel_announcement` message, returning `true` if it should be forwarded on, `false`
23450 * or returning an `Err` otherwise.
23452 struct LDKCResult_boolLightningErrorZ (*handle_channel_announcement)(const void *this_arg, const struct LDKChannelAnnouncement *NONNULL_PTR msg);
23454 * Handle an incoming `channel_update` message, returning true if it should be forwarded on,
23455 * `false` or returning an `Err` otherwise.
23457 struct LDKCResult_boolLightningErrorZ (*handle_channel_update)(const void *this_arg, const struct LDKChannelUpdate *NONNULL_PTR msg);
23459 * Gets channel announcements and updates required to dump our routing table to a remote node,
23460 * starting at the `short_channel_id` indicated by `starting_point` and including announcements
23461 * for a single channel.
23463 struct LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ (*get_next_channel_announcement)(const void *this_arg, uint64_t starting_point);
23465 * Gets a node announcement required to dump our routing table to a remote node, starting at
23466 * the node *after* the provided pubkey and including up to one announcement immediately
23467 * higher (as defined by `<PublicKey as Ord>::cmp`) than `starting_point`.
23468 * If `None` is provided for `starting_point`, we start at the first node.
23470 * Note that starting_point (or a relevant inner pointer) may be NULL or all-0s to represent None
23471 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
23473 struct LDKNodeAnnouncement (*get_next_node_announcement)(const void *this_arg, struct LDKNodeId starting_point);
23475 * Called when a connection is established with a peer. This can be used to
23476 * perform routing table synchronization using a strategy defined by the
23479 * May return an `Err(())` if the features the peer supports are not sufficient to communicate
23480 * with us. Implementors should be somewhat conservative about doing so, however, as other
23481 * message handlers may still wish to communicate with this peer.
23483 struct LDKCResult_NoneNoneZ (*peer_connected)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKInit *NONNULL_PTR init, bool inbound);
23485 * Handles the reply of a query we initiated to learn about channels
23486 * for a given range of blocks. We can expect to receive one or more
23487 * replies to a single query.
23489 struct LDKCResult_NoneLightningErrorZ (*handle_reply_channel_range)(const void *this_arg, struct LDKPublicKey their_node_id, struct LDKReplyChannelRange msg);
23491 * Handles the reply of a query we initiated asking for routing gossip
23492 * messages for a list of channels. We should receive this message when
23493 * a node has completed its best effort to send us the pertaining routing
23496 struct LDKCResult_NoneLightningErrorZ (*handle_reply_short_channel_ids_end)(const void *this_arg, struct LDKPublicKey their_node_id, struct LDKReplyShortChannelIdsEnd msg);
23498 * Handles when a peer asks us to send a list of `short_channel_id`s
23499 * for the requested range of blocks.
23501 struct LDKCResult_NoneLightningErrorZ (*handle_query_channel_range)(const void *this_arg, struct LDKPublicKey their_node_id, struct LDKQueryChannelRange msg);
23503 * Handles when a peer asks us to send routing gossip messages for a
23504 * list of `short_channel_id`s.
23506 struct LDKCResult_NoneLightningErrorZ (*handle_query_short_channel_ids)(const void *this_arg, struct LDKPublicKey their_node_id, struct LDKQueryShortChannelIds msg);
23508 * Indicates that there are a large number of [`ChannelAnnouncement`] (or other) messages
23509 * pending some async action. While there is no guarantee of the rate of future messages, the
23510 * caller should seek to reduce the rate of new gossip messages handled, especially
23511 * [`ChannelAnnouncement`]s.
23513 bool (*processing_queue_high)(const void *this_arg);
23515 * Gets the node feature flags which this handler itself supports. All available handlers are
23516 * queried similarly and their feature flags are OR'd together to form the [`NodeFeatures`]
23517 * which are broadcasted in our [`NodeAnnouncement`] message.
23519 struct LDKNodeFeatures (*provided_node_features)(const void *this_arg);
23521 * Gets the init feature flags which should be sent to the given peer. All available handlers
23522 * are queried similarly and their feature flags are OR'd together to form the [`InitFeatures`]
23523 * which are sent in our [`Init`] message.
23525 * Note that this method is called before [`Self::peer_connected`].
23527 struct LDKInitFeatures (*provided_init_features)(const void *this_arg, struct LDKPublicKey their_node_id);
23529 * Implementation of MessageSendEventsProvider for this object.
23531 struct LDKMessageSendEventsProvider MessageSendEventsProvider;
23533 * Frees any resources associated with this object given its this_arg pointer.
23534 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
23536 void (*free)(void *this_arg);
23537 } LDKRoutingMessageHandler;
23540 * A handler for received [`OnionMessage`]s and for providing generated ones to send.
23542 typedef struct LDKOnionMessageHandler {
23544 * An opaque pointer which is passed to your function implementations as an argument.
23545 * This has no meaning in the LDK, and can be NULL or any other value.
23549 * Because much of the lightning network does not yet support forwarding onion messages, we
23550 * may need to directly connect to a node which will forward a message for us. In such a case,
23551 * this method will return the set of nodes which need connection by node_id and the
23552 * corresponding socket addresses where they may accept incoming connections.
23554 * Thus, this method should be polled regularly to detect messages await such a direct
23557 struct LDKCVec_C2Tuple_PublicKeyCVec_SocketAddressZZZ (*get_and_clear_connections_needed)(const void *this_arg);
23559 * Handle an incoming `onion_message` message from the given peer.
23561 void (*handle_onion_message)(const void *this_arg, struct LDKPublicKey peer_node_id, const struct LDKOnionMessage *NONNULL_PTR msg);
23563 * Returns the next pending onion message for the peer with the given node id.
23565 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
23567 struct LDKOnionMessage (*next_onion_message_for_peer)(const void *this_arg, struct LDKPublicKey peer_node_id);
23569 * Called when a connection is established with a peer. Can be used to track which peers
23570 * advertise onion message support and are online.
23572 * May return an `Err(())` if the features the peer supports are not sufficient to communicate
23573 * with us. Implementors should be somewhat conservative about doing so, however, as other
23574 * message handlers may still wish to communicate with this peer.
23576 struct LDKCResult_NoneNoneZ (*peer_connected)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKInit *NONNULL_PTR init, bool inbound);
23578 * Indicates a connection to the peer failed/an existing connection was lost. Allows handlers to
23579 * drop and refuse to forward onion messages to this peer.
23581 void (*peer_disconnected)(const void *this_arg, struct LDKPublicKey their_node_id);
23583 * Performs actions that should happen roughly every ten seconds after startup. Allows handlers
23584 * to drop any buffered onion messages intended for prospective peers.
23586 void (*timer_tick_occurred)(const void *this_arg);
23588 * Gets the node feature flags which this handler itself supports. All available handlers are
23589 * queried similarly and their feature flags are OR'd together to form the [`NodeFeatures`]
23590 * which are broadcasted in our [`NodeAnnouncement`] message.
23592 struct LDKNodeFeatures (*provided_node_features)(const void *this_arg);
23594 * Gets the init feature flags which should be sent to the given peer. All available handlers
23595 * are queried similarly and their feature flags are OR'd together to form the [`InitFeatures`]
23596 * which are sent in our [`Init`] message.
23598 * Note that this method is called before [`Self::peer_connected`].
23600 struct LDKInitFeatures (*provided_init_features)(const void *this_arg, struct LDKPublicKey their_node_id);
23602 * Frees any resources associated with this object given its this_arg pointer.
23603 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
23605 void (*free)(void *this_arg);
23606 } LDKOnionMessageHandler;
23611 * BOLT 4 onion packet including hop data for the next peer.
23613 typedef struct MUST_USE_STRUCT LDKTrampolineOnionPacket {
23615 * A pointer to the opaque Rust object.
23616 * Nearly everywhere, inner must be non-null, however in places where
23617 * the Rust equivalent takes an Option, it may be set to null to indicate None.
23619 LDKnativeTrampolineOnionPacket *inner;
23621 * Indicates that this is the only struct which contains the same pointer.
23622 * Rust functions which take ownership of an object provided via an argument require
23623 * this to be true and invalidate the object pointed to by inner.
23626 } LDKTrampolineOnionPacket;
23629 * Trait to be implemented by custom message (unrelated to the channel/gossip LN layers)
23632 typedef struct LDKCustomMessageReader {
23634 * An opaque pointer which is passed to your function implementations as an argument.
23635 * This has no meaning in the LDK, and can be NULL or any other value.
23639 * Decodes a custom message to `CustomMessageType`. If the given message type is known to the
23640 * implementation and the message could be decoded, must return `Ok(Some(message))`. If the
23641 * message type is unknown to the implementation, must return `Ok(None)`. If a decoding error
23642 * occur, must return `Err(DecodeError::X)` where `X` details the encountered error.
23644 struct LDKCResult_COption_TypeZDecodeErrorZ (*read)(const void *this_arg, uint16_t message_type, struct LDKu8slice buffer);
23646 * Frees any resources associated with this object given its this_arg pointer.
23647 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
23649 void (*free)(void *this_arg);
23650 } LDKCustomMessageReader;
23653 * A handler provided to [`PeerManager`] for reading and handling custom messages.
23655 * [BOLT 1] specifies a custom message type range for use with experimental or application-specific
23656 * messages. `CustomMessageHandler` allows for user-defined handling of such types. See the
23657 * [`lightning_custom_message`] crate for tools useful in composing more than one custom handler.
23659 * [BOLT 1]: https://github.com/lightning/bolts/blob/master/01-messaging.md
23660 * [`lightning_custom_message`]: https://docs.rs/lightning_custom_message/latest/lightning_custom_message
23662 typedef struct LDKCustomMessageHandler {
23664 * An opaque pointer which is passed to your function implementations as an argument.
23665 * This has no meaning in the LDK, and can be NULL or any other value.
23669 * Handles the given message sent from `sender_node_id`, possibly producing messages for
23670 * [`CustomMessageHandler::get_and_clear_pending_msg`] to return and thus for [`PeerManager`]
23673 struct LDKCResult_NoneLightningErrorZ (*handle_custom_message)(const void *this_arg, struct LDKType msg, struct LDKPublicKey sender_node_id);
23675 * Returns the list of pending messages that were generated by the handler, clearing the list
23676 * in the process. Each message is paired with the node id of the intended recipient. If no
23677 * connection to the node exists, then the message is simply not sent.
23679 struct LDKCVec_C2Tuple_PublicKeyTypeZZ (*get_and_clear_pending_msg)(const void *this_arg);
23681 * Gets the node feature flags which this handler itself supports. All available handlers are
23682 * queried similarly and their feature flags are OR'd together to form the [`NodeFeatures`]
23683 * which are broadcasted in our [`NodeAnnouncement`] message.
23685 * [`NodeAnnouncement`]: crate::ln::msgs::NodeAnnouncement
23687 struct LDKNodeFeatures (*provided_node_features)(const void *this_arg);
23689 * Gets the init feature flags which should be sent to the given peer. All available handlers
23690 * are queried similarly and their feature flags are OR'd together to form the [`InitFeatures`]
23691 * which are sent in our [`Init`] message.
23693 * [`Init`]: crate::ln::msgs::Init
23695 struct LDKInitFeatures (*provided_init_features)(const void *this_arg, struct LDKPublicKey their_node_id);
23697 * Implementation of CustomMessageReader for this object.
23699 struct LDKCustomMessageReader CustomMessageReader;
23701 * Frees any resources associated with this object given its this_arg pointer.
23702 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
23704 void (*free)(void *this_arg);
23705 } LDKCustomMessageHandler;
23710 * A dummy struct which implements `RoutingMessageHandler` without storing any routing information
23711 * or doing any processing. You can provide one of these as the route_handler in a MessageHandler.
23713 typedef struct MUST_USE_STRUCT LDKIgnoringMessageHandler {
23715 * A pointer to the opaque Rust object.
23716 * Nearly everywhere, inner must be non-null, however in places where
23717 * the Rust equivalent takes an Option, it may be set to null to indicate None.
23719 LDKnativeIgnoringMessageHandler *inner;
23721 * Indicates that this is the only struct which contains the same pointer.
23722 * Rust functions which take ownership of an object provided via an argument require
23723 * this to be true and invalidate the object pointed to by inner.
23726 } LDKIgnoringMessageHandler;
23729 * Handler for custom onion messages. If you are using [`SimpleArcOnionMessenger`],
23730 * [`SimpleRefOnionMessenger`], or prefer to ignore inbound custom onion messages,
23731 * [`IgnoringMessageHandler`] must be provided to [`OnionMessenger::new`]. Otherwise, a custom
23732 * implementation of this trait must be provided, with [`CustomMessage`] specifying the supported
23735 * See [`OnionMessenger`] for example usage.
23737 * [`IgnoringMessageHandler`]: crate::ln::peer_handler::IgnoringMessageHandler
23738 * [`CustomMessage`]: Self::CustomMessage
23740 typedef struct LDKCustomOnionMessageHandler {
23742 * An opaque pointer which is passed to your function implementations as an argument.
23743 * This has no meaning in the LDK, and can be NULL or any other value.
23747 * Called with the custom message that was received, returning a response to send, if any.
23749 * The returned [`Self::CustomMessage`], if any, is enqueued to be sent by [`OnionMessenger`].
23751 struct LDKCOption_OnionMessageContentsZ (*handle_custom_message)(const void *this_arg, struct LDKOnionMessageContents msg);
23753 * Read a custom message of type `message_type` from `buffer`, returning `Ok(None)` if the
23754 * message type is unknown.
23756 struct LDKCResult_COption_OnionMessageContentsZDecodeErrorZ (*read_custom_message)(const void *this_arg, uint64_t message_type, struct LDKu8slice buffer);
23758 * Releases any [`Self::CustomMessage`]s that need to be sent.
23760 * Typically, this is used for messages initiating a message flow rather than in response to
23761 * another message. The latter should use the return value of [`Self::handle_custom_message`].
23763 struct LDKCVec_C3Tuple_OnionMessageContentsDestinationBlindedPathZZ (*release_pending_custom_messages)(const void *this_arg);
23765 * Frees any resources associated with this object given its this_arg pointer.
23766 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
23768 void (*free)(void *this_arg);
23769 } LDKCustomOnionMessageHandler;
23774 * A dummy struct which implements `ChannelMessageHandler` without having any channels.
23775 * You can provide one of these as the route_handler in a MessageHandler.
23777 typedef struct MUST_USE_STRUCT LDKErroringMessageHandler {
23779 * A pointer to the opaque Rust object.
23780 * Nearly everywhere, inner must be non-null, however in places where
23781 * the Rust equivalent takes an Option, it may be set to null to indicate None.
23783 LDKnativeErroringMessageHandler *inner;
23785 * Indicates that this is the only struct which contains the same pointer.
23786 * Rust functions which take ownership of an object provided via an argument require
23787 * this to be true and invalidate the object pointed to by inner.
23790 } LDKErroringMessageHandler;
23795 * Provides references to trait impls which handle different types of messages.
23797 typedef struct MUST_USE_STRUCT LDKMessageHandler {
23799 * A pointer to the opaque Rust object.
23800 * Nearly everywhere, inner must be non-null, however in places where
23801 * the Rust equivalent takes an Option, it may be set to null to indicate None.
23803 LDKnativeMessageHandler *inner;
23805 * Indicates that this is the only struct which contains the same pointer.
23806 * Rust functions which take ownership of an object provided via an argument require
23807 * this to be true and invalidate the object pointed to by inner.
23810 } LDKMessageHandler;
23813 * Provides an object which can be used to send data to and which uniquely identifies a connection
23814 * to a remote host. You will need to be able to generate multiple of these which meet Eq and
23815 * implement Hash to meet the PeerManager API.
23817 * For efficiency, [`Clone`] should be relatively cheap for this type.
23819 * Two descriptors may compare equal (by [`cmp::Eq`] and [`hash::Hash`]) as long as the original
23820 * has been disconnected, the [`PeerManager`] has been informed of the disconnection (either by it
23821 * having triggered the disconnection or a call to [`PeerManager::socket_disconnected`]), and no
23822 * further calls to the [`PeerManager`] related to the original socket occur. This allows you to
23823 * use a file descriptor for your SocketDescriptor directly, however for simplicity you may wish
23824 * to simply use another value which is guaranteed to be globally unique instead.
23826 typedef struct LDKSocketDescriptor {
23828 * An opaque pointer which is passed to your function implementations as an argument.
23829 * This has no meaning in the LDK, and can be NULL or any other value.
23833 * Attempts to send some data from the given slice to the peer.
23835 * Returns the amount of data which was sent, possibly 0 if the socket has since disconnected.
23836 * Note that in the disconnected case, [`PeerManager::socket_disconnected`] must still be
23837 * called and further write attempts may occur until that time.
23839 * If the returned size is smaller than `data.len()`, a
23840 * [`PeerManager::write_buffer_space_avail`] call must be made the next time more data can be
23841 * written. Additionally, until a `send_data` event completes fully, no further
23842 * [`PeerManager::read_event`] calls should be made for the same peer! Because this is to
23843 * prevent denial-of-service issues, you should not read or buffer any data from the socket
23846 * If a [`PeerManager::read_event`] call on this descriptor had previously returned true
23847 * (indicating that read events should be paused to prevent DoS in the send buffer),
23848 * `resume_read` may be set indicating that read events on this descriptor should resume. A
23849 * `resume_read` of false carries no meaning, and should not cause any action.
23851 uintptr_t (*send_data)(void *this_arg, struct LDKu8slice data, bool resume_read);
23853 * Disconnect the socket pointed to by this SocketDescriptor.
23855 * You do *not* need to call [`PeerManager::socket_disconnected`] with this socket after this
23856 * call (doing so is a noop).
23858 void (*disconnect_socket)(void *this_arg);
23860 * Checks if two objects are equal given this object's this_arg pointer and another object.
23862 bool (*eq)(const void *this_arg, const struct LDKSocketDescriptor *NONNULL_PTR other_arg);
23864 * Calculate a succinct non-cryptographic hash for an object given its this_arg pointer.
23865 * This is used, for example, for inclusion of this object in a hash map.
23867 uint64_t (*hash)(const void *this_arg);
23869 * Called, if set, after this SocketDescriptor has been cloned into a duplicate object.
23870 * The new SocketDescriptor is provided, and should be mutated as needed to perform a
23871 * deep copy of the object pointed to by this_arg or avoid any double-freeing.
23873 void (*cloned)(struct LDKSocketDescriptor *NONNULL_PTR new_SocketDescriptor);
23875 * Frees any resources associated with this object given its this_arg pointer.
23876 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
23878 void (*free)(void *this_arg);
23879 } LDKSocketDescriptor;
23884 * A PeerManager manages a set of peers, described by their [`SocketDescriptor`] and marshalls
23885 * socket events into messages which it passes on to its [`MessageHandler`].
23887 * Locks are taken internally, so you must never assume that reentrancy from a
23888 * [`SocketDescriptor`] call back into [`PeerManager`] methods will not deadlock.
23890 * Calls to [`read_event`] will decode relevant messages and pass them to the
23891 * [`ChannelMessageHandler`], likely doing message processing in-line. Thus, the primary form of
23892 * parallelism in Rust-Lightning is in calls to [`read_event`]. Note, however, that calls to any
23893 * [`PeerManager`] functions related to the same connection must occur only in serial, making new
23894 * calls only after previous ones have returned.
23896 * Rather than using a plain [`PeerManager`], it is preferable to use either a [`SimpleArcPeerManager`]
23897 * a [`SimpleRefPeerManager`], for conciseness. See their documentation for more details, but
23898 * essentially you should default to using a [`SimpleRefPeerManager`], and use a
23899 * [`SimpleArcPeerManager`] when you require a `PeerManager` with a static lifetime, such as when
23900 * you're using lightning-net-tokio.
23902 * [`read_event`]: PeerManager::read_event
23904 typedef struct MUST_USE_STRUCT LDKPeerManager {
23906 * A pointer to the opaque Rust object.
23907 * Nearly everywhere, inner must be non-null, however in places where
23908 * the Rust equivalent takes an Option, it may be set to null to indicate None.
23910 LDKnativePeerManager *inner;
23912 * Indicates that this is the only struct which contains the same pointer.
23913 * Rust functions which take ownership of an object provided via an argument require
23914 * this to be true and invalidate the object pointed to by inner.
23922 * Static channel fields used to build transactions given per-commitment fields, organized by
23923 * broadcaster/countersignatory.
23925 * This is derived from the holder/counterparty-organized ChannelTransactionParameters via the
23926 * as_holder_broadcastable and as_counterparty_broadcastable functions.
23928 typedef struct MUST_USE_STRUCT LDKDirectedChannelTransactionParameters {
23930 * A pointer to the opaque Rust object.
23931 * Nearly everywhere, inner must be non-null, however in places where
23932 * the Rust equivalent takes an Option, it may be set to null to indicate None.
23934 LDKnativeDirectedChannelTransactionParameters *inner;
23936 * Indicates that this is the only struct which contains the same pointer.
23937 * Rust functions which take ownership of an object provided via an argument require
23938 * this to be true and invalidate the object pointed to by inner.
23941 } LDKDirectedChannelTransactionParameters;
23946 * Features used within an `offer`.
23948 typedef struct MUST_USE_STRUCT LDKOfferFeatures {
23950 * A pointer to the opaque Rust object.
23951 * Nearly everywhere, inner must be non-null, however in places where
23952 * the Rust equivalent takes an Option, it may be set to null to indicate None.
23954 LDKnativeOfferFeatures *inner;
23956 * Indicates that this is the only struct which contains the same pointer.
23957 * Rust functions which take ownership of an object provided via an argument require
23958 * this to be true and invalidate the object pointed to by inner.
23961 } LDKOfferFeatures;
23966 * Features used within an `invoice_request`.
23968 typedef struct MUST_USE_STRUCT LDKInvoiceRequestFeatures {
23970 * A pointer to the opaque Rust object.
23971 * Nearly everywhere, inner must be non-null, however in places where
23972 * the Rust equivalent takes an Option, it may be set to null to indicate None.
23974 LDKnativeInvoiceRequestFeatures *inner;
23976 * Indicates that this is the only struct which contains the same pointer.
23977 * Rust functions which take ownership of an object provided via an argument require
23978 * this to be true and invalidate the object pointed to by inner.
23981 } LDKInvoiceRequestFeatures;
23986 * Builds an [`Offer`] for the \"offer to be paid\" flow.
23988 * See [module-level documentation] for usage.
23990 * [module-level documentation]: self
23992 typedef struct MUST_USE_STRUCT LDKOfferWithExplicitMetadataBuilder {
23994 * A pointer to the opaque Rust object.
23995 * Nearly everywhere, inner must be non-null, however in places where
23996 * the Rust equivalent takes an Option, it may be set to null to indicate None.
23998 LDKnativeOfferWithExplicitMetadataBuilder *inner;
24000 * Indicates that this is the only struct which contains the same pointer.
24001 * Rust functions which take ownership of an object provided via an argument require
24002 * this to be true and invalidate the object pointed to by inner.
24005 } LDKOfferWithExplicitMetadataBuilder;
24008 * Represents a tweaked X-only public key as required for BIP 340 (Taproot).
24010 typedef struct LDKTweakedPublicKey {
24012 * The bytes of the public key X coordinate
24014 uint8_t x_coordinate[32];
24015 } LDKTweakedPublicKey;
24018 * A function for signing an [`UnsignedBolt12Invoice`].
24020 typedef struct LDKSignBolt12InvoiceFn {
24022 * An opaque pointer which is passed to your function implementations as an argument.
24023 * This has no meaning in the LDK, and can be NULL or any other value.
24027 * Signs a [`TaggedHash`] computed over the merkle root of `message`'s TLV stream.
24029 struct LDKCResult_SchnorrSignatureNoneZ (*sign_invoice)(const void *this_arg, const struct LDKUnsignedBolt12Invoice *NONNULL_PTR message);
24031 * Frees any resources associated with this object given its this_arg pointer.
24032 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
24034 void (*free)(void *this_arg);
24035 } LDKSignBolt12InvoiceFn;
24040 * A hash for use in a specific context by tweaking with a context-dependent tag as per [BIP 340]
24041 * and computed over the merkle root of a TLV stream to sign as defined in [BOLT 12].
24043 * [BIP 340]: https://github.com/bitcoin/bips/blob/master/bip-0340.mediawiki
24044 * [BOLT 12]: https://github.com/rustyrussell/lightning-rfc/blob/guilt/offers/12-offer-encoding.md#signature-calculation
24046 typedef struct MUST_USE_STRUCT LDKTaggedHash {
24048 * A pointer to the opaque Rust object.
24049 * Nearly everywhere, inner must be non-null, however in places where
24050 * the Rust equivalent takes an Option, it may be set to null to indicate None.
24052 LDKnativeTaggedHash *inner;
24054 * Indicates that this is the only struct which contains the same pointer.
24055 * Rust functions which take ownership of an object provided via an argument require
24056 * this to be true and invalidate the object pointed to by inner.
24064 * The field in the [`InvoiceRequest`] or the [`Bolt12Invoice`] that contained an error.
24066 * [`InvoiceRequest`]: crate::offers::invoice_request::InvoiceRequest
24067 * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice
24069 typedef struct MUST_USE_STRUCT LDKErroneousField {
24071 * A pointer to the opaque Rust object.
24072 * Nearly everywhere, inner must be non-null, however in places where
24073 * the Rust equivalent takes an Option, it may be set to null to indicate None.
24075 LDKnativeErroneousField *inner;
24077 * Indicates that this is the only struct which contains the same pointer.
24078 * Rust functions which take ownership of an object provided via an argument require
24079 * this to be true and invalidate the object pointed to by inner.
24082 } LDKErroneousField;
24085 * A function for signing an [`UnsignedInvoiceRequest`].
24087 typedef struct LDKSignInvoiceRequestFn {
24089 * An opaque pointer which is passed to your function implementations as an argument.
24090 * This has no meaning in the LDK, and can be NULL or any other value.
24094 * Signs a [`TaggedHash`] computed over the merkle root of `message`'s TLV stream.
24096 struct LDKCResult_SchnorrSignatureNoneZ (*sign_invoice_request)(const void *this_arg, const struct LDKUnsignedInvoiceRequest *NONNULL_PTR message);
24098 * Frees any resources associated with this object given its this_arg pointer.
24099 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
24101 void (*free)(void *this_arg);
24102 } LDKSignInvoiceRequestFn;
24105 * Error when signing messages.
24107 typedef enum LDKSignError_Tag {
24109 * User-defined error when signing the message.
24111 LDKSignError_Signing,
24113 * Error when verifying the produced signature using the given pubkey.
24115 LDKSignError_Verification,
24117 * Must be last for serialization purposes
24119 LDKSignError_Sentinel,
24120 } LDKSignError_Tag;
24122 typedef struct MUST_USE_STRUCT LDKSignError {
24123 LDKSignError_Tag tag;
24126 enum LDKSecp256k1Error verification;
24134 * Receives and validates network updates from peers,
24135 * stores authentic and relevant data as a network graph.
24136 * This network graph is then used for routing payments.
24137 * Provides interface to help with initial routing sync by
24138 * serving historical announcements.
24140 typedef struct MUST_USE_STRUCT LDKP2PGossipSync {
24142 * A pointer to the opaque Rust object.
24143 * Nearly everywhere, inner must be non-null, however in places where
24144 * the Rust equivalent takes an Option, it may be set to null to indicate None.
24146 LDKnativeP2PGossipSync *inner;
24148 * Indicates that this is the only struct which contains the same pointer.
24149 * Rust functions which take ownership of an object provided via an argument require
24150 * this to be true and invalidate the object pointed to by inner.
24153 } LDKP2PGossipSync;
24158 * A read-only view of [`NetworkGraph`].
24160 typedef struct MUST_USE_STRUCT LDKReadOnlyNetworkGraph {
24162 * A pointer to the opaque Rust object.
24163 * Nearly everywhere, inner must be non-null, however in places where
24164 * the Rust equivalent takes an Option, it may be set to null to indicate None.
24166 LDKnativeReadOnlyNetworkGraph *inner;
24168 * Indicates that this is the only struct which contains the same pointer.
24169 * Rust functions which take ownership of an object provided via an argument require
24170 * this to be true and invalidate the object pointed to by inner.
24173 } LDKReadOnlyNetworkGraph;
24178 * A wrapper around [`ChannelInfo`] representing information about the channel as directed from a
24179 * source node to a target node.
24181 typedef struct MUST_USE_STRUCT LDKDirectedChannelInfo {
24183 * A pointer to the opaque Rust object.
24184 * Nearly everywhere, inner must be non-null, however in places where
24185 * the Rust equivalent takes an Option, it may be set to null to indicate None.
24187 LDKnativeDirectedChannelInfo *inner;
24189 * Indicates that this is the only struct which contains the same pointer.
24190 * Rust functions which take ownership of an object provided via an argument require
24191 * this to be true and invalidate the object pointed to by inner.
24194 } LDKDirectedChannelInfo;
24197 * The effective capacity of a channel for routing purposes.
24199 * While this may be smaller than the actual channel capacity, amounts greater than
24200 * [`Self::as_msat`] should not be routed through the channel.
24202 typedef enum LDKEffectiveCapacity_Tag {
24204 * The available liquidity in the channel known from being a channel counterparty, and thus a
24207 LDKEffectiveCapacity_ExactLiquidity,
24209 * The maximum HTLC amount in one direction as advertised on the gossip network.
24211 LDKEffectiveCapacity_AdvertisedMaxHTLC,
24213 * The total capacity of the channel as determined by the funding transaction.
24215 LDKEffectiveCapacity_Total,
24217 * A capacity sufficient to route any payment, typically used for private channels provided by
24220 LDKEffectiveCapacity_Infinite,
24222 * The maximum HTLC amount as provided by an invoice route hint.
24224 LDKEffectiveCapacity_HintMaxHTLC,
24226 * A capacity that is unknown possibly because either the chain state is unavailable to know
24227 * the total capacity or the `htlc_maximum_msat` was not advertised on the gossip network.
24229 LDKEffectiveCapacity_Unknown,
24231 * Must be last for serialization purposes
24233 LDKEffectiveCapacity_Sentinel,
24234 } LDKEffectiveCapacity_Tag;
24236 typedef struct LDKEffectiveCapacity_LDKExactLiquidity_Body {
24238 * Either the inbound or outbound liquidity depending on the direction, denominated in
24241 uint64_t liquidity_msat;
24242 } LDKEffectiveCapacity_LDKExactLiquidity_Body;
24244 typedef struct LDKEffectiveCapacity_LDKAdvertisedMaxHTLC_Body {
24246 * The maximum HTLC amount denominated in millisatoshi.
24248 uint64_t amount_msat;
24249 } LDKEffectiveCapacity_LDKAdvertisedMaxHTLC_Body;
24251 typedef struct LDKEffectiveCapacity_LDKTotal_Body {
24253 * The funding amount denominated in millisatoshi.
24255 uint64_t capacity_msat;
24257 * The maximum HTLC amount denominated in millisatoshi.
24259 uint64_t htlc_maximum_msat;
24260 } LDKEffectiveCapacity_LDKTotal_Body;
24262 typedef struct LDKEffectiveCapacity_LDKHintMaxHTLC_Body {
24264 * The maximum HTLC amount denominated in millisatoshi.
24266 uint64_t amount_msat;
24267 } LDKEffectiveCapacity_LDKHintMaxHTLC_Body;
24269 typedef struct MUST_USE_STRUCT LDKEffectiveCapacity {
24270 LDKEffectiveCapacity_Tag tag;
24272 LDKEffectiveCapacity_LDKExactLiquidity_Body exact_liquidity;
24273 LDKEffectiveCapacity_LDKAdvertisedMaxHTLC_Body advertised_max_htlc;
24274 LDKEffectiveCapacity_LDKTotal_Body total;
24275 LDKEffectiveCapacity_LDKHintMaxHTLC_Body hint_max_htlc;
24277 } LDKEffectiveCapacity;
24282 * A [`Router`] implemented using [`find_route`].
24284 typedef struct MUST_USE_STRUCT LDKDefaultRouter {
24286 * A pointer to the opaque Rust object.
24287 * Nearly everywhere, inner must be non-null, however in places where
24288 * the Rust equivalent takes an Option, it may be set to null to indicate None.
24290 LDKnativeDefaultRouter *inner;
24292 * Indicates that this is the only struct which contains the same pointer.
24293 * Rust functions which take ownership of an object provided via an argument require
24294 * this to be true and invalidate the object pointed to by inner.
24297 } LDKDefaultRouter;
24302 * [`ScoreLookUp`] implementation that factors in in-flight HTLC liquidity.
24304 * Useful for custom [`Router`] implementations to wrap their [`ScoreLookUp`] on-the-fly when calling
24307 * [`ScoreLookUp`]: crate::routing::scoring::ScoreLookUp
24309 typedef struct MUST_USE_STRUCT LDKScorerAccountingForInFlightHtlcs {
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 LDKnativeScorerAccountingForInFlightHtlcs *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 } LDKScorerAccountingForInFlightHtlcs;
24325 * The recipient of a payment, differing based on whether they've hidden their identity with route
24328 typedef enum LDKPayee_Tag {
24330 * The recipient provided blinded paths and payinfo to reach them. The blinded paths themselves
24331 * will be included in the final [`Route`].
24335 * The recipient included these route hints in their BOLT11 invoice.
24339 * Must be last for serialization purposes
24344 typedef struct LDKPayee_LDKBlinded_Body {
24346 * Aggregated routing info and blinded paths, for routing to the payee without knowing their
24349 struct LDKCVec_C2Tuple_BlindedPayInfoBlindedPathZZ route_hints;
24351 * Features supported by the payee.
24353 * May be set from the payee's invoice. May be `None` if the invoice does not contain any
24356 * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
24358 struct LDKBolt12InvoiceFeatures features;
24359 } LDKPayee_LDKBlinded_Body;
24361 typedef struct LDKPayee_LDKClear_Body {
24363 * The node id of the payee.
24365 struct LDKPublicKey node_id;
24367 * Hints for routing to the payee, containing channels connecting the payee to public nodes.
24369 struct LDKCVec_RouteHintZ route_hints;
24371 * Features supported by the payee.
24373 * May be set from the payee's invoice or via [`for_keysend`]. May be `None` if the invoice
24374 * does not contain any features.
24376 * [`for_keysend`]: PaymentParameters::for_keysend
24378 * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
24380 struct LDKBolt11InvoiceFeatures features;
24382 * The minimum CLTV delta at the end of the route. This value must not be zero.
24384 uint32_t final_cltv_expiry_delta;
24385 } LDKPayee_LDKClear_Body;
24387 typedef struct MUST_USE_STRUCT LDKPayee {
24390 LDKPayee_LDKBlinded_Body blinded;
24391 LDKPayee_LDKClear_Body clear;
24396 * A trait which can both lookup and update routing channel penalty scores.
24398 * This is used in places where both bounds are required and implemented for all types which
24399 * implement [`ScoreLookUp`] and [`ScoreUpdate`].
24401 * Bindings users may need to manually implement this for their custom scoring implementations.
24403 typedef struct LDKScore {
24405 * An opaque pointer which is passed to your function implementations as an argument.
24406 * This has no meaning in the LDK, and can be NULL or any other value.
24410 * Implementation of ScoreLookUp for this object.
24412 struct LDKScoreLookUp ScoreLookUp;
24414 * Implementation of ScoreUpdate for this object.
24416 struct LDKScoreUpdate ScoreUpdate;
24418 * Serialize the object into a byte array
24420 struct LDKCVec_u8Z (*write)(const void *this_arg);
24422 * Frees any resources associated with this object given its this_arg pointer.
24423 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
24425 void (*free)(void *this_arg);
24431 * A concrete implementation of [`LockableScore`] which supports multi-threading.
24433 typedef struct MUST_USE_STRUCT LDKMultiThreadedLockableScore {
24435 * A pointer to the opaque Rust object.
24436 * Nearly everywhere, inner must be non-null, however in places where
24437 * the Rust equivalent takes an Option, it may be set to null to indicate None.
24439 LDKnativeMultiThreadedLockableScore *inner;
24441 * Indicates that this is the only struct which contains the same pointer.
24442 * Rust functions which take ownership of an object provided via an argument require
24443 * this to be true and invalidate the object pointed to by inner.
24446 } LDKMultiThreadedLockableScore;
24451 * A locked `MultiThreadedLockableScore`.
24453 typedef struct MUST_USE_STRUCT LDKMultiThreadedScoreLockRead {
24455 * A pointer to the opaque Rust object.
24456 * Nearly everywhere, inner must be non-null, however in places where
24457 * the Rust equivalent takes an Option, it may be set to null to indicate None.
24459 LDKnativeMultiThreadedScoreLockRead *inner;
24461 * Indicates that this is the only struct which contains the same pointer.
24462 * Rust functions which take ownership of an object provided via an argument require
24463 * this to be true and invalidate the object pointed to by inner.
24466 } LDKMultiThreadedScoreLockRead;
24471 * A locked `MultiThreadedLockableScore`.
24473 typedef struct MUST_USE_STRUCT LDKMultiThreadedScoreLockWrite {
24475 * A pointer to the opaque Rust object.
24476 * Nearly everywhere, inner must be non-null, however in places where
24477 * the Rust equivalent takes an Option, it may be set to null to indicate None.
24479 LDKnativeMultiThreadedScoreLockWrite *inner;
24481 * Indicates that this is the only struct which contains the same pointer.
24482 * Rust functions which take ownership of an object provided via an argument require
24483 * this to be true and invalidate the object pointed to by inner.
24486 } LDKMultiThreadedScoreLockWrite;
24491 * Parameters for configuring [`ProbabilisticScorer`].
24493 * Used to configure decay parameters that are static throughout the lifetime of the scorer.
24494 * these decay parameters affect the score of the channel penalty and are not changed on a
24495 * per-route penalty cost call.
24497 typedef struct MUST_USE_STRUCT LDKProbabilisticScoringDecayParameters {
24499 * A pointer to the opaque Rust object.
24500 * Nearly everywhere, inner must be non-null, however in places where
24501 * the Rust equivalent takes an Option, it may be set to null to indicate None.
24503 LDKnativeProbabilisticScoringDecayParameters *inner;
24505 * Indicates that this is the only struct which contains the same pointer.
24506 * Rust functions which take ownership of an object provided via an argument require
24507 * this to be true and invalidate the object pointed to by inner.
24510 } LDKProbabilisticScoringDecayParameters;
24515 * Simple implementation of [`EntropySource`], [`NodeSigner`], and [`SignerProvider`] that takes a
24516 * 32-byte seed for use as a BIP 32 extended key and derives keys from that.
24518 * Your `node_id` is seed/0'.
24519 * Unilateral closes may use seed/1'.
24520 * Cooperative closes may use seed/2'.
24521 * The two close keys may be needed to claim on-chain funds!
24523 * This struct cannot be used for nodes that wish to support receiving phantom payments;
24524 * [`PhantomKeysManager`] must be used instead.
24526 * Note that switching between this struct and [`PhantomKeysManager`] will invalidate any
24527 * previously issued invoices and attempts to pay previous invoices will fail.
24529 typedef struct MUST_USE_STRUCT LDKKeysManager {
24531 * A pointer to the opaque Rust object.
24532 * Nearly everywhere, inner must be non-null, however in places where
24533 * the Rust equivalent takes an Option, it may be set to null to indicate None.
24535 LDKnativeKeysManager *inner;
24537 * Indicates that this is the only struct which contains the same pointer.
24538 * Rust functions which take ownership of an object provided via an argument require
24539 * this to be true and invalidate the object pointed to by inner.
24547 * Similar to [`KeysManager`], but allows the node using this struct to receive phantom node
24550 * A phantom node payment is a payment made to a phantom invoice, which is an invoice that can be
24551 * paid to one of multiple nodes. This works because we encode the invoice route hints such that
24552 * LDK will recognize an incoming payment as destined for a phantom node, and collect the payment
24553 * itself without ever needing to forward to this fake node.
24555 * Phantom node payments are useful for load balancing between multiple LDK nodes. They also
24556 * provide some fault tolerance, because payers will automatically retry paying other provided
24557 * nodes in the case that one node goes down.
24559 * Note that multi-path payments are not supported in phantom invoices for security reasons.
24560 * Switching between this struct and [`KeysManager`] will invalidate any previously issued
24561 * invoices and attempts to pay previous invoices will fail.
24563 typedef struct MUST_USE_STRUCT LDKPhantomKeysManager {
24565 * A pointer to the opaque Rust object.
24566 * Nearly everywhere, inner must be non-null, however in places where
24567 * the Rust equivalent takes an Option, it may be set to null to indicate None.
24569 LDKnativePhantomKeysManager *inner;
24571 * Indicates that this is the only struct which contains the same pointer.
24572 * Rust functions which take ownership of an object provided via an argument require
24573 * this to be true and invalidate the object pointed to by inner.
24576 } LDKPhantomKeysManager;
24581 * An implementation of [`EntropySource`] using ChaCha20.
24583 typedef struct MUST_USE_STRUCT LDKRandomBytes {
24585 * A pointer to the opaque Rust object.
24586 * Nearly everywhere, inner must be non-null, however in places where
24587 * the Rust equivalent takes an Option, it may be set to null to indicate None.
24589 LDKnativeRandomBytes *inner;
24591 * Indicates that this is the only struct which contains the same pointer.
24592 * Rust functions which take ownership of an object provided via an argument require
24593 * this to be true and invalidate the object pointed to by inner.
24601 * A sender, receiver and forwarder of [`OnionMessage`]s.
24603 * # Handling Messages
24605 * `OnionMessenger` implements [`OnionMessageHandler`], making it responsible for either forwarding
24606 * messages to peers or delegating to the appropriate handler for the message type. Currently, the
24607 * available handlers are:
24608 * * [`OffersMessageHandler`], for responding to [`InvoiceRequest`]s and paying [`Bolt12Invoice`]s
24609 * * [`CustomOnionMessageHandler`], for handling user-defined message types
24611 * # Sending Messages
24613 * [`OnionMessage`]s are sent initially using [`OnionMessenger::send_onion_message`]. When handling
24614 * a message, the matched handler may return a response message which `OnionMessenger` will send
24620 * # extern crate bitcoin;
24621 * # use bitcoin::hashes::_export::_core::time::Duration;
24622 * # use bitcoin::hashes::hex::FromHex;
24623 * # use bitcoin::secp256k1::{PublicKey, Secp256k1, SecretKey, self};
24624 * # use lightning::blinded_path::{BlindedPath, EmptyNodeIdLookUp};
24625 * # use lightning::sign::{EntropySource, KeysManager};
24626 * # use lightning::ln::peer_handler::IgnoringMessageHandler;
24627 * # use lightning::onion_message::messenger::{Destination, MessageRouter, OnionMessagePath, OnionMessenger};
24628 * # use lightning::onion_message::packet::OnionMessageContents;
24629 * # use lightning::util::logger::{Logger, Record};
24630 * # use lightning::util::ser::{Writeable, Writer};
24631 * # use lightning::io;
24632 * # use std::sync::Arc;
24633 * # struct FakeLogger;
24634 * # impl Logger for FakeLogger {
24635 * # fn log(&self, record: Record) { println!(\"{:?}\" , record); }
24637 * # struct FakeMessageRouter {}
24638 * # impl MessageRouter for FakeMessageRouter {
24639 * # fn find_path(&self, sender: PublicKey, peers: Vec<PublicKey>, destination: Destination) -> Result<OnionMessagePath, ()> {
24640 * # let secp_ctx = Secp256k1::new();
24641 * # let node_secret = SecretKey::from_slice(&<Vec<u8>>::from_hex(\"0101010101010101010101010101010101010101010101010101010101010101\").unwrap()[..]).unwrap();
24642 * # let hop_node_id1 = PublicKey::from_secret_key(&secp_ctx, &node_secret);
24643 * # let hop_node_id2 = hop_node_id1;
24644 * # Ok(OnionMessagePath {
24645 * # intermediate_nodes: vec![hop_node_id1, hop_node_id2],
24647 * # first_node_addresses: None,
24650 * # fn create_blinded_paths<T: secp256k1::Signing + secp256k1::Verification>(
24651 * # &self, _recipient: PublicKey, _peers: Vec<PublicKey>, _secp_ctx: &Secp256k1<T>
24652 * # ) -> Result<Vec<BlindedPath>, ()> {
24656 * # let seed = [42u8; 32];
24657 * # let time = Duration::from_secs(123456);
24658 * # let keys_manager = KeysManager::new(&seed, time.as_secs(), time.subsec_nanos());
24659 * # let logger = Arc::new(FakeLogger {});
24660 * # let node_secret = SecretKey::from_slice(&<Vec<u8>>::from_hex(\"0101010101010101010101010101010101010101010101010101010101010101\").unwrap()[..]).unwrap();
24661 * # let secp_ctx = Secp256k1::new();
24662 * # let hop_node_id1 = PublicKey::from_secret_key(&secp_ctx, &node_secret);
24663 * # let (hop_node_id3, hop_node_id4) = (hop_node_id1, hop_node_id1);
24664 * # let destination_node_id = hop_node_id1;
24665 * # let node_id_lookup = EmptyNodeIdLookUp {};
24666 * # let message_router = Arc::new(FakeMessageRouter {});
24667 * # let custom_message_handler = IgnoringMessageHandler {};
24668 * # let offers_message_handler = IgnoringMessageHandler {};
24669 * // Create the onion messenger. This must use the same `keys_manager` as is passed to your
24670 * // ChannelManager.
24671 * let onion_messenger = OnionMessenger::new(
24672 * &keys_manager, &keys_manager, logger, &node_id_lookup, message_router,
24673 * &offers_message_handler, &custom_message_handler
24676 * # #[derive(Debug, Clone)]
24677 * # struct YourCustomMessage {}
24678 * impl Writeable for YourCustomMessage {
24679 * \tfn write<W: Writer>(&self, w: &mut W) -> Result<(), io::Error> {
24681 * \t\t// Write your custom onion message to `w`
24684 * impl OnionMessageContents for YourCustomMessage {
24685 * \tfn tlv_type(&self) -> u64 {
24686 * \t\t# let your_custom_message_type = 42;
24687 * \t\tyour_custom_message_type
24690 * // Send a custom onion message to a node id.
24691 * let destination = Destination::Node(destination_node_id);
24692 * let reply_path = None;
24693 * # let message = YourCustomMessage {};
24694 * onion_messenger.send_onion_message(message, destination, reply_path);
24696 * // Create a blinded path to yourself, for someone to send an onion message to.
24697 * # let your_node_id = hop_node_id1;
24698 * let hops = [hop_node_id3, hop_node_id4, your_node_id];
24699 * let blinded_path = BlindedPath::new_for_message(&hops, &keys_manager, &secp_ctx).unwrap();
24701 * // Send a custom onion message to a blinded path.
24702 * let destination = Destination::BlindedPath(blinded_path);
24703 * let reply_path = None;
24704 * # let message = YourCustomMessage {};
24705 * onion_messenger.send_onion_message(message, destination, reply_path);
24708 * [`InvoiceRequest`]: crate::offers::invoice_request::InvoiceRequest
24709 * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice
24711 typedef struct MUST_USE_STRUCT LDKOnionMessenger {
24713 * A pointer to the opaque Rust object.
24714 * Nearly everywhere, inner must be non-null, however in places where
24715 * the Rust equivalent takes an Option, it may be set to null to indicate None.
24717 LDKnativeOnionMessenger *inner;
24719 * Indicates that this is the only struct which contains the same pointer.
24720 * Rust functions which take ownership of an object provided via an argument require
24721 * this to be true and invalidate the object pointed to by inner.
24724 } LDKOnionMessenger;
24729 * A [`MessageRouter`] that can only route to a directly connected [`Destination`].
24731 typedef struct MUST_USE_STRUCT LDKDefaultMessageRouter {
24733 * A pointer to the opaque Rust object.
24734 * Nearly everywhere, inner must be non-null, however in places where
24735 * the Rust equivalent takes an Option, it may be set to null to indicate None.
24737 LDKnativeDefaultMessageRouter *inner;
24739 * Indicates that this is the only struct which contains the same pointer.
24740 * Rust functions which take ownership of an object provided via an argument require
24741 * this to be true and invalidate the object pointed to by inner.
24744 } LDKDefaultMessageRouter;
24747 * The unblinded node in a [`BlindedPath`].
24749 typedef enum LDKIntroductionNode_Tag {
24751 * The node id of the introduction node.
24753 LDKIntroductionNode_NodeId,
24755 * The short channel id of the channel leading to the introduction node. The [`Direction`]
24756 * identifies which side of the channel is the introduction node.
24758 LDKIntroductionNode_DirectedShortChannelId,
24760 * Must be last for serialization purposes
24762 LDKIntroductionNode_Sentinel,
24763 } LDKIntroductionNode_Tag;
24765 typedef struct LDKIntroductionNode_LDKDirectedShortChannelId_Body {
24766 enum LDKDirection _0;
24768 } LDKIntroductionNode_LDKDirectedShortChannelId_Body;
24770 typedef struct MUST_USE_STRUCT LDKIntroductionNode {
24771 LDKIntroductionNode_Tag tag;
24774 struct LDKPublicKey node_id;
24776 LDKIntroductionNode_LDKDirectedShortChannelId_Body directed_short_channel_id;
24778 } LDKIntroductionNode;
24783 * A [`NodeIdLookUp`] that always returns `None`.
24785 typedef struct MUST_USE_STRUCT LDKEmptyNodeIdLookUp {
24787 * A pointer to the opaque Rust object.
24788 * Nearly everywhere, inner must be non-null, however in places where
24789 * the Rust equivalent takes an Option, it may be set to null to indicate None.
24791 LDKnativeEmptyNodeIdLookUp *inner;
24793 * Indicates that this is the only struct which contains the same pointer.
24794 * Rust functions which take ownership of an object provided via an argument require
24795 * this to be true and invalidate the object pointed to by inner.
24798 } LDKEmptyNodeIdLookUp;
24803 * Data to construct a [`BlindedHop`] for forwarding a payment.
24805 typedef struct MUST_USE_STRUCT LDKForwardTlvs {
24807 * A pointer to the opaque Rust object.
24808 * Nearly everywhere, inner must be non-null, however in places where
24809 * the Rust equivalent takes an Option, it may be set to null to indicate None.
24811 LDKnativeForwardTlvs *inner;
24813 * Indicates that this is the only struct which contains the same pointer.
24814 * Rust functions which take ownership of an object provided via an argument require
24815 * this to be true and invalidate the object pointed to by inner.
24821 * An abstraction over a bitcoin wallet that can perform coin selection over a set of UTXOs and can
24822 * sign for them. The coin selection method aims to mimic Bitcoin Core's `fundrawtransaction` RPC,
24823 * which most wallets should be able to satisfy. Otherwise, consider implementing [`WalletSource`],
24824 * which can provide a default implementation of this trait when used with [`Wallet`].
24826 typedef struct LDKCoinSelectionSource {
24828 * An opaque pointer which is passed to your function implementations as an argument.
24829 * This has no meaning in the LDK, and can be NULL or any other value.
24833 * Performs coin selection of a set of UTXOs, with at least 1 confirmation each, that are
24834 * available to spend. Implementations are free to pick their coin selection algorithm of
24835 * choice, as long as the following requirements are met:
24837 * 1. `must_spend` contains a set of [`Input`]s that must be included in the transaction
24838 * throughout coin selection, but must not be returned as part of the result.
24839 * 2. `must_pay_to` contains a set of [`TxOut`]s that must be included in the transaction
24840 * throughout coin selection. In some cases, like when funding an anchor transaction, this
24841 * set is empty. Implementations should ensure they handle this correctly on their end,
24842 * e.g., Bitcoin Core's `fundrawtransaction` RPC requires at least one output to be
24843 * provided, in which case a zero-value empty OP_RETURN output can be used instead.
24844 * 3. Enough inputs must be selected/contributed for the resulting transaction (including the
24845 * inputs and outputs noted above) to meet `target_feerate_sat_per_1000_weight`.
24847 * Implementations must take note that [`Input::satisfaction_weight`] only tracks the weight of
24848 * the input's `script_sig` and `witness`. Some wallets, like Bitcoin Core's, may require
24849 * providing the full input weight. Failing to do so may lead to underestimating fee bumps and
24850 * delaying block inclusion.
24852 * The `claim_id` must map to the set of external UTXOs assigned to the claim, such that they
24853 * can be re-used within new fee-bumped iterations of the original claiming transaction,
24854 * ensuring that claims don't double spend each other. If a specific `claim_id` has never had a
24855 * transaction associated with it, and all of the available UTXOs have already been assigned to
24856 * other claims, implementations must be willing to double spend their UTXOs. The choice of
24857 * which UTXOs to double spend is left to the implementation, but it must strive to keep the
24858 * set of other claims being double spent to a minimum.
24860 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);
24862 * Signs and provides the full witness for all inputs within the transaction known to the
24863 * trait (i.e., any provided via [`CoinSelectionSource::select_confirmed_utxos`]).
24865 * If your wallet does not support signing PSBTs you can call `psbt.extract_tx()` to get the
24866 * unsigned transaction and then sign it with your wallet.
24868 struct LDKCResult_TransactionNoneZ (*sign_psbt)(const void *this_arg, struct LDKCVec_u8Z psbt);
24870 * Frees any resources associated with this object given its this_arg pointer.
24871 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
24873 void (*free)(void *this_arg);
24874 } LDKCoinSelectionSource;
24877 * An alternative to [`CoinSelectionSource`] that can be implemented and used along [`Wallet`] to
24878 * provide a default implementation to [`CoinSelectionSource`].
24880 typedef struct LDKWalletSource {
24882 * An opaque pointer which is passed to your function implementations as an argument.
24883 * This has no meaning in the LDK, and can be NULL or any other value.
24887 * Returns all UTXOs, with at least 1 confirmation each, that are available to spend.
24889 struct LDKCResult_CVec_UtxoZNoneZ (*list_confirmed_utxos)(const void *this_arg);
24891 * Returns a script to use for change above dust resulting from a successful coin selection
24894 struct LDKCResult_CVec_u8ZNoneZ (*get_change_script)(const void *this_arg);
24896 * Signs and provides the full [`TxIn::script_sig`] and [`TxIn::witness`] for all inputs within
24897 * the transaction known to the wallet (i.e., any provided via
24898 * [`WalletSource::list_confirmed_utxos`]).
24900 * If your wallet does not support signing PSBTs you can call `psbt.extract_tx()` to get the
24901 * unsigned transaction and then sign it with your wallet.
24903 struct LDKCResult_TransactionNoneZ (*sign_psbt)(const void *this_arg, struct LDKCVec_u8Z psbt);
24905 * Frees any resources associated with this object given its this_arg pointer.
24906 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
24908 void (*free)(void *this_arg);
24914 * A wrapper over [`WalletSource`] that implements [`CoinSelection`] by preferring UTXOs that would
24915 * avoid conflicting double spends. If not enough UTXOs are available to do so, conflicting double
24916 * spends may happen.
24918 typedef struct MUST_USE_STRUCT LDKWallet {
24920 * A pointer to the opaque Rust object.
24921 * Nearly everywhere, inner must be non-null, however in places where
24922 * the Rust equivalent takes an Option, it may be set to null to indicate None.
24924 LDKnativeWallet *inner;
24926 * Indicates that this is the only struct which contains the same pointer.
24927 * Rust functions which take ownership of an object provided via an argument require
24928 * this to be true and invalidate the object pointed to by inner.
24936 * A handler for [`Event::BumpTransaction`] events that sources confirmed UTXOs from a
24937 * [`CoinSelectionSource`] to fee bump transactions via Child-Pays-For-Parent (CPFP) or
24938 * Replace-By-Fee (RBF).
24940 * [`Event::BumpTransaction`]: crate::events::Event::BumpTransaction
24942 typedef struct MUST_USE_STRUCT LDKBumpTransactionEventHandler {
24944 * A pointer to the opaque Rust object.
24945 * Nearly everywhere, inner must be non-null, however in places where
24946 * the Rust equivalent takes an Option, it may be set to null to indicate None.
24948 LDKnativeBumpTransactionEventHandler *inner;
24950 * Indicates that this is the only struct which contains the same pointer.
24951 * Rust functions which take ownership of an object provided via an argument require
24952 * this to be true and invalidate the object pointed to by inner.
24955 } LDKBumpTransactionEventHandler;
24960 * A [`KVStore`] implementation that writes to and reads from the file system.
24962 typedef struct MUST_USE_STRUCT LDKFilesystemStore {
24964 * A pointer to the opaque Rust object.
24965 * Nearly everywhere, inner must be non-null, however in places where
24966 * the Rust equivalent takes an Option, it may be set to null to indicate None.
24968 LDKnativeFilesystemStore *inner;
24970 * Indicates that this is the only struct which contains the same pointer.
24971 * Rust functions which take ownership of an object provided via an argument require
24972 * this to be true and invalidate the object pointed to by inner.
24975 } LDKFilesystemStore;
24980 * `BackgroundProcessor` takes care of tasks that (1) need to happen periodically to keep
24981 * Rust-Lightning running properly, and (2) either can or should be run in the background. Its
24982 * responsibilities are:
24983 * * Processing [`Event`]s with a user-provided [`EventHandler`].
24984 * * Monitoring whether the [`ChannelManager`] needs to be re-persisted to disk, and if so,
24985 * writing it to disk/backups by invoking the callback given to it at startup.
24986 * [`ChannelManager`] persistence should be done in the background.
24987 * * Calling [`ChannelManager::timer_tick_occurred`], [`ChainMonitor::rebroadcast_pending_claims`]
24988 * and [`PeerManager::timer_tick_occurred`] at the appropriate intervals.
24989 * * Calling [`NetworkGraph::remove_stale_channels_and_tracking`] (if a [`GossipSync`] with a
24990 * [`NetworkGraph`] is provided to [`BackgroundProcessor::start`]).
24992 * It will also call [`PeerManager::process_events`] periodically though this shouldn't be relied
24993 * upon as doing so may result in high latency.
24997 * If [`ChannelManager`] persistence fails and the persisted manager becomes out-of-date, then
24998 * there is a risk of channels force-closing on startup when the manager realizes it's outdated.
24999 * However, as long as [`ChannelMonitor`] backups are sound, no funds besides those used for
25000 * unilateral chain closure fees are at risk.
25002 * [`ChannelManager`]: lightning::ln::channelmanager::ChannelManager
25003 * [`ChannelManager::timer_tick_occurred`]: lightning::ln::channelmanager::ChannelManager::timer_tick_occurred
25004 * [`ChannelMonitor`]: lightning::chain::channelmonitor::ChannelMonitor
25005 * [`Event`]: lightning::events::Event
25006 * [`PeerManager::timer_tick_occurred`]: lightning::ln::peer_handler::PeerManager::timer_tick_occurred
25007 * [`PeerManager::process_events`]: lightning::ln::peer_handler::PeerManager::process_events
25008 *BackgroundProcessor will immediately stop on drop. It should be stored until shutdown.
25010 typedef struct MUST_USE_STRUCT LDKBackgroundProcessor {
25012 * A pointer to the opaque Rust object.
25013 * Nearly everywhere, inner must be non-null, however in places where
25014 * the Rust equivalent takes an Option, it may be set to null to indicate None.
25016 LDKnativeBackgroundProcessor *inner;
25018 * Indicates that this is the only struct which contains the same pointer.
25019 * Rust functions which take ownership of an object provided via an argument require
25020 * this to be true and invalidate the object pointed to by inner.
25023 } LDKBackgroundProcessor;
25028 * The main Rapid Gossip Sync object.
25030 * See [crate-level documentation] for usage.
25032 * [crate-level documentation]: crate
25034 typedef struct MUST_USE_STRUCT LDKRapidGossipSync {
25036 * A pointer to the opaque Rust object.
25037 * Nearly everywhere, inner must be non-null, however in places where
25038 * the Rust equivalent takes an Option, it may be set to null to indicate None.
25040 LDKnativeRapidGossipSync *inner;
25042 * Indicates that this is the only struct which contains the same pointer.
25043 * Rust functions which take ownership of an object provided via an argument require
25044 * this to be true and invalidate the object pointed to by inner.
25047 } LDKRapidGossipSync;
25050 * Either [`P2PGossipSync`] or [`RapidGossipSync`].
25052 typedef enum LDKGossipSync_Tag {
25054 * Gossip sync via the lightning peer-to-peer network as defined by BOLT 7.
25058 * Rapid gossip sync from a trusted server.
25060 LDKGossipSync_Rapid,
25064 LDKGossipSync_None,
25066 * Must be last for serialization purposes
25068 LDKGossipSync_Sentinel,
25069 } LDKGossipSync_Tag;
25071 typedef struct MUST_USE_STRUCT LDKGossipSync {
25072 LDKGossipSync_Tag tag;
25076 * Note that this field is expected to be a reference.
25078 struct LDKP2PGossipSync p2p;
25082 * Note that this field is expected to be a reference.
25084 struct LDKRapidGossipSync rapid;
25092 * Data of the [`RawBolt11Invoice`] that is encoded in the data part
25094 typedef struct MUST_USE_STRUCT LDKRawDataPart {
25096 * A pointer to the opaque Rust object.
25097 * Nearly everywhere, inner must be non-null, however in places where
25098 * the Rust equivalent takes an Option, it may be set to null to indicate None.
25100 LDKnativeRawDataPart *inner;
25102 * Indicates that this is the only struct which contains the same pointer.
25103 * Rust functions which take ownership of an object provided via an argument require
25104 * this to be true and invalidate the object pointed to by inner.
25114 typedef struct MUST_USE_STRUCT LDKSha256 {
25116 * A pointer to the opaque Rust object.
25117 * Nearly everywhere, inner must be non-null, however in places where
25118 * the Rust equivalent takes an Option, it may be set to null to indicate None.
25120 LDKnativeSha256 *inner;
25122 * Indicates that this is the only struct which contains the same pointer.
25123 * Rust functions which take ownership of an object provided via an argument require
25124 * this to be true and invalidate the object pointed to by inner.
25132 * Positive duration that defines when (relatively to the timestamp) in the future the invoice
25135 typedef struct MUST_USE_STRUCT LDKExpiryTime {
25137 * A pointer to the opaque Rust object.
25138 * Nearly everywhere, inner must be non-null, however in places where
25139 * the Rust equivalent takes an Option, it may be set to null to indicate None.
25141 LDKnativeExpiryTime *inner;
25143 * Indicates that this is the only struct which contains the same pointer.
25144 * Rust functions which take ownership of an object provided via an argument require
25145 * this to be true and invalidate the object pointed to by inner.
25153 * `min_final_cltv_expiry_delta` to use for the last HTLC in the route
25155 typedef struct MUST_USE_STRUCT LDKMinFinalCltvExpiryDelta {
25157 * A pointer to the opaque Rust object.
25158 * Nearly everywhere, inner must be non-null, however in places where
25159 * the Rust equivalent takes an Option, it may be set to null to indicate None.
25161 LDKnativeMinFinalCltvExpiryDelta *inner;
25163 * Indicates that this is the only struct which contains the same pointer.
25164 * Rust functions which take ownership of an object provided via an argument require
25165 * this to be true and invalidate the object pointed to by inner.
25168 } LDKMinFinalCltvExpiryDelta;
25171 * A 20-byte byte array.
25173 typedef struct LDKTwentyBytes {
25181 * Fallback address in case no LN payment is possible
25183 typedef enum LDKFallback_Tag {
25184 LDKFallback_SegWitProgram,
25185 LDKFallback_PubKeyHash,
25186 LDKFallback_ScriptHash,
25188 * Must be last for serialization purposes
25190 LDKFallback_Sentinel,
25193 typedef struct LDKFallback_LDKSegWitProgram_Body {
25194 struct LDKWitnessVersion version;
25195 struct LDKCVec_u8Z program;
25196 } LDKFallback_LDKSegWitProgram_Body;
25198 typedef struct MUST_USE_STRUCT LDKFallback {
25199 LDKFallback_Tag tag;
25201 LDKFallback_LDKSegWitProgram_Body seg_wit_program;
25203 struct LDKTwentyBytes pub_key_hash;
25206 struct LDKTwentyBytes script_hash;
25211 extern const uintptr_t MAX_BUF_SIZE;
25213 extern const uintptr_t KVSTORE_NAMESPACE_KEY_MAX_LEN;
25215 extern const uint64_t MAX_SCID_BLOCK;
25217 extern const uint64_t MAX_SCID_TX_INDEX;
25219 extern const uint64_t MAX_SCID_VOUT_INDEX;
25221 extern const uint64_t MIN_RELAY_FEE_SAT_PER_1000_WEIGHT;
25223 extern const uint32_t FEERATE_FLOOR_SATS_PER_KW;
25225 extern const uint64_t CLOSED_CHANNEL_UPDATE_ID;
25227 extern const uint32_t ANTI_REORG_DELAY;
25229 extern const uint16_t BREAKDOWN_TIMEOUT;
25231 extern const uint16_t MIN_CLTV_EXPIRY_DELTA;
25233 extern const uint16_t MIN_FINAL_CLTV_EXPIRY_DELTA;
25235 extern const uint16_t MAX_HTLCS;
25237 extern const uintptr_t OFFERED_HTLC_SCRIPT_WEIGHT;
25239 extern const uintptr_t OFFERED_HTLC_SCRIPT_WEIGHT_ANCHORS;
25241 extern const uintptr_t MAX_ACCEPTED_HTLC_SCRIPT_WEIGHT;
25243 extern const uint64_t ANCHOR_INPUT_WITNESS_WEIGHT;
25245 extern const uint64_t HTLC_TIMEOUT_INPUT_ANCHOR_WITNESS_WEIGHT;
25247 extern const uint64_t HTLC_SUCCESS_INPUT_ANCHOR_WITNESS_WEIGHT;
25249 extern const uintptr_t REVOKEABLE_REDEEMSCRIPT_MAX_LENGTH;
25251 extern const uintptr_t PAYER_NOTE_LIMIT;
25253 extern const uint64_t UNKNOWN_CHANNEL_CAPACITY_MSAT;
25255 extern const uint32_t DEFAULT_MAX_TOTAL_CLTV_EXPIRY_DELTA;
25257 extern const uint8_t DEFAULT_MAX_PATH_COUNT;
25259 extern const uint64_t MAX_TIMESTAMP;
25261 extern const uint64_t DEFAULT_EXPIRY_TIME;
25263 extern const uint64_t DEFAULT_MIN_FINAL_CLTV_EXPIRY_DELTA;
25265 extern const uint8_t TAG_PAYMENT_HASH;
25267 extern const uint8_t TAG_DESCRIPTION;
25269 extern const uint8_t TAG_PAYEE_PUB_KEY;
25271 extern const uint8_t TAG_DESCRIPTION_HASH;
25273 extern const uint8_t TAG_EXPIRY_TIME;
25275 extern const uint8_t TAG_MIN_FINAL_CLTV_EXPIRY_DELTA;
25277 extern const uint8_t TAG_FALLBACK;
25279 extern const uint8_t TAG_PRIVATE_ROUTE;
25281 extern const uint8_t TAG_PAYMENT_SECRET;
25283 extern const uint8_t TAG_PAYMENT_METADATA;
25285 extern const uint8_t TAG_FEATURES;
25287 struct LDKStr _ldk_get_compiled_version(void);
25289 struct LDKStr _ldk_c_bindings_get_compiled_version(void);
25292 * Gets the 128-bit integer, as 16 little-endian bytes
25294 struct LDKSixteenBytes U128_le_bytes(struct LDKU128 val);
25297 * Constructs a new U128 from 16 little-endian bytes
25299 struct LDKU128 U128_new(struct LDKSixteenBytes le_bytes);
25302 * Constructs a new WitnessProgram given a version and program bytes.
25304 * The program MUST be at least 2 bytes and no longer than 40 bytes long.
25305 * Further, if the version is 0, the program MUST be either exactly 20 or exactly 32 bytes long.
25307 struct LDKWitnessProgram WitnessProgram_new(struct LDKWitnessVersion version, struct LDKCVec_u8Z program);
25310 * Gets the `WitnessVersion` of the given `WitnessProgram`
25312 struct LDKWitnessVersion WitnessProgram_get_version(const struct LDKWitnessProgram *NONNULL_PTR prog);
25315 * Gets the witness program bytes of the given `WitnessProgram`
25317 struct LDKu8slice WitnessProgram_get_program(const struct LDKWitnessProgram *NONNULL_PTR prog);
25320 * Creates a new WitnessProgram which has the same data as `orig`
25322 struct LDKWitnessProgram WitnessProgram_clone(const struct LDKWitnessProgram *NONNULL_PTR orig);
25325 * Releases any memory held by the given `WitnessProgram` (which is currently none)
25327 void WitnessProgram_free(struct LDKWitnessProgram o);
25330 * Convenience function for constructing a new BigEndianScalar
25332 struct LDKBigEndianScalar BigEndianScalar_new(struct LDKThirtyTwoBytes big_endian_bytes);
25335 * Creates a new BigEndianScalar which has the same data as `orig`
25337 struct LDKBigEndianScalar BigEndianScalar_clone(const struct LDKBigEndianScalar *NONNULL_PTR orig);
25340 * Creates a new Bech32Error which has the same data as `orig`
25342 struct LDKBech32Error Bech32Error_clone(const struct LDKBech32Error *NONNULL_PTR orig);
25345 * Releases any memory held by the given `Bech32Error` (which is currently none)
25347 void Bech32Error_free(struct LDKBech32Error o);
25350 * Frees the data buffer, if data_is_owned is set and datalen > 0.
25352 void Transaction_free(struct LDKTransaction _res);
25355 * Creates a new Witness which has the same data as `orig` but with a new buffer.
25357 struct LDKWitness Witness_clone(const struct LDKWitness *NONNULL_PTR orig);
25360 * Frees the data pointed to by data
25362 void Witness_free(struct LDKWitness _res);
25365 * Convenience function for constructing a new TxIn
25367 struct LDKTxIn TxIn_new(struct LDKWitness witness, struct LDKCVec_u8Z script_sig, uint32_t sequence, struct LDKThirtyTwoBytes previous_txid, uint32_t previous_vout);
25370 * Gets the `witness` in the given `TxIn`.
25372 struct LDKWitness TxIn_get_witness(const struct LDKTxIn *NONNULL_PTR txin);
25375 * Gets the `script_sig` in the given `TxIn`.
25377 struct LDKu8slice TxIn_get_script_sig(const struct LDKTxIn *NONNULL_PTR txin);
25380 * Gets the `sequence` in the given `TxIn`.
25382 uint32_t TxIn_get_sequence(const struct LDKTxIn *NONNULL_PTR txin);
25385 * Gets the previous outpoint txid in the given `TxIn`.
25387 struct LDKThirtyTwoBytes TxIn_get_previous_txid(const struct LDKTxIn *NONNULL_PTR txin);
25390 * Gets the previout outpoint index in the given `TxIn`.
25392 uint32_t TxIn_get_previous_vout(const struct LDKTxIn *NONNULL_PTR txin);
25395 * Frees the witness and script_sig in a TxIn
25397 void TxIn_free(struct LDKTxIn _res);
25400 * Convenience function for constructing a new TxOut
25402 struct LDKTxOut TxOut_new(struct LDKCVec_u8Z script_pubkey, uint64_t value);
25405 * Gets the `script_pubkey` in the given `TxOut`.
25407 struct LDKu8slice TxOut_get_script_pubkey(const struct LDKTxOut *NONNULL_PTR txout);
25410 * Gets the value in the given `TxOut`.
25412 uint64_t TxOut_get_value(const struct LDKTxOut *NONNULL_PTR txout);
25415 * Frees the data pointed to by script_pubkey.
25417 void TxOut_free(struct LDKTxOut _res);
25420 * Creates a new TxOut which has the same data as `orig` but with a new script buffer.
25422 struct LDKTxOut TxOut_clone(const struct LDKTxOut *NONNULL_PTR orig);
25425 * Frees the data buffer, if chars_is_owned is set and len > 0.
25427 void Str_free(struct LDKStr _res);
25429 #if defined(LDK_DEBUG_BUILD)
25431 * This function exists for memory safety testing purposes. It should never be used in production
25434 const void *__unmangle_inner_ptr(const void *ptr);
25438 * Frees the buffer pointed to by `data` if `datalen` is non-0.
25440 void CVec_u8Z_free(struct LDKCVec_u8Z _res);
25443 * Creates a new CResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ in the success state.
25445 struct LDKCResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ CResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ_ok(struct LDKRefundMaybeWithDerivedMetadataBuilder o);
25448 * Creates a new CResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ in the error state.
25450 struct LDKCResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ CResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ_err(enum LDKBolt12SemanticError e);
25453 * Checks if the given object is currently in the success state
25455 bool CResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ_is_ok(const struct LDKCResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ *NONNULL_PTR o);
25458 * Frees any resources used by the CResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ.
25460 void CResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ_free(struct LDKCResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ _res);
25463 * Creates a new CResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ which has the same data as `orig`
25464 * but with all dynamically-allocated buffers duplicated in new buffers.
25466 struct LDKCResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ CResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ_clone(const struct LDKCResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ *NONNULL_PTR orig);
25469 * Creates a new CResult_RefundBolt12SemanticErrorZ in the success state.
25471 struct LDKCResult_RefundBolt12SemanticErrorZ CResult_RefundBolt12SemanticErrorZ_ok(struct LDKRefund o);
25474 * Creates a new CResult_RefundBolt12SemanticErrorZ in the error state.
25476 struct LDKCResult_RefundBolt12SemanticErrorZ CResult_RefundBolt12SemanticErrorZ_err(enum LDKBolt12SemanticError e);
25479 * Checks if the given object is currently in the success state
25481 bool CResult_RefundBolt12SemanticErrorZ_is_ok(const struct LDKCResult_RefundBolt12SemanticErrorZ *NONNULL_PTR o);
25484 * Frees any resources used by the CResult_RefundBolt12SemanticErrorZ.
25486 void CResult_RefundBolt12SemanticErrorZ_free(struct LDKCResult_RefundBolt12SemanticErrorZ _res);
25489 * Creates a new CResult_RefundBolt12SemanticErrorZ which has the same data as `orig`
25490 * but with all dynamically-allocated buffers duplicated in new buffers.
25492 struct LDKCResult_RefundBolt12SemanticErrorZ CResult_RefundBolt12SemanticErrorZ_clone(const struct LDKCResult_RefundBolt12SemanticErrorZ *NONNULL_PTR orig);
25495 * Constructs a new COption_u64Z containing a u64
25497 struct LDKCOption_u64Z COption_u64Z_some(uint64_t o);
25500 * Constructs a new COption_u64Z containing nothing
25502 struct LDKCOption_u64Z COption_u64Z_none(void);
25505 * Frees any resources associated with the u64, if we are in the Some state
25507 void COption_u64Z_free(struct LDKCOption_u64Z _res);
25510 * Creates a new COption_u64Z which has the same data as `orig`
25511 * but with all dynamically-allocated buffers duplicated in new buffers.
25513 struct LDKCOption_u64Z COption_u64Z_clone(const struct LDKCOption_u64Z *NONNULL_PTR orig);
25516 * Frees the buffer pointed to by `data` if `datalen` is non-0.
25518 void CVec_BlindedPathZ_free(struct LDKCVec_BlindedPathZ _res);
25521 * Creates a new CResult_RefundBolt12ParseErrorZ in the success state.
25523 struct LDKCResult_RefundBolt12ParseErrorZ CResult_RefundBolt12ParseErrorZ_ok(struct LDKRefund o);
25526 * Creates a new CResult_RefundBolt12ParseErrorZ in the error state.
25528 struct LDKCResult_RefundBolt12ParseErrorZ CResult_RefundBolt12ParseErrorZ_err(struct LDKBolt12ParseError e);
25531 * Checks if the given object is currently in the success state
25533 bool CResult_RefundBolt12ParseErrorZ_is_ok(const struct LDKCResult_RefundBolt12ParseErrorZ *NONNULL_PTR o);
25536 * Frees any resources used by the CResult_RefundBolt12ParseErrorZ.
25538 void CResult_RefundBolt12ParseErrorZ_free(struct LDKCResult_RefundBolt12ParseErrorZ _res);
25541 * Creates a new CResult_RefundBolt12ParseErrorZ which has the same data as `orig`
25542 * but with all dynamically-allocated buffers duplicated in new buffers.
25544 struct LDKCResult_RefundBolt12ParseErrorZ CResult_RefundBolt12ParseErrorZ_clone(const struct LDKCResult_RefundBolt12ParseErrorZ *NONNULL_PTR orig);
25547 * Creates a new CResult_RetryDecodeErrorZ in the success state.
25549 struct LDKCResult_RetryDecodeErrorZ CResult_RetryDecodeErrorZ_ok(struct LDKRetry o);
25552 * Creates a new CResult_RetryDecodeErrorZ in the error state.
25554 struct LDKCResult_RetryDecodeErrorZ CResult_RetryDecodeErrorZ_err(struct LDKDecodeError e);
25557 * Checks if the given object is currently in the success state
25559 bool CResult_RetryDecodeErrorZ_is_ok(const struct LDKCResult_RetryDecodeErrorZ *NONNULL_PTR o);
25562 * Frees any resources used by the CResult_RetryDecodeErrorZ.
25564 void CResult_RetryDecodeErrorZ_free(struct LDKCResult_RetryDecodeErrorZ _res);
25567 * Creates a new CResult_RetryDecodeErrorZ which has the same data as `orig`
25568 * but with all dynamically-allocated buffers duplicated in new buffers.
25570 struct LDKCResult_RetryDecodeErrorZ CResult_RetryDecodeErrorZ_clone(const struct LDKCResult_RetryDecodeErrorZ *NONNULL_PTR orig);
25573 * Creates a new CResult_NoneAPIErrorZ in the success state.
25575 struct LDKCResult_NoneAPIErrorZ CResult_NoneAPIErrorZ_ok(void);
25578 * Creates a new CResult_NoneAPIErrorZ in the error state.
25580 struct LDKCResult_NoneAPIErrorZ CResult_NoneAPIErrorZ_err(struct LDKAPIError e);
25583 * Checks if the given object is currently in the success state
25585 bool CResult_NoneAPIErrorZ_is_ok(const struct LDKCResult_NoneAPIErrorZ *NONNULL_PTR o);
25588 * Frees any resources used by the CResult_NoneAPIErrorZ.
25590 void CResult_NoneAPIErrorZ_free(struct LDKCResult_NoneAPIErrorZ _res);
25593 * Creates a new CResult_NoneAPIErrorZ which has the same data as `orig`
25594 * but with all dynamically-allocated buffers duplicated in new buffers.
25596 struct LDKCResult_NoneAPIErrorZ CResult_NoneAPIErrorZ_clone(const struct LDKCResult_NoneAPIErrorZ *NONNULL_PTR orig);
25599 * Frees the buffer pointed to by `data` if `datalen` is non-0.
25601 void CVec_CResult_NoneAPIErrorZZ_free(struct LDKCVec_CResult_NoneAPIErrorZZ _res);
25604 * Frees the buffer pointed to by `data` if `datalen` is non-0.
25606 void CVec_APIErrorZ_free(struct LDKCVec_APIErrorZ _res);
25609 * Constructs a new COption_ThirtyTwoBytesZ containing a crate::c_types::ThirtyTwoBytes
25611 struct LDKCOption_ThirtyTwoBytesZ COption_ThirtyTwoBytesZ_some(struct LDKThirtyTwoBytes o);
25614 * Constructs a new COption_ThirtyTwoBytesZ containing nothing
25616 struct LDKCOption_ThirtyTwoBytesZ COption_ThirtyTwoBytesZ_none(void);
25619 * Frees any resources associated with the crate::c_types::ThirtyTwoBytes, if we are in the Some state
25621 void COption_ThirtyTwoBytesZ_free(struct LDKCOption_ThirtyTwoBytesZ _res);
25624 * Creates a new COption_ThirtyTwoBytesZ which has the same data as `orig`
25625 * but with all dynamically-allocated buffers duplicated in new buffers.
25627 struct LDKCOption_ThirtyTwoBytesZ COption_ThirtyTwoBytesZ_clone(const struct LDKCOption_ThirtyTwoBytesZ *NONNULL_PTR orig);
25630 * Constructs a new COption_CVec_u8ZZ containing a crate::c_types::derived::CVec_u8Z
25632 struct LDKCOption_CVec_u8ZZ COption_CVec_u8ZZ_some(struct LDKCVec_u8Z o);
25635 * Constructs a new COption_CVec_u8ZZ containing nothing
25637 struct LDKCOption_CVec_u8ZZ COption_CVec_u8ZZ_none(void);
25640 * Frees any resources associated with the crate::c_types::derived::CVec_u8Z, if we are in the Some state
25642 void COption_CVec_u8ZZ_free(struct LDKCOption_CVec_u8ZZ _res);
25645 * Creates a new COption_CVec_u8ZZ which has the same data as `orig`
25646 * but with all dynamically-allocated buffers duplicated in new buffers.
25648 struct LDKCOption_CVec_u8ZZ COption_CVec_u8ZZ_clone(const struct LDKCOption_CVec_u8ZZ *NONNULL_PTR orig);
25651 * Creates a new CResult_RecipientOnionFieldsDecodeErrorZ in the success state.
25653 struct LDKCResult_RecipientOnionFieldsDecodeErrorZ CResult_RecipientOnionFieldsDecodeErrorZ_ok(struct LDKRecipientOnionFields o);
25656 * Creates a new CResult_RecipientOnionFieldsDecodeErrorZ in the error state.
25658 struct LDKCResult_RecipientOnionFieldsDecodeErrorZ CResult_RecipientOnionFieldsDecodeErrorZ_err(struct LDKDecodeError e);
25661 * Checks if the given object is currently in the success state
25663 bool CResult_RecipientOnionFieldsDecodeErrorZ_is_ok(const struct LDKCResult_RecipientOnionFieldsDecodeErrorZ *NONNULL_PTR o);
25666 * Frees any resources used by the CResult_RecipientOnionFieldsDecodeErrorZ.
25668 void CResult_RecipientOnionFieldsDecodeErrorZ_free(struct LDKCResult_RecipientOnionFieldsDecodeErrorZ _res);
25671 * Creates a new CResult_RecipientOnionFieldsDecodeErrorZ which has the same data as `orig`
25672 * but with all dynamically-allocated buffers duplicated in new buffers.
25674 struct LDKCResult_RecipientOnionFieldsDecodeErrorZ CResult_RecipientOnionFieldsDecodeErrorZ_clone(const struct LDKCResult_RecipientOnionFieldsDecodeErrorZ *NONNULL_PTR orig);
25677 * Creates a new tuple which has the same data as `orig`
25678 * but with all dynamically-allocated buffers duplicated in new buffers.
25680 struct LDKC2Tuple_u64CVec_u8ZZ C2Tuple_u64CVec_u8ZZ_clone(const struct LDKC2Tuple_u64CVec_u8ZZ *NONNULL_PTR orig);
25683 * Creates a new C2Tuple_u64CVec_u8ZZ from the contained elements.
25685 struct LDKC2Tuple_u64CVec_u8ZZ C2Tuple_u64CVec_u8ZZ_new(uint64_t a, struct LDKCVec_u8Z b);
25688 * Frees any resources used by the C2Tuple_u64CVec_u8ZZ.
25690 void C2Tuple_u64CVec_u8ZZ_free(struct LDKC2Tuple_u64CVec_u8ZZ _res);
25693 * Frees the buffer pointed to by `data` if `datalen` is non-0.
25695 void CVec_C2Tuple_u64CVec_u8ZZZ_free(struct LDKCVec_C2Tuple_u64CVec_u8ZZZ _res);
25698 * Creates a new CResult_RecipientOnionFieldsNoneZ in the success state.
25700 struct LDKCResult_RecipientOnionFieldsNoneZ CResult_RecipientOnionFieldsNoneZ_ok(struct LDKRecipientOnionFields o);
25703 * Creates a new CResult_RecipientOnionFieldsNoneZ in the error state.
25705 struct LDKCResult_RecipientOnionFieldsNoneZ CResult_RecipientOnionFieldsNoneZ_err(void);
25708 * Checks if the given object is currently in the success state
25710 bool CResult_RecipientOnionFieldsNoneZ_is_ok(const struct LDKCResult_RecipientOnionFieldsNoneZ *NONNULL_PTR o);
25713 * Frees any resources used by the CResult_RecipientOnionFieldsNoneZ.
25715 void CResult_RecipientOnionFieldsNoneZ_free(struct LDKCResult_RecipientOnionFieldsNoneZ _res);
25718 * Creates a new CResult_RecipientOnionFieldsNoneZ which has the same data as `orig`
25719 * but with all dynamically-allocated buffers duplicated in new buffers.
25721 struct LDKCResult_RecipientOnionFieldsNoneZ CResult_RecipientOnionFieldsNoneZ_clone(const struct LDKCResult_RecipientOnionFieldsNoneZ *NONNULL_PTR orig);
25724 * Creates a new CResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ in the success state.
25726 struct LDKCResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ CResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ_ok(struct LDKUnsignedBolt12Invoice o);
25729 * Creates a new CResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ in the error state.
25731 struct LDKCResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ CResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ_err(enum LDKBolt12SemanticError e);
25734 * Checks if the given object is currently in the success state
25736 bool CResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ_is_ok(const struct LDKCResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ *NONNULL_PTR o);
25739 * Frees any resources used by the CResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ.
25741 void CResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ_free(struct LDKCResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ _res);
25744 * Creates a new CResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ which has the same data as `orig`
25745 * but with all dynamically-allocated buffers duplicated in new buffers.
25747 struct LDKCResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ CResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ_clone(const struct LDKCResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ *NONNULL_PTR orig);
25750 * Creates a new CResult_Bolt12InvoiceBolt12SemanticErrorZ in the success state.
25752 struct LDKCResult_Bolt12InvoiceBolt12SemanticErrorZ CResult_Bolt12InvoiceBolt12SemanticErrorZ_ok(struct LDKBolt12Invoice o);
25755 * Creates a new CResult_Bolt12InvoiceBolt12SemanticErrorZ in the error state.
25757 struct LDKCResult_Bolt12InvoiceBolt12SemanticErrorZ CResult_Bolt12InvoiceBolt12SemanticErrorZ_err(enum LDKBolt12SemanticError e);
25760 * Checks if the given object is currently in the success state
25762 bool CResult_Bolt12InvoiceBolt12SemanticErrorZ_is_ok(const struct LDKCResult_Bolt12InvoiceBolt12SemanticErrorZ *NONNULL_PTR o);
25765 * Frees any resources used by the CResult_Bolt12InvoiceBolt12SemanticErrorZ.
25767 void CResult_Bolt12InvoiceBolt12SemanticErrorZ_free(struct LDKCResult_Bolt12InvoiceBolt12SemanticErrorZ _res);
25770 * Creates a new CResult_Bolt12InvoiceBolt12SemanticErrorZ which has the same data as `orig`
25771 * but with all dynamically-allocated buffers duplicated in new buffers.
25773 struct LDKCResult_Bolt12InvoiceBolt12SemanticErrorZ CResult_Bolt12InvoiceBolt12SemanticErrorZ_clone(const struct LDKCResult_Bolt12InvoiceBolt12SemanticErrorZ *NONNULL_PTR orig);
25776 * Creates a new CResult_SchnorrSignatureNoneZ in the success state.
25778 struct LDKCResult_SchnorrSignatureNoneZ CResult_SchnorrSignatureNoneZ_ok(struct LDKSchnorrSignature o);
25781 * Creates a new CResult_SchnorrSignatureNoneZ in the error state.
25783 struct LDKCResult_SchnorrSignatureNoneZ CResult_SchnorrSignatureNoneZ_err(void);
25786 * Checks if the given object is currently in the success state
25788 bool CResult_SchnorrSignatureNoneZ_is_ok(const struct LDKCResult_SchnorrSignatureNoneZ *NONNULL_PTR o);
25791 * Frees any resources used by the CResult_SchnorrSignatureNoneZ.
25793 void CResult_SchnorrSignatureNoneZ_free(struct LDKCResult_SchnorrSignatureNoneZ _res);
25796 * Creates a new CResult_SchnorrSignatureNoneZ which has the same data as `orig`
25797 * but with all dynamically-allocated buffers duplicated in new buffers.
25799 struct LDKCResult_SchnorrSignatureNoneZ CResult_SchnorrSignatureNoneZ_clone(const struct LDKCResult_SchnorrSignatureNoneZ *NONNULL_PTR orig);
25802 * Frees the buffer pointed to by `data` if `datalen` is non-0.
25804 void CVec_ThirtyTwoBytesZ_free(struct LDKCVec_ThirtyTwoBytesZ _res);
25807 * Constructs a new COption_CVec_ThirtyTwoBytesZZ containing a crate::c_types::derived::CVec_ThirtyTwoBytesZ
25809 struct LDKCOption_CVec_ThirtyTwoBytesZZ COption_CVec_ThirtyTwoBytesZZ_some(struct LDKCVec_ThirtyTwoBytesZ o);
25812 * Constructs a new COption_CVec_ThirtyTwoBytesZZ containing nothing
25814 struct LDKCOption_CVec_ThirtyTwoBytesZZ COption_CVec_ThirtyTwoBytesZZ_none(void);
25817 * Frees any resources associated with the crate::c_types::derived::CVec_ThirtyTwoBytesZ, if we are in the Some state
25819 void COption_CVec_ThirtyTwoBytesZZ_free(struct LDKCOption_CVec_ThirtyTwoBytesZZ _res);
25822 * Creates a new COption_CVec_ThirtyTwoBytesZZ which has the same data as `orig`
25823 * but with all dynamically-allocated buffers duplicated in new buffers.
25825 struct LDKCOption_CVec_ThirtyTwoBytesZZ COption_CVec_ThirtyTwoBytesZZ_clone(const struct LDKCOption_CVec_ThirtyTwoBytesZZ *NONNULL_PTR orig);
25828 * Constructs a new COption_AmountZ containing a crate::lightning::offers::offer::Amount
25830 struct LDKCOption_AmountZ COption_AmountZ_some(struct LDKAmount o);
25833 * Constructs a new COption_AmountZ containing nothing
25835 struct LDKCOption_AmountZ COption_AmountZ_none(void);
25838 * Frees any resources associated with the crate::lightning::offers::offer::Amount, if we are in the Some state
25840 void COption_AmountZ_free(struct LDKCOption_AmountZ _res);
25843 * Creates a new COption_AmountZ which has the same data as `orig`
25844 * but with all dynamically-allocated buffers duplicated in new buffers.
25846 struct LDKCOption_AmountZ COption_AmountZ_clone(const struct LDKCOption_AmountZ *NONNULL_PTR orig);
25849 * Constructs a new COption_QuantityZ containing a crate::lightning::offers::offer::Quantity
25851 struct LDKCOption_QuantityZ COption_QuantityZ_some(struct LDKQuantity o);
25854 * Constructs a new COption_QuantityZ containing nothing
25856 struct LDKCOption_QuantityZ COption_QuantityZ_none(void);
25859 * Frees any resources associated with the crate::lightning::offers::offer::Quantity, if we are in the Some state
25861 void COption_QuantityZ_free(struct LDKCOption_QuantityZ _res);
25864 * Creates a new COption_QuantityZ which has the same data as `orig`
25865 * but with all dynamically-allocated buffers duplicated in new buffers.
25867 struct LDKCOption_QuantityZ COption_QuantityZ_clone(const struct LDKCOption_QuantityZ *NONNULL_PTR orig);
25870 * Creates a new CResult_ThirtyTwoBytesNoneZ in the success state.
25872 struct LDKCResult_ThirtyTwoBytesNoneZ CResult_ThirtyTwoBytesNoneZ_ok(struct LDKThirtyTwoBytes o);
25875 * Creates a new CResult_ThirtyTwoBytesNoneZ in the error state.
25877 struct LDKCResult_ThirtyTwoBytesNoneZ CResult_ThirtyTwoBytesNoneZ_err(void);
25880 * Checks if the given object is currently in the success state
25882 bool CResult_ThirtyTwoBytesNoneZ_is_ok(const struct LDKCResult_ThirtyTwoBytesNoneZ *NONNULL_PTR o);
25885 * Frees any resources used by the CResult_ThirtyTwoBytesNoneZ.
25887 void CResult_ThirtyTwoBytesNoneZ_free(struct LDKCResult_ThirtyTwoBytesNoneZ _res);
25890 * Creates a new CResult_ThirtyTwoBytesNoneZ which has the same data as `orig`
25891 * but with all dynamically-allocated buffers duplicated in new buffers.
25893 struct LDKCResult_ThirtyTwoBytesNoneZ CResult_ThirtyTwoBytesNoneZ_clone(const struct LDKCResult_ThirtyTwoBytesNoneZ *NONNULL_PTR orig);
25896 * Creates a new CResult_BlindedPayInfoDecodeErrorZ in the success state.
25898 struct LDKCResult_BlindedPayInfoDecodeErrorZ CResult_BlindedPayInfoDecodeErrorZ_ok(struct LDKBlindedPayInfo o);
25901 * Creates a new CResult_BlindedPayInfoDecodeErrorZ in the error state.
25903 struct LDKCResult_BlindedPayInfoDecodeErrorZ CResult_BlindedPayInfoDecodeErrorZ_err(struct LDKDecodeError e);
25906 * Checks if the given object is currently in the success state
25908 bool CResult_BlindedPayInfoDecodeErrorZ_is_ok(const struct LDKCResult_BlindedPayInfoDecodeErrorZ *NONNULL_PTR o);
25911 * Frees any resources used by the CResult_BlindedPayInfoDecodeErrorZ.
25913 void CResult_BlindedPayInfoDecodeErrorZ_free(struct LDKCResult_BlindedPayInfoDecodeErrorZ _res);
25916 * Creates a new CResult_BlindedPayInfoDecodeErrorZ which has the same data as `orig`
25917 * but with all dynamically-allocated buffers duplicated in new buffers.
25919 struct LDKCResult_BlindedPayInfoDecodeErrorZ CResult_BlindedPayInfoDecodeErrorZ_clone(const struct LDKCResult_BlindedPayInfoDecodeErrorZ *NONNULL_PTR orig);
25922 * Creates a new CResult_DelayedPaymentOutputDescriptorDecodeErrorZ in the success state.
25924 struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_ok(struct LDKDelayedPaymentOutputDescriptor o);
25927 * Creates a new CResult_DelayedPaymentOutputDescriptorDecodeErrorZ in the error state.
25929 struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_err(struct LDKDecodeError e);
25932 * Checks if the given object is currently in the success state
25934 bool CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_is_ok(const struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ *NONNULL_PTR o);
25937 * Frees any resources used by the CResult_DelayedPaymentOutputDescriptorDecodeErrorZ.
25939 void CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_free(struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ _res);
25942 * Creates a new CResult_DelayedPaymentOutputDescriptorDecodeErrorZ which has the same data as `orig`
25943 * but with all dynamically-allocated buffers duplicated in new buffers.
25945 struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_clone(const struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ *NONNULL_PTR orig);
25948 * Creates a new CResult_StaticPaymentOutputDescriptorDecodeErrorZ in the success state.
25950 struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ CResult_StaticPaymentOutputDescriptorDecodeErrorZ_ok(struct LDKStaticPaymentOutputDescriptor o);
25953 * Creates a new CResult_StaticPaymentOutputDescriptorDecodeErrorZ in the error state.
25955 struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ CResult_StaticPaymentOutputDescriptorDecodeErrorZ_err(struct LDKDecodeError e);
25958 * Checks if the given object is currently in the success state
25960 bool CResult_StaticPaymentOutputDescriptorDecodeErrorZ_is_ok(const struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ *NONNULL_PTR o);
25963 * Frees any resources used by the CResult_StaticPaymentOutputDescriptorDecodeErrorZ.
25965 void CResult_StaticPaymentOutputDescriptorDecodeErrorZ_free(struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ _res);
25968 * Creates a new CResult_StaticPaymentOutputDescriptorDecodeErrorZ which has the same data as `orig`
25969 * but with all dynamically-allocated buffers duplicated in new buffers.
25971 struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ CResult_StaticPaymentOutputDescriptorDecodeErrorZ_clone(const struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ *NONNULL_PTR orig);
25974 * Creates a new CResult_SpendableOutputDescriptorDecodeErrorZ in the success state.
25976 struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ CResult_SpendableOutputDescriptorDecodeErrorZ_ok(struct LDKSpendableOutputDescriptor o);
25979 * Creates a new CResult_SpendableOutputDescriptorDecodeErrorZ in the error state.
25981 struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ CResult_SpendableOutputDescriptorDecodeErrorZ_err(struct LDKDecodeError e);
25984 * Checks if the given object is currently in the success state
25986 bool CResult_SpendableOutputDescriptorDecodeErrorZ_is_ok(const struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ *NONNULL_PTR o);
25989 * Frees any resources used by the CResult_SpendableOutputDescriptorDecodeErrorZ.
25991 void CResult_SpendableOutputDescriptorDecodeErrorZ_free(struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ _res);
25994 * Creates a new CResult_SpendableOutputDescriptorDecodeErrorZ which has the same data as `orig`
25995 * but with all dynamically-allocated buffers duplicated in new buffers.
25997 struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ CResult_SpendableOutputDescriptorDecodeErrorZ_clone(const struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ *NONNULL_PTR orig);
26000 * Frees the buffer pointed to by `data` if `datalen` is non-0.
26002 void CVec_SpendableOutputDescriptorZ_free(struct LDKCVec_SpendableOutputDescriptorZ _res);
26005 * Frees the buffer pointed to by `data` if `datalen` is non-0.
26007 void CVec_TxOutZ_free(struct LDKCVec_TxOutZ _res);
26010 * Constructs a new COption_u32Z containing a u32
26012 struct LDKCOption_u32Z COption_u32Z_some(uint32_t o);
26015 * Constructs a new COption_u32Z containing nothing
26017 struct LDKCOption_u32Z COption_u32Z_none(void);
26020 * Frees any resources associated with the u32, if we are in the Some state
26022 void COption_u32Z_free(struct LDKCOption_u32Z _res);
26025 * Creates a new COption_u32Z which has the same data as `orig`
26026 * but with all dynamically-allocated buffers duplicated in new buffers.
26028 struct LDKCOption_u32Z COption_u32Z_clone(const struct LDKCOption_u32Z *NONNULL_PTR orig);
26031 * Creates a new tuple which has the same data as `orig`
26032 * but with all dynamically-allocated buffers duplicated in new buffers.
26034 struct LDKC2Tuple_CVec_u8Zu64Z C2Tuple_CVec_u8Zu64Z_clone(const struct LDKC2Tuple_CVec_u8Zu64Z *NONNULL_PTR orig);
26037 * Creates a new C2Tuple_CVec_u8Zu64Z from the contained elements.
26039 struct LDKC2Tuple_CVec_u8Zu64Z C2Tuple_CVec_u8Zu64Z_new(struct LDKCVec_u8Z a, uint64_t b);
26042 * Frees any resources used by the C2Tuple_CVec_u8Zu64Z.
26044 void C2Tuple_CVec_u8Zu64Z_free(struct LDKC2Tuple_CVec_u8Zu64Z _res);
26047 * Creates a new CResult_C2Tuple_CVec_u8Zu64ZNoneZ in the success state.
26049 struct LDKCResult_C2Tuple_CVec_u8Zu64ZNoneZ CResult_C2Tuple_CVec_u8Zu64ZNoneZ_ok(struct LDKC2Tuple_CVec_u8Zu64Z o);
26052 * Creates a new CResult_C2Tuple_CVec_u8Zu64ZNoneZ in the error state.
26054 struct LDKCResult_C2Tuple_CVec_u8Zu64ZNoneZ CResult_C2Tuple_CVec_u8Zu64ZNoneZ_err(void);
26057 * Checks if the given object is currently in the success state
26059 bool CResult_C2Tuple_CVec_u8Zu64ZNoneZ_is_ok(const struct LDKCResult_C2Tuple_CVec_u8Zu64ZNoneZ *NONNULL_PTR o);
26062 * Frees any resources used by the CResult_C2Tuple_CVec_u8Zu64ZNoneZ.
26064 void CResult_C2Tuple_CVec_u8Zu64ZNoneZ_free(struct LDKCResult_C2Tuple_CVec_u8Zu64ZNoneZ _res);
26067 * Creates a new CResult_C2Tuple_CVec_u8Zu64ZNoneZ which has the same data as `orig`
26068 * but with all dynamically-allocated buffers duplicated in new buffers.
26070 struct LDKCResult_C2Tuple_CVec_u8Zu64ZNoneZ CResult_C2Tuple_CVec_u8Zu64ZNoneZ_clone(const struct LDKCResult_C2Tuple_CVec_u8Zu64ZNoneZ *NONNULL_PTR orig);
26073 * Creates a new CResult_ChannelDerivationParametersDecodeErrorZ in the success state.
26075 struct LDKCResult_ChannelDerivationParametersDecodeErrorZ CResult_ChannelDerivationParametersDecodeErrorZ_ok(struct LDKChannelDerivationParameters o);
26078 * Creates a new CResult_ChannelDerivationParametersDecodeErrorZ in the error state.
26080 struct LDKCResult_ChannelDerivationParametersDecodeErrorZ CResult_ChannelDerivationParametersDecodeErrorZ_err(struct LDKDecodeError e);
26083 * Checks if the given object is currently in the success state
26085 bool CResult_ChannelDerivationParametersDecodeErrorZ_is_ok(const struct LDKCResult_ChannelDerivationParametersDecodeErrorZ *NONNULL_PTR o);
26088 * Frees any resources used by the CResult_ChannelDerivationParametersDecodeErrorZ.
26090 void CResult_ChannelDerivationParametersDecodeErrorZ_free(struct LDKCResult_ChannelDerivationParametersDecodeErrorZ _res);
26093 * Creates a new CResult_ChannelDerivationParametersDecodeErrorZ which has the same data as `orig`
26094 * but with all dynamically-allocated buffers duplicated in new buffers.
26096 struct LDKCResult_ChannelDerivationParametersDecodeErrorZ CResult_ChannelDerivationParametersDecodeErrorZ_clone(const struct LDKCResult_ChannelDerivationParametersDecodeErrorZ *NONNULL_PTR orig);
26099 * Creates a new CResult_HTLCDescriptorDecodeErrorZ in the success state.
26101 struct LDKCResult_HTLCDescriptorDecodeErrorZ CResult_HTLCDescriptorDecodeErrorZ_ok(struct LDKHTLCDescriptor o);
26104 * Creates a new CResult_HTLCDescriptorDecodeErrorZ in the error state.
26106 struct LDKCResult_HTLCDescriptorDecodeErrorZ CResult_HTLCDescriptorDecodeErrorZ_err(struct LDKDecodeError e);
26109 * Checks if the given object is currently in the success state
26111 bool CResult_HTLCDescriptorDecodeErrorZ_is_ok(const struct LDKCResult_HTLCDescriptorDecodeErrorZ *NONNULL_PTR o);
26114 * Frees any resources used by the CResult_HTLCDescriptorDecodeErrorZ.
26116 void CResult_HTLCDescriptorDecodeErrorZ_free(struct LDKCResult_HTLCDescriptorDecodeErrorZ _res);
26119 * Creates a new CResult_HTLCDescriptorDecodeErrorZ which has the same data as `orig`
26120 * but with all dynamically-allocated buffers duplicated in new buffers.
26122 struct LDKCResult_HTLCDescriptorDecodeErrorZ CResult_HTLCDescriptorDecodeErrorZ_clone(const struct LDKCResult_HTLCDescriptorDecodeErrorZ *NONNULL_PTR orig);
26125 * Creates a new CResult_NoneNoneZ in the success state.
26127 struct LDKCResult_NoneNoneZ CResult_NoneNoneZ_ok(void);
26130 * Creates a new CResult_NoneNoneZ in the error state.
26132 struct LDKCResult_NoneNoneZ CResult_NoneNoneZ_err(void);
26135 * Checks if the given object is currently in the success state
26137 bool CResult_NoneNoneZ_is_ok(const struct LDKCResult_NoneNoneZ *NONNULL_PTR o);
26140 * Frees any resources used by the CResult_NoneNoneZ.
26142 void CResult_NoneNoneZ_free(struct LDKCResult_NoneNoneZ _res);
26145 * Creates a new CResult_NoneNoneZ which has the same data as `orig`
26146 * but with all dynamically-allocated buffers duplicated in new buffers.
26148 struct LDKCResult_NoneNoneZ CResult_NoneNoneZ_clone(const struct LDKCResult_NoneNoneZ *NONNULL_PTR orig);
26151 * Creates a new CResult_PublicKeyNoneZ in the success state.
26153 struct LDKCResult_PublicKeyNoneZ CResult_PublicKeyNoneZ_ok(struct LDKPublicKey o);
26156 * Creates a new CResult_PublicKeyNoneZ in the error state.
26158 struct LDKCResult_PublicKeyNoneZ CResult_PublicKeyNoneZ_err(void);
26161 * Checks if the given object is currently in the success state
26163 bool CResult_PublicKeyNoneZ_is_ok(const struct LDKCResult_PublicKeyNoneZ *NONNULL_PTR o);
26166 * Frees any resources used by the CResult_PublicKeyNoneZ.
26168 void CResult_PublicKeyNoneZ_free(struct LDKCResult_PublicKeyNoneZ _res);
26171 * Creates a new CResult_PublicKeyNoneZ which has the same data as `orig`
26172 * but with all dynamically-allocated buffers duplicated in new buffers.
26174 struct LDKCResult_PublicKeyNoneZ CResult_PublicKeyNoneZ_clone(const struct LDKCResult_PublicKeyNoneZ *NONNULL_PTR orig);
26177 * Constructs a new COption_BigEndianScalarZ containing a crate::c_types::BigEndianScalar
26179 struct LDKCOption_BigEndianScalarZ COption_BigEndianScalarZ_some(struct LDKBigEndianScalar o);
26182 * Constructs a new COption_BigEndianScalarZ containing nothing
26184 struct LDKCOption_BigEndianScalarZ COption_BigEndianScalarZ_none(void);
26187 * Frees any resources associated with the crate::c_types::BigEndianScalar, if we are in the Some state
26189 void COption_BigEndianScalarZ_free(struct LDKCOption_BigEndianScalarZ _res);
26192 * Creates a new COption_BigEndianScalarZ which has the same data as `orig`
26193 * but with all dynamically-allocated buffers duplicated in new buffers.
26195 struct LDKCOption_BigEndianScalarZ COption_BigEndianScalarZ_clone(const struct LDKCOption_BigEndianScalarZ *NONNULL_PTR orig);
26198 * Frees the buffer pointed to by `data` if `datalen` is non-0.
26200 void CVec_U5Z_free(struct LDKCVec_U5Z _res);
26203 * Creates a new CResult_RecoverableSignatureNoneZ in the success state.
26205 struct LDKCResult_RecoverableSignatureNoneZ CResult_RecoverableSignatureNoneZ_ok(struct LDKRecoverableSignature o);
26208 * Creates a new CResult_RecoverableSignatureNoneZ in the error state.
26210 struct LDKCResult_RecoverableSignatureNoneZ CResult_RecoverableSignatureNoneZ_err(void);
26213 * Checks if the given object is currently in the success state
26215 bool CResult_RecoverableSignatureNoneZ_is_ok(const struct LDKCResult_RecoverableSignatureNoneZ *NONNULL_PTR o);
26218 * Frees any resources used by the CResult_RecoverableSignatureNoneZ.
26220 void CResult_RecoverableSignatureNoneZ_free(struct LDKCResult_RecoverableSignatureNoneZ _res);
26223 * Creates a new CResult_RecoverableSignatureNoneZ which has the same data as `orig`
26224 * but with all dynamically-allocated buffers duplicated in new buffers.
26226 struct LDKCResult_RecoverableSignatureNoneZ CResult_RecoverableSignatureNoneZ_clone(const struct LDKCResult_RecoverableSignatureNoneZ *NONNULL_PTR orig);
26229 * Creates a new CResult_ECDSASignatureNoneZ in the success state.
26231 struct LDKCResult_ECDSASignatureNoneZ CResult_ECDSASignatureNoneZ_ok(struct LDKECDSASignature o);
26234 * Creates a new CResult_ECDSASignatureNoneZ in the error state.
26236 struct LDKCResult_ECDSASignatureNoneZ CResult_ECDSASignatureNoneZ_err(void);
26239 * Checks if the given object is currently in the success state
26241 bool CResult_ECDSASignatureNoneZ_is_ok(const struct LDKCResult_ECDSASignatureNoneZ *NONNULL_PTR o);
26244 * Frees any resources used by the CResult_ECDSASignatureNoneZ.
26246 void CResult_ECDSASignatureNoneZ_free(struct LDKCResult_ECDSASignatureNoneZ _res);
26249 * Creates a new CResult_ECDSASignatureNoneZ which has the same data as `orig`
26250 * but with all dynamically-allocated buffers duplicated in new buffers.
26252 struct LDKCResult_ECDSASignatureNoneZ CResult_ECDSASignatureNoneZ_clone(const struct LDKCResult_ECDSASignatureNoneZ *NONNULL_PTR orig);
26255 * Creates a new CResult_TransactionNoneZ in the success state.
26257 struct LDKCResult_TransactionNoneZ CResult_TransactionNoneZ_ok(struct LDKTransaction o);
26260 * Creates a new CResult_TransactionNoneZ in the error state.
26262 struct LDKCResult_TransactionNoneZ CResult_TransactionNoneZ_err(void);
26265 * Checks if the given object is currently in the success state
26267 bool CResult_TransactionNoneZ_is_ok(const struct LDKCResult_TransactionNoneZ *NONNULL_PTR o);
26270 * Frees any resources used by the CResult_TransactionNoneZ.
26272 void CResult_TransactionNoneZ_free(struct LDKCResult_TransactionNoneZ _res);
26275 * Creates a new CResult_TransactionNoneZ which has the same data as `orig`
26276 * but with all dynamically-allocated buffers duplicated in new buffers.
26278 struct LDKCResult_TransactionNoneZ CResult_TransactionNoneZ_clone(const struct LDKCResult_TransactionNoneZ *NONNULL_PTR orig);
26281 * Creates a new CResult_WriteableEcdsaChannelSignerDecodeErrorZ in the success state.
26283 struct LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ CResult_WriteableEcdsaChannelSignerDecodeErrorZ_ok(struct LDKWriteableEcdsaChannelSigner o);
26286 * Creates a new CResult_WriteableEcdsaChannelSignerDecodeErrorZ in the error state.
26288 struct LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ CResult_WriteableEcdsaChannelSignerDecodeErrorZ_err(struct LDKDecodeError e);
26291 * Checks if the given object is currently in the success state
26293 bool CResult_WriteableEcdsaChannelSignerDecodeErrorZ_is_ok(const struct LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ *NONNULL_PTR o);
26296 * Frees any resources used by the CResult_WriteableEcdsaChannelSignerDecodeErrorZ.
26298 void CResult_WriteableEcdsaChannelSignerDecodeErrorZ_free(struct LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ _res);
26301 * Creates a new CResult_WriteableEcdsaChannelSignerDecodeErrorZ which has the same data as `orig`
26302 * but with all dynamically-allocated buffers duplicated in new buffers.
26304 struct LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ CResult_WriteableEcdsaChannelSignerDecodeErrorZ_clone(const struct LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ *NONNULL_PTR orig);
26307 * Creates a new CResult_CVec_u8ZNoneZ in the success state.
26309 struct LDKCResult_CVec_u8ZNoneZ CResult_CVec_u8ZNoneZ_ok(struct LDKCVec_u8Z o);
26312 * Creates a new CResult_CVec_u8ZNoneZ in the error state.
26314 struct LDKCResult_CVec_u8ZNoneZ CResult_CVec_u8ZNoneZ_err(void);
26317 * Checks if the given object is currently in the success state
26319 bool CResult_CVec_u8ZNoneZ_is_ok(const struct LDKCResult_CVec_u8ZNoneZ *NONNULL_PTR o);
26322 * Frees any resources used by the CResult_CVec_u8ZNoneZ.
26324 void CResult_CVec_u8ZNoneZ_free(struct LDKCResult_CVec_u8ZNoneZ _res);
26327 * Creates a new CResult_CVec_u8ZNoneZ which has the same data as `orig`
26328 * but with all dynamically-allocated buffers duplicated in new buffers.
26330 struct LDKCResult_CVec_u8ZNoneZ CResult_CVec_u8ZNoneZ_clone(const struct LDKCResult_CVec_u8ZNoneZ *NONNULL_PTR orig);
26333 * Creates a new CResult_ShutdownScriptNoneZ in the success state.
26335 struct LDKCResult_ShutdownScriptNoneZ CResult_ShutdownScriptNoneZ_ok(struct LDKShutdownScript o);
26338 * Creates a new CResult_ShutdownScriptNoneZ in the error state.
26340 struct LDKCResult_ShutdownScriptNoneZ CResult_ShutdownScriptNoneZ_err(void);
26343 * Checks if the given object is currently in the success state
26345 bool CResult_ShutdownScriptNoneZ_is_ok(const struct LDKCResult_ShutdownScriptNoneZ *NONNULL_PTR o);
26348 * Frees any resources used by the CResult_ShutdownScriptNoneZ.
26350 void CResult_ShutdownScriptNoneZ_free(struct LDKCResult_ShutdownScriptNoneZ _res);
26353 * Creates a new CResult_ShutdownScriptNoneZ which has the same data as `orig`
26354 * but with all dynamically-allocated buffers duplicated in new buffers.
26356 struct LDKCResult_ShutdownScriptNoneZ CResult_ShutdownScriptNoneZ_clone(const struct LDKCResult_ShutdownScriptNoneZ *NONNULL_PTR orig);
26359 * Constructs a new COption_u16Z containing a u16
26361 struct LDKCOption_u16Z COption_u16Z_some(uint16_t o);
26364 * Constructs a new COption_u16Z containing nothing
26366 struct LDKCOption_u16Z COption_u16Z_none(void);
26369 * Frees any resources associated with the u16, if we are in the Some state
26371 void COption_u16Z_free(struct LDKCOption_u16Z _res);
26374 * Creates a new COption_u16Z which has the same data as `orig`
26375 * but with all dynamically-allocated buffers duplicated in new buffers.
26377 struct LDKCOption_u16Z COption_u16Z_clone(const struct LDKCOption_u16Z *NONNULL_PTR orig);
26380 * Constructs a new COption_boolZ containing a bool
26382 struct LDKCOption_boolZ COption_boolZ_some(bool o);
26385 * Constructs a new COption_boolZ containing nothing
26387 struct LDKCOption_boolZ COption_boolZ_none(void);
26390 * Frees any resources associated with the bool, if we are in the Some state
26392 void COption_boolZ_free(struct LDKCOption_boolZ _res);
26395 * Creates a new COption_boolZ which has the same data as `orig`
26396 * but with all dynamically-allocated buffers duplicated in new buffers.
26398 struct LDKCOption_boolZ COption_boolZ_clone(const struct LDKCOption_boolZ *NONNULL_PTR orig);
26401 * Creates a new CResult_WitnessNoneZ in the success state.
26403 struct LDKCResult_WitnessNoneZ CResult_WitnessNoneZ_ok(struct LDKWitness o);
26406 * Creates a new CResult_WitnessNoneZ in the error state.
26408 struct LDKCResult_WitnessNoneZ CResult_WitnessNoneZ_err(void);
26411 * Checks if the given object is currently in the success state
26413 bool CResult_WitnessNoneZ_is_ok(const struct LDKCResult_WitnessNoneZ *NONNULL_PTR o);
26416 * Frees any resources used by the CResult_WitnessNoneZ.
26418 void CResult_WitnessNoneZ_free(struct LDKCResult_WitnessNoneZ _res);
26421 * Creates a new CResult_WitnessNoneZ which has the same data as `orig`
26422 * but with all dynamically-allocated buffers duplicated in new buffers.
26424 struct LDKCResult_WitnessNoneZ CResult_WitnessNoneZ_clone(const struct LDKCResult_WitnessNoneZ *NONNULL_PTR orig);
26427 * Frees the buffer pointed to by `data` if `datalen` is non-0.
26429 void CVec_ECDSASignatureZ_free(struct LDKCVec_ECDSASignatureZ _res);
26432 * Creates a new tuple which has the same data as `orig`
26433 * but with all dynamically-allocated buffers duplicated in new buffers.
26435 struct LDKC2Tuple_ECDSASignatureCVec_ECDSASignatureZZ C2Tuple_ECDSASignatureCVec_ECDSASignatureZZ_clone(const struct LDKC2Tuple_ECDSASignatureCVec_ECDSASignatureZZ *NONNULL_PTR orig);
26438 * Creates a new C2Tuple_ECDSASignatureCVec_ECDSASignatureZZ from the contained elements.
26440 struct LDKC2Tuple_ECDSASignatureCVec_ECDSASignatureZZ C2Tuple_ECDSASignatureCVec_ECDSASignatureZZ_new(struct LDKECDSASignature a, struct LDKCVec_ECDSASignatureZ b);
26443 * Frees any resources used by the C2Tuple_ECDSASignatureCVec_ECDSASignatureZZ.
26445 void C2Tuple_ECDSASignatureCVec_ECDSASignatureZZ_free(struct LDKC2Tuple_ECDSASignatureCVec_ECDSASignatureZZ _res);
26448 * Creates a new CResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ in the success state.
26450 struct LDKCResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ CResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ_ok(struct LDKC2Tuple_ECDSASignatureCVec_ECDSASignatureZZ o);
26453 * Creates a new CResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ in the error state.
26455 struct LDKCResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ CResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ_err(void);
26458 * Checks if the given object is currently in the success state
26460 bool CResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ_is_ok(const struct LDKCResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ *NONNULL_PTR o);
26463 * Frees any resources used by the CResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ.
26465 void CResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ_free(struct LDKCResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ _res);
26468 * Creates a new CResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ which has the same data as `orig`
26469 * but with all dynamically-allocated buffers duplicated in new buffers.
26471 struct LDKCResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ CResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ_clone(const struct LDKCResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ *NONNULL_PTR orig);
26474 * Creates a new CResult_InMemorySignerDecodeErrorZ in the success state.
26476 struct LDKCResult_InMemorySignerDecodeErrorZ CResult_InMemorySignerDecodeErrorZ_ok(struct LDKInMemorySigner o);
26479 * Creates a new CResult_InMemorySignerDecodeErrorZ in the error state.
26481 struct LDKCResult_InMemorySignerDecodeErrorZ CResult_InMemorySignerDecodeErrorZ_err(struct LDKDecodeError e);
26484 * Checks if the given object is currently in the success state
26486 bool CResult_InMemorySignerDecodeErrorZ_is_ok(const struct LDKCResult_InMemorySignerDecodeErrorZ *NONNULL_PTR o);
26489 * Frees any resources used by the CResult_InMemorySignerDecodeErrorZ.
26491 void CResult_InMemorySignerDecodeErrorZ_free(struct LDKCResult_InMemorySignerDecodeErrorZ _res);
26494 * Creates a new CResult_InMemorySignerDecodeErrorZ which has the same data as `orig`
26495 * but with all dynamically-allocated buffers duplicated in new buffers.
26497 struct LDKCResult_InMemorySignerDecodeErrorZ CResult_InMemorySignerDecodeErrorZ_clone(const struct LDKCResult_InMemorySignerDecodeErrorZ *NONNULL_PTR orig);
26500 * Constructs a new COption_WriteableScoreZ containing a crate::lightning::routing::scoring::WriteableScore
26502 struct LDKCOption_WriteableScoreZ COption_WriteableScoreZ_some(struct LDKWriteableScore o);
26505 * Constructs a new COption_WriteableScoreZ containing nothing
26507 struct LDKCOption_WriteableScoreZ COption_WriteableScoreZ_none(void);
26510 * Frees any resources associated with the crate::lightning::routing::scoring::WriteableScore, if we are in the Some state
26512 void COption_WriteableScoreZ_free(struct LDKCOption_WriteableScoreZ _res);
26515 * Creates a new CResult_NoneIOErrorZ in the success state.
26517 struct LDKCResult_NoneIOErrorZ CResult_NoneIOErrorZ_ok(void);
26520 * Creates a new CResult_NoneIOErrorZ in the error state.
26522 struct LDKCResult_NoneIOErrorZ CResult_NoneIOErrorZ_err(enum LDKIOError e);
26525 * Checks if the given object is currently in the success state
26527 bool CResult_NoneIOErrorZ_is_ok(const struct LDKCResult_NoneIOErrorZ *NONNULL_PTR o);
26530 * Frees any resources used by the CResult_NoneIOErrorZ.
26532 void CResult_NoneIOErrorZ_free(struct LDKCResult_NoneIOErrorZ _res);
26535 * Creates a new CResult_NoneIOErrorZ which has the same data as `orig`
26536 * but with all dynamically-allocated buffers duplicated in new buffers.
26538 struct LDKCResult_NoneIOErrorZ CResult_NoneIOErrorZ_clone(const struct LDKCResult_NoneIOErrorZ *NONNULL_PTR orig);
26541 * Frees the buffer pointed to by `data` if `datalen` is non-0.
26543 void CVec_ChannelDetailsZ_free(struct LDKCVec_ChannelDetailsZ _res);
26546 * Creates a new CResult_RouteLightningErrorZ in the success state.
26548 struct LDKCResult_RouteLightningErrorZ CResult_RouteLightningErrorZ_ok(struct LDKRoute o);
26551 * Creates a new CResult_RouteLightningErrorZ in the error state.
26553 struct LDKCResult_RouteLightningErrorZ CResult_RouteLightningErrorZ_err(struct LDKLightningError e);
26556 * Checks if the given object is currently in the success state
26558 bool CResult_RouteLightningErrorZ_is_ok(const struct LDKCResult_RouteLightningErrorZ *NONNULL_PTR o);
26561 * Frees any resources used by the CResult_RouteLightningErrorZ.
26563 void CResult_RouteLightningErrorZ_free(struct LDKCResult_RouteLightningErrorZ _res);
26566 * Creates a new CResult_RouteLightningErrorZ which has the same data as `orig`
26567 * but with all dynamically-allocated buffers duplicated in new buffers.
26569 struct LDKCResult_RouteLightningErrorZ CResult_RouteLightningErrorZ_clone(const struct LDKCResult_RouteLightningErrorZ *NONNULL_PTR orig);
26572 * Creates a new tuple which has the same data as `orig`
26573 * but with all dynamically-allocated buffers duplicated in new buffers.
26575 struct LDKC2Tuple_BlindedPayInfoBlindedPathZ C2Tuple_BlindedPayInfoBlindedPathZ_clone(const struct LDKC2Tuple_BlindedPayInfoBlindedPathZ *NONNULL_PTR orig);
26578 * Creates a new C2Tuple_BlindedPayInfoBlindedPathZ from the contained elements.
26580 struct LDKC2Tuple_BlindedPayInfoBlindedPathZ C2Tuple_BlindedPayInfoBlindedPathZ_new(struct LDKBlindedPayInfo a, struct LDKBlindedPath b);
26583 * Frees any resources used by the C2Tuple_BlindedPayInfoBlindedPathZ.
26585 void C2Tuple_BlindedPayInfoBlindedPathZ_free(struct LDKC2Tuple_BlindedPayInfoBlindedPathZ _res);
26588 * Frees the buffer pointed to by `data` if `datalen` is non-0.
26590 void CVec_C2Tuple_BlindedPayInfoBlindedPathZZ_free(struct LDKCVec_C2Tuple_BlindedPayInfoBlindedPathZZ _res);
26593 * Creates a new CResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ in the success state.
26595 struct LDKCResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ CResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ_ok(struct LDKCVec_C2Tuple_BlindedPayInfoBlindedPathZZ o);
26598 * Creates a new CResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ in the error state.
26600 struct LDKCResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ CResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ_err(void);
26603 * Checks if the given object is currently in the success state
26605 bool CResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ_is_ok(const struct LDKCResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ *NONNULL_PTR o);
26608 * Frees any resources used by the CResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ.
26610 void CResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ_free(struct LDKCResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ _res);
26613 * Creates a new CResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ which has the same data as `orig`
26614 * but with all dynamically-allocated buffers duplicated in new buffers.
26616 struct LDKCResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ CResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ_clone(const struct LDKCResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ *NONNULL_PTR orig);
26619 * Frees the buffer pointed to by `data` if `datalen` is non-0.
26621 void CVec_PublicKeyZ_free(struct LDKCVec_PublicKeyZ _res);
26624 * Creates a new CResult_OnionMessagePathNoneZ in the success state.
26626 struct LDKCResult_OnionMessagePathNoneZ CResult_OnionMessagePathNoneZ_ok(struct LDKOnionMessagePath o);
26629 * Creates a new CResult_OnionMessagePathNoneZ in the error state.
26631 struct LDKCResult_OnionMessagePathNoneZ CResult_OnionMessagePathNoneZ_err(void);
26634 * Checks if the given object is currently in the success state
26636 bool CResult_OnionMessagePathNoneZ_is_ok(const struct LDKCResult_OnionMessagePathNoneZ *NONNULL_PTR o);
26639 * Frees any resources used by the CResult_OnionMessagePathNoneZ.
26641 void CResult_OnionMessagePathNoneZ_free(struct LDKCResult_OnionMessagePathNoneZ _res);
26644 * Creates a new CResult_OnionMessagePathNoneZ which has the same data as `orig`
26645 * but with all dynamically-allocated buffers duplicated in new buffers.
26647 struct LDKCResult_OnionMessagePathNoneZ CResult_OnionMessagePathNoneZ_clone(const struct LDKCResult_OnionMessagePathNoneZ *NONNULL_PTR orig);
26650 * Creates a new CResult_CVec_BlindedPathZNoneZ in the success state.
26652 struct LDKCResult_CVec_BlindedPathZNoneZ CResult_CVec_BlindedPathZNoneZ_ok(struct LDKCVec_BlindedPathZ o);
26655 * Creates a new CResult_CVec_BlindedPathZNoneZ in the error state.
26657 struct LDKCResult_CVec_BlindedPathZNoneZ CResult_CVec_BlindedPathZNoneZ_err(void);
26660 * Checks if the given object is currently in the success state
26662 bool CResult_CVec_BlindedPathZNoneZ_is_ok(const struct LDKCResult_CVec_BlindedPathZNoneZ *NONNULL_PTR o);
26665 * Frees any resources used by the CResult_CVec_BlindedPathZNoneZ.
26667 void CResult_CVec_BlindedPathZNoneZ_free(struct LDKCResult_CVec_BlindedPathZNoneZ _res);
26670 * Creates a new CResult_CVec_BlindedPathZNoneZ which has the same data as `orig`
26671 * but with all dynamically-allocated buffers duplicated in new buffers.
26673 struct LDKCResult_CVec_BlindedPathZNoneZ CResult_CVec_BlindedPathZNoneZ_clone(const struct LDKCResult_CVec_BlindedPathZNoneZ *NONNULL_PTR orig);
26676 * Creates a new CResult_InFlightHtlcsDecodeErrorZ in the success state.
26678 struct LDKCResult_InFlightHtlcsDecodeErrorZ CResult_InFlightHtlcsDecodeErrorZ_ok(struct LDKInFlightHtlcs o);
26681 * Creates a new CResult_InFlightHtlcsDecodeErrorZ in the error state.
26683 struct LDKCResult_InFlightHtlcsDecodeErrorZ CResult_InFlightHtlcsDecodeErrorZ_err(struct LDKDecodeError e);
26686 * Checks if the given object is currently in the success state
26688 bool CResult_InFlightHtlcsDecodeErrorZ_is_ok(const struct LDKCResult_InFlightHtlcsDecodeErrorZ *NONNULL_PTR o);
26691 * Frees any resources used by the CResult_InFlightHtlcsDecodeErrorZ.
26693 void CResult_InFlightHtlcsDecodeErrorZ_free(struct LDKCResult_InFlightHtlcsDecodeErrorZ _res);
26696 * Creates a new CResult_InFlightHtlcsDecodeErrorZ which has the same data as `orig`
26697 * but with all dynamically-allocated buffers duplicated in new buffers.
26699 struct LDKCResult_InFlightHtlcsDecodeErrorZ CResult_InFlightHtlcsDecodeErrorZ_clone(const struct LDKCResult_InFlightHtlcsDecodeErrorZ *NONNULL_PTR orig);
26702 * Creates a new CResult_RouteHopDecodeErrorZ in the success state.
26704 struct LDKCResult_RouteHopDecodeErrorZ CResult_RouteHopDecodeErrorZ_ok(struct LDKRouteHop o);
26707 * Creates a new CResult_RouteHopDecodeErrorZ in the error state.
26709 struct LDKCResult_RouteHopDecodeErrorZ CResult_RouteHopDecodeErrorZ_err(struct LDKDecodeError e);
26712 * Checks if the given object is currently in the success state
26714 bool CResult_RouteHopDecodeErrorZ_is_ok(const struct LDKCResult_RouteHopDecodeErrorZ *NONNULL_PTR o);
26717 * Frees any resources used by the CResult_RouteHopDecodeErrorZ.
26719 void CResult_RouteHopDecodeErrorZ_free(struct LDKCResult_RouteHopDecodeErrorZ _res);
26722 * Creates a new CResult_RouteHopDecodeErrorZ which has the same data as `orig`
26723 * but with all dynamically-allocated buffers duplicated in new buffers.
26725 struct LDKCResult_RouteHopDecodeErrorZ CResult_RouteHopDecodeErrorZ_clone(const struct LDKCResult_RouteHopDecodeErrorZ *NONNULL_PTR orig);
26728 * Frees the buffer pointed to by `data` if `datalen` is non-0.
26730 void CVec_BlindedHopZ_free(struct LDKCVec_BlindedHopZ _res);
26733 * Creates a new CResult_BlindedTailDecodeErrorZ in the success state.
26735 struct LDKCResult_BlindedTailDecodeErrorZ CResult_BlindedTailDecodeErrorZ_ok(struct LDKBlindedTail o);
26738 * Creates a new CResult_BlindedTailDecodeErrorZ in the error state.
26740 struct LDKCResult_BlindedTailDecodeErrorZ CResult_BlindedTailDecodeErrorZ_err(struct LDKDecodeError e);
26743 * Checks if the given object is currently in the success state
26745 bool CResult_BlindedTailDecodeErrorZ_is_ok(const struct LDKCResult_BlindedTailDecodeErrorZ *NONNULL_PTR o);
26748 * Frees any resources used by the CResult_BlindedTailDecodeErrorZ.
26750 void CResult_BlindedTailDecodeErrorZ_free(struct LDKCResult_BlindedTailDecodeErrorZ _res);
26753 * Creates a new CResult_BlindedTailDecodeErrorZ which has the same data as `orig`
26754 * but with all dynamically-allocated buffers duplicated in new buffers.
26756 struct LDKCResult_BlindedTailDecodeErrorZ CResult_BlindedTailDecodeErrorZ_clone(const struct LDKCResult_BlindedTailDecodeErrorZ *NONNULL_PTR orig);
26759 * Frees the buffer pointed to by `data` if `datalen` is non-0.
26761 void CVec_RouteHopZ_free(struct LDKCVec_RouteHopZ _res);
26764 * Frees the buffer pointed to by `data` if `datalen` is non-0.
26766 void CVec_PathZ_free(struct LDKCVec_PathZ _res);
26769 * Creates a new CResult_RouteDecodeErrorZ in the success state.
26771 struct LDKCResult_RouteDecodeErrorZ CResult_RouteDecodeErrorZ_ok(struct LDKRoute o);
26774 * Creates a new CResult_RouteDecodeErrorZ in the error state.
26776 struct LDKCResult_RouteDecodeErrorZ CResult_RouteDecodeErrorZ_err(struct LDKDecodeError e);
26779 * Checks if the given object is currently in the success state
26781 bool CResult_RouteDecodeErrorZ_is_ok(const struct LDKCResult_RouteDecodeErrorZ *NONNULL_PTR o);
26784 * Frees any resources used by the CResult_RouteDecodeErrorZ.
26786 void CResult_RouteDecodeErrorZ_free(struct LDKCResult_RouteDecodeErrorZ _res);
26789 * Creates a new CResult_RouteDecodeErrorZ which has the same data as `orig`
26790 * but with all dynamically-allocated buffers duplicated in new buffers.
26792 struct LDKCResult_RouteDecodeErrorZ CResult_RouteDecodeErrorZ_clone(const struct LDKCResult_RouteDecodeErrorZ *NONNULL_PTR orig);
26795 * Creates a new CResult_RouteParametersDecodeErrorZ in the success state.
26797 struct LDKCResult_RouteParametersDecodeErrorZ CResult_RouteParametersDecodeErrorZ_ok(struct LDKRouteParameters o);
26800 * Creates a new CResult_RouteParametersDecodeErrorZ in the error state.
26802 struct LDKCResult_RouteParametersDecodeErrorZ CResult_RouteParametersDecodeErrorZ_err(struct LDKDecodeError e);
26805 * Checks if the given object is currently in the success state
26807 bool CResult_RouteParametersDecodeErrorZ_is_ok(const struct LDKCResult_RouteParametersDecodeErrorZ *NONNULL_PTR o);
26810 * Frees any resources used by the CResult_RouteParametersDecodeErrorZ.
26812 void CResult_RouteParametersDecodeErrorZ_free(struct LDKCResult_RouteParametersDecodeErrorZ _res);
26815 * Creates a new CResult_RouteParametersDecodeErrorZ which has the same data as `orig`
26816 * but with all dynamically-allocated buffers duplicated in new buffers.
26818 struct LDKCResult_RouteParametersDecodeErrorZ CResult_RouteParametersDecodeErrorZ_clone(const struct LDKCResult_RouteParametersDecodeErrorZ *NONNULL_PTR orig);
26821 * Frees the buffer pointed to by `data` if `datalen` is non-0.
26823 void CVec_u64Z_free(struct LDKCVec_u64Z _res);
26826 * Creates a new CResult_PaymentParametersDecodeErrorZ in the success state.
26828 struct LDKCResult_PaymentParametersDecodeErrorZ CResult_PaymentParametersDecodeErrorZ_ok(struct LDKPaymentParameters o);
26831 * Creates a new CResult_PaymentParametersDecodeErrorZ in the error state.
26833 struct LDKCResult_PaymentParametersDecodeErrorZ CResult_PaymentParametersDecodeErrorZ_err(struct LDKDecodeError e);
26836 * Checks if the given object is currently in the success state
26838 bool CResult_PaymentParametersDecodeErrorZ_is_ok(const struct LDKCResult_PaymentParametersDecodeErrorZ *NONNULL_PTR o);
26841 * Frees any resources used by the CResult_PaymentParametersDecodeErrorZ.
26843 void CResult_PaymentParametersDecodeErrorZ_free(struct LDKCResult_PaymentParametersDecodeErrorZ _res);
26846 * Creates a new CResult_PaymentParametersDecodeErrorZ which has the same data as `orig`
26847 * but with all dynamically-allocated buffers duplicated in new buffers.
26849 struct LDKCResult_PaymentParametersDecodeErrorZ CResult_PaymentParametersDecodeErrorZ_clone(const struct LDKCResult_PaymentParametersDecodeErrorZ *NONNULL_PTR orig);
26852 * Frees the buffer pointed to by `data` if `datalen` is non-0.
26854 void CVec_RouteHintZ_free(struct LDKCVec_RouteHintZ _res);
26857 * Frees the buffer pointed to by `data` if `datalen` is non-0.
26859 void CVec_RouteHintHopZ_free(struct LDKCVec_RouteHintHopZ _res);
26862 * Creates a new CResult_RouteHintDecodeErrorZ in the success state.
26864 struct LDKCResult_RouteHintDecodeErrorZ CResult_RouteHintDecodeErrorZ_ok(struct LDKRouteHint o);
26867 * Creates a new CResult_RouteHintDecodeErrorZ in the error state.
26869 struct LDKCResult_RouteHintDecodeErrorZ CResult_RouteHintDecodeErrorZ_err(struct LDKDecodeError e);
26872 * Checks if the given object is currently in the success state
26874 bool CResult_RouteHintDecodeErrorZ_is_ok(const struct LDKCResult_RouteHintDecodeErrorZ *NONNULL_PTR o);
26877 * Frees any resources used by the CResult_RouteHintDecodeErrorZ.
26879 void CResult_RouteHintDecodeErrorZ_free(struct LDKCResult_RouteHintDecodeErrorZ _res);
26882 * Creates a new CResult_RouteHintDecodeErrorZ which has the same data as `orig`
26883 * but with all dynamically-allocated buffers duplicated in new buffers.
26885 struct LDKCResult_RouteHintDecodeErrorZ CResult_RouteHintDecodeErrorZ_clone(const struct LDKCResult_RouteHintDecodeErrorZ *NONNULL_PTR orig);
26888 * Creates a new CResult_RouteHintHopDecodeErrorZ in the success state.
26890 struct LDKCResult_RouteHintHopDecodeErrorZ CResult_RouteHintHopDecodeErrorZ_ok(struct LDKRouteHintHop o);
26893 * Creates a new CResult_RouteHintHopDecodeErrorZ in the error state.
26895 struct LDKCResult_RouteHintHopDecodeErrorZ CResult_RouteHintHopDecodeErrorZ_err(struct LDKDecodeError e);
26898 * Checks if the given object is currently in the success state
26900 bool CResult_RouteHintHopDecodeErrorZ_is_ok(const struct LDKCResult_RouteHintHopDecodeErrorZ *NONNULL_PTR o);
26903 * Frees any resources used by the CResult_RouteHintHopDecodeErrorZ.
26905 void CResult_RouteHintHopDecodeErrorZ_free(struct LDKCResult_RouteHintHopDecodeErrorZ _res);
26908 * Creates a new CResult_RouteHintHopDecodeErrorZ which has the same data as `orig`
26909 * but with all dynamically-allocated buffers duplicated in new buffers.
26911 struct LDKCResult_RouteHintHopDecodeErrorZ CResult_RouteHintHopDecodeErrorZ_clone(const struct LDKCResult_RouteHintHopDecodeErrorZ *NONNULL_PTR orig);
26914 * Creates a new CResult_FixedPenaltyScorerDecodeErrorZ in the success state.
26916 struct LDKCResult_FixedPenaltyScorerDecodeErrorZ CResult_FixedPenaltyScorerDecodeErrorZ_ok(struct LDKFixedPenaltyScorer o);
26919 * Creates a new CResult_FixedPenaltyScorerDecodeErrorZ in the error state.
26921 struct LDKCResult_FixedPenaltyScorerDecodeErrorZ CResult_FixedPenaltyScorerDecodeErrorZ_err(struct LDKDecodeError e);
26924 * Checks if the given object is currently in the success state
26926 bool CResult_FixedPenaltyScorerDecodeErrorZ_is_ok(const struct LDKCResult_FixedPenaltyScorerDecodeErrorZ *NONNULL_PTR o);
26929 * Frees any resources used by the CResult_FixedPenaltyScorerDecodeErrorZ.
26931 void CResult_FixedPenaltyScorerDecodeErrorZ_free(struct LDKCResult_FixedPenaltyScorerDecodeErrorZ _res);
26934 * Creates a new CResult_FixedPenaltyScorerDecodeErrorZ which has the same data as `orig`
26935 * but with all dynamically-allocated buffers duplicated in new buffers.
26937 struct LDKCResult_FixedPenaltyScorerDecodeErrorZ CResult_FixedPenaltyScorerDecodeErrorZ_clone(const struct LDKCResult_FixedPenaltyScorerDecodeErrorZ *NONNULL_PTR orig);
26940 * Frees the buffer pointed to by `data` if `datalen` is non-0.
26942 void CVec_NodeIdZ_free(struct LDKCVec_NodeIdZ _res);
26945 * Creates a new tuple which has the same data as `orig`
26946 * but with all dynamically-allocated buffers duplicated in new buffers.
26948 struct LDKC2Tuple_u64u64Z C2Tuple_u64u64Z_clone(const struct LDKC2Tuple_u64u64Z *NONNULL_PTR orig);
26951 * Creates a new C2Tuple_u64u64Z from the contained elements.
26953 struct LDKC2Tuple_u64u64Z C2Tuple_u64u64Z_new(uint64_t a, uint64_t b);
26956 * Frees any resources used by the C2Tuple_u64u64Z.
26958 void C2Tuple_u64u64Z_free(struct LDKC2Tuple_u64u64Z _res);
26961 * Constructs a new COption_C2Tuple_u64u64ZZ containing a crate::c_types::derived::C2Tuple_u64u64Z
26963 struct LDKCOption_C2Tuple_u64u64ZZ COption_C2Tuple_u64u64ZZ_some(struct LDKC2Tuple_u64u64Z o);
26966 * Constructs a new COption_C2Tuple_u64u64ZZ containing nothing
26968 struct LDKCOption_C2Tuple_u64u64ZZ COption_C2Tuple_u64u64ZZ_none(void);
26971 * Frees any resources associated with the crate::c_types::derived::C2Tuple_u64u64Z, if we are in the Some state
26973 void COption_C2Tuple_u64u64ZZ_free(struct LDKCOption_C2Tuple_u64u64ZZ _res);
26976 * Creates a new COption_C2Tuple_u64u64ZZ which has the same data as `orig`
26977 * but with all dynamically-allocated buffers duplicated in new buffers.
26979 struct LDKCOption_C2Tuple_u64u64ZZ COption_C2Tuple_u64u64ZZ_clone(const struct LDKCOption_C2Tuple_u64u64ZZ *NONNULL_PTR orig);
26982 * Creates a new C2Tuple_Z from the contained elements.
26984 struct LDKC2Tuple_Z C2Tuple_Z_new(struct LDKThirtyTwoU16s a, struct LDKThirtyTwoU16s b);
26987 * Frees any resources used by the C2Tuple_Z.
26989 void C2Tuple_Z_free(struct LDKC2Tuple_Z _res);
26992 * Creates a new C2Tuple__u1632_u1632Z from the contained elements.
26994 struct LDKC2Tuple__u1632_u1632Z C2Tuple__u1632_u1632Z_new(struct LDKThirtyTwoU16s a, struct LDKThirtyTwoU16s b);
26997 * Frees any resources used by the C2Tuple__u1632_u1632Z.
26999 void C2Tuple__u1632_u1632Z_free(struct LDKC2Tuple__u1632_u1632Z _res);
27002 * Constructs a new COption_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ containing a crate::c_types::derived::C2Tuple__u1632_u1632Z
27004 struct LDKCOption_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ COption_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ_some(struct LDKC2Tuple__u1632_u1632Z o);
27007 * Constructs a new COption_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ containing nothing
27009 struct LDKCOption_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ COption_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ_none(void);
27012 * Frees any resources associated with the crate::c_types::derived::C2Tuple__u1632_u1632Z, if we are in the Some state
27014 void COption_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ_free(struct LDKCOption_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ _res);
27017 * Constructs a new COption_f64Z containing a f64
27019 struct LDKCOption_f64Z COption_f64Z_some(double o);
27022 * Constructs a new COption_f64Z containing nothing
27024 struct LDKCOption_f64Z COption_f64Z_none(void);
27027 * Frees any resources associated with the f64, if we are in the Some state
27029 void COption_f64Z_free(struct LDKCOption_f64Z _res);
27032 * Creates a new COption_f64Z which has the same data as `orig`
27033 * but with all dynamically-allocated buffers duplicated in new buffers.
27035 struct LDKCOption_f64Z COption_f64Z_clone(const struct LDKCOption_f64Z *NONNULL_PTR orig);
27038 * Creates a new CResult_ProbabilisticScorerDecodeErrorZ in the success state.
27040 struct LDKCResult_ProbabilisticScorerDecodeErrorZ CResult_ProbabilisticScorerDecodeErrorZ_ok(struct LDKProbabilisticScorer o);
27043 * Creates a new CResult_ProbabilisticScorerDecodeErrorZ in the error state.
27045 struct LDKCResult_ProbabilisticScorerDecodeErrorZ CResult_ProbabilisticScorerDecodeErrorZ_err(struct LDKDecodeError e);
27048 * Checks if the given object is currently in the success state
27050 bool CResult_ProbabilisticScorerDecodeErrorZ_is_ok(const struct LDKCResult_ProbabilisticScorerDecodeErrorZ *NONNULL_PTR o);
27053 * Frees any resources used by the CResult_ProbabilisticScorerDecodeErrorZ.
27055 void CResult_ProbabilisticScorerDecodeErrorZ_free(struct LDKCResult_ProbabilisticScorerDecodeErrorZ _res);
27058 * Creates a new CResult_BestBlockDecodeErrorZ in the success state.
27060 struct LDKCResult_BestBlockDecodeErrorZ CResult_BestBlockDecodeErrorZ_ok(struct LDKBestBlock o);
27063 * Creates a new CResult_BestBlockDecodeErrorZ in the error state.
27065 struct LDKCResult_BestBlockDecodeErrorZ CResult_BestBlockDecodeErrorZ_err(struct LDKDecodeError e);
27068 * Checks if the given object is currently in the success state
27070 bool CResult_BestBlockDecodeErrorZ_is_ok(const struct LDKCResult_BestBlockDecodeErrorZ *NONNULL_PTR o);
27073 * Frees any resources used by the CResult_BestBlockDecodeErrorZ.
27075 void CResult_BestBlockDecodeErrorZ_free(struct LDKCResult_BestBlockDecodeErrorZ _res);
27078 * Creates a new CResult_BestBlockDecodeErrorZ which has the same data as `orig`
27079 * but with all dynamically-allocated buffers duplicated in new buffers.
27081 struct LDKCResult_BestBlockDecodeErrorZ CResult_BestBlockDecodeErrorZ_clone(const struct LDKCResult_BestBlockDecodeErrorZ *NONNULL_PTR orig);
27084 * Creates a new tuple which has the same data as `orig`
27085 * but with all dynamically-allocated buffers duplicated in new buffers.
27087 struct LDKC2Tuple_usizeTransactionZ C2Tuple_usizeTransactionZ_clone(const struct LDKC2Tuple_usizeTransactionZ *NONNULL_PTR orig);
27090 * Creates a new C2Tuple_usizeTransactionZ from the contained elements.
27092 struct LDKC2Tuple_usizeTransactionZ C2Tuple_usizeTransactionZ_new(uintptr_t a, struct LDKTransaction b);
27095 * Frees any resources used by the C2Tuple_usizeTransactionZ.
27097 void C2Tuple_usizeTransactionZ_free(struct LDKC2Tuple_usizeTransactionZ _res);
27100 * Frees the buffer pointed to by `data` if `datalen` is non-0.
27102 void CVec_C2Tuple_usizeTransactionZZ_free(struct LDKCVec_C2Tuple_usizeTransactionZZ _res);
27105 * Creates a new tuple which has the same data as `orig`
27106 * but with all dynamically-allocated buffers duplicated in new buffers.
27108 struct LDKC3Tuple_ThirtyTwoBytesu32COption_ThirtyTwoBytesZZ C3Tuple_ThirtyTwoBytesu32COption_ThirtyTwoBytesZZ_clone(const struct LDKC3Tuple_ThirtyTwoBytesu32COption_ThirtyTwoBytesZZ *NONNULL_PTR orig);
27111 * Creates a new C3Tuple_ThirtyTwoBytesu32COption_ThirtyTwoBytesZZ from the contained elements.
27113 struct LDKC3Tuple_ThirtyTwoBytesu32COption_ThirtyTwoBytesZZ C3Tuple_ThirtyTwoBytesu32COption_ThirtyTwoBytesZZ_new(struct LDKThirtyTwoBytes a, uint32_t b, struct LDKCOption_ThirtyTwoBytesZ c);
27116 * Frees any resources used by the C3Tuple_ThirtyTwoBytesu32COption_ThirtyTwoBytesZZ.
27118 void C3Tuple_ThirtyTwoBytesu32COption_ThirtyTwoBytesZZ_free(struct LDKC3Tuple_ThirtyTwoBytesu32COption_ThirtyTwoBytesZZ _res);
27121 * Frees the buffer pointed to by `data` if `datalen` is non-0.
27123 void CVec_C3Tuple_ThirtyTwoBytesu32COption_ThirtyTwoBytesZZZ_free(struct LDKCVec_C3Tuple_ThirtyTwoBytesu32COption_ThirtyTwoBytesZZZ _res);
27126 * Creates a new CResult_ChannelMonitorUpdateStatusNoneZ in the success state.
27128 struct LDKCResult_ChannelMonitorUpdateStatusNoneZ CResult_ChannelMonitorUpdateStatusNoneZ_ok(enum LDKChannelMonitorUpdateStatus o);
27131 * Creates a new CResult_ChannelMonitorUpdateStatusNoneZ in the error state.
27133 struct LDKCResult_ChannelMonitorUpdateStatusNoneZ CResult_ChannelMonitorUpdateStatusNoneZ_err(void);
27136 * Checks if the given object is currently in the success state
27138 bool CResult_ChannelMonitorUpdateStatusNoneZ_is_ok(const struct LDKCResult_ChannelMonitorUpdateStatusNoneZ *NONNULL_PTR o);
27141 * Frees any resources used by the CResult_ChannelMonitorUpdateStatusNoneZ.
27143 void CResult_ChannelMonitorUpdateStatusNoneZ_free(struct LDKCResult_ChannelMonitorUpdateStatusNoneZ _res);
27146 * Creates a new CResult_ChannelMonitorUpdateStatusNoneZ which has the same data as `orig`
27147 * but with all dynamically-allocated buffers duplicated in new buffers.
27149 struct LDKCResult_ChannelMonitorUpdateStatusNoneZ CResult_ChannelMonitorUpdateStatusNoneZ_clone(const struct LDKCResult_ChannelMonitorUpdateStatusNoneZ *NONNULL_PTR orig);
27152 * Frees the buffer pointed to by `data` if `datalen` is non-0.
27154 void CVec_MonitorEventZ_free(struct LDKCVec_MonitorEventZ _res);
27157 * Creates a new tuple which has the same data as `orig`
27158 * but with all dynamically-allocated buffers duplicated in new buffers.
27160 struct LDKC4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ C4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ_clone(const struct LDKC4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ *NONNULL_PTR orig);
27163 * Creates a new C4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ from the contained elements.
27165 struct LDKC4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ C4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ_new(struct LDKOutPoint a, struct LDKChannelId b, struct LDKCVec_MonitorEventZ c, struct LDKPublicKey d);
27168 * Frees any resources used by the C4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ.
27170 void C4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ_free(struct LDKC4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ _res);
27173 * Frees the buffer pointed to by `data` if `datalen` is non-0.
27175 void CVec_C4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZZ_free(struct LDKCVec_C4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZZ _res);
27178 * Creates a new CResult_InitFeaturesDecodeErrorZ in the success state.
27180 struct LDKCResult_InitFeaturesDecodeErrorZ CResult_InitFeaturesDecodeErrorZ_ok(struct LDKInitFeatures o);
27183 * Creates a new CResult_InitFeaturesDecodeErrorZ in the error state.
27185 struct LDKCResult_InitFeaturesDecodeErrorZ CResult_InitFeaturesDecodeErrorZ_err(struct LDKDecodeError e);
27188 * Checks if the given object is currently in the success state
27190 bool CResult_InitFeaturesDecodeErrorZ_is_ok(const struct LDKCResult_InitFeaturesDecodeErrorZ *NONNULL_PTR o);
27193 * Frees any resources used by the CResult_InitFeaturesDecodeErrorZ.
27195 void CResult_InitFeaturesDecodeErrorZ_free(struct LDKCResult_InitFeaturesDecodeErrorZ _res);
27198 * Creates a new CResult_InitFeaturesDecodeErrorZ which has the same data as `orig`
27199 * but with all dynamically-allocated buffers duplicated in new buffers.
27201 struct LDKCResult_InitFeaturesDecodeErrorZ CResult_InitFeaturesDecodeErrorZ_clone(const struct LDKCResult_InitFeaturesDecodeErrorZ *NONNULL_PTR orig);
27204 * Creates a new CResult_ChannelFeaturesDecodeErrorZ in the success state.
27206 struct LDKCResult_ChannelFeaturesDecodeErrorZ CResult_ChannelFeaturesDecodeErrorZ_ok(struct LDKChannelFeatures o);
27209 * Creates a new CResult_ChannelFeaturesDecodeErrorZ in the error state.
27211 struct LDKCResult_ChannelFeaturesDecodeErrorZ CResult_ChannelFeaturesDecodeErrorZ_err(struct LDKDecodeError e);
27214 * Checks if the given object is currently in the success state
27216 bool CResult_ChannelFeaturesDecodeErrorZ_is_ok(const struct LDKCResult_ChannelFeaturesDecodeErrorZ *NONNULL_PTR o);
27219 * Frees any resources used by the CResult_ChannelFeaturesDecodeErrorZ.
27221 void CResult_ChannelFeaturesDecodeErrorZ_free(struct LDKCResult_ChannelFeaturesDecodeErrorZ _res);
27224 * Creates a new CResult_ChannelFeaturesDecodeErrorZ which has the same data as `orig`
27225 * but with all dynamically-allocated buffers duplicated in new buffers.
27227 struct LDKCResult_ChannelFeaturesDecodeErrorZ CResult_ChannelFeaturesDecodeErrorZ_clone(const struct LDKCResult_ChannelFeaturesDecodeErrorZ *NONNULL_PTR orig);
27230 * Creates a new CResult_NodeFeaturesDecodeErrorZ in the success state.
27232 struct LDKCResult_NodeFeaturesDecodeErrorZ CResult_NodeFeaturesDecodeErrorZ_ok(struct LDKNodeFeatures o);
27235 * Creates a new CResult_NodeFeaturesDecodeErrorZ in the error state.
27237 struct LDKCResult_NodeFeaturesDecodeErrorZ CResult_NodeFeaturesDecodeErrorZ_err(struct LDKDecodeError e);
27240 * Checks if the given object is currently in the success state
27242 bool CResult_NodeFeaturesDecodeErrorZ_is_ok(const struct LDKCResult_NodeFeaturesDecodeErrorZ *NONNULL_PTR o);
27245 * Frees any resources used by the CResult_NodeFeaturesDecodeErrorZ.
27247 void CResult_NodeFeaturesDecodeErrorZ_free(struct LDKCResult_NodeFeaturesDecodeErrorZ _res);
27250 * Creates a new CResult_NodeFeaturesDecodeErrorZ which has the same data as `orig`
27251 * but with all dynamically-allocated buffers duplicated in new buffers.
27253 struct LDKCResult_NodeFeaturesDecodeErrorZ CResult_NodeFeaturesDecodeErrorZ_clone(const struct LDKCResult_NodeFeaturesDecodeErrorZ *NONNULL_PTR orig);
27256 * Creates a new CResult_Bolt11InvoiceFeaturesDecodeErrorZ in the success state.
27258 struct LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZ CResult_Bolt11InvoiceFeaturesDecodeErrorZ_ok(struct LDKBolt11InvoiceFeatures o);
27261 * Creates a new CResult_Bolt11InvoiceFeaturesDecodeErrorZ in the error state.
27263 struct LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZ CResult_Bolt11InvoiceFeaturesDecodeErrorZ_err(struct LDKDecodeError e);
27266 * Checks if the given object is currently in the success state
27268 bool CResult_Bolt11InvoiceFeaturesDecodeErrorZ_is_ok(const struct LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZ *NONNULL_PTR o);
27271 * Frees any resources used by the CResult_Bolt11InvoiceFeaturesDecodeErrorZ.
27273 void CResult_Bolt11InvoiceFeaturesDecodeErrorZ_free(struct LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZ _res);
27276 * Creates a new CResult_Bolt11InvoiceFeaturesDecodeErrorZ which has the same data as `orig`
27277 * but with all dynamically-allocated buffers duplicated in new buffers.
27279 struct LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZ CResult_Bolt11InvoiceFeaturesDecodeErrorZ_clone(const struct LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZ *NONNULL_PTR orig);
27282 * Creates a new CResult_Bolt12InvoiceFeaturesDecodeErrorZ in the success state.
27284 struct LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZ CResult_Bolt12InvoiceFeaturesDecodeErrorZ_ok(struct LDKBolt12InvoiceFeatures o);
27287 * Creates a new CResult_Bolt12InvoiceFeaturesDecodeErrorZ in the error state.
27289 struct LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZ CResult_Bolt12InvoiceFeaturesDecodeErrorZ_err(struct LDKDecodeError e);
27292 * Checks if the given object is currently in the success state
27294 bool CResult_Bolt12InvoiceFeaturesDecodeErrorZ_is_ok(const struct LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZ *NONNULL_PTR o);
27297 * Frees any resources used by the CResult_Bolt12InvoiceFeaturesDecodeErrorZ.
27299 void CResult_Bolt12InvoiceFeaturesDecodeErrorZ_free(struct LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZ _res);
27302 * Creates a new CResult_Bolt12InvoiceFeaturesDecodeErrorZ which has the same data as `orig`
27303 * but with all dynamically-allocated buffers duplicated in new buffers.
27305 struct LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZ CResult_Bolt12InvoiceFeaturesDecodeErrorZ_clone(const struct LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZ *NONNULL_PTR orig);
27308 * Creates a new CResult_BlindedHopFeaturesDecodeErrorZ in the success state.
27310 struct LDKCResult_BlindedHopFeaturesDecodeErrorZ CResult_BlindedHopFeaturesDecodeErrorZ_ok(struct LDKBlindedHopFeatures o);
27313 * Creates a new CResult_BlindedHopFeaturesDecodeErrorZ in the error state.
27315 struct LDKCResult_BlindedHopFeaturesDecodeErrorZ CResult_BlindedHopFeaturesDecodeErrorZ_err(struct LDKDecodeError e);
27318 * Checks if the given object is currently in the success state
27320 bool CResult_BlindedHopFeaturesDecodeErrorZ_is_ok(const struct LDKCResult_BlindedHopFeaturesDecodeErrorZ *NONNULL_PTR o);
27323 * Frees any resources used by the CResult_BlindedHopFeaturesDecodeErrorZ.
27325 void CResult_BlindedHopFeaturesDecodeErrorZ_free(struct LDKCResult_BlindedHopFeaturesDecodeErrorZ _res);
27328 * Creates a new CResult_BlindedHopFeaturesDecodeErrorZ which has the same data as `orig`
27329 * but with all dynamically-allocated buffers duplicated in new buffers.
27331 struct LDKCResult_BlindedHopFeaturesDecodeErrorZ CResult_BlindedHopFeaturesDecodeErrorZ_clone(const struct LDKCResult_BlindedHopFeaturesDecodeErrorZ *NONNULL_PTR orig);
27334 * Creates a new CResult_ChannelTypeFeaturesDecodeErrorZ in the success state.
27336 struct LDKCResult_ChannelTypeFeaturesDecodeErrorZ CResult_ChannelTypeFeaturesDecodeErrorZ_ok(struct LDKChannelTypeFeatures o);
27339 * Creates a new CResult_ChannelTypeFeaturesDecodeErrorZ in the error state.
27341 struct LDKCResult_ChannelTypeFeaturesDecodeErrorZ CResult_ChannelTypeFeaturesDecodeErrorZ_err(struct LDKDecodeError e);
27344 * Checks if the given object is currently in the success state
27346 bool CResult_ChannelTypeFeaturesDecodeErrorZ_is_ok(const struct LDKCResult_ChannelTypeFeaturesDecodeErrorZ *NONNULL_PTR o);
27349 * Frees any resources used by the CResult_ChannelTypeFeaturesDecodeErrorZ.
27351 void CResult_ChannelTypeFeaturesDecodeErrorZ_free(struct LDKCResult_ChannelTypeFeaturesDecodeErrorZ _res);
27354 * Creates a new CResult_ChannelTypeFeaturesDecodeErrorZ which has the same data as `orig`
27355 * but with all dynamically-allocated buffers duplicated in new buffers.
27357 struct LDKCResult_ChannelTypeFeaturesDecodeErrorZ CResult_ChannelTypeFeaturesDecodeErrorZ_clone(const struct LDKCResult_ChannelTypeFeaturesDecodeErrorZ *NONNULL_PTR orig);
27360 * Creates a new CResult_OfferIdDecodeErrorZ in the success state.
27362 struct LDKCResult_OfferIdDecodeErrorZ CResult_OfferIdDecodeErrorZ_ok(struct LDKOfferId o);
27365 * Creates a new CResult_OfferIdDecodeErrorZ in the error state.
27367 struct LDKCResult_OfferIdDecodeErrorZ CResult_OfferIdDecodeErrorZ_err(struct LDKDecodeError e);
27370 * Checks if the given object is currently in the success state
27372 bool CResult_OfferIdDecodeErrorZ_is_ok(const struct LDKCResult_OfferIdDecodeErrorZ *NONNULL_PTR o);
27375 * Frees any resources used by the CResult_OfferIdDecodeErrorZ.
27377 void CResult_OfferIdDecodeErrorZ_free(struct LDKCResult_OfferIdDecodeErrorZ _res);
27380 * Creates a new CResult_OfferIdDecodeErrorZ which has the same data as `orig`
27381 * but with all dynamically-allocated buffers duplicated in new buffers.
27383 struct LDKCResult_OfferIdDecodeErrorZ CResult_OfferIdDecodeErrorZ_clone(const struct LDKCResult_OfferIdDecodeErrorZ *NONNULL_PTR orig);
27386 * Creates a new CResult_NoneBolt12SemanticErrorZ in the success state.
27388 struct LDKCResult_NoneBolt12SemanticErrorZ CResult_NoneBolt12SemanticErrorZ_ok(void);
27391 * Creates a new CResult_NoneBolt12SemanticErrorZ in the error state.
27393 struct LDKCResult_NoneBolt12SemanticErrorZ CResult_NoneBolt12SemanticErrorZ_err(enum LDKBolt12SemanticError e);
27396 * Checks if the given object is currently in the success state
27398 bool CResult_NoneBolt12SemanticErrorZ_is_ok(const struct LDKCResult_NoneBolt12SemanticErrorZ *NONNULL_PTR o);
27401 * Frees any resources used by the CResult_NoneBolt12SemanticErrorZ.
27403 void CResult_NoneBolt12SemanticErrorZ_free(struct LDKCResult_NoneBolt12SemanticErrorZ _res);
27406 * Creates a new CResult_NoneBolt12SemanticErrorZ which has the same data as `orig`
27407 * but with all dynamically-allocated buffers duplicated in new buffers.
27409 struct LDKCResult_NoneBolt12SemanticErrorZ CResult_NoneBolt12SemanticErrorZ_clone(const struct LDKCResult_NoneBolt12SemanticErrorZ *NONNULL_PTR orig);
27412 * Creates a new CResult_OfferBolt12SemanticErrorZ in the success state.
27414 struct LDKCResult_OfferBolt12SemanticErrorZ CResult_OfferBolt12SemanticErrorZ_ok(struct LDKOffer o);
27417 * Creates a new CResult_OfferBolt12SemanticErrorZ in the error state.
27419 struct LDKCResult_OfferBolt12SemanticErrorZ CResult_OfferBolt12SemanticErrorZ_err(enum LDKBolt12SemanticError e);
27422 * Checks if the given object is currently in the success state
27424 bool CResult_OfferBolt12SemanticErrorZ_is_ok(const struct LDKCResult_OfferBolt12SemanticErrorZ *NONNULL_PTR o);
27427 * Frees any resources used by the CResult_OfferBolt12SemanticErrorZ.
27429 void CResult_OfferBolt12SemanticErrorZ_free(struct LDKCResult_OfferBolt12SemanticErrorZ _res);
27432 * Creates a new CResult_OfferBolt12SemanticErrorZ which has the same data as `orig`
27433 * but with all dynamically-allocated buffers duplicated in new buffers.
27435 struct LDKCResult_OfferBolt12SemanticErrorZ CResult_OfferBolt12SemanticErrorZ_clone(const struct LDKCResult_OfferBolt12SemanticErrorZ *NONNULL_PTR orig);
27438 * Creates a new CResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ in the success state.
27440 struct LDKCResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ CResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ_ok(struct LDKInvoiceRequestWithDerivedPayerIdBuilder o);
27443 * Creates a new CResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ in the error state.
27445 struct LDKCResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ CResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ_err(enum LDKBolt12SemanticError e);
27448 * Checks if the given object is currently in the success state
27450 bool CResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ_is_ok(const struct LDKCResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ *NONNULL_PTR o);
27453 * Frees any resources used by the CResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ.
27455 void CResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ_free(struct LDKCResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ _res);
27458 * Creates a new CResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ in the success state.
27460 struct LDKCResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ CResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ_ok(struct LDKInvoiceRequestWithExplicitPayerIdBuilder o);
27463 * Creates a new CResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ in the error state.
27465 struct LDKCResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ CResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ_err(enum LDKBolt12SemanticError e);
27468 * Checks if the given object is currently in the success state
27470 bool CResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ_is_ok(const struct LDKCResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ *NONNULL_PTR o);
27473 * Frees any resources used by the CResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ.
27475 void CResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ_free(struct LDKCResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ _res);
27478 * Creates a new CResult_OfferBolt12ParseErrorZ in the success state.
27480 struct LDKCResult_OfferBolt12ParseErrorZ CResult_OfferBolt12ParseErrorZ_ok(struct LDKOffer o);
27483 * Creates a new CResult_OfferBolt12ParseErrorZ in the error state.
27485 struct LDKCResult_OfferBolt12ParseErrorZ CResult_OfferBolt12ParseErrorZ_err(struct LDKBolt12ParseError e);
27488 * Checks if the given object is currently in the success state
27490 bool CResult_OfferBolt12ParseErrorZ_is_ok(const struct LDKCResult_OfferBolt12ParseErrorZ *NONNULL_PTR o);
27493 * Frees any resources used by the CResult_OfferBolt12ParseErrorZ.
27495 void CResult_OfferBolt12ParseErrorZ_free(struct LDKCResult_OfferBolt12ParseErrorZ _res);
27498 * Creates a new CResult_OfferBolt12ParseErrorZ which has the same data as `orig`
27499 * but with all dynamically-allocated buffers duplicated in new buffers.
27501 struct LDKCResult_OfferBolt12ParseErrorZ CResult_OfferBolt12ParseErrorZ_clone(const struct LDKCResult_OfferBolt12ParseErrorZ *NONNULL_PTR orig);
27504 * Creates a new CResult_NodeIdDecodeErrorZ in the success state.
27506 struct LDKCResult_NodeIdDecodeErrorZ CResult_NodeIdDecodeErrorZ_ok(struct LDKNodeId o);
27509 * Creates a new CResult_NodeIdDecodeErrorZ in the error state.
27511 struct LDKCResult_NodeIdDecodeErrorZ CResult_NodeIdDecodeErrorZ_err(struct LDKDecodeError e);
27514 * Checks if the given object is currently in the success state
27516 bool CResult_NodeIdDecodeErrorZ_is_ok(const struct LDKCResult_NodeIdDecodeErrorZ *NONNULL_PTR o);
27519 * Frees any resources used by the CResult_NodeIdDecodeErrorZ.
27521 void CResult_NodeIdDecodeErrorZ_free(struct LDKCResult_NodeIdDecodeErrorZ _res);
27524 * Creates a new CResult_NodeIdDecodeErrorZ which has the same data as `orig`
27525 * but with all dynamically-allocated buffers duplicated in new buffers.
27527 struct LDKCResult_NodeIdDecodeErrorZ CResult_NodeIdDecodeErrorZ_clone(const struct LDKCResult_NodeIdDecodeErrorZ *NONNULL_PTR orig);
27530 * Creates a new CResult_PublicKeySecp256k1ErrorZ in the success state.
27532 struct LDKCResult_PublicKeySecp256k1ErrorZ CResult_PublicKeySecp256k1ErrorZ_ok(struct LDKPublicKey o);
27535 * Creates a new CResult_PublicKeySecp256k1ErrorZ in the error state.
27537 struct LDKCResult_PublicKeySecp256k1ErrorZ CResult_PublicKeySecp256k1ErrorZ_err(enum LDKSecp256k1Error e);
27540 * Checks if the given object is currently in the success state
27542 bool CResult_PublicKeySecp256k1ErrorZ_is_ok(const struct LDKCResult_PublicKeySecp256k1ErrorZ *NONNULL_PTR o);
27545 * Frees any resources used by the CResult_PublicKeySecp256k1ErrorZ.
27547 void CResult_PublicKeySecp256k1ErrorZ_free(struct LDKCResult_PublicKeySecp256k1ErrorZ _res);
27550 * Creates a new CResult_PublicKeySecp256k1ErrorZ which has the same data as `orig`
27551 * but with all dynamically-allocated buffers duplicated in new buffers.
27553 struct LDKCResult_PublicKeySecp256k1ErrorZ CResult_PublicKeySecp256k1ErrorZ_clone(const struct LDKCResult_PublicKeySecp256k1ErrorZ *NONNULL_PTR orig);
27556 * Constructs a new COption_NetworkUpdateZ containing a crate::lightning::routing::gossip::NetworkUpdate
27558 struct LDKCOption_NetworkUpdateZ COption_NetworkUpdateZ_some(struct LDKNetworkUpdate o);
27561 * Constructs a new COption_NetworkUpdateZ containing nothing
27563 struct LDKCOption_NetworkUpdateZ COption_NetworkUpdateZ_none(void);
27566 * Frees any resources associated with the crate::lightning::routing::gossip::NetworkUpdate, if we are in the Some state
27568 void COption_NetworkUpdateZ_free(struct LDKCOption_NetworkUpdateZ _res);
27571 * Creates a new COption_NetworkUpdateZ which has the same data as `orig`
27572 * but with all dynamically-allocated buffers duplicated in new buffers.
27574 struct LDKCOption_NetworkUpdateZ COption_NetworkUpdateZ_clone(const struct LDKCOption_NetworkUpdateZ *NONNULL_PTR orig);
27577 * Creates a new CResult_COption_NetworkUpdateZDecodeErrorZ in the success state.
27579 struct LDKCResult_COption_NetworkUpdateZDecodeErrorZ CResult_COption_NetworkUpdateZDecodeErrorZ_ok(struct LDKCOption_NetworkUpdateZ o);
27582 * Creates a new CResult_COption_NetworkUpdateZDecodeErrorZ in the error state.
27584 struct LDKCResult_COption_NetworkUpdateZDecodeErrorZ CResult_COption_NetworkUpdateZDecodeErrorZ_err(struct LDKDecodeError e);
27587 * Checks if the given object is currently in the success state
27589 bool CResult_COption_NetworkUpdateZDecodeErrorZ_is_ok(const struct LDKCResult_COption_NetworkUpdateZDecodeErrorZ *NONNULL_PTR o);
27592 * Frees any resources used by the CResult_COption_NetworkUpdateZDecodeErrorZ.
27594 void CResult_COption_NetworkUpdateZDecodeErrorZ_free(struct LDKCResult_COption_NetworkUpdateZDecodeErrorZ _res);
27597 * Creates a new CResult_COption_NetworkUpdateZDecodeErrorZ which has the same data as `orig`
27598 * but with all dynamically-allocated buffers duplicated in new buffers.
27600 struct LDKCResult_COption_NetworkUpdateZDecodeErrorZ CResult_COption_NetworkUpdateZDecodeErrorZ_clone(const struct LDKCResult_COption_NetworkUpdateZDecodeErrorZ *NONNULL_PTR orig);
27603 * Constructs a new COption_UtxoLookupZ containing a crate::lightning::routing::utxo::UtxoLookup
27605 struct LDKCOption_UtxoLookupZ COption_UtxoLookupZ_some(struct LDKUtxoLookup o);
27608 * Constructs a new COption_UtxoLookupZ containing nothing
27610 struct LDKCOption_UtxoLookupZ COption_UtxoLookupZ_none(void);
27613 * Frees any resources associated with the crate::lightning::routing::utxo::UtxoLookup, if we are in the Some state
27615 void COption_UtxoLookupZ_free(struct LDKCOption_UtxoLookupZ _res);
27618 * Creates a new CResult_NoneLightningErrorZ in the success state.
27620 struct LDKCResult_NoneLightningErrorZ CResult_NoneLightningErrorZ_ok(void);
27623 * Creates a new CResult_NoneLightningErrorZ in the error state.
27625 struct LDKCResult_NoneLightningErrorZ CResult_NoneLightningErrorZ_err(struct LDKLightningError e);
27628 * Checks if the given object is currently in the success state
27630 bool CResult_NoneLightningErrorZ_is_ok(const struct LDKCResult_NoneLightningErrorZ *NONNULL_PTR o);
27633 * Frees any resources used by the CResult_NoneLightningErrorZ.
27635 void CResult_NoneLightningErrorZ_free(struct LDKCResult_NoneLightningErrorZ _res);
27638 * Creates a new CResult_NoneLightningErrorZ which has the same data as `orig`
27639 * but with all dynamically-allocated buffers duplicated in new buffers.
27641 struct LDKCResult_NoneLightningErrorZ CResult_NoneLightningErrorZ_clone(const struct LDKCResult_NoneLightningErrorZ *NONNULL_PTR orig);
27644 * Creates a new CResult_boolLightningErrorZ in the success state.
27646 struct LDKCResult_boolLightningErrorZ CResult_boolLightningErrorZ_ok(bool o);
27649 * Creates a new CResult_boolLightningErrorZ in the error state.
27651 struct LDKCResult_boolLightningErrorZ CResult_boolLightningErrorZ_err(struct LDKLightningError e);
27654 * Checks if the given object is currently in the success state
27656 bool CResult_boolLightningErrorZ_is_ok(const struct LDKCResult_boolLightningErrorZ *NONNULL_PTR o);
27659 * Frees any resources used by the CResult_boolLightningErrorZ.
27661 void CResult_boolLightningErrorZ_free(struct LDKCResult_boolLightningErrorZ _res);
27664 * Creates a new CResult_boolLightningErrorZ which has the same data as `orig`
27665 * but with all dynamically-allocated buffers duplicated in new buffers.
27667 struct LDKCResult_boolLightningErrorZ CResult_boolLightningErrorZ_clone(const struct LDKCResult_boolLightningErrorZ *NONNULL_PTR orig);
27670 * Creates a new tuple which has the same data as `orig`
27671 * but with all dynamically-allocated buffers duplicated in new buffers.
27673 struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_clone(const struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ *NONNULL_PTR orig);
27676 * Creates a new C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ from the contained elements.
27678 struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_new(struct LDKChannelAnnouncement a, struct LDKChannelUpdate b, struct LDKChannelUpdate c);
27681 * Frees any resources used by the C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ.
27683 void C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_free(struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ _res);
27686 * Constructs a new COption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ containing a crate::c_types::derived::C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ
27688 struct LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ COption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_some(struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ o);
27691 * Constructs a new COption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ containing nothing
27693 struct LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ COption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_none(void);
27696 * Frees any resources associated with the crate::c_types::derived::C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ, if we are in the Some state
27698 void COption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_free(struct LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ _res);
27701 * Creates a new COption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ which has the same data as `orig`
27702 * but with all dynamically-allocated buffers duplicated in new buffers.
27704 struct LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ COption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_clone(const struct LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ *NONNULL_PTR orig);
27707 * Frees the buffer pointed to by `data` if `datalen` is non-0.
27709 void CVec_MessageSendEventZ_free(struct LDKCVec_MessageSendEventZ _res);
27712 * Creates a new CResult_ChannelUpdateInfoDecodeErrorZ in the success state.
27714 struct LDKCResult_ChannelUpdateInfoDecodeErrorZ CResult_ChannelUpdateInfoDecodeErrorZ_ok(struct LDKChannelUpdateInfo o);
27717 * Creates a new CResult_ChannelUpdateInfoDecodeErrorZ in the error state.
27719 struct LDKCResult_ChannelUpdateInfoDecodeErrorZ CResult_ChannelUpdateInfoDecodeErrorZ_err(struct LDKDecodeError e);
27722 * Checks if the given object is currently in the success state
27724 bool CResult_ChannelUpdateInfoDecodeErrorZ_is_ok(const struct LDKCResult_ChannelUpdateInfoDecodeErrorZ *NONNULL_PTR o);
27727 * Frees any resources used by the CResult_ChannelUpdateInfoDecodeErrorZ.
27729 void CResult_ChannelUpdateInfoDecodeErrorZ_free(struct LDKCResult_ChannelUpdateInfoDecodeErrorZ _res);
27732 * Creates a new CResult_ChannelUpdateInfoDecodeErrorZ which has the same data as `orig`
27733 * but with all dynamically-allocated buffers duplicated in new buffers.
27735 struct LDKCResult_ChannelUpdateInfoDecodeErrorZ CResult_ChannelUpdateInfoDecodeErrorZ_clone(const struct LDKCResult_ChannelUpdateInfoDecodeErrorZ *NONNULL_PTR orig);
27738 * Creates a new CResult_ChannelInfoDecodeErrorZ in the success state.
27740 struct LDKCResult_ChannelInfoDecodeErrorZ CResult_ChannelInfoDecodeErrorZ_ok(struct LDKChannelInfo o);
27743 * Creates a new CResult_ChannelInfoDecodeErrorZ in the error state.
27745 struct LDKCResult_ChannelInfoDecodeErrorZ CResult_ChannelInfoDecodeErrorZ_err(struct LDKDecodeError e);
27748 * Checks if the given object is currently in the success state
27750 bool CResult_ChannelInfoDecodeErrorZ_is_ok(const struct LDKCResult_ChannelInfoDecodeErrorZ *NONNULL_PTR o);
27753 * Frees any resources used by the CResult_ChannelInfoDecodeErrorZ.
27755 void CResult_ChannelInfoDecodeErrorZ_free(struct LDKCResult_ChannelInfoDecodeErrorZ _res);
27758 * Creates a new CResult_ChannelInfoDecodeErrorZ which has the same data as `orig`
27759 * but with all dynamically-allocated buffers duplicated in new buffers.
27761 struct LDKCResult_ChannelInfoDecodeErrorZ CResult_ChannelInfoDecodeErrorZ_clone(const struct LDKCResult_ChannelInfoDecodeErrorZ *NONNULL_PTR orig);
27764 * Creates a new CResult_RoutingFeesDecodeErrorZ in the success state.
27766 struct LDKCResult_RoutingFeesDecodeErrorZ CResult_RoutingFeesDecodeErrorZ_ok(struct LDKRoutingFees o);
27769 * Creates a new CResult_RoutingFeesDecodeErrorZ in the error state.
27771 struct LDKCResult_RoutingFeesDecodeErrorZ CResult_RoutingFeesDecodeErrorZ_err(struct LDKDecodeError e);
27774 * Checks if the given object is currently in the success state
27776 bool CResult_RoutingFeesDecodeErrorZ_is_ok(const struct LDKCResult_RoutingFeesDecodeErrorZ *NONNULL_PTR o);
27779 * Frees any resources used by the CResult_RoutingFeesDecodeErrorZ.
27781 void CResult_RoutingFeesDecodeErrorZ_free(struct LDKCResult_RoutingFeesDecodeErrorZ _res);
27784 * Creates a new CResult_RoutingFeesDecodeErrorZ which has the same data as `orig`
27785 * but with all dynamically-allocated buffers duplicated in new buffers.
27787 struct LDKCResult_RoutingFeesDecodeErrorZ CResult_RoutingFeesDecodeErrorZ_clone(const struct LDKCResult_RoutingFeesDecodeErrorZ *NONNULL_PTR orig);
27790 * Frees the buffer pointed to by `data` if `datalen` is non-0.
27792 void CVec_SocketAddressZ_free(struct LDKCVec_SocketAddressZ _res);
27795 * Creates a new CResult_NodeAnnouncementInfoDecodeErrorZ in the success state.
27797 struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ CResult_NodeAnnouncementInfoDecodeErrorZ_ok(struct LDKNodeAnnouncementInfo o);
27800 * Creates a new CResult_NodeAnnouncementInfoDecodeErrorZ in the error state.
27802 struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ CResult_NodeAnnouncementInfoDecodeErrorZ_err(struct LDKDecodeError e);
27805 * Checks if the given object is currently in the success state
27807 bool CResult_NodeAnnouncementInfoDecodeErrorZ_is_ok(const struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ *NONNULL_PTR o);
27810 * Frees any resources used by the CResult_NodeAnnouncementInfoDecodeErrorZ.
27812 void CResult_NodeAnnouncementInfoDecodeErrorZ_free(struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ _res);
27815 * Creates a new CResult_NodeAnnouncementInfoDecodeErrorZ which has the same data as `orig`
27816 * but with all dynamically-allocated buffers duplicated in new buffers.
27818 struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ CResult_NodeAnnouncementInfoDecodeErrorZ_clone(const struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ *NONNULL_PTR orig);
27821 * Creates a new CResult_NodeAliasDecodeErrorZ in the success state.
27823 struct LDKCResult_NodeAliasDecodeErrorZ CResult_NodeAliasDecodeErrorZ_ok(struct LDKNodeAlias o);
27826 * Creates a new CResult_NodeAliasDecodeErrorZ in the error state.
27828 struct LDKCResult_NodeAliasDecodeErrorZ CResult_NodeAliasDecodeErrorZ_err(struct LDKDecodeError e);
27831 * Checks if the given object is currently in the success state
27833 bool CResult_NodeAliasDecodeErrorZ_is_ok(const struct LDKCResult_NodeAliasDecodeErrorZ *NONNULL_PTR o);
27836 * Frees any resources used by the CResult_NodeAliasDecodeErrorZ.
27838 void CResult_NodeAliasDecodeErrorZ_free(struct LDKCResult_NodeAliasDecodeErrorZ _res);
27841 * Creates a new CResult_NodeAliasDecodeErrorZ which has the same data as `orig`
27842 * but with all dynamically-allocated buffers duplicated in new buffers.
27844 struct LDKCResult_NodeAliasDecodeErrorZ CResult_NodeAliasDecodeErrorZ_clone(const struct LDKCResult_NodeAliasDecodeErrorZ *NONNULL_PTR orig);
27847 * Creates a new CResult_NodeInfoDecodeErrorZ in the success state.
27849 struct LDKCResult_NodeInfoDecodeErrorZ CResult_NodeInfoDecodeErrorZ_ok(struct LDKNodeInfo o);
27852 * Creates a new CResult_NodeInfoDecodeErrorZ in the error state.
27854 struct LDKCResult_NodeInfoDecodeErrorZ CResult_NodeInfoDecodeErrorZ_err(struct LDKDecodeError e);
27857 * Checks if the given object is currently in the success state
27859 bool CResult_NodeInfoDecodeErrorZ_is_ok(const struct LDKCResult_NodeInfoDecodeErrorZ *NONNULL_PTR o);
27862 * Frees any resources used by the CResult_NodeInfoDecodeErrorZ.
27864 void CResult_NodeInfoDecodeErrorZ_free(struct LDKCResult_NodeInfoDecodeErrorZ _res);
27867 * Creates a new CResult_NodeInfoDecodeErrorZ which has the same data as `orig`
27868 * but with all dynamically-allocated buffers duplicated in new buffers.
27870 struct LDKCResult_NodeInfoDecodeErrorZ CResult_NodeInfoDecodeErrorZ_clone(const struct LDKCResult_NodeInfoDecodeErrorZ *NONNULL_PTR orig);
27873 * Creates a new CResult_NetworkGraphDecodeErrorZ in the success state.
27875 struct LDKCResult_NetworkGraphDecodeErrorZ CResult_NetworkGraphDecodeErrorZ_ok(struct LDKNetworkGraph o);
27878 * Creates a new CResult_NetworkGraphDecodeErrorZ in the error state.
27880 struct LDKCResult_NetworkGraphDecodeErrorZ CResult_NetworkGraphDecodeErrorZ_err(struct LDKDecodeError e);
27883 * Checks if the given object is currently in the success state
27885 bool CResult_NetworkGraphDecodeErrorZ_is_ok(const struct LDKCResult_NetworkGraphDecodeErrorZ *NONNULL_PTR o);
27888 * Frees any resources used by the CResult_NetworkGraphDecodeErrorZ.
27890 void CResult_NetworkGraphDecodeErrorZ_free(struct LDKCResult_NetworkGraphDecodeErrorZ _res);
27893 * Constructs a new COption_CVec_SocketAddressZZ containing a crate::c_types::derived::CVec_SocketAddressZ
27895 struct LDKCOption_CVec_SocketAddressZZ COption_CVec_SocketAddressZZ_some(struct LDKCVec_SocketAddressZ o);
27898 * Constructs a new COption_CVec_SocketAddressZZ containing nothing
27900 struct LDKCOption_CVec_SocketAddressZZ COption_CVec_SocketAddressZZ_none(void);
27903 * Frees any resources associated with the crate::c_types::derived::CVec_SocketAddressZ, if we are in the Some state
27905 void COption_CVec_SocketAddressZZ_free(struct LDKCOption_CVec_SocketAddressZZ _res);
27908 * Creates a new COption_CVec_SocketAddressZZ which has the same data as `orig`
27909 * but with all dynamically-allocated buffers duplicated in new buffers.
27911 struct LDKCOption_CVec_SocketAddressZZ COption_CVec_SocketAddressZZ_clone(const struct LDKCOption_CVec_SocketAddressZZ *NONNULL_PTR orig);
27914 * Creates a new CResult_u64ShortChannelIdErrorZ in the success state.
27916 struct LDKCResult_u64ShortChannelIdErrorZ CResult_u64ShortChannelIdErrorZ_ok(uint64_t o);
27919 * Creates a new CResult_u64ShortChannelIdErrorZ in the error state.
27921 struct LDKCResult_u64ShortChannelIdErrorZ CResult_u64ShortChannelIdErrorZ_err(enum LDKShortChannelIdError e);
27924 * Checks if the given object is currently in the success state
27926 bool CResult_u64ShortChannelIdErrorZ_is_ok(const struct LDKCResult_u64ShortChannelIdErrorZ *NONNULL_PTR o);
27929 * Frees any resources used by the CResult_u64ShortChannelIdErrorZ.
27931 void CResult_u64ShortChannelIdErrorZ_free(struct LDKCResult_u64ShortChannelIdErrorZ _res);
27934 * Creates a new CResult_PendingHTLCInfoInboundHTLCErrZ in the success state.
27936 struct LDKCResult_PendingHTLCInfoInboundHTLCErrZ CResult_PendingHTLCInfoInboundHTLCErrZ_ok(struct LDKPendingHTLCInfo o);
27939 * Creates a new CResult_PendingHTLCInfoInboundHTLCErrZ in the error state.
27941 struct LDKCResult_PendingHTLCInfoInboundHTLCErrZ CResult_PendingHTLCInfoInboundHTLCErrZ_err(struct LDKInboundHTLCErr e);
27944 * Checks if the given object is currently in the success state
27946 bool CResult_PendingHTLCInfoInboundHTLCErrZ_is_ok(const struct LDKCResult_PendingHTLCInfoInboundHTLCErrZ *NONNULL_PTR o);
27949 * Frees any resources used by the CResult_PendingHTLCInfoInboundHTLCErrZ.
27951 void CResult_PendingHTLCInfoInboundHTLCErrZ_free(struct LDKCResult_PendingHTLCInfoInboundHTLCErrZ _res);
27954 * Creates a new CResult_PendingHTLCInfoInboundHTLCErrZ which has the same data as `orig`
27955 * but with all dynamically-allocated buffers duplicated in new buffers.
27957 struct LDKCResult_PendingHTLCInfoInboundHTLCErrZ CResult_PendingHTLCInfoInboundHTLCErrZ_clone(const struct LDKCResult_PendingHTLCInfoInboundHTLCErrZ *NONNULL_PTR orig);
27960 * Frees the buffer pointed to by `data` if `datalen` is non-0.
27962 void CVec_HTLCOutputInCommitmentZ_free(struct LDKCVec_HTLCOutputInCommitmentZ _res);
27965 * Frees the buffer pointed to by `data` if `datalen` is non-0.
27967 void CVec_HTLCDescriptorZ_free(struct LDKCVec_HTLCDescriptorZ _res);
27970 * Frees the buffer pointed to by `data` if `datalen` is non-0.
27972 void CVec_UtxoZ_free(struct LDKCVec_UtxoZ _res);
27975 * Constructs a new COption_TxOutZ containing a crate::c_types::TxOut
27977 struct LDKCOption_TxOutZ COption_TxOutZ_some(struct LDKTxOut o);
27980 * Constructs a new COption_TxOutZ containing nothing
27982 struct LDKCOption_TxOutZ COption_TxOutZ_none(void);
27985 * Frees any resources associated with the crate::c_types::TxOut, if we are in the Some state
27987 void COption_TxOutZ_free(struct LDKCOption_TxOutZ _res);
27990 * Creates a new COption_TxOutZ which has the same data as `orig`
27991 * but with all dynamically-allocated buffers duplicated in new buffers.
27993 struct LDKCOption_TxOutZ COption_TxOutZ_clone(const struct LDKCOption_TxOutZ *NONNULL_PTR orig);
27996 * Frees the buffer pointed to by `data` if `datalen` is non-0.
27998 void CVec_InputZ_free(struct LDKCVec_InputZ _res);
28001 * Creates a new CResult_CoinSelectionNoneZ in the success state.
28003 struct LDKCResult_CoinSelectionNoneZ CResult_CoinSelectionNoneZ_ok(struct LDKCoinSelection o);
28006 * Creates a new CResult_CoinSelectionNoneZ in the error state.
28008 struct LDKCResult_CoinSelectionNoneZ CResult_CoinSelectionNoneZ_err(void);
28011 * Checks if the given object is currently in the success state
28013 bool CResult_CoinSelectionNoneZ_is_ok(const struct LDKCResult_CoinSelectionNoneZ *NONNULL_PTR o);
28016 * Frees any resources used by the CResult_CoinSelectionNoneZ.
28018 void CResult_CoinSelectionNoneZ_free(struct LDKCResult_CoinSelectionNoneZ _res);
28021 * Creates a new CResult_CoinSelectionNoneZ which has the same data as `orig`
28022 * but with all dynamically-allocated buffers duplicated in new buffers.
28024 struct LDKCResult_CoinSelectionNoneZ CResult_CoinSelectionNoneZ_clone(const struct LDKCResult_CoinSelectionNoneZ *NONNULL_PTR orig);
28027 * Creates a new CResult_CVec_UtxoZNoneZ in the success state.
28029 struct LDKCResult_CVec_UtxoZNoneZ CResult_CVec_UtxoZNoneZ_ok(struct LDKCVec_UtxoZ o);
28032 * Creates a new CResult_CVec_UtxoZNoneZ in the error state.
28034 struct LDKCResult_CVec_UtxoZNoneZ CResult_CVec_UtxoZNoneZ_err(void);
28037 * Checks if the given object is currently in the success state
28039 bool CResult_CVec_UtxoZNoneZ_is_ok(const struct LDKCResult_CVec_UtxoZNoneZ *NONNULL_PTR o);
28042 * Frees any resources used by the CResult_CVec_UtxoZNoneZ.
28044 void CResult_CVec_UtxoZNoneZ_free(struct LDKCResult_CVec_UtxoZNoneZ _res);
28047 * Creates a new CResult_CVec_UtxoZNoneZ which has the same data as `orig`
28048 * but with all dynamically-allocated buffers duplicated in new buffers.
28050 struct LDKCResult_CVec_UtxoZNoneZ CResult_CVec_UtxoZNoneZ_clone(const struct LDKCResult_CVec_UtxoZNoneZ *NONNULL_PTR orig);
28053 * Constructs a new COption_PaymentContextZ containing a crate::lightning::blinded_path::payment::PaymentContext
28055 struct LDKCOption_PaymentContextZ COption_PaymentContextZ_some(struct LDKPaymentContext o);
28058 * Constructs a new COption_PaymentContextZ containing nothing
28060 struct LDKCOption_PaymentContextZ COption_PaymentContextZ_none(void);
28063 * Frees any resources associated with the crate::lightning::blinded_path::payment::PaymentContext, if we are in the Some state
28065 void COption_PaymentContextZ_free(struct LDKCOption_PaymentContextZ _res);
28068 * Creates a new COption_PaymentContextZ which has the same data as `orig`
28069 * but with all dynamically-allocated buffers duplicated in new buffers.
28071 struct LDKCOption_PaymentContextZ COption_PaymentContextZ_clone(const struct LDKCOption_PaymentContextZ *NONNULL_PTR orig);
28074 * Creates a new tuple which has the same data as `orig`
28075 * but with all dynamically-allocated buffers duplicated in new buffers.
28077 struct LDKC2Tuple_u64u16Z C2Tuple_u64u16Z_clone(const struct LDKC2Tuple_u64u16Z *NONNULL_PTR orig);
28080 * Creates a new C2Tuple_u64u16Z from the contained elements.
28082 struct LDKC2Tuple_u64u16Z C2Tuple_u64u16Z_new(uint64_t a, uint16_t b);
28085 * Frees any resources used by the C2Tuple_u64u16Z.
28087 void C2Tuple_u64u16Z_free(struct LDKC2Tuple_u64u16Z _res);
28090 * Constructs a new COption_C2Tuple_u64u16ZZ containing a crate::c_types::derived::C2Tuple_u64u16Z
28092 struct LDKCOption_C2Tuple_u64u16ZZ COption_C2Tuple_u64u16ZZ_some(struct LDKC2Tuple_u64u16Z o);
28095 * Constructs a new COption_C2Tuple_u64u16ZZ containing nothing
28097 struct LDKCOption_C2Tuple_u64u16ZZ COption_C2Tuple_u64u16ZZ_none(void);
28100 * Frees any resources associated with the crate::c_types::derived::C2Tuple_u64u16Z, if we are in the Some state
28102 void COption_C2Tuple_u64u16ZZ_free(struct LDKCOption_C2Tuple_u64u16ZZ _res);
28105 * Creates a new COption_C2Tuple_u64u16ZZ which has the same data as `orig`
28106 * but with all dynamically-allocated buffers duplicated in new buffers.
28108 struct LDKCOption_C2Tuple_u64u16ZZ COption_C2Tuple_u64u16ZZ_clone(const struct LDKCOption_C2Tuple_u64u16ZZ *NONNULL_PTR orig);
28111 * Creates a new CResult_ChannelIdAPIErrorZ in the success state.
28113 struct LDKCResult_ChannelIdAPIErrorZ CResult_ChannelIdAPIErrorZ_ok(struct LDKChannelId o);
28116 * Creates a new CResult_ChannelIdAPIErrorZ in the error state.
28118 struct LDKCResult_ChannelIdAPIErrorZ CResult_ChannelIdAPIErrorZ_err(struct LDKAPIError e);
28121 * Checks if the given object is currently in the success state
28123 bool CResult_ChannelIdAPIErrorZ_is_ok(const struct LDKCResult_ChannelIdAPIErrorZ *NONNULL_PTR o);
28126 * Frees any resources used by the CResult_ChannelIdAPIErrorZ.
28128 void CResult_ChannelIdAPIErrorZ_free(struct LDKCResult_ChannelIdAPIErrorZ _res);
28131 * Creates a new CResult_ChannelIdAPIErrorZ which has the same data as `orig`
28132 * but with all dynamically-allocated buffers duplicated in new buffers.
28134 struct LDKCResult_ChannelIdAPIErrorZ CResult_ChannelIdAPIErrorZ_clone(const struct LDKCResult_ChannelIdAPIErrorZ *NONNULL_PTR orig);
28137 * Frees the buffer pointed to by `data` if `datalen` is non-0.
28139 void CVec_RecentPaymentDetailsZ_free(struct LDKCVec_RecentPaymentDetailsZ _res);
28142 * Creates a new CResult_NonePaymentSendFailureZ in the success state.
28144 struct LDKCResult_NonePaymentSendFailureZ CResult_NonePaymentSendFailureZ_ok(void);
28147 * Creates a new CResult_NonePaymentSendFailureZ in the error state.
28149 struct LDKCResult_NonePaymentSendFailureZ CResult_NonePaymentSendFailureZ_err(struct LDKPaymentSendFailure e);
28152 * Checks if the given object is currently in the success state
28154 bool CResult_NonePaymentSendFailureZ_is_ok(const struct LDKCResult_NonePaymentSendFailureZ *NONNULL_PTR o);
28157 * Frees any resources used by the CResult_NonePaymentSendFailureZ.
28159 void CResult_NonePaymentSendFailureZ_free(struct LDKCResult_NonePaymentSendFailureZ _res);
28162 * Creates a new CResult_NonePaymentSendFailureZ which has the same data as `orig`
28163 * but with all dynamically-allocated buffers duplicated in new buffers.
28165 struct LDKCResult_NonePaymentSendFailureZ CResult_NonePaymentSendFailureZ_clone(const struct LDKCResult_NonePaymentSendFailureZ *NONNULL_PTR orig);
28168 * Creates a new CResult_NoneRetryableSendFailureZ in the success state.
28170 struct LDKCResult_NoneRetryableSendFailureZ CResult_NoneRetryableSendFailureZ_ok(void);
28173 * Creates a new CResult_NoneRetryableSendFailureZ in the error state.
28175 struct LDKCResult_NoneRetryableSendFailureZ CResult_NoneRetryableSendFailureZ_err(enum LDKRetryableSendFailure e);
28178 * Checks if the given object is currently in the success state
28180 bool CResult_NoneRetryableSendFailureZ_is_ok(const struct LDKCResult_NoneRetryableSendFailureZ *NONNULL_PTR o);
28183 * Frees any resources used by the CResult_NoneRetryableSendFailureZ.
28185 void CResult_NoneRetryableSendFailureZ_free(struct LDKCResult_NoneRetryableSendFailureZ _res);
28188 * Creates a new CResult_NoneRetryableSendFailureZ which has the same data as `orig`
28189 * but with all dynamically-allocated buffers duplicated in new buffers.
28191 struct LDKCResult_NoneRetryableSendFailureZ CResult_NoneRetryableSendFailureZ_clone(const struct LDKCResult_NoneRetryableSendFailureZ *NONNULL_PTR orig);
28194 * Creates a new CResult_ThirtyTwoBytesPaymentSendFailureZ in the success state.
28196 struct LDKCResult_ThirtyTwoBytesPaymentSendFailureZ CResult_ThirtyTwoBytesPaymentSendFailureZ_ok(struct LDKThirtyTwoBytes o);
28199 * Creates a new CResult_ThirtyTwoBytesPaymentSendFailureZ in the error state.
28201 struct LDKCResult_ThirtyTwoBytesPaymentSendFailureZ CResult_ThirtyTwoBytesPaymentSendFailureZ_err(struct LDKPaymentSendFailure e);
28204 * Checks if the given object is currently in the success state
28206 bool CResult_ThirtyTwoBytesPaymentSendFailureZ_is_ok(const struct LDKCResult_ThirtyTwoBytesPaymentSendFailureZ *NONNULL_PTR o);
28209 * Frees any resources used by the CResult_ThirtyTwoBytesPaymentSendFailureZ.
28211 void CResult_ThirtyTwoBytesPaymentSendFailureZ_free(struct LDKCResult_ThirtyTwoBytesPaymentSendFailureZ _res);
28214 * Creates a new CResult_ThirtyTwoBytesPaymentSendFailureZ which has the same data as `orig`
28215 * but with all dynamically-allocated buffers duplicated in new buffers.
28217 struct LDKCResult_ThirtyTwoBytesPaymentSendFailureZ CResult_ThirtyTwoBytesPaymentSendFailureZ_clone(const struct LDKCResult_ThirtyTwoBytesPaymentSendFailureZ *NONNULL_PTR orig);
28220 * Creates a new CResult_ThirtyTwoBytesRetryableSendFailureZ in the success state.
28222 struct LDKCResult_ThirtyTwoBytesRetryableSendFailureZ CResult_ThirtyTwoBytesRetryableSendFailureZ_ok(struct LDKThirtyTwoBytes o);
28225 * Creates a new CResult_ThirtyTwoBytesRetryableSendFailureZ in the error state.
28227 struct LDKCResult_ThirtyTwoBytesRetryableSendFailureZ CResult_ThirtyTwoBytesRetryableSendFailureZ_err(enum LDKRetryableSendFailure e);
28230 * Checks if the given object is currently in the success state
28232 bool CResult_ThirtyTwoBytesRetryableSendFailureZ_is_ok(const struct LDKCResult_ThirtyTwoBytesRetryableSendFailureZ *NONNULL_PTR o);
28235 * Frees any resources used by the CResult_ThirtyTwoBytesRetryableSendFailureZ.
28237 void CResult_ThirtyTwoBytesRetryableSendFailureZ_free(struct LDKCResult_ThirtyTwoBytesRetryableSendFailureZ _res);
28240 * Creates a new CResult_ThirtyTwoBytesRetryableSendFailureZ which has the same data as `orig`
28241 * but with all dynamically-allocated buffers duplicated in new buffers.
28243 struct LDKCResult_ThirtyTwoBytesRetryableSendFailureZ CResult_ThirtyTwoBytesRetryableSendFailureZ_clone(const struct LDKCResult_ThirtyTwoBytesRetryableSendFailureZ *NONNULL_PTR orig);
28246 * Creates a new tuple which has the same data as `orig`
28247 * but with all dynamically-allocated buffers duplicated in new buffers.
28249 struct LDKC2Tuple_ThirtyTwoBytesThirtyTwoBytesZ C2Tuple_ThirtyTwoBytesThirtyTwoBytesZ_clone(const struct LDKC2Tuple_ThirtyTwoBytesThirtyTwoBytesZ *NONNULL_PTR orig);
28252 * Creates a new C2Tuple_ThirtyTwoBytesThirtyTwoBytesZ from the contained elements.
28254 struct LDKC2Tuple_ThirtyTwoBytesThirtyTwoBytesZ C2Tuple_ThirtyTwoBytesThirtyTwoBytesZ_new(struct LDKThirtyTwoBytes a, struct LDKThirtyTwoBytes b);
28257 * Frees any resources used by the C2Tuple_ThirtyTwoBytesThirtyTwoBytesZ.
28259 void C2Tuple_ThirtyTwoBytesThirtyTwoBytesZ_free(struct LDKC2Tuple_ThirtyTwoBytesThirtyTwoBytesZ _res);
28262 * Creates a new CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ in the success state.
28264 struct LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ_ok(struct LDKC2Tuple_ThirtyTwoBytesThirtyTwoBytesZ o);
28267 * Creates a new CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ in the error state.
28269 struct LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ_err(struct LDKPaymentSendFailure e);
28272 * Checks if the given object is currently in the success state
28274 bool CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ_is_ok(const struct LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ *NONNULL_PTR o);
28277 * Frees any resources used by the CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ.
28279 void CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ_free(struct LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ _res);
28282 * Creates a new CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ which has the same data as `orig`
28283 * but with all dynamically-allocated buffers duplicated in new buffers.
28285 struct LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ_clone(const struct LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ *NONNULL_PTR orig);
28288 * Frees the buffer pointed to by `data` if `datalen` is non-0.
28290 void CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZ_free(struct LDKCVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZ _res);
28293 * Creates a new CResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ in the success state.
28295 struct LDKCResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ CResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ_ok(struct LDKCVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZ o);
28298 * Creates a new CResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ in the error state.
28300 struct LDKCResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ CResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ_err(struct LDKProbeSendFailure e);
28303 * Checks if the given object is currently in the success state
28305 bool CResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ_is_ok(const struct LDKCResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ *NONNULL_PTR o);
28308 * Frees any resources used by the CResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ.
28310 void CResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ_free(struct LDKCResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ _res);
28313 * Creates a new CResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ which has the same data as `orig`
28314 * but with all dynamically-allocated buffers duplicated in new buffers.
28316 struct LDKCResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ CResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ_clone(const struct LDKCResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ *NONNULL_PTR orig);
28319 * Creates a new tuple which has the same data as `orig`
28320 * but with all dynamically-allocated buffers duplicated in new buffers.
28322 struct LDKC2Tuple_ChannelIdPublicKeyZ C2Tuple_ChannelIdPublicKeyZ_clone(const struct LDKC2Tuple_ChannelIdPublicKeyZ *NONNULL_PTR orig);
28325 * Creates a new C2Tuple_ChannelIdPublicKeyZ from the contained elements.
28327 struct LDKC2Tuple_ChannelIdPublicKeyZ C2Tuple_ChannelIdPublicKeyZ_new(struct LDKChannelId a, struct LDKPublicKey b);
28330 * Frees any resources used by the C2Tuple_ChannelIdPublicKeyZ.
28332 void C2Tuple_ChannelIdPublicKeyZ_free(struct LDKC2Tuple_ChannelIdPublicKeyZ _res);
28335 * Frees the buffer pointed to by `data` if `datalen` is non-0.
28337 void CVec_C2Tuple_ChannelIdPublicKeyZZ_free(struct LDKCVec_C2Tuple_ChannelIdPublicKeyZZ _res);
28340 * Frees the buffer pointed to by `data` if `datalen` is non-0.
28342 void CVec_ChannelIdZ_free(struct LDKCVec_ChannelIdZ _res);
28345 * Creates a new CResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ in the success state.
28347 struct LDKCResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ CResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ_ok(struct LDKOfferWithDerivedMetadataBuilder o);
28350 * Creates a new CResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ in the error state.
28352 struct LDKCResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ CResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ_err(enum LDKBolt12SemanticError e);
28355 * Checks if the given object is currently in the success state
28357 bool CResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ_is_ok(const struct LDKCResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ *NONNULL_PTR o);
28360 * Frees any resources used by the CResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ.
28362 void CResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ_free(struct LDKCResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ _res);
28365 * Creates a new CResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ which has the same data as `orig`
28366 * but with all dynamically-allocated buffers duplicated in new buffers.
28368 struct LDKCResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ CResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ_clone(const struct LDKCResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ *NONNULL_PTR orig);
28371 * Constructs a new COption_StrZ containing a crate::c_types::Str
28373 struct LDKCOption_StrZ COption_StrZ_some(struct LDKStr o);
28376 * Constructs a new COption_StrZ containing nothing
28378 struct LDKCOption_StrZ COption_StrZ_none(void);
28381 * Frees any resources associated with the crate::c_types::Str, if we are in the Some state
28383 void COption_StrZ_free(struct LDKCOption_StrZ _res);
28386 * Creates a new COption_StrZ which has the same data as `orig`
28387 * but with all dynamically-allocated buffers duplicated in new buffers.
28389 struct LDKCOption_StrZ COption_StrZ_clone(const struct LDKCOption_StrZ *NONNULL_PTR orig);
28392 * Creates a new CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ in the success state.
28394 struct LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ_ok(struct LDKC2Tuple_ThirtyTwoBytesThirtyTwoBytesZ o);
28397 * Creates a new CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ in the error state.
28399 struct LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ_err(void);
28402 * Checks if the given object is currently in the success state
28404 bool CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ_is_ok(const struct LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ *NONNULL_PTR o);
28407 * Frees any resources used by the CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ.
28409 void CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ_free(struct LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ _res);
28412 * Creates a new CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ which has the same data as `orig`
28413 * but with all dynamically-allocated buffers duplicated in new buffers.
28415 struct LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ_clone(const struct LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ *NONNULL_PTR orig);
28418 * Creates a new CResult_ThirtyTwoBytesAPIErrorZ in the success state.
28420 struct LDKCResult_ThirtyTwoBytesAPIErrorZ CResult_ThirtyTwoBytesAPIErrorZ_ok(struct LDKThirtyTwoBytes o);
28423 * Creates a new CResult_ThirtyTwoBytesAPIErrorZ in the error state.
28425 struct LDKCResult_ThirtyTwoBytesAPIErrorZ CResult_ThirtyTwoBytesAPIErrorZ_err(struct LDKAPIError e);
28428 * Checks if the given object is currently in the success state
28430 bool CResult_ThirtyTwoBytesAPIErrorZ_is_ok(const struct LDKCResult_ThirtyTwoBytesAPIErrorZ *NONNULL_PTR o);
28433 * Frees any resources used by the CResult_ThirtyTwoBytesAPIErrorZ.
28435 void CResult_ThirtyTwoBytesAPIErrorZ_free(struct LDKCResult_ThirtyTwoBytesAPIErrorZ _res);
28438 * Creates a new CResult_ThirtyTwoBytesAPIErrorZ which has the same data as `orig`
28439 * but with all dynamically-allocated buffers duplicated in new buffers.
28441 struct LDKCResult_ThirtyTwoBytesAPIErrorZ CResult_ThirtyTwoBytesAPIErrorZ_clone(const struct LDKCResult_ThirtyTwoBytesAPIErrorZ *NONNULL_PTR orig);
28444 * Constructs a new COption_OffersMessageZ containing a crate::lightning::onion_message::offers::OffersMessage
28446 struct LDKCOption_OffersMessageZ COption_OffersMessageZ_some(struct LDKOffersMessage o);
28449 * Constructs a new COption_OffersMessageZ containing nothing
28451 struct LDKCOption_OffersMessageZ COption_OffersMessageZ_none(void);
28454 * Frees any resources associated with the crate::lightning::onion_message::offers::OffersMessage, if we are in the Some state
28456 void COption_OffersMessageZ_free(struct LDKCOption_OffersMessageZ _res);
28459 * Creates a new COption_OffersMessageZ which has the same data as `orig`
28460 * but with all dynamically-allocated buffers duplicated in new buffers.
28462 struct LDKCOption_OffersMessageZ COption_OffersMessageZ_clone(const struct LDKCOption_OffersMessageZ *NONNULL_PTR orig);
28465 * Creates a new tuple which has the same data as `orig`
28466 * but with all dynamically-allocated buffers duplicated in new buffers.
28468 struct LDKC3Tuple_OffersMessageDestinationBlindedPathZ C3Tuple_OffersMessageDestinationBlindedPathZ_clone(const struct LDKC3Tuple_OffersMessageDestinationBlindedPathZ *NONNULL_PTR orig);
28471 * Creates a new C3Tuple_OffersMessageDestinationBlindedPathZ from the contained elements.
28473 struct LDKC3Tuple_OffersMessageDestinationBlindedPathZ C3Tuple_OffersMessageDestinationBlindedPathZ_new(struct LDKOffersMessage a, struct LDKDestination b, struct LDKBlindedPath c);
28476 * Frees any resources used by the C3Tuple_OffersMessageDestinationBlindedPathZ.
28478 void C3Tuple_OffersMessageDestinationBlindedPathZ_free(struct LDKC3Tuple_OffersMessageDestinationBlindedPathZ _res);
28481 * Frees the buffer pointed to by `data` if `datalen` is non-0.
28483 void CVec_C3Tuple_OffersMessageDestinationBlindedPathZZ_free(struct LDKCVec_C3Tuple_OffersMessageDestinationBlindedPathZZ _res);
28486 * Creates a new CResult_PhantomRouteHintsDecodeErrorZ in the success state.
28488 struct LDKCResult_PhantomRouteHintsDecodeErrorZ CResult_PhantomRouteHintsDecodeErrorZ_ok(struct LDKPhantomRouteHints o);
28491 * Creates a new CResult_PhantomRouteHintsDecodeErrorZ in the error state.
28493 struct LDKCResult_PhantomRouteHintsDecodeErrorZ CResult_PhantomRouteHintsDecodeErrorZ_err(struct LDKDecodeError e);
28496 * Checks if the given object is currently in the success state
28498 bool CResult_PhantomRouteHintsDecodeErrorZ_is_ok(const struct LDKCResult_PhantomRouteHintsDecodeErrorZ *NONNULL_PTR o);
28501 * Frees any resources used by the CResult_PhantomRouteHintsDecodeErrorZ.
28503 void CResult_PhantomRouteHintsDecodeErrorZ_free(struct LDKCResult_PhantomRouteHintsDecodeErrorZ _res);
28506 * Creates a new CResult_PhantomRouteHintsDecodeErrorZ which has the same data as `orig`
28507 * but with all dynamically-allocated buffers duplicated in new buffers.
28509 struct LDKCResult_PhantomRouteHintsDecodeErrorZ CResult_PhantomRouteHintsDecodeErrorZ_clone(const struct LDKCResult_PhantomRouteHintsDecodeErrorZ *NONNULL_PTR orig);
28512 * Creates a new CResult_BlindedForwardDecodeErrorZ in the success state.
28514 struct LDKCResult_BlindedForwardDecodeErrorZ CResult_BlindedForwardDecodeErrorZ_ok(struct LDKBlindedForward o);
28517 * Creates a new CResult_BlindedForwardDecodeErrorZ in the error state.
28519 struct LDKCResult_BlindedForwardDecodeErrorZ CResult_BlindedForwardDecodeErrorZ_err(struct LDKDecodeError e);
28522 * Checks if the given object is currently in the success state
28524 bool CResult_BlindedForwardDecodeErrorZ_is_ok(const struct LDKCResult_BlindedForwardDecodeErrorZ *NONNULL_PTR o);
28527 * Frees any resources used by the CResult_BlindedForwardDecodeErrorZ.
28529 void CResult_BlindedForwardDecodeErrorZ_free(struct LDKCResult_BlindedForwardDecodeErrorZ _res);
28532 * Creates a new CResult_BlindedForwardDecodeErrorZ which has the same data as `orig`
28533 * but with all dynamically-allocated buffers duplicated in new buffers.
28535 struct LDKCResult_BlindedForwardDecodeErrorZ CResult_BlindedForwardDecodeErrorZ_clone(const struct LDKCResult_BlindedForwardDecodeErrorZ *NONNULL_PTR orig);
28538 * Creates a new CResult_PendingHTLCRoutingDecodeErrorZ in the success state.
28540 struct LDKCResult_PendingHTLCRoutingDecodeErrorZ CResult_PendingHTLCRoutingDecodeErrorZ_ok(struct LDKPendingHTLCRouting o);
28543 * Creates a new CResult_PendingHTLCRoutingDecodeErrorZ in the error state.
28545 struct LDKCResult_PendingHTLCRoutingDecodeErrorZ CResult_PendingHTLCRoutingDecodeErrorZ_err(struct LDKDecodeError e);
28548 * Checks if the given object is currently in the success state
28550 bool CResult_PendingHTLCRoutingDecodeErrorZ_is_ok(const struct LDKCResult_PendingHTLCRoutingDecodeErrorZ *NONNULL_PTR o);
28553 * Frees any resources used by the CResult_PendingHTLCRoutingDecodeErrorZ.
28555 void CResult_PendingHTLCRoutingDecodeErrorZ_free(struct LDKCResult_PendingHTLCRoutingDecodeErrorZ _res);
28558 * Creates a new CResult_PendingHTLCRoutingDecodeErrorZ which has the same data as `orig`
28559 * but with all dynamically-allocated buffers duplicated in new buffers.
28561 struct LDKCResult_PendingHTLCRoutingDecodeErrorZ CResult_PendingHTLCRoutingDecodeErrorZ_clone(const struct LDKCResult_PendingHTLCRoutingDecodeErrorZ *NONNULL_PTR orig);
28564 * Creates a new CResult_PendingHTLCInfoDecodeErrorZ in the success state.
28566 struct LDKCResult_PendingHTLCInfoDecodeErrorZ CResult_PendingHTLCInfoDecodeErrorZ_ok(struct LDKPendingHTLCInfo o);
28569 * Creates a new CResult_PendingHTLCInfoDecodeErrorZ in the error state.
28571 struct LDKCResult_PendingHTLCInfoDecodeErrorZ CResult_PendingHTLCInfoDecodeErrorZ_err(struct LDKDecodeError e);
28574 * Checks if the given object is currently in the success state
28576 bool CResult_PendingHTLCInfoDecodeErrorZ_is_ok(const struct LDKCResult_PendingHTLCInfoDecodeErrorZ *NONNULL_PTR o);
28579 * Frees any resources used by the CResult_PendingHTLCInfoDecodeErrorZ.
28581 void CResult_PendingHTLCInfoDecodeErrorZ_free(struct LDKCResult_PendingHTLCInfoDecodeErrorZ _res);
28584 * Creates a new CResult_PendingHTLCInfoDecodeErrorZ which has the same data as `orig`
28585 * but with all dynamically-allocated buffers duplicated in new buffers.
28587 struct LDKCResult_PendingHTLCInfoDecodeErrorZ CResult_PendingHTLCInfoDecodeErrorZ_clone(const struct LDKCResult_PendingHTLCInfoDecodeErrorZ *NONNULL_PTR orig);
28590 * Creates a new CResult_BlindedFailureDecodeErrorZ in the success state.
28592 struct LDKCResult_BlindedFailureDecodeErrorZ CResult_BlindedFailureDecodeErrorZ_ok(enum LDKBlindedFailure o);
28595 * Creates a new CResult_BlindedFailureDecodeErrorZ in the error state.
28597 struct LDKCResult_BlindedFailureDecodeErrorZ CResult_BlindedFailureDecodeErrorZ_err(struct LDKDecodeError e);
28600 * Checks if the given object is currently in the success state
28602 bool CResult_BlindedFailureDecodeErrorZ_is_ok(const struct LDKCResult_BlindedFailureDecodeErrorZ *NONNULL_PTR o);
28605 * Frees any resources used by the CResult_BlindedFailureDecodeErrorZ.
28607 void CResult_BlindedFailureDecodeErrorZ_free(struct LDKCResult_BlindedFailureDecodeErrorZ _res);
28610 * Creates a new CResult_BlindedFailureDecodeErrorZ which has the same data as `orig`
28611 * but with all dynamically-allocated buffers duplicated in new buffers.
28613 struct LDKCResult_BlindedFailureDecodeErrorZ CResult_BlindedFailureDecodeErrorZ_clone(const struct LDKCResult_BlindedFailureDecodeErrorZ *NONNULL_PTR orig);
28616 * Frees the buffer pointed to by `data` if `datalen` is non-0.
28618 void CVec_ChannelMonitorZ_free(struct LDKCVec_ChannelMonitorZ _res);
28621 * Creates a new C2Tuple_ThirtyTwoBytesChannelManagerZ from the contained elements.
28623 struct LDKC2Tuple_ThirtyTwoBytesChannelManagerZ C2Tuple_ThirtyTwoBytesChannelManagerZ_new(struct LDKThirtyTwoBytes a, struct LDKChannelManager b);
28626 * Frees any resources used by the C2Tuple_ThirtyTwoBytesChannelManagerZ.
28628 void C2Tuple_ThirtyTwoBytesChannelManagerZ_free(struct LDKC2Tuple_ThirtyTwoBytesChannelManagerZ _res);
28631 * Creates a new CResult_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ in the success state.
28633 struct LDKCResult_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ CResult_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ_ok(struct LDKC2Tuple_ThirtyTwoBytesChannelManagerZ o);
28636 * Creates a new CResult_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ in the error state.
28638 struct LDKCResult_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ CResult_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ_err(struct LDKDecodeError e);
28641 * Checks if the given object is currently in the success state
28643 bool CResult_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ_is_ok(const struct LDKCResult_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ *NONNULL_PTR o);
28646 * Frees any resources used by the CResult_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ.
28648 void CResult_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ_free(struct LDKCResult_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ _res);
28651 * Creates a new CResult_MaxDustHTLCExposureDecodeErrorZ in the success state.
28653 struct LDKCResult_MaxDustHTLCExposureDecodeErrorZ CResult_MaxDustHTLCExposureDecodeErrorZ_ok(struct LDKMaxDustHTLCExposure o);
28656 * Creates a new CResult_MaxDustHTLCExposureDecodeErrorZ in the error state.
28658 struct LDKCResult_MaxDustHTLCExposureDecodeErrorZ CResult_MaxDustHTLCExposureDecodeErrorZ_err(struct LDKDecodeError e);
28661 * Checks if the given object is currently in the success state
28663 bool CResult_MaxDustHTLCExposureDecodeErrorZ_is_ok(const struct LDKCResult_MaxDustHTLCExposureDecodeErrorZ *NONNULL_PTR o);
28666 * Frees any resources used by the CResult_MaxDustHTLCExposureDecodeErrorZ.
28668 void CResult_MaxDustHTLCExposureDecodeErrorZ_free(struct LDKCResult_MaxDustHTLCExposureDecodeErrorZ _res);
28671 * Creates a new CResult_MaxDustHTLCExposureDecodeErrorZ which has the same data as `orig`
28672 * but with all dynamically-allocated buffers duplicated in new buffers.
28674 struct LDKCResult_MaxDustHTLCExposureDecodeErrorZ CResult_MaxDustHTLCExposureDecodeErrorZ_clone(const struct LDKCResult_MaxDustHTLCExposureDecodeErrorZ *NONNULL_PTR orig);
28677 * Creates a new CResult_ChannelConfigDecodeErrorZ in the success state.
28679 struct LDKCResult_ChannelConfigDecodeErrorZ CResult_ChannelConfigDecodeErrorZ_ok(struct LDKChannelConfig o);
28682 * Creates a new CResult_ChannelConfigDecodeErrorZ in the error state.
28684 struct LDKCResult_ChannelConfigDecodeErrorZ CResult_ChannelConfigDecodeErrorZ_err(struct LDKDecodeError e);
28687 * Checks if the given object is currently in the success state
28689 bool CResult_ChannelConfigDecodeErrorZ_is_ok(const struct LDKCResult_ChannelConfigDecodeErrorZ *NONNULL_PTR o);
28692 * Frees any resources used by the CResult_ChannelConfigDecodeErrorZ.
28694 void CResult_ChannelConfigDecodeErrorZ_free(struct LDKCResult_ChannelConfigDecodeErrorZ _res);
28697 * Creates a new CResult_ChannelConfigDecodeErrorZ which has the same data as `orig`
28698 * but with all dynamically-allocated buffers duplicated in new buffers.
28700 struct LDKCResult_ChannelConfigDecodeErrorZ CResult_ChannelConfigDecodeErrorZ_clone(const struct LDKCResult_ChannelConfigDecodeErrorZ *NONNULL_PTR orig);
28703 * Constructs a new COption_MaxDustHTLCExposureZ containing a crate::lightning::util::config::MaxDustHTLCExposure
28705 struct LDKCOption_MaxDustHTLCExposureZ COption_MaxDustHTLCExposureZ_some(struct LDKMaxDustHTLCExposure o);
28708 * Constructs a new COption_MaxDustHTLCExposureZ containing nothing
28710 struct LDKCOption_MaxDustHTLCExposureZ COption_MaxDustHTLCExposureZ_none(void);
28713 * Frees any resources associated with the crate::lightning::util::config::MaxDustHTLCExposure, if we are in the Some state
28715 void COption_MaxDustHTLCExposureZ_free(struct LDKCOption_MaxDustHTLCExposureZ _res);
28718 * Creates a new COption_MaxDustHTLCExposureZ which has the same data as `orig`
28719 * but with all dynamically-allocated buffers duplicated in new buffers.
28721 struct LDKCOption_MaxDustHTLCExposureZ COption_MaxDustHTLCExposureZ_clone(const struct LDKCOption_MaxDustHTLCExposureZ *NONNULL_PTR orig);
28724 * Constructs a new COption_APIErrorZ containing a crate::lightning::util::errors::APIError
28726 struct LDKCOption_APIErrorZ COption_APIErrorZ_some(struct LDKAPIError o);
28729 * Constructs a new COption_APIErrorZ containing nothing
28731 struct LDKCOption_APIErrorZ COption_APIErrorZ_none(void);
28734 * Frees any resources associated with the crate::lightning::util::errors::APIError, if we are in the Some state
28736 void COption_APIErrorZ_free(struct LDKCOption_APIErrorZ _res);
28739 * Creates a new COption_APIErrorZ which has the same data as `orig`
28740 * but with all dynamically-allocated buffers duplicated in new buffers.
28742 struct LDKCOption_APIErrorZ COption_APIErrorZ_clone(const struct LDKCOption_APIErrorZ *NONNULL_PTR orig);
28745 * Creates a new CResult_COption_APIErrorZDecodeErrorZ in the success state.
28747 struct LDKCResult_COption_APIErrorZDecodeErrorZ CResult_COption_APIErrorZDecodeErrorZ_ok(struct LDKCOption_APIErrorZ o);
28750 * Creates a new CResult_COption_APIErrorZDecodeErrorZ in the error state.
28752 struct LDKCResult_COption_APIErrorZDecodeErrorZ CResult_COption_APIErrorZDecodeErrorZ_err(struct LDKDecodeError e);
28755 * Checks if the given object is currently in the success state
28757 bool CResult_COption_APIErrorZDecodeErrorZ_is_ok(const struct LDKCResult_COption_APIErrorZDecodeErrorZ *NONNULL_PTR o);
28760 * Frees any resources used by the CResult_COption_APIErrorZDecodeErrorZ.
28762 void CResult_COption_APIErrorZDecodeErrorZ_free(struct LDKCResult_COption_APIErrorZDecodeErrorZ _res);
28765 * Creates a new CResult_COption_APIErrorZDecodeErrorZ which has the same data as `orig`
28766 * but with all dynamically-allocated buffers duplicated in new buffers.
28768 struct LDKCResult_COption_APIErrorZDecodeErrorZ CResult_COption_APIErrorZDecodeErrorZ_clone(const struct LDKCResult_COption_APIErrorZDecodeErrorZ *NONNULL_PTR orig);
28771 * Creates a new CResult_ChannelMonitorUpdateDecodeErrorZ in the success state.
28773 struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ CResult_ChannelMonitorUpdateDecodeErrorZ_ok(struct LDKChannelMonitorUpdate o);
28776 * Creates a new CResult_ChannelMonitorUpdateDecodeErrorZ in the error state.
28778 struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ CResult_ChannelMonitorUpdateDecodeErrorZ_err(struct LDKDecodeError e);
28781 * Checks if the given object is currently in the success state
28783 bool CResult_ChannelMonitorUpdateDecodeErrorZ_is_ok(const struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ *NONNULL_PTR o);
28786 * Frees any resources used by the CResult_ChannelMonitorUpdateDecodeErrorZ.
28788 void CResult_ChannelMonitorUpdateDecodeErrorZ_free(struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ _res);
28791 * Creates a new CResult_ChannelMonitorUpdateDecodeErrorZ which has the same data as `orig`
28792 * but with all dynamically-allocated buffers duplicated in new buffers.
28794 struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ CResult_ChannelMonitorUpdateDecodeErrorZ_clone(const struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ *NONNULL_PTR orig);
28797 * Constructs a new COption_MonitorEventZ containing a crate::lightning::chain::channelmonitor::MonitorEvent
28799 struct LDKCOption_MonitorEventZ COption_MonitorEventZ_some(struct LDKMonitorEvent o);
28802 * Constructs a new COption_MonitorEventZ containing nothing
28804 struct LDKCOption_MonitorEventZ COption_MonitorEventZ_none(void);
28807 * Frees any resources associated with the crate::lightning::chain::channelmonitor::MonitorEvent, if we are in the Some state
28809 void COption_MonitorEventZ_free(struct LDKCOption_MonitorEventZ _res);
28812 * Creates a new COption_MonitorEventZ which has the same data as `orig`
28813 * but with all dynamically-allocated buffers duplicated in new buffers.
28815 struct LDKCOption_MonitorEventZ COption_MonitorEventZ_clone(const struct LDKCOption_MonitorEventZ *NONNULL_PTR orig);
28818 * Creates a new CResult_COption_MonitorEventZDecodeErrorZ in the success state.
28820 struct LDKCResult_COption_MonitorEventZDecodeErrorZ CResult_COption_MonitorEventZDecodeErrorZ_ok(struct LDKCOption_MonitorEventZ o);
28823 * Creates a new CResult_COption_MonitorEventZDecodeErrorZ in the error state.
28825 struct LDKCResult_COption_MonitorEventZDecodeErrorZ CResult_COption_MonitorEventZDecodeErrorZ_err(struct LDKDecodeError e);
28828 * Checks if the given object is currently in the success state
28830 bool CResult_COption_MonitorEventZDecodeErrorZ_is_ok(const struct LDKCResult_COption_MonitorEventZDecodeErrorZ *NONNULL_PTR o);
28833 * Frees any resources used by the CResult_COption_MonitorEventZDecodeErrorZ.
28835 void CResult_COption_MonitorEventZDecodeErrorZ_free(struct LDKCResult_COption_MonitorEventZDecodeErrorZ _res);
28838 * Creates a new CResult_COption_MonitorEventZDecodeErrorZ which has the same data as `orig`
28839 * but with all dynamically-allocated buffers duplicated in new buffers.
28841 struct LDKCResult_COption_MonitorEventZDecodeErrorZ CResult_COption_MonitorEventZDecodeErrorZ_clone(const struct LDKCResult_COption_MonitorEventZDecodeErrorZ *NONNULL_PTR orig);
28844 * Creates a new CResult_HTLCUpdateDecodeErrorZ in the success state.
28846 struct LDKCResult_HTLCUpdateDecodeErrorZ CResult_HTLCUpdateDecodeErrorZ_ok(struct LDKHTLCUpdate o);
28849 * Creates a new CResult_HTLCUpdateDecodeErrorZ in the error state.
28851 struct LDKCResult_HTLCUpdateDecodeErrorZ CResult_HTLCUpdateDecodeErrorZ_err(struct LDKDecodeError e);
28854 * Checks if the given object is currently in the success state
28856 bool CResult_HTLCUpdateDecodeErrorZ_is_ok(const struct LDKCResult_HTLCUpdateDecodeErrorZ *NONNULL_PTR o);
28859 * Frees any resources used by the CResult_HTLCUpdateDecodeErrorZ.
28861 void CResult_HTLCUpdateDecodeErrorZ_free(struct LDKCResult_HTLCUpdateDecodeErrorZ _res);
28864 * Creates a new CResult_HTLCUpdateDecodeErrorZ which has the same data as `orig`
28865 * but with all dynamically-allocated buffers duplicated in new buffers.
28867 struct LDKCResult_HTLCUpdateDecodeErrorZ CResult_HTLCUpdateDecodeErrorZ_clone(const struct LDKCResult_HTLCUpdateDecodeErrorZ *NONNULL_PTR orig);
28870 * Creates a new tuple which has the same data as `orig`
28871 * but with all dynamically-allocated buffers duplicated in new buffers.
28873 struct LDKC2Tuple_OutPointCVec_u8ZZ C2Tuple_OutPointCVec_u8ZZ_clone(const struct LDKC2Tuple_OutPointCVec_u8ZZ *NONNULL_PTR orig);
28876 * Creates a new C2Tuple_OutPointCVec_u8ZZ from the contained elements.
28878 struct LDKC2Tuple_OutPointCVec_u8ZZ C2Tuple_OutPointCVec_u8ZZ_new(struct LDKOutPoint a, struct LDKCVec_u8Z b);
28881 * Frees any resources used by the C2Tuple_OutPointCVec_u8ZZ.
28883 void C2Tuple_OutPointCVec_u8ZZ_free(struct LDKC2Tuple_OutPointCVec_u8ZZ _res);
28886 * Creates a new tuple which has the same data as `orig`
28887 * but with all dynamically-allocated buffers duplicated in new buffers.
28889 struct LDKC2Tuple_u32CVec_u8ZZ C2Tuple_u32CVec_u8ZZ_clone(const struct LDKC2Tuple_u32CVec_u8ZZ *NONNULL_PTR orig);
28892 * Creates a new C2Tuple_u32CVec_u8ZZ from the contained elements.
28894 struct LDKC2Tuple_u32CVec_u8ZZ C2Tuple_u32CVec_u8ZZ_new(uint32_t a, struct LDKCVec_u8Z b);
28897 * Frees any resources used by the C2Tuple_u32CVec_u8ZZ.
28899 void C2Tuple_u32CVec_u8ZZ_free(struct LDKC2Tuple_u32CVec_u8ZZ _res);
28902 * Frees the buffer pointed to by `data` if `datalen` is non-0.
28904 void CVec_C2Tuple_u32CVec_u8ZZZ_free(struct LDKCVec_C2Tuple_u32CVec_u8ZZZ _res);
28907 * Creates a new tuple which has the same data as `orig`
28908 * but with all dynamically-allocated buffers duplicated in new buffers.
28910 struct LDKC2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZ C2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZ_clone(const struct LDKC2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZ *NONNULL_PTR orig);
28913 * Creates a new C2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZ from the contained elements.
28915 struct LDKC2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZ C2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZ_new(struct LDKThirtyTwoBytes a, struct LDKCVec_C2Tuple_u32CVec_u8ZZZ b);
28918 * Frees any resources used by the C2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZ.
28920 void C2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZ_free(struct LDKC2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZ _res);
28923 * Frees the buffer pointed to by `data` if `datalen` is non-0.
28925 void CVec_C2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZZ_free(struct LDKCVec_C2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZZ _res);
28928 * Frees the buffer pointed to by `data` if `datalen` is non-0.
28930 void CVec_CommitmentTransactionZ_free(struct LDKCVec_CommitmentTransactionZ _res);
28933 * Creates a new tuple which has the same data as `orig`
28934 * but with all dynamically-allocated buffers duplicated in new buffers.
28936 struct LDKC2Tuple_u32TxOutZ C2Tuple_u32TxOutZ_clone(const struct LDKC2Tuple_u32TxOutZ *NONNULL_PTR orig);
28939 * Creates a new C2Tuple_u32TxOutZ from the contained elements.
28941 struct LDKC2Tuple_u32TxOutZ C2Tuple_u32TxOutZ_new(uint32_t a, struct LDKTxOut b);
28944 * Frees any resources used by the C2Tuple_u32TxOutZ.
28946 void C2Tuple_u32TxOutZ_free(struct LDKC2Tuple_u32TxOutZ _res);
28949 * Frees the buffer pointed to by `data` if `datalen` is non-0.
28951 void CVec_C2Tuple_u32TxOutZZ_free(struct LDKCVec_C2Tuple_u32TxOutZZ _res);
28954 * Creates a new tuple which has the same data as `orig`
28955 * but with all dynamically-allocated buffers duplicated in new buffers.
28957 struct LDKC2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32TxOutZZZ C2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32TxOutZZZ_clone(const struct LDKC2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32TxOutZZZ *NONNULL_PTR orig);
28960 * Creates a new C2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32TxOutZZZ from the contained elements.
28962 struct LDKC2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32TxOutZZZ C2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32TxOutZZZ_new(struct LDKThirtyTwoBytes a, struct LDKCVec_C2Tuple_u32TxOutZZ b);
28965 * Frees any resources used by the C2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32TxOutZZZ.
28967 void C2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32TxOutZZZ_free(struct LDKC2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32TxOutZZZ _res);
28970 * Frees the buffer pointed to by `data` if `datalen` is non-0.
28972 void CVec_TransactionOutputsZ_free(struct LDKCVec_TransactionOutputsZ _res);
28975 * Frees the buffer pointed to by `data` if `datalen` is non-0.
28977 void CVec_BalanceZ_free(struct LDKCVec_BalanceZ _res);
28980 * Creates a new tuple which has the same data as `orig`
28981 * but with all dynamically-allocated buffers duplicated in new buffers.
28983 struct LDKC2Tuple_ThirtyTwoBytesChannelMonitorZ C2Tuple_ThirtyTwoBytesChannelMonitorZ_clone(const struct LDKC2Tuple_ThirtyTwoBytesChannelMonitorZ *NONNULL_PTR orig);
28986 * Creates a new C2Tuple_ThirtyTwoBytesChannelMonitorZ from the contained elements.
28988 struct LDKC2Tuple_ThirtyTwoBytesChannelMonitorZ C2Tuple_ThirtyTwoBytesChannelMonitorZ_new(struct LDKThirtyTwoBytes a, struct LDKChannelMonitor b);
28991 * Frees any resources used by the C2Tuple_ThirtyTwoBytesChannelMonitorZ.
28993 void C2Tuple_ThirtyTwoBytesChannelMonitorZ_free(struct LDKC2Tuple_ThirtyTwoBytesChannelMonitorZ _res);
28996 * Creates a new CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ in the success state.
28998 struct LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ_ok(struct LDKC2Tuple_ThirtyTwoBytesChannelMonitorZ o);
29001 * Creates a new CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ in the error state.
29003 struct LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ_err(struct LDKDecodeError e);
29006 * Checks if the given object is currently in the success state
29008 bool CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ_is_ok(const struct LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ *NONNULL_PTR o);
29011 * Frees any resources used by the CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ.
29013 void CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ_free(struct LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ _res);
29016 * Creates a new CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ which has the same data as `orig`
29017 * but with all dynamically-allocated buffers duplicated in new buffers.
29019 struct LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ_clone(const struct LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ *NONNULL_PTR orig);
29022 * Creates a new tuple which has the same data as `orig`
29023 * but with all dynamically-allocated buffers duplicated in new buffers.
29025 struct LDKC2Tuple_PublicKeyTypeZ C2Tuple_PublicKeyTypeZ_clone(const struct LDKC2Tuple_PublicKeyTypeZ *NONNULL_PTR orig);
29028 * Creates a new C2Tuple_PublicKeyTypeZ from the contained elements.
29030 struct LDKC2Tuple_PublicKeyTypeZ C2Tuple_PublicKeyTypeZ_new(struct LDKPublicKey a, struct LDKType b);
29033 * Frees any resources used by the C2Tuple_PublicKeyTypeZ.
29035 void C2Tuple_PublicKeyTypeZ_free(struct LDKC2Tuple_PublicKeyTypeZ _res);
29038 * Frees the buffer pointed to by `data` if `datalen` is non-0.
29040 void CVec_C2Tuple_PublicKeyTypeZZ_free(struct LDKCVec_C2Tuple_PublicKeyTypeZZ _res);
29043 * Creates a new tuple which has the same data as `orig`
29044 * but with all dynamically-allocated buffers duplicated in new buffers.
29046 struct LDKC2Tuple_PublicKeyCVec_SocketAddressZZ C2Tuple_PublicKeyCVec_SocketAddressZZ_clone(const struct LDKC2Tuple_PublicKeyCVec_SocketAddressZZ *NONNULL_PTR orig);
29049 * Creates a new C2Tuple_PublicKeyCVec_SocketAddressZZ from the contained elements.
29051 struct LDKC2Tuple_PublicKeyCVec_SocketAddressZZ C2Tuple_PublicKeyCVec_SocketAddressZZ_new(struct LDKPublicKey a, struct LDKCVec_SocketAddressZ b);
29054 * Frees any resources used by the C2Tuple_PublicKeyCVec_SocketAddressZZ.
29056 void C2Tuple_PublicKeyCVec_SocketAddressZZ_free(struct LDKC2Tuple_PublicKeyCVec_SocketAddressZZ _res);
29059 * Frees the buffer pointed to by `data` if `datalen` is non-0.
29061 void CVec_C2Tuple_PublicKeyCVec_SocketAddressZZZ_free(struct LDKCVec_C2Tuple_PublicKeyCVec_SocketAddressZZZ _res);
29064 * Constructs a new COption_OnionMessageContentsZ containing a crate::lightning::onion_message::packet::OnionMessageContents
29066 struct LDKCOption_OnionMessageContentsZ COption_OnionMessageContentsZ_some(struct LDKOnionMessageContents o);
29069 * Constructs a new COption_OnionMessageContentsZ containing nothing
29071 struct LDKCOption_OnionMessageContentsZ COption_OnionMessageContentsZ_none(void);
29074 * Frees any resources associated with the crate::lightning::onion_message::packet::OnionMessageContents, if we are in the Some state
29076 void COption_OnionMessageContentsZ_free(struct LDKCOption_OnionMessageContentsZ _res);
29079 * Creates a new COption_OnionMessageContentsZ which has the same data as `orig`
29080 * but with all dynamically-allocated buffers duplicated in new buffers.
29082 struct LDKCOption_OnionMessageContentsZ COption_OnionMessageContentsZ_clone(const struct LDKCOption_OnionMessageContentsZ *NONNULL_PTR orig);
29085 * Creates a new CResult_COption_OnionMessageContentsZDecodeErrorZ in the success state.
29087 struct LDKCResult_COption_OnionMessageContentsZDecodeErrorZ CResult_COption_OnionMessageContentsZDecodeErrorZ_ok(struct LDKCOption_OnionMessageContentsZ o);
29090 * Creates a new CResult_COption_OnionMessageContentsZDecodeErrorZ in the error state.
29092 struct LDKCResult_COption_OnionMessageContentsZDecodeErrorZ CResult_COption_OnionMessageContentsZDecodeErrorZ_err(struct LDKDecodeError e);
29095 * Checks if the given object is currently in the success state
29097 bool CResult_COption_OnionMessageContentsZDecodeErrorZ_is_ok(const struct LDKCResult_COption_OnionMessageContentsZDecodeErrorZ *NONNULL_PTR o);
29100 * Frees any resources used by the CResult_COption_OnionMessageContentsZDecodeErrorZ.
29102 void CResult_COption_OnionMessageContentsZDecodeErrorZ_free(struct LDKCResult_COption_OnionMessageContentsZDecodeErrorZ _res);
29105 * Creates a new CResult_COption_OnionMessageContentsZDecodeErrorZ which has the same data as `orig`
29106 * but with all dynamically-allocated buffers duplicated in new buffers.
29108 struct LDKCResult_COption_OnionMessageContentsZDecodeErrorZ CResult_COption_OnionMessageContentsZDecodeErrorZ_clone(const struct LDKCResult_COption_OnionMessageContentsZDecodeErrorZ *NONNULL_PTR orig);
29111 * Creates a new tuple which has the same data as `orig`
29112 * but with all dynamically-allocated buffers duplicated in new buffers.
29114 struct LDKC3Tuple_OnionMessageContentsDestinationBlindedPathZ C3Tuple_OnionMessageContentsDestinationBlindedPathZ_clone(const struct LDKC3Tuple_OnionMessageContentsDestinationBlindedPathZ *NONNULL_PTR orig);
29117 * Creates a new C3Tuple_OnionMessageContentsDestinationBlindedPathZ from the contained elements.
29119 struct LDKC3Tuple_OnionMessageContentsDestinationBlindedPathZ C3Tuple_OnionMessageContentsDestinationBlindedPathZ_new(struct LDKOnionMessageContents a, struct LDKDestination b, struct LDKBlindedPath c);
29122 * Frees any resources used by the C3Tuple_OnionMessageContentsDestinationBlindedPathZ.
29124 void C3Tuple_OnionMessageContentsDestinationBlindedPathZ_free(struct LDKC3Tuple_OnionMessageContentsDestinationBlindedPathZ _res);
29127 * Frees the buffer pointed to by `data` if `datalen` is non-0.
29129 void CVec_C3Tuple_OnionMessageContentsDestinationBlindedPathZZ_free(struct LDKCVec_C3Tuple_OnionMessageContentsDestinationBlindedPathZZ _res);
29132 * Constructs a new COption_TypeZ containing a crate::lightning::ln::wire::Type
29134 struct LDKCOption_TypeZ COption_TypeZ_some(struct LDKType o);
29137 * Constructs a new COption_TypeZ containing nothing
29139 struct LDKCOption_TypeZ COption_TypeZ_none(void);
29142 * Frees any resources associated with the crate::lightning::ln::wire::Type, if we are in the Some state
29144 void COption_TypeZ_free(struct LDKCOption_TypeZ _res);
29147 * Creates a new COption_TypeZ which has the same data as `orig`
29148 * but with all dynamically-allocated buffers duplicated in new buffers.
29150 struct LDKCOption_TypeZ COption_TypeZ_clone(const struct LDKCOption_TypeZ *NONNULL_PTR orig);
29153 * Creates a new CResult_COption_TypeZDecodeErrorZ in the success state.
29155 struct LDKCResult_COption_TypeZDecodeErrorZ CResult_COption_TypeZDecodeErrorZ_ok(struct LDKCOption_TypeZ o);
29158 * Creates a new CResult_COption_TypeZDecodeErrorZ in the error state.
29160 struct LDKCResult_COption_TypeZDecodeErrorZ CResult_COption_TypeZDecodeErrorZ_err(struct LDKDecodeError e);
29163 * Checks if the given object is currently in the success state
29165 bool CResult_COption_TypeZDecodeErrorZ_is_ok(const struct LDKCResult_COption_TypeZDecodeErrorZ *NONNULL_PTR o);
29168 * Frees any resources used by the CResult_COption_TypeZDecodeErrorZ.
29170 void CResult_COption_TypeZDecodeErrorZ_free(struct LDKCResult_COption_TypeZDecodeErrorZ _res);
29173 * Creates a new CResult_COption_TypeZDecodeErrorZ which has the same data as `orig`
29174 * but with all dynamically-allocated buffers duplicated in new buffers.
29176 struct LDKCResult_COption_TypeZDecodeErrorZ CResult_COption_TypeZDecodeErrorZ_clone(const struct LDKCResult_COption_TypeZDecodeErrorZ *NONNULL_PTR orig);
29179 * Constructs a new COption_SocketAddressZ containing a crate::lightning::ln::msgs::SocketAddress
29181 struct LDKCOption_SocketAddressZ COption_SocketAddressZ_some(struct LDKSocketAddress o);
29184 * Constructs a new COption_SocketAddressZ containing nothing
29186 struct LDKCOption_SocketAddressZ COption_SocketAddressZ_none(void);
29189 * Frees any resources associated with the crate::lightning::ln::msgs::SocketAddress, if we are in the Some state
29191 void COption_SocketAddressZ_free(struct LDKCOption_SocketAddressZ _res);
29194 * Creates a new COption_SocketAddressZ which has the same data as `orig`
29195 * but with all dynamically-allocated buffers duplicated in new buffers.
29197 struct LDKCOption_SocketAddressZ COption_SocketAddressZ_clone(const struct LDKCOption_SocketAddressZ *NONNULL_PTR orig);
29200 * Frees the buffer pointed to by `data` if `datalen` is non-0.
29202 void CVec_PeerDetailsZ_free(struct LDKCVec_PeerDetailsZ _res);
29205 * Creates a new CResult_CVec_u8ZPeerHandleErrorZ in the success state.
29207 struct LDKCResult_CVec_u8ZPeerHandleErrorZ CResult_CVec_u8ZPeerHandleErrorZ_ok(struct LDKCVec_u8Z o);
29210 * Creates a new CResult_CVec_u8ZPeerHandleErrorZ in the error state.
29212 struct LDKCResult_CVec_u8ZPeerHandleErrorZ CResult_CVec_u8ZPeerHandleErrorZ_err(struct LDKPeerHandleError e);
29215 * Checks if the given object is currently in the success state
29217 bool CResult_CVec_u8ZPeerHandleErrorZ_is_ok(const struct LDKCResult_CVec_u8ZPeerHandleErrorZ *NONNULL_PTR o);
29220 * Frees any resources used by the CResult_CVec_u8ZPeerHandleErrorZ.
29222 void CResult_CVec_u8ZPeerHandleErrorZ_free(struct LDKCResult_CVec_u8ZPeerHandleErrorZ _res);
29225 * Creates a new CResult_CVec_u8ZPeerHandleErrorZ which has the same data as `orig`
29226 * but with all dynamically-allocated buffers duplicated in new buffers.
29228 struct LDKCResult_CVec_u8ZPeerHandleErrorZ CResult_CVec_u8ZPeerHandleErrorZ_clone(const struct LDKCResult_CVec_u8ZPeerHandleErrorZ *NONNULL_PTR orig);
29231 * Creates a new CResult_NonePeerHandleErrorZ in the success state.
29233 struct LDKCResult_NonePeerHandleErrorZ CResult_NonePeerHandleErrorZ_ok(void);
29236 * Creates a new CResult_NonePeerHandleErrorZ in the error state.
29238 struct LDKCResult_NonePeerHandleErrorZ CResult_NonePeerHandleErrorZ_err(struct LDKPeerHandleError e);
29241 * Checks if the given object is currently in the success state
29243 bool CResult_NonePeerHandleErrorZ_is_ok(const struct LDKCResult_NonePeerHandleErrorZ *NONNULL_PTR o);
29246 * Frees any resources used by the CResult_NonePeerHandleErrorZ.
29248 void CResult_NonePeerHandleErrorZ_free(struct LDKCResult_NonePeerHandleErrorZ _res);
29251 * Creates a new CResult_NonePeerHandleErrorZ which has the same data as `orig`
29252 * but with all dynamically-allocated buffers duplicated in new buffers.
29254 struct LDKCResult_NonePeerHandleErrorZ CResult_NonePeerHandleErrorZ_clone(const struct LDKCResult_NonePeerHandleErrorZ *NONNULL_PTR orig);
29257 * Creates a new CResult_boolPeerHandleErrorZ in the success state.
29259 struct LDKCResult_boolPeerHandleErrorZ CResult_boolPeerHandleErrorZ_ok(bool o);
29262 * Creates a new CResult_boolPeerHandleErrorZ in the error state.
29264 struct LDKCResult_boolPeerHandleErrorZ CResult_boolPeerHandleErrorZ_err(struct LDKPeerHandleError e);
29267 * Checks if the given object is currently in the success state
29269 bool CResult_boolPeerHandleErrorZ_is_ok(const struct LDKCResult_boolPeerHandleErrorZ *NONNULL_PTR o);
29272 * Frees any resources used by the CResult_boolPeerHandleErrorZ.
29274 void CResult_boolPeerHandleErrorZ_free(struct LDKCResult_boolPeerHandleErrorZ _res);
29277 * Creates a new CResult_boolPeerHandleErrorZ which has the same data as `orig`
29278 * but with all dynamically-allocated buffers duplicated in new buffers.
29280 struct LDKCResult_boolPeerHandleErrorZ CResult_boolPeerHandleErrorZ_clone(const struct LDKCResult_boolPeerHandleErrorZ *NONNULL_PTR orig);
29283 * Creates a new CResult_u32GraphSyncErrorZ in the success state.
29285 struct LDKCResult_u32GraphSyncErrorZ CResult_u32GraphSyncErrorZ_ok(uint32_t o);
29288 * Creates a new CResult_u32GraphSyncErrorZ in the error state.
29290 struct LDKCResult_u32GraphSyncErrorZ CResult_u32GraphSyncErrorZ_err(struct LDKGraphSyncError e);
29293 * Checks if the given object is currently in the success state
29295 bool CResult_u32GraphSyncErrorZ_is_ok(const struct LDKCResult_u32GraphSyncErrorZ *NONNULL_PTR o);
29298 * Frees any resources used by the CResult_u32GraphSyncErrorZ.
29300 void CResult_u32GraphSyncErrorZ_free(struct LDKCResult_u32GraphSyncErrorZ _res);
29303 * Creates a new CResult_CVec_u8ZIOErrorZ in the success state.
29305 struct LDKCResult_CVec_u8ZIOErrorZ CResult_CVec_u8ZIOErrorZ_ok(struct LDKCVec_u8Z o);
29308 * Creates a new CResult_CVec_u8ZIOErrorZ in the error state.
29310 struct LDKCResult_CVec_u8ZIOErrorZ CResult_CVec_u8ZIOErrorZ_err(enum LDKIOError e);
29313 * Checks if the given object is currently in the success state
29315 bool CResult_CVec_u8ZIOErrorZ_is_ok(const struct LDKCResult_CVec_u8ZIOErrorZ *NONNULL_PTR o);
29318 * Frees any resources used by the CResult_CVec_u8ZIOErrorZ.
29320 void CResult_CVec_u8ZIOErrorZ_free(struct LDKCResult_CVec_u8ZIOErrorZ _res);
29323 * Creates a new CResult_CVec_u8ZIOErrorZ which has the same data as `orig`
29324 * but with all dynamically-allocated buffers duplicated in new buffers.
29326 struct LDKCResult_CVec_u8ZIOErrorZ CResult_CVec_u8ZIOErrorZ_clone(const struct LDKCResult_CVec_u8ZIOErrorZ *NONNULL_PTR orig);
29329 * Frees the buffer pointed to by `data` if `datalen` is non-0.
29331 void CVec_StrZ_free(struct LDKCVec_StrZ _res);
29334 * Creates a new CResult_CVec_StrZIOErrorZ in the success state.
29336 struct LDKCResult_CVec_StrZIOErrorZ CResult_CVec_StrZIOErrorZ_ok(struct LDKCVec_StrZ o);
29339 * Creates a new CResult_CVec_StrZIOErrorZ in the error state.
29341 struct LDKCResult_CVec_StrZIOErrorZ CResult_CVec_StrZIOErrorZ_err(enum LDKIOError e);
29344 * Checks if the given object is currently in the success state
29346 bool CResult_CVec_StrZIOErrorZ_is_ok(const struct LDKCResult_CVec_StrZIOErrorZ *NONNULL_PTR o);
29349 * Frees any resources used by the CResult_CVec_StrZIOErrorZ.
29351 void CResult_CVec_StrZIOErrorZ_free(struct LDKCResult_CVec_StrZIOErrorZ _res);
29354 * Creates a new CResult_CVec_StrZIOErrorZ which has the same data as `orig`
29355 * but with all dynamically-allocated buffers duplicated in new buffers.
29357 struct LDKCResult_CVec_StrZIOErrorZ CResult_CVec_StrZIOErrorZ_clone(const struct LDKCResult_CVec_StrZIOErrorZ *NONNULL_PTR orig);
29360 * Frees the buffer pointed to by `data` if `datalen` is non-0.
29362 void CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZ_free(struct LDKCVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZ _res);
29365 * Creates a new CResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ in the success state.
29367 struct LDKCResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ CResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ_ok(struct LDKCVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZ o);
29370 * Creates a new CResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ in the error state.
29372 struct LDKCResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ CResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ_err(enum LDKIOError e);
29375 * Checks if the given object is currently in the success state
29377 bool CResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ_is_ok(const struct LDKCResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ *NONNULL_PTR o);
29380 * Frees any resources used by the CResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ.
29382 void CResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ_free(struct LDKCResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ _res);
29385 * Creates a new CResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ which has the same data as `orig`
29386 * but with all dynamically-allocated buffers duplicated in new buffers.
29388 struct LDKCResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ CResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ_clone(const struct LDKCResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ *NONNULL_PTR orig);
29391 * Creates a new CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ in the success state.
29393 struct LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ_ok(struct LDKC2Tuple_ThirtyTwoBytesChannelMonitorZ o);
29396 * Creates a new CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ in the error state.
29398 struct LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ_err(enum LDKIOError e);
29401 * Checks if the given object is currently in the success state
29403 bool CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ_is_ok(const struct LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ *NONNULL_PTR o);
29406 * Frees any resources used by the CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ.
29408 void CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ_free(struct LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ _res);
29411 * Creates a new CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ which has the same data as `orig`
29412 * but with all dynamically-allocated buffers duplicated in new buffers.
29414 struct LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ_clone(const struct LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ *NONNULL_PTR orig);
29417 * Creates a new CResult_UnsignedInvoiceRequestBolt12SemanticErrorZ in the success state.
29419 struct LDKCResult_UnsignedInvoiceRequestBolt12SemanticErrorZ CResult_UnsignedInvoiceRequestBolt12SemanticErrorZ_ok(struct LDKUnsignedInvoiceRequest o);
29422 * Creates a new CResult_UnsignedInvoiceRequestBolt12SemanticErrorZ in the error state.
29424 struct LDKCResult_UnsignedInvoiceRequestBolt12SemanticErrorZ CResult_UnsignedInvoiceRequestBolt12SemanticErrorZ_err(enum LDKBolt12SemanticError e);
29427 * Checks if the given object is currently in the success state
29429 bool CResult_UnsignedInvoiceRequestBolt12SemanticErrorZ_is_ok(const struct LDKCResult_UnsignedInvoiceRequestBolt12SemanticErrorZ *NONNULL_PTR o);
29432 * Frees any resources used by the CResult_UnsignedInvoiceRequestBolt12SemanticErrorZ.
29434 void CResult_UnsignedInvoiceRequestBolt12SemanticErrorZ_free(struct LDKCResult_UnsignedInvoiceRequestBolt12SemanticErrorZ _res);
29437 * Creates a new CResult_UnsignedInvoiceRequestBolt12SemanticErrorZ which has the same data as `orig`
29438 * but with all dynamically-allocated buffers duplicated in new buffers.
29440 struct LDKCResult_UnsignedInvoiceRequestBolt12SemanticErrorZ CResult_UnsignedInvoiceRequestBolt12SemanticErrorZ_clone(const struct LDKCResult_UnsignedInvoiceRequestBolt12SemanticErrorZ *NONNULL_PTR orig);
29443 * Creates a new CResult_InvoiceRequestBolt12SemanticErrorZ in the success state.
29445 struct LDKCResult_InvoiceRequestBolt12SemanticErrorZ CResult_InvoiceRequestBolt12SemanticErrorZ_ok(struct LDKInvoiceRequest o);
29448 * Creates a new CResult_InvoiceRequestBolt12SemanticErrorZ in the error state.
29450 struct LDKCResult_InvoiceRequestBolt12SemanticErrorZ CResult_InvoiceRequestBolt12SemanticErrorZ_err(enum LDKBolt12SemanticError e);
29453 * Checks if the given object is currently in the success state
29455 bool CResult_InvoiceRequestBolt12SemanticErrorZ_is_ok(const struct LDKCResult_InvoiceRequestBolt12SemanticErrorZ *NONNULL_PTR o);
29458 * Frees any resources used by the CResult_InvoiceRequestBolt12SemanticErrorZ.
29460 void CResult_InvoiceRequestBolt12SemanticErrorZ_free(struct LDKCResult_InvoiceRequestBolt12SemanticErrorZ _res);
29463 * Creates a new CResult_InvoiceRequestBolt12SemanticErrorZ which has the same data as `orig`
29464 * but with all dynamically-allocated buffers duplicated in new buffers.
29466 struct LDKCResult_InvoiceRequestBolt12SemanticErrorZ CResult_InvoiceRequestBolt12SemanticErrorZ_clone(const struct LDKCResult_InvoiceRequestBolt12SemanticErrorZ *NONNULL_PTR orig);
29469 * Constructs a new COption_SecretKeyZ containing a crate::c_types::SecretKey
29471 struct LDKCOption_SecretKeyZ COption_SecretKeyZ_some(struct LDKSecretKey o);
29474 * Constructs a new COption_SecretKeyZ containing nothing
29476 struct LDKCOption_SecretKeyZ COption_SecretKeyZ_none(void);
29479 * Frees any resources associated with the crate::c_types::SecretKey, if we are in the Some state
29481 void COption_SecretKeyZ_free(struct LDKCOption_SecretKeyZ _res);
29484 * Creates a new COption_SecretKeyZ which has the same data as `orig`
29485 * but with all dynamically-allocated buffers duplicated in new buffers.
29487 struct LDKCOption_SecretKeyZ COption_SecretKeyZ_clone(const struct LDKCOption_SecretKeyZ *NONNULL_PTR orig);
29490 * Creates a new CResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ in the success state.
29492 struct LDKCResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ CResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ_ok(struct LDKInvoiceWithExplicitSigningPubkeyBuilder o);
29495 * Creates a new CResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ in the error state.
29497 struct LDKCResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ CResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ_err(enum LDKBolt12SemanticError e);
29500 * Checks if the given object is currently in the success state
29502 bool CResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ_is_ok(const struct LDKCResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ *NONNULL_PTR o);
29505 * Frees any resources used by the CResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ.
29507 void CResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ_free(struct LDKCResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ _res);
29510 * Creates a new CResult_VerifiedInvoiceRequestNoneZ in the success state.
29512 struct LDKCResult_VerifiedInvoiceRequestNoneZ CResult_VerifiedInvoiceRequestNoneZ_ok(struct LDKVerifiedInvoiceRequest o);
29515 * Creates a new CResult_VerifiedInvoiceRequestNoneZ in the error state.
29517 struct LDKCResult_VerifiedInvoiceRequestNoneZ CResult_VerifiedInvoiceRequestNoneZ_err(void);
29520 * Checks if the given object is currently in the success state
29522 bool CResult_VerifiedInvoiceRequestNoneZ_is_ok(const struct LDKCResult_VerifiedInvoiceRequestNoneZ *NONNULL_PTR o);
29525 * Frees any resources used by the CResult_VerifiedInvoiceRequestNoneZ.
29527 void CResult_VerifiedInvoiceRequestNoneZ_free(struct LDKCResult_VerifiedInvoiceRequestNoneZ _res);
29530 * Creates a new CResult_VerifiedInvoiceRequestNoneZ which has the same data as `orig`
29531 * but with all dynamically-allocated buffers duplicated in new buffers.
29533 struct LDKCResult_VerifiedInvoiceRequestNoneZ CResult_VerifiedInvoiceRequestNoneZ_clone(const struct LDKCResult_VerifiedInvoiceRequestNoneZ *NONNULL_PTR orig);
29536 * Creates a new CResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ in the success state.
29538 struct LDKCResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ CResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ_ok(struct LDKInvoiceWithDerivedSigningPubkeyBuilder o);
29541 * Creates a new CResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ in the error state.
29543 struct LDKCResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ CResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ_err(enum LDKBolt12SemanticError e);
29546 * Checks if the given object is currently in the success state
29548 bool CResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ_is_ok(const struct LDKCResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ *NONNULL_PTR o);
29551 * Frees any resources used by the CResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ.
29553 void CResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ_free(struct LDKCResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ _res);
29556 * Creates a new CResult_InvoiceRequestFieldsDecodeErrorZ in the success state.
29558 struct LDKCResult_InvoiceRequestFieldsDecodeErrorZ CResult_InvoiceRequestFieldsDecodeErrorZ_ok(struct LDKInvoiceRequestFields o);
29561 * Creates a new CResult_InvoiceRequestFieldsDecodeErrorZ in the error state.
29563 struct LDKCResult_InvoiceRequestFieldsDecodeErrorZ CResult_InvoiceRequestFieldsDecodeErrorZ_err(struct LDKDecodeError e);
29566 * Checks if the given object is currently in the success state
29568 bool CResult_InvoiceRequestFieldsDecodeErrorZ_is_ok(const struct LDKCResult_InvoiceRequestFieldsDecodeErrorZ *NONNULL_PTR o);
29571 * Frees any resources used by the CResult_InvoiceRequestFieldsDecodeErrorZ.
29573 void CResult_InvoiceRequestFieldsDecodeErrorZ_free(struct LDKCResult_InvoiceRequestFieldsDecodeErrorZ _res);
29576 * Creates a new CResult_InvoiceRequestFieldsDecodeErrorZ which has the same data as `orig`
29577 * but with all dynamically-allocated buffers duplicated in new buffers.
29579 struct LDKCResult_InvoiceRequestFieldsDecodeErrorZ CResult_InvoiceRequestFieldsDecodeErrorZ_clone(const struct LDKCResult_InvoiceRequestFieldsDecodeErrorZ *NONNULL_PTR orig);
29582 * Constructs a new COption_NoneZ containing a
29584 enum LDKCOption_NoneZ COption_NoneZ_some(void);
29587 * Constructs a new COption_NoneZ containing nothing
29589 enum LDKCOption_NoneZ COption_NoneZ_none(void);
29592 * Frees any resources associated with the , if we are in the Some state
29594 void COption_NoneZ_free(enum LDKCOption_NoneZ _res);
29597 * Frees the buffer pointed to by `data` if `datalen` is non-0.
29599 void CVec_WitnessZ_free(struct LDKCVec_WitnessZ _res);
29602 * Constructs a new COption_ECDSASignatureZ containing a crate::c_types::ECDSASignature
29604 struct LDKCOption_ECDSASignatureZ COption_ECDSASignatureZ_some(struct LDKECDSASignature o);
29607 * Constructs a new COption_ECDSASignatureZ containing nothing
29609 struct LDKCOption_ECDSASignatureZ COption_ECDSASignatureZ_none(void);
29612 * Frees any resources associated with the crate::c_types::ECDSASignature, if we are in the Some state
29614 void COption_ECDSASignatureZ_free(struct LDKCOption_ECDSASignatureZ _res);
29617 * Creates a new COption_ECDSASignatureZ which has the same data as `orig`
29618 * but with all dynamically-allocated buffers duplicated in new buffers.
29620 struct LDKCOption_ECDSASignatureZ COption_ECDSASignatureZ_clone(const struct LDKCOption_ECDSASignatureZ *NONNULL_PTR orig);
29623 * Constructs a new COption_i64Z containing a i64
29625 struct LDKCOption_i64Z COption_i64Z_some(int64_t o);
29628 * Constructs a new COption_i64Z containing nothing
29630 struct LDKCOption_i64Z COption_i64Z_none(void);
29633 * Frees any resources associated with the i64, if we are in the Some state
29635 void COption_i64Z_free(struct LDKCOption_i64Z _res);
29638 * Creates a new COption_i64Z which has the same data as `orig`
29639 * but with all dynamically-allocated buffers duplicated in new buffers.
29641 struct LDKCOption_i64Z COption_i64Z_clone(const struct LDKCOption_i64Z *NONNULL_PTR orig);
29644 * Creates a new CResult_SocketAddressDecodeErrorZ in the success state.
29646 struct LDKCResult_SocketAddressDecodeErrorZ CResult_SocketAddressDecodeErrorZ_ok(struct LDKSocketAddress o);
29649 * Creates a new CResult_SocketAddressDecodeErrorZ in the error state.
29651 struct LDKCResult_SocketAddressDecodeErrorZ CResult_SocketAddressDecodeErrorZ_err(struct LDKDecodeError e);
29654 * Checks if the given object is currently in the success state
29656 bool CResult_SocketAddressDecodeErrorZ_is_ok(const struct LDKCResult_SocketAddressDecodeErrorZ *NONNULL_PTR o);
29659 * Frees any resources used by the CResult_SocketAddressDecodeErrorZ.
29661 void CResult_SocketAddressDecodeErrorZ_free(struct LDKCResult_SocketAddressDecodeErrorZ _res);
29664 * Creates a new CResult_SocketAddressDecodeErrorZ which has the same data as `orig`
29665 * but with all dynamically-allocated buffers duplicated in new buffers.
29667 struct LDKCResult_SocketAddressDecodeErrorZ CResult_SocketAddressDecodeErrorZ_clone(const struct LDKCResult_SocketAddressDecodeErrorZ *NONNULL_PTR orig);
29670 * Creates a new CResult_SocketAddressSocketAddressParseErrorZ in the success state.
29672 struct LDKCResult_SocketAddressSocketAddressParseErrorZ CResult_SocketAddressSocketAddressParseErrorZ_ok(struct LDKSocketAddress o);
29675 * Creates a new CResult_SocketAddressSocketAddressParseErrorZ in the error state.
29677 struct LDKCResult_SocketAddressSocketAddressParseErrorZ CResult_SocketAddressSocketAddressParseErrorZ_err(enum LDKSocketAddressParseError e);
29680 * Checks if the given object is currently in the success state
29682 bool CResult_SocketAddressSocketAddressParseErrorZ_is_ok(const struct LDKCResult_SocketAddressSocketAddressParseErrorZ *NONNULL_PTR o);
29685 * Frees any resources used by the CResult_SocketAddressSocketAddressParseErrorZ.
29687 void CResult_SocketAddressSocketAddressParseErrorZ_free(struct LDKCResult_SocketAddressSocketAddressParseErrorZ _res);
29690 * Creates a new CResult_SocketAddressSocketAddressParseErrorZ which has the same data as `orig`
29691 * but with all dynamically-allocated buffers duplicated in new buffers.
29693 struct LDKCResult_SocketAddressSocketAddressParseErrorZ CResult_SocketAddressSocketAddressParseErrorZ_clone(const struct LDKCResult_SocketAddressSocketAddressParseErrorZ *NONNULL_PTR orig);
29696 * Frees the buffer pointed to by `data` if `datalen` is non-0.
29698 void CVec_UpdateAddHTLCZ_free(struct LDKCVec_UpdateAddHTLCZ _res);
29701 * Frees the buffer pointed to by `data` if `datalen` is non-0.
29703 void CVec_UpdateFulfillHTLCZ_free(struct LDKCVec_UpdateFulfillHTLCZ _res);
29706 * Frees the buffer pointed to by `data` if `datalen` is non-0.
29708 void CVec_UpdateFailHTLCZ_free(struct LDKCVec_UpdateFailHTLCZ _res);
29711 * Frees the buffer pointed to by `data` if `datalen` is non-0.
29713 void CVec_UpdateFailMalformedHTLCZ_free(struct LDKCVec_UpdateFailMalformedHTLCZ _res);
29716 * Creates a new CResult_AcceptChannelDecodeErrorZ in the success state.
29718 struct LDKCResult_AcceptChannelDecodeErrorZ CResult_AcceptChannelDecodeErrorZ_ok(struct LDKAcceptChannel o);
29721 * Creates a new CResult_AcceptChannelDecodeErrorZ in the error state.
29723 struct LDKCResult_AcceptChannelDecodeErrorZ CResult_AcceptChannelDecodeErrorZ_err(struct LDKDecodeError e);
29726 * Checks if the given object is currently in the success state
29728 bool CResult_AcceptChannelDecodeErrorZ_is_ok(const struct LDKCResult_AcceptChannelDecodeErrorZ *NONNULL_PTR o);
29731 * Frees any resources used by the CResult_AcceptChannelDecodeErrorZ.
29733 void CResult_AcceptChannelDecodeErrorZ_free(struct LDKCResult_AcceptChannelDecodeErrorZ _res);
29736 * Creates a new CResult_AcceptChannelDecodeErrorZ which has the same data as `orig`
29737 * but with all dynamically-allocated buffers duplicated in new buffers.
29739 struct LDKCResult_AcceptChannelDecodeErrorZ CResult_AcceptChannelDecodeErrorZ_clone(const struct LDKCResult_AcceptChannelDecodeErrorZ *NONNULL_PTR orig);
29742 * Creates a new CResult_AcceptChannelV2DecodeErrorZ in the success state.
29744 struct LDKCResult_AcceptChannelV2DecodeErrorZ CResult_AcceptChannelV2DecodeErrorZ_ok(struct LDKAcceptChannelV2 o);
29747 * Creates a new CResult_AcceptChannelV2DecodeErrorZ in the error state.
29749 struct LDKCResult_AcceptChannelV2DecodeErrorZ CResult_AcceptChannelV2DecodeErrorZ_err(struct LDKDecodeError e);
29752 * Checks if the given object is currently in the success state
29754 bool CResult_AcceptChannelV2DecodeErrorZ_is_ok(const struct LDKCResult_AcceptChannelV2DecodeErrorZ *NONNULL_PTR o);
29757 * Frees any resources used by the CResult_AcceptChannelV2DecodeErrorZ.
29759 void CResult_AcceptChannelV2DecodeErrorZ_free(struct LDKCResult_AcceptChannelV2DecodeErrorZ _res);
29762 * Creates a new CResult_AcceptChannelV2DecodeErrorZ which has the same data as `orig`
29763 * but with all dynamically-allocated buffers duplicated in new buffers.
29765 struct LDKCResult_AcceptChannelV2DecodeErrorZ CResult_AcceptChannelV2DecodeErrorZ_clone(const struct LDKCResult_AcceptChannelV2DecodeErrorZ *NONNULL_PTR orig);
29768 * Creates a new CResult_StfuDecodeErrorZ in the success state.
29770 struct LDKCResult_StfuDecodeErrorZ CResult_StfuDecodeErrorZ_ok(struct LDKStfu o);
29773 * Creates a new CResult_StfuDecodeErrorZ in the error state.
29775 struct LDKCResult_StfuDecodeErrorZ CResult_StfuDecodeErrorZ_err(struct LDKDecodeError e);
29778 * Checks if the given object is currently in the success state
29780 bool CResult_StfuDecodeErrorZ_is_ok(const struct LDKCResult_StfuDecodeErrorZ *NONNULL_PTR o);
29783 * Frees any resources used by the CResult_StfuDecodeErrorZ.
29785 void CResult_StfuDecodeErrorZ_free(struct LDKCResult_StfuDecodeErrorZ _res);
29788 * Creates a new CResult_StfuDecodeErrorZ which has the same data as `orig`
29789 * but with all dynamically-allocated buffers duplicated in new buffers.
29791 struct LDKCResult_StfuDecodeErrorZ CResult_StfuDecodeErrorZ_clone(const struct LDKCResult_StfuDecodeErrorZ *NONNULL_PTR orig);
29794 * Creates a new CResult_SpliceDecodeErrorZ in the success state.
29796 struct LDKCResult_SpliceDecodeErrorZ CResult_SpliceDecodeErrorZ_ok(struct LDKSplice o);
29799 * Creates a new CResult_SpliceDecodeErrorZ in the error state.
29801 struct LDKCResult_SpliceDecodeErrorZ CResult_SpliceDecodeErrorZ_err(struct LDKDecodeError e);
29804 * Checks if the given object is currently in the success state
29806 bool CResult_SpliceDecodeErrorZ_is_ok(const struct LDKCResult_SpliceDecodeErrorZ *NONNULL_PTR o);
29809 * Frees any resources used by the CResult_SpliceDecodeErrorZ.
29811 void CResult_SpliceDecodeErrorZ_free(struct LDKCResult_SpliceDecodeErrorZ _res);
29814 * Creates a new CResult_SpliceDecodeErrorZ which has the same data as `orig`
29815 * but with all dynamically-allocated buffers duplicated in new buffers.
29817 struct LDKCResult_SpliceDecodeErrorZ CResult_SpliceDecodeErrorZ_clone(const struct LDKCResult_SpliceDecodeErrorZ *NONNULL_PTR orig);
29820 * Creates a new CResult_SpliceAckDecodeErrorZ in the success state.
29822 struct LDKCResult_SpliceAckDecodeErrorZ CResult_SpliceAckDecodeErrorZ_ok(struct LDKSpliceAck o);
29825 * Creates a new CResult_SpliceAckDecodeErrorZ in the error state.
29827 struct LDKCResult_SpliceAckDecodeErrorZ CResult_SpliceAckDecodeErrorZ_err(struct LDKDecodeError e);
29830 * Checks if the given object is currently in the success state
29832 bool CResult_SpliceAckDecodeErrorZ_is_ok(const struct LDKCResult_SpliceAckDecodeErrorZ *NONNULL_PTR o);
29835 * Frees any resources used by the CResult_SpliceAckDecodeErrorZ.
29837 void CResult_SpliceAckDecodeErrorZ_free(struct LDKCResult_SpliceAckDecodeErrorZ _res);
29840 * Creates a new CResult_SpliceAckDecodeErrorZ which has the same data as `orig`
29841 * but with all dynamically-allocated buffers duplicated in new buffers.
29843 struct LDKCResult_SpliceAckDecodeErrorZ CResult_SpliceAckDecodeErrorZ_clone(const struct LDKCResult_SpliceAckDecodeErrorZ *NONNULL_PTR orig);
29846 * Creates a new CResult_SpliceLockedDecodeErrorZ in the success state.
29848 struct LDKCResult_SpliceLockedDecodeErrorZ CResult_SpliceLockedDecodeErrorZ_ok(struct LDKSpliceLocked o);
29851 * Creates a new CResult_SpliceLockedDecodeErrorZ in the error state.
29853 struct LDKCResult_SpliceLockedDecodeErrorZ CResult_SpliceLockedDecodeErrorZ_err(struct LDKDecodeError e);
29856 * Checks if the given object is currently in the success state
29858 bool CResult_SpliceLockedDecodeErrorZ_is_ok(const struct LDKCResult_SpliceLockedDecodeErrorZ *NONNULL_PTR o);
29861 * Frees any resources used by the CResult_SpliceLockedDecodeErrorZ.
29863 void CResult_SpliceLockedDecodeErrorZ_free(struct LDKCResult_SpliceLockedDecodeErrorZ _res);
29866 * Creates a new CResult_SpliceLockedDecodeErrorZ which has the same data as `orig`
29867 * but with all dynamically-allocated buffers duplicated in new buffers.
29869 struct LDKCResult_SpliceLockedDecodeErrorZ CResult_SpliceLockedDecodeErrorZ_clone(const struct LDKCResult_SpliceLockedDecodeErrorZ *NONNULL_PTR orig);
29872 * Creates a new CResult_TxAddInputDecodeErrorZ in the success state.
29874 struct LDKCResult_TxAddInputDecodeErrorZ CResult_TxAddInputDecodeErrorZ_ok(struct LDKTxAddInput o);
29877 * Creates a new CResult_TxAddInputDecodeErrorZ in the error state.
29879 struct LDKCResult_TxAddInputDecodeErrorZ CResult_TxAddInputDecodeErrorZ_err(struct LDKDecodeError e);
29882 * Checks if the given object is currently in the success state
29884 bool CResult_TxAddInputDecodeErrorZ_is_ok(const struct LDKCResult_TxAddInputDecodeErrorZ *NONNULL_PTR o);
29887 * Frees any resources used by the CResult_TxAddInputDecodeErrorZ.
29889 void CResult_TxAddInputDecodeErrorZ_free(struct LDKCResult_TxAddInputDecodeErrorZ _res);
29892 * Creates a new CResult_TxAddInputDecodeErrorZ which has the same data as `orig`
29893 * but with all dynamically-allocated buffers duplicated in new buffers.
29895 struct LDKCResult_TxAddInputDecodeErrorZ CResult_TxAddInputDecodeErrorZ_clone(const struct LDKCResult_TxAddInputDecodeErrorZ *NONNULL_PTR orig);
29898 * Creates a new CResult_TxAddOutputDecodeErrorZ in the success state.
29900 struct LDKCResult_TxAddOutputDecodeErrorZ CResult_TxAddOutputDecodeErrorZ_ok(struct LDKTxAddOutput o);
29903 * Creates a new CResult_TxAddOutputDecodeErrorZ in the error state.
29905 struct LDKCResult_TxAddOutputDecodeErrorZ CResult_TxAddOutputDecodeErrorZ_err(struct LDKDecodeError e);
29908 * Checks if the given object is currently in the success state
29910 bool CResult_TxAddOutputDecodeErrorZ_is_ok(const struct LDKCResult_TxAddOutputDecodeErrorZ *NONNULL_PTR o);
29913 * Frees any resources used by the CResult_TxAddOutputDecodeErrorZ.
29915 void CResult_TxAddOutputDecodeErrorZ_free(struct LDKCResult_TxAddOutputDecodeErrorZ _res);
29918 * Creates a new CResult_TxAddOutputDecodeErrorZ which has the same data as `orig`
29919 * but with all dynamically-allocated buffers duplicated in new buffers.
29921 struct LDKCResult_TxAddOutputDecodeErrorZ CResult_TxAddOutputDecodeErrorZ_clone(const struct LDKCResult_TxAddOutputDecodeErrorZ *NONNULL_PTR orig);
29924 * Creates a new CResult_TxRemoveInputDecodeErrorZ in the success state.
29926 struct LDKCResult_TxRemoveInputDecodeErrorZ CResult_TxRemoveInputDecodeErrorZ_ok(struct LDKTxRemoveInput o);
29929 * Creates a new CResult_TxRemoveInputDecodeErrorZ in the error state.
29931 struct LDKCResult_TxRemoveInputDecodeErrorZ CResult_TxRemoveInputDecodeErrorZ_err(struct LDKDecodeError e);
29934 * Checks if the given object is currently in the success state
29936 bool CResult_TxRemoveInputDecodeErrorZ_is_ok(const struct LDKCResult_TxRemoveInputDecodeErrorZ *NONNULL_PTR o);
29939 * Frees any resources used by the CResult_TxRemoveInputDecodeErrorZ.
29941 void CResult_TxRemoveInputDecodeErrorZ_free(struct LDKCResult_TxRemoveInputDecodeErrorZ _res);
29944 * Creates a new CResult_TxRemoveInputDecodeErrorZ which has the same data as `orig`
29945 * but with all dynamically-allocated buffers duplicated in new buffers.
29947 struct LDKCResult_TxRemoveInputDecodeErrorZ CResult_TxRemoveInputDecodeErrorZ_clone(const struct LDKCResult_TxRemoveInputDecodeErrorZ *NONNULL_PTR orig);
29950 * Creates a new CResult_TxRemoveOutputDecodeErrorZ in the success state.
29952 struct LDKCResult_TxRemoveOutputDecodeErrorZ CResult_TxRemoveOutputDecodeErrorZ_ok(struct LDKTxRemoveOutput o);
29955 * Creates a new CResult_TxRemoveOutputDecodeErrorZ in the error state.
29957 struct LDKCResult_TxRemoveOutputDecodeErrorZ CResult_TxRemoveOutputDecodeErrorZ_err(struct LDKDecodeError e);
29960 * Checks if the given object is currently in the success state
29962 bool CResult_TxRemoveOutputDecodeErrorZ_is_ok(const struct LDKCResult_TxRemoveOutputDecodeErrorZ *NONNULL_PTR o);
29965 * Frees any resources used by the CResult_TxRemoveOutputDecodeErrorZ.
29967 void CResult_TxRemoveOutputDecodeErrorZ_free(struct LDKCResult_TxRemoveOutputDecodeErrorZ _res);
29970 * Creates a new CResult_TxRemoveOutputDecodeErrorZ which has the same data as `orig`
29971 * but with all dynamically-allocated buffers duplicated in new buffers.
29973 struct LDKCResult_TxRemoveOutputDecodeErrorZ CResult_TxRemoveOutputDecodeErrorZ_clone(const struct LDKCResult_TxRemoveOutputDecodeErrorZ *NONNULL_PTR orig);
29976 * Creates a new CResult_TxCompleteDecodeErrorZ in the success state.
29978 struct LDKCResult_TxCompleteDecodeErrorZ CResult_TxCompleteDecodeErrorZ_ok(struct LDKTxComplete o);
29981 * Creates a new CResult_TxCompleteDecodeErrorZ in the error state.
29983 struct LDKCResult_TxCompleteDecodeErrorZ CResult_TxCompleteDecodeErrorZ_err(struct LDKDecodeError e);
29986 * Checks if the given object is currently in the success state
29988 bool CResult_TxCompleteDecodeErrorZ_is_ok(const struct LDKCResult_TxCompleteDecodeErrorZ *NONNULL_PTR o);
29991 * Frees any resources used by the CResult_TxCompleteDecodeErrorZ.
29993 void CResult_TxCompleteDecodeErrorZ_free(struct LDKCResult_TxCompleteDecodeErrorZ _res);
29996 * Creates a new CResult_TxCompleteDecodeErrorZ which has the same data as `orig`
29997 * but with all dynamically-allocated buffers duplicated in new buffers.
29999 struct LDKCResult_TxCompleteDecodeErrorZ CResult_TxCompleteDecodeErrorZ_clone(const struct LDKCResult_TxCompleteDecodeErrorZ *NONNULL_PTR orig);
30002 * Creates a new CResult_TxSignaturesDecodeErrorZ in the success state.
30004 struct LDKCResult_TxSignaturesDecodeErrorZ CResult_TxSignaturesDecodeErrorZ_ok(struct LDKTxSignatures o);
30007 * Creates a new CResult_TxSignaturesDecodeErrorZ in the error state.
30009 struct LDKCResult_TxSignaturesDecodeErrorZ CResult_TxSignaturesDecodeErrorZ_err(struct LDKDecodeError e);
30012 * Checks if the given object is currently in the success state
30014 bool CResult_TxSignaturesDecodeErrorZ_is_ok(const struct LDKCResult_TxSignaturesDecodeErrorZ *NONNULL_PTR o);
30017 * Frees any resources used by the CResult_TxSignaturesDecodeErrorZ.
30019 void CResult_TxSignaturesDecodeErrorZ_free(struct LDKCResult_TxSignaturesDecodeErrorZ _res);
30022 * Creates a new CResult_TxSignaturesDecodeErrorZ which has the same data as `orig`
30023 * but with all dynamically-allocated buffers duplicated in new buffers.
30025 struct LDKCResult_TxSignaturesDecodeErrorZ CResult_TxSignaturesDecodeErrorZ_clone(const struct LDKCResult_TxSignaturesDecodeErrorZ *NONNULL_PTR orig);
30028 * Creates a new CResult_TxInitRbfDecodeErrorZ in the success state.
30030 struct LDKCResult_TxInitRbfDecodeErrorZ CResult_TxInitRbfDecodeErrorZ_ok(struct LDKTxInitRbf o);
30033 * Creates a new CResult_TxInitRbfDecodeErrorZ in the error state.
30035 struct LDKCResult_TxInitRbfDecodeErrorZ CResult_TxInitRbfDecodeErrorZ_err(struct LDKDecodeError e);
30038 * Checks if the given object is currently in the success state
30040 bool CResult_TxInitRbfDecodeErrorZ_is_ok(const struct LDKCResult_TxInitRbfDecodeErrorZ *NONNULL_PTR o);
30043 * Frees any resources used by the CResult_TxInitRbfDecodeErrorZ.
30045 void CResult_TxInitRbfDecodeErrorZ_free(struct LDKCResult_TxInitRbfDecodeErrorZ _res);
30048 * Creates a new CResult_TxInitRbfDecodeErrorZ which has the same data as `orig`
30049 * but with all dynamically-allocated buffers duplicated in new buffers.
30051 struct LDKCResult_TxInitRbfDecodeErrorZ CResult_TxInitRbfDecodeErrorZ_clone(const struct LDKCResult_TxInitRbfDecodeErrorZ *NONNULL_PTR orig);
30054 * Creates a new CResult_TxAckRbfDecodeErrorZ in the success state.
30056 struct LDKCResult_TxAckRbfDecodeErrorZ CResult_TxAckRbfDecodeErrorZ_ok(struct LDKTxAckRbf o);
30059 * Creates a new CResult_TxAckRbfDecodeErrorZ in the error state.
30061 struct LDKCResult_TxAckRbfDecodeErrorZ CResult_TxAckRbfDecodeErrorZ_err(struct LDKDecodeError e);
30064 * Checks if the given object is currently in the success state
30066 bool CResult_TxAckRbfDecodeErrorZ_is_ok(const struct LDKCResult_TxAckRbfDecodeErrorZ *NONNULL_PTR o);
30069 * Frees any resources used by the CResult_TxAckRbfDecodeErrorZ.
30071 void CResult_TxAckRbfDecodeErrorZ_free(struct LDKCResult_TxAckRbfDecodeErrorZ _res);
30074 * Creates a new CResult_TxAckRbfDecodeErrorZ which has the same data as `orig`
30075 * but with all dynamically-allocated buffers duplicated in new buffers.
30077 struct LDKCResult_TxAckRbfDecodeErrorZ CResult_TxAckRbfDecodeErrorZ_clone(const struct LDKCResult_TxAckRbfDecodeErrorZ *NONNULL_PTR orig);
30080 * Creates a new CResult_TxAbortDecodeErrorZ in the success state.
30082 struct LDKCResult_TxAbortDecodeErrorZ CResult_TxAbortDecodeErrorZ_ok(struct LDKTxAbort o);
30085 * Creates a new CResult_TxAbortDecodeErrorZ in the error state.
30087 struct LDKCResult_TxAbortDecodeErrorZ CResult_TxAbortDecodeErrorZ_err(struct LDKDecodeError e);
30090 * Checks if the given object is currently in the success state
30092 bool CResult_TxAbortDecodeErrorZ_is_ok(const struct LDKCResult_TxAbortDecodeErrorZ *NONNULL_PTR o);
30095 * Frees any resources used by the CResult_TxAbortDecodeErrorZ.
30097 void CResult_TxAbortDecodeErrorZ_free(struct LDKCResult_TxAbortDecodeErrorZ _res);
30100 * Creates a new CResult_TxAbortDecodeErrorZ which has the same data as `orig`
30101 * but with all dynamically-allocated buffers duplicated in new buffers.
30103 struct LDKCResult_TxAbortDecodeErrorZ CResult_TxAbortDecodeErrorZ_clone(const struct LDKCResult_TxAbortDecodeErrorZ *NONNULL_PTR orig);
30106 * Creates a new CResult_AnnouncementSignaturesDecodeErrorZ in the success state.
30108 struct LDKCResult_AnnouncementSignaturesDecodeErrorZ CResult_AnnouncementSignaturesDecodeErrorZ_ok(struct LDKAnnouncementSignatures o);
30111 * Creates a new CResult_AnnouncementSignaturesDecodeErrorZ in the error state.
30113 struct LDKCResult_AnnouncementSignaturesDecodeErrorZ CResult_AnnouncementSignaturesDecodeErrorZ_err(struct LDKDecodeError e);
30116 * Checks if the given object is currently in the success state
30118 bool CResult_AnnouncementSignaturesDecodeErrorZ_is_ok(const struct LDKCResult_AnnouncementSignaturesDecodeErrorZ *NONNULL_PTR o);
30121 * Frees any resources used by the CResult_AnnouncementSignaturesDecodeErrorZ.
30123 void CResult_AnnouncementSignaturesDecodeErrorZ_free(struct LDKCResult_AnnouncementSignaturesDecodeErrorZ _res);
30126 * Creates a new CResult_AnnouncementSignaturesDecodeErrorZ which has the same data as `orig`
30127 * but with all dynamically-allocated buffers duplicated in new buffers.
30129 struct LDKCResult_AnnouncementSignaturesDecodeErrorZ CResult_AnnouncementSignaturesDecodeErrorZ_clone(const struct LDKCResult_AnnouncementSignaturesDecodeErrorZ *NONNULL_PTR orig);
30132 * Creates a new CResult_ChannelReestablishDecodeErrorZ in the success state.
30134 struct LDKCResult_ChannelReestablishDecodeErrorZ CResult_ChannelReestablishDecodeErrorZ_ok(struct LDKChannelReestablish o);
30137 * Creates a new CResult_ChannelReestablishDecodeErrorZ in the error state.
30139 struct LDKCResult_ChannelReestablishDecodeErrorZ CResult_ChannelReestablishDecodeErrorZ_err(struct LDKDecodeError e);
30142 * Checks if the given object is currently in the success state
30144 bool CResult_ChannelReestablishDecodeErrorZ_is_ok(const struct LDKCResult_ChannelReestablishDecodeErrorZ *NONNULL_PTR o);
30147 * Frees any resources used by the CResult_ChannelReestablishDecodeErrorZ.
30149 void CResult_ChannelReestablishDecodeErrorZ_free(struct LDKCResult_ChannelReestablishDecodeErrorZ _res);
30152 * Creates a new CResult_ChannelReestablishDecodeErrorZ which has the same data as `orig`
30153 * but with all dynamically-allocated buffers duplicated in new buffers.
30155 struct LDKCResult_ChannelReestablishDecodeErrorZ CResult_ChannelReestablishDecodeErrorZ_clone(const struct LDKCResult_ChannelReestablishDecodeErrorZ *NONNULL_PTR orig);
30158 * Creates a new CResult_ClosingSignedDecodeErrorZ in the success state.
30160 struct LDKCResult_ClosingSignedDecodeErrorZ CResult_ClosingSignedDecodeErrorZ_ok(struct LDKClosingSigned o);
30163 * Creates a new CResult_ClosingSignedDecodeErrorZ in the error state.
30165 struct LDKCResult_ClosingSignedDecodeErrorZ CResult_ClosingSignedDecodeErrorZ_err(struct LDKDecodeError e);
30168 * Checks if the given object is currently in the success state
30170 bool CResult_ClosingSignedDecodeErrorZ_is_ok(const struct LDKCResult_ClosingSignedDecodeErrorZ *NONNULL_PTR o);
30173 * Frees any resources used by the CResult_ClosingSignedDecodeErrorZ.
30175 void CResult_ClosingSignedDecodeErrorZ_free(struct LDKCResult_ClosingSignedDecodeErrorZ _res);
30178 * Creates a new CResult_ClosingSignedDecodeErrorZ which has the same data as `orig`
30179 * but with all dynamically-allocated buffers duplicated in new buffers.
30181 struct LDKCResult_ClosingSignedDecodeErrorZ CResult_ClosingSignedDecodeErrorZ_clone(const struct LDKCResult_ClosingSignedDecodeErrorZ *NONNULL_PTR orig);
30184 * Creates a new CResult_ClosingSignedFeeRangeDecodeErrorZ in the success state.
30186 struct LDKCResult_ClosingSignedFeeRangeDecodeErrorZ CResult_ClosingSignedFeeRangeDecodeErrorZ_ok(struct LDKClosingSignedFeeRange o);
30189 * Creates a new CResult_ClosingSignedFeeRangeDecodeErrorZ in the error state.
30191 struct LDKCResult_ClosingSignedFeeRangeDecodeErrorZ CResult_ClosingSignedFeeRangeDecodeErrorZ_err(struct LDKDecodeError e);
30194 * Checks if the given object is currently in the success state
30196 bool CResult_ClosingSignedFeeRangeDecodeErrorZ_is_ok(const struct LDKCResult_ClosingSignedFeeRangeDecodeErrorZ *NONNULL_PTR o);
30199 * Frees any resources used by the CResult_ClosingSignedFeeRangeDecodeErrorZ.
30201 void CResult_ClosingSignedFeeRangeDecodeErrorZ_free(struct LDKCResult_ClosingSignedFeeRangeDecodeErrorZ _res);
30204 * Creates a new CResult_ClosingSignedFeeRangeDecodeErrorZ which has the same data as `orig`
30205 * but with all dynamically-allocated buffers duplicated in new buffers.
30207 struct LDKCResult_ClosingSignedFeeRangeDecodeErrorZ CResult_ClosingSignedFeeRangeDecodeErrorZ_clone(const struct LDKCResult_ClosingSignedFeeRangeDecodeErrorZ *NONNULL_PTR orig);
30210 * Creates a new CResult_CommitmentSignedDecodeErrorZ in the success state.
30212 struct LDKCResult_CommitmentSignedDecodeErrorZ CResult_CommitmentSignedDecodeErrorZ_ok(struct LDKCommitmentSigned o);
30215 * Creates a new CResult_CommitmentSignedDecodeErrorZ in the error state.
30217 struct LDKCResult_CommitmentSignedDecodeErrorZ CResult_CommitmentSignedDecodeErrorZ_err(struct LDKDecodeError e);
30220 * Checks if the given object is currently in the success state
30222 bool CResult_CommitmentSignedDecodeErrorZ_is_ok(const struct LDKCResult_CommitmentSignedDecodeErrorZ *NONNULL_PTR o);
30225 * Frees any resources used by the CResult_CommitmentSignedDecodeErrorZ.
30227 void CResult_CommitmentSignedDecodeErrorZ_free(struct LDKCResult_CommitmentSignedDecodeErrorZ _res);
30230 * Creates a new CResult_CommitmentSignedDecodeErrorZ which has the same data as `orig`
30231 * but with all dynamically-allocated buffers duplicated in new buffers.
30233 struct LDKCResult_CommitmentSignedDecodeErrorZ CResult_CommitmentSignedDecodeErrorZ_clone(const struct LDKCResult_CommitmentSignedDecodeErrorZ *NONNULL_PTR orig);
30236 * Creates a new CResult_FundingCreatedDecodeErrorZ in the success state.
30238 struct LDKCResult_FundingCreatedDecodeErrorZ CResult_FundingCreatedDecodeErrorZ_ok(struct LDKFundingCreated o);
30241 * Creates a new CResult_FundingCreatedDecodeErrorZ in the error state.
30243 struct LDKCResult_FundingCreatedDecodeErrorZ CResult_FundingCreatedDecodeErrorZ_err(struct LDKDecodeError e);
30246 * Checks if the given object is currently in the success state
30248 bool CResult_FundingCreatedDecodeErrorZ_is_ok(const struct LDKCResult_FundingCreatedDecodeErrorZ *NONNULL_PTR o);
30251 * Frees any resources used by the CResult_FundingCreatedDecodeErrorZ.
30253 void CResult_FundingCreatedDecodeErrorZ_free(struct LDKCResult_FundingCreatedDecodeErrorZ _res);
30256 * Creates a new CResult_FundingCreatedDecodeErrorZ which has the same data as `orig`
30257 * but with all dynamically-allocated buffers duplicated in new buffers.
30259 struct LDKCResult_FundingCreatedDecodeErrorZ CResult_FundingCreatedDecodeErrorZ_clone(const struct LDKCResult_FundingCreatedDecodeErrorZ *NONNULL_PTR orig);
30262 * Creates a new CResult_FundingSignedDecodeErrorZ in the success state.
30264 struct LDKCResult_FundingSignedDecodeErrorZ CResult_FundingSignedDecodeErrorZ_ok(struct LDKFundingSigned o);
30267 * Creates a new CResult_FundingSignedDecodeErrorZ in the error state.
30269 struct LDKCResult_FundingSignedDecodeErrorZ CResult_FundingSignedDecodeErrorZ_err(struct LDKDecodeError e);
30272 * Checks if the given object is currently in the success state
30274 bool CResult_FundingSignedDecodeErrorZ_is_ok(const struct LDKCResult_FundingSignedDecodeErrorZ *NONNULL_PTR o);
30277 * Frees any resources used by the CResult_FundingSignedDecodeErrorZ.
30279 void CResult_FundingSignedDecodeErrorZ_free(struct LDKCResult_FundingSignedDecodeErrorZ _res);
30282 * Creates a new CResult_FundingSignedDecodeErrorZ which has the same data as `orig`
30283 * but with all dynamically-allocated buffers duplicated in new buffers.
30285 struct LDKCResult_FundingSignedDecodeErrorZ CResult_FundingSignedDecodeErrorZ_clone(const struct LDKCResult_FundingSignedDecodeErrorZ *NONNULL_PTR orig);
30288 * Creates a new CResult_ChannelReadyDecodeErrorZ in the success state.
30290 struct LDKCResult_ChannelReadyDecodeErrorZ CResult_ChannelReadyDecodeErrorZ_ok(struct LDKChannelReady o);
30293 * Creates a new CResult_ChannelReadyDecodeErrorZ in the error state.
30295 struct LDKCResult_ChannelReadyDecodeErrorZ CResult_ChannelReadyDecodeErrorZ_err(struct LDKDecodeError e);
30298 * Checks if the given object is currently in the success state
30300 bool CResult_ChannelReadyDecodeErrorZ_is_ok(const struct LDKCResult_ChannelReadyDecodeErrorZ *NONNULL_PTR o);
30303 * Frees any resources used by the CResult_ChannelReadyDecodeErrorZ.
30305 void CResult_ChannelReadyDecodeErrorZ_free(struct LDKCResult_ChannelReadyDecodeErrorZ _res);
30308 * Creates a new CResult_ChannelReadyDecodeErrorZ which has the same data as `orig`
30309 * but with all dynamically-allocated buffers duplicated in new buffers.
30311 struct LDKCResult_ChannelReadyDecodeErrorZ CResult_ChannelReadyDecodeErrorZ_clone(const struct LDKCResult_ChannelReadyDecodeErrorZ *NONNULL_PTR orig);
30314 * Creates a new CResult_InitDecodeErrorZ in the success state.
30316 struct LDKCResult_InitDecodeErrorZ CResult_InitDecodeErrorZ_ok(struct LDKInit o);
30319 * Creates a new CResult_InitDecodeErrorZ in the error state.
30321 struct LDKCResult_InitDecodeErrorZ CResult_InitDecodeErrorZ_err(struct LDKDecodeError e);
30324 * Checks if the given object is currently in the success state
30326 bool CResult_InitDecodeErrorZ_is_ok(const struct LDKCResult_InitDecodeErrorZ *NONNULL_PTR o);
30329 * Frees any resources used by the CResult_InitDecodeErrorZ.
30331 void CResult_InitDecodeErrorZ_free(struct LDKCResult_InitDecodeErrorZ _res);
30334 * Creates a new CResult_InitDecodeErrorZ which has the same data as `orig`
30335 * but with all dynamically-allocated buffers duplicated in new buffers.
30337 struct LDKCResult_InitDecodeErrorZ CResult_InitDecodeErrorZ_clone(const struct LDKCResult_InitDecodeErrorZ *NONNULL_PTR orig);
30340 * Creates a new CResult_OpenChannelDecodeErrorZ in the success state.
30342 struct LDKCResult_OpenChannelDecodeErrorZ CResult_OpenChannelDecodeErrorZ_ok(struct LDKOpenChannel o);
30345 * Creates a new CResult_OpenChannelDecodeErrorZ in the error state.
30347 struct LDKCResult_OpenChannelDecodeErrorZ CResult_OpenChannelDecodeErrorZ_err(struct LDKDecodeError e);
30350 * Checks if the given object is currently in the success state
30352 bool CResult_OpenChannelDecodeErrorZ_is_ok(const struct LDKCResult_OpenChannelDecodeErrorZ *NONNULL_PTR o);
30355 * Frees any resources used by the CResult_OpenChannelDecodeErrorZ.
30357 void CResult_OpenChannelDecodeErrorZ_free(struct LDKCResult_OpenChannelDecodeErrorZ _res);
30360 * Creates a new CResult_OpenChannelDecodeErrorZ which has the same data as `orig`
30361 * but with all dynamically-allocated buffers duplicated in new buffers.
30363 struct LDKCResult_OpenChannelDecodeErrorZ CResult_OpenChannelDecodeErrorZ_clone(const struct LDKCResult_OpenChannelDecodeErrorZ *NONNULL_PTR orig);
30366 * Creates a new CResult_OpenChannelV2DecodeErrorZ in the success state.
30368 struct LDKCResult_OpenChannelV2DecodeErrorZ CResult_OpenChannelV2DecodeErrorZ_ok(struct LDKOpenChannelV2 o);
30371 * Creates a new CResult_OpenChannelV2DecodeErrorZ in the error state.
30373 struct LDKCResult_OpenChannelV2DecodeErrorZ CResult_OpenChannelV2DecodeErrorZ_err(struct LDKDecodeError e);
30376 * Checks if the given object is currently in the success state
30378 bool CResult_OpenChannelV2DecodeErrorZ_is_ok(const struct LDKCResult_OpenChannelV2DecodeErrorZ *NONNULL_PTR o);
30381 * Frees any resources used by the CResult_OpenChannelV2DecodeErrorZ.
30383 void CResult_OpenChannelV2DecodeErrorZ_free(struct LDKCResult_OpenChannelV2DecodeErrorZ _res);
30386 * Creates a new CResult_OpenChannelV2DecodeErrorZ which has the same data as `orig`
30387 * but with all dynamically-allocated buffers duplicated in new buffers.
30389 struct LDKCResult_OpenChannelV2DecodeErrorZ CResult_OpenChannelV2DecodeErrorZ_clone(const struct LDKCResult_OpenChannelV2DecodeErrorZ *NONNULL_PTR orig);
30392 * Creates a new CResult_RevokeAndACKDecodeErrorZ in the success state.
30394 struct LDKCResult_RevokeAndACKDecodeErrorZ CResult_RevokeAndACKDecodeErrorZ_ok(struct LDKRevokeAndACK o);
30397 * Creates a new CResult_RevokeAndACKDecodeErrorZ in the error state.
30399 struct LDKCResult_RevokeAndACKDecodeErrorZ CResult_RevokeAndACKDecodeErrorZ_err(struct LDKDecodeError e);
30402 * Checks if the given object is currently in the success state
30404 bool CResult_RevokeAndACKDecodeErrorZ_is_ok(const struct LDKCResult_RevokeAndACKDecodeErrorZ *NONNULL_PTR o);
30407 * Frees any resources used by the CResult_RevokeAndACKDecodeErrorZ.
30409 void CResult_RevokeAndACKDecodeErrorZ_free(struct LDKCResult_RevokeAndACKDecodeErrorZ _res);
30412 * Creates a new CResult_RevokeAndACKDecodeErrorZ which has the same data as `orig`
30413 * but with all dynamically-allocated buffers duplicated in new buffers.
30415 struct LDKCResult_RevokeAndACKDecodeErrorZ CResult_RevokeAndACKDecodeErrorZ_clone(const struct LDKCResult_RevokeAndACKDecodeErrorZ *NONNULL_PTR orig);
30418 * Creates a new CResult_ShutdownDecodeErrorZ in the success state.
30420 struct LDKCResult_ShutdownDecodeErrorZ CResult_ShutdownDecodeErrorZ_ok(struct LDKShutdown o);
30423 * Creates a new CResult_ShutdownDecodeErrorZ in the error state.
30425 struct LDKCResult_ShutdownDecodeErrorZ CResult_ShutdownDecodeErrorZ_err(struct LDKDecodeError e);
30428 * Checks if the given object is currently in the success state
30430 bool CResult_ShutdownDecodeErrorZ_is_ok(const struct LDKCResult_ShutdownDecodeErrorZ *NONNULL_PTR o);
30433 * Frees any resources used by the CResult_ShutdownDecodeErrorZ.
30435 void CResult_ShutdownDecodeErrorZ_free(struct LDKCResult_ShutdownDecodeErrorZ _res);
30438 * Creates a new CResult_ShutdownDecodeErrorZ which has the same data as `orig`
30439 * but with all dynamically-allocated buffers duplicated in new buffers.
30441 struct LDKCResult_ShutdownDecodeErrorZ CResult_ShutdownDecodeErrorZ_clone(const struct LDKCResult_ShutdownDecodeErrorZ *NONNULL_PTR orig);
30444 * Creates a new CResult_UpdateFailHTLCDecodeErrorZ in the success state.
30446 struct LDKCResult_UpdateFailHTLCDecodeErrorZ CResult_UpdateFailHTLCDecodeErrorZ_ok(struct LDKUpdateFailHTLC o);
30449 * Creates a new CResult_UpdateFailHTLCDecodeErrorZ in the error state.
30451 struct LDKCResult_UpdateFailHTLCDecodeErrorZ CResult_UpdateFailHTLCDecodeErrorZ_err(struct LDKDecodeError e);
30454 * Checks if the given object is currently in the success state
30456 bool CResult_UpdateFailHTLCDecodeErrorZ_is_ok(const struct LDKCResult_UpdateFailHTLCDecodeErrorZ *NONNULL_PTR o);
30459 * Frees any resources used by the CResult_UpdateFailHTLCDecodeErrorZ.
30461 void CResult_UpdateFailHTLCDecodeErrorZ_free(struct LDKCResult_UpdateFailHTLCDecodeErrorZ _res);
30464 * Creates a new CResult_UpdateFailHTLCDecodeErrorZ which has the same data as `orig`
30465 * but with all dynamically-allocated buffers duplicated in new buffers.
30467 struct LDKCResult_UpdateFailHTLCDecodeErrorZ CResult_UpdateFailHTLCDecodeErrorZ_clone(const struct LDKCResult_UpdateFailHTLCDecodeErrorZ *NONNULL_PTR orig);
30470 * Creates a new CResult_UpdateFailMalformedHTLCDecodeErrorZ in the success state.
30472 struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ CResult_UpdateFailMalformedHTLCDecodeErrorZ_ok(struct LDKUpdateFailMalformedHTLC o);
30475 * Creates a new CResult_UpdateFailMalformedHTLCDecodeErrorZ in the error state.
30477 struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ CResult_UpdateFailMalformedHTLCDecodeErrorZ_err(struct LDKDecodeError e);
30480 * Checks if the given object is currently in the success state
30482 bool CResult_UpdateFailMalformedHTLCDecodeErrorZ_is_ok(const struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ *NONNULL_PTR o);
30485 * Frees any resources used by the CResult_UpdateFailMalformedHTLCDecodeErrorZ.
30487 void CResult_UpdateFailMalformedHTLCDecodeErrorZ_free(struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ _res);
30490 * Creates a new CResult_UpdateFailMalformedHTLCDecodeErrorZ which has the same data as `orig`
30491 * but with all dynamically-allocated buffers duplicated in new buffers.
30493 struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ CResult_UpdateFailMalformedHTLCDecodeErrorZ_clone(const struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ *NONNULL_PTR orig);
30496 * Creates a new CResult_UpdateFeeDecodeErrorZ in the success state.
30498 struct LDKCResult_UpdateFeeDecodeErrorZ CResult_UpdateFeeDecodeErrorZ_ok(struct LDKUpdateFee o);
30501 * Creates a new CResult_UpdateFeeDecodeErrorZ in the error state.
30503 struct LDKCResult_UpdateFeeDecodeErrorZ CResult_UpdateFeeDecodeErrorZ_err(struct LDKDecodeError e);
30506 * Checks if the given object is currently in the success state
30508 bool CResult_UpdateFeeDecodeErrorZ_is_ok(const struct LDKCResult_UpdateFeeDecodeErrorZ *NONNULL_PTR o);
30511 * Frees any resources used by the CResult_UpdateFeeDecodeErrorZ.
30513 void CResult_UpdateFeeDecodeErrorZ_free(struct LDKCResult_UpdateFeeDecodeErrorZ _res);
30516 * Creates a new CResult_UpdateFeeDecodeErrorZ which has the same data as `orig`
30517 * but with all dynamically-allocated buffers duplicated in new buffers.
30519 struct LDKCResult_UpdateFeeDecodeErrorZ CResult_UpdateFeeDecodeErrorZ_clone(const struct LDKCResult_UpdateFeeDecodeErrorZ *NONNULL_PTR orig);
30522 * Creates a new CResult_UpdateFulfillHTLCDecodeErrorZ in the success state.
30524 struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ CResult_UpdateFulfillHTLCDecodeErrorZ_ok(struct LDKUpdateFulfillHTLC o);
30527 * Creates a new CResult_UpdateFulfillHTLCDecodeErrorZ in the error state.
30529 struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ CResult_UpdateFulfillHTLCDecodeErrorZ_err(struct LDKDecodeError e);
30532 * Checks if the given object is currently in the success state
30534 bool CResult_UpdateFulfillHTLCDecodeErrorZ_is_ok(const struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ *NONNULL_PTR o);
30537 * Frees any resources used by the CResult_UpdateFulfillHTLCDecodeErrorZ.
30539 void CResult_UpdateFulfillHTLCDecodeErrorZ_free(struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ _res);
30542 * Creates a new CResult_UpdateFulfillHTLCDecodeErrorZ which has the same data as `orig`
30543 * but with all dynamically-allocated buffers duplicated in new buffers.
30545 struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ CResult_UpdateFulfillHTLCDecodeErrorZ_clone(const struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ *NONNULL_PTR orig);
30548 * Creates a new CResult_OnionPacketDecodeErrorZ in the success state.
30550 struct LDKCResult_OnionPacketDecodeErrorZ CResult_OnionPacketDecodeErrorZ_ok(struct LDKOnionPacket o);
30553 * Creates a new CResult_OnionPacketDecodeErrorZ in the error state.
30555 struct LDKCResult_OnionPacketDecodeErrorZ CResult_OnionPacketDecodeErrorZ_err(struct LDKDecodeError e);
30558 * Checks if the given object is currently in the success state
30560 bool CResult_OnionPacketDecodeErrorZ_is_ok(const struct LDKCResult_OnionPacketDecodeErrorZ *NONNULL_PTR o);
30563 * Frees any resources used by the CResult_OnionPacketDecodeErrorZ.
30565 void CResult_OnionPacketDecodeErrorZ_free(struct LDKCResult_OnionPacketDecodeErrorZ _res);
30568 * Creates a new CResult_OnionPacketDecodeErrorZ which has the same data as `orig`
30569 * but with all dynamically-allocated buffers duplicated in new buffers.
30571 struct LDKCResult_OnionPacketDecodeErrorZ CResult_OnionPacketDecodeErrorZ_clone(const struct LDKCResult_OnionPacketDecodeErrorZ *NONNULL_PTR orig);
30574 * Creates a new CResult_UpdateAddHTLCDecodeErrorZ in the success state.
30576 struct LDKCResult_UpdateAddHTLCDecodeErrorZ CResult_UpdateAddHTLCDecodeErrorZ_ok(struct LDKUpdateAddHTLC o);
30579 * Creates a new CResult_UpdateAddHTLCDecodeErrorZ in the error state.
30581 struct LDKCResult_UpdateAddHTLCDecodeErrorZ CResult_UpdateAddHTLCDecodeErrorZ_err(struct LDKDecodeError e);
30584 * Checks if the given object is currently in the success state
30586 bool CResult_UpdateAddHTLCDecodeErrorZ_is_ok(const struct LDKCResult_UpdateAddHTLCDecodeErrorZ *NONNULL_PTR o);
30589 * Frees any resources used by the CResult_UpdateAddHTLCDecodeErrorZ.
30591 void CResult_UpdateAddHTLCDecodeErrorZ_free(struct LDKCResult_UpdateAddHTLCDecodeErrorZ _res);
30594 * Creates a new CResult_UpdateAddHTLCDecodeErrorZ which has the same data as `orig`
30595 * but with all dynamically-allocated buffers duplicated in new buffers.
30597 struct LDKCResult_UpdateAddHTLCDecodeErrorZ CResult_UpdateAddHTLCDecodeErrorZ_clone(const struct LDKCResult_UpdateAddHTLCDecodeErrorZ *NONNULL_PTR orig);
30600 * Creates a new CResult_OnionMessageDecodeErrorZ in the success state.
30602 struct LDKCResult_OnionMessageDecodeErrorZ CResult_OnionMessageDecodeErrorZ_ok(struct LDKOnionMessage o);
30605 * Creates a new CResult_OnionMessageDecodeErrorZ in the error state.
30607 struct LDKCResult_OnionMessageDecodeErrorZ CResult_OnionMessageDecodeErrorZ_err(struct LDKDecodeError e);
30610 * Checks if the given object is currently in the success state
30612 bool CResult_OnionMessageDecodeErrorZ_is_ok(const struct LDKCResult_OnionMessageDecodeErrorZ *NONNULL_PTR o);
30615 * Frees any resources used by the CResult_OnionMessageDecodeErrorZ.
30617 void CResult_OnionMessageDecodeErrorZ_free(struct LDKCResult_OnionMessageDecodeErrorZ _res);
30620 * Creates a new CResult_OnionMessageDecodeErrorZ which has the same data as `orig`
30621 * but with all dynamically-allocated buffers duplicated in new buffers.
30623 struct LDKCResult_OnionMessageDecodeErrorZ CResult_OnionMessageDecodeErrorZ_clone(const struct LDKCResult_OnionMessageDecodeErrorZ *NONNULL_PTR orig);
30626 * Creates a new CResult_FinalOnionHopDataDecodeErrorZ in the success state.
30628 struct LDKCResult_FinalOnionHopDataDecodeErrorZ CResult_FinalOnionHopDataDecodeErrorZ_ok(struct LDKFinalOnionHopData o);
30631 * Creates a new CResult_FinalOnionHopDataDecodeErrorZ in the error state.
30633 struct LDKCResult_FinalOnionHopDataDecodeErrorZ CResult_FinalOnionHopDataDecodeErrorZ_err(struct LDKDecodeError e);
30636 * Checks if the given object is currently in the success state
30638 bool CResult_FinalOnionHopDataDecodeErrorZ_is_ok(const struct LDKCResult_FinalOnionHopDataDecodeErrorZ *NONNULL_PTR o);
30641 * Frees any resources used by the CResult_FinalOnionHopDataDecodeErrorZ.
30643 void CResult_FinalOnionHopDataDecodeErrorZ_free(struct LDKCResult_FinalOnionHopDataDecodeErrorZ _res);
30646 * Creates a new CResult_FinalOnionHopDataDecodeErrorZ which has the same data as `orig`
30647 * but with all dynamically-allocated buffers duplicated in new buffers.
30649 struct LDKCResult_FinalOnionHopDataDecodeErrorZ CResult_FinalOnionHopDataDecodeErrorZ_clone(const struct LDKCResult_FinalOnionHopDataDecodeErrorZ *NONNULL_PTR orig);
30652 * Creates a new CResult_PingDecodeErrorZ in the success state.
30654 struct LDKCResult_PingDecodeErrorZ CResult_PingDecodeErrorZ_ok(struct LDKPing o);
30657 * Creates a new CResult_PingDecodeErrorZ in the error state.
30659 struct LDKCResult_PingDecodeErrorZ CResult_PingDecodeErrorZ_err(struct LDKDecodeError e);
30662 * Checks if the given object is currently in the success state
30664 bool CResult_PingDecodeErrorZ_is_ok(const struct LDKCResult_PingDecodeErrorZ *NONNULL_PTR o);
30667 * Frees any resources used by the CResult_PingDecodeErrorZ.
30669 void CResult_PingDecodeErrorZ_free(struct LDKCResult_PingDecodeErrorZ _res);
30672 * Creates a new CResult_PingDecodeErrorZ which has the same data as `orig`
30673 * but with all dynamically-allocated buffers duplicated in new buffers.
30675 struct LDKCResult_PingDecodeErrorZ CResult_PingDecodeErrorZ_clone(const struct LDKCResult_PingDecodeErrorZ *NONNULL_PTR orig);
30678 * Creates a new CResult_PongDecodeErrorZ in the success state.
30680 struct LDKCResult_PongDecodeErrorZ CResult_PongDecodeErrorZ_ok(struct LDKPong o);
30683 * Creates a new CResult_PongDecodeErrorZ in the error state.
30685 struct LDKCResult_PongDecodeErrorZ CResult_PongDecodeErrorZ_err(struct LDKDecodeError e);
30688 * Checks if the given object is currently in the success state
30690 bool CResult_PongDecodeErrorZ_is_ok(const struct LDKCResult_PongDecodeErrorZ *NONNULL_PTR o);
30693 * Frees any resources used by the CResult_PongDecodeErrorZ.
30695 void CResult_PongDecodeErrorZ_free(struct LDKCResult_PongDecodeErrorZ _res);
30698 * Creates a new CResult_PongDecodeErrorZ which has the same data as `orig`
30699 * but with all dynamically-allocated buffers duplicated in new buffers.
30701 struct LDKCResult_PongDecodeErrorZ CResult_PongDecodeErrorZ_clone(const struct LDKCResult_PongDecodeErrorZ *NONNULL_PTR orig);
30704 * Creates a new CResult_UnsignedChannelAnnouncementDecodeErrorZ in the success state.
30706 struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ CResult_UnsignedChannelAnnouncementDecodeErrorZ_ok(struct LDKUnsignedChannelAnnouncement o);
30709 * Creates a new CResult_UnsignedChannelAnnouncementDecodeErrorZ in the error state.
30711 struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ CResult_UnsignedChannelAnnouncementDecodeErrorZ_err(struct LDKDecodeError e);
30714 * Checks if the given object is currently in the success state
30716 bool CResult_UnsignedChannelAnnouncementDecodeErrorZ_is_ok(const struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ *NONNULL_PTR o);
30719 * Frees any resources used by the CResult_UnsignedChannelAnnouncementDecodeErrorZ.
30721 void CResult_UnsignedChannelAnnouncementDecodeErrorZ_free(struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ _res);
30724 * Creates a new CResult_UnsignedChannelAnnouncementDecodeErrorZ which has the same data as `orig`
30725 * but with all dynamically-allocated buffers duplicated in new buffers.
30727 struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ CResult_UnsignedChannelAnnouncementDecodeErrorZ_clone(const struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ *NONNULL_PTR orig);
30730 * Creates a new CResult_ChannelAnnouncementDecodeErrorZ in the success state.
30732 struct LDKCResult_ChannelAnnouncementDecodeErrorZ CResult_ChannelAnnouncementDecodeErrorZ_ok(struct LDKChannelAnnouncement o);
30735 * Creates a new CResult_ChannelAnnouncementDecodeErrorZ in the error state.
30737 struct LDKCResult_ChannelAnnouncementDecodeErrorZ CResult_ChannelAnnouncementDecodeErrorZ_err(struct LDKDecodeError e);
30740 * Checks if the given object is currently in the success state
30742 bool CResult_ChannelAnnouncementDecodeErrorZ_is_ok(const struct LDKCResult_ChannelAnnouncementDecodeErrorZ *NONNULL_PTR o);
30745 * Frees any resources used by the CResult_ChannelAnnouncementDecodeErrorZ.
30747 void CResult_ChannelAnnouncementDecodeErrorZ_free(struct LDKCResult_ChannelAnnouncementDecodeErrorZ _res);
30750 * Creates a new CResult_ChannelAnnouncementDecodeErrorZ which has the same data as `orig`
30751 * but with all dynamically-allocated buffers duplicated in new buffers.
30753 struct LDKCResult_ChannelAnnouncementDecodeErrorZ CResult_ChannelAnnouncementDecodeErrorZ_clone(const struct LDKCResult_ChannelAnnouncementDecodeErrorZ *NONNULL_PTR orig);
30756 * Creates a new CResult_UnsignedChannelUpdateDecodeErrorZ in the success state.
30758 struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ CResult_UnsignedChannelUpdateDecodeErrorZ_ok(struct LDKUnsignedChannelUpdate o);
30761 * Creates a new CResult_UnsignedChannelUpdateDecodeErrorZ in the error state.
30763 struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ CResult_UnsignedChannelUpdateDecodeErrorZ_err(struct LDKDecodeError e);
30766 * Checks if the given object is currently in the success state
30768 bool CResult_UnsignedChannelUpdateDecodeErrorZ_is_ok(const struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ *NONNULL_PTR o);
30771 * Frees any resources used by the CResult_UnsignedChannelUpdateDecodeErrorZ.
30773 void CResult_UnsignedChannelUpdateDecodeErrorZ_free(struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ _res);
30776 * Creates a new CResult_UnsignedChannelUpdateDecodeErrorZ which has the same data as `orig`
30777 * but with all dynamically-allocated buffers duplicated in new buffers.
30779 struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ CResult_UnsignedChannelUpdateDecodeErrorZ_clone(const struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ *NONNULL_PTR orig);
30782 * Creates a new CResult_ChannelUpdateDecodeErrorZ in the success state.
30784 struct LDKCResult_ChannelUpdateDecodeErrorZ CResult_ChannelUpdateDecodeErrorZ_ok(struct LDKChannelUpdate o);
30787 * Creates a new CResult_ChannelUpdateDecodeErrorZ in the error state.
30789 struct LDKCResult_ChannelUpdateDecodeErrorZ CResult_ChannelUpdateDecodeErrorZ_err(struct LDKDecodeError e);
30792 * Checks if the given object is currently in the success state
30794 bool CResult_ChannelUpdateDecodeErrorZ_is_ok(const struct LDKCResult_ChannelUpdateDecodeErrorZ *NONNULL_PTR o);
30797 * Frees any resources used by the CResult_ChannelUpdateDecodeErrorZ.
30799 void CResult_ChannelUpdateDecodeErrorZ_free(struct LDKCResult_ChannelUpdateDecodeErrorZ _res);
30802 * Creates a new CResult_ChannelUpdateDecodeErrorZ which has the same data as `orig`
30803 * but with all dynamically-allocated buffers duplicated in new buffers.
30805 struct LDKCResult_ChannelUpdateDecodeErrorZ CResult_ChannelUpdateDecodeErrorZ_clone(const struct LDKCResult_ChannelUpdateDecodeErrorZ *NONNULL_PTR orig);
30808 * Creates a new CResult_ErrorMessageDecodeErrorZ in the success state.
30810 struct LDKCResult_ErrorMessageDecodeErrorZ CResult_ErrorMessageDecodeErrorZ_ok(struct LDKErrorMessage o);
30813 * Creates a new CResult_ErrorMessageDecodeErrorZ in the error state.
30815 struct LDKCResult_ErrorMessageDecodeErrorZ CResult_ErrorMessageDecodeErrorZ_err(struct LDKDecodeError e);
30818 * Checks if the given object is currently in the success state
30820 bool CResult_ErrorMessageDecodeErrorZ_is_ok(const struct LDKCResult_ErrorMessageDecodeErrorZ *NONNULL_PTR o);
30823 * Frees any resources used by the CResult_ErrorMessageDecodeErrorZ.
30825 void CResult_ErrorMessageDecodeErrorZ_free(struct LDKCResult_ErrorMessageDecodeErrorZ _res);
30828 * Creates a new CResult_ErrorMessageDecodeErrorZ which has the same data as `orig`
30829 * but with all dynamically-allocated buffers duplicated in new buffers.
30831 struct LDKCResult_ErrorMessageDecodeErrorZ CResult_ErrorMessageDecodeErrorZ_clone(const struct LDKCResult_ErrorMessageDecodeErrorZ *NONNULL_PTR orig);
30834 * Creates a new CResult_WarningMessageDecodeErrorZ in the success state.
30836 struct LDKCResult_WarningMessageDecodeErrorZ CResult_WarningMessageDecodeErrorZ_ok(struct LDKWarningMessage o);
30839 * Creates a new CResult_WarningMessageDecodeErrorZ in the error state.
30841 struct LDKCResult_WarningMessageDecodeErrorZ CResult_WarningMessageDecodeErrorZ_err(struct LDKDecodeError e);
30844 * Checks if the given object is currently in the success state
30846 bool CResult_WarningMessageDecodeErrorZ_is_ok(const struct LDKCResult_WarningMessageDecodeErrorZ *NONNULL_PTR o);
30849 * Frees any resources used by the CResult_WarningMessageDecodeErrorZ.
30851 void CResult_WarningMessageDecodeErrorZ_free(struct LDKCResult_WarningMessageDecodeErrorZ _res);
30854 * Creates a new CResult_WarningMessageDecodeErrorZ which has the same data as `orig`
30855 * but with all dynamically-allocated buffers duplicated in new buffers.
30857 struct LDKCResult_WarningMessageDecodeErrorZ CResult_WarningMessageDecodeErrorZ_clone(const struct LDKCResult_WarningMessageDecodeErrorZ *NONNULL_PTR orig);
30860 * Creates a new CResult_UnsignedNodeAnnouncementDecodeErrorZ in the success state.
30862 struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ CResult_UnsignedNodeAnnouncementDecodeErrorZ_ok(struct LDKUnsignedNodeAnnouncement o);
30865 * Creates a new CResult_UnsignedNodeAnnouncementDecodeErrorZ in the error state.
30867 struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ CResult_UnsignedNodeAnnouncementDecodeErrorZ_err(struct LDKDecodeError e);
30870 * Checks if the given object is currently in the success state
30872 bool CResult_UnsignedNodeAnnouncementDecodeErrorZ_is_ok(const struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ *NONNULL_PTR o);
30875 * Frees any resources used by the CResult_UnsignedNodeAnnouncementDecodeErrorZ.
30877 void CResult_UnsignedNodeAnnouncementDecodeErrorZ_free(struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ _res);
30880 * Creates a new CResult_UnsignedNodeAnnouncementDecodeErrorZ which has the same data as `orig`
30881 * but with all dynamically-allocated buffers duplicated in new buffers.
30883 struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ CResult_UnsignedNodeAnnouncementDecodeErrorZ_clone(const struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ *NONNULL_PTR orig);
30886 * Creates a new CResult_NodeAnnouncementDecodeErrorZ in the success state.
30888 struct LDKCResult_NodeAnnouncementDecodeErrorZ CResult_NodeAnnouncementDecodeErrorZ_ok(struct LDKNodeAnnouncement o);
30891 * Creates a new CResult_NodeAnnouncementDecodeErrorZ in the error state.
30893 struct LDKCResult_NodeAnnouncementDecodeErrorZ CResult_NodeAnnouncementDecodeErrorZ_err(struct LDKDecodeError e);
30896 * Checks if the given object is currently in the success state
30898 bool CResult_NodeAnnouncementDecodeErrorZ_is_ok(const struct LDKCResult_NodeAnnouncementDecodeErrorZ *NONNULL_PTR o);
30901 * Frees any resources used by the CResult_NodeAnnouncementDecodeErrorZ.
30903 void CResult_NodeAnnouncementDecodeErrorZ_free(struct LDKCResult_NodeAnnouncementDecodeErrorZ _res);
30906 * Creates a new CResult_NodeAnnouncementDecodeErrorZ which has the same data as `orig`
30907 * but with all dynamically-allocated buffers duplicated in new buffers.
30909 struct LDKCResult_NodeAnnouncementDecodeErrorZ CResult_NodeAnnouncementDecodeErrorZ_clone(const struct LDKCResult_NodeAnnouncementDecodeErrorZ *NONNULL_PTR orig);
30912 * Creates a new CResult_QueryShortChannelIdsDecodeErrorZ in the success state.
30914 struct LDKCResult_QueryShortChannelIdsDecodeErrorZ CResult_QueryShortChannelIdsDecodeErrorZ_ok(struct LDKQueryShortChannelIds o);
30917 * Creates a new CResult_QueryShortChannelIdsDecodeErrorZ in the error state.
30919 struct LDKCResult_QueryShortChannelIdsDecodeErrorZ CResult_QueryShortChannelIdsDecodeErrorZ_err(struct LDKDecodeError e);
30922 * Checks if the given object is currently in the success state
30924 bool CResult_QueryShortChannelIdsDecodeErrorZ_is_ok(const struct LDKCResult_QueryShortChannelIdsDecodeErrorZ *NONNULL_PTR o);
30927 * Frees any resources used by the CResult_QueryShortChannelIdsDecodeErrorZ.
30929 void CResult_QueryShortChannelIdsDecodeErrorZ_free(struct LDKCResult_QueryShortChannelIdsDecodeErrorZ _res);
30932 * Creates a new CResult_QueryShortChannelIdsDecodeErrorZ which has the same data as `orig`
30933 * but with all dynamically-allocated buffers duplicated in new buffers.
30935 struct LDKCResult_QueryShortChannelIdsDecodeErrorZ CResult_QueryShortChannelIdsDecodeErrorZ_clone(const struct LDKCResult_QueryShortChannelIdsDecodeErrorZ *NONNULL_PTR orig);
30938 * Creates a new CResult_ReplyShortChannelIdsEndDecodeErrorZ in the success state.
30940 struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ CResult_ReplyShortChannelIdsEndDecodeErrorZ_ok(struct LDKReplyShortChannelIdsEnd o);
30943 * Creates a new CResult_ReplyShortChannelIdsEndDecodeErrorZ in the error state.
30945 struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ CResult_ReplyShortChannelIdsEndDecodeErrorZ_err(struct LDKDecodeError e);
30948 * Checks if the given object is currently in the success state
30950 bool CResult_ReplyShortChannelIdsEndDecodeErrorZ_is_ok(const struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ *NONNULL_PTR o);
30953 * Frees any resources used by the CResult_ReplyShortChannelIdsEndDecodeErrorZ.
30955 void CResult_ReplyShortChannelIdsEndDecodeErrorZ_free(struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ _res);
30958 * Creates a new CResult_ReplyShortChannelIdsEndDecodeErrorZ which has the same data as `orig`
30959 * but with all dynamically-allocated buffers duplicated in new buffers.
30961 struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ CResult_ReplyShortChannelIdsEndDecodeErrorZ_clone(const struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ *NONNULL_PTR orig);
30964 * Creates a new CResult_QueryChannelRangeDecodeErrorZ in the success state.
30966 struct LDKCResult_QueryChannelRangeDecodeErrorZ CResult_QueryChannelRangeDecodeErrorZ_ok(struct LDKQueryChannelRange o);
30969 * Creates a new CResult_QueryChannelRangeDecodeErrorZ in the error state.
30971 struct LDKCResult_QueryChannelRangeDecodeErrorZ CResult_QueryChannelRangeDecodeErrorZ_err(struct LDKDecodeError e);
30974 * Checks if the given object is currently in the success state
30976 bool CResult_QueryChannelRangeDecodeErrorZ_is_ok(const struct LDKCResult_QueryChannelRangeDecodeErrorZ *NONNULL_PTR o);
30979 * Frees any resources used by the CResult_QueryChannelRangeDecodeErrorZ.
30981 void CResult_QueryChannelRangeDecodeErrorZ_free(struct LDKCResult_QueryChannelRangeDecodeErrorZ _res);
30984 * Creates a new CResult_QueryChannelRangeDecodeErrorZ which has the same data as `orig`
30985 * but with all dynamically-allocated buffers duplicated in new buffers.
30987 struct LDKCResult_QueryChannelRangeDecodeErrorZ CResult_QueryChannelRangeDecodeErrorZ_clone(const struct LDKCResult_QueryChannelRangeDecodeErrorZ *NONNULL_PTR orig);
30990 * Creates a new CResult_ReplyChannelRangeDecodeErrorZ in the success state.
30992 struct LDKCResult_ReplyChannelRangeDecodeErrorZ CResult_ReplyChannelRangeDecodeErrorZ_ok(struct LDKReplyChannelRange o);
30995 * Creates a new CResult_ReplyChannelRangeDecodeErrorZ in the error state.
30997 struct LDKCResult_ReplyChannelRangeDecodeErrorZ CResult_ReplyChannelRangeDecodeErrorZ_err(struct LDKDecodeError e);
31000 * Checks if the given object is currently in the success state
31002 bool CResult_ReplyChannelRangeDecodeErrorZ_is_ok(const struct LDKCResult_ReplyChannelRangeDecodeErrorZ *NONNULL_PTR o);
31005 * Frees any resources used by the CResult_ReplyChannelRangeDecodeErrorZ.
31007 void CResult_ReplyChannelRangeDecodeErrorZ_free(struct LDKCResult_ReplyChannelRangeDecodeErrorZ _res);
31010 * Creates a new CResult_ReplyChannelRangeDecodeErrorZ which has the same data as `orig`
31011 * but with all dynamically-allocated buffers duplicated in new buffers.
31013 struct LDKCResult_ReplyChannelRangeDecodeErrorZ CResult_ReplyChannelRangeDecodeErrorZ_clone(const struct LDKCResult_ReplyChannelRangeDecodeErrorZ *NONNULL_PTR orig);
31016 * Creates a new CResult_GossipTimestampFilterDecodeErrorZ in the success state.
31018 struct LDKCResult_GossipTimestampFilterDecodeErrorZ CResult_GossipTimestampFilterDecodeErrorZ_ok(struct LDKGossipTimestampFilter o);
31021 * Creates a new CResult_GossipTimestampFilterDecodeErrorZ in the error state.
31023 struct LDKCResult_GossipTimestampFilterDecodeErrorZ CResult_GossipTimestampFilterDecodeErrorZ_err(struct LDKDecodeError e);
31026 * Checks if the given object is currently in the success state
31028 bool CResult_GossipTimestampFilterDecodeErrorZ_is_ok(const struct LDKCResult_GossipTimestampFilterDecodeErrorZ *NONNULL_PTR o);
31031 * Frees any resources used by the CResult_GossipTimestampFilterDecodeErrorZ.
31033 void CResult_GossipTimestampFilterDecodeErrorZ_free(struct LDKCResult_GossipTimestampFilterDecodeErrorZ _res);
31036 * Creates a new CResult_GossipTimestampFilterDecodeErrorZ which has the same data as `orig`
31037 * but with all dynamically-allocated buffers duplicated in new buffers.
31039 struct LDKCResult_GossipTimestampFilterDecodeErrorZ CResult_GossipTimestampFilterDecodeErrorZ_clone(const struct LDKCResult_GossipTimestampFilterDecodeErrorZ *NONNULL_PTR orig);
31042 * Frees the buffer pointed to by `data` if `datalen` is non-0.
31044 void CVec_PhantomRouteHintsZ_free(struct LDKCVec_PhantomRouteHintsZ _res);
31047 * Creates a new CResult_Bolt11InvoiceSignOrCreationErrorZ in the success state.
31049 struct LDKCResult_Bolt11InvoiceSignOrCreationErrorZ CResult_Bolt11InvoiceSignOrCreationErrorZ_ok(struct LDKBolt11Invoice o);
31052 * Creates a new CResult_Bolt11InvoiceSignOrCreationErrorZ in the error state.
31054 struct LDKCResult_Bolt11InvoiceSignOrCreationErrorZ CResult_Bolt11InvoiceSignOrCreationErrorZ_err(struct LDKSignOrCreationError e);
31057 * Checks if the given object is currently in the success state
31059 bool CResult_Bolt11InvoiceSignOrCreationErrorZ_is_ok(const struct LDKCResult_Bolt11InvoiceSignOrCreationErrorZ *NONNULL_PTR o);
31062 * Frees any resources used by the CResult_Bolt11InvoiceSignOrCreationErrorZ.
31064 void CResult_Bolt11InvoiceSignOrCreationErrorZ_free(struct LDKCResult_Bolt11InvoiceSignOrCreationErrorZ _res);
31067 * Creates a new CResult_Bolt11InvoiceSignOrCreationErrorZ which has the same data as `orig`
31068 * but with all dynamically-allocated buffers duplicated in new buffers.
31070 struct LDKCResult_Bolt11InvoiceSignOrCreationErrorZ CResult_Bolt11InvoiceSignOrCreationErrorZ_clone(const struct LDKCResult_Bolt11InvoiceSignOrCreationErrorZ *NONNULL_PTR orig);
31073 * Constructs a new COption_InboundHTLCStateDetailsZ containing a crate::lightning::ln::channel_state::InboundHTLCStateDetails
31075 struct LDKCOption_InboundHTLCStateDetailsZ COption_InboundHTLCStateDetailsZ_some(enum LDKInboundHTLCStateDetails o);
31078 * Constructs a new COption_InboundHTLCStateDetailsZ containing nothing
31080 struct LDKCOption_InboundHTLCStateDetailsZ COption_InboundHTLCStateDetailsZ_none(void);
31083 * Frees any resources associated with the crate::lightning::ln::channel_state::InboundHTLCStateDetails, if we are in the Some state
31085 void COption_InboundHTLCStateDetailsZ_free(struct LDKCOption_InboundHTLCStateDetailsZ _res);
31088 * Creates a new COption_InboundHTLCStateDetailsZ which has the same data as `orig`
31089 * but with all dynamically-allocated buffers duplicated in new buffers.
31091 struct LDKCOption_InboundHTLCStateDetailsZ COption_InboundHTLCStateDetailsZ_clone(const struct LDKCOption_InboundHTLCStateDetailsZ *NONNULL_PTR orig);
31094 * Creates a new CResult_COption_InboundHTLCStateDetailsZDecodeErrorZ in the success state.
31096 struct LDKCResult_COption_InboundHTLCStateDetailsZDecodeErrorZ CResult_COption_InboundHTLCStateDetailsZDecodeErrorZ_ok(struct LDKCOption_InboundHTLCStateDetailsZ o);
31099 * Creates a new CResult_COption_InboundHTLCStateDetailsZDecodeErrorZ in the error state.
31101 struct LDKCResult_COption_InboundHTLCStateDetailsZDecodeErrorZ CResult_COption_InboundHTLCStateDetailsZDecodeErrorZ_err(struct LDKDecodeError e);
31104 * Checks if the given object is currently in the success state
31106 bool CResult_COption_InboundHTLCStateDetailsZDecodeErrorZ_is_ok(const struct LDKCResult_COption_InboundHTLCStateDetailsZDecodeErrorZ *NONNULL_PTR o);
31109 * Frees any resources used by the CResult_COption_InboundHTLCStateDetailsZDecodeErrorZ.
31111 void CResult_COption_InboundHTLCStateDetailsZDecodeErrorZ_free(struct LDKCResult_COption_InboundHTLCStateDetailsZDecodeErrorZ _res);
31114 * Creates a new CResult_COption_InboundHTLCStateDetailsZDecodeErrorZ which has the same data as `orig`
31115 * but with all dynamically-allocated buffers duplicated in new buffers.
31117 struct LDKCResult_COption_InboundHTLCStateDetailsZDecodeErrorZ CResult_COption_InboundHTLCStateDetailsZDecodeErrorZ_clone(const struct LDKCResult_COption_InboundHTLCStateDetailsZDecodeErrorZ *NONNULL_PTR orig);
31120 * Creates a new CResult_InboundHTLCDetailsDecodeErrorZ in the success state.
31122 struct LDKCResult_InboundHTLCDetailsDecodeErrorZ CResult_InboundHTLCDetailsDecodeErrorZ_ok(struct LDKInboundHTLCDetails o);
31125 * Creates a new CResult_InboundHTLCDetailsDecodeErrorZ in the error state.
31127 struct LDKCResult_InboundHTLCDetailsDecodeErrorZ CResult_InboundHTLCDetailsDecodeErrorZ_err(struct LDKDecodeError e);
31130 * Checks if the given object is currently in the success state
31132 bool CResult_InboundHTLCDetailsDecodeErrorZ_is_ok(const struct LDKCResult_InboundHTLCDetailsDecodeErrorZ *NONNULL_PTR o);
31135 * Frees any resources used by the CResult_InboundHTLCDetailsDecodeErrorZ.
31137 void CResult_InboundHTLCDetailsDecodeErrorZ_free(struct LDKCResult_InboundHTLCDetailsDecodeErrorZ _res);
31140 * Creates a new CResult_InboundHTLCDetailsDecodeErrorZ which has the same data as `orig`
31141 * but with all dynamically-allocated buffers duplicated in new buffers.
31143 struct LDKCResult_InboundHTLCDetailsDecodeErrorZ CResult_InboundHTLCDetailsDecodeErrorZ_clone(const struct LDKCResult_InboundHTLCDetailsDecodeErrorZ *NONNULL_PTR orig);
31146 * Constructs a new COption_OutboundHTLCStateDetailsZ containing a crate::lightning::ln::channel_state::OutboundHTLCStateDetails
31148 struct LDKCOption_OutboundHTLCStateDetailsZ COption_OutboundHTLCStateDetailsZ_some(enum LDKOutboundHTLCStateDetails o);
31151 * Constructs a new COption_OutboundHTLCStateDetailsZ containing nothing
31153 struct LDKCOption_OutboundHTLCStateDetailsZ COption_OutboundHTLCStateDetailsZ_none(void);
31156 * Frees any resources associated with the crate::lightning::ln::channel_state::OutboundHTLCStateDetails, if we are in the Some state
31158 void COption_OutboundHTLCStateDetailsZ_free(struct LDKCOption_OutboundHTLCStateDetailsZ _res);
31161 * Creates a new COption_OutboundHTLCStateDetailsZ which has the same data as `orig`
31162 * but with all dynamically-allocated buffers duplicated in new buffers.
31164 struct LDKCOption_OutboundHTLCStateDetailsZ COption_OutboundHTLCStateDetailsZ_clone(const struct LDKCOption_OutboundHTLCStateDetailsZ *NONNULL_PTR orig);
31167 * Creates a new CResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ in the success state.
31169 struct LDKCResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ CResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ_ok(struct LDKCOption_OutboundHTLCStateDetailsZ o);
31172 * Creates a new CResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ in the error state.
31174 struct LDKCResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ CResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ_err(struct LDKDecodeError e);
31177 * Checks if the given object is currently in the success state
31179 bool CResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ_is_ok(const struct LDKCResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ *NONNULL_PTR o);
31182 * Frees any resources used by the CResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ.
31184 void CResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ_free(struct LDKCResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ _res);
31187 * Creates a new CResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ which has the same data as `orig`
31188 * but with all dynamically-allocated buffers duplicated in new buffers.
31190 struct LDKCResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ CResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ_clone(const struct LDKCResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ *NONNULL_PTR orig);
31193 * Creates a new CResult_OutboundHTLCDetailsDecodeErrorZ in the success state.
31195 struct LDKCResult_OutboundHTLCDetailsDecodeErrorZ CResult_OutboundHTLCDetailsDecodeErrorZ_ok(struct LDKOutboundHTLCDetails o);
31198 * Creates a new CResult_OutboundHTLCDetailsDecodeErrorZ in the error state.
31200 struct LDKCResult_OutboundHTLCDetailsDecodeErrorZ CResult_OutboundHTLCDetailsDecodeErrorZ_err(struct LDKDecodeError e);
31203 * Checks if the given object is currently in the success state
31205 bool CResult_OutboundHTLCDetailsDecodeErrorZ_is_ok(const struct LDKCResult_OutboundHTLCDetailsDecodeErrorZ *NONNULL_PTR o);
31208 * Frees any resources used by the CResult_OutboundHTLCDetailsDecodeErrorZ.
31210 void CResult_OutboundHTLCDetailsDecodeErrorZ_free(struct LDKCResult_OutboundHTLCDetailsDecodeErrorZ _res);
31213 * Creates a new CResult_OutboundHTLCDetailsDecodeErrorZ which has the same data as `orig`
31214 * but with all dynamically-allocated buffers duplicated in new buffers.
31216 struct LDKCResult_OutboundHTLCDetailsDecodeErrorZ CResult_OutboundHTLCDetailsDecodeErrorZ_clone(const struct LDKCResult_OutboundHTLCDetailsDecodeErrorZ *NONNULL_PTR orig);
31219 * Creates a new CResult_CounterpartyForwardingInfoDecodeErrorZ in the success state.
31221 struct LDKCResult_CounterpartyForwardingInfoDecodeErrorZ CResult_CounterpartyForwardingInfoDecodeErrorZ_ok(struct LDKCounterpartyForwardingInfo o);
31224 * Creates a new CResult_CounterpartyForwardingInfoDecodeErrorZ in the error state.
31226 struct LDKCResult_CounterpartyForwardingInfoDecodeErrorZ CResult_CounterpartyForwardingInfoDecodeErrorZ_err(struct LDKDecodeError e);
31229 * Checks if the given object is currently in the success state
31231 bool CResult_CounterpartyForwardingInfoDecodeErrorZ_is_ok(const struct LDKCResult_CounterpartyForwardingInfoDecodeErrorZ *NONNULL_PTR o);
31234 * Frees any resources used by the CResult_CounterpartyForwardingInfoDecodeErrorZ.
31236 void CResult_CounterpartyForwardingInfoDecodeErrorZ_free(struct LDKCResult_CounterpartyForwardingInfoDecodeErrorZ _res);
31239 * Creates a new CResult_CounterpartyForwardingInfoDecodeErrorZ which has the same data as `orig`
31240 * but with all dynamically-allocated buffers duplicated in new buffers.
31242 struct LDKCResult_CounterpartyForwardingInfoDecodeErrorZ CResult_CounterpartyForwardingInfoDecodeErrorZ_clone(const struct LDKCResult_CounterpartyForwardingInfoDecodeErrorZ *NONNULL_PTR orig);
31245 * Creates a new CResult_ChannelCounterpartyDecodeErrorZ in the success state.
31247 struct LDKCResult_ChannelCounterpartyDecodeErrorZ CResult_ChannelCounterpartyDecodeErrorZ_ok(struct LDKChannelCounterparty o);
31250 * Creates a new CResult_ChannelCounterpartyDecodeErrorZ in the error state.
31252 struct LDKCResult_ChannelCounterpartyDecodeErrorZ CResult_ChannelCounterpartyDecodeErrorZ_err(struct LDKDecodeError e);
31255 * Checks if the given object is currently in the success state
31257 bool CResult_ChannelCounterpartyDecodeErrorZ_is_ok(const struct LDKCResult_ChannelCounterpartyDecodeErrorZ *NONNULL_PTR o);
31260 * Frees any resources used by the CResult_ChannelCounterpartyDecodeErrorZ.
31262 void CResult_ChannelCounterpartyDecodeErrorZ_free(struct LDKCResult_ChannelCounterpartyDecodeErrorZ _res);
31265 * Creates a new CResult_ChannelCounterpartyDecodeErrorZ which has the same data as `orig`
31266 * but with all dynamically-allocated buffers duplicated in new buffers.
31268 struct LDKCResult_ChannelCounterpartyDecodeErrorZ CResult_ChannelCounterpartyDecodeErrorZ_clone(const struct LDKCResult_ChannelCounterpartyDecodeErrorZ *NONNULL_PTR orig);
31271 * Constructs a new COption_ChannelShutdownStateZ containing a crate::lightning::ln::channel_state::ChannelShutdownState
31273 struct LDKCOption_ChannelShutdownStateZ COption_ChannelShutdownStateZ_some(enum LDKChannelShutdownState o);
31276 * Constructs a new COption_ChannelShutdownStateZ containing nothing
31278 struct LDKCOption_ChannelShutdownStateZ COption_ChannelShutdownStateZ_none(void);
31281 * Frees any resources associated with the crate::lightning::ln::channel_state::ChannelShutdownState, if we are in the Some state
31283 void COption_ChannelShutdownStateZ_free(struct LDKCOption_ChannelShutdownStateZ _res);
31286 * Creates a new COption_ChannelShutdownStateZ which has the same data as `orig`
31287 * but with all dynamically-allocated buffers duplicated in new buffers.
31289 struct LDKCOption_ChannelShutdownStateZ COption_ChannelShutdownStateZ_clone(const struct LDKCOption_ChannelShutdownStateZ *NONNULL_PTR orig);
31292 * Frees the buffer pointed to by `data` if `datalen` is non-0.
31294 void CVec_InboundHTLCDetailsZ_free(struct LDKCVec_InboundHTLCDetailsZ _res);
31297 * Frees the buffer pointed to by `data` if `datalen` is non-0.
31299 void CVec_OutboundHTLCDetailsZ_free(struct LDKCVec_OutboundHTLCDetailsZ _res);
31302 * Creates a new CResult_ChannelDetailsDecodeErrorZ in the success state.
31304 struct LDKCResult_ChannelDetailsDecodeErrorZ CResult_ChannelDetailsDecodeErrorZ_ok(struct LDKChannelDetails o);
31307 * Creates a new CResult_ChannelDetailsDecodeErrorZ in the error state.
31309 struct LDKCResult_ChannelDetailsDecodeErrorZ CResult_ChannelDetailsDecodeErrorZ_err(struct LDKDecodeError e);
31312 * Checks if the given object is currently in the success state
31314 bool CResult_ChannelDetailsDecodeErrorZ_is_ok(const struct LDKCResult_ChannelDetailsDecodeErrorZ *NONNULL_PTR o);
31317 * Frees any resources used by the CResult_ChannelDetailsDecodeErrorZ.
31319 void CResult_ChannelDetailsDecodeErrorZ_free(struct LDKCResult_ChannelDetailsDecodeErrorZ _res);
31322 * Creates a new CResult_ChannelDetailsDecodeErrorZ which has the same data as `orig`
31323 * but with all dynamically-allocated buffers duplicated in new buffers.
31325 struct LDKCResult_ChannelDetailsDecodeErrorZ CResult_ChannelDetailsDecodeErrorZ_clone(const struct LDKCResult_ChannelDetailsDecodeErrorZ *NONNULL_PTR orig);
31328 * Creates a new CResult_ChannelShutdownStateDecodeErrorZ in the success state.
31330 struct LDKCResult_ChannelShutdownStateDecodeErrorZ CResult_ChannelShutdownStateDecodeErrorZ_ok(enum LDKChannelShutdownState o);
31333 * Creates a new CResult_ChannelShutdownStateDecodeErrorZ in the error state.
31335 struct LDKCResult_ChannelShutdownStateDecodeErrorZ CResult_ChannelShutdownStateDecodeErrorZ_err(struct LDKDecodeError e);
31338 * Checks if the given object is currently in the success state
31340 bool CResult_ChannelShutdownStateDecodeErrorZ_is_ok(const struct LDKCResult_ChannelShutdownStateDecodeErrorZ *NONNULL_PTR o);
31343 * Frees any resources used by the CResult_ChannelShutdownStateDecodeErrorZ.
31345 void CResult_ChannelShutdownStateDecodeErrorZ_free(struct LDKCResult_ChannelShutdownStateDecodeErrorZ _res);
31348 * Creates a new CResult_ChannelShutdownStateDecodeErrorZ which has the same data as `orig`
31349 * but with all dynamically-allocated buffers duplicated in new buffers.
31351 struct LDKCResult_ChannelShutdownStateDecodeErrorZ CResult_ChannelShutdownStateDecodeErrorZ_clone(const struct LDKCResult_ChannelShutdownStateDecodeErrorZ *NONNULL_PTR orig);
31354 * Frees the buffer pointed to by `data` if `datalen` is non-0.
31356 void CVec_FutureZ_free(struct LDKCVec_FutureZ _res);
31359 * Creates a new CResult_OffersMessageDecodeErrorZ in the success state.
31361 struct LDKCResult_OffersMessageDecodeErrorZ CResult_OffersMessageDecodeErrorZ_ok(struct LDKOffersMessage o);
31364 * Creates a new CResult_OffersMessageDecodeErrorZ in the error state.
31366 struct LDKCResult_OffersMessageDecodeErrorZ CResult_OffersMessageDecodeErrorZ_err(struct LDKDecodeError e);
31369 * Checks if the given object is currently in the success state
31371 bool CResult_OffersMessageDecodeErrorZ_is_ok(const struct LDKCResult_OffersMessageDecodeErrorZ *NONNULL_PTR o);
31374 * Frees any resources used by the CResult_OffersMessageDecodeErrorZ.
31376 void CResult_OffersMessageDecodeErrorZ_free(struct LDKCResult_OffersMessageDecodeErrorZ _res);
31379 * Creates a new CResult_OffersMessageDecodeErrorZ which has the same data as `orig`
31380 * but with all dynamically-allocated buffers duplicated in new buffers.
31382 struct LDKCResult_OffersMessageDecodeErrorZ CResult_OffersMessageDecodeErrorZ_clone(const struct LDKCResult_OffersMessageDecodeErrorZ *NONNULL_PTR orig);
31385 * Constructs a new COption_HTLCClaimZ containing a crate::lightning::ln::chan_utils::HTLCClaim
31387 struct LDKCOption_HTLCClaimZ COption_HTLCClaimZ_some(enum LDKHTLCClaim o);
31390 * Constructs a new COption_HTLCClaimZ containing nothing
31392 struct LDKCOption_HTLCClaimZ COption_HTLCClaimZ_none(void);
31395 * Frees any resources associated with the crate::lightning::ln::chan_utils::HTLCClaim, if we are in the Some state
31397 void COption_HTLCClaimZ_free(struct LDKCOption_HTLCClaimZ _res);
31400 * Creates a new CResult_CounterpartyCommitmentSecretsDecodeErrorZ in the success state.
31402 struct LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ CResult_CounterpartyCommitmentSecretsDecodeErrorZ_ok(struct LDKCounterpartyCommitmentSecrets o);
31405 * Creates a new CResult_CounterpartyCommitmentSecretsDecodeErrorZ in the error state.
31407 struct LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ CResult_CounterpartyCommitmentSecretsDecodeErrorZ_err(struct LDKDecodeError e);
31410 * Checks if the given object is currently in the success state
31412 bool CResult_CounterpartyCommitmentSecretsDecodeErrorZ_is_ok(const struct LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ *NONNULL_PTR o);
31415 * Frees any resources used by the CResult_CounterpartyCommitmentSecretsDecodeErrorZ.
31417 void CResult_CounterpartyCommitmentSecretsDecodeErrorZ_free(struct LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ _res);
31420 * Creates a new CResult_CounterpartyCommitmentSecretsDecodeErrorZ which has the same data as `orig`
31421 * but with all dynamically-allocated buffers duplicated in new buffers.
31423 struct LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ CResult_CounterpartyCommitmentSecretsDecodeErrorZ_clone(const struct LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ *NONNULL_PTR orig);
31426 * Creates a new CResult_TxCreationKeysDecodeErrorZ in the success state.
31428 struct LDKCResult_TxCreationKeysDecodeErrorZ CResult_TxCreationKeysDecodeErrorZ_ok(struct LDKTxCreationKeys o);
31431 * Creates a new CResult_TxCreationKeysDecodeErrorZ in the error state.
31433 struct LDKCResult_TxCreationKeysDecodeErrorZ CResult_TxCreationKeysDecodeErrorZ_err(struct LDKDecodeError e);
31436 * Checks if the given object is currently in the success state
31438 bool CResult_TxCreationKeysDecodeErrorZ_is_ok(const struct LDKCResult_TxCreationKeysDecodeErrorZ *NONNULL_PTR o);
31441 * Frees any resources used by the CResult_TxCreationKeysDecodeErrorZ.
31443 void CResult_TxCreationKeysDecodeErrorZ_free(struct LDKCResult_TxCreationKeysDecodeErrorZ _res);
31446 * Creates a new CResult_TxCreationKeysDecodeErrorZ which has the same data as `orig`
31447 * but with all dynamically-allocated buffers duplicated in new buffers.
31449 struct LDKCResult_TxCreationKeysDecodeErrorZ CResult_TxCreationKeysDecodeErrorZ_clone(const struct LDKCResult_TxCreationKeysDecodeErrorZ *NONNULL_PTR orig);
31452 * Creates a new CResult_ChannelPublicKeysDecodeErrorZ in the success state.
31454 struct LDKCResult_ChannelPublicKeysDecodeErrorZ CResult_ChannelPublicKeysDecodeErrorZ_ok(struct LDKChannelPublicKeys o);
31457 * Creates a new CResult_ChannelPublicKeysDecodeErrorZ in the error state.
31459 struct LDKCResult_ChannelPublicKeysDecodeErrorZ CResult_ChannelPublicKeysDecodeErrorZ_err(struct LDKDecodeError e);
31462 * Checks if the given object is currently in the success state
31464 bool CResult_ChannelPublicKeysDecodeErrorZ_is_ok(const struct LDKCResult_ChannelPublicKeysDecodeErrorZ *NONNULL_PTR o);
31467 * Frees any resources used by the CResult_ChannelPublicKeysDecodeErrorZ.
31469 void CResult_ChannelPublicKeysDecodeErrorZ_free(struct LDKCResult_ChannelPublicKeysDecodeErrorZ _res);
31472 * Creates a new CResult_ChannelPublicKeysDecodeErrorZ which has the same data as `orig`
31473 * but with all dynamically-allocated buffers duplicated in new buffers.
31475 struct LDKCResult_ChannelPublicKeysDecodeErrorZ CResult_ChannelPublicKeysDecodeErrorZ_clone(const struct LDKCResult_ChannelPublicKeysDecodeErrorZ *NONNULL_PTR orig);
31478 * Creates a new CResult_HTLCOutputInCommitmentDecodeErrorZ in the success state.
31480 struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ CResult_HTLCOutputInCommitmentDecodeErrorZ_ok(struct LDKHTLCOutputInCommitment o);
31483 * Creates a new CResult_HTLCOutputInCommitmentDecodeErrorZ in the error state.
31485 struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ CResult_HTLCOutputInCommitmentDecodeErrorZ_err(struct LDKDecodeError e);
31488 * Checks if the given object is currently in the success state
31490 bool CResult_HTLCOutputInCommitmentDecodeErrorZ_is_ok(const struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ *NONNULL_PTR o);
31493 * Frees any resources used by the CResult_HTLCOutputInCommitmentDecodeErrorZ.
31495 void CResult_HTLCOutputInCommitmentDecodeErrorZ_free(struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ _res);
31498 * Creates a new CResult_HTLCOutputInCommitmentDecodeErrorZ which has the same data as `orig`
31499 * but with all dynamically-allocated buffers duplicated in new buffers.
31501 struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ CResult_HTLCOutputInCommitmentDecodeErrorZ_clone(const struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ *NONNULL_PTR orig);
31504 * Creates a new CResult_CounterpartyChannelTransactionParametersDecodeErrorZ in the success state.
31506 struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_ok(struct LDKCounterpartyChannelTransactionParameters o);
31509 * Creates a new CResult_CounterpartyChannelTransactionParametersDecodeErrorZ in the error state.
31511 struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_err(struct LDKDecodeError e);
31514 * Checks if the given object is currently in the success state
31516 bool CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_is_ok(const struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ *NONNULL_PTR o);
31519 * Frees any resources used by the CResult_CounterpartyChannelTransactionParametersDecodeErrorZ.
31521 void CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_free(struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ _res);
31524 * Creates a new CResult_CounterpartyChannelTransactionParametersDecodeErrorZ which has the same data as `orig`
31525 * but with all dynamically-allocated buffers duplicated in new buffers.
31527 struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_clone(const struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ *NONNULL_PTR orig);
31530 * Creates a new CResult_ChannelTransactionParametersDecodeErrorZ in the success state.
31532 struct LDKCResult_ChannelTransactionParametersDecodeErrorZ CResult_ChannelTransactionParametersDecodeErrorZ_ok(struct LDKChannelTransactionParameters o);
31535 * Creates a new CResult_ChannelTransactionParametersDecodeErrorZ in the error state.
31537 struct LDKCResult_ChannelTransactionParametersDecodeErrorZ CResult_ChannelTransactionParametersDecodeErrorZ_err(struct LDKDecodeError e);
31540 * Checks if the given object is currently in the success state
31542 bool CResult_ChannelTransactionParametersDecodeErrorZ_is_ok(const struct LDKCResult_ChannelTransactionParametersDecodeErrorZ *NONNULL_PTR o);
31545 * Frees any resources used by the CResult_ChannelTransactionParametersDecodeErrorZ.
31547 void CResult_ChannelTransactionParametersDecodeErrorZ_free(struct LDKCResult_ChannelTransactionParametersDecodeErrorZ _res);
31550 * Creates a new CResult_ChannelTransactionParametersDecodeErrorZ which has the same data as `orig`
31551 * but with all dynamically-allocated buffers duplicated in new buffers.
31553 struct LDKCResult_ChannelTransactionParametersDecodeErrorZ CResult_ChannelTransactionParametersDecodeErrorZ_clone(const struct LDKCResult_ChannelTransactionParametersDecodeErrorZ *NONNULL_PTR orig);
31556 * Creates a new CResult_HolderCommitmentTransactionDecodeErrorZ in the success state.
31558 struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ CResult_HolderCommitmentTransactionDecodeErrorZ_ok(struct LDKHolderCommitmentTransaction o);
31561 * Creates a new CResult_HolderCommitmentTransactionDecodeErrorZ in the error state.
31563 struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ CResult_HolderCommitmentTransactionDecodeErrorZ_err(struct LDKDecodeError e);
31566 * Checks if the given object is currently in the success state
31568 bool CResult_HolderCommitmentTransactionDecodeErrorZ_is_ok(const struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ *NONNULL_PTR o);
31571 * Frees any resources used by the CResult_HolderCommitmentTransactionDecodeErrorZ.
31573 void CResult_HolderCommitmentTransactionDecodeErrorZ_free(struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ _res);
31576 * Creates a new CResult_HolderCommitmentTransactionDecodeErrorZ which has the same data as `orig`
31577 * but with all dynamically-allocated buffers duplicated in new buffers.
31579 struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ CResult_HolderCommitmentTransactionDecodeErrorZ_clone(const struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ *NONNULL_PTR orig);
31582 * Creates a new CResult_BuiltCommitmentTransactionDecodeErrorZ in the success state.
31584 struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ CResult_BuiltCommitmentTransactionDecodeErrorZ_ok(struct LDKBuiltCommitmentTransaction o);
31587 * Creates a new CResult_BuiltCommitmentTransactionDecodeErrorZ in the error state.
31589 struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ CResult_BuiltCommitmentTransactionDecodeErrorZ_err(struct LDKDecodeError e);
31592 * Checks if the given object is currently in the success state
31594 bool CResult_BuiltCommitmentTransactionDecodeErrorZ_is_ok(const struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ *NONNULL_PTR o);
31597 * Frees any resources used by the CResult_BuiltCommitmentTransactionDecodeErrorZ.
31599 void CResult_BuiltCommitmentTransactionDecodeErrorZ_free(struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ _res);
31602 * Creates a new CResult_BuiltCommitmentTransactionDecodeErrorZ which has the same data as `orig`
31603 * but with all dynamically-allocated buffers duplicated in new buffers.
31605 struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ CResult_BuiltCommitmentTransactionDecodeErrorZ_clone(const struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ *NONNULL_PTR orig);
31608 * Creates a new CResult_TrustedClosingTransactionNoneZ in the success state.
31610 struct LDKCResult_TrustedClosingTransactionNoneZ CResult_TrustedClosingTransactionNoneZ_ok(struct LDKTrustedClosingTransaction o);
31613 * Creates a new CResult_TrustedClosingTransactionNoneZ in the error state.
31615 struct LDKCResult_TrustedClosingTransactionNoneZ CResult_TrustedClosingTransactionNoneZ_err(void);
31618 * Checks if the given object is currently in the success state
31620 bool CResult_TrustedClosingTransactionNoneZ_is_ok(const struct LDKCResult_TrustedClosingTransactionNoneZ *NONNULL_PTR o);
31623 * Frees any resources used by the CResult_TrustedClosingTransactionNoneZ.
31625 void CResult_TrustedClosingTransactionNoneZ_free(struct LDKCResult_TrustedClosingTransactionNoneZ _res);
31628 * Creates a new CResult_CommitmentTransactionDecodeErrorZ in the success state.
31630 struct LDKCResult_CommitmentTransactionDecodeErrorZ CResult_CommitmentTransactionDecodeErrorZ_ok(struct LDKCommitmentTransaction o);
31633 * Creates a new CResult_CommitmentTransactionDecodeErrorZ in the error state.
31635 struct LDKCResult_CommitmentTransactionDecodeErrorZ CResult_CommitmentTransactionDecodeErrorZ_err(struct LDKDecodeError e);
31638 * Checks if the given object is currently in the success state
31640 bool CResult_CommitmentTransactionDecodeErrorZ_is_ok(const struct LDKCResult_CommitmentTransactionDecodeErrorZ *NONNULL_PTR o);
31643 * Frees any resources used by the CResult_CommitmentTransactionDecodeErrorZ.
31645 void CResult_CommitmentTransactionDecodeErrorZ_free(struct LDKCResult_CommitmentTransactionDecodeErrorZ _res);
31648 * Creates a new CResult_CommitmentTransactionDecodeErrorZ which has the same data as `orig`
31649 * but with all dynamically-allocated buffers duplicated in new buffers.
31651 struct LDKCResult_CommitmentTransactionDecodeErrorZ CResult_CommitmentTransactionDecodeErrorZ_clone(const struct LDKCResult_CommitmentTransactionDecodeErrorZ *NONNULL_PTR orig);
31654 * Creates a new CResult_TrustedCommitmentTransactionNoneZ in the success state.
31656 struct LDKCResult_TrustedCommitmentTransactionNoneZ CResult_TrustedCommitmentTransactionNoneZ_ok(struct LDKTrustedCommitmentTransaction o);
31659 * Creates a new CResult_TrustedCommitmentTransactionNoneZ in the error state.
31661 struct LDKCResult_TrustedCommitmentTransactionNoneZ CResult_TrustedCommitmentTransactionNoneZ_err(void);
31664 * Checks if the given object is currently in the success state
31666 bool CResult_TrustedCommitmentTransactionNoneZ_is_ok(const struct LDKCResult_TrustedCommitmentTransactionNoneZ *NONNULL_PTR o);
31669 * Frees any resources used by the CResult_TrustedCommitmentTransactionNoneZ.
31671 void CResult_TrustedCommitmentTransactionNoneZ_free(struct LDKCResult_TrustedCommitmentTransactionNoneZ _res);
31674 * Creates a new CResult_CVec_ECDSASignatureZNoneZ in the success state.
31676 struct LDKCResult_CVec_ECDSASignatureZNoneZ CResult_CVec_ECDSASignatureZNoneZ_ok(struct LDKCVec_ECDSASignatureZ o);
31679 * Creates a new CResult_CVec_ECDSASignatureZNoneZ in the error state.
31681 struct LDKCResult_CVec_ECDSASignatureZNoneZ CResult_CVec_ECDSASignatureZNoneZ_err(void);
31684 * Checks if the given object is currently in the success state
31686 bool CResult_CVec_ECDSASignatureZNoneZ_is_ok(const struct LDKCResult_CVec_ECDSASignatureZNoneZ *NONNULL_PTR o);
31689 * Frees any resources used by the CResult_CVec_ECDSASignatureZNoneZ.
31691 void CResult_CVec_ECDSASignatureZNoneZ_free(struct LDKCResult_CVec_ECDSASignatureZNoneZ _res);
31694 * Creates a new CResult_CVec_ECDSASignatureZNoneZ which has the same data as `orig`
31695 * but with all dynamically-allocated buffers duplicated in new buffers.
31697 struct LDKCResult_CVec_ECDSASignatureZNoneZ CResult_CVec_ECDSASignatureZNoneZ_clone(const struct LDKCResult_CVec_ECDSASignatureZNoneZ *NONNULL_PTR orig);
31700 * Constructs a new COption_usizeZ containing a usize
31702 struct LDKCOption_usizeZ COption_usizeZ_some(uintptr_t o);
31705 * Constructs a new COption_usizeZ containing nothing
31707 struct LDKCOption_usizeZ COption_usizeZ_none(void);
31710 * Frees any resources associated with the usize, if we are in the Some state
31712 void COption_usizeZ_free(struct LDKCOption_usizeZ _res);
31715 * Creates a new COption_usizeZ which has the same data as `orig`
31716 * but with all dynamically-allocated buffers duplicated in new buffers.
31718 struct LDKCOption_usizeZ COption_usizeZ_clone(const struct LDKCOption_usizeZ *NONNULL_PTR orig);
31721 * Creates a new CResult_ShutdownScriptDecodeErrorZ in the success state.
31723 struct LDKCResult_ShutdownScriptDecodeErrorZ CResult_ShutdownScriptDecodeErrorZ_ok(struct LDKShutdownScript o);
31726 * Creates a new CResult_ShutdownScriptDecodeErrorZ in the error state.
31728 struct LDKCResult_ShutdownScriptDecodeErrorZ CResult_ShutdownScriptDecodeErrorZ_err(struct LDKDecodeError e);
31731 * Checks if the given object is currently in the success state
31733 bool CResult_ShutdownScriptDecodeErrorZ_is_ok(const struct LDKCResult_ShutdownScriptDecodeErrorZ *NONNULL_PTR o);
31736 * Frees any resources used by the CResult_ShutdownScriptDecodeErrorZ.
31738 void CResult_ShutdownScriptDecodeErrorZ_free(struct LDKCResult_ShutdownScriptDecodeErrorZ _res);
31741 * Creates a new CResult_ShutdownScriptDecodeErrorZ which has the same data as `orig`
31742 * but with all dynamically-allocated buffers duplicated in new buffers.
31744 struct LDKCResult_ShutdownScriptDecodeErrorZ CResult_ShutdownScriptDecodeErrorZ_clone(const struct LDKCResult_ShutdownScriptDecodeErrorZ *NONNULL_PTR orig);
31747 * Creates a new CResult_ShutdownScriptInvalidShutdownScriptZ in the success state.
31749 struct LDKCResult_ShutdownScriptInvalidShutdownScriptZ CResult_ShutdownScriptInvalidShutdownScriptZ_ok(struct LDKShutdownScript o);
31752 * Creates a new CResult_ShutdownScriptInvalidShutdownScriptZ in the error state.
31754 struct LDKCResult_ShutdownScriptInvalidShutdownScriptZ CResult_ShutdownScriptInvalidShutdownScriptZ_err(struct LDKInvalidShutdownScript e);
31757 * Checks if the given object is currently in the success state
31759 bool CResult_ShutdownScriptInvalidShutdownScriptZ_is_ok(const struct LDKCResult_ShutdownScriptInvalidShutdownScriptZ *NONNULL_PTR o);
31762 * Frees any resources used by the CResult_ShutdownScriptInvalidShutdownScriptZ.
31764 void CResult_ShutdownScriptInvalidShutdownScriptZ_free(struct LDKCResult_ShutdownScriptInvalidShutdownScriptZ _res);
31767 * Creates a new CResult_ShutdownScriptInvalidShutdownScriptZ which has the same data as `orig`
31768 * but with all dynamically-allocated buffers duplicated in new buffers.
31770 struct LDKCResult_ShutdownScriptInvalidShutdownScriptZ CResult_ShutdownScriptInvalidShutdownScriptZ_clone(const struct LDKCResult_ShutdownScriptInvalidShutdownScriptZ *NONNULL_PTR orig);
31773 * Frees the buffer pointed to by `data` if `datalen` is non-0.
31775 void CVec_TransactionZ_free(struct LDKCVec_TransactionZ _res);
31778 * Creates a new CResult_PaymentPurposeDecodeErrorZ in the success state.
31780 struct LDKCResult_PaymentPurposeDecodeErrorZ CResult_PaymentPurposeDecodeErrorZ_ok(struct LDKPaymentPurpose o);
31783 * Creates a new CResult_PaymentPurposeDecodeErrorZ in the error state.
31785 struct LDKCResult_PaymentPurposeDecodeErrorZ CResult_PaymentPurposeDecodeErrorZ_err(struct LDKDecodeError e);
31788 * Checks if the given object is currently in the success state
31790 bool CResult_PaymentPurposeDecodeErrorZ_is_ok(const struct LDKCResult_PaymentPurposeDecodeErrorZ *NONNULL_PTR o);
31793 * Frees any resources used by the CResult_PaymentPurposeDecodeErrorZ.
31795 void CResult_PaymentPurposeDecodeErrorZ_free(struct LDKCResult_PaymentPurposeDecodeErrorZ _res);
31798 * Creates a new CResult_PaymentPurposeDecodeErrorZ which has the same data as `orig`
31799 * but with all dynamically-allocated buffers duplicated in new buffers.
31801 struct LDKCResult_PaymentPurposeDecodeErrorZ CResult_PaymentPurposeDecodeErrorZ_clone(const struct LDKCResult_PaymentPurposeDecodeErrorZ *NONNULL_PTR orig);
31804 * Creates a new CResult_ClaimedHTLCDecodeErrorZ in the success state.
31806 struct LDKCResult_ClaimedHTLCDecodeErrorZ CResult_ClaimedHTLCDecodeErrorZ_ok(struct LDKClaimedHTLC o);
31809 * Creates a new CResult_ClaimedHTLCDecodeErrorZ in the error state.
31811 struct LDKCResult_ClaimedHTLCDecodeErrorZ CResult_ClaimedHTLCDecodeErrorZ_err(struct LDKDecodeError e);
31814 * Checks if the given object is currently in the success state
31816 bool CResult_ClaimedHTLCDecodeErrorZ_is_ok(const struct LDKCResult_ClaimedHTLCDecodeErrorZ *NONNULL_PTR o);
31819 * Frees any resources used by the CResult_ClaimedHTLCDecodeErrorZ.
31821 void CResult_ClaimedHTLCDecodeErrorZ_free(struct LDKCResult_ClaimedHTLCDecodeErrorZ _res);
31824 * Creates a new CResult_ClaimedHTLCDecodeErrorZ which has the same data as `orig`
31825 * but with all dynamically-allocated buffers duplicated in new buffers.
31827 struct LDKCResult_ClaimedHTLCDecodeErrorZ CResult_ClaimedHTLCDecodeErrorZ_clone(const struct LDKCResult_ClaimedHTLCDecodeErrorZ *NONNULL_PTR orig);
31830 * Constructs a new COption_PathFailureZ containing a crate::lightning::events::PathFailure
31832 struct LDKCOption_PathFailureZ COption_PathFailureZ_some(struct LDKPathFailure o);
31835 * Constructs a new COption_PathFailureZ containing nothing
31837 struct LDKCOption_PathFailureZ COption_PathFailureZ_none(void);
31840 * Frees any resources associated with the crate::lightning::events::PathFailure, if we are in the Some state
31842 void COption_PathFailureZ_free(struct LDKCOption_PathFailureZ _res);
31845 * Creates a new COption_PathFailureZ which has the same data as `orig`
31846 * but with all dynamically-allocated buffers duplicated in new buffers.
31848 struct LDKCOption_PathFailureZ COption_PathFailureZ_clone(const struct LDKCOption_PathFailureZ *NONNULL_PTR orig);
31851 * Creates a new CResult_COption_PathFailureZDecodeErrorZ in the success state.
31853 struct LDKCResult_COption_PathFailureZDecodeErrorZ CResult_COption_PathFailureZDecodeErrorZ_ok(struct LDKCOption_PathFailureZ o);
31856 * Creates a new CResult_COption_PathFailureZDecodeErrorZ in the error state.
31858 struct LDKCResult_COption_PathFailureZDecodeErrorZ CResult_COption_PathFailureZDecodeErrorZ_err(struct LDKDecodeError e);
31861 * Checks if the given object is currently in the success state
31863 bool CResult_COption_PathFailureZDecodeErrorZ_is_ok(const struct LDKCResult_COption_PathFailureZDecodeErrorZ *NONNULL_PTR o);
31866 * Frees any resources used by the CResult_COption_PathFailureZDecodeErrorZ.
31868 void CResult_COption_PathFailureZDecodeErrorZ_free(struct LDKCResult_COption_PathFailureZDecodeErrorZ _res);
31871 * Creates a new CResult_COption_PathFailureZDecodeErrorZ which has the same data as `orig`
31872 * but with all dynamically-allocated buffers duplicated in new buffers.
31874 struct LDKCResult_COption_PathFailureZDecodeErrorZ CResult_COption_PathFailureZDecodeErrorZ_clone(const struct LDKCResult_COption_PathFailureZDecodeErrorZ *NONNULL_PTR orig);
31877 * Constructs a new COption_ClosureReasonZ containing a crate::lightning::events::ClosureReason
31879 struct LDKCOption_ClosureReasonZ COption_ClosureReasonZ_some(struct LDKClosureReason o);
31882 * Constructs a new COption_ClosureReasonZ containing nothing
31884 struct LDKCOption_ClosureReasonZ COption_ClosureReasonZ_none(void);
31887 * Frees any resources associated with the crate::lightning::events::ClosureReason, if we are in the Some state
31889 void COption_ClosureReasonZ_free(struct LDKCOption_ClosureReasonZ _res);
31892 * Creates a new COption_ClosureReasonZ which has the same data as `orig`
31893 * but with all dynamically-allocated buffers duplicated in new buffers.
31895 struct LDKCOption_ClosureReasonZ COption_ClosureReasonZ_clone(const struct LDKCOption_ClosureReasonZ *NONNULL_PTR orig);
31898 * Creates a new CResult_COption_ClosureReasonZDecodeErrorZ in the success state.
31900 struct LDKCResult_COption_ClosureReasonZDecodeErrorZ CResult_COption_ClosureReasonZDecodeErrorZ_ok(struct LDKCOption_ClosureReasonZ o);
31903 * Creates a new CResult_COption_ClosureReasonZDecodeErrorZ in the error state.
31905 struct LDKCResult_COption_ClosureReasonZDecodeErrorZ CResult_COption_ClosureReasonZDecodeErrorZ_err(struct LDKDecodeError e);
31908 * Checks if the given object is currently in the success state
31910 bool CResult_COption_ClosureReasonZDecodeErrorZ_is_ok(const struct LDKCResult_COption_ClosureReasonZDecodeErrorZ *NONNULL_PTR o);
31913 * Frees any resources used by the CResult_COption_ClosureReasonZDecodeErrorZ.
31915 void CResult_COption_ClosureReasonZDecodeErrorZ_free(struct LDKCResult_COption_ClosureReasonZDecodeErrorZ _res);
31918 * Creates a new CResult_COption_ClosureReasonZDecodeErrorZ which has the same data as `orig`
31919 * but with all dynamically-allocated buffers duplicated in new buffers.
31921 struct LDKCResult_COption_ClosureReasonZDecodeErrorZ CResult_COption_ClosureReasonZDecodeErrorZ_clone(const struct LDKCResult_COption_ClosureReasonZDecodeErrorZ *NONNULL_PTR orig);
31924 * Constructs a new COption_HTLCDestinationZ containing a crate::lightning::events::HTLCDestination
31926 struct LDKCOption_HTLCDestinationZ COption_HTLCDestinationZ_some(struct LDKHTLCDestination o);
31929 * Constructs a new COption_HTLCDestinationZ containing nothing
31931 struct LDKCOption_HTLCDestinationZ COption_HTLCDestinationZ_none(void);
31934 * Frees any resources associated with the crate::lightning::events::HTLCDestination, if we are in the Some state
31936 void COption_HTLCDestinationZ_free(struct LDKCOption_HTLCDestinationZ _res);
31939 * Creates a new COption_HTLCDestinationZ which has the same data as `orig`
31940 * but with all dynamically-allocated buffers duplicated in new buffers.
31942 struct LDKCOption_HTLCDestinationZ COption_HTLCDestinationZ_clone(const struct LDKCOption_HTLCDestinationZ *NONNULL_PTR orig);
31945 * Creates a new CResult_COption_HTLCDestinationZDecodeErrorZ in the success state.
31947 struct LDKCResult_COption_HTLCDestinationZDecodeErrorZ CResult_COption_HTLCDestinationZDecodeErrorZ_ok(struct LDKCOption_HTLCDestinationZ o);
31950 * Creates a new CResult_COption_HTLCDestinationZDecodeErrorZ in the error state.
31952 struct LDKCResult_COption_HTLCDestinationZDecodeErrorZ CResult_COption_HTLCDestinationZDecodeErrorZ_err(struct LDKDecodeError e);
31955 * Checks if the given object is currently in the success state
31957 bool CResult_COption_HTLCDestinationZDecodeErrorZ_is_ok(const struct LDKCResult_COption_HTLCDestinationZDecodeErrorZ *NONNULL_PTR o);
31960 * Frees any resources used by the CResult_COption_HTLCDestinationZDecodeErrorZ.
31962 void CResult_COption_HTLCDestinationZDecodeErrorZ_free(struct LDKCResult_COption_HTLCDestinationZDecodeErrorZ _res);
31965 * Creates a new CResult_COption_HTLCDestinationZDecodeErrorZ which has the same data as `orig`
31966 * but with all dynamically-allocated buffers duplicated in new buffers.
31968 struct LDKCResult_COption_HTLCDestinationZDecodeErrorZ CResult_COption_HTLCDestinationZDecodeErrorZ_clone(const struct LDKCResult_COption_HTLCDestinationZDecodeErrorZ *NONNULL_PTR orig);
31971 * Creates a new CResult_PaymentFailureReasonDecodeErrorZ in the success state.
31973 struct LDKCResult_PaymentFailureReasonDecodeErrorZ CResult_PaymentFailureReasonDecodeErrorZ_ok(enum LDKPaymentFailureReason o);
31976 * Creates a new CResult_PaymentFailureReasonDecodeErrorZ in the error state.
31978 struct LDKCResult_PaymentFailureReasonDecodeErrorZ CResult_PaymentFailureReasonDecodeErrorZ_err(struct LDKDecodeError e);
31981 * Checks if the given object is currently in the success state
31983 bool CResult_PaymentFailureReasonDecodeErrorZ_is_ok(const struct LDKCResult_PaymentFailureReasonDecodeErrorZ *NONNULL_PTR o);
31986 * Frees any resources used by the CResult_PaymentFailureReasonDecodeErrorZ.
31988 void CResult_PaymentFailureReasonDecodeErrorZ_free(struct LDKCResult_PaymentFailureReasonDecodeErrorZ _res);
31991 * Creates a new CResult_PaymentFailureReasonDecodeErrorZ which has the same data as `orig`
31992 * but with all dynamically-allocated buffers duplicated in new buffers.
31994 struct LDKCResult_PaymentFailureReasonDecodeErrorZ CResult_PaymentFailureReasonDecodeErrorZ_clone(const struct LDKCResult_PaymentFailureReasonDecodeErrorZ *NONNULL_PTR orig);
31997 * Constructs a new COption_U128Z containing a crate::c_types::U128
31999 struct LDKCOption_U128Z COption_U128Z_some(struct LDKU128 o);
32002 * Constructs a new COption_U128Z containing nothing
32004 struct LDKCOption_U128Z COption_U128Z_none(void);
32007 * Frees any resources associated with the crate::c_types::U128, if we are in the Some state
32009 void COption_U128Z_free(struct LDKCOption_U128Z _res);
32012 * Creates a new COption_U128Z which has the same data as `orig`
32013 * but with all dynamically-allocated buffers duplicated in new buffers.
32015 struct LDKCOption_U128Z COption_U128Z_clone(const struct LDKCOption_U128Z *NONNULL_PTR orig);
32018 * Frees the buffer pointed to by `data` if `datalen` is non-0.
32020 void CVec_ClaimedHTLCZ_free(struct LDKCVec_ClaimedHTLCZ _res);
32023 * Constructs a new COption_PaymentFailureReasonZ containing a crate::lightning::events::PaymentFailureReason
32025 struct LDKCOption_PaymentFailureReasonZ COption_PaymentFailureReasonZ_some(enum LDKPaymentFailureReason o);
32028 * Constructs a new COption_PaymentFailureReasonZ containing nothing
32030 struct LDKCOption_PaymentFailureReasonZ COption_PaymentFailureReasonZ_none(void);
32033 * Frees any resources associated with the crate::lightning::events::PaymentFailureReason, if we are in the Some state
32035 void COption_PaymentFailureReasonZ_free(struct LDKCOption_PaymentFailureReasonZ _res);
32038 * Creates a new COption_PaymentFailureReasonZ which has the same data as `orig`
32039 * but with all dynamically-allocated buffers duplicated in new buffers.
32041 struct LDKCOption_PaymentFailureReasonZ COption_PaymentFailureReasonZ_clone(const struct LDKCOption_PaymentFailureReasonZ *NONNULL_PTR orig);
32044 * Constructs a new COption_EventZ containing a crate::lightning::events::Event
32046 struct LDKCOption_EventZ COption_EventZ_some(struct LDKEvent o);
32049 * Constructs a new COption_EventZ containing nothing
32051 struct LDKCOption_EventZ COption_EventZ_none(void);
32054 * Frees any resources associated with the crate::lightning::events::Event, if we are in the Some state
32056 void COption_EventZ_free(struct LDKCOption_EventZ _res);
32059 * Creates a new COption_EventZ which has the same data as `orig`
32060 * but with all dynamically-allocated buffers duplicated in new buffers.
32062 struct LDKCOption_EventZ COption_EventZ_clone(const struct LDKCOption_EventZ *NONNULL_PTR orig);
32065 * Creates a new CResult_COption_EventZDecodeErrorZ in the success state.
32067 struct LDKCResult_COption_EventZDecodeErrorZ CResult_COption_EventZDecodeErrorZ_ok(struct LDKCOption_EventZ o);
32070 * Creates a new CResult_COption_EventZDecodeErrorZ in the error state.
32072 struct LDKCResult_COption_EventZDecodeErrorZ CResult_COption_EventZDecodeErrorZ_err(struct LDKDecodeError e);
32075 * Checks if the given object is currently in the success state
32077 bool CResult_COption_EventZDecodeErrorZ_is_ok(const struct LDKCResult_COption_EventZDecodeErrorZ *NONNULL_PTR o);
32080 * Frees any resources used by the CResult_COption_EventZDecodeErrorZ.
32082 void CResult_COption_EventZDecodeErrorZ_free(struct LDKCResult_COption_EventZDecodeErrorZ _res);
32085 * Creates a new CResult_COption_EventZDecodeErrorZ which has the same data as `orig`
32086 * but with all dynamically-allocated buffers duplicated in new buffers.
32088 struct LDKCResult_COption_EventZDecodeErrorZ CResult_COption_EventZDecodeErrorZ_clone(const struct LDKCResult_COption_EventZDecodeErrorZ *NONNULL_PTR orig);
32091 * Creates a new CResult_SiPrefixBolt11ParseErrorZ in the success state.
32093 struct LDKCResult_SiPrefixBolt11ParseErrorZ CResult_SiPrefixBolt11ParseErrorZ_ok(enum LDKSiPrefix o);
32096 * Creates a new CResult_SiPrefixBolt11ParseErrorZ in the error state.
32098 struct LDKCResult_SiPrefixBolt11ParseErrorZ CResult_SiPrefixBolt11ParseErrorZ_err(struct LDKBolt11ParseError e);
32101 * Checks if the given object is currently in the success state
32103 bool CResult_SiPrefixBolt11ParseErrorZ_is_ok(const struct LDKCResult_SiPrefixBolt11ParseErrorZ *NONNULL_PTR o);
32106 * Frees any resources used by the CResult_SiPrefixBolt11ParseErrorZ.
32108 void CResult_SiPrefixBolt11ParseErrorZ_free(struct LDKCResult_SiPrefixBolt11ParseErrorZ _res);
32111 * Creates a new CResult_SiPrefixBolt11ParseErrorZ which has the same data as `orig`
32112 * but with all dynamically-allocated buffers duplicated in new buffers.
32114 struct LDKCResult_SiPrefixBolt11ParseErrorZ CResult_SiPrefixBolt11ParseErrorZ_clone(const struct LDKCResult_SiPrefixBolt11ParseErrorZ *NONNULL_PTR orig);
32117 * Creates a new CResult_Bolt11InvoiceParseOrSemanticErrorZ in the success state.
32119 struct LDKCResult_Bolt11InvoiceParseOrSemanticErrorZ CResult_Bolt11InvoiceParseOrSemanticErrorZ_ok(struct LDKBolt11Invoice o);
32122 * Creates a new CResult_Bolt11InvoiceParseOrSemanticErrorZ in the error state.
32124 struct LDKCResult_Bolt11InvoiceParseOrSemanticErrorZ CResult_Bolt11InvoiceParseOrSemanticErrorZ_err(struct LDKParseOrSemanticError e);
32127 * Checks if the given object is currently in the success state
32129 bool CResult_Bolt11InvoiceParseOrSemanticErrorZ_is_ok(const struct LDKCResult_Bolt11InvoiceParseOrSemanticErrorZ *NONNULL_PTR o);
32132 * Frees any resources used by the CResult_Bolt11InvoiceParseOrSemanticErrorZ.
32134 void CResult_Bolt11InvoiceParseOrSemanticErrorZ_free(struct LDKCResult_Bolt11InvoiceParseOrSemanticErrorZ _res);
32137 * Creates a new CResult_Bolt11InvoiceParseOrSemanticErrorZ which has the same data as `orig`
32138 * but with all dynamically-allocated buffers duplicated in new buffers.
32140 struct LDKCResult_Bolt11InvoiceParseOrSemanticErrorZ CResult_Bolt11InvoiceParseOrSemanticErrorZ_clone(const struct LDKCResult_Bolt11InvoiceParseOrSemanticErrorZ *NONNULL_PTR orig);
32143 * Creates a new CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ in the success state.
32145 struct LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZ CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ_ok(struct LDKSignedRawBolt11Invoice o);
32148 * Creates a new CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ in the error state.
32150 struct LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZ CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ_err(struct LDKBolt11ParseError e);
32153 * Checks if the given object is currently in the success state
32155 bool CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ_is_ok(const struct LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZ *NONNULL_PTR o);
32158 * Frees any resources used by the CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ.
32160 void CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ_free(struct LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZ _res);
32163 * Creates a new CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ which has the same data as `orig`
32164 * but with all dynamically-allocated buffers duplicated in new buffers.
32166 struct LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZ CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ_clone(const struct LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZ *NONNULL_PTR orig);
32169 * Creates a new tuple which has the same data as `orig`
32170 * but with all dynamically-allocated buffers duplicated in new buffers.
32172 struct LDKC3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ C3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ_clone(const struct LDKC3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ *NONNULL_PTR orig);
32175 * Creates a new C3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ from the contained elements.
32177 struct LDKC3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ C3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ_new(struct LDKRawBolt11Invoice a, struct LDKThirtyTwoBytes b, struct LDKBolt11InvoiceSignature c);
32180 * Frees any resources used by the C3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ.
32182 void C3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ_free(struct LDKC3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ _res);
32185 * Creates a new CResult_PayeePubKeySecp256k1ErrorZ in the success state.
32187 struct LDKCResult_PayeePubKeySecp256k1ErrorZ CResult_PayeePubKeySecp256k1ErrorZ_ok(struct LDKPayeePubKey o);
32190 * Creates a new CResult_PayeePubKeySecp256k1ErrorZ in the error state.
32192 struct LDKCResult_PayeePubKeySecp256k1ErrorZ CResult_PayeePubKeySecp256k1ErrorZ_err(enum LDKSecp256k1Error e);
32195 * Checks if the given object is currently in the success state
32197 bool CResult_PayeePubKeySecp256k1ErrorZ_is_ok(const struct LDKCResult_PayeePubKeySecp256k1ErrorZ *NONNULL_PTR o);
32200 * Frees any resources used by the CResult_PayeePubKeySecp256k1ErrorZ.
32202 void CResult_PayeePubKeySecp256k1ErrorZ_free(struct LDKCResult_PayeePubKeySecp256k1ErrorZ _res);
32205 * Creates a new CResult_PayeePubKeySecp256k1ErrorZ which has the same data as `orig`
32206 * but with all dynamically-allocated buffers duplicated in new buffers.
32208 struct LDKCResult_PayeePubKeySecp256k1ErrorZ CResult_PayeePubKeySecp256k1ErrorZ_clone(const struct LDKCResult_PayeePubKeySecp256k1ErrorZ *NONNULL_PTR orig);
32211 * Frees the buffer pointed to by `data` if `datalen` is non-0.
32213 void CVec_PrivateRouteZ_free(struct LDKCVec_PrivateRouteZ _res);
32216 * Creates a new CResult_PositiveTimestampCreationErrorZ in the success state.
32218 struct LDKCResult_PositiveTimestampCreationErrorZ CResult_PositiveTimestampCreationErrorZ_ok(struct LDKPositiveTimestamp o);
32221 * Creates a new CResult_PositiveTimestampCreationErrorZ in the error state.
32223 struct LDKCResult_PositiveTimestampCreationErrorZ CResult_PositiveTimestampCreationErrorZ_err(enum LDKCreationError e);
32226 * Checks if the given object is currently in the success state
32228 bool CResult_PositiveTimestampCreationErrorZ_is_ok(const struct LDKCResult_PositiveTimestampCreationErrorZ *NONNULL_PTR o);
32231 * Frees any resources used by the CResult_PositiveTimestampCreationErrorZ.
32233 void CResult_PositiveTimestampCreationErrorZ_free(struct LDKCResult_PositiveTimestampCreationErrorZ _res);
32236 * Creates a new CResult_PositiveTimestampCreationErrorZ which has the same data as `orig`
32237 * but with all dynamically-allocated buffers duplicated in new buffers.
32239 struct LDKCResult_PositiveTimestampCreationErrorZ CResult_PositiveTimestampCreationErrorZ_clone(const struct LDKCResult_PositiveTimestampCreationErrorZ *NONNULL_PTR orig);
32242 * Creates a new CResult_NoneBolt11SemanticErrorZ in the success state.
32244 struct LDKCResult_NoneBolt11SemanticErrorZ CResult_NoneBolt11SemanticErrorZ_ok(void);
32247 * Creates a new CResult_NoneBolt11SemanticErrorZ in the error state.
32249 struct LDKCResult_NoneBolt11SemanticErrorZ CResult_NoneBolt11SemanticErrorZ_err(enum LDKBolt11SemanticError e);
32252 * Checks if the given object is currently in the success state
32254 bool CResult_NoneBolt11SemanticErrorZ_is_ok(const struct LDKCResult_NoneBolt11SemanticErrorZ *NONNULL_PTR o);
32257 * Frees any resources used by the CResult_NoneBolt11SemanticErrorZ.
32259 void CResult_NoneBolt11SemanticErrorZ_free(struct LDKCResult_NoneBolt11SemanticErrorZ _res);
32262 * Creates a new CResult_NoneBolt11SemanticErrorZ which has the same data as `orig`
32263 * but with all dynamically-allocated buffers duplicated in new buffers.
32265 struct LDKCResult_NoneBolt11SemanticErrorZ CResult_NoneBolt11SemanticErrorZ_clone(const struct LDKCResult_NoneBolt11SemanticErrorZ *NONNULL_PTR orig);
32268 * Creates a new CResult_Bolt11InvoiceBolt11SemanticErrorZ in the success state.
32270 struct LDKCResult_Bolt11InvoiceBolt11SemanticErrorZ CResult_Bolt11InvoiceBolt11SemanticErrorZ_ok(struct LDKBolt11Invoice o);
32273 * Creates a new CResult_Bolt11InvoiceBolt11SemanticErrorZ in the error state.
32275 struct LDKCResult_Bolt11InvoiceBolt11SemanticErrorZ CResult_Bolt11InvoiceBolt11SemanticErrorZ_err(enum LDKBolt11SemanticError e);
32278 * Checks if the given object is currently in the success state
32280 bool CResult_Bolt11InvoiceBolt11SemanticErrorZ_is_ok(const struct LDKCResult_Bolt11InvoiceBolt11SemanticErrorZ *NONNULL_PTR o);
32283 * Frees any resources used by the CResult_Bolt11InvoiceBolt11SemanticErrorZ.
32285 void CResult_Bolt11InvoiceBolt11SemanticErrorZ_free(struct LDKCResult_Bolt11InvoiceBolt11SemanticErrorZ _res);
32288 * Creates a new CResult_Bolt11InvoiceBolt11SemanticErrorZ which has the same data as `orig`
32289 * but with all dynamically-allocated buffers duplicated in new buffers.
32291 struct LDKCResult_Bolt11InvoiceBolt11SemanticErrorZ CResult_Bolt11InvoiceBolt11SemanticErrorZ_clone(const struct LDKCResult_Bolt11InvoiceBolt11SemanticErrorZ *NONNULL_PTR orig);
32294 * Creates a new CResult_DescriptionCreationErrorZ in the success state.
32296 struct LDKCResult_DescriptionCreationErrorZ CResult_DescriptionCreationErrorZ_ok(struct LDKDescription o);
32299 * Creates a new CResult_DescriptionCreationErrorZ in the error state.
32301 struct LDKCResult_DescriptionCreationErrorZ CResult_DescriptionCreationErrorZ_err(enum LDKCreationError e);
32304 * Checks if the given object is currently in the success state
32306 bool CResult_DescriptionCreationErrorZ_is_ok(const struct LDKCResult_DescriptionCreationErrorZ *NONNULL_PTR o);
32309 * Frees any resources used by the CResult_DescriptionCreationErrorZ.
32311 void CResult_DescriptionCreationErrorZ_free(struct LDKCResult_DescriptionCreationErrorZ _res);
32314 * Creates a new CResult_DescriptionCreationErrorZ which has the same data as `orig`
32315 * but with all dynamically-allocated buffers duplicated in new buffers.
32317 struct LDKCResult_DescriptionCreationErrorZ CResult_DescriptionCreationErrorZ_clone(const struct LDKCResult_DescriptionCreationErrorZ *NONNULL_PTR orig);
32320 * Creates a new CResult_PrivateRouteCreationErrorZ in the success state.
32322 struct LDKCResult_PrivateRouteCreationErrorZ CResult_PrivateRouteCreationErrorZ_ok(struct LDKPrivateRoute o);
32325 * Creates a new CResult_PrivateRouteCreationErrorZ in the error state.
32327 struct LDKCResult_PrivateRouteCreationErrorZ CResult_PrivateRouteCreationErrorZ_err(enum LDKCreationError e);
32330 * Checks if the given object is currently in the success state
32332 bool CResult_PrivateRouteCreationErrorZ_is_ok(const struct LDKCResult_PrivateRouteCreationErrorZ *NONNULL_PTR o);
32335 * Frees any resources used by the CResult_PrivateRouteCreationErrorZ.
32337 void CResult_PrivateRouteCreationErrorZ_free(struct LDKCResult_PrivateRouteCreationErrorZ _res);
32340 * Creates a new CResult_PrivateRouteCreationErrorZ which has the same data as `orig`
32341 * but with all dynamically-allocated buffers duplicated in new buffers.
32343 struct LDKCResult_PrivateRouteCreationErrorZ CResult_PrivateRouteCreationErrorZ_clone(const struct LDKCResult_PrivateRouteCreationErrorZ *NONNULL_PTR orig);
32346 * Creates a new CResult_OutPointDecodeErrorZ in the success state.
32348 struct LDKCResult_OutPointDecodeErrorZ CResult_OutPointDecodeErrorZ_ok(struct LDKOutPoint o);
32351 * Creates a new CResult_OutPointDecodeErrorZ in the error state.
32353 struct LDKCResult_OutPointDecodeErrorZ CResult_OutPointDecodeErrorZ_err(struct LDKDecodeError e);
32356 * Checks if the given object is currently in the success state
32358 bool CResult_OutPointDecodeErrorZ_is_ok(const struct LDKCResult_OutPointDecodeErrorZ *NONNULL_PTR o);
32361 * Frees any resources used by the CResult_OutPointDecodeErrorZ.
32363 void CResult_OutPointDecodeErrorZ_free(struct LDKCResult_OutPointDecodeErrorZ _res);
32366 * Creates a new CResult_OutPointDecodeErrorZ which has the same data as `orig`
32367 * but with all dynamically-allocated buffers duplicated in new buffers.
32369 struct LDKCResult_OutPointDecodeErrorZ CResult_OutPointDecodeErrorZ_clone(const struct LDKCResult_OutPointDecodeErrorZ *NONNULL_PTR orig);
32372 * Creates a new CResult_BigSizeDecodeErrorZ in the success state.
32374 struct LDKCResult_BigSizeDecodeErrorZ CResult_BigSizeDecodeErrorZ_ok(struct LDKBigSize o);
32377 * Creates a new CResult_BigSizeDecodeErrorZ in the error state.
32379 struct LDKCResult_BigSizeDecodeErrorZ CResult_BigSizeDecodeErrorZ_err(struct LDKDecodeError e);
32382 * Checks if the given object is currently in the success state
32384 bool CResult_BigSizeDecodeErrorZ_is_ok(const struct LDKCResult_BigSizeDecodeErrorZ *NONNULL_PTR o);
32387 * Frees any resources used by the CResult_BigSizeDecodeErrorZ.
32389 void CResult_BigSizeDecodeErrorZ_free(struct LDKCResult_BigSizeDecodeErrorZ _res);
32392 * Creates a new CResult_BigSizeDecodeErrorZ which has the same data as `orig`
32393 * but with all dynamically-allocated buffers duplicated in new buffers.
32395 struct LDKCResult_BigSizeDecodeErrorZ CResult_BigSizeDecodeErrorZ_clone(const struct LDKCResult_BigSizeDecodeErrorZ *NONNULL_PTR orig);
32398 * Creates a new CResult_HostnameDecodeErrorZ in the success state.
32400 struct LDKCResult_HostnameDecodeErrorZ CResult_HostnameDecodeErrorZ_ok(struct LDKHostname o);
32403 * Creates a new CResult_HostnameDecodeErrorZ in the error state.
32405 struct LDKCResult_HostnameDecodeErrorZ CResult_HostnameDecodeErrorZ_err(struct LDKDecodeError e);
32408 * Checks if the given object is currently in the success state
32410 bool CResult_HostnameDecodeErrorZ_is_ok(const struct LDKCResult_HostnameDecodeErrorZ *NONNULL_PTR o);
32413 * Frees any resources used by the CResult_HostnameDecodeErrorZ.
32415 void CResult_HostnameDecodeErrorZ_free(struct LDKCResult_HostnameDecodeErrorZ _res);
32418 * Creates a new CResult_HostnameDecodeErrorZ which has the same data as `orig`
32419 * but with all dynamically-allocated buffers duplicated in new buffers.
32421 struct LDKCResult_HostnameDecodeErrorZ CResult_HostnameDecodeErrorZ_clone(const struct LDKCResult_HostnameDecodeErrorZ *NONNULL_PTR orig);
32424 * Creates a new CResult_TransactionU16LenLimitedNoneZ in the success state.
32426 struct LDKCResult_TransactionU16LenLimitedNoneZ CResult_TransactionU16LenLimitedNoneZ_ok(struct LDKTransactionU16LenLimited o);
32429 * Creates a new CResult_TransactionU16LenLimitedNoneZ in the error state.
32431 struct LDKCResult_TransactionU16LenLimitedNoneZ CResult_TransactionU16LenLimitedNoneZ_err(void);
32434 * Checks if the given object is currently in the success state
32436 bool CResult_TransactionU16LenLimitedNoneZ_is_ok(const struct LDKCResult_TransactionU16LenLimitedNoneZ *NONNULL_PTR o);
32439 * Frees any resources used by the CResult_TransactionU16LenLimitedNoneZ.
32441 void CResult_TransactionU16LenLimitedNoneZ_free(struct LDKCResult_TransactionU16LenLimitedNoneZ _res);
32444 * Creates a new CResult_TransactionU16LenLimitedNoneZ which has the same data as `orig`
32445 * but with all dynamically-allocated buffers duplicated in new buffers.
32447 struct LDKCResult_TransactionU16LenLimitedNoneZ CResult_TransactionU16LenLimitedNoneZ_clone(const struct LDKCResult_TransactionU16LenLimitedNoneZ *NONNULL_PTR orig);
32450 * Creates a new CResult_TransactionU16LenLimitedDecodeErrorZ in the success state.
32452 struct LDKCResult_TransactionU16LenLimitedDecodeErrorZ CResult_TransactionU16LenLimitedDecodeErrorZ_ok(struct LDKTransactionU16LenLimited o);
32455 * Creates a new CResult_TransactionU16LenLimitedDecodeErrorZ in the error state.
32457 struct LDKCResult_TransactionU16LenLimitedDecodeErrorZ CResult_TransactionU16LenLimitedDecodeErrorZ_err(struct LDKDecodeError e);
32460 * Checks if the given object is currently in the success state
32462 bool CResult_TransactionU16LenLimitedDecodeErrorZ_is_ok(const struct LDKCResult_TransactionU16LenLimitedDecodeErrorZ *NONNULL_PTR o);
32465 * Frees any resources used by the CResult_TransactionU16LenLimitedDecodeErrorZ.
32467 void CResult_TransactionU16LenLimitedDecodeErrorZ_free(struct LDKCResult_TransactionU16LenLimitedDecodeErrorZ _res);
32470 * Creates a new CResult_TransactionU16LenLimitedDecodeErrorZ which has the same data as `orig`
32471 * but with all dynamically-allocated buffers duplicated in new buffers.
32473 struct LDKCResult_TransactionU16LenLimitedDecodeErrorZ CResult_TransactionU16LenLimitedDecodeErrorZ_clone(const struct LDKCResult_TransactionU16LenLimitedDecodeErrorZ *NONNULL_PTR orig);
32476 * Creates a new CResult_UntrustedStringDecodeErrorZ in the success state.
32478 struct LDKCResult_UntrustedStringDecodeErrorZ CResult_UntrustedStringDecodeErrorZ_ok(struct LDKUntrustedString o);
32481 * Creates a new CResult_UntrustedStringDecodeErrorZ in the error state.
32483 struct LDKCResult_UntrustedStringDecodeErrorZ CResult_UntrustedStringDecodeErrorZ_err(struct LDKDecodeError e);
32486 * Checks if the given object is currently in the success state
32488 bool CResult_UntrustedStringDecodeErrorZ_is_ok(const struct LDKCResult_UntrustedStringDecodeErrorZ *NONNULL_PTR o);
32491 * Frees any resources used by the CResult_UntrustedStringDecodeErrorZ.
32493 void CResult_UntrustedStringDecodeErrorZ_free(struct LDKCResult_UntrustedStringDecodeErrorZ _res);
32496 * Creates a new CResult_UntrustedStringDecodeErrorZ which has the same data as `orig`
32497 * but with all dynamically-allocated buffers duplicated in new buffers.
32499 struct LDKCResult_UntrustedStringDecodeErrorZ CResult_UntrustedStringDecodeErrorZ_clone(const struct LDKCResult_UntrustedStringDecodeErrorZ *NONNULL_PTR orig);
32502 * Creates a new CResult_ChannelIdDecodeErrorZ in the success state.
32504 struct LDKCResult_ChannelIdDecodeErrorZ CResult_ChannelIdDecodeErrorZ_ok(struct LDKChannelId o);
32507 * Creates a new CResult_ChannelIdDecodeErrorZ in the error state.
32509 struct LDKCResult_ChannelIdDecodeErrorZ CResult_ChannelIdDecodeErrorZ_err(struct LDKDecodeError e);
32512 * Checks if the given object is currently in the success state
32514 bool CResult_ChannelIdDecodeErrorZ_is_ok(const struct LDKCResult_ChannelIdDecodeErrorZ *NONNULL_PTR o);
32517 * Frees any resources used by the CResult_ChannelIdDecodeErrorZ.
32519 void CResult_ChannelIdDecodeErrorZ_free(struct LDKCResult_ChannelIdDecodeErrorZ _res);
32522 * Creates a new CResult_ChannelIdDecodeErrorZ which has the same data as `orig`
32523 * but with all dynamically-allocated buffers duplicated in new buffers.
32525 struct LDKCResult_ChannelIdDecodeErrorZ CResult_ChannelIdDecodeErrorZ_clone(const struct LDKCResult_ChannelIdDecodeErrorZ *NONNULL_PTR orig);
32528 * Creates a new tuple which has the same data as `orig`
32529 * but with all dynamically-allocated buffers duplicated in new buffers.
32531 struct LDKC2Tuple__u832u16Z C2Tuple__u832u16Z_clone(const struct LDKC2Tuple__u832u16Z *NONNULL_PTR orig);
32534 * Creates a new C2Tuple__u832u16Z from the contained elements.
32536 struct LDKC2Tuple__u832u16Z C2Tuple__u832u16Z_new(struct LDKThirtyTwoBytes a, uint16_t b);
32539 * Frees any resources used by the C2Tuple__u832u16Z.
32541 void C2Tuple__u832u16Z_free(struct LDKC2Tuple__u832u16Z _res);
32544 * Creates a new CResult_PaymentRelayDecodeErrorZ in the success state.
32546 struct LDKCResult_PaymentRelayDecodeErrorZ CResult_PaymentRelayDecodeErrorZ_ok(struct LDKPaymentRelay o);
32549 * Creates a new CResult_PaymentRelayDecodeErrorZ in the error state.
32551 struct LDKCResult_PaymentRelayDecodeErrorZ CResult_PaymentRelayDecodeErrorZ_err(struct LDKDecodeError e);
32554 * Checks if the given object is currently in the success state
32556 bool CResult_PaymentRelayDecodeErrorZ_is_ok(const struct LDKCResult_PaymentRelayDecodeErrorZ *NONNULL_PTR o);
32559 * Frees any resources used by the CResult_PaymentRelayDecodeErrorZ.
32561 void CResult_PaymentRelayDecodeErrorZ_free(struct LDKCResult_PaymentRelayDecodeErrorZ _res);
32564 * Creates a new CResult_PaymentRelayDecodeErrorZ which has the same data as `orig`
32565 * but with all dynamically-allocated buffers duplicated in new buffers.
32567 struct LDKCResult_PaymentRelayDecodeErrorZ CResult_PaymentRelayDecodeErrorZ_clone(const struct LDKCResult_PaymentRelayDecodeErrorZ *NONNULL_PTR orig);
32570 * Creates a new CResult_PaymentConstraintsDecodeErrorZ in the success state.
32572 struct LDKCResult_PaymentConstraintsDecodeErrorZ CResult_PaymentConstraintsDecodeErrorZ_ok(struct LDKPaymentConstraints o);
32575 * Creates a new CResult_PaymentConstraintsDecodeErrorZ in the error state.
32577 struct LDKCResult_PaymentConstraintsDecodeErrorZ CResult_PaymentConstraintsDecodeErrorZ_err(struct LDKDecodeError e);
32580 * Checks if the given object is currently in the success state
32582 bool CResult_PaymentConstraintsDecodeErrorZ_is_ok(const struct LDKCResult_PaymentConstraintsDecodeErrorZ *NONNULL_PTR o);
32585 * Frees any resources used by the CResult_PaymentConstraintsDecodeErrorZ.
32587 void CResult_PaymentConstraintsDecodeErrorZ_free(struct LDKCResult_PaymentConstraintsDecodeErrorZ _res);
32590 * Creates a new CResult_PaymentConstraintsDecodeErrorZ which has the same data as `orig`
32591 * but with all dynamically-allocated buffers duplicated in new buffers.
32593 struct LDKCResult_PaymentConstraintsDecodeErrorZ CResult_PaymentConstraintsDecodeErrorZ_clone(const struct LDKCResult_PaymentConstraintsDecodeErrorZ *NONNULL_PTR orig);
32596 * Creates a new CResult_PaymentContextDecodeErrorZ in the success state.
32598 struct LDKCResult_PaymentContextDecodeErrorZ CResult_PaymentContextDecodeErrorZ_ok(struct LDKPaymentContext o);
32601 * Creates a new CResult_PaymentContextDecodeErrorZ in the error state.
32603 struct LDKCResult_PaymentContextDecodeErrorZ CResult_PaymentContextDecodeErrorZ_err(struct LDKDecodeError e);
32606 * Checks if the given object is currently in the success state
32608 bool CResult_PaymentContextDecodeErrorZ_is_ok(const struct LDKCResult_PaymentContextDecodeErrorZ *NONNULL_PTR o);
32611 * Frees any resources used by the CResult_PaymentContextDecodeErrorZ.
32613 void CResult_PaymentContextDecodeErrorZ_free(struct LDKCResult_PaymentContextDecodeErrorZ _res);
32616 * Creates a new CResult_PaymentContextDecodeErrorZ which has the same data as `orig`
32617 * but with all dynamically-allocated buffers duplicated in new buffers.
32619 struct LDKCResult_PaymentContextDecodeErrorZ CResult_PaymentContextDecodeErrorZ_clone(const struct LDKCResult_PaymentContextDecodeErrorZ *NONNULL_PTR orig);
32622 * Creates a new CResult_UnknownPaymentContextDecodeErrorZ in the success state.
32624 struct LDKCResult_UnknownPaymentContextDecodeErrorZ CResult_UnknownPaymentContextDecodeErrorZ_ok(struct LDKUnknownPaymentContext o);
32627 * Creates a new CResult_UnknownPaymentContextDecodeErrorZ in the error state.
32629 struct LDKCResult_UnknownPaymentContextDecodeErrorZ CResult_UnknownPaymentContextDecodeErrorZ_err(struct LDKDecodeError e);
32632 * Checks if the given object is currently in the success state
32634 bool CResult_UnknownPaymentContextDecodeErrorZ_is_ok(const struct LDKCResult_UnknownPaymentContextDecodeErrorZ *NONNULL_PTR o);
32637 * Frees any resources used by the CResult_UnknownPaymentContextDecodeErrorZ.
32639 void CResult_UnknownPaymentContextDecodeErrorZ_free(struct LDKCResult_UnknownPaymentContextDecodeErrorZ _res);
32642 * Creates a new CResult_UnknownPaymentContextDecodeErrorZ which has the same data as `orig`
32643 * but with all dynamically-allocated buffers duplicated in new buffers.
32645 struct LDKCResult_UnknownPaymentContextDecodeErrorZ CResult_UnknownPaymentContextDecodeErrorZ_clone(const struct LDKCResult_UnknownPaymentContextDecodeErrorZ *NONNULL_PTR orig);
32648 * Creates a new CResult_Bolt12OfferContextDecodeErrorZ in the success state.
32650 struct LDKCResult_Bolt12OfferContextDecodeErrorZ CResult_Bolt12OfferContextDecodeErrorZ_ok(struct LDKBolt12OfferContext o);
32653 * Creates a new CResult_Bolt12OfferContextDecodeErrorZ in the error state.
32655 struct LDKCResult_Bolt12OfferContextDecodeErrorZ CResult_Bolt12OfferContextDecodeErrorZ_err(struct LDKDecodeError e);
32658 * Checks if the given object is currently in the success state
32660 bool CResult_Bolt12OfferContextDecodeErrorZ_is_ok(const struct LDKCResult_Bolt12OfferContextDecodeErrorZ *NONNULL_PTR o);
32663 * Frees any resources used by the CResult_Bolt12OfferContextDecodeErrorZ.
32665 void CResult_Bolt12OfferContextDecodeErrorZ_free(struct LDKCResult_Bolt12OfferContextDecodeErrorZ _res);
32668 * Creates a new CResult_Bolt12OfferContextDecodeErrorZ which has the same data as `orig`
32669 * but with all dynamically-allocated buffers duplicated in new buffers.
32671 struct LDKCResult_Bolt12OfferContextDecodeErrorZ CResult_Bolt12OfferContextDecodeErrorZ_clone(const struct LDKCResult_Bolt12OfferContextDecodeErrorZ *NONNULL_PTR orig);
32674 * Creates a new CResult_Bolt12RefundContextDecodeErrorZ in the success state.
32676 struct LDKCResult_Bolt12RefundContextDecodeErrorZ CResult_Bolt12RefundContextDecodeErrorZ_ok(struct LDKBolt12RefundContext o);
32679 * Creates a new CResult_Bolt12RefundContextDecodeErrorZ in the error state.
32681 struct LDKCResult_Bolt12RefundContextDecodeErrorZ CResult_Bolt12RefundContextDecodeErrorZ_err(struct LDKDecodeError e);
32684 * Checks if the given object is currently in the success state
32686 bool CResult_Bolt12RefundContextDecodeErrorZ_is_ok(const struct LDKCResult_Bolt12RefundContextDecodeErrorZ *NONNULL_PTR o);
32689 * Frees any resources used by the CResult_Bolt12RefundContextDecodeErrorZ.
32691 void CResult_Bolt12RefundContextDecodeErrorZ_free(struct LDKCResult_Bolt12RefundContextDecodeErrorZ _res);
32694 * Creates a new CResult_Bolt12RefundContextDecodeErrorZ which has the same data as `orig`
32695 * but with all dynamically-allocated buffers duplicated in new buffers.
32697 struct LDKCResult_Bolt12RefundContextDecodeErrorZ CResult_Bolt12RefundContextDecodeErrorZ_clone(const struct LDKCResult_Bolt12RefundContextDecodeErrorZ *NONNULL_PTR orig);
32700 * Creates a new CResult_StrSecp256k1ErrorZ in the success state.
32702 struct LDKCResult_StrSecp256k1ErrorZ CResult_StrSecp256k1ErrorZ_ok(struct LDKStr o);
32705 * Creates a new CResult_StrSecp256k1ErrorZ in the error state.
32707 struct LDKCResult_StrSecp256k1ErrorZ CResult_StrSecp256k1ErrorZ_err(enum LDKSecp256k1Error e);
32710 * Checks if the given object is currently in the success state
32712 bool CResult_StrSecp256k1ErrorZ_is_ok(const struct LDKCResult_StrSecp256k1ErrorZ *NONNULL_PTR o);
32715 * Frees any resources used by the CResult_StrSecp256k1ErrorZ.
32717 void CResult_StrSecp256k1ErrorZ_free(struct LDKCResult_StrSecp256k1ErrorZ _res);
32720 * Creates a new CResult_StrSecp256k1ErrorZ which has the same data as `orig`
32721 * but with all dynamically-allocated buffers duplicated in new buffers.
32723 struct LDKCResult_StrSecp256k1ErrorZ CResult_StrSecp256k1ErrorZ_clone(const struct LDKCResult_StrSecp256k1ErrorZ *NONNULL_PTR orig);
32726 * Creates a new tuple which has the same data as `orig`
32727 * but with all dynamically-allocated buffers duplicated in new buffers.
32729 struct LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_clone(const struct LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ *NONNULL_PTR orig);
32732 * Creates a new C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ from the contained elements.
32734 struct LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_new(struct LDKThirtyTwoBytes a, struct LDKRecipientOnionFields b, struct LDKRouteParameters c);
32737 * Frees any resources used by the C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ.
32739 void C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_free(struct LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ _res);
32742 * Creates a new CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ in the success state.
32744 struct LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_ok(struct LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ o);
32747 * Creates a new CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ in the error state.
32749 struct LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_err(void);
32752 * Checks if the given object is currently in the success state
32754 bool CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_is_ok(const struct LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ *NONNULL_PTR o);
32757 * Frees any resources used by the CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ.
32759 void CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_free(struct LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ _res);
32762 * Creates a new CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ which has the same data as `orig`
32763 * but with all dynamically-allocated buffers duplicated in new buffers.
32765 struct LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_clone(const struct LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ *NONNULL_PTR orig);
32768 * Creates a new CResult_TxOutUtxoLookupErrorZ in the success state.
32770 struct LDKCResult_TxOutUtxoLookupErrorZ CResult_TxOutUtxoLookupErrorZ_ok(struct LDKTxOut o);
32773 * Creates a new CResult_TxOutUtxoLookupErrorZ in the error state.
32775 struct LDKCResult_TxOutUtxoLookupErrorZ CResult_TxOutUtxoLookupErrorZ_err(enum LDKUtxoLookupError e);
32778 * Checks if the given object is currently in the success state
32780 bool CResult_TxOutUtxoLookupErrorZ_is_ok(const struct LDKCResult_TxOutUtxoLookupErrorZ *NONNULL_PTR o);
32783 * Frees any resources used by the CResult_TxOutUtxoLookupErrorZ.
32785 void CResult_TxOutUtxoLookupErrorZ_free(struct LDKCResult_TxOutUtxoLookupErrorZ _res);
32788 * Creates a new CResult_TxOutUtxoLookupErrorZ which has the same data as `orig`
32789 * but with all dynamically-allocated buffers duplicated in new buffers.
32791 struct LDKCResult_TxOutUtxoLookupErrorZ CResult_TxOutUtxoLookupErrorZ_clone(const struct LDKCResult_TxOutUtxoLookupErrorZ *NONNULL_PTR orig);
32794 * Creates a new tuple which has the same data as `orig`
32795 * but with all dynamically-allocated buffers duplicated in new buffers.
32797 struct LDKC3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ_clone(const struct LDKC3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ *NONNULL_PTR orig);
32800 * Creates a new C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ from the contained elements.
32802 struct LDKC3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ_new(struct LDKPublicKey a, struct LDKOnionMessage b, struct LDKCOption_CVec_SocketAddressZZ c);
32805 * Frees any resources used by the C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ.
32807 void C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ_free(struct LDKC3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ _res);
32810 * Creates a new CResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ in the success state.
32812 struct LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ CResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ_ok(struct LDKC3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ o);
32815 * Creates a new CResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ in the error state.
32817 struct LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ CResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ_err(struct LDKSendError e);
32820 * Checks if the given object is currently in the success state
32822 bool CResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ_is_ok(const struct LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ *NONNULL_PTR o);
32825 * Frees any resources used by the CResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ.
32827 void CResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ_free(struct LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ _res);
32830 * Creates a new CResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ which has the same data as `orig`
32831 * but with all dynamically-allocated buffers duplicated in new buffers.
32833 struct LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ CResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ_clone(const struct LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ *NONNULL_PTR orig);
32836 * Creates a new CResult_PeeledOnionNoneZ in the success state.
32838 struct LDKCResult_PeeledOnionNoneZ CResult_PeeledOnionNoneZ_ok(struct LDKPeeledOnion o);
32841 * Creates a new CResult_PeeledOnionNoneZ in the error state.
32843 struct LDKCResult_PeeledOnionNoneZ CResult_PeeledOnionNoneZ_err(void);
32846 * Checks if the given object is currently in the success state
32848 bool CResult_PeeledOnionNoneZ_is_ok(const struct LDKCResult_PeeledOnionNoneZ *NONNULL_PTR o);
32851 * Frees any resources used by the CResult_PeeledOnionNoneZ.
32853 void CResult_PeeledOnionNoneZ_free(struct LDKCResult_PeeledOnionNoneZ _res);
32856 * Creates a new CResult_PeeledOnionNoneZ which has the same data as `orig`
32857 * but with all dynamically-allocated buffers duplicated in new buffers.
32859 struct LDKCResult_PeeledOnionNoneZ CResult_PeeledOnionNoneZ_clone(const struct LDKCResult_PeeledOnionNoneZ *NONNULL_PTR orig);
32862 * Creates a new CResult_SendSuccessSendErrorZ in the success state.
32864 struct LDKCResult_SendSuccessSendErrorZ CResult_SendSuccessSendErrorZ_ok(struct LDKSendSuccess o);
32867 * Creates a new CResult_SendSuccessSendErrorZ in the error state.
32869 struct LDKCResult_SendSuccessSendErrorZ CResult_SendSuccessSendErrorZ_err(struct LDKSendError e);
32872 * Checks if the given object is currently in the success state
32874 bool CResult_SendSuccessSendErrorZ_is_ok(const struct LDKCResult_SendSuccessSendErrorZ *NONNULL_PTR o);
32877 * Frees any resources used by the CResult_SendSuccessSendErrorZ.
32879 void CResult_SendSuccessSendErrorZ_free(struct LDKCResult_SendSuccessSendErrorZ _res);
32882 * Creates a new CResult_SendSuccessSendErrorZ which has the same data as `orig`
32883 * but with all dynamically-allocated buffers duplicated in new buffers.
32885 struct LDKCResult_SendSuccessSendErrorZ CResult_SendSuccessSendErrorZ_clone(const struct LDKCResult_SendSuccessSendErrorZ *NONNULL_PTR orig);
32888 * Creates a new CResult_BlindedPathNoneZ in the success state.
32890 struct LDKCResult_BlindedPathNoneZ CResult_BlindedPathNoneZ_ok(struct LDKBlindedPath o);
32893 * Creates a new CResult_BlindedPathNoneZ in the error state.
32895 struct LDKCResult_BlindedPathNoneZ CResult_BlindedPathNoneZ_err(void);
32898 * Checks if the given object is currently in the success state
32900 bool CResult_BlindedPathNoneZ_is_ok(const struct LDKCResult_BlindedPathNoneZ *NONNULL_PTR o);
32903 * Frees any resources used by the CResult_BlindedPathNoneZ.
32905 void CResult_BlindedPathNoneZ_free(struct LDKCResult_BlindedPathNoneZ _res);
32908 * Creates a new CResult_BlindedPathNoneZ which has the same data as `orig`
32909 * but with all dynamically-allocated buffers duplicated in new buffers.
32911 struct LDKCResult_BlindedPathNoneZ CResult_BlindedPathNoneZ_clone(const struct LDKCResult_BlindedPathNoneZ *NONNULL_PTR orig);
32914 * Creates a new CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ in the success state.
32916 struct LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ_ok(struct LDKC2Tuple_BlindedPayInfoBlindedPathZ o);
32919 * Creates a new CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ in the error state.
32921 struct LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ_err(void);
32924 * Checks if the given object is currently in the success state
32926 bool CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ_is_ok(const struct LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ *NONNULL_PTR o);
32929 * Frees any resources used by the CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ.
32931 void CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ_free(struct LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ _res);
32934 * Creates a new CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ which has the same data as `orig`
32935 * but with all dynamically-allocated buffers duplicated in new buffers.
32937 struct LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ_clone(const struct LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ *NONNULL_PTR orig);
32940 * Frees the buffer pointed to by `data` if `datalen` is non-0.
32942 void CVec_ForwardNodeZ_free(struct LDKCVec_ForwardNodeZ _res);
32945 * Creates a new CResult_BlindedPathDecodeErrorZ in the success state.
32947 struct LDKCResult_BlindedPathDecodeErrorZ CResult_BlindedPathDecodeErrorZ_ok(struct LDKBlindedPath o);
32950 * Creates a new CResult_BlindedPathDecodeErrorZ in the error state.
32952 struct LDKCResult_BlindedPathDecodeErrorZ CResult_BlindedPathDecodeErrorZ_err(struct LDKDecodeError e);
32955 * Checks if the given object is currently in the success state
32957 bool CResult_BlindedPathDecodeErrorZ_is_ok(const struct LDKCResult_BlindedPathDecodeErrorZ *NONNULL_PTR o);
32960 * Frees any resources used by the CResult_BlindedPathDecodeErrorZ.
32962 void CResult_BlindedPathDecodeErrorZ_free(struct LDKCResult_BlindedPathDecodeErrorZ _res);
32965 * Creates a new CResult_BlindedPathDecodeErrorZ which has the same data as `orig`
32966 * but with all dynamically-allocated buffers duplicated in new buffers.
32968 struct LDKCResult_BlindedPathDecodeErrorZ CResult_BlindedPathDecodeErrorZ_clone(const struct LDKCResult_BlindedPathDecodeErrorZ *NONNULL_PTR orig);
32971 * Creates a new CResult_BlindedHopDecodeErrorZ in the success state.
32973 struct LDKCResult_BlindedHopDecodeErrorZ CResult_BlindedHopDecodeErrorZ_ok(struct LDKBlindedHop o);
32976 * Creates a new CResult_BlindedHopDecodeErrorZ in the error state.
32978 struct LDKCResult_BlindedHopDecodeErrorZ CResult_BlindedHopDecodeErrorZ_err(struct LDKDecodeError e);
32981 * Checks if the given object is currently in the success state
32983 bool CResult_BlindedHopDecodeErrorZ_is_ok(const struct LDKCResult_BlindedHopDecodeErrorZ *NONNULL_PTR o);
32986 * Frees any resources used by the CResult_BlindedHopDecodeErrorZ.
32988 void CResult_BlindedHopDecodeErrorZ_free(struct LDKCResult_BlindedHopDecodeErrorZ _res);
32991 * Creates a new CResult_BlindedHopDecodeErrorZ which has the same data as `orig`
32992 * but with all dynamically-allocated buffers duplicated in new buffers.
32994 struct LDKCResult_BlindedHopDecodeErrorZ CResult_BlindedHopDecodeErrorZ_clone(const struct LDKCResult_BlindedHopDecodeErrorZ *NONNULL_PTR orig);
32997 * Creates a new CResult_InvoiceErrorDecodeErrorZ in the success state.
32999 struct LDKCResult_InvoiceErrorDecodeErrorZ CResult_InvoiceErrorDecodeErrorZ_ok(struct LDKInvoiceError o);
33002 * Creates a new CResult_InvoiceErrorDecodeErrorZ in the error state.
33004 struct LDKCResult_InvoiceErrorDecodeErrorZ CResult_InvoiceErrorDecodeErrorZ_err(struct LDKDecodeError e);
33007 * Checks if the given object is currently in the success state
33009 bool CResult_InvoiceErrorDecodeErrorZ_is_ok(const struct LDKCResult_InvoiceErrorDecodeErrorZ *NONNULL_PTR o);
33012 * Frees any resources used by the CResult_InvoiceErrorDecodeErrorZ.
33014 void CResult_InvoiceErrorDecodeErrorZ_free(struct LDKCResult_InvoiceErrorDecodeErrorZ _res);
33017 * Creates a new CResult_InvoiceErrorDecodeErrorZ which has the same data as `orig`
33018 * but with all dynamically-allocated buffers duplicated in new buffers.
33020 struct LDKCResult_InvoiceErrorDecodeErrorZ CResult_InvoiceErrorDecodeErrorZ_clone(const struct LDKCResult_InvoiceErrorDecodeErrorZ *NONNULL_PTR orig);
33023 * Creates a new CResult_TrackedSpendableOutputDecodeErrorZ in the success state.
33025 struct LDKCResult_TrackedSpendableOutputDecodeErrorZ CResult_TrackedSpendableOutputDecodeErrorZ_ok(struct LDKTrackedSpendableOutput o);
33028 * Creates a new CResult_TrackedSpendableOutputDecodeErrorZ in the error state.
33030 struct LDKCResult_TrackedSpendableOutputDecodeErrorZ CResult_TrackedSpendableOutputDecodeErrorZ_err(struct LDKDecodeError e);
33033 * Checks if the given object is currently in the success state
33035 bool CResult_TrackedSpendableOutputDecodeErrorZ_is_ok(const struct LDKCResult_TrackedSpendableOutputDecodeErrorZ *NONNULL_PTR o);
33038 * Frees any resources used by the CResult_TrackedSpendableOutputDecodeErrorZ.
33040 void CResult_TrackedSpendableOutputDecodeErrorZ_free(struct LDKCResult_TrackedSpendableOutputDecodeErrorZ _res);
33043 * Creates a new CResult_TrackedSpendableOutputDecodeErrorZ which has the same data as `orig`
33044 * but with all dynamically-allocated buffers duplicated in new buffers.
33046 struct LDKCResult_TrackedSpendableOutputDecodeErrorZ CResult_TrackedSpendableOutputDecodeErrorZ_clone(const struct LDKCResult_TrackedSpendableOutputDecodeErrorZ *NONNULL_PTR orig);
33049 * Creates a new CResult_OutputSpendStatusDecodeErrorZ in the success state.
33051 struct LDKCResult_OutputSpendStatusDecodeErrorZ CResult_OutputSpendStatusDecodeErrorZ_ok(struct LDKOutputSpendStatus o);
33054 * Creates a new CResult_OutputSpendStatusDecodeErrorZ in the error state.
33056 struct LDKCResult_OutputSpendStatusDecodeErrorZ CResult_OutputSpendStatusDecodeErrorZ_err(struct LDKDecodeError e);
33059 * Checks if the given object is currently in the success state
33061 bool CResult_OutputSpendStatusDecodeErrorZ_is_ok(const struct LDKCResult_OutputSpendStatusDecodeErrorZ *NONNULL_PTR o);
33064 * Frees any resources used by the CResult_OutputSpendStatusDecodeErrorZ.
33066 void CResult_OutputSpendStatusDecodeErrorZ_free(struct LDKCResult_OutputSpendStatusDecodeErrorZ _res);
33069 * Creates a new CResult_OutputSpendStatusDecodeErrorZ which has the same data as `orig`
33070 * but with all dynamically-allocated buffers duplicated in new buffers.
33072 struct LDKCResult_OutputSpendStatusDecodeErrorZ CResult_OutputSpendStatusDecodeErrorZ_clone(const struct LDKCResult_OutputSpendStatusDecodeErrorZ *NONNULL_PTR orig);
33075 * Constructs a new COption_FilterZ containing a crate::lightning::chain::Filter
33077 struct LDKCOption_FilterZ COption_FilterZ_some(struct LDKFilter o);
33080 * Constructs a new COption_FilterZ containing nothing
33082 struct LDKCOption_FilterZ COption_FilterZ_none(void);
33085 * Frees any resources associated with the crate::lightning::chain::Filter, if we are in the Some state
33087 void COption_FilterZ_free(struct LDKCOption_FilterZ _res);
33090 * Frees the buffer pointed to by `data` if `datalen` is non-0.
33092 void CVec_TrackedSpendableOutputZ_free(struct LDKCVec_TrackedSpendableOutputZ _res);
33095 * Creates a new CResult_OutputSweeperDecodeErrorZ in the success state.
33097 struct LDKCResult_OutputSweeperDecodeErrorZ CResult_OutputSweeperDecodeErrorZ_ok(struct LDKOutputSweeper o);
33100 * Creates a new CResult_OutputSweeperDecodeErrorZ in the error state.
33102 struct LDKCResult_OutputSweeperDecodeErrorZ CResult_OutputSweeperDecodeErrorZ_err(struct LDKDecodeError e);
33105 * Checks if the given object is currently in the success state
33107 bool CResult_OutputSweeperDecodeErrorZ_is_ok(const struct LDKCResult_OutputSweeperDecodeErrorZ *NONNULL_PTR o);
33110 * Frees any resources used by the CResult_OutputSweeperDecodeErrorZ.
33112 void CResult_OutputSweeperDecodeErrorZ_free(struct LDKCResult_OutputSweeperDecodeErrorZ _res);
33115 * Creates a new C2Tuple_BestBlockOutputSweeperZ from the contained elements.
33117 struct LDKC2Tuple_BestBlockOutputSweeperZ C2Tuple_BestBlockOutputSweeperZ_new(struct LDKBestBlock a, struct LDKOutputSweeper b);
33120 * Frees any resources used by the C2Tuple_BestBlockOutputSweeperZ.
33122 void C2Tuple_BestBlockOutputSweeperZ_free(struct LDKC2Tuple_BestBlockOutputSweeperZ _res);
33125 * Creates a new CResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ in the success state.
33127 struct LDKCResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ CResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ_ok(struct LDKC2Tuple_BestBlockOutputSweeperZ o);
33130 * Creates a new CResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ in the error state.
33132 struct LDKCResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ CResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ_err(struct LDKDecodeError e);
33135 * Checks if the given object is currently in the success state
33137 bool CResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ_is_ok(const struct LDKCResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ *NONNULL_PTR o);
33140 * Frees any resources used by the CResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ.
33142 void CResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ_free(struct LDKCResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ _res);
33145 * Creates a new CResult_DelayedPaymentBasepointDecodeErrorZ in the success state.
33147 struct LDKCResult_DelayedPaymentBasepointDecodeErrorZ CResult_DelayedPaymentBasepointDecodeErrorZ_ok(struct LDKDelayedPaymentBasepoint o);
33150 * Creates a new CResult_DelayedPaymentBasepointDecodeErrorZ in the error state.
33152 struct LDKCResult_DelayedPaymentBasepointDecodeErrorZ CResult_DelayedPaymentBasepointDecodeErrorZ_err(struct LDKDecodeError e);
33155 * Checks if the given object is currently in the success state
33157 bool CResult_DelayedPaymentBasepointDecodeErrorZ_is_ok(const struct LDKCResult_DelayedPaymentBasepointDecodeErrorZ *NONNULL_PTR o);
33160 * Frees any resources used by the CResult_DelayedPaymentBasepointDecodeErrorZ.
33162 void CResult_DelayedPaymentBasepointDecodeErrorZ_free(struct LDKCResult_DelayedPaymentBasepointDecodeErrorZ _res);
33165 * Creates a new CResult_DelayedPaymentBasepointDecodeErrorZ which has the same data as `orig`
33166 * but with all dynamically-allocated buffers duplicated in new buffers.
33168 struct LDKCResult_DelayedPaymentBasepointDecodeErrorZ CResult_DelayedPaymentBasepointDecodeErrorZ_clone(const struct LDKCResult_DelayedPaymentBasepointDecodeErrorZ *NONNULL_PTR orig);
33171 * Creates a new CResult_DelayedPaymentKeyDecodeErrorZ in the success state.
33173 struct LDKCResult_DelayedPaymentKeyDecodeErrorZ CResult_DelayedPaymentKeyDecodeErrorZ_ok(struct LDKDelayedPaymentKey o);
33176 * Creates a new CResult_DelayedPaymentKeyDecodeErrorZ in the error state.
33178 struct LDKCResult_DelayedPaymentKeyDecodeErrorZ CResult_DelayedPaymentKeyDecodeErrorZ_err(struct LDKDecodeError e);
33181 * Checks if the given object is currently in the success state
33183 bool CResult_DelayedPaymentKeyDecodeErrorZ_is_ok(const struct LDKCResult_DelayedPaymentKeyDecodeErrorZ *NONNULL_PTR o);
33186 * Frees any resources used by the CResult_DelayedPaymentKeyDecodeErrorZ.
33188 void CResult_DelayedPaymentKeyDecodeErrorZ_free(struct LDKCResult_DelayedPaymentKeyDecodeErrorZ _res);
33191 * Creates a new CResult_DelayedPaymentKeyDecodeErrorZ which has the same data as `orig`
33192 * but with all dynamically-allocated buffers duplicated in new buffers.
33194 struct LDKCResult_DelayedPaymentKeyDecodeErrorZ CResult_DelayedPaymentKeyDecodeErrorZ_clone(const struct LDKCResult_DelayedPaymentKeyDecodeErrorZ *NONNULL_PTR orig);
33197 * Creates a new CResult_HtlcBasepointDecodeErrorZ in the success state.
33199 struct LDKCResult_HtlcBasepointDecodeErrorZ CResult_HtlcBasepointDecodeErrorZ_ok(struct LDKHtlcBasepoint o);
33202 * Creates a new CResult_HtlcBasepointDecodeErrorZ in the error state.
33204 struct LDKCResult_HtlcBasepointDecodeErrorZ CResult_HtlcBasepointDecodeErrorZ_err(struct LDKDecodeError e);
33207 * Checks if the given object is currently in the success state
33209 bool CResult_HtlcBasepointDecodeErrorZ_is_ok(const struct LDKCResult_HtlcBasepointDecodeErrorZ *NONNULL_PTR o);
33212 * Frees any resources used by the CResult_HtlcBasepointDecodeErrorZ.
33214 void CResult_HtlcBasepointDecodeErrorZ_free(struct LDKCResult_HtlcBasepointDecodeErrorZ _res);
33217 * Creates a new CResult_HtlcBasepointDecodeErrorZ which has the same data as `orig`
33218 * but with all dynamically-allocated buffers duplicated in new buffers.
33220 struct LDKCResult_HtlcBasepointDecodeErrorZ CResult_HtlcBasepointDecodeErrorZ_clone(const struct LDKCResult_HtlcBasepointDecodeErrorZ *NONNULL_PTR orig);
33223 * Creates a new CResult_HtlcKeyDecodeErrorZ in the success state.
33225 struct LDKCResult_HtlcKeyDecodeErrorZ CResult_HtlcKeyDecodeErrorZ_ok(struct LDKHtlcKey o);
33228 * Creates a new CResult_HtlcKeyDecodeErrorZ in the error state.
33230 struct LDKCResult_HtlcKeyDecodeErrorZ CResult_HtlcKeyDecodeErrorZ_err(struct LDKDecodeError e);
33233 * Checks if the given object is currently in the success state
33235 bool CResult_HtlcKeyDecodeErrorZ_is_ok(const struct LDKCResult_HtlcKeyDecodeErrorZ *NONNULL_PTR o);
33238 * Frees any resources used by the CResult_HtlcKeyDecodeErrorZ.
33240 void CResult_HtlcKeyDecodeErrorZ_free(struct LDKCResult_HtlcKeyDecodeErrorZ _res);
33243 * Creates a new CResult_HtlcKeyDecodeErrorZ which has the same data as `orig`
33244 * but with all dynamically-allocated buffers duplicated in new buffers.
33246 struct LDKCResult_HtlcKeyDecodeErrorZ CResult_HtlcKeyDecodeErrorZ_clone(const struct LDKCResult_HtlcKeyDecodeErrorZ *NONNULL_PTR orig);
33249 * Creates a new CResult_RevocationBasepointDecodeErrorZ in the success state.
33251 struct LDKCResult_RevocationBasepointDecodeErrorZ CResult_RevocationBasepointDecodeErrorZ_ok(struct LDKRevocationBasepoint o);
33254 * Creates a new CResult_RevocationBasepointDecodeErrorZ in the error state.
33256 struct LDKCResult_RevocationBasepointDecodeErrorZ CResult_RevocationBasepointDecodeErrorZ_err(struct LDKDecodeError e);
33259 * Checks if the given object is currently in the success state
33261 bool CResult_RevocationBasepointDecodeErrorZ_is_ok(const struct LDKCResult_RevocationBasepointDecodeErrorZ *NONNULL_PTR o);
33264 * Frees any resources used by the CResult_RevocationBasepointDecodeErrorZ.
33266 void CResult_RevocationBasepointDecodeErrorZ_free(struct LDKCResult_RevocationBasepointDecodeErrorZ _res);
33269 * Creates a new CResult_RevocationBasepointDecodeErrorZ which has the same data as `orig`
33270 * but with all dynamically-allocated buffers duplicated in new buffers.
33272 struct LDKCResult_RevocationBasepointDecodeErrorZ CResult_RevocationBasepointDecodeErrorZ_clone(const struct LDKCResult_RevocationBasepointDecodeErrorZ *NONNULL_PTR orig);
33275 * Creates a new CResult_RevocationKeyDecodeErrorZ in the success state.
33277 struct LDKCResult_RevocationKeyDecodeErrorZ CResult_RevocationKeyDecodeErrorZ_ok(struct LDKRevocationKey o);
33280 * Creates a new CResult_RevocationKeyDecodeErrorZ in the error state.
33282 struct LDKCResult_RevocationKeyDecodeErrorZ CResult_RevocationKeyDecodeErrorZ_err(struct LDKDecodeError e);
33285 * Checks if the given object is currently in the success state
33287 bool CResult_RevocationKeyDecodeErrorZ_is_ok(const struct LDKCResult_RevocationKeyDecodeErrorZ *NONNULL_PTR o);
33290 * Frees any resources used by the CResult_RevocationKeyDecodeErrorZ.
33292 void CResult_RevocationKeyDecodeErrorZ_free(struct LDKCResult_RevocationKeyDecodeErrorZ _res);
33295 * Creates a new CResult_RevocationKeyDecodeErrorZ which has the same data as `orig`
33296 * but with all dynamically-allocated buffers duplicated in new buffers.
33298 struct LDKCResult_RevocationKeyDecodeErrorZ CResult_RevocationKeyDecodeErrorZ_clone(const struct LDKCResult_RevocationKeyDecodeErrorZ *NONNULL_PTR orig);
33301 * Creates a new CResult_LockedChannelMonitorNoneZ in the success state.
33303 struct LDKCResult_LockedChannelMonitorNoneZ CResult_LockedChannelMonitorNoneZ_ok(struct LDKLockedChannelMonitor o);
33306 * Creates a new CResult_LockedChannelMonitorNoneZ in the error state.
33308 struct LDKCResult_LockedChannelMonitorNoneZ CResult_LockedChannelMonitorNoneZ_err(void);
33311 * Checks if the given object is currently in the success state
33313 bool CResult_LockedChannelMonitorNoneZ_is_ok(const struct LDKCResult_LockedChannelMonitorNoneZ *NONNULL_PTR o);
33316 * Frees any resources used by the CResult_LockedChannelMonitorNoneZ.
33318 void CResult_LockedChannelMonitorNoneZ_free(struct LDKCResult_LockedChannelMonitorNoneZ _res);
33321 * Creates a new tuple which has the same data as `orig`
33322 * but with all dynamically-allocated buffers duplicated in new buffers.
33324 struct LDKC2Tuple_OutPointChannelIdZ C2Tuple_OutPointChannelIdZ_clone(const struct LDKC2Tuple_OutPointChannelIdZ *NONNULL_PTR orig);
33327 * Creates a new C2Tuple_OutPointChannelIdZ from the contained elements.
33329 struct LDKC2Tuple_OutPointChannelIdZ C2Tuple_OutPointChannelIdZ_new(struct LDKOutPoint a, struct LDKChannelId b);
33332 * Frees any resources used by the C2Tuple_OutPointChannelIdZ.
33334 void C2Tuple_OutPointChannelIdZ_free(struct LDKC2Tuple_OutPointChannelIdZ _res);
33337 * Frees the buffer pointed to by `data` if `datalen` is non-0.
33339 void CVec_C2Tuple_OutPointChannelIdZZ_free(struct LDKCVec_C2Tuple_OutPointChannelIdZZ _res);
33342 * Frees the buffer pointed to by `data` if `datalen` is non-0.
33344 void CVec_MonitorUpdateIdZ_free(struct LDKCVec_MonitorUpdateIdZ _res);
33347 * Creates a new tuple which has the same data as `orig`
33348 * but with all dynamically-allocated buffers duplicated in new buffers.
33350 struct LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ C2Tuple_OutPointCVec_MonitorUpdateIdZZ_clone(const struct LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ *NONNULL_PTR orig);
33353 * Creates a new C2Tuple_OutPointCVec_MonitorUpdateIdZZ from the contained elements.
33355 struct LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ C2Tuple_OutPointCVec_MonitorUpdateIdZZ_new(struct LDKOutPoint a, struct LDKCVec_MonitorUpdateIdZ b);
33358 * Frees any resources used by the C2Tuple_OutPointCVec_MonitorUpdateIdZZ.
33360 void C2Tuple_OutPointCVec_MonitorUpdateIdZZ_free(struct LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ _res);
33363 * Frees the buffer pointed to by `data` if `datalen` is non-0.
33365 void CVec_C2Tuple_OutPointCVec_MonitorUpdateIdZZZ_free(struct LDKCVec_C2Tuple_OutPointCVec_MonitorUpdateIdZZZ _res);
33368 * Frees any resources used by the APIError
33370 void APIError_free(struct LDKAPIError this_ptr);
33373 * Creates a copy of the APIError
33375 struct LDKAPIError APIError_clone(const struct LDKAPIError *NONNULL_PTR orig);
33378 * Utility method to constructs a new APIMisuseError-variant APIError
33380 struct LDKAPIError APIError_apimisuse_error(struct LDKStr err);
33383 * Utility method to constructs a new FeeRateTooHigh-variant APIError
33385 struct LDKAPIError APIError_fee_rate_too_high(struct LDKStr err, uint32_t feerate);
33388 * Utility method to constructs a new InvalidRoute-variant APIError
33390 struct LDKAPIError APIError_invalid_route(struct LDKStr err);
33393 * Utility method to constructs a new ChannelUnavailable-variant APIError
33395 struct LDKAPIError APIError_channel_unavailable(struct LDKStr err);
33398 * Utility method to constructs a new MonitorUpdateInProgress-variant APIError
33400 struct LDKAPIError APIError_monitor_update_in_progress(void);
33403 * Utility method to constructs a new IncompatibleShutdownScript-variant APIError
33405 struct LDKAPIError APIError_incompatible_shutdown_script(struct LDKShutdownScript script);
33408 * Checks if two APIErrors contain equal inner contents.
33409 * This ignores pointers and is_owned flags and looks at the values in fields.
33411 bool APIError_eq(const struct LDKAPIError *NONNULL_PTR a, const struct LDKAPIError *NONNULL_PTR b);
33414 * Serialize the APIError object into a byte array which can be read by APIError_read
33416 struct LDKCVec_u8Z APIError_write(const struct LDKAPIError *NONNULL_PTR obj);
33419 * Read a APIError from a byte array, created by APIError_write
33421 struct LDKCResult_COption_APIErrorZDecodeErrorZ APIError_read(struct LDKu8slice ser);
33424 * Frees any resources used by the BigSize, if is_owned is set and inner is non-NULL.
33426 void BigSize_free(struct LDKBigSize this_obj);
33428 uint64_t BigSize_get_a(const struct LDKBigSize *NONNULL_PTR this_ptr);
33430 void BigSize_set_a(struct LDKBigSize *NONNULL_PTR this_ptr, uint64_t val);
33433 * Constructs a new BigSize given each field
33435 MUST_USE_RES struct LDKBigSize BigSize_new(uint64_t a_arg);
33438 * Creates a copy of the BigSize
33440 struct LDKBigSize BigSize_clone(const struct LDKBigSize *NONNULL_PTR orig);
33443 * Generates a non-cryptographic 64-bit hash of the BigSize.
33445 uint64_t BigSize_hash(const struct LDKBigSize *NONNULL_PTR o);
33448 * Checks if two BigSizes contain equal inner contents.
33449 * This ignores pointers and is_owned flags and looks at the values in fields.
33450 * Two objects with NULL inner values will be considered "equal" here.
33452 bool BigSize_eq(const struct LDKBigSize *NONNULL_PTR a, const struct LDKBigSize *NONNULL_PTR b);
33455 * Serialize the BigSize object into a byte array which can be read by BigSize_read
33457 struct LDKCVec_u8Z BigSize_write(const struct LDKBigSize *NONNULL_PTR obj);
33460 * Read a BigSize from a byte array, created by BigSize_write
33462 struct LDKCResult_BigSizeDecodeErrorZ BigSize_read(struct LDKu8slice ser);
33465 * Frees any resources used by the Hostname, if is_owned is set and inner is non-NULL.
33467 void Hostname_free(struct LDKHostname this_obj);
33470 * Creates a copy of the Hostname
33472 struct LDKHostname Hostname_clone(const struct LDKHostname *NONNULL_PTR orig);
33475 * Generates a non-cryptographic 64-bit hash of the Hostname.
33477 uint64_t Hostname_hash(const struct LDKHostname *NONNULL_PTR o);
33480 * Checks if two Hostnames contain equal inner contents.
33481 * This ignores pointers and is_owned flags and looks at the values in fields.
33482 * Two objects with NULL inner values will be considered "equal" here.
33484 bool Hostname_eq(const struct LDKHostname *NONNULL_PTR a, const struct LDKHostname *NONNULL_PTR b);
33487 * Returns the length of the hostname.
33489 MUST_USE_RES uint8_t Hostname_len(const struct LDKHostname *NONNULL_PTR this_arg);
33492 * Get the string representation of a Hostname object
33494 struct LDKStr Hostname_to_str(const struct LDKHostname *NONNULL_PTR o);
33497 * Serialize the Hostname object into a byte array which can be read by Hostname_read
33499 struct LDKCVec_u8Z Hostname_write(const struct LDKHostname *NONNULL_PTR obj);
33502 * Read a Hostname from a byte array, created by Hostname_write
33504 struct LDKCResult_HostnameDecodeErrorZ Hostname_read(struct LDKu8slice ser);
33507 * Frees any resources used by the TransactionU16LenLimited, if is_owned is set and inner is non-NULL.
33509 void TransactionU16LenLimited_free(struct LDKTransactionU16LenLimited this_obj);
33512 * Creates a copy of the TransactionU16LenLimited
33514 struct LDKTransactionU16LenLimited TransactionU16LenLimited_clone(const struct LDKTransactionU16LenLimited *NONNULL_PTR orig);
33517 * Generates a non-cryptographic 64-bit hash of the TransactionU16LenLimited.
33519 uint64_t TransactionU16LenLimited_hash(const struct LDKTransactionU16LenLimited *NONNULL_PTR o);
33522 * Checks if two TransactionU16LenLimiteds contain equal inner contents.
33523 * This ignores pointers and is_owned flags and looks at the values in fields.
33524 * Two objects with NULL inner values will be considered "equal" here.
33526 bool TransactionU16LenLimited_eq(const struct LDKTransactionU16LenLimited *NONNULL_PTR a, const struct LDKTransactionU16LenLimited *NONNULL_PTR b);
33529 * Constructs a new `TransactionU16LenLimited` from a `Transaction` only if it's consensus-
33530 * serialized length is <= u16::MAX.
33532 MUST_USE_RES struct LDKCResult_TransactionU16LenLimitedNoneZ TransactionU16LenLimited_new(struct LDKTransaction transaction);
33535 * Consumes this `TransactionU16LenLimited` and returns its contained `Transaction`.
33537 MUST_USE_RES struct LDKTransaction TransactionU16LenLimited_into_transaction(struct LDKTransactionU16LenLimited this_arg);
33540 * Returns a reference to the contained `Transaction`
33542 MUST_USE_RES struct LDKTransaction TransactionU16LenLimited_as_transaction(const struct LDKTransactionU16LenLimited *NONNULL_PTR this_arg);
33545 * Serialize the TransactionU16LenLimited object into a byte array which can be read by TransactionU16LenLimited_read
33547 struct LDKCVec_u8Z TransactionU16LenLimited_write(const struct LDKTransactionU16LenLimited *NONNULL_PTR obj);
33550 * Read a TransactionU16LenLimited from a byte array, created by TransactionU16LenLimited_write
33552 struct LDKCResult_TransactionU16LenLimitedDecodeErrorZ TransactionU16LenLimited_read(struct LDKu8slice ser);
33555 * Creates a digital signature of a message given a SecretKey, like the node's secret.
33556 * 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.
33557 * Signatures are EC recoverable, meaning that given the message and the signature the PublicKey of the signer can be extracted.
33559 struct LDKCResult_StrSecp256k1ErrorZ sign(struct LDKu8slice msg, const uint8_t (*sk)[32]);
33562 * Recovers the PublicKey of the signer of the message given the message and the signature.
33564 struct LDKCResult_PublicKeySecp256k1ErrorZ recover_pk(struct LDKu8slice msg, struct LDKStr sig);
33567 * Verifies a message was signed by a PrivateKey that derives to a given PublicKey, given a message, a signature,
33568 * and the PublicKey.
33570 bool verify(struct LDKu8slice msg, struct LDKStr sig, struct LDKPublicKey pk);
33573 * Construct the invoice's HRP and signatureless data into a preimage to be hashed.
33575 struct LDKCVec_u8Z construct_invoice_preimage(struct LDKu8slice hrp_bytes, struct LDKCVec_U5Z data_without_signature);
33578 * Calls the free function if one is set
33580 void KVStore_free(struct LDKKVStore this_ptr);
33583 * Calls the free function if one is set
33585 void Persister_free(struct LDKPersister this_ptr);
33588 * Read previously persisted [`ChannelMonitor`]s from the store.
33590 struct LDKCResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ read_channel_monitors(struct LDKKVStore kv_store, struct LDKEntropySource entropy_source, struct LDKSignerProvider signer_provider);
33593 * Frees any resources used by the MonitorUpdatingPersister, if is_owned is set and inner is non-NULL.
33595 void MonitorUpdatingPersister_free(struct LDKMonitorUpdatingPersister this_obj);
33598 * Constructs a new [`MonitorUpdatingPersister`].
33600 * The `maximum_pending_updates` parameter controls how many updates may be stored before a
33601 * [`MonitorUpdatingPersister`] consolidates updates by writing a full monitor. Note that
33602 * consolidation will frequently occur with fewer updates than what you set here; this number
33603 * is merely the maximum that may be stored. When setting this value, consider that for higher
33604 * values of `maximum_pending_updates`:
33606 * - [`MonitorUpdatingPersister`] will tend to write more [`ChannelMonitorUpdate`]s than
33607 * [`ChannelMonitor`]s, approaching one [`ChannelMonitor`] write for every
33608 * `maximum_pending_updates` [`ChannelMonitorUpdate`]s.
33609 * - [`MonitorUpdatingPersister`] will issue deletes differently. Lazy deletes will come in
33610 * \"waves\" for each [`ChannelMonitor`] write. A larger `maximum_pending_updates` means bigger,
33611 * less frequent \"waves.\"
33612 * - [`MonitorUpdatingPersister`] will potentially have more listing to do if you need to run
33613 * [`MonitorUpdatingPersister::cleanup_stale_updates`].
33615 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);
33618 * Reads all stored channel monitors, along with any stored updates for them.
33620 * It is extremely important that your [`KVStore::read`] implementation uses the
33621 * [`io::ErrorKind::NotFound`] variant correctly. For more information, please see the
33622 * documentation for [`MonitorUpdatingPersister`].
33624 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);
33627 * Read a single channel monitor, along with any stored updates for it.
33629 * It is extremely important that your [`KVStore::read`] implementation uses the
33630 * [`io::ErrorKind::NotFound`] variant correctly. For more information, please see the
33631 * documentation for [`MonitorUpdatingPersister`].
33633 * For `monitor_key`, channel storage keys be the channel's transaction ID and index, or
33634 * [`OutPoint`], with an underscore `_` between them. For example, given:
33636 * - Transaction ID: `deadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeef`
33639 * The correct `monitor_key` would be:
33640 * `deadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeef_1`
33642 * Loading a large number of monitors will be faster if done in parallel. You can use this
33643 * function to accomplish this. Take care to limit the number of parallel readers.
33645 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);
33648 * Cleans up stale updates for all monitors.
33650 * This function works by first listing all monitors, and then for each of them, listing all
33651 * updates. The updates that have an `update_id` less than or equal to than the stored monitor
33652 * are deleted. The deletion can either be lazy or non-lazy based on the `lazy` flag; this will
33653 * be passed to [`KVStore::remove`].
33655 MUST_USE_RES struct LDKCResult_NoneIOErrorZ MonitorUpdatingPersister_cleanup_stale_updates(const struct LDKMonitorUpdatingPersister *NONNULL_PTR this_arg, bool lazy);
33658 * Constructs a new Persist which calls the relevant methods on this_arg.
33659 * This copies the `inner` pointer in this_arg and thus the returned Persist must be freed before this_arg is
33661 struct LDKPersist MonitorUpdatingPersister_as_Persist(const struct LDKMonitorUpdatingPersister *NONNULL_PTR this_arg);
33664 * Creates a copy of the ShortChannelIdError
33666 enum LDKShortChannelIdError ShortChannelIdError_clone(const enum LDKShortChannelIdError *NONNULL_PTR orig);
33669 * Utility method to constructs a new BlockOverflow-variant ShortChannelIdError
33671 enum LDKShortChannelIdError ShortChannelIdError_block_overflow(void);
33674 * Utility method to constructs a new TxIndexOverflow-variant ShortChannelIdError
33676 enum LDKShortChannelIdError ShortChannelIdError_tx_index_overflow(void);
33679 * Utility method to constructs a new VoutIndexOverflow-variant ShortChannelIdError
33681 enum LDKShortChannelIdError ShortChannelIdError_vout_index_overflow(void);
33684 * Checks if two ShortChannelIdErrors contain equal inner contents.
33685 * This ignores pointers and is_owned flags and looks at the values in fields.
33687 bool ShortChannelIdError_eq(const enum LDKShortChannelIdError *NONNULL_PTR a, const enum LDKShortChannelIdError *NONNULL_PTR b);
33690 * Extracts the block height (most significant 3-bytes) from the `short_channel_id`
33692 uint32_t block_from_scid(uint64_t short_channel_id);
33695 * Extracts the tx index (bytes [2..4]) from the `short_channel_id`
33697 uint32_t tx_index_from_scid(uint64_t short_channel_id);
33700 * Extracts the vout (bytes [0..2]) from the `short_channel_id`
33702 uint16_t vout_from_scid(uint64_t short_channel_id);
33705 * Constructs a `short_channel_id` using the components pieces. Results in an error
33706 * if the block height, tx index, or vout index overflow the maximum sizes.
33708 struct LDKCResult_u64ShortChannelIdErrorZ scid_from_parts(uint64_t block, uint64_t tx_index, uint64_t vout_index);
33711 * Frees any resources used by the UntrustedString, if is_owned is set and inner is non-NULL.
33713 void UntrustedString_free(struct LDKUntrustedString this_obj);
33715 struct LDKStr UntrustedString_get_a(const struct LDKUntrustedString *NONNULL_PTR this_ptr);
33717 void UntrustedString_set_a(struct LDKUntrustedString *NONNULL_PTR this_ptr, struct LDKStr val);
33720 * Constructs a new UntrustedString given each field
33722 MUST_USE_RES struct LDKUntrustedString UntrustedString_new(struct LDKStr a_arg);
33725 * Creates a copy of the UntrustedString
33727 struct LDKUntrustedString UntrustedString_clone(const struct LDKUntrustedString *NONNULL_PTR orig);
33730 * Checks if two UntrustedStrings contain equal inner contents.
33731 * This ignores pointers and is_owned flags and looks at the values in fields.
33732 * Two objects with NULL inner values will be considered "equal" here.
33734 bool UntrustedString_eq(const struct LDKUntrustedString *NONNULL_PTR a, const struct LDKUntrustedString *NONNULL_PTR b);
33737 * Generates a non-cryptographic 64-bit hash of the UntrustedString.
33739 uint64_t UntrustedString_hash(const struct LDKUntrustedString *NONNULL_PTR o);
33742 * Serialize the UntrustedString object into a byte array which can be read by UntrustedString_read
33744 struct LDKCVec_u8Z UntrustedString_write(const struct LDKUntrustedString *NONNULL_PTR obj);
33747 * Read a UntrustedString from a byte array, created by UntrustedString_write
33749 struct LDKCResult_UntrustedStringDecodeErrorZ UntrustedString_read(struct LDKu8slice ser);
33752 * Get the string representation of a UntrustedString object
33754 struct LDKStr UntrustedString_to_str(const struct LDKUntrustedString *NONNULL_PTR o);
33757 * Frees any resources used by the PrintableString, if is_owned is set and inner is non-NULL.
33759 void PrintableString_free(struct LDKPrintableString this_obj);
33761 struct LDKStr PrintableString_get_a(const struct LDKPrintableString *NONNULL_PTR this_ptr);
33763 void PrintableString_set_a(struct LDKPrintableString *NONNULL_PTR this_ptr, struct LDKStr val);
33766 * Constructs a new PrintableString given each field
33768 MUST_USE_RES struct LDKPrintableString PrintableString_new(struct LDKStr a_arg);
33771 * Get the string representation of a PrintableString object
33773 struct LDKStr PrintableString_to_str(const struct LDKPrintableString *NONNULL_PTR o);
33776 * Frees any resources used by the TrackedSpendableOutput, if is_owned is set and inner is non-NULL.
33778 void TrackedSpendableOutput_free(struct LDKTrackedSpendableOutput this_obj);
33781 * The tracked output descriptor.
33783 struct LDKSpendableOutputDescriptor TrackedSpendableOutput_get_descriptor(const struct LDKTrackedSpendableOutput *NONNULL_PTR this_ptr);
33786 * The tracked output descriptor.
33788 void TrackedSpendableOutput_set_descriptor(struct LDKTrackedSpendableOutput *NONNULL_PTR this_ptr, struct LDKSpendableOutputDescriptor val);
33791 * The channel this output belongs to.
33793 * Will be `None` if no `channel_id` was given to [`OutputSweeper::track_spendable_outputs`]
33795 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
33797 struct LDKChannelId TrackedSpendableOutput_get_channel_id(const struct LDKTrackedSpendableOutput *NONNULL_PTR this_ptr);
33800 * The channel this output belongs to.
33802 * Will be `None` if no `channel_id` was given to [`OutputSweeper::track_spendable_outputs`]
33804 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
33806 void TrackedSpendableOutput_set_channel_id(struct LDKTrackedSpendableOutput *NONNULL_PTR this_ptr, struct LDKChannelId val);
33809 * The current status of the output spend.
33811 struct LDKOutputSpendStatus TrackedSpendableOutput_get_status(const struct LDKTrackedSpendableOutput *NONNULL_PTR this_ptr);
33814 * The current status of the output spend.
33816 void TrackedSpendableOutput_set_status(struct LDKTrackedSpendableOutput *NONNULL_PTR this_ptr, struct LDKOutputSpendStatus val);
33819 * Constructs a new TrackedSpendableOutput given each field
33821 * Note that channel_id_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
33823 MUST_USE_RES struct LDKTrackedSpendableOutput TrackedSpendableOutput_new(struct LDKSpendableOutputDescriptor descriptor_arg, struct LDKChannelId channel_id_arg, struct LDKOutputSpendStatus status_arg);
33826 * Creates a copy of the TrackedSpendableOutput
33828 struct LDKTrackedSpendableOutput TrackedSpendableOutput_clone(const struct LDKTrackedSpendableOutput *NONNULL_PTR orig);
33831 * Checks if two TrackedSpendableOutputs contain equal inner contents.
33832 * This ignores pointers and is_owned flags and looks at the values in fields.
33833 * Two objects with NULL inner values will be considered "equal" here.
33835 bool TrackedSpendableOutput_eq(const struct LDKTrackedSpendableOutput *NONNULL_PTR a, const struct LDKTrackedSpendableOutput *NONNULL_PTR b);
33838 * Returns whether the output is spent in the given transaction.
33840 MUST_USE_RES bool TrackedSpendableOutput_is_spent_in(const struct LDKTrackedSpendableOutput *NONNULL_PTR this_arg, struct LDKTransaction tx);
33843 * Serialize the TrackedSpendableOutput object into a byte array which can be read by TrackedSpendableOutput_read
33845 struct LDKCVec_u8Z TrackedSpendableOutput_write(const struct LDKTrackedSpendableOutput *NONNULL_PTR obj);
33848 * Read a TrackedSpendableOutput from a byte array, created by TrackedSpendableOutput_write
33850 struct LDKCResult_TrackedSpendableOutputDecodeErrorZ TrackedSpendableOutput_read(struct LDKu8slice ser);
33853 * Frees any resources used by the OutputSpendStatus
33855 void OutputSpendStatus_free(struct LDKOutputSpendStatus this_ptr);
33858 * Creates a copy of the OutputSpendStatus
33860 struct LDKOutputSpendStatus OutputSpendStatus_clone(const struct LDKOutputSpendStatus *NONNULL_PTR orig);
33863 * Utility method to constructs a new PendingInitialBroadcast-variant OutputSpendStatus
33865 struct LDKOutputSpendStatus OutputSpendStatus_pending_initial_broadcast(struct LDKCOption_u32Z delayed_until_height);
33868 * Utility method to constructs a new PendingFirstConfirmation-variant OutputSpendStatus
33870 struct LDKOutputSpendStatus OutputSpendStatus_pending_first_confirmation(struct LDKThirtyTwoBytes first_broadcast_hash, uint32_t latest_broadcast_height, struct LDKTransaction latest_spending_tx);
33873 * Utility method to constructs a new PendingThresholdConfirmations-variant OutputSpendStatus
33875 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);
33878 * Checks if two OutputSpendStatuss contain equal inner contents.
33879 * This ignores pointers and is_owned flags and looks at the values in fields.
33881 bool OutputSpendStatus_eq(const struct LDKOutputSpendStatus *NONNULL_PTR a, const struct LDKOutputSpendStatus *NONNULL_PTR b);
33884 * Serialize the OutputSpendStatus object into a byte array which can be read by OutputSpendStatus_read
33886 struct LDKCVec_u8Z OutputSpendStatus_write(const struct LDKOutputSpendStatus *NONNULL_PTR obj);
33889 * Read a OutputSpendStatus from a byte array, created by OutputSpendStatus_write
33891 struct LDKCResult_OutputSpendStatusDecodeErrorZ OutputSpendStatus_read(struct LDKu8slice ser);
33894 * Frees any resources used by the OutputSweeper, if is_owned is set and inner is non-NULL.
33896 void OutputSweeper_free(struct LDKOutputSweeper this_obj);
33899 * Constructs a new [`OutputSweeper`].
33901 * If chain data is provided via the [`Confirm`] interface or via filtered blocks, users also
33902 * need to register their [`Filter`] implementation via the given `chain_data_source`.
33904 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);
33907 * Tells the sweeper to track the given outputs descriptors.
33909 * Usually, this should be called based on the values emitted by the
33910 * [`Event::SpendableOutputs`].
33912 * The given `exclude_static_outputs` flag controls whether the sweeper will filter out
33913 * [`SpendableOutputDescriptor::StaticOutput`]s, which may be handled directly by the on-chain
33914 * wallet implementation.
33916 * If `delay_until_height` is set, we will delay the spending until the respective block
33917 * height is reached. This can be used to batch spends, e.g., to reduce on-chain fees.
33919 * Returns `Err` on persistence failure, in which case the call may be safely retried.
33921 * [`Event::SpendableOutputs`]: crate::events::Event::SpendableOutputs
33923 * Note that channel_id (or a relevant inner pointer) may be NULL or all-0s to represent None
33925 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);
33928 * Returns a list of the currently tracked spendable outputs.
33930 MUST_USE_RES struct LDKCVec_TrackedSpendableOutputZ OutputSweeper_tracked_spendable_outputs(const struct LDKOutputSweeper *NONNULL_PTR this_arg);
33933 * Gets the latest best block which was connected either via the [`Listen`] or
33934 * [`Confirm`] interfaces.
33936 MUST_USE_RES struct LDKBestBlock OutputSweeper_current_best_block(const struct LDKOutputSweeper *NONNULL_PTR this_arg);
33939 * Constructs a new Listen which calls the relevant methods on this_arg.
33940 * This copies the `inner` pointer in this_arg and thus the returned Listen must be freed before this_arg is
33942 struct LDKListen OutputSweeper_as_Listen(const struct LDKOutputSweeper *NONNULL_PTR this_arg);
33945 * Constructs a new Confirm which calls the relevant methods on this_arg.
33946 * This copies the `inner` pointer in this_arg and thus the returned Confirm must be freed before this_arg is
33948 struct LDKConfirm OutputSweeper_as_Confirm(const struct LDKOutputSweeper *NONNULL_PTR this_arg);
33951 * Frees any resources used by the SpendingDelay
33953 void SpendingDelay_free(struct LDKSpendingDelay this_ptr);
33956 * Creates a copy of the SpendingDelay
33958 struct LDKSpendingDelay SpendingDelay_clone(const struct LDKSpendingDelay *NONNULL_PTR orig);
33961 * Utility method to constructs a new Relative-variant SpendingDelay
33963 struct LDKSpendingDelay SpendingDelay_relative(uint32_t num_blocks);
33966 * Utility method to constructs a new Absolute-variant SpendingDelay
33968 struct LDKSpendingDelay SpendingDelay_absolute(uint32_t height);
33971 * Read a OutputSweeper from a byte array, created by OutputSweeper_write
33973 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);
33976 * Read a C2Tuple_BestBlockOutputSweeperZ from a byte array, created by C2Tuple_BestBlockOutputSweeperZ_write
33978 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);
33981 * Calls the free function if one is set
33983 void FutureCallback_free(struct LDKFutureCallback this_ptr);
33986 * Frees any resources used by the Future, if is_owned is set and inner is non-NULL.
33988 void Future_free(struct LDKFuture this_obj);
33991 * Registers a callback to be called upon completion of this future. If the future has already
33992 * completed, the callback will be called immediately.
33994 void Future_register_callback_fn(const struct LDKFuture *NONNULL_PTR this_arg, struct LDKFutureCallback callback);
33997 * Waits until this [`Future`] completes.
33999 void Future_wait(const struct LDKFuture *NONNULL_PTR this_arg);
34002 * Waits until this [`Future`] completes or the given amount of time has elapsed.
34004 * Returns true if the [`Future`] completed, false if the time elapsed.
34006 MUST_USE_RES bool Future_wait_timeout(const struct LDKFuture *NONNULL_PTR this_arg, uint64_t max_wait);
34009 * Frees any resources used by the Sleeper, if is_owned is set and inner is non-NULL.
34011 void Sleeper_free(struct LDKSleeper this_obj);
34014 * Constructs a new sleeper from one future, allowing blocking on it.
34016 MUST_USE_RES struct LDKSleeper Sleeper_from_single_future(const struct LDKFuture *NONNULL_PTR future);
34019 * Constructs a new sleeper from two futures, allowing blocking on both at once.
34021 MUST_USE_RES struct LDKSleeper Sleeper_from_two_futures(const struct LDKFuture *NONNULL_PTR fut_a, const struct LDKFuture *NONNULL_PTR fut_b);
34024 * Constructs a new sleeper on many futures, allowing blocking on all at once.
34026 MUST_USE_RES struct LDKSleeper Sleeper_new(struct LDKCVec_FutureZ futures);
34029 * Wait until one of the [`Future`]s registered with this [`Sleeper`] has completed.
34031 void Sleeper_wait(const struct LDKSleeper *NONNULL_PTR this_arg);
34034 * Wait until one of the [`Future`]s registered with this [`Sleeper`] has completed or the
34035 * given amount of time has elapsed. Returns true if a [`Future`] completed, false if the time
34038 MUST_USE_RES bool Sleeper_wait_timeout(const struct LDKSleeper *NONNULL_PTR this_arg, uint64_t max_wait);
34041 * Creates a copy of the Level
34043 enum LDKLevel Level_clone(const enum LDKLevel *NONNULL_PTR orig);
34046 * Utility method to constructs a new Gossip-variant Level
34048 enum LDKLevel Level_gossip(void);
34051 * Utility method to constructs a new Trace-variant Level
34053 enum LDKLevel Level_trace(void);
34056 * Utility method to constructs a new Debug-variant Level
34058 enum LDKLevel Level_debug(void);
34061 * Utility method to constructs a new Info-variant Level
34063 enum LDKLevel Level_info(void);
34066 * Utility method to constructs a new Warn-variant Level
34068 enum LDKLevel Level_warn(void);
34071 * Utility method to constructs a new Error-variant Level
34073 enum LDKLevel Level_error(void);
34076 * Checks if two Levels contain equal inner contents.
34077 * This ignores pointers and is_owned flags and looks at the values in fields.
34079 bool Level_eq(const enum LDKLevel *NONNULL_PTR a, const enum LDKLevel *NONNULL_PTR b);
34082 * Generates a non-cryptographic 64-bit hash of the Level.
34084 uint64_t Level_hash(const enum LDKLevel *NONNULL_PTR o);
34087 * Get the string representation of a Level object
34089 struct LDKStr Level_to_str(const enum LDKLevel *NONNULL_PTR o);
34092 * Returns the most verbose logging level.
34094 MUST_USE_RES enum LDKLevel Level_max(void);
34097 * Frees any resources used by the Record, if is_owned is set and inner is non-NULL.
34099 void Record_free(struct LDKRecord this_obj);
34102 * The verbosity level of the message.
34104 enum LDKLevel Record_get_level(const struct LDKRecord *NONNULL_PTR this_ptr);
34107 * The verbosity level of the message.
34109 void Record_set_level(struct LDKRecord *NONNULL_PTR this_ptr, enum LDKLevel val);
34112 * The node id of the peer pertaining to the logged record.
34114 * Note that in some cases a [`Self::channel_id`] may be filled in but this may still be
34115 * `None`, depending on if the peer information is readily available in LDK when the log is
34118 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
34120 struct LDKPublicKey Record_get_peer_id(const struct LDKRecord *NONNULL_PTR this_ptr);
34123 * The node id of the peer pertaining to the logged record.
34125 * Note that in some cases a [`Self::channel_id`] may be filled in but this may still be
34126 * `None`, depending on if the peer information is readily available in LDK when the log is
34129 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
34131 void Record_set_peer_id(struct LDKRecord *NONNULL_PTR this_ptr, struct LDKPublicKey val);
34134 * The channel id of the channel pertaining to the logged record. May be a temporary id before
34135 * the channel has been funded.
34137 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
34139 struct LDKChannelId Record_get_channel_id(const struct LDKRecord *NONNULL_PTR this_ptr);
34142 * The channel id of the channel pertaining to the logged record. May be a temporary id before
34143 * the channel has been funded.
34145 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
34147 void Record_set_channel_id(struct LDKRecord *NONNULL_PTR this_ptr, struct LDKChannelId val);
34150 * The message body.
34152 struct LDKStr Record_get_args(const struct LDKRecord *NONNULL_PTR this_ptr);
34155 * The message body.
34157 void Record_set_args(struct LDKRecord *NONNULL_PTR this_ptr, struct LDKStr val);
34160 * The module path of the message.
34162 struct LDKStr Record_get_module_path(const struct LDKRecord *NONNULL_PTR this_ptr);
34165 * The module path of the message.
34167 void Record_set_module_path(struct LDKRecord *NONNULL_PTR this_ptr, struct LDKStr val);
34170 * The source file containing the message.
34172 struct LDKStr Record_get_file(const struct LDKRecord *NONNULL_PTR this_ptr);
34175 * The source file containing the message.
34177 void Record_set_file(struct LDKRecord *NONNULL_PTR this_ptr, struct LDKStr val);
34180 * The line containing the message.
34182 uint32_t Record_get_line(const struct LDKRecord *NONNULL_PTR this_ptr);
34185 * The line containing the message.
34187 void Record_set_line(struct LDKRecord *NONNULL_PTR this_ptr, uint32_t val);
34190 * Constructs a new Record given each field
34192 * Note that peer_id_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
34193 * Note that channel_id_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
34195 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);
34198 * Creates a copy of the Record
34200 struct LDKRecord Record_clone(const struct LDKRecord *NONNULL_PTR orig);
34203 * Calls the free function if one is set
34205 void Logger_free(struct LDKLogger this_ptr);
34208 * Frees any resources used by the ChannelHandshakeConfig, if is_owned is set and inner is non-NULL.
34210 void ChannelHandshakeConfig_free(struct LDKChannelHandshakeConfig this_obj);
34213 * Confirmations we will wait for before considering the channel locked in.
34214 * Applied only for inbound channels (see ChannelHandshakeLimits::max_minimum_depth for the
34215 * equivalent limit applied to outbound channels).
34217 * A lower-bound of 1 is applied, requiring all channels to have a confirmed commitment
34218 * transaction before operation. If you wish to accept channels with zero confirmations, see
34219 * [`UserConfig::manually_accept_inbound_channels`] and
34220 * [`ChannelManager::accept_inbound_channel_from_trusted_peer_0conf`].
34222 * Default value: 6.
34224 * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
34225 * [`ChannelManager::accept_inbound_channel_from_trusted_peer_0conf`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel_from_trusted_peer_0conf
34227 uint32_t ChannelHandshakeConfig_get_minimum_depth(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr);
34230 * Confirmations we will wait for before considering the channel locked in.
34231 * Applied only for inbound channels (see ChannelHandshakeLimits::max_minimum_depth for the
34232 * equivalent limit applied to outbound channels).
34234 * A lower-bound of 1 is applied, requiring all channels to have a confirmed commitment
34235 * transaction before operation. If you wish to accept channels with zero confirmations, see
34236 * [`UserConfig::manually_accept_inbound_channels`] and
34237 * [`ChannelManager::accept_inbound_channel_from_trusted_peer_0conf`].
34239 * Default value: 6.
34241 * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
34242 * [`ChannelManager::accept_inbound_channel_from_trusted_peer_0conf`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel_from_trusted_peer_0conf
34244 void ChannelHandshakeConfig_set_minimum_depth(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, uint32_t val);
34247 * Set to the number of blocks we require our counterparty to wait to claim their money (ie
34248 * the number of blocks we have to punish our counterparty if they broadcast a revoked
34251 * This is one of the main parameters of our security model. We (or one of our watchtowers) MUST
34252 * be online to check for revoked transactions on-chain at least once every our_to_self_delay
34253 * blocks (minus some margin to allow us enough time to broadcast and confirm a transaction,
34254 * possibly with time in between to RBF the spending transaction).
34256 * Meanwhile, asking for a too high delay, we bother peer to freeze funds for nothing in
34257 * case of an honest unilateral channel close, which implicitly decrease the economic value of
34260 * Default value: [`BREAKDOWN_TIMEOUT`], we enforce it as a minimum at channel opening so you
34261 * can tweak config to ask for more security, not less.
34263 uint16_t ChannelHandshakeConfig_get_our_to_self_delay(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr);
34266 * Set to the number of blocks we require our counterparty to wait to claim their money (ie
34267 * the number of blocks we have to punish our counterparty if they broadcast a revoked
34270 * This is one of the main parameters of our security model. We (or one of our watchtowers) MUST
34271 * be online to check for revoked transactions on-chain at least once every our_to_self_delay
34272 * blocks (minus some margin to allow us enough time to broadcast and confirm a transaction,
34273 * possibly with time in between to RBF the spending transaction).
34275 * Meanwhile, asking for a too high delay, we bother peer to freeze funds for nothing in
34276 * case of an honest unilateral channel close, which implicitly decrease the economic value of
34279 * Default value: [`BREAKDOWN_TIMEOUT`], we enforce it as a minimum at channel opening so you
34280 * can tweak config to ask for more security, not less.
34282 void ChannelHandshakeConfig_set_our_to_self_delay(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, uint16_t val);
34285 * Set to the smallest value HTLC we will accept to process.
34287 * This value is sent to our counterparty on channel-open and we close the channel any time
34288 * our counterparty misbehaves by sending us an HTLC with a value smaller than this.
34290 * Default value: 1. If the value is less than 1, it is ignored and set to 1, as is required
34293 uint64_t ChannelHandshakeConfig_get_our_htlc_minimum_msat(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr);
34296 * Set to the smallest value HTLC we will accept to process.
34298 * This value is sent to our counterparty on channel-open and we close the channel any time
34299 * our counterparty misbehaves by sending us an HTLC with a value smaller than this.
34301 * Default value: 1. If the value is less than 1, it is ignored and set to 1, as is required
34304 void ChannelHandshakeConfig_set_our_htlc_minimum_msat(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, uint64_t val);
34307 * Sets the percentage of the channel value we will cap the total value of outstanding inbound
34310 * This can be set to a value between 1-100, where the value corresponds to the percent of the
34311 * channel value in whole percentages.
34314 * * If configured to another value than the default value 10, any new channels created with
34315 * the non default value will cause versions of LDK prior to 0.0.104 to refuse to read the
34316 * `ChannelManager`.
34318 * * This caps the total value for inbound HTLCs in-flight only, and there's currently
34319 * no way to configure the cap for the total value of outbound HTLCs in-flight.
34321 * * The requirements for your node being online to ensure the safety of HTLC-encumbered funds
34322 * are different from the non-HTLC-encumbered funds. This makes this an important knob to
34323 * restrict exposure to loss due to being offline for too long.
34324 * See [`ChannelHandshakeConfig::our_to_self_delay`] and [`ChannelConfig::cltv_expiry_delta`]
34325 * for more information.
34327 * Default value: 10.
34328 * Minimum value: 1, any values less than 1 will be treated as 1 instead.
34329 * Maximum value: 100, any values larger than 100 will be treated as 100 instead.
34331 uint8_t ChannelHandshakeConfig_get_max_inbound_htlc_value_in_flight_percent_of_channel(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr);
34334 * Sets the percentage of the channel value we will cap the total value of outstanding inbound
34337 * This can be set to a value between 1-100, where the value corresponds to the percent of the
34338 * channel value in whole percentages.
34341 * * If configured to another value than the default value 10, any new channels created with
34342 * the non default value will cause versions of LDK prior to 0.0.104 to refuse to read the
34343 * `ChannelManager`.
34345 * * This caps the total value for inbound HTLCs in-flight only, and there's currently
34346 * no way to configure the cap for the total value of outbound HTLCs in-flight.
34348 * * The requirements for your node being online to ensure the safety of HTLC-encumbered funds
34349 * are different from the non-HTLC-encumbered funds. This makes this an important knob to
34350 * restrict exposure to loss due to being offline for too long.
34351 * See [`ChannelHandshakeConfig::our_to_self_delay`] and [`ChannelConfig::cltv_expiry_delta`]
34352 * for more information.
34354 * Default value: 10.
34355 * Minimum value: 1, any values less than 1 will be treated as 1 instead.
34356 * Maximum value: 100, any values larger than 100 will be treated as 100 instead.
34358 void ChannelHandshakeConfig_set_max_inbound_htlc_value_in_flight_percent_of_channel(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, uint8_t val);
34361 * If set, we attempt to negotiate the `scid_privacy` (referred to as `scid_alias` in the
34362 * BOLTs) option for outbound private channels. This provides better privacy by not including
34363 * our real on-chain channel UTXO in each invoice and requiring that our counterparty only
34364 * relay HTLCs to us using the channel's SCID alias.
34366 * If this option is set, channels may be created that will not be readable by LDK versions
34367 * prior to 0.0.106, causing [`ChannelManager`]'s read method to return a
34368 * [`DecodeError::InvalidValue`].
34370 * Note that setting this to true does *not* prevent us from opening channels with
34371 * counterparties that do not support the `scid_alias` option; we will simply fall back to a
34372 * private channel without that option.
34374 * Ignored if the channel is negotiated to be announced, see
34375 * [`ChannelHandshakeConfig::announced_channel`] and
34376 * [`ChannelHandshakeLimits::force_announced_channel_preference`] for more.
34378 * Default value: false. This value is likely to change to true in the future.
34380 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
34381 * [`DecodeError::InvalidValue`]: crate::ln::msgs::DecodeError::InvalidValue
34383 bool ChannelHandshakeConfig_get_negotiate_scid_privacy(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr);
34386 * If set, we attempt to negotiate the `scid_privacy` (referred to as `scid_alias` in the
34387 * BOLTs) option for outbound private channels. This provides better privacy by not including
34388 * our real on-chain channel UTXO in each invoice and requiring that our counterparty only
34389 * relay HTLCs to us using the channel's SCID alias.
34391 * If this option is set, channels may be created that will not be readable by LDK versions
34392 * prior to 0.0.106, causing [`ChannelManager`]'s read method to return a
34393 * [`DecodeError::InvalidValue`].
34395 * Note that setting this to true does *not* prevent us from opening channels with
34396 * counterparties that do not support the `scid_alias` option; we will simply fall back to a
34397 * private channel without that option.
34399 * Ignored if the channel is negotiated to be announced, see
34400 * [`ChannelHandshakeConfig::announced_channel`] and
34401 * [`ChannelHandshakeLimits::force_announced_channel_preference`] for more.
34403 * Default value: false. This value is likely to change to true in the future.
34405 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
34406 * [`DecodeError::InvalidValue`]: crate::ln::msgs::DecodeError::InvalidValue
34408 void ChannelHandshakeConfig_set_negotiate_scid_privacy(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, bool val);
34411 * Set to announce the channel publicly and notify all nodes that they can route via this
34414 * This should only be set to true for nodes which expect to be online reliably.
34416 * As the node which funds a channel picks this value this will only apply for new outbound
34417 * channels unless [`ChannelHandshakeLimits::force_announced_channel_preference`] is set.
34419 * Default value: false.
34421 bool ChannelHandshakeConfig_get_announced_channel(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr);
34424 * Set to announce the channel publicly and notify all nodes that they can route via this
34427 * This should only be set to true for nodes which expect to be online reliably.
34429 * As the node which funds a channel picks this value this will only apply for new outbound
34430 * channels unless [`ChannelHandshakeLimits::force_announced_channel_preference`] is set.
34432 * Default value: false.
34434 void ChannelHandshakeConfig_set_announced_channel(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, bool val);
34437 * When set, we commit to an upfront shutdown_pubkey at channel open. If our counterparty
34438 * supports it, they will then enforce the mutual-close output to us matches what we provided
34439 * at intialization, preventing us from closing to an alternate pubkey.
34441 * This is set to true by default to provide a slight increase in security, though ultimately
34442 * any attacker who is able to take control of a channel can just as easily send the funds via
34443 * lightning payments, so we never require that our counterparties support this option.
34445 * The upfront key committed is provided from [`SignerProvider::get_shutdown_scriptpubkey`].
34447 * Default value: true.
34449 * [`SignerProvider::get_shutdown_scriptpubkey`]: crate::sign::SignerProvider::get_shutdown_scriptpubkey
34451 bool ChannelHandshakeConfig_get_commit_upfront_shutdown_pubkey(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr);
34454 * When set, we commit to an upfront shutdown_pubkey at channel open. If our counterparty
34455 * supports it, they will then enforce the mutual-close output to us matches what we provided
34456 * at intialization, preventing us from closing to an alternate pubkey.
34458 * This is set to true by default to provide a slight increase in security, though ultimately
34459 * any attacker who is able to take control of a channel can just as easily send the funds via
34460 * lightning payments, so we never require that our counterparties support this option.
34462 * The upfront key committed is provided from [`SignerProvider::get_shutdown_scriptpubkey`].
34464 * Default value: true.
34466 * [`SignerProvider::get_shutdown_scriptpubkey`]: crate::sign::SignerProvider::get_shutdown_scriptpubkey
34468 void ChannelHandshakeConfig_set_commit_upfront_shutdown_pubkey(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, bool val);
34471 * The Proportion of the channel value to configure as counterparty's channel reserve,
34472 * i.e., `their_channel_reserve_satoshis` for both outbound and inbound channels.
34474 * `their_channel_reserve_satoshis` is the minimum balance that the other node has to maintain
34475 * on their side, at all times.
34476 * This ensures that if our counterparty broadcasts a revoked state, we can punish them by
34477 * claiming at least this value on chain.
34479 * Channel reserve values greater than 30% could be considered highly unreasonable, since that
34480 * amount can never be used for payments.
34481 * Also, if our selected channel reserve for counterparty and counterparty's selected
34482 * channel reserve for us sum up to equal or greater than channel value, channel negotiations
34485 * Note: Versions of LDK earlier than v0.0.104 will fail to read channels with any channel reserve
34486 * other than the default value.
34488 * Default value: 1% of channel value, i.e., configured as 10,000 millionths.
34489 * Minimum value: If the calculated proportional value is less than 1000 sats, it will be treated
34490 * as 1000 sats instead, which is a safe implementation-specific lower bound.
34491 * Maximum value: 1,000,000, any values larger than 1 Million will be treated as 1 Million (or 100%)
34492 * instead, although channel negotiations will fail in that case.
34494 uint32_t ChannelHandshakeConfig_get_their_channel_reserve_proportional_millionths(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr);
34497 * The Proportion of the channel value to configure as counterparty's channel reserve,
34498 * i.e., `their_channel_reserve_satoshis` for both outbound and inbound channels.
34500 * `their_channel_reserve_satoshis` is the minimum balance that the other node has to maintain
34501 * on their side, at all times.
34502 * This ensures that if our counterparty broadcasts a revoked state, we can punish them by
34503 * claiming at least this value on chain.
34505 * Channel reserve values greater than 30% could be considered highly unreasonable, since that
34506 * amount can never be used for payments.
34507 * Also, if our selected channel reserve for counterparty and counterparty's selected
34508 * channel reserve for us sum up to equal or greater than channel value, channel negotiations
34511 * Note: Versions of LDK earlier than v0.0.104 will fail to read channels with any channel reserve
34512 * other than the default value.
34514 * Default value: 1% of channel value, i.e., configured as 10,000 millionths.
34515 * Minimum value: If the calculated proportional value is less than 1000 sats, it will be treated
34516 * as 1000 sats instead, which is a safe implementation-specific lower bound.
34517 * Maximum value: 1,000,000, any values larger than 1 Million will be treated as 1 Million (or 100%)
34518 * instead, although channel negotiations will fail in that case.
34520 void ChannelHandshakeConfig_set_their_channel_reserve_proportional_millionths(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, uint32_t val);
34523 * If set, we attempt to negotiate the `anchors_zero_fee_htlc_tx`option for all future
34524 * channels. This feature requires having a reserve of onchain funds readily available to bump
34525 * transactions in the event of a channel force close to avoid the possibility of losing funds.
34527 * Note that if you wish accept inbound channels with anchor outputs, you must enable
34528 * [`UserConfig::manually_accept_inbound_channels`] and manually accept them with
34529 * [`ChannelManager::accept_inbound_channel`]. This is done to give you the chance to check
34530 * whether your reserve of onchain funds is enough to cover the fees for all existing and new
34531 * channels featuring anchor outputs in the event of a force close.
34533 * If this option is set, channels may be created that will not be readable by LDK versions
34534 * prior to 0.0.116, causing [`ChannelManager`]'s read method to return a
34535 * [`DecodeError::InvalidValue`].
34537 * Note that setting this to true does *not* prevent us from opening channels with
34538 * counterparties that do not support the `anchors_zero_fee_htlc_tx` option; we will simply
34539 * fall back to a `static_remote_key` channel.
34541 * LDK will not support the legacy `option_anchors` commitment version due to a discovered
34542 * vulnerability after its deployment. For more context, see the [`SIGHASH_SINGLE + update_fee
34543 * Considered Harmful`] mailing list post.
34545 * Default value: false. This value is likely to change to true in the future.
34547 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
34548 * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
34549 * [`DecodeError::InvalidValue`]: crate::ln::msgs::DecodeError::InvalidValue
34550 * [`SIGHASH_SINGLE + update_fee Considered Harmful`]: https://lists.linuxfoundation.org/pipermail/lightning-dev/2020-September/002796.html
34552 bool ChannelHandshakeConfig_get_negotiate_anchors_zero_fee_htlc_tx(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr);
34555 * If set, we attempt to negotiate the `anchors_zero_fee_htlc_tx`option for all future
34556 * channels. This feature requires having a reserve of onchain funds readily available to bump
34557 * transactions in the event of a channel force close to avoid the possibility of losing funds.
34559 * Note that if you wish accept inbound channels with anchor outputs, you must enable
34560 * [`UserConfig::manually_accept_inbound_channels`] and manually accept them with
34561 * [`ChannelManager::accept_inbound_channel`]. This is done to give you the chance to check
34562 * whether your reserve of onchain funds is enough to cover the fees for all existing and new
34563 * channels featuring anchor outputs in the event of a force close.
34565 * If this option is set, channels may be created that will not be readable by LDK versions
34566 * prior to 0.0.116, causing [`ChannelManager`]'s read method to return a
34567 * [`DecodeError::InvalidValue`].
34569 * Note that setting this to true does *not* prevent us from opening channels with
34570 * counterparties that do not support the `anchors_zero_fee_htlc_tx` option; we will simply
34571 * fall back to a `static_remote_key` channel.
34573 * LDK will not support the legacy `option_anchors` commitment version due to a discovered
34574 * vulnerability after its deployment. For more context, see the [`SIGHASH_SINGLE + update_fee
34575 * Considered Harmful`] mailing list post.
34577 * Default value: false. This value is likely to change to true in the future.
34579 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
34580 * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
34581 * [`DecodeError::InvalidValue`]: crate::ln::msgs::DecodeError::InvalidValue
34582 * [`SIGHASH_SINGLE + update_fee Considered Harmful`]: https://lists.linuxfoundation.org/pipermail/lightning-dev/2020-September/002796.html
34584 void ChannelHandshakeConfig_set_negotiate_anchors_zero_fee_htlc_tx(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, bool val);
34587 * The maximum number of HTLCs in-flight from our counterparty towards us at the same time.
34589 * Increasing the value can help improve liquidity and stability in
34590 * routing at the cost of higher long term disk / DB usage.
34592 * Note: Versions of LDK earlier than v0.0.115 will fail to read channels with a configuration
34593 * other than the default value.
34595 * Default value: 50
34596 * Maximum value: 483, any values larger will be treated as 483.
34597 * This is the BOLT #2 spec limit on `max_accepted_htlcs`.
34599 uint16_t ChannelHandshakeConfig_get_our_max_accepted_htlcs(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr);
34602 * The maximum number of HTLCs in-flight from our counterparty towards us at the same time.
34604 * Increasing the value can help improve liquidity and stability in
34605 * routing at the cost of higher long term disk / DB usage.
34607 * Note: Versions of LDK earlier than v0.0.115 will fail to read channels with a configuration
34608 * other than the default value.
34610 * Default value: 50
34611 * Maximum value: 483, any values larger will be treated as 483.
34612 * This is the BOLT #2 spec limit on `max_accepted_htlcs`.
34614 void ChannelHandshakeConfig_set_our_max_accepted_htlcs(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, uint16_t val);
34617 * Constructs a new ChannelHandshakeConfig given each field
34619 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);
34622 * Creates a copy of the ChannelHandshakeConfig
34624 struct LDKChannelHandshakeConfig ChannelHandshakeConfig_clone(const struct LDKChannelHandshakeConfig *NONNULL_PTR orig);
34627 * Creates a "default" ChannelHandshakeConfig. See struct and individual field documentaiton for details on which values are used.
34629 MUST_USE_RES struct LDKChannelHandshakeConfig ChannelHandshakeConfig_default(void);
34632 * Frees any resources used by the ChannelHandshakeLimits, if is_owned is set and inner is non-NULL.
34634 void ChannelHandshakeLimits_free(struct LDKChannelHandshakeLimits this_obj);
34637 * Minimum allowed satoshis when a channel is funded. This is supplied by the sender and so
34638 * only applies to inbound channels.
34640 * Default value: 0.
34642 uint64_t ChannelHandshakeLimits_get_min_funding_satoshis(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
34645 * Minimum allowed satoshis when a channel is funded. This is supplied by the sender and so
34646 * only applies to inbound channels.
34648 * Default value: 0.
34650 void ChannelHandshakeLimits_set_min_funding_satoshis(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint64_t val);
34653 * Maximum allowed satoshis when a channel is funded. This is supplied by the sender and so
34654 * only applies to inbound channels.
34656 * Default value: 2^24 - 1.
34658 uint64_t ChannelHandshakeLimits_get_max_funding_satoshis(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
34661 * Maximum allowed satoshis when a channel is funded. This is supplied by the sender and so
34662 * only applies to inbound channels.
34664 * Default value: 2^24 - 1.
34666 void ChannelHandshakeLimits_set_max_funding_satoshis(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint64_t val);
34669 * The remote node sets a limit on the minimum size of HTLCs we can send to them. This allows
34670 * you to limit the maximum minimum-size they can require.
34672 * Default value: u64::max_value.
34674 uint64_t ChannelHandshakeLimits_get_max_htlc_minimum_msat(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
34677 * The remote node sets a limit on the minimum size of HTLCs we can send to them. This allows
34678 * you to limit the maximum minimum-size they can require.
34680 * Default value: u64::max_value.
34682 void ChannelHandshakeLimits_set_max_htlc_minimum_msat(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint64_t val);
34685 * The remote node sets a limit on the maximum value of pending HTLCs to them at any given
34686 * time to limit their funds exposure to HTLCs. This allows you to set a minimum such value.
34688 * Default value: 0.
34690 uint64_t ChannelHandshakeLimits_get_min_max_htlc_value_in_flight_msat(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
34693 * The remote node sets a limit on the maximum value of pending HTLCs to them at any given
34694 * time to limit their funds exposure to HTLCs. This allows you to set a minimum such value.
34696 * Default value: 0.
34698 void ChannelHandshakeLimits_set_min_max_htlc_value_in_flight_msat(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint64_t val);
34701 * The remote node will require we keep a certain amount in direct payment to ourselves at all
34702 * time, ensuring that we are able to be punished if we broadcast an old state. This allows to
34703 * you limit the amount which we will have to keep to ourselves (and cannot use for HTLCs).
34705 * Default value: u64::max_value.
34707 uint64_t ChannelHandshakeLimits_get_max_channel_reserve_satoshis(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
34710 * The remote node will require we keep a certain amount in direct payment to ourselves at all
34711 * time, ensuring that we are able to be punished if we broadcast an old state. This allows to
34712 * you limit the amount which we will have to keep to ourselves (and cannot use for HTLCs).
34714 * Default value: u64::max_value.
34716 void ChannelHandshakeLimits_set_max_channel_reserve_satoshis(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint64_t val);
34719 * The remote node sets a limit on the maximum number of pending HTLCs to them at any given
34720 * time. This allows you to set a minimum such value.
34722 * Default value: 0.
34724 uint16_t ChannelHandshakeLimits_get_min_max_accepted_htlcs(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
34727 * The remote node sets a limit on the maximum number of pending HTLCs to them at any given
34728 * time. This allows you to set a minimum such value.
34730 * Default value: 0.
34732 void ChannelHandshakeLimits_set_min_max_accepted_htlcs(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint16_t val);
34735 * Before a channel is usable the funding transaction will need to be confirmed by at least a
34736 * certain number of blocks, specified by the node which is not the funder (as the funder can
34737 * assume they aren't going to double-spend themselves).
34738 * This config allows you to set a limit on the maximum amount of time to wait.
34740 * Default value: 144, or roughly one day and only applies to outbound channels.
34742 uint32_t ChannelHandshakeLimits_get_max_minimum_depth(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
34745 * Before a channel is usable the funding transaction will need to be confirmed by at least a
34746 * certain number of blocks, specified by the node which is not the funder (as the funder can
34747 * assume they aren't going to double-spend themselves).
34748 * This config allows you to set a limit on the maximum amount of time to wait.
34750 * Default value: 144, or roughly one day and only applies to outbound channels.
34752 void ChannelHandshakeLimits_set_max_minimum_depth(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint32_t val);
34755 * Whether we implicitly trust funding transactions generated by us for our own outbound
34756 * channels to not be double-spent.
34758 * If this is set, we assume that our own funding transactions are *never* double-spent, and
34759 * thus we can trust them without any confirmations. This is generally a reasonable
34760 * assumption, given we're the only ones who could ever double-spend it (assuming we have sole
34761 * control of the signing keys).
34763 * You may wish to un-set this if you allow the user to (or do in an automated fashion)
34764 * double-spend the funding transaction to RBF with an alternative channel open.
34766 * This only applies if our counterparty set their confirmations-required value to 0, and we
34767 * always trust our own funding transaction at 1 confirmation irrespective of this value.
34768 * Thus, this effectively acts as a `min_minimum_depth`, with the only possible values being
34769 * `true` (0) and `false` (1).
34771 * Default value: true
34773 bool ChannelHandshakeLimits_get_trust_own_funding_0conf(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
34776 * Whether we implicitly trust funding transactions generated by us for our own outbound
34777 * channels to not be double-spent.
34779 * If this is set, we assume that our own funding transactions are *never* double-spent, and
34780 * thus we can trust them without any confirmations. This is generally a reasonable
34781 * assumption, given we're the only ones who could ever double-spend it (assuming we have sole
34782 * control of the signing keys).
34784 * You may wish to un-set this if you allow the user to (or do in an automated fashion)
34785 * double-spend the funding transaction to RBF with an alternative channel open.
34787 * This only applies if our counterparty set their confirmations-required value to 0, and we
34788 * always trust our own funding transaction at 1 confirmation irrespective of this value.
34789 * Thus, this effectively acts as a `min_minimum_depth`, with the only possible values being
34790 * `true` (0) and `false` (1).
34792 * Default value: true
34794 void ChannelHandshakeLimits_set_trust_own_funding_0conf(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, bool val);
34797 * Set to force an incoming channel to match our announced channel preference in
34798 * [`ChannelHandshakeConfig::announced_channel`].
34800 * For a node which is not online reliably, this should be set to true and
34801 * [`ChannelHandshakeConfig::announced_channel`] set to false, ensuring that no announced (aka public)
34802 * channels will ever be opened.
34804 * Default value: true.
34806 bool ChannelHandshakeLimits_get_force_announced_channel_preference(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
34809 * Set to force an incoming channel to match our announced channel preference in
34810 * [`ChannelHandshakeConfig::announced_channel`].
34812 * For a node which is not online reliably, this should be set to true and
34813 * [`ChannelHandshakeConfig::announced_channel`] set to false, ensuring that no announced (aka public)
34814 * channels will ever be opened.
34816 * Default value: true.
34818 void ChannelHandshakeLimits_set_force_announced_channel_preference(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, bool val);
34821 * Set to the amount of time we're willing to wait to claim money back to us.
34823 * Not checking this value would be a security issue, as our peer would be able to set it to
34824 * max relative lock-time (a year) and we would \"lose\" money as it would be locked for a long time.
34826 * Default value: 2016, which we also enforce as a maximum value so you can tweak config to
34827 * reduce the loss of having useless locked funds (if your peer accepts)
34829 uint16_t ChannelHandshakeLimits_get_their_to_self_delay(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
34832 * Set to the amount of time we're willing to wait to claim money back to us.
34834 * Not checking this value would be a security issue, as our peer would be able to set it to
34835 * max relative lock-time (a year) and we would \"lose\" money as it would be locked for a long time.
34837 * Default value: 2016, which we also enforce as a maximum value so you can tweak config to
34838 * reduce the loss of having useless locked funds (if your peer accepts)
34840 void ChannelHandshakeLimits_set_their_to_self_delay(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint16_t val);
34843 * Constructs a new ChannelHandshakeLimits given each field
34845 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);
34848 * Creates a copy of the ChannelHandshakeLimits
34850 struct LDKChannelHandshakeLimits ChannelHandshakeLimits_clone(const struct LDKChannelHandshakeLimits *NONNULL_PTR orig);
34853 * Creates a "default" ChannelHandshakeLimits. See struct and individual field documentaiton for details on which values are used.
34855 MUST_USE_RES struct LDKChannelHandshakeLimits ChannelHandshakeLimits_default(void);
34858 * Frees any resources used by the MaxDustHTLCExposure
34860 void MaxDustHTLCExposure_free(struct LDKMaxDustHTLCExposure this_ptr);
34863 * Creates a copy of the MaxDustHTLCExposure
34865 struct LDKMaxDustHTLCExposure MaxDustHTLCExposure_clone(const struct LDKMaxDustHTLCExposure *NONNULL_PTR orig);
34868 * Utility method to constructs a new FixedLimitMsat-variant MaxDustHTLCExposure
34870 struct LDKMaxDustHTLCExposure MaxDustHTLCExposure_fixed_limit_msat(uint64_t a);
34873 * Utility method to constructs a new FeeRateMultiplier-variant MaxDustHTLCExposure
34875 struct LDKMaxDustHTLCExposure MaxDustHTLCExposure_fee_rate_multiplier(uint64_t a);
34878 * Checks if two MaxDustHTLCExposures contain equal inner contents.
34879 * This ignores pointers and is_owned flags and looks at the values in fields.
34881 bool MaxDustHTLCExposure_eq(const struct LDKMaxDustHTLCExposure *NONNULL_PTR a, const struct LDKMaxDustHTLCExposure *NONNULL_PTR b);
34884 * Serialize the MaxDustHTLCExposure object into a byte array which can be read by MaxDustHTLCExposure_read
34886 struct LDKCVec_u8Z MaxDustHTLCExposure_write(const struct LDKMaxDustHTLCExposure *NONNULL_PTR obj);
34889 * Read a MaxDustHTLCExposure from a byte array, created by MaxDustHTLCExposure_write
34891 struct LDKCResult_MaxDustHTLCExposureDecodeErrorZ MaxDustHTLCExposure_read(struct LDKu8slice ser);
34894 * Frees any resources used by the ChannelConfig, if is_owned is set and inner is non-NULL.
34896 void ChannelConfig_free(struct LDKChannelConfig this_obj);
34899 * Amount (in millionths of a satoshi) charged per satoshi for payments forwarded outbound
34900 * over the channel.
34901 * This may be allowed to change at runtime in a later update, however doing so must result in
34902 * update messages sent to notify all nodes of our updated relay fee.
34904 * Default value: 0.
34906 uint32_t ChannelConfig_get_forwarding_fee_proportional_millionths(const struct LDKChannelConfig *NONNULL_PTR this_ptr);
34909 * Amount (in millionths of a satoshi) charged per satoshi for payments forwarded outbound
34910 * over the channel.
34911 * This may be allowed to change at runtime in a later update, however doing so must result in
34912 * update messages sent to notify all nodes of our updated relay fee.
34914 * Default value: 0.
34916 void ChannelConfig_set_forwarding_fee_proportional_millionths(struct LDKChannelConfig *NONNULL_PTR this_ptr, uint32_t val);
34919 * Amount (in milli-satoshi) charged for payments forwarded outbound over the channel, in
34920 * excess of [`forwarding_fee_proportional_millionths`].
34921 * This may be allowed to change at runtime in a later update, however doing so must result in
34922 * update messages sent to notify all nodes of our updated relay fee.
34924 * The default value of a single satoshi roughly matches the market rate on many routing nodes
34925 * as of July 2021. Adjusting it upwards or downwards may change whether nodes route through
34928 * Default value: 1000.
34930 * [`forwarding_fee_proportional_millionths`]: ChannelConfig::forwarding_fee_proportional_millionths
34932 uint32_t ChannelConfig_get_forwarding_fee_base_msat(const struct LDKChannelConfig *NONNULL_PTR this_ptr);
34935 * Amount (in milli-satoshi) charged for payments forwarded outbound over the channel, in
34936 * excess of [`forwarding_fee_proportional_millionths`].
34937 * This may be allowed to change at runtime in a later update, however doing so must result in
34938 * update messages sent to notify all nodes of our updated relay fee.
34940 * The default value of a single satoshi roughly matches the market rate on many routing nodes
34941 * as of July 2021. Adjusting it upwards or downwards may change whether nodes route through
34944 * Default value: 1000.
34946 * [`forwarding_fee_proportional_millionths`]: ChannelConfig::forwarding_fee_proportional_millionths
34948 void ChannelConfig_set_forwarding_fee_base_msat(struct LDKChannelConfig *NONNULL_PTR this_ptr, uint32_t val);
34951 * The difference in the CLTV value between incoming HTLCs and an outbound HTLC forwarded over
34952 * the channel this config applies to.
34954 * This is analogous to [`ChannelHandshakeConfig::our_to_self_delay`] but applies to in-flight
34955 * HTLC balance when a channel appears on-chain whereas
34956 * [`ChannelHandshakeConfig::our_to_self_delay`] applies to the remaining
34957 * (non-HTLC-encumbered) balance.
34959 * Thus, for HTLC-encumbered balances to be enforced on-chain when a channel is force-closed,
34960 * we (or one of our watchtowers) MUST be online to check for broadcast of the current
34961 * commitment transaction at least once per this many blocks (minus some margin to allow us
34962 * enough time to broadcast and confirm a transaction, possibly with time in between to RBF
34963 * the spending transaction).
34965 * Default value: 72 (12 hours at an average of 6 blocks/hour).
34966 * Minimum value: [`MIN_CLTV_EXPIRY_DELTA`], any values less than this will be treated as
34967 * [`MIN_CLTV_EXPIRY_DELTA`] instead.
34969 * [`MIN_CLTV_EXPIRY_DELTA`]: crate::ln::channelmanager::MIN_CLTV_EXPIRY_DELTA
34971 uint16_t ChannelConfig_get_cltv_expiry_delta(const struct LDKChannelConfig *NONNULL_PTR this_ptr);
34974 * The difference in the CLTV value between incoming HTLCs and an outbound HTLC forwarded over
34975 * the channel this config applies to.
34977 * This is analogous to [`ChannelHandshakeConfig::our_to_self_delay`] but applies to in-flight
34978 * HTLC balance when a channel appears on-chain whereas
34979 * [`ChannelHandshakeConfig::our_to_self_delay`] applies to the remaining
34980 * (non-HTLC-encumbered) balance.
34982 * Thus, for HTLC-encumbered balances to be enforced on-chain when a channel is force-closed,
34983 * we (or one of our watchtowers) MUST be online to check for broadcast of the current
34984 * commitment transaction at least once per this many blocks (minus some margin to allow us
34985 * enough time to broadcast and confirm a transaction, possibly with time in between to RBF
34986 * the spending transaction).
34988 * Default value: 72 (12 hours at an average of 6 blocks/hour).
34989 * Minimum value: [`MIN_CLTV_EXPIRY_DELTA`], any values less than this will be treated as
34990 * [`MIN_CLTV_EXPIRY_DELTA`] instead.
34992 * [`MIN_CLTV_EXPIRY_DELTA`]: crate::ln::channelmanager::MIN_CLTV_EXPIRY_DELTA
34994 void ChannelConfig_set_cltv_expiry_delta(struct LDKChannelConfig *NONNULL_PTR this_ptr, uint16_t val);
34997 * Limit our total exposure to potential loss to on-chain fees on close, including in-flight
34998 * HTLCs which are burned to fees as they are too small to claim on-chain and fees on
34999 * commitment transaction(s) broadcasted by our counterparty in excess of our own fee estimate.
35001 * # HTLC-based Dust Exposure
35003 * When an HTLC present in one of our channels is below a \"dust\" threshold, the HTLC will
35004 * not be claimable on-chain, instead being turned into additional miner fees if either
35005 * party force-closes the channel. Because the threshold is per-HTLC, our total exposure
35006 * to such payments may be substantial if there are many dust HTLCs present when the
35007 * channel is force-closed.
35009 * The dust threshold for each HTLC is based on the `dust_limit_satoshis` for each party in a
35010 * channel negotiated throughout the channel open process, along with the fees required to have
35011 * a broadcastable HTLC spending transaction. When a channel supports anchor outputs
35012 * (specifically the zero fee HTLC transaction variant), this threshold no longer takes into
35013 * account the HTLC transaction fee as it is zero. Because of this, you may want to set this
35014 * value to a fixed limit for channels using anchor outputs, while the fee rate multiplier
35015 * variant is primarily intended for use with pre-anchor channels.
35017 * The selected limit is applied for sent, forwarded, and received HTLCs and limits the total
35018 * exposure across all three types per-channel.
35020 * # Transaction Fee Dust Exposure
35022 * Further, counterparties broadcasting a commitment transaction in a force-close may result
35023 * in other balance being burned to fees, and thus all fees on commitment and HTLC
35024 * transactions in excess of our local fee estimates are included in the dust calculation.
35026 * Because of this, another way to look at this limit is to divide it by 43,000 (or 218,750
35027 * for non-anchor channels) and see it as the maximum feerate disagreement (in sats/vB) per
35028 * non-dust HTLC we're allowed to have with our peers before risking a force-closure for
35029 * inbound channels.
35031 * Thus, for the default value of 10_000 * a current feerate estimate of 10 sat/vB (or 2,500
35032 * sat/KW), we risk force-closure if we disagree with our peer by:
35033 * * `10_000 * 2_500 / 43_000 / (483*2)` = 0.6 sat/vB for anchor channels with 483 HTLCs in
35034 * both directions (the maximum),
35035 * * `10_000 * 2_500 / 43_000 / (50*2)` = 5.8 sat/vB for anchor channels with 50 HTLCs in both
35036 * directions (the LDK default max from [`ChannelHandshakeConfig::our_max_accepted_htlcs`])
35037 * * `10_000 * 2_500 / 218_750 / (483*2)` = 0.1 sat/vB for non-anchor channels with 483 HTLCs
35038 * in both directions (the maximum),
35039 * * `10_000 * 2_500 / 218_750 / (50*2)` = 1.1 sat/vB for non-anchor channels with 50 HTLCs
35040 * in both (the LDK default maximum from [`ChannelHandshakeConfig::our_max_accepted_htlcs`])
35042 * Note that when using [`MaxDustHTLCExposure::FeeRateMultiplier`] this maximum disagreement
35043 * will scale linearly with increases (or decreases) in the our feerate estimates. Further,
35044 * for anchor channels we expect our counterparty to use a relatively low feerate estimate
35045 * while we use [`ConfirmationTarget::OnChainSweep`] (which should be relatively high) and
35046 * feerate disagreement force-closures should only occur when theirs is higher than ours.
35048 * Default value: [`MaxDustHTLCExposure::FeeRateMultiplier`] with a multiplier of 10_000.
35050 * [`ConfirmationTarget::OnChainSweep`]: crate::chain::chaininterface::ConfirmationTarget::OnChainSweep
35052 struct LDKMaxDustHTLCExposure ChannelConfig_get_max_dust_htlc_exposure(const struct LDKChannelConfig *NONNULL_PTR this_ptr);
35055 * Limit our total exposure to potential loss to on-chain fees on close, including in-flight
35056 * HTLCs which are burned to fees as they are too small to claim on-chain and fees on
35057 * commitment transaction(s) broadcasted by our counterparty in excess of our own fee estimate.
35059 * # HTLC-based Dust Exposure
35061 * When an HTLC present in one of our channels is below a \"dust\" threshold, the HTLC will
35062 * not be claimable on-chain, instead being turned into additional miner fees if either
35063 * party force-closes the channel. Because the threshold is per-HTLC, our total exposure
35064 * to such payments may be substantial if there are many dust HTLCs present when the
35065 * channel is force-closed.
35067 * The dust threshold for each HTLC is based on the `dust_limit_satoshis` for each party in a
35068 * channel negotiated throughout the channel open process, along with the fees required to have
35069 * a broadcastable HTLC spending transaction. When a channel supports anchor outputs
35070 * (specifically the zero fee HTLC transaction variant), this threshold no longer takes into
35071 * account the HTLC transaction fee as it is zero. Because of this, you may want to set this
35072 * value to a fixed limit for channels using anchor outputs, while the fee rate multiplier
35073 * variant is primarily intended for use with pre-anchor channels.
35075 * The selected limit is applied for sent, forwarded, and received HTLCs and limits the total
35076 * exposure across all three types per-channel.
35078 * # Transaction Fee Dust Exposure
35080 * Further, counterparties broadcasting a commitment transaction in a force-close may result
35081 * in other balance being burned to fees, and thus all fees on commitment and HTLC
35082 * transactions in excess of our local fee estimates are included in the dust calculation.
35084 * Because of this, another way to look at this limit is to divide it by 43,000 (or 218,750
35085 * for non-anchor channels) and see it as the maximum feerate disagreement (in sats/vB) per
35086 * non-dust HTLC we're allowed to have with our peers before risking a force-closure for
35087 * inbound channels.
35089 * Thus, for the default value of 10_000 * a current feerate estimate of 10 sat/vB (or 2,500
35090 * sat/KW), we risk force-closure if we disagree with our peer by:
35091 * * `10_000 * 2_500 / 43_000 / (483*2)` = 0.6 sat/vB for anchor channels with 483 HTLCs in
35092 * both directions (the maximum),
35093 * * `10_000 * 2_500 / 43_000 / (50*2)` = 5.8 sat/vB for anchor channels with 50 HTLCs in both
35094 * directions (the LDK default max from [`ChannelHandshakeConfig::our_max_accepted_htlcs`])
35095 * * `10_000 * 2_500 / 218_750 / (483*2)` = 0.1 sat/vB for non-anchor channels with 483 HTLCs
35096 * in both directions (the maximum),
35097 * * `10_000 * 2_500 / 218_750 / (50*2)` = 1.1 sat/vB for non-anchor channels with 50 HTLCs
35098 * in both (the LDK default maximum from [`ChannelHandshakeConfig::our_max_accepted_htlcs`])
35100 * Note that when using [`MaxDustHTLCExposure::FeeRateMultiplier`] this maximum disagreement
35101 * will scale linearly with increases (or decreases) in the our feerate estimates. Further,
35102 * for anchor channels we expect our counterparty to use a relatively low feerate estimate
35103 * while we use [`ConfirmationTarget::OnChainSweep`] (which should be relatively high) and
35104 * feerate disagreement force-closures should only occur when theirs is higher than ours.
35106 * Default value: [`MaxDustHTLCExposure::FeeRateMultiplier`] with a multiplier of 10_000.
35108 * [`ConfirmationTarget::OnChainSweep`]: crate::chain::chaininterface::ConfirmationTarget::OnChainSweep
35110 void ChannelConfig_set_max_dust_htlc_exposure(struct LDKChannelConfig *NONNULL_PTR this_ptr, struct LDKMaxDustHTLCExposure val);
35113 * The additional fee we're willing to pay to avoid waiting for the counterparty's
35114 * `to_self_delay` to reclaim funds.
35116 * When we close a channel cooperatively with our counterparty, we negotiate a fee for the
35117 * closing transaction which both sides find acceptable, ultimately paid by the channel
35118 * funder/initiator.
35120 * When we are the funder, because we have to pay the channel closing fee, we bound the
35121 * acceptable fee by our [`ChannelCloseMinimum`] and [`NonAnchorChannelFee`] fees, with the upper bound increased by
35122 * this value. Because the on-chain fee we'd pay to force-close the channel is kept near our
35123 * [`NonAnchorChannelFee`] feerate during normal operation, this value represents the additional fee we're
35124 * willing to pay in order to avoid waiting for our counterparty's to_self_delay to reclaim our
35127 * When we are not the funder, we require the closing transaction fee pay at least our
35128 * [`ChannelCloseMinimum`] fee estimate, but allow our counterparty to pay as much fee as they like.
35129 * Thus, this value is ignored when we are not the funder.
35131 * Default value: 1000 satoshis.
35133 * [`NonAnchorChannelFee`]: crate::chain::chaininterface::ConfirmationTarget::NonAnchorChannelFee
35134 * [`ChannelCloseMinimum`]: crate::chain::chaininterface::ConfirmationTarget::ChannelCloseMinimum
35136 uint64_t ChannelConfig_get_force_close_avoidance_max_fee_satoshis(const struct LDKChannelConfig *NONNULL_PTR this_ptr);
35139 * The additional fee we're willing to pay to avoid waiting for the counterparty's
35140 * `to_self_delay` to reclaim funds.
35142 * When we close a channel cooperatively with our counterparty, we negotiate a fee for the
35143 * closing transaction which both sides find acceptable, ultimately paid by the channel
35144 * funder/initiator.
35146 * When we are the funder, because we have to pay the channel closing fee, we bound the
35147 * acceptable fee by our [`ChannelCloseMinimum`] and [`NonAnchorChannelFee`] fees, with the upper bound increased by
35148 * this value. Because the on-chain fee we'd pay to force-close the channel is kept near our
35149 * [`NonAnchorChannelFee`] feerate during normal operation, this value represents the additional fee we're
35150 * willing to pay in order to avoid waiting for our counterparty's to_self_delay to reclaim our
35153 * When we are not the funder, we require the closing transaction fee pay at least our
35154 * [`ChannelCloseMinimum`] fee estimate, but allow our counterparty to pay as much fee as they like.
35155 * Thus, this value is ignored when we are not the funder.
35157 * Default value: 1000 satoshis.
35159 * [`NonAnchorChannelFee`]: crate::chain::chaininterface::ConfirmationTarget::NonAnchorChannelFee
35160 * [`ChannelCloseMinimum`]: crate::chain::chaininterface::ConfirmationTarget::ChannelCloseMinimum
35162 void ChannelConfig_set_force_close_avoidance_max_fee_satoshis(struct LDKChannelConfig *NONNULL_PTR this_ptr, uint64_t val);
35165 * If set, allows this channel's counterparty to skim an additional fee off this node's inbound
35166 * HTLCs. Useful for liquidity providers to offload on-chain channel costs to end users.
35169 * - The payee will set this option and set its invoice route hints to use [intercept scids]
35170 * generated by this channel's counterparty.
35171 * - The counterparty will get an [`HTLCIntercepted`] event upon payment forward, and call
35172 * [`forward_intercepted_htlc`] with less than the amount provided in
35173 * [`HTLCIntercepted::expected_outbound_amount_msat`]. The difference between the expected and
35174 * actual forward amounts is their fee. See
35175 * <https://github.com/BitcoinAndLightningLayerSpecs/lsp/tree/main/LSPS2#flow-lsp-trusts-client-model>
35176 * for how this feature may be used in the LSP use case.
35179 * It's important for payee wallet software to verify that [`PaymentClaimable::amount_msat`] is
35180 * as-expected if this feature is activated, otherwise they may lose money!
35181 * [`PaymentClaimable::counterparty_skimmed_fee_msat`] provides the fee taken by the
35185 * Switching this config flag on may break compatibility with versions of LDK prior to 0.0.116.
35186 * Unsetting this flag between restarts may lead to payment receive failures.
35188 * Default value: false.
35190 * [intercept scids]: crate::ln::channelmanager::ChannelManager::get_intercept_scid
35191 * [`forward_intercepted_htlc`]: crate::ln::channelmanager::ChannelManager::forward_intercepted_htlc
35192 * [`HTLCIntercepted`]: crate::events::Event::HTLCIntercepted
35193 * [`HTLCIntercepted::expected_outbound_amount_msat`]: crate::events::Event::HTLCIntercepted::expected_outbound_amount_msat
35194 * [`PaymentClaimable::amount_msat`]: crate::events::Event::PaymentClaimable::amount_msat
35195 * [`PaymentClaimable::counterparty_skimmed_fee_msat`]: crate::events::Event::PaymentClaimable::counterparty_skimmed_fee_msat
35197 bool ChannelConfig_get_accept_underpaying_htlcs(const struct LDKChannelConfig *NONNULL_PTR this_ptr);
35200 * If set, allows this channel's counterparty to skim an additional fee off this node's inbound
35201 * HTLCs. Useful for liquidity providers to offload on-chain channel costs to end users.
35204 * - The payee will set this option and set its invoice route hints to use [intercept scids]
35205 * generated by this channel's counterparty.
35206 * - The counterparty will get an [`HTLCIntercepted`] event upon payment forward, and call
35207 * [`forward_intercepted_htlc`] with less than the amount provided in
35208 * [`HTLCIntercepted::expected_outbound_amount_msat`]. The difference between the expected and
35209 * actual forward amounts is their fee. See
35210 * <https://github.com/BitcoinAndLightningLayerSpecs/lsp/tree/main/LSPS2#flow-lsp-trusts-client-model>
35211 * for how this feature may be used in the LSP use case.
35214 * It's important for payee wallet software to verify that [`PaymentClaimable::amount_msat`] is
35215 * as-expected if this feature is activated, otherwise they may lose money!
35216 * [`PaymentClaimable::counterparty_skimmed_fee_msat`] provides the fee taken by the
35220 * Switching this config flag on may break compatibility with versions of LDK prior to 0.0.116.
35221 * Unsetting this flag between restarts may lead to payment receive failures.
35223 * Default value: false.
35225 * [intercept scids]: crate::ln::channelmanager::ChannelManager::get_intercept_scid
35226 * [`forward_intercepted_htlc`]: crate::ln::channelmanager::ChannelManager::forward_intercepted_htlc
35227 * [`HTLCIntercepted`]: crate::events::Event::HTLCIntercepted
35228 * [`HTLCIntercepted::expected_outbound_amount_msat`]: crate::events::Event::HTLCIntercepted::expected_outbound_amount_msat
35229 * [`PaymentClaimable::amount_msat`]: crate::events::Event::PaymentClaimable::amount_msat
35230 * [`PaymentClaimable::counterparty_skimmed_fee_msat`]: crate::events::Event::PaymentClaimable::counterparty_skimmed_fee_msat
35232 void ChannelConfig_set_accept_underpaying_htlcs(struct LDKChannelConfig *NONNULL_PTR this_ptr, bool val);
35235 * Constructs a new ChannelConfig given each field
35237 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);
35240 * Creates a copy of the ChannelConfig
35242 struct LDKChannelConfig ChannelConfig_clone(const struct LDKChannelConfig *NONNULL_PTR orig);
35245 * Checks if two ChannelConfigs contain equal inner contents.
35246 * This ignores pointers and is_owned flags and looks at the values in fields.
35247 * Two objects with NULL inner values will be considered "equal" here.
35249 bool ChannelConfig_eq(const struct LDKChannelConfig *NONNULL_PTR a, const struct LDKChannelConfig *NONNULL_PTR b);
35252 * Applies the given [`ChannelConfigUpdate`] as a partial update to the [`ChannelConfig`].
35254 void ChannelConfig_apply(struct LDKChannelConfig *NONNULL_PTR this_arg, const struct LDKChannelConfigUpdate *NONNULL_PTR update);
35257 * Creates a "default" ChannelConfig. See struct and individual field documentaiton for details on which values are used.
35259 MUST_USE_RES struct LDKChannelConfig ChannelConfig_default(void);
35262 * Serialize the ChannelConfig object into a byte array which can be read by ChannelConfig_read
35264 struct LDKCVec_u8Z ChannelConfig_write(const struct LDKChannelConfig *NONNULL_PTR obj);
35267 * Read a ChannelConfig from a byte array, created by ChannelConfig_write
35269 struct LDKCResult_ChannelConfigDecodeErrorZ ChannelConfig_read(struct LDKu8slice ser);
35272 * Frees any resources used by the ChannelConfigUpdate, if is_owned is set and inner is non-NULL.
35274 void ChannelConfigUpdate_free(struct LDKChannelConfigUpdate this_obj);
35276 struct LDKCOption_u32Z ChannelConfigUpdate_get_forwarding_fee_proportional_millionths(const struct LDKChannelConfigUpdate *NONNULL_PTR this_ptr);
35278 void ChannelConfigUpdate_set_forwarding_fee_proportional_millionths(struct LDKChannelConfigUpdate *NONNULL_PTR this_ptr, struct LDKCOption_u32Z val);
35280 struct LDKCOption_u32Z ChannelConfigUpdate_get_forwarding_fee_base_msat(const struct LDKChannelConfigUpdate *NONNULL_PTR this_ptr);
35282 void ChannelConfigUpdate_set_forwarding_fee_base_msat(struct LDKChannelConfigUpdate *NONNULL_PTR this_ptr, struct LDKCOption_u32Z val);
35284 struct LDKCOption_u16Z ChannelConfigUpdate_get_cltv_expiry_delta(const struct LDKChannelConfigUpdate *NONNULL_PTR this_ptr);
35286 void ChannelConfigUpdate_set_cltv_expiry_delta(struct LDKChannelConfigUpdate *NONNULL_PTR this_ptr, struct LDKCOption_u16Z val);
35290 * Returns a copy of the field.
35292 struct LDKCOption_MaxDustHTLCExposureZ ChannelConfigUpdate_get_max_dust_htlc_exposure_msat(const struct LDKChannelConfigUpdate *NONNULL_PTR this_ptr);
35294 void ChannelConfigUpdate_set_max_dust_htlc_exposure_msat(struct LDKChannelConfigUpdate *NONNULL_PTR this_ptr, struct LDKCOption_MaxDustHTLCExposureZ val);
35296 struct LDKCOption_u64Z ChannelConfigUpdate_get_force_close_avoidance_max_fee_satoshis(const struct LDKChannelConfigUpdate *NONNULL_PTR this_ptr);
35298 void ChannelConfigUpdate_set_force_close_avoidance_max_fee_satoshis(struct LDKChannelConfigUpdate *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
35301 * Constructs a new ChannelConfigUpdate given each field
35303 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);
35306 * Creates a "default" ChannelConfigUpdate. See struct and individual field documentaiton for details on which values are used.
35308 MUST_USE_RES struct LDKChannelConfigUpdate ChannelConfigUpdate_default(void);
35311 * Frees any resources used by the UserConfig, if is_owned is set and inner is non-NULL.
35313 void UserConfig_free(struct LDKUserConfig this_obj);
35316 * Channel handshake config that we propose to our counterparty.
35318 struct LDKChannelHandshakeConfig UserConfig_get_channel_handshake_config(const struct LDKUserConfig *NONNULL_PTR this_ptr);
35321 * Channel handshake config that we propose to our counterparty.
35323 void UserConfig_set_channel_handshake_config(struct LDKUserConfig *NONNULL_PTR this_ptr, struct LDKChannelHandshakeConfig val);
35326 * Limits applied to our counterparty's proposed channel handshake config settings.
35328 struct LDKChannelHandshakeLimits UserConfig_get_channel_handshake_limits(const struct LDKUserConfig *NONNULL_PTR this_ptr);
35331 * Limits applied to our counterparty's proposed channel handshake config settings.
35333 void UserConfig_set_channel_handshake_limits(struct LDKUserConfig *NONNULL_PTR this_ptr, struct LDKChannelHandshakeLimits val);
35336 * Channel config which affects behavior during channel lifetime.
35338 struct LDKChannelConfig UserConfig_get_channel_config(const struct LDKUserConfig *NONNULL_PTR this_ptr);
35341 * Channel config which affects behavior during channel lifetime.
35343 void UserConfig_set_channel_config(struct LDKUserConfig *NONNULL_PTR this_ptr, struct LDKChannelConfig val);
35346 * If this is set to false, we will reject any HTLCs which were to be forwarded over private
35347 * channels. This prevents us from taking on HTLC-forwarding risk when we intend to run as a
35348 * node which is not online reliably.
35350 * For nodes which are not online reliably, you should set all channels to *not* be announced
35351 * (using [`ChannelHandshakeConfig::announced_channel`] and
35352 * [`ChannelHandshakeLimits::force_announced_channel_preference`]) and set this to false to
35353 * ensure you are not exposed to any forwarding risk.
35355 * Note that because you cannot change a channel's announced state after creation, there is no
35356 * way to disable forwarding on public channels retroactively. Thus, in order to change a node
35357 * from a publicly-announced forwarding node to a private non-forwarding node you must close
35358 * all your channels and open new ones. For privacy, you should also change your node_id
35359 * (swapping all private and public key material for new ones) at that time.
35361 * Default value: false.
35363 bool UserConfig_get_accept_forwards_to_priv_channels(const struct LDKUserConfig *NONNULL_PTR this_ptr);
35366 * If this is set to false, we will reject any HTLCs which were to be forwarded over private
35367 * channels. This prevents us from taking on HTLC-forwarding risk when we intend to run as a
35368 * node which is not online reliably.
35370 * For nodes which are not online reliably, you should set all channels to *not* be announced
35371 * (using [`ChannelHandshakeConfig::announced_channel`] and
35372 * [`ChannelHandshakeLimits::force_announced_channel_preference`]) and set this to false to
35373 * ensure you are not exposed to any forwarding risk.
35375 * Note that because you cannot change a channel's announced state after creation, there is no
35376 * way to disable forwarding on public channels retroactively. Thus, in order to change a node
35377 * from a publicly-announced forwarding node to a private non-forwarding node you must close
35378 * all your channels and open new ones. For privacy, you should also change your node_id
35379 * (swapping all private and public key material for new ones) at that time.
35381 * Default value: false.
35383 void UserConfig_set_accept_forwards_to_priv_channels(struct LDKUserConfig *NONNULL_PTR this_ptr, bool val);
35386 * If this is set to false, we do not accept inbound requests to open a new channel.
35387 * Default value: true.
35389 bool UserConfig_get_accept_inbound_channels(const struct LDKUserConfig *NONNULL_PTR this_ptr);
35392 * If this is set to false, we do not accept inbound requests to open a new channel.
35393 * Default value: true.
35395 void UserConfig_set_accept_inbound_channels(struct LDKUserConfig *NONNULL_PTR this_ptr, bool val);
35398 * If this is set to true, the user needs to manually accept inbound requests to open a new
35401 * When set to true, [`Event::OpenChannelRequest`] will be triggered once a request to open a
35402 * new inbound channel is received through a [`msgs::OpenChannel`] message. In that case, a
35403 * [`msgs::AcceptChannel`] message will not be sent back to the counterparty node unless the
35404 * user explicitly chooses to accept the request.
35406 * Default value: false.
35408 * [`Event::OpenChannelRequest`]: crate::events::Event::OpenChannelRequest
35409 * [`msgs::OpenChannel`]: crate::ln::msgs::OpenChannel
35410 * [`msgs::AcceptChannel`]: crate::ln::msgs::AcceptChannel
35412 bool UserConfig_get_manually_accept_inbound_channels(const struct LDKUserConfig *NONNULL_PTR this_ptr);
35415 * If this is set to true, the user needs to manually accept inbound requests to open a new
35418 * When set to true, [`Event::OpenChannelRequest`] will be triggered once a request to open a
35419 * new inbound channel is received through a [`msgs::OpenChannel`] message. In that case, a
35420 * [`msgs::AcceptChannel`] message will not be sent back to the counterparty node unless the
35421 * user explicitly chooses to accept the request.
35423 * Default value: false.
35425 * [`Event::OpenChannelRequest`]: crate::events::Event::OpenChannelRequest
35426 * [`msgs::OpenChannel`]: crate::ln::msgs::OpenChannel
35427 * [`msgs::AcceptChannel`]: crate::ln::msgs::AcceptChannel
35429 void UserConfig_set_manually_accept_inbound_channels(struct LDKUserConfig *NONNULL_PTR this_ptr, bool val);
35432 * If this is set to true, LDK will intercept HTLCs that are attempting to be forwarded over
35433 * fake short channel ids generated via [`ChannelManager::get_intercept_scid`]. Upon HTLC
35434 * intercept, LDK will generate an [`Event::HTLCIntercepted`] which MUST be handled by the user.
35436 * Setting this to true may break backwards compatibility with LDK versions < 0.0.113.
35438 * Default value: false.
35440 * [`ChannelManager::get_intercept_scid`]: crate::ln::channelmanager::ChannelManager::get_intercept_scid
35441 * [`Event::HTLCIntercepted`]: crate::events::Event::HTLCIntercepted
35443 bool UserConfig_get_accept_intercept_htlcs(const struct LDKUserConfig *NONNULL_PTR this_ptr);
35446 * If this is set to true, LDK will intercept HTLCs that are attempting to be forwarded over
35447 * fake short channel ids generated via [`ChannelManager::get_intercept_scid`]. Upon HTLC
35448 * intercept, LDK will generate an [`Event::HTLCIntercepted`] which MUST be handled by the user.
35450 * Setting this to true may break backwards compatibility with LDK versions < 0.0.113.
35452 * Default value: false.
35454 * [`ChannelManager::get_intercept_scid`]: crate::ln::channelmanager::ChannelManager::get_intercept_scid
35455 * [`Event::HTLCIntercepted`]: crate::events::Event::HTLCIntercepted
35457 void UserConfig_set_accept_intercept_htlcs(struct LDKUserConfig *NONNULL_PTR this_ptr, bool val);
35460 * If this is set to false, when receiving a keysend payment we'll fail it if it has multiple
35461 * parts. If this is set to true, we'll accept the payment.
35463 * Setting this to true will break backwards compatibility upon downgrading to an LDK
35464 * version < 0.0.116 while receiving an MPP keysend. If we have already received an MPP
35465 * keysend, downgrading will cause us to fail to deserialize [`ChannelManager`].
35467 * Default value: false.
35469 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
35471 bool UserConfig_get_accept_mpp_keysend(const struct LDKUserConfig *NONNULL_PTR this_ptr);
35474 * If this is set to false, when receiving a keysend payment we'll fail it if it has multiple
35475 * parts. If this is set to true, we'll accept the payment.
35477 * Setting this to true will break backwards compatibility upon downgrading to an LDK
35478 * version < 0.0.116 while receiving an MPP keysend. If we have already received an MPP
35479 * keysend, downgrading will cause us to fail to deserialize [`ChannelManager`].
35481 * Default value: false.
35483 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
35485 void UserConfig_set_accept_mpp_keysend(struct LDKUserConfig *NONNULL_PTR this_ptr, bool val);
35488 * Constructs a new UserConfig given each field
35490 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);
35493 * Creates a copy of the UserConfig
35495 struct LDKUserConfig UserConfig_clone(const struct LDKUserConfig *NONNULL_PTR orig);
35498 * Creates a "default" UserConfig. See struct and individual field documentaiton for details on which values are used.
35500 MUST_USE_RES struct LDKUserConfig UserConfig_default(void);
35503 * Frees any resources used by the BestBlock, if is_owned is set and inner is non-NULL.
35505 void BestBlock_free(struct LDKBestBlock this_obj);
35510 const uint8_t (*BestBlock_get_block_hash(const struct LDKBestBlock *NONNULL_PTR this_ptr))[32];
35515 void BestBlock_set_block_hash(struct LDKBestBlock *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
35518 * The height at which the block was confirmed.
35520 uint32_t BestBlock_get_height(const struct LDKBestBlock *NONNULL_PTR this_ptr);
35523 * The height at which the block was confirmed.
35525 void BestBlock_set_height(struct LDKBestBlock *NONNULL_PTR this_ptr, uint32_t val);
35528 * Constructs a new BestBlock given each field
35530 MUST_USE_RES struct LDKBestBlock BestBlock_new(struct LDKThirtyTwoBytes block_hash_arg, uint32_t height_arg);
35533 * Creates a copy of the BestBlock
35535 struct LDKBestBlock BestBlock_clone(const struct LDKBestBlock *NONNULL_PTR orig);
35538 * Generates a non-cryptographic 64-bit hash of the BestBlock.
35540 uint64_t BestBlock_hash(const struct LDKBestBlock *NONNULL_PTR o);
35543 * Checks if two BestBlocks contain equal inner contents.
35544 * This ignores pointers and is_owned flags and looks at the values in fields.
35545 * Two objects with NULL inner values will be considered "equal" here.
35547 bool BestBlock_eq(const struct LDKBestBlock *NONNULL_PTR a, const struct LDKBestBlock *NONNULL_PTR b);
35550 * Constructs a `BestBlock` that represents the genesis block at height 0 of the given
35553 MUST_USE_RES struct LDKBestBlock BestBlock_from_network(enum LDKNetwork network);
35556 * Serialize the BestBlock object into a byte array which can be read by BestBlock_read
35558 struct LDKCVec_u8Z BestBlock_write(const struct LDKBestBlock *NONNULL_PTR obj);
35561 * Read a BestBlock from a byte array, created by BestBlock_write
35563 struct LDKCResult_BestBlockDecodeErrorZ BestBlock_read(struct LDKu8slice ser);
35566 * Calls the free function if one is set
35568 void Listen_free(struct LDKListen this_ptr);
35571 * Calls the free function if one is set
35573 void Confirm_free(struct LDKConfirm this_ptr);
35576 * Creates a copy of the ChannelMonitorUpdateStatus
35578 enum LDKChannelMonitorUpdateStatus ChannelMonitorUpdateStatus_clone(const enum LDKChannelMonitorUpdateStatus *NONNULL_PTR orig);
35581 * Utility method to constructs a new Completed-variant ChannelMonitorUpdateStatus
35583 enum LDKChannelMonitorUpdateStatus ChannelMonitorUpdateStatus_completed(void);
35586 * Utility method to constructs a new InProgress-variant ChannelMonitorUpdateStatus
35588 enum LDKChannelMonitorUpdateStatus ChannelMonitorUpdateStatus_in_progress(void);
35591 * Utility method to constructs a new UnrecoverableError-variant ChannelMonitorUpdateStatus
35593 enum LDKChannelMonitorUpdateStatus ChannelMonitorUpdateStatus_unrecoverable_error(void);
35596 * Checks if two ChannelMonitorUpdateStatuss contain equal inner contents.
35597 * This ignores pointers and is_owned flags and looks at the values in fields.
35599 bool ChannelMonitorUpdateStatus_eq(const enum LDKChannelMonitorUpdateStatus *NONNULL_PTR a, const enum LDKChannelMonitorUpdateStatus *NONNULL_PTR b);
35602 * Calls the free function if one is set
35604 void Watch_free(struct LDKWatch this_ptr);
35607 * Calls the free function if one is set
35609 void Filter_free(struct LDKFilter this_ptr);
35612 * Frees any resources used by the WatchedOutput, if is_owned is set and inner is non-NULL.
35614 void WatchedOutput_free(struct LDKWatchedOutput this_obj);
35617 * First block where the transaction output may have been spent.
35619 struct LDKCOption_ThirtyTwoBytesZ WatchedOutput_get_block_hash(const struct LDKWatchedOutput *NONNULL_PTR this_ptr);
35622 * First block where the transaction output may have been spent.
35624 void WatchedOutput_set_block_hash(struct LDKWatchedOutput *NONNULL_PTR this_ptr, struct LDKCOption_ThirtyTwoBytesZ val);
35627 * Outpoint identifying the transaction output.
35629 struct LDKOutPoint WatchedOutput_get_outpoint(const struct LDKWatchedOutput *NONNULL_PTR this_ptr);
35632 * Outpoint identifying the transaction output.
35634 void WatchedOutput_set_outpoint(struct LDKWatchedOutput *NONNULL_PTR this_ptr, struct LDKOutPoint val);
35637 * Spending condition of the transaction output.
35639 struct LDKCVec_u8Z WatchedOutput_get_script_pubkey(const struct LDKWatchedOutput *NONNULL_PTR this_ptr);
35642 * Spending condition of the transaction output.
35644 void WatchedOutput_set_script_pubkey(struct LDKWatchedOutput *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val);
35647 * Constructs a new WatchedOutput given each field
35649 MUST_USE_RES struct LDKWatchedOutput WatchedOutput_new(struct LDKCOption_ThirtyTwoBytesZ block_hash_arg, struct LDKOutPoint outpoint_arg, struct LDKCVec_u8Z script_pubkey_arg);
35652 * Creates a copy of the WatchedOutput
35654 struct LDKWatchedOutput WatchedOutput_clone(const struct LDKWatchedOutput *NONNULL_PTR orig);
35657 * Checks if two WatchedOutputs contain equal inner contents.
35658 * This ignores pointers and is_owned flags and looks at the values in fields.
35659 * Two objects with NULL inner values will be considered "equal" here.
35661 bool WatchedOutput_eq(const struct LDKWatchedOutput *NONNULL_PTR a, const struct LDKWatchedOutput *NONNULL_PTR b);
35664 * Generates a non-cryptographic 64-bit hash of the WatchedOutput.
35666 uint64_t WatchedOutput_hash(const struct LDKWatchedOutput *NONNULL_PTR o);
35669 * Calls the free function if one is set
35671 void BroadcasterInterface_free(struct LDKBroadcasterInterface this_ptr);
35674 * Creates a copy of the ConfirmationTarget
35676 enum LDKConfirmationTarget ConfirmationTarget_clone(const enum LDKConfirmationTarget *NONNULL_PTR orig);
35679 * Utility method to constructs a new OnChainSweep-variant ConfirmationTarget
35681 enum LDKConfirmationTarget ConfirmationTarget_on_chain_sweep(void);
35684 * Utility method to constructs a new MinAllowedAnchorChannelRemoteFee-variant ConfirmationTarget
35686 enum LDKConfirmationTarget ConfirmationTarget_min_allowed_anchor_channel_remote_fee(void);
35689 * Utility method to constructs a new MinAllowedNonAnchorChannelRemoteFee-variant ConfirmationTarget
35691 enum LDKConfirmationTarget ConfirmationTarget_min_allowed_non_anchor_channel_remote_fee(void);
35694 * Utility method to constructs a new AnchorChannelFee-variant ConfirmationTarget
35696 enum LDKConfirmationTarget ConfirmationTarget_anchor_channel_fee(void);
35699 * Utility method to constructs a new NonAnchorChannelFee-variant ConfirmationTarget
35701 enum LDKConfirmationTarget ConfirmationTarget_non_anchor_channel_fee(void);
35704 * Utility method to constructs a new ChannelCloseMinimum-variant ConfirmationTarget
35706 enum LDKConfirmationTarget ConfirmationTarget_channel_close_minimum(void);
35709 * Utility method to constructs a new OutputSpendingFee-variant ConfirmationTarget
35711 enum LDKConfirmationTarget ConfirmationTarget_output_spending_fee(void);
35714 * Generates a non-cryptographic 64-bit hash of the ConfirmationTarget.
35716 uint64_t ConfirmationTarget_hash(const enum LDKConfirmationTarget *NONNULL_PTR o);
35719 * Checks if two ConfirmationTargets contain equal inner contents.
35720 * This ignores pointers and is_owned flags and looks at the values in fields.
35722 bool ConfirmationTarget_eq(const enum LDKConfirmationTarget *NONNULL_PTR a, const enum LDKConfirmationTarget *NONNULL_PTR b);
35725 * Calls the free function if one is set
35727 void FeeEstimator_free(struct LDKFeeEstimator this_ptr);
35730 * Frees any resources used by the MonitorUpdateId, if is_owned is set and inner is non-NULL.
35732 void MonitorUpdateId_free(struct LDKMonitorUpdateId this_obj);
35735 * Creates a copy of the MonitorUpdateId
35737 struct LDKMonitorUpdateId MonitorUpdateId_clone(const struct LDKMonitorUpdateId *NONNULL_PTR orig);
35740 * Generates a non-cryptographic 64-bit hash of the MonitorUpdateId.
35742 uint64_t MonitorUpdateId_hash(const struct LDKMonitorUpdateId *NONNULL_PTR o);
35745 * Checks if two MonitorUpdateIds contain equal inner contents.
35746 * This ignores pointers and is_owned flags and looks at the values in fields.
35747 * Two objects with NULL inner values will be considered "equal" here.
35749 bool MonitorUpdateId_eq(const struct LDKMonitorUpdateId *NONNULL_PTR a, const struct LDKMonitorUpdateId *NONNULL_PTR b);
35752 * Calls the free function if one is set
35754 void Persist_free(struct LDKPersist this_ptr);
35757 * Frees any resources used by the LockedChannelMonitor, if is_owned is set and inner is non-NULL.
35759 void LockedChannelMonitor_free(struct LDKLockedChannelMonitor this_obj);
35762 * Frees any resources used by the ChainMonitor, if is_owned is set and inner is non-NULL.
35764 void ChainMonitor_free(struct LDKChainMonitor this_obj);
35767 * Creates a new `ChainMonitor` used to watch on-chain activity pertaining to channels.
35769 * When an optional chain source implementing [`chain::Filter`] is provided, the chain monitor
35770 * will call back to it indicating transactions and outputs of interest. This allows clients to
35771 * pre-filter blocks or only fetch blocks matching a compact filter. Otherwise, clients may
35772 * always need to fetch full blocks absent another means for determining which blocks contain
35773 * transactions relevant to the watched channels.
35775 MUST_USE_RES struct LDKChainMonitor ChainMonitor_new(struct LDKCOption_FilterZ chain_source, struct LDKBroadcasterInterface broadcaster, struct LDKLogger logger, struct LDKFeeEstimator feeest, struct LDKPersist persister);
35778 * Gets the balances in the contained [`ChannelMonitor`]s which are claimable on-chain or
35779 * claims which are awaiting confirmation.
35781 * Includes the balances from each [`ChannelMonitor`] *except* those included in
35782 * `ignored_channels`, allowing you to filter out balances from channels which are still open
35783 * (and whose balance should likely be pulled from the [`ChannelDetails`]).
35785 * See [`ChannelMonitor::get_claimable_balances`] for more details on the exact criteria for
35786 * inclusion in the return value.
35788 MUST_USE_RES struct LDKCVec_BalanceZ ChainMonitor_get_claimable_balances(const struct LDKChainMonitor *NONNULL_PTR this_arg, struct LDKCVec_ChannelDetailsZ ignored_channels);
35791 * Gets the [`LockedChannelMonitor`] for a given funding outpoint, returning an `Err` if no
35792 * such [`ChannelMonitor`] is currently being monitored for.
35794 * Note that the result holds a mutex over our monitor set, and should not be held
35797 MUST_USE_RES struct LDKCResult_LockedChannelMonitorNoneZ ChainMonitor_get_monitor(const struct LDKChainMonitor *NONNULL_PTR this_arg, struct LDKOutPoint funding_txo);
35800 * Lists the funding outpoint and channel ID of each [`ChannelMonitor`] being monitored.
35802 * Note that [`ChannelMonitor`]s are not removed when a channel is closed as they are always
35803 * monitoring for on-chain state resolutions.
35805 MUST_USE_RES struct LDKCVec_C2Tuple_OutPointChannelIdZZ ChainMonitor_list_monitors(const struct LDKChainMonitor *NONNULL_PTR this_arg);
35808 * Lists the pending updates for each [`ChannelMonitor`] (by `OutPoint` being monitored).
35810 MUST_USE_RES struct LDKCVec_C2Tuple_OutPointCVec_MonitorUpdateIdZZZ ChainMonitor_list_pending_monitor_updates(const struct LDKChainMonitor *NONNULL_PTR this_arg);
35813 * Indicates the persistence of a [`ChannelMonitor`] has completed after
35814 * [`ChannelMonitorUpdateStatus::InProgress`] was returned from an update operation.
35816 * Thus, the anticipated use is, at a high level:
35817 * 1) This [`ChainMonitor`] calls [`Persist::update_persisted_channel`] which stores the
35818 * update to disk and begins updating any remote (e.g. watchtower/backup) copies,
35819 * returning [`ChannelMonitorUpdateStatus::InProgress`],
35820 * 2) once all remote copies are updated, you call this function with the
35821 * `completed_update_id` that completed, and once all pending updates have completed the
35822 * channel will be re-enabled.
35824 * Returns an [`APIError::APIMisuseError`] if `funding_txo` does not match any currently
35825 * registered [`ChannelMonitor`]s.
35827 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);
35830 * Gets a [`Future`] that completes when an event is available either via
35831 * [`chain::Watch::release_pending_monitor_events`] or
35832 * [`EventsProvider::process_pending_events`].
35834 * Note that callbacks registered on the [`Future`] MUST NOT call back into this
35835 * [`ChainMonitor`] and should instead register actions to be taken later.
35837 * [`EventsProvider::process_pending_events`]: crate::events::EventsProvider::process_pending_events
35839 MUST_USE_RES struct LDKFuture ChainMonitor_get_update_future(const struct LDKChainMonitor *NONNULL_PTR this_arg);
35842 * Triggers rebroadcasts/fee-bumps of pending claims from a force-closed channel. This is
35843 * crucial in preventing certain classes of pinning attacks, detecting substantial mempool
35844 * feerate changes between blocks, and ensuring reliability if broadcasting fails. We recommend
35845 * invoking this every 30 seconds, or lower if running in an environment with spotty
35846 * connections, like on mobile.
35848 void ChainMonitor_rebroadcast_pending_claims(const struct LDKChainMonitor *NONNULL_PTR this_arg);
35851 * Triggers rebroadcasts of pending claims from force-closed channels after a transaction
35852 * signature generation failure.
35854 * `monitor_opt` can be used as a filter to only trigger them for a specific channel monitor.
35856 * Note that monitor_opt (or a relevant inner pointer) may be NULL or all-0s to represent None
35858 void ChainMonitor_signer_unblocked(const struct LDKChainMonitor *NONNULL_PTR this_arg, struct LDKOutPoint monitor_opt);
35861 * Archives fully resolved channel monitors by calling [`Persist::archive_persisted_channel`].
35863 * This is useful for pruning fully resolved monitors from the monitor set and primary
35864 * storage so they are not kept in memory and reloaded on restart.
35866 * Should be called occasionally (once every handful of blocks or on startup).
35868 * Depending on the implementation of [`Persist::archive_persisted_channel`] the monitor
35869 * data could be moved to an archive location or removed entirely.
35871 void ChainMonitor_archive_fully_resolved_channel_monitors(const struct LDKChainMonitor *NONNULL_PTR this_arg);
35874 * Constructs a new Listen which calls the relevant methods on this_arg.
35875 * This copies the `inner` pointer in this_arg and thus the returned Listen must be freed before this_arg is
35877 struct LDKListen ChainMonitor_as_Listen(const struct LDKChainMonitor *NONNULL_PTR this_arg);
35880 * Constructs a new Confirm which calls the relevant methods on this_arg.
35881 * This copies the `inner` pointer in this_arg and thus the returned Confirm must be freed before this_arg is
35883 struct LDKConfirm ChainMonitor_as_Confirm(const struct LDKChainMonitor *NONNULL_PTR this_arg);
35886 * Constructs a new Watch which calls the relevant methods on this_arg.
35887 * This copies the `inner` pointer in this_arg and thus the returned Watch must be freed before this_arg is
35889 struct LDKWatch ChainMonitor_as_Watch(const struct LDKChainMonitor *NONNULL_PTR this_arg);
35892 * Constructs a new EventsProvider which calls the relevant methods on this_arg.
35893 * This copies the `inner` pointer in this_arg and thus the returned EventsProvider must be freed before this_arg is
35895 struct LDKEventsProvider ChainMonitor_as_EventsProvider(const struct LDKChainMonitor *NONNULL_PTR this_arg);
35898 * Frees any resources used by the ChannelMonitorUpdate, if is_owned is set and inner is non-NULL.
35900 void ChannelMonitorUpdate_free(struct LDKChannelMonitorUpdate this_obj);
35903 * The sequence number of this update. Updates *must* be replayed in-order according to this
35904 * sequence number (and updates may panic if they are not). The update_id values are strictly
35905 * increasing and increase by one for each new update, with two exceptions specified below.
35907 * This sequence number is also used to track up to which points updates which returned
35908 * [`ChannelMonitorUpdateStatus::InProgress`] have been applied to all copies of a given
35909 * ChannelMonitor when ChannelManager::channel_monitor_updated is called.
35911 * The only instances we allow where update_id values are not strictly increasing have a
35912 * special update ID of [`CLOSED_CHANNEL_UPDATE_ID`]. This update ID is used for updates that
35913 * will force close the channel by broadcasting the latest commitment transaction or
35914 * special post-force-close updates, like providing preimages necessary to claim outputs on the
35915 * broadcast commitment transaction. See its docs for more details.
35917 * [`ChannelMonitorUpdateStatus::InProgress`]: super::ChannelMonitorUpdateStatus::InProgress
35919 uint64_t ChannelMonitorUpdate_get_update_id(const struct LDKChannelMonitorUpdate *NONNULL_PTR this_ptr);
35922 * The sequence number of this update. Updates *must* be replayed in-order according to this
35923 * sequence number (and updates may panic if they are not). The update_id values are strictly
35924 * increasing and increase by one for each new update, with two exceptions specified below.
35926 * This sequence number is also used to track up to which points updates which returned
35927 * [`ChannelMonitorUpdateStatus::InProgress`] have been applied to all copies of a given
35928 * ChannelMonitor when ChannelManager::channel_monitor_updated is called.
35930 * The only instances we allow where update_id values are not strictly increasing have a
35931 * special update ID of [`CLOSED_CHANNEL_UPDATE_ID`]. This update ID is used for updates that
35932 * will force close the channel by broadcasting the latest commitment transaction or
35933 * special post-force-close updates, like providing preimages necessary to claim outputs on the
35934 * broadcast commitment transaction. See its docs for more details.
35936 * [`ChannelMonitorUpdateStatus::InProgress`]: super::ChannelMonitorUpdateStatus::InProgress
35938 void ChannelMonitorUpdate_set_update_id(struct LDKChannelMonitorUpdate *NONNULL_PTR this_ptr, uint64_t val);
35941 * The channel ID associated with these updates.
35943 * Will be `None` for `ChannelMonitorUpdate`s constructed on LDK versions prior to 0.0.121 and
35944 * always `Some` otherwise.
35946 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
35948 struct LDKChannelId ChannelMonitorUpdate_get_channel_id(const struct LDKChannelMonitorUpdate *NONNULL_PTR this_ptr);
35951 * The channel ID associated with these updates.
35953 * Will be `None` for `ChannelMonitorUpdate`s constructed on LDK versions prior to 0.0.121 and
35954 * always `Some` otherwise.
35956 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
35958 void ChannelMonitorUpdate_set_channel_id(struct LDKChannelMonitorUpdate *NONNULL_PTR this_ptr, struct LDKChannelId val);
35961 * Creates a copy of the ChannelMonitorUpdate
35963 struct LDKChannelMonitorUpdate ChannelMonitorUpdate_clone(const struct LDKChannelMonitorUpdate *NONNULL_PTR orig);
35966 * Checks if two ChannelMonitorUpdates contain equal inner contents.
35967 * This ignores pointers and is_owned flags and looks at the values in fields.
35968 * Two objects with NULL inner values will be considered "equal" here.
35970 bool ChannelMonitorUpdate_eq(const struct LDKChannelMonitorUpdate *NONNULL_PTR a, const struct LDKChannelMonitorUpdate *NONNULL_PTR b);
35973 * Serialize the ChannelMonitorUpdate object into a byte array which can be read by ChannelMonitorUpdate_read
35975 struct LDKCVec_u8Z ChannelMonitorUpdate_write(const struct LDKChannelMonitorUpdate *NONNULL_PTR obj);
35978 * Read a ChannelMonitorUpdate from a byte array, created by ChannelMonitorUpdate_write
35980 struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ ChannelMonitorUpdate_read(struct LDKu8slice ser);
35983 * Frees any resources used by the MonitorEvent
35985 void MonitorEvent_free(struct LDKMonitorEvent this_ptr);
35988 * Creates a copy of the MonitorEvent
35990 struct LDKMonitorEvent MonitorEvent_clone(const struct LDKMonitorEvent *NONNULL_PTR orig);
35993 * Utility method to constructs a new HTLCEvent-variant MonitorEvent
35995 struct LDKMonitorEvent MonitorEvent_htlcevent(struct LDKHTLCUpdate a);
35998 * Utility method to constructs a new HolderForceClosedWithInfo-variant MonitorEvent
36000 struct LDKMonitorEvent MonitorEvent_holder_force_closed_with_info(struct LDKClosureReason reason, struct LDKOutPoint outpoint, struct LDKChannelId channel_id);
36003 * Utility method to constructs a new HolderForceClosed-variant MonitorEvent
36005 struct LDKMonitorEvent MonitorEvent_holder_force_closed(struct LDKOutPoint a);
36008 * Utility method to constructs a new Completed-variant MonitorEvent
36010 struct LDKMonitorEvent MonitorEvent_completed(struct LDKOutPoint funding_txo, struct LDKChannelId channel_id, uint64_t monitor_update_id);
36013 * Checks if two MonitorEvents contain equal inner contents.
36014 * This ignores pointers and is_owned flags and looks at the values in fields.
36016 bool MonitorEvent_eq(const struct LDKMonitorEvent *NONNULL_PTR a, const struct LDKMonitorEvent *NONNULL_PTR b);
36019 * Serialize the MonitorEvent object into a byte array which can be read by MonitorEvent_read
36021 struct LDKCVec_u8Z MonitorEvent_write(const struct LDKMonitorEvent *NONNULL_PTR obj);
36024 * Read a MonitorEvent from a byte array, created by MonitorEvent_write
36026 struct LDKCResult_COption_MonitorEventZDecodeErrorZ MonitorEvent_read(struct LDKu8slice ser);
36029 * Frees any resources used by the HTLCUpdate, if is_owned is set and inner is non-NULL.
36031 void HTLCUpdate_free(struct LDKHTLCUpdate this_obj);
36034 * Creates a copy of the HTLCUpdate
36036 struct LDKHTLCUpdate HTLCUpdate_clone(const struct LDKHTLCUpdate *NONNULL_PTR orig);
36039 * Checks if two HTLCUpdates contain equal inner contents.
36040 * This ignores pointers and is_owned flags and looks at the values in fields.
36041 * Two objects with NULL inner values will be considered "equal" here.
36043 bool HTLCUpdate_eq(const struct LDKHTLCUpdate *NONNULL_PTR a, const struct LDKHTLCUpdate *NONNULL_PTR b);
36046 * Serialize the HTLCUpdate object into a byte array which can be read by HTLCUpdate_read
36048 struct LDKCVec_u8Z HTLCUpdate_write(const struct LDKHTLCUpdate *NONNULL_PTR obj);
36051 * Read a HTLCUpdate from a byte array, created by HTLCUpdate_write
36053 struct LDKCResult_HTLCUpdateDecodeErrorZ HTLCUpdate_read(struct LDKu8slice ser);
36056 * Frees any resources used by the Balance
36058 void Balance_free(struct LDKBalance this_ptr);
36061 * Creates a copy of the Balance
36063 struct LDKBalance Balance_clone(const struct LDKBalance *NONNULL_PTR orig);
36066 * Utility method to constructs a new ClaimableOnChannelClose-variant Balance
36068 struct LDKBalance Balance_claimable_on_channel_close(uint64_t amount_satoshis);
36071 * Utility method to constructs a new ClaimableAwaitingConfirmations-variant Balance
36073 struct LDKBalance Balance_claimable_awaiting_confirmations(uint64_t amount_satoshis, uint32_t confirmation_height);
36076 * Utility method to constructs a new ContentiousClaimable-variant Balance
36078 struct LDKBalance Balance_contentious_claimable(uint64_t amount_satoshis, uint32_t timeout_height, struct LDKThirtyTwoBytes payment_hash, struct LDKThirtyTwoBytes payment_preimage);
36081 * Utility method to constructs a new MaybeTimeoutClaimableHTLC-variant Balance
36083 struct LDKBalance Balance_maybe_timeout_claimable_htlc(uint64_t amount_satoshis, uint32_t claimable_height, struct LDKThirtyTwoBytes payment_hash);
36086 * Utility method to constructs a new MaybePreimageClaimableHTLC-variant Balance
36088 struct LDKBalance Balance_maybe_preimage_claimable_htlc(uint64_t amount_satoshis, uint32_t expiry_height, struct LDKThirtyTwoBytes payment_hash);
36091 * Utility method to constructs a new CounterpartyRevokedOutputClaimable-variant Balance
36093 struct LDKBalance Balance_counterparty_revoked_output_claimable(uint64_t amount_satoshis);
36096 * Checks if two Balances contain equal inner contents.
36097 * This ignores pointers and is_owned flags and looks at the values in fields.
36099 bool Balance_eq(const struct LDKBalance *NONNULL_PTR a, const struct LDKBalance *NONNULL_PTR b);
36102 * The amount claimable, in satoshis. This excludes balances that we are unsure if we are able
36103 * to claim, this is because we are waiting for a preimage or for a timeout to expire. For more
36104 * information on these balances see [`Balance::MaybeTimeoutClaimableHTLC`] and
36105 * [`Balance::MaybePreimageClaimableHTLC`].
36107 * On-chain fees required to claim the balance are not included in this amount.
36109 MUST_USE_RES uint64_t Balance_claimable_amount_satoshis(const struct LDKBalance *NONNULL_PTR this_arg);
36112 * Frees any resources used by the ChannelMonitor, if is_owned is set and inner is non-NULL.
36114 void ChannelMonitor_free(struct LDKChannelMonitor this_obj);
36117 * Creates a copy of the ChannelMonitor
36119 struct LDKChannelMonitor ChannelMonitor_clone(const struct LDKChannelMonitor *NONNULL_PTR orig);
36122 * Serialize the ChannelMonitor object into a byte array which can be read by ChannelMonitor_read
36124 struct LDKCVec_u8Z ChannelMonitor_write(const struct LDKChannelMonitor *NONNULL_PTR obj);
36127 * Updates a ChannelMonitor on the basis of some new information provided by the Channel
36130 * panics if the given update is not the next update by update_id.
36132 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);
36135 * Gets the update_id from the latest ChannelMonitorUpdate which was applied to this
36138 MUST_USE_RES uint64_t ChannelMonitor_get_latest_update_id(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
36141 * Gets the funding transaction outpoint of the channel this ChannelMonitor is monitoring for.
36143 MUST_USE_RES struct LDKC2Tuple_OutPointCVec_u8ZZ ChannelMonitor_get_funding_txo(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
36146 * Gets the channel_id of the channel this ChannelMonitor is monitoring for.
36148 MUST_USE_RES struct LDKChannelId ChannelMonitor_channel_id(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
36151 * Gets a list of txids, with their output scripts (in the order they appear in the
36152 * transaction), which we must learn about spends of via block_connected().
36154 MUST_USE_RES struct LDKCVec_C2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZZ ChannelMonitor_get_outputs_to_watch(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
36157 * Loads the funding txo and outputs to watch into the given `chain::Filter` by repeatedly
36158 * calling `chain::Filter::register_output` and `chain::Filter::register_tx` until all outputs
36159 * have been registered.
36161 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);
36164 * Get the list of HTLCs who's status has been updated on chain. This should be called by
36165 * ChannelManager via [`chain::Watch::release_pending_monitor_events`].
36167 MUST_USE_RES struct LDKCVec_MonitorEventZ ChannelMonitor_get_and_clear_pending_monitor_events(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
36170 * Processes [`SpendableOutputs`] events produced from each [`ChannelMonitor`] upon maturity.
36172 * For channels featuring anchor outputs, this method will also process [`BumpTransaction`]
36173 * events produced from each [`ChannelMonitor`] while there is a balance to claim onchain
36174 * within each channel. As the confirmation of a commitment transaction may be critical to the
36175 * safety of funds, we recommend invoking this every 30 seconds, or lower if running in an
36176 * environment with spotty connections, like on mobile.
36178 * An [`EventHandler`] may safely call back to the provider, though this shouldn't be needed in
36179 * order to handle these events.
36181 * [`SpendableOutputs`]: crate::events::Event::SpendableOutputs
36182 * [`BumpTransaction`]: crate::events::Event::BumpTransaction
36184 void ChannelMonitor_process_pending_events(const struct LDKChannelMonitor *NONNULL_PTR this_arg, const struct LDKEventHandler *NONNULL_PTR handler);
36187 * Gets the counterparty's initial commitment transaction. The returned commitment
36188 * transaction is unsigned. This is intended to be called during the initial persistence of
36189 * the monitor (inside an implementation of [`Persist::persist_new_channel`]), to allow for
36190 * watchtowers in the persistence pipeline to have enough data to form justice transactions.
36192 * This is similar to [`Self::counterparty_commitment_txs_from_update`], except
36193 * that for the initial commitment transaction, we don't have a corresponding update.
36195 * This will only return `Some` for channel monitors that have been created after upgrading
36198 * [`Persist::persist_new_channel`]: crate::chain::chainmonitor::Persist::persist_new_channel
36200 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
36202 MUST_USE_RES struct LDKCommitmentTransaction ChannelMonitor_initial_counterparty_commitment_tx(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
36205 * Gets all of the counterparty commitment transactions provided by the given update. This
36206 * may be empty if the update doesn't include any new counterparty commitments. Returned
36207 * commitment transactions are unsigned.
36209 * This is provided so that watchtower clients in the persistence pipeline are able to build
36210 * justice transactions for each counterparty commitment upon each update. It's intended to be
36211 * used within an implementation of [`Persist::update_persisted_channel`], which is provided
36212 * with a monitor and an update. Once revoked, signing a justice transaction can be done using
36213 * [`Self::sign_to_local_justice_tx`].
36215 * It is expected that a watchtower client may use this method to retrieve the latest counterparty
36216 * commitment transaction(s), and then hold the necessary data until a later update in which
36217 * the monitor has been updated with the corresponding revocation data, at which point the
36218 * monitor can sign the justice transaction.
36220 * This will only return a non-empty list for monitor updates that have been created after
36221 * upgrading to LDK 0.0.117+. Note that no restriction lies on the monitors themselves, which
36222 * may have been created prior to upgrading.
36224 * [`Persist::update_persisted_channel`]: crate::chain::chainmonitor::Persist::update_persisted_channel
36226 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);
36229 * Wrapper around [`EcdsaChannelSigner::sign_justice_revoked_output`] to make
36230 * signing the justice transaction easier for implementors of
36231 * [`chain::chainmonitor::Persist`]. On success this method returns the provided transaction
36232 * signing the input at `input_idx`. This method will only produce a valid signature for
36233 * a transaction spending the `to_local` output of a commitment transaction, i.e. this cannot
36234 * be used for revoked HTLC outputs.
36236 * `Value` is the value of the output being spent by the input at `input_idx`, committed
36237 * in the BIP 143 signature.
36239 * This method will only succeed if this monitor has received the revocation secret for the
36240 * provided `commitment_number`. If a commitment number is provided that does not correspond
36241 * to the commitment transaction being revoked, this will return a signed transaction, but
36242 * the signature will not be valid.
36244 * [`EcdsaChannelSigner::sign_justice_revoked_output`]: crate::sign::ecdsa::EcdsaChannelSigner::sign_justice_revoked_output
36245 * [`Persist`]: crate::chain::chainmonitor::Persist
36247 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);
36250 * Gets the `node_id` of the counterparty for this channel.
36252 * Will be `None` for channels constructed on LDK versions prior to 0.0.110 and always `Some`
36255 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
36257 MUST_USE_RES struct LDKPublicKey ChannelMonitor_get_counterparty_node_id(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
36260 * You may use this to broadcast the latest local commitment transaction, either because
36261 * a monitor update failed or because we've fallen behind (i.e. we've received proof that our
36262 * counterparty side knows a revocation secret we gave them that they shouldn't know).
36264 * Broadcasting these transactions in this manner is UNSAFE, as they allow counterparty
36265 * side to punish you. Nevertheless you may want to broadcast them if counterparty doesn't
36266 * close channel with their commitment transaction after a substantial amount of time. Best
36267 * may be to contact the other node operator out-of-band to coordinate other options available
36270 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);
36273 * Processes transactions in a newly connected block, which may result in any of the following:
36274 * - update the monitor's state against resolved HTLCs
36275 * - punish the counterparty in the case of seeing a revoked commitment transaction
36276 * - force close the channel and claim/timeout incoming/outgoing HTLCs if near expiration
36277 * - detect settled outputs for later spending
36278 * - schedule and bump any in-flight claims
36280 * Returns any new outputs to watch from `txdata`; after called, these are also included in
36281 * [`get_outputs_to_watch`].
36283 * [`get_outputs_to_watch`]: #method.get_outputs_to_watch
36285 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);
36288 * Determines if the disconnected block contained any transactions of interest and updates
36291 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);
36294 * Processes transactions confirmed in a block with the given header and height, returning new
36295 * outputs to watch. See [`block_connected`] for details.
36297 * Used instead of [`block_connected`] by clients that are notified of transactions rather than
36298 * blocks. See [`chain::Confirm`] for calling expectations.
36300 * [`block_connected`]: Self::block_connected
36302 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);
36305 * Processes a transaction that was reorganized out of the chain.
36307 * Used instead of [`block_disconnected`] by clients that are notified of transactions rather
36308 * than blocks. See [`chain::Confirm`] for calling expectations.
36310 * [`block_disconnected`]: Self::block_disconnected
36312 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);
36315 * Updates the monitor with the current best chain tip, returning new outputs to watch. See
36316 * [`block_connected`] for details.
36318 * Used instead of [`block_connected`] by clients that are notified of transactions rather than
36319 * blocks. See [`chain::Confirm`] for calling expectations.
36321 * [`block_connected`]: Self::block_connected
36323 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);
36326 * Returns the set of txids that should be monitored for re-organization out of the chain.
36328 MUST_USE_RES struct LDKCVec_C3Tuple_ThirtyTwoBytesu32COption_ThirtyTwoBytesZZZ ChannelMonitor_get_relevant_txids(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
36331 * Gets the latest best block which was connected either via the [`chain::Listen`] or
36332 * [`chain::Confirm`] interfaces.
36334 MUST_USE_RES struct LDKBestBlock ChannelMonitor_current_best_block(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
36337 * Triggers rebroadcasts/fee-bumps of pending claims from a force-closed channel. This is
36338 * crucial in preventing certain classes of pinning attacks, detecting substantial mempool
36339 * feerate changes between blocks, and ensuring reliability if broadcasting fails. We recommend
36340 * invoking this every 30 seconds, or lower if running in an environment with spotty
36341 * connections, like on mobile.
36343 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);
36346 * Triggers rebroadcasts of pending claims from a force-closed channel after a transaction
36347 * signature generation failure.
36349 void ChannelMonitor_signer_unblocked(const struct LDKChannelMonitor *NONNULL_PTR this_arg, struct LDKBroadcasterInterface broadcaster, struct LDKFeeEstimator fee_estimator, const struct LDKLogger *NONNULL_PTR logger);
36352 * Returns the descriptors for relevant outputs (i.e., those that we can spend) within the
36353 * transaction if they exist and the transaction has at least [`ANTI_REORG_DELAY`]
36354 * confirmations. For [`SpendableOutputDescriptor::DelayedPaymentOutput`] descriptors to be
36355 * returned, the transaction must have at least `max(ANTI_REORG_DELAY, to_self_delay)`
36358 * Descriptors returned by this method are primarily exposed via [`Event::SpendableOutputs`]
36359 * once they are no longer under reorg risk. This method serves as a way to retrieve these
36360 * descriptors at a later time, either for historical purposes, or to replay any
36361 * missed/unhandled descriptors. For the purpose of gathering historical records, if the
36362 * channel close has fully resolved (i.e., [`ChannelMonitor::get_claimable_balances`] returns
36363 * an empty set), you can retrieve all spendable outputs by providing all descendant spending
36364 * transactions starting from the channel's funding transaction and going down three levels.
36366 * `tx` is a transaction we'll scan the outputs of. Any transaction can be provided. If any
36367 * outputs which can be spent by us are found, at least one descriptor is returned.
36369 * `confirmation_height` must be the height of the block in which `tx` was included in.
36371 MUST_USE_RES struct LDKCVec_SpendableOutputDescriptorZ ChannelMonitor_get_spendable_outputs(const struct LDKChannelMonitor *NONNULL_PTR this_arg, struct LDKTransaction tx, uint32_t confirmation_height);
36374 * Checks if the monitor is fully resolved. Resolved monitor is one that has claimed all of
36375 * its outputs and balances (i.e. [`Self::get_claimable_balances`] returns an empty set).
36377 * This function returns true only if [`Self::get_claimable_balances`] has been empty for at least
36378 * 4032 blocks as an additional protection against any bugs resulting in spuriously empty balance sets.
36380 MUST_USE_RES bool ChannelMonitor_is_fully_resolved(const struct LDKChannelMonitor *NONNULL_PTR this_arg, const struct LDKLogger *NONNULL_PTR logger);
36383 * Gets the balances in this channel which are either claimable by us if we were to
36384 * force-close the channel now or which are claimable on-chain (possibly awaiting
36387 * Any balances in the channel which are available on-chain (excluding on-chain fees) are
36388 * included here until an [`Event::SpendableOutputs`] event has been generated for the
36389 * balance, or until our counterparty has claimed the balance and accrued several
36390 * confirmations on the claim transaction.
36392 * Note that for `ChannelMonitors` which track a channel which went on-chain with versions of
36393 * LDK prior to 0.0.111, not all or excess balances may be included.
36395 * See [`Balance`] for additional details on the types of claimable balances which
36396 * may be returned here and their meanings.
36398 MUST_USE_RES struct LDKCVec_BalanceZ ChannelMonitor_get_claimable_balances(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
36401 * Read a C2Tuple_ThirtyTwoBytesChannelMonitorZ from a byte array, created by C2Tuple_ThirtyTwoBytesChannelMonitorZ_write
36403 struct LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ C2Tuple_ThirtyTwoBytesChannelMonitorZ_read(struct LDKu8slice ser, const struct LDKEntropySource *NONNULL_PTR arg_a, const struct LDKSignerProvider *NONNULL_PTR arg_b);
36406 * Frees any resources used by the OutPoint, if is_owned is set and inner is non-NULL.
36408 void OutPoint_free(struct LDKOutPoint this_obj);
36411 * The referenced transaction's txid.
36413 const uint8_t (*OutPoint_get_txid(const struct LDKOutPoint *NONNULL_PTR this_ptr))[32];
36416 * The referenced transaction's txid.
36418 void OutPoint_set_txid(struct LDKOutPoint *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
36421 * The index of the referenced output in its transaction's vout.
36423 uint16_t OutPoint_get_index(const struct LDKOutPoint *NONNULL_PTR this_ptr);
36426 * The index of the referenced output in its transaction's vout.
36428 void OutPoint_set_index(struct LDKOutPoint *NONNULL_PTR this_ptr, uint16_t val);
36431 * Constructs a new OutPoint given each field
36433 MUST_USE_RES struct LDKOutPoint OutPoint_new(struct LDKThirtyTwoBytes txid_arg, uint16_t index_arg);
36436 * Creates a copy of the OutPoint
36438 struct LDKOutPoint OutPoint_clone(const struct LDKOutPoint *NONNULL_PTR orig);
36441 * Checks if two OutPoints contain equal inner contents.
36442 * This ignores pointers and is_owned flags and looks at the values in fields.
36443 * Two objects with NULL inner values will be considered "equal" here.
36445 bool OutPoint_eq(const struct LDKOutPoint *NONNULL_PTR a, const struct LDKOutPoint *NONNULL_PTR b);
36448 * Generates a non-cryptographic 64-bit hash of the OutPoint.
36450 uint64_t OutPoint_hash(const struct LDKOutPoint *NONNULL_PTR o);
36453 * Get the string representation of a OutPoint object
36455 struct LDKStr OutPoint_to_str(const struct LDKOutPoint *NONNULL_PTR o);
36458 * Serialize the OutPoint object into a byte array which can be read by OutPoint_read
36460 struct LDKCVec_u8Z OutPoint_write(const struct LDKOutPoint *NONNULL_PTR obj);
36463 * Read a OutPoint from a byte array, created by OutPoint_write
36465 struct LDKCResult_OutPointDecodeErrorZ OutPoint_read(struct LDKu8slice ser);
36468 * Frees any resources used by the InboundHTLCErr, if is_owned is set and inner is non-NULL.
36470 void InboundHTLCErr_free(struct LDKInboundHTLCErr this_obj);
36473 * BOLT 4 error code.
36475 uint16_t InboundHTLCErr_get_err_code(const struct LDKInboundHTLCErr *NONNULL_PTR this_ptr);
36478 * BOLT 4 error code.
36480 void InboundHTLCErr_set_err_code(struct LDKInboundHTLCErr *NONNULL_PTR this_ptr, uint16_t val);
36483 * Data attached to this error.
36485 * Returns a copy of the field.
36487 struct LDKCVec_u8Z InboundHTLCErr_get_err_data(const struct LDKInboundHTLCErr *NONNULL_PTR this_ptr);
36490 * Data attached to this error.
36492 void InboundHTLCErr_set_err_data(struct LDKInboundHTLCErr *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val);
36495 * Error message text.
36497 struct LDKStr InboundHTLCErr_get_msg(const struct LDKInboundHTLCErr *NONNULL_PTR this_ptr);
36500 * Error message text.
36502 void InboundHTLCErr_set_msg(struct LDKInboundHTLCErr *NONNULL_PTR this_ptr, struct LDKStr val);
36505 * Constructs a new InboundHTLCErr given each field
36507 MUST_USE_RES struct LDKInboundHTLCErr InboundHTLCErr_new(uint16_t err_code_arg, struct LDKCVec_u8Z err_data_arg, struct LDKStr msg_arg);
36510 * Creates a copy of the InboundHTLCErr
36512 struct LDKInboundHTLCErr InboundHTLCErr_clone(const struct LDKInboundHTLCErr *NONNULL_PTR orig);
36515 * Generates a non-cryptographic 64-bit hash of the InboundHTLCErr.
36517 uint64_t InboundHTLCErr_hash(const struct LDKInboundHTLCErr *NONNULL_PTR o);
36520 * Checks if two InboundHTLCErrs contain equal inner contents.
36521 * This ignores pointers and is_owned flags and looks at the values in fields.
36522 * Two objects with NULL inner values will be considered "equal" here.
36524 bool InboundHTLCErr_eq(const struct LDKInboundHTLCErr *NONNULL_PTR a, const struct LDKInboundHTLCErr *NONNULL_PTR b);
36527 * Peel one layer off an incoming onion, returning a [`PendingHTLCInfo`] that contains information
36528 * about the intended next-hop for the HTLC.
36530 * This does all the relevant context-free checks that LDK requires for payment relay or
36531 * acceptance. If the payment is to be received, and the amount matches the expected amount for
36532 * a given invoice, this indicates the [`msgs::UpdateAddHTLC`], once fully committed in the
36533 * channel, will generate an [`Event::PaymentClaimable`].
36535 * [`Event::PaymentClaimable`]: crate::events::Event::PaymentClaimable
36537 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);
36540 * Frees any resources used by the PendingHTLCRouting
36542 void PendingHTLCRouting_free(struct LDKPendingHTLCRouting this_ptr);
36545 * Creates a copy of the PendingHTLCRouting
36547 struct LDKPendingHTLCRouting PendingHTLCRouting_clone(const struct LDKPendingHTLCRouting *NONNULL_PTR orig);
36550 * Utility method to constructs a new Forward-variant PendingHTLCRouting
36552 struct LDKPendingHTLCRouting PendingHTLCRouting_forward(struct LDKOnionPacket onion_packet, uint64_t short_channel_id, struct LDKBlindedForward blinded);
36555 * Utility method to constructs a new Receive-variant PendingHTLCRouting
36557 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);
36560 * Utility method to constructs a new ReceiveKeysend-variant PendingHTLCRouting
36562 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);
36565 * Frees any resources used by the BlindedForward, if is_owned is set and inner is non-NULL.
36567 void BlindedForward_free(struct LDKBlindedForward this_obj);
36570 * The `blinding_point` that was set in the inbound [`msgs::UpdateAddHTLC`], or in the inbound
36571 * onion payload if we're the introduction node. Useful for calculating the next hop's
36572 * [`msgs::UpdateAddHTLC::blinding_point`].
36574 struct LDKPublicKey BlindedForward_get_inbound_blinding_point(const struct LDKBlindedForward *NONNULL_PTR this_ptr);
36577 * The `blinding_point` that was set in the inbound [`msgs::UpdateAddHTLC`], or in the inbound
36578 * onion payload if we're the introduction node. Useful for calculating the next hop's
36579 * [`msgs::UpdateAddHTLC::blinding_point`].
36581 void BlindedForward_set_inbound_blinding_point(struct LDKBlindedForward *NONNULL_PTR this_ptr, struct LDKPublicKey val);
36584 * If needed, this determines how this HTLC should be failed backwards, based on whether we are
36585 * the introduction node.
36587 enum LDKBlindedFailure BlindedForward_get_failure(const struct LDKBlindedForward *NONNULL_PTR this_ptr);
36590 * If needed, this determines how this HTLC should be failed backwards, based on whether we are
36591 * the introduction node.
36593 void BlindedForward_set_failure(struct LDKBlindedForward *NONNULL_PTR this_ptr, enum LDKBlindedFailure val);
36596 * Constructs a new BlindedForward given each field
36598 MUST_USE_RES struct LDKBlindedForward BlindedForward_new(struct LDKPublicKey inbound_blinding_point_arg, enum LDKBlindedFailure failure_arg);
36601 * Creates a copy of the BlindedForward
36603 struct LDKBlindedForward BlindedForward_clone(const struct LDKBlindedForward *NONNULL_PTR orig);
36606 * Generates a non-cryptographic 64-bit hash of the BlindedForward.
36608 uint64_t BlindedForward_hash(const struct LDKBlindedForward *NONNULL_PTR o);
36611 * Checks if two BlindedForwards contain equal inner contents.
36612 * This ignores pointers and is_owned flags and looks at the values in fields.
36613 * Two objects with NULL inner values will be considered "equal" here.
36615 bool BlindedForward_eq(const struct LDKBlindedForward *NONNULL_PTR a, const struct LDKBlindedForward *NONNULL_PTR b);
36618 * Frees any resources used by the PendingHTLCInfo, if is_owned is set and inner is non-NULL.
36620 void PendingHTLCInfo_free(struct LDKPendingHTLCInfo this_obj);
36623 * Further routing details based on whether the HTLC is being forwarded or received.
36625 struct LDKPendingHTLCRouting PendingHTLCInfo_get_routing(const struct LDKPendingHTLCInfo *NONNULL_PTR this_ptr);
36628 * Further routing details based on whether the HTLC is being forwarded or received.
36630 void PendingHTLCInfo_set_routing(struct LDKPendingHTLCInfo *NONNULL_PTR this_ptr, struct LDKPendingHTLCRouting val);
36633 * The onion shared secret we build with the sender used to decrypt the onion.
36635 * This is later used to encrypt failure packets in the event that the HTLC is failed.
36637 const uint8_t (*PendingHTLCInfo_get_incoming_shared_secret(const struct LDKPendingHTLCInfo *NONNULL_PTR this_ptr))[32];
36640 * The onion shared secret we build with the sender used to decrypt the onion.
36642 * This is later used to encrypt failure packets in the event that the HTLC is failed.
36644 void PendingHTLCInfo_set_incoming_shared_secret(struct LDKPendingHTLCInfo *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
36647 * Hash of the payment preimage, to lock the payment until the receiver releases the preimage.
36649 const uint8_t (*PendingHTLCInfo_get_payment_hash(const struct LDKPendingHTLCInfo *NONNULL_PTR this_ptr))[32];
36652 * Hash of the payment preimage, to lock the payment until the receiver releases the preimage.
36654 void PendingHTLCInfo_set_payment_hash(struct LDKPendingHTLCInfo *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
36657 * Amount received in the incoming HTLC.
36659 * This field was added in LDK 0.0.113 and will be `None` for objects written by prior
36662 struct LDKCOption_u64Z PendingHTLCInfo_get_incoming_amt_msat(const struct LDKPendingHTLCInfo *NONNULL_PTR this_ptr);
36665 * Amount received in the incoming HTLC.
36667 * This field was added in LDK 0.0.113 and will be `None` for objects written by prior
36670 void PendingHTLCInfo_set_incoming_amt_msat(struct LDKPendingHTLCInfo *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
36673 * The amount the sender indicated should be forwarded on to the next hop or amount the sender
36674 * intended for us to receive for received payments.
36676 * If the received amount is less than this for received payments, an intermediary hop has
36677 * attempted to steal some of our funds and we should fail the HTLC (the sender should retry
36678 * it along another path).
36680 * Because nodes can take less than their required fees, and because senders may wish to
36681 * improve their own privacy, this amount may be less than [`Self::incoming_amt_msat`] for
36682 * received payments. In such cases, recipients must handle this HTLC as if it had received
36683 * [`Self::outgoing_amt_msat`].
36685 uint64_t PendingHTLCInfo_get_outgoing_amt_msat(const struct LDKPendingHTLCInfo *NONNULL_PTR this_ptr);
36688 * The amount the sender indicated should be forwarded on to the next hop or amount the sender
36689 * intended for us to receive for received payments.
36691 * If the received amount is less than this for received payments, an intermediary hop has
36692 * attempted to steal some of our funds and we should fail the HTLC (the sender should retry
36693 * it along another path).
36695 * Because nodes can take less than their required fees, and because senders may wish to
36696 * improve their own privacy, this amount may be less than [`Self::incoming_amt_msat`] for
36697 * received payments. In such cases, recipients must handle this HTLC as if it had received
36698 * [`Self::outgoing_amt_msat`].
36700 void PendingHTLCInfo_set_outgoing_amt_msat(struct LDKPendingHTLCInfo *NONNULL_PTR this_ptr, uint64_t val);
36703 * The CLTV the sender has indicated we should set on the forwarded HTLC (or has indicated
36704 * should have been set on the received HTLC for received payments).
36706 uint32_t PendingHTLCInfo_get_outgoing_cltv_value(const struct LDKPendingHTLCInfo *NONNULL_PTR this_ptr);
36709 * The CLTV the sender has indicated we should set on the forwarded HTLC (or has indicated
36710 * should have been set on the received HTLC for received payments).
36712 void PendingHTLCInfo_set_outgoing_cltv_value(struct LDKPendingHTLCInfo *NONNULL_PTR this_ptr, uint32_t val);
36715 * The fee taken for this HTLC in addition to the standard protocol HTLC fees.
36717 * If this is a payment for forwarding, this is the fee we are taking before forwarding the
36720 * If this is a received payment, this is the fee that our counterparty took.
36722 * This is used to allow LSPs to take fees as a part of payments, without the sender having to
36725 struct LDKCOption_u64Z PendingHTLCInfo_get_skimmed_fee_msat(const struct LDKPendingHTLCInfo *NONNULL_PTR this_ptr);
36728 * The fee taken for this HTLC in addition to the standard protocol HTLC fees.
36730 * If this is a payment for forwarding, this is the fee we are taking before forwarding the
36733 * If this is a received payment, this is the fee that our counterparty took.
36735 * This is used to allow LSPs to take fees as a part of payments, without the sender having to
36738 void PendingHTLCInfo_set_skimmed_fee_msat(struct LDKPendingHTLCInfo *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
36741 * Constructs a new PendingHTLCInfo given each field
36743 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);
36746 * Creates a copy of the PendingHTLCInfo
36748 struct LDKPendingHTLCInfo PendingHTLCInfo_clone(const struct LDKPendingHTLCInfo *NONNULL_PTR orig);
36751 * Creates a copy of the BlindedFailure
36753 enum LDKBlindedFailure BlindedFailure_clone(const enum LDKBlindedFailure *NONNULL_PTR orig);
36756 * Utility method to constructs a new FromIntroductionNode-variant BlindedFailure
36758 enum LDKBlindedFailure BlindedFailure_from_introduction_node(void);
36761 * Utility method to constructs a new FromBlindedNode-variant BlindedFailure
36763 enum LDKBlindedFailure BlindedFailure_from_blinded_node(void);
36766 * Generates a non-cryptographic 64-bit hash of the BlindedFailure.
36768 uint64_t BlindedFailure_hash(const enum LDKBlindedFailure *NONNULL_PTR o);
36771 * Checks if two BlindedFailures contain equal inner contents.
36772 * This ignores pointers and is_owned flags and looks at the values in fields.
36774 bool BlindedFailure_eq(const enum LDKBlindedFailure *NONNULL_PTR a, const enum LDKBlindedFailure *NONNULL_PTR b);
36777 * Frees any resources used by the FailureCode
36779 void FailureCode_free(struct LDKFailureCode this_ptr);
36782 * Creates a copy of the FailureCode
36784 struct LDKFailureCode FailureCode_clone(const struct LDKFailureCode *NONNULL_PTR orig);
36787 * Utility method to constructs a new TemporaryNodeFailure-variant FailureCode
36789 struct LDKFailureCode FailureCode_temporary_node_failure(void);
36792 * Utility method to constructs a new RequiredNodeFeatureMissing-variant FailureCode
36794 struct LDKFailureCode FailureCode_required_node_feature_missing(void);
36797 * Utility method to constructs a new IncorrectOrUnknownPaymentDetails-variant FailureCode
36799 struct LDKFailureCode FailureCode_incorrect_or_unknown_payment_details(void);
36802 * Utility method to constructs a new InvalidOnionPayload-variant FailureCode
36804 struct LDKFailureCode FailureCode_invalid_onion_payload(struct LDKCOption_C2Tuple_u64u16ZZ a);
36807 * Frees any resources used by the ChannelManager, if is_owned is set and inner is non-NULL.
36809 void ChannelManager_free(struct LDKChannelManager this_obj);
36812 * Frees any resources used by the ChainParameters, if is_owned is set and inner is non-NULL.
36814 void ChainParameters_free(struct LDKChainParameters this_obj);
36817 * The network for determining the `chain_hash` in Lightning messages.
36819 enum LDKNetwork ChainParameters_get_network(const struct LDKChainParameters *NONNULL_PTR this_ptr);
36822 * The network for determining the `chain_hash` in Lightning messages.
36824 void ChainParameters_set_network(struct LDKChainParameters *NONNULL_PTR this_ptr, enum LDKNetwork val);
36827 * The hash and height of the latest block successfully connected.
36829 * Used to track on-chain channel funding outputs and send payments with reliable timelocks.
36831 struct LDKBestBlock ChainParameters_get_best_block(const struct LDKChainParameters *NONNULL_PTR this_ptr);
36834 * The hash and height of the latest block successfully connected.
36836 * Used to track on-chain channel funding outputs and send payments with reliable timelocks.
36838 void ChainParameters_set_best_block(struct LDKChainParameters *NONNULL_PTR this_ptr, struct LDKBestBlock val);
36841 * Constructs a new ChainParameters given each field
36843 MUST_USE_RES struct LDKChainParameters ChainParameters_new(enum LDKNetwork network_arg, struct LDKBestBlock best_block_arg);
36846 * Creates a copy of the ChainParameters
36848 struct LDKChainParameters ChainParameters_clone(const struct LDKChainParameters *NONNULL_PTR orig);
36851 * Frees any resources used by the RecentPaymentDetails
36853 void RecentPaymentDetails_free(struct LDKRecentPaymentDetails this_ptr);
36856 * Creates a copy of the RecentPaymentDetails
36858 struct LDKRecentPaymentDetails RecentPaymentDetails_clone(const struct LDKRecentPaymentDetails *NONNULL_PTR orig);
36861 * Utility method to constructs a new AwaitingInvoice-variant RecentPaymentDetails
36863 struct LDKRecentPaymentDetails RecentPaymentDetails_awaiting_invoice(struct LDKThirtyTwoBytes payment_id);
36866 * Utility method to constructs a new Pending-variant RecentPaymentDetails
36868 struct LDKRecentPaymentDetails RecentPaymentDetails_pending(struct LDKThirtyTwoBytes payment_id, struct LDKThirtyTwoBytes payment_hash, uint64_t total_msat);
36871 * Utility method to constructs a new Fulfilled-variant RecentPaymentDetails
36873 struct LDKRecentPaymentDetails RecentPaymentDetails_fulfilled(struct LDKThirtyTwoBytes payment_id, struct LDKCOption_ThirtyTwoBytesZ payment_hash);
36876 * Utility method to constructs a new Abandoned-variant RecentPaymentDetails
36878 struct LDKRecentPaymentDetails RecentPaymentDetails_abandoned(struct LDKThirtyTwoBytes payment_id, struct LDKThirtyTwoBytes payment_hash);
36881 * Frees any resources used by the PhantomRouteHints, if is_owned is set and inner is non-NULL.
36883 void PhantomRouteHints_free(struct LDKPhantomRouteHints this_obj);
36886 * The list of channels to be included in the invoice route hints.
36888 struct LDKCVec_ChannelDetailsZ PhantomRouteHints_get_channels(const struct LDKPhantomRouteHints *NONNULL_PTR this_ptr);
36891 * The list of channels to be included in the invoice route hints.
36893 void PhantomRouteHints_set_channels(struct LDKPhantomRouteHints *NONNULL_PTR this_ptr, struct LDKCVec_ChannelDetailsZ val);
36896 * A fake scid used for representing the phantom node's fake channel in generating the invoice
36899 uint64_t PhantomRouteHints_get_phantom_scid(const struct LDKPhantomRouteHints *NONNULL_PTR this_ptr);
36902 * A fake scid used for representing the phantom node's fake channel in generating the invoice
36905 void PhantomRouteHints_set_phantom_scid(struct LDKPhantomRouteHints *NONNULL_PTR this_ptr, uint64_t val);
36908 * The pubkey of the real backing node that would ultimately receive the payment.
36910 struct LDKPublicKey PhantomRouteHints_get_real_node_pubkey(const struct LDKPhantomRouteHints *NONNULL_PTR this_ptr);
36913 * The pubkey of the real backing node that would ultimately receive the payment.
36915 void PhantomRouteHints_set_real_node_pubkey(struct LDKPhantomRouteHints *NONNULL_PTR this_ptr, struct LDKPublicKey val);
36918 * Constructs a new PhantomRouteHints given each field
36920 MUST_USE_RES struct LDKPhantomRouteHints PhantomRouteHints_new(struct LDKCVec_ChannelDetailsZ channels_arg, uint64_t phantom_scid_arg, struct LDKPublicKey real_node_pubkey_arg);
36923 * Creates a copy of the PhantomRouteHints
36925 struct LDKPhantomRouteHints PhantomRouteHints_clone(const struct LDKPhantomRouteHints *NONNULL_PTR orig);
36928 * Constructs a new `ChannelManager` to hold several channels and route between them.
36930 * The current time or latest block header time can be provided as the `current_timestamp`.
36932 * This is the main \"logic hub\" for all channel-related actions, and implements
36933 * [`ChannelMessageHandler`].
36935 * Non-proportional fees are fixed according to our risk using the provided fee estimator.
36937 * Users need to notify the new `ChannelManager` when a new block is connected or
36938 * disconnected using its [`block_connected`] and [`block_disconnected`] methods, starting
36939 * from after [`params.best_block.block_hash`]. See [`chain::Listen`] and [`chain::Confirm`] for
36942 * [`block_connected`]: chain::Listen::block_connected
36943 * [`block_disconnected`]: chain::Listen::block_disconnected
36944 * [`params.best_block.block_hash`]: chain::BestBlock::block_hash
36946 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);
36949 * Gets the current configuration applied to all new channels.
36951 MUST_USE_RES struct LDKUserConfig ChannelManager_get_current_default_configuration(const struct LDKChannelManager *NONNULL_PTR this_arg);
36954 * Creates a new outbound channel to the given remote node and with the given value.
36956 * `user_channel_id` will be provided back as in
36957 * [`Event::FundingGenerationReady::user_channel_id`] to allow tracking of which events
36958 * correspond with which `create_channel` call. Note that the `user_channel_id` defaults to a
36959 * randomized value for inbound channels. `user_channel_id` has no meaning inside of LDK, it
36960 * is simply copied to events and otherwise ignored.
36962 * Raises [`APIError::APIMisuseError`] when `channel_value_satoshis` > 2**24 or `push_msat` is
36963 * greater than `channel_value_satoshis * 1k` or `channel_value_satoshis < 1000`.
36965 * Raises [`APIError::ChannelUnavailable`] if the channel cannot be opened due to failing to
36966 * generate a shutdown scriptpubkey or destination script set by
36967 * [`SignerProvider::get_shutdown_scriptpubkey`] or [`SignerProvider::get_destination_script`].
36969 * Note that we do not check if you are currently connected to the given peer. If no
36970 * connection is available, the outbound `open_channel` message may fail to send, resulting in
36971 * the channel eventually being silently forgotten (dropped on reload).
36973 * If `temporary_channel_id` is specified, it will be used as the temporary channel ID of the
36974 * channel. Otherwise, a random one will be generated for you.
36976 * Returns the new Channel's temporary `channel_id`. This ID will appear as
36977 * [`Event::FundingGenerationReady::temporary_channel_id`] and in
36978 * [`ChannelDetails::channel_id`] until after
36979 * [`ChannelManager::funding_transaction_generated`] is called, swapping the Channel's ID for
36980 * one derived from the funding transaction's TXID. If the counterparty rejects the channel
36981 * immediately, this temporary ID will appear in [`Event::ChannelClosed::channel_id`].
36983 * [`Event::FundingGenerationReady::user_channel_id`]: events::Event::FundingGenerationReady::user_channel_id
36984 * [`Event::FundingGenerationReady::temporary_channel_id`]: events::Event::FundingGenerationReady::temporary_channel_id
36985 * [`Event::ChannelClosed::channel_id`]: events::Event::ChannelClosed::channel_id
36987 * Note that temporary_channel_id (or a relevant inner pointer) may be NULL or all-0s to represent None
36988 * Note that override_config (or a relevant inner pointer) may be NULL or all-0s to represent None
36990 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);
36993 * Gets the list of open channels, in random order. See [`ChannelDetails`] field documentation for
36994 * more information.
36996 MUST_USE_RES struct LDKCVec_ChannelDetailsZ ChannelManager_list_channels(const struct LDKChannelManager *NONNULL_PTR this_arg);
36999 * Gets the list of usable channels, in random order. Useful as an argument to
37000 * [`Router::find_route`] to ensure non-announced channels are used.
37002 * These are guaranteed to have their [`ChannelDetails::is_usable`] value set to true, see the
37003 * documentation for [`ChannelDetails::is_usable`] for more info on exactly what the criteria
37006 MUST_USE_RES struct LDKCVec_ChannelDetailsZ ChannelManager_list_usable_channels(const struct LDKChannelManager *NONNULL_PTR this_arg);
37009 * Gets the list of channels we have with a given counterparty, in random order.
37011 MUST_USE_RES struct LDKCVec_ChannelDetailsZ ChannelManager_list_channels_with_counterparty(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKPublicKey counterparty_node_id);
37014 * Returns in an undefined order recent payments that -- if not fulfilled -- have yet to find a
37015 * successful path, or have unresolved HTLCs.
37017 * This can be useful for payments that may have been prepared, but ultimately not sent, as a
37018 * result of a crash. If such a payment exists, is not listed here, and an
37019 * [`Event::PaymentSent`] has not been received, you may consider resending the payment.
37021 * [`Event::PaymentSent`]: events::Event::PaymentSent
37023 MUST_USE_RES struct LDKCVec_RecentPaymentDetailsZ ChannelManager_list_recent_payments(const struct LDKChannelManager *NONNULL_PTR this_arg);
37026 * Begins the process of closing a channel. After this call (plus some timeout), no new HTLCs
37027 * will be accepted on the given channel, and after additional timeout/the closing of all
37028 * pending HTLCs, the channel will be closed on chain.
37030 * * If we are the channel initiator, we will pay between our [`ChannelCloseMinimum`] and
37031 * [`ChannelConfig::force_close_avoidance_max_fee_satoshis`] plus our [`NonAnchorChannelFee`]
37033 * * If our counterparty is the channel initiator, we will require a channel closing
37034 * transaction feerate of at least our [`ChannelCloseMinimum`] feerate or the feerate which
37035 * would appear on a force-closure transaction, whichever is lower. We will allow our
37036 * counterparty to pay as much fee as they'd like, however.
37038 * May generate a [`SendShutdown`] message event on success, which should be relayed.
37040 * Raises [`APIError::ChannelUnavailable`] if the channel cannot be closed due to failing to
37041 * generate a shutdown scriptpubkey or destination script set by
37042 * [`SignerProvider::get_shutdown_scriptpubkey`]. A force-closure may be needed to close the
37045 * [`ChannelConfig::force_close_avoidance_max_fee_satoshis`]: crate::util::config::ChannelConfig::force_close_avoidance_max_fee_satoshis
37046 * [`ChannelCloseMinimum`]: crate::chain::chaininterface::ConfirmationTarget::ChannelCloseMinimum
37047 * [`NonAnchorChannelFee`]: crate::chain::chaininterface::ConfirmationTarget::NonAnchorChannelFee
37048 * [`SendShutdown`]: crate::events::MessageSendEvent::SendShutdown
37050 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);
37053 * Begins the process of closing a channel. After this call (plus some timeout), no new HTLCs
37054 * will be accepted on the given channel, and after additional timeout/the closing of all
37055 * pending HTLCs, the channel will be closed on chain.
37057 * `target_feerate_sat_per_1000_weight` has different meanings depending on if we initiated
37058 * the channel being closed or not:
37059 * * If we are the channel initiator, we will pay at least this feerate on the closing
37060 * transaction. The upper-bound is set by
37061 * [`ChannelConfig::force_close_avoidance_max_fee_satoshis`] plus our [`NonAnchorChannelFee`]
37062 * fee estimate (or `target_feerate_sat_per_1000_weight`, if it is greater).
37063 * * If our counterparty is the channel initiator, we will refuse to accept a channel closure
37064 * transaction feerate below `target_feerate_sat_per_1000_weight` (or the feerate which
37065 * will appear on a force-closure transaction, whichever is lower).
37067 * The `shutdown_script` provided will be used as the `scriptPubKey` for the closing transaction.
37068 * Will fail if a shutdown script has already been set for this channel by
37069 * ['ChannelHandshakeConfig::commit_upfront_shutdown_pubkey`]. The given shutdown script must
37070 * also be compatible with our and the counterparty's features.
37072 * May generate a [`SendShutdown`] message event on success, which should be relayed.
37074 * Raises [`APIError::ChannelUnavailable`] if the channel cannot be closed due to failing to
37075 * generate a shutdown scriptpubkey or destination script set by
37076 * [`SignerProvider::get_shutdown_scriptpubkey`]. A force-closure may be needed to close the
37079 * [`ChannelConfig::force_close_avoidance_max_fee_satoshis`]: crate::util::config::ChannelConfig::force_close_avoidance_max_fee_satoshis
37080 * [`NonAnchorChannelFee`]: crate::chain::chaininterface::ConfirmationTarget::NonAnchorChannelFee
37081 * [`SendShutdown`]: crate::events::MessageSendEvent::SendShutdown
37083 * Note that shutdown_script (or a relevant inner pointer) may be NULL or all-0s to represent None
37085 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);
37088 * Force closes a channel, immediately broadcasting the latest local transaction(s) and
37089 * rejecting new HTLCs on the given channel. Fails if `channel_id` is unknown to
37090 * the manager, or if the `counterparty_node_id` isn't the counterparty of the corresponding
37093 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);
37096 * Force closes a channel, rejecting new HTLCs on the given channel but skips broadcasting
37097 * the latest local transaction(s). Fails if `channel_id` is unknown to the manager, or if the
37098 * `counterparty_node_id` isn't the counterparty of the corresponding channel.
37100 * You can always broadcast the latest local transaction(s) via
37101 * [`ChannelMonitor::broadcast_latest_holder_commitment_txn`].
37103 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);
37106 * Force close all channels, immediately broadcasting the latest local commitment transaction
37107 * for each to the chain and rejecting new HTLCs on each.
37109 void ChannelManager_force_close_all_channels_broadcasting_latest_txn(const struct LDKChannelManager *NONNULL_PTR this_arg);
37112 * Force close all channels rejecting new HTLCs on each but without broadcasting the latest
37113 * local transaction(s).
37115 void ChannelManager_force_close_all_channels_without_broadcasting_txn(const struct LDKChannelManager *NONNULL_PTR this_arg);
37118 * Sends a payment along a given route.
37120 * Value parameters are provided via the last hop in route, see documentation for [`RouteHop`]
37121 * fields for more info.
37123 * May generate [`UpdateHTLCs`] message(s) event on success, which should be relayed (e.g. via
37124 * [`PeerManager::process_events`]).
37126 * # Avoiding Duplicate Payments
37128 * If a pending payment is currently in-flight with the same [`PaymentId`] provided, this
37129 * method will error with an [`APIError::InvalidRoute`]. Note, however, that once a payment
37130 * is no longer pending (either via [`ChannelManager::abandon_payment`], or handling of an
37131 * [`Event::PaymentSent`] or [`Event::PaymentFailed`]) LDK will not stop you from sending a
37132 * second payment with the same [`PaymentId`].
37134 * Thus, in order to ensure duplicate payments are not sent, you should implement your own
37135 * tracking of payments, including state to indicate once a payment has completed. Because you
37136 * should also ensure that [`PaymentHash`]es are not re-used, for simplicity, you should
37137 * consider using the [`PaymentHash`] as the key for tracking payments. In that case, the
37138 * [`PaymentId`] should be a copy of the [`PaymentHash`] bytes.
37140 * Additionally, in the scenario where we begin the process of sending a payment, but crash
37141 * before `send_payment` returns (or prior to [`ChannelMonitorUpdate`] persistence if you're
37142 * using [`ChannelMonitorUpdateStatus::InProgress`]), the payment may be lost on restart. See
37143 * [`ChannelManager::list_recent_payments`] for more information.
37145 * # Possible Error States on [`PaymentSendFailure`]
37147 * Each path may have a different return value, and [`PaymentSendFailure`] may return a `Vec` with
37148 * each entry matching the corresponding-index entry in the route paths, see
37149 * [`PaymentSendFailure`] for more info.
37151 * In general, a path may raise:
37152 * * [`APIError::InvalidRoute`] when an invalid route or forwarding parameter (cltv_delta, fee,
37153 * node public key) is specified.
37154 * * [`APIError::ChannelUnavailable`] if the next-hop channel is not available as it has been
37155 * closed, doesn't exist, or the peer is currently disconnected.
37156 * * [`APIError::MonitorUpdateInProgress`] if a new monitor update failure prevented sending the
37157 * relevant updates.
37159 * Note that depending on the type of the [`PaymentSendFailure`] the HTLC may have been
37160 * irrevocably committed to on our end. In such a case, do NOT retry the payment with a
37161 * different route unless you intend to pay twice!
37163 * [`RouteHop`]: crate::routing::router::RouteHop
37164 * [`Event::PaymentSent`]: events::Event::PaymentSent
37165 * [`Event::PaymentFailed`]: events::Event::PaymentFailed
37166 * [`UpdateHTLCs`]: events::MessageSendEvent::UpdateHTLCs
37167 * [`PeerManager::process_events`]: crate::ln::peer_handler::PeerManager::process_events
37168 * [`ChannelMonitorUpdateStatus::InProgress`]: crate::chain::ChannelMonitorUpdateStatus::InProgress
37170 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);
37173 * Similar to [`ChannelManager::send_payment_with_route`], but will automatically find a route based on
37174 * `route_params` and retry failed payment paths based on `retry_strategy`.
37176 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);
37179 * Signals that no further attempts for the given payment should occur. Useful if you have a
37180 * pending outbound payment with retries remaining, but wish to stop retrying the payment before
37181 * retries are exhausted.
37183 * # Event Generation
37185 * If no [`Event::PaymentFailed`] event had been generated before, one will be generated as soon
37186 * as there are no remaining pending HTLCs for this payment.
37188 * Note that calling this method does *not* prevent a payment from succeeding. You must still
37189 * wait until you receive either a [`Event::PaymentFailed`] or [`Event::PaymentSent`] event to
37190 * determine the ultimate status of a payment.
37192 * # Requested Invoices
37194 * In the case of paying a [`Bolt12Invoice`] via [`ChannelManager::pay_for_offer`], abandoning
37195 * the payment prior to receiving the invoice will result in an [`Event::InvoiceRequestFailed`]
37196 * and prevent any attempts at paying it once received. The other events may only be generated
37197 * once the invoice has been received.
37199 * # Restart Behavior
37201 * If an [`Event::PaymentFailed`] is generated and we restart without first persisting the
37202 * [`ChannelManager`], another [`Event::PaymentFailed`] may be generated; likewise for
37203 * [`Event::InvoiceRequestFailed`].
37205 * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice
37207 void ChannelManager_abandon_payment(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKThirtyTwoBytes payment_id);
37210 * Send a spontaneous payment, which is a payment that does not require the recipient to have
37211 * generated an invoice. Optionally, you may specify the preimage. If you do choose to specify
37212 * the preimage, it must be a cryptographically secure random value that no intermediate node
37213 * would be able to guess -- otherwise, an intermediate node may claim the payment and it will
37214 * never reach the recipient.
37216 * See [`send_payment`] documentation for more details on the return value of this function
37217 * and idempotency guarantees provided by the [`PaymentId`] key.
37219 * Similar to regular payments, you MUST NOT reuse a `payment_preimage` value. See
37220 * [`send_payment`] for more information about the risks of duplicate preimage usage.
37222 * [`send_payment`]: Self::send_payment
37224 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);
37227 * Similar to [`ChannelManager::send_spontaneous_payment`], but will automatically find a route
37228 * based on `route_params` and retry failed payment paths based on `retry_strategy`.
37230 * See [`PaymentParameters::for_keysend`] for help in constructing `route_params` for spontaneous
37233 * [`PaymentParameters::for_keysend`]: crate::routing::router::PaymentParameters::for_keysend
37235 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);
37238 * Send a payment that is probing the given route for liquidity. We calculate the
37239 * [`PaymentHash`] of probes based on a static secret and a random [`PaymentId`], which allows
37240 * us to easily discern them from real payments.
37242 MUST_USE_RES struct LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ ChannelManager_send_probe(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKPath path);
37245 * Sends payment probes over all paths of a route that would be used to pay the given
37246 * amount to the given `node_id`.
37248 * See [`ChannelManager::send_preflight_probes`] for more information.
37250 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);
37253 * Sends payment probes over all paths of a route that would be used to pay a route found
37254 * according to the given [`RouteParameters`].
37256 * This may be used to send \"pre-flight\" probes, i.e., to train our scorer before conducting
37257 * the actual payment. Note this is only useful if there likely is sufficient time for the
37258 * probe to settle before sending out the actual payment, e.g., when waiting for user
37259 * confirmation in a wallet UI.
37261 * Otherwise, there is a chance the probe could take up some liquidity needed to complete the
37262 * actual payment. Users should therefore be cautious and might avoid sending probes if
37263 * liquidity is scarce and/or they don't expect the probe to return before they send the
37264 * payment. To mitigate this issue, channels with available liquidity less than the required
37265 * amount times the given `liquidity_limit_multiplier` won't be used to send pre-flight
37266 * probes. If `None` is given as `liquidity_limit_multiplier`, it defaults to `3`.
37268 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);
37271 * Call this upon creation of a funding transaction for the given channel.
37273 * Returns an [`APIError::APIMisuseError`] if the funding_transaction spent non-SegWit outputs
37274 * or if no output was found which matches the parameters in [`Event::FundingGenerationReady`].
37276 * Returns [`APIError::APIMisuseError`] if the funding transaction is not final for propagation
37277 * across the p2p network.
37279 * Returns [`APIError::ChannelUnavailable`] if a funding transaction has already been provided
37280 * for the channel or if the channel has been closed as indicated by [`Event::ChannelClosed`].
37282 * May panic if the output found in the funding transaction is duplicative with some other
37283 * channel (note that this should be trivially prevented by using unique funding transaction
37284 * keys per-channel).
37286 * Do NOT broadcast the funding transaction yourself. When we have safely received our
37287 * counterparty's signature the funding transaction will automatically be broadcast via the
37288 * [`BroadcasterInterface`] provided when this `ChannelManager` was constructed.
37290 * Note that this includes RBF or similar transaction replacement strategies - lightning does
37291 * not currently support replacing a funding transaction on an existing channel. Instead,
37292 * create a new channel with a conflicting funding transaction.
37294 * Note to keep the miner incentives aligned in moving the blockchain forward, we recommend
37295 * the wallet software generating the funding transaction to apply anti-fee sniping as
37296 * implemented by Bitcoin Core wallet. See <https://bitcoinops.org/en/topics/fee-sniping/>
37297 * for more details.
37299 * [`Event::FundingGenerationReady`]: crate::events::Event::FundingGenerationReady
37300 * [`Event::ChannelClosed`]: crate::events::Event::ChannelClosed
37302 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);
37305 * Call this upon creation of a batch funding transaction for the given channels.
37307 * Return values are identical to [`Self::funding_transaction_generated`], respective to
37308 * each individual channel and transaction output.
37310 * Do NOT broadcast the funding transaction yourself. This batch funding transaction
37311 * will only be broadcast when we have safely received and persisted the counterparty's
37312 * signature for each channel.
37314 * If there is an error, all channels in the batch are to be considered closed.
37316 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);
37319 * Atomically applies partial updates to the [`ChannelConfig`] of the given channels.
37321 * Once the updates are applied, each eligible channel (advertised with a known short channel
37322 * ID and a change in [`forwarding_fee_proportional_millionths`], [`forwarding_fee_base_msat`],
37323 * or [`cltv_expiry_delta`]) has a [`BroadcastChannelUpdate`] event message generated
37324 * containing the new [`ChannelUpdate`] message which should be broadcast to the network.
37326 * Returns [`ChannelUnavailable`] when a channel is not found or an incorrect
37327 * `counterparty_node_id` is provided.
37329 * Returns [`APIMisuseError`] when a [`cltv_expiry_delta`] update is to be applied with a value
37330 * below [`MIN_CLTV_EXPIRY_DELTA`].
37332 * If an error is returned, none of the updates should be considered applied.
37334 * [`forwarding_fee_proportional_millionths`]: ChannelConfig::forwarding_fee_proportional_millionths
37335 * [`forwarding_fee_base_msat`]: ChannelConfig::forwarding_fee_base_msat
37336 * [`cltv_expiry_delta`]: ChannelConfig::cltv_expiry_delta
37337 * [`BroadcastChannelUpdate`]: events::MessageSendEvent::BroadcastChannelUpdate
37338 * [`ChannelUpdate`]: msgs::ChannelUpdate
37339 * [`ChannelUnavailable`]: APIError::ChannelUnavailable
37340 * [`APIMisuseError`]: APIError::APIMisuseError
37342 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);
37345 * Atomically updates the [`ChannelConfig`] for the given channels.
37347 * Once the updates are applied, each eligible channel (advertised with a known short channel
37348 * ID and a change in [`forwarding_fee_proportional_millionths`], [`forwarding_fee_base_msat`],
37349 * or [`cltv_expiry_delta`]) has a [`BroadcastChannelUpdate`] event message generated
37350 * containing the new [`ChannelUpdate`] message which should be broadcast to the network.
37352 * Returns [`ChannelUnavailable`] when a channel is not found or an incorrect
37353 * `counterparty_node_id` is provided.
37355 * Returns [`APIMisuseError`] when a [`cltv_expiry_delta`] update is to be applied with a value
37356 * below [`MIN_CLTV_EXPIRY_DELTA`].
37358 * If an error is returned, none of the updates should be considered applied.
37360 * [`forwarding_fee_proportional_millionths`]: ChannelConfig::forwarding_fee_proportional_millionths
37361 * [`forwarding_fee_base_msat`]: ChannelConfig::forwarding_fee_base_msat
37362 * [`cltv_expiry_delta`]: ChannelConfig::cltv_expiry_delta
37363 * [`BroadcastChannelUpdate`]: events::MessageSendEvent::BroadcastChannelUpdate
37364 * [`ChannelUpdate`]: msgs::ChannelUpdate
37365 * [`ChannelUnavailable`]: APIError::ChannelUnavailable
37366 * [`APIMisuseError`]: APIError::APIMisuseError
37368 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);
37371 * Attempts to forward an intercepted HTLC over the provided channel id and with the provided
37372 * amount to forward. Should only be called in response to an [`HTLCIntercepted`] event.
37374 * Intercepted HTLCs can be useful for Lightning Service Providers (LSPs) to open a just-in-time
37375 * channel to a receiving node if the node lacks sufficient inbound liquidity.
37377 * To make use of intercepted HTLCs, set [`UserConfig::accept_intercept_htlcs`] and use
37378 * [`ChannelManager::get_intercept_scid`] to generate short channel id(s) to put in the
37379 * receiver's invoice route hints. These route hints will signal to LDK to generate an
37380 * [`HTLCIntercepted`] event when it receives the forwarded HTLC, and this method or
37381 * [`ChannelManager::fail_intercepted_htlc`] MUST be called in response to the event.
37383 * Note that LDK does not enforce fee requirements in `amt_to_forward_msat`, and will not stop
37384 * you from forwarding more than you received. See
37385 * [`HTLCIntercepted::expected_outbound_amount_msat`] for more on forwarding a different amount
37388 * Errors if the event was not handled in time, in which case the HTLC was automatically failed
37391 * [`UserConfig::accept_intercept_htlcs`]: crate::util::config::UserConfig::accept_intercept_htlcs
37392 * [`HTLCIntercepted`]: events::Event::HTLCIntercepted
37393 * [`HTLCIntercepted::expected_outbound_amount_msat`]: events::Event::HTLCIntercepted::expected_outbound_amount_msat
37395 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);
37398 * Fails the intercepted HTLC indicated by intercept_id. Should only be called in response to
37399 * an [`HTLCIntercepted`] event. See [`ChannelManager::forward_intercepted_htlc`].
37401 * Errors if the event was not handled in time, in which case the HTLC was automatically failed
37404 * [`HTLCIntercepted`]: events::Event::HTLCIntercepted
37406 MUST_USE_RES struct LDKCResult_NoneAPIErrorZ ChannelManager_fail_intercepted_htlc(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKThirtyTwoBytes intercept_id);
37409 * Processes HTLCs which are pending waiting on random forward delay.
37411 * Should only really ever be called in response to a PendingHTLCsForwardable event.
37412 * Will likely generate further events.
37414 void ChannelManager_process_pending_htlc_forwards(const struct LDKChannelManager *NONNULL_PTR this_arg);
37417 * Performs actions which should happen on startup and roughly once per minute thereafter.
37419 * This currently includes:
37420 * * Increasing or decreasing the on-chain feerate estimates for our outbound channels,
37421 * * Broadcasting [`ChannelUpdate`] messages if we've been disconnected from our peer for more
37422 * than a minute, informing the network that they should no longer attempt to route over
37424 * * Expiring a channel's previous [`ChannelConfig`] if necessary to only allow forwarding HTLCs
37425 * with the current [`ChannelConfig`].
37426 * * Removing peers which have disconnected but and no longer have any channels.
37427 * * Force-closing and removing channels which have not completed establishment in a timely manner.
37428 * * Forgetting about stale outbound payments, either those that have already been fulfilled
37429 * or those awaiting an invoice that hasn't been delivered in the necessary amount of time.
37430 * The latter is determined using the system clock in `std` and the highest seen block time
37431 * minus two hours in `no-std`.
37433 * Note that this may cause reentrancy through [`chain::Watch::update_channel`] calls or feerate
37434 * estimate fetches.
37436 * [`ChannelUpdate`]: msgs::ChannelUpdate
37437 * [`ChannelConfig`]: crate::util::config::ChannelConfig
37439 void ChannelManager_timer_tick_occurred(const struct LDKChannelManager *NONNULL_PTR this_arg);
37442 * Indicates that the preimage for payment_hash is unknown or the received amount is incorrect
37443 * after a PaymentClaimable event, failing the HTLC back to its origin and freeing resources
37444 * along the path (including in our own channel on which we received it).
37446 * Note that in some cases around unclean shutdown, it is possible the payment may have
37447 * already been claimed by you via [`ChannelManager::claim_funds`] prior to you seeing (a
37448 * second copy of) the [`events::Event::PaymentClaimable`] event. Alternatively, the payment
37449 * may have already been failed automatically by LDK if it was nearing its expiration time.
37451 * While LDK will never claim a payment automatically on your behalf (i.e. without you calling
37452 * [`ChannelManager::claim_funds`]), you should still monitor for
37453 * [`events::Event::PaymentClaimed`] events even for payments you intend to fail, especially on
37454 * startup during which time claims that were in-progress at shutdown may be replayed.
37456 void ChannelManager_fail_htlc_backwards(const struct LDKChannelManager *NONNULL_PTR this_arg, const uint8_t (*payment_hash)[32]);
37459 * This is a variant of [`ChannelManager::fail_htlc_backwards`] that allows you to specify the
37460 * reason for the failure.
37462 * See [`FailureCode`] for valid failure codes.
37464 void ChannelManager_fail_htlc_backwards_with_reason(const struct LDKChannelManager *NONNULL_PTR this_arg, const uint8_t (*payment_hash)[32], struct LDKFailureCode failure_code);
37467 * Provides a payment preimage in response to [`Event::PaymentClaimable`], generating any
37468 * [`MessageSendEvent`]s needed to claim the payment.
37470 * This method is guaranteed to ensure the payment has been claimed but only if the current
37471 * height is strictly below [`Event::PaymentClaimable::claim_deadline`]. To avoid race
37472 * conditions, you should wait for an [`Event::PaymentClaimed`] before considering the payment
37473 * successful. It will generally be available in the next [`process_pending_events`] call.
37475 * Note that if you did not set an `amount_msat` when calling [`create_inbound_payment`] or
37476 * [`create_inbound_payment_for_hash`] you must check that the amount in the `PaymentClaimable`
37477 * event matches your expectation. If you fail to do so and call this method, you may provide
37478 * the sender \"proof-of-payment\" when they did not fulfill the full expected payment.
37480 * This function will fail the payment if it has custom TLVs with even type numbers, as we
37481 * will assume they are unknown. If you intend to accept even custom TLVs, you should use
37482 * [`claim_funds_with_known_custom_tlvs`].
37484 * [`Event::PaymentClaimable`]: crate::events::Event::PaymentClaimable
37485 * [`Event::PaymentClaimable::claim_deadline`]: crate::events::Event::PaymentClaimable::claim_deadline
37486 * [`Event::PaymentClaimed`]: crate::events::Event::PaymentClaimed
37487 * [`process_pending_events`]: EventsProvider::process_pending_events
37488 * [`create_inbound_payment`]: Self::create_inbound_payment
37489 * [`create_inbound_payment_for_hash`]: Self::create_inbound_payment_for_hash
37490 * [`claim_funds_with_known_custom_tlvs`]: Self::claim_funds_with_known_custom_tlvs
37492 void ChannelManager_claim_funds(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKThirtyTwoBytes payment_preimage);
37495 * This is a variant of [`claim_funds`] that allows accepting a payment with custom TLVs with
37496 * even type numbers.
37500 * You MUST check you've understood all even TLVs before using this to
37501 * claim, otherwise you may unintentionally agree to some protocol you do not understand.
37503 * [`claim_funds`]: Self::claim_funds
37505 void ChannelManager_claim_funds_with_known_custom_tlvs(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKThirtyTwoBytes payment_preimage);
37508 * Gets the node_id held by this ChannelManager
37510 MUST_USE_RES struct LDKPublicKey ChannelManager_get_our_node_id(const struct LDKChannelManager *NONNULL_PTR this_arg);
37513 * Accepts a request to open a channel after a [`Event::OpenChannelRequest`].
37515 * The `temporary_channel_id` parameter indicates which inbound channel should be accepted,
37516 * and the `counterparty_node_id` parameter is the id of the peer which has requested to open
37519 * The `user_channel_id` parameter will be provided back in
37520 * [`Event::ChannelClosed::user_channel_id`] to allow tracking of which events correspond
37521 * with which `accept_inbound_channel`/`accept_inbound_channel_from_trusted_peer_0conf` call.
37523 * Note that this method will return an error and reject the channel, if it requires support
37524 * for zero confirmations. Instead, `accept_inbound_channel_from_trusted_peer_0conf` must be
37525 * used to accept such channels.
37527 * [`Event::OpenChannelRequest`]: events::Event::OpenChannelRequest
37528 * [`Event::ChannelClosed::user_channel_id`]: events::Event::ChannelClosed::user_channel_id
37530 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);
37533 * Accepts a request to open a channel after a [`events::Event::OpenChannelRequest`], treating
37534 * it as confirmed immediately.
37536 * The `user_channel_id` parameter will be provided back in
37537 * [`Event::ChannelClosed::user_channel_id`] to allow tracking of which events correspond
37538 * with which `accept_inbound_channel`/`accept_inbound_channel_from_trusted_peer_0conf` call.
37540 * Unlike [`ChannelManager::accept_inbound_channel`], this method accepts the incoming channel
37541 * and (if the counterparty agrees), enables forwarding of payments immediately.
37543 * This fully trusts that the counterparty has honestly and correctly constructed the funding
37544 * transaction and blindly assumes that it will eventually confirm.
37546 * If it does not confirm before we decide to close the channel, or if the funding transaction
37547 * does not pay to the correct script the correct amount, *you will lose funds*.
37549 * [`Event::OpenChannelRequest`]: events::Event::OpenChannelRequest
37550 * [`Event::ChannelClosed::user_channel_id`]: events::Event::ChannelClosed::user_channel_id
37552 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);
37555 * Creates an [`OfferBuilder`] such that the [`Offer`] it builds is recognized by the
37556 * [`ChannelManager`] when handling [`InvoiceRequest`] messages for the offer. The offer will
37557 * not have an expiration unless otherwise set on the builder.
37561 * Uses [`MessageRouter::create_blinded_paths`] to construct a [`BlindedPath`] for the offer.
37562 * However, if one is not found, uses a one-hop [`BlindedPath`] with
37563 * [`ChannelManager::get_our_node_id`] as the introduction node instead. In the latter case,
37564 * the node must be announced, otherwise, there is no way to find a path to the introduction in
37565 * order to send the [`InvoiceRequest`].
37567 * Also, uses a derived signing pubkey in the offer for recipient privacy.
37571 * Requires a direct connection to the introduction node in the responding [`InvoiceRequest`]'s
37576 * Errors if the parameterized [`Router`] is unable to create a blinded path for the offer.
37578 * [`Offer`]: crate::offers::offer::Offer
37579 * [`InvoiceRequest`]: crate::offers::invoice_request::InvoiceRequest
37581 MUST_USE_RES struct LDKCResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ ChannelManager_create_offer_builder(const struct LDKChannelManager *NONNULL_PTR this_arg);
37584 * Creates a [`RefundBuilder`] such that the [`Refund`] it builds is recognized by the
37585 * [`ChannelManager`] when handling [`Bolt12Invoice`] messages for the refund.
37589 * The provided `payment_id` is used to ensure that only one invoice is paid for the refund.
37590 * See [Avoiding Duplicate Payments] for other requirements once the payment has been sent.
37592 * The builder will have the provided expiration set. Any changes to the expiration on the
37593 * returned builder will not be honored by [`ChannelManager`]. For `no-std`, the highest seen
37594 * block time minus two hours is used for the current time when determining if the refund has
37597 * To revoke the refund, use [`ChannelManager::abandon_payment`] prior to receiving the
37598 * invoice. If abandoned, or an invoice isn't received before expiration, the payment will fail
37599 * with an [`Event::InvoiceRequestFailed`].
37601 * If `max_total_routing_fee_msat` is not specified, The default from
37602 * [`RouteParameters::from_payment_params_and_value`] is applied.
37606 * Uses [`MessageRouter::create_blinded_paths`] to construct a [`BlindedPath`] for the refund.
37607 * However, if one is not found, uses a one-hop [`BlindedPath`] with
37608 * [`ChannelManager::get_our_node_id`] as the introduction node instead. In the latter case,
37609 * the node must be announced, otherwise, there is no way to find a path to the introduction in
37610 * order to send the [`Bolt12Invoice`].
37612 * Also, uses a derived payer id in the refund for payer privacy.
37616 * Requires a direct connection to an introduction node in the responding
37617 * [`Bolt12Invoice::payment_paths`].
37622 * - a duplicate `payment_id` is provided given the caveats in the aforementioned link,
37623 * - `amount_msats` is invalid, or
37624 * - the parameterized [`Router`] is unable to create a blinded path for the refund.
37626 * [`Refund`]: crate::offers::refund::Refund
37627 * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice
37628 * [`Bolt12Invoice::payment_paths`]: crate::offers::invoice::Bolt12Invoice::payment_paths
37629 * [Avoiding Duplicate Payments]: #avoiding-duplicate-payments
37631 MUST_USE_RES struct LDKCResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ ChannelManager_create_refund_builder(const struct LDKChannelManager *NONNULL_PTR this_arg, uint64_t amount_msats, uint64_t absolute_expiry, struct LDKThirtyTwoBytes payment_id, struct LDKRetry retry_strategy, struct LDKCOption_u64Z max_total_routing_fee_msat);
37634 * Pays for an [`Offer`] using the given parameters by creating an [`InvoiceRequest`] and
37635 * enqueuing it to be sent via an onion message. [`ChannelManager`] will pay the actual
37636 * [`Bolt12Invoice`] once it is received.
37638 * Uses [`InvoiceRequestBuilder`] such that the [`InvoiceRequest`] it builds is recognized by
37639 * the [`ChannelManager`] when handling a [`Bolt12Invoice`] message in response to the request.
37640 * The optional parameters are used in the builder, if `Some`:
37641 * - `quantity` for [`InvoiceRequest::quantity`] which must be set if
37642 * [`Offer::expects_quantity`] is `true`.
37643 * - `amount_msats` if overpaying what is required for the given `quantity` is desired, and
37644 * - `payer_note` for [`InvoiceRequest::payer_note`].
37646 * If `max_total_routing_fee_msat` is not specified, The default from
37647 * [`RouteParameters::from_payment_params_and_value`] is applied.
37651 * The provided `payment_id` is used to ensure that only one invoice is paid for the request
37652 * when received. See [Avoiding Duplicate Payments] for other requirements once the payment has
37655 * To revoke the request, use [`ChannelManager::abandon_payment`] prior to receiving the
37656 * invoice. If abandoned, or an invoice isn't received in a reasonable amount of time, the
37657 * payment will fail with an [`Event::InvoiceRequestFailed`].
37661 * Uses a one-hop [`BlindedPath`] for the reply path with [`ChannelManager::get_our_node_id`]
37662 * as the introduction node and a derived payer id for payer privacy. As such, currently, the
37663 * node must be announced. Otherwise, there is no way to find a path to the introduction node
37664 * in order to send the [`Bolt12Invoice`].
37668 * Requires a direct connection to an introduction node in [`Offer::paths`] or to
37669 * [`Offer::signing_pubkey`], if empty. A similar restriction applies to the responding
37670 * [`Bolt12Invoice::payment_paths`].
37675 * - a duplicate `payment_id` is provided given the caveats in the aforementioned link,
37676 * - the provided parameters are invalid for the offer,
37677 * - the offer is for an unsupported chain, or
37678 * - the parameterized [`Router`] is unable to create a blinded reply path for the invoice
37681 * [`InvoiceRequest`]: crate::offers::invoice_request::InvoiceRequest
37682 * [`InvoiceRequest::quantity`]: crate::offers::invoice_request::InvoiceRequest::quantity
37683 * [`InvoiceRequest::payer_note`]: crate::offers::invoice_request::InvoiceRequest::payer_note
37684 * [`InvoiceRequestBuilder`]: crate::offers::invoice_request::InvoiceRequestBuilder
37685 * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice
37686 * [`Bolt12Invoice::payment_paths`]: crate::offers::invoice::Bolt12Invoice::payment_paths
37687 * [Avoiding Duplicate Payments]: #avoiding-duplicate-payments
37689 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);
37692 * Creates a [`Bolt12Invoice`] for a [`Refund`] and enqueues it to be sent via an onion
37695 * The resulting invoice uses a [`PaymentHash`] recognized by the [`ChannelManager`] and a
37696 * [`BlindedPath`] containing the [`PaymentSecret`] needed to reconstruct the corresponding
37697 * [`PaymentPreimage`]. It is returned purely for informational purposes.
37701 * Requires a direct connection to an introduction node in [`Refund::paths`] or to
37702 * [`Refund::payer_id`], if empty. This request is best effort; an invoice will be sent to each
37703 * node meeting the aforementioned criteria, but there's no guarantee that they will be
37704 * received and no retries will be made.
37709 * - the refund is for an unsupported chain, or
37710 * - the parameterized [`Router`] is unable to create a blinded payment path or reply path for
37713 * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice
37715 MUST_USE_RES struct LDKCResult_Bolt12InvoiceBolt12SemanticErrorZ ChannelManager_request_refund_payment(const struct LDKChannelManager *NONNULL_PTR this_arg, const struct LDKRefund *NONNULL_PTR refund);
37718 * Gets a payment secret and payment hash for use in an invoice given to a third party wishing
37721 * This differs from [`create_inbound_payment_for_hash`] only in that it generates the
37722 * [`PaymentHash`] and [`PaymentPreimage`] for you.
37724 * The [`PaymentPreimage`] will ultimately be returned to you in the [`PaymentClaimable`] event, which
37725 * will have the [`PaymentClaimable::purpose`] return `Some` for [`PaymentPurpose::preimage`]. That
37726 * should then be passed directly to [`claim_funds`].
37728 * See [`create_inbound_payment_for_hash`] for detailed documentation on behavior and requirements.
37730 * Note that a malicious eavesdropper can intuit whether an inbound payment was created by
37731 * `create_inbound_payment` or `create_inbound_payment_for_hash` based on runtime.
37735 * If you register an inbound payment with this method, then serialize the `ChannelManager`, then
37736 * deserialize it with a node running 0.0.103 and earlier, the payment will fail to be received.
37738 * Errors if `min_value_msat` is greater than total bitcoin supply.
37740 * If `min_final_cltv_expiry_delta` is set to some value, then the payment will not be receivable
37741 * on versions of LDK prior to 0.0.114.
37743 * [`claim_funds`]: Self::claim_funds
37744 * [`PaymentClaimable`]: events::Event::PaymentClaimable
37745 * [`PaymentClaimable::purpose`]: events::Event::PaymentClaimable::purpose
37746 * [`PaymentPurpose::preimage`]: events::PaymentPurpose::preimage
37747 * [`create_inbound_payment_for_hash`]: Self::create_inbound_payment_for_hash
37749 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);
37752 * Gets a [`PaymentSecret`] for a given [`PaymentHash`], for which the payment preimage is
37753 * stored external to LDK.
37755 * A [`PaymentClaimable`] event will only be generated if the [`PaymentSecret`] matches a
37756 * payment secret fetched via this method or [`create_inbound_payment`], and which is at least
37757 * the `min_value_msat` provided here, if one is provided.
37759 * The [`PaymentHash`] (and corresponding [`PaymentPreimage`]) should be globally unique, though
37760 * note that LDK will not stop you from registering duplicate payment hashes for inbound
37763 * `min_value_msat` should be set if the invoice being generated contains a value. Any payment
37764 * received for the returned [`PaymentHash`] will be required to be at least `min_value_msat`
37765 * before a [`PaymentClaimable`] event will be generated, ensuring that we do not provide the
37766 * sender \"proof-of-payment\" unless they have paid the required amount.
37768 * `invoice_expiry_delta_secs` describes the number of seconds that the invoice is valid for
37769 * in excess of the current time. This should roughly match the expiry time set in the invoice.
37770 * After this many seconds, we will remove the inbound payment, resulting in any attempts to
37771 * pay the invoice failing. The BOLT spec suggests 3,600 secs as a default validity time for
37772 * invoices when no timeout is set.
37774 * Note that we use block header time to time-out pending inbound payments (with some margin
37775 * to compensate for the inaccuracy of block header timestamps). Thus, in practice we will
37776 * accept a payment and generate a [`PaymentClaimable`] event for some time after the expiry.
37777 * If you need exact expiry semantics, you should enforce them upon receipt of
37778 * [`PaymentClaimable`].
37780 * Note that invoices generated for inbound payments should have their `min_final_cltv_expiry_delta`
37781 * set to at least [`MIN_FINAL_CLTV_EXPIRY_DELTA`].
37783 * Note that a malicious eavesdropper can intuit whether an inbound payment was created by
37784 * `create_inbound_payment` or `create_inbound_payment_for_hash` based on runtime.
37788 * If you register an inbound payment with this method, then serialize the `ChannelManager`, then
37789 * deserialize it with a node running 0.0.103 and earlier, the payment will fail to be received.
37791 * Errors if `min_value_msat` is greater than total bitcoin supply.
37793 * If `min_final_cltv_expiry_delta` is set to some value, then the payment will not be receivable
37794 * on versions of LDK prior to 0.0.114.
37796 * [`create_inbound_payment`]: Self::create_inbound_payment
37797 * [`PaymentClaimable`]: events::Event::PaymentClaimable
37799 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);
37802 * Gets an LDK-generated payment preimage from a payment hash and payment secret that were
37803 * previously returned from [`create_inbound_payment`].
37805 * [`create_inbound_payment`]: Self::create_inbound_payment
37807 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);
37810 * Gets a fake short channel id for use in receiving [phantom node payments]. These fake scids
37811 * are used when constructing the phantom invoice's route hints.
37813 * [phantom node payments]: crate::sign::PhantomKeysManager
37815 MUST_USE_RES uint64_t ChannelManager_get_phantom_scid(const struct LDKChannelManager *NONNULL_PTR this_arg);
37818 * Gets route hints for use in receiving [phantom node payments].
37820 * [phantom node payments]: crate::sign::PhantomKeysManager
37822 MUST_USE_RES struct LDKPhantomRouteHints ChannelManager_get_phantom_route_hints(const struct LDKChannelManager *NONNULL_PTR this_arg);
37825 * Gets a fake short channel id for use in receiving intercepted payments. These fake scids are
37826 * used when constructing the route hints for HTLCs intended to be intercepted. See
37827 * [`ChannelManager::forward_intercepted_htlc`].
37829 * Note that this method is not guaranteed to return unique values, you may need to call it a few
37830 * times to get a unique scid.
37832 MUST_USE_RES uint64_t ChannelManager_get_intercept_scid(const struct LDKChannelManager *NONNULL_PTR this_arg);
37835 * Gets inflight HTLC information by processing pending outbound payments that are in
37836 * our channels. May be used during pathfinding to account for in-use channel liquidity.
37838 MUST_USE_RES struct LDKInFlightHtlcs ChannelManager_compute_inflight_htlcs(const struct LDKChannelManager *NONNULL_PTR this_arg);
37841 * Constructs a new MessageSendEventsProvider which calls the relevant methods on this_arg.
37842 * This copies the `inner` pointer in this_arg and thus the returned MessageSendEventsProvider must be freed before this_arg is
37844 struct LDKMessageSendEventsProvider ChannelManager_as_MessageSendEventsProvider(const struct LDKChannelManager *NONNULL_PTR this_arg);
37847 * Constructs a new EventsProvider which calls the relevant methods on this_arg.
37848 * This copies the `inner` pointer in this_arg and thus the returned EventsProvider must be freed before this_arg is
37850 struct LDKEventsProvider ChannelManager_as_EventsProvider(const struct LDKChannelManager *NONNULL_PTR this_arg);
37853 * Constructs a new Listen which calls the relevant methods on this_arg.
37854 * This copies the `inner` pointer in this_arg and thus the returned Listen must be freed before this_arg is
37856 struct LDKListen ChannelManager_as_Listen(const struct LDKChannelManager *NONNULL_PTR this_arg);
37859 * Constructs a new Confirm which calls the relevant methods on this_arg.
37860 * This copies the `inner` pointer in this_arg and thus the returned Confirm must be freed before this_arg is
37862 struct LDKConfirm ChannelManager_as_Confirm(const struct LDKChannelManager *NONNULL_PTR this_arg);
37865 * Gets a [`Future`] that completes when this [`ChannelManager`] may need to be persisted or
37866 * may have events that need processing.
37868 * In order to check if this [`ChannelManager`] needs persisting, call
37869 * [`Self::get_and_clear_needs_persistence`].
37871 * Note that callbacks registered on the [`Future`] MUST NOT call back into this
37872 * [`ChannelManager`] and should instead register actions to be taken later.
37874 MUST_USE_RES struct LDKFuture ChannelManager_get_event_or_persistence_needed_future(const struct LDKChannelManager *NONNULL_PTR this_arg);
37877 * Returns true if this [`ChannelManager`] needs to be persisted.
37879 * See [`Self::get_event_or_persistence_needed_future`] for retrieving a [`Future`] that
37880 * indicates this should be checked.
37882 MUST_USE_RES bool ChannelManager_get_and_clear_needs_persistence(const struct LDKChannelManager *NONNULL_PTR this_arg);
37885 * Gets the latest best block which was connected either via the [`chain::Listen`] or
37886 * [`chain::Confirm`] interfaces.
37888 MUST_USE_RES struct LDKBestBlock ChannelManager_current_best_block(const struct LDKChannelManager *NONNULL_PTR this_arg);
37891 * Fetches the set of [`NodeFeatures`] flags that are provided by or required by
37892 * [`ChannelManager`].
37894 MUST_USE_RES struct LDKNodeFeatures ChannelManager_node_features(const struct LDKChannelManager *NONNULL_PTR this_arg);
37897 * Fetches the set of [`ChannelFeatures`] flags that are provided by or required by
37898 * [`ChannelManager`].
37900 MUST_USE_RES struct LDKChannelFeatures ChannelManager_channel_features(const struct LDKChannelManager *NONNULL_PTR this_arg);
37903 * Fetches the set of [`ChannelTypeFeatures`] flags that are provided by or required by
37904 * [`ChannelManager`].
37906 MUST_USE_RES struct LDKChannelTypeFeatures ChannelManager_channel_type_features(const struct LDKChannelManager *NONNULL_PTR this_arg);
37909 * Fetches the set of [`InitFeatures`] flags that are provided by or required by
37910 * [`ChannelManager`].
37912 MUST_USE_RES struct LDKInitFeatures ChannelManager_init_features(const struct LDKChannelManager *NONNULL_PTR this_arg);
37915 * Constructs a new ChannelMessageHandler which calls the relevant methods on this_arg.
37916 * This copies the `inner` pointer in this_arg and thus the returned ChannelMessageHandler must be freed before this_arg is
37918 struct LDKChannelMessageHandler ChannelManager_as_ChannelMessageHandler(const struct LDKChannelManager *NONNULL_PTR this_arg);
37921 * Constructs a new OffersMessageHandler which calls the relevant methods on this_arg.
37922 * This copies the `inner` pointer in this_arg and thus the returned OffersMessageHandler must be freed before this_arg is
37924 struct LDKOffersMessageHandler ChannelManager_as_OffersMessageHandler(const struct LDKChannelManager *NONNULL_PTR this_arg);
37927 * Constructs a new NodeIdLookUp which calls the relevant methods on this_arg.
37928 * This copies the `inner` pointer in this_arg and thus the returned NodeIdLookUp must be freed before this_arg is
37930 struct LDKNodeIdLookUp ChannelManager_as_NodeIdLookUp(const struct LDKChannelManager *NONNULL_PTR this_arg);
37933 * Fetches the set of [`InitFeatures`] flags that are provided by or required by
37934 * [`ChannelManager`].
37936 struct LDKInitFeatures provided_init_features(const struct LDKUserConfig *NONNULL_PTR config);
37939 * Serialize the PhantomRouteHints object into a byte array which can be read by PhantomRouteHints_read
37941 struct LDKCVec_u8Z PhantomRouteHints_write(const struct LDKPhantomRouteHints *NONNULL_PTR obj);
37944 * Read a PhantomRouteHints from a byte array, created by PhantomRouteHints_write
37946 struct LDKCResult_PhantomRouteHintsDecodeErrorZ PhantomRouteHints_read(struct LDKu8slice ser);
37949 * Serialize the BlindedForward object into a byte array which can be read by BlindedForward_read
37951 struct LDKCVec_u8Z BlindedForward_write(const struct LDKBlindedForward *NONNULL_PTR obj);
37954 * Read a BlindedForward from a byte array, created by BlindedForward_write
37956 struct LDKCResult_BlindedForwardDecodeErrorZ BlindedForward_read(struct LDKu8slice ser);
37959 * Serialize the PendingHTLCRouting object into a byte array which can be read by PendingHTLCRouting_read
37961 struct LDKCVec_u8Z PendingHTLCRouting_write(const struct LDKPendingHTLCRouting *NONNULL_PTR obj);
37964 * Read a PendingHTLCRouting from a byte array, created by PendingHTLCRouting_write
37966 struct LDKCResult_PendingHTLCRoutingDecodeErrorZ PendingHTLCRouting_read(struct LDKu8slice ser);
37969 * Serialize the PendingHTLCInfo object into a byte array which can be read by PendingHTLCInfo_read
37971 struct LDKCVec_u8Z PendingHTLCInfo_write(const struct LDKPendingHTLCInfo *NONNULL_PTR obj);
37974 * Read a PendingHTLCInfo from a byte array, created by PendingHTLCInfo_write
37976 struct LDKCResult_PendingHTLCInfoDecodeErrorZ PendingHTLCInfo_read(struct LDKu8slice ser);
37979 * Serialize the BlindedFailure object into a byte array which can be read by BlindedFailure_read
37981 struct LDKCVec_u8Z BlindedFailure_write(const enum LDKBlindedFailure *NONNULL_PTR obj);
37984 * Read a BlindedFailure from a byte array, created by BlindedFailure_write
37986 struct LDKCResult_BlindedFailureDecodeErrorZ BlindedFailure_read(struct LDKu8slice ser);
37989 * Serialize the ChannelManager object into a byte array which can be read by ChannelManager_read
37991 struct LDKCVec_u8Z ChannelManager_write(const struct LDKChannelManager *NONNULL_PTR obj);
37994 * Frees any resources used by the ChannelManagerReadArgs, if is_owned is set and inner is non-NULL.
37996 void ChannelManagerReadArgs_free(struct LDKChannelManagerReadArgs this_obj);
37999 * A cryptographically secure source of entropy.
38001 const struct LDKEntropySource *ChannelManagerReadArgs_get_entropy_source(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
38004 * A cryptographically secure source of entropy.
38006 void ChannelManagerReadArgs_set_entropy_source(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKEntropySource val);
38009 * A signer that is able to perform node-scoped cryptographic operations.
38011 const struct LDKNodeSigner *ChannelManagerReadArgs_get_node_signer(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
38014 * A signer that is able to perform node-scoped cryptographic operations.
38016 void ChannelManagerReadArgs_set_node_signer(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKNodeSigner val);
38019 * The keys provider which will give us relevant keys. Some keys will be loaded during
38020 * deserialization and KeysInterface::read_chan_signer will be used to read per-Channel
38023 const struct LDKSignerProvider *ChannelManagerReadArgs_get_signer_provider(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
38026 * The keys provider which will give us relevant keys. Some keys will be loaded during
38027 * deserialization and KeysInterface::read_chan_signer will be used to read per-Channel
38030 void ChannelManagerReadArgs_set_signer_provider(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKSignerProvider val);
38033 * The fee_estimator for use in the ChannelManager in the future.
38035 * No calls to the FeeEstimator will be made during deserialization.
38037 const struct LDKFeeEstimator *ChannelManagerReadArgs_get_fee_estimator(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
38040 * The fee_estimator for use in the ChannelManager in the future.
38042 * No calls to the FeeEstimator will be made during deserialization.
38044 void ChannelManagerReadArgs_set_fee_estimator(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKFeeEstimator val);
38047 * The chain::Watch for use in the ChannelManager in the future.
38049 * No calls to the chain::Watch will be made during deserialization. It is assumed that
38050 * you have deserialized ChannelMonitors separately and will add them to your
38051 * chain::Watch after deserializing this ChannelManager.
38053 const struct LDKWatch *ChannelManagerReadArgs_get_chain_monitor(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
38056 * The chain::Watch for use in the ChannelManager in the future.
38058 * No calls to the chain::Watch will be made during deserialization. It is assumed that
38059 * you have deserialized ChannelMonitors separately and will add them to your
38060 * chain::Watch after deserializing this ChannelManager.
38062 void ChannelManagerReadArgs_set_chain_monitor(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKWatch val);
38065 * The BroadcasterInterface which will be used in the ChannelManager in the future and may be
38066 * used to broadcast the latest local commitment transactions of channels which must be
38067 * force-closed during deserialization.
38069 const struct LDKBroadcasterInterface *ChannelManagerReadArgs_get_tx_broadcaster(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
38072 * The BroadcasterInterface which will be used in the ChannelManager in the future and may be
38073 * used to broadcast the latest local commitment transactions of channels which must be
38074 * force-closed during deserialization.
38076 void ChannelManagerReadArgs_set_tx_broadcaster(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKBroadcasterInterface val);
38079 * The router which will be used in the ChannelManager in the future for finding routes
38080 * on-the-fly for trampoline payments. Absent in private nodes that don't support forwarding.
38082 * No calls to the router will be made during deserialization.
38084 const struct LDKRouter *ChannelManagerReadArgs_get_router(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
38087 * The router which will be used in the ChannelManager in the future for finding routes
38088 * on-the-fly for trampoline payments. Absent in private nodes that don't support forwarding.
38090 * No calls to the router will be made during deserialization.
38092 void ChannelManagerReadArgs_set_router(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKRouter val);
38095 * The Logger for use in the ChannelManager and which may be used to log information during
38098 const struct LDKLogger *ChannelManagerReadArgs_get_logger(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
38101 * The Logger for use in the ChannelManager and which may be used to log information during
38104 void ChannelManagerReadArgs_set_logger(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKLogger val);
38107 * Default settings used for new channels. Any existing channels will continue to use the
38108 * runtime settings which were stored when the ChannelManager was serialized.
38110 struct LDKUserConfig ChannelManagerReadArgs_get_default_config(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
38113 * Default settings used for new channels. Any existing channels will continue to use the
38114 * runtime settings which were stored when the ChannelManager was serialized.
38116 void ChannelManagerReadArgs_set_default_config(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKUserConfig val);
38119 * Simple utility function to create a ChannelManagerReadArgs which creates the monitor
38120 * HashMap for you. This is primarily useful for C bindings where it is not practical to
38121 * populate a HashMap directly from C.
38123 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);
38126 * Read a C2Tuple_ThirtyTwoBytesChannelManagerZ from a byte array, created by C2Tuple_ThirtyTwoBytesChannelManagerZ_write
38128 struct LDKCResult_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ C2Tuple_ThirtyTwoBytesChannelManagerZ_read(struct LDKu8slice ser, struct LDKChannelManagerReadArgs arg);
38131 * Frees any resources used by the DelayedPaymentBasepoint, if is_owned is set and inner is non-NULL.
38133 void DelayedPaymentBasepoint_free(struct LDKDelayedPaymentBasepoint this_obj);
38135 struct LDKPublicKey DelayedPaymentBasepoint_get_a(const struct LDKDelayedPaymentBasepoint *NONNULL_PTR this_ptr);
38137 void DelayedPaymentBasepoint_set_a(struct LDKDelayedPaymentBasepoint *NONNULL_PTR this_ptr, struct LDKPublicKey val);
38140 * Constructs a new DelayedPaymentBasepoint given each field
38142 MUST_USE_RES struct LDKDelayedPaymentBasepoint DelayedPaymentBasepoint_new(struct LDKPublicKey a_arg);
38145 * Checks if two DelayedPaymentBasepoints contain equal inner contents.
38146 * This ignores pointers and is_owned flags and looks at the values in fields.
38147 * Two objects with NULL inner values will be considered "equal" here.
38149 bool DelayedPaymentBasepoint_eq(const struct LDKDelayedPaymentBasepoint *NONNULL_PTR a, const struct LDKDelayedPaymentBasepoint *NONNULL_PTR b);
38152 * Creates a copy of the DelayedPaymentBasepoint
38154 struct LDKDelayedPaymentBasepoint DelayedPaymentBasepoint_clone(const struct LDKDelayedPaymentBasepoint *NONNULL_PTR orig);
38157 * Generates a non-cryptographic 64-bit hash of the DelayedPaymentBasepoint.
38159 uint64_t DelayedPaymentBasepoint_hash(const struct LDKDelayedPaymentBasepoint *NONNULL_PTR o);
38162 * Get inner Public Key
38164 MUST_USE_RES struct LDKPublicKey DelayedPaymentBasepoint_to_public_key(const struct LDKDelayedPaymentBasepoint *NONNULL_PTR this_arg);
38167 *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.
38169 MUST_USE_RES struct LDKThirtyTwoBytes DelayedPaymentBasepoint_derive_add_tweak(const struct LDKDelayedPaymentBasepoint *NONNULL_PTR this_arg, struct LDKPublicKey per_commitment_point);
38172 * Serialize the DelayedPaymentBasepoint object into a byte array which can be read by DelayedPaymentBasepoint_read
38174 struct LDKCVec_u8Z DelayedPaymentBasepoint_write(const struct LDKDelayedPaymentBasepoint *NONNULL_PTR obj);
38177 * Read a DelayedPaymentBasepoint from a byte array, created by DelayedPaymentBasepoint_write
38179 struct LDKCResult_DelayedPaymentBasepointDecodeErrorZ DelayedPaymentBasepoint_read(struct LDKu8slice ser);
38182 * Frees any resources used by the DelayedPaymentKey, if is_owned is set and inner is non-NULL.
38184 void DelayedPaymentKey_free(struct LDKDelayedPaymentKey this_obj);
38186 struct LDKPublicKey DelayedPaymentKey_get_a(const struct LDKDelayedPaymentKey *NONNULL_PTR this_ptr);
38188 void DelayedPaymentKey_set_a(struct LDKDelayedPaymentKey *NONNULL_PTR this_ptr, struct LDKPublicKey val);
38191 * Constructs a new DelayedPaymentKey given each field
38193 MUST_USE_RES struct LDKDelayedPaymentKey DelayedPaymentKey_new(struct LDKPublicKey a_arg);
38196 * Checks if two DelayedPaymentKeys contain equal inner contents.
38197 * This ignores pointers and is_owned flags and looks at the values in fields.
38198 * Two objects with NULL inner values will be considered "equal" here.
38200 bool DelayedPaymentKey_eq(const struct LDKDelayedPaymentKey *NONNULL_PTR a, const struct LDKDelayedPaymentKey *NONNULL_PTR b);
38203 * Creates a copy of the DelayedPaymentKey
38205 struct LDKDelayedPaymentKey DelayedPaymentKey_clone(const struct LDKDelayedPaymentKey *NONNULL_PTR orig);
38208 *Derive a public delayedpubkey using one node\'s `per_commitment_point` and its countersignatory\'s `basepoint`
38210 MUST_USE_RES struct LDKDelayedPaymentKey DelayedPaymentKey_from_basepoint(const struct LDKDelayedPaymentBasepoint *NONNULL_PTR countersignatory_basepoint, struct LDKPublicKey per_commitment_point);
38213 *Build a delayedpubkey directly from an already-derived private key
38215 MUST_USE_RES struct LDKDelayedPaymentKey DelayedPaymentKey_from_secret_key(const uint8_t (*sk)[32]);
38218 * Get inner Public Key
38220 MUST_USE_RES struct LDKPublicKey DelayedPaymentKey_to_public_key(const struct LDKDelayedPaymentKey *NONNULL_PTR this_arg);
38223 * Serialize the DelayedPaymentKey object into a byte array which can be read by DelayedPaymentKey_read
38225 struct LDKCVec_u8Z DelayedPaymentKey_write(const struct LDKDelayedPaymentKey *NONNULL_PTR obj);
38228 * Read a DelayedPaymentKey from a byte array, created by DelayedPaymentKey_write
38230 struct LDKCResult_DelayedPaymentKeyDecodeErrorZ DelayedPaymentKey_read(struct LDKu8slice ser);
38233 * Frees any resources used by the HtlcBasepoint, if is_owned is set and inner is non-NULL.
38235 void HtlcBasepoint_free(struct LDKHtlcBasepoint this_obj);
38237 struct LDKPublicKey HtlcBasepoint_get_a(const struct LDKHtlcBasepoint *NONNULL_PTR this_ptr);
38239 void HtlcBasepoint_set_a(struct LDKHtlcBasepoint *NONNULL_PTR this_ptr, struct LDKPublicKey val);
38242 * Constructs a new HtlcBasepoint given each field
38244 MUST_USE_RES struct LDKHtlcBasepoint HtlcBasepoint_new(struct LDKPublicKey a_arg);
38247 * Checks if two HtlcBasepoints contain equal inner contents.
38248 * This ignores pointers and is_owned flags and looks at the values in fields.
38249 * Two objects with NULL inner values will be considered "equal" here.
38251 bool HtlcBasepoint_eq(const struct LDKHtlcBasepoint *NONNULL_PTR a, const struct LDKHtlcBasepoint *NONNULL_PTR b);
38254 * Creates a copy of the HtlcBasepoint
38256 struct LDKHtlcBasepoint HtlcBasepoint_clone(const struct LDKHtlcBasepoint *NONNULL_PTR orig);
38259 * Generates a non-cryptographic 64-bit hash of the HtlcBasepoint.
38261 uint64_t HtlcBasepoint_hash(const struct LDKHtlcBasepoint *NONNULL_PTR o);
38264 * Get inner Public Key
38266 MUST_USE_RES struct LDKPublicKey HtlcBasepoint_to_public_key(const struct LDKHtlcBasepoint *NONNULL_PTR this_arg);
38269 *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.
38271 MUST_USE_RES struct LDKThirtyTwoBytes HtlcBasepoint_derive_add_tweak(const struct LDKHtlcBasepoint *NONNULL_PTR this_arg, struct LDKPublicKey per_commitment_point);
38274 * Serialize the HtlcBasepoint object into a byte array which can be read by HtlcBasepoint_read
38276 struct LDKCVec_u8Z HtlcBasepoint_write(const struct LDKHtlcBasepoint *NONNULL_PTR obj);
38279 * Read a HtlcBasepoint from a byte array, created by HtlcBasepoint_write
38281 struct LDKCResult_HtlcBasepointDecodeErrorZ HtlcBasepoint_read(struct LDKu8slice ser);
38284 * Frees any resources used by the HtlcKey, if is_owned is set and inner is non-NULL.
38286 void HtlcKey_free(struct LDKHtlcKey this_obj);
38288 struct LDKPublicKey HtlcKey_get_a(const struct LDKHtlcKey *NONNULL_PTR this_ptr);
38290 void HtlcKey_set_a(struct LDKHtlcKey *NONNULL_PTR this_ptr, struct LDKPublicKey val);
38293 * Constructs a new HtlcKey given each field
38295 MUST_USE_RES struct LDKHtlcKey HtlcKey_new(struct LDKPublicKey a_arg);
38298 * Checks if two HtlcKeys contain equal inner contents.
38299 * This ignores pointers and is_owned flags and looks at the values in fields.
38300 * Two objects with NULL inner values will be considered "equal" here.
38302 bool HtlcKey_eq(const struct LDKHtlcKey *NONNULL_PTR a, const struct LDKHtlcKey *NONNULL_PTR b);
38305 * Creates a copy of the HtlcKey
38307 struct LDKHtlcKey HtlcKey_clone(const struct LDKHtlcKey *NONNULL_PTR orig);
38310 *Derive a public htlcpubkey using one node\'s `per_commitment_point` and its countersignatory\'s `basepoint`
38312 MUST_USE_RES struct LDKHtlcKey HtlcKey_from_basepoint(const struct LDKHtlcBasepoint *NONNULL_PTR countersignatory_basepoint, struct LDKPublicKey per_commitment_point);
38315 *Build a htlcpubkey directly from an already-derived private key
38317 MUST_USE_RES struct LDKHtlcKey HtlcKey_from_secret_key(const uint8_t (*sk)[32]);
38320 * Get inner Public Key
38322 MUST_USE_RES struct LDKPublicKey HtlcKey_to_public_key(const struct LDKHtlcKey *NONNULL_PTR this_arg);
38325 * Serialize the HtlcKey object into a byte array which can be read by HtlcKey_read
38327 struct LDKCVec_u8Z HtlcKey_write(const struct LDKHtlcKey *NONNULL_PTR obj);
38330 * Read a HtlcKey from a byte array, created by HtlcKey_write
38332 struct LDKCResult_HtlcKeyDecodeErrorZ HtlcKey_read(struct LDKu8slice ser);
38335 * Adds a tweak to a public key to derive a new public key.
38337 * May panic if `tweak` is not the output of a SHA-256 hash.
38339 struct LDKPublicKey add_public_key_tweak(struct LDKPublicKey base_point, const uint8_t (*tweak)[32]);
38342 * Frees any resources used by the RevocationBasepoint, if is_owned is set and inner is non-NULL.
38344 void RevocationBasepoint_free(struct LDKRevocationBasepoint this_obj);
38346 struct LDKPublicKey RevocationBasepoint_get_a(const struct LDKRevocationBasepoint *NONNULL_PTR this_ptr);
38348 void RevocationBasepoint_set_a(struct LDKRevocationBasepoint *NONNULL_PTR this_ptr, struct LDKPublicKey val);
38351 * Constructs a new RevocationBasepoint given each field
38353 MUST_USE_RES struct LDKRevocationBasepoint RevocationBasepoint_new(struct LDKPublicKey a_arg);
38356 * Checks if two RevocationBasepoints contain equal inner contents.
38357 * This ignores pointers and is_owned flags and looks at the values in fields.
38358 * Two objects with NULL inner values will be considered "equal" here.
38360 bool RevocationBasepoint_eq(const struct LDKRevocationBasepoint *NONNULL_PTR a, const struct LDKRevocationBasepoint *NONNULL_PTR b);
38363 * Creates a copy of the RevocationBasepoint
38365 struct LDKRevocationBasepoint RevocationBasepoint_clone(const struct LDKRevocationBasepoint *NONNULL_PTR orig);
38368 * Generates a non-cryptographic 64-bit hash of the RevocationBasepoint.
38370 uint64_t RevocationBasepoint_hash(const struct LDKRevocationBasepoint *NONNULL_PTR o);
38373 * Get inner Public Key
38375 MUST_USE_RES struct LDKPublicKey RevocationBasepoint_to_public_key(const struct LDKRevocationBasepoint *NONNULL_PTR this_arg);
38378 * Serialize the RevocationBasepoint object into a byte array which can be read by RevocationBasepoint_read
38380 struct LDKCVec_u8Z RevocationBasepoint_write(const struct LDKRevocationBasepoint *NONNULL_PTR obj);
38383 * Read a RevocationBasepoint from a byte array, created by RevocationBasepoint_write
38385 struct LDKCResult_RevocationBasepointDecodeErrorZ RevocationBasepoint_read(struct LDKu8slice ser);
38388 * Frees any resources used by the RevocationKey, if is_owned is set and inner is non-NULL.
38390 void RevocationKey_free(struct LDKRevocationKey this_obj);
38392 struct LDKPublicKey RevocationKey_get_a(const struct LDKRevocationKey *NONNULL_PTR this_ptr);
38394 void RevocationKey_set_a(struct LDKRevocationKey *NONNULL_PTR this_ptr, struct LDKPublicKey val);
38397 * Constructs a new RevocationKey given each field
38399 MUST_USE_RES struct LDKRevocationKey RevocationKey_new(struct LDKPublicKey a_arg);
38402 * Checks if two RevocationKeys contain equal inner contents.
38403 * This ignores pointers and is_owned flags and looks at the values in fields.
38404 * Two objects with NULL inner values will be considered "equal" here.
38406 bool RevocationKey_eq(const struct LDKRevocationKey *NONNULL_PTR a, const struct LDKRevocationKey *NONNULL_PTR b);
38409 * Creates a copy of the RevocationKey
38411 struct LDKRevocationKey RevocationKey_clone(const struct LDKRevocationKey *NONNULL_PTR orig);
38414 * Generates a non-cryptographic 64-bit hash of the RevocationKey.
38416 uint64_t RevocationKey_hash(const struct LDKRevocationKey *NONNULL_PTR o);
38419 * Derives a per-commitment-transaction revocation public key from one party's per-commitment
38420 * point and the other party's [`RevocationBasepoint`]. This is the public equivalent of
38421 * [`chan_utils::derive_private_revocation_key`] - using only public keys to derive a public
38422 * key instead of private keys.
38424 * Note that this is infallible iff we trust that at least one of the two input keys are randomly
38425 * generated (ie our own).
38427 * [`chan_utils::derive_private_revocation_key`]: crate::ln::chan_utils::derive_private_revocation_key
38429 MUST_USE_RES struct LDKRevocationKey RevocationKey_from_basepoint(const struct LDKRevocationBasepoint *NONNULL_PTR countersignatory_basepoint, struct LDKPublicKey per_commitment_point);
38432 * Get inner Public Key
38434 MUST_USE_RES struct LDKPublicKey RevocationKey_to_public_key(const struct LDKRevocationKey *NONNULL_PTR this_arg);
38437 * Serialize the RevocationKey object into a byte array which can be read by RevocationKey_read
38439 struct LDKCVec_u8Z RevocationKey_write(const struct LDKRevocationKey *NONNULL_PTR obj);
38442 * Read a RevocationKey from a byte array, created by RevocationKey_write
38444 struct LDKCResult_RevocationKeyDecodeErrorZ RevocationKey_read(struct LDKu8slice ser);
38447 * Creates a copy of the InboundHTLCStateDetails
38449 enum LDKInboundHTLCStateDetails InboundHTLCStateDetails_clone(const enum LDKInboundHTLCStateDetails *NONNULL_PTR orig);
38452 * Utility method to constructs a new AwaitingRemoteRevokeToAdd-variant InboundHTLCStateDetails
38454 enum LDKInboundHTLCStateDetails InboundHTLCStateDetails_awaiting_remote_revoke_to_add(void);
38457 * Utility method to constructs a new Committed-variant InboundHTLCStateDetails
38459 enum LDKInboundHTLCStateDetails InboundHTLCStateDetails_committed(void);
38462 * Utility method to constructs a new AwaitingRemoteRevokeToRemoveFulfill-variant InboundHTLCStateDetails
38464 enum LDKInboundHTLCStateDetails InboundHTLCStateDetails_awaiting_remote_revoke_to_remove_fulfill(void);
38467 * Utility method to constructs a new AwaitingRemoteRevokeToRemoveFail-variant InboundHTLCStateDetails
38469 enum LDKInboundHTLCStateDetails InboundHTLCStateDetails_awaiting_remote_revoke_to_remove_fail(void);
38472 * Serialize the InboundHTLCStateDetails object into a byte array which can be read by InboundHTLCStateDetails_read
38474 struct LDKCVec_u8Z InboundHTLCStateDetails_write(const enum LDKInboundHTLCStateDetails *NONNULL_PTR obj);
38477 * Read a InboundHTLCStateDetails from a byte array, created by InboundHTLCStateDetails_write
38479 struct LDKCResult_COption_InboundHTLCStateDetailsZDecodeErrorZ InboundHTLCStateDetails_read(struct LDKu8slice ser);
38482 * Frees any resources used by the InboundHTLCDetails, if is_owned is set and inner is non-NULL.
38484 void InboundHTLCDetails_free(struct LDKInboundHTLCDetails this_obj);
38488 * The IDs are incremented by 1 starting from 0 for each offered HTLC.
38489 * They are unique per channel and inbound/outbound direction, unless an HTLC was only announced
38490 * and not part of any commitment transaction.
38492 uint64_t InboundHTLCDetails_get_htlc_id(const struct LDKInboundHTLCDetails *NONNULL_PTR this_ptr);
38496 * The IDs are incremented by 1 starting from 0 for each offered HTLC.
38497 * They are unique per channel and inbound/outbound direction, unless an HTLC was only announced
38498 * and not part of any commitment transaction.
38500 void InboundHTLCDetails_set_htlc_id(struct LDKInboundHTLCDetails *NONNULL_PTR this_ptr, uint64_t val);
38503 * The amount in msat.
38505 uint64_t InboundHTLCDetails_get_amount_msat(const struct LDKInboundHTLCDetails *NONNULL_PTR this_ptr);
38508 * The amount in msat.
38510 void InboundHTLCDetails_set_amount_msat(struct LDKInboundHTLCDetails *NONNULL_PTR this_ptr, uint64_t val);
38513 * The block height at which this HTLC expires.
38515 uint32_t InboundHTLCDetails_get_cltv_expiry(const struct LDKInboundHTLCDetails *NONNULL_PTR this_ptr);
38518 * The block height at which this HTLC expires.
38520 void InboundHTLCDetails_set_cltv_expiry(struct LDKInboundHTLCDetails *NONNULL_PTR this_ptr, uint32_t val);
38523 * The payment hash.
38525 const uint8_t (*InboundHTLCDetails_get_payment_hash(const struct LDKInboundHTLCDetails *NONNULL_PTR this_ptr))[32];
38528 * The payment hash.
38530 void InboundHTLCDetails_set_payment_hash(struct LDKInboundHTLCDetails *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
38533 * The state of the HTLC in the state machine.
38535 * Determines on which commitment transactions the HTLC is included and what message the HTLC is
38536 * waiting for to advance to the next state.
38538 * See [`InboundHTLCStateDetails`] for information on the specific states.
38540 * LDK will always fill this field in, but when downgrading to prior versions of LDK, new
38541 * states may result in `None` here.
38543 struct LDKCOption_InboundHTLCStateDetailsZ InboundHTLCDetails_get_state(const struct LDKInboundHTLCDetails *NONNULL_PTR this_ptr);
38546 * The state of the HTLC in the state machine.
38548 * Determines on which commitment transactions the HTLC is included and what message the HTLC is
38549 * waiting for to advance to the next state.
38551 * See [`InboundHTLCStateDetails`] for information on the specific states.
38553 * LDK will always fill this field in, but when downgrading to prior versions of LDK, new
38554 * states may result in `None` here.
38556 void InboundHTLCDetails_set_state(struct LDKInboundHTLCDetails *NONNULL_PTR this_ptr, struct LDKCOption_InboundHTLCStateDetailsZ val);
38559 * Whether the HTLC has an output below the local dust limit. If so, the output will be trimmed
38560 * from the local commitment transaction and added to the commitment transaction fee.
38561 * For non-anchor channels, this takes into account the cost of the second-stage HTLC
38562 * transactions as well.
38564 * When the local commitment transaction is broadcasted as part of a unilateral closure,
38565 * the value of this HTLC will therefore not be claimable but instead burned as a transaction
38568 * Note that dust limits are specific to each party. An HTLC can be dust for the local
38569 * commitment transaction but not for the counterparty's commitment transaction and vice versa.
38571 bool InboundHTLCDetails_get_is_dust(const struct LDKInboundHTLCDetails *NONNULL_PTR this_ptr);
38574 * Whether the HTLC has an output below the local dust limit. If so, the output will be trimmed
38575 * from the local commitment transaction and added to the commitment transaction fee.
38576 * For non-anchor channels, this takes into account the cost of the second-stage HTLC
38577 * transactions as well.
38579 * When the local commitment transaction is broadcasted as part of a unilateral closure,
38580 * the value of this HTLC will therefore not be claimable but instead burned as a transaction
38583 * Note that dust limits are specific to each party. An HTLC can be dust for the local
38584 * commitment transaction but not for the counterparty's commitment transaction and vice versa.
38586 void InboundHTLCDetails_set_is_dust(struct LDKInboundHTLCDetails *NONNULL_PTR this_ptr, bool val);
38589 * Constructs a new InboundHTLCDetails given each field
38591 MUST_USE_RES struct LDKInboundHTLCDetails InboundHTLCDetails_new(uint64_t htlc_id_arg, uint64_t amount_msat_arg, uint32_t cltv_expiry_arg, struct LDKThirtyTwoBytes payment_hash_arg, struct LDKCOption_InboundHTLCStateDetailsZ state_arg, bool is_dust_arg);
38594 * Creates a copy of the InboundHTLCDetails
38596 struct LDKInboundHTLCDetails InboundHTLCDetails_clone(const struct LDKInboundHTLCDetails *NONNULL_PTR orig);
38599 * Serialize the InboundHTLCDetails object into a byte array which can be read by InboundHTLCDetails_read
38601 struct LDKCVec_u8Z InboundHTLCDetails_write(const struct LDKInboundHTLCDetails *NONNULL_PTR obj);
38604 * Read a InboundHTLCDetails from a byte array, created by InboundHTLCDetails_write
38606 struct LDKCResult_InboundHTLCDetailsDecodeErrorZ InboundHTLCDetails_read(struct LDKu8slice ser);
38609 * Creates a copy of the OutboundHTLCStateDetails
38611 enum LDKOutboundHTLCStateDetails OutboundHTLCStateDetails_clone(const enum LDKOutboundHTLCStateDetails *NONNULL_PTR orig);
38614 * Utility method to constructs a new AwaitingRemoteRevokeToAdd-variant OutboundHTLCStateDetails
38616 enum LDKOutboundHTLCStateDetails OutboundHTLCStateDetails_awaiting_remote_revoke_to_add(void);
38619 * Utility method to constructs a new Committed-variant OutboundHTLCStateDetails
38621 enum LDKOutboundHTLCStateDetails OutboundHTLCStateDetails_committed(void);
38624 * Utility method to constructs a new AwaitingRemoteRevokeToRemoveSuccess-variant OutboundHTLCStateDetails
38626 enum LDKOutboundHTLCStateDetails OutboundHTLCStateDetails_awaiting_remote_revoke_to_remove_success(void);
38629 * Utility method to constructs a new AwaitingRemoteRevokeToRemoveFailure-variant OutboundHTLCStateDetails
38631 enum LDKOutboundHTLCStateDetails OutboundHTLCStateDetails_awaiting_remote_revoke_to_remove_failure(void);
38634 * Serialize the OutboundHTLCStateDetails object into a byte array which can be read by OutboundHTLCStateDetails_read
38636 struct LDKCVec_u8Z OutboundHTLCStateDetails_write(const enum LDKOutboundHTLCStateDetails *NONNULL_PTR obj);
38639 * Read a OutboundHTLCStateDetails from a byte array, created by OutboundHTLCStateDetails_write
38641 struct LDKCResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ OutboundHTLCStateDetails_read(struct LDKu8slice ser);
38644 * Frees any resources used by the OutboundHTLCDetails, if is_owned is set and inner is non-NULL.
38646 void OutboundHTLCDetails_free(struct LDKOutboundHTLCDetails this_obj);
38650 * The IDs are incremented by 1 starting from 0 for each offered HTLC.
38651 * They are unique per channel and inbound/outbound direction, unless an HTLC was only announced
38652 * and not part of any commitment transaction.
38654 * Not present when we are awaiting a remote revocation and the HTLC is not added yet.
38656 struct LDKCOption_u64Z OutboundHTLCDetails_get_htlc_id(const struct LDKOutboundHTLCDetails *NONNULL_PTR this_ptr);
38660 * The IDs are incremented by 1 starting from 0 for each offered HTLC.
38661 * They are unique per channel and inbound/outbound direction, unless an HTLC was only announced
38662 * and not part of any commitment transaction.
38664 * Not present when we are awaiting a remote revocation and the HTLC is not added yet.
38666 void OutboundHTLCDetails_set_htlc_id(struct LDKOutboundHTLCDetails *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
38669 * The amount in msat.
38671 uint64_t OutboundHTLCDetails_get_amount_msat(const struct LDKOutboundHTLCDetails *NONNULL_PTR this_ptr);
38674 * The amount in msat.
38676 void OutboundHTLCDetails_set_amount_msat(struct LDKOutboundHTLCDetails *NONNULL_PTR this_ptr, uint64_t val);
38679 * The block height at which this HTLC expires.
38681 uint32_t OutboundHTLCDetails_get_cltv_expiry(const struct LDKOutboundHTLCDetails *NONNULL_PTR this_ptr);
38684 * The block height at which this HTLC expires.
38686 void OutboundHTLCDetails_set_cltv_expiry(struct LDKOutboundHTLCDetails *NONNULL_PTR this_ptr, uint32_t val);
38689 * The payment hash.
38691 const uint8_t (*OutboundHTLCDetails_get_payment_hash(const struct LDKOutboundHTLCDetails *NONNULL_PTR this_ptr))[32];
38694 * The payment hash.
38696 void OutboundHTLCDetails_set_payment_hash(struct LDKOutboundHTLCDetails *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
38699 * The state of the HTLC in the state machine.
38701 * Determines on which commitment transactions the HTLC is included and what message the HTLC is
38702 * waiting for to advance to the next state.
38704 * See [`OutboundHTLCStateDetails`] for information on the specific states.
38706 * LDK will always fill this field in, but when downgrading to prior versions of LDK, new
38707 * states may result in `None` here.
38709 struct LDKCOption_OutboundHTLCStateDetailsZ OutboundHTLCDetails_get_state(const struct LDKOutboundHTLCDetails *NONNULL_PTR this_ptr);
38712 * The state of the HTLC in the state machine.
38714 * Determines on which commitment transactions the HTLC is included and what message the HTLC is
38715 * waiting for to advance to the next state.
38717 * See [`OutboundHTLCStateDetails`] for information on the specific states.
38719 * LDK will always fill this field in, but when downgrading to prior versions of LDK, new
38720 * states may result in `None` here.
38722 void OutboundHTLCDetails_set_state(struct LDKOutboundHTLCDetails *NONNULL_PTR this_ptr, struct LDKCOption_OutboundHTLCStateDetailsZ val);
38725 * The extra fee being skimmed off the top of this HTLC.
38727 struct LDKCOption_u64Z OutboundHTLCDetails_get_skimmed_fee_msat(const struct LDKOutboundHTLCDetails *NONNULL_PTR this_ptr);
38730 * The extra fee being skimmed off the top of this HTLC.
38732 void OutboundHTLCDetails_set_skimmed_fee_msat(struct LDKOutboundHTLCDetails *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
38735 * Whether the HTLC has an output below the local dust limit. If so, the output will be trimmed
38736 * from the local commitment transaction and added to the commitment transaction fee.
38737 * For non-anchor channels, this takes into account the cost of the second-stage HTLC
38738 * transactions as well.
38740 * When the local commitment transaction is broadcasted as part of a unilateral closure,
38741 * the value of this HTLC will therefore not be claimable but instead burned as a transaction
38744 * Note that dust limits are specific to each party. An HTLC can be dust for the local
38745 * commitment transaction but not for the counterparty's commitment transaction and vice versa.
38747 bool OutboundHTLCDetails_get_is_dust(const struct LDKOutboundHTLCDetails *NONNULL_PTR this_ptr);
38750 * Whether the HTLC has an output below the local dust limit. If so, the output will be trimmed
38751 * from the local commitment transaction and added to the commitment transaction fee.
38752 * For non-anchor channels, this takes into account the cost of the second-stage HTLC
38753 * transactions as well.
38755 * When the local commitment transaction is broadcasted as part of a unilateral closure,
38756 * the value of this HTLC will therefore not be claimable but instead burned as a transaction
38759 * Note that dust limits are specific to each party. An HTLC can be dust for the local
38760 * commitment transaction but not for the counterparty's commitment transaction and vice versa.
38762 void OutboundHTLCDetails_set_is_dust(struct LDKOutboundHTLCDetails *NONNULL_PTR this_ptr, bool val);
38765 * Constructs a new OutboundHTLCDetails given each field
38767 MUST_USE_RES struct LDKOutboundHTLCDetails OutboundHTLCDetails_new(struct LDKCOption_u64Z htlc_id_arg, uint64_t amount_msat_arg, uint32_t cltv_expiry_arg, struct LDKThirtyTwoBytes payment_hash_arg, struct LDKCOption_OutboundHTLCStateDetailsZ state_arg, struct LDKCOption_u64Z skimmed_fee_msat_arg, bool is_dust_arg);
38770 * Creates a copy of the OutboundHTLCDetails
38772 struct LDKOutboundHTLCDetails OutboundHTLCDetails_clone(const struct LDKOutboundHTLCDetails *NONNULL_PTR orig);
38775 * Serialize the OutboundHTLCDetails object into a byte array which can be read by OutboundHTLCDetails_read
38777 struct LDKCVec_u8Z OutboundHTLCDetails_write(const struct LDKOutboundHTLCDetails *NONNULL_PTR obj);
38780 * Read a OutboundHTLCDetails from a byte array, created by OutboundHTLCDetails_write
38782 struct LDKCResult_OutboundHTLCDetailsDecodeErrorZ OutboundHTLCDetails_read(struct LDKu8slice ser);
38785 * Frees any resources used by the CounterpartyForwardingInfo, if is_owned is set and inner is non-NULL.
38787 void CounterpartyForwardingInfo_free(struct LDKCounterpartyForwardingInfo this_obj);
38790 * Base routing fee in millisatoshis.
38792 uint32_t CounterpartyForwardingInfo_get_fee_base_msat(const struct LDKCounterpartyForwardingInfo *NONNULL_PTR this_ptr);
38795 * Base routing fee in millisatoshis.
38797 void CounterpartyForwardingInfo_set_fee_base_msat(struct LDKCounterpartyForwardingInfo *NONNULL_PTR this_ptr, uint32_t val);
38800 * Amount in millionths of a satoshi the channel will charge per transferred satoshi.
38802 uint32_t CounterpartyForwardingInfo_get_fee_proportional_millionths(const struct LDKCounterpartyForwardingInfo *NONNULL_PTR this_ptr);
38805 * Amount in millionths of a satoshi the channel will charge per transferred satoshi.
38807 void CounterpartyForwardingInfo_set_fee_proportional_millionths(struct LDKCounterpartyForwardingInfo *NONNULL_PTR this_ptr, uint32_t val);
38810 * The minimum difference in cltv_expiry between an ingoing HTLC and its outgoing counterpart,
38811 * such that the outgoing HTLC is forwardable to this counterparty. See `msgs::ChannelUpdate`'s
38812 * `cltv_expiry_delta` for more details.
38814 uint16_t CounterpartyForwardingInfo_get_cltv_expiry_delta(const struct LDKCounterpartyForwardingInfo *NONNULL_PTR this_ptr);
38817 * The minimum difference in cltv_expiry between an ingoing HTLC and its outgoing counterpart,
38818 * such that the outgoing HTLC is forwardable to this counterparty. See `msgs::ChannelUpdate`'s
38819 * `cltv_expiry_delta` for more details.
38821 void CounterpartyForwardingInfo_set_cltv_expiry_delta(struct LDKCounterpartyForwardingInfo *NONNULL_PTR this_ptr, uint16_t val);
38824 * Constructs a new CounterpartyForwardingInfo given each field
38826 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);
38829 * Creates a copy of the CounterpartyForwardingInfo
38831 struct LDKCounterpartyForwardingInfo CounterpartyForwardingInfo_clone(const struct LDKCounterpartyForwardingInfo *NONNULL_PTR orig);
38834 * Serialize the CounterpartyForwardingInfo object into a byte array which can be read by CounterpartyForwardingInfo_read
38836 struct LDKCVec_u8Z CounterpartyForwardingInfo_write(const struct LDKCounterpartyForwardingInfo *NONNULL_PTR obj);
38839 * Read a CounterpartyForwardingInfo from a byte array, created by CounterpartyForwardingInfo_write
38841 struct LDKCResult_CounterpartyForwardingInfoDecodeErrorZ CounterpartyForwardingInfo_read(struct LDKu8slice ser);
38844 * Frees any resources used by the ChannelCounterparty, if is_owned is set and inner is non-NULL.
38846 void ChannelCounterparty_free(struct LDKChannelCounterparty this_obj);
38849 * The node_id of our counterparty
38851 struct LDKPublicKey ChannelCounterparty_get_node_id(const struct LDKChannelCounterparty *NONNULL_PTR this_ptr);
38854 * The node_id of our counterparty
38856 void ChannelCounterparty_set_node_id(struct LDKChannelCounterparty *NONNULL_PTR this_ptr, struct LDKPublicKey val);
38859 * The Features the channel counterparty provided upon last connection.
38860 * Useful for routing as it is the most up-to-date copy of the counterparty's features and
38861 * many routing-relevant features are present in the init context.
38863 struct LDKInitFeatures ChannelCounterparty_get_features(const struct LDKChannelCounterparty *NONNULL_PTR this_ptr);
38866 * The Features the channel counterparty provided upon last connection.
38867 * Useful for routing as it is the most up-to-date copy of the counterparty's features and
38868 * many routing-relevant features are present in the init context.
38870 void ChannelCounterparty_set_features(struct LDKChannelCounterparty *NONNULL_PTR this_ptr, struct LDKInitFeatures val);
38873 * The value, in satoshis, that must always be held in the channel for our counterparty. This
38874 * value ensures that if our counterparty broadcasts a revoked state, we can punish them by
38875 * claiming at least this value on chain.
38877 * This value is not included in [`inbound_capacity_msat`] as it can never be spent.
38879 * [`inbound_capacity_msat`]: ChannelDetails::inbound_capacity_msat
38881 uint64_t ChannelCounterparty_get_unspendable_punishment_reserve(const struct LDKChannelCounterparty *NONNULL_PTR this_ptr);
38884 * The value, in satoshis, that must always be held in the channel for our counterparty. This
38885 * value ensures that if our counterparty broadcasts a revoked state, we can punish them by
38886 * claiming at least this value on chain.
38888 * This value is not included in [`inbound_capacity_msat`] as it can never be spent.
38890 * [`inbound_capacity_msat`]: ChannelDetails::inbound_capacity_msat
38892 void ChannelCounterparty_set_unspendable_punishment_reserve(struct LDKChannelCounterparty *NONNULL_PTR this_ptr, uint64_t val);
38895 * Information on the fees and requirements that the counterparty requires when forwarding
38896 * payments to us through this channel.
38898 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
38900 struct LDKCounterpartyForwardingInfo ChannelCounterparty_get_forwarding_info(const struct LDKChannelCounterparty *NONNULL_PTR this_ptr);
38903 * Information on the fees and requirements that the counterparty requires when forwarding
38904 * payments to us through this channel.
38906 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
38908 void ChannelCounterparty_set_forwarding_info(struct LDKChannelCounterparty *NONNULL_PTR this_ptr, struct LDKCounterpartyForwardingInfo val);
38911 * The smallest value HTLC (in msat) the remote peer will accept, for this channel. This field
38912 * is only `None` before we have received either the `OpenChannel` or `AcceptChannel` message
38913 * from the remote peer, or for `ChannelCounterparty` objects serialized prior to LDK 0.0.107.
38915 struct LDKCOption_u64Z ChannelCounterparty_get_outbound_htlc_minimum_msat(const struct LDKChannelCounterparty *NONNULL_PTR this_ptr);
38918 * The smallest value HTLC (in msat) the remote peer will accept, for this channel. This field
38919 * is only `None` before we have received either the `OpenChannel` or `AcceptChannel` message
38920 * from the remote peer, or for `ChannelCounterparty` objects serialized prior to LDK 0.0.107.
38922 void ChannelCounterparty_set_outbound_htlc_minimum_msat(struct LDKChannelCounterparty *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
38925 * The largest value HTLC (in msat) the remote peer currently will accept, for this channel.
38927 struct LDKCOption_u64Z ChannelCounterparty_get_outbound_htlc_maximum_msat(const struct LDKChannelCounterparty *NONNULL_PTR this_ptr);
38930 * The largest value HTLC (in msat) the remote peer currently will accept, for this channel.
38932 void ChannelCounterparty_set_outbound_htlc_maximum_msat(struct LDKChannelCounterparty *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
38935 * Constructs a new ChannelCounterparty given each field
38937 * Note that forwarding_info_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
38939 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);
38942 * Creates a copy of the ChannelCounterparty
38944 struct LDKChannelCounterparty ChannelCounterparty_clone(const struct LDKChannelCounterparty *NONNULL_PTR orig);
38947 * Serialize the ChannelCounterparty object into a byte array which can be read by ChannelCounterparty_read
38949 struct LDKCVec_u8Z ChannelCounterparty_write(const struct LDKChannelCounterparty *NONNULL_PTR obj);
38952 * Read a ChannelCounterparty from a byte array, created by ChannelCounterparty_write
38954 struct LDKCResult_ChannelCounterpartyDecodeErrorZ ChannelCounterparty_read(struct LDKu8slice ser);
38957 * Frees any resources used by the ChannelDetails, if is_owned is set and inner is non-NULL.
38959 void ChannelDetails_free(struct LDKChannelDetails this_obj);
38962 * The channel's ID (prior to funding transaction generation, this is a random 32 bytes,
38963 * thereafter this is the txid of the funding transaction xor the funding transaction output).
38964 * Note that this means this value is *not* persistent - it can change once during the
38965 * lifetime of the channel.
38967 struct LDKChannelId ChannelDetails_get_channel_id(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
38970 * The channel's ID (prior to funding transaction generation, this is a random 32 bytes,
38971 * thereafter this is the txid of the funding transaction xor the funding transaction output).
38972 * Note that this means this value is *not* persistent - it can change once during the
38973 * lifetime of the channel.
38975 void ChannelDetails_set_channel_id(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKChannelId val);
38978 * Parameters which apply to our counterparty. See individual fields for more information.
38980 struct LDKChannelCounterparty ChannelDetails_get_counterparty(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
38983 * Parameters which apply to our counterparty. See individual fields for more information.
38985 void ChannelDetails_set_counterparty(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKChannelCounterparty val);
38988 * The Channel's funding transaction output, if we've negotiated the funding transaction with
38989 * our counterparty already.
38991 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
38993 struct LDKOutPoint ChannelDetails_get_funding_txo(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
38996 * The Channel's funding transaction output, if we've negotiated the funding transaction with
38997 * our counterparty already.
38999 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
39001 void ChannelDetails_set_funding_txo(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKOutPoint val);
39004 * The features which this channel operates with. See individual features for more info.
39006 * `None` until negotiation completes and the channel type is finalized.
39008 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
39010 struct LDKChannelTypeFeatures ChannelDetails_get_channel_type(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
39013 * The features which this channel operates with. See individual features for more info.
39015 * `None` until negotiation completes and the channel type is finalized.
39017 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
39019 void ChannelDetails_set_channel_type(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKChannelTypeFeatures val);
39022 * The position of the funding transaction in the chain. None if the funding transaction has
39023 * not yet been confirmed and the channel fully opened.
39025 * Note that if [`inbound_scid_alias`] is set, it must be used for invoices and inbound
39026 * payments instead of this. See [`get_inbound_payment_scid`].
39028 * For channels with [`confirmations_required`] set to `Some(0)`, [`outbound_scid_alias`] may
39029 * be used in place of this in outbound routes. See [`get_outbound_payment_scid`].
39031 * [`inbound_scid_alias`]: Self::inbound_scid_alias
39032 * [`outbound_scid_alias`]: Self::outbound_scid_alias
39033 * [`get_inbound_payment_scid`]: Self::get_inbound_payment_scid
39034 * [`get_outbound_payment_scid`]: Self::get_outbound_payment_scid
39035 * [`confirmations_required`]: Self::confirmations_required
39037 struct LDKCOption_u64Z ChannelDetails_get_short_channel_id(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
39040 * The position of the funding transaction in the chain. None if the funding transaction has
39041 * not yet been confirmed and the channel fully opened.
39043 * Note that if [`inbound_scid_alias`] is set, it must be used for invoices and inbound
39044 * payments instead of this. See [`get_inbound_payment_scid`].
39046 * For channels with [`confirmations_required`] set to `Some(0)`, [`outbound_scid_alias`] may
39047 * be used in place of this in outbound routes. See [`get_outbound_payment_scid`].
39049 * [`inbound_scid_alias`]: Self::inbound_scid_alias
39050 * [`outbound_scid_alias`]: Self::outbound_scid_alias
39051 * [`get_inbound_payment_scid`]: Self::get_inbound_payment_scid
39052 * [`get_outbound_payment_scid`]: Self::get_outbound_payment_scid
39053 * [`confirmations_required`]: Self::confirmations_required
39055 void ChannelDetails_set_short_channel_id(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
39058 * An optional [`short_channel_id`] alias for this channel, randomly generated by us and
39059 * usable in place of [`short_channel_id`] to reference the channel in outbound routes when
39060 * the channel has not yet been confirmed (as long as [`confirmations_required`] is
39063 * This will be `None` as long as the channel is not available for routing outbound payments.
39065 * [`short_channel_id`]: Self::short_channel_id
39066 * [`confirmations_required`]: Self::confirmations_required
39068 struct LDKCOption_u64Z ChannelDetails_get_outbound_scid_alias(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
39071 * An optional [`short_channel_id`] alias for this channel, randomly generated by us and
39072 * usable in place of [`short_channel_id`] to reference the channel in outbound routes when
39073 * the channel has not yet been confirmed (as long as [`confirmations_required`] is
39076 * This will be `None` as long as the channel is not available for routing outbound payments.
39078 * [`short_channel_id`]: Self::short_channel_id
39079 * [`confirmations_required`]: Self::confirmations_required
39081 void ChannelDetails_set_outbound_scid_alias(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
39084 * An optional [`short_channel_id`] alias for this channel, randomly generated by our
39085 * counterparty and usable in place of [`short_channel_id`] in invoice route hints. Our
39086 * counterparty will recognize the alias provided here in place of the [`short_channel_id`]
39087 * when they see a payment to be routed to us.
39089 * Our counterparty may choose to rotate this value at any time, though will always recognize
39090 * previous values for inbound payment forwarding.
39092 * [`short_channel_id`]: Self::short_channel_id
39094 struct LDKCOption_u64Z ChannelDetails_get_inbound_scid_alias(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
39097 * An optional [`short_channel_id`] alias for this channel, randomly generated by our
39098 * counterparty and usable in place of [`short_channel_id`] in invoice route hints. Our
39099 * counterparty will recognize the alias provided here in place of the [`short_channel_id`]
39100 * when they see a payment to be routed to us.
39102 * Our counterparty may choose to rotate this value at any time, though will always recognize
39103 * previous values for inbound payment forwarding.
39105 * [`short_channel_id`]: Self::short_channel_id
39107 void ChannelDetails_set_inbound_scid_alias(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
39110 * The value, in satoshis, of this channel as appears in the funding output
39112 uint64_t ChannelDetails_get_channel_value_satoshis(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
39115 * The value, in satoshis, of this channel as appears in the funding output
39117 void ChannelDetails_set_channel_value_satoshis(struct LDKChannelDetails *NONNULL_PTR this_ptr, uint64_t val);
39120 * The value, in satoshis, that must always be held in the channel for us. This value ensures
39121 * that if we broadcast a revoked state, our counterparty can punish us by claiming at least
39122 * this value on chain.
39124 * This value is not included in [`outbound_capacity_msat`] as it can never be spent.
39126 * This value will be `None` for outbound channels until the counterparty accepts the channel.
39128 * [`outbound_capacity_msat`]: ChannelDetails::outbound_capacity_msat
39130 struct LDKCOption_u64Z ChannelDetails_get_unspendable_punishment_reserve(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
39133 * The value, in satoshis, that must always be held in the channel for us. This value ensures
39134 * that if we broadcast a revoked state, our counterparty can punish us by claiming at least
39135 * this value on chain.
39137 * This value is not included in [`outbound_capacity_msat`] as it can never be spent.
39139 * This value will be `None` for outbound channels until the counterparty accepts the channel.
39141 * [`outbound_capacity_msat`]: ChannelDetails::outbound_capacity_msat
39143 void ChannelDetails_set_unspendable_punishment_reserve(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
39146 * The `user_channel_id` value passed in to [`ChannelManager::create_channel`] for outbound
39147 * channels, or to [`ChannelManager::accept_inbound_channel`] for inbound channels if
39148 * [`UserConfig::manually_accept_inbound_channels`] config flag is set to true. Otherwise
39149 * `user_channel_id` will be randomized for an inbound channel. This may be zero for objects
39150 * serialized with LDK versions prior to 0.0.113.
39152 * [`ChannelManager::create_channel`]: crate::ln::channelmanager::ChannelManager::create_channel
39153 * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
39154 * [`UserConfig::manually_accept_inbound_channels`]: crate::util::config::UserConfig::manually_accept_inbound_channels
39156 struct LDKU128 ChannelDetails_get_user_channel_id(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
39159 * The `user_channel_id` value passed in to [`ChannelManager::create_channel`] for outbound
39160 * channels, or to [`ChannelManager::accept_inbound_channel`] for inbound channels if
39161 * [`UserConfig::manually_accept_inbound_channels`] config flag is set to true. Otherwise
39162 * `user_channel_id` will be randomized for an inbound channel. This may be zero for objects
39163 * serialized with LDK versions prior to 0.0.113.
39165 * [`ChannelManager::create_channel`]: crate::ln::channelmanager::ChannelManager::create_channel
39166 * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
39167 * [`UserConfig::manually_accept_inbound_channels`]: crate::util::config::UserConfig::manually_accept_inbound_channels
39169 void ChannelDetails_set_user_channel_id(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKU128 val);
39172 * The currently negotiated fee rate denominated in satoshi per 1000 weight units,
39173 * which is applied to commitment and HTLC transactions.
39175 * This value will be `None` for objects serialized with LDK versions prior to 0.0.115.
39177 struct LDKCOption_u32Z ChannelDetails_get_feerate_sat_per_1000_weight(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
39180 * The currently negotiated fee rate denominated in satoshi per 1000 weight units,
39181 * which is applied to commitment and HTLC transactions.
39183 * This value will be `None` for objects serialized with LDK versions prior to 0.0.115.
39185 void ChannelDetails_set_feerate_sat_per_1000_weight(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u32Z val);
39188 * Our total balance. This is the amount we would get if we close the channel.
39189 * This value is not exact. Due to various in-flight changes and feerate changes, exactly this
39190 * amount is not likely to be recoverable on close.
39192 * This does not include any pending HTLCs which are not yet fully resolved (and, thus, whose
39193 * balance is not available for inclusion in new outbound HTLCs). This further does not include
39194 * any pending outgoing HTLCs which are awaiting some other resolution to be sent.
39195 * This does not consider any on-chain fees.
39197 * See also [`ChannelDetails::outbound_capacity_msat`]
39199 uint64_t ChannelDetails_get_balance_msat(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
39202 * Our total balance. This is the amount we would get if we close the channel.
39203 * This value is not exact. Due to various in-flight changes and feerate changes, exactly this
39204 * amount is not likely to be recoverable on close.
39206 * This does not include any pending HTLCs which are not yet fully resolved (and, thus, whose
39207 * balance is not available for inclusion in new outbound HTLCs). This further does not include
39208 * any pending outgoing HTLCs which are awaiting some other resolution to be sent.
39209 * This does not consider any on-chain fees.
39211 * See also [`ChannelDetails::outbound_capacity_msat`]
39213 void ChannelDetails_set_balance_msat(struct LDKChannelDetails *NONNULL_PTR this_ptr, uint64_t val);
39216 * The available outbound capacity for sending HTLCs to the remote peer. This does not include
39217 * any pending HTLCs which are not yet fully resolved (and, thus, whose balance is not
39218 * available for inclusion in new outbound HTLCs). This further does not include any pending
39219 * outgoing HTLCs which are awaiting some other resolution to be sent.
39221 * See also [`ChannelDetails::balance_msat`]
39223 * This value is not exact. Due to various in-flight changes, feerate changes, and our
39224 * conflict-avoidance policy, exactly this amount is not likely to be spendable. However, we
39225 * should be able to spend nearly this amount.
39227 uint64_t ChannelDetails_get_outbound_capacity_msat(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
39230 * The available outbound capacity for sending HTLCs to the remote peer. This does not include
39231 * any pending HTLCs which are not yet fully resolved (and, thus, whose balance is not
39232 * available for inclusion in new outbound HTLCs). This further does not include any pending
39233 * outgoing HTLCs which are awaiting some other resolution to be sent.
39235 * See also [`ChannelDetails::balance_msat`]
39237 * This value is not exact. Due to various in-flight changes, feerate changes, and our
39238 * conflict-avoidance policy, exactly this amount is not likely to be spendable. However, we
39239 * should be able to spend nearly this amount.
39241 void ChannelDetails_set_outbound_capacity_msat(struct LDKChannelDetails *NONNULL_PTR this_ptr, uint64_t val);
39244 * The available outbound capacity for sending a single HTLC to the remote peer. This is
39245 * similar to [`ChannelDetails::outbound_capacity_msat`] but it may be further restricted by
39246 * the current state and per-HTLC limit(s). This is intended for use when routing, allowing us
39247 * to use a limit as close as possible to the HTLC limit we can currently send.
39249 * See also [`ChannelDetails::next_outbound_htlc_minimum_msat`],
39250 * [`ChannelDetails::balance_msat`], and [`ChannelDetails::outbound_capacity_msat`].
39252 uint64_t ChannelDetails_get_next_outbound_htlc_limit_msat(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
39255 * The available outbound capacity for sending a single HTLC to the remote peer. This is
39256 * similar to [`ChannelDetails::outbound_capacity_msat`] but it may be further restricted by
39257 * the current state and per-HTLC limit(s). This is intended for use when routing, allowing us
39258 * to use a limit as close as possible to the HTLC limit we can currently send.
39260 * See also [`ChannelDetails::next_outbound_htlc_minimum_msat`],
39261 * [`ChannelDetails::balance_msat`], and [`ChannelDetails::outbound_capacity_msat`].
39263 void ChannelDetails_set_next_outbound_htlc_limit_msat(struct LDKChannelDetails *NONNULL_PTR this_ptr, uint64_t val);
39266 * The minimum value for sending a single HTLC to the remote peer. This is the equivalent of
39267 * [`ChannelDetails::next_outbound_htlc_limit_msat`] but represents a lower-bound, rather than
39268 * an upper-bound. This is intended for use when routing, allowing us to ensure we pick a
39269 * route which is valid.
39271 uint64_t ChannelDetails_get_next_outbound_htlc_minimum_msat(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
39274 * The minimum value for sending a single HTLC to the remote peer. This is the equivalent of
39275 * [`ChannelDetails::next_outbound_htlc_limit_msat`] but represents a lower-bound, rather than
39276 * an upper-bound. This is intended for use when routing, allowing us to ensure we pick a
39277 * route which is valid.
39279 void ChannelDetails_set_next_outbound_htlc_minimum_msat(struct LDKChannelDetails *NONNULL_PTR this_ptr, uint64_t val);
39282 * The available inbound capacity for the remote peer to send HTLCs to us. This does not
39283 * include any pending HTLCs which are not yet fully resolved (and, thus, whose balance is not
39284 * available for inclusion in new inbound HTLCs).
39285 * Note that there are some corner cases not fully handled here, so the actual available
39286 * inbound capacity may be slightly higher than this.
39288 * This value is not exact. Due to various in-flight changes, feerate changes, and our
39289 * counterparty's conflict-avoidance policy, exactly this amount is not likely to be spendable.
39290 * However, our counterparty should be able to spend nearly this amount.
39292 uint64_t ChannelDetails_get_inbound_capacity_msat(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
39295 * The available inbound capacity for the remote peer to send HTLCs to us. This does not
39296 * include any pending HTLCs which are not yet fully resolved (and, thus, whose balance is not
39297 * available for inclusion in new inbound HTLCs).
39298 * Note that there are some corner cases not fully handled here, so the actual available
39299 * inbound capacity may be slightly higher than this.
39301 * This value is not exact. Due to various in-flight changes, feerate changes, and our
39302 * counterparty's conflict-avoidance policy, exactly this amount is not likely to be spendable.
39303 * However, our counterparty should be able to spend nearly this amount.
39305 void ChannelDetails_set_inbound_capacity_msat(struct LDKChannelDetails *NONNULL_PTR this_ptr, uint64_t val);
39308 * The number of required confirmations on the funding transaction before the funding will be
39309 * considered \"locked\". This number is selected by the channel fundee (i.e. us if
39310 * [`is_outbound`] is *not* set), and can be selected for inbound channels with
39311 * [`ChannelHandshakeConfig::minimum_depth`] or limited for outbound channels with
39312 * [`ChannelHandshakeLimits::max_minimum_depth`].
39314 * This value will be `None` for outbound channels until the counterparty accepts the channel.
39316 * [`is_outbound`]: ChannelDetails::is_outbound
39317 * [`ChannelHandshakeConfig::minimum_depth`]: crate::util::config::ChannelHandshakeConfig::minimum_depth
39318 * [`ChannelHandshakeLimits::max_minimum_depth`]: crate::util::config::ChannelHandshakeLimits::max_minimum_depth
39320 struct LDKCOption_u32Z ChannelDetails_get_confirmations_required(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
39323 * The number of required confirmations on the funding transaction before the funding will be
39324 * considered \"locked\". This number is selected by the channel fundee (i.e. us if
39325 * [`is_outbound`] is *not* set), and can be selected for inbound channels with
39326 * [`ChannelHandshakeConfig::minimum_depth`] or limited for outbound channels with
39327 * [`ChannelHandshakeLimits::max_minimum_depth`].
39329 * This value will be `None` for outbound channels until the counterparty accepts the channel.
39331 * [`is_outbound`]: ChannelDetails::is_outbound
39332 * [`ChannelHandshakeConfig::minimum_depth`]: crate::util::config::ChannelHandshakeConfig::minimum_depth
39333 * [`ChannelHandshakeLimits::max_minimum_depth`]: crate::util::config::ChannelHandshakeLimits::max_minimum_depth
39335 void ChannelDetails_set_confirmations_required(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u32Z val);
39338 * The current number of confirmations on the funding transaction.
39340 * This value will be `None` for objects serialized with LDK versions prior to 0.0.113.
39342 struct LDKCOption_u32Z ChannelDetails_get_confirmations(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
39345 * The current number of confirmations on the funding transaction.
39347 * This value will be `None` for objects serialized with LDK versions prior to 0.0.113.
39349 void ChannelDetails_set_confirmations(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u32Z val);
39352 * The number of blocks (after our commitment transaction confirms) that we will need to wait
39353 * until we can claim our funds after we force-close the channel. During this time our
39354 * counterparty is allowed to punish us if we broadcasted a stale state. If our counterparty
39355 * force-closes the channel and broadcasts a commitment transaction we do not have to wait any
39356 * time to claim our non-HTLC-encumbered funds.
39358 * This value will be `None` for outbound channels until the counterparty accepts the channel.
39360 struct LDKCOption_u16Z ChannelDetails_get_force_close_spend_delay(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
39363 * The number of blocks (after our commitment transaction confirms) that we will need to wait
39364 * until we can claim our funds after we force-close the channel. During this time our
39365 * counterparty is allowed to punish us if we broadcasted a stale state. If our counterparty
39366 * force-closes the channel and broadcasts a commitment transaction we do not have to wait any
39367 * time to claim our non-HTLC-encumbered funds.
39369 * This value will be `None` for outbound channels until the counterparty accepts the channel.
39371 void ChannelDetails_set_force_close_spend_delay(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u16Z val);
39374 * True if the channel was initiated (and thus funded) by us.
39376 bool ChannelDetails_get_is_outbound(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
39379 * True if the channel was initiated (and thus funded) by us.
39381 void ChannelDetails_set_is_outbound(struct LDKChannelDetails *NONNULL_PTR this_ptr, bool val);
39384 * True if the channel is confirmed, channel_ready messages have been exchanged, and the
39385 * channel is not currently being shut down. `channel_ready` message exchange implies the
39386 * required confirmation count has been reached (and we were connected to the peer at some
39387 * point after the funding transaction received enough confirmations). The required
39388 * confirmation count is provided in [`confirmations_required`].
39390 * [`confirmations_required`]: ChannelDetails::confirmations_required
39392 bool ChannelDetails_get_is_channel_ready(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
39395 * True if the channel is confirmed, channel_ready messages have been exchanged, and the
39396 * channel is not currently being shut down. `channel_ready` message exchange implies the
39397 * required confirmation count has been reached (and we were connected to the peer at some
39398 * point after the funding transaction received enough confirmations). The required
39399 * confirmation count is provided in [`confirmations_required`].
39401 * [`confirmations_required`]: ChannelDetails::confirmations_required
39403 void ChannelDetails_set_is_channel_ready(struct LDKChannelDetails *NONNULL_PTR this_ptr, bool val);
39406 * The stage of the channel's shutdown.
39407 * `None` for `ChannelDetails` serialized on LDK versions prior to 0.0.116.
39409 * Returns a copy of the field.
39411 struct LDKCOption_ChannelShutdownStateZ ChannelDetails_get_channel_shutdown_state(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
39414 * The stage of the channel's shutdown.
39415 * `None` for `ChannelDetails` serialized on LDK versions prior to 0.0.116.
39417 void ChannelDetails_set_channel_shutdown_state(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_ChannelShutdownStateZ val);
39420 * True if the channel is (a) confirmed and channel_ready messages have been exchanged, (b)
39421 * the peer is connected, and (c) the channel is not currently negotiating a shutdown.
39423 * This is a strict superset of `is_channel_ready`.
39425 bool ChannelDetails_get_is_usable(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
39428 * True if the channel is (a) confirmed and channel_ready messages have been exchanged, (b)
39429 * the peer is connected, and (c) the channel is not currently negotiating a shutdown.
39431 * This is a strict superset of `is_channel_ready`.
39433 void ChannelDetails_set_is_usable(struct LDKChannelDetails *NONNULL_PTR this_ptr, bool val);
39436 * True if this channel is (or will be) publicly-announced.
39438 bool ChannelDetails_get_is_public(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
39441 * True if this channel is (or will be) publicly-announced.
39443 void ChannelDetails_set_is_public(struct LDKChannelDetails *NONNULL_PTR this_ptr, bool val);
39446 * The smallest value HTLC (in msat) we will accept, for this channel. This field
39447 * is only `None` for `ChannelDetails` objects serialized prior to LDK 0.0.107
39449 struct LDKCOption_u64Z ChannelDetails_get_inbound_htlc_minimum_msat(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
39452 * The smallest value HTLC (in msat) we will accept, for this channel. This field
39453 * is only `None` for `ChannelDetails` objects serialized prior to LDK 0.0.107
39455 void ChannelDetails_set_inbound_htlc_minimum_msat(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
39458 * The largest value HTLC (in msat) we currently will accept, for this channel.
39460 struct LDKCOption_u64Z ChannelDetails_get_inbound_htlc_maximum_msat(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
39463 * The largest value HTLC (in msat) we currently will accept, for this channel.
39465 void ChannelDetails_set_inbound_htlc_maximum_msat(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
39468 * Set of configurable parameters that affect channel operation.
39470 * This field is only `None` for `ChannelDetails` objects serialized prior to LDK 0.0.109.
39472 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
39474 struct LDKChannelConfig ChannelDetails_get_config(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
39477 * Set of configurable parameters that affect channel operation.
39479 * This field is only `None` for `ChannelDetails` objects serialized prior to LDK 0.0.109.
39481 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
39483 void ChannelDetails_set_config(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKChannelConfig val);
39486 * Pending inbound HTLCs.
39488 * This field is empty for objects serialized with LDK versions prior to 0.0.122.
39490 struct LDKCVec_InboundHTLCDetailsZ ChannelDetails_get_pending_inbound_htlcs(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
39493 * Pending inbound HTLCs.
39495 * This field is empty for objects serialized with LDK versions prior to 0.0.122.
39497 void ChannelDetails_set_pending_inbound_htlcs(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCVec_InboundHTLCDetailsZ val);
39500 * Pending outbound HTLCs.
39502 * This field is empty for objects serialized with LDK versions prior to 0.0.122.
39504 struct LDKCVec_OutboundHTLCDetailsZ ChannelDetails_get_pending_outbound_htlcs(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
39507 * Pending outbound HTLCs.
39509 * This field is empty for objects serialized with LDK versions prior to 0.0.122.
39511 void ChannelDetails_set_pending_outbound_htlcs(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCVec_OutboundHTLCDetailsZ val);
39514 * Constructs a new ChannelDetails given each field
39516 * Note that funding_txo_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
39517 * Note that channel_type_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
39518 * Note that config_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
39520 MUST_USE_RES struct LDKChannelDetails ChannelDetails_new(struct LDKChannelId channel_id_arg, struct LDKChannelCounterparty counterparty_arg, struct LDKOutPoint funding_txo_arg, struct LDKChannelTypeFeatures channel_type_arg, struct LDKCOption_u64Z short_channel_id_arg, struct LDKCOption_u64Z outbound_scid_alias_arg, struct LDKCOption_u64Z inbound_scid_alias_arg, uint64_t channel_value_satoshis_arg, struct LDKCOption_u64Z unspendable_punishment_reserve_arg, struct LDKU128 user_channel_id_arg, struct LDKCOption_u32Z feerate_sat_per_1000_weight_arg, uint64_t balance_msat_arg, uint64_t outbound_capacity_msat_arg, uint64_t next_outbound_htlc_limit_msat_arg, uint64_t next_outbound_htlc_minimum_msat_arg, uint64_t inbound_capacity_msat_arg, struct LDKCOption_u32Z confirmations_required_arg, struct LDKCOption_u32Z confirmations_arg, struct LDKCOption_u16Z force_close_spend_delay_arg, bool is_outbound_arg, bool is_channel_ready_arg, struct LDKCOption_ChannelShutdownStateZ channel_shutdown_state_arg, bool is_usable_arg, bool is_public_arg, struct LDKCOption_u64Z inbound_htlc_minimum_msat_arg, struct LDKCOption_u64Z inbound_htlc_maximum_msat_arg, struct LDKChannelConfig config_arg, struct LDKCVec_InboundHTLCDetailsZ pending_inbound_htlcs_arg, struct LDKCVec_OutboundHTLCDetailsZ pending_outbound_htlcs_arg);
39523 * Creates a copy of the ChannelDetails
39525 struct LDKChannelDetails ChannelDetails_clone(const struct LDKChannelDetails *NONNULL_PTR orig);
39528 * Gets the current SCID which should be used to identify this channel for inbound payments.
39529 * This should be used for providing invoice hints or in any other context where our
39530 * counterparty will forward a payment to us.
39532 * This is either the [`ChannelDetails::inbound_scid_alias`], if set, or the
39533 * [`ChannelDetails::short_channel_id`]. See those for more information.
39535 MUST_USE_RES struct LDKCOption_u64Z ChannelDetails_get_inbound_payment_scid(const struct LDKChannelDetails *NONNULL_PTR this_arg);
39538 * Gets the current SCID which should be used to identify this channel for outbound payments.
39539 * This should be used in [`Route`]s to describe the first hop or in other contexts where
39540 * we're sending or forwarding a payment outbound over this channel.
39542 * This is either the [`ChannelDetails::short_channel_id`], if set, or the
39543 * [`ChannelDetails::outbound_scid_alias`]. See those for more information.
39545 * [`Route`]: crate::routing::router::Route
39547 MUST_USE_RES struct LDKCOption_u64Z ChannelDetails_get_outbound_payment_scid(const struct LDKChannelDetails *NONNULL_PTR this_arg);
39550 * Serialize the ChannelDetails object into a byte array which can be read by ChannelDetails_read
39552 struct LDKCVec_u8Z ChannelDetails_write(const struct LDKChannelDetails *NONNULL_PTR obj);
39555 * Read a ChannelDetails from a byte array, created by ChannelDetails_write
39557 struct LDKCResult_ChannelDetailsDecodeErrorZ ChannelDetails_read(struct LDKu8slice ser);
39560 * Creates a copy of the ChannelShutdownState
39562 enum LDKChannelShutdownState ChannelShutdownState_clone(const enum LDKChannelShutdownState *NONNULL_PTR orig);
39565 * Utility method to constructs a new NotShuttingDown-variant ChannelShutdownState
39567 enum LDKChannelShutdownState ChannelShutdownState_not_shutting_down(void);
39570 * Utility method to constructs a new ShutdownInitiated-variant ChannelShutdownState
39572 enum LDKChannelShutdownState ChannelShutdownState_shutdown_initiated(void);
39575 * Utility method to constructs a new ResolvingHTLCs-variant ChannelShutdownState
39577 enum LDKChannelShutdownState ChannelShutdownState_resolving_htlcs(void);
39580 * Utility method to constructs a new NegotiatingClosingFee-variant ChannelShutdownState
39582 enum LDKChannelShutdownState ChannelShutdownState_negotiating_closing_fee(void);
39585 * Utility method to constructs a new ShutdownComplete-variant ChannelShutdownState
39587 enum LDKChannelShutdownState ChannelShutdownState_shutdown_complete(void);
39590 * Checks if two ChannelShutdownStates contain equal inner contents.
39591 * This ignores pointers and is_owned flags and looks at the values in fields.
39593 bool ChannelShutdownState_eq(const enum LDKChannelShutdownState *NONNULL_PTR a, const enum LDKChannelShutdownState *NONNULL_PTR b);
39596 * Serialize the ChannelShutdownState object into a byte array which can be read by ChannelShutdownState_read
39598 struct LDKCVec_u8Z ChannelShutdownState_write(const enum LDKChannelShutdownState *NONNULL_PTR obj);
39601 * Read a ChannelShutdownState from a byte array, created by ChannelShutdownState_write
39603 struct LDKCResult_ChannelShutdownStateDecodeErrorZ ChannelShutdownState_read(struct LDKu8slice ser);
39606 * Frees any resources used by the ExpandedKey, if is_owned is set and inner is non-NULL.
39608 void ExpandedKey_free(struct LDKExpandedKey this_obj);
39611 * Create a new [`ExpandedKey`] for generating an inbound payment hash and secret.
39613 * It is recommended to cache this value and not regenerate it for each new inbound payment.
39615 MUST_USE_RES struct LDKExpandedKey ExpandedKey_new(const uint8_t (*key_material)[32]);
39618 * Equivalent to [`crate::ln::channelmanager::ChannelManager::create_inbound_payment`], but no
39619 * `ChannelManager` is required. Useful for generating invoices for [phantom node payments] without
39620 * a `ChannelManager`.
39622 * `keys` is generated by calling [`NodeSigner::get_inbound_payment_key_material`] and then
39623 * calling [`ExpandedKey::new`] with its result. It is recommended to cache this value and not
39624 * regenerate it for each new inbound payment.
39626 * `current_time` is a Unix timestamp representing the current time.
39628 * Note that if `min_final_cltv_expiry_delta` is set to some value, then the payment will not be receivable
39629 * on versions of LDK prior to 0.0.114.
39631 * [phantom node payments]: crate::sign::PhantomKeysManager
39632 * [`NodeSigner::get_inbound_payment_key_material`]: crate::sign::NodeSigner::get_inbound_payment_key_material
39634 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);
39637 * Equivalent to [`crate::ln::channelmanager::ChannelManager::create_inbound_payment_for_hash`],
39638 * but no `ChannelManager` is required. Useful for generating invoices for [phantom node payments]
39639 * without a `ChannelManager`.
39641 * See [`create`] for information on the `keys` and `current_time` parameters.
39643 * Note that if `min_final_cltv_expiry_delta` is set to some value, then the payment will not be receivable
39644 * on versions of LDK prior to 0.0.114.
39646 * [phantom node payments]: crate::sign::PhantomKeysManager
39648 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);
39651 * Frees any resources used by the DecodeError
39653 void DecodeError_free(struct LDKDecodeError this_ptr);
39656 * Creates a copy of the DecodeError
39658 struct LDKDecodeError DecodeError_clone(const struct LDKDecodeError *NONNULL_PTR orig);
39661 * Utility method to constructs a new UnknownVersion-variant DecodeError
39663 struct LDKDecodeError DecodeError_unknown_version(void);
39666 * Utility method to constructs a new UnknownRequiredFeature-variant DecodeError
39668 struct LDKDecodeError DecodeError_unknown_required_feature(void);
39671 * Utility method to constructs a new InvalidValue-variant DecodeError
39673 struct LDKDecodeError DecodeError_invalid_value(void);
39676 * Utility method to constructs a new ShortRead-variant DecodeError
39678 struct LDKDecodeError DecodeError_short_read(void);
39681 * Utility method to constructs a new BadLengthDescriptor-variant DecodeError
39683 struct LDKDecodeError DecodeError_bad_length_descriptor(void);
39686 * Utility method to constructs a new Io-variant DecodeError
39688 struct LDKDecodeError DecodeError_io(enum LDKIOError a);
39691 * Utility method to constructs a new UnsupportedCompression-variant DecodeError
39693 struct LDKDecodeError DecodeError_unsupported_compression(void);
39696 * Utility method to constructs a new DangerousValue-variant DecodeError
39698 struct LDKDecodeError DecodeError_dangerous_value(void);
39701 * Generates a non-cryptographic 64-bit hash of the DecodeError.
39703 uint64_t DecodeError_hash(const struct LDKDecodeError *NONNULL_PTR o);
39706 * Checks if two DecodeErrors contain equal inner contents.
39707 * This ignores pointers and is_owned flags and looks at the values in fields.
39709 bool DecodeError_eq(const struct LDKDecodeError *NONNULL_PTR a, const struct LDKDecodeError *NONNULL_PTR b);
39712 * Frees any resources used by the Init, if is_owned is set and inner is non-NULL.
39714 void Init_free(struct LDKInit this_obj);
39717 * The relevant features which the sender supports.
39719 struct LDKInitFeatures Init_get_features(const struct LDKInit *NONNULL_PTR this_ptr);
39722 * The relevant features which the sender supports.
39724 void Init_set_features(struct LDKInit *NONNULL_PTR this_ptr, struct LDKInitFeatures val);
39727 * Indicates chains the sender is interested in.
39729 * If there are no common chains, the connection will be closed.
39731 * Returns a copy of the field.
39733 struct LDKCOption_CVec_ThirtyTwoBytesZZ Init_get_networks(const struct LDKInit *NONNULL_PTR this_ptr);
39736 * Indicates chains the sender is interested in.
39738 * If there are no common chains, the connection will be closed.
39740 void Init_set_networks(struct LDKInit *NONNULL_PTR this_ptr, struct LDKCOption_CVec_ThirtyTwoBytesZZ val);
39743 * The receipient's network address.
39745 * This adds the option to report a remote IP address back to a connecting peer using the init
39746 * message. A node can decide to use that information to discover a potential update to its
39747 * public IPv4 address (NAT) and use that for a [`NodeAnnouncement`] update message containing
39750 struct LDKCOption_SocketAddressZ Init_get_remote_network_address(const struct LDKInit *NONNULL_PTR this_ptr);
39753 * The receipient's network address.
39755 * This adds the option to report a remote IP address back to a connecting peer using the init
39756 * message. A node can decide to use that information to discover a potential update to its
39757 * public IPv4 address (NAT) and use that for a [`NodeAnnouncement`] update message containing
39760 void Init_set_remote_network_address(struct LDKInit *NONNULL_PTR this_ptr, struct LDKCOption_SocketAddressZ val);
39763 * Constructs a new Init given each field
39765 MUST_USE_RES struct LDKInit Init_new(struct LDKInitFeatures features_arg, struct LDKCOption_CVec_ThirtyTwoBytesZZ networks_arg, struct LDKCOption_SocketAddressZ remote_network_address_arg);
39768 * Creates a copy of the Init
39770 struct LDKInit Init_clone(const struct LDKInit *NONNULL_PTR orig);
39773 * Generates a non-cryptographic 64-bit hash of the Init.
39775 uint64_t Init_hash(const struct LDKInit *NONNULL_PTR o);
39778 * Checks if two Inits contain equal inner contents.
39779 * This ignores pointers and is_owned flags and looks at the values in fields.
39780 * Two objects with NULL inner values will be considered "equal" here.
39782 bool Init_eq(const struct LDKInit *NONNULL_PTR a, const struct LDKInit *NONNULL_PTR b);
39785 * Frees any resources used by the ErrorMessage, if is_owned is set and inner is non-NULL.
39787 void ErrorMessage_free(struct LDKErrorMessage this_obj);
39790 * The channel ID involved in the error.
39792 * All-0s indicates a general error unrelated to a specific channel, after which all channels
39793 * with the sending peer should be closed.
39795 struct LDKChannelId ErrorMessage_get_channel_id(const struct LDKErrorMessage *NONNULL_PTR this_ptr);
39798 * The channel ID involved in the error.
39800 * All-0s indicates a general error unrelated to a specific channel, after which all channels
39801 * with the sending peer should be closed.
39803 void ErrorMessage_set_channel_id(struct LDKErrorMessage *NONNULL_PTR this_ptr, struct LDKChannelId val);
39806 * A possibly human-readable error description.
39808 * The string should be sanitized before it is used (e.g., emitted to logs or printed to
39809 * `stdout`). Otherwise, a well crafted error message may trigger a security vulnerability in
39810 * the terminal emulator or the logging subsystem.
39812 struct LDKStr ErrorMessage_get_data(const struct LDKErrorMessage *NONNULL_PTR this_ptr);
39815 * A possibly human-readable error description.
39817 * The string should be sanitized before it is used (e.g., emitted to logs or printed to
39818 * `stdout`). Otherwise, a well crafted error message may trigger a security vulnerability in
39819 * the terminal emulator or the logging subsystem.
39821 void ErrorMessage_set_data(struct LDKErrorMessage *NONNULL_PTR this_ptr, struct LDKStr val);
39824 * Constructs a new ErrorMessage given each field
39826 MUST_USE_RES struct LDKErrorMessage ErrorMessage_new(struct LDKChannelId channel_id_arg, struct LDKStr data_arg);
39829 * Creates a copy of the ErrorMessage
39831 struct LDKErrorMessage ErrorMessage_clone(const struct LDKErrorMessage *NONNULL_PTR orig);
39834 * Generates a non-cryptographic 64-bit hash of the ErrorMessage.
39836 uint64_t ErrorMessage_hash(const struct LDKErrorMessage *NONNULL_PTR o);
39839 * Checks if two ErrorMessages contain equal inner contents.
39840 * This ignores pointers and is_owned flags and looks at the values in fields.
39841 * Two objects with NULL inner values will be considered "equal" here.
39843 bool ErrorMessage_eq(const struct LDKErrorMessage *NONNULL_PTR a, const struct LDKErrorMessage *NONNULL_PTR b);
39846 * Frees any resources used by the WarningMessage, if is_owned is set and inner is non-NULL.
39848 void WarningMessage_free(struct LDKWarningMessage this_obj);
39851 * The channel ID involved in the warning.
39853 * All-0s indicates a warning unrelated to a specific channel.
39855 struct LDKChannelId WarningMessage_get_channel_id(const struct LDKWarningMessage *NONNULL_PTR this_ptr);
39858 * The channel ID involved in the warning.
39860 * All-0s indicates a warning unrelated to a specific channel.
39862 void WarningMessage_set_channel_id(struct LDKWarningMessage *NONNULL_PTR this_ptr, struct LDKChannelId val);
39865 * A possibly human-readable warning description.
39867 * The string should be sanitized before it is used (e.g. emitted to logs or printed to
39868 * stdout). Otherwise, a well crafted error message may trigger a security vulnerability in
39869 * the terminal emulator or the logging subsystem.
39871 struct LDKStr WarningMessage_get_data(const struct LDKWarningMessage *NONNULL_PTR this_ptr);
39874 * A possibly human-readable warning description.
39876 * The string should be sanitized before it is used (e.g. emitted to logs or printed to
39877 * stdout). Otherwise, a well crafted error message may trigger a security vulnerability in
39878 * the terminal emulator or the logging subsystem.
39880 void WarningMessage_set_data(struct LDKWarningMessage *NONNULL_PTR this_ptr, struct LDKStr val);
39883 * Constructs a new WarningMessage given each field
39885 MUST_USE_RES struct LDKWarningMessage WarningMessage_new(struct LDKChannelId channel_id_arg, struct LDKStr data_arg);
39888 * Creates a copy of the WarningMessage
39890 struct LDKWarningMessage WarningMessage_clone(const struct LDKWarningMessage *NONNULL_PTR orig);
39893 * Generates a non-cryptographic 64-bit hash of the WarningMessage.
39895 uint64_t WarningMessage_hash(const struct LDKWarningMessage *NONNULL_PTR o);
39898 * Checks if two WarningMessages contain equal inner contents.
39899 * This ignores pointers and is_owned flags and looks at the values in fields.
39900 * Two objects with NULL inner values will be considered "equal" here.
39902 bool WarningMessage_eq(const struct LDKWarningMessage *NONNULL_PTR a, const struct LDKWarningMessage *NONNULL_PTR b);
39905 * Frees any resources used by the Ping, if is_owned is set and inner is non-NULL.
39907 void Ping_free(struct LDKPing this_obj);
39910 * The desired response length.
39912 uint16_t Ping_get_ponglen(const struct LDKPing *NONNULL_PTR this_ptr);
39915 * The desired response length.
39917 void Ping_set_ponglen(struct LDKPing *NONNULL_PTR this_ptr, uint16_t val);
39920 * The ping packet size.
39922 * This field is not sent on the wire. byteslen zeros are sent.
39924 uint16_t Ping_get_byteslen(const struct LDKPing *NONNULL_PTR this_ptr);
39927 * The ping packet size.
39929 * This field is not sent on the wire. byteslen zeros are sent.
39931 void Ping_set_byteslen(struct LDKPing *NONNULL_PTR this_ptr, uint16_t val);
39934 * Constructs a new Ping given each field
39936 MUST_USE_RES struct LDKPing Ping_new(uint16_t ponglen_arg, uint16_t byteslen_arg);
39939 * Creates a copy of the Ping
39941 struct LDKPing Ping_clone(const struct LDKPing *NONNULL_PTR orig);
39944 * Generates a non-cryptographic 64-bit hash of the Ping.
39946 uint64_t Ping_hash(const struct LDKPing *NONNULL_PTR o);
39949 * Checks if two Pings contain equal inner contents.
39950 * This ignores pointers and is_owned flags and looks at the values in fields.
39951 * Two objects with NULL inner values will be considered "equal" here.
39953 bool Ping_eq(const struct LDKPing *NONNULL_PTR a, const struct LDKPing *NONNULL_PTR b);
39956 * Frees any resources used by the Pong, if is_owned is set and inner is non-NULL.
39958 void Pong_free(struct LDKPong this_obj);
39961 * The pong packet size.
39963 * This field is not sent on the wire. byteslen zeros are sent.
39965 uint16_t Pong_get_byteslen(const struct LDKPong *NONNULL_PTR this_ptr);
39968 * The pong packet size.
39970 * This field is not sent on the wire. byteslen zeros are sent.
39972 void Pong_set_byteslen(struct LDKPong *NONNULL_PTR this_ptr, uint16_t val);
39975 * Constructs a new Pong given each field
39977 MUST_USE_RES struct LDKPong Pong_new(uint16_t byteslen_arg);
39980 * Creates a copy of the Pong
39982 struct LDKPong Pong_clone(const struct LDKPong *NONNULL_PTR orig);
39985 * Generates a non-cryptographic 64-bit hash of the Pong.
39987 uint64_t Pong_hash(const struct LDKPong *NONNULL_PTR o);
39990 * Checks if two Pongs contain equal inner contents.
39991 * This ignores pointers and is_owned flags and looks at the values in fields.
39992 * Two objects with NULL inner values will be considered "equal" here.
39994 bool Pong_eq(const struct LDKPong *NONNULL_PTR a, const struct LDKPong *NONNULL_PTR b);
39997 * Frees any resources used by the CommonOpenChannelFields, if is_owned is set and inner is non-NULL.
39999 void CommonOpenChannelFields_free(struct LDKCommonOpenChannelFields this_obj);
40002 * The genesis hash of the blockchain where the channel is to be opened
40004 const uint8_t (*CommonOpenChannelFields_get_chain_hash(const struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr))[32];
40007 * The genesis hash of the blockchain where the channel is to be opened
40009 void CommonOpenChannelFields_set_chain_hash(struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
40012 * A temporary channel ID
40013 * For V2 channels: derived using a zeroed out value for the channel acceptor's revocation basepoint
40014 * For V1 channels: a temporary channel ID, until the funding outpoint is announced
40016 struct LDKChannelId CommonOpenChannelFields_get_temporary_channel_id(const struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr);
40019 * A temporary channel ID
40020 * For V2 channels: derived using a zeroed out value for the channel acceptor's revocation basepoint
40021 * For V1 channels: a temporary channel ID, until the funding outpoint is announced
40023 void CommonOpenChannelFields_set_temporary_channel_id(struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr, struct LDKChannelId val);
40026 * For V1 channels: The channel value
40027 * For V2 channels: Part of the channel value contributed by the channel initiator
40029 uint64_t CommonOpenChannelFields_get_funding_satoshis(const struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr);
40032 * For V1 channels: The channel value
40033 * For V2 channels: Part of the channel value contributed by the channel initiator
40035 void CommonOpenChannelFields_set_funding_satoshis(struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr, uint64_t val);
40038 * The threshold below which outputs on transactions broadcast by the channel initiator will be
40041 uint64_t CommonOpenChannelFields_get_dust_limit_satoshis(const struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr);
40044 * The threshold below which outputs on transactions broadcast by the channel initiator will be
40047 void CommonOpenChannelFields_set_dust_limit_satoshis(struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr, uint64_t val);
40050 * The maximum inbound HTLC value in flight towards channel initiator, in milli-satoshi
40052 uint64_t CommonOpenChannelFields_get_max_htlc_value_in_flight_msat(const struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr);
40055 * The maximum inbound HTLC value in flight towards channel initiator, in milli-satoshi
40057 void CommonOpenChannelFields_set_max_htlc_value_in_flight_msat(struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr, uint64_t val);
40060 * The minimum HTLC size incoming to channel initiator, in milli-satoshi
40062 uint64_t CommonOpenChannelFields_get_htlc_minimum_msat(const struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr);
40065 * The minimum HTLC size incoming to channel initiator, in milli-satoshi
40067 void CommonOpenChannelFields_set_htlc_minimum_msat(struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr, uint64_t val);
40070 * The feerate for the commitment transaction set by the channel initiator until updated by
40073 uint32_t CommonOpenChannelFields_get_commitment_feerate_sat_per_1000_weight(const struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr);
40076 * The feerate for the commitment transaction set by the channel initiator until updated by
40079 void CommonOpenChannelFields_set_commitment_feerate_sat_per_1000_weight(struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr, uint32_t val);
40082 * The number of blocks which the counterparty will have to wait to claim on-chain funds if they
40083 * broadcast a commitment transaction
40085 uint16_t CommonOpenChannelFields_get_to_self_delay(const struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr);
40088 * The number of blocks which the counterparty will have to wait to claim on-chain funds if they
40089 * broadcast a commitment transaction
40091 void CommonOpenChannelFields_set_to_self_delay(struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr, uint16_t val);
40094 * The maximum number of inbound HTLCs towards channel initiator
40096 uint16_t CommonOpenChannelFields_get_max_accepted_htlcs(const struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr);
40099 * The maximum number of inbound HTLCs towards channel initiator
40101 void CommonOpenChannelFields_set_max_accepted_htlcs(struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr, uint16_t val);
40104 * The channel initiator's key controlling the funding transaction
40106 struct LDKPublicKey CommonOpenChannelFields_get_funding_pubkey(const struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr);
40109 * The channel initiator's key controlling the funding transaction
40111 void CommonOpenChannelFields_set_funding_pubkey(struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr, struct LDKPublicKey val);
40114 * Used to derive a revocation key for transactions broadcast by counterparty
40116 struct LDKPublicKey CommonOpenChannelFields_get_revocation_basepoint(const struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr);
40119 * Used to derive a revocation key for transactions broadcast by counterparty
40121 void CommonOpenChannelFields_set_revocation_basepoint(struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr, struct LDKPublicKey val);
40124 * A payment key to channel initiator for transactions broadcast by counterparty
40126 struct LDKPublicKey CommonOpenChannelFields_get_payment_basepoint(const struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr);
40129 * A payment key to channel initiator for transactions broadcast by counterparty
40131 void CommonOpenChannelFields_set_payment_basepoint(struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr, struct LDKPublicKey val);
40134 * Used to derive a payment key to channel initiator for transactions broadcast by channel
40137 struct LDKPublicKey CommonOpenChannelFields_get_delayed_payment_basepoint(const struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr);
40140 * Used to derive a payment key to channel initiator for transactions broadcast by channel
40143 void CommonOpenChannelFields_set_delayed_payment_basepoint(struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr, struct LDKPublicKey val);
40146 * Used to derive an HTLC payment key to channel initiator
40148 struct LDKPublicKey CommonOpenChannelFields_get_htlc_basepoint(const struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr);
40151 * Used to derive an HTLC payment key to channel initiator
40153 void CommonOpenChannelFields_set_htlc_basepoint(struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr, struct LDKPublicKey val);
40156 * The first to-be-broadcast-by-channel-initiator transaction's per commitment point
40158 struct LDKPublicKey CommonOpenChannelFields_get_first_per_commitment_point(const struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr);
40161 * The first to-be-broadcast-by-channel-initiator transaction's per commitment point
40163 void CommonOpenChannelFields_set_first_per_commitment_point(struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr, struct LDKPublicKey val);
40166 * The channel flags to be used
40168 uint8_t CommonOpenChannelFields_get_channel_flags(const struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr);
40171 * The channel flags to be used
40173 void CommonOpenChannelFields_set_channel_flags(struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr, uint8_t val);
40176 * Optionally, a request to pre-set the to-channel-initiator output's scriptPubkey for when we
40177 * collaboratively close
40179 struct LDKCOption_CVec_u8ZZ CommonOpenChannelFields_get_shutdown_scriptpubkey(const struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr);
40182 * Optionally, a request to pre-set the to-channel-initiator output's scriptPubkey for when we
40183 * collaboratively close
40185 void CommonOpenChannelFields_set_shutdown_scriptpubkey(struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr, struct LDKCOption_CVec_u8ZZ val);
40188 * The channel type that this channel will represent
40190 * If this is `None`, we derive the channel type from the intersection of our
40191 * feature bits with our counterparty's feature bits from the [`Init`] message.
40193 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
40195 struct LDKChannelTypeFeatures CommonOpenChannelFields_get_channel_type(const struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr);
40198 * The channel type that this channel will represent
40200 * If this is `None`, we derive the channel type from the intersection of our
40201 * feature bits with our counterparty's feature bits from the [`Init`] message.
40203 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
40205 void CommonOpenChannelFields_set_channel_type(struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr, struct LDKChannelTypeFeatures val);
40208 * Constructs a new CommonOpenChannelFields given each field
40210 * Note that channel_type_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
40212 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);
40215 * Creates a copy of the CommonOpenChannelFields
40217 struct LDKCommonOpenChannelFields CommonOpenChannelFields_clone(const struct LDKCommonOpenChannelFields *NONNULL_PTR orig);
40220 * Generates a non-cryptographic 64-bit hash of the CommonOpenChannelFields.
40222 uint64_t CommonOpenChannelFields_hash(const struct LDKCommonOpenChannelFields *NONNULL_PTR o);
40225 * Checks if two CommonOpenChannelFieldss contain equal inner contents.
40226 * This ignores pointers and is_owned flags and looks at the values in fields.
40227 * Two objects with NULL inner values will be considered "equal" here.
40229 bool CommonOpenChannelFields_eq(const struct LDKCommonOpenChannelFields *NONNULL_PTR a, const struct LDKCommonOpenChannelFields *NONNULL_PTR b);
40232 * Frees any resources used by the OpenChannel, if is_owned is set and inner is non-NULL.
40234 void OpenChannel_free(struct LDKOpenChannel this_obj);
40237 * Common fields of `open_channel(2)`-like messages
40239 struct LDKCommonOpenChannelFields OpenChannel_get_common_fields(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
40242 * Common fields of `open_channel(2)`-like messages
40244 void OpenChannel_set_common_fields(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKCommonOpenChannelFields val);
40247 * The amount to push to the counterparty as part of the open, in milli-satoshi
40249 uint64_t OpenChannel_get_push_msat(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
40252 * The amount to push to the counterparty as part of the open, in milli-satoshi
40254 void OpenChannel_set_push_msat(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint64_t val);
40257 * The minimum value unencumbered by HTLCs for the counterparty to keep in the channel
40259 uint64_t OpenChannel_get_channel_reserve_satoshis(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
40262 * The minimum value unencumbered by HTLCs for the counterparty to keep in the channel
40264 void OpenChannel_set_channel_reserve_satoshis(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint64_t val);
40267 * Constructs a new OpenChannel given each field
40269 MUST_USE_RES struct LDKOpenChannel OpenChannel_new(struct LDKCommonOpenChannelFields common_fields_arg, uint64_t push_msat_arg, uint64_t channel_reserve_satoshis_arg);
40272 * Creates a copy of the OpenChannel
40274 struct LDKOpenChannel OpenChannel_clone(const struct LDKOpenChannel *NONNULL_PTR orig);
40277 * Generates a non-cryptographic 64-bit hash of the OpenChannel.
40279 uint64_t OpenChannel_hash(const struct LDKOpenChannel *NONNULL_PTR o);
40282 * Checks if two OpenChannels contain equal inner contents.
40283 * This ignores pointers and is_owned flags and looks at the values in fields.
40284 * Two objects with NULL inner values will be considered "equal" here.
40286 bool OpenChannel_eq(const struct LDKOpenChannel *NONNULL_PTR a, const struct LDKOpenChannel *NONNULL_PTR b);
40289 * Frees any resources used by the OpenChannelV2, if is_owned is set and inner is non-NULL.
40291 void OpenChannelV2_free(struct LDKOpenChannelV2 this_obj);
40294 * Common fields of `open_channel(2)`-like messages
40296 struct LDKCommonOpenChannelFields OpenChannelV2_get_common_fields(const struct LDKOpenChannelV2 *NONNULL_PTR this_ptr);
40299 * Common fields of `open_channel(2)`-like messages
40301 void OpenChannelV2_set_common_fields(struct LDKOpenChannelV2 *NONNULL_PTR this_ptr, struct LDKCommonOpenChannelFields val);
40304 * The feerate for the funding transaction set by the channel initiator
40306 uint32_t OpenChannelV2_get_funding_feerate_sat_per_1000_weight(const struct LDKOpenChannelV2 *NONNULL_PTR this_ptr);
40309 * The feerate for the funding transaction set by the channel initiator
40311 void OpenChannelV2_set_funding_feerate_sat_per_1000_weight(struct LDKOpenChannelV2 *NONNULL_PTR this_ptr, uint32_t val);
40314 * The locktime for the funding transaction
40316 uint32_t OpenChannelV2_get_locktime(const struct LDKOpenChannelV2 *NONNULL_PTR this_ptr);
40319 * The locktime for the funding transaction
40321 void OpenChannelV2_set_locktime(struct LDKOpenChannelV2 *NONNULL_PTR this_ptr, uint32_t val);
40324 * The second to-be-broadcast-by-channel-initiator transaction's per commitment point
40326 struct LDKPublicKey OpenChannelV2_get_second_per_commitment_point(const struct LDKOpenChannelV2 *NONNULL_PTR this_ptr);
40329 * The second to-be-broadcast-by-channel-initiator transaction's per commitment point
40331 void OpenChannelV2_set_second_per_commitment_point(struct LDKOpenChannelV2 *NONNULL_PTR this_ptr, struct LDKPublicKey val);
40334 * Optionally, a requirement that only confirmed inputs can be added
40336 enum LDKCOption_NoneZ OpenChannelV2_get_require_confirmed_inputs(const struct LDKOpenChannelV2 *NONNULL_PTR this_ptr);
40339 * Optionally, a requirement that only confirmed inputs can be added
40341 void OpenChannelV2_set_require_confirmed_inputs(struct LDKOpenChannelV2 *NONNULL_PTR this_ptr, enum LDKCOption_NoneZ val);
40344 * Constructs a new OpenChannelV2 given each field
40346 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);
40349 * Creates a copy of the OpenChannelV2
40351 struct LDKOpenChannelV2 OpenChannelV2_clone(const struct LDKOpenChannelV2 *NONNULL_PTR orig);
40354 * Generates a non-cryptographic 64-bit hash of the OpenChannelV2.
40356 uint64_t OpenChannelV2_hash(const struct LDKOpenChannelV2 *NONNULL_PTR o);
40359 * Checks if two OpenChannelV2s contain equal inner contents.
40360 * This ignores pointers and is_owned flags and looks at the values in fields.
40361 * Two objects with NULL inner values will be considered "equal" here.
40363 bool OpenChannelV2_eq(const struct LDKOpenChannelV2 *NONNULL_PTR a, const struct LDKOpenChannelV2 *NONNULL_PTR b);
40366 * Frees any resources used by the CommonAcceptChannelFields, if is_owned is set and inner is non-NULL.
40368 void CommonAcceptChannelFields_free(struct LDKCommonAcceptChannelFields this_obj);
40371 * The same `temporary_channel_id` received from the initiator's `open_channel2` or `open_channel` message.
40373 struct LDKChannelId CommonAcceptChannelFields_get_temporary_channel_id(const struct LDKCommonAcceptChannelFields *NONNULL_PTR this_ptr);
40376 * The same `temporary_channel_id` received from the initiator's `open_channel2` or `open_channel` message.
40378 void CommonAcceptChannelFields_set_temporary_channel_id(struct LDKCommonAcceptChannelFields *NONNULL_PTR this_ptr, struct LDKChannelId val);
40381 * The threshold below which outputs on transactions broadcast by the channel acceptor will be
40384 uint64_t CommonAcceptChannelFields_get_dust_limit_satoshis(const struct LDKCommonAcceptChannelFields *NONNULL_PTR this_ptr);
40387 * The threshold below which outputs on transactions broadcast by the channel acceptor will be
40390 void CommonAcceptChannelFields_set_dust_limit_satoshis(struct LDKCommonAcceptChannelFields *NONNULL_PTR this_ptr, uint64_t val);
40393 * The maximum inbound HTLC value in flight towards sender, in milli-satoshi
40395 uint64_t CommonAcceptChannelFields_get_max_htlc_value_in_flight_msat(const struct LDKCommonAcceptChannelFields *NONNULL_PTR this_ptr);
40398 * The maximum inbound HTLC value in flight towards sender, in milli-satoshi
40400 void CommonAcceptChannelFields_set_max_htlc_value_in_flight_msat(struct LDKCommonAcceptChannelFields *NONNULL_PTR this_ptr, uint64_t val);
40403 * The minimum HTLC size incoming to channel acceptor, in milli-satoshi
40405 uint64_t CommonAcceptChannelFields_get_htlc_minimum_msat(const struct LDKCommonAcceptChannelFields *NONNULL_PTR this_ptr);
40408 * The minimum HTLC size incoming to channel acceptor, in milli-satoshi
40410 void CommonAcceptChannelFields_set_htlc_minimum_msat(struct LDKCommonAcceptChannelFields *NONNULL_PTR this_ptr, uint64_t val);
40413 * Minimum depth of the funding transaction before the channel is considered open
40415 uint32_t CommonAcceptChannelFields_get_minimum_depth(const struct LDKCommonAcceptChannelFields *NONNULL_PTR this_ptr);
40418 * Minimum depth of the funding transaction before the channel is considered open
40420 void CommonAcceptChannelFields_set_minimum_depth(struct LDKCommonAcceptChannelFields *NONNULL_PTR this_ptr, uint32_t val);
40423 * The number of blocks which the counterparty will have to wait to claim on-chain funds if they
40424 * broadcast a commitment transaction
40426 uint16_t CommonAcceptChannelFields_get_to_self_delay(const struct LDKCommonAcceptChannelFields *NONNULL_PTR this_ptr);
40429 * The number of blocks which the counterparty will have to wait to claim on-chain funds if they
40430 * broadcast a commitment transaction
40432 void CommonAcceptChannelFields_set_to_self_delay(struct LDKCommonAcceptChannelFields *NONNULL_PTR this_ptr, uint16_t val);
40435 * The maximum number of inbound HTLCs towards channel acceptor
40437 uint16_t CommonAcceptChannelFields_get_max_accepted_htlcs(const struct LDKCommonAcceptChannelFields *NONNULL_PTR this_ptr);
40440 * The maximum number of inbound HTLCs towards channel acceptor
40442 void CommonAcceptChannelFields_set_max_accepted_htlcs(struct LDKCommonAcceptChannelFields *NONNULL_PTR this_ptr, uint16_t val);
40445 * The channel acceptor's key controlling the funding transaction
40447 struct LDKPublicKey CommonAcceptChannelFields_get_funding_pubkey(const struct LDKCommonAcceptChannelFields *NONNULL_PTR this_ptr);
40450 * The channel acceptor's key controlling the funding transaction
40452 void CommonAcceptChannelFields_set_funding_pubkey(struct LDKCommonAcceptChannelFields *NONNULL_PTR this_ptr, struct LDKPublicKey val);
40455 * Used to derive a revocation key for transactions broadcast by counterparty
40457 struct LDKPublicKey CommonAcceptChannelFields_get_revocation_basepoint(const struct LDKCommonAcceptChannelFields *NONNULL_PTR this_ptr);
40460 * Used to derive a revocation key for transactions broadcast by counterparty
40462 void CommonAcceptChannelFields_set_revocation_basepoint(struct LDKCommonAcceptChannelFields *NONNULL_PTR this_ptr, struct LDKPublicKey val);
40465 * A payment key to channel acceptor for transactions broadcast by counterparty
40467 struct LDKPublicKey CommonAcceptChannelFields_get_payment_basepoint(const struct LDKCommonAcceptChannelFields *NONNULL_PTR this_ptr);
40470 * A payment key to channel acceptor for transactions broadcast by counterparty
40472 void CommonAcceptChannelFields_set_payment_basepoint(struct LDKCommonAcceptChannelFields *NONNULL_PTR this_ptr, struct LDKPublicKey val);
40475 * Used to derive a payment key to channel acceptor for transactions broadcast by channel
40478 struct LDKPublicKey CommonAcceptChannelFields_get_delayed_payment_basepoint(const struct LDKCommonAcceptChannelFields *NONNULL_PTR this_ptr);
40481 * Used to derive a payment key to channel acceptor for transactions broadcast by channel
40484 void CommonAcceptChannelFields_set_delayed_payment_basepoint(struct LDKCommonAcceptChannelFields *NONNULL_PTR this_ptr, struct LDKPublicKey val);
40487 * Used to derive an HTLC payment key to channel acceptor for transactions broadcast by counterparty
40489 struct LDKPublicKey CommonAcceptChannelFields_get_htlc_basepoint(const struct LDKCommonAcceptChannelFields *NONNULL_PTR this_ptr);
40492 * Used to derive an HTLC payment key to channel acceptor for transactions broadcast by counterparty
40494 void CommonAcceptChannelFields_set_htlc_basepoint(struct LDKCommonAcceptChannelFields *NONNULL_PTR this_ptr, struct LDKPublicKey val);
40497 * The first to-be-broadcast-by-channel-acceptor transaction's per commitment point
40499 struct LDKPublicKey CommonAcceptChannelFields_get_first_per_commitment_point(const struct LDKCommonAcceptChannelFields *NONNULL_PTR this_ptr);
40502 * The first to-be-broadcast-by-channel-acceptor transaction's per commitment point
40504 void CommonAcceptChannelFields_set_first_per_commitment_point(struct LDKCommonAcceptChannelFields *NONNULL_PTR this_ptr, struct LDKPublicKey val);
40507 * Optionally, a request to pre-set the to-channel-acceptor output's scriptPubkey for when we
40508 * collaboratively close
40510 struct LDKCOption_CVec_u8ZZ CommonAcceptChannelFields_get_shutdown_scriptpubkey(const struct LDKCommonAcceptChannelFields *NONNULL_PTR this_ptr);
40513 * Optionally, a request to pre-set the to-channel-acceptor output's scriptPubkey for when we
40514 * collaboratively close
40516 void CommonAcceptChannelFields_set_shutdown_scriptpubkey(struct LDKCommonAcceptChannelFields *NONNULL_PTR this_ptr, struct LDKCOption_CVec_u8ZZ val);
40519 * The channel type that this channel will represent. If none is set, we derive the channel
40520 * type from the intersection of our feature bits with our counterparty's feature bits from
40521 * the Init message.
40523 * This is required to match the equivalent field in [`OpenChannel`] or [`OpenChannelV2`]'s
40524 * [`CommonOpenChannelFields::channel_type`].
40526 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
40528 struct LDKChannelTypeFeatures CommonAcceptChannelFields_get_channel_type(const struct LDKCommonAcceptChannelFields *NONNULL_PTR this_ptr);
40531 * The channel type that this channel will represent. If none is set, we derive the channel
40532 * type from the intersection of our feature bits with our counterparty's feature bits from
40533 * the Init message.
40535 * This is required to match the equivalent field in [`OpenChannel`] or [`OpenChannelV2`]'s
40536 * [`CommonOpenChannelFields::channel_type`].
40538 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
40540 void CommonAcceptChannelFields_set_channel_type(struct LDKCommonAcceptChannelFields *NONNULL_PTR this_ptr, struct LDKChannelTypeFeatures val);
40543 * Constructs a new CommonAcceptChannelFields given each field
40545 * Note that channel_type_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
40547 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);
40550 * Creates a copy of the CommonAcceptChannelFields
40552 struct LDKCommonAcceptChannelFields CommonAcceptChannelFields_clone(const struct LDKCommonAcceptChannelFields *NONNULL_PTR orig);
40555 * Generates a non-cryptographic 64-bit hash of the CommonAcceptChannelFields.
40557 uint64_t CommonAcceptChannelFields_hash(const struct LDKCommonAcceptChannelFields *NONNULL_PTR o);
40560 * Checks if two CommonAcceptChannelFieldss contain equal inner contents.
40561 * This ignores pointers and is_owned flags and looks at the values in fields.
40562 * Two objects with NULL inner values will be considered "equal" here.
40564 bool CommonAcceptChannelFields_eq(const struct LDKCommonAcceptChannelFields *NONNULL_PTR a, const struct LDKCommonAcceptChannelFields *NONNULL_PTR b);
40567 * Frees any resources used by the AcceptChannel, if is_owned is set and inner is non-NULL.
40569 void AcceptChannel_free(struct LDKAcceptChannel this_obj);
40572 * Common fields of `accept_channel(2)`-like messages
40574 struct LDKCommonAcceptChannelFields AcceptChannel_get_common_fields(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
40577 * Common fields of `accept_channel(2)`-like messages
40579 void AcceptChannel_set_common_fields(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKCommonAcceptChannelFields val);
40582 * The minimum value unencumbered by HTLCs for the counterparty to keep in the channel
40584 uint64_t AcceptChannel_get_channel_reserve_satoshis(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
40587 * The minimum value unencumbered by HTLCs for the counterparty to keep in the channel
40589 void AcceptChannel_set_channel_reserve_satoshis(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint64_t val);
40592 * Constructs a new AcceptChannel given each field
40594 MUST_USE_RES struct LDKAcceptChannel AcceptChannel_new(struct LDKCommonAcceptChannelFields common_fields_arg, uint64_t channel_reserve_satoshis_arg);
40597 * Creates a copy of the AcceptChannel
40599 struct LDKAcceptChannel AcceptChannel_clone(const struct LDKAcceptChannel *NONNULL_PTR orig);
40602 * Generates a non-cryptographic 64-bit hash of the AcceptChannel.
40604 uint64_t AcceptChannel_hash(const struct LDKAcceptChannel *NONNULL_PTR o);
40607 * Checks if two AcceptChannels contain equal inner contents.
40608 * This ignores pointers and is_owned flags and looks at the values in fields.
40609 * Two objects with NULL inner values will be considered "equal" here.
40611 bool AcceptChannel_eq(const struct LDKAcceptChannel *NONNULL_PTR a, const struct LDKAcceptChannel *NONNULL_PTR b);
40614 * Frees any resources used by the AcceptChannelV2, if is_owned is set and inner is non-NULL.
40616 void AcceptChannelV2_free(struct LDKAcceptChannelV2 this_obj);
40619 * Common fields of `accept_channel(2)`-like messages
40621 struct LDKCommonAcceptChannelFields AcceptChannelV2_get_common_fields(const struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr);
40624 * Common fields of `accept_channel(2)`-like messages
40626 void AcceptChannelV2_set_common_fields(struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr, struct LDKCommonAcceptChannelFields val);
40629 * Part of the channel value contributed by the channel acceptor
40631 uint64_t AcceptChannelV2_get_funding_satoshis(const struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr);
40634 * Part of the channel value contributed by the channel acceptor
40636 void AcceptChannelV2_set_funding_satoshis(struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr, uint64_t val);
40639 * The second to-be-broadcast-by-channel-acceptor transaction's per commitment point
40641 struct LDKPublicKey AcceptChannelV2_get_second_per_commitment_point(const struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr);
40644 * The second to-be-broadcast-by-channel-acceptor transaction's per commitment point
40646 void AcceptChannelV2_set_second_per_commitment_point(struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr, struct LDKPublicKey val);
40649 * Optionally, a requirement that only confirmed inputs can be added
40651 enum LDKCOption_NoneZ AcceptChannelV2_get_require_confirmed_inputs(const struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr);
40654 * Optionally, a requirement that only confirmed inputs can be added
40656 void AcceptChannelV2_set_require_confirmed_inputs(struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr, enum LDKCOption_NoneZ val);
40659 * Constructs a new AcceptChannelV2 given each field
40661 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);
40664 * Creates a copy of the AcceptChannelV2
40666 struct LDKAcceptChannelV2 AcceptChannelV2_clone(const struct LDKAcceptChannelV2 *NONNULL_PTR orig);
40669 * Generates a non-cryptographic 64-bit hash of the AcceptChannelV2.
40671 uint64_t AcceptChannelV2_hash(const struct LDKAcceptChannelV2 *NONNULL_PTR o);
40674 * Checks if two AcceptChannelV2s contain equal inner contents.
40675 * This ignores pointers and is_owned flags and looks at the values in fields.
40676 * Two objects with NULL inner values will be considered "equal" here.
40678 bool AcceptChannelV2_eq(const struct LDKAcceptChannelV2 *NONNULL_PTR a, const struct LDKAcceptChannelV2 *NONNULL_PTR b);
40681 * Frees any resources used by the FundingCreated, if is_owned is set and inner is non-NULL.
40683 void FundingCreated_free(struct LDKFundingCreated this_obj);
40686 * A temporary channel ID, until the funding is established
40688 struct LDKChannelId FundingCreated_get_temporary_channel_id(const struct LDKFundingCreated *NONNULL_PTR this_ptr);
40691 * A temporary channel ID, until the funding is established
40693 void FundingCreated_set_temporary_channel_id(struct LDKFundingCreated *NONNULL_PTR this_ptr, struct LDKChannelId val);
40696 * The funding transaction ID
40698 const uint8_t (*FundingCreated_get_funding_txid(const struct LDKFundingCreated *NONNULL_PTR this_ptr))[32];
40701 * The funding transaction ID
40703 void FundingCreated_set_funding_txid(struct LDKFundingCreated *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
40706 * The specific output index funding this channel
40708 uint16_t FundingCreated_get_funding_output_index(const struct LDKFundingCreated *NONNULL_PTR this_ptr);
40711 * The specific output index funding this channel
40713 void FundingCreated_set_funding_output_index(struct LDKFundingCreated *NONNULL_PTR this_ptr, uint16_t val);
40716 * The signature of the channel initiator (funder) on the initial commitment transaction
40718 struct LDKECDSASignature FundingCreated_get_signature(const struct LDKFundingCreated *NONNULL_PTR this_ptr);
40721 * The signature of the channel initiator (funder) on the initial commitment transaction
40723 void FundingCreated_set_signature(struct LDKFundingCreated *NONNULL_PTR this_ptr, struct LDKECDSASignature val);
40726 * Constructs a new FundingCreated given each field
40728 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);
40731 * Creates a copy of the FundingCreated
40733 struct LDKFundingCreated FundingCreated_clone(const struct LDKFundingCreated *NONNULL_PTR orig);
40736 * Generates a non-cryptographic 64-bit hash of the FundingCreated.
40738 uint64_t FundingCreated_hash(const struct LDKFundingCreated *NONNULL_PTR o);
40741 * Checks if two FundingCreateds contain equal inner contents.
40742 * This ignores pointers and is_owned flags and looks at the values in fields.
40743 * Two objects with NULL inner values will be considered "equal" here.
40745 bool FundingCreated_eq(const struct LDKFundingCreated *NONNULL_PTR a, const struct LDKFundingCreated *NONNULL_PTR b);
40748 * Frees any resources used by the FundingSigned, if is_owned is set and inner is non-NULL.
40750 void FundingSigned_free(struct LDKFundingSigned this_obj);
40755 struct LDKChannelId FundingSigned_get_channel_id(const struct LDKFundingSigned *NONNULL_PTR this_ptr);
40760 void FundingSigned_set_channel_id(struct LDKFundingSigned *NONNULL_PTR this_ptr, struct LDKChannelId val);
40763 * The signature of the channel acceptor (fundee) on the initial commitment transaction
40765 struct LDKECDSASignature FundingSigned_get_signature(const struct LDKFundingSigned *NONNULL_PTR this_ptr);
40768 * The signature of the channel acceptor (fundee) on the initial commitment transaction
40770 void FundingSigned_set_signature(struct LDKFundingSigned *NONNULL_PTR this_ptr, struct LDKECDSASignature val);
40773 * Constructs a new FundingSigned given each field
40775 MUST_USE_RES struct LDKFundingSigned FundingSigned_new(struct LDKChannelId channel_id_arg, struct LDKECDSASignature signature_arg);
40778 * Creates a copy of the FundingSigned
40780 struct LDKFundingSigned FundingSigned_clone(const struct LDKFundingSigned *NONNULL_PTR orig);
40783 * Generates a non-cryptographic 64-bit hash of the FundingSigned.
40785 uint64_t FundingSigned_hash(const struct LDKFundingSigned *NONNULL_PTR o);
40788 * Checks if two FundingSigneds contain equal inner contents.
40789 * This ignores pointers and is_owned flags and looks at the values in fields.
40790 * Two objects with NULL inner values will be considered "equal" here.
40792 bool FundingSigned_eq(const struct LDKFundingSigned *NONNULL_PTR a, const struct LDKFundingSigned *NONNULL_PTR b);
40795 * Frees any resources used by the ChannelReady, if is_owned is set and inner is non-NULL.
40797 void ChannelReady_free(struct LDKChannelReady this_obj);
40802 struct LDKChannelId ChannelReady_get_channel_id(const struct LDKChannelReady *NONNULL_PTR this_ptr);
40807 void ChannelReady_set_channel_id(struct LDKChannelReady *NONNULL_PTR this_ptr, struct LDKChannelId val);
40810 * The per-commitment point of the second commitment transaction
40812 struct LDKPublicKey ChannelReady_get_next_per_commitment_point(const struct LDKChannelReady *NONNULL_PTR this_ptr);
40815 * The per-commitment point of the second commitment transaction
40817 void ChannelReady_set_next_per_commitment_point(struct LDKChannelReady *NONNULL_PTR this_ptr, struct LDKPublicKey val);
40820 * If set, provides a `short_channel_id` alias for this channel.
40822 * The sender will accept payments to be forwarded over this SCID and forward them to this
40823 * messages' recipient.
40825 struct LDKCOption_u64Z ChannelReady_get_short_channel_id_alias(const struct LDKChannelReady *NONNULL_PTR this_ptr);
40828 * If set, provides a `short_channel_id` alias for this channel.
40830 * The sender will accept payments to be forwarded over this SCID and forward them to this
40831 * messages' recipient.
40833 void ChannelReady_set_short_channel_id_alias(struct LDKChannelReady *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
40836 * Constructs a new ChannelReady given each field
40838 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);
40841 * Creates a copy of the ChannelReady
40843 struct LDKChannelReady ChannelReady_clone(const struct LDKChannelReady *NONNULL_PTR orig);
40846 * Generates a non-cryptographic 64-bit hash of the ChannelReady.
40848 uint64_t ChannelReady_hash(const struct LDKChannelReady *NONNULL_PTR o);
40851 * Checks if two ChannelReadys contain equal inner contents.
40852 * This ignores pointers and is_owned flags and looks at the values in fields.
40853 * Two objects with NULL inner values will be considered "equal" here.
40855 bool ChannelReady_eq(const struct LDKChannelReady *NONNULL_PTR a, const struct LDKChannelReady *NONNULL_PTR b);
40858 * Frees any resources used by the Stfu, if is_owned is set and inner is non-NULL.
40860 void Stfu_free(struct LDKStfu this_obj);
40863 * The channel ID where quiescence is intended
40865 struct LDKChannelId Stfu_get_channel_id(const struct LDKStfu *NONNULL_PTR this_ptr);
40868 * The channel ID where quiescence is intended
40870 void Stfu_set_channel_id(struct LDKStfu *NONNULL_PTR this_ptr, struct LDKChannelId val);
40873 * Initiator flag, 1 if initiating, 0 if replying to an stfu.
40875 uint8_t Stfu_get_initiator(const struct LDKStfu *NONNULL_PTR this_ptr);
40878 * Initiator flag, 1 if initiating, 0 if replying to an stfu.
40880 void Stfu_set_initiator(struct LDKStfu *NONNULL_PTR this_ptr, uint8_t val);
40883 * Constructs a new Stfu given each field
40885 MUST_USE_RES struct LDKStfu Stfu_new(struct LDKChannelId channel_id_arg, uint8_t initiator_arg);
40888 * Creates a copy of the Stfu
40890 struct LDKStfu Stfu_clone(const struct LDKStfu *NONNULL_PTR orig);
40893 * Checks if two Stfus contain equal inner contents.
40894 * This ignores pointers and is_owned flags and looks at the values in fields.
40895 * Two objects with NULL inner values will be considered "equal" here.
40897 bool Stfu_eq(const struct LDKStfu *NONNULL_PTR a, const struct LDKStfu *NONNULL_PTR b);
40900 * Frees any resources used by the Splice, if is_owned is set and inner is non-NULL.
40902 void Splice_free(struct LDKSplice this_obj);
40905 * The channel ID where splicing is intended
40907 struct LDKChannelId Splice_get_channel_id(const struct LDKSplice *NONNULL_PTR this_ptr);
40910 * The channel ID where splicing is intended
40912 void Splice_set_channel_id(struct LDKSplice *NONNULL_PTR this_ptr, struct LDKChannelId val);
40915 * The genesis hash of the blockchain where the channel is intended to be spliced
40917 const uint8_t (*Splice_get_chain_hash(const struct LDKSplice *NONNULL_PTR this_ptr))[32];
40920 * The genesis hash of the blockchain where the channel is intended to be spliced
40922 void Splice_set_chain_hash(struct LDKSplice *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
40925 * The intended change in channel capacity: the amount to be added (positive value)
40926 * or removed (negative value) by the sender (splice initiator) by splicing into/from the channel.
40928 int64_t Splice_get_relative_satoshis(const struct LDKSplice *NONNULL_PTR this_ptr);
40931 * The intended change in channel capacity: the amount to be added (positive value)
40932 * or removed (negative value) by the sender (splice initiator) by splicing into/from the channel.
40934 void Splice_set_relative_satoshis(struct LDKSplice *NONNULL_PTR this_ptr, int64_t val);
40937 * The feerate for the new funding transaction, set by the splice initiator
40939 uint32_t Splice_get_funding_feerate_perkw(const struct LDKSplice *NONNULL_PTR this_ptr);
40942 * The feerate for the new funding transaction, set by the splice initiator
40944 void Splice_set_funding_feerate_perkw(struct LDKSplice *NONNULL_PTR this_ptr, uint32_t val);
40947 * The locktime for the new funding transaction
40949 uint32_t Splice_get_locktime(const struct LDKSplice *NONNULL_PTR this_ptr);
40952 * The locktime for the new funding transaction
40954 void Splice_set_locktime(struct LDKSplice *NONNULL_PTR this_ptr, uint32_t val);
40957 * The key of the sender (splice initiator) controlling the new funding transaction
40959 struct LDKPublicKey Splice_get_funding_pubkey(const struct LDKSplice *NONNULL_PTR this_ptr);
40962 * The key of the sender (splice initiator) controlling the new funding transaction
40964 void Splice_set_funding_pubkey(struct LDKSplice *NONNULL_PTR this_ptr, struct LDKPublicKey val);
40967 * Constructs a new Splice given each field
40969 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);
40972 * Creates a copy of the Splice
40974 struct LDKSplice Splice_clone(const struct LDKSplice *NONNULL_PTR orig);
40977 * Checks if two Splices contain equal inner contents.
40978 * This ignores pointers and is_owned flags and looks at the values in fields.
40979 * Two objects with NULL inner values will be considered "equal" here.
40981 bool Splice_eq(const struct LDKSplice *NONNULL_PTR a, const struct LDKSplice *NONNULL_PTR b);
40984 * Frees any resources used by the SpliceAck, if is_owned is set and inner is non-NULL.
40986 void SpliceAck_free(struct LDKSpliceAck this_obj);
40989 * The channel ID where splicing is intended
40991 struct LDKChannelId SpliceAck_get_channel_id(const struct LDKSpliceAck *NONNULL_PTR this_ptr);
40994 * The channel ID where splicing is intended
40996 void SpliceAck_set_channel_id(struct LDKSpliceAck *NONNULL_PTR this_ptr, struct LDKChannelId val);
40999 * The genesis hash of the blockchain where the channel is intended to be spliced
41001 const uint8_t (*SpliceAck_get_chain_hash(const struct LDKSpliceAck *NONNULL_PTR this_ptr))[32];
41004 * The genesis hash of the blockchain where the channel is intended to be spliced
41006 void SpliceAck_set_chain_hash(struct LDKSpliceAck *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
41009 * The intended change in channel capacity: the amount to be added (positive value)
41010 * or removed (negative value) by the sender (splice acceptor) by splicing into/from the channel.
41012 int64_t SpliceAck_get_relative_satoshis(const struct LDKSpliceAck *NONNULL_PTR this_ptr);
41015 * The intended change in channel capacity: the amount to be added (positive value)
41016 * or removed (negative value) by the sender (splice acceptor) by splicing into/from the channel.
41018 void SpliceAck_set_relative_satoshis(struct LDKSpliceAck *NONNULL_PTR this_ptr, int64_t val);
41021 * The key of the sender (splice acceptor) controlling the new funding transaction
41023 struct LDKPublicKey SpliceAck_get_funding_pubkey(const struct LDKSpliceAck *NONNULL_PTR this_ptr);
41026 * The key of the sender (splice acceptor) controlling the new funding transaction
41028 void SpliceAck_set_funding_pubkey(struct LDKSpliceAck *NONNULL_PTR this_ptr, struct LDKPublicKey val);
41031 * Constructs a new SpliceAck given each field
41033 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);
41036 * Creates a copy of the SpliceAck
41038 struct LDKSpliceAck SpliceAck_clone(const struct LDKSpliceAck *NONNULL_PTR orig);
41041 * Checks if two SpliceAcks contain equal inner contents.
41042 * This ignores pointers and is_owned flags and looks at the values in fields.
41043 * Two objects with NULL inner values will be considered "equal" here.
41045 bool SpliceAck_eq(const struct LDKSpliceAck *NONNULL_PTR a, const struct LDKSpliceAck *NONNULL_PTR b);
41048 * Frees any resources used by the SpliceLocked, if is_owned is set and inner is non-NULL.
41050 void SpliceLocked_free(struct LDKSpliceLocked this_obj);
41055 struct LDKChannelId SpliceLocked_get_channel_id(const struct LDKSpliceLocked *NONNULL_PTR this_ptr);
41060 void SpliceLocked_set_channel_id(struct LDKSpliceLocked *NONNULL_PTR this_ptr, struct LDKChannelId val);
41063 * Constructs a new SpliceLocked given each field
41065 MUST_USE_RES struct LDKSpliceLocked SpliceLocked_new(struct LDKChannelId channel_id_arg);
41068 * Creates a copy of the SpliceLocked
41070 struct LDKSpliceLocked SpliceLocked_clone(const struct LDKSpliceLocked *NONNULL_PTR orig);
41073 * Checks if two SpliceLockeds contain equal inner contents.
41074 * This ignores pointers and is_owned flags and looks at the values in fields.
41075 * Two objects with NULL inner values will be considered "equal" here.
41077 bool SpliceLocked_eq(const struct LDKSpliceLocked *NONNULL_PTR a, const struct LDKSpliceLocked *NONNULL_PTR b);
41080 * Frees any resources used by the TxAddInput, if is_owned is set and inner is non-NULL.
41082 void TxAddInput_free(struct LDKTxAddInput this_obj);
41087 struct LDKChannelId TxAddInput_get_channel_id(const struct LDKTxAddInput *NONNULL_PTR this_ptr);
41092 void TxAddInput_set_channel_id(struct LDKTxAddInput *NONNULL_PTR this_ptr, struct LDKChannelId val);
41095 * A randomly chosen unique identifier for this input, which is even for initiators and odd for
41098 uint64_t TxAddInput_get_serial_id(const struct LDKTxAddInput *NONNULL_PTR this_ptr);
41101 * A randomly chosen unique identifier for this input, which is even for initiators and odd for
41104 void TxAddInput_set_serial_id(struct LDKTxAddInput *NONNULL_PTR this_ptr, uint64_t val);
41107 * Serialized transaction that contains the output this input spends to verify that it is non
41110 struct LDKTransactionU16LenLimited TxAddInput_get_prevtx(const struct LDKTxAddInput *NONNULL_PTR this_ptr);
41113 * Serialized transaction that contains the output this input spends to verify that it is non
41116 void TxAddInput_set_prevtx(struct LDKTxAddInput *NONNULL_PTR this_ptr, struct LDKTransactionU16LenLimited val);
41119 * The index of the output being spent
41121 uint32_t TxAddInput_get_prevtx_out(const struct LDKTxAddInput *NONNULL_PTR this_ptr);
41124 * The index of the output being spent
41126 void TxAddInput_set_prevtx_out(struct LDKTxAddInput *NONNULL_PTR this_ptr, uint32_t val);
41129 * The sequence number of this input
41131 uint32_t TxAddInput_get_sequence(const struct LDKTxAddInput *NONNULL_PTR this_ptr);
41134 * The sequence number of this input
41136 void TxAddInput_set_sequence(struct LDKTxAddInput *NONNULL_PTR this_ptr, uint32_t val);
41139 * Constructs a new TxAddInput given each field
41141 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);
41144 * Creates a copy of the TxAddInput
41146 struct LDKTxAddInput TxAddInput_clone(const struct LDKTxAddInput *NONNULL_PTR orig);
41149 * Generates a non-cryptographic 64-bit hash of the TxAddInput.
41151 uint64_t TxAddInput_hash(const struct LDKTxAddInput *NONNULL_PTR o);
41154 * Checks if two TxAddInputs contain equal inner contents.
41155 * This ignores pointers and is_owned flags and looks at the values in fields.
41156 * Two objects with NULL inner values will be considered "equal" here.
41158 bool TxAddInput_eq(const struct LDKTxAddInput *NONNULL_PTR a, const struct LDKTxAddInput *NONNULL_PTR b);
41161 * Frees any resources used by the TxAddOutput, if is_owned is set and inner is non-NULL.
41163 void TxAddOutput_free(struct LDKTxAddOutput this_obj);
41168 struct LDKChannelId TxAddOutput_get_channel_id(const struct LDKTxAddOutput *NONNULL_PTR this_ptr);
41173 void TxAddOutput_set_channel_id(struct LDKTxAddOutput *NONNULL_PTR this_ptr, struct LDKChannelId val);
41176 * A randomly chosen unique identifier for this output, which is even for initiators and odd for
41179 uint64_t TxAddOutput_get_serial_id(const struct LDKTxAddOutput *NONNULL_PTR this_ptr);
41182 * A randomly chosen unique identifier for this output, which is even for initiators and odd for
41185 void TxAddOutput_set_serial_id(struct LDKTxAddOutput *NONNULL_PTR this_ptr, uint64_t val);
41188 * The satoshi value of the output
41190 uint64_t TxAddOutput_get_sats(const struct LDKTxAddOutput *NONNULL_PTR this_ptr);
41193 * The satoshi value of the output
41195 void TxAddOutput_set_sats(struct LDKTxAddOutput *NONNULL_PTR this_ptr, uint64_t val);
41198 * The scriptPubKey for the output
41200 struct LDKCVec_u8Z TxAddOutput_get_script(const struct LDKTxAddOutput *NONNULL_PTR this_ptr);
41203 * The scriptPubKey for the output
41205 void TxAddOutput_set_script(struct LDKTxAddOutput *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val);
41208 * Constructs a new TxAddOutput given each field
41210 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);
41213 * Creates a copy of the TxAddOutput
41215 struct LDKTxAddOutput TxAddOutput_clone(const struct LDKTxAddOutput *NONNULL_PTR orig);
41218 * Generates a non-cryptographic 64-bit hash of the TxAddOutput.
41220 uint64_t TxAddOutput_hash(const struct LDKTxAddOutput *NONNULL_PTR o);
41223 * Checks if two TxAddOutputs contain equal inner contents.
41224 * This ignores pointers and is_owned flags and looks at the values in fields.
41225 * Two objects with NULL inner values will be considered "equal" here.
41227 bool TxAddOutput_eq(const struct LDKTxAddOutput *NONNULL_PTR a, const struct LDKTxAddOutput *NONNULL_PTR b);
41230 * Frees any resources used by the TxRemoveInput, if is_owned is set and inner is non-NULL.
41232 void TxRemoveInput_free(struct LDKTxRemoveInput this_obj);
41237 struct LDKChannelId TxRemoveInput_get_channel_id(const struct LDKTxRemoveInput *NONNULL_PTR this_ptr);
41242 void TxRemoveInput_set_channel_id(struct LDKTxRemoveInput *NONNULL_PTR this_ptr, struct LDKChannelId val);
41245 * The serial ID of the input to be removed
41247 uint64_t TxRemoveInput_get_serial_id(const struct LDKTxRemoveInput *NONNULL_PTR this_ptr);
41250 * The serial ID of the input to be removed
41252 void TxRemoveInput_set_serial_id(struct LDKTxRemoveInput *NONNULL_PTR this_ptr, uint64_t val);
41255 * Constructs a new TxRemoveInput given each field
41257 MUST_USE_RES struct LDKTxRemoveInput TxRemoveInput_new(struct LDKChannelId channel_id_arg, uint64_t serial_id_arg);
41260 * Creates a copy of the TxRemoveInput
41262 struct LDKTxRemoveInput TxRemoveInput_clone(const struct LDKTxRemoveInput *NONNULL_PTR orig);
41265 * Generates a non-cryptographic 64-bit hash of the TxRemoveInput.
41267 uint64_t TxRemoveInput_hash(const struct LDKTxRemoveInput *NONNULL_PTR o);
41270 * Checks if two TxRemoveInputs contain equal inner contents.
41271 * This ignores pointers and is_owned flags and looks at the values in fields.
41272 * Two objects with NULL inner values will be considered "equal" here.
41274 bool TxRemoveInput_eq(const struct LDKTxRemoveInput *NONNULL_PTR a, const struct LDKTxRemoveInput *NONNULL_PTR b);
41277 * Frees any resources used by the TxRemoveOutput, if is_owned is set and inner is non-NULL.
41279 void TxRemoveOutput_free(struct LDKTxRemoveOutput this_obj);
41284 struct LDKChannelId TxRemoveOutput_get_channel_id(const struct LDKTxRemoveOutput *NONNULL_PTR this_ptr);
41289 void TxRemoveOutput_set_channel_id(struct LDKTxRemoveOutput *NONNULL_PTR this_ptr, struct LDKChannelId val);
41292 * The serial ID of the output to be removed
41294 uint64_t TxRemoveOutput_get_serial_id(const struct LDKTxRemoveOutput *NONNULL_PTR this_ptr);
41297 * The serial ID of the output to be removed
41299 void TxRemoveOutput_set_serial_id(struct LDKTxRemoveOutput *NONNULL_PTR this_ptr, uint64_t val);
41302 * Constructs a new TxRemoveOutput given each field
41304 MUST_USE_RES struct LDKTxRemoveOutput TxRemoveOutput_new(struct LDKChannelId channel_id_arg, uint64_t serial_id_arg);
41307 * Creates a copy of the TxRemoveOutput
41309 struct LDKTxRemoveOutput TxRemoveOutput_clone(const struct LDKTxRemoveOutput *NONNULL_PTR orig);
41312 * Generates a non-cryptographic 64-bit hash of the TxRemoveOutput.
41314 uint64_t TxRemoveOutput_hash(const struct LDKTxRemoveOutput *NONNULL_PTR o);
41317 * Checks if two TxRemoveOutputs contain equal inner contents.
41318 * This ignores pointers and is_owned flags and looks at the values in fields.
41319 * Two objects with NULL inner values will be considered "equal" here.
41321 bool TxRemoveOutput_eq(const struct LDKTxRemoveOutput *NONNULL_PTR a, const struct LDKTxRemoveOutput *NONNULL_PTR b);
41324 * Frees any resources used by the TxComplete, if is_owned is set and inner is non-NULL.
41326 void TxComplete_free(struct LDKTxComplete this_obj);
41331 struct LDKChannelId TxComplete_get_channel_id(const struct LDKTxComplete *NONNULL_PTR this_ptr);
41336 void TxComplete_set_channel_id(struct LDKTxComplete *NONNULL_PTR this_ptr, struct LDKChannelId val);
41339 * Constructs a new TxComplete given each field
41341 MUST_USE_RES struct LDKTxComplete TxComplete_new(struct LDKChannelId channel_id_arg);
41344 * Creates a copy of the TxComplete
41346 struct LDKTxComplete TxComplete_clone(const struct LDKTxComplete *NONNULL_PTR orig);
41349 * Generates a non-cryptographic 64-bit hash of the TxComplete.
41351 uint64_t TxComplete_hash(const struct LDKTxComplete *NONNULL_PTR o);
41354 * Checks if two TxCompletes contain equal inner contents.
41355 * This ignores pointers and is_owned flags and looks at the values in fields.
41356 * Two objects with NULL inner values will be considered "equal" here.
41358 bool TxComplete_eq(const struct LDKTxComplete *NONNULL_PTR a, const struct LDKTxComplete *NONNULL_PTR b);
41361 * Frees any resources used by the TxSignatures, if is_owned is set and inner is non-NULL.
41363 void TxSignatures_free(struct LDKTxSignatures this_obj);
41368 struct LDKChannelId TxSignatures_get_channel_id(const struct LDKTxSignatures *NONNULL_PTR this_ptr);
41373 void TxSignatures_set_channel_id(struct LDKTxSignatures *NONNULL_PTR this_ptr, struct LDKChannelId val);
41378 const uint8_t (*TxSignatures_get_tx_hash(const struct LDKTxSignatures *NONNULL_PTR this_ptr))[32];
41383 void TxSignatures_set_tx_hash(struct LDKTxSignatures *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
41386 * The list of witnesses
41388 * Returns a copy of the field.
41390 struct LDKCVec_WitnessZ TxSignatures_get_witnesses(const struct LDKTxSignatures *NONNULL_PTR this_ptr);
41393 * The list of witnesses
41395 void TxSignatures_set_witnesses(struct LDKTxSignatures *NONNULL_PTR this_ptr, struct LDKCVec_WitnessZ val);
41398 * Optional signature for the shared input -- the previous funding outpoint -- signed by both peers
41400 struct LDKCOption_ECDSASignatureZ TxSignatures_get_funding_outpoint_sig(const struct LDKTxSignatures *NONNULL_PTR this_ptr);
41403 * Optional signature for the shared input -- the previous funding outpoint -- signed by both peers
41405 void TxSignatures_set_funding_outpoint_sig(struct LDKTxSignatures *NONNULL_PTR this_ptr, struct LDKCOption_ECDSASignatureZ val);
41408 * Constructs a new TxSignatures given each field
41410 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);
41413 * Creates a copy of the TxSignatures
41415 struct LDKTxSignatures TxSignatures_clone(const struct LDKTxSignatures *NONNULL_PTR orig);
41418 * Generates a non-cryptographic 64-bit hash of the TxSignatures.
41420 uint64_t TxSignatures_hash(const struct LDKTxSignatures *NONNULL_PTR o);
41423 * Checks if two TxSignaturess contain equal inner contents.
41424 * This ignores pointers and is_owned flags and looks at the values in fields.
41425 * Two objects with NULL inner values will be considered "equal" here.
41427 bool TxSignatures_eq(const struct LDKTxSignatures *NONNULL_PTR a, const struct LDKTxSignatures *NONNULL_PTR b);
41430 * Frees any resources used by the TxInitRbf, if is_owned is set and inner is non-NULL.
41432 void TxInitRbf_free(struct LDKTxInitRbf this_obj);
41437 struct LDKChannelId TxInitRbf_get_channel_id(const struct LDKTxInitRbf *NONNULL_PTR this_ptr);
41442 void TxInitRbf_set_channel_id(struct LDKTxInitRbf *NONNULL_PTR this_ptr, struct LDKChannelId val);
41445 * The locktime of the transaction
41447 uint32_t TxInitRbf_get_locktime(const struct LDKTxInitRbf *NONNULL_PTR this_ptr);
41450 * The locktime of the transaction
41452 void TxInitRbf_set_locktime(struct LDKTxInitRbf *NONNULL_PTR this_ptr, uint32_t val);
41455 * The feerate of the transaction
41457 uint32_t TxInitRbf_get_feerate_sat_per_1000_weight(const struct LDKTxInitRbf *NONNULL_PTR this_ptr);
41460 * The feerate of the transaction
41462 void TxInitRbf_set_feerate_sat_per_1000_weight(struct LDKTxInitRbf *NONNULL_PTR this_ptr, uint32_t val);
41465 * The number of satoshis the sender will contribute to or, if negative, remove from
41466 * (e.g. splice-out) the funding output of the transaction
41468 struct LDKCOption_i64Z TxInitRbf_get_funding_output_contribution(const struct LDKTxInitRbf *NONNULL_PTR this_ptr);
41471 * The number of satoshis the sender will contribute to or, if negative, remove from
41472 * (e.g. splice-out) the funding output of the transaction
41474 void TxInitRbf_set_funding_output_contribution(struct LDKTxInitRbf *NONNULL_PTR this_ptr, struct LDKCOption_i64Z val);
41477 * Constructs a new TxInitRbf given each field
41479 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);
41482 * Creates a copy of the TxInitRbf
41484 struct LDKTxInitRbf TxInitRbf_clone(const struct LDKTxInitRbf *NONNULL_PTR orig);
41487 * Generates a non-cryptographic 64-bit hash of the TxInitRbf.
41489 uint64_t TxInitRbf_hash(const struct LDKTxInitRbf *NONNULL_PTR o);
41492 * Checks if two TxInitRbfs contain equal inner contents.
41493 * This ignores pointers and is_owned flags and looks at the values in fields.
41494 * Two objects with NULL inner values will be considered "equal" here.
41496 bool TxInitRbf_eq(const struct LDKTxInitRbf *NONNULL_PTR a, const struct LDKTxInitRbf *NONNULL_PTR b);
41499 * Frees any resources used by the TxAckRbf, if is_owned is set and inner is non-NULL.
41501 void TxAckRbf_free(struct LDKTxAckRbf this_obj);
41506 struct LDKChannelId TxAckRbf_get_channel_id(const struct LDKTxAckRbf *NONNULL_PTR this_ptr);
41511 void TxAckRbf_set_channel_id(struct LDKTxAckRbf *NONNULL_PTR this_ptr, struct LDKChannelId val);
41514 * The number of satoshis the sender will contribute to or, if negative, remove from
41515 * (e.g. splice-out) the funding output of the transaction
41517 struct LDKCOption_i64Z TxAckRbf_get_funding_output_contribution(const struct LDKTxAckRbf *NONNULL_PTR this_ptr);
41520 * The number of satoshis the sender will contribute to or, if negative, remove from
41521 * (e.g. splice-out) the funding output of the transaction
41523 void TxAckRbf_set_funding_output_contribution(struct LDKTxAckRbf *NONNULL_PTR this_ptr, struct LDKCOption_i64Z val);
41526 * Constructs a new TxAckRbf given each field
41528 MUST_USE_RES struct LDKTxAckRbf TxAckRbf_new(struct LDKChannelId channel_id_arg, struct LDKCOption_i64Z funding_output_contribution_arg);
41531 * Creates a copy of the TxAckRbf
41533 struct LDKTxAckRbf TxAckRbf_clone(const struct LDKTxAckRbf *NONNULL_PTR orig);
41536 * Generates a non-cryptographic 64-bit hash of the TxAckRbf.
41538 uint64_t TxAckRbf_hash(const struct LDKTxAckRbf *NONNULL_PTR o);
41541 * Checks if two TxAckRbfs contain equal inner contents.
41542 * This ignores pointers and is_owned flags and looks at the values in fields.
41543 * Two objects with NULL inner values will be considered "equal" here.
41545 bool TxAckRbf_eq(const struct LDKTxAckRbf *NONNULL_PTR a, const struct LDKTxAckRbf *NONNULL_PTR b);
41548 * Frees any resources used by the TxAbort, if is_owned is set and inner is non-NULL.
41550 void TxAbort_free(struct LDKTxAbort this_obj);
41555 struct LDKChannelId TxAbort_get_channel_id(const struct LDKTxAbort *NONNULL_PTR this_ptr);
41560 void TxAbort_set_channel_id(struct LDKTxAbort *NONNULL_PTR this_ptr, struct LDKChannelId val);
41565 * Returns a copy of the field.
41567 struct LDKCVec_u8Z TxAbort_get_data(const struct LDKTxAbort *NONNULL_PTR this_ptr);
41572 void TxAbort_set_data(struct LDKTxAbort *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val);
41575 * Constructs a new TxAbort given each field
41577 MUST_USE_RES struct LDKTxAbort TxAbort_new(struct LDKChannelId channel_id_arg, struct LDKCVec_u8Z data_arg);
41580 * Creates a copy of the TxAbort
41582 struct LDKTxAbort TxAbort_clone(const struct LDKTxAbort *NONNULL_PTR orig);
41585 * Generates a non-cryptographic 64-bit hash of the TxAbort.
41587 uint64_t TxAbort_hash(const struct LDKTxAbort *NONNULL_PTR o);
41590 * Checks if two TxAborts contain equal inner contents.
41591 * This ignores pointers and is_owned flags and looks at the values in fields.
41592 * Two objects with NULL inner values will be considered "equal" here.
41594 bool TxAbort_eq(const struct LDKTxAbort *NONNULL_PTR a, const struct LDKTxAbort *NONNULL_PTR b);
41597 * Frees any resources used by the Shutdown, if is_owned is set and inner is non-NULL.
41599 void Shutdown_free(struct LDKShutdown this_obj);
41604 struct LDKChannelId Shutdown_get_channel_id(const struct LDKShutdown *NONNULL_PTR this_ptr);
41609 void Shutdown_set_channel_id(struct LDKShutdown *NONNULL_PTR this_ptr, struct LDKChannelId val);
41612 * The destination of this peer's funds on closing.
41614 * Must be in one of these forms: P2PKH, P2SH, P2WPKH, P2WSH, P2TR.
41616 struct LDKCVec_u8Z Shutdown_get_scriptpubkey(const struct LDKShutdown *NONNULL_PTR this_ptr);
41619 * The destination of this peer's funds on closing.
41621 * Must be in one of these forms: P2PKH, P2SH, P2WPKH, P2WSH, P2TR.
41623 void Shutdown_set_scriptpubkey(struct LDKShutdown *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val);
41626 * Constructs a new Shutdown given each field
41628 MUST_USE_RES struct LDKShutdown Shutdown_new(struct LDKChannelId channel_id_arg, struct LDKCVec_u8Z scriptpubkey_arg);
41631 * Creates a copy of the Shutdown
41633 struct LDKShutdown Shutdown_clone(const struct LDKShutdown *NONNULL_PTR orig);
41636 * Generates a non-cryptographic 64-bit hash of the Shutdown.
41638 uint64_t Shutdown_hash(const struct LDKShutdown *NONNULL_PTR o);
41641 * Checks if two Shutdowns contain equal inner contents.
41642 * This ignores pointers and is_owned flags and looks at the values in fields.
41643 * Two objects with NULL inner values will be considered "equal" here.
41645 bool Shutdown_eq(const struct LDKShutdown *NONNULL_PTR a, const struct LDKShutdown *NONNULL_PTR b);
41648 * Frees any resources used by the ClosingSignedFeeRange, if is_owned is set and inner is non-NULL.
41650 void ClosingSignedFeeRange_free(struct LDKClosingSignedFeeRange this_obj);
41653 * The minimum absolute fee, in satoshis, which the sender is willing to place on the closing
41656 uint64_t ClosingSignedFeeRange_get_min_fee_satoshis(const struct LDKClosingSignedFeeRange *NONNULL_PTR this_ptr);
41659 * The minimum absolute fee, in satoshis, which the sender is willing to place on the closing
41662 void ClosingSignedFeeRange_set_min_fee_satoshis(struct LDKClosingSignedFeeRange *NONNULL_PTR this_ptr, uint64_t val);
41665 * The maximum absolute fee, in satoshis, which the sender is willing to place on the closing
41668 uint64_t ClosingSignedFeeRange_get_max_fee_satoshis(const struct LDKClosingSignedFeeRange *NONNULL_PTR this_ptr);
41671 * The maximum absolute fee, in satoshis, which the sender is willing to place on the closing
41674 void ClosingSignedFeeRange_set_max_fee_satoshis(struct LDKClosingSignedFeeRange *NONNULL_PTR this_ptr, uint64_t val);
41677 * Constructs a new ClosingSignedFeeRange given each field
41679 MUST_USE_RES struct LDKClosingSignedFeeRange ClosingSignedFeeRange_new(uint64_t min_fee_satoshis_arg, uint64_t max_fee_satoshis_arg);
41682 * Creates a copy of the ClosingSignedFeeRange
41684 struct LDKClosingSignedFeeRange ClosingSignedFeeRange_clone(const struct LDKClosingSignedFeeRange *NONNULL_PTR orig);
41687 * Generates a non-cryptographic 64-bit hash of the ClosingSignedFeeRange.
41689 uint64_t ClosingSignedFeeRange_hash(const struct LDKClosingSignedFeeRange *NONNULL_PTR o);
41692 * Checks if two ClosingSignedFeeRanges contain equal inner contents.
41693 * This ignores pointers and is_owned flags and looks at the values in fields.
41694 * Two objects with NULL inner values will be considered "equal" here.
41696 bool ClosingSignedFeeRange_eq(const struct LDKClosingSignedFeeRange *NONNULL_PTR a, const struct LDKClosingSignedFeeRange *NONNULL_PTR b);
41699 * Frees any resources used by the ClosingSigned, if is_owned is set and inner is non-NULL.
41701 void ClosingSigned_free(struct LDKClosingSigned this_obj);
41706 struct LDKChannelId ClosingSigned_get_channel_id(const struct LDKClosingSigned *NONNULL_PTR this_ptr);
41711 void ClosingSigned_set_channel_id(struct LDKClosingSigned *NONNULL_PTR this_ptr, struct LDKChannelId val);
41714 * The proposed total fee for the closing transaction
41716 uint64_t ClosingSigned_get_fee_satoshis(const struct LDKClosingSigned *NONNULL_PTR this_ptr);
41719 * The proposed total fee for the closing transaction
41721 void ClosingSigned_set_fee_satoshis(struct LDKClosingSigned *NONNULL_PTR this_ptr, uint64_t val);
41724 * A signature on the closing transaction
41726 struct LDKECDSASignature ClosingSigned_get_signature(const struct LDKClosingSigned *NONNULL_PTR this_ptr);
41729 * A signature on the closing transaction
41731 void ClosingSigned_set_signature(struct LDKClosingSigned *NONNULL_PTR this_ptr, struct LDKECDSASignature val);
41734 * The minimum and maximum fees which the sender is willing to accept, provided only by new
41737 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
41739 struct LDKClosingSignedFeeRange ClosingSigned_get_fee_range(const struct LDKClosingSigned *NONNULL_PTR this_ptr);
41742 * The minimum and maximum fees which the sender is willing to accept, provided only by new
41745 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
41747 void ClosingSigned_set_fee_range(struct LDKClosingSigned *NONNULL_PTR this_ptr, struct LDKClosingSignedFeeRange val);
41750 * Constructs a new ClosingSigned given each field
41752 * Note that fee_range_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
41754 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);
41757 * Creates a copy of the ClosingSigned
41759 struct LDKClosingSigned ClosingSigned_clone(const struct LDKClosingSigned *NONNULL_PTR orig);
41762 * Generates a non-cryptographic 64-bit hash of the ClosingSigned.
41764 uint64_t ClosingSigned_hash(const struct LDKClosingSigned *NONNULL_PTR o);
41767 * Checks if two ClosingSigneds contain equal inner contents.
41768 * This ignores pointers and is_owned flags and looks at the values in fields.
41769 * Two objects with NULL inner values will be considered "equal" here.
41771 bool ClosingSigned_eq(const struct LDKClosingSigned *NONNULL_PTR a, const struct LDKClosingSigned *NONNULL_PTR b);
41774 * Frees any resources used by the UpdateAddHTLC, if is_owned is set and inner is non-NULL.
41776 void UpdateAddHTLC_free(struct LDKUpdateAddHTLC this_obj);
41781 struct LDKChannelId UpdateAddHTLC_get_channel_id(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr);
41786 void UpdateAddHTLC_set_channel_id(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, struct LDKChannelId val);
41791 uint64_t UpdateAddHTLC_get_htlc_id(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr);
41796 void UpdateAddHTLC_set_htlc_id(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, uint64_t val);
41799 * The HTLC value in milli-satoshi
41801 uint64_t UpdateAddHTLC_get_amount_msat(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr);
41804 * The HTLC value in milli-satoshi
41806 void UpdateAddHTLC_set_amount_msat(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, uint64_t val);
41809 * The payment hash, the pre-image of which controls HTLC redemption
41811 const uint8_t (*UpdateAddHTLC_get_payment_hash(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr))[32];
41814 * The payment hash, the pre-image of which controls HTLC redemption
41816 void UpdateAddHTLC_set_payment_hash(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
41819 * The expiry height of the HTLC
41821 uint32_t UpdateAddHTLC_get_cltv_expiry(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr);
41824 * The expiry height of the HTLC
41826 void UpdateAddHTLC_set_cltv_expiry(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, uint32_t val);
41829 * The extra fee skimmed by the sender of this message. See
41830 * [`ChannelConfig::accept_underpaying_htlcs`].
41832 * [`ChannelConfig::accept_underpaying_htlcs`]: crate::util::config::ChannelConfig::accept_underpaying_htlcs
41834 struct LDKCOption_u64Z UpdateAddHTLC_get_skimmed_fee_msat(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr);
41837 * The extra fee skimmed by the sender of this message. See
41838 * [`ChannelConfig::accept_underpaying_htlcs`].
41840 * [`ChannelConfig::accept_underpaying_htlcs`]: crate::util::config::ChannelConfig::accept_underpaying_htlcs
41842 void UpdateAddHTLC_set_skimmed_fee_msat(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
41845 * The onion routing packet with encrypted data for the next hop.
41847 struct LDKOnionPacket UpdateAddHTLC_get_onion_routing_packet(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr);
41850 * The onion routing packet with encrypted data for the next hop.
41852 void UpdateAddHTLC_set_onion_routing_packet(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, struct LDKOnionPacket val);
41855 * Provided if we are relaying or receiving a payment within a blinded path, to decrypt the onion
41856 * routing packet and the recipient-provided encrypted payload within.
41858 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
41860 struct LDKPublicKey UpdateAddHTLC_get_blinding_point(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr);
41863 * Provided if we are relaying or receiving a payment within a blinded path, to decrypt the onion
41864 * routing packet and the recipient-provided encrypted payload within.
41866 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
41868 void UpdateAddHTLC_set_blinding_point(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, struct LDKPublicKey val);
41871 * Constructs a new UpdateAddHTLC given each field
41873 * Note that blinding_point_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
41875 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);
41878 * Creates a copy of the UpdateAddHTLC
41880 struct LDKUpdateAddHTLC UpdateAddHTLC_clone(const struct LDKUpdateAddHTLC *NONNULL_PTR orig);
41883 * Generates a non-cryptographic 64-bit hash of the UpdateAddHTLC.
41885 uint64_t UpdateAddHTLC_hash(const struct LDKUpdateAddHTLC *NONNULL_PTR o);
41888 * Checks if two UpdateAddHTLCs contain equal inner contents.
41889 * This ignores pointers and is_owned flags and looks at the values in fields.
41890 * Two objects with NULL inner values will be considered "equal" here.
41892 bool UpdateAddHTLC_eq(const struct LDKUpdateAddHTLC *NONNULL_PTR a, const struct LDKUpdateAddHTLC *NONNULL_PTR b);
41895 * Frees any resources used by the OnionMessage, if is_owned is set and inner is non-NULL.
41897 void OnionMessage_free(struct LDKOnionMessage this_obj);
41900 * Used in decrypting the onion packet's payload.
41902 struct LDKPublicKey OnionMessage_get_blinding_point(const struct LDKOnionMessage *NONNULL_PTR this_ptr);
41905 * Used in decrypting the onion packet's payload.
41907 void OnionMessage_set_blinding_point(struct LDKOnionMessage *NONNULL_PTR this_ptr, struct LDKPublicKey val);
41910 * The full onion packet including hop data, pubkey, and hmac
41912 struct LDKPacket OnionMessage_get_onion_routing_packet(const struct LDKOnionMessage *NONNULL_PTR this_ptr);
41915 * The full onion packet including hop data, pubkey, and hmac
41917 void OnionMessage_set_onion_routing_packet(struct LDKOnionMessage *NONNULL_PTR this_ptr, struct LDKPacket val);
41920 * Constructs a new OnionMessage given each field
41922 MUST_USE_RES struct LDKOnionMessage OnionMessage_new(struct LDKPublicKey blinding_point_arg, struct LDKPacket onion_routing_packet_arg);
41925 * Creates a copy of the OnionMessage
41927 struct LDKOnionMessage OnionMessage_clone(const struct LDKOnionMessage *NONNULL_PTR orig);
41930 * Generates a non-cryptographic 64-bit hash of the OnionMessage.
41932 uint64_t OnionMessage_hash(const struct LDKOnionMessage *NONNULL_PTR o);
41935 * Checks if two OnionMessages contain equal inner contents.
41936 * This ignores pointers and is_owned flags and looks at the values in fields.
41937 * Two objects with NULL inner values will be considered "equal" here.
41939 bool OnionMessage_eq(const struct LDKOnionMessage *NONNULL_PTR a, const struct LDKOnionMessage *NONNULL_PTR b);
41942 * Frees any resources used by the UpdateFulfillHTLC, if is_owned is set and inner is non-NULL.
41944 void UpdateFulfillHTLC_free(struct LDKUpdateFulfillHTLC this_obj);
41949 struct LDKChannelId UpdateFulfillHTLC_get_channel_id(const struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr);
41954 void UpdateFulfillHTLC_set_channel_id(struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr, struct LDKChannelId val);
41959 uint64_t UpdateFulfillHTLC_get_htlc_id(const struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr);
41964 void UpdateFulfillHTLC_set_htlc_id(struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr, uint64_t val);
41967 * The pre-image of the payment hash, allowing HTLC redemption
41969 const uint8_t (*UpdateFulfillHTLC_get_payment_preimage(const struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr))[32];
41972 * The pre-image of the payment hash, allowing HTLC redemption
41974 void UpdateFulfillHTLC_set_payment_preimage(struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
41977 * Constructs a new UpdateFulfillHTLC given each field
41979 MUST_USE_RES struct LDKUpdateFulfillHTLC UpdateFulfillHTLC_new(struct LDKChannelId channel_id_arg, uint64_t htlc_id_arg, struct LDKThirtyTwoBytes payment_preimage_arg);
41982 * Creates a copy of the UpdateFulfillHTLC
41984 struct LDKUpdateFulfillHTLC UpdateFulfillHTLC_clone(const struct LDKUpdateFulfillHTLC *NONNULL_PTR orig);
41987 * Generates a non-cryptographic 64-bit hash of the UpdateFulfillHTLC.
41989 uint64_t UpdateFulfillHTLC_hash(const struct LDKUpdateFulfillHTLC *NONNULL_PTR o);
41992 * Checks if two UpdateFulfillHTLCs contain equal inner contents.
41993 * This ignores pointers and is_owned flags and looks at the values in fields.
41994 * Two objects with NULL inner values will be considered "equal" here.
41996 bool UpdateFulfillHTLC_eq(const struct LDKUpdateFulfillHTLC *NONNULL_PTR a, const struct LDKUpdateFulfillHTLC *NONNULL_PTR b);
41999 * Frees any resources used by the UpdateFailHTLC, if is_owned is set and inner is non-NULL.
42001 void UpdateFailHTLC_free(struct LDKUpdateFailHTLC this_obj);
42006 struct LDKChannelId UpdateFailHTLC_get_channel_id(const struct LDKUpdateFailHTLC *NONNULL_PTR this_ptr);
42011 void UpdateFailHTLC_set_channel_id(struct LDKUpdateFailHTLC *NONNULL_PTR this_ptr, struct LDKChannelId val);
42016 uint64_t UpdateFailHTLC_get_htlc_id(const struct LDKUpdateFailHTLC *NONNULL_PTR this_ptr);
42021 void UpdateFailHTLC_set_htlc_id(struct LDKUpdateFailHTLC *NONNULL_PTR this_ptr, uint64_t val);
42024 * Creates a copy of the UpdateFailHTLC
42026 struct LDKUpdateFailHTLC UpdateFailHTLC_clone(const struct LDKUpdateFailHTLC *NONNULL_PTR orig);
42029 * Generates a non-cryptographic 64-bit hash of the UpdateFailHTLC.
42031 uint64_t UpdateFailHTLC_hash(const struct LDKUpdateFailHTLC *NONNULL_PTR o);
42034 * Checks if two UpdateFailHTLCs contain equal inner contents.
42035 * This ignores pointers and is_owned flags and looks at the values in fields.
42036 * Two objects with NULL inner values will be considered "equal" here.
42038 bool UpdateFailHTLC_eq(const struct LDKUpdateFailHTLC *NONNULL_PTR a, const struct LDKUpdateFailHTLC *NONNULL_PTR b);
42041 * Frees any resources used by the UpdateFailMalformedHTLC, if is_owned is set and inner is non-NULL.
42043 void UpdateFailMalformedHTLC_free(struct LDKUpdateFailMalformedHTLC this_obj);
42048 struct LDKChannelId UpdateFailMalformedHTLC_get_channel_id(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr);
42053 void UpdateFailMalformedHTLC_set_channel_id(struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr, struct LDKChannelId val);
42058 uint64_t UpdateFailMalformedHTLC_get_htlc_id(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr);
42063 void UpdateFailMalformedHTLC_set_htlc_id(struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr, uint64_t val);
42068 uint16_t UpdateFailMalformedHTLC_get_failure_code(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr);
42073 void UpdateFailMalformedHTLC_set_failure_code(struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr, uint16_t val);
42076 * Creates a copy of the UpdateFailMalformedHTLC
42078 struct LDKUpdateFailMalformedHTLC UpdateFailMalformedHTLC_clone(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR orig);
42081 * Generates a non-cryptographic 64-bit hash of the UpdateFailMalformedHTLC.
42083 uint64_t UpdateFailMalformedHTLC_hash(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR o);
42086 * Checks if two UpdateFailMalformedHTLCs contain equal inner contents.
42087 * This ignores pointers and is_owned flags and looks at the values in fields.
42088 * Two objects with NULL inner values will be considered "equal" here.
42090 bool UpdateFailMalformedHTLC_eq(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR a, const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR b);
42093 * Frees any resources used by the CommitmentSigned, if is_owned is set and inner is non-NULL.
42095 void CommitmentSigned_free(struct LDKCommitmentSigned this_obj);
42100 struct LDKChannelId CommitmentSigned_get_channel_id(const struct LDKCommitmentSigned *NONNULL_PTR this_ptr);
42105 void CommitmentSigned_set_channel_id(struct LDKCommitmentSigned *NONNULL_PTR this_ptr, struct LDKChannelId val);
42108 * A signature on the commitment transaction
42110 struct LDKECDSASignature CommitmentSigned_get_signature(const struct LDKCommitmentSigned *NONNULL_PTR this_ptr);
42113 * A signature on the commitment transaction
42115 void CommitmentSigned_set_signature(struct LDKCommitmentSigned *NONNULL_PTR this_ptr, struct LDKECDSASignature val);
42118 * Signatures on the HTLC transactions
42120 * Returns a copy of the field.
42122 struct LDKCVec_ECDSASignatureZ CommitmentSigned_get_htlc_signatures(const struct LDKCommitmentSigned *NONNULL_PTR this_ptr);
42125 * Signatures on the HTLC transactions
42127 void CommitmentSigned_set_htlc_signatures(struct LDKCommitmentSigned *NONNULL_PTR this_ptr, struct LDKCVec_ECDSASignatureZ val);
42130 * Constructs a new CommitmentSigned given each field
42132 MUST_USE_RES struct LDKCommitmentSigned CommitmentSigned_new(struct LDKChannelId channel_id_arg, struct LDKECDSASignature signature_arg, struct LDKCVec_ECDSASignatureZ htlc_signatures_arg);
42135 * Creates a copy of the CommitmentSigned
42137 struct LDKCommitmentSigned CommitmentSigned_clone(const struct LDKCommitmentSigned *NONNULL_PTR orig);
42140 * Generates a non-cryptographic 64-bit hash of the CommitmentSigned.
42142 uint64_t CommitmentSigned_hash(const struct LDKCommitmentSigned *NONNULL_PTR o);
42145 * Checks if two CommitmentSigneds contain equal inner contents.
42146 * This ignores pointers and is_owned flags and looks at the values in fields.
42147 * Two objects with NULL inner values will be considered "equal" here.
42149 bool CommitmentSigned_eq(const struct LDKCommitmentSigned *NONNULL_PTR a, const struct LDKCommitmentSigned *NONNULL_PTR b);
42152 * Frees any resources used by the RevokeAndACK, if is_owned is set and inner is non-NULL.
42154 void RevokeAndACK_free(struct LDKRevokeAndACK this_obj);
42159 struct LDKChannelId RevokeAndACK_get_channel_id(const struct LDKRevokeAndACK *NONNULL_PTR this_ptr);
42164 void RevokeAndACK_set_channel_id(struct LDKRevokeAndACK *NONNULL_PTR this_ptr, struct LDKChannelId val);
42167 * The secret corresponding to the per-commitment point
42169 const uint8_t (*RevokeAndACK_get_per_commitment_secret(const struct LDKRevokeAndACK *NONNULL_PTR this_ptr))[32];
42172 * The secret corresponding to the per-commitment point
42174 void RevokeAndACK_set_per_commitment_secret(struct LDKRevokeAndACK *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
42177 * The next sender-broadcast commitment transaction's per-commitment point
42179 struct LDKPublicKey RevokeAndACK_get_next_per_commitment_point(const struct LDKRevokeAndACK *NONNULL_PTR this_ptr);
42182 * The next sender-broadcast commitment transaction's per-commitment point
42184 void RevokeAndACK_set_next_per_commitment_point(struct LDKRevokeAndACK *NONNULL_PTR this_ptr, struct LDKPublicKey val);
42187 * Constructs a new RevokeAndACK given each field
42189 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);
42192 * Creates a copy of the RevokeAndACK
42194 struct LDKRevokeAndACK RevokeAndACK_clone(const struct LDKRevokeAndACK *NONNULL_PTR orig);
42197 * Generates a non-cryptographic 64-bit hash of the RevokeAndACK.
42199 uint64_t RevokeAndACK_hash(const struct LDKRevokeAndACK *NONNULL_PTR o);
42202 * Checks if two RevokeAndACKs contain equal inner contents.
42203 * This ignores pointers and is_owned flags and looks at the values in fields.
42204 * Two objects with NULL inner values will be considered "equal" here.
42206 bool RevokeAndACK_eq(const struct LDKRevokeAndACK *NONNULL_PTR a, const struct LDKRevokeAndACK *NONNULL_PTR b);
42209 * Frees any resources used by the UpdateFee, if is_owned is set and inner is non-NULL.
42211 void UpdateFee_free(struct LDKUpdateFee this_obj);
42216 struct LDKChannelId UpdateFee_get_channel_id(const struct LDKUpdateFee *NONNULL_PTR this_ptr);
42221 void UpdateFee_set_channel_id(struct LDKUpdateFee *NONNULL_PTR this_ptr, struct LDKChannelId val);
42224 * Fee rate per 1000-weight of the transaction
42226 uint32_t UpdateFee_get_feerate_per_kw(const struct LDKUpdateFee *NONNULL_PTR this_ptr);
42229 * Fee rate per 1000-weight of the transaction
42231 void UpdateFee_set_feerate_per_kw(struct LDKUpdateFee *NONNULL_PTR this_ptr, uint32_t val);
42234 * Constructs a new UpdateFee given each field
42236 MUST_USE_RES struct LDKUpdateFee UpdateFee_new(struct LDKChannelId channel_id_arg, uint32_t feerate_per_kw_arg);
42239 * Creates a copy of the UpdateFee
42241 struct LDKUpdateFee UpdateFee_clone(const struct LDKUpdateFee *NONNULL_PTR orig);
42244 * Generates a non-cryptographic 64-bit hash of the UpdateFee.
42246 uint64_t UpdateFee_hash(const struct LDKUpdateFee *NONNULL_PTR o);
42249 * Checks if two UpdateFees contain equal inner contents.
42250 * This ignores pointers and is_owned flags and looks at the values in fields.
42251 * Two objects with NULL inner values will be considered "equal" here.
42253 bool UpdateFee_eq(const struct LDKUpdateFee *NONNULL_PTR a, const struct LDKUpdateFee *NONNULL_PTR b);
42256 * Frees any resources used by the ChannelReestablish, if is_owned is set and inner is non-NULL.
42258 void ChannelReestablish_free(struct LDKChannelReestablish this_obj);
42263 struct LDKChannelId ChannelReestablish_get_channel_id(const struct LDKChannelReestablish *NONNULL_PTR this_ptr);
42268 void ChannelReestablish_set_channel_id(struct LDKChannelReestablish *NONNULL_PTR this_ptr, struct LDKChannelId val);
42271 * The next commitment number for the sender
42273 uint64_t ChannelReestablish_get_next_local_commitment_number(const struct LDKChannelReestablish *NONNULL_PTR this_ptr);
42276 * The next commitment number for the sender
42278 void ChannelReestablish_set_next_local_commitment_number(struct LDKChannelReestablish *NONNULL_PTR this_ptr, uint64_t val);
42281 * The next commitment number for the recipient
42283 uint64_t ChannelReestablish_get_next_remote_commitment_number(const struct LDKChannelReestablish *NONNULL_PTR this_ptr);
42286 * The next commitment number for the recipient
42288 void ChannelReestablish_set_next_remote_commitment_number(struct LDKChannelReestablish *NONNULL_PTR this_ptr, uint64_t val);
42291 * Proof that the sender knows the per-commitment secret of a specific commitment transaction
42292 * belonging to the recipient
42294 const uint8_t (*ChannelReestablish_get_your_last_per_commitment_secret(const struct LDKChannelReestablish *NONNULL_PTR this_ptr))[32];
42297 * Proof that the sender knows the per-commitment secret of a specific commitment transaction
42298 * belonging to the recipient
42300 void ChannelReestablish_set_your_last_per_commitment_secret(struct LDKChannelReestablish *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
42303 * The sender's per-commitment point for their current commitment transaction
42305 struct LDKPublicKey ChannelReestablish_get_my_current_per_commitment_point(const struct LDKChannelReestablish *NONNULL_PTR this_ptr);
42308 * The sender's per-commitment point for their current commitment transaction
42310 void ChannelReestablish_set_my_current_per_commitment_point(struct LDKChannelReestablish *NONNULL_PTR this_ptr, struct LDKPublicKey val);
42313 * The next funding transaction ID
42315 struct LDKCOption_ThirtyTwoBytesZ ChannelReestablish_get_next_funding_txid(const struct LDKChannelReestablish *NONNULL_PTR this_ptr);
42318 * The next funding transaction ID
42320 void ChannelReestablish_set_next_funding_txid(struct LDKChannelReestablish *NONNULL_PTR this_ptr, struct LDKCOption_ThirtyTwoBytesZ val);
42323 * Constructs a new ChannelReestablish given each field
42325 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);
42328 * Creates a copy of the ChannelReestablish
42330 struct LDKChannelReestablish ChannelReestablish_clone(const struct LDKChannelReestablish *NONNULL_PTR orig);
42333 * Generates a non-cryptographic 64-bit hash of the ChannelReestablish.
42335 uint64_t ChannelReestablish_hash(const struct LDKChannelReestablish *NONNULL_PTR o);
42338 * Checks if two ChannelReestablishs contain equal inner contents.
42339 * This ignores pointers and is_owned flags and looks at the values in fields.
42340 * Two objects with NULL inner values will be considered "equal" here.
42342 bool ChannelReestablish_eq(const struct LDKChannelReestablish *NONNULL_PTR a, const struct LDKChannelReestablish *NONNULL_PTR b);
42345 * Frees any resources used by the AnnouncementSignatures, if is_owned is set and inner is non-NULL.
42347 void AnnouncementSignatures_free(struct LDKAnnouncementSignatures this_obj);
42352 struct LDKChannelId AnnouncementSignatures_get_channel_id(const struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr);
42357 void AnnouncementSignatures_set_channel_id(struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr, struct LDKChannelId val);
42360 * The short channel ID
42362 uint64_t AnnouncementSignatures_get_short_channel_id(const struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr);
42365 * The short channel ID
42367 void AnnouncementSignatures_set_short_channel_id(struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr, uint64_t val);
42370 * A signature by the node key
42372 struct LDKECDSASignature AnnouncementSignatures_get_node_signature(const struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr);
42375 * A signature by the node key
42377 void AnnouncementSignatures_set_node_signature(struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr, struct LDKECDSASignature val);
42380 * A signature by the funding key
42382 struct LDKECDSASignature AnnouncementSignatures_get_bitcoin_signature(const struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr);
42385 * A signature by the funding key
42387 void AnnouncementSignatures_set_bitcoin_signature(struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr, struct LDKECDSASignature val);
42390 * Constructs a new AnnouncementSignatures given each field
42392 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);
42395 * Creates a copy of the AnnouncementSignatures
42397 struct LDKAnnouncementSignatures AnnouncementSignatures_clone(const struct LDKAnnouncementSignatures *NONNULL_PTR orig);
42400 * Generates a non-cryptographic 64-bit hash of the AnnouncementSignatures.
42402 uint64_t AnnouncementSignatures_hash(const struct LDKAnnouncementSignatures *NONNULL_PTR o);
42405 * Checks if two AnnouncementSignaturess contain equal inner contents.
42406 * This ignores pointers and is_owned flags and looks at the values in fields.
42407 * Two objects with NULL inner values will be considered "equal" here.
42409 bool AnnouncementSignatures_eq(const struct LDKAnnouncementSignatures *NONNULL_PTR a, const struct LDKAnnouncementSignatures *NONNULL_PTR b);
42412 * Frees any resources used by the SocketAddress
42414 void SocketAddress_free(struct LDKSocketAddress this_ptr);
42417 * Creates a copy of the SocketAddress
42419 struct LDKSocketAddress SocketAddress_clone(const struct LDKSocketAddress *NONNULL_PTR orig);
42422 * Utility method to constructs a new TcpIpV4-variant SocketAddress
42424 struct LDKSocketAddress SocketAddress_tcp_ip_v4(struct LDKFourBytes addr, uint16_t port);
42427 * Utility method to constructs a new TcpIpV6-variant SocketAddress
42429 struct LDKSocketAddress SocketAddress_tcp_ip_v6(struct LDKSixteenBytes addr, uint16_t port);
42432 * Utility method to constructs a new OnionV2-variant SocketAddress
42434 struct LDKSocketAddress SocketAddress_onion_v2(struct LDKTwelveBytes a);
42437 * Utility method to constructs a new OnionV3-variant SocketAddress
42439 struct LDKSocketAddress SocketAddress_onion_v3(struct LDKThirtyTwoBytes ed25519_pubkey, uint16_t checksum, uint8_t version, uint16_t port);
42442 * Utility method to constructs a new Hostname-variant SocketAddress
42444 struct LDKSocketAddress SocketAddress_hostname(struct LDKHostname hostname, uint16_t port);
42447 * Generates a non-cryptographic 64-bit hash of the SocketAddress.
42449 uint64_t SocketAddress_hash(const struct LDKSocketAddress *NONNULL_PTR o);
42452 * Checks if two SocketAddresss contain equal inner contents.
42453 * This ignores pointers and is_owned flags and looks at the values in fields.
42455 bool SocketAddress_eq(const struct LDKSocketAddress *NONNULL_PTR a, const struct LDKSocketAddress *NONNULL_PTR b);
42458 * Serialize the SocketAddress object into a byte array which can be read by SocketAddress_read
42460 struct LDKCVec_u8Z SocketAddress_write(const struct LDKSocketAddress *NONNULL_PTR obj);
42463 * Read a SocketAddress from a byte array, created by SocketAddress_write
42465 struct LDKCResult_SocketAddressDecodeErrorZ SocketAddress_read(struct LDKu8slice ser);
42468 * Creates a copy of the SocketAddressParseError
42470 enum LDKSocketAddressParseError SocketAddressParseError_clone(const enum LDKSocketAddressParseError *NONNULL_PTR orig);
42473 * Utility method to constructs a new SocketAddrParse-variant SocketAddressParseError
42475 enum LDKSocketAddressParseError SocketAddressParseError_socket_addr_parse(void);
42478 * Utility method to constructs a new InvalidInput-variant SocketAddressParseError
42480 enum LDKSocketAddressParseError SocketAddressParseError_invalid_input(void);
42483 * Utility method to constructs a new InvalidPort-variant SocketAddressParseError
42485 enum LDKSocketAddressParseError SocketAddressParseError_invalid_port(void);
42488 * Utility method to constructs a new InvalidOnionV3-variant SocketAddressParseError
42490 enum LDKSocketAddressParseError SocketAddressParseError_invalid_onion_v3(void);
42493 * Generates a non-cryptographic 64-bit hash of the SocketAddressParseError.
42495 uint64_t SocketAddressParseError_hash(const enum LDKSocketAddressParseError *NONNULL_PTR o);
42498 * Checks if two SocketAddressParseErrors contain equal inner contents.
42499 * This ignores pointers and is_owned flags and looks at the values in fields.
42501 bool SocketAddressParseError_eq(const enum LDKSocketAddressParseError *NONNULL_PTR a, const enum LDKSocketAddressParseError *NONNULL_PTR b);
42504 * Get the string representation of a SocketAddressParseError object
42506 struct LDKStr SocketAddressParseError_to_str(const enum LDKSocketAddressParseError *NONNULL_PTR o);
42509 * Parses an OnionV3 host and port into a [`SocketAddress::OnionV3`].
42511 * The host part must end with \".onion\".
42513 struct LDKCResult_SocketAddressSocketAddressParseErrorZ parse_onion_address(struct LDKStr host, uint16_t port);
42516 * Get the string representation of a SocketAddress object
42518 struct LDKStr SocketAddress_to_str(const struct LDKSocketAddress *NONNULL_PTR o);
42521 * Read a SocketAddress object from a string
42523 struct LDKCResult_SocketAddressSocketAddressParseErrorZ SocketAddress_from_str(struct LDKStr s);
42526 * Frees any resources used by the UnsignedGossipMessage
42528 void UnsignedGossipMessage_free(struct LDKUnsignedGossipMessage this_ptr);
42531 * Creates a copy of the UnsignedGossipMessage
42533 struct LDKUnsignedGossipMessage UnsignedGossipMessage_clone(const struct LDKUnsignedGossipMessage *NONNULL_PTR orig);
42536 * Utility method to constructs a new ChannelAnnouncement-variant UnsignedGossipMessage
42538 struct LDKUnsignedGossipMessage UnsignedGossipMessage_channel_announcement(struct LDKUnsignedChannelAnnouncement a);
42541 * Utility method to constructs a new ChannelUpdate-variant UnsignedGossipMessage
42543 struct LDKUnsignedGossipMessage UnsignedGossipMessage_channel_update(struct LDKUnsignedChannelUpdate a);
42546 * Utility method to constructs a new NodeAnnouncement-variant UnsignedGossipMessage
42548 struct LDKUnsignedGossipMessage UnsignedGossipMessage_node_announcement(struct LDKUnsignedNodeAnnouncement a);
42551 * Serialize the UnsignedGossipMessage object into a byte array which can be read by UnsignedGossipMessage_read
42553 struct LDKCVec_u8Z UnsignedGossipMessage_write(const struct LDKUnsignedGossipMessage *NONNULL_PTR obj);
42556 * Frees any resources used by the UnsignedNodeAnnouncement, if is_owned is set and inner is non-NULL.
42558 void UnsignedNodeAnnouncement_free(struct LDKUnsignedNodeAnnouncement this_obj);
42561 * The advertised features
42563 struct LDKNodeFeatures UnsignedNodeAnnouncement_get_features(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr);
42566 * The advertised features
42568 void UnsignedNodeAnnouncement_set_features(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKNodeFeatures val);
42571 * A strictly monotonic announcement counter, with gaps allowed
42573 uint32_t UnsignedNodeAnnouncement_get_timestamp(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr);
42576 * A strictly monotonic announcement counter, with gaps allowed
42578 void UnsignedNodeAnnouncement_set_timestamp(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, uint32_t val);
42581 * The `node_id` this announcement originated from (don't rebroadcast the `node_announcement` back
42584 struct LDKNodeId UnsignedNodeAnnouncement_get_node_id(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr);
42587 * The `node_id` this announcement originated from (don't rebroadcast the `node_announcement` back
42590 void UnsignedNodeAnnouncement_set_node_id(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKNodeId val);
42593 * An RGB color for UI purposes
42595 const uint8_t (*UnsignedNodeAnnouncement_get_rgb(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr))[3];
42598 * An RGB color for UI purposes
42600 void UnsignedNodeAnnouncement_set_rgb(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKThreeBytes val);
42603 * An alias, for UI purposes.
42605 * This should be sanitized before use. There is no guarantee of uniqueness.
42607 struct LDKNodeAlias UnsignedNodeAnnouncement_get_alias(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr);
42610 * An alias, for UI purposes.
42612 * This should be sanitized before use. There is no guarantee of uniqueness.
42614 void UnsignedNodeAnnouncement_set_alias(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKNodeAlias val);
42617 * List of addresses on which this node is reachable
42619 * Returns a copy of the field.
42621 struct LDKCVec_SocketAddressZ UnsignedNodeAnnouncement_get_addresses(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr);
42624 * List of addresses on which this node is reachable
42626 void UnsignedNodeAnnouncement_set_addresses(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKCVec_SocketAddressZ val);
42629 * Excess address data which was signed as a part of the message which we do not (yet) understand how
42632 * This is stored to ensure forward-compatibility as new address types are added to the lightning gossip protocol.
42634 * Returns a copy of the field.
42636 struct LDKCVec_u8Z UnsignedNodeAnnouncement_get_excess_address_data(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr);
42639 * Excess address data which was signed as a part of the message which we do not (yet) understand how
42642 * This is stored to ensure forward-compatibility as new address types are added to the lightning gossip protocol.
42644 void UnsignedNodeAnnouncement_set_excess_address_data(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val);
42647 * Excess data which was signed as a part of the message which we do not (yet) understand how
42650 * This is stored to ensure forward-compatibility as new fields are added to the lightning gossip protocol.
42652 * Returns a copy of the field.
42654 struct LDKCVec_u8Z UnsignedNodeAnnouncement_get_excess_data(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr);
42657 * Excess data which was signed as a part of the message which we do not (yet) understand how
42660 * This is stored to ensure forward-compatibility as new fields are added to the lightning gossip protocol.
42662 void UnsignedNodeAnnouncement_set_excess_data(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val);
42665 * Constructs a new UnsignedNodeAnnouncement given each field
42667 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);
42670 * Creates a copy of the UnsignedNodeAnnouncement
42672 struct LDKUnsignedNodeAnnouncement UnsignedNodeAnnouncement_clone(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR orig);
42675 * Generates a non-cryptographic 64-bit hash of the UnsignedNodeAnnouncement.
42677 uint64_t UnsignedNodeAnnouncement_hash(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR o);
42680 * Checks if two UnsignedNodeAnnouncements contain equal inner contents.
42681 * This ignores pointers and is_owned flags and looks at the values in fields.
42682 * Two objects with NULL inner values will be considered "equal" here.
42684 bool UnsignedNodeAnnouncement_eq(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR a, const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR b);
42687 * Frees any resources used by the NodeAnnouncement, if is_owned is set and inner is non-NULL.
42689 void NodeAnnouncement_free(struct LDKNodeAnnouncement this_obj);
42692 * The signature by the node key
42694 struct LDKECDSASignature NodeAnnouncement_get_signature(const struct LDKNodeAnnouncement *NONNULL_PTR this_ptr);
42697 * The signature by the node key
42699 void NodeAnnouncement_set_signature(struct LDKNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKECDSASignature val);
42702 * The actual content of the announcement
42704 struct LDKUnsignedNodeAnnouncement NodeAnnouncement_get_contents(const struct LDKNodeAnnouncement *NONNULL_PTR this_ptr);
42707 * The actual content of the announcement
42709 void NodeAnnouncement_set_contents(struct LDKNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKUnsignedNodeAnnouncement val);
42712 * Constructs a new NodeAnnouncement given each field
42714 MUST_USE_RES struct LDKNodeAnnouncement NodeAnnouncement_new(struct LDKECDSASignature signature_arg, struct LDKUnsignedNodeAnnouncement contents_arg);
42717 * Creates a copy of the NodeAnnouncement
42719 struct LDKNodeAnnouncement NodeAnnouncement_clone(const struct LDKNodeAnnouncement *NONNULL_PTR orig);
42722 * Generates a non-cryptographic 64-bit hash of the NodeAnnouncement.
42724 uint64_t NodeAnnouncement_hash(const struct LDKNodeAnnouncement *NONNULL_PTR o);
42727 * Checks if two NodeAnnouncements contain equal inner contents.
42728 * This ignores pointers and is_owned flags and looks at the values in fields.
42729 * Two objects with NULL inner values will be considered "equal" here.
42731 bool NodeAnnouncement_eq(const struct LDKNodeAnnouncement *NONNULL_PTR a, const struct LDKNodeAnnouncement *NONNULL_PTR b);
42734 * Frees any resources used by the UnsignedChannelAnnouncement, if is_owned is set and inner is non-NULL.
42736 void UnsignedChannelAnnouncement_free(struct LDKUnsignedChannelAnnouncement this_obj);
42739 * The advertised channel features
42741 struct LDKChannelFeatures UnsignedChannelAnnouncement_get_features(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
42744 * The advertised channel features
42746 void UnsignedChannelAnnouncement_set_features(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKChannelFeatures val);
42749 * The genesis hash of the blockchain where the channel is to be opened
42751 const uint8_t (*UnsignedChannelAnnouncement_get_chain_hash(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr))[32];
42754 * The genesis hash of the blockchain where the channel is to be opened
42756 void UnsignedChannelAnnouncement_set_chain_hash(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
42759 * The short channel ID
42761 uint64_t UnsignedChannelAnnouncement_get_short_channel_id(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
42764 * The short channel ID
42766 void UnsignedChannelAnnouncement_set_short_channel_id(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, uint64_t val);
42769 * One of the two `node_id`s which are endpoints of this channel
42771 struct LDKNodeId UnsignedChannelAnnouncement_get_node_id_1(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
42774 * One of the two `node_id`s which are endpoints of this channel
42776 void UnsignedChannelAnnouncement_set_node_id_1(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKNodeId val);
42779 * The other of the two `node_id`s which are endpoints of this channel
42781 struct LDKNodeId UnsignedChannelAnnouncement_get_node_id_2(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
42784 * The other of the two `node_id`s which are endpoints of this channel
42786 void UnsignedChannelAnnouncement_set_node_id_2(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKNodeId val);
42789 * The funding key for the first node
42791 struct LDKNodeId UnsignedChannelAnnouncement_get_bitcoin_key_1(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
42794 * The funding key for the first node
42796 void UnsignedChannelAnnouncement_set_bitcoin_key_1(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKNodeId val);
42799 * The funding key for the second node
42801 struct LDKNodeId UnsignedChannelAnnouncement_get_bitcoin_key_2(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
42804 * The funding key for the second node
42806 void UnsignedChannelAnnouncement_set_bitcoin_key_2(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKNodeId val);
42809 * Excess data which was signed as a part of the message which we do not (yet) understand how
42812 * This is stored to ensure forward-compatibility as new fields are added to the lightning gossip protocol.
42814 * Returns a copy of the field.
42816 struct LDKCVec_u8Z UnsignedChannelAnnouncement_get_excess_data(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
42819 * Excess data which was signed as a part of the message which we do not (yet) understand how
42822 * This is stored to ensure forward-compatibility as new fields are added to the lightning gossip protocol.
42824 void UnsignedChannelAnnouncement_set_excess_data(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val);
42827 * Constructs a new UnsignedChannelAnnouncement given each field
42829 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);
42832 * Creates a copy of the UnsignedChannelAnnouncement
42834 struct LDKUnsignedChannelAnnouncement UnsignedChannelAnnouncement_clone(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR orig);
42837 * Generates a non-cryptographic 64-bit hash of the UnsignedChannelAnnouncement.
42839 uint64_t UnsignedChannelAnnouncement_hash(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR o);
42842 * Checks if two UnsignedChannelAnnouncements contain equal inner contents.
42843 * This ignores pointers and is_owned flags and looks at the values in fields.
42844 * Two objects with NULL inner values will be considered "equal" here.
42846 bool UnsignedChannelAnnouncement_eq(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR a, const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR b);
42849 * Frees any resources used by the ChannelAnnouncement, if is_owned is set and inner is non-NULL.
42851 void ChannelAnnouncement_free(struct LDKChannelAnnouncement this_obj);
42854 * Authentication of the announcement by the first public node
42856 struct LDKECDSASignature ChannelAnnouncement_get_node_signature_1(const struct LDKChannelAnnouncement *NONNULL_PTR this_ptr);
42859 * Authentication of the announcement by the first public node
42861 void ChannelAnnouncement_set_node_signature_1(struct LDKChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKECDSASignature val);
42864 * Authentication of the announcement by the second public node
42866 struct LDKECDSASignature ChannelAnnouncement_get_node_signature_2(const struct LDKChannelAnnouncement *NONNULL_PTR this_ptr);
42869 * Authentication of the announcement by the second public node
42871 void ChannelAnnouncement_set_node_signature_2(struct LDKChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKECDSASignature val);
42874 * Proof of funding UTXO ownership by the first public node
42876 struct LDKECDSASignature ChannelAnnouncement_get_bitcoin_signature_1(const struct LDKChannelAnnouncement *NONNULL_PTR this_ptr);
42879 * Proof of funding UTXO ownership by the first public node
42881 void ChannelAnnouncement_set_bitcoin_signature_1(struct LDKChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKECDSASignature val);
42884 * Proof of funding UTXO ownership by the second public node
42886 struct LDKECDSASignature ChannelAnnouncement_get_bitcoin_signature_2(const struct LDKChannelAnnouncement *NONNULL_PTR this_ptr);
42889 * Proof of funding UTXO ownership by the second public node
42891 void ChannelAnnouncement_set_bitcoin_signature_2(struct LDKChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKECDSASignature val);
42894 * The actual announcement
42896 struct LDKUnsignedChannelAnnouncement ChannelAnnouncement_get_contents(const struct LDKChannelAnnouncement *NONNULL_PTR this_ptr);
42899 * The actual announcement
42901 void ChannelAnnouncement_set_contents(struct LDKChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKUnsignedChannelAnnouncement val);
42904 * Constructs a new ChannelAnnouncement given each field
42906 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);
42909 * Creates a copy of the ChannelAnnouncement
42911 struct LDKChannelAnnouncement ChannelAnnouncement_clone(const struct LDKChannelAnnouncement *NONNULL_PTR orig);
42914 * Generates a non-cryptographic 64-bit hash of the ChannelAnnouncement.
42916 uint64_t ChannelAnnouncement_hash(const struct LDKChannelAnnouncement *NONNULL_PTR o);
42919 * Checks if two ChannelAnnouncements contain equal inner contents.
42920 * This ignores pointers and is_owned flags and looks at the values in fields.
42921 * Two objects with NULL inner values will be considered "equal" here.
42923 bool ChannelAnnouncement_eq(const struct LDKChannelAnnouncement *NONNULL_PTR a, const struct LDKChannelAnnouncement *NONNULL_PTR b);
42926 * Frees any resources used by the UnsignedChannelUpdate, if is_owned is set and inner is non-NULL.
42928 void UnsignedChannelUpdate_free(struct LDKUnsignedChannelUpdate this_obj);
42931 * The genesis hash of the blockchain where the channel is to be opened
42933 const uint8_t (*UnsignedChannelUpdate_get_chain_hash(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr))[32];
42936 * The genesis hash of the blockchain where the channel is to be opened
42938 void UnsignedChannelUpdate_set_chain_hash(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
42941 * The short channel ID
42943 uint64_t UnsignedChannelUpdate_get_short_channel_id(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
42946 * The short channel ID
42948 void UnsignedChannelUpdate_set_short_channel_id(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint64_t val);
42951 * A strictly monotonic announcement counter, with gaps allowed, specific to this channel
42953 uint32_t UnsignedChannelUpdate_get_timestamp(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
42956 * A strictly monotonic announcement counter, with gaps allowed, specific to this channel
42958 void UnsignedChannelUpdate_set_timestamp(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint32_t val);
42963 uint8_t UnsignedChannelUpdate_get_flags(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
42968 void UnsignedChannelUpdate_set_flags(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint8_t val);
42971 * The number of blocks such that if:
42972 * `incoming_htlc.cltv_expiry < outgoing_htlc.cltv_expiry + cltv_expiry_delta`
42973 * then we need to fail the HTLC backwards. When forwarding an HTLC, `cltv_expiry_delta` determines
42974 * the outgoing HTLC's minimum `cltv_expiry` value -- so, if an incoming HTLC comes in with a
42975 * `cltv_expiry` of 100000, and the node we're forwarding to has a `cltv_expiry_delta` value of 10,
42976 * then we'll check that the outgoing HTLC's `cltv_expiry` value is at least 100010 before
42977 * forwarding. Note that the HTLC sender is the one who originally sets this value when
42978 * constructing the route.
42980 uint16_t UnsignedChannelUpdate_get_cltv_expiry_delta(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
42983 * The number of blocks such that if:
42984 * `incoming_htlc.cltv_expiry < outgoing_htlc.cltv_expiry + cltv_expiry_delta`
42985 * then we need to fail the HTLC backwards. When forwarding an HTLC, `cltv_expiry_delta` determines
42986 * the outgoing HTLC's minimum `cltv_expiry` value -- so, if an incoming HTLC comes in with a
42987 * `cltv_expiry` of 100000, and the node we're forwarding to has a `cltv_expiry_delta` value of 10,
42988 * then we'll check that the outgoing HTLC's `cltv_expiry` value is at least 100010 before
42989 * forwarding. Note that the HTLC sender is the one who originally sets this value when
42990 * constructing the route.
42992 void UnsignedChannelUpdate_set_cltv_expiry_delta(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint16_t val);
42995 * The minimum HTLC size incoming to sender, in milli-satoshi
42997 uint64_t UnsignedChannelUpdate_get_htlc_minimum_msat(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
43000 * The minimum HTLC size incoming to sender, in milli-satoshi
43002 void UnsignedChannelUpdate_set_htlc_minimum_msat(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint64_t val);
43005 * The maximum HTLC value incoming to sender, in milli-satoshi.
43007 * This used to be optional.
43009 uint64_t UnsignedChannelUpdate_get_htlc_maximum_msat(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
43012 * The maximum HTLC value incoming to sender, in milli-satoshi.
43014 * This used to be optional.
43016 void UnsignedChannelUpdate_set_htlc_maximum_msat(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint64_t val);
43019 * The base HTLC fee charged by sender, in milli-satoshi
43021 uint32_t UnsignedChannelUpdate_get_fee_base_msat(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
43024 * The base HTLC fee charged by sender, in milli-satoshi
43026 void UnsignedChannelUpdate_set_fee_base_msat(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint32_t val);
43029 * The amount to fee multiplier, in micro-satoshi
43031 uint32_t UnsignedChannelUpdate_get_fee_proportional_millionths(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
43034 * The amount to fee multiplier, in micro-satoshi
43036 void UnsignedChannelUpdate_set_fee_proportional_millionths(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint32_t val);
43039 * Excess data which was signed as a part of the message which we do not (yet) understand how
43042 * This is stored to ensure forward-compatibility as new fields are added to the lightning gossip protocol.
43044 * Returns a copy of the field.
43046 struct LDKCVec_u8Z UnsignedChannelUpdate_get_excess_data(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
43049 * Excess data which was signed as a part of the message which we do not (yet) understand how
43052 * This is stored to ensure forward-compatibility as new fields are added to the lightning gossip protocol.
43054 void UnsignedChannelUpdate_set_excess_data(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val);
43057 * Constructs a new UnsignedChannelUpdate given each field
43059 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);
43062 * Creates a copy of the UnsignedChannelUpdate
43064 struct LDKUnsignedChannelUpdate UnsignedChannelUpdate_clone(const struct LDKUnsignedChannelUpdate *NONNULL_PTR orig);
43067 * Generates a non-cryptographic 64-bit hash of the UnsignedChannelUpdate.
43069 uint64_t UnsignedChannelUpdate_hash(const struct LDKUnsignedChannelUpdate *NONNULL_PTR o);
43072 * Checks if two UnsignedChannelUpdates contain equal inner contents.
43073 * This ignores pointers and is_owned flags and looks at the values in fields.
43074 * Two objects with NULL inner values will be considered "equal" here.
43076 bool UnsignedChannelUpdate_eq(const struct LDKUnsignedChannelUpdate *NONNULL_PTR a, const struct LDKUnsignedChannelUpdate *NONNULL_PTR b);
43079 * Frees any resources used by the ChannelUpdate, if is_owned is set and inner is non-NULL.
43081 void ChannelUpdate_free(struct LDKChannelUpdate this_obj);
43084 * A signature of the channel update
43086 struct LDKECDSASignature ChannelUpdate_get_signature(const struct LDKChannelUpdate *NONNULL_PTR this_ptr);
43089 * A signature of the channel update
43091 void ChannelUpdate_set_signature(struct LDKChannelUpdate *NONNULL_PTR this_ptr, struct LDKECDSASignature val);
43094 * The actual channel update
43096 struct LDKUnsignedChannelUpdate ChannelUpdate_get_contents(const struct LDKChannelUpdate *NONNULL_PTR this_ptr);
43099 * The actual channel update
43101 void ChannelUpdate_set_contents(struct LDKChannelUpdate *NONNULL_PTR this_ptr, struct LDKUnsignedChannelUpdate val);
43104 * Constructs a new ChannelUpdate given each field
43106 MUST_USE_RES struct LDKChannelUpdate ChannelUpdate_new(struct LDKECDSASignature signature_arg, struct LDKUnsignedChannelUpdate contents_arg);
43109 * Creates a copy of the ChannelUpdate
43111 struct LDKChannelUpdate ChannelUpdate_clone(const struct LDKChannelUpdate *NONNULL_PTR orig);
43114 * Generates a non-cryptographic 64-bit hash of the ChannelUpdate.
43116 uint64_t ChannelUpdate_hash(const struct LDKChannelUpdate *NONNULL_PTR o);
43119 * Checks if two ChannelUpdates contain equal inner contents.
43120 * This ignores pointers and is_owned flags and looks at the values in fields.
43121 * Two objects with NULL inner values will be considered "equal" here.
43123 bool ChannelUpdate_eq(const struct LDKChannelUpdate *NONNULL_PTR a, const struct LDKChannelUpdate *NONNULL_PTR b);
43126 * Frees any resources used by the QueryChannelRange, if is_owned is set and inner is non-NULL.
43128 void QueryChannelRange_free(struct LDKQueryChannelRange this_obj);
43131 * The genesis hash of the blockchain being queried
43133 const uint8_t (*QueryChannelRange_get_chain_hash(const struct LDKQueryChannelRange *NONNULL_PTR this_ptr))[32];
43136 * The genesis hash of the blockchain being queried
43138 void QueryChannelRange_set_chain_hash(struct LDKQueryChannelRange *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
43141 * The height of the first block for the channel UTXOs being queried
43143 uint32_t QueryChannelRange_get_first_blocknum(const struct LDKQueryChannelRange *NONNULL_PTR this_ptr);
43146 * The height of the first block for the channel UTXOs being queried
43148 void QueryChannelRange_set_first_blocknum(struct LDKQueryChannelRange *NONNULL_PTR this_ptr, uint32_t val);
43151 * The number of blocks to include in the query results
43153 uint32_t QueryChannelRange_get_number_of_blocks(const struct LDKQueryChannelRange *NONNULL_PTR this_ptr);
43156 * The number of blocks to include in the query results
43158 void QueryChannelRange_set_number_of_blocks(struct LDKQueryChannelRange *NONNULL_PTR this_ptr, uint32_t val);
43161 * Constructs a new QueryChannelRange given each field
43163 MUST_USE_RES struct LDKQueryChannelRange QueryChannelRange_new(struct LDKThirtyTwoBytes chain_hash_arg, uint32_t first_blocknum_arg, uint32_t number_of_blocks_arg);
43166 * Creates a copy of the QueryChannelRange
43168 struct LDKQueryChannelRange QueryChannelRange_clone(const struct LDKQueryChannelRange *NONNULL_PTR orig);
43171 * Generates a non-cryptographic 64-bit hash of the QueryChannelRange.
43173 uint64_t QueryChannelRange_hash(const struct LDKQueryChannelRange *NONNULL_PTR o);
43176 * Checks if two QueryChannelRanges contain equal inner contents.
43177 * This ignores pointers and is_owned flags and looks at the values in fields.
43178 * Two objects with NULL inner values will be considered "equal" here.
43180 bool QueryChannelRange_eq(const struct LDKQueryChannelRange *NONNULL_PTR a, const struct LDKQueryChannelRange *NONNULL_PTR b);
43183 * Frees any resources used by the ReplyChannelRange, if is_owned is set and inner is non-NULL.
43185 void ReplyChannelRange_free(struct LDKReplyChannelRange this_obj);
43188 * The genesis hash of the blockchain being queried
43190 const uint8_t (*ReplyChannelRange_get_chain_hash(const struct LDKReplyChannelRange *NONNULL_PTR this_ptr))[32];
43193 * The genesis hash of the blockchain being queried
43195 void ReplyChannelRange_set_chain_hash(struct LDKReplyChannelRange *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
43198 * The height of the first block in the range of the reply
43200 uint32_t ReplyChannelRange_get_first_blocknum(const struct LDKReplyChannelRange *NONNULL_PTR this_ptr);
43203 * The height of the first block in the range of the reply
43205 void ReplyChannelRange_set_first_blocknum(struct LDKReplyChannelRange *NONNULL_PTR this_ptr, uint32_t val);
43208 * The number of blocks included in the range of the reply
43210 uint32_t ReplyChannelRange_get_number_of_blocks(const struct LDKReplyChannelRange *NONNULL_PTR this_ptr);
43213 * The number of blocks included in the range of the reply
43215 void ReplyChannelRange_set_number_of_blocks(struct LDKReplyChannelRange *NONNULL_PTR this_ptr, uint32_t val);
43218 * True when this is the final reply for a query
43220 bool ReplyChannelRange_get_sync_complete(const struct LDKReplyChannelRange *NONNULL_PTR this_ptr);
43223 * True when this is the final reply for a query
43225 void ReplyChannelRange_set_sync_complete(struct LDKReplyChannelRange *NONNULL_PTR this_ptr, bool val);
43228 * The `short_channel_id`s in the channel range
43230 * Returns a copy of the field.
43232 struct LDKCVec_u64Z ReplyChannelRange_get_short_channel_ids(const struct LDKReplyChannelRange *NONNULL_PTR this_ptr);
43235 * The `short_channel_id`s in the channel range
43237 void ReplyChannelRange_set_short_channel_ids(struct LDKReplyChannelRange *NONNULL_PTR this_ptr, struct LDKCVec_u64Z val);
43240 * Constructs a new ReplyChannelRange given each field
43242 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);
43245 * Creates a copy of the ReplyChannelRange
43247 struct LDKReplyChannelRange ReplyChannelRange_clone(const struct LDKReplyChannelRange *NONNULL_PTR orig);
43250 * Generates a non-cryptographic 64-bit hash of the ReplyChannelRange.
43252 uint64_t ReplyChannelRange_hash(const struct LDKReplyChannelRange *NONNULL_PTR o);
43255 * Checks if two ReplyChannelRanges contain equal inner contents.
43256 * This ignores pointers and is_owned flags and looks at the values in fields.
43257 * Two objects with NULL inner values will be considered "equal" here.
43259 bool ReplyChannelRange_eq(const struct LDKReplyChannelRange *NONNULL_PTR a, const struct LDKReplyChannelRange *NONNULL_PTR b);
43262 * Frees any resources used by the QueryShortChannelIds, if is_owned is set and inner is non-NULL.
43264 void QueryShortChannelIds_free(struct LDKQueryShortChannelIds this_obj);
43267 * The genesis hash of the blockchain being queried
43269 const uint8_t (*QueryShortChannelIds_get_chain_hash(const struct LDKQueryShortChannelIds *NONNULL_PTR this_ptr))[32];
43272 * The genesis hash of the blockchain being queried
43274 void QueryShortChannelIds_set_chain_hash(struct LDKQueryShortChannelIds *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
43277 * The short_channel_ids that are being queried
43279 * Returns a copy of the field.
43281 struct LDKCVec_u64Z QueryShortChannelIds_get_short_channel_ids(const struct LDKQueryShortChannelIds *NONNULL_PTR this_ptr);
43284 * The short_channel_ids that are being queried
43286 void QueryShortChannelIds_set_short_channel_ids(struct LDKQueryShortChannelIds *NONNULL_PTR this_ptr, struct LDKCVec_u64Z val);
43289 * Constructs a new QueryShortChannelIds given each field
43291 MUST_USE_RES struct LDKQueryShortChannelIds QueryShortChannelIds_new(struct LDKThirtyTwoBytes chain_hash_arg, struct LDKCVec_u64Z short_channel_ids_arg);
43294 * Creates a copy of the QueryShortChannelIds
43296 struct LDKQueryShortChannelIds QueryShortChannelIds_clone(const struct LDKQueryShortChannelIds *NONNULL_PTR orig);
43299 * Generates a non-cryptographic 64-bit hash of the QueryShortChannelIds.
43301 uint64_t QueryShortChannelIds_hash(const struct LDKQueryShortChannelIds *NONNULL_PTR o);
43304 * Checks if two QueryShortChannelIdss contain equal inner contents.
43305 * This ignores pointers and is_owned flags and looks at the values in fields.
43306 * Two objects with NULL inner values will be considered "equal" here.
43308 bool QueryShortChannelIds_eq(const struct LDKQueryShortChannelIds *NONNULL_PTR a, const struct LDKQueryShortChannelIds *NONNULL_PTR b);
43311 * Frees any resources used by the ReplyShortChannelIdsEnd, if is_owned is set and inner is non-NULL.
43313 void ReplyShortChannelIdsEnd_free(struct LDKReplyShortChannelIdsEnd this_obj);
43316 * The genesis hash of the blockchain that was queried
43318 const uint8_t (*ReplyShortChannelIdsEnd_get_chain_hash(const struct LDKReplyShortChannelIdsEnd *NONNULL_PTR this_ptr))[32];
43321 * The genesis hash of the blockchain that was queried
43323 void ReplyShortChannelIdsEnd_set_chain_hash(struct LDKReplyShortChannelIdsEnd *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
43326 * Indicates if the query recipient maintains up-to-date channel
43327 * information for the `chain_hash`
43329 bool ReplyShortChannelIdsEnd_get_full_information(const struct LDKReplyShortChannelIdsEnd *NONNULL_PTR this_ptr);
43332 * Indicates if the query recipient maintains up-to-date channel
43333 * information for the `chain_hash`
43335 void ReplyShortChannelIdsEnd_set_full_information(struct LDKReplyShortChannelIdsEnd *NONNULL_PTR this_ptr, bool val);
43338 * Constructs a new ReplyShortChannelIdsEnd given each field
43340 MUST_USE_RES struct LDKReplyShortChannelIdsEnd ReplyShortChannelIdsEnd_new(struct LDKThirtyTwoBytes chain_hash_arg, bool full_information_arg);
43343 * Creates a copy of the ReplyShortChannelIdsEnd
43345 struct LDKReplyShortChannelIdsEnd ReplyShortChannelIdsEnd_clone(const struct LDKReplyShortChannelIdsEnd *NONNULL_PTR orig);
43348 * Generates a non-cryptographic 64-bit hash of the ReplyShortChannelIdsEnd.
43350 uint64_t ReplyShortChannelIdsEnd_hash(const struct LDKReplyShortChannelIdsEnd *NONNULL_PTR o);
43353 * Checks if two ReplyShortChannelIdsEnds contain equal inner contents.
43354 * This ignores pointers and is_owned flags and looks at the values in fields.
43355 * Two objects with NULL inner values will be considered "equal" here.
43357 bool ReplyShortChannelIdsEnd_eq(const struct LDKReplyShortChannelIdsEnd *NONNULL_PTR a, const struct LDKReplyShortChannelIdsEnd *NONNULL_PTR b);
43360 * Frees any resources used by the GossipTimestampFilter, if is_owned is set and inner is non-NULL.
43362 void GossipTimestampFilter_free(struct LDKGossipTimestampFilter this_obj);
43365 * The genesis hash of the blockchain for channel and node information
43367 const uint8_t (*GossipTimestampFilter_get_chain_hash(const struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr))[32];
43370 * The genesis hash of the blockchain for channel and node information
43372 void GossipTimestampFilter_set_chain_hash(struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
43375 * The starting unix timestamp
43377 uint32_t GossipTimestampFilter_get_first_timestamp(const struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr);
43380 * The starting unix timestamp
43382 void GossipTimestampFilter_set_first_timestamp(struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr, uint32_t val);
43385 * The range of information in seconds
43387 uint32_t GossipTimestampFilter_get_timestamp_range(const struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr);
43390 * The range of information in seconds
43392 void GossipTimestampFilter_set_timestamp_range(struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr, uint32_t val);
43395 * Constructs a new GossipTimestampFilter given each field
43397 MUST_USE_RES struct LDKGossipTimestampFilter GossipTimestampFilter_new(struct LDKThirtyTwoBytes chain_hash_arg, uint32_t first_timestamp_arg, uint32_t timestamp_range_arg);
43400 * Creates a copy of the GossipTimestampFilter
43402 struct LDKGossipTimestampFilter GossipTimestampFilter_clone(const struct LDKGossipTimestampFilter *NONNULL_PTR orig);
43405 * Generates a non-cryptographic 64-bit hash of the GossipTimestampFilter.
43407 uint64_t GossipTimestampFilter_hash(const struct LDKGossipTimestampFilter *NONNULL_PTR o);
43410 * Checks if two GossipTimestampFilters contain equal inner contents.
43411 * This ignores pointers and is_owned flags and looks at the values in fields.
43412 * Two objects with NULL inner values will be considered "equal" here.
43414 bool GossipTimestampFilter_eq(const struct LDKGossipTimestampFilter *NONNULL_PTR a, const struct LDKGossipTimestampFilter *NONNULL_PTR b);
43417 * Frees any resources used by the ErrorAction
43419 void ErrorAction_free(struct LDKErrorAction this_ptr);
43422 * Creates a copy of the ErrorAction
43424 struct LDKErrorAction ErrorAction_clone(const struct LDKErrorAction *NONNULL_PTR orig);
43427 * Utility method to constructs a new DisconnectPeer-variant ErrorAction
43429 struct LDKErrorAction ErrorAction_disconnect_peer(struct LDKErrorMessage msg);
43432 * Utility method to constructs a new DisconnectPeerWithWarning-variant ErrorAction
43434 struct LDKErrorAction ErrorAction_disconnect_peer_with_warning(struct LDKWarningMessage msg);
43437 * Utility method to constructs a new IgnoreError-variant ErrorAction
43439 struct LDKErrorAction ErrorAction_ignore_error(void);
43442 * Utility method to constructs a new IgnoreAndLog-variant ErrorAction
43444 struct LDKErrorAction ErrorAction_ignore_and_log(enum LDKLevel a);
43447 * Utility method to constructs a new IgnoreDuplicateGossip-variant ErrorAction
43449 struct LDKErrorAction ErrorAction_ignore_duplicate_gossip(void);
43452 * Utility method to constructs a new SendErrorMessage-variant ErrorAction
43454 struct LDKErrorAction ErrorAction_send_error_message(struct LDKErrorMessage msg);
43457 * Utility method to constructs a new SendWarningMessage-variant ErrorAction
43459 struct LDKErrorAction ErrorAction_send_warning_message(struct LDKWarningMessage msg, enum LDKLevel log_level);
43462 * Generates a non-cryptographic 64-bit hash of the ErrorAction.
43464 uint64_t ErrorAction_hash(const struct LDKErrorAction *NONNULL_PTR o);
43467 * Frees any resources used by the LightningError, if is_owned is set and inner is non-NULL.
43469 void LightningError_free(struct LDKLightningError this_obj);
43472 * A human-readable message describing the error
43474 struct LDKStr LightningError_get_err(const struct LDKLightningError *NONNULL_PTR this_ptr);
43477 * A human-readable message describing the error
43479 void LightningError_set_err(struct LDKLightningError *NONNULL_PTR this_ptr, struct LDKStr val);
43482 * The action which should be taken against the offending peer.
43484 struct LDKErrorAction LightningError_get_action(const struct LDKLightningError *NONNULL_PTR this_ptr);
43487 * The action which should be taken against the offending peer.
43489 void LightningError_set_action(struct LDKLightningError *NONNULL_PTR this_ptr, struct LDKErrorAction val);
43492 * Constructs a new LightningError given each field
43494 MUST_USE_RES struct LDKLightningError LightningError_new(struct LDKStr err_arg, struct LDKErrorAction action_arg);
43497 * Creates a copy of the LightningError
43499 struct LDKLightningError LightningError_clone(const struct LDKLightningError *NONNULL_PTR orig);
43502 * Frees any resources used by the CommitmentUpdate, if is_owned is set and inner is non-NULL.
43504 void CommitmentUpdate_free(struct LDKCommitmentUpdate this_obj);
43507 * `update_add_htlc` messages which should be sent
43509 struct LDKCVec_UpdateAddHTLCZ CommitmentUpdate_get_update_add_htlcs(const struct LDKCommitmentUpdate *NONNULL_PTR this_ptr);
43512 * `update_add_htlc` messages which should be sent
43514 void CommitmentUpdate_set_update_add_htlcs(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKCVec_UpdateAddHTLCZ val);
43517 * `update_fulfill_htlc` messages which should be sent
43519 struct LDKCVec_UpdateFulfillHTLCZ CommitmentUpdate_get_update_fulfill_htlcs(const struct LDKCommitmentUpdate *NONNULL_PTR this_ptr);
43522 * `update_fulfill_htlc` messages which should be sent
43524 void CommitmentUpdate_set_update_fulfill_htlcs(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKCVec_UpdateFulfillHTLCZ val);
43527 * `update_fail_htlc` messages which should be sent
43529 struct LDKCVec_UpdateFailHTLCZ CommitmentUpdate_get_update_fail_htlcs(const struct LDKCommitmentUpdate *NONNULL_PTR this_ptr);
43532 * `update_fail_htlc` messages which should be sent
43534 void CommitmentUpdate_set_update_fail_htlcs(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKCVec_UpdateFailHTLCZ val);
43537 * `update_fail_malformed_htlc` messages which should be sent
43539 struct LDKCVec_UpdateFailMalformedHTLCZ CommitmentUpdate_get_update_fail_malformed_htlcs(const struct LDKCommitmentUpdate *NONNULL_PTR this_ptr);
43542 * `update_fail_malformed_htlc` messages which should be sent
43544 void CommitmentUpdate_set_update_fail_malformed_htlcs(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKCVec_UpdateFailMalformedHTLCZ val);
43547 * An `update_fee` message which should be sent
43549 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
43551 struct LDKUpdateFee CommitmentUpdate_get_update_fee(const struct LDKCommitmentUpdate *NONNULL_PTR this_ptr);
43554 * An `update_fee` message which should be sent
43556 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
43558 void CommitmentUpdate_set_update_fee(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKUpdateFee val);
43561 * A `commitment_signed` message which should be sent
43563 struct LDKCommitmentSigned CommitmentUpdate_get_commitment_signed(const struct LDKCommitmentUpdate *NONNULL_PTR this_ptr);
43566 * A `commitment_signed` message which should be sent
43568 void CommitmentUpdate_set_commitment_signed(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKCommitmentSigned val);
43571 * Constructs a new CommitmentUpdate given each field
43573 * Note that update_fee_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
43575 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);
43578 * Creates a copy of the CommitmentUpdate
43580 struct LDKCommitmentUpdate CommitmentUpdate_clone(const struct LDKCommitmentUpdate *NONNULL_PTR orig);
43583 * Generates a non-cryptographic 64-bit hash of the CommitmentUpdate.
43585 uint64_t CommitmentUpdate_hash(const struct LDKCommitmentUpdate *NONNULL_PTR o);
43588 * Checks if two CommitmentUpdates contain equal inner contents.
43589 * This ignores pointers and is_owned flags and looks at the values in fields.
43590 * Two objects with NULL inner values will be considered "equal" here.
43592 bool CommitmentUpdate_eq(const struct LDKCommitmentUpdate *NONNULL_PTR a, const struct LDKCommitmentUpdate *NONNULL_PTR b);
43595 * Calls the free function if one is set
43597 void ChannelMessageHandler_free(struct LDKChannelMessageHandler this_ptr);
43600 * Calls the free function if one is set
43602 void RoutingMessageHandler_free(struct LDKRoutingMessageHandler this_ptr);
43605 * Calls the free function if one is set
43607 void OnionMessageHandler_free(struct LDKOnionMessageHandler this_ptr);
43610 * Frees any resources used by the FinalOnionHopData, if is_owned is set and inner is non-NULL.
43612 void FinalOnionHopData_free(struct LDKFinalOnionHopData this_obj);
43615 * When sending a multi-part payment, this secret is used to identify a payment across HTLCs.
43616 * Because it is generated by the recipient and included in the invoice, it also provides
43617 * proof to the recipient that the payment was sent by someone with the generated invoice.
43619 const uint8_t (*FinalOnionHopData_get_payment_secret(const struct LDKFinalOnionHopData *NONNULL_PTR this_ptr))[32];
43622 * When sending a multi-part payment, this secret is used to identify a payment across HTLCs.
43623 * Because it is generated by the recipient and included in the invoice, it also provides
43624 * proof to the recipient that the payment was sent by someone with the generated invoice.
43626 void FinalOnionHopData_set_payment_secret(struct LDKFinalOnionHopData *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
43629 * The intended total amount that this payment is for.
43631 * Message serialization may panic if this value is more than 21 million Bitcoin.
43633 uint64_t FinalOnionHopData_get_total_msat(const struct LDKFinalOnionHopData *NONNULL_PTR this_ptr);
43636 * The intended total amount that this payment is for.
43638 * Message serialization may panic if this value is more than 21 million Bitcoin.
43640 void FinalOnionHopData_set_total_msat(struct LDKFinalOnionHopData *NONNULL_PTR this_ptr, uint64_t val);
43643 * Constructs a new FinalOnionHopData given each field
43645 MUST_USE_RES struct LDKFinalOnionHopData FinalOnionHopData_new(struct LDKThirtyTwoBytes payment_secret_arg, uint64_t total_msat_arg);
43648 * Creates a copy of the FinalOnionHopData
43650 struct LDKFinalOnionHopData FinalOnionHopData_clone(const struct LDKFinalOnionHopData *NONNULL_PTR orig);
43653 * Frees any resources used by the OnionPacket, if is_owned is set and inner is non-NULL.
43655 void OnionPacket_free(struct LDKOnionPacket this_obj);
43658 * BOLT 4 version number.
43660 uint8_t OnionPacket_get_version(const struct LDKOnionPacket *NONNULL_PTR this_ptr);
43663 * BOLT 4 version number.
43665 void OnionPacket_set_version(struct LDKOnionPacket *NONNULL_PTR this_ptr, uint8_t val);
43668 * In order to ensure we always return an error on onion decode in compliance with [BOLT
43669 * #4](https://github.com/lightning/bolts/blob/master/04-onion-routing.md), we have to
43670 * deserialize `OnionPacket`s contained in [`UpdateAddHTLC`] messages even if the ephemeral
43671 * public key (here) is bogus, so we hold a [`Result`] instead of a [`PublicKey`] as we'd
43674 * Returns a copy of the field.
43676 struct LDKCResult_PublicKeySecp256k1ErrorZ OnionPacket_get_public_key(const struct LDKOnionPacket *NONNULL_PTR this_ptr);
43679 * In order to ensure we always return an error on onion decode in compliance with [BOLT
43680 * #4](https://github.com/lightning/bolts/blob/master/04-onion-routing.md), we have to
43681 * deserialize `OnionPacket`s contained in [`UpdateAddHTLC`] messages even if the ephemeral
43682 * public key (here) is bogus, so we hold a [`Result`] instead of a [`PublicKey`] as we'd
43685 void OnionPacket_set_public_key(struct LDKOnionPacket *NONNULL_PTR this_ptr, struct LDKCResult_PublicKeySecp256k1ErrorZ val);
43688 * HMAC to verify the integrity of hop_data.
43690 const uint8_t (*OnionPacket_get_hmac(const struct LDKOnionPacket *NONNULL_PTR this_ptr))[32];
43693 * HMAC to verify the integrity of hop_data.
43695 void OnionPacket_set_hmac(struct LDKOnionPacket *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
43698 * Creates a copy of the OnionPacket
43700 struct LDKOnionPacket OnionPacket_clone(const struct LDKOnionPacket *NONNULL_PTR orig);
43703 * Generates a non-cryptographic 64-bit hash of the OnionPacket.
43705 uint64_t OnionPacket_hash(const struct LDKOnionPacket *NONNULL_PTR o);
43708 * Checks if two OnionPackets contain equal inner contents.
43709 * This ignores pointers and is_owned flags and looks at the values in fields.
43710 * Two objects with NULL inner values will be considered "equal" here.
43712 bool OnionPacket_eq(const struct LDKOnionPacket *NONNULL_PTR a, const struct LDKOnionPacket *NONNULL_PTR b);
43715 * Frees any resources used by the TrampolineOnionPacket, if is_owned is set and inner is non-NULL.
43717 void TrampolineOnionPacket_free(struct LDKTrampolineOnionPacket this_obj);
43720 * Bolt 04 version number
43722 uint8_t TrampolineOnionPacket_get_version(const struct LDKTrampolineOnionPacket *NONNULL_PTR this_ptr);
43725 * Bolt 04 version number
43727 void TrampolineOnionPacket_set_version(struct LDKTrampolineOnionPacket *NONNULL_PTR this_ptr, uint8_t val);
43730 * A random sepc256k1 point, used to build the ECDH shared secret to decrypt hop_data
43732 struct LDKPublicKey TrampolineOnionPacket_get_public_key(const struct LDKTrampolineOnionPacket *NONNULL_PTR this_ptr);
43735 * A random sepc256k1 point, used to build the ECDH shared secret to decrypt hop_data
43737 void TrampolineOnionPacket_set_public_key(struct LDKTrampolineOnionPacket *NONNULL_PTR this_ptr, struct LDKPublicKey val);
43740 * Encrypted payload for the next hop
43742 * Returns a copy of the field.
43744 struct LDKCVec_u8Z TrampolineOnionPacket_get_hop_data(const struct LDKTrampolineOnionPacket *NONNULL_PTR this_ptr);
43747 * Encrypted payload for the next hop
43749 void TrampolineOnionPacket_set_hop_data(struct LDKTrampolineOnionPacket *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val);
43752 * HMAC to verify the integrity of hop_data
43754 const uint8_t (*TrampolineOnionPacket_get_hmac(const struct LDKTrampolineOnionPacket *NONNULL_PTR this_ptr))[32];
43757 * HMAC to verify the integrity of hop_data
43759 void TrampolineOnionPacket_set_hmac(struct LDKTrampolineOnionPacket *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
43762 * Constructs a new TrampolineOnionPacket given each field
43764 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);
43767 * Creates a copy of the TrampolineOnionPacket
43769 struct LDKTrampolineOnionPacket TrampolineOnionPacket_clone(const struct LDKTrampolineOnionPacket *NONNULL_PTR orig);
43772 * Generates a non-cryptographic 64-bit hash of the TrampolineOnionPacket.
43774 uint64_t TrampolineOnionPacket_hash(const struct LDKTrampolineOnionPacket *NONNULL_PTR o);
43777 * Checks if two TrampolineOnionPackets contain equal inner contents.
43778 * This ignores pointers and is_owned flags and looks at the values in fields.
43779 * Two objects with NULL inner values will be considered "equal" here.
43781 bool TrampolineOnionPacket_eq(const struct LDKTrampolineOnionPacket *NONNULL_PTR a, const struct LDKTrampolineOnionPacket *NONNULL_PTR b);
43784 * Serialize the TrampolineOnionPacket object into a byte array which can be read by TrampolineOnionPacket_read
43786 struct LDKCVec_u8Z TrampolineOnionPacket_write(const struct LDKTrampolineOnionPacket *NONNULL_PTR obj);
43789 * Get the string representation of a DecodeError object
43791 struct LDKStr DecodeError_to_str(const struct LDKDecodeError *NONNULL_PTR o);
43794 * Serialize the AcceptChannel object into a byte array which can be read by AcceptChannel_read
43796 struct LDKCVec_u8Z AcceptChannel_write(const struct LDKAcceptChannel *NONNULL_PTR obj);
43799 * Read a AcceptChannel from a byte array, created by AcceptChannel_write
43801 struct LDKCResult_AcceptChannelDecodeErrorZ AcceptChannel_read(struct LDKu8slice ser);
43804 * Serialize the AcceptChannelV2 object into a byte array which can be read by AcceptChannelV2_read
43806 struct LDKCVec_u8Z AcceptChannelV2_write(const struct LDKAcceptChannelV2 *NONNULL_PTR obj);
43809 * Read a AcceptChannelV2 from a byte array, created by AcceptChannelV2_write
43811 struct LDKCResult_AcceptChannelV2DecodeErrorZ AcceptChannelV2_read(struct LDKu8slice ser);
43814 * Serialize the Stfu object into a byte array which can be read by Stfu_read
43816 struct LDKCVec_u8Z Stfu_write(const struct LDKStfu *NONNULL_PTR obj);
43819 * Read a Stfu from a byte array, created by Stfu_write
43821 struct LDKCResult_StfuDecodeErrorZ Stfu_read(struct LDKu8slice ser);
43824 * Serialize the Splice object into a byte array which can be read by Splice_read
43826 struct LDKCVec_u8Z Splice_write(const struct LDKSplice *NONNULL_PTR obj);
43829 * Read a Splice from a byte array, created by Splice_write
43831 struct LDKCResult_SpliceDecodeErrorZ Splice_read(struct LDKu8slice ser);
43834 * Serialize the SpliceAck object into a byte array which can be read by SpliceAck_read
43836 struct LDKCVec_u8Z SpliceAck_write(const struct LDKSpliceAck *NONNULL_PTR obj);
43839 * Read a SpliceAck from a byte array, created by SpliceAck_write
43841 struct LDKCResult_SpliceAckDecodeErrorZ SpliceAck_read(struct LDKu8slice ser);
43844 * Serialize the SpliceLocked object into a byte array which can be read by SpliceLocked_read
43846 struct LDKCVec_u8Z SpliceLocked_write(const struct LDKSpliceLocked *NONNULL_PTR obj);
43849 * Read a SpliceLocked from a byte array, created by SpliceLocked_write
43851 struct LDKCResult_SpliceLockedDecodeErrorZ SpliceLocked_read(struct LDKu8slice ser);
43854 * Serialize the TxAddInput object into a byte array which can be read by TxAddInput_read
43856 struct LDKCVec_u8Z TxAddInput_write(const struct LDKTxAddInput *NONNULL_PTR obj);
43859 * Read a TxAddInput from a byte array, created by TxAddInput_write
43861 struct LDKCResult_TxAddInputDecodeErrorZ TxAddInput_read(struct LDKu8slice ser);
43864 * Serialize the TxAddOutput object into a byte array which can be read by TxAddOutput_read
43866 struct LDKCVec_u8Z TxAddOutput_write(const struct LDKTxAddOutput *NONNULL_PTR obj);
43869 * Read a TxAddOutput from a byte array, created by TxAddOutput_write
43871 struct LDKCResult_TxAddOutputDecodeErrorZ TxAddOutput_read(struct LDKu8slice ser);
43874 * Serialize the TxRemoveInput object into a byte array which can be read by TxRemoveInput_read
43876 struct LDKCVec_u8Z TxRemoveInput_write(const struct LDKTxRemoveInput *NONNULL_PTR obj);
43879 * Read a TxRemoveInput from a byte array, created by TxRemoveInput_write
43881 struct LDKCResult_TxRemoveInputDecodeErrorZ TxRemoveInput_read(struct LDKu8slice ser);
43884 * Serialize the TxRemoveOutput object into a byte array which can be read by TxRemoveOutput_read
43886 struct LDKCVec_u8Z TxRemoveOutput_write(const struct LDKTxRemoveOutput *NONNULL_PTR obj);
43889 * Read a TxRemoveOutput from a byte array, created by TxRemoveOutput_write
43891 struct LDKCResult_TxRemoveOutputDecodeErrorZ TxRemoveOutput_read(struct LDKu8slice ser);
43894 * Serialize the TxComplete object into a byte array which can be read by TxComplete_read
43896 struct LDKCVec_u8Z TxComplete_write(const struct LDKTxComplete *NONNULL_PTR obj);
43899 * Read a TxComplete from a byte array, created by TxComplete_write
43901 struct LDKCResult_TxCompleteDecodeErrorZ TxComplete_read(struct LDKu8slice ser);
43904 * Serialize the TxSignatures object into a byte array which can be read by TxSignatures_read
43906 struct LDKCVec_u8Z TxSignatures_write(const struct LDKTxSignatures *NONNULL_PTR obj);
43909 * Read a TxSignatures from a byte array, created by TxSignatures_write
43911 struct LDKCResult_TxSignaturesDecodeErrorZ TxSignatures_read(struct LDKu8slice ser);
43914 * Serialize the TxInitRbf object into a byte array which can be read by TxInitRbf_read
43916 struct LDKCVec_u8Z TxInitRbf_write(const struct LDKTxInitRbf *NONNULL_PTR obj);
43919 * Read a TxInitRbf from a byte array, created by TxInitRbf_write
43921 struct LDKCResult_TxInitRbfDecodeErrorZ TxInitRbf_read(struct LDKu8slice ser);
43924 * Serialize the TxAckRbf object into a byte array which can be read by TxAckRbf_read
43926 struct LDKCVec_u8Z TxAckRbf_write(const struct LDKTxAckRbf *NONNULL_PTR obj);
43929 * Read a TxAckRbf from a byte array, created by TxAckRbf_write
43931 struct LDKCResult_TxAckRbfDecodeErrorZ TxAckRbf_read(struct LDKu8slice ser);
43934 * Serialize the TxAbort object into a byte array which can be read by TxAbort_read
43936 struct LDKCVec_u8Z TxAbort_write(const struct LDKTxAbort *NONNULL_PTR obj);
43939 * Read a TxAbort from a byte array, created by TxAbort_write
43941 struct LDKCResult_TxAbortDecodeErrorZ TxAbort_read(struct LDKu8slice ser);
43944 * Serialize the AnnouncementSignatures object into a byte array which can be read by AnnouncementSignatures_read
43946 struct LDKCVec_u8Z AnnouncementSignatures_write(const struct LDKAnnouncementSignatures *NONNULL_PTR obj);
43949 * Read a AnnouncementSignatures from a byte array, created by AnnouncementSignatures_write
43951 struct LDKCResult_AnnouncementSignaturesDecodeErrorZ AnnouncementSignatures_read(struct LDKu8slice ser);
43954 * Serialize the ChannelReestablish object into a byte array which can be read by ChannelReestablish_read
43956 struct LDKCVec_u8Z ChannelReestablish_write(const struct LDKChannelReestablish *NONNULL_PTR obj);
43959 * Read a ChannelReestablish from a byte array, created by ChannelReestablish_write
43961 struct LDKCResult_ChannelReestablishDecodeErrorZ ChannelReestablish_read(struct LDKu8slice ser);
43964 * Serialize the ClosingSigned object into a byte array which can be read by ClosingSigned_read
43966 struct LDKCVec_u8Z ClosingSigned_write(const struct LDKClosingSigned *NONNULL_PTR obj);
43969 * Read a ClosingSigned from a byte array, created by ClosingSigned_write
43971 struct LDKCResult_ClosingSignedDecodeErrorZ ClosingSigned_read(struct LDKu8slice ser);
43974 * Serialize the ClosingSignedFeeRange object into a byte array which can be read by ClosingSignedFeeRange_read
43976 struct LDKCVec_u8Z ClosingSignedFeeRange_write(const struct LDKClosingSignedFeeRange *NONNULL_PTR obj);
43979 * Read a ClosingSignedFeeRange from a byte array, created by ClosingSignedFeeRange_write
43981 struct LDKCResult_ClosingSignedFeeRangeDecodeErrorZ ClosingSignedFeeRange_read(struct LDKu8slice ser);
43984 * Serialize the CommitmentSigned object into a byte array which can be read by CommitmentSigned_read
43986 struct LDKCVec_u8Z CommitmentSigned_write(const struct LDKCommitmentSigned *NONNULL_PTR obj);
43989 * Read a CommitmentSigned from a byte array, created by CommitmentSigned_write
43991 struct LDKCResult_CommitmentSignedDecodeErrorZ CommitmentSigned_read(struct LDKu8slice ser);
43994 * Serialize the FundingCreated object into a byte array which can be read by FundingCreated_read
43996 struct LDKCVec_u8Z FundingCreated_write(const struct LDKFundingCreated *NONNULL_PTR obj);
43999 * Read a FundingCreated from a byte array, created by FundingCreated_write
44001 struct LDKCResult_FundingCreatedDecodeErrorZ FundingCreated_read(struct LDKu8slice ser);
44004 * Serialize the FundingSigned object into a byte array which can be read by FundingSigned_read
44006 struct LDKCVec_u8Z FundingSigned_write(const struct LDKFundingSigned *NONNULL_PTR obj);
44009 * Read a FundingSigned from a byte array, created by FundingSigned_write
44011 struct LDKCResult_FundingSignedDecodeErrorZ FundingSigned_read(struct LDKu8slice ser);
44014 * Serialize the ChannelReady object into a byte array which can be read by ChannelReady_read
44016 struct LDKCVec_u8Z ChannelReady_write(const struct LDKChannelReady *NONNULL_PTR obj);
44019 * Read a ChannelReady from a byte array, created by ChannelReady_write
44021 struct LDKCResult_ChannelReadyDecodeErrorZ ChannelReady_read(struct LDKu8slice ser);
44024 * Serialize the Init object into a byte array which can be read by Init_read
44026 struct LDKCVec_u8Z Init_write(const struct LDKInit *NONNULL_PTR obj);
44029 * Read a Init from a byte array, created by Init_write
44031 struct LDKCResult_InitDecodeErrorZ Init_read(struct LDKu8slice ser);
44034 * Serialize the OpenChannel object into a byte array which can be read by OpenChannel_read
44036 struct LDKCVec_u8Z OpenChannel_write(const struct LDKOpenChannel *NONNULL_PTR obj);
44039 * Read a OpenChannel from a byte array, created by OpenChannel_write
44041 struct LDKCResult_OpenChannelDecodeErrorZ OpenChannel_read(struct LDKu8slice ser);
44044 * Serialize the OpenChannelV2 object into a byte array which can be read by OpenChannelV2_read
44046 struct LDKCVec_u8Z OpenChannelV2_write(const struct LDKOpenChannelV2 *NONNULL_PTR obj);
44049 * Read a OpenChannelV2 from a byte array, created by OpenChannelV2_write
44051 struct LDKCResult_OpenChannelV2DecodeErrorZ OpenChannelV2_read(struct LDKu8slice ser);
44054 * Serialize the RevokeAndACK object into a byte array which can be read by RevokeAndACK_read
44056 struct LDKCVec_u8Z RevokeAndACK_write(const struct LDKRevokeAndACK *NONNULL_PTR obj);
44059 * Read a RevokeAndACK from a byte array, created by RevokeAndACK_write
44061 struct LDKCResult_RevokeAndACKDecodeErrorZ RevokeAndACK_read(struct LDKu8slice ser);
44064 * Serialize the Shutdown object into a byte array which can be read by Shutdown_read
44066 struct LDKCVec_u8Z Shutdown_write(const struct LDKShutdown *NONNULL_PTR obj);
44069 * Read a Shutdown from a byte array, created by Shutdown_write
44071 struct LDKCResult_ShutdownDecodeErrorZ Shutdown_read(struct LDKu8slice ser);
44074 * Serialize the UpdateFailHTLC object into a byte array which can be read by UpdateFailHTLC_read
44076 struct LDKCVec_u8Z UpdateFailHTLC_write(const struct LDKUpdateFailHTLC *NONNULL_PTR obj);
44079 * Read a UpdateFailHTLC from a byte array, created by UpdateFailHTLC_write
44081 struct LDKCResult_UpdateFailHTLCDecodeErrorZ UpdateFailHTLC_read(struct LDKu8slice ser);
44084 * Serialize the UpdateFailMalformedHTLC object into a byte array which can be read by UpdateFailMalformedHTLC_read
44086 struct LDKCVec_u8Z UpdateFailMalformedHTLC_write(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR obj);
44089 * Read a UpdateFailMalformedHTLC from a byte array, created by UpdateFailMalformedHTLC_write
44091 struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ UpdateFailMalformedHTLC_read(struct LDKu8slice ser);
44094 * Serialize the UpdateFee object into a byte array which can be read by UpdateFee_read
44096 struct LDKCVec_u8Z UpdateFee_write(const struct LDKUpdateFee *NONNULL_PTR obj);
44099 * Read a UpdateFee from a byte array, created by UpdateFee_write
44101 struct LDKCResult_UpdateFeeDecodeErrorZ UpdateFee_read(struct LDKu8slice ser);
44104 * Serialize the UpdateFulfillHTLC object into a byte array which can be read by UpdateFulfillHTLC_read
44106 struct LDKCVec_u8Z UpdateFulfillHTLC_write(const struct LDKUpdateFulfillHTLC *NONNULL_PTR obj);
44109 * Read a UpdateFulfillHTLC from a byte array, created by UpdateFulfillHTLC_write
44111 struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ UpdateFulfillHTLC_read(struct LDKu8slice ser);
44114 * Serialize the OnionPacket object into a byte array which can be read by OnionPacket_read
44116 struct LDKCVec_u8Z OnionPacket_write(const struct LDKOnionPacket *NONNULL_PTR obj);
44119 * Read a OnionPacket from a byte array, created by OnionPacket_write
44121 struct LDKCResult_OnionPacketDecodeErrorZ OnionPacket_read(struct LDKu8slice ser);
44124 * Serialize the UpdateAddHTLC object into a byte array which can be read by UpdateAddHTLC_read
44126 struct LDKCVec_u8Z UpdateAddHTLC_write(const struct LDKUpdateAddHTLC *NONNULL_PTR obj);
44129 * Read a UpdateAddHTLC from a byte array, created by UpdateAddHTLC_write
44131 struct LDKCResult_UpdateAddHTLCDecodeErrorZ UpdateAddHTLC_read(struct LDKu8slice ser);
44134 * Read a OnionMessage from a byte array, created by OnionMessage_write
44136 struct LDKCResult_OnionMessageDecodeErrorZ OnionMessage_read(struct LDKu8slice ser);
44139 * Serialize the OnionMessage object into a byte array which can be read by OnionMessage_read
44141 struct LDKCVec_u8Z OnionMessage_write(const struct LDKOnionMessage *NONNULL_PTR obj);
44144 * Serialize the FinalOnionHopData object into a byte array which can be read by FinalOnionHopData_read
44146 struct LDKCVec_u8Z FinalOnionHopData_write(const struct LDKFinalOnionHopData *NONNULL_PTR obj);
44149 * Read a FinalOnionHopData from a byte array, created by FinalOnionHopData_write
44151 struct LDKCResult_FinalOnionHopDataDecodeErrorZ FinalOnionHopData_read(struct LDKu8slice ser);
44154 * Serialize the Ping object into a byte array which can be read by Ping_read
44156 struct LDKCVec_u8Z Ping_write(const struct LDKPing *NONNULL_PTR obj);
44159 * Read a Ping from a byte array, created by Ping_write
44161 struct LDKCResult_PingDecodeErrorZ Ping_read(struct LDKu8slice ser);
44164 * Serialize the Pong object into a byte array which can be read by Pong_read
44166 struct LDKCVec_u8Z Pong_write(const struct LDKPong *NONNULL_PTR obj);
44169 * Read a Pong from a byte array, created by Pong_write
44171 struct LDKCResult_PongDecodeErrorZ Pong_read(struct LDKu8slice ser);
44174 * Serialize the UnsignedChannelAnnouncement object into a byte array which can be read by UnsignedChannelAnnouncement_read
44176 struct LDKCVec_u8Z UnsignedChannelAnnouncement_write(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR obj);
44179 * Read a UnsignedChannelAnnouncement from a byte array, created by UnsignedChannelAnnouncement_write
44181 struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ UnsignedChannelAnnouncement_read(struct LDKu8slice ser);
44184 * Serialize the ChannelAnnouncement object into a byte array which can be read by ChannelAnnouncement_read
44186 struct LDKCVec_u8Z ChannelAnnouncement_write(const struct LDKChannelAnnouncement *NONNULL_PTR obj);
44189 * Read a ChannelAnnouncement from a byte array, created by ChannelAnnouncement_write
44191 struct LDKCResult_ChannelAnnouncementDecodeErrorZ ChannelAnnouncement_read(struct LDKu8slice ser);
44194 * Serialize the UnsignedChannelUpdate object into a byte array which can be read by UnsignedChannelUpdate_read
44196 struct LDKCVec_u8Z UnsignedChannelUpdate_write(const struct LDKUnsignedChannelUpdate *NONNULL_PTR obj);
44199 * Read a UnsignedChannelUpdate from a byte array, created by UnsignedChannelUpdate_write
44201 struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ UnsignedChannelUpdate_read(struct LDKu8slice ser);
44204 * Serialize the ChannelUpdate object into a byte array which can be read by ChannelUpdate_read
44206 struct LDKCVec_u8Z ChannelUpdate_write(const struct LDKChannelUpdate *NONNULL_PTR obj);
44209 * Read a ChannelUpdate from a byte array, created by ChannelUpdate_write
44211 struct LDKCResult_ChannelUpdateDecodeErrorZ ChannelUpdate_read(struct LDKu8slice ser);
44214 * Serialize the ErrorMessage object into a byte array which can be read by ErrorMessage_read
44216 struct LDKCVec_u8Z ErrorMessage_write(const struct LDKErrorMessage *NONNULL_PTR obj);
44219 * Read a ErrorMessage from a byte array, created by ErrorMessage_write
44221 struct LDKCResult_ErrorMessageDecodeErrorZ ErrorMessage_read(struct LDKu8slice ser);
44224 * Serialize the WarningMessage object into a byte array which can be read by WarningMessage_read
44226 struct LDKCVec_u8Z WarningMessage_write(const struct LDKWarningMessage *NONNULL_PTR obj);
44229 * Read a WarningMessage from a byte array, created by WarningMessage_write
44231 struct LDKCResult_WarningMessageDecodeErrorZ WarningMessage_read(struct LDKu8slice ser);
44234 * Serialize the UnsignedNodeAnnouncement object into a byte array which can be read by UnsignedNodeAnnouncement_read
44236 struct LDKCVec_u8Z UnsignedNodeAnnouncement_write(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR obj);
44239 * Read a UnsignedNodeAnnouncement from a byte array, created by UnsignedNodeAnnouncement_write
44241 struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ UnsignedNodeAnnouncement_read(struct LDKu8slice ser);
44244 * Serialize the NodeAnnouncement object into a byte array which can be read by NodeAnnouncement_read
44246 struct LDKCVec_u8Z NodeAnnouncement_write(const struct LDKNodeAnnouncement *NONNULL_PTR obj);
44249 * Read a NodeAnnouncement from a byte array, created by NodeAnnouncement_write
44251 struct LDKCResult_NodeAnnouncementDecodeErrorZ NodeAnnouncement_read(struct LDKu8slice ser);
44254 * Read a QueryShortChannelIds from a byte array, created by QueryShortChannelIds_write
44256 struct LDKCResult_QueryShortChannelIdsDecodeErrorZ QueryShortChannelIds_read(struct LDKu8slice ser);
44259 * Serialize the QueryShortChannelIds object into a byte array which can be read by QueryShortChannelIds_read
44261 struct LDKCVec_u8Z QueryShortChannelIds_write(const struct LDKQueryShortChannelIds *NONNULL_PTR obj);
44264 * Serialize the ReplyShortChannelIdsEnd object into a byte array which can be read by ReplyShortChannelIdsEnd_read
44266 struct LDKCVec_u8Z ReplyShortChannelIdsEnd_write(const struct LDKReplyShortChannelIdsEnd *NONNULL_PTR obj);
44269 * Read a ReplyShortChannelIdsEnd from a byte array, created by ReplyShortChannelIdsEnd_write
44271 struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ ReplyShortChannelIdsEnd_read(struct LDKu8slice ser);
44274 * Calculates the overflow safe ending block height for the query.
44276 * Overflow returns `0xffffffff`, otherwise returns `first_blocknum + number_of_blocks`.
44278 MUST_USE_RES uint32_t QueryChannelRange_end_blocknum(const struct LDKQueryChannelRange *NONNULL_PTR this_arg);
44281 * Serialize the QueryChannelRange object into a byte array which can be read by QueryChannelRange_read
44283 struct LDKCVec_u8Z QueryChannelRange_write(const struct LDKQueryChannelRange *NONNULL_PTR obj);
44286 * Read a QueryChannelRange from a byte array, created by QueryChannelRange_write
44288 struct LDKCResult_QueryChannelRangeDecodeErrorZ QueryChannelRange_read(struct LDKu8slice ser);
44291 * Read a ReplyChannelRange from a byte array, created by ReplyChannelRange_write
44293 struct LDKCResult_ReplyChannelRangeDecodeErrorZ ReplyChannelRange_read(struct LDKu8slice ser);
44296 * Serialize the ReplyChannelRange object into a byte array which can be read by ReplyChannelRange_read
44298 struct LDKCVec_u8Z ReplyChannelRange_write(const struct LDKReplyChannelRange *NONNULL_PTR obj);
44301 * Serialize the GossipTimestampFilter object into a byte array which can be read by GossipTimestampFilter_read
44303 struct LDKCVec_u8Z GossipTimestampFilter_write(const struct LDKGossipTimestampFilter *NONNULL_PTR obj);
44306 * Read a GossipTimestampFilter from a byte array, created by GossipTimestampFilter_write
44308 struct LDKCResult_GossipTimestampFilterDecodeErrorZ GossipTimestampFilter_read(struct LDKu8slice ser);
44311 * Calls the free function if one is set
44313 void CustomMessageHandler_free(struct LDKCustomMessageHandler this_ptr);
44316 * Frees any resources used by the IgnoringMessageHandler, if is_owned is set and inner is non-NULL.
44318 void IgnoringMessageHandler_free(struct LDKIgnoringMessageHandler this_obj);
44321 * Constructs a new IgnoringMessageHandler given each field
44323 MUST_USE_RES struct LDKIgnoringMessageHandler IgnoringMessageHandler_new(void);
44326 * Constructs a new EventsProvider which calls the relevant methods on this_arg.
44327 * This copies the `inner` pointer in this_arg and thus the returned EventsProvider must be freed before this_arg is
44329 struct LDKEventsProvider IgnoringMessageHandler_as_EventsProvider(const struct LDKIgnoringMessageHandler *NONNULL_PTR this_arg);
44332 * Constructs a new MessageSendEventsProvider which calls the relevant methods on this_arg.
44333 * This copies the `inner` pointer in this_arg and thus the returned MessageSendEventsProvider must be freed before this_arg is
44335 struct LDKMessageSendEventsProvider IgnoringMessageHandler_as_MessageSendEventsProvider(const struct LDKIgnoringMessageHandler *NONNULL_PTR this_arg);
44338 * Constructs a new RoutingMessageHandler which calls the relevant methods on this_arg.
44339 * This copies the `inner` pointer in this_arg and thus the returned RoutingMessageHandler must be freed before this_arg is
44341 struct LDKRoutingMessageHandler IgnoringMessageHandler_as_RoutingMessageHandler(const struct LDKIgnoringMessageHandler *NONNULL_PTR this_arg);
44344 * Constructs a new OnionMessageHandler which calls the relevant methods on this_arg.
44345 * This copies the `inner` pointer in this_arg and thus the returned OnionMessageHandler must be freed before this_arg is
44347 struct LDKOnionMessageHandler IgnoringMessageHandler_as_OnionMessageHandler(const struct LDKIgnoringMessageHandler *NONNULL_PTR this_arg);
44350 * Constructs a new OffersMessageHandler which calls the relevant methods on this_arg.
44351 * This copies the `inner` pointer in this_arg and thus the returned OffersMessageHandler must be freed before this_arg is
44353 struct LDKOffersMessageHandler IgnoringMessageHandler_as_OffersMessageHandler(const struct LDKIgnoringMessageHandler *NONNULL_PTR this_arg);
44356 * Constructs a new CustomOnionMessageHandler which calls the relevant methods on this_arg.
44357 * This copies the `inner` pointer in this_arg and thus the returned CustomOnionMessageHandler must be freed before this_arg is
44359 struct LDKCustomOnionMessageHandler IgnoringMessageHandler_as_CustomOnionMessageHandler(const struct LDKIgnoringMessageHandler *NONNULL_PTR this_arg);
44362 * Constructs a new CustomMessageReader which calls the relevant methods on this_arg.
44363 * This copies the `inner` pointer in this_arg and thus the returned CustomMessageReader must be freed before this_arg is
44365 struct LDKCustomMessageReader IgnoringMessageHandler_as_CustomMessageReader(const struct LDKIgnoringMessageHandler *NONNULL_PTR this_arg);
44368 * Constructs a new CustomMessageHandler which calls the relevant methods on this_arg.
44369 * This copies the `inner` pointer in this_arg and thus the returned CustomMessageHandler must be freed before this_arg is
44371 struct LDKCustomMessageHandler IgnoringMessageHandler_as_CustomMessageHandler(const struct LDKIgnoringMessageHandler *NONNULL_PTR this_arg);
44374 * Frees any resources used by the ErroringMessageHandler, if is_owned is set and inner is non-NULL.
44376 void ErroringMessageHandler_free(struct LDKErroringMessageHandler this_obj);
44379 * Constructs a new ErroringMessageHandler
44381 MUST_USE_RES struct LDKErroringMessageHandler ErroringMessageHandler_new(void);
44384 * Constructs a new MessageSendEventsProvider which calls the relevant methods on this_arg.
44385 * This copies the `inner` pointer in this_arg and thus the returned MessageSendEventsProvider must be freed before this_arg is
44387 struct LDKMessageSendEventsProvider ErroringMessageHandler_as_MessageSendEventsProvider(const struct LDKErroringMessageHandler *NONNULL_PTR this_arg);
44390 * Constructs a new ChannelMessageHandler which calls the relevant methods on this_arg.
44391 * This copies the `inner` pointer in this_arg and thus the returned ChannelMessageHandler must be freed before this_arg is
44393 struct LDKChannelMessageHandler ErroringMessageHandler_as_ChannelMessageHandler(const struct LDKErroringMessageHandler *NONNULL_PTR this_arg);
44396 * Frees any resources used by the MessageHandler, if is_owned is set and inner is non-NULL.
44398 void MessageHandler_free(struct LDKMessageHandler this_obj);
44401 * A message handler which handles messages specific to channels. Usually this is just a
44402 * [`ChannelManager`] object or an [`ErroringMessageHandler`].
44404 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
44406 const struct LDKChannelMessageHandler *MessageHandler_get_chan_handler(const struct LDKMessageHandler *NONNULL_PTR this_ptr);
44409 * A message handler which handles messages specific to channels. Usually this is just a
44410 * [`ChannelManager`] object or an [`ErroringMessageHandler`].
44412 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
44414 void MessageHandler_set_chan_handler(struct LDKMessageHandler *NONNULL_PTR this_ptr, struct LDKChannelMessageHandler val);
44417 * A message handler which handles messages updating our knowledge of the network channel
44418 * graph. Usually this is just a [`P2PGossipSync`] object or an [`IgnoringMessageHandler`].
44420 * [`P2PGossipSync`]: crate::routing::gossip::P2PGossipSync
44422 const struct LDKRoutingMessageHandler *MessageHandler_get_route_handler(const struct LDKMessageHandler *NONNULL_PTR this_ptr);
44425 * A message handler which handles messages updating our knowledge of the network channel
44426 * graph. Usually this is just a [`P2PGossipSync`] object or an [`IgnoringMessageHandler`].
44428 * [`P2PGossipSync`]: crate::routing::gossip::P2PGossipSync
44430 void MessageHandler_set_route_handler(struct LDKMessageHandler *NONNULL_PTR this_ptr, struct LDKRoutingMessageHandler val);
44433 * A message handler which handles onion messages. This should generally be an
44434 * [`OnionMessenger`], but can also be an [`IgnoringMessageHandler`].
44436 * [`OnionMessenger`]: crate::onion_message::messenger::OnionMessenger
44438 const struct LDKOnionMessageHandler *MessageHandler_get_onion_message_handler(const struct LDKMessageHandler *NONNULL_PTR this_ptr);
44441 * A message handler which handles onion messages. This should generally be an
44442 * [`OnionMessenger`], but can also be an [`IgnoringMessageHandler`].
44444 * [`OnionMessenger`]: crate::onion_message::messenger::OnionMessenger
44446 void MessageHandler_set_onion_message_handler(struct LDKMessageHandler *NONNULL_PTR this_ptr, struct LDKOnionMessageHandler val);
44449 * A message handler which handles custom messages. The only LDK-provided implementation is
44450 * [`IgnoringMessageHandler`].
44452 const struct LDKCustomMessageHandler *MessageHandler_get_custom_message_handler(const struct LDKMessageHandler *NONNULL_PTR this_ptr);
44455 * A message handler which handles custom messages. The only LDK-provided implementation is
44456 * [`IgnoringMessageHandler`].
44458 void MessageHandler_set_custom_message_handler(struct LDKMessageHandler *NONNULL_PTR this_ptr, struct LDKCustomMessageHandler val);
44461 * Constructs a new MessageHandler given each field
44463 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);
44466 * Creates a copy of a SocketDescriptor
44468 struct LDKSocketDescriptor SocketDescriptor_clone(const struct LDKSocketDescriptor *NONNULL_PTR orig);
44471 * Calls the free function if one is set
44473 void SocketDescriptor_free(struct LDKSocketDescriptor this_ptr);
44476 * Frees any resources used by the PeerDetails, if is_owned is set and inner is non-NULL.
44478 void PeerDetails_free(struct LDKPeerDetails this_obj);
44481 * The node id of the peer.
44483 * For outbound connections, this [`PublicKey`] will be the same as the `their_node_id` parameter
44484 * passed in to [`PeerManager::new_outbound_connection`].
44486 struct LDKPublicKey PeerDetails_get_counterparty_node_id(const struct LDKPeerDetails *NONNULL_PTR this_ptr);
44489 * The node id of the peer.
44491 * For outbound connections, this [`PublicKey`] will be the same as the `their_node_id` parameter
44492 * passed in to [`PeerManager::new_outbound_connection`].
44494 void PeerDetails_set_counterparty_node_id(struct LDKPeerDetails *NONNULL_PTR this_ptr, struct LDKPublicKey val);
44497 * The socket address the peer provided in the initial handshake.
44499 * Will only be `Some` if an address had been previously provided to
44500 * [`PeerManager::new_outbound_connection`] or [`PeerManager::new_inbound_connection`].
44502 * Returns a copy of the field.
44504 struct LDKCOption_SocketAddressZ PeerDetails_get_socket_address(const struct LDKPeerDetails *NONNULL_PTR this_ptr);
44507 * The socket address the peer provided in the initial handshake.
44509 * Will only be `Some` if an address had been previously provided to
44510 * [`PeerManager::new_outbound_connection`] or [`PeerManager::new_inbound_connection`].
44512 void PeerDetails_set_socket_address(struct LDKPeerDetails *NONNULL_PTR this_ptr, struct LDKCOption_SocketAddressZ val);
44515 * The features the peer provided in the initial handshake.
44517 struct LDKInitFeatures PeerDetails_get_init_features(const struct LDKPeerDetails *NONNULL_PTR this_ptr);
44520 * The features the peer provided in the initial handshake.
44522 void PeerDetails_set_init_features(struct LDKPeerDetails *NONNULL_PTR this_ptr, struct LDKInitFeatures val);
44525 * Indicates the direction of the peer connection.
44527 * Will be `true` for inbound connections, and `false` for outbound connections.
44529 bool PeerDetails_get_is_inbound_connection(const struct LDKPeerDetails *NONNULL_PTR this_ptr);
44532 * Indicates the direction of the peer connection.
44534 * Will be `true` for inbound connections, and `false` for outbound connections.
44536 void PeerDetails_set_is_inbound_connection(struct LDKPeerDetails *NONNULL_PTR this_ptr, bool val);
44539 * Constructs a new PeerDetails given each field
44541 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);
44544 * Frees any resources used by the PeerHandleError, if is_owned is set and inner is non-NULL.
44546 void PeerHandleError_free(struct LDKPeerHandleError this_obj);
44549 * Constructs a new PeerHandleError given each field
44551 MUST_USE_RES struct LDKPeerHandleError PeerHandleError_new(void);
44554 * Creates a copy of the PeerHandleError
44556 struct LDKPeerHandleError PeerHandleError_clone(const struct LDKPeerHandleError *NONNULL_PTR orig);
44559 * Get the string representation of a PeerHandleError object
44561 struct LDKStr PeerHandleError_to_str(const struct LDKPeerHandleError *NONNULL_PTR o);
44564 * Frees any resources used by the PeerManager, if is_owned is set and inner is non-NULL.
44566 void PeerManager_free(struct LDKPeerManager this_obj);
44569 * Constructs a new `PeerManager` with the given message handlers.
44571 * `ephemeral_random_data` is used to derive per-connection ephemeral keys and must be
44572 * cryptographically secure random bytes.
44574 * `current_time` is used as an always-increasing counter that survives across restarts and is
44575 * incremented irregularly internally. In general it is best to simply use the current UNIX
44576 * timestamp, however if it is not available a persistent counter that increases once per
44577 * minute should suffice.
44579 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);
44582 * Returns a list of [`PeerDetails`] for connected peers that have completed the initial
44585 MUST_USE_RES struct LDKCVec_PeerDetailsZ PeerManager_list_peers(const struct LDKPeerManager *NONNULL_PTR this_arg);
44588 * Returns the [`PeerDetails`] of a connected peer that has completed the initial handshake.
44590 * Will return `None` if the peer is unknown or it hasn't completed the initial handshake.
44592 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
44594 MUST_USE_RES struct LDKPeerDetails PeerManager_peer_by_node_id(const struct LDKPeerManager *NONNULL_PTR this_arg, struct LDKPublicKey their_node_id);
44597 * Indicates a new outbound connection has been established to a node with the given `node_id`
44598 * and an optional remote network address.
44600 * The remote network address adds the option to report a remote IP address back to a connecting
44601 * peer using the init message.
44602 * The user should pass the remote network address of the host they are connected to.
44604 * If an `Err` is returned here you must disconnect the connection immediately.
44606 * Returns a small number of bytes to send to the remote node (currently always 50).
44608 * Panics if descriptor is duplicative with some other descriptor which has not yet been
44609 * [`socket_disconnected`].
44611 * [`socket_disconnected`]: PeerManager::socket_disconnected
44613 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);
44616 * Indicates a new inbound connection has been established to a node with an optional remote
44619 * The remote network address adds the option to report a remote IP address back to a connecting
44620 * peer using the init message.
44621 * The user should pass the remote network address of the host they are connected to.
44623 * May refuse the connection by returning an Err, but will never write bytes to the remote end
44624 * (outbound connector always speaks first). If an `Err` is returned here you must disconnect
44625 * the connection immediately.
44627 * Panics if descriptor is duplicative with some other descriptor which has not yet been
44628 * [`socket_disconnected`].
44630 * [`socket_disconnected`]: PeerManager::socket_disconnected
44632 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);
44635 * Indicates that there is room to write data to the given socket descriptor.
44637 * May return an Err to indicate that the connection should be closed.
44639 * May call [`send_data`] on the descriptor passed in (or an equal descriptor) before
44640 * returning. Thus, be very careful with reentrancy issues! The invariants around calling
44641 * [`write_buffer_space_avail`] in case a write did not fully complete must still hold - be
44642 * ready to call [`write_buffer_space_avail`] again if a write call generated here isn't
44645 * [`send_data`]: SocketDescriptor::send_data
44646 * [`write_buffer_space_avail`]: PeerManager::write_buffer_space_avail
44648 MUST_USE_RES struct LDKCResult_NonePeerHandleErrorZ PeerManager_write_buffer_space_avail(const struct LDKPeerManager *NONNULL_PTR this_arg, struct LDKSocketDescriptor *NONNULL_PTR descriptor);
44651 * Indicates that data was read from the given socket descriptor.
44653 * May return an Err to indicate that the connection should be closed.
44655 * Will *not* call back into [`send_data`] on any descriptors to avoid reentrancy complexity.
44656 * Thus, however, you should call [`process_events`] after any `read_event` to generate
44657 * [`send_data`] calls to handle responses.
44659 * If `Ok(true)` is returned, further read_events should not be triggered until a
44660 * [`send_data`] call on this descriptor has `resume_read` set (preventing DoS issues in the
44663 * In order to avoid processing too many messages at once per peer, `data` should be on the
44666 * [`send_data`]: SocketDescriptor::send_data
44667 * [`process_events`]: PeerManager::process_events
44669 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);
44672 * Checks for any events generated by our handlers and processes them. Includes sending most
44673 * response messages as well as messages generated by calls to handler functions directly (eg
44674 * functions like [`ChannelManager::process_pending_htlc_forwards`] or [`send_payment`]).
44676 * May call [`send_data`] on [`SocketDescriptor`]s. Thus, be very careful with reentrancy
44679 * You don't have to call this function explicitly if you are using [`lightning-net-tokio`]
44680 * or one of the other clients provided in our language bindings.
44682 * Note that if there are any other calls to this function waiting on lock(s) this may return
44683 * without doing any work. All available events that need handling will be handled before the
44684 * other calls return.
44686 * [`send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
44687 * [`ChannelManager::process_pending_htlc_forwards`]: crate::ln::channelmanager::ChannelManager::process_pending_htlc_forwards
44688 * [`send_data`]: SocketDescriptor::send_data
44690 void PeerManager_process_events(const struct LDKPeerManager *NONNULL_PTR this_arg);
44693 * Indicates that the given socket descriptor's connection is now closed.
44695 void PeerManager_socket_disconnected(const struct LDKPeerManager *NONNULL_PTR this_arg, const struct LDKSocketDescriptor *NONNULL_PTR descriptor);
44698 * Disconnect a peer given its node id.
44700 * If a peer is connected, this will call [`disconnect_socket`] on the descriptor for the
44701 * peer. Thus, be very careful about reentrancy issues.
44703 * [`disconnect_socket`]: SocketDescriptor::disconnect_socket
44705 void PeerManager_disconnect_by_node_id(const struct LDKPeerManager *NONNULL_PTR this_arg, struct LDKPublicKey node_id);
44708 * Disconnects all currently-connected peers. This is useful on platforms where there may be
44709 * an indication that TCP sockets have stalled even if we weren't around to time them out
44710 * using regular ping/pongs.
44712 void PeerManager_disconnect_all_peers(const struct LDKPeerManager *NONNULL_PTR this_arg);
44715 * Send pings to each peer and disconnect those which did not respond to the last round of
44718 * This may be called on any timescale you want, however, roughly once every ten seconds is
44719 * preferred. The call rate determines both how often we send a ping to our peers and how much
44720 * time they have to respond before we disconnect them.
44722 * May call [`send_data`] on all [`SocketDescriptor`]s. Thus, be very careful with reentrancy
44725 * [`send_data`]: SocketDescriptor::send_data
44727 void PeerManager_timer_tick_occurred(const struct LDKPeerManager *NONNULL_PTR this_arg);
44730 * Generates a signed node_announcement from the given arguments, sending it to all connected
44731 * peers. Note that peers will likely ignore this message unless we have at least one public
44732 * channel which has at least six confirmations on-chain.
44734 * `rgb` is a node \"color\" and `alias` is a printable human-readable string to describe this
44735 * node to humans. They carry no in-protocol meaning.
44737 * `addresses` represent the set (possibly empty) of socket addresses on which this node
44738 * accepts incoming connections. These will be included in the node_announcement, publicly
44739 * tying these addresses together and to this node. If you wish to preserve user privacy,
44740 * addresses should likely contain only Tor Onion addresses.
44742 * Panics if `addresses` is absurdly large (more than 100).
44744 * [`get_and_clear_pending_msg_events`]: MessageSendEventsProvider::get_and_clear_pending_msg_events
44746 void PeerManager_broadcast_node_announcement(const struct LDKPeerManager *NONNULL_PTR this_arg, struct LDKThreeBytes rgb, struct LDKThirtyTwoBytes alias, struct LDKCVec_SocketAddressZ addresses);
44749 * Gets the weight for an HTLC-Success transaction.
44751 uint64_t htlc_success_tx_weight(const struct LDKChannelTypeFeatures *NONNULL_PTR channel_type_features);
44754 * Gets the weight for an HTLC-Timeout transaction.
44756 uint64_t htlc_timeout_tx_weight(const struct LDKChannelTypeFeatures *NONNULL_PTR channel_type_features);
44759 * Creates a copy of the HTLCClaim
44761 enum LDKHTLCClaim HTLCClaim_clone(const enum LDKHTLCClaim *NONNULL_PTR orig);
44764 * Utility method to constructs a new OfferedTimeout-variant HTLCClaim
44766 enum LDKHTLCClaim HTLCClaim_offered_timeout(void);
44769 * Utility method to constructs a new OfferedPreimage-variant HTLCClaim
44771 enum LDKHTLCClaim HTLCClaim_offered_preimage(void);
44774 * Utility method to constructs a new AcceptedTimeout-variant HTLCClaim
44776 enum LDKHTLCClaim HTLCClaim_accepted_timeout(void);
44779 * Utility method to constructs a new AcceptedPreimage-variant HTLCClaim
44781 enum LDKHTLCClaim HTLCClaim_accepted_preimage(void);
44784 * Utility method to constructs a new Revocation-variant HTLCClaim
44786 enum LDKHTLCClaim HTLCClaim_revocation(void);
44789 * Checks if two HTLCClaims contain equal inner contents.
44790 * This ignores pointers and is_owned flags and looks at the values in fields.
44792 bool HTLCClaim_eq(const enum LDKHTLCClaim *NONNULL_PTR a, const enum LDKHTLCClaim *NONNULL_PTR b);
44795 * Check if a given input witness attempts to claim a HTLC.
44797 MUST_USE_RES struct LDKCOption_HTLCClaimZ HTLCClaim_from_witness(struct LDKWitness witness);
44800 * Build the commitment secret from the seed and the commitment number
44802 struct LDKThirtyTwoBytes build_commitment_secret(const uint8_t (*commitment_seed)[32], uint64_t idx);
44805 * Build a closing transaction
44807 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);
44810 * Frees any resources used by the CounterpartyCommitmentSecrets, if is_owned is set and inner is non-NULL.
44812 void CounterpartyCommitmentSecrets_free(struct LDKCounterpartyCommitmentSecrets this_obj);
44815 * Creates a copy of the CounterpartyCommitmentSecrets
44817 struct LDKCounterpartyCommitmentSecrets CounterpartyCommitmentSecrets_clone(const struct LDKCounterpartyCommitmentSecrets *NONNULL_PTR orig);
44820 * Creates a new empty `CounterpartyCommitmentSecrets` structure.
44822 MUST_USE_RES struct LDKCounterpartyCommitmentSecrets CounterpartyCommitmentSecrets_new(void);
44825 * Returns the minimum index of all stored secrets. Note that indexes start
44826 * at 1 << 48 and get decremented by one for each new secret.
44828 MUST_USE_RES uint64_t CounterpartyCommitmentSecrets_get_min_seen_secret(const struct LDKCounterpartyCommitmentSecrets *NONNULL_PTR this_arg);
44831 * Inserts the `secret` at `idx`. Returns `Ok(())` if the secret
44832 * was generated in accordance with BOLT 3 and is consistent with previous secrets.
44834 MUST_USE_RES struct LDKCResult_NoneNoneZ CounterpartyCommitmentSecrets_provide_secret(struct LDKCounterpartyCommitmentSecrets *NONNULL_PTR this_arg, uint64_t idx, struct LDKThirtyTwoBytes secret);
44837 * Returns the secret at `idx`.
44838 * Returns `None` if `idx` is < [`CounterpartyCommitmentSecrets::get_min_seen_secret`].
44840 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
44842 MUST_USE_RES struct LDKThirtyTwoBytes CounterpartyCommitmentSecrets_get_secret(const struct LDKCounterpartyCommitmentSecrets *NONNULL_PTR this_arg, uint64_t idx);
44845 * Serialize the CounterpartyCommitmentSecrets object into a byte array which can be read by CounterpartyCommitmentSecrets_read
44847 struct LDKCVec_u8Z CounterpartyCommitmentSecrets_write(const struct LDKCounterpartyCommitmentSecrets *NONNULL_PTR obj);
44850 * Read a CounterpartyCommitmentSecrets from a byte array, created by CounterpartyCommitmentSecrets_write
44852 struct LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ CounterpartyCommitmentSecrets_read(struct LDKu8slice ser);
44855 * Derives a per-commitment-transaction private key (eg an htlc key or delayed_payment key)
44856 * from the base secret and the per_commitment_point.
44858 struct LDKSecretKey derive_private_key(struct LDKPublicKey per_commitment_point, const uint8_t (*base_secret)[32]);
44861 * Derives a per-commitment-transaction revocation key from its constituent parts.
44863 * Only the cheating participant owns a valid witness to propagate a revoked
44864 * commitment transaction, thus per_commitment_secret always come from cheater
44865 * and revocation_base_secret always come from punisher, which is the broadcaster
44866 * of the transaction spending with this key knowledge.
44868 struct LDKSecretKey derive_private_revocation_key(const uint8_t (*per_commitment_secret)[32], const uint8_t (*countersignatory_revocation_base_secret)[32]);
44871 * Frees any resources used by the TxCreationKeys, if is_owned is set and inner is non-NULL.
44873 void TxCreationKeys_free(struct LDKTxCreationKeys this_obj);
44876 * The broadcaster's per-commitment public key which was used to derive the other keys.
44878 struct LDKPublicKey TxCreationKeys_get_per_commitment_point(const struct LDKTxCreationKeys *NONNULL_PTR this_ptr);
44881 * The broadcaster's per-commitment public key which was used to derive the other keys.
44883 void TxCreationKeys_set_per_commitment_point(struct LDKTxCreationKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
44886 * The revocation key which is used to allow the broadcaster of the commitment
44887 * transaction to provide their counterparty the ability to punish them if they broadcast
44890 struct LDKRevocationKey TxCreationKeys_get_revocation_key(const struct LDKTxCreationKeys *NONNULL_PTR this_ptr);
44893 * The revocation key which is used to allow the broadcaster of the commitment
44894 * transaction to provide their counterparty the ability to punish them if they broadcast
44897 void TxCreationKeys_set_revocation_key(struct LDKTxCreationKeys *NONNULL_PTR this_ptr, struct LDKRevocationKey val);
44900 * Broadcaster's HTLC Key
44902 struct LDKHtlcKey TxCreationKeys_get_broadcaster_htlc_key(const struct LDKTxCreationKeys *NONNULL_PTR this_ptr);
44905 * Broadcaster's HTLC Key
44907 void TxCreationKeys_set_broadcaster_htlc_key(struct LDKTxCreationKeys *NONNULL_PTR this_ptr, struct LDKHtlcKey val);
44910 * Countersignatory's HTLC Key
44912 struct LDKHtlcKey TxCreationKeys_get_countersignatory_htlc_key(const struct LDKTxCreationKeys *NONNULL_PTR this_ptr);
44915 * Countersignatory's HTLC Key
44917 void TxCreationKeys_set_countersignatory_htlc_key(struct LDKTxCreationKeys *NONNULL_PTR this_ptr, struct LDKHtlcKey val);
44920 * Broadcaster's Payment Key (which isn't allowed to be spent from for some delay)
44922 struct LDKDelayedPaymentKey TxCreationKeys_get_broadcaster_delayed_payment_key(const struct LDKTxCreationKeys *NONNULL_PTR this_ptr);
44925 * Broadcaster's Payment Key (which isn't allowed to be spent from for some delay)
44927 void TxCreationKeys_set_broadcaster_delayed_payment_key(struct LDKTxCreationKeys *NONNULL_PTR this_ptr, struct LDKDelayedPaymentKey val);
44930 * Constructs a new TxCreationKeys given each field
44932 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);
44935 * Checks if two TxCreationKeyss contain equal inner contents.
44936 * This ignores pointers and is_owned flags and looks at the values in fields.
44937 * Two objects with NULL inner values will be considered "equal" here.
44939 bool TxCreationKeys_eq(const struct LDKTxCreationKeys *NONNULL_PTR a, const struct LDKTxCreationKeys *NONNULL_PTR b);
44942 * Creates a copy of the TxCreationKeys
44944 struct LDKTxCreationKeys TxCreationKeys_clone(const struct LDKTxCreationKeys *NONNULL_PTR orig);
44947 * Serialize the TxCreationKeys object into a byte array which can be read by TxCreationKeys_read
44949 struct LDKCVec_u8Z TxCreationKeys_write(const struct LDKTxCreationKeys *NONNULL_PTR obj);
44952 * Read a TxCreationKeys from a byte array, created by TxCreationKeys_write
44954 struct LDKCResult_TxCreationKeysDecodeErrorZ TxCreationKeys_read(struct LDKu8slice ser);
44957 * Frees any resources used by the ChannelPublicKeys, if is_owned is set and inner is non-NULL.
44959 void ChannelPublicKeys_free(struct LDKChannelPublicKeys this_obj);
44962 * The public key which is used to sign all commitment transactions, as it appears in the
44963 * on-chain channel lock-in 2-of-2 multisig output.
44965 struct LDKPublicKey ChannelPublicKeys_get_funding_pubkey(const struct LDKChannelPublicKeys *NONNULL_PTR this_ptr);
44968 * The public key which is used to sign all commitment transactions, as it appears in the
44969 * on-chain channel lock-in 2-of-2 multisig output.
44971 void ChannelPublicKeys_set_funding_pubkey(struct LDKChannelPublicKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
44974 * The base point which is used (with derive_public_revocation_key) to derive per-commitment
44975 * revocation keys. This is combined with the per-commitment-secret generated by the
44976 * counterparty to create a secret which the counterparty can reveal to revoke previous
44979 struct LDKRevocationBasepoint ChannelPublicKeys_get_revocation_basepoint(const struct LDKChannelPublicKeys *NONNULL_PTR this_ptr);
44982 * The base point which is used (with derive_public_revocation_key) to derive per-commitment
44983 * revocation keys. This is combined with the per-commitment-secret generated by the
44984 * counterparty to create a secret which the counterparty can reveal to revoke previous
44987 void ChannelPublicKeys_set_revocation_basepoint(struct LDKChannelPublicKeys *NONNULL_PTR this_ptr, struct LDKRevocationBasepoint val);
44990 * The public key on which the non-broadcaster (ie the countersignatory) receives an immediately
44991 * spendable primary channel balance on the broadcaster's commitment transaction. This key is
44992 * static across every commitment transaction.
44994 struct LDKPublicKey ChannelPublicKeys_get_payment_point(const struct LDKChannelPublicKeys *NONNULL_PTR this_ptr);
44997 * The public key on which the non-broadcaster (ie the countersignatory) receives an immediately
44998 * spendable primary channel balance on the broadcaster's commitment transaction. This key is
44999 * static across every commitment transaction.
45001 void ChannelPublicKeys_set_payment_point(struct LDKChannelPublicKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
45004 * The base point which is used (with derive_public_key) to derive a per-commitment payment
45005 * public key which receives non-HTLC-encumbered funds which are only available for spending
45006 * after some delay (or can be claimed via the revocation path).
45008 struct LDKDelayedPaymentBasepoint ChannelPublicKeys_get_delayed_payment_basepoint(const struct LDKChannelPublicKeys *NONNULL_PTR this_ptr);
45011 * The base point which is used (with derive_public_key) to derive a per-commitment payment
45012 * public key which receives non-HTLC-encumbered funds which are only available for spending
45013 * after some delay (or can be claimed via the revocation path).
45015 void ChannelPublicKeys_set_delayed_payment_basepoint(struct LDKChannelPublicKeys *NONNULL_PTR this_ptr, struct LDKDelayedPaymentBasepoint val);
45018 * The base point which is used (with derive_public_key) to derive a per-commitment public key
45019 * which is used to encumber HTLC-in-flight outputs.
45021 struct LDKHtlcBasepoint ChannelPublicKeys_get_htlc_basepoint(const struct LDKChannelPublicKeys *NONNULL_PTR this_ptr);
45024 * The base point which is used (with derive_public_key) to derive a per-commitment public key
45025 * which is used to encumber HTLC-in-flight outputs.
45027 void ChannelPublicKeys_set_htlc_basepoint(struct LDKChannelPublicKeys *NONNULL_PTR this_ptr, struct LDKHtlcBasepoint val);
45030 * Constructs a new ChannelPublicKeys given each field
45032 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);
45035 * Creates a copy of the ChannelPublicKeys
45037 struct LDKChannelPublicKeys ChannelPublicKeys_clone(const struct LDKChannelPublicKeys *NONNULL_PTR orig);
45040 * Generates a non-cryptographic 64-bit hash of the ChannelPublicKeys.
45042 uint64_t ChannelPublicKeys_hash(const struct LDKChannelPublicKeys *NONNULL_PTR o);
45045 * Checks if two ChannelPublicKeyss contain equal inner contents.
45046 * This ignores pointers and is_owned flags and looks at the values in fields.
45047 * Two objects with NULL inner values will be considered "equal" here.
45049 bool ChannelPublicKeys_eq(const struct LDKChannelPublicKeys *NONNULL_PTR a, const struct LDKChannelPublicKeys *NONNULL_PTR b);
45052 * Serialize the ChannelPublicKeys object into a byte array which can be read by ChannelPublicKeys_read
45054 struct LDKCVec_u8Z ChannelPublicKeys_write(const struct LDKChannelPublicKeys *NONNULL_PTR obj);
45057 * Read a ChannelPublicKeys from a byte array, created by ChannelPublicKeys_write
45059 struct LDKCResult_ChannelPublicKeysDecodeErrorZ ChannelPublicKeys_read(struct LDKu8slice ser);
45062 * Create per-state keys from channel base points and the per-commitment point.
45063 * Key set is asymmetric and can't be used as part of counter-signatory set of transactions.
45065 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);
45068 * Generate per-state keys from channel static keys.
45069 * Key set is asymmetric and can't be used as part of counter-signatory set of transactions.
45071 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);
45074 * A script either spendable by the revocation
45075 * key or the broadcaster_delayed_payment_key and satisfying the relative-locktime OP_CSV constrain.
45076 * Encumbering a `to_holder` output on a commitment transaction or 2nd-stage HTLC transactions.
45078 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);
45081 * Returns the script for the counterparty's output on a holder's commitment transaction based on
45082 * the channel type.
45084 struct LDKCVec_u8Z get_counterparty_payment_script(const struct LDKChannelTypeFeatures *NONNULL_PTR channel_type_features, struct LDKPublicKey payment_key);
45087 * Frees any resources used by the HTLCOutputInCommitment, if is_owned is set and inner is non-NULL.
45089 void HTLCOutputInCommitment_free(struct LDKHTLCOutputInCommitment this_obj);
45092 * Whether the HTLC was \"offered\" (ie outbound in relation to this commitment transaction).
45093 * Note that this is not the same as whether it is ountbound *from us*. To determine that you
45094 * need to compare this value to whether the commitment transaction in question is that of
45095 * the counterparty or our own.
45097 bool HTLCOutputInCommitment_get_offered(const struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr);
45100 * Whether the HTLC was \"offered\" (ie outbound in relation to this commitment transaction).
45101 * Note that this is not the same as whether it is ountbound *from us*. To determine that you
45102 * need to compare this value to whether the commitment transaction in question is that of
45103 * the counterparty or our own.
45105 void HTLCOutputInCommitment_set_offered(struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr, bool val);
45108 * The value, in msat, of the HTLC. The value as it appears in the commitment transaction is
45109 * this divided by 1000.
45111 uint64_t HTLCOutputInCommitment_get_amount_msat(const struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr);
45114 * The value, in msat, of the HTLC. The value as it appears in the commitment transaction is
45115 * this divided by 1000.
45117 void HTLCOutputInCommitment_set_amount_msat(struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr, uint64_t val);
45120 * The CLTV lock-time at which this HTLC expires.
45122 uint32_t HTLCOutputInCommitment_get_cltv_expiry(const struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr);
45125 * The CLTV lock-time at which this HTLC expires.
45127 void HTLCOutputInCommitment_set_cltv_expiry(struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr, uint32_t val);
45130 * The hash of the preimage which unlocks this HTLC.
45132 const uint8_t (*HTLCOutputInCommitment_get_payment_hash(const struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr))[32];
45135 * The hash of the preimage which unlocks this HTLC.
45137 void HTLCOutputInCommitment_set_payment_hash(struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
45140 * The position within the commitment transactions' outputs. This may be None if the value is
45141 * below the dust limit (in which case no output appears in the commitment transaction and the
45142 * value is spent to additional transaction fees).
45144 struct LDKCOption_u32Z HTLCOutputInCommitment_get_transaction_output_index(const struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr);
45147 * The position within the commitment transactions' outputs. This may be None if the value is
45148 * below the dust limit (in which case no output appears in the commitment transaction and the
45149 * value is spent to additional transaction fees).
45151 void HTLCOutputInCommitment_set_transaction_output_index(struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr, struct LDKCOption_u32Z val);
45154 * Constructs a new HTLCOutputInCommitment given each field
45156 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);
45159 * Creates a copy of the HTLCOutputInCommitment
45161 struct LDKHTLCOutputInCommitment HTLCOutputInCommitment_clone(const struct LDKHTLCOutputInCommitment *NONNULL_PTR orig);
45164 * Checks if two HTLCOutputInCommitments contain equal inner contents.
45165 * This ignores pointers and is_owned flags and looks at the values in fields.
45166 * Two objects with NULL inner values will be considered "equal" here.
45168 bool HTLCOutputInCommitment_eq(const struct LDKHTLCOutputInCommitment *NONNULL_PTR a, const struct LDKHTLCOutputInCommitment *NONNULL_PTR b);
45171 * Serialize the HTLCOutputInCommitment object into a byte array which can be read by HTLCOutputInCommitment_read
45173 struct LDKCVec_u8Z HTLCOutputInCommitment_write(const struct LDKHTLCOutputInCommitment *NONNULL_PTR obj);
45176 * Read a HTLCOutputInCommitment from a byte array, created by HTLCOutputInCommitment_write
45178 struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ HTLCOutputInCommitment_read(struct LDKu8slice ser);
45181 * Gets the witness redeemscript for an HTLC output in a commitment transaction. Note that htlc
45182 * does not need to have its previous_output_index filled.
45184 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);
45187 * Gets the redeemscript for a funding output from the two funding public keys.
45188 * Note that the order of funding public keys does not matter.
45190 struct LDKCVec_u8Z make_funding_redeemscript(struct LDKPublicKey broadcaster, struct LDKPublicKey countersignatory);
45193 * Builds an unsigned HTLC-Success or HTLC-Timeout transaction from the given channel and HTLC
45194 * parameters. This is used by [`TrustedCommitmentTransaction::get_htlc_sigs`] to fetch the
45195 * transaction which needs signing, and can be used to construct an HTLC transaction which is
45196 * broadcastable given a counterparty HTLC signature.
45198 * Panics if htlc.transaction_output_index.is_none() (as such HTLCs do not appear in the
45199 * commitment transaction).
45201 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);
45204 * Returns the witness required to satisfy and spend a HTLC input.
45206 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);
45209 * Gets the witnessScript for the to_remote output when anchors are enabled.
45211 struct LDKCVec_u8Z get_to_countersignatory_with_anchors_redeemscript(struct LDKPublicKey payment_point);
45214 * Gets the witnessScript for an anchor output from the funding public key.
45215 * The witness in the spending input must be:
45216 * <BIP 143 funding_signature>
45217 * After 16 blocks of confirmation, an alternative satisfying witness could be:
45219 * (empty vector required to satisfy compliance with MINIMALIF-standard rule)
45221 struct LDKCVec_u8Z get_anchor_redeemscript(struct LDKPublicKey funding_pubkey);
45224 * Returns the witness required to satisfy and spend an anchor input.
45226 struct LDKWitness build_anchor_input_witness(struct LDKPublicKey funding_key, struct LDKECDSASignature funding_sig);
45229 * Frees any resources used by the ChannelTransactionParameters, if is_owned is set and inner is non-NULL.
45231 void ChannelTransactionParameters_free(struct LDKChannelTransactionParameters this_obj);
45234 * Holder public keys
45236 struct LDKChannelPublicKeys ChannelTransactionParameters_get_holder_pubkeys(const struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr);
45239 * Holder public keys
45241 void ChannelTransactionParameters_set_holder_pubkeys(struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr, struct LDKChannelPublicKeys val);
45244 * The contest delay selected by the holder, which applies to counterparty-broadcast transactions
45246 uint16_t ChannelTransactionParameters_get_holder_selected_contest_delay(const struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr);
45249 * The contest delay selected by the holder, which applies to counterparty-broadcast transactions
45251 void ChannelTransactionParameters_set_holder_selected_contest_delay(struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr, uint16_t val);
45254 * Whether the holder is the initiator of this channel.
45255 * This is an input to the commitment number obscure factor computation.
45257 bool ChannelTransactionParameters_get_is_outbound_from_holder(const struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr);
45260 * Whether the holder is the initiator of this channel.
45261 * This is an input to the commitment number obscure factor computation.
45263 void ChannelTransactionParameters_set_is_outbound_from_holder(struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr, bool val);
45266 * The late-bound counterparty channel transaction parameters.
45267 * These parameters are populated at the point in the protocol where the counterparty provides them.
45269 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
45271 struct LDKCounterpartyChannelTransactionParameters ChannelTransactionParameters_get_counterparty_parameters(const struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr);
45274 * The late-bound counterparty channel transaction parameters.
45275 * These parameters are populated at the point in the protocol where the counterparty provides them.
45277 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
45279 void ChannelTransactionParameters_set_counterparty_parameters(struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr, struct LDKCounterpartyChannelTransactionParameters val);
45282 * The late-bound funding outpoint
45284 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
45286 struct LDKOutPoint ChannelTransactionParameters_get_funding_outpoint(const struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr);
45289 * The late-bound funding outpoint
45291 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
45293 void ChannelTransactionParameters_set_funding_outpoint(struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr, struct LDKOutPoint val);
45296 * This channel's type, as negotiated during channel open. For old objects where this field
45297 * wasn't serialized, it will default to static_remote_key at deserialization.
45299 struct LDKChannelTypeFeatures ChannelTransactionParameters_get_channel_type_features(const struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr);
45302 * This channel's type, as negotiated during channel open. For old objects where this field
45303 * wasn't serialized, it will default to static_remote_key at deserialization.
45305 void ChannelTransactionParameters_set_channel_type_features(struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr, struct LDKChannelTypeFeatures val);
45308 * Constructs a new ChannelTransactionParameters given each field
45310 * Note that counterparty_parameters_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
45311 * Note that funding_outpoint_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
45313 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);
45316 * Creates a copy of the ChannelTransactionParameters
45318 struct LDKChannelTransactionParameters ChannelTransactionParameters_clone(const struct LDKChannelTransactionParameters *NONNULL_PTR orig);
45321 * Generates a non-cryptographic 64-bit hash of the ChannelTransactionParameters.
45323 uint64_t ChannelTransactionParameters_hash(const struct LDKChannelTransactionParameters *NONNULL_PTR o);
45326 * Checks if two ChannelTransactionParameterss contain equal inner contents.
45327 * This ignores pointers and is_owned flags and looks at the values in fields.
45328 * Two objects with NULL inner values will be considered "equal" here.
45330 bool ChannelTransactionParameters_eq(const struct LDKChannelTransactionParameters *NONNULL_PTR a, const struct LDKChannelTransactionParameters *NONNULL_PTR b);
45333 * Frees any resources used by the CounterpartyChannelTransactionParameters, if is_owned is set and inner is non-NULL.
45335 void CounterpartyChannelTransactionParameters_free(struct LDKCounterpartyChannelTransactionParameters this_obj);
45338 * Counter-party public keys
45340 struct LDKChannelPublicKeys CounterpartyChannelTransactionParameters_get_pubkeys(const struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR this_ptr);
45343 * Counter-party public keys
45345 void CounterpartyChannelTransactionParameters_set_pubkeys(struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR this_ptr, struct LDKChannelPublicKeys val);
45348 * The contest delay selected by the counterparty, which applies to holder-broadcast transactions
45350 uint16_t CounterpartyChannelTransactionParameters_get_selected_contest_delay(const struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR this_ptr);
45353 * The contest delay selected by the counterparty, which applies to holder-broadcast transactions
45355 void CounterpartyChannelTransactionParameters_set_selected_contest_delay(struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR this_ptr, uint16_t val);
45358 * Constructs a new CounterpartyChannelTransactionParameters given each field
45360 MUST_USE_RES struct LDKCounterpartyChannelTransactionParameters CounterpartyChannelTransactionParameters_new(struct LDKChannelPublicKeys pubkeys_arg, uint16_t selected_contest_delay_arg);
45363 * Creates a copy of the CounterpartyChannelTransactionParameters
45365 struct LDKCounterpartyChannelTransactionParameters CounterpartyChannelTransactionParameters_clone(const struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR orig);
45368 * Generates a non-cryptographic 64-bit hash of the CounterpartyChannelTransactionParameters.
45370 uint64_t CounterpartyChannelTransactionParameters_hash(const struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR o);
45373 * Checks if two CounterpartyChannelTransactionParameterss contain equal inner contents.
45374 * This ignores pointers and is_owned flags and looks at the values in fields.
45375 * Two objects with NULL inner values will be considered "equal" here.
45377 bool CounterpartyChannelTransactionParameters_eq(const struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR a, const struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR b);
45380 * Whether the late bound parameters are populated.
45382 MUST_USE_RES bool ChannelTransactionParameters_is_populated(const struct LDKChannelTransactionParameters *NONNULL_PTR this_arg);
45385 * Convert the holder/counterparty parameters to broadcaster/countersignatory-organized parameters,
45386 * given that the holder is the broadcaster.
45388 * self.is_populated() must be true before calling this function.
45390 MUST_USE_RES struct LDKDirectedChannelTransactionParameters ChannelTransactionParameters_as_holder_broadcastable(const struct LDKChannelTransactionParameters *NONNULL_PTR this_arg);
45393 * Convert the holder/counterparty parameters to broadcaster/countersignatory-organized parameters,
45394 * given that the counterparty is the broadcaster.
45396 * self.is_populated() must be true before calling this function.
45398 MUST_USE_RES struct LDKDirectedChannelTransactionParameters ChannelTransactionParameters_as_counterparty_broadcastable(const struct LDKChannelTransactionParameters *NONNULL_PTR this_arg);
45401 * Serialize the CounterpartyChannelTransactionParameters object into a byte array which can be read by CounterpartyChannelTransactionParameters_read
45403 struct LDKCVec_u8Z CounterpartyChannelTransactionParameters_write(const struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR obj);
45406 * Read a CounterpartyChannelTransactionParameters from a byte array, created by CounterpartyChannelTransactionParameters_write
45408 struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ CounterpartyChannelTransactionParameters_read(struct LDKu8slice ser);
45411 * Serialize the ChannelTransactionParameters object into a byte array which can be read by ChannelTransactionParameters_read
45413 struct LDKCVec_u8Z ChannelTransactionParameters_write(const struct LDKChannelTransactionParameters *NONNULL_PTR obj);
45416 * Read a ChannelTransactionParameters from a byte array, created by ChannelTransactionParameters_write
45418 struct LDKCResult_ChannelTransactionParametersDecodeErrorZ ChannelTransactionParameters_read(struct LDKu8slice ser);
45421 * Frees any resources used by the DirectedChannelTransactionParameters, if is_owned is set and inner is non-NULL.
45423 void DirectedChannelTransactionParameters_free(struct LDKDirectedChannelTransactionParameters this_obj);
45426 * Get the channel pubkeys for the broadcaster
45428 MUST_USE_RES struct LDKChannelPublicKeys DirectedChannelTransactionParameters_broadcaster_pubkeys(const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR this_arg);
45431 * Get the channel pubkeys for the countersignatory
45433 MUST_USE_RES struct LDKChannelPublicKeys DirectedChannelTransactionParameters_countersignatory_pubkeys(const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR this_arg);
45436 * Get the contest delay applicable to the transactions.
45437 * Note that the contest delay was selected by the countersignatory.
45439 MUST_USE_RES uint16_t DirectedChannelTransactionParameters_contest_delay(const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR this_arg);
45442 * Whether the channel is outbound from the broadcaster.
45444 * The boolean representing the side that initiated the channel is
45445 * an input to the commitment number obscure factor computation.
45447 MUST_USE_RES bool DirectedChannelTransactionParameters_is_outbound(const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR this_arg);
45450 * The funding outpoint
45452 MUST_USE_RES struct LDKOutPoint DirectedChannelTransactionParameters_funding_outpoint(const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR this_arg);
45455 * Whether to use anchors for this channel
45457 MUST_USE_RES struct LDKChannelTypeFeatures DirectedChannelTransactionParameters_channel_type_features(const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR this_arg);
45460 * Frees any resources used by the HolderCommitmentTransaction, if is_owned is set and inner is non-NULL.
45462 void HolderCommitmentTransaction_free(struct LDKHolderCommitmentTransaction this_obj);
45465 * Our counterparty's signature for the transaction
45467 struct LDKECDSASignature HolderCommitmentTransaction_get_counterparty_sig(const struct LDKHolderCommitmentTransaction *NONNULL_PTR this_ptr);
45470 * Our counterparty's signature for the transaction
45472 void HolderCommitmentTransaction_set_counterparty_sig(struct LDKHolderCommitmentTransaction *NONNULL_PTR this_ptr, struct LDKECDSASignature val);
45475 * All non-dust counterparty HTLC signatures, in the order they appear in the transaction
45477 * Returns a copy of the field.
45479 struct LDKCVec_ECDSASignatureZ HolderCommitmentTransaction_get_counterparty_htlc_sigs(const struct LDKHolderCommitmentTransaction *NONNULL_PTR this_ptr);
45482 * All non-dust counterparty HTLC signatures, in the order they appear in the transaction
45484 void HolderCommitmentTransaction_set_counterparty_htlc_sigs(struct LDKHolderCommitmentTransaction *NONNULL_PTR this_ptr, struct LDKCVec_ECDSASignatureZ val);
45487 * Creates a copy of the HolderCommitmentTransaction
45489 struct LDKHolderCommitmentTransaction HolderCommitmentTransaction_clone(const struct LDKHolderCommitmentTransaction *NONNULL_PTR orig);
45492 * Serialize the HolderCommitmentTransaction object into a byte array which can be read by HolderCommitmentTransaction_read
45494 struct LDKCVec_u8Z HolderCommitmentTransaction_write(const struct LDKHolderCommitmentTransaction *NONNULL_PTR obj);
45497 * Read a HolderCommitmentTransaction from a byte array, created by HolderCommitmentTransaction_write
45499 struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ HolderCommitmentTransaction_read(struct LDKu8slice ser);
45502 * Create a new holder transaction with the given counterparty signatures.
45503 * The funding keys are used to figure out which signature should go first when building the transaction for broadcast.
45505 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);
45508 * Frees any resources used by the BuiltCommitmentTransaction, if is_owned is set and inner is non-NULL.
45510 void BuiltCommitmentTransaction_free(struct LDKBuiltCommitmentTransaction this_obj);
45513 * The commitment transaction
45515 struct LDKTransaction BuiltCommitmentTransaction_get_transaction(const struct LDKBuiltCommitmentTransaction *NONNULL_PTR this_ptr);
45518 * The commitment transaction
45520 void BuiltCommitmentTransaction_set_transaction(struct LDKBuiltCommitmentTransaction *NONNULL_PTR this_ptr, struct LDKTransaction val);
45523 * The txid for the commitment transaction.
45525 * This is provided as a performance optimization, instead of calling transaction.txid()
45528 const uint8_t (*BuiltCommitmentTransaction_get_txid(const struct LDKBuiltCommitmentTransaction *NONNULL_PTR this_ptr))[32];
45531 * The txid for the commitment transaction.
45533 * This is provided as a performance optimization, instead of calling transaction.txid()
45536 void BuiltCommitmentTransaction_set_txid(struct LDKBuiltCommitmentTransaction *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
45539 * Constructs a new BuiltCommitmentTransaction given each field
45541 MUST_USE_RES struct LDKBuiltCommitmentTransaction BuiltCommitmentTransaction_new(struct LDKTransaction transaction_arg, struct LDKThirtyTwoBytes txid_arg);
45544 * Creates a copy of the BuiltCommitmentTransaction
45546 struct LDKBuiltCommitmentTransaction BuiltCommitmentTransaction_clone(const struct LDKBuiltCommitmentTransaction *NONNULL_PTR orig);
45549 * Serialize the BuiltCommitmentTransaction object into a byte array which can be read by BuiltCommitmentTransaction_read
45551 struct LDKCVec_u8Z BuiltCommitmentTransaction_write(const struct LDKBuiltCommitmentTransaction *NONNULL_PTR obj);
45554 * Read a BuiltCommitmentTransaction from a byte array, created by BuiltCommitmentTransaction_write
45556 struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ BuiltCommitmentTransaction_read(struct LDKu8slice ser);
45559 * Get the SIGHASH_ALL sighash value of the transaction.
45561 * This can be used to verify a signature.
45563 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);
45566 * Signs the counterparty's commitment transaction.
45568 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);
45571 * Signs the holder commitment transaction because we are about to broadcast it.
45573 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);
45576 * Frees any resources used by the ClosingTransaction, if is_owned is set and inner is non-NULL.
45578 void ClosingTransaction_free(struct LDKClosingTransaction this_obj);
45581 * Creates a copy of the ClosingTransaction
45583 struct LDKClosingTransaction ClosingTransaction_clone(const struct LDKClosingTransaction *NONNULL_PTR orig);
45586 * Generates a non-cryptographic 64-bit hash of the ClosingTransaction.
45588 uint64_t ClosingTransaction_hash(const struct LDKClosingTransaction *NONNULL_PTR o);
45591 * Checks if two ClosingTransactions contain equal inner contents.
45592 * This ignores pointers and is_owned flags and looks at the values in fields.
45593 * Two objects with NULL inner values will be considered "equal" here.
45595 bool ClosingTransaction_eq(const struct LDKClosingTransaction *NONNULL_PTR a, const struct LDKClosingTransaction *NONNULL_PTR b);
45598 * Construct an object of the class
45600 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);
45603 * Trust our pre-built transaction.
45605 * Applies a wrapper which allows access to the transaction.
45607 * This should only be used if you fully trust the builder of this object. It should not
45608 * be used by an external signer - instead use the verify function.
45610 MUST_USE_RES struct LDKTrustedClosingTransaction ClosingTransaction_trust(const struct LDKClosingTransaction *NONNULL_PTR this_arg);
45613 * Verify our pre-built transaction.
45615 * Applies a wrapper which allows access to the transaction.
45617 * An external validating signer must call this method before signing
45618 * or using the built transaction.
45620 MUST_USE_RES struct LDKCResult_TrustedClosingTransactionNoneZ ClosingTransaction_verify(const struct LDKClosingTransaction *NONNULL_PTR this_arg, struct LDKOutPoint funding_outpoint);
45623 * The value to be sent to the holder, or zero if the output will be omitted
45625 MUST_USE_RES uint64_t ClosingTransaction_to_holder_value_sat(const struct LDKClosingTransaction *NONNULL_PTR this_arg);
45628 * The value to be sent to the counterparty, or zero if the output will be omitted
45630 MUST_USE_RES uint64_t ClosingTransaction_to_counterparty_value_sat(const struct LDKClosingTransaction *NONNULL_PTR this_arg);
45633 * The destination of the holder's output
45635 MUST_USE_RES struct LDKu8slice ClosingTransaction_to_holder_script(const struct LDKClosingTransaction *NONNULL_PTR this_arg);
45638 * The destination of the counterparty's output
45640 MUST_USE_RES struct LDKu8slice ClosingTransaction_to_counterparty_script(const struct LDKClosingTransaction *NONNULL_PTR this_arg);
45643 * Frees any resources used by the TrustedClosingTransaction, if is_owned is set and inner is non-NULL.
45645 void TrustedClosingTransaction_free(struct LDKTrustedClosingTransaction this_obj);
45648 * The pre-built Bitcoin commitment transaction
45650 MUST_USE_RES struct LDKTransaction TrustedClosingTransaction_built_transaction(const struct LDKTrustedClosingTransaction *NONNULL_PTR this_arg);
45653 * Get the SIGHASH_ALL sighash value of the transaction.
45655 * This can be used to verify a signature.
45657 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);
45660 * Sign a transaction, either because we are counter-signing the counterparty's transaction or
45661 * because we are about to broadcast a holder transaction.
45663 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);
45666 * Frees any resources used by the CommitmentTransaction, if is_owned is set and inner is non-NULL.
45668 void CommitmentTransaction_free(struct LDKCommitmentTransaction this_obj);
45671 * Creates a copy of the CommitmentTransaction
45673 struct LDKCommitmentTransaction CommitmentTransaction_clone(const struct LDKCommitmentTransaction *NONNULL_PTR orig);
45676 * Serialize the CommitmentTransaction object into a byte array which can be read by CommitmentTransaction_read
45678 struct LDKCVec_u8Z CommitmentTransaction_write(const struct LDKCommitmentTransaction *NONNULL_PTR obj);
45681 * Read a CommitmentTransaction from a byte array, created by CommitmentTransaction_write
45683 struct LDKCResult_CommitmentTransactionDecodeErrorZ CommitmentTransaction_read(struct LDKu8slice ser);
45686 * The backwards-counting commitment number
45688 MUST_USE_RES uint64_t CommitmentTransaction_commitment_number(const struct LDKCommitmentTransaction *NONNULL_PTR this_arg);
45691 * The per commitment point used by the broadcaster.
45693 MUST_USE_RES struct LDKPublicKey CommitmentTransaction_per_commitment_point(const struct LDKCommitmentTransaction *NONNULL_PTR this_arg);
45696 * The value to be sent to the broadcaster
45698 MUST_USE_RES uint64_t CommitmentTransaction_to_broadcaster_value_sat(const struct LDKCommitmentTransaction *NONNULL_PTR this_arg);
45701 * The value to be sent to the counterparty
45703 MUST_USE_RES uint64_t CommitmentTransaction_to_countersignatory_value_sat(const struct LDKCommitmentTransaction *NONNULL_PTR this_arg);
45706 * The feerate paid per 1000-weight-unit in this commitment transaction.
45708 MUST_USE_RES uint32_t CommitmentTransaction_feerate_per_kw(const struct LDKCommitmentTransaction *NONNULL_PTR this_arg);
45711 * Trust our pre-built transaction and derived transaction creation public keys.
45713 * Applies a wrapper which allows access to these fields.
45715 * This should only be used if you fully trust the builder of this object. It should not
45716 * be used by an external signer - instead use the verify function.
45718 MUST_USE_RES struct LDKTrustedCommitmentTransaction CommitmentTransaction_trust(const struct LDKCommitmentTransaction *NONNULL_PTR this_arg);
45721 * Verify our pre-built transaction and derived transaction creation public keys.
45723 * Applies a wrapper which allows access to these fields.
45725 * An external validating signer must call this method before signing
45726 * or using the built transaction.
45728 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);
45731 * Frees any resources used by the TrustedCommitmentTransaction, if is_owned is set and inner is non-NULL.
45733 void TrustedCommitmentTransaction_free(struct LDKTrustedCommitmentTransaction this_obj);
45736 * The transaction ID of the built Bitcoin transaction
45738 MUST_USE_RES struct LDKThirtyTwoBytes TrustedCommitmentTransaction_txid(const struct LDKTrustedCommitmentTransaction *NONNULL_PTR this_arg);
45741 * The pre-built Bitcoin commitment transaction
45743 MUST_USE_RES struct LDKBuiltCommitmentTransaction TrustedCommitmentTransaction_built_transaction(const struct LDKTrustedCommitmentTransaction *NONNULL_PTR this_arg);
45746 * The pre-calculated transaction creation public keys.
45748 MUST_USE_RES struct LDKTxCreationKeys TrustedCommitmentTransaction_keys(const struct LDKTrustedCommitmentTransaction *NONNULL_PTR this_arg);
45751 * Should anchors be used.
45753 MUST_USE_RES struct LDKChannelTypeFeatures TrustedCommitmentTransaction_channel_type_features(const struct LDKTrustedCommitmentTransaction *NONNULL_PTR this_arg);
45756 * Get a signature for each HTLC which was included in the commitment transaction (ie for
45757 * which HTLCOutputInCommitment::transaction_output_index.is_some()).
45759 * The returned Vec has one entry for each HTLC, and in the same order.
45761 * This function is only valid in the holder commitment context, it always uses EcdsaSighashType::All.
45763 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);
45766 * Returns the index of the revokeable output, i.e. the `to_local` output sending funds to
45767 * the broadcaster, in the built transaction, if any exists.
45769 * There are two cases where this may return `None`:
45770 * - The balance of the revokeable output is below the dust limit (only found on commitments
45771 * early in the channel's lifetime, i.e. before the channel reserve is met).
45772 * - This commitment was created before LDK 0.0.117. In this case, the
45773 * commitment transaction previously didn't contain enough information to locate the
45774 * revokeable output.
45776 MUST_USE_RES struct LDKCOption_usizeZ TrustedCommitmentTransaction_revokeable_output_index(const struct LDKTrustedCommitmentTransaction *NONNULL_PTR this_arg);
45779 * Helper method to build an unsigned justice transaction spending the revokeable
45780 * `to_local` output to a destination script. Fee estimation accounts for the expected
45781 * revocation witness data that will be added when signed.
45783 * This method will error if the given fee rate results in a fee greater than the value
45784 * of the output being spent, or if there exists no revokeable `to_local` output on this
45785 * commitment transaction. See [`Self::revokeable_output_index`] for more details.
45787 * The built transaction will allow fee bumping with RBF, and this method takes
45788 * `feerate_per_kw` as an input such that multiple copies of a justice transaction at different
45789 * fee rates may be built.
45791 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);
45794 * Commitment transaction numbers which appear in the transactions themselves are XOR'd with a
45795 * shared secret first. This prevents on-chain observers from discovering how many commitment
45796 * transactions occurred in a channel before it was closed.
45798 * This function gets the shared secret from relevant channel public keys and can be used to
45799 * \"decrypt\" the commitment transaction number given a commitment transaction on-chain.
45801 uint64_t get_commitment_transaction_number_obscure_factor(struct LDKPublicKey broadcaster_payment_basepoint, struct LDKPublicKey countersignatory_payment_basepoint, bool outbound_from_broadcaster);
45804 * Checks if two InitFeaturess contain equal inner contents.
45805 * This ignores pointers and is_owned flags and looks at the values in fields.
45806 * Two objects with NULL inner values will be considered "equal" here.
45808 bool InitFeatures_eq(const struct LDKInitFeatures *NONNULL_PTR a, const struct LDKInitFeatures *NONNULL_PTR b);
45811 * Checks if two NodeFeaturess contain equal inner contents.
45812 * This ignores pointers and is_owned flags and looks at the values in fields.
45813 * Two objects with NULL inner values will be considered "equal" here.
45815 bool NodeFeatures_eq(const struct LDKNodeFeatures *NONNULL_PTR a, const struct LDKNodeFeatures *NONNULL_PTR b);
45818 * Checks if two ChannelFeaturess contain equal inner contents.
45819 * This ignores pointers and is_owned flags and looks at the values in fields.
45820 * Two objects with NULL inner values will be considered "equal" here.
45822 bool ChannelFeatures_eq(const struct LDKChannelFeatures *NONNULL_PTR a, const struct LDKChannelFeatures *NONNULL_PTR b);
45825 * Checks if two Bolt11InvoiceFeaturess contain equal inner contents.
45826 * This ignores pointers and is_owned flags and looks at the values in fields.
45827 * Two objects with NULL inner values will be considered "equal" here.
45829 bool Bolt11InvoiceFeatures_eq(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR a, const struct LDKBolt11InvoiceFeatures *NONNULL_PTR b);
45832 * Checks if two OfferFeaturess contain equal inner contents.
45833 * This ignores pointers and is_owned flags and looks at the values in fields.
45834 * Two objects with NULL inner values will be considered "equal" here.
45836 bool OfferFeatures_eq(const struct LDKOfferFeatures *NONNULL_PTR a, const struct LDKOfferFeatures *NONNULL_PTR b);
45839 * Checks if two InvoiceRequestFeaturess contain equal inner contents.
45840 * This ignores pointers and is_owned flags and looks at the values in fields.
45841 * Two objects with NULL inner values will be considered "equal" here.
45843 bool InvoiceRequestFeatures_eq(const struct LDKInvoiceRequestFeatures *NONNULL_PTR a, const struct LDKInvoiceRequestFeatures *NONNULL_PTR b);
45846 * Checks if two Bolt12InvoiceFeaturess contain equal inner contents.
45847 * This ignores pointers and is_owned flags and looks at the values in fields.
45848 * Two objects with NULL inner values will be considered "equal" here.
45850 bool Bolt12InvoiceFeatures_eq(const struct LDKBolt12InvoiceFeatures *NONNULL_PTR a, const struct LDKBolt12InvoiceFeatures *NONNULL_PTR b);
45853 * Checks if two BlindedHopFeaturess contain equal inner contents.
45854 * This ignores pointers and is_owned flags and looks at the values in fields.
45855 * Two objects with NULL inner values will be considered "equal" here.
45857 bool BlindedHopFeatures_eq(const struct LDKBlindedHopFeatures *NONNULL_PTR a, const struct LDKBlindedHopFeatures *NONNULL_PTR b);
45860 * Checks if two ChannelTypeFeaturess contain equal inner contents.
45861 * This ignores pointers and is_owned flags and looks at the values in fields.
45862 * Two objects with NULL inner values will be considered "equal" here.
45864 bool ChannelTypeFeatures_eq(const struct LDKChannelTypeFeatures *NONNULL_PTR a, const struct LDKChannelTypeFeatures *NONNULL_PTR b);
45867 * Creates a copy of the InitFeatures
45869 struct LDKInitFeatures InitFeatures_clone(const struct LDKInitFeatures *NONNULL_PTR orig);
45872 * Creates a copy of the NodeFeatures
45874 struct LDKNodeFeatures NodeFeatures_clone(const struct LDKNodeFeatures *NONNULL_PTR orig);
45877 * Creates a copy of the ChannelFeatures
45879 struct LDKChannelFeatures ChannelFeatures_clone(const struct LDKChannelFeatures *NONNULL_PTR orig);
45882 * Creates a copy of the Bolt11InvoiceFeatures
45884 struct LDKBolt11InvoiceFeatures Bolt11InvoiceFeatures_clone(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR orig);
45887 * Creates a copy of the OfferFeatures
45889 struct LDKOfferFeatures OfferFeatures_clone(const struct LDKOfferFeatures *NONNULL_PTR orig);
45892 * Creates a copy of the InvoiceRequestFeatures
45894 struct LDKInvoiceRequestFeatures InvoiceRequestFeatures_clone(const struct LDKInvoiceRequestFeatures *NONNULL_PTR orig);
45897 * Creates a copy of the Bolt12InvoiceFeatures
45899 struct LDKBolt12InvoiceFeatures Bolt12InvoiceFeatures_clone(const struct LDKBolt12InvoiceFeatures *NONNULL_PTR orig);
45902 * Creates a copy of the BlindedHopFeatures
45904 struct LDKBlindedHopFeatures BlindedHopFeatures_clone(const struct LDKBlindedHopFeatures *NONNULL_PTR orig);
45907 * Creates a copy of the ChannelTypeFeatures
45909 struct LDKChannelTypeFeatures ChannelTypeFeatures_clone(const struct LDKChannelTypeFeatures *NONNULL_PTR orig);
45912 * Generates a non-cryptographic 64-bit hash of the InitFeatures.
45914 uint64_t InitFeatures_hash(const struct LDKInitFeatures *NONNULL_PTR o);
45917 * Generates a non-cryptographic 64-bit hash of the NodeFeatures.
45919 uint64_t NodeFeatures_hash(const struct LDKNodeFeatures *NONNULL_PTR o);
45922 * Generates a non-cryptographic 64-bit hash of the ChannelFeatures.
45924 uint64_t ChannelFeatures_hash(const struct LDKChannelFeatures *NONNULL_PTR o);
45927 * Generates a non-cryptographic 64-bit hash of the Bolt11InvoiceFeatures.
45929 uint64_t Bolt11InvoiceFeatures_hash(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR o);
45932 * Generates a non-cryptographic 64-bit hash of the OfferFeatures.
45934 uint64_t OfferFeatures_hash(const struct LDKOfferFeatures *NONNULL_PTR o);
45937 * Generates a non-cryptographic 64-bit hash of the InvoiceRequestFeatures.
45939 uint64_t InvoiceRequestFeatures_hash(const struct LDKInvoiceRequestFeatures *NONNULL_PTR o);
45942 * Generates a non-cryptographic 64-bit hash of the Bolt12InvoiceFeatures.
45944 uint64_t Bolt12InvoiceFeatures_hash(const struct LDKBolt12InvoiceFeatures *NONNULL_PTR o);
45947 * Generates a non-cryptographic 64-bit hash of the BlindedHopFeatures.
45949 uint64_t BlindedHopFeatures_hash(const struct LDKBlindedHopFeatures *NONNULL_PTR o);
45952 * Generates a non-cryptographic 64-bit hash of the ChannelTypeFeatures.
45954 uint64_t ChannelTypeFeatures_hash(const struct LDKChannelTypeFeatures *NONNULL_PTR o);
45957 * Frees any resources used by the InitFeatures, if is_owned is set and inner is non-NULL.
45959 void InitFeatures_free(struct LDKInitFeatures this_obj);
45962 * Frees any resources used by the NodeFeatures, if is_owned is set and inner is non-NULL.
45964 void NodeFeatures_free(struct LDKNodeFeatures this_obj);
45967 * Frees any resources used by the ChannelFeatures, if is_owned is set and inner is non-NULL.
45969 void ChannelFeatures_free(struct LDKChannelFeatures this_obj);
45972 * Frees any resources used by the Bolt11InvoiceFeatures, if is_owned is set and inner is non-NULL.
45974 void Bolt11InvoiceFeatures_free(struct LDKBolt11InvoiceFeatures this_obj);
45977 * Frees any resources used by the OfferFeatures, if is_owned is set and inner is non-NULL.
45979 void OfferFeatures_free(struct LDKOfferFeatures this_obj);
45982 * Frees any resources used by the InvoiceRequestFeatures, if is_owned is set and inner is non-NULL.
45984 void InvoiceRequestFeatures_free(struct LDKInvoiceRequestFeatures this_obj);
45987 * Frees any resources used by the Bolt12InvoiceFeatures, if is_owned is set and inner is non-NULL.
45989 void Bolt12InvoiceFeatures_free(struct LDKBolt12InvoiceFeatures this_obj);
45992 * Frees any resources used by the BlindedHopFeatures, if is_owned is set and inner is non-NULL.
45994 void BlindedHopFeatures_free(struct LDKBlindedHopFeatures this_obj);
45997 * Frees any resources used by the ChannelTypeFeatures, if is_owned is set and inner is non-NULL.
45999 void ChannelTypeFeatures_free(struct LDKChannelTypeFeatures this_obj);
46002 * Create a blank Features with no features set
46004 MUST_USE_RES struct LDKInitFeatures InitFeatures_empty(void);
46007 * Returns true if this `Features` object contains required features unknown by `other`.
46009 MUST_USE_RES bool InitFeatures_requires_unknown_bits_from(const struct LDKInitFeatures *NONNULL_PTR this_arg, const struct LDKInitFeatures *NONNULL_PTR other);
46012 * Returns true if this `Features` object contains unknown feature flags which are set as
46015 MUST_USE_RES bool InitFeatures_requires_unknown_bits(const struct LDKInitFeatures *NONNULL_PTR this_arg);
46018 * Sets a required feature bit. Errors if `bit` is outside the feature range as defined
46021 * Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
46022 * be set instead (i.e., `bit - 1`).
46024 * [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
46026 MUST_USE_RES struct LDKCResult_NoneNoneZ InitFeatures_set_required_feature_bit(struct LDKInitFeatures *NONNULL_PTR this_arg, uintptr_t bit);
46029 * Sets an optional feature bit. Errors if `bit` is outside the feature range as defined
46032 * Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
46033 * set instead (i.e., `bit + 1`).
46035 * [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
46037 MUST_USE_RES struct LDKCResult_NoneNoneZ InitFeatures_set_optional_feature_bit(struct LDKInitFeatures *NONNULL_PTR this_arg, uintptr_t bit);
46040 * Sets a required custom feature bit. Errors if `bit` is outside the custom range as defined
46041 * by [bLIP 2] or if it is a known `T` feature.
46043 * Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
46044 * be set instead (i.e., `bit - 1`).
46046 * [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
46048 MUST_USE_RES struct LDKCResult_NoneNoneZ InitFeatures_set_required_custom_bit(struct LDKInitFeatures *NONNULL_PTR this_arg, uintptr_t bit);
46051 * Sets an optional custom feature bit. Errors if `bit` is outside the custom range as defined
46052 * by [bLIP 2] or if it is a known `T` feature.
46054 * Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
46055 * set instead (i.e., `bit + 1`).
46057 * [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
46059 MUST_USE_RES struct LDKCResult_NoneNoneZ InitFeatures_set_optional_custom_bit(struct LDKInitFeatures *NONNULL_PTR this_arg, uintptr_t bit);
46062 * Create a blank Features with no features set
46064 MUST_USE_RES struct LDKNodeFeatures NodeFeatures_empty(void);
46067 * Returns true if this `Features` object contains required features unknown by `other`.
46069 MUST_USE_RES bool NodeFeatures_requires_unknown_bits_from(const struct LDKNodeFeatures *NONNULL_PTR this_arg, const struct LDKNodeFeatures *NONNULL_PTR other);
46072 * Returns true if this `Features` object contains unknown feature flags which are set as
46075 MUST_USE_RES bool NodeFeatures_requires_unknown_bits(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
46078 * Sets a required feature bit. Errors if `bit` is outside the feature range as defined
46081 * Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
46082 * be set instead (i.e., `bit - 1`).
46084 * [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
46086 MUST_USE_RES struct LDKCResult_NoneNoneZ NodeFeatures_set_required_feature_bit(struct LDKNodeFeatures *NONNULL_PTR this_arg, uintptr_t bit);
46089 * Sets an optional feature bit. Errors if `bit` is outside the feature range as defined
46092 * Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
46093 * set instead (i.e., `bit + 1`).
46095 * [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
46097 MUST_USE_RES struct LDKCResult_NoneNoneZ NodeFeatures_set_optional_feature_bit(struct LDKNodeFeatures *NONNULL_PTR this_arg, uintptr_t bit);
46100 * Sets a required custom feature bit. Errors if `bit` is outside the custom range as defined
46101 * by [bLIP 2] or if it is a known `T` feature.
46103 * Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
46104 * be set instead (i.e., `bit - 1`).
46106 * [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
46108 MUST_USE_RES struct LDKCResult_NoneNoneZ NodeFeatures_set_required_custom_bit(struct LDKNodeFeatures *NONNULL_PTR this_arg, uintptr_t bit);
46111 * Sets an optional custom feature bit. Errors if `bit` is outside the custom range as defined
46112 * by [bLIP 2] or if it is a known `T` feature.
46114 * Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
46115 * set instead (i.e., `bit + 1`).
46117 * [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
46119 MUST_USE_RES struct LDKCResult_NoneNoneZ NodeFeatures_set_optional_custom_bit(struct LDKNodeFeatures *NONNULL_PTR this_arg, uintptr_t bit);
46122 * Create a blank Features with no features set
46124 MUST_USE_RES struct LDKChannelFeatures ChannelFeatures_empty(void);
46127 * Returns true if this `Features` object contains required features unknown by `other`.
46129 MUST_USE_RES bool ChannelFeatures_requires_unknown_bits_from(const struct LDKChannelFeatures *NONNULL_PTR this_arg, const struct LDKChannelFeatures *NONNULL_PTR other);
46132 * Returns true if this `Features` object contains unknown feature flags which are set as
46135 MUST_USE_RES bool ChannelFeatures_requires_unknown_bits(const struct LDKChannelFeatures *NONNULL_PTR this_arg);
46138 * Sets a required feature bit. Errors if `bit` is outside the feature range as defined
46141 * Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
46142 * be set instead (i.e., `bit - 1`).
46144 * [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
46146 MUST_USE_RES struct LDKCResult_NoneNoneZ ChannelFeatures_set_required_feature_bit(struct LDKChannelFeatures *NONNULL_PTR this_arg, uintptr_t bit);
46149 * Sets an optional feature bit. Errors if `bit` is outside the feature range as defined
46152 * Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
46153 * set instead (i.e., `bit + 1`).
46155 * [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
46157 MUST_USE_RES struct LDKCResult_NoneNoneZ ChannelFeatures_set_optional_feature_bit(struct LDKChannelFeatures *NONNULL_PTR this_arg, uintptr_t bit);
46160 * Sets a required custom feature bit. Errors if `bit` is outside the custom range as defined
46161 * by [bLIP 2] or if it is a known `T` feature.
46163 * Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
46164 * be set instead (i.e., `bit - 1`).
46166 * [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
46168 MUST_USE_RES struct LDKCResult_NoneNoneZ ChannelFeatures_set_required_custom_bit(struct LDKChannelFeatures *NONNULL_PTR this_arg, uintptr_t bit);
46171 * Sets an optional custom feature bit. Errors if `bit` is outside the custom range as defined
46172 * by [bLIP 2] or if it is a known `T` feature.
46174 * Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
46175 * set instead (i.e., `bit + 1`).
46177 * [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
46179 MUST_USE_RES struct LDKCResult_NoneNoneZ ChannelFeatures_set_optional_custom_bit(struct LDKChannelFeatures *NONNULL_PTR this_arg, uintptr_t bit);
46182 * Create a blank Features with no features set
46184 MUST_USE_RES struct LDKBolt11InvoiceFeatures Bolt11InvoiceFeatures_empty(void);
46187 * Returns true if this `Features` object contains required features unknown by `other`.
46189 MUST_USE_RES bool Bolt11InvoiceFeatures_requires_unknown_bits_from(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg, const struct LDKBolt11InvoiceFeatures *NONNULL_PTR other);
46192 * Returns true if this `Features` object contains unknown feature flags which are set as
46195 MUST_USE_RES bool Bolt11InvoiceFeatures_requires_unknown_bits(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg);
46198 * Sets a required feature bit. Errors if `bit` is outside the feature range as defined
46201 * Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
46202 * be set instead (i.e., `bit - 1`).
46204 * [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
46206 MUST_USE_RES struct LDKCResult_NoneNoneZ Bolt11InvoiceFeatures_set_required_feature_bit(struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg, uintptr_t bit);
46209 * Sets an optional feature bit. Errors if `bit` is outside the feature range as defined
46212 * Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
46213 * set instead (i.e., `bit + 1`).
46215 * [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
46217 MUST_USE_RES struct LDKCResult_NoneNoneZ Bolt11InvoiceFeatures_set_optional_feature_bit(struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg, uintptr_t bit);
46220 * Sets a required custom feature bit. Errors if `bit` is outside the custom range as defined
46221 * by [bLIP 2] or if it is a known `T` feature.
46223 * Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
46224 * be set instead (i.e., `bit - 1`).
46226 * [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
46228 MUST_USE_RES struct LDKCResult_NoneNoneZ Bolt11InvoiceFeatures_set_required_custom_bit(struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg, uintptr_t bit);
46231 * Sets an optional custom feature bit. Errors if `bit` is outside the custom range as defined
46232 * by [bLIP 2] or if it is a known `T` feature.
46234 * Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
46235 * set instead (i.e., `bit + 1`).
46237 * [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
46239 MUST_USE_RES struct LDKCResult_NoneNoneZ Bolt11InvoiceFeatures_set_optional_custom_bit(struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg, uintptr_t bit);
46242 * Create a blank Features with no features set
46244 MUST_USE_RES struct LDKOfferFeatures OfferFeatures_empty(void);
46247 * Returns true if this `Features` object contains required features unknown by `other`.
46249 MUST_USE_RES bool OfferFeatures_requires_unknown_bits_from(const struct LDKOfferFeatures *NONNULL_PTR this_arg, const struct LDKOfferFeatures *NONNULL_PTR other);
46252 * Returns true if this `Features` object contains unknown feature flags which are set as
46255 MUST_USE_RES bool OfferFeatures_requires_unknown_bits(const struct LDKOfferFeatures *NONNULL_PTR this_arg);
46258 * Sets a required feature bit. Errors if `bit` is outside the feature range as defined
46261 * Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
46262 * be set instead (i.e., `bit - 1`).
46264 * [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
46266 MUST_USE_RES struct LDKCResult_NoneNoneZ OfferFeatures_set_required_feature_bit(struct LDKOfferFeatures *NONNULL_PTR this_arg, uintptr_t bit);
46269 * Sets an optional feature bit. Errors if `bit` is outside the feature range as defined
46272 * Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
46273 * set instead (i.e., `bit + 1`).
46275 * [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
46277 MUST_USE_RES struct LDKCResult_NoneNoneZ OfferFeatures_set_optional_feature_bit(struct LDKOfferFeatures *NONNULL_PTR this_arg, uintptr_t bit);
46280 * Sets a required custom feature bit. Errors if `bit` is outside the custom range as defined
46281 * by [bLIP 2] or if it is a known `T` feature.
46283 * Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
46284 * be set instead (i.e., `bit - 1`).
46286 * [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
46288 MUST_USE_RES struct LDKCResult_NoneNoneZ OfferFeatures_set_required_custom_bit(struct LDKOfferFeatures *NONNULL_PTR this_arg, uintptr_t bit);
46291 * Sets an optional custom feature bit. Errors if `bit` is outside the custom range as defined
46292 * by [bLIP 2] or if it is a known `T` feature.
46294 * Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
46295 * set instead (i.e., `bit + 1`).
46297 * [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
46299 MUST_USE_RES struct LDKCResult_NoneNoneZ OfferFeatures_set_optional_custom_bit(struct LDKOfferFeatures *NONNULL_PTR this_arg, uintptr_t bit);
46302 * Create a blank Features with no features set
46304 MUST_USE_RES struct LDKInvoiceRequestFeatures InvoiceRequestFeatures_empty(void);
46307 * Returns true if this `Features` object contains required features unknown by `other`.
46309 MUST_USE_RES bool InvoiceRequestFeatures_requires_unknown_bits_from(const struct LDKInvoiceRequestFeatures *NONNULL_PTR this_arg, const struct LDKInvoiceRequestFeatures *NONNULL_PTR other);
46312 * Returns true if this `Features` object contains unknown feature flags which are set as
46315 MUST_USE_RES bool InvoiceRequestFeatures_requires_unknown_bits(const struct LDKInvoiceRequestFeatures *NONNULL_PTR this_arg);
46318 * Sets a required feature bit. Errors if `bit` is outside the feature range as defined
46321 * Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
46322 * be set instead (i.e., `bit - 1`).
46324 * [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
46326 MUST_USE_RES struct LDKCResult_NoneNoneZ InvoiceRequestFeatures_set_required_feature_bit(struct LDKInvoiceRequestFeatures *NONNULL_PTR this_arg, uintptr_t bit);
46329 * Sets an optional feature bit. Errors if `bit` is outside the feature range as defined
46332 * Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
46333 * set instead (i.e., `bit + 1`).
46335 * [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
46337 MUST_USE_RES struct LDKCResult_NoneNoneZ InvoiceRequestFeatures_set_optional_feature_bit(struct LDKInvoiceRequestFeatures *NONNULL_PTR this_arg, uintptr_t bit);
46340 * Sets a required custom feature bit. Errors if `bit` is outside the custom range as defined
46341 * by [bLIP 2] or if it is a known `T` feature.
46343 * Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
46344 * be set instead (i.e., `bit - 1`).
46346 * [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
46348 MUST_USE_RES struct LDKCResult_NoneNoneZ InvoiceRequestFeatures_set_required_custom_bit(struct LDKInvoiceRequestFeatures *NONNULL_PTR this_arg, uintptr_t bit);
46351 * Sets an optional custom feature bit. Errors if `bit` is outside the custom range as defined
46352 * by [bLIP 2] or if it is a known `T` feature.
46354 * Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
46355 * set instead (i.e., `bit + 1`).
46357 * [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
46359 MUST_USE_RES struct LDKCResult_NoneNoneZ InvoiceRequestFeatures_set_optional_custom_bit(struct LDKInvoiceRequestFeatures *NONNULL_PTR this_arg, uintptr_t bit);
46362 * Create a blank Features with no features set
46364 MUST_USE_RES struct LDKBolt12InvoiceFeatures Bolt12InvoiceFeatures_empty(void);
46367 * Returns true if this `Features` object contains required features unknown by `other`.
46369 MUST_USE_RES bool Bolt12InvoiceFeatures_requires_unknown_bits_from(const struct LDKBolt12InvoiceFeatures *NONNULL_PTR this_arg, const struct LDKBolt12InvoiceFeatures *NONNULL_PTR other);
46372 * Returns true if this `Features` object contains unknown feature flags which are set as
46375 MUST_USE_RES bool Bolt12InvoiceFeatures_requires_unknown_bits(const struct LDKBolt12InvoiceFeatures *NONNULL_PTR this_arg);
46378 * Sets a required feature bit. Errors if `bit` is outside the feature range as defined
46381 * Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
46382 * be set instead (i.e., `bit - 1`).
46384 * [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
46386 MUST_USE_RES struct LDKCResult_NoneNoneZ Bolt12InvoiceFeatures_set_required_feature_bit(struct LDKBolt12InvoiceFeatures *NONNULL_PTR this_arg, uintptr_t bit);
46389 * Sets an optional feature bit. Errors if `bit` is outside the feature range as defined
46392 * Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
46393 * set instead (i.e., `bit + 1`).
46395 * [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
46397 MUST_USE_RES struct LDKCResult_NoneNoneZ Bolt12InvoiceFeatures_set_optional_feature_bit(struct LDKBolt12InvoiceFeatures *NONNULL_PTR this_arg, uintptr_t bit);
46400 * Sets a required custom feature bit. Errors if `bit` is outside the custom range as defined
46401 * by [bLIP 2] or if it is a known `T` feature.
46403 * Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
46404 * be set instead (i.e., `bit - 1`).
46406 * [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
46408 MUST_USE_RES struct LDKCResult_NoneNoneZ Bolt12InvoiceFeatures_set_required_custom_bit(struct LDKBolt12InvoiceFeatures *NONNULL_PTR this_arg, uintptr_t bit);
46411 * Sets an optional custom feature bit. Errors if `bit` is outside the custom range as defined
46412 * by [bLIP 2] or if it is a known `T` feature.
46414 * Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
46415 * set instead (i.e., `bit + 1`).
46417 * [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
46419 MUST_USE_RES struct LDKCResult_NoneNoneZ Bolt12InvoiceFeatures_set_optional_custom_bit(struct LDKBolt12InvoiceFeatures *NONNULL_PTR this_arg, uintptr_t bit);
46422 * Create a blank Features with no features set
46424 MUST_USE_RES struct LDKBlindedHopFeatures BlindedHopFeatures_empty(void);
46427 * Returns true if this `Features` object contains required features unknown by `other`.
46429 MUST_USE_RES bool BlindedHopFeatures_requires_unknown_bits_from(const struct LDKBlindedHopFeatures *NONNULL_PTR this_arg, const struct LDKBlindedHopFeatures *NONNULL_PTR other);
46432 * Returns true if this `Features` object contains unknown feature flags which are set as
46435 MUST_USE_RES bool BlindedHopFeatures_requires_unknown_bits(const struct LDKBlindedHopFeatures *NONNULL_PTR this_arg);
46438 * Sets a required feature bit. Errors if `bit` is outside the feature range as defined
46441 * Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
46442 * be set instead (i.e., `bit - 1`).
46444 * [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
46446 MUST_USE_RES struct LDKCResult_NoneNoneZ BlindedHopFeatures_set_required_feature_bit(struct LDKBlindedHopFeatures *NONNULL_PTR this_arg, uintptr_t bit);
46449 * Sets an optional feature bit. Errors if `bit` is outside the feature range as defined
46452 * Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
46453 * set instead (i.e., `bit + 1`).
46455 * [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
46457 MUST_USE_RES struct LDKCResult_NoneNoneZ BlindedHopFeatures_set_optional_feature_bit(struct LDKBlindedHopFeatures *NONNULL_PTR this_arg, uintptr_t bit);
46460 * Sets a required custom feature bit. Errors if `bit` is outside the custom range as defined
46461 * by [bLIP 2] or if it is a known `T` feature.
46463 * Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
46464 * be set instead (i.e., `bit - 1`).
46466 * [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
46468 MUST_USE_RES struct LDKCResult_NoneNoneZ BlindedHopFeatures_set_required_custom_bit(struct LDKBlindedHopFeatures *NONNULL_PTR this_arg, uintptr_t bit);
46471 * Sets an optional custom feature bit. Errors if `bit` is outside the custom range as defined
46472 * by [bLIP 2] or if it is a known `T` feature.
46474 * Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
46475 * set instead (i.e., `bit + 1`).
46477 * [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
46479 MUST_USE_RES struct LDKCResult_NoneNoneZ BlindedHopFeatures_set_optional_custom_bit(struct LDKBlindedHopFeatures *NONNULL_PTR this_arg, uintptr_t bit);
46482 * Create a blank Features with no features set
46484 MUST_USE_RES struct LDKChannelTypeFeatures ChannelTypeFeatures_empty(void);
46487 * Returns true if this `Features` object contains required features unknown by `other`.
46489 MUST_USE_RES bool ChannelTypeFeatures_requires_unknown_bits_from(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg, const struct LDKChannelTypeFeatures *NONNULL_PTR other);
46492 * Returns true if this `Features` object contains unknown feature flags which are set as
46495 MUST_USE_RES bool ChannelTypeFeatures_requires_unknown_bits(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
46498 * Sets a required feature bit. Errors if `bit` is outside the feature range as defined
46501 * Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
46502 * be set instead (i.e., `bit - 1`).
46504 * [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
46506 MUST_USE_RES struct LDKCResult_NoneNoneZ ChannelTypeFeatures_set_required_feature_bit(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg, uintptr_t bit);
46509 * Sets an optional feature bit. Errors if `bit` is outside the feature range as defined
46512 * Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
46513 * set instead (i.e., `bit + 1`).
46515 * [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
46517 MUST_USE_RES struct LDKCResult_NoneNoneZ ChannelTypeFeatures_set_optional_feature_bit(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg, uintptr_t bit);
46520 * Sets a required custom feature bit. Errors if `bit` is outside the custom range as defined
46521 * by [bLIP 2] or if it is a known `T` feature.
46523 * Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
46524 * be set instead (i.e., `bit - 1`).
46526 * [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
46528 MUST_USE_RES struct LDKCResult_NoneNoneZ ChannelTypeFeatures_set_required_custom_bit(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg, uintptr_t bit);
46531 * Sets an optional custom feature bit. Errors if `bit` is outside the custom range as defined
46532 * by [bLIP 2] or if it is a known `T` feature.
46534 * Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
46535 * set instead (i.e., `bit + 1`).
46537 * [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
46539 MUST_USE_RES struct LDKCResult_NoneNoneZ ChannelTypeFeatures_set_optional_custom_bit(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg, uintptr_t bit);
46542 * Serialize the InitFeatures object into a byte array which can be read by InitFeatures_read
46544 struct LDKCVec_u8Z InitFeatures_write(const struct LDKInitFeatures *NONNULL_PTR obj);
46547 * Read a InitFeatures from a byte array, created by InitFeatures_write
46549 struct LDKCResult_InitFeaturesDecodeErrorZ InitFeatures_read(struct LDKu8slice ser);
46552 * Serialize the ChannelFeatures object into a byte array which can be read by ChannelFeatures_read
46554 struct LDKCVec_u8Z ChannelFeatures_write(const struct LDKChannelFeatures *NONNULL_PTR obj);
46557 * Read a ChannelFeatures from a byte array, created by ChannelFeatures_write
46559 struct LDKCResult_ChannelFeaturesDecodeErrorZ ChannelFeatures_read(struct LDKu8slice ser);
46562 * Serialize the NodeFeatures object into a byte array which can be read by NodeFeatures_read
46564 struct LDKCVec_u8Z NodeFeatures_write(const struct LDKNodeFeatures *NONNULL_PTR obj);
46567 * Read a NodeFeatures from a byte array, created by NodeFeatures_write
46569 struct LDKCResult_NodeFeaturesDecodeErrorZ NodeFeatures_read(struct LDKu8slice ser);
46572 * Serialize the Bolt11InvoiceFeatures object into a byte array which can be read by Bolt11InvoiceFeatures_read
46574 struct LDKCVec_u8Z Bolt11InvoiceFeatures_write(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR obj);
46577 * Read a Bolt11InvoiceFeatures from a byte array, created by Bolt11InvoiceFeatures_write
46579 struct LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZ Bolt11InvoiceFeatures_read(struct LDKu8slice ser);
46582 * Serialize the Bolt12InvoiceFeatures object into a byte array which can be read by Bolt12InvoiceFeatures_read
46584 struct LDKCVec_u8Z Bolt12InvoiceFeatures_write(const struct LDKBolt12InvoiceFeatures *NONNULL_PTR obj);
46587 * Read a Bolt12InvoiceFeatures from a byte array, created by Bolt12InvoiceFeatures_write
46589 struct LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZ Bolt12InvoiceFeatures_read(struct LDKu8slice ser);
46592 * Serialize the BlindedHopFeatures object into a byte array which can be read by BlindedHopFeatures_read
46594 struct LDKCVec_u8Z BlindedHopFeatures_write(const struct LDKBlindedHopFeatures *NONNULL_PTR obj);
46597 * Read a BlindedHopFeatures from a byte array, created by BlindedHopFeatures_write
46599 struct LDKCResult_BlindedHopFeaturesDecodeErrorZ BlindedHopFeatures_read(struct LDKu8slice ser);
46602 * Serialize the ChannelTypeFeatures object into a byte array which can be read by ChannelTypeFeatures_read
46604 struct LDKCVec_u8Z ChannelTypeFeatures_write(const struct LDKChannelTypeFeatures *NONNULL_PTR obj);
46607 * Read a ChannelTypeFeatures from a byte array, created by ChannelTypeFeatures_write
46609 struct LDKCResult_ChannelTypeFeaturesDecodeErrorZ ChannelTypeFeatures_read(struct LDKu8slice ser);
46612 * Set this feature as optional.
46614 void InitFeatures_set_data_loss_protect_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
46617 * Set this feature as required.
46619 void InitFeatures_set_data_loss_protect_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
46622 * Checks if this feature is supported.
46624 MUST_USE_RES bool InitFeatures_supports_data_loss_protect(const struct LDKInitFeatures *NONNULL_PTR this_arg);
46627 * Set this feature as optional.
46629 void NodeFeatures_set_data_loss_protect_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
46632 * Set this feature as required.
46634 void NodeFeatures_set_data_loss_protect_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
46637 * Checks if this feature is supported.
46639 MUST_USE_RES bool NodeFeatures_supports_data_loss_protect(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
46642 * Checks if this feature is required.
46644 MUST_USE_RES bool InitFeatures_requires_data_loss_protect(const struct LDKInitFeatures *NONNULL_PTR this_arg);
46647 * Checks if this feature is required.
46649 MUST_USE_RES bool NodeFeatures_requires_data_loss_protect(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
46652 * Set this feature as optional.
46654 void InitFeatures_set_initial_routing_sync_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
46657 * Set this feature as required.
46659 void InitFeatures_set_initial_routing_sync_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
46662 * Checks if this feature is supported.
46664 MUST_USE_RES bool InitFeatures_initial_routing_sync(const struct LDKInitFeatures *NONNULL_PTR this_arg);
46667 * Set this feature as optional.
46669 void InitFeatures_set_upfront_shutdown_script_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
46672 * Set this feature as required.
46674 void InitFeatures_set_upfront_shutdown_script_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
46677 * Checks if this feature is supported.
46679 MUST_USE_RES bool InitFeatures_supports_upfront_shutdown_script(const struct LDKInitFeatures *NONNULL_PTR this_arg);
46682 * Set this feature as optional.
46684 void NodeFeatures_set_upfront_shutdown_script_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
46687 * Set this feature as required.
46689 void NodeFeatures_set_upfront_shutdown_script_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
46692 * Checks if this feature is supported.
46694 MUST_USE_RES bool NodeFeatures_supports_upfront_shutdown_script(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
46697 * Checks if this feature is required.
46699 MUST_USE_RES bool InitFeatures_requires_upfront_shutdown_script(const struct LDKInitFeatures *NONNULL_PTR this_arg);
46702 * Checks if this feature is required.
46704 MUST_USE_RES bool NodeFeatures_requires_upfront_shutdown_script(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
46707 * Set this feature as optional.
46709 void InitFeatures_set_gossip_queries_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
46712 * Set this feature as required.
46714 void InitFeatures_set_gossip_queries_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
46717 * Checks if this feature is supported.
46719 MUST_USE_RES bool InitFeatures_supports_gossip_queries(const struct LDKInitFeatures *NONNULL_PTR this_arg);
46722 * Set this feature as optional.
46724 void NodeFeatures_set_gossip_queries_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
46727 * Set this feature as required.
46729 void NodeFeatures_set_gossip_queries_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
46732 * Checks if this feature is supported.
46734 MUST_USE_RES bool NodeFeatures_supports_gossip_queries(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
46737 * Checks if this feature is required.
46739 MUST_USE_RES bool InitFeatures_requires_gossip_queries(const struct LDKInitFeatures *NONNULL_PTR this_arg);
46742 * Checks if this feature is required.
46744 MUST_USE_RES bool NodeFeatures_requires_gossip_queries(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
46747 * Set this feature as optional.
46749 void InitFeatures_set_variable_length_onion_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
46752 * Set this feature as required.
46754 void InitFeatures_set_variable_length_onion_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
46757 * Checks if this feature is supported.
46759 MUST_USE_RES bool InitFeatures_supports_variable_length_onion(const struct LDKInitFeatures *NONNULL_PTR this_arg);
46762 * Set this feature as optional.
46764 void NodeFeatures_set_variable_length_onion_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
46767 * Set this feature as required.
46769 void NodeFeatures_set_variable_length_onion_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
46772 * Checks if this feature is supported.
46774 MUST_USE_RES bool NodeFeatures_supports_variable_length_onion(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
46777 * Set this feature as optional.
46779 void Bolt11InvoiceFeatures_set_variable_length_onion_optional(struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg);
46782 * Set this feature as required.
46784 void Bolt11InvoiceFeatures_set_variable_length_onion_required(struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg);
46787 * Checks if this feature is supported.
46789 MUST_USE_RES bool Bolt11InvoiceFeatures_supports_variable_length_onion(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg);
46792 * Checks if this feature is required.
46794 MUST_USE_RES bool InitFeatures_requires_variable_length_onion(const struct LDKInitFeatures *NONNULL_PTR this_arg);
46797 * Checks if this feature is required.
46799 MUST_USE_RES bool NodeFeatures_requires_variable_length_onion(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
46802 * Checks if this feature is required.
46804 MUST_USE_RES bool Bolt11InvoiceFeatures_requires_variable_length_onion(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg);
46807 * Set this feature as optional.
46809 void InitFeatures_set_static_remote_key_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
46812 * Set this feature as required.
46814 void InitFeatures_set_static_remote_key_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
46817 * Checks if this feature is supported.
46819 MUST_USE_RES bool InitFeatures_supports_static_remote_key(const struct LDKInitFeatures *NONNULL_PTR this_arg);
46822 * Set this feature as optional.
46824 void NodeFeatures_set_static_remote_key_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
46827 * Set this feature as required.
46829 void NodeFeatures_set_static_remote_key_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
46832 * Checks if this feature is supported.
46834 MUST_USE_RES bool NodeFeatures_supports_static_remote_key(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
46837 * Set this feature as optional.
46839 void ChannelTypeFeatures_set_static_remote_key_optional(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
46842 * Set this feature as required.
46844 void ChannelTypeFeatures_set_static_remote_key_required(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
46847 * Checks if this feature is supported.
46849 MUST_USE_RES bool ChannelTypeFeatures_supports_static_remote_key(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
46852 * Checks if this feature is required.
46854 MUST_USE_RES bool InitFeatures_requires_static_remote_key(const struct LDKInitFeatures *NONNULL_PTR this_arg);
46857 * Checks if this feature is required.
46859 MUST_USE_RES bool NodeFeatures_requires_static_remote_key(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
46862 * Checks if this feature is required.
46864 MUST_USE_RES bool ChannelTypeFeatures_requires_static_remote_key(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
46867 * Set this feature as optional.
46869 void InitFeatures_set_payment_secret_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
46872 * Set this feature as required.
46874 void InitFeatures_set_payment_secret_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
46877 * Checks if this feature is supported.
46879 MUST_USE_RES bool InitFeatures_supports_payment_secret(const struct LDKInitFeatures *NONNULL_PTR this_arg);
46882 * Set this feature as optional.
46884 void NodeFeatures_set_payment_secret_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
46887 * Set this feature as required.
46889 void NodeFeatures_set_payment_secret_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
46892 * Checks if this feature is supported.
46894 MUST_USE_RES bool NodeFeatures_supports_payment_secret(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
46897 * Set this feature as optional.
46899 void Bolt11InvoiceFeatures_set_payment_secret_optional(struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg);
46902 * Set this feature as required.
46904 void Bolt11InvoiceFeatures_set_payment_secret_required(struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg);
46907 * Checks if this feature is supported.
46909 MUST_USE_RES bool Bolt11InvoiceFeatures_supports_payment_secret(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg);
46912 * Checks if this feature is required.
46914 MUST_USE_RES bool InitFeatures_requires_payment_secret(const struct LDKInitFeatures *NONNULL_PTR this_arg);
46917 * Checks if this feature is required.
46919 MUST_USE_RES bool NodeFeatures_requires_payment_secret(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
46922 * Checks if this feature is required.
46924 MUST_USE_RES bool Bolt11InvoiceFeatures_requires_payment_secret(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg);
46927 * Set this feature as optional.
46929 void InitFeatures_set_basic_mpp_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
46932 * Set this feature as required.
46934 void InitFeatures_set_basic_mpp_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
46937 * Checks if this feature is supported.
46939 MUST_USE_RES bool InitFeatures_supports_basic_mpp(const struct LDKInitFeatures *NONNULL_PTR this_arg);
46942 * Set this feature as optional.
46944 void NodeFeatures_set_basic_mpp_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
46947 * Set this feature as required.
46949 void NodeFeatures_set_basic_mpp_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
46952 * Checks if this feature is supported.
46954 MUST_USE_RES bool NodeFeatures_supports_basic_mpp(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
46957 * Set this feature as optional.
46959 void Bolt11InvoiceFeatures_set_basic_mpp_optional(struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg);
46962 * Set this feature as required.
46964 void Bolt11InvoiceFeatures_set_basic_mpp_required(struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg);
46967 * Checks if this feature is supported.
46969 MUST_USE_RES bool Bolt11InvoiceFeatures_supports_basic_mpp(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg);
46972 * Set this feature as optional.
46974 void Bolt12InvoiceFeatures_set_basic_mpp_optional(struct LDKBolt12InvoiceFeatures *NONNULL_PTR this_arg);
46977 * Set this feature as required.
46979 void Bolt12InvoiceFeatures_set_basic_mpp_required(struct LDKBolt12InvoiceFeatures *NONNULL_PTR this_arg);
46982 * Checks if this feature is supported.
46984 MUST_USE_RES bool Bolt12InvoiceFeatures_supports_basic_mpp(const struct LDKBolt12InvoiceFeatures *NONNULL_PTR this_arg);
46987 * Checks if this feature is required.
46989 MUST_USE_RES bool InitFeatures_requires_basic_mpp(const struct LDKInitFeatures *NONNULL_PTR this_arg);
46992 * Checks if this feature is required.
46994 MUST_USE_RES bool NodeFeatures_requires_basic_mpp(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
46997 * Checks if this feature is required.
46999 MUST_USE_RES bool Bolt11InvoiceFeatures_requires_basic_mpp(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg);
47002 * Checks if this feature is required.
47004 MUST_USE_RES bool Bolt12InvoiceFeatures_requires_basic_mpp(const struct LDKBolt12InvoiceFeatures *NONNULL_PTR this_arg);
47007 * Set this feature as optional.
47009 void InitFeatures_set_wumbo_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
47012 * Set this feature as required.
47014 void InitFeatures_set_wumbo_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
47017 * Checks if this feature is supported.
47019 MUST_USE_RES bool InitFeatures_supports_wumbo(const struct LDKInitFeatures *NONNULL_PTR this_arg);
47022 * Set this feature as optional.
47024 void NodeFeatures_set_wumbo_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
47027 * Set this feature as required.
47029 void NodeFeatures_set_wumbo_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
47032 * Checks if this feature is supported.
47034 MUST_USE_RES bool NodeFeatures_supports_wumbo(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
47037 * Checks if this feature is required.
47039 MUST_USE_RES bool InitFeatures_requires_wumbo(const struct LDKInitFeatures *NONNULL_PTR this_arg);
47042 * Checks if this feature is required.
47044 MUST_USE_RES bool NodeFeatures_requires_wumbo(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
47047 * Set this feature as optional.
47049 void InitFeatures_set_anchors_nonzero_fee_htlc_tx_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
47052 * Set this feature as required.
47054 void InitFeatures_set_anchors_nonzero_fee_htlc_tx_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
47057 * Checks if this feature is supported.
47059 MUST_USE_RES bool InitFeatures_supports_anchors_nonzero_fee_htlc_tx(const struct LDKInitFeatures *NONNULL_PTR this_arg);
47062 * Set this feature as optional.
47064 void NodeFeatures_set_anchors_nonzero_fee_htlc_tx_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
47067 * Set this feature as required.
47069 void NodeFeatures_set_anchors_nonzero_fee_htlc_tx_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
47072 * Checks if this feature is supported.
47074 MUST_USE_RES bool NodeFeatures_supports_anchors_nonzero_fee_htlc_tx(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
47077 * Set this feature as optional.
47079 void ChannelTypeFeatures_set_anchors_nonzero_fee_htlc_tx_optional(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
47082 * Set this feature as required.
47084 void ChannelTypeFeatures_set_anchors_nonzero_fee_htlc_tx_required(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
47087 * Checks if this feature is supported.
47089 MUST_USE_RES bool ChannelTypeFeatures_supports_anchors_nonzero_fee_htlc_tx(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
47092 * Checks if this feature is required.
47094 MUST_USE_RES bool InitFeatures_requires_anchors_nonzero_fee_htlc_tx(const struct LDKInitFeatures *NONNULL_PTR this_arg);
47097 * Checks if this feature is required.
47099 MUST_USE_RES bool NodeFeatures_requires_anchors_nonzero_fee_htlc_tx(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
47102 * Checks if this feature is required.
47104 MUST_USE_RES bool ChannelTypeFeatures_requires_anchors_nonzero_fee_htlc_tx(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
47107 * Set this feature as optional.
47109 void InitFeatures_set_anchors_zero_fee_htlc_tx_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
47112 * Set this feature as required.
47114 void InitFeatures_set_anchors_zero_fee_htlc_tx_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
47117 * Checks if this feature is supported.
47119 MUST_USE_RES bool InitFeatures_supports_anchors_zero_fee_htlc_tx(const struct LDKInitFeatures *NONNULL_PTR this_arg);
47122 * Set this feature as optional.
47124 void NodeFeatures_set_anchors_zero_fee_htlc_tx_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
47127 * Set this feature as required.
47129 void NodeFeatures_set_anchors_zero_fee_htlc_tx_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
47132 * Checks if this feature is supported.
47134 MUST_USE_RES bool NodeFeatures_supports_anchors_zero_fee_htlc_tx(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
47137 * Set this feature as optional.
47139 void ChannelTypeFeatures_set_anchors_zero_fee_htlc_tx_optional(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
47142 * Set this feature as required.
47144 void ChannelTypeFeatures_set_anchors_zero_fee_htlc_tx_required(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
47147 * Checks if this feature is supported.
47149 MUST_USE_RES bool ChannelTypeFeatures_supports_anchors_zero_fee_htlc_tx(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
47152 * Checks if this feature is required.
47154 MUST_USE_RES bool InitFeatures_requires_anchors_zero_fee_htlc_tx(const struct LDKInitFeatures *NONNULL_PTR this_arg);
47157 * Checks if this feature is required.
47159 MUST_USE_RES bool NodeFeatures_requires_anchors_zero_fee_htlc_tx(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
47162 * Checks if this feature is required.
47164 MUST_USE_RES bool ChannelTypeFeatures_requires_anchors_zero_fee_htlc_tx(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
47167 * Set this feature as optional.
47169 void InitFeatures_set_route_blinding_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
47172 * Set this feature as required.
47174 void InitFeatures_set_route_blinding_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
47177 * Checks if this feature is supported.
47179 MUST_USE_RES bool InitFeatures_supports_route_blinding(const struct LDKInitFeatures *NONNULL_PTR this_arg);
47182 * Set this feature as optional.
47184 void NodeFeatures_set_route_blinding_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
47187 * Set this feature as required.
47189 void NodeFeatures_set_route_blinding_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
47192 * Checks if this feature is supported.
47194 MUST_USE_RES bool NodeFeatures_supports_route_blinding(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
47197 * Checks if this feature is required.
47199 MUST_USE_RES bool InitFeatures_requires_route_blinding(const struct LDKInitFeatures *NONNULL_PTR this_arg);
47202 * Checks if this feature is required.
47204 MUST_USE_RES bool NodeFeatures_requires_route_blinding(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
47207 * Set this feature as optional.
47209 void InitFeatures_set_shutdown_any_segwit_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
47212 * Set this feature as required.
47214 void InitFeatures_set_shutdown_any_segwit_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
47217 * Checks if this feature is supported.
47219 MUST_USE_RES bool InitFeatures_supports_shutdown_anysegwit(const struct LDKInitFeatures *NONNULL_PTR this_arg);
47222 * Set this feature as optional.
47224 void NodeFeatures_set_shutdown_any_segwit_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
47227 * Set this feature as required.
47229 void NodeFeatures_set_shutdown_any_segwit_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
47232 * Checks if this feature is supported.
47234 MUST_USE_RES bool NodeFeatures_supports_shutdown_anysegwit(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
47237 * Checks if this feature is required.
47239 MUST_USE_RES bool InitFeatures_requires_shutdown_anysegwit(const struct LDKInitFeatures *NONNULL_PTR this_arg);
47242 * Checks if this feature is required.
47244 MUST_USE_RES bool NodeFeatures_requires_shutdown_anysegwit(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
47247 * Set this feature as optional.
47249 void InitFeatures_set_taproot_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
47252 * Set this feature as required.
47254 void InitFeatures_set_taproot_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
47257 * Checks if this feature is supported.
47259 MUST_USE_RES bool InitFeatures_supports_taproot(const struct LDKInitFeatures *NONNULL_PTR this_arg);
47262 * Set this feature as optional.
47264 void NodeFeatures_set_taproot_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
47267 * Set this feature as required.
47269 void NodeFeatures_set_taproot_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
47272 * Checks if this feature is supported.
47274 MUST_USE_RES bool NodeFeatures_supports_taproot(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
47277 * Set this feature as optional.
47279 void ChannelTypeFeatures_set_taproot_optional(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
47282 * Set this feature as required.
47284 void ChannelTypeFeatures_set_taproot_required(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
47287 * Checks if this feature is supported.
47289 MUST_USE_RES bool ChannelTypeFeatures_supports_taproot(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
47292 * Checks if this feature is required.
47294 MUST_USE_RES bool InitFeatures_requires_taproot(const struct LDKInitFeatures *NONNULL_PTR this_arg);
47297 * Checks if this feature is required.
47299 MUST_USE_RES bool NodeFeatures_requires_taproot(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
47302 * Checks if this feature is required.
47304 MUST_USE_RES bool ChannelTypeFeatures_requires_taproot(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
47307 * Set this feature as optional.
47309 void InitFeatures_set_onion_messages_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
47312 * Set this feature as required.
47314 void InitFeatures_set_onion_messages_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
47317 * Checks if this feature is supported.
47319 MUST_USE_RES bool InitFeatures_supports_onion_messages(const struct LDKInitFeatures *NONNULL_PTR this_arg);
47322 * Set this feature as optional.
47324 void NodeFeatures_set_onion_messages_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
47327 * Set this feature as required.
47329 void NodeFeatures_set_onion_messages_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
47332 * Checks if this feature is supported.
47334 MUST_USE_RES bool NodeFeatures_supports_onion_messages(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
47337 * Checks if this feature is required.
47339 MUST_USE_RES bool InitFeatures_requires_onion_messages(const struct LDKInitFeatures *NONNULL_PTR this_arg);
47342 * Checks if this feature is required.
47344 MUST_USE_RES bool NodeFeatures_requires_onion_messages(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
47347 * Set this feature as optional.
47349 void InitFeatures_set_channel_type_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
47352 * Set this feature as required.
47354 void InitFeatures_set_channel_type_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
47357 * Checks if this feature is supported.
47359 MUST_USE_RES bool InitFeatures_supports_channel_type(const struct LDKInitFeatures *NONNULL_PTR this_arg);
47362 * Set this feature as optional.
47364 void NodeFeatures_set_channel_type_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
47367 * Set this feature as required.
47369 void NodeFeatures_set_channel_type_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
47372 * Checks if this feature is supported.
47374 MUST_USE_RES bool NodeFeatures_supports_channel_type(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
47377 * Checks if this feature is required.
47379 MUST_USE_RES bool InitFeatures_requires_channel_type(const struct LDKInitFeatures *NONNULL_PTR this_arg);
47382 * Checks if this feature is required.
47384 MUST_USE_RES bool NodeFeatures_requires_channel_type(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
47387 * Set this feature as optional.
47389 void InitFeatures_set_scid_privacy_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
47392 * Set this feature as required.
47394 void InitFeatures_set_scid_privacy_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
47397 * Checks if this feature is supported.
47399 MUST_USE_RES bool InitFeatures_supports_scid_privacy(const struct LDKInitFeatures *NONNULL_PTR this_arg);
47402 * Set this feature as optional.
47404 void NodeFeatures_set_scid_privacy_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
47407 * Set this feature as required.
47409 void NodeFeatures_set_scid_privacy_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
47412 * Checks if this feature is supported.
47414 MUST_USE_RES bool NodeFeatures_supports_scid_privacy(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
47417 * Set this feature as optional.
47419 void ChannelTypeFeatures_set_scid_privacy_optional(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
47422 * Set this feature as required.
47424 void ChannelTypeFeatures_set_scid_privacy_required(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
47427 * Checks if this feature is supported.
47429 MUST_USE_RES bool ChannelTypeFeatures_supports_scid_privacy(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
47432 * Checks if this feature is required.
47434 MUST_USE_RES bool InitFeatures_requires_scid_privacy(const struct LDKInitFeatures *NONNULL_PTR this_arg);
47437 * Checks if this feature is required.
47439 MUST_USE_RES bool NodeFeatures_requires_scid_privacy(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
47442 * Checks if this feature is required.
47444 MUST_USE_RES bool ChannelTypeFeatures_requires_scid_privacy(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
47447 * Set this feature as optional.
47449 void Bolt11InvoiceFeatures_set_payment_metadata_optional(struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg);
47452 * Set this feature as required.
47454 void Bolt11InvoiceFeatures_set_payment_metadata_required(struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg);
47457 * Checks if this feature is supported.
47459 MUST_USE_RES bool Bolt11InvoiceFeatures_supports_payment_metadata(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg);
47462 * Checks if this feature is required.
47464 MUST_USE_RES bool Bolt11InvoiceFeatures_requires_payment_metadata(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg);
47467 * Set this feature as optional.
47469 void InitFeatures_set_zero_conf_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
47472 * Set this feature as required.
47474 void InitFeatures_set_zero_conf_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
47477 * Checks if this feature is supported.
47479 MUST_USE_RES bool InitFeatures_supports_zero_conf(const struct LDKInitFeatures *NONNULL_PTR this_arg);
47482 * Set this feature as optional.
47484 void NodeFeatures_set_zero_conf_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
47487 * Set this feature as required.
47489 void NodeFeatures_set_zero_conf_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
47492 * Checks if this feature is supported.
47494 MUST_USE_RES bool NodeFeatures_supports_zero_conf(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
47497 * Set this feature as optional.
47499 void ChannelTypeFeatures_set_zero_conf_optional(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
47502 * Set this feature as required.
47504 void ChannelTypeFeatures_set_zero_conf_required(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
47507 * Checks if this feature is supported.
47509 MUST_USE_RES bool ChannelTypeFeatures_supports_zero_conf(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
47512 * Checks if this feature is required.
47514 MUST_USE_RES bool InitFeatures_requires_zero_conf(const struct LDKInitFeatures *NONNULL_PTR this_arg);
47517 * Checks if this feature is required.
47519 MUST_USE_RES bool NodeFeatures_requires_zero_conf(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
47522 * Checks if this feature is required.
47524 MUST_USE_RES bool ChannelTypeFeatures_requires_zero_conf(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
47527 * Set this feature as optional.
47529 void NodeFeatures_set_keysend_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
47532 * Set this feature as required.
47534 void NodeFeatures_set_keysend_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
47537 * Checks if this feature is supported.
47539 MUST_USE_RES bool NodeFeatures_supports_keysend(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
47542 * Checks if this feature is required.
47544 MUST_USE_RES bool NodeFeatures_requires_keysend(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
47547 * Set this feature as optional.
47549 void InitFeatures_set_trampoline_routing_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
47552 * Set this feature as required.
47554 void InitFeatures_set_trampoline_routing_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
47557 * Checks if this feature is supported.
47559 MUST_USE_RES bool InitFeatures_supports_trampoline_routing(const struct LDKInitFeatures *NONNULL_PTR this_arg);
47562 * Set this feature as optional.
47564 void NodeFeatures_set_trampoline_routing_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
47567 * Set this feature as required.
47569 void NodeFeatures_set_trampoline_routing_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
47572 * Checks if this feature is supported.
47574 MUST_USE_RES bool NodeFeatures_supports_trampoline_routing(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
47577 * Set this feature as optional.
47579 void Bolt11InvoiceFeatures_set_trampoline_routing_optional(struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg);
47582 * Set this feature as required.
47584 void Bolt11InvoiceFeatures_set_trampoline_routing_required(struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg);
47587 * Checks if this feature is supported.
47589 MUST_USE_RES bool Bolt11InvoiceFeatures_supports_trampoline_routing(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg);
47592 * Checks if this feature is required.
47594 MUST_USE_RES bool InitFeatures_requires_trampoline_routing(const struct LDKInitFeatures *NONNULL_PTR this_arg);
47597 * Checks if this feature is required.
47599 MUST_USE_RES bool NodeFeatures_requires_trampoline_routing(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
47602 * Checks if this feature is required.
47604 MUST_USE_RES bool Bolt11InvoiceFeatures_requires_trampoline_routing(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg);
47607 * Frees any resources used by the ShutdownScript, if is_owned is set and inner is non-NULL.
47609 void ShutdownScript_free(struct LDKShutdownScript this_obj);
47612 * Creates a copy of the ShutdownScript
47614 struct LDKShutdownScript ShutdownScript_clone(const struct LDKShutdownScript *NONNULL_PTR orig);
47617 * Checks if two ShutdownScripts contain equal inner contents.
47618 * This ignores pointers and is_owned flags and looks at the values in fields.
47619 * Two objects with NULL inner values will be considered "equal" here.
47621 bool ShutdownScript_eq(const struct LDKShutdownScript *NONNULL_PTR a, const struct LDKShutdownScript *NONNULL_PTR b);
47624 * Frees any resources used by the InvalidShutdownScript, if is_owned is set and inner is non-NULL.
47626 void InvalidShutdownScript_free(struct LDKInvalidShutdownScript this_obj);
47629 * The script that did not meet the requirements from [BOLT #2].
47631 * [BOLT #2]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md
47633 struct LDKCVec_u8Z InvalidShutdownScript_get_script(const struct LDKInvalidShutdownScript *NONNULL_PTR this_ptr);
47636 * The script that did not meet the requirements from [BOLT #2].
47638 * [BOLT #2]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md
47640 void InvalidShutdownScript_set_script(struct LDKInvalidShutdownScript *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val);
47643 * Constructs a new InvalidShutdownScript given each field
47645 MUST_USE_RES struct LDKInvalidShutdownScript InvalidShutdownScript_new(struct LDKCVec_u8Z script_arg);
47648 * Creates a copy of the InvalidShutdownScript
47650 struct LDKInvalidShutdownScript InvalidShutdownScript_clone(const struct LDKInvalidShutdownScript *NONNULL_PTR orig);
47653 * Serialize the ShutdownScript object into a byte array which can be read by ShutdownScript_read
47655 struct LDKCVec_u8Z ShutdownScript_write(const struct LDKShutdownScript *NONNULL_PTR obj);
47658 * Read a ShutdownScript from a byte array, created by ShutdownScript_write
47660 struct LDKCResult_ShutdownScriptDecodeErrorZ ShutdownScript_read(struct LDKu8slice ser);
47663 * Generates a P2WPKH script pubkey from the given [`WPubkeyHash`].
47665 MUST_USE_RES struct LDKShutdownScript ShutdownScript_new_p2wpkh(const uint8_t (*pubkey_hash)[20]);
47668 * Generates a P2WSH script pubkey from the given [`WScriptHash`].
47670 MUST_USE_RES struct LDKShutdownScript ShutdownScript_new_p2wsh(const uint8_t (*script_hash)[32]);
47673 * Generates a witness script pubkey from the given segwit version and program.
47675 * Note for version-zero witness scripts you must use [`ShutdownScript::new_p2wpkh`] or
47676 * [`ShutdownScript::new_p2wsh`] instead.
47680 * This function may return an error if `program` is invalid for the segwit `version`.
47682 MUST_USE_RES struct LDKCResult_ShutdownScriptInvalidShutdownScriptZ ShutdownScript_new_witness_program(struct LDKWitnessProgram witness_program);
47685 * Converts the shutdown script into the underlying [`ScriptBuf`].
47687 MUST_USE_RES struct LDKCVec_u8Z ShutdownScript_into_inner(struct LDKShutdownScript this_arg);
47690 * Returns the [`PublicKey`] used for a P2WPKH shutdown script if constructed directly from it.
47692 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
47694 MUST_USE_RES struct LDKPublicKey ShutdownScript_as_legacy_pubkey(const struct LDKShutdownScript *NONNULL_PTR this_arg);
47697 * Returns whether the shutdown script is compatible with the features as defined by BOLT #2.
47699 * Specifically, checks for compliance with feature `option_shutdown_anysegwit`.
47701 MUST_USE_RES bool ShutdownScript_is_compatible(const struct LDKShutdownScript *NONNULL_PTR this_arg, const struct LDKInitFeatures *NONNULL_PTR features);
47704 * Get the string representation of a ShutdownScript object
47706 struct LDKStr ShutdownScript_to_str(const struct LDKShutdownScript *NONNULL_PTR o);
47709 * Frees any resources used by the ChannelId, if is_owned is set and inner is non-NULL.
47711 void ChannelId_free(struct LDKChannelId this_obj);
47713 const uint8_t (*ChannelId_get_a(const struct LDKChannelId *NONNULL_PTR this_ptr))[32];
47715 void ChannelId_set_a(struct LDKChannelId *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
47718 * Constructs a new ChannelId given each field
47720 MUST_USE_RES struct LDKChannelId ChannelId_new(struct LDKThirtyTwoBytes a_arg);
47723 * Creates a copy of the ChannelId
47725 struct LDKChannelId ChannelId_clone(const struct LDKChannelId *NONNULL_PTR orig);
47728 * Checks if two ChannelIds contain equal inner contents.
47729 * This ignores pointers and is_owned flags and looks at the values in fields.
47730 * Two objects with NULL inner values will be considered "equal" here.
47732 bool ChannelId_eq(const struct LDKChannelId *NONNULL_PTR a, const struct LDKChannelId *NONNULL_PTR b);
47735 * Generates a non-cryptographic 64-bit hash of the ChannelId.
47737 uint64_t ChannelId_hash(const struct LDKChannelId *NONNULL_PTR o);
47740 * Create _v1_ channel ID based on a funding TX ID and output index
47742 MUST_USE_RES struct LDKChannelId ChannelId_v1_from_funding_txid(const uint8_t (*txid)[32], uint16_t output_index);
47745 * Create _v1_ channel ID from a funding tx outpoint
47747 MUST_USE_RES struct LDKChannelId ChannelId_v1_from_funding_outpoint(struct LDKOutPoint outpoint);
47750 * Create a _temporary_ channel ID randomly, based on an entropy source.
47752 MUST_USE_RES struct LDKChannelId ChannelId_temporary_from_entropy_source(const struct LDKEntropySource *NONNULL_PTR entropy_source);
47755 * Generic constructor; create a new channel ID from the provided data.
47756 * Use a more specific `*_from_*` constructor when possible.
47758 MUST_USE_RES struct LDKChannelId ChannelId_from_bytes(struct LDKThirtyTwoBytes data);
47761 * Create a channel ID consisting of all-zeros data (e.g. when uninitialized or a placeholder).
47763 MUST_USE_RES struct LDKChannelId ChannelId_new_zero(void);
47766 * Check whether ID is consisting of all zeros (uninitialized)
47768 MUST_USE_RES bool ChannelId_is_zero(const struct LDKChannelId *NONNULL_PTR this_arg);
47771 * Create _v2_ channel ID by concatenating the holder revocation basepoint with the counterparty
47772 * revocation basepoint and hashing the result. The basepoints will be concatenated in increasing
47775 MUST_USE_RES struct LDKChannelId ChannelId_v2_from_revocation_basepoints(const struct LDKRevocationBasepoint *NONNULL_PTR ours, const struct LDKRevocationBasepoint *NONNULL_PTR theirs);
47778 * Create temporary _v2_ channel ID by concatenating a zeroed out basepoint with the holder
47779 * revocation basepoint and hashing the result.
47781 MUST_USE_RES struct LDKChannelId ChannelId_temporary_v2_from_revocation_basepoint(const struct LDKRevocationBasepoint *NONNULL_PTR our_revocation_basepoint);
47784 * Serialize the ChannelId object into a byte array which can be read by ChannelId_read
47786 struct LDKCVec_u8Z ChannelId_write(const struct LDKChannelId *NONNULL_PTR obj);
47789 * Read a ChannelId from a byte array, created by ChannelId_write
47791 struct LDKCResult_ChannelIdDecodeErrorZ ChannelId_read(struct LDKu8slice ser);
47794 * Get the string representation of a ChannelId object
47796 struct LDKStr ChannelId_to_str(const struct LDKChannelId *NONNULL_PTR o);
47799 * Frees any resources used by the Retry
47801 void Retry_free(struct LDKRetry this_ptr);
47804 * Creates a copy of the Retry
47806 struct LDKRetry Retry_clone(const struct LDKRetry *NONNULL_PTR orig);
47809 * Utility method to constructs a new Attempts-variant Retry
47811 struct LDKRetry Retry_attempts(uint32_t a);
47814 * Utility method to constructs a new Timeout-variant Retry
47816 struct LDKRetry Retry_timeout(uint64_t a);
47819 * Checks if two Retrys contain equal inner contents.
47820 * This ignores pointers and is_owned flags and looks at the values in fields.
47822 bool Retry_eq(const struct LDKRetry *NONNULL_PTR a, const struct LDKRetry *NONNULL_PTR b);
47825 * Generates a non-cryptographic 64-bit hash of the Retry.
47827 uint64_t Retry_hash(const struct LDKRetry *NONNULL_PTR o);
47830 * Serialize the Retry object into a byte array which can be read by Retry_read
47832 struct LDKCVec_u8Z Retry_write(const struct LDKRetry *NONNULL_PTR obj);
47835 * Read a Retry from a byte array, created by Retry_write
47837 struct LDKCResult_RetryDecodeErrorZ Retry_read(struct LDKu8slice ser);
47840 * Creates a copy of the RetryableSendFailure
47842 enum LDKRetryableSendFailure RetryableSendFailure_clone(const enum LDKRetryableSendFailure *NONNULL_PTR orig);
47845 * Utility method to constructs a new PaymentExpired-variant RetryableSendFailure
47847 enum LDKRetryableSendFailure RetryableSendFailure_payment_expired(void);
47850 * Utility method to constructs a new RouteNotFound-variant RetryableSendFailure
47852 enum LDKRetryableSendFailure RetryableSendFailure_route_not_found(void);
47855 * Utility method to constructs a new DuplicatePayment-variant RetryableSendFailure
47857 enum LDKRetryableSendFailure RetryableSendFailure_duplicate_payment(void);
47860 * Checks if two RetryableSendFailures contain equal inner contents.
47861 * This ignores pointers and is_owned flags and looks at the values in fields.
47863 bool RetryableSendFailure_eq(const enum LDKRetryableSendFailure *NONNULL_PTR a, const enum LDKRetryableSendFailure *NONNULL_PTR b);
47866 * Frees any resources used by the PaymentSendFailure
47868 void PaymentSendFailure_free(struct LDKPaymentSendFailure this_ptr);
47871 * Creates a copy of the PaymentSendFailure
47873 struct LDKPaymentSendFailure PaymentSendFailure_clone(const struct LDKPaymentSendFailure *NONNULL_PTR orig);
47876 * Utility method to constructs a new ParameterError-variant PaymentSendFailure
47878 struct LDKPaymentSendFailure PaymentSendFailure_parameter_error(struct LDKAPIError a);
47881 * Utility method to constructs a new PathParameterError-variant PaymentSendFailure
47883 struct LDKPaymentSendFailure PaymentSendFailure_path_parameter_error(struct LDKCVec_CResult_NoneAPIErrorZZ a);
47886 * Utility method to constructs a new AllFailedResendSafe-variant PaymentSendFailure
47888 struct LDKPaymentSendFailure PaymentSendFailure_all_failed_resend_safe(struct LDKCVec_APIErrorZ a);
47891 * Utility method to constructs a new DuplicatePayment-variant PaymentSendFailure
47893 struct LDKPaymentSendFailure PaymentSendFailure_duplicate_payment(void);
47896 * Utility method to constructs a new PartialFailure-variant PaymentSendFailure
47898 struct LDKPaymentSendFailure PaymentSendFailure_partial_failure(struct LDKCVec_CResult_NoneAPIErrorZZ results, struct LDKRouteParameters failed_paths_retry, struct LDKThirtyTwoBytes payment_id);
47901 * Checks if two PaymentSendFailures contain equal inner contents.
47902 * This ignores pointers and is_owned flags and looks at the values in fields.
47904 bool PaymentSendFailure_eq(const struct LDKPaymentSendFailure *NONNULL_PTR a, const struct LDKPaymentSendFailure *NONNULL_PTR b);
47907 * Frees any resources used by the ProbeSendFailure
47909 void ProbeSendFailure_free(struct LDKProbeSendFailure this_ptr);
47912 * Creates a copy of the ProbeSendFailure
47914 struct LDKProbeSendFailure ProbeSendFailure_clone(const struct LDKProbeSendFailure *NONNULL_PTR orig);
47917 * Utility method to constructs a new RouteNotFound-variant ProbeSendFailure
47919 struct LDKProbeSendFailure ProbeSendFailure_route_not_found(void);
47922 * Utility method to constructs a new SendingFailed-variant ProbeSendFailure
47924 struct LDKProbeSendFailure ProbeSendFailure_sending_failed(struct LDKPaymentSendFailure a);
47927 * Checks if two ProbeSendFailures contain equal inner contents.
47928 * This ignores pointers and is_owned flags and looks at the values in fields.
47930 bool ProbeSendFailure_eq(const struct LDKProbeSendFailure *NONNULL_PTR a, const struct LDKProbeSendFailure *NONNULL_PTR b);
47933 * Frees any resources used by the RecipientOnionFields, if is_owned is set and inner is non-NULL.
47935 void RecipientOnionFields_free(struct LDKRecipientOnionFields this_obj);
47938 * The [`PaymentSecret`] is an arbitrary 32 bytes provided by the recipient for us to repeat
47939 * in the onion. It is unrelated to `payment_hash` (or [`PaymentPreimage`]) and exists to
47940 * authenticate the sender to the recipient and prevent payment-probing (deanonymization)
47943 * If you do not have one, the [`Route`] you pay over must not contain multiple paths as
47944 * multi-path payments require a recipient-provided secret.
47946 * Some implementations may reject spontaneous payments with payment secrets, so you may only
47947 * want to provide a secret for a spontaneous payment if MPP is needed and you know your
47948 * recipient will not reject it.
47950 struct LDKCOption_ThirtyTwoBytesZ RecipientOnionFields_get_payment_secret(const struct LDKRecipientOnionFields *NONNULL_PTR this_ptr);
47953 * The [`PaymentSecret`] is an arbitrary 32 bytes provided by the recipient for us to repeat
47954 * in the onion. It is unrelated to `payment_hash` (or [`PaymentPreimage`]) and exists to
47955 * authenticate the sender to the recipient and prevent payment-probing (deanonymization)
47958 * If you do not have one, the [`Route`] you pay over must not contain multiple paths as
47959 * multi-path payments require a recipient-provided secret.
47961 * Some implementations may reject spontaneous payments with payment secrets, so you may only
47962 * want to provide a secret for a spontaneous payment if MPP is needed and you know your
47963 * recipient will not reject it.
47965 void RecipientOnionFields_set_payment_secret(struct LDKRecipientOnionFields *NONNULL_PTR this_ptr, struct LDKCOption_ThirtyTwoBytesZ val);
47968 * The payment metadata serves a similar purpose as [`Self::payment_secret`] but is of
47969 * arbitrary length. This gives recipients substantially more flexibility to receive
47972 * In LDK, while the [`Self::payment_secret`] is fixed based on an internal authentication
47973 * scheme to authenticate received payments against expected payments and invoices, this field
47974 * is not used in LDK for received payments, and can be used to store arbitrary data in
47975 * invoices which will be received with the payment.
47977 * Note that this field was added to the lightning specification more recently than
47978 * [`Self::payment_secret`] and while nearly all lightning senders support secrets, metadata
47979 * may not be supported as universally.
47981 * Returns a copy of the field.
47983 struct LDKCOption_CVec_u8ZZ RecipientOnionFields_get_payment_metadata(const struct LDKRecipientOnionFields *NONNULL_PTR this_ptr);
47986 * The payment metadata serves a similar purpose as [`Self::payment_secret`] but is of
47987 * arbitrary length. This gives recipients substantially more flexibility to receive
47990 * In LDK, while the [`Self::payment_secret`] is fixed based on an internal authentication
47991 * scheme to authenticate received payments against expected payments and invoices, this field
47992 * is not used in LDK for received payments, and can be used to store arbitrary data in
47993 * invoices which will be received with the payment.
47995 * Note that this field was added to the lightning specification more recently than
47996 * [`Self::payment_secret`] and while nearly all lightning senders support secrets, metadata
47997 * may not be supported as universally.
47999 void RecipientOnionFields_set_payment_metadata(struct LDKRecipientOnionFields *NONNULL_PTR this_ptr, struct LDKCOption_CVec_u8ZZ val);
48002 * Creates a copy of the RecipientOnionFields
48004 struct LDKRecipientOnionFields RecipientOnionFields_clone(const struct LDKRecipientOnionFields *NONNULL_PTR orig);
48007 * Checks if two RecipientOnionFieldss contain equal inner contents.
48008 * This ignores pointers and is_owned flags and looks at the values in fields.
48009 * Two objects with NULL inner values will be considered "equal" here.
48011 bool RecipientOnionFields_eq(const struct LDKRecipientOnionFields *NONNULL_PTR a, const struct LDKRecipientOnionFields *NONNULL_PTR b);
48014 * Serialize the RecipientOnionFields object into a byte array which can be read by RecipientOnionFields_read
48016 struct LDKCVec_u8Z RecipientOnionFields_write(const struct LDKRecipientOnionFields *NONNULL_PTR obj);
48019 * Read a RecipientOnionFields from a byte array, created by RecipientOnionFields_write
48021 struct LDKCResult_RecipientOnionFieldsDecodeErrorZ RecipientOnionFields_read(struct LDKu8slice ser);
48024 * Creates a [`RecipientOnionFields`] from only a [`PaymentSecret`]. This is the most common
48025 * set of onion fields for today's BOLT11 invoices - most nodes require a [`PaymentSecret`]
48026 * but do not require or provide any further data.
48028 MUST_USE_RES struct LDKRecipientOnionFields RecipientOnionFields_secret_only(struct LDKThirtyTwoBytes payment_secret);
48031 * Creates a new [`RecipientOnionFields`] with no fields. This generally does not create
48032 * payable HTLCs except for single-path spontaneous payments, i.e. this should generally
48033 * only be used for calls to [`ChannelManager::send_spontaneous_payment`]. If you are sending
48034 * a spontaneous MPP this will not work as all MPP require payment secrets; you may
48035 * instead want to use [`RecipientOnionFields::secret_only`].
48037 * [`ChannelManager::send_spontaneous_payment`]: super::channelmanager::ChannelManager::send_spontaneous_payment
48038 * [`RecipientOnionFields::secret_only`]: RecipientOnionFields::secret_only
48040 MUST_USE_RES struct LDKRecipientOnionFields RecipientOnionFields_spontaneous_empty(void);
48043 * Creates a new [`RecipientOnionFields`] from an existing one, adding custom TLVs. Each
48044 * TLV is provided as a `(u64, Vec<u8>)` for the type number and serialized value
48045 * respectively. TLV type numbers must be unique and within the range
48046 * reserved for custom types, i.e. >= 2^16, otherwise this method will return `Err(())`.
48048 * This method will also error for types in the experimental range which have been
48049 * standardized within the protocol, which only includes 5482373484 (keysend) for now.
48051 * See [`Self::custom_tlvs`] for more info.
48053 MUST_USE_RES struct LDKCResult_RecipientOnionFieldsNoneZ RecipientOnionFields_with_custom_tlvs(struct LDKRecipientOnionFields this_arg, struct LDKCVec_C2Tuple_u64CVec_u8ZZZ custom_tlvs);
48056 * Gets the custom TLVs that will be sent or have been received.
48058 * Custom TLVs allow sending extra application-specific data with a payment. They provide
48059 * additional flexibility on top of payment metadata, as while other implementations may
48060 * require `payment_metadata` to reflect metadata provided in an invoice, custom TLVs
48061 * do not have this restriction.
48063 * Note that if this field is non-empty, it will contain strictly increasing TLVs, each
48064 * represented by a `(u64, Vec<u8>)` for its type number and serialized value respectively.
48065 * This is validated when setting this field using [`Self::with_custom_tlvs`].
48067 MUST_USE_RES struct LDKCVec_C2Tuple_u64CVec_u8ZZZ RecipientOnionFields_custom_tlvs(const struct LDKRecipientOnionFields *NONNULL_PTR this_arg);
48070 * Calls the free function if one is set
48072 void CustomMessageReader_free(struct LDKCustomMessageReader this_ptr);
48075 * Creates a copy of a Type
48077 struct LDKType Type_clone(const struct LDKType *NONNULL_PTR orig);
48080 * Calls the free function if one is set
48082 void Type_free(struct LDKType this_ptr);
48085 * Frees any resources used by the OfferId, if is_owned is set and inner is non-NULL.
48087 void OfferId_free(struct LDKOfferId this_obj);
48089 const uint8_t (*OfferId_get_a(const struct LDKOfferId *NONNULL_PTR this_ptr))[32];
48091 void OfferId_set_a(struct LDKOfferId *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
48094 * Constructs a new OfferId given each field
48096 MUST_USE_RES struct LDKOfferId OfferId_new(struct LDKThirtyTwoBytes a_arg);
48099 * Creates a copy of the OfferId
48101 struct LDKOfferId OfferId_clone(const struct LDKOfferId *NONNULL_PTR orig);
48104 * Checks if two OfferIds contain equal inner contents.
48105 * This ignores pointers and is_owned flags and looks at the values in fields.
48106 * Two objects with NULL inner values will be considered "equal" here.
48108 bool OfferId_eq(const struct LDKOfferId *NONNULL_PTR a, const struct LDKOfferId *NONNULL_PTR b);
48111 * Serialize the OfferId object into a byte array which can be read by OfferId_read
48113 struct LDKCVec_u8Z OfferId_write(const struct LDKOfferId *NONNULL_PTR obj);
48116 * Read a OfferId from a byte array, created by OfferId_write
48118 struct LDKCResult_OfferIdDecodeErrorZ OfferId_read(struct LDKu8slice ser);
48121 * Frees any resources used by the OfferWithExplicitMetadataBuilder, if is_owned is set and inner is non-NULL.
48123 void OfferWithExplicitMetadataBuilder_free(struct LDKOfferWithExplicitMetadataBuilder this_obj);
48126 * Creates a copy of the OfferWithExplicitMetadataBuilder
48128 struct LDKOfferWithExplicitMetadataBuilder OfferWithExplicitMetadataBuilder_clone(const struct LDKOfferWithExplicitMetadataBuilder *NONNULL_PTR orig);
48131 * Frees any resources used by the OfferWithDerivedMetadataBuilder, if is_owned is set and inner is non-NULL.
48133 void OfferWithDerivedMetadataBuilder_free(struct LDKOfferWithDerivedMetadataBuilder this_obj);
48136 * Creates a copy of the OfferWithDerivedMetadataBuilder
48138 struct LDKOfferWithDerivedMetadataBuilder OfferWithDerivedMetadataBuilder_clone(const struct LDKOfferWithDerivedMetadataBuilder *NONNULL_PTR orig);
48141 * Creates a new builder for an offer using the [`Offer::signing_pubkey`] for signing invoices.
48142 * The associated secret key must be remembered while the offer is valid.
48144 * Use a different pubkey per offer to avoid correlating offers.
48148 * If constructing an [`Offer`] for use with a [`ChannelManager`], use
48149 * [`ChannelManager::create_offer_builder`] instead of [`OfferBuilder::new`].
48151 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
48152 * [`ChannelManager::create_offer_builder`]: crate::ln::channelmanager::ChannelManager::create_offer_builder
48154 MUST_USE_RES struct LDKOfferWithExplicitMetadataBuilder OfferWithExplicitMetadataBuilder_new(struct LDKPublicKey signing_pubkey);
48157 * Sets the [`Offer::metadata`] to the given bytes.
48159 * Successive calls to this method will override the previous setting.
48161 MUST_USE_RES struct LDKCResult_NoneBolt12SemanticErrorZ OfferWithExplicitMetadataBuilder_metadata(struct LDKOfferWithExplicitMetadataBuilder this_arg, struct LDKCVec_u8Z metadata);
48164 * Adds the chain hash of the given [`Network`] to [`Offer::chains`]. If not called,
48165 * the chain hash of [`Network::Bitcoin`] is assumed to be the only one supported.
48167 * See [`Offer::chains`] on how this relates to the payment currency.
48169 * Successive calls to this method will add another chain hash.
48171 MUST_USE_RES void OfferWithExplicitMetadataBuilder_chain(struct LDKOfferWithExplicitMetadataBuilder this_arg, enum LDKNetwork network);
48174 * Sets the [`Offer::amount`] as an [`Amount::Bitcoin`].
48176 * Successive calls to this method will override the previous setting.
48178 MUST_USE_RES void OfferWithExplicitMetadataBuilder_amount_msats(struct LDKOfferWithExplicitMetadataBuilder this_arg, uint64_t amount_msats);
48181 * Sets the [`Offer::absolute_expiry`] as seconds since the Unix epoch. Any expiry that has
48182 * already passed is valid and can be checked for using [`Offer::is_expired`].
48184 * Successive calls to this method will override the previous setting.
48186 MUST_USE_RES void OfferWithExplicitMetadataBuilder_absolute_expiry(struct LDKOfferWithExplicitMetadataBuilder this_arg, uint64_t absolute_expiry);
48189 * Sets the [`Offer::description`].
48191 * Successive calls to this method will override the previous setting.
48193 MUST_USE_RES void OfferWithExplicitMetadataBuilder_description(struct LDKOfferWithExplicitMetadataBuilder this_arg, struct LDKStr description);
48196 * Sets the [`Offer::issuer`].
48198 * Successive calls to this method will override the previous setting.
48200 MUST_USE_RES void OfferWithExplicitMetadataBuilder_issuer(struct LDKOfferWithExplicitMetadataBuilder this_arg, struct LDKStr issuer);
48203 * Adds a blinded path to [`Offer::paths`]. Must include at least one path if only connected by
48204 * private channels or if [`Offer::signing_pubkey`] is not a public node id.
48206 * Successive calls to this method will add another blinded path. Caller is responsible for not
48207 * adding duplicate paths.
48209 MUST_USE_RES void OfferWithExplicitMetadataBuilder_path(struct LDKOfferWithExplicitMetadataBuilder this_arg, struct LDKBlindedPath path);
48212 * Sets the quantity of items for [`Offer::supported_quantity`]. If not called, defaults to
48213 * [`Quantity::One`].
48215 * Successive calls to this method will override the previous setting.
48217 MUST_USE_RES void OfferWithExplicitMetadataBuilder_supported_quantity(struct LDKOfferWithExplicitMetadataBuilder this_arg, struct LDKQuantity quantity);
48220 * Builds an [`Offer`] from the builder's settings.
48222 MUST_USE_RES struct LDKCResult_OfferBolt12SemanticErrorZ OfferWithExplicitMetadataBuilder_build(struct LDKOfferWithExplicitMetadataBuilder this_arg);
48225 * Similar to [`OfferBuilder::new`] except, if [`OfferBuilder::path`] is called, the signing
48226 * pubkey is derived from the given [`ExpandedKey`] and [`EntropySource`]. This provides
48227 * recipient privacy by using a different signing pubkey for each offer. Otherwise, the
48228 * provided `node_id` is used for the signing pubkey.
48230 * Also, sets the metadata when [`OfferBuilder::build`] is called such that it can be used by
48231 * [`InvoiceRequest::verify`] to determine if the request was produced for the offer given an
48234 * [`InvoiceRequest::verify`]: crate::offers::invoice_request::InvoiceRequest::verify
48235 * [`ExpandedKey`]: crate::ln::inbound_payment::ExpandedKey
48237 MUST_USE_RES struct LDKOfferWithDerivedMetadataBuilder OfferWithDerivedMetadataBuilder_deriving_signing_pubkey(struct LDKPublicKey node_id, const struct LDKExpandedKey *NONNULL_PTR expanded_key, struct LDKEntropySource entropy_source);
48240 * Adds the chain hash of the given [`Network`] to [`Offer::chains`]. If not called,
48241 * the chain hash of [`Network::Bitcoin`] is assumed to be the only one supported.
48243 * See [`Offer::chains`] on how this relates to the payment currency.
48245 * Successive calls to this method will add another chain hash.
48247 MUST_USE_RES void OfferWithDerivedMetadataBuilder_chain(struct LDKOfferWithDerivedMetadataBuilder this_arg, enum LDKNetwork network);
48250 * Sets the [`Offer::amount`] as an [`Amount::Bitcoin`].
48252 * Successive calls to this method will override the previous setting.
48254 MUST_USE_RES void OfferWithDerivedMetadataBuilder_amount_msats(struct LDKOfferWithDerivedMetadataBuilder this_arg, uint64_t amount_msats);
48257 * Sets the [`Offer::absolute_expiry`] as seconds since the Unix epoch. Any expiry that has
48258 * already passed is valid and can be checked for using [`Offer::is_expired`].
48260 * Successive calls to this method will override the previous setting.
48262 MUST_USE_RES void OfferWithDerivedMetadataBuilder_absolute_expiry(struct LDKOfferWithDerivedMetadataBuilder this_arg, uint64_t absolute_expiry);
48265 * Sets the [`Offer::description`].
48267 * Successive calls to this method will override the previous setting.
48269 MUST_USE_RES void OfferWithDerivedMetadataBuilder_description(struct LDKOfferWithDerivedMetadataBuilder this_arg, struct LDKStr description);
48272 * Sets the [`Offer::issuer`].
48274 * Successive calls to this method will override the previous setting.
48276 MUST_USE_RES void OfferWithDerivedMetadataBuilder_issuer(struct LDKOfferWithDerivedMetadataBuilder this_arg, struct LDKStr issuer);
48279 * Adds a blinded path to [`Offer::paths`]. Must include at least one path if only connected by
48280 * private channels or if [`Offer::signing_pubkey`] is not a public node id.
48282 * Successive calls to this method will add another blinded path. Caller is responsible for not
48283 * adding duplicate paths.
48285 MUST_USE_RES void OfferWithDerivedMetadataBuilder_path(struct LDKOfferWithDerivedMetadataBuilder this_arg, struct LDKBlindedPath path);
48288 * Sets the quantity of items for [`Offer::supported_quantity`]. If not called, defaults to
48289 * [`Quantity::One`].
48291 * Successive calls to this method will override the previous setting.
48293 MUST_USE_RES void OfferWithDerivedMetadataBuilder_supported_quantity(struct LDKOfferWithDerivedMetadataBuilder this_arg, struct LDKQuantity quantity);
48296 * Builds an [`Offer`] from the builder's settings.
48298 MUST_USE_RES struct LDKCResult_OfferBolt12SemanticErrorZ OfferWithDerivedMetadataBuilder_build(struct LDKOfferWithDerivedMetadataBuilder this_arg);
48301 * Frees any resources used by the Offer, if is_owned is set and inner is non-NULL.
48303 void Offer_free(struct LDKOffer this_obj);
48306 * Creates a copy of the Offer
48308 struct LDKOffer Offer_clone(const struct LDKOffer *NONNULL_PTR orig);
48311 * The chains that may be used when paying a requested invoice (e.g., bitcoin mainnet).
48312 * Payments must be denominated in units of the minimal lightning-payable unit (e.g., msats)
48313 * for the selected chain.
48315 MUST_USE_RES struct LDKCVec_ThirtyTwoBytesZ Offer_chains(const struct LDKOffer *NONNULL_PTR this_arg);
48318 * Opaque bytes set by the originator. Useful for authentication and validating fields since it
48319 * is reflected in `invoice_request` messages along with all the other fields from the `offer`.
48321 MUST_USE_RES struct LDKCOption_CVec_u8ZZ Offer_metadata(const struct LDKOffer *NONNULL_PTR this_arg);
48324 * The minimum amount required for a successful payment of a single item.
48326 MUST_USE_RES struct LDKCOption_AmountZ Offer_amount(const struct LDKOffer *NONNULL_PTR this_arg);
48329 * A complete description of the purpose of the payment. Intended to be displayed to the user
48330 * but with the caveat that it has not been verified in any way.
48332 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
48334 MUST_USE_RES struct LDKPrintableString Offer_description(const struct LDKOffer *NONNULL_PTR this_arg);
48337 * Features pertaining to the offer.
48339 MUST_USE_RES struct LDKOfferFeatures Offer_offer_features(const struct LDKOffer *NONNULL_PTR this_arg);
48342 * Duration since the Unix epoch when an invoice should no longer be requested.
48344 * If `None`, the offer does not expire.
48346 MUST_USE_RES struct LDKCOption_u64Z Offer_absolute_expiry(const struct LDKOffer *NONNULL_PTR this_arg);
48349 * The issuer of the offer, possibly beginning with `user@domain` or `domain`. Intended to be
48350 * displayed to the user but with the caveat that it has not been verified in any way.
48352 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
48354 MUST_USE_RES struct LDKPrintableString Offer_issuer(const struct LDKOffer *NONNULL_PTR this_arg);
48357 * Paths to the recipient originating from publicly reachable nodes. Blinded paths provide
48358 * recipient privacy by obfuscating its node id.
48360 MUST_USE_RES struct LDKCVec_BlindedPathZ Offer_paths(const struct LDKOffer *NONNULL_PTR this_arg);
48363 * The quantity of items supported.
48365 MUST_USE_RES struct LDKQuantity Offer_supported_quantity(const struct LDKOffer *NONNULL_PTR this_arg);
48368 * The public key used by the recipient to sign invoices.
48370 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
48372 MUST_USE_RES struct LDKPublicKey Offer_signing_pubkey(const struct LDKOffer *NONNULL_PTR this_arg);
48375 * Returns the id of the offer.
48377 MUST_USE_RES struct LDKOfferId Offer_id(const struct LDKOffer *NONNULL_PTR this_arg);
48380 * Returns whether the given chain is supported by the offer.
48382 MUST_USE_RES bool Offer_supports_chain(const struct LDKOffer *NONNULL_PTR this_arg, struct LDKThirtyTwoBytes chain);
48385 * Whether the offer has expired.
48387 MUST_USE_RES bool Offer_is_expired(const struct LDKOffer *NONNULL_PTR this_arg);
48390 * Whether the offer has expired given the duration since the Unix epoch.
48392 MUST_USE_RES bool Offer_is_expired_no_std(const struct LDKOffer *NONNULL_PTR this_arg, uint64_t duration_since_epoch);
48395 * Returns whether the given quantity is valid for the offer.
48397 MUST_USE_RES bool Offer_is_valid_quantity(const struct LDKOffer *NONNULL_PTR this_arg, uint64_t quantity);
48400 * Returns whether a quantity is expected in an [`InvoiceRequest`] for the offer.
48402 * [`InvoiceRequest`]: crate::offers::invoice_request::InvoiceRequest
48404 MUST_USE_RES bool Offer_expects_quantity(const struct LDKOffer *NONNULL_PTR this_arg);
48407 * Similar to [`Offer::request_invoice`] except it:
48408 * - derives the [`InvoiceRequest::payer_id`] such that a different key can be used for each
48410 * - sets [`InvoiceRequest::payer_metadata`] when [`InvoiceRequestBuilder::build`] is called
48411 * such that it can be used by [`Bolt12Invoice::verify`] to determine if the invoice was
48412 * requested using a base [`ExpandedKey`] from which the payer id was derived, and
48413 * - includes the [`PaymentId`] encrypted in [`InvoiceRequest::payer_metadata`] so that it can
48414 * be used when sending the payment for the requested invoice.
48416 * Useful to protect the sender's privacy.
48418 * [`InvoiceRequest::payer_id`]: crate::offers::invoice_request::InvoiceRequest::payer_id
48419 * [`InvoiceRequest::payer_metadata`]: crate::offers::invoice_request::InvoiceRequest::payer_metadata
48420 * [`Bolt12Invoice::verify`]: crate::offers::invoice::Bolt12Invoice::verify
48421 * [`ExpandedKey`]: crate::ln::inbound_payment::ExpandedKey
48423 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);
48426 * Similar to [`Offer::request_invoice_deriving_payer_id`] except uses `payer_id` for the
48427 * [`InvoiceRequest::payer_id`] instead of deriving a different key for each request.
48429 * Useful for recurring payments using the same `payer_id` with different invoices.
48431 * [`InvoiceRequest::payer_id`]: crate::offers::invoice_request::InvoiceRequest::payer_id
48433 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);
48436 * Creates an [`InvoiceRequestBuilder`] for the offer with the given `metadata` and `payer_id`,
48437 * which will be reflected in the `Bolt12Invoice` response.
48439 * The `metadata` is useful for including information about the derivation of `payer_id` such
48440 * that invoice response handling can be stateless. Also serves as payer-provided entropy while
48441 * hashing in the signature calculation.
48443 * This should not leak any information such as by using a simple BIP-32 derivation path.
48444 * Otherwise, payments may be correlated.
48446 * Errors if the offer contains unknown required features.
48448 * [`InvoiceRequest`]: crate::offers::invoice_request::InvoiceRequest
48450 MUST_USE_RES struct LDKCResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ Offer_request_invoice(const struct LDKOffer *NONNULL_PTR this_arg, struct LDKCVec_u8Z metadata, struct LDKPublicKey payer_id);
48453 * Generates a non-cryptographic 64-bit hash of the Offer.
48455 uint64_t Offer_hash(const struct LDKOffer *NONNULL_PTR o);
48458 * Serialize the Offer object into a byte array which can be read by Offer_read
48460 struct LDKCVec_u8Z Offer_write(const struct LDKOffer *NONNULL_PTR obj);
48463 * Frees any resources used by the Amount
48465 void Amount_free(struct LDKAmount this_ptr);
48468 * Creates a copy of the Amount
48470 struct LDKAmount Amount_clone(const struct LDKAmount *NONNULL_PTR orig);
48473 * Utility method to constructs a new Bitcoin-variant Amount
48475 struct LDKAmount Amount_bitcoin(uint64_t amount_msats);
48478 * Utility method to constructs a new Currency-variant Amount
48480 struct LDKAmount Amount_currency(struct LDKThreeBytes iso4217_code, uint64_t amount);
48483 * Frees any resources used by the Quantity
48485 void Quantity_free(struct LDKQuantity this_ptr);
48488 * Creates a copy of the Quantity
48490 struct LDKQuantity Quantity_clone(const struct LDKQuantity *NONNULL_PTR orig);
48493 * Utility method to constructs a new Bounded-variant Quantity
48495 struct LDKQuantity Quantity_bounded(uint64_t a);
48498 * Utility method to constructs a new Unbounded-variant Quantity
48500 struct LDKQuantity Quantity_unbounded(void);
48503 * Utility method to constructs a new One-variant Quantity
48505 struct LDKQuantity Quantity_one(void);
48508 * Read a Offer object from a string
48510 struct LDKCResult_OfferBolt12ParseErrorZ Offer_from_str(struct LDKStr s);
48513 * Get the string representation of a Offer object
48515 struct LDKStr Offer_to_str(const struct LDKOffer *NONNULL_PTR o);
48518 * Frees any resources used by the InvoiceWithExplicitSigningPubkeyBuilder, if is_owned is set and inner is non-NULL.
48520 void InvoiceWithExplicitSigningPubkeyBuilder_free(struct LDKInvoiceWithExplicitSigningPubkeyBuilder this_obj);
48523 * Frees any resources used by the InvoiceWithDerivedSigningPubkeyBuilder, if is_owned is set and inner is non-NULL.
48525 void InvoiceWithDerivedSigningPubkeyBuilder_free(struct LDKInvoiceWithDerivedSigningPubkeyBuilder this_obj);
48528 * Builds an unsigned [`Bolt12Invoice`] after checking for valid semantics. It can be signed by
48529 * [`UnsignedBolt12Invoice::sign`].
48531 MUST_USE_RES struct LDKCResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ InvoiceWithExplicitSigningPubkeyBuilder_build(struct LDKInvoiceWithExplicitSigningPubkeyBuilder this_arg);
48534 * Sets the [`Bolt12Invoice::relative_expiry`] as seconds since [`Bolt12Invoice::created_at`].
48535 * Any expiry that has already passed is valid and can be checked for using
48536 * [`Bolt12Invoice::is_expired`].
48538 * Successive calls to this method will override the previous setting.
48540 MUST_USE_RES void InvoiceWithExplicitSigningPubkeyBuilder_relative_expiry(struct LDKInvoiceWithExplicitSigningPubkeyBuilder this_arg, uint32_t relative_expiry_secs);
48543 * Adds a P2WSH address to [`Bolt12Invoice::fallbacks`].
48545 * Successive calls to this method will add another address. Caller is responsible for not
48546 * adding duplicate addresses and only calling if capable of receiving to P2WSH addresses.
48548 MUST_USE_RES void InvoiceWithExplicitSigningPubkeyBuilder_fallback_v0_p2wsh(struct LDKInvoiceWithExplicitSigningPubkeyBuilder this_arg, const uint8_t (*script_hash)[32]);
48551 * Adds a P2WPKH address to [`Bolt12Invoice::fallbacks`].
48553 * Successive calls to this method will add another address. Caller is responsible for not
48554 * adding duplicate addresses and only calling if capable of receiving to P2WPKH addresses.
48556 MUST_USE_RES void InvoiceWithExplicitSigningPubkeyBuilder_fallback_v0_p2wpkh(struct LDKInvoiceWithExplicitSigningPubkeyBuilder this_arg, const uint8_t (*pubkey_hash)[20]);
48559 * Adds a P2TR address to [`Bolt12Invoice::fallbacks`].
48561 * Successive calls to this method will add another address. Caller is responsible for not
48562 * adding duplicate addresses and only calling if capable of receiving to P2TR addresses.
48564 MUST_USE_RES void InvoiceWithExplicitSigningPubkeyBuilder_fallback_v1_p2tr_tweaked(struct LDKInvoiceWithExplicitSigningPubkeyBuilder this_arg, struct LDKTweakedPublicKey output_key);
48567 * Sets [`Bolt12Invoice::invoice_features`] to indicate MPP may be used. Otherwise, MPP is
48570 MUST_USE_RES void InvoiceWithExplicitSigningPubkeyBuilder_allow_mpp(struct LDKInvoiceWithExplicitSigningPubkeyBuilder this_arg);
48573 * Builds a signed [`Bolt12Invoice`] after checking for valid semantics.
48575 MUST_USE_RES struct LDKCResult_Bolt12InvoiceBolt12SemanticErrorZ InvoiceWithDerivedSigningPubkeyBuilder_build_and_sign(struct LDKInvoiceWithDerivedSigningPubkeyBuilder this_arg);
48578 * Sets the [`Bolt12Invoice::relative_expiry`] as seconds since [`Bolt12Invoice::created_at`].
48579 * Any expiry that has already passed is valid and can be checked for using
48580 * [`Bolt12Invoice::is_expired`].
48582 * Successive calls to this method will override the previous setting.
48584 MUST_USE_RES void InvoiceWithDerivedSigningPubkeyBuilder_relative_expiry(struct LDKInvoiceWithDerivedSigningPubkeyBuilder this_arg, uint32_t relative_expiry_secs);
48587 * Adds a P2WSH address to [`Bolt12Invoice::fallbacks`].
48589 * Successive calls to this method will add another address. Caller is responsible for not
48590 * adding duplicate addresses and only calling if capable of receiving to P2WSH addresses.
48592 MUST_USE_RES void InvoiceWithDerivedSigningPubkeyBuilder_fallback_v0_p2wsh(struct LDKInvoiceWithDerivedSigningPubkeyBuilder this_arg, const uint8_t (*script_hash)[32]);
48595 * Adds a P2WPKH address to [`Bolt12Invoice::fallbacks`].
48597 * Successive calls to this method will add another address. Caller is responsible for not
48598 * adding duplicate addresses and only calling if capable of receiving to P2WPKH addresses.
48600 MUST_USE_RES void InvoiceWithDerivedSigningPubkeyBuilder_fallback_v0_p2wpkh(struct LDKInvoiceWithDerivedSigningPubkeyBuilder this_arg, const uint8_t (*pubkey_hash)[20]);
48603 * Adds a P2TR address to [`Bolt12Invoice::fallbacks`].
48605 * Successive calls to this method will add another address. Caller is responsible for not
48606 * adding duplicate addresses and only calling if capable of receiving to P2TR addresses.
48608 MUST_USE_RES void InvoiceWithDerivedSigningPubkeyBuilder_fallback_v1_p2tr_tweaked(struct LDKInvoiceWithDerivedSigningPubkeyBuilder this_arg, struct LDKTweakedPublicKey output_key);
48611 * Sets [`Bolt12Invoice::invoice_features`] to indicate MPP may be used. Otherwise, MPP is
48614 MUST_USE_RES void InvoiceWithDerivedSigningPubkeyBuilder_allow_mpp(struct LDKInvoiceWithDerivedSigningPubkeyBuilder this_arg);
48617 * Frees any resources used by the UnsignedBolt12Invoice, if is_owned is set and inner is non-NULL.
48619 void UnsignedBolt12Invoice_free(struct LDKUnsignedBolt12Invoice this_obj);
48622 * Creates a copy of the UnsignedBolt12Invoice
48624 struct LDKUnsignedBolt12Invoice UnsignedBolt12Invoice_clone(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR orig);
48627 * Calls the free function if one is set
48629 void SignBolt12InvoiceFn_free(struct LDKSignBolt12InvoiceFn this_ptr);
48632 * Returns the [`TaggedHash`] of the invoice to sign.
48634 MUST_USE_RES struct LDKTaggedHash UnsignedBolt12Invoice_tagged_hash(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
48637 * Frees any resources used by the Bolt12Invoice, if is_owned is set and inner is non-NULL.
48639 void Bolt12Invoice_free(struct LDKBolt12Invoice this_obj);
48642 * Creates a copy of the Bolt12Invoice
48644 struct LDKBolt12Invoice Bolt12Invoice_clone(const struct LDKBolt12Invoice *NONNULL_PTR orig);
48647 * The chains that may be used when paying a requested invoice.
48649 * From [`Offer::chains`]; `None` if the invoice was created in response to a [`Refund`].
48651 * [`Offer::chains`]: crate::offers::offer::Offer::chains
48653 MUST_USE_RES struct LDKCOption_CVec_ThirtyTwoBytesZZ UnsignedBolt12Invoice_offer_chains(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
48656 * The chain that must be used when paying the invoice; selected from [`offer_chains`] if the
48657 * invoice originated from an offer.
48659 * From [`InvoiceRequest::chain`] or [`Refund::chain`].
48661 * [`offer_chains`]: Self::offer_chains
48662 * [`InvoiceRequest::chain`]: crate::offers::invoice_request::InvoiceRequest::chain
48664 MUST_USE_RES struct LDKThirtyTwoBytes UnsignedBolt12Invoice_chain(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
48667 * Opaque bytes set by the originating [`Offer`].
48669 * From [`Offer::metadata`]; `None` if the invoice was created in response to a [`Refund`] or
48670 * if the [`Offer`] did not set it.
48672 * [`Offer`]: crate::offers::offer::Offer
48673 * [`Offer::metadata`]: crate::offers::offer::Offer::metadata
48675 MUST_USE_RES struct LDKCOption_CVec_u8ZZ UnsignedBolt12Invoice_metadata(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
48678 * The minimum amount required for a successful payment of a single item.
48680 * From [`Offer::amount`]; `None` if the invoice was created in response to a [`Refund`] or if
48681 * the [`Offer`] did not set it.
48683 * [`Offer`]: crate::offers::offer::Offer
48684 * [`Offer::amount`]: crate::offers::offer::Offer::amount
48686 MUST_USE_RES struct LDKCOption_AmountZ UnsignedBolt12Invoice_amount(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
48689 * Features pertaining to the originating [`Offer`].
48691 * From [`Offer::offer_features`]; `None` if the invoice was created in response to a
48694 * [`Offer`]: crate::offers::offer::Offer
48695 * [`Offer::offer_features`]: crate::offers::offer::Offer::offer_features
48697 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
48699 MUST_USE_RES struct LDKOfferFeatures UnsignedBolt12Invoice_offer_features(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
48702 * A complete description of the purpose of the originating offer or refund.
48704 * From [`Offer::description`] or [`Refund::description`].
48706 * [`Offer::description`]: crate::offers::offer::Offer::description
48708 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
48710 MUST_USE_RES struct LDKPrintableString UnsignedBolt12Invoice_description(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
48713 * Duration since the Unix epoch when an invoice should no longer be requested.
48715 * From [`Offer::absolute_expiry`] or [`Refund::absolute_expiry`].
48717 * [`Offer::absolute_expiry`]: crate::offers::offer::Offer::absolute_expiry
48719 MUST_USE_RES struct LDKCOption_u64Z UnsignedBolt12Invoice_absolute_expiry(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
48722 * The issuer of the offer or refund.
48724 * From [`Offer::issuer`] or [`Refund::issuer`].
48726 * [`Offer::issuer`]: crate::offers::offer::Offer::issuer
48728 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
48730 MUST_USE_RES struct LDKPrintableString UnsignedBolt12Invoice_issuer(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
48733 * Paths to the recipient originating from publicly reachable nodes.
48735 * From [`Offer::paths`] or [`Refund::paths`].
48737 * [`Offer::paths`]: crate::offers::offer::Offer::paths
48739 MUST_USE_RES struct LDKCVec_BlindedPathZ UnsignedBolt12Invoice_message_paths(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
48742 * The quantity of items supported.
48744 * From [`Offer::supported_quantity`]; `None` if the invoice was created in response to a
48747 * [`Offer::supported_quantity`]: crate::offers::offer::Offer::supported_quantity
48749 MUST_USE_RES struct LDKCOption_QuantityZ UnsignedBolt12Invoice_supported_quantity(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
48752 * An unpredictable series of bytes from the payer.
48754 * From [`InvoiceRequest::payer_metadata`] or [`Refund::payer_metadata`].
48756 MUST_USE_RES struct LDKu8slice UnsignedBolt12Invoice_payer_metadata(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
48759 * Features pertaining to requesting an invoice.
48761 * From [`InvoiceRequest::invoice_request_features`] or [`Refund::features`].
48763 MUST_USE_RES struct LDKInvoiceRequestFeatures UnsignedBolt12Invoice_invoice_request_features(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
48766 * The quantity of items requested or refunded for.
48768 * From [`InvoiceRequest::quantity`] or [`Refund::quantity`].
48770 MUST_USE_RES struct LDKCOption_u64Z UnsignedBolt12Invoice_quantity(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
48773 * A possibly transient pubkey used to sign the invoice request or to send an invoice for a
48774 * refund in case there are no [`message_paths`].
48776 * [`message_paths`]: Self::message_paths
48778 MUST_USE_RES struct LDKPublicKey UnsignedBolt12Invoice_payer_id(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
48781 * A payer-provided note reflected back in the invoice.
48783 * From [`InvoiceRequest::payer_note`] or [`Refund::payer_note`].
48785 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
48787 MUST_USE_RES struct LDKPrintableString UnsignedBolt12Invoice_payer_note(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
48790 * Duration since the Unix epoch when the invoice was created.
48792 MUST_USE_RES uint64_t UnsignedBolt12Invoice_created_at(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
48795 * Duration since [`Bolt12Invoice::created_at`] when the invoice has expired and therefore
48796 * should no longer be paid.
48798 MUST_USE_RES uint64_t UnsignedBolt12Invoice_relative_expiry(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
48801 * Whether the invoice has expired.
48803 MUST_USE_RES bool UnsignedBolt12Invoice_is_expired(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
48806 * SHA256 hash of the payment preimage that will be given in return for paying the invoice.
48808 MUST_USE_RES struct LDKThirtyTwoBytes UnsignedBolt12Invoice_payment_hash(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
48811 * The minimum amount required for a successful payment of the invoice.
48813 MUST_USE_RES uint64_t UnsignedBolt12Invoice_amount_msats(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
48816 * Features pertaining to paying an invoice.
48818 MUST_USE_RES struct LDKBolt12InvoiceFeatures UnsignedBolt12Invoice_invoice_features(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
48821 * The public key corresponding to the key used to sign the invoice.
48823 MUST_USE_RES struct LDKPublicKey UnsignedBolt12Invoice_signing_pubkey(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
48826 * The chains that may be used when paying a requested invoice.
48828 * From [`Offer::chains`]; `None` if the invoice was created in response to a [`Refund`].
48830 * [`Offer::chains`]: crate::offers::offer::Offer::chains
48832 MUST_USE_RES struct LDKCOption_CVec_ThirtyTwoBytesZZ Bolt12Invoice_offer_chains(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
48835 * The chain that must be used when paying the invoice; selected from [`offer_chains`] if the
48836 * invoice originated from an offer.
48838 * From [`InvoiceRequest::chain`] or [`Refund::chain`].
48840 * [`offer_chains`]: Self::offer_chains
48841 * [`InvoiceRequest::chain`]: crate::offers::invoice_request::InvoiceRequest::chain
48843 MUST_USE_RES struct LDKThirtyTwoBytes Bolt12Invoice_chain(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
48846 * Opaque bytes set by the originating [`Offer`].
48848 * From [`Offer::metadata`]; `None` if the invoice was created in response to a [`Refund`] or
48849 * if the [`Offer`] did not set it.
48851 * [`Offer`]: crate::offers::offer::Offer
48852 * [`Offer::metadata`]: crate::offers::offer::Offer::metadata
48854 MUST_USE_RES struct LDKCOption_CVec_u8ZZ Bolt12Invoice_metadata(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
48857 * The minimum amount required for a successful payment of a single item.
48859 * From [`Offer::amount`]; `None` if the invoice was created in response to a [`Refund`] or if
48860 * the [`Offer`] did not set it.
48862 * [`Offer`]: crate::offers::offer::Offer
48863 * [`Offer::amount`]: crate::offers::offer::Offer::amount
48865 MUST_USE_RES struct LDKCOption_AmountZ Bolt12Invoice_amount(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
48868 * Features pertaining to the originating [`Offer`].
48870 * From [`Offer::offer_features`]; `None` if the invoice was created in response to a
48873 * [`Offer`]: crate::offers::offer::Offer
48874 * [`Offer::offer_features`]: crate::offers::offer::Offer::offer_features
48876 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
48878 MUST_USE_RES struct LDKOfferFeatures Bolt12Invoice_offer_features(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
48881 * A complete description of the purpose of the originating offer or refund.
48883 * From [`Offer::description`] or [`Refund::description`].
48885 * [`Offer::description`]: crate::offers::offer::Offer::description
48887 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
48889 MUST_USE_RES struct LDKPrintableString Bolt12Invoice_description(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
48892 * Duration since the Unix epoch when an invoice should no longer be requested.
48894 * From [`Offer::absolute_expiry`] or [`Refund::absolute_expiry`].
48896 * [`Offer::absolute_expiry`]: crate::offers::offer::Offer::absolute_expiry
48898 MUST_USE_RES struct LDKCOption_u64Z Bolt12Invoice_absolute_expiry(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
48901 * The issuer of the offer or refund.
48903 * From [`Offer::issuer`] or [`Refund::issuer`].
48905 * [`Offer::issuer`]: crate::offers::offer::Offer::issuer
48907 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
48909 MUST_USE_RES struct LDKPrintableString Bolt12Invoice_issuer(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
48912 * Paths to the recipient originating from publicly reachable nodes.
48914 * From [`Offer::paths`] or [`Refund::paths`].
48916 * [`Offer::paths`]: crate::offers::offer::Offer::paths
48918 MUST_USE_RES struct LDKCVec_BlindedPathZ Bolt12Invoice_message_paths(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
48921 * The quantity of items supported.
48923 * From [`Offer::supported_quantity`]; `None` if the invoice was created in response to a
48926 * [`Offer::supported_quantity`]: crate::offers::offer::Offer::supported_quantity
48928 MUST_USE_RES struct LDKCOption_QuantityZ Bolt12Invoice_supported_quantity(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
48931 * An unpredictable series of bytes from the payer.
48933 * From [`InvoiceRequest::payer_metadata`] or [`Refund::payer_metadata`].
48935 MUST_USE_RES struct LDKu8slice Bolt12Invoice_payer_metadata(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
48938 * Features pertaining to requesting an invoice.
48940 * From [`InvoiceRequest::invoice_request_features`] or [`Refund::features`].
48942 MUST_USE_RES struct LDKInvoiceRequestFeatures Bolt12Invoice_invoice_request_features(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
48945 * The quantity of items requested or refunded for.
48947 * From [`InvoiceRequest::quantity`] or [`Refund::quantity`].
48949 MUST_USE_RES struct LDKCOption_u64Z Bolt12Invoice_quantity(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
48952 * A possibly transient pubkey used to sign the invoice request or to send an invoice for a
48953 * refund in case there are no [`message_paths`].
48955 * [`message_paths`]: Self::message_paths
48957 MUST_USE_RES struct LDKPublicKey Bolt12Invoice_payer_id(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
48960 * A payer-provided note reflected back in the invoice.
48962 * From [`InvoiceRequest::payer_note`] or [`Refund::payer_note`].
48964 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
48966 MUST_USE_RES struct LDKPrintableString Bolt12Invoice_payer_note(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
48969 * Duration since the Unix epoch when the invoice was created.
48971 MUST_USE_RES uint64_t Bolt12Invoice_created_at(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
48974 * Duration since [`Bolt12Invoice::created_at`] when the invoice has expired and therefore
48975 * should no longer be paid.
48977 MUST_USE_RES uint64_t Bolt12Invoice_relative_expiry(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
48980 * Whether the invoice has expired.
48982 MUST_USE_RES bool Bolt12Invoice_is_expired(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
48985 * SHA256 hash of the payment preimage that will be given in return for paying the invoice.
48987 MUST_USE_RES struct LDKThirtyTwoBytes Bolt12Invoice_payment_hash(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
48990 * The minimum amount required for a successful payment of the invoice.
48992 MUST_USE_RES uint64_t Bolt12Invoice_amount_msats(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
48995 * Features pertaining to paying an invoice.
48997 MUST_USE_RES struct LDKBolt12InvoiceFeatures Bolt12Invoice_invoice_features(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
49000 * The public key corresponding to the key used to sign the invoice.
49002 MUST_USE_RES struct LDKPublicKey Bolt12Invoice_signing_pubkey(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
49005 * Signature of the invoice verified using [`Bolt12Invoice::signing_pubkey`].
49007 MUST_USE_RES struct LDKSchnorrSignature Bolt12Invoice_signature(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
49010 * Hash that was used for signing the invoice.
49012 MUST_USE_RES struct LDKThirtyTwoBytes Bolt12Invoice_signable_hash(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
49015 * Verifies that the invoice was for a request or refund created using the given key. Returns
49016 * the associated [`PaymentId`] to use when sending the payment.
49018 MUST_USE_RES struct LDKCResult_ThirtyTwoBytesNoneZ Bolt12Invoice_verify(const struct LDKBolt12Invoice *NONNULL_PTR this_arg, const struct LDKExpandedKey *NONNULL_PTR key);
49021 * Generates a non-cryptographic 64-bit hash of the Bolt12Invoice.
49023 uint64_t Bolt12Invoice_hash(const struct LDKBolt12Invoice *NONNULL_PTR o);
49026 * Serialize the UnsignedBolt12Invoice object into a byte array which can be read by UnsignedBolt12Invoice_read
49028 struct LDKCVec_u8Z UnsignedBolt12Invoice_write(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR obj);
49031 * Serialize the Bolt12Invoice object into a byte array which can be read by Bolt12Invoice_read
49033 struct LDKCVec_u8Z Bolt12Invoice_write(const struct LDKBolt12Invoice *NONNULL_PTR obj);
49036 * Frees any resources used by the BlindedPayInfo, if is_owned is set and inner is non-NULL.
49038 void BlindedPayInfo_free(struct LDKBlindedPayInfo this_obj);
49041 * Base fee charged (in millisatoshi) for the entire blinded path.
49043 uint32_t BlindedPayInfo_get_fee_base_msat(const struct LDKBlindedPayInfo *NONNULL_PTR this_ptr);
49046 * Base fee charged (in millisatoshi) for the entire blinded path.
49048 void BlindedPayInfo_set_fee_base_msat(struct LDKBlindedPayInfo *NONNULL_PTR this_ptr, uint32_t val);
49051 * Liquidity fee charged (in millionths of the amount transferred) for the entire blinded path
49052 * (i.e., 10,000 is 1%).
49054 uint32_t BlindedPayInfo_get_fee_proportional_millionths(const struct LDKBlindedPayInfo *NONNULL_PTR this_ptr);
49057 * Liquidity fee charged (in millionths of the amount transferred) for the entire blinded path
49058 * (i.e., 10,000 is 1%).
49060 void BlindedPayInfo_set_fee_proportional_millionths(struct LDKBlindedPayInfo *NONNULL_PTR this_ptr, uint32_t val);
49063 * Number of blocks subtracted from an incoming HTLC's `cltv_expiry` for the entire blinded
49066 uint16_t BlindedPayInfo_get_cltv_expiry_delta(const struct LDKBlindedPayInfo *NONNULL_PTR this_ptr);
49069 * Number of blocks subtracted from an incoming HTLC's `cltv_expiry` for the entire blinded
49072 void BlindedPayInfo_set_cltv_expiry_delta(struct LDKBlindedPayInfo *NONNULL_PTR this_ptr, uint16_t val);
49075 * The minimum HTLC value (in millisatoshi) that is acceptable to all channel peers on the
49076 * blinded path from the introduction node to the recipient, accounting for any fees, i.e., as
49077 * seen by the recipient.
49079 uint64_t BlindedPayInfo_get_htlc_minimum_msat(const struct LDKBlindedPayInfo *NONNULL_PTR this_ptr);
49082 * The minimum HTLC value (in millisatoshi) that is acceptable to all channel peers on the
49083 * blinded path from the introduction node to the recipient, accounting for any fees, i.e., as
49084 * seen by the recipient.
49086 void BlindedPayInfo_set_htlc_minimum_msat(struct LDKBlindedPayInfo *NONNULL_PTR this_ptr, uint64_t val);
49089 * The maximum HTLC value (in millisatoshi) that is acceptable to all channel peers on the
49090 * blinded path from the introduction node to the recipient, accounting for any fees, i.e., as
49091 * seen by the recipient.
49093 uint64_t BlindedPayInfo_get_htlc_maximum_msat(const struct LDKBlindedPayInfo *NONNULL_PTR this_ptr);
49096 * The maximum HTLC value (in millisatoshi) that is acceptable to all channel peers on the
49097 * blinded path from the introduction node to the recipient, accounting for any fees, i.e., as
49098 * seen by the recipient.
49100 void BlindedPayInfo_set_htlc_maximum_msat(struct LDKBlindedPayInfo *NONNULL_PTR this_ptr, uint64_t val);
49103 * Features set in `encrypted_data_tlv` for the `encrypted_recipient_data` TLV record in an
49106 struct LDKBlindedHopFeatures BlindedPayInfo_get_features(const struct LDKBlindedPayInfo *NONNULL_PTR this_ptr);
49109 * Features set in `encrypted_data_tlv` for the `encrypted_recipient_data` TLV record in an
49112 void BlindedPayInfo_set_features(struct LDKBlindedPayInfo *NONNULL_PTR this_ptr, struct LDKBlindedHopFeatures val);
49115 * Constructs a new BlindedPayInfo given each field
49117 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);
49120 * Creates a copy of the BlindedPayInfo
49122 struct LDKBlindedPayInfo BlindedPayInfo_clone(const struct LDKBlindedPayInfo *NONNULL_PTR orig);
49125 * Generates a non-cryptographic 64-bit hash of the BlindedPayInfo.
49127 uint64_t BlindedPayInfo_hash(const struct LDKBlindedPayInfo *NONNULL_PTR o);
49130 * Checks if two BlindedPayInfos contain equal inner contents.
49131 * This ignores pointers and is_owned flags and looks at the values in fields.
49132 * Two objects with NULL inner values will be considered "equal" here.
49134 bool BlindedPayInfo_eq(const struct LDKBlindedPayInfo *NONNULL_PTR a, const struct LDKBlindedPayInfo *NONNULL_PTR b);
49137 * Serialize the BlindedPayInfo object into a byte array which can be read by BlindedPayInfo_read
49139 struct LDKCVec_u8Z BlindedPayInfo_write(const struct LDKBlindedPayInfo *NONNULL_PTR obj);
49142 * Read a BlindedPayInfo from a byte array, created by BlindedPayInfo_write
49144 struct LDKCResult_BlindedPayInfoDecodeErrorZ BlindedPayInfo_read(struct LDKu8slice ser);
49147 * Frees any resources used by the InvoiceError, if is_owned is set and inner is non-NULL.
49149 void InvoiceError_free(struct LDKInvoiceError this_obj);
49152 * The field in the [`InvoiceRequest`] or the [`Bolt12Invoice`] that contained an error.
49154 * [`InvoiceRequest`]: crate::offers::invoice_request::InvoiceRequest
49155 * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice
49157 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
49159 struct LDKErroneousField InvoiceError_get_erroneous_field(const struct LDKInvoiceError *NONNULL_PTR this_ptr);
49162 * The field in the [`InvoiceRequest`] or the [`Bolt12Invoice`] that contained an error.
49164 * [`InvoiceRequest`]: crate::offers::invoice_request::InvoiceRequest
49165 * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice
49167 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
49169 void InvoiceError_set_erroneous_field(struct LDKInvoiceError *NONNULL_PTR this_ptr, struct LDKErroneousField val);
49172 * An explanation of the error.
49174 struct LDKUntrustedString InvoiceError_get_message(const struct LDKInvoiceError *NONNULL_PTR this_ptr);
49177 * An explanation of the error.
49179 void InvoiceError_set_message(struct LDKInvoiceError *NONNULL_PTR this_ptr, struct LDKUntrustedString val);
49182 * Constructs a new InvoiceError given each field
49184 * Note that erroneous_field_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
49186 MUST_USE_RES struct LDKInvoiceError InvoiceError_new(struct LDKErroneousField erroneous_field_arg, struct LDKUntrustedString message_arg);
49189 * Creates a copy of the InvoiceError
49191 struct LDKInvoiceError InvoiceError_clone(const struct LDKInvoiceError *NONNULL_PTR orig);
49194 * Frees any resources used by the ErroneousField, if is_owned is set and inner is non-NULL.
49196 void ErroneousField_free(struct LDKErroneousField this_obj);
49199 * The type number of the TLV field containing the error.
49201 uint64_t ErroneousField_get_tlv_fieldnum(const struct LDKErroneousField *NONNULL_PTR this_ptr);
49204 * The type number of the TLV field containing the error.
49206 void ErroneousField_set_tlv_fieldnum(struct LDKErroneousField *NONNULL_PTR this_ptr, uint64_t val);
49209 * A value to use for the TLV field to avoid the error.
49211 * Returns a copy of the field.
49213 struct LDKCOption_CVec_u8ZZ ErroneousField_get_suggested_value(const struct LDKErroneousField *NONNULL_PTR this_ptr);
49216 * A value to use for the TLV field to avoid the error.
49218 void ErroneousField_set_suggested_value(struct LDKErroneousField *NONNULL_PTR this_ptr, struct LDKCOption_CVec_u8ZZ val);
49221 * Constructs a new ErroneousField given each field
49223 MUST_USE_RES struct LDKErroneousField ErroneousField_new(uint64_t tlv_fieldnum_arg, struct LDKCOption_CVec_u8ZZ suggested_value_arg);
49226 * Creates a copy of the ErroneousField
49228 struct LDKErroneousField ErroneousField_clone(const struct LDKErroneousField *NONNULL_PTR orig);
49231 * Creates an [`InvoiceError`] with the given message.
49233 MUST_USE_RES struct LDKInvoiceError InvoiceError_from_string(struct LDKStr s);
49236 * Get the string representation of a InvoiceError object
49238 struct LDKStr InvoiceError_to_str(const struct LDKInvoiceError *NONNULL_PTR o);
49241 * Serialize the InvoiceError object into a byte array which can be read by InvoiceError_read
49243 struct LDKCVec_u8Z InvoiceError_write(const struct LDKInvoiceError *NONNULL_PTR obj);
49246 * Read a InvoiceError from a byte array, created by InvoiceError_write
49248 struct LDKCResult_InvoiceErrorDecodeErrorZ InvoiceError_read(struct LDKu8slice ser);
49251 * Frees any resources used by the InvoiceRequestWithExplicitPayerIdBuilder, if is_owned is set and inner is non-NULL.
49253 void InvoiceRequestWithExplicitPayerIdBuilder_free(struct LDKInvoiceRequestWithExplicitPayerIdBuilder this_obj);
49256 * Frees any resources used by the InvoiceRequestWithDerivedPayerIdBuilder, if is_owned is set and inner is non-NULL.
49258 void InvoiceRequestWithDerivedPayerIdBuilder_free(struct LDKInvoiceRequestWithDerivedPayerIdBuilder this_obj);
49261 * Builds an unsigned [`InvoiceRequest`] after checking for valid semantics. It can be signed
49262 * by [`UnsignedInvoiceRequest::sign`].
49264 MUST_USE_RES struct LDKCResult_UnsignedInvoiceRequestBolt12SemanticErrorZ InvoiceRequestWithExplicitPayerIdBuilder_build(struct LDKInvoiceRequestWithExplicitPayerIdBuilder this_arg);
49267 * Sets the [`InvoiceRequest::chain`] of the given [`Network`] for paying an invoice. If not
49268 * called, [`Network::Bitcoin`] is assumed. Errors if the chain for `network` is not supported
49271 * Successive calls to this method will override the previous setting.
49273 MUST_USE_RES struct LDKCResult_NoneBolt12SemanticErrorZ InvoiceRequestWithExplicitPayerIdBuilder_chain(struct LDKInvoiceRequestWithExplicitPayerIdBuilder this_arg, enum LDKNetwork network);
49276 * Sets the [`InvoiceRequest::amount_msats`] for paying an invoice. Errors if `amount_msats` is
49277 * not at least the expected invoice amount (i.e., [`Offer::amount`] times [`quantity`]).
49279 * Successive calls to this method will override the previous setting.
49281 * [`quantity`]: Self::quantity
49283 MUST_USE_RES struct LDKCResult_NoneBolt12SemanticErrorZ InvoiceRequestWithExplicitPayerIdBuilder_amount_msats(struct LDKInvoiceRequestWithExplicitPayerIdBuilder this_arg, uint64_t amount_msats);
49286 * Sets [`InvoiceRequest::quantity`] of items. If not set, `1` is assumed. Errors if `quantity`
49287 * does not conform to [`Offer::is_valid_quantity`].
49289 * Successive calls to this method will override the previous setting.
49291 MUST_USE_RES struct LDKCResult_NoneBolt12SemanticErrorZ InvoiceRequestWithExplicitPayerIdBuilder_quantity(struct LDKInvoiceRequestWithExplicitPayerIdBuilder this_arg, uint64_t quantity);
49294 * Sets the [`InvoiceRequest::payer_note`].
49296 * Successive calls to this method will override the previous setting.
49298 MUST_USE_RES void InvoiceRequestWithExplicitPayerIdBuilder_payer_note(struct LDKInvoiceRequestWithExplicitPayerIdBuilder this_arg, struct LDKStr payer_note);
49301 * Builds a signed [`InvoiceRequest`] after checking for valid semantics.
49303 MUST_USE_RES struct LDKCResult_InvoiceRequestBolt12SemanticErrorZ InvoiceRequestWithDerivedPayerIdBuilder_build_and_sign(struct LDKInvoiceRequestWithDerivedPayerIdBuilder this_arg);
49306 * Sets the [`InvoiceRequest::chain`] of the given [`Network`] for paying an invoice. If not
49307 * called, [`Network::Bitcoin`] is assumed. Errors if the chain for `network` is not supported
49310 * Successive calls to this method will override the previous setting.
49312 MUST_USE_RES struct LDKCResult_NoneBolt12SemanticErrorZ InvoiceRequestWithDerivedPayerIdBuilder_chain(struct LDKInvoiceRequestWithDerivedPayerIdBuilder this_arg, enum LDKNetwork network);
49315 * Sets the [`InvoiceRequest::amount_msats`] for paying an invoice. Errors if `amount_msats` is
49316 * not at least the expected invoice amount (i.e., [`Offer::amount`] times [`quantity`]).
49318 * Successive calls to this method will override the previous setting.
49320 * [`quantity`]: Self::quantity
49322 MUST_USE_RES struct LDKCResult_NoneBolt12SemanticErrorZ InvoiceRequestWithDerivedPayerIdBuilder_amount_msats(struct LDKInvoiceRequestWithDerivedPayerIdBuilder this_arg, uint64_t amount_msats);
49325 * Sets [`InvoiceRequest::quantity`] of items. If not set, `1` is assumed. Errors if `quantity`
49326 * does not conform to [`Offer::is_valid_quantity`].
49328 * Successive calls to this method will override the previous setting.
49330 MUST_USE_RES struct LDKCResult_NoneBolt12SemanticErrorZ InvoiceRequestWithDerivedPayerIdBuilder_quantity(struct LDKInvoiceRequestWithDerivedPayerIdBuilder this_arg, uint64_t quantity);
49333 * Sets the [`InvoiceRequest::payer_note`].
49335 * Successive calls to this method will override the previous setting.
49337 MUST_USE_RES void InvoiceRequestWithDerivedPayerIdBuilder_payer_note(struct LDKInvoiceRequestWithDerivedPayerIdBuilder this_arg, struct LDKStr payer_note);
49340 * Frees any resources used by the UnsignedInvoiceRequest, if is_owned is set and inner is non-NULL.
49342 void UnsignedInvoiceRequest_free(struct LDKUnsignedInvoiceRequest this_obj);
49345 * Creates a copy of the UnsignedInvoiceRequest
49347 struct LDKUnsignedInvoiceRequest UnsignedInvoiceRequest_clone(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR orig);
49350 * Calls the free function if one is set
49352 void SignInvoiceRequestFn_free(struct LDKSignInvoiceRequestFn this_ptr);
49355 * Returns the [`TaggedHash`] of the invoice to sign.
49357 MUST_USE_RES struct LDKTaggedHash UnsignedInvoiceRequest_tagged_hash(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR this_arg);
49360 * Frees any resources used by the InvoiceRequest, if is_owned is set and inner is non-NULL.
49362 void InvoiceRequest_free(struct LDKInvoiceRequest this_obj);
49365 * Creates a copy of the InvoiceRequest
49367 struct LDKInvoiceRequest InvoiceRequest_clone(const struct LDKInvoiceRequest *NONNULL_PTR orig);
49370 * Frees any resources used by the VerifiedInvoiceRequest, if is_owned is set and inner is non-NULL.
49372 void VerifiedInvoiceRequest_free(struct LDKVerifiedInvoiceRequest this_obj);
49375 * The identifier of the [`Offer`] for which the [`InvoiceRequest`] was made.
49377 struct LDKOfferId VerifiedInvoiceRequest_get_offer_id(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_ptr);
49380 * The identifier of the [`Offer`] for which the [`InvoiceRequest`] was made.
49382 void VerifiedInvoiceRequest_set_offer_id(struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_ptr, struct LDKOfferId val);
49385 * Keys used for signing a [`Bolt12Invoice`] if they can be derived.
49387 * If `Some`, must call [`respond_using_derived_keys`] when responding. Otherwise, call
49388 * [`respond_with`].
49390 * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice
49391 * [`respond_using_derived_keys`]: Self::respond_using_derived_keys
49392 * [`respond_with`]: Self::respond_with
49394 struct LDKCOption_SecretKeyZ VerifiedInvoiceRequest_get_keys(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_ptr);
49397 * Keys used for signing a [`Bolt12Invoice`] if they can be derived.
49399 * If `Some`, must call [`respond_using_derived_keys`] when responding. Otherwise, call
49400 * [`respond_with`].
49402 * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice
49403 * [`respond_using_derived_keys`]: Self::respond_using_derived_keys
49404 * [`respond_with`]: Self::respond_with
49406 void VerifiedInvoiceRequest_set_keys(struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_ptr, struct LDKCOption_SecretKeyZ val);
49409 * Creates a copy of the VerifiedInvoiceRequest
49411 struct LDKVerifiedInvoiceRequest VerifiedInvoiceRequest_clone(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR orig);
49414 * The chains that may be used when paying a requested invoice (e.g., bitcoin mainnet).
49415 * Payments must be denominated in units of the minimal lightning-payable unit (e.g., msats)
49416 * for the selected chain.
49418 MUST_USE_RES struct LDKCVec_ThirtyTwoBytesZ UnsignedInvoiceRequest_chains(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR this_arg);
49421 * Opaque bytes set by the originator. Useful for authentication and validating fields since it
49422 * is reflected in `invoice_request` messages along with all the other fields from the `offer`.
49424 MUST_USE_RES struct LDKCOption_CVec_u8ZZ UnsignedInvoiceRequest_metadata(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR this_arg);
49427 * The minimum amount required for a successful payment of a single item.
49429 MUST_USE_RES struct LDKCOption_AmountZ UnsignedInvoiceRequest_amount(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR this_arg);
49432 * A complete description of the purpose of the payment. Intended to be displayed to the user
49433 * but with the caveat that it has not been verified in any way.
49435 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
49437 MUST_USE_RES struct LDKPrintableString UnsignedInvoiceRequest_description(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR this_arg);
49440 * Features pertaining to the offer.
49442 MUST_USE_RES struct LDKOfferFeatures UnsignedInvoiceRequest_offer_features(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR this_arg);
49445 * Duration since the Unix epoch when an invoice should no longer be requested.
49447 * If `None`, the offer does not expire.
49449 MUST_USE_RES struct LDKCOption_u64Z UnsignedInvoiceRequest_absolute_expiry(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR this_arg);
49452 * The issuer of the offer, possibly beginning with `user@domain` or `domain`. Intended to be
49453 * displayed to the user but with the caveat that it has not been verified in any way.
49455 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
49457 MUST_USE_RES struct LDKPrintableString UnsignedInvoiceRequest_issuer(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR this_arg);
49460 * Paths to the recipient originating from publicly reachable nodes. Blinded paths provide
49461 * recipient privacy by obfuscating its node id.
49463 MUST_USE_RES struct LDKCVec_BlindedPathZ UnsignedInvoiceRequest_paths(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR this_arg);
49466 * The quantity of items supported.
49468 MUST_USE_RES struct LDKQuantity UnsignedInvoiceRequest_supported_quantity(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR this_arg);
49471 * The public key used by the recipient to sign invoices.
49473 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
49475 MUST_USE_RES struct LDKPublicKey UnsignedInvoiceRequest_signing_pubkey(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR this_arg);
49478 * An unpredictable series of bytes, typically containing information about the derivation of
49481 * [`payer_id`]: Self::payer_id
49483 MUST_USE_RES struct LDKu8slice UnsignedInvoiceRequest_payer_metadata(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR this_arg);
49486 * A chain from [`Offer::chains`] that the offer is valid for.
49488 MUST_USE_RES struct LDKThirtyTwoBytes UnsignedInvoiceRequest_chain(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR this_arg);
49491 * The amount to pay in msats (i.e., the minimum lightning-payable unit for [`chain`]), which
49492 * must be greater than or equal to [`Offer::amount`], converted if necessary.
49494 * [`chain`]: Self::chain
49496 MUST_USE_RES struct LDKCOption_u64Z UnsignedInvoiceRequest_amount_msats(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR this_arg);
49499 * Features pertaining to requesting an invoice.
49501 MUST_USE_RES struct LDKInvoiceRequestFeatures UnsignedInvoiceRequest_invoice_request_features(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR this_arg);
49504 * The quantity of the offer's item conforming to [`Offer::is_valid_quantity`].
49506 MUST_USE_RES struct LDKCOption_u64Z UnsignedInvoiceRequest_quantity(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR this_arg);
49509 * A possibly transient pubkey used to sign the invoice request.
49511 MUST_USE_RES struct LDKPublicKey UnsignedInvoiceRequest_payer_id(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR this_arg);
49514 * A payer-provided note which will be seen by the recipient and reflected back in the invoice
49517 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
49519 MUST_USE_RES struct LDKPrintableString UnsignedInvoiceRequest_payer_note(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR this_arg);
49522 * The chains that may be used when paying a requested invoice (e.g., bitcoin mainnet).
49523 * Payments must be denominated in units of the minimal lightning-payable unit (e.g., msats)
49524 * for the selected chain.
49526 MUST_USE_RES struct LDKCVec_ThirtyTwoBytesZ InvoiceRequest_chains(const struct LDKInvoiceRequest *NONNULL_PTR this_arg);
49529 * Opaque bytes set by the originator. Useful for authentication and validating fields since it
49530 * is reflected in `invoice_request` messages along with all the other fields from the `offer`.
49532 MUST_USE_RES struct LDKCOption_CVec_u8ZZ InvoiceRequest_metadata(const struct LDKInvoiceRequest *NONNULL_PTR this_arg);
49535 * The minimum amount required for a successful payment of a single item.
49537 MUST_USE_RES struct LDKCOption_AmountZ InvoiceRequest_amount(const struct LDKInvoiceRequest *NONNULL_PTR this_arg);
49540 * A complete description of the purpose of the payment. Intended to be displayed to the user
49541 * but with the caveat that it has not been verified in any way.
49543 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
49545 MUST_USE_RES struct LDKPrintableString InvoiceRequest_description(const struct LDKInvoiceRequest *NONNULL_PTR this_arg);
49548 * Features pertaining to the offer.
49550 MUST_USE_RES struct LDKOfferFeatures InvoiceRequest_offer_features(const struct LDKInvoiceRequest *NONNULL_PTR this_arg);
49553 * Duration since the Unix epoch when an invoice should no longer be requested.
49555 * If `None`, the offer does not expire.
49557 MUST_USE_RES struct LDKCOption_u64Z InvoiceRequest_absolute_expiry(const struct LDKInvoiceRequest *NONNULL_PTR this_arg);
49560 * The issuer of the offer, possibly beginning with `user@domain` or `domain`. Intended to be
49561 * displayed to the user but with the caveat that it has not been verified in any way.
49563 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
49565 MUST_USE_RES struct LDKPrintableString InvoiceRequest_issuer(const struct LDKInvoiceRequest *NONNULL_PTR this_arg);
49568 * Paths to the recipient originating from publicly reachable nodes. Blinded paths provide
49569 * recipient privacy by obfuscating its node id.
49571 MUST_USE_RES struct LDKCVec_BlindedPathZ InvoiceRequest_paths(const struct LDKInvoiceRequest *NONNULL_PTR this_arg);
49574 * The quantity of items supported.
49576 MUST_USE_RES struct LDKQuantity InvoiceRequest_supported_quantity(const struct LDKInvoiceRequest *NONNULL_PTR this_arg);
49579 * The public key used by the recipient to sign invoices.
49581 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
49583 MUST_USE_RES struct LDKPublicKey InvoiceRequest_signing_pubkey(const struct LDKInvoiceRequest *NONNULL_PTR this_arg);
49586 * An unpredictable series of bytes, typically containing information about the derivation of
49589 * [`payer_id`]: Self::payer_id
49591 MUST_USE_RES struct LDKu8slice InvoiceRequest_payer_metadata(const struct LDKInvoiceRequest *NONNULL_PTR this_arg);
49594 * A chain from [`Offer::chains`] that the offer is valid for.
49596 MUST_USE_RES struct LDKThirtyTwoBytes InvoiceRequest_chain(const struct LDKInvoiceRequest *NONNULL_PTR this_arg);
49599 * The amount to pay in msats (i.e., the minimum lightning-payable unit for [`chain`]), which
49600 * must be greater than or equal to [`Offer::amount`], converted if necessary.
49602 * [`chain`]: Self::chain
49604 MUST_USE_RES struct LDKCOption_u64Z InvoiceRequest_amount_msats(const struct LDKInvoiceRequest *NONNULL_PTR this_arg);
49607 * Features pertaining to requesting an invoice.
49609 MUST_USE_RES struct LDKInvoiceRequestFeatures InvoiceRequest_invoice_request_features(const struct LDKInvoiceRequest *NONNULL_PTR this_arg);
49612 * The quantity of the offer's item conforming to [`Offer::is_valid_quantity`].
49614 MUST_USE_RES struct LDKCOption_u64Z InvoiceRequest_quantity(const struct LDKInvoiceRequest *NONNULL_PTR this_arg);
49617 * A possibly transient pubkey used to sign the invoice request.
49619 MUST_USE_RES struct LDKPublicKey InvoiceRequest_payer_id(const struct LDKInvoiceRequest *NONNULL_PTR this_arg);
49622 * A payer-provided note which will be seen by the recipient and reflected back in the invoice
49625 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
49627 MUST_USE_RES struct LDKPrintableString InvoiceRequest_payer_note(const struct LDKInvoiceRequest *NONNULL_PTR this_arg);
49630 * Creates an [`InvoiceBuilder`] for the request with the given required fields and using the
49631 * [`Duration`] since [`std::time::SystemTime::UNIX_EPOCH`] as the creation time.
49633 * See [`InvoiceRequest::respond_with_no_std`] for further details where the aforementioned
49634 * creation time is used for the `created_at` parameter.
49636 * [`Duration`]: core::time::Duration
49638 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);
49641 * Creates an [`InvoiceBuilder`] for the request with the given required fields.
49643 * Unless [`InvoiceBuilder::relative_expiry`] is set, the invoice will expire two hours after
49644 * `created_at`, which is used to set [`Bolt12Invoice::created_at`]. Useful for `no-std` builds
49645 * where [`std::time::SystemTime`] is not available.
49647 * The caller is expected to remember the preimage of `payment_hash` in order to claim a payment
49650 * The `payment_paths` parameter is useful for maintaining the payment recipient's privacy. It
49651 * must contain one or more elements ordered from most-preferred to least-preferred, if there's
49652 * a preference. Note, however, that any privacy is lost if a public node id was used for
49653 * [`Offer::signing_pubkey`].
49655 * Errors if the request contains unknown required features.
49659 * If the originating [`Offer`] was created using [`OfferBuilder::deriving_signing_pubkey`],
49660 * then use [`InvoiceRequest::verify`] and [`VerifiedInvoiceRequest`] methods instead.
49662 * [`Bolt12Invoice::created_at`]: crate::offers::invoice::Bolt12Invoice::created_at
49663 * [`OfferBuilder::deriving_signing_pubkey`]: crate::offers::offer::OfferBuilder::deriving_signing_pubkey
49665 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);
49668 * Verifies that the request was for an offer created using the given key. Returns the verified
49669 * request which contains the derived keys needed to sign a [`Bolt12Invoice`] for the request
49670 * if they could be extracted from the metadata.
49672 * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice
49674 MUST_USE_RES struct LDKCResult_VerifiedInvoiceRequestNoneZ InvoiceRequest_verify(struct LDKInvoiceRequest this_arg, const struct LDKExpandedKey *NONNULL_PTR key);
49677 * Signature of the invoice request using [`payer_id`].
49679 * [`payer_id`]: Self::payer_id
49681 MUST_USE_RES struct LDKSchnorrSignature InvoiceRequest_signature(const struct LDKInvoiceRequest *NONNULL_PTR this_arg);
49684 * The chains that may be used when paying a requested invoice (e.g., bitcoin mainnet).
49685 * Payments must be denominated in units of the minimal lightning-payable unit (e.g., msats)
49686 * for the selected chain.
49688 MUST_USE_RES struct LDKCVec_ThirtyTwoBytesZ VerifiedInvoiceRequest_chains(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg);
49691 * Opaque bytes set by the originator. Useful for authentication and validating fields since it
49692 * is reflected in `invoice_request` messages along with all the other fields from the `offer`.
49694 MUST_USE_RES struct LDKCOption_CVec_u8ZZ VerifiedInvoiceRequest_metadata(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg);
49697 * The minimum amount required for a successful payment of a single item.
49699 MUST_USE_RES struct LDKCOption_AmountZ VerifiedInvoiceRequest_amount(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg);
49702 * A complete description of the purpose of the payment. Intended to be displayed to the user
49703 * but with the caveat that it has not been verified in any way.
49705 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
49707 MUST_USE_RES struct LDKPrintableString VerifiedInvoiceRequest_description(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg);
49710 * Features pertaining to the offer.
49712 MUST_USE_RES struct LDKOfferFeatures VerifiedInvoiceRequest_offer_features(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg);
49715 * Duration since the Unix epoch when an invoice should no longer be requested.
49717 * If `None`, the offer does not expire.
49719 MUST_USE_RES struct LDKCOption_u64Z VerifiedInvoiceRequest_absolute_expiry(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg);
49722 * The issuer of the offer, possibly beginning with `user@domain` or `domain`. Intended to be
49723 * displayed to the user but with the caveat that it has not been verified in any way.
49725 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
49727 MUST_USE_RES struct LDKPrintableString VerifiedInvoiceRequest_issuer(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg);
49730 * Paths to the recipient originating from publicly reachable nodes. Blinded paths provide
49731 * recipient privacy by obfuscating its node id.
49733 MUST_USE_RES struct LDKCVec_BlindedPathZ VerifiedInvoiceRequest_paths(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg);
49736 * The quantity of items supported.
49738 MUST_USE_RES struct LDKQuantity VerifiedInvoiceRequest_supported_quantity(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg);
49741 * The public key used by the recipient to sign invoices.
49743 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
49745 MUST_USE_RES struct LDKPublicKey VerifiedInvoiceRequest_signing_pubkey(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg);
49748 * An unpredictable series of bytes, typically containing information about the derivation of
49751 * [`payer_id`]: Self::payer_id
49753 MUST_USE_RES struct LDKu8slice VerifiedInvoiceRequest_payer_metadata(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg);
49756 * A chain from [`Offer::chains`] that the offer is valid for.
49758 MUST_USE_RES struct LDKThirtyTwoBytes VerifiedInvoiceRequest_chain(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg);
49761 * The amount to pay in msats (i.e., the minimum lightning-payable unit for [`chain`]), which
49762 * must be greater than or equal to [`Offer::amount`], converted if necessary.
49764 * [`chain`]: Self::chain
49766 MUST_USE_RES struct LDKCOption_u64Z VerifiedInvoiceRequest_amount_msats(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg);
49769 * Features pertaining to requesting an invoice.
49771 MUST_USE_RES struct LDKInvoiceRequestFeatures VerifiedInvoiceRequest_invoice_request_features(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg);
49774 * The quantity of the offer's item conforming to [`Offer::is_valid_quantity`].
49776 MUST_USE_RES struct LDKCOption_u64Z VerifiedInvoiceRequest_quantity(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg);
49779 * A possibly transient pubkey used to sign the invoice request.
49781 MUST_USE_RES struct LDKPublicKey VerifiedInvoiceRequest_payer_id(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg);
49784 * A payer-provided note which will be seen by the recipient and reflected back in the invoice
49787 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
49789 MUST_USE_RES struct LDKPrintableString VerifiedInvoiceRequest_payer_note(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg);
49792 * Creates an [`InvoiceBuilder`] for the request with the given required fields and using the
49793 * [`Duration`] since [`std::time::SystemTime::UNIX_EPOCH`] as the creation time.
49795 * See [`InvoiceRequest::respond_with_no_std`] for further details where the aforementioned
49796 * creation time is used for the `created_at` parameter.
49798 * [`Duration`]: core::time::Duration
49800 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);
49803 * Creates an [`InvoiceBuilder`] for the request with the given required fields.
49805 * Unless [`InvoiceBuilder::relative_expiry`] is set, the invoice will expire two hours after
49806 * `created_at`, which is used to set [`Bolt12Invoice::created_at`]. Useful for `no-std` builds
49807 * where [`std::time::SystemTime`] is not available.
49809 * The caller is expected to remember the preimage of `payment_hash` in order to claim a payment
49812 * The `payment_paths` parameter is useful for maintaining the payment recipient's privacy. It
49813 * must contain one or more elements ordered from most-preferred to least-preferred, if there's
49814 * a preference. Note, however, that any privacy is lost if a public node id was used for
49815 * [`Offer::signing_pubkey`].
49817 * Errors if the request contains unknown required features.
49821 * If the originating [`Offer`] was created using [`OfferBuilder::deriving_signing_pubkey`],
49822 * then use [`InvoiceRequest::verify`] and [`VerifiedInvoiceRequest`] methods instead.
49824 * [`Bolt12Invoice::created_at`]: crate::offers::invoice::Bolt12Invoice::created_at
49825 * [`OfferBuilder::deriving_signing_pubkey`]: crate::offers::offer::OfferBuilder::deriving_signing_pubkey
49827 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);
49830 * Creates an [`InvoiceBuilder`] for the request using the given required fields and that uses
49831 * derived signing keys from the originating [`Offer`] to sign the [`Bolt12Invoice`]. Must use
49832 * the same [`ExpandedKey`] as the one used to create the offer.
49834 * See [`InvoiceRequest::respond_with`] for further details.
49836 * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice
49838 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);
49841 * Creates an [`InvoiceBuilder`] for the request using the given required fields and that uses
49842 * derived signing keys from the originating [`Offer`] to sign the [`Bolt12Invoice`]. Must use
49843 * the same [`ExpandedKey`] as the one used to create the offer.
49845 * See [`InvoiceRequest::respond_with_no_std`] for further details.
49847 * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice
49849 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);
49852 * Serialize the UnsignedInvoiceRequest object into a byte array which can be read by UnsignedInvoiceRequest_read
49854 struct LDKCVec_u8Z UnsignedInvoiceRequest_write(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR obj);
49857 * Serialize the InvoiceRequest object into a byte array which can be read by InvoiceRequest_read
49859 struct LDKCVec_u8Z InvoiceRequest_write(const struct LDKInvoiceRequest *NONNULL_PTR obj);
49862 * Frees any resources used by the InvoiceRequestFields, if is_owned is set and inner is non-NULL.
49864 void InvoiceRequestFields_free(struct LDKInvoiceRequestFields this_obj);
49867 * A possibly transient pubkey used to sign the invoice request.
49869 struct LDKPublicKey InvoiceRequestFields_get_payer_id(const struct LDKInvoiceRequestFields *NONNULL_PTR this_ptr);
49872 * A possibly transient pubkey used to sign the invoice request.
49874 void InvoiceRequestFields_set_payer_id(struct LDKInvoiceRequestFields *NONNULL_PTR this_ptr, struct LDKPublicKey val);
49877 * The quantity of the offer's item conforming to [`Offer::is_valid_quantity`].
49879 struct LDKCOption_u64Z InvoiceRequestFields_get_quantity(const struct LDKInvoiceRequestFields *NONNULL_PTR this_ptr);
49882 * The quantity of the offer's item conforming to [`Offer::is_valid_quantity`].
49884 void InvoiceRequestFields_set_quantity(struct LDKInvoiceRequestFields *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
49887 * A payer-provided note which will be seen by the recipient and reflected back in the invoice
49888 * response. Truncated to [`PAYER_NOTE_LIMIT`] characters.
49890 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
49892 struct LDKUntrustedString InvoiceRequestFields_get_payer_note_truncated(const struct LDKInvoiceRequestFields *NONNULL_PTR this_ptr);
49895 * A payer-provided note which will be seen by the recipient and reflected back in the invoice
49896 * response. Truncated to [`PAYER_NOTE_LIMIT`] characters.
49898 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
49900 void InvoiceRequestFields_set_payer_note_truncated(struct LDKInvoiceRequestFields *NONNULL_PTR this_ptr, struct LDKUntrustedString val);
49903 * Constructs a new InvoiceRequestFields given each field
49905 * Note that payer_note_truncated_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
49907 MUST_USE_RES struct LDKInvoiceRequestFields InvoiceRequestFields_new(struct LDKPublicKey payer_id_arg, struct LDKCOption_u64Z quantity_arg, struct LDKUntrustedString payer_note_truncated_arg);
49910 * Creates a copy of the InvoiceRequestFields
49912 struct LDKInvoiceRequestFields InvoiceRequestFields_clone(const struct LDKInvoiceRequestFields *NONNULL_PTR orig);
49915 * Checks if two InvoiceRequestFieldss contain equal inner contents.
49916 * This ignores pointers and is_owned flags and looks at the values in fields.
49917 * Two objects with NULL inner values will be considered "equal" here.
49919 bool InvoiceRequestFields_eq(const struct LDKInvoiceRequestFields *NONNULL_PTR a, const struct LDKInvoiceRequestFields *NONNULL_PTR b);
49922 * Serialize the InvoiceRequestFields object into a byte array which can be read by InvoiceRequestFields_read
49924 struct LDKCVec_u8Z InvoiceRequestFields_write(const struct LDKInvoiceRequestFields *NONNULL_PTR obj);
49927 * Read a InvoiceRequestFields from a byte array, created by InvoiceRequestFields_write
49929 struct LDKCResult_InvoiceRequestFieldsDecodeErrorZ InvoiceRequestFields_read(struct LDKu8slice ser);
49932 * Frees any resources used by the TaggedHash, if is_owned is set and inner is non-NULL.
49934 void TaggedHash_free(struct LDKTaggedHash this_obj);
49937 * Creates a copy of the TaggedHash
49939 struct LDKTaggedHash TaggedHash_clone(const struct LDKTaggedHash *NONNULL_PTR orig);
49942 * Returns the digest to sign.
49944 MUST_USE_RES const uint8_t (*TaggedHash_as_digest(const struct LDKTaggedHash *NONNULL_PTR this_arg))[32];
49947 * Returns the tag used in the tagged hash.
49949 MUST_USE_RES struct LDKStr TaggedHash_tag(const struct LDKTaggedHash *NONNULL_PTR this_arg);
49952 * Returns the merkle root used in the tagged hash.
49954 MUST_USE_RES struct LDKThirtyTwoBytes TaggedHash_merkle_root(const struct LDKTaggedHash *NONNULL_PTR this_arg);
49957 * Frees any resources used by the SignError
49959 void SignError_free(struct LDKSignError this_ptr);
49962 * Creates a copy of the SignError
49964 struct LDKSignError SignError_clone(const struct LDKSignError *NONNULL_PTR orig);
49967 * Utility method to constructs a new Signing-variant SignError
49969 struct LDKSignError SignError_signing(void);
49972 * Utility method to constructs a new Verification-variant SignError
49974 struct LDKSignError SignError_verification(enum LDKSecp256k1Error a);
49977 * Frees any resources used by the Bolt12ParseError, if is_owned is set and inner is non-NULL.
49979 void Bolt12ParseError_free(struct LDKBolt12ParseError this_obj);
49982 * Creates a copy of the Bolt12ParseError
49984 struct LDKBolt12ParseError Bolt12ParseError_clone(const struct LDKBolt12ParseError *NONNULL_PTR orig);
49987 * Creates a copy of the Bolt12SemanticError
49989 enum LDKBolt12SemanticError Bolt12SemanticError_clone(const enum LDKBolt12SemanticError *NONNULL_PTR orig);
49992 * Utility method to constructs a new AlreadyExpired-variant Bolt12SemanticError
49994 enum LDKBolt12SemanticError Bolt12SemanticError_already_expired(void);
49997 * Utility method to constructs a new UnsupportedChain-variant Bolt12SemanticError
49999 enum LDKBolt12SemanticError Bolt12SemanticError_unsupported_chain(void);
50002 * Utility method to constructs a new UnexpectedChain-variant Bolt12SemanticError
50004 enum LDKBolt12SemanticError Bolt12SemanticError_unexpected_chain(void);
50007 * Utility method to constructs a new MissingAmount-variant Bolt12SemanticError
50009 enum LDKBolt12SemanticError Bolt12SemanticError_missing_amount(void);
50012 * Utility method to constructs a new InvalidAmount-variant Bolt12SemanticError
50014 enum LDKBolt12SemanticError Bolt12SemanticError_invalid_amount(void);
50017 * Utility method to constructs a new InsufficientAmount-variant Bolt12SemanticError
50019 enum LDKBolt12SemanticError Bolt12SemanticError_insufficient_amount(void);
50022 * Utility method to constructs a new UnexpectedAmount-variant Bolt12SemanticError
50024 enum LDKBolt12SemanticError Bolt12SemanticError_unexpected_amount(void);
50027 * Utility method to constructs a new UnsupportedCurrency-variant Bolt12SemanticError
50029 enum LDKBolt12SemanticError Bolt12SemanticError_unsupported_currency(void);
50032 * Utility method to constructs a new UnknownRequiredFeatures-variant Bolt12SemanticError
50034 enum LDKBolt12SemanticError Bolt12SemanticError_unknown_required_features(void);
50037 * Utility method to constructs a new UnexpectedFeatures-variant Bolt12SemanticError
50039 enum LDKBolt12SemanticError Bolt12SemanticError_unexpected_features(void);
50042 * Utility method to constructs a new MissingDescription-variant Bolt12SemanticError
50044 enum LDKBolt12SemanticError Bolt12SemanticError_missing_description(void);
50047 * Utility method to constructs a new MissingSigningPubkey-variant Bolt12SemanticError
50049 enum LDKBolt12SemanticError Bolt12SemanticError_missing_signing_pubkey(void);
50052 * Utility method to constructs a new InvalidSigningPubkey-variant Bolt12SemanticError
50054 enum LDKBolt12SemanticError Bolt12SemanticError_invalid_signing_pubkey(void);
50057 * Utility method to constructs a new UnexpectedSigningPubkey-variant Bolt12SemanticError
50059 enum LDKBolt12SemanticError Bolt12SemanticError_unexpected_signing_pubkey(void);
50062 * Utility method to constructs a new MissingQuantity-variant Bolt12SemanticError
50064 enum LDKBolt12SemanticError Bolt12SemanticError_missing_quantity(void);
50067 * Utility method to constructs a new InvalidQuantity-variant Bolt12SemanticError
50069 enum LDKBolt12SemanticError Bolt12SemanticError_invalid_quantity(void);
50072 * Utility method to constructs a new UnexpectedQuantity-variant Bolt12SemanticError
50074 enum LDKBolt12SemanticError Bolt12SemanticError_unexpected_quantity(void);
50077 * Utility method to constructs a new InvalidMetadata-variant Bolt12SemanticError
50079 enum LDKBolt12SemanticError Bolt12SemanticError_invalid_metadata(void);
50082 * Utility method to constructs a new UnexpectedMetadata-variant Bolt12SemanticError
50084 enum LDKBolt12SemanticError Bolt12SemanticError_unexpected_metadata(void);
50087 * Utility method to constructs a new MissingPayerMetadata-variant Bolt12SemanticError
50089 enum LDKBolt12SemanticError Bolt12SemanticError_missing_payer_metadata(void);
50092 * Utility method to constructs a new MissingPayerId-variant Bolt12SemanticError
50094 enum LDKBolt12SemanticError Bolt12SemanticError_missing_payer_id(void);
50097 * Utility method to constructs a new DuplicatePaymentId-variant Bolt12SemanticError
50099 enum LDKBolt12SemanticError Bolt12SemanticError_duplicate_payment_id(void);
50102 * Utility method to constructs a new MissingPaths-variant Bolt12SemanticError
50104 enum LDKBolt12SemanticError Bolt12SemanticError_missing_paths(void);
50107 * Utility method to constructs a new UnexpectedPaths-variant Bolt12SemanticError
50109 enum LDKBolt12SemanticError Bolt12SemanticError_unexpected_paths(void);
50112 * Utility method to constructs a new InvalidPayInfo-variant Bolt12SemanticError
50114 enum LDKBolt12SemanticError Bolt12SemanticError_invalid_pay_info(void);
50117 * Utility method to constructs a new MissingCreationTime-variant Bolt12SemanticError
50119 enum LDKBolt12SemanticError Bolt12SemanticError_missing_creation_time(void);
50122 * Utility method to constructs a new MissingPaymentHash-variant Bolt12SemanticError
50124 enum LDKBolt12SemanticError Bolt12SemanticError_missing_payment_hash(void);
50127 * Utility method to constructs a new MissingSignature-variant Bolt12SemanticError
50129 enum LDKBolt12SemanticError Bolt12SemanticError_missing_signature(void);
50132 * Frees any resources used by the RefundMaybeWithDerivedMetadataBuilder, if is_owned is set and inner is non-NULL.
50134 void RefundMaybeWithDerivedMetadataBuilder_free(struct LDKRefundMaybeWithDerivedMetadataBuilder this_obj);
50137 * Creates a copy of the RefundMaybeWithDerivedMetadataBuilder
50139 struct LDKRefundMaybeWithDerivedMetadataBuilder RefundMaybeWithDerivedMetadataBuilder_clone(const struct LDKRefundMaybeWithDerivedMetadataBuilder *NONNULL_PTR orig);
50142 * Creates a new builder for a refund using the [`Refund::payer_id`] for the public node id to
50143 * send to if no [`Refund::paths`] are set. Otherwise, it may be a transient pubkey.
50145 * Additionally, sets the required (empty) [`Refund::description`], [`Refund::payer_metadata`],
50146 * and [`Refund::amount_msats`].
50150 * If constructing a [`Refund`] for use with a [`ChannelManager`], use
50151 * [`ChannelManager::create_refund_builder`] instead of [`RefundBuilder::new`].
50153 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
50154 * [`ChannelManager::create_refund_builder`]: crate::ln::channelmanager::ChannelManager::create_refund_builder
50156 MUST_USE_RES struct LDKCResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ RefundMaybeWithDerivedMetadataBuilder_new(struct LDKCVec_u8Z metadata, struct LDKPublicKey payer_id, uint64_t amount_msats);
50159 * Similar to [`RefundBuilder::new`] except, if [`RefundBuilder::path`] is called, the payer id
50160 * is derived from the given [`ExpandedKey`] and nonce. This provides sender privacy by using a
50161 * different payer id for each refund, assuming a different nonce is used. Otherwise, the
50162 * provided `node_id` is used for the payer id.
50164 * Also, sets the metadata when [`RefundBuilder::build`] is called such that it can be used to
50165 * verify that an [`InvoiceRequest`] was produced for the refund given an [`ExpandedKey`].
50167 * The `payment_id` is encrypted in the metadata and should be unique. This ensures that only
50168 * one invoice will be paid for the refund and that payments can be uniquely identified.
50170 * [`InvoiceRequest`]: crate::offers::invoice_request::InvoiceRequest
50171 * [`ExpandedKey`]: crate::ln::inbound_payment::ExpandedKey
50173 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);
50176 * Sets the [`Refund::description`].
50178 * Successive calls to this method will override the previous setting.
50180 MUST_USE_RES void RefundMaybeWithDerivedMetadataBuilder_description(struct LDKRefundMaybeWithDerivedMetadataBuilder this_arg, struct LDKStr description);
50183 * Sets the [`Refund::absolute_expiry`] as seconds since the Unix epoch. Any expiry that has
50184 * already passed is valid and can be checked for using [`Refund::is_expired`].
50186 * Successive calls to this method will override the previous setting.
50188 MUST_USE_RES void RefundMaybeWithDerivedMetadataBuilder_absolute_expiry(struct LDKRefundMaybeWithDerivedMetadataBuilder this_arg, uint64_t absolute_expiry);
50191 * Sets the [`Refund::issuer`].
50193 * Successive calls to this method will override the previous setting.
50195 MUST_USE_RES void RefundMaybeWithDerivedMetadataBuilder_issuer(struct LDKRefundMaybeWithDerivedMetadataBuilder this_arg, struct LDKStr issuer);
50198 * Adds a blinded path to [`Refund::paths`]. Must include at least one path if only connected
50199 * by private channels or if [`Refund::payer_id`] is not a public node id.
50201 * Successive calls to this method will add another blinded path. Caller is responsible for not
50202 * adding duplicate paths.
50204 MUST_USE_RES void RefundMaybeWithDerivedMetadataBuilder_path(struct LDKRefundMaybeWithDerivedMetadataBuilder this_arg, struct LDKBlindedPath path);
50207 * Sets the [`Refund::chain`] of the given [`Network`] for paying an invoice. If not
50208 * called, [`Network::Bitcoin`] is assumed.
50210 * Successive calls to this method will override the previous setting.
50212 MUST_USE_RES void RefundMaybeWithDerivedMetadataBuilder_chain(struct LDKRefundMaybeWithDerivedMetadataBuilder this_arg, enum LDKNetwork network);
50215 * Sets [`Refund::quantity`] of items. This is purely for informational purposes. It is useful
50216 * when the refund pertains to a [`Bolt12Invoice`] that paid for more than one item from an
50217 * [`Offer`] as specified by [`InvoiceRequest::quantity`].
50219 * Successive calls to this method will override the previous setting.
50221 * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice
50222 * [`InvoiceRequest::quantity`]: crate::offers::invoice_request::InvoiceRequest::quantity
50223 * [`Offer`]: crate::offers::offer::Offer
50225 MUST_USE_RES void RefundMaybeWithDerivedMetadataBuilder_quantity(struct LDKRefundMaybeWithDerivedMetadataBuilder this_arg, uint64_t quantity);
50228 * Sets the [`Refund::payer_note`].
50230 * Successive calls to this method will override the previous setting.
50232 MUST_USE_RES void RefundMaybeWithDerivedMetadataBuilder_payer_note(struct LDKRefundMaybeWithDerivedMetadataBuilder this_arg, struct LDKStr payer_note);
50235 * Builds a [`Refund`] after checking for valid semantics.
50237 MUST_USE_RES struct LDKCResult_RefundBolt12SemanticErrorZ RefundMaybeWithDerivedMetadataBuilder_build(struct LDKRefundMaybeWithDerivedMetadataBuilder this_arg);
50240 * Frees any resources used by the Refund, if is_owned is set and inner is non-NULL.
50242 void Refund_free(struct LDKRefund this_obj);
50245 * Creates a copy of the Refund
50247 struct LDKRefund Refund_clone(const struct LDKRefund *NONNULL_PTR orig);
50250 * A complete description of the purpose of the refund. Intended to be displayed to the user
50251 * but with the caveat that it has not been verified in any way.
50253 MUST_USE_RES struct LDKPrintableString Refund_description(const struct LDKRefund *NONNULL_PTR this_arg);
50256 * Duration since the Unix epoch when an invoice should no longer be sent.
50258 * If `None`, the refund does not expire.
50260 MUST_USE_RES struct LDKCOption_u64Z Refund_absolute_expiry(const struct LDKRefund *NONNULL_PTR this_arg);
50263 * Whether the refund has expired.
50265 MUST_USE_RES bool Refund_is_expired(const struct LDKRefund *NONNULL_PTR this_arg);
50268 * Whether the refund has expired given the duration since the Unix epoch.
50270 MUST_USE_RES bool Refund_is_expired_no_std(const struct LDKRefund *NONNULL_PTR this_arg, uint64_t duration_since_epoch);
50273 * The issuer of the refund, possibly beginning with `user@domain` or `domain`. Intended to be
50274 * displayed to the user but with the caveat that it has not been verified in any way.
50276 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
50278 MUST_USE_RES struct LDKPrintableString Refund_issuer(const struct LDKRefund *NONNULL_PTR this_arg);
50281 * Paths to the sender originating from publicly reachable nodes. Blinded paths provide sender
50282 * privacy by obfuscating its node id.
50284 MUST_USE_RES struct LDKCVec_BlindedPathZ Refund_paths(const struct LDKRefund *NONNULL_PTR this_arg);
50287 * An unpredictable series of bytes, typically containing information about the derivation of
50290 * [`payer_id`]: Self::payer_id
50292 MUST_USE_RES struct LDKu8slice Refund_payer_metadata(const struct LDKRefund *NONNULL_PTR this_arg);
50295 * A chain that the refund is valid for.
50297 MUST_USE_RES struct LDKThirtyTwoBytes Refund_chain(const struct LDKRefund *NONNULL_PTR this_arg);
50300 * The amount to refund in msats (i.e., the minimum lightning-payable unit for [`chain`]).
50302 * [`chain`]: Self::chain
50304 MUST_USE_RES uint64_t Refund_amount_msats(const struct LDKRefund *NONNULL_PTR this_arg);
50307 * Features pertaining to requesting an invoice.
50309 MUST_USE_RES struct LDKInvoiceRequestFeatures Refund_features(const struct LDKRefund *NONNULL_PTR this_arg);
50312 * The quantity of an item that refund is for.
50314 MUST_USE_RES struct LDKCOption_u64Z Refund_quantity(const struct LDKRefund *NONNULL_PTR this_arg);
50317 * A public node id to send to in the case where there are no [`paths`]. Otherwise, a possibly
50318 * transient pubkey.
50320 * [`paths`]: Self::paths
50322 MUST_USE_RES struct LDKPublicKey Refund_payer_id(const struct LDKRefund *NONNULL_PTR this_arg);
50325 * Payer provided note to include in the invoice.
50327 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
50329 MUST_USE_RES struct LDKPrintableString Refund_payer_note(const struct LDKRefund *NONNULL_PTR this_arg);
50332 * Generates a non-cryptographic 64-bit hash of the Refund.
50334 uint64_t Refund_hash(const struct LDKRefund *NONNULL_PTR o);
50337 * Serialize the Refund object into a byte array which can be read by Refund_read
50339 struct LDKCVec_u8Z Refund_write(const struct LDKRefund *NONNULL_PTR obj);
50342 * Read a Refund object from a string
50344 struct LDKCResult_RefundBolt12ParseErrorZ Refund_from_str(struct LDKStr s);
50347 * Get the string representation of a Refund object
50349 struct LDKStr Refund_to_str(const struct LDKRefund *NONNULL_PTR o);
50352 * Creates a copy of the UtxoLookupError
50354 enum LDKUtxoLookupError UtxoLookupError_clone(const enum LDKUtxoLookupError *NONNULL_PTR orig);
50357 * Utility method to constructs a new UnknownChain-variant UtxoLookupError
50359 enum LDKUtxoLookupError UtxoLookupError_unknown_chain(void);
50362 * Utility method to constructs a new UnknownTx-variant UtxoLookupError
50364 enum LDKUtxoLookupError UtxoLookupError_unknown_tx(void);
50367 * Frees any resources used by the UtxoResult
50369 void UtxoResult_free(struct LDKUtxoResult this_ptr);
50372 * Creates a copy of the UtxoResult
50374 struct LDKUtxoResult UtxoResult_clone(const struct LDKUtxoResult *NONNULL_PTR orig);
50377 * Utility method to constructs a new Sync-variant UtxoResult
50379 struct LDKUtxoResult UtxoResult_sync(struct LDKCResult_TxOutUtxoLookupErrorZ a);
50382 * Utility method to constructs a new Async-variant UtxoResult
50384 struct LDKUtxoResult UtxoResult_async(struct LDKUtxoFuture a);
50387 * Calls the free function if one is set
50389 void UtxoLookup_free(struct LDKUtxoLookup this_ptr);
50392 * Frees any resources used by the UtxoFuture, if is_owned is set and inner is non-NULL.
50394 void UtxoFuture_free(struct LDKUtxoFuture this_obj);
50397 * Creates a copy of the UtxoFuture
50399 struct LDKUtxoFuture UtxoFuture_clone(const struct LDKUtxoFuture *NONNULL_PTR orig);
50402 * Builds a new future for later resolution.
50404 MUST_USE_RES struct LDKUtxoFuture UtxoFuture_new(void);
50407 * Resolves this future against the given `graph` and with the given `result`.
50409 * This is identical to calling [`UtxoFuture::resolve`] with a dummy `gossip`, disabling
50410 * forwarding the validated gossip message onwards to peers.
50412 * Because this may cause the [`NetworkGraph`]'s [`processing_queue_high`] to flip, in order
50413 * to allow us to interact with peers again, you should call [`PeerManager::process_events`]
50416 * [`processing_queue_high`]: crate::ln::msgs::RoutingMessageHandler::processing_queue_high
50417 * [`PeerManager::process_events`]: crate::ln::peer_handler::PeerManager::process_events
50419 void UtxoFuture_resolve_without_forwarding(const struct LDKUtxoFuture *NONNULL_PTR this_arg, const struct LDKNetworkGraph *NONNULL_PTR graph, struct LDKCResult_TxOutUtxoLookupErrorZ result);
50422 * Resolves this future against the given `graph` and with the given `result`.
50424 * The given `gossip` is used to broadcast any validated messages onwards to all peers which
50425 * have available buffer space.
50427 * Because this may cause the [`NetworkGraph`]'s [`processing_queue_high`] to flip, in order
50428 * to allow us to interact with peers again, you should call [`PeerManager::process_events`]
50431 * [`processing_queue_high`]: crate::ln::msgs::RoutingMessageHandler::processing_queue_high
50432 * [`PeerManager::process_events`]: crate::ln::peer_handler::PeerManager::process_events
50434 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);
50437 * Frees any resources used by the NodeId, if is_owned is set and inner is non-NULL.
50439 void NodeId_free(struct LDKNodeId this_obj);
50442 * Creates a copy of the NodeId
50444 struct LDKNodeId NodeId_clone(const struct LDKNodeId *NONNULL_PTR orig);
50447 * Create a new NodeId from a public key
50449 MUST_USE_RES struct LDKNodeId NodeId_from_pubkey(struct LDKPublicKey pubkey);
50452 * Create a new NodeId from a slice of bytes
50454 MUST_USE_RES struct LDKCResult_NodeIdDecodeErrorZ NodeId_from_slice(struct LDKu8slice bytes);
50457 * Get the public key slice from this NodeId
50459 MUST_USE_RES struct LDKu8slice NodeId_as_slice(const struct LDKNodeId *NONNULL_PTR this_arg);
50462 * Get the public key as an array from this NodeId
50464 MUST_USE_RES const uint8_t (*NodeId_as_array(const struct LDKNodeId *NONNULL_PTR this_arg))[33];
50467 * Get the public key from this NodeId
50469 MUST_USE_RES struct LDKCResult_PublicKeySecp256k1ErrorZ NodeId_as_pubkey(const struct LDKNodeId *NONNULL_PTR this_arg);
50472 * Get the string representation of a NodeId object
50474 struct LDKStr NodeId_to_str(const struct LDKNodeId *NONNULL_PTR o);
50477 * Generates a non-cryptographic 64-bit hash of the NodeId.
50479 uint64_t NodeId_hash(const struct LDKNodeId *NONNULL_PTR o);
50482 * Serialize the NodeId object into a byte array which can be read by NodeId_read
50484 struct LDKCVec_u8Z NodeId_write(const struct LDKNodeId *NONNULL_PTR obj);
50487 * Read a NodeId from a byte array, created by NodeId_write
50489 struct LDKCResult_NodeIdDecodeErrorZ NodeId_read(struct LDKu8slice ser);
50492 * Frees any resources used by the NetworkGraph, if is_owned is set and inner is non-NULL.
50494 void NetworkGraph_free(struct LDKNetworkGraph this_obj);
50497 * Frees any resources used by the ReadOnlyNetworkGraph, if is_owned is set and inner is non-NULL.
50499 void ReadOnlyNetworkGraph_free(struct LDKReadOnlyNetworkGraph this_obj);
50502 * Frees any resources used by the NetworkUpdate
50504 void NetworkUpdate_free(struct LDKNetworkUpdate this_ptr);
50507 * Creates a copy of the NetworkUpdate
50509 struct LDKNetworkUpdate NetworkUpdate_clone(const struct LDKNetworkUpdate *NONNULL_PTR orig);
50512 * Utility method to constructs a new ChannelUpdateMessage-variant NetworkUpdate
50514 struct LDKNetworkUpdate NetworkUpdate_channel_update_message(struct LDKChannelUpdate msg);
50517 * Utility method to constructs a new ChannelFailure-variant NetworkUpdate
50519 struct LDKNetworkUpdate NetworkUpdate_channel_failure(uint64_t short_channel_id, bool is_permanent);
50522 * Utility method to constructs a new NodeFailure-variant NetworkUpdate
50524 struct LDKNetworkUpdate NetworkUpdate_node_failure(struct LDKPublicKey node_id, bool is_permanent);
50527 * Checks if two NetworkUpdates contain equal inner contents.
50528 * This ignores pointers and is_owned flags and looks at the values in fields.
50530 bool NetworkUpdate_eq(const struct LDKNetworkUpdate *NONNULL_PTR a, const struct LDKNetworkUpdate *NONNULL_PTR b);
50533 * Serialize the NetworkUpdate object into a byte array which can be read by NetworkUpdate_read
50535 struct LDKCVec_u8Z NetworkUpdate_write(const struct LDKNetworkUpdate *NONNULL_PTR obj);
50538 * Read a NetworkUpdate from a byte array, created by NetworkUpdate_write
50540 struct LDKCResult_COption_NetworkUpdateZDecodeErrorZ NetworkUpdate_read(struct LDKu8slice ser);
50543 * Frees any resources used by the P2PGossipSync, if is_owned is set and inner is non-NULL.
50545 void P2PGossipSync_free(struct LDKP2PGossipSync this_obj);
50548 * Creates a new tracker of the actual state of the network of channels and nodes,
50549 * assuming an existing [`NetworkGraph`].
50550 * UTXO lookup is used to make sure announced channels exist on-chain, channel data is
50551 * correct, and the announcement is signed with channel owners' keys.
50553 MUST_USE_RES struct LDKP2PGossipSync P2PGossipSync_new(const struct LDKNetworkGraph *NONNULL_PTR network_graph, struct LDKCOption_UtxoLookupZ utxo_lookup, struct LDKLogger logger);
50556 * Adds a provider used to check new announcements. Does not affect
50557 * existing announcements unless they are updated.
50558 * Add, update or remove the provider would replace the current one.
50560 void P2PGossipSync_add_utxo_lookup(const struct LDKP2PGossipSync *NONNULL_PTR this_arg, struct LDKCOption_UtxoLookupZ utxo_lookup);
50563 * Handles any network updates originating from [`Event`]s.
50564 * Note that this will skip applying any [`NetworkUpdate::ChannelUpdateMessage`] to avoid
50565 * leaking possibly identifying information of the sender to the public network.
50567 * [`Event`]: crate::events::Event
50569 void NetworkGraph_handle_network_update(const struct LDKNetworkGraph *NONNULL_PTR this_arg, const struct LDKNetworkUpdate *NONNULL_PTR network_update);
50572 * Gets the chain hash for this network graph.
50574 MUST_USE_RES struct LDKThirtyTwoBytes NetworkGraph_get_chain_hash(const struct LDKNetworkGraph *NONNULL_PTR this_arg);
50577 * Verifies the signature of a [`NodeAnnouncement`].
50579 * Returns an error if it is invalid.
50581 struct LDKCResult_NoneLightningErrorZ verify_node_announcement(const struct LDKNodeAnnouncement *NONNULL_PTR msg);
50584 * Verifies all signatures included in a [`ChannelAnnouncement`].
50586 * Returns an error if one of the signatures is invalid.
50588 struct LDKCResult_NoneLightningErrorZ verify_channel_announcement(const struct LDKChannelAnnouncement *NONNULL_PTR msg);
50591 * Constructs a new RoutingMessageHandler which calls the relevant methods on this_arg.
50592 * This copies the `inner` pointer in this_arg and thus the returned RoutingMessageHandler must be freed before this_arg is
50594 struct LDKRoutingMessageHandler P2PGossipSync_as_RoutingMessageHandler(const struct LDKP2PGossipSync *NONNULL_PTR this_arg);
50597 * Constructs a new MessageSendEventsProvider which calls the relevant methods on this_arg.
50598 * This copies the `inner` pointer in this_arg and thus the returned MessageSendEventsProvider must be freed before this_arg is
50600 struct LDKMessageSendEventsProvider P2PGossipSync_as_MessageSendEventsProvider(const struct LDKP2PGossipSync *NONNULL_PTR this_arg);
50603 * Frees any resources used by the ChannelUpdateInfo, if is_owned is set and inner is non-NULL.
50605 void ChannelUpdateInfo_free(struct LDKChannelUpdateInfo this_obj);
50608 * When the last update to the channel direction was issued.
50609 * Value is opaque, as set in the announcement.
50611 uint32_t ChannelUpdateInfo_get_last_update(const struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr);
50614 * When the last update to the channel direction was issued.
50615 * Value is opaque, as set in the announcement.
50617 void ChannelUpdateInfo_set_last_update(struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr, uint32_t val);
50620 * Whether the channel can be currently used for payments (in this one direction).
50622 bool ChannelUpdateInfo_get_enabled(const struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr);
50625 * Whether the channel can be currently used for payments (in this one direction).
50627 void ChannelUpdateInfo_set_enabled(struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr, bool val);
50630 * The difference in CLTV values that you must have when routing through this channel.
50632 uint16_t ChannelUpdateInfo_get_cltv_expiry_delta(const struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr);
50635 * The difference in CLTV values that you must have when routing through this channel.
50637 void ChannelUpdateInfo_set_cltv_expiry_delta(struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr, uint16_t val);
50640 * The minimum value, which must be relayed to the next hop via the channel
50642 uint64_t ChannelUpdateInfo_get_htlc_minimum_msat(const struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr);
50645 * The minimum value, which must be relayed to the next hop via the channel
50647 void ChannelUpdateInfo_set_htlc_minimum_msat(struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr, uint64_t val);
50650 * The maximum value which may be relayed to the next hop via the channel.
50652 uint64_t ChannelUpdateInfo_get_htlc_maximum_msat(const struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr);
50655 * The maximum value which may be relayed to the next hop via the channel.
50657 void ChannelUpdateInfo_set_htlc_maximum_msat(struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr, uint64_t val);
50660 * Fees charged when the channel is used for routing
50662 struct LDKRoutingFees ChannelUpdateInfo_get_fees(const struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr);
50665 * Fees charged when the channel is used for routing
50667 void ChannelUpdateInfo_set_fees(struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr, struct LDKRoutingFees val);
50670 * Most recent update for the channel received from the network
50671 * Mostly redundant with the data we store in fields explicitly.
50672 * Everything else is useful only for sending out for initial routing sync.
50673 * Not stored if contains excess data to prevent DoS.
50675 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
50677 struct LDKChannelUpdate ChannelUpdateInfo_get_last_update_message(const struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr);
50680 * Most recent update for the channel received from the network
50681 * Mostly redundant with the data we store in fields explicitly.
50682 * Everything else is useful only for sending out for initial routing sync.
50683 * Not stored if contains excess data to prevent DoS.
50685 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
50687 void ChannelUpdateInfo_set_last_update_message(struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr, struct LDKChannelUpdate val);
50690 * Constructs a new ChannelUpdateInfo given each field
50692 * Note that last_update_message_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
50694 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);
50697 * Creates a copy of the ChannelUpdateInfo
50699 struct LDKChannelUpdateInfo ChannelUpdateInfo_clone(const struct LDKChannelUpdateInfo *NONNULL_PTR orig);
50702 * Checks if two ChannelUpdateInfos contain equal inner contents.
50703 * This ignores pointers and is_owned flags and looks at the values in fields.
50704 * Two objects with NULL inner values will be considered "equal" here.
50706 bool ChannelUpdateInfo_eq(const struct LDKChannelUpdateInfo *NONNULL_PTR a, const struct LDKChannelUpdateInfo *NONNULL_PTR b);
50709 * Get the string representation of a ChannelUpdateInfo object
50711 struct LDKStr ChannelUpdateInfo_to_str(const struct LDKChannelUpdateInfo *NONNULL_PTR o);
50714 * Serialize the ChannelUpdateInfo object into a byte array which can be read by ChannelUpdateInfo_read
50716 struct LDKCVec_u8Z ChannelUpdateInfo_write(const struct LDKChannelUpdateInfo *NONNULL_PTR obj);
50719 * Read a ChannelUpdateInfo from a byte array, created by ChannelUpdateInfo_write
50721 struct LDKCResult_ChannelUpdateInfoDecodeErrorZ ChannelUpdateInfo_read(struct LDKu8slice ser);
50724 * Frees any resources used by the ChannelInfo, if is_owned is set and inner is non-NULL.
50726 void ChannelInfo_free(struct LDKChannelInfo this_obj);
50729 * Protocol features of a channel communicated during its announcement
50731 struct LDKChannelFeatures ChannelInfo_get_features(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
50734 * Protocol features of a channel communicated during its announcement
50736 void ChannelInfo_set_features(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKChannelFeatures val);
50739 * Source node of the first direction of a channel
50741 struct LDKNodeId ChannelInfo_get_node_one(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
50744 * Source node of the first direction of a channel
50746 void ChannelInfo_set_node_one(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKNodeId val);
50749 * Details about the first direction of a channel
50751 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
50753 struct LDKChannelUpdateInfo ChannelInfo_get_one_to_two(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
50756 * Details about the first direction of a channel
50758 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
50760 void ChannelInfo_set_one_to_two(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKChannelUpdateInfo val);
50763 * Source node of the second direction of a channel
50765 struct LDKNodeId ChannelInfo_get_node_two(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
50768 * Source node of the second direction of a channel
50770 void ChannelInfo_set_node_two(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKNodeId val);
50773 * Details about the second direction of a channel
50775 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
50777 struct LDKChannelUpdateInfo ChannelInfo_get_two_to_one(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
50780 * Details about the second direction of a channel
50782 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
50784 void ChannelInfo_set_two_to_one(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKChannelUpdateInfo val);
50787 * The channel capacity as seen on-chain, if chain lookup is available.
50789 struct LDKCOption_u64Z ChannelInfo_get_capacity_sats(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
50792 * The channel capacity as seen on-chain, if chain lookup is available.
50794 void ChannelInfo_set_capacity_sats(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
50797 * An initial announcement of the channel
50798 * Mostly redundant with the data we store in fields explicitly.
50799 * Everything else is useful only for sending out for initial routing sync.
50800 * Not stored if contains excess data to prevent DoS.
50802 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
50804 struct LDKChannelAnnouncement ChannelInfo_get_announcement_message(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
50807 * An initial announcement of the channel
50808 * Mostly redundant with the data we store in fields explicitly.
50809 * Everything else is useful only for sending out for initial routing sync.
50810 * Not stored if contains excess data to prevent DoS.
50812 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
50814 void ChannelInfo_set_announcement_message(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKChannelAnnouncement val);
50817 * Creates a copy of the ChannelInfo
50819 struct LDKChannelInfo ChannelInfo_clone(const struct LDKChannelInfo *NONNULL_PTR orig);
50822 * Checks if two ChannelInfos contain equal inner contents.
50823 * This ignores pointers and is_owned flags and looks at the values in fields.
50824 * Two objects with NULL inner values will be considered "equal" here.
50826 bool ChannelInfo_eq(const struct LDKChannelInfo *NONNULL_PTR a, const struct LDKChannelInfo *NONNULL_PTR b);
50829 * Returns a [`ChannelUpdateInfo`] based on the direction implied by the channel_flag.
50831 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
50833 MUST_USE_RES struct LDKChannelUpdateInfo ChannelInfo_get_directional_info(const struct LDKChannelInfo *NONNULL_PTR this_arg, uint8_t channel_flags);
50836 * Get the string representation of a ChannelInfo object
50838 struct LDKStr ChannelInfo_to_str(const struct LDKChannelInfo *NONNULL_PTR o);
50841 * Serialize the ChannelInfo object into a byte array which can be read by ChannelInfo_read
50843 struct LDKCVec_u8Z ChannelInfo_write(const struct LDKChannelInfo *NONNULL_PTR obj);
50846 * Read a ChannelInfo from a byte array, created by ChannelInfo_write
50848 struct LDKCResult_ChannelInfoDecodeErrorZ ChannelInfo_read(struct LDKu8slice ser);
50851 * Frees any resources used by the DirectedChannelInfo, if is_owned is set and inner is non-NULL.
50853 void DirectedChannelInfo_free(struct LDKDirectedChannelInfo this_obj);
50856 * Creates a copy of the DirectedChannelInfo
50858 struct LDKDirectedChannelInfo DirectedChannelInfo_clone(const struct LDKDirectedChannelInfo *NONNULL_PTR orig);
50861 * Returns information for the channel.
50863 MUST_USE_RES struct LDKChannelInfo DirectedChannelInfo_channel(const struct LDKDirectedChannelInfo *NONNULL_PTR this_arg);
50866 * Returns the [`EffectiveCapacity`] of the channel in the direction.
50868 * This is either the total capacity from the funding transaction, if known, or the
50869 * `htlc_maximum_msat` for the direction as advertised by the gossip network, if known,
50872 MUST_USE_RES struct LDKEffectiveCapacity DirectedChannelInfo_effective_capacity(const struct LDKDirectedChannelInfo *NONNULL_PTR this_arg);
50875 * Returns the `node_id` of the source hop.
50877 * Refers to the `node_id` forwarding the payment to the next hop.
50879 MUST_USE_RES struct LDKNodeId DirectedChannelInfo_source(const struct LDKDirectedChannelInfo *NONNULL_PTR this_arg);
50882 * Returns the `node_id` of the target hop.
50884 * Refers to the `node_id` receiving the payment from the previous hop.
50886 MUST_USE_RES struct LDKNodeId DirectedChannelInfo_target(const struct LDKDirectedChannelInfo *NONNULL_PTR this_arg);
50889 * Frees any resources used by the EffectiveCapacity
50891 void EffectiveCapacity_free(struct LDKEffectiveCapacity this_ptr);
50894 * Creates a copy of the EffectiveCapacity
50896 struct LDKEffectiveCapacity EffectiveCapacity_clone(const struct LDKEffectiveCapacity *NONNULL_PTR orig);
50899 * Utility method to constructs a new ExactLiquidity-variant EffectiveCapacity
50901 struct LDKEffectiveCapacity EffectiveCapacity_exact_liquidity(uint64_t liquidity_msat);
50904 * Utility method to constructs a new AdvertisedMaxHTLC-variant EffectiveCapacity
50906 struct LDKEffectiveCapacity EffectiveCapacity_advertised_max_htlc(uint64_t amount_msat);
50909 * Utility method to constructs a new Total-variant EffectiveCapacity
50911 struct LDKEffectiveCapacity EffectiveCapacity_total(uint64_t capacity_msat, uint64_t htlc_maximum_msat);
50914 * Utility method to constructs a new Infinite-variant EffectiveCapacity
50916 struct LDKEffectiveCapacity EffectiveCapacity_infinite(void);
50919 * Utility method to constructs a new HintMaxHTLC-variant EffectiveCapacity
50921 struct LDKEffectiveCapacity EffectiveCapacity_hint_max_htlc(uint64_t amount_msat);
50924 * Utility method to constructs a new Unknown-variant EffectiveCapacity
50926 struct LDKEffectiveCapacity EffectiveCapacity_unknown(void);
50929 * Returns the effective capacity denominated in millisatoshi.
50931 MUST_USE_RES uint64_t EffectiveCapacity_as_msat(const struct LDKEffectiveCapacity *NONNULL_PTR this_arg);
50934 * Frees any resources used by the RoutingFees, if is_owned is set and inner is non-NULL.
50936 void RoutingFees_free(struct LDKRoutingFees this_obj);
50939 * Flat routing fee in millisatoshis.
50941 uint32_t RoutingFees_get_base_msat(const struct LDKRoutingFees *NONNULL_PTR this_ptr);
50944 * Flat routing fee in millisatoshis.
50946 void RoutingFees_set_base_msat(struct LDKRoutingFees *NONNULL_PTR this_ptr, uint32_t val);
50949 * Liquidity-based routing fee in millionths of a routed amount.
50950 * In other words, 10000 is 1%.
50952 uint32_t RoutingFees_get_proportional_millionths(const struct LDKRoutingFees *NONNULL_PTR this_ptr);
50955 * Liquidity-based routing fee in millionths of a routed amount.
50956 * In other words, 10000 is 1%.
50958 void RoutingFees_set_proportional_millionths(struct LDKRoutingFees *NONNULL_PTR this_ptr, uint32_t val);
50961 * Constructs a new RoutingFees given each field
50963 MUST_USE_RES struct LDKRoutingFees RoutingFees_new(uint32_t base_msat_arg, uint32_t proportional_millionths_arg);
50966 * Checks if two RoutingFeess contain equal inner contents.
50967 * This ignores pointers and is_owned flags and looks at the values in fields.
50968 * Two objects with NULL inner values will be considered "equal" here.
50970 bool RoutingFees_eq(const struct LDKRoutingFees *NONNULL_PTR a, const struct LDKRoutingFees *NONNULL_PTR b);
50973 * Creates a copy of the RoutingFees
50975 struct LDKRoutingFees RoutingFees_clone(const struct LDKRoutingFees *NONNULL_PTR orig);
50978 * Generates a non-cryptographic 64-bit hash of the RoutingFees.
50980 uint64_t RoutingFees_hash(const struct LDKRoutingFees *NONNULL_PTR o);
50983 * Serialize the RoutingFees object into a byte array which can be read by RoutingFees_read
50985 struct LDKCVec_u8Z RoutingFees_write(const struct LDKRoutingFees *NONNULL_PTR obj);
50988 * Read a RoutingFees from a byte array, created by RoutingFees_write
50990 struct LDKCResult_RoutingFeesDecodeErrorZ RoutingFees_read(struct LDKu8slice ser);
50993 * Frees any resources used by the NodeAnnouncementInfo, if is_owned is set and inner is non-NULL.
50995 void NodeAnnouncementInfo_free(struct LDKNodeAnnouncementInfo this_obj);
50998 * Protocol features the node announced support for
51000 struct LDKNodeFeatures NodeAnnouncementInfo_get_features(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr);
51003 * Protocol features the node announced support for
51005 void NodeAnnouncementInfo_set_features(struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr, struct LDKNodeFeatures val);
51008 * When the last known update to the node state was issued.
51009 * Value is opaque, as set in the announcement.
51011 uint32_t NodeAnnouncementInfo_get_last_update(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr);
51014 * When the last known update to the node state was issued.
51015 * Value is opaque, as set in the announcement.
51017 void NodeAnnouncementInfo_set_last_update(struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr, uint32_t val);
51020 * Color assigned to the node
51022 const uint8_t (*NodeAnnouncementInfo_get_rgb(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr))[3];
51025 * Color assigned to the node
51027 void NodeAnnouncementInfo_set_rgb(struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr, struct LDKThreeBytes val);
51030 * Moniker assigned to the node.
51031 * May be invalid or malicious (eg control chars),
51032 * should not be exposed to the user.
51034 struct LDKNodeAlias NodeAnnouncementInfo_get_alias(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr);
51037 * Moniker assigned to the node.
51038 * May be invalid or malicious (eg control chars),
51039 * should not be exposed to the user.
51041 void NodeAnnouncementInfo_set_alias(struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr, struct LDKNodeAlias val);
51044 * An initial announcement of the node
51045 * Mostly redundant with the data we store in fields explicitly.
51046 * Everything else is useful only for sending out for initial routing sync.
51047 * Not stored if contains excess data to prevent DoS.
51049 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
51051 struct LDKNodeAnnouncement NodeAnnouncementInfo_get_announcement_message(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr);
51054 * An initial announcement of the node
51055 * Mostly redundant with the data we store in fields explicitly.
51056 * Everything else is useful only for sending out for initial routing sync.
51057 * Not stored if contains excess data to prevent DoS.
51059 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
51061 void NodeAnnouncementInfo_set_announcement_message(struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr, struct LDKNodeAnnouncement val);
51064 * Constructs a new NodeAnnouncementInfo given each field
51066 * Note that announcement_message_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
51068 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);
51071 * Creates a copy of the NodeAnnouncementInfo
51073 struct LDKNodeAnnouncementInfo NodeAnnouncementInfo_clone(const struct LDKNodeAnnouncementInfo *NONNULL_PTR orig);
51076 * Checks if two NodeAnnouncementInfos contain equal inner contents.
51077 * This ignores pointers and is_owned flags and looks at the values in fields.
51078 * Two objects with NULL inner values will be considered "equal" here.
51080 bool NodeAnnouncementInfo_eq(const struct LDKNodeAnnouncementInfo *NONNULL_PTR a, const struct LDKNodeAnnouncementInfo *NONNULL_PTR b);
51083 * Internet-level addresses via which one can connect to the node
51085 MUST_USE_RES struct LDKCVec_SocketAddressZ NodeAnnouncementInfo_addresses(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_arg);
51088 * Serialize the NodeAnnouncementInfo object into a byte array which can be read by NodeAnnouncementInfo_read
51090 struct LDKCVec_u8Z NodeAnnouncementInfo_write(const struct LDKNodeAnnouncementInfo *NONNULL_PTR obj);
51093 * Read a NodeAnnouncementInfo from a byte array, created by NodeAnnouncementInfo_write
51095 struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ NodeAnnouncementInfo_read(struct LDKu8slice ser);
51098 * Frees any resources used by the NodeAlias, if is_owned is set and inner is non-NULL.
51100 void NodeAlias_free(struct LDKNodeAlias this_obj);
51102 const uint8_t (*NodeAlias_get_a(const struct LDKNodeAlias *NONNULL_PTR this_ptr))[32];
51104 void NodeAlias_set_a(struct LDKNodeAlias *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
51107 * Constructs a new NodeAlias given each field
51109 MUST_USE_RES struct LDKNodeAlias NodeAlias_new(struct LDKThirtyTwoBytes a_arg);
51112 * Creates a copy of the NodeAlias
51114 struct LDKNodeAlias NodeAlias_clone(const struct LDKNodeAlias *NONNULL_PTR orig);
51117 * Generates a non-cryptographic 64-bit hash of the NodeAlias.
51119 uint64_t NodeAlias_hash(const struct LDKNodeAlias *NONNULL_PTR o);
51122 * Checks if two NodeAliass contain equal inner contents.
51123 * This ignores pointers and is_owned flags and looks at the values in fields.
51124 * Two objects with NULL inner values will be considered "equal" here.
51126 bool NodeAlias_eq(const struct LDKNodeAlias *NONNULL_PTR a, const struct LDKNodeAlias *NONNULL_PTR b);
51129 * Get the string representation of a NodeAlias object
51131 struct LDKStr NodeAlias_to_str(const struct LDKNodeAlias *NONNULL_PTR o);
51134 * Serialize the NodeAlias object into a byte array which can be read by NodeAlias_read
51136 struct LDKCVec_u8Z NodeAlias_write(const struct LDKNodeAlias *NONNULL_PTR obj);
51139 * Read a NodeAlias from a byte array, created by NodeAlias_write
51141 struct LDKCResult_NodeAliasDecodeErrorZ NodeAlias_read(struct LDKu8slice ser);
51144 * Frees any resources used by the NodeInfo, if is_owned is set and inner is non-NULL.
51146 void NodeInfo_free(struct LDKNodeInfo this_obj);
51149 * All valid channels a node has announced
51151 * Returns a copy of the field.
51153 struct LDKCVec_u64Z NodeInfo_get_channels(const struct LDKNodeInfo *NONNULL_PTR this_ptr);
51156 * All valid channels a node has announced
51158 void NodeInfo_set_channels(struct LDKNodeInfo *NONNULL_PTR this_ptr, struct LDKCVec_u64Z val);
51161 * More information about a node from node_announcement.
51162 * Optional because we store a Node entry after learning about it from
51163 * a channel announcement, but before receiving a node announcement.
51165 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
51167 struct LDKNodeAnnouncementInfo NodeInfo_get_announcement_info(const struct LDKNodeInfo *NONNULL_PTR this_ptr);
51170 * More information about a node from node_announcement.
51171 * Optional because we store a Node entry after learning about it from
51172 * a channel announcement, but before receiving a node announcement.
51174 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
51176 void NodeInfo_set_announcement_info(struct LDKNodeInfo *NONNULL_PTR this_ptr, struct LDKNodeAnnouncementInfo val);
51179 * Constructs a new NodeInfo given each field
51181 * Note that announcement_info_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
51183 MUST_USE_RES struct LDKNodeInfo NodeInfo_new(struct LDKCVec_u64Z channels_arg, struct LDKNodeAnnouncementInfo announcement_info_arg);
51186 * Creates a copy of the NodeInfo
51188 struct LDKNodeInfo NodeInfo_clone(const struct LDKNodeInfo *NONNULL_PTR orig);
51191 * Checks if two NodeInfos contain equal inner contents.
51192 * This ignores pointers and is_owned flags and looks at the values in fields.
51193 * Two objects with NULL inner values will be considered "equal" here.
51195 bool NodeInfo_eq(const struct LDKNodeInfo *NONNULL_PTR a, const struct LDKNodeInfo *NONNULL_PTR b);
51198 * Returns whether the node has only announced Tor addresses.
51200 MUST_USE_RES bool NodeInfo_is_tor_only(const struct LDKNodeInfo *NONNULL_PTR this_arg);
51203 * Get the string representation of a NodeInfo object
51205 struct LDKStr NodeInfo_to_str(const struct LDKNodeInfo *NONNULL_PTR o);
51208 * Serialize the NodeInfo object into a byte array which can be read by NodeInfo_read
51210 struct LDKCVec_u8Z NodeInfo_write(const struct LDKNodeInfo *NONNULL_PTR obj);
51213 * Read a NodeInfo from a byte array, created by NodeInfo_write
51215 struct LDKCResult_NodeInfoDecodeErrorZ NodeInfo_read(struct LDKu8slice ser);
51218 * Serialize the NetworkGraph object into a byte array which can be read by NetworkGraph_read
51220 struct LDKCVec_u8Z NetworkGraph_write(const struct LDKNetworkGraph *NONNULL_PTR obj);
51223 * Read a NetworkGraph from a byte array, created by NetworkGraph_write
51225 struct LDKCResult_NetworkGraphDecodeErrorZ NetworkGraph_read(struct LDKu8slice ser, struct LDKLogger arg);
51228 * Get the string representation of a NetworkGraph object
51230 struct LDKStr NetworkGraph_to_str(const struct LDKNetworkGraph *NONNULL_PTR o);
51233 * Creates a new, empty, network graph.
51235 MUST_USE_RES struct LDKNetworkGraph NetworkGraph_new(enum LDKNetwork network, struct LDKLogger logger);
51238 * Returns a read-only view of the network graph.
51240 MUST_USE_RES struct LDKReadOnlyNetworkGraph NetworkGraph_read_only(const struct LDKNetworkGraph *NONNULL_PTR this_arg);
51243 * The unix timestamp provided by the most recent rapid gossip sync.
51244 * It will be set by the rapid sync process after every sync completion.
51246 MUST_USE_RES struct LDKCOption_u32Z NetworkGraph_get_last_rapid_gossip_sync_timestamp(const struct LDKNetworkGraph *NONNULL_PTR this_arg);
51249 * Update the unix timestamp provided by the most recent rapid gossip sync.
51250 * This should be done automatically by the rapid sync process after every sync completion.
51252 void NetworkGraph_set_last_rapid_gossip_sync_timestamp(const struct LDKNetworkGraph *NONNULL_PTR this_arg, uint32_t last_rapid_gossip_sync_timestamp);
51255 * For an already known node (from channel announcements), update its stored properties from a
51256 * given node announcement.
51258 * You probably don't want to call this directly, instead relying on a P2PGossipSync's
51259 * RoutingMessageHandler implementation to call it indirectly. This may be useful to accept
51260 * routing messages from a source using a protocol other than the lightning P2P protocol.
51262 MUST_USE_RES struct LDKCResult_NoneLightningErrorZ NetworkGraph_update_node_from_announcement(const struct LDKNetworkGraph *NONNULL_PTR this_arg, const struct LDKNodeAnnouncement *NONNULL_PTR msg);
51265 * For an already known node (from channel announcements), update its stored properties from a
51266 * given node announcement without verifying the associated signatures. Because we aren't
51267 * given the associated signatures here we cannot relay the node announcement to any of our
51270 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);
51273 * Store or update channel info from a channel announcement.
51275 * You probably don't want to call this directly, instead relying on a [`P2PGossipSync`]'s
51276 * [`RoutingMessageHandler`] implementation to call it indirectly. This may be useful to accept
51277 * routing messages from a source using a protocol other than the lightning P2P protocol.
51279 * If a [`UtxoLookup`] object is provided via `utxo_lookup`, it will be called to verify
51280 * the corresponding UTXO exists on chain and is correctly-formatted.
51282 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);
51285 * Store or update channel info from a channel announcement.
51287 * You probably don't want to call this directly, instead relying on a [`P2PGossipSync`]'s
51288 * [`RoutingMessageHandler`] implementation to call it indirectly. This may be useful to accept
51289 * routing messages from a source using a protocol other than the lightning P2P protocol.
51291 * This will skip verification of if the channel is actually on-chain.
51293 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);
51296 * Store or update channel info from a channel announcement without verifying the associated
51297 * signatures. Because we aren't given the associated signatures here we cannot relay the
51298 * channel announcement to any of our peers.
51300 * If a [`UtxoLookup`] object is provided via `utxo_lookup`, it will be called to verify
51301 * the corresponding UTXO exists on chain and is correctly-formatted.
51303 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);
51306 * Update channel from partial announcement data received via rapid gossip sync
51308 * `timestamp: u64`: Timestamp emulating the backdated original announcement receipt (by the
51309 * rapid gossip sync server)
51311 * All other parameters as used in [`msgs::UnsignedChannelAnnouncement`] fields.
51313 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);
51316 * Marks a channel in the graph as failed permanently.
51318 * The channel and any node for which this was their last channel are removed from the graph.
51320 void NetworkGraph_channel_failed_permanent(const struct LDKNetworkGraph *NONNULL_PTR this_arg, uint64_t short_channel_id);
51323 * Marks a node in the graph as permanently failed, effectively removing it and its channels
51324 * from local storage.
51326 void NetworkGraph_node_failed_permanent(const struct LDKNetworkGraph *NONNULL_PTR this_arg, struct LDKPublicKey node_id);
51329 * Removes information about channels that we haven't heard any updates about in some time.
51330 * This can be used regularly to prune the network graph of channels that likely no longer
51333 * While there is no formal requirement that nodes regularly re-broadcast their channel
51334 * updates every two weeks, the non-normative section of BOLT 7 currently suggests that
51335 * pruning occur for updates which are at least two weeks old, which we implement here.
51337 * Note that for users of the `lightning-background-processor` crate this method may be
51338 * automatically called regularly for you.
51340 * This method will also cause us to stop tracking removed nodes and channels if they have been
51341 * in the map for a while so that these can be resynced from gossip in the future.
51343 * This method is only available with the `std` feature. See
51344 * [`NetworkGraph::remove_stale_channels_and_tracking_with_time`] for `no-std` use.
51346 void NetworkGraph_remove_stale_channels_and_tracking(const struct LDKNetworkGraph *NONNULL_PTR this_arg);
51349 * Removes information about channels that we haven't heard any updates about in some time.
51350 * This can be used regularly to prune the network graph of channels that likely no longer
51353 * While there is no formal requirement that nodes regularly re-broadcast their channel
51354 * updates every two weeks, the non-normative section of BOLT 7 currently suggests that
51355 * pruning occur for updates which are at least two weeks old, which we implement here.
51357 * This method will also cause us to stop tracking removed nodes and channels if they have been
51358 * in the map for a while so that these can be resynced from gossip in the future.
51360 * This function takes the current unix time as an argument. For users with the `std` feature
51361 * enabled, [`NetworkGraph::remove_stale_channels_and_tracking`] may be preferable.
51363 void NetworkGraph_remove_stale_channels_and_tracking_with_time(const struct LDKNetworkGraph *NONNULL_PTR this_arg, uint64_t current_time_unix);
51366 * For an already known (from announcement) channel, update info about one of the directions
51369 * You probably don't want to call this directly, instead relying on a [`P2PGossipSync`]'s
51370 * [`RoutingMessageHandler`] implementation to call it indirectly. This may be useful to accept
51371 * routing messages from a source using a protocol other than the lightning P2P protocol.
51373 * If built with `no-std`, any updates with a timestamp more than two weeks in the past or
51374 * materially in the future will be rejected.
51376 MUST_USE_RES struct LDKCResult_NoneLightningErrorZ NetworkGraph_update_channel(const struct LDKNetworkGraph *NONNULL_PTR this_arg, const struct LDKChannelUpdate *NONNULL_PTR msg);
51379 * For an already known (from announcement) channel, update info about one of the directions
51380 * of the channel without verifying the associated signatures. Because we aren't given the
51381 * associated signatures here we cannot relay the channel update to any of our peers.
51383 * If built with `no-std`, any updates with a timestamp more than two weeks in the past or
51384 * materially in the future will be rejected.
51386 MUST_USE_RES struct LDKCResult_NoneLightningErrorZ NetworkGraph_update_channel_unsigned(const struct LDKNetworkGraph *NONNULL_PTR this_arg, const struct LDKUnsignedChannelUpdate *NONNULL_PTR msg);
51389 * For an already known (from announcement) channel, verify the given [`ChannelUpdate`].
51391 * This checks whether the update currently is applicable by [`Self::update_channel`].
51393 * If built with `no-std`, any updates with a timestamp more than two weeks in the past or
51394 * materially in the future will be rejected.
51396 MUST_USE_RES struct LDKCResult_NoneLightningErrorZ NetworkGraph_verify_channel_update(const struct LDKNetworkGraph *NONNULL_PTR this_arg, const struct LDKChannelUpdate *NONNULL_PTR msg);
51399 * Returns information on a channel with the given id.
51401 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
51403 MUST_USE_RES struct LDKChannelInfo ReadOnlyNetworkGraph_channel(const struct LDKReadOnlyNetworkGraph *NONNULL_PTR this_arg, uint64_t short_channel_id);
51406 * Returns the list of channels in the graph
51408 MUST_USE_RES struct LDKCVec_u64Z ReadOnlyNetworkGraph_list_channels(const struct LDKReadOnlyNetworkGraph *NONNULL_PTR this_arg);
51411 * Returns information on a node with the given id.
51413 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
51415 MUST_USE_RES struct LDKNodeInfo ReadOnlyNetworkGraph_node(const struct LDKReadOnlyNetworkGraph *NONNULL_PTR this_arg, const struct LDKNodeId *NONNULL_PTR node_id);
51418 * Returns the list of nodes in the graph
51420 MUST_USE_RES struct LDKCVec_NodeIdZ ReadOnlyNetworkGraph_list_nodes(const struct LDKReadOnlyNetworkGraph *NONNULL_PTR this_arg);
51423 * Get network addresses by node id.
51424 * Returns None if the requested node is completely unknown,
51425 * or if node announcement for the node was never received.
51427 MUST_USE_RES struct LDKCOption_CVec_SocketAddressZZ ReadOnlyNetworkGraph_get_addresses(const struct LDKReadOnlyNetworkGraph *NONNULL_PTR this_arg, struct LDKPublicKey pubkey);
51430 * Frees any resources used by the DefaultRouter, if is_owned is set and inner is non-NULL.
51432 void DefaultRouter_free(struct LDKDefaultRouter this_obj);
51435 * Creates a new router.
51437 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);
51440 * Constructs a new Router which calls the relevant methods on this_arg.
51441 * This copies the `inner` pointer in this_arg and thus the returned Router must be freed before this_arg is
51443 struct LDKRouter DefaultRouter_as_Router(const struct LDKDefaultRouter *NONNULL_PTR this_arg);
51446 * Constructs a new MessageRouter which calls the relevant methods on this_arg.
51447 * This copies the `inner` pointer in this_arg and thus the returned MessageRouter must be freed before this_arg is
51449 struct LDKMessageRouter DefaultRouter_as_MessageRouter(const struct LDKDefaultRouter *NONNULL_PTR this_arg);
51452 * Calls the free function if one is set
51454 void Router_free(struct LDKRouter this_ptr);
51457 * Frees any resources used by the ScorerAccountingForInFlightHtlcs, if is_owned is set and inner is non-NULL.
51459 void ScorerAccountingForInFlightHtlcs_free(struct LDKScorerAccountingForInFlightHtlcs this_obj);
51462 * Initialize a new `ScorerAccountingForInFlightHtlcs`.
51464 MUST_USE_RES struct LDKScorerAccountingForInFlightHtlcs ScorerAccountingForInFlightHtlcs_new(struct LDKScoreLookUp scorer, const struct LDKInFlightHtlcs *NONNULL_PTR inflight_htlcs);
51467 * Constructs a new ScoreLookUp which calls the relevant methods on this_arg.
51468 * This copies the `inner` pointer in this_arg and thus the returned ScoreLookUp must be freed before this_arg is
51470 struct LDKScoreLookUp ScorerAccountingForInFlightHtlcs_as_ScoreLookUp(const struct LDKScorerAccountingForInFlightHtlcs *NONNULL_PTR this_arg);
51473 * Frees any resources used by the InFlightHtlcs, if is_owned is set and inner is non-NULL.
51475 void InFlightHtlcs_free(struct LDKInFlightHtlcs this_obj);
51478 * Creates a copy of the InFlightHtlcs
51480 struct LDKInFlightHtlcs InFlightHtlcs_clone(const struct LDKInFlightHtlcs *NONNULL_PTR orig);
51483 * Constructs an empty `InFlightHtlcs`.
51485 MUST_USE_RES struct LDKInFlightHtlcs InFlightHtlcs_new(void);
51488 * Takes in a path with payer's node id and adds the path's details to `InFlightHtlcs`.
51490 void InFlightHtlcs_process_path(struct LDKInFlightHtlcs *NONNULL_PTR this_arg, const struct LDKPath *NONNULL_PTR path, struct LDKPublicKey payer_node_id);
51493 * Adds a known HTLC given the public key of the HTLC source, target, and short channel
51496 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);
51499 * Returns liquidity in msat given the public key of the HTLC source, target, and short channel
51502 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);
51505 * Serialize the InFlightHtlcs object into a byte array which can be read by InFlightHtlcs_read
51507 struct LDKCVec_u8Z InFlightHtlcs_write(const struct LDKInFlightHtlcs *NONNULL_PTR obj);
51510 * Read a InFlightHtlcs from a byte array, created by InFlightHtlcs_write
51512 struct LDKCResult_InFlightHtlcsDecodeErrorZ InFlightHtlcs_read(struct LDKu8slice ser);
51515 * Frees any resources used by the RouteHop, if is_owned is set and inner is non-NULL.
51517 void RouteHop_free(struct LDKRouteHop this_obj);
51520 * The node_id of the node at this hop.
51522 struct LDKPublicKey RouteHop_get_pubkey(const struct LDKRouteHop *NONNULL_PTR this_ptr);
51525 * The node_id of the node at this hop.
51527 void RouteHop_set_pubkey(struct LDKRouteHop *NONNULL_PTR this_ptr, struct LDKPublicKey val);
51530 * The node_announcement features of the node at this hop. For the last hop, these may be
51531 * amended to match the features present in the invoice this node generated.
51533 struct LDKNodeFeatures RouteHop_get_node_features(const struct LDKRouteHop *NONNULL_PTR this_ptr);
51536 * The node_announcement features of the node at this hop. For the last hop, these may be
51537 * amended to match the features present in the invoice this node generated.
51539 void RouteHop_set_node_features(struct LDKRouteHop *NONNULL_PTR this_ptr, struct LDKNodeFeatures val);
51542 * The channel that should be used from the previous hop to reach this node.
51544 uint64_t RouteHop_get_short_channel_id(const struct LDKRouteHop *NONNULL_PTR this_ptr);
51547 * The channel that should be used from the previous hop to reach this node.
51549 void RouteHop_set_short_channel_id(struct LDKRouteHop *NONNULL_PTR this_ptr, uint64_t val);
51552 * The channel_announcement features of the channel that should be used from the previous hop
51553 * to reach this node.
51555 struct LDKChannelFeatures RouteHop_get_channel_features(const struct LDKRouteHop *NONNULL_PTR this_ptr);
51558 * The channel_announcement features of the channel that should be used from the previous hop
51559 * to reach this node.
51561 void RouteHop_set_channel_features(struct LDKRouteHop *NONNULL_PTR this_ptr, struct LDKChannelFeatures val);
51564 * The fee taken on this hop (for paying for the use of the *next* channel in the path).
51565 * If this is the last hop in [`Path::hops`]:
51566 * * if we're sending to a [`BlindedPath`], this is the fee paid for use of the entire blinded path
51567 * * otherwise, this is the full value of this [`Path`]'s part of the payment
51569 * [`BlindedPath`]: crate::blinded_path::BlindedPath
51571 uint64_t RouteHop_get_fee_msat(const struct LDKRouteHop *NONNULL_PTR this_ptr);
51574 * The fee taken on this hop (for paying for the use of the *next* channel in the path).
51575 * If this is the last hop in [`Path::hops`]:
51576 * * if we're sending to a [`BlindedPath`], this is the fee paid for use of the entire blinded path
51577 * * otherwise, this is the full value of this [`Path`]'s part of the payment
51579 * [`BlindedPath`]: crate::blinded_path::BlindedPath
51581 void RouteHop_set_fee_msat(struct LDKRouteHop *NONNULL_PTR this_ptr, uint64_t val);
51584 * The CLTV delta added for this hop.
51585 * If this is the last hop in [`Path::hops`]:
51586 * * if we're sending to a [`BlindedPath`], this is the CLTV delta for the entire blinded path
51587 * * otherwise, this is the CLTV delta expected at the destination
51589 * [`BlindedPath`]: crate::blinded_path::BlindedPath
51591 uint32_t RouteHop_get_cltv_expiry_delta(const struct LDKRouteHop *NONNULL_PTR this_ptr);
51594 * The CLTV delta added for this hop.
51595 * If this is the last hop in [`Path::hops`]:
51596 * * if we're sending to a [`BlindedPath`], this is the CLTV delta for the entire blinded path
51597 * * otherwise, this is the CLTV delta expected at the destination
51599 * [`BlindedPath`]: crate::blinded_path::BlindedPath
51601 void RouteHop_set_cltv_expiry_delta(struct LDKRouteHop *NONNULL_PTR this_ptr, uint32_t val);
51604 * Indicates whether this hop is possibly announced in the public network graph.
51606 * Will be `true` if there is a possibility that the channel is publicly known, i.e., if we
51607 * either know for sure it's announced in the public graph, or if any public channels exist
51608 * for which the given `short_channel_id` could be an alias for. Will be `false` if we believe
51609 * the channel to be unannounced.
51611 * Will be `true` for objects serialized with LDK version 0.0.116 and before.
51613 bool RouteHop_get_maybe_announced_channel(const struct LDKRouteHop *NONNULL_PTR this_ptr);
51616 * Indicates whether this hop is possibly announced in the public network graph.
51618 * Will be `true` if there is a possibility that the channel is publicly known, i.e., if we
51619 * either know for sure it's announced in the public graph, or if any public channels exist
51620 * for which the given `short_channel_id` could be an alias for. Will be `false` if we believe
51621 * the channel to be unannounced.
51623 * Will be `true` for objects serialized with LDK version 0.0.116 and before.
51625 void RouteHop_set_maybe_announced_channel(struct LDKRouteHop *NONNULL_PTR this_ptr, bool val);
51628 * Constructs a new RouteHop given each field
51630 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);
51633 * Creates a copy of the RouteHop
51635 struct LDKRouteHop RouteHop_clone(const struct LDKRouteHop *NONNULL_PTR orig);
51638 * Generates a non-cryptographic 64-bit hash of the RouteHop.
51640 uint64_t RouteHop_hash(const struct LDKRouteHop *NONNULL_PTR o);
51643 * Checks if two RouteHops contain equal inner contents.
51644 * This ignores pointers and is_owned flags and looks at the values in fields.
51645 * Two objects with NULL inner values will be considered "equal" here.
51647 bool RouteHop_eq(const struct LDKRouteHop *NONNULL_PTR a, const struct LDKRouteHop *NONNULL_PTR b);
51650 * Serialize the RouteHop object into a byte array which can be read by RouteHop_read
51652 struct LDKCVec_u8Z RouteHop_write(const struct LDKRouteHop *NONNULL_PTR obj);
51655 * Read a RouteHop from a byte array, created by RouteHop_write
51657 struct LDKCResult_RouteHopDecodeErrorZ RouteHop_read(struct LDKu8slice ser);
51660 * Frees any resources used by the BlindedTail, if is_owned is set and inner is non-NULL.
51662 void BlindedTail_free(struct LDKBlindedTail this_obj);
51665 * The hops of the [`BlindedPath`] provided by the recipient.
51667 * [`BlindedPath`]: crate::blinded_path::BlindedPath
51669 struct LDKCVec_BlindedHopZ BlindedTail_get_hops(const struct LDKBlindedTail *NONNULL_PTR this_ptr);
51672 * The hops of the [`BlindedPath`] provided by the recipient.
51674 * [`BlindedPath`]: crate::blinded_path::BlindedPath
51676 void BlindedTail_set_hops(struct LDKBlindedTail *NONNULL_PTR this_ptr, struct LDKCVec_BlindedHopZ val);
51679 * The blinding point of the [`BlindedPath`] provided by the recipient.
51681 * [`BlindedPath`]: crate::blinded_path::BlindedPath
51683 struct LDKPublicKey BlindedTail_get_blinding_point(const struct LDKBlindedTail *NONNULL_PTR this_ptr);
51686 * The blinding point of the [`BlindedPath`] provided by the recipient.
51688 * [`BlindedPath`]: crate::blinded_path::BlindedPath
51690 void BlindedTail_set_blinding_point(struct LDKBlindedTail *NONNULL_PTR this_ptr, struct LDKPublicKey val);
51693 * Excess CLTV delta added to the recipient's CLTV expiry to deter intermediate nodes from
51694 * inferring the destination. May be 0.
51696 uint32_t BlindedTail_get_excess_final_cltv_expiry_delta(const struct LDKBlindedTail *NONNULL_PTR this_ptr);
51699 * Excess CLTV delta added to the recipient's CLTV expiry to deter intermediate nodes from
51700 * inferring the destination. May be 0.
51702 void BlindedTail_set_excess_final_cltv_expiry_delta(struct LDKBlindedTail *NONNULL_PTR this_ptr, uint32_t val);
51705 * The total amount paid on this [`Path`], excluding the fees.
51707 uint64_t BlindedTail_get_final_value_msat(const struct LDKBlindedTail *NONNULL_PTR this_ptr);
51710 * The total amount paid on this [`Path`], excluding the fees.
51712 void BlindedTail_set_final_value_msat(struct LDKBlindedTail *NONNULL_PTR this_ptr, uint64_t val);
51715 * Constructs a new BlindedTail given each field
51717 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);
51720 * Creates a copy of the BlindedTail
51722 struct LDKBlindedTail BlindedTail_clone(const struct LDKBlindedTail *NONNULL_PTR orig);
51725 * Generates a non-cryptographic 64-bit hash of the BlindedTail.
51727 uint64_t BlindedTail_hash(const struct LDKBlindedTail *NONNULL_PTR o);
51730 * Checks if two BlindedTails contain equal inner contents.
51731 * This ignores pointers and is_owned flags and looks at the values in fields.
51732 * Two objects with NULL inner values will be considered "equal" here.
51734 bool BlindedTail_eq(const struct LDKBlindedTail *NONNULL_PTR a, const struct LDKBlindedTail *NONNULL_PTR b);
51737 * Serialize the BlindedTail object into a byte array which can be read by BlindedTail_read
51739 struct LDKCVec_u8Z BlindedTail_write(const struct LDKBlindedTail *NONNULL_PTR obj);
51742 * Read a BlindedTail from a byte array, created by BlindedTail_write
51744 struct LDKCResult_BlindedTailDecodeErrorZ BlindedTail_read(struct LDKu8slice ser);
51747 * Frees any resources used by the Path, if is_owned is set and inner is non-NULL.
51749 void Path_free(struct LDKPath this_obj);
51752 * The list of unblinded hops in this [`Path`]. Must be at least length one.
51754 struct LDKCVec_RouteHopZ Path_get_hops(const struct LDKPath *NONNULL_PTR this_ptr);
51757 * The list of unblinded hops in this [`Path`]. Must be at least length one.
51759 void Path_set_hops(struct LDKPath *NONNULL_PTR this_ptr, struct LDKCVec_RouteHopZ val);
51762 * The blinded path at which this path terminates, if we're sending to one, and its metadata.
51764 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
51766 struct LDKBlindedTail Path_get_blinded_tail(const struct LDKPath *NONNULL_PTR this_ptr);
51769 * The blinded path at which this path terminates, if we're sending to one, and its metadata.
51771 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
51773 void Path_set_blinded_tail(struct LDKPath *NONNULL_PTR this_ptr, struct LDKBlindedTail val);
51776 * Constructs a new Path given each field
51778 * Note that blinded_tail_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
51780 MUST_USE_RES struct LDKPath Path_new(struct LDKCVec_RouteHopZ hops_arg, struct LDKBlindedTail blinded_tail_arg);
51783 * Creates a copy of the Path
51785 struct LDKPath Path_clone(const struct LDKPath *NONNULL_PTR orig);
51788 * Generates a non-cryptographic 64-bit hash of the Path.
51790 uint64_t Path_hash(const struct LDKPath *NONNULL_PTR o);
51793 * Checks if two Paths contain equal inner contents.
51794 * This ignores pointers and is_owned flags and looks at the values in fields.
51795 * Two objects with NULL inner values will be considered "equal" here.
51797 bool Path_eq(const struct LDKPath *NONNULL_PTR a, const struct LDKPath *NONNULL_PTR b);
51800 * Gets the fees for a given path, excluding any excess paid to the recipient.
51802 MUST_USE_RES uint64_t Path_fee_msat(const struct LDKPath *NONNULL_PTR this_arg);
51805 * Gets the total amount paid on this [`Path`], excluding the fees.
51807 MUST_USE_RES uint64_t Path_final_value_msat(const struct LDKPath *NONNULL_PTR this_arg);
51810 * Gets the final hop's CLTV expiry delta.
51812 MUST_USE_RES struct LDKCOption_u32Z Path_final_cltv_expiry_delta(const struct LDKPath *NONNULL_PTR this_arg);
51815 * Frees any resources used by the Route, if is_owned is set and inner is non-NULL.
51817 void Route_free(struct LDKRoute this_obj);
51820 * The list of [`Path`]s taken for a single (potentially-)multi-part payment. If no
51821 * [`BlindedTail`]s are present, then the pubkey of the last [`RouteHop`] in each path must be
51824 struct LDKCVec_PathZ Route_get_paths(const struct LDKRoute *NONNULL_PTR this_ptr);
51827 * The list of [`Path`]s taken for a single (potentially-)multi-part payment. If no
51828 * [`BlindedTail`]s are present, then the pubkey of the last [`RouteHop`] in each path must be
51831 void Route_set_paths(struct LDKRoute *NONNULL_PTR this_ptr, struct LDKCVec_PathZ val);
51834 * The `route_params` parameter passed to [`find_route`].
51836 * This is used by `ChannelManager` to track information which may be required for retries.
51838 * Will be `None` for objects serialized with LDK versions prior to 0.0.117.
51840 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
51842 struct LDKRouteParameters Route_get_route_params(const struct LDKRoute *NONNULL_PTR this_ptr);
51845 * The `route_params` parameter passed to [`find_route`].
51847 * This is used by `ChannelManager` to track information which may be required for retries.
51849 * Will be `None` for objects serialized with LDK versions prior to 0.0.117.
51851 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
51853 void Route_set_route_params(struct LDKRoute *NONNULL_PTR this_ptr, struct LDKRouteParameters val);
51856 * Constructs a new Route given each field
51858 * Note that route_params_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
51860 MUST_USE_RES struct LDKRoute Route_new(struct LDKCVec_PathZ paths_arg, struct LDKRouteParameters route_params_arg);
51863 * Creates a copy of the Route
51865 struct LDKRoute Route_clone(const struct LDKRoute *NONNULL_PTR orig);
51868 * Generates a non-cryptographic 64-bit hash of the Route.
51870 uint64_t Route_hash(const struct LDKRoute *NONNULL_PTR o);
51873 * Checks if two Routes contain equal inner contents.
51874 * This ignores pointers and is_owned flags and looks at the values in fields.
51875 * Two objects with NULL inner values will be considered "equal" here.
51877 bool Route_eq(const struct LDKRoute *NONNULL_PTR a, const struct LDKRoute *NONNULL_PTR b);
51880 * Returns the total amount of fees paid on this [`Route`].
51882 * For objects serialized with LDK 0.0.117 and after, this includes any extra payment made to
51883 * the recipient, which can happen in excess of the amount passed to [`find_route`] via
51884 * [`RouteParameters::final_value_msat`], if we had to reach the [`htlc_minimum_msat`] limits.
51886 * [`htlc_minimum_msat`]: https://github.com/lightning/bolts/blob/master/07-routing-gossip.md#the-channel_update-message
51888 MUST_USE_RES uint64_t Route_get_total_fees(const struct LDKRoute *NONNULL_PTR this_arg);
51891 * Returns the total amount paid on this [`Route`], excluding the fees.
51893 * Might be more than requested as part of the given [`RouteParameters::final_value_msat`] if
51894 * we had to reach the [`htlc_minimum_msat`] limits.
51896 * [`htlc_minimum_msat`]: https://github.com/lightning/bolts/blob/master/07-routing-gossip.md#the-channel_update-message
51898 MUST_USE_RES uint64_t Route_get_total_amount(const struct LDKRoute *NONNULL_PTR this_arg);
51901 * Get the string representation of a Route object
51903 struct LDKStr Route_to_str(const struct LDKRoute *NONNULL_PTR o);
51906 * Serialize the Route object into a byte array which can be read by Route_read
51908 struct LDKCVec_u8Z Route_write(const struct LDKRoute *NONNULL_PTR obj);
51911 * Read a Route from a byte array, created by Route_write
51913 struct LDKCResult_RouteDecodeErrorZ Route_read(struct LDKu8slice ser);
51916 * Frees any resources used by the RouteParameters, if is_owned is set and inner is non-NULL.
51918 void RouteParameters_free(struct LDKRouteParameters this_obj);
51921 * The parameters of the failed payment path.
51923 struct LDKPaymentParameters RouteParameters_get_payment_params(const struct LDKRouteParameters *NONNULL_PTR this_ptr);
51926 * The parameters of the failed payment path.
51928 void RouteParameters_set_payment_params(struct LDKRouteParameters *NONNULL_PTR this_ptr, struct LDKPaymentParameters val);
51931 * The amount in msats sent on the failed payment path.
51933 uint64_t RouteParameters_get_final_value_msat(const struct LDKRouteParameters *NONNULL_PTR this_ptr);
51936 * The amount in msats sent on the failed payment path.
51938 void RouteParameters_set_final_value_msat(struct LDKRouteParameters *NONNULL_PTR this_ptr, uint64_t val);
51941 * The maximum total fees, in millisatoshi, that may accrue during route finding.
51943 * This limit also applies to the total fees that may arise while retrying failed payment
51946 * Note that values below a few sats may result in some paths being spuriously ignored.
51948 struct LDKCOption_u64Z RouteParameters_get_max_total_routing_fee_msat(const struct LDKRouteParameters *NONNULL_PTR this_ptr);
51951 * The maximum total fees, in millisatoshi, that may accrue during route finding.
51953 * This limit also applies to the total fees that may arise while retrying failed payment
51956 * Note that values below a few sats may result in some paths being spuriously ignored.
51958 void RouteParameters_set_max_total_routing_fee_msat(struct LDKRouteParameters *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
51961 * Constructs a new RouteParameters given each field
51963 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);
51966 * Creates a copy of the RouteParameters
51968 struct LDKRouteParameters RouteParameters_clone(const struct LDKRouteParameters *NONNULL_PTR orig);
51971 * Generates a non-cryptographic 64-bit hash of the RouteParameters.
51973 uint64_t RouteParameters_hash(const struct LDKRouteParameters *NONNULL_PTR o);
51976 * Checks if two RouteParameterss contain equal inner contents.
51977 * This ignores pointers and is_owned flags and looks at the values in fields.
51978 * Two objects with NULL inner values will be considered "equal" here.
51980 bool RouteParameters_eq(const struct LDKRouteParameters *NONNULL_PTR a, const struct LDKRouteParameters *NONNULL_PTR b);
51983 * Constructs [`RouteParameters`] from the given [`PaymentParameters`] and a payment amount.
51985 * [`Self::max_total_routing_fee_msat`] defaults to 1% of the payment amount + 50 sats
51987 MUST_USE_RES struct LDKRouteParameters RouteParameters_from_payment_params_and_value(struct LDKPaymentParameters payment_params, uint64_t final_value_msat);
51990 * Serialize the RouteParameters object into a byte array which can be read by RouteParameters_read
51992 struct LDKCVec_u8Z RouteParameters_write(const struct LDKRouteParameters *NONNULL_PTR obj);
51995 * Read a RouteParameters from a byte array, created by RouteParameters_write
51997 struct LDKCResult_RouteParametersDecodeErrorZ RouteParameters_read(struct LDKu8slice ser);
52000 * Frees any resources used by the PaymentParameters, if is_owned is set and inner is non-NULL.
52002 void PaymentParameters_free(struct LDKPaymentParameters this_obj);
52005 * Information about the payee, such as their features and route hints for their channels.
52007 struct LDKPayee PaymentParameters_get_payee(const struct LDKPaymentParameters *NONNULL_PTR this_ptr);
52010 * Information about the payee, such as their features and route hints for their channels.
52012 void PaymentParameters_set_payee(struct LDKPaymentParameters *NONNULL_PTR this_ptr, struct LDKPayee val);
52015 * Expiration of a payment to the payee, in seconds relative to the UNIX epoch.
52017 struct LDKCOption_u64Z PaymentParameters_get_expiry_time(const struct LDKPaymentParameters *NONNULL_PTR this_ptr);
52020 * Expiration of a payment to the payee, in seconds relative to the UNIX epoch.
52022 void PaymentParameters_set_expiry_time(struct LDKPaymentParameters *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
52025 * The maximum total CLTV delta we accept for the route.
52026 * Defaults to [`DEFAULT_MAX_TOTAL_CLTV_EXPIRY_DELTA`].
52028 uint32_t PaymentParameters_get_max_total_cltv_expiry_delta(const struct LDKPaymentParameters *NONNULL_PTR this_ptr);
52031 * The maximum total CLTV delta we accept for the route.
52032 * Defaults to [`DEFAULT_MAX_TOTAL_CLTV_EXPIRY_DELTA`].
52034 void PaymentParameters_set_max_total_cltv_expiry_delta(struct LDKPaymentParameters *NONNULL_PTR this_ptr, uint32_t val);
52037 * The maximum number of paths that may be used by (MPP) payments.
52038 * Defaults to [`DEFAULT_MAX_PATH_COUNT`].
52040 uint8_t PaymentParameters_get_max_path_count(const struct LDKPaymentParameters *NONNULL_PTR this_ptr);
52043 * The maximum number of paths that may be used by (MPP) payments.
52044 * Defaults to [`DEFAULT_MAX_PATH_COUNT`].
52046 void PaymentParameters_set_max_path_count(struct LDKPaymentParameters *NONNULL_PTR this_ptr, uint8_t val);
52049 * Selects the maximum share of a channel's total capacity which will be sent over a channel,
52050 * as a power of 1/2. A higher value prefers to send the payment using more MPP parts whereas
52051 * a lower value prefers to send larger MPP parts, potentially saturating channels and
52052 * increasing failure probability for those paths.
52054 * Note that this restriction will be relaxed during pathfinding after paths which meet this
52055 * restriction have been found. While paths which meet this criteria will be searched for, it
52056 * is ultimately up to the scorer to select them over other paths.
52058 * A value of 0 will allow payments up to and including a channel's total announced usable
52059 * capacity, a value of one will only use up to half its capacity, two 1/4, etc.
52063 uint8_t PaymentParameters_get_max_channel_saturation_power_of_half(const struct LDKPaymentParameters *NONNULL_PTR this_ptr);
52066 * Selects the maximum share of a channel's total capacity which will be sent over a channel,
52067 * as a power of 1/2. A higher value prefers to send the payment using more MPP parts whereas
52068 * a lower value prefers to send larger MPP parts, potentially saturating channels and
52069 * increasing failure probability for those paths.
52071 * Note that this restriction will be relaxed during pathfinding after paths which meet this
52072 * restriction have been found. While paths which meet this criteria will be searched for, it
52073 * is ultimately up to the scorer to select them over other paths.
52075 * A value of 0 will allow payments up to and including a channel's total announced usable
52076 * capacity, a value of one will only use up to half its capacity, two 1/4, etc.
52080 void PaymentParameters_set_max_channel_saturation_power_of_half(struct LDKPaymentParameters *NONNULL_PTR this_ptr, uint8_t val);
52083 * A list of SCIDs which this payment was previously attempted over and which caused the
52084 * payment to fail. Future attempts for the same payment shouldn't be relayed through any of
52087 * Returns a copy of the field.
52089 struct LDKCVec_u64Z PaymentParameters_get_previously_failed_channels(const struct LDKPaymentParameters *NONNULL_PTR this_ptr);
52092 * A list of SCIDs which this payment was previously attempted over and which caused the
52093 * payment to fail. Future attempts for the same payment shouldn't be relayed through any of
52096 void PaymentParameters_set_previously_failed_channels(struct LDKPaymentParameters *NONNULL_PTR this_ptr, struct LDKCVec_u64Z val);
52099 * A list of indices corresponding to blinded paths in [`Payee::Blinded::route_hints`] which this
52100 * payment was previously attempted over and which caused the payment to fail. Future attempts
52101 * for the same payment shouldn't be relayed through any of these blinded paths.
52103 * Returns a copy of the field.
52105 struct LDKCVec_u64Z PaymentParameters_get_previously_failed_blinded_path_idxs(const struct LDKPaymentParameters *NONNULL_PTR this_ptr);
52108 * A list of indices corresponding to blinded paths in [`Payee::Blinded::route_hints`] which this
52109 * payment was previously attempted over and which caused the payment to fail. Future attempts
52110 * for the same payment shouldn't be relayed through any of these blinded paths.
52112 void PaymentParameters_set_previously_failed_blinded_path_idxs(struct LDKPaymentParameters *NONNULL_PTR this_ptr, struct LDKCVec_u64Z val);
52115 * Constructs a new PaymentParameters given each field
52117 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);
52120 * Creates a copy of the PaymentParameters
52122 struct LDKPaymentParameters PaymentParameters_clone(const struct LDKPaymentParameters *NONNULL_PTR orig);
52125 * Generates a non-cryptographic 64-bit hash of the PaymentParameters.
52127 uint64_t PaymentParameters_hash(const struct LDKPaymentParameters *NONNULL_PTR o);
52130 * Checks if two PaymentParameterss contain equal inner contents.
52131 * This ignores pointers and is_owned flags and looks at the values in fields.
52132 * Two objects with NULL inner values will be considered "equal" here.
52134 bool PaymentParameters_eq(const struct LDKPaymentParameters *NONNULL_PTR a, const struct LDKPaymentParameters *NONNULL_PTR b);
52137 * Serialize the PaymentParameters object into a byte array which can be read by PaymentParameters_read
52139 struct LDKCVec_u8Z PaymentParameters_write(const struct LDKPaymentParameters *NONNULL_PTR obj);
52142 * Read a PaymentParameters from a byte array, created by PaymentParameters_write
52144 struct LDKCResult_PaymentParametersDecodeErrorZ PaymentParameters_read(struct LDKu8slice ser, uint32_t arg);
52147 * Creates a payee with the node id of the given `pubkey`.
52149 * The `final_cltv_expiry_delta` should match the expected final CLTV delta the recipient has
52152 MUST_USE_RES struct LDKPaymentParameters PaymentParameters_from_node_id(struct LDKPublicKey payee_pubkey, uint32_t final_cltv_expiry_delta);
52155 * Creates a payee with the node id of the given `pubkey` to use for keysend payments.
52157 * The `final_cltv_expiry_delta` should match the expected final CLTV delta the recipient has
52160 * Note that MPP keysend is not widely supported yet. The `allow_mpp` lets you choose
52161 * whether your router will be allowed to find a multi-part route for this payment. If you
52162 * set `allow_mpp` to true, you should ensure a payment secret is set on send, likely via
52163 * [`RecipientOnionFields::secret_only`].
52165 * [`RecipientOnionFields::secret_only`]: crate::ln::channelmanager::RecipientOnionFields::secret_only
52167 MUST_USE_RES struct LDKPaymentParameters PaymentParameters_for_keysend(struct LDKPublicKey payee_pubkey, uint32_t final_cltv_expiry_delta, bool allow_mpp);
52170 * Creates parameters for paying to a blinded payee from the provided invoice. Sets
52171 * [`Payee::Blinded::route_hints`], [`Payee::Blinded::features`], and
52172 * [`PaymentParameters::expiry_time`].
52174 MUST_USE_RES struct LDKPaymentParameters PaymentParameters_from_bolt12_invoice(const struct LDKBolt12Invoice *NONNULL_PTR invoice);
52177 * Creates parameters for paying to a blinded payee from the provided blinded route hints.
52179 MUST_USE_RES struct LDKPaymentParameters PaymentParameters_blinded(struct LDKCVec_C2Tuple_BlindedPayInfoBlindedPathZZ blinded_route_hints);
52182 * Frees any resources used by the Payee
52184 void Payee_free(struct LDKPayee this_ptr);
52187 * Creates a copy of the Payee
52189 struct LDKPayee Payee_clone(const struct LDKPayee *NONNULL_PTR orig);
52192 * Utility method to constructs a new Blinded-variant Payee
52194 struct LDKPayee Payee_blinded(struct LDKCVec_C2Tuple_BlindedPayInfoBlindedPathZZ route_hints, struct LDKBolt12InvoiceFeatures features);
52197 * Utility method to constructs a new Clear-variant Payee
52199 struct LDKPayee Payee_clear(struct LDKPublicKey node_id, struct LDKCVec_RouteHintZ route_hints, struct LDKBolt11InvoiceFeatures features, uint32_t final_cltv_expiry_delta);
52202 * Generates a non-cryptographic 64-bit hash of the Payee.
52204 uint64_t Payee_hash(const struct LDKPayee *NONNULL_PTR o);
52207 * Checks if two Payees contain equal inner contents.
52208 * This ignores pointers and is_owned flags and looks at the values in fields.
52210 bool Payee_eq(const struct LDKPayee *NONNULL_PTR a, const struct LDKPayee *NONNULL_PTR b);
52213 * Frees any resources used by the RouteHint, if is_owned is set and inner is non-NULL.
52215 void RouteHint_free(struct LDKRouteHint this_obj);
52217 struct LDKCVec_RouteHintHopZ RouteHint_get_a(const struct LDKRouteHint *NONNULL_PTR this_ptr);
52219 void RouteHint_set_a(struct LDKRouteHint *NONNULL_PTR this_ptr, struct LDKCVec_RouteHintHopZ val);
52222 * Constructs a new RouteHint given each field
52224 MUST_USE_RES struct LDKRouteHint RouteHint_new(struct LDKCVec_RouteHintHopZ a_arg);
52227 * Creates a copy of the RouteHint
52229 struct LDKRouteHint RouteHint_clone(const struct LDKRouteHint *NONNULL_PTR orig);
52232 * Generates a non-cryptographic 64-bit hash of the RouteHint.
52234 uint64_t RouteHint_hash(const struct LDKRouteHint *NONNULL_PTR o);
52237 * Checks if two RouteHints contain equal inner contents.
52238 * This ignores pointers and is_owned flags and looks at the values in fields.
52239 * Two objects with NULL inner values will be considered "equal" here.
52241 bool RouteHint_eq(const struct LDKRouteHint *NONNULL_PTR a, const struct LDKRouteHint *NONNULL_PTR b);
52244 * Serialize the RouteHint object into a byte array which can be read by RouteHint_read
52246 struct LDKCVec_u8Z RouteHint_write(const struct LDKRouteHint *NONNULL_PTR obj);
52249 * Read a RouteHint from a byte array, created by RouteHint_write
52251 struct LDKCResult_RouteHintDecodeErrorZ RouteHint_read(struct LDKu8slice ser);
52254 * Frees any resources used by the RouteHintHop, if is_owned is set and inner is non-NULL.
52256 void RouteHintHop_free(struct LDKRouteHintHop this_obj);
52259 * The node_id of the non-target end of the route
52261 struct LDKPublicKey RouteHintHop_get_src_node_id(const struct LDKRouteHintHop *NONNULL_PTR this_ptr);
52264 * The node_id of the non-target end of the route
52266 void RouteHintHop_set_src_node_id(struct LDKRouteHintHop *NONNULL_PTR this_ptr, struct LDKPublicKey val);
52269 * The short_channel_id of this channel
52271 uint64_t RouteHintHop_get_short_channel_id(const struct LDKRouteHintHop *NONNULL_PTR this_ptr);
52274 * The short_channel_id of this channel
52276 void RouteHintHop_set_short_channel_id(struct LDKRouteHintHop *NONNULL_PTR this_ptr, uint64_t val);
52279 * The fees which must be paid to use this channel
52281 struct LDKRoutingFees RouteHintHop_get_fees(const struct LDKRouteHintHop *NONNULL_PTR this_ptr);
52284 * The fees which must be paid to use this channel
52286 void RouteHintHop_set_fees(struct LDKRouteHintHop *NONNULL_PTR this_ptr, struct LDKRoutingFees val);
52289 * The difference in CLTV values between this node and the next node.
52291 uint16_t RouteHintHop_get_cltv_expiry_delta(const struct LDKRouteHintHop *NONNULL_PTR this_ptr);
52294 * The difference in CLTV values between this node and the next node.
52296 void RouteHintHop_set_cltv_expiry_delta(struct LDKRouteHintHop *NONNULL_PTR this_ptr, uint16_t val);
52299 * The minimum value, in msat, which must be relayed to the next hop.
52301 struct LDKCOption_u64Z RouteHintHop_get_htlc_minimum_msat(const struct LDKRouteHintHop *NONNULL_PTR this_ptr);
52304 * The minimum value, in msat, which must be relayed to the next hop.
52306 void RouteHintHop_set_htlc_minimum_msat(struct LDKRouteHintHop *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
52309 * The maximum value in msat available for routing with a single HTLC.
52311 struct LDKCOption_u64Z RouteHintHop_get_htlc_maximum_msat(const struct LDKRouteHintHop *NONNULL_PTR this_ptr);
52314 * The maximum value in msat available for routing with a single HTLC.
52316 void RouteHintHop_set_htlc_maximum_msat(struct LDKRouteHintHop *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
52319 * Constructs a new RouteHintHop given each field
52321 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);
52324 * Creates a copy of the RouteHintHop
52326 struct LDKRouteHintHop RouteHintHop_clone(const struct LDKRouteHintHop *NONNULL_PTR orig);
52329 * Generates a non-cryptographic 64-bit hash of the RouteHintHop.
52331 uint64_t RouteHintHop_hash(const struct LDKRouteHintHop *NONNULL_PTR o);
52334 * Checks if two RouteHintHops contain equal inner contents.
52335 * This ignores pointers and is_owned flags and looks at the values in fields.
52336 * Two objects with NULL inner values will be considered "equal" here.
52338 bool RouteHintHop_eq(const struct LDKRouteHintHop *NONNULL_PTR a, const struct LDKRouteHintHop *NONNULL_PTR b);
52341 * Serialize the RouteHintHop object into a byte array which can be read by RouteHintHop_read
52343 struct LDKCVec_u8Z RouteHintHop_write(const struct LDKRouteHintHop *NONNULL_PTR obj);
52346 * Read a RouteHintHop from a byte array, created by RouteHintHop_write
52348 struct LDKCResult_RouteHintHopDecodeErrorZ RouteHintHop_read(struct LDKu8slice ser);
52351 * Frees any resources used by the FirstHopCandidate, if is_owned is set and inner is non-NULL.
52353 void FirstHopCandidate_free(struct LDKFirstHopCandidate this_obj);
52356 * Creates a copy of the FirstHopCandidate
52358 struct LDKFirstHopCandidate FirstHopCandidate_clone(const struct LDKFirstHopCandidate *NONNULL_PTR orig);
52361 * Frees any resources used by the PublicHopCandidate, if is_owned is set and inner is non-NULL.
52363 void PublicHopCandidate_free(struct LDKPublicHopCandidate this_obj);
52366 * The short channel ID of the channel, i.e. the identifier by which we refer to this
52369 uint64_t PublicHopCandidate_get_short_channel_id(const struct LDKPublicHopCandidate *NONNULL_PTR this_ptr);
52372 * The short channel ID of the channel, i.e. the identifier by which we refer to this
52375 void PublicHopCandidate_set_short_channel_id(struct LDKPublicHopCandidate *NONNULL_PTR this_ptr, uint64_t val);
52378 * Creates a copy of the PublicHopCandidate
52380 struct LDKPublicHopCandidate PublicHopCandidate_clone(const struct LDKPublicHopCandidate *NONNULL_PTR orig);
52383 * Frees any resources used by the PrivateHopCandidate, if is_owned is set and inner is non-NULL.
52385 void PrivateHopCandidate_free(struct LDKPrivateHopCandidate this_obj);
52388 * Creates a copy of the PrivateHopCandidate
52390 struct LDKPrivateHopCandidate PrivateHopCandidate_clone(const struct LDKPrivateHopCandidate *NONNULL_PTR orig);
52393 * Frees any resources used by the BlindedPathCandidate, if is_owned is set and inner is non-NULL.
52395 void BlindedPathCandidate_free(struct LDKBlindedPathCandidate this_obj);
52398 * Creates a copy of the BlindedPathCandidate
52400 struct LDKBlindedPathCandidate BlindedPathCandidate_clone(const struct LDKBlindedPathCandidate *NONNULL_PTR orig);
52403 * Frees any resources used by the OneHopBlindedPathCandidate, if is_owned is set and inner is non-NULL.
52405 void OneHopBlindedPathCandidate_free(struct LDKOneHopBlindedPathCandidate this_obj);
52408 * Creates a copy of the OneHopBlindedPathCandidate
52410 struct LDKOneHopBlindedPathCandidate OneHopBlindedPathCandidate_clone(const struct LDKOneHopBlindedPathCandidate *NONNULL_PTR orig);
52413 * Frees any resources used by the CandidateRouteHop
52415 void CandidateRouteHop_free(struct LDKCandidateRouteHop this_ptr);
52418 * Creates a copy of the CandidateRouteHop
52420 struct LDKCandidateRouteHop CandidateRouteHop_clone(const struct LDKCandidateRouteHop *NONNULL_PTR orig);
52423 * Utility method to constructs a new FirstHop-variant CandidateRouteHop
52425 struct LDKCandidateRouteHop CandidateRouteHop_first_hop(struct LDKFirstHopCandidate a);
52428 * Utility method to constructs a new PublicHop-variant CandidateRouteHop
52430 struct LDKCandidateRouteHop CandidateRouteHop_public_hop(struct LDKPublicHopCandidate a);
52433 * Utility method to constructs a new PrivateHop-variant CandidateRouteHop
52435 struct LDKCandidateRouteHop CandidateRouteHop_private_hop(struct LDKPrivateHopCandidate a);
52438 * Utility method to constructs a new Blinded-variant CandidateRouteHop
52440 struct LDKCandidateRouteHop CandidateRouteHop_blinded(struct LDKBlindedPathCandidate a);
52443 * Utility method to constructs a new OneHopBlinded-variant CandidateRouteHop
52445 struct LDKCandidateRouteHop CandidateRouteHop_one_hop_blinded(struct LDKOneHopBlindedPathCandidate a);
52448 * Returns the globally unique short channel ID for this hop, if one is known.
52450 * This only returns `Some` if the channel is public (either our own, or one we've learned
52451 * from the public network graph), and thus the short channel ID we have for this channel is
52452 * globally unique and identifies this channel in a global namespace.
52454 MUST_USE_RES struct LDKCOption_u64Z CandidateRouteHop_globally_unique_short_channel_id(const struct LDKCandidateRouteHop *NONNULL_PTR this_arg);
52457 * Returns the required difference in HTLC CLTV expiry between the [`Self::source`] and the
52458 * next-hop for an HTLC taking this hop.
52460 * This is the time that the node(s) in this hop have to claim the HTLC on-chain if the
52461 * next-hop goes on chain with a payment preimage.
52463 MUST_USE_RES uint32_t CandidateRouteHop_cltv_expiry_delta(const struct LDKCandidateRouteHop *NONNULL_PTR this_arg);
52466 * Returns the minimum amount that can be sent over this hop, in millisatoshis.
52468 MUST_USE_RES uint64_t CandidateRouteHop_htlc_minimum_msat(const struct LDKCandidateRouteHop *NONNULL_PTR this_arg);
52471 * Returns the fees that must be paid to route an HTLC over this channel.
52473 MUST_USE_RES struct LDKRoutingFees CandidateRouteHop_fees(const struct LDKCandidateRouteHop *NONNULL_PTR this_arg);
52476 * Returns the source node id of current hop.
52478 * Source node id refers to the node forwarding the HTLC through this hop.
52480 * For [`Self::FirstHop`] we return payer's node id.
52482 MUST_USE_RES struct LDKNodeId CandidateRouteHop_source(const struct LDKCandidateRouteHop *NONNULL_PTR this_arg);
52485 * Returns the target node id of this hop, if known.
52487 * Target node id refers to the node receiving the HTLC after this hop.
52489 * For [`Self::Blinded`] we return `None` because the ultimate destination after the blinded
52492 * For [`Self::OneHopBlinded`] we return `None` because the target is the same as the source,
52493 * and such a return value would be somewhat nonsensical.
52495 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
52497 MUST_USE_RES struct LDKNodeId CandidateRouteHop_target(const struct LDKCandidateRouteHop *NONNULL_PTR this_arg);
52500 * Finds a route from us (payer) to the given target node (payee).
52502 * If the payee provided features in their invoice, they should be provided via the `payee` field
52503 * in the given [`RouteParameters::payment_params`].
52504 * Without this, MPP will only be used if the payee's features are available in the network graph.
52506 * Private routing paths between a public node and the target may be included in the `payee` field
52507 * of [`RouteParameters::payment_params`].
52509 * If some channels aren't announced, it may be useful to fill in `first_hops` with the results
52510 * from [`ChannelManager::list_usable_channels`]. If it is filled in, the view of these channels
52511 * from `network_graph` will be ignored, and only those in `first_hops` will be used.
52513 * The fees on channels from us to the next hop are ignored as they are assumed to all be equal.
52514 * However, the enabled/disabled bit on such channels as well as the `htlc_minimum_msat` /
52515 * `htlc_maximum_msat` *are* checked as they may change based on the receiving node.
52519 * Panics if first_hops contains channels without `short_channel_id`s;
52520 * [`ChannelManager::list_usable_channels`] will never include such channels.
52522 * [`ChannelManager::list_usable_channels`]: crate::ln::channelmanager::ChannelManager::list_usable_channels
52523 * [`Event::PaymentPathFailed`]: crate::events::Event::PaymentPathFailed
52524 * [`NetworkGraph`]: crate::routing::gossip::NetworkGraph
52526 * Note that first_hops (or a relevant inner pointer) may be NULL or all-0s to represent None
52528 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]);
52531 * Construct a route from us (payer) to the target node (payee) via the given hops (which should
52532 * exclude the payer, but include the payee). This may be useful, e.g., for probing the chosen path.
52534 * Re-uses logic from `find_route`, so the restrictions described there also apply here.
52536 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]);
52539 * Calls the free function if one is set
52541 void ScoreLookUp_free(struct LDKScoreLookUp this_ptr);
52544 * Calls the free function if one is set
52546 void ScoreUpdate_free(struct LDKScoreUpdate this_ptr);
52549 * Calls the free function if one is set
52551 void Score_free(struct LDKScore this_ptr);
52554 * Calls the free function if one is set
52556 void LockableScore_free(struct LDKLockableScore this_ptr);
52559 * Calls the free function if one is set
52561 void WriteableScore_free(struct LDKWriteableScore this_ptr);
52564 * Frees any resources used by the MultiThreadedLockableScore, if is_owned is set and inner is non-NULL.
52566 void MultiThreadedLockableScore_free(struct LDKMultiThreadedLockableScore this_obj);
52569 * Constructs a new LockableScore which calls the relevant methods on this_arg.
52570 * This copies the `inner` pointer in this_arg and thus the returned LockableScore must be freed before this_arg is
52572 struct LDKLockableScore MultiThreadedLockableScore_as_LockableScore(const struct LDKMultiThreadedLockableScore *NONNULL_PTR this_arg);
52575 * Serialize the MultiThreadedLockableScore object into a byte array which can be read by MultiThreadedLockableScore_read
52577 struct LDKCVec_u8Z MultiThreadedLockableScore_write(const struct LDKMultiThreadedLockableScore *NONNULL_PTR obj);
52580 * Constructs a new WriteableScore which calls the relevant methods on this_arg.
52581 * This copies the `inner` pointer in this_arg and thus the returned WriteableScore must be freed before this_arg is
52583 struct LDKWriteableScore MultiThreadedLockableScore_as_WriteableScore(const struct LDKMultiThreadedLockableScore *NONNULL_PTR this_arg);
52586 * Creates a new [`MultiThreadedLockableScore`] given an underlying [`Score`].
52588 MUST_USE_RES struct LDKMultiThreadedLockableScore MultiThreadedLockableScore_new(struct LDKScore score);
52591 * Frees any resources used by the MultiThreadedScoreLockRead, if is_owned is set and inner is non-NULL.
52593 void MultiThreadedScoreLockRead_free(struct LDKMultiThreadedScoreLockRead this_obj);
52596 * Frees any resources used by the MultiThreadedScoreLockWrite, if is_owned is set and inner is non-NULL.
52598 void MultiThreadedScoreLockWrite_free(struct LDKMultiThreadedScoreLockWrite this_obj);
52601 * Constructs a new ScoreLookUp which calls the relevant methods on this_arg.
52602 * This copies the `inner` pointer in this_arg and thus the returned ScoreLookUp must be freed before this_arg is
52604 struct LDKScoreLookUp MultiThreadedScoreLockRead_as_ScoreLookUp(const struct LDKMultiThreadedScoreLockRead *NONNULL_PTR this_arg);
52607 * Serialize the MultiThreadedScoreLockWrite object into a byte array which can be read by MultiThreadedScoreLockWrite_read
52609 struct LDKCVec_u8Z MultiThreadedScoreLockWrite_write(const struct LDKMultiThreadedScoreLockWrite *NONNULL_PTR obj);
52612 * Constructs a new ScoreUpdate which calls the relevant methods on this_arg.
52613 * This copies the `inner` pointer in this_arg and thus the returned ScoreUpdate must be freed before this_arg is
52615 struct LDKScoreUpdate MultiThreadedScoreLockWrite_as_ScoreUpdate(const struct LDKMultiThreadedScoreLockWrite *NONNULL_PTR this_arg);
52618 * Frees any resources used by the ChannelUsage, if is_owned is set and inner is non-NULL.
52620 void ChannelUsage_free(struct LDKChannelUsage this_obj);
52623 * The amount to send through the channel, denominated in millisatoshis.
52625 uint64_t ChannelUsage_get_amount_msat(const struct LDKChannelUsage *NONNULL_PTR this_ptr);
52628 * The amount to send through the channel, denominated in millisatoshis.
52630 void ChannelUsage_set_amount_msat(struct LDKChannelUsage *NONNULL_PTR this_ptr, uint64_t val);
52633 * Total amount, denominated in millisatoshis, already allocated to send through the channel
52634 * as part of a multi-path payment.
52636 uint64_t ChannelUsage_get_inflight_htlc_msat(const struct LDKChannelUsage *NONNULL_PTR this_ptr);
52639 * Total amount, denominated in millisatoshis, already allocated to send through the channel
52640 * as part of a multi-path payment.
52642 void ChannelUsage_set_inflight_htlc_msat(struct LDKChannelUsage *NONNULL_PTR this_ptr, uint64_t val);
52645 * The effective capacity of the channel.
52647 struct LDKEffectiveCapacity ChannelUsage_get_effective_capacity(const struct LDKChannelUsage *NONNULL_PTR this_ptr);
52650 * The effective capacity of the channel.
52652 void ChannelUsage_set_effective_capacity(struct LDKChannelUsage *NONNULL_PTR this_ptr, struct LDKEffectiveCapacity val);
52655 * Constructs a new ChannelUsage given each field
52657 MUST_USE_RES struct LDKChannelUsage ChannelUsage_new(uint64_t amount_msat_arg, uint64_t inflight_htlc_msat_arg, struct LDKEffectiveCapacity effective_capacity_arg);
52660 * Creates a copy of the ChannelUsage
52662 struct LDKChannelUsage ChannelUsage_clone(const struct LDKChannelUsage *NONNULL_PTR orig);
52665 * Frees any resources used by the FixedPenaltyScorer, if is_owned is set and inner is non-NULL.
52667 void FixedPenaltyScorer_free(struct LDKFixedPenaltyScorer this_obj);
52670 * Creates a copy of the FixedPenaltyScorer
52672 struct LDKFixedPenaltyScorer FixedPenaltyScorer_clone(const struct LDKFixedPenaltyScorer *NONNULL_PTR orig);
52675 * Creates a new scorer using `penalty_msat`.
52677 MUST_USE_RES struct LDKFixedPenaltyScorer FixedPenaltyScorer_with_penalty(uint64_t penalty_msat);
52680 * Constructs a new ScoreLookUp which calls the relevant methods on this_arg.
52681 * This copies the `inner` pointer in this_arg and thus the returned ScoreLookUp must be freed before this_arg is
52683 struct LDKScoreLookUp FixedPenaltyScorer_as_ScoreLookUp(const struct LDKFixedPenaltyScorer *NONNULL_PTR this_arg);
52686 * Constructs a new ScoreUpdate which calls the relevant methods on this_arg.
52687 * This copies the `inner` pointer in this_arg and thus the returned ScoreUpdate must be freed before this_arg is
52689 struct LDKScoreUpdate FixedPenaltyScorer_as_ScoreUpdate(const struct LDKFixedPenaltyScorer *NONNULL_PTR this_arg);
52692 * Serialize the FixedPenaltyScorer object into a byte array which can be read by FixedPenaltyScorer_read
52694 struct LDKCVec_u8Z FixedPenaltyScorer_write(const struct LDKFixedPenaltyScorer *NONNULL_PTR obj);
52697 * Read a FixedPenaltyScorer from a byte array, created by FixedPenaltyScorer_write
52699 struct LDKCResult_FixedPenaltyScorerDecodeErrorZ FixedPenaltyScorer_read(struct LDKu8slice ser, uint64_t arg);
52702 * Frees any resources used by the ProbabilisticScorer, if is_owned is set and inner is non-NULL.
52704 void ProbabilisticScorer_free(struct LDKProbabilisticScorer this_obj);
52707 * Frees any resources used by the ProbabilisticScoringFeeParameters, if is_owned is set and inner is non-NULL.
52709 void ProbabilisticScoringFeeParameters_free(struct LDKProbabilisticScoringFeeParameters this_obj);
52712 * A fixed penalty in msats to apply to each channel.
52714 * Default value: 500 msat
52716 uint64_t ProbabilisticScoringFeeParameters_get_base_penalty_msat(const struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_ptr);
52719 * A fixed penalty in msats to apply to each channel.
52721 * Default value: 500 msat
52723 void ProbabilisticScoringFeeParameters_set_base_penalty_msat(struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_ptr, uint64_t val);
52726 * A multiplier used with the total amount flowing over a channel to calculate a fixed penalty
52727 * applied to each channel, in excess of the [`base_penalty_msat`].
52729 * The purpose of the amount penalty is to avoid having fees dominate the channel cost (i.e.,
52730 * fees plus penalty) for large payments. The penalty is computed as the product of this
52731 * multiplier and `2^30`ths of the total amount flowing over a channel (i.e. the payment
52732 * amount plus the amount of any other HTLCs flowing we sent over the same channel).
52734 * ie `base_penalty_amount_multiplier_msat * amount_msat / 2^30`
52736 * Default value: 8,192 msat
52738 * [`base_penalty_msat`]: Self::base_penalty_msat
52740 uint64_t ProbabilisticScoringFeeParameters_get_base_penalty_amount_multiplier_msat(const struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_ptr);
52743 * A multiplier used with the total amount flowing over a channel to calculate a fixed penalty
52744 * applied to each channel, in excess of the [`base_penalty_msat`].
52746 * The purpose of the amount penalty is to avoid having fees dominate the channel cost (i.e.,
52747 * fees plus penalty) for large payments. The penalty is computed as the product of this
52748 * multiplier and `2^30`ths of the total amount flowing over a channel (i.e. the payment
52749 * amount plus the amount of any other HTLCs flowing we sent over the same channel).
52751 * ie `base_penalty_amount_multiplier_msat * amount_msat / 2^30`
52753 * Default value: 8,192 msat
52755 * [`base_penalty_msat`]: Self::base_penalty_msat
52757 void ProbabilisticScoringFeeParameters_set_base_penalty_amount_multiplier_msat(struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_ptr, uint64_t val);
52760 * A multiplier used in conjunction with the negative `log10` of the channel's success
52761 * probability for a payment, as determined by our latest estimates of the channel's
52762 * liquidity, to determine the liquidity penalty.
52764 * The penalty is based in part on the knowledge learned from prior successful and unsuccessful
52765 * payments. This knowledge is decayed over time based on [`liquidity_offset_half_life`]. The
52766 * penalty is effectively limited to `2 * liquidity_penalty_multiplier_msat` (corresponding to
52767 * lower bounding the success probability to `0.01`) when the amount falls within the
52768 * uncertainty bounds of the channel liquidity balance. Amounts above the upper bound will
52769 * result in a `u64::max_value` penalty, however.
52771 * `-log10(success_probability) * liquidity_penalty_multiplier_msat`
52773 * Default value: 30,000 msat
52775 * [`liquidity_offset_half_life`]: ProbabilisticScoringDecayParameters::liquidity_offset_half_life
52777 uint64_t ProbabilisticScoringFeeParameters_get_liquidity_penalty_multiplier_msat(const struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_ptr);
52780 * A multiplier used in conjunction with the negative `log10` of the channel's success
52781 * probability for a payment, as determined by our latest estimates of the channel's
52782 * liquidity, to determine the liquidity penalty.
52784 * The penalty is based in part on the knowledge learned from prior successful and unsuccessful
52785 * payments. This knowledge is decayed over time based on [`liquidity_offset_half_life`]. The
52786 * penalty is effectively limited to `2 * liquidity_penalty_multiplier_msat` (corresponding to
52787 * lower bounding the success probability to `0.01`) when the amount falls within the
52788 * uncertainty bounds of the channel liquidity balance. Amounts above the upper bound will
52789 * result in a `u64::max_value` penalty, however.
52791 * `-log10(success_probability) * liquidity_penalty_multiplier_msat`
52793 * Default value: 30,000 msat
52795 * [`liquidity_offset_half_life`]: ProbabilisticScoringDecayParameters::liquidity_offset_half_life
52797 void ProbabilisticScoringFeeParameters_set_liquidity_penalty_multiplier_msat(struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_ptr, uint64_t val);
52800 * A multiplier used in conjunction with the total amount flowing over a channel and the
52801 * negative `log10` of the channel's success probability for the payment, as determined by our
52802 * latest estimates of the channel's liquidity, to determine the amount penalty.
52804 * The purpose of the amount penalty is to avoid having fees dominate the channel cost (i.e.,
52805 * fees plus penalty) for large payments. The penalty is computed as the product of this
52806 * multiplier and `2^20`ths of the amount flowing over this channel, weighted by the negative
52807 * `log10` of the success probability.
52809 * `-log10(success_probability) * liquidity_penalty_amount_multiplier_msat * amount_msat / 2^20`
52811 * In practice, this means for 0.1 success probability (`-log10(0.1) == 1`) each `2^20`th of
52812 * the amount will result in a penalty of the multiplier. And, as the success probability
52813 * decreases, the negative `log10` weighting will increase dramatically. For higher success
52814 * probabilities, the multiplier will have a decreasing effect as the negative `log10` will
52817 * Default value: 192 msat
52819 uint64_t ProbabilisticScoringFeeParameters_get_liquidity_penalty_amount_multiplier_msat(const struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_ptr);
52822 * A multiplier used in conjunction with the total amount flowing over a channel and the
52823 * negative `log10` of the channel's success probability for the payment, as determined by our
52824 * latest estimates of the channel's liquidity, to determine the amount penalty.
52826 * The purpose of the amount penalty is to avoid having fees dominate the channel cost (i.e.,
52827 * fees plus penalty) for large payments. The penalty is computed as the product of this
52828 * multiplier and `2^20`ths of the amount flowing over this channel, weighted by the negative
52829 * `log10` of the success probability.
52831 * `-log10(success_probability) * liquidity_penalty_amount_multiplier_msat * amount_msat / 2^20`
52833 * In practice, this means for 0.1 success probability (`-log10(0.1) == 1`) each `2^20`th of
52834 * the amount will result in a penalty of the multiplier. And, as the success probability
52835 * decreases, the negative `log10` weighting will increase dramatically. For higher success
52836 * probabilities, the multiplier will have a decreasing effect as the negative `log10` will
52839 * Default value: 192 msat
52841 void ProbabilisticScoringFeeParameters_set_liquidity_penalty_amount_multiplier_msat(struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_ptr, uint64_t val);
52844 * A multiplier used in conjunction with the negative `log10` of the channel's success
52845 * probability for the payment, as determined based on the history of our estimates of the
52846 * channel's available liquidity, to determine a penalty.
52848 * This penalty is similar to [`liquidity_penalty_multiplier_msat`], however, instead of using
52849 * only our latest estimate for the current liquidity available in the channel, it estimates
52850 * success probability based on the estimated liquidity available in the channel through
52851 * history. Specifically, every time we update our liquidity bounds on a given channel, we
52852 * track which of several buckets those bounds fall into, exponentially decaying the
52853 * probability of each bucket as new samples are added.
52855 * Default value: 10,000 msat
52857 * [`liquidity_penalty_multiplier_msat`]: Self::liquidity_penalty_multiplier_msat
52859 uint64_t ProbabilisticScoringFeeParameters_get_historical_liquidity_penalty_multiplier_msat(const struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_ptr);
52862 * A multiplier used in conjunction with the negative `log10` of the channel's success
52863 * probability for the payment, as determined based on the history of our estimates of the
52864 * channel's available liquidity, to determine a penalty.
52866 * This penalty is similar to [`liquidity_penalty_multiplier_msat`], however, instead of using
52867 * only our latest estimate for the current liquidity available in the channel, it estimates
52868 * success probability based on the estimated liquidity available in the channel through
52869 * history. Specifically, every time we update our liquidity bounds on a given channel, we
52870 * track which of several buckets those bounds fall into, exponentially decaying the
52871 * probability of each bucket as new samples are added.
52873 * Default value: 10,000 msat
52875 * [`liquidity_penalty_multiplier_msat`]: Self::liquidity_penalty_multiplier_msat
52877 void ProbabilisticScoringFeeParameters_set_historical_liquidity_penalty_multiplier_msat(struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_ptr, uint64_t val);
52880 * A multiplier used in conjunction with the total amount flowing over a channel and the
52881 * negative `log10` of the channel's success probability for the payment, as determined based
52882 * on the history of our estimates of the channel's available liquidity, to determine a
52885 * The purpose of the amount penalty is to avoid having fees dominate the channel cost for
52886 * large payments. The penalty is computed as the product of this multiplier and `2^20`ths
52887 * of the amount flowing over this channel, weighted by the negative `log10` of the success
52890 * This penalty is similar to [`liquidity_penalty_amount_multiplier_msat`], however, instead
52891 * of using only our latest estimate for the current liquidity available in the channel, it
52892 * estimates success probability based on the estimated liquidity available in the channel
52893 * through history. Specifically, every time we update our liquidity bounds on a given
52894 * channel, we track which of several buckets those bounds fall into, exponentially decaying
52895 * the probability of each bucket as new samples are added.
52897 * Default value: 64 msat
52899 * [`liquidity_penalty_amount_multiplier_msat`]: Self::liquidity_penalty_amount_multiplier_msat
52901 uint64_t ProbabilisticScoringFeeParameters_get_historical_liquidity_penalty_amount_multiplier_msat(const struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_ptr);
52904 * A multiplier used in conjunction with the total amount flowing over a channel and the
52905 * negative `log10` of the channel's success probability for the payment, as determined based
52906 * on the history of our estimates of the channel's available liquidity, to determine a
52909 * The purpose of the amount penalty is to avoid having fees dominate the channel cost for
52910 * large payments. The penalty is computed as the product of this multiplier and `2^20`ths
52911 * of the amount flowing over this channel, weighted by the negative `log10` of the success
52914 * This penalty is similar to [`liquidity_penalty_amount_multiplier_msat`], however, instead
52915 * of using only our latest estimate for the current liquidity available in the channel, it
52916 * estimates success probability based on the estimated liquidity available in the channel
52917 * through history. Specifically, every time we update our liquidity bounds on a given
52918 * channel, we track which of several buckets those bounds fall into, exponentially decaying
52919 * the probability of each bucket as new samples are added.
52921 * Default value: 64 msat
52923 * [`liquidity_penalty_amount_multiplier_msat`]: Self::liquidity_penalty_amount_multiplier_msat
52925 void ProbabilisticScoringFeeParameters_set_historical_liquidity_penalty_amount_multiplier_msat(struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_ptr, uint64_t val);
52928 * This penalty is applied when `htlc_maximum_msat` is equal to or larger than half of the
52929 * channel's capacity, (ie. htlc_maximum_msat >= 0.5 * channel_capacity) which makes us
52930 * prefer nodes with a smaller `htlc_maximum_msat`. We treat such nodes preferentially
52931 * as this makes balance discovery attacks harder to execute, thereby creating an incentive
52932 * to restrict `htlc_maximum_msat` and improve privacy.
52934 * Default value: 250 msat
52936 uint64_t ProbabilisticScoringFeeParameters_get_anti_probing_penalty_msat(const struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_ptr);
52939 * This penalty is applied when `htlc_maximum_msat` is equal to or larger than half of the
52940 * channel's capacity, (ie. htlc_maximum_msat >= 0.5 * channel_capacity) which makes us
52941 * prefer nodes with a smaller `htlc_maximum_msat`. We treat such nodes preferentially
52942 * as this makes balance discovery attacks harder to execute, thereby creating an incentive
52943 * to restrict `htlc_maximum_msat` and improve privacy.
52945 * Default value: 250 msat
52947 void ProbabilisticScoringFeeParameters_set_anti_probing_penalty_msat(struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_ptr, uint64_t val);
52950 * This penalty is applied when the total amount flowing over a channel exceeds our current
52951 * estimate of the channel's available liquidity. The total amount is the amount of the
52952 * current HTLC plus any HTLCs which we've sent over the same channel.
52954 * Note that in this case all other penalties, including the
52955 * [`liquidity_penalty_multiplier_msat`] and [`liquidity_penalty_amount_multiplier_msat`]-based
52956 * penalties, as well as the [`base_penalty_msat`] and the [`anti_probing_penalty_msat`], if
52957 * applicable, are still included in the overall penalty.
52959 * If you wish to avoid creating paths with such channels entirely, setting this to a value of
52960 * `u64::max_value()` will guarantee that.
52962 * Default value: 1_0000_0000_000 msat (1 Bitcoin)
52964 * [`liquidity_penalty_multiplier_msat`]: Self::liquidity_penalty_multiplier_msat
52965 * [`liquidity_penalty_amount_multiplier_msat`]: Self::liquidity_penalty_amount_multiplier_msat
52966 * [`base_penalty_msat`]: Self::base_penalty_msat
52967 * [`anti_probing_penalty_msat`]: Self::anti_probing_penalty_msat
52969 uint64_t ProbabilisticScoringFeeParameters_get_considered_impossible_penalty_msat(const struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_ptr);
52972 * This penalty is applied when the total amount flowing over a channel exceeds our current
52973 * estimate of the channel's available liquidity. The total amount is the amount of the
52974 * current HTLC plus any HTLCs which we've sent over the same channel.
52976 * Note that in this case all other penalties, including the
52977 * [`liquidity_penalty_multiplier_msat`] and [`liquidity_penalty_amount_multiplier_msat`]-based
52978 * penalties, as well as the [`base_penalty_msat`] and the [`anti_probing_penalty_msat`], if
52979 * applicable, are still included in the overall penalty.
52981 * If you wish to avoid creating paths with such channels entirely, setting this to a value of
52982 * `u64::max_value()` will guarantee that.
52984 * Default value: 1_0000_0000_000 msat (1 Bitcoin)
52986 * [`liquidity_penalty_multiplier_msat`]: Self::liquidity_penalty_multiplier_msat
52987 * [`liquidity_penalty_amount_multiplier_msat`]: Self::liquidity_penalty_amount_multiplier_msat
52988 * [`base_penalty_msat`]: Self::base_penalty_msat
52989 * [`anti_probing_penalty_msat`]: Self::anti_probing_penalty_msat
52991 void ProbabilisticScoringFeeParameters_set_considered_impossible_penalty_msat(struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_ptr, uint64_t val);
52994 * In order to calculate most of the scores above, we must first convert a lower and upper
52995 * bound on the available liquidity in a channel into the probability that we think a payment
52996 * will succeed. That probability is derived from a Probability Density Function for where we
52997 * think the liquidity in a channel likely lies, given such bounds.
52999 * If this flag is set, that PDF is simply a constant - we assume that the actual available
53000 * liquidity in a channel is just as likely to be at any point between our lower and upper
53003 * If this flag is *not* set, that PDF is `(x - 0.5*capacity) ^ 2`. That is, we use an
53004 * exponential curve which expects the liquidity of a channel to lie \"at the edges\". This
53005 * matches experimental results - most routing nodes do not aggressively rebalance their
53006 * channels and flows in the network are often unbalanced, leaving liquidity usually
53009 * Thus, for the \"best\" routes, leave this flag `false`. However, the flag does imply a number
53010 * of floating-point multiplications in the hottest routing code, which may lead to routing
53011 * performance degradation on some machines.
53013 * Default value: false
53015 bool ProbabilisticScoringFeeParameters_get_linear_success_probability(const struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_ptr);
53018 * In order to calculate most of the scores above, we must first convert a lower and upper
53019 * bound on the available liquidity in a channel into the probability that we think a payment
53020 * will succeed. That probability is derived from a Probability Density Function for where we
53021 * think the liquidity in a channel likely lies, given such bounds.
53023 * If this flag is set, that PDF is simply a constant - we assume that the actual available
53024 * liquidity in a channel is just as likely to be at any point between our lower and upper
53027 * If this flag is *not* set, that PDF is `(x - 0.5*capacity) ^ 2`. That is, we use an
53028 * exponential curve which expects the liquidity of a channel to lie \"at the edges\". This
53029 * matches experimental results - most routing nodes do not aggressively rebalance their
53030 * channels and flows in the network are often unbalanced, leaving liquidity usually
53033 * Thus, for the \"best\" routes, leave this flag `false`. However, the flag does imply a number
53034 * of floating-point multiplications in the hottest routing code, which may lead to routing
53035 * performance degradation on some machines.
53037 * Default value: false
53039 void ProbabilisticScoringFeeParameters_set_linear_success_probability(struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_ptr, bool val);
53042 * Creates a copy of the ProbabilisticScoringFeeParameters
53044 struct LDKProbabilisticScoringFeeParameters ProbabilisticScoringFeeParameters_clone(const struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR orig);
53047 * Creates a "default" ProbabilisticScoringFeeParameters. See struct and individual field documentaiton for details on which values are used.
53049 MUST_USE_RES struct LDKProbabilisticScoringFeeParameters ProbabilisticScoringFeeParameters_default(void);
53052 * Marks the node with the given `node_id` as banned,
53053 * i.e it will be avoided during path finding.
53055 void ProbabilisticScoringFeeParameters_add_banned(struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_arg, const struct LDKNodeId *NONNULL_PTR node_id);
53058 * Marks all nodes in the given list as banned, i.e.,
53059 * they will be avoided during path finding.
53061 void ProbabilisticScoringFeeParameters_add_banned_from_list(struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_arg, struct LDKCVec_NodeIdZ node_ids);
53064 * Removes the node with the given `node_id` from the list of nodes to avoid.
53066 void ProbabilisticScoringFeeParameters_remove_banned(struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_arg, const struct LDKNodeId *NONNULL_PTR node_id);
53069 * Sets a manual penalty for the given node.
53071 void ProbabilisticScoringFeeParameters_set_manual_penalty(struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_arg, const struct LDKNodeId *NONNULL_PTR node_id, uint64_t penalty);
53074 * Removes the node with the given `node_id` from the list of manual penalties.
53076 void ProbabilisticScoringFeeParameters_remove_manual_penalty(struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_arg, const struct LDKNodeId *NONNULL_PTR node_id);
53079 * Clears the list of manual penalties that are applied during path finding.
53081 void ProbabilisticScoringFeeParameters_clear_manual_penalties(struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_arg);
53084 * Frees any resources used by the ProbabilisticScoringDecayParameters, if is_owned is set and inner is non-NULL.
53086 void ProbabilisticScoringDecayParameters_free(struct LDKProbabilisticScoringDecayParameters this_obj);
53089 * If we aren't learning any new datapoints for a channel, the historical liquidity bounds
53090 * tracking can simply live on with increasingly stale data. Instead, when a channel has not
53091 * seen a liquidity estimate update for this amount of time, the historical datapoints are
53093 * For an example of historical_no_updates_half_life being used see [`historical_estimated_channel_liquidity_probabilities`]
53095 * Note that after 16 or more half lives all historical data will be completely gone.
53097 * Default value: 14 days
53099 * [`historical_estimated_channel_liquidity_probabilities`]: ProbabilisticScorer::historical_estimated_channel_liquidity_probabilities
53101 uint64_t ProbabilisticScoringDecayParameters_get_historical_no_updates_half_life(const struct LDKProbabilisticScoringDecayParameters *NONNULL_PTR this_ptr);
53104 * If we aren't learning any new datapoints for a channel, the historical liquidity bounds
53105 * tracking can simply live on with increasingly stale data. Instead, when a channel has not
53106 * seen a liquidity estimate update for this amount of time, the historical datapoints are
53108 * For an example of historical_no_updates_half_life being used see [`historical_estimated_channel_liquidity_probabilities`]
53110 * Note that after 16 or more half lives all historical data will be completely gone.
53112 * Default value: 14 days
53114 * [`historical_estimated_channel_liquidity_probabilities`]: ProbabilisticScorer::historical_estimated_channel_liquidity_probabilities
53116 void ProbabilisticScoringDecayParameters_set_historical_no_updates_half_life(struct LDKProbabilisticScoringDecayParameters *NONNULL_PTR this_ptr, uint64_t val);
53119 * Whenever this amount of time elapses since the last update to a channel's liquidity bounds,
53120 * the distance from the bounds to \"zero\" is cut in half. In other words, the lower-bound on
53121 * the available liquidity is halved and the upper-bound moves half-way to the channel's total
53124 * Because halving the liquidity bounds grows the uncertainty on the channel's liquidity,
53125 * the penalty for an amount within the new bounds may change. See the [`ProbabilisticScorer`]
53126 * struct documentation for more info on the way the liquidity bounds are used.
53128 * For example, if the channel's capacity is 1 million sats, and the current upper and lower
53129 * liquidity bounds are 200,000 sats and 600,000 sats, after this amount of time the upper
53130 * and lower liquidity bounds will be decayed to 100,000 and 800,000 sats.
53132 * Default value: 6 hours
53136 * When built with the `no-std` feature, time will never elapse. Therefore, the channel
53137 * liquidity knowledge will never decay except when the bounds cross.
53139 uint64_t ProbabilisticScoringDecayParameters_get_liquidity_offset_half_life(const struct LDKProbabilisticScoringDecayParameters *NONNULL_PTR this_ptr);
53142 * Whenever this amount of time elapses since the last update to a channel's liquidity bounds,
53143 * the distance from the bounds to \"zero\" is cut in half. In other words, the lower-bound on
53144 * the available liquidity is halved and the upper-bound moves half-way to the channel's total
53147 * Because halving the liquidity bounds grows the uncertainty on the channel's liquidity,
53148 * the penalty for an amount within the new bounds may change. See the [`ProbabilisticScorer`]
53149 * struct documentation for more info on the way the liquidity bounds are used.
53151 * For example, if the channel's capacity is 1 million sats, and the current upper and lower
53152 * liquidity bounds are 200,000 sats and 600,000 sats, after this amount of time the upper
53153 * and lower liquidity bounds will be decayed to 100,000 and 800,000 sats.
53155 * Default value: 6 hours
53159 * When built with the `no-std` feature, time will never elapse. Therefore, the channel
53160 * liquidity knowledge will never decay except when the bounds cross.
53162 void ProbabilisticScoringDecayParameters_set_liquidity_offset_half_life(struct LDKProbabilisticScoringDecayParameters *NONNULL_PTR this_ptr, uint64_t val);
53165 * Constructs a new ProbabilisticScoringDecayParameters given each field
53167 MUST_USE_RES struct LDKProbabilisticScoringDecayParameters ProbabilisticScoringDecayParameters_new(uint64_t historical_no_updates_half_life_arg, uint64_t liquidity_offset_half_life_arg);
53170 * Creates a copy of the ProbabilisticScoringDecayParameters
53172 struct LDKProbabilisticScoringDecayParameters ProbabilisticScoringDecayParameters_clone(const struct LDKProbabilisticScoringDecayParameters *NONNULL_PTR orig);
53175 * Creates a "default" ProbabilisticScoringDecayParameters. See struct and individual field documentaiton for details on which values are used.
53177 MUST_USE_RES struct LDKProbabilisticScoringDecayParameters ProbabilisticScoringDecayParameters_default(void);
53180 * Creates a new scorer using the given scoring parameters for sending payments from a node
53181 * through a network graph.
53183 MUST_USE_RES struct LDKProbabilisticScorer ProbabilisticScorer_new(struct LDKProbabilisticScoringDecayParameters decay_params, const struct LDKNetworkGraph *NONNULL_PTR network_graph, struct LDKLogger logger);
53186 * Dump the contents of this scorer into the configured logger.
53188 * Note that this writes roughly one line per channel for which we have a liquidity estimate,
53189 * which may be a substantial amount of log output.
53191 void ProbabilisticScorer_debug_log_liquidity_stats(const struct LDKProbabilisticScorer *NONNULL_PTR this_arg);
53194 * Query the estimated minimum and maximum liquidity available for sending a payment over the
53195 * channel with `scid` towards the given `target` node.
53197 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);
53200 * Query the historical estimated minimum and maximum liquidity available for sending a
53201 * payment over the channel with `scid` towards the given `target` node.
53203 * Returns two sets of 32 buckets. The first set describes the lower-bound liquidity history,
53204 * the second set describes the upper-bound liquidity history. Each bucket describes the
53205 * relative frequency at which we've seen a liquidity bound in the bucket's range relative to
53206 * the channel's total capacity, on an arbitrary scale. Because the values are slowly decayed,
53207 * more recent data points are weighted more heavily than older datapoints.
53209 * Note that the range of each bucket varies by its location to provide more granular results
53210 * at the edges of a channel's capacity, where it is more likely to sit.
53212 * When scoring, the estimated probability that an upper-/lower-bound lies in a given bucket
53213 * is calculated by dividing that bucket's value with the total value of all buckets.
53215 * For example, using a lower bucket count for illustrative purposes, a value of
53216 * `[0, 0, 0, ..., 0, 32]` indicates that we believe the probability of a bound being very
53217 * close to the channel's capacity to be 100%, and have never (recently) seen it in any other
53218 * bucket. A value of `[31, 0, 0, ..., 0, 0, 32]` indicates we've seen the bound being both
53219 * in the top and bottom bucket, and roughly with similar (recent) frequency.
53221 * Because the datapoints are decayed slowly over time, values will eventually return to
53222 * `Some(([0; 32], [0; 32]))` or `None` if no data remains for a channel.
53224 * In order to fetch a single success probability from the buckets provided here, as used in
53225 * the scoring model, see [`Self::historical_estimated_payment_success_probability`].
53227 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);
53230 * Query the probability of payment success sending the given `amount_msat` over the channel
53231 * with `scid` towards the given `target` node, based on the historical estimated liquidity
53234 * These are the same bounds as returned by
53235 * [`Self::historical_estimated_channel_liquidity_probabilities`] (but not those returned by
53236 * [`Self::estimated_channel_liquidity_range`]).
53238 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);
53241 * Constructs a new ScoreLookUp which calls the relevant methods on this_arg.
53242 * This copies the `inner` pointer in this_arg and thus the returned ScoreLookUp must be freed before this_arg is
53244 struct LDKScoreLookUp ProbabilisticScorer_as_ScoreLookUp(const struct LDKProbabilisticScorer *NONNULL_PTR this_arg);
53247 * Constructs a new ScoreUpdate which calls the relevant methods on this_arg.
53248 * This copies the `inner` pointer in this_arg and thus the returned ScoreUpdate must be freed before this_arg is
53250 struct LDKScoreUpdate ProbabilisticScorer_as_ScoreUpdate(const struct LDKProbabilisticScorer *NONNULL_PTR this_arg);
53253 * Constructs a new Score which calls the relevant methods on this_arg.
53254 * This copies the `inner` pointer in this_arg and thus the returned Score must be freed before this_arg is
53256 struct LDKScore ProbabilisticScorer_as_Score(const struct LDKProbabilisticScorer *NONNULL_PTR this_arg);
53259 * Serialize the ProbabilisticScorer object into a byte array which can be read by ProbabilisticScorer_read
53261 struct LDKCVec_u8Z ProbabilisticScorer_write(const struct LDKProbabilisticScorer *NONNULL_PTR obj);
53264 * Read a ProbabilisticScorer from a byte array, created by ProbabilisticScorer_write
53266 struct LDKCResult_ProbabilisticScorerDecodeErrorZ ProbabilisticScorer_read(struct LDKu8slice ser, struct LDKProbabilisticScoringDecayParameters arg_a, const struct LDKNetworkGraph *NONNULL_PTR arg_b, struct LDKLogger arg_c);
53269 * Frees any resources used by the DelayedPaymentOutputDescriptor, if is_owned is set and inner is non-NULL.
53271 void DelayedPaymentOutputDescriptor_free(struct LDKDelayedPaymentOutputDescriptor this_obj);
53274 * The outpoint which is spendable.
53276 struct LDKOutPoint DelayedPaymentOutputDescriptor_get_outpoint(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr);
53279 * The outpoint which is spendable.
53281 void DelayedPaymentOutputDescriptor_set_outpoint(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKOutPoint val);
53284 * Per commitment point to derive the delayed payment key by key holder.
53286 struct LDKPublicKey DelayedPaymentOutputDescriptor_get_per_commitment_point(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr);
53289 * Per commitment point to derive the delayed payment key by key holder.
53291 void DelayedPaymentOutputDescriptor_set_per_commitment_point(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKPublicKey val);
53294 * The `nSequence` value which must be set in the spending input to satisfy the `OP_CSV` in
53295 * the witness_script.
53297 uint16_t DelayedPaymentOutputDescriptor_get_to_self_delay(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr);
53300 * The `nSequence` value which must be set in the spending input to satisfy the `OP_CSV` in
53301 * the witness_script.
53303 void DelayedPaymentOutputDescriptor_set_to_self_delay(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, uint16_t val);
53306 * The output which is referenced by the given outpoint.
53308 struct LDKTxOut DelayedPaymentOutputDescriptor_get_output(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr);
53311 * The output which is referenced by the given outpoint.
53313 void DelayedPaymentOutputDescriptor_set_output(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKTxOut val);
53316 * The revocation point specific to the commitment transaction which was broadcast. Used to
53317 * derive the witnessScript for this output.
53319 struct LDKRevocationKey DelayedPaymentOutputDescriptor_get_revocation_pubkey(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr);
53322 * The revocation point specific to the commitment transaction which was broadcast. Used to
53323 * derive the witnessScript for this output.
53325 void DelayedPaymentOutputDescriptor_set_revocation_pubkey(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKRevocationKey val);
53328 * Arbitrary identification information returned by a call to [`ChannelSigner::channel_keys_id`].
53329 * This may be useful in re-deriving keys used in the channel to spend the output.
53331 const uint8_t (*DelayedPaymentOutputDescriptor_get_channel_keys_id(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr))[32];
53334 * Arbitrary identification information returned by a call to [`ChannelSigner::channel_keys_id`].
53335 * This may be useful in re-deriving keys used in the channel to spend the output.
53337 void DelayedPaymentOutputDescriptor_set_channel_keys_id(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
53340 * The value of the channel which this output originated from, possibly indirectly.
53342 uint64_t DelayedPaymentOutputDescriptor_get_channel_value_satoshis(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr);
53345 * The value of the channel which this output originated from, possibly indirectly.
53347 void DelayedPaymentOutputDescriptor_set_channel_value_satoshis(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, uint64_t val);
53350 * The channel public keys and other parameters needed to generate a spending transaction or
53351 * to provide to a re-derived signer through [`ChannelSigner::provide_channel_parameters`].
53353 * Added as optional, but always `Some` if the descriptor was produced in v0.0.123 or later.
53355 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
53357 struct LDKChannelTransactionParameters DelayedPaymentOutputDescriptor_get_channel_transaction_parameters(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr);
53360 * The channel public keys and other parameters needed to generate a spending transaction or
53361 * to provide to a re-derived signer through [`ChannelSigner::provide_channel_parameters`].
53363 * Added as optional, but always `Some` if the descriptor was produced in v0.0.123 or later.
53365 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
53367 void DelayedPaymentOutputDescriptor_set_channel_transaction_parameters(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKChannelTransactionParameters val);
53370 * Constructs a new DelayedPaymentOutputDescriptor given each field
53372 * Note that channel_transaction_parameters_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
53374 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);
53377 * Creates a copy of the DelayedPaymentOutputDescriptor
53379 struct LDKDelayedPaymentOutputDescriptor DelayedPaymentOutputDescriptor_clone(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR orig);
53382 * Generates a non-cryptographic 64-bit hash of the DelayedPaymentOutputDescriptor.
53384 uint64_t DelayedPaymentOutputDescriptor_hash(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR o);
53387 * Checks if two DelayedPaymentOutputDescriptors contain equal inner contents.
53388 * This ignores pointers and is_owned flags and looks at the values in fields.
53389 * Two objects with NULL inner values will be considered "equal" here.
53391 bool DelayedPaymentOutputDescriptor_eq(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR a, const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR b);
53394 * Serialize the DelayedPaymentOutputDescriptor object into a byte array which can be read by DelayedPaymentOutputDescriptor_read
53396 struct LDKCVec_u8Z DelayedPaymentOutputDescriptor_write(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR obj);
53399 * Read a DelayedPaymentOutputDescriptor from a byte array, created by DelayedPaymentOutputDescriptor_write
53401 struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ DelayedPaymentOutputDescriptor_read(struct LDKu8slice ser);
53404 * Frees any resources used by the StaticPaymentOutputDescriptor, if is_owned is set and inner is non-NULL.
53406 void StaticPaymentOutputDescriptor_free(struct LDKStaticPaymentOutputDescriptor this_obj);
53409 * The outpoint which is spendable.
53411 struct LDKOutPoint StaticPaymentOutputDescriptor_get_outpoint(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr);
53414 * The outpoint which is spendable.
53416 void StaticPaymentOutputDescriptor_set_outpoint(struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKOutPoint val);
53419 * The output which is referenced by the given outpoint.
53421 struct LDKTxOut StaticPaymentOutputDescriptor_get_output(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr);
53424 * The output which is referenced by the given outpoint.
53426 void StaticPaymentOutputDescriptor_set_output(struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKTxOut val);
53429 * Arbitrary identification information returned by a call to [`ChannelSigner::channel_keys_id`].
53430 * This may be useful in re-deriving keys used in the channel to spend the output.
53432 const uint8_t (*StaticPaymentOutputDescriptor_get_channel_keys_id(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr))[32];
53435 * Arbitrary identification information returned by a call to [`ChannelSigner::channel_keys_id`].
53436 * This may be useful in re-deriving keys used in the channel to spend the output.
53438 void StaticPaymentOutputDescriptor_set_channel_keys_id(struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
53441 * The value of the channel which this transactions spends.
53443 uint64_t StaticPaymentOutputDescriptor_get_channel_value_satoshis(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr);
53446 * The value of the channel which this transactions spends.
53448 void StaticPaymentOutputDescriptor_set_channel_value_satoshis(struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr, uint64_t val);
53451 * The necessary channel parameters that need to be provided to the re-derived signer through
53452 * [`ChannelSigner::provide_channel_parameters`].
53454 * Added as optional, but always `Some` if the descriptor was produced in v0.0.117 or later.
53456 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
53458 struct LDKChannelTransactionParameters StaticPaymentOutputDescriptor_get_channel_transaction_parameters(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr);
53461 * The necessary channel parameters that need to be provided to the re-derived signer through
53462 * [`ChannelSigner::provide_channel_parameters`].
53464 * Added as optional, but always `Some` if the descriptor was produced in v0.0.117 or later.
53466 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
53468 void StaticPaymentOutputDescriptor_set_channel_transaction_parameters(struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKChannelTransactionParameters val);
53471 * Constructs a new StaticPaymentOutputDescriptor given each field
53473 * Note that channel_transaction_parameters_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
53475 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);
53478 * Creates a copy of the StaticPaymentOutputDescriptor
53480 struct LDKStaticPaymentOutputDescriptor StaticPaymentOutputDescriptor_clone(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR orig);
53483 * Generates a non-cryptographic 64-bit hash of the StaticPaymentOutputDescriptor.
53485 uint64_t StaticPaymentOutputDescriptor_hash(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR o);
53488 * Checks if two StaticPaymentOutputDescriptors contain equal inner contents.
53489 * This ignores pointers and is_owned flags and looks at the values in fields.
53490 * Two objects with NULL inner values will be considered "equal" here.
53492 bool StaticPaymentOutputDescriptor_eq(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR a, const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR b);
53495 * Returns the `witness_script` of the spendable output.
53497 * Note that this will only return `Some` for [`StaticPaymentOutputDescriptor`]s that
53498 * originated from an anchor outputs channel, as they take the form of a P2WSH script.
53500 MUST_USE_RES struct LDKCOption_CVec_u8ZZ StaticPaymentOutputDescriptor_witness_script(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_arg);
53503 * The maximum length a well-formed witness spending one of these should have.
53504 * Note: If you have the grind_signatures feature enabled, this will be at least 1 byte
53507 MUST_USE_RES uint64_t StaticPaymentOutputDescriptor_max_witness_length(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_arg);
53510 * Serialize the StaticPaymentOutputDescriptor object into a byte array which can be read by StaticPaymentOutputDescriptor_read
53512 struct LDKCVec_u8Z StaticPaymentOutputDescriptor_write(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR obj);
53515 * Read a StaticPaymentOutputDescriptor from a byte array, created by StaticPaymentOutputDescriptor_write
53517 struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ StaticPaymentOutputDescriptor_read(struct LDKu8slice ser);
53520 * Frees any resources used by the SpendableOutputDescriptor
53522 void SpendableOutputDescriptor_free(struct LDKSpendableOutputDescriptor this_ptr);
53525 * Creates a copy of the SpendableOutputDescriptor
53527 struct LDKSpendableOutputDescriptor SpendableOutputDescriptor_clone(const struct LDKSpendableOutputDescriptor *NONNULL_PTR orig);
53530 * Utility method to constructs a new StaticOutput-variant SpendableOutputDescriptor
53532 struct LDKSpendableOutputDescriptor SpendableOutputDescriptor_static_output(struct LDKOutPoint outpoint, struct LDKTxOut output, struct LDKThirtyTwoBytes channel_keys_id);
53535 * Utility method to constructs a new DelayedPaymentOutput-variant SpendableOutputDescriptor
53537 struct LDKSpendableOutputDescriptor SpendableOutputDescriptor_delayed_payment_output(struct LDKDelayedPaymentOutputDescriptor a);
53540 * Utility method to constructs a new StaticPaymentOutput-variant SpendableOutputDescriptor
53542 struct LDKSpendableOutputDescriptor SpendableOutputDescriptor_static_payment_output(struct LDKStaticPaymentOutputDescriptor a);
53545 * Generates a non-cryptographic 64-bit hash of the SpendableOutputDescriptor.
53547 uint64_t SpendableOutputDescriptor_hash(const struct LDKSpendableOutputDescriptor *NONNULL_PTR o);
53550 * Checks if two SpendableOutputDescriptors contain equal inner contents.
53551 * This ignores pointers and is_owned flags and looks at the values in fields.
53553 bool SpendableOutputDescriptor_eq(const struct LDKSpendableOutputDescriptor *NONNULL_PTR a, const struct LDKSpendableOutputDescriptor *NONNULL_PTR b);
53556 * Serialize the SpendableOutputDescriptor object into a byte array which can be read by SpendableOutputDescriptor_read
53558 struct LDKCVec_u8Z SpendableOutputDescriptor_write(const struct LDKSpendableOutputDescriptor *NONNULL_PTR obj);
53561 * Read a SpendableOutputDescriptor from a byte array, created by SpendableOutputDescriptor_write
53563 struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ SpendableOutputDescriptor_read(struct LDKu8slice ser);
53566 * Creates an unsigned [`PartiallySignedTransaction`] which spends the given descriptors to
53567 * the given outputs, plus an output to the given change destination (if sufficient
53568 * change value remains). The PSBT will have a feerate, at least, of the given value.
53570 * The `locktime` argument is used to set the transaction's locktime. If `None`, the
53571 * transaction will have a locktime of 0. It it recommended to set this to the current block
53572 * height to avoid fee sniping, unless you have some specific reason to use a different
53575 * Returns the PSBT and expected max transaction weight.
53577 * Returns `Err(())` if the output value is greater than the input value minus required fee,
53578 * if a descriptor was duplicated, or if an output descriptor `script_pubkey`
53579 * does not match the one we can spend.
53581 * We do not enforce that outputs meet the dust limit or that any output scripts are standard.
53583 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);
53586 * Frees any resources used by the ChannelDerivationParameters, if is_owned is set and inner is non-NULL.
53588 void ChannelDerivationParameters_free(struct LDKChannelDerivationParameters this_obj);
53591 * The value in satoshis of the channel we're attempting to spend the anchor output of.
53593 uint64_t ChannelDerivationParameters_get_value_satoshis(const struct LDKChannelDerivationParameters *NONNULL_PTR this_ptr);
53596 * The value in satoshis of the channel we're attempting to spend the anchor output of.
53598 void ChannelDerivationParameters_set_value_satoshis(struct LDKChannelDerivationParameters *NONNULL_PTR this_ptr, uint64_t val);
53601 * The unique identifier to re-derive the signer for the associated channel.
53603 const uint8_t (*ChannelDerivationParameters_get_keys_id(const struct LDKChannelDerivationParameters *NONNULL_PTR this_ptr))[32];
53606 * The unique identifier to re-derive the signer for the associated channel.
53608 void ChannelDerivationParameters_set_keys_id(struct LDKChannelDerivationParameters *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
53611 * The necessary channel parameters that need to be provided to the re-derived signer through
53612 * [`ChannelSigner::provide_channel_parameters`].
53614 struct LDKChannelTransactionParameters ChannelDerivationParameters_get_transaction_parameters(const struct LDKChannelDerivationParameters *NONNULL_PTR this_ptr);
53617 * The necessary channel parameters that need to be provided to the re-derived signer through
53618 * [`ChannelSigner::provide_channel_parameters`].
53620 void ChannelDerivationParameters_set_transaction_parameters(struct LDKChannelDerivationParameters *NONNULL_PTR this_ptr, struct LDKChannelTransactionParameters val);
53623 * Constructs a new ChannelDerivationParameters given each field
53625 MUST_USE_RES struct LDKChannelDerivationParameters ChannelDerivationParameters_new(uint64_t value_satoshis_arg, struct LDKThirtyTwoBytes keys_id_arg, struct LDKChannelTransactionParameters transaction_parameters_arg);
53628 * Creates a copy of the ChannelDerivationParameters
53630 struct LDKChannelDerivationParameters ChannelDerivationParameters_clone(const struct LDKChannelDerivationParameters *NONNULL_PTR orig);
53633 * Checks if two ChannelDerivationParameterss contain equal inner contents.
53634 * This ignores pointers and is_owned flags and looks at the values in fields.
53635 * Two objects with NULL inner values will be considered "equal" here.
53637 bool ChannelDerivationParameters_eq(const struct LDKChannelDerivationParameters *NONNULL_PTR a, const struct LDKChannelDerivationParameters *NONNULL_PTR b);
53640 * Serialize the ChannelDerivationParameters object into a byte array which can be read by ChannelDerivationParameters_read
53642 struct LDKCVec_u8Z ChannelDerivationParameters_write(const struct LDKChannelDerivationParameters *NONNULL_PTR obj);
53645 * Read a ChannelDerivationParameters from a byte array, created by ChannelDerivationParameters_write
53647 struct LDKCResult_ChannelDerivationParametersDecodeErrorZ ChannelDerivationParameters_read(struct LDKu8slice ser);
53650 * Frees any resources used by the HTLCDescriptor, if is_owned is set and inner is non-NULL.
53652 void HTLCDescriptor_free(struct LDKHTLCDescriptor this_obj);
53655 * The parameters required to derive the signer for the HTLC input.
53657 struct LDKChannelDerivationParameters HTLCDescriptor_get_channel_derivation_parameters(const struct LDKHTLCDescriptor *NONNULL_PTR this_ptr);
53660 * The parameters required to derive the signer for the HTLC input.
53662 void HTLCDescriptor_set_channel_derivation_parameters(struct LDKHTLCDescriptor *NONNULL_PTR this_ptr, struct LDKChannelDerivationParameters val);
53665 * The txid of the commitment transaction in which the HTLC output lives.
53667 const uint8_t (*HTLCDescriptor_get_commitment_txid(const struct LDKHTLCDescriptor *NONNULL_PTR this_ptr))[32];
53670 * The txid of the commitment transaction in which the HTLC output lives.
53672 void HTLCDescriptor_set_commitment_txid(struct LDKHTLCDescriptor *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
53675 * The number of the commitment transaction in which the HTLC output lives.
53677 uint64_t HTLCDescriptor_get_per_commitment_number(const struct LDKHTLCDescriptor *NONNULL_PTR this_ptr);
53680 * The number of the commitment transaction in which the HTLC output lives.
53682 void HTLCDescriptor_set_per_commitment_number(struct LDKHTLCDescriptor *NONNULL_PTR this_ptr, uint64_t val);
53685 * The key tweak corresponding to the number of the commitment transaction in which the HTLC
53686 * output lives. This tweak is applied to all the basepoints for both parties in the channel to
53687 * arrive at unique keys per commitment.
53689 * See <https://github.com/lightning/bolts/blob/master/03-transactions.md#keys> for more info.
53691 struct LDKPublicKey HTLCDescriptor_get_per_commitment_point(const struct LDKHTLCDescriptor *NONNULL_PTR this_ptr);
53694 * The key tweak corresponding to the number of the commitment transaction in which the HTLC
53695 * output lives. This tweak is applied to all the basepoints for both parties in the channel to
53696 * arrive at unique keys per commitment.
53698 * See <https://github.com/lightning/bolts/blob/master/03-transactions.md#keys> for more info.
53700 void HTLCDescriptor_set_per_commitment_point(struct LDKHTLCDescriptor *NONNULL_PTR this_ptr, struct LDKPublicKey val);
53703 * The feerate to use on the HTLC claiming transaction. This is always `0` for HTLCs
53704 * originating from a channel supporting anchor outputs, otherwise it is the channel's
53705 * negotiated feerate at the time the commitment transaction was built.
53707 uint32_t HTLCDescriptor_get_feerate_per_kw(const struct LDKHTLCDescriptor *NONNULL_PTR this_ptr);
53710 * The feerate to use on the HTLC claiming transaction. This is always `0` for HTLCs
53711 * originating from a channel supporting anchor outputs, otherwise it is the channel's
53712 * negotiated feerate at the time the commitment transaction was built.
53714 void HTLCDescriptor_set_feerate_per_kw(struct LDKHTLCDescriptor *NONNULL_PTR this_ptr, uint32_t val);
53717 * The details of the HTLC as it appears in the commitment transaction.
53719 struct LDKHTLCOutputInCommitment HTLCDescriptor_get_htlc(const struct LDKHTLCDescriptor *NONNULL_PTR this_ptr);
53722 * The details of the HTLC as it appears in the commitment transaction.
53724 void HTLCDescriptor_set_htlc(struct LDKHTLCDescriptor *NONNULL_PTR this_ptr, struct LDKHTLCOutputInCommitment val);
53727 * The preimage, if `Some`, to claim the HTLC output with. If `None`, the timeout path must be
53730 struct LDKCOption_ThirtyTwoBytesZ HTLCDescriptor_get_preimage(const struct LDKHTLCDescriptor *NONNULL_PTR this_ptr);
53733 * The preimage, if `Some`, to claim the HTLC output with. If `None`, the timeout path must be
53736 void HTLCDescriptor_set_preimage(struct LDKHTLCDescriptor *NONNULL_PTR this_ptr, struct LDKCOption_ThirtyTwoBytesZ val);
53739 * The counterparty's signature required to spend the HTLC output.
53741 struct LDKECDSASignature HTLCDescriptor_get_counterparty_sig(const struct LDKHTLCDescriptor *NONNULL_PTR this_ptr);
53744 * The counterparty's signature required to spend the HTLC output.
53746 void HTLCDescriptor_set_counterparty_sig(struct LDKHTLCDescriptor *NONNULL_PTR this_ptr, struct LDKECDSASignature val);
53749 * Constructs a new HTLCDescriptor given each field
53751 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);
53754 * Creates a copy of the HTLCDescriptor
53756 struct LDKHTLCDescriptor HTLCDescriptor_clone(const struct LDKHTLCDescriptor *NONNULL_PTR orig);
53759 * Checks if two HTLCDescriptors contain equal inner contents.
53760 * This ignores pointers and is_owned flags and looks at the values in fields.
53761 * Two objects with NULL inner values will be considered "equal" here.
53763 bool HTLCDescriptor_eq(const struct LDKHTLCDescriptor *NONNULL_PTR a, const struct LDKHTLCDescriptor *NONNULL_PTR b);
53766 * Serialize the HTLCDescriptor object into a byte array which can be read by HTLCDescriptor_read
53768 struct LDKCVec_u8Z HTLCDescriptor_write(const struct LDKHTLCDescriptor *NONNULL_PTR obj);
53771 * Read a HTLCDescriptor from a byte array, created by HTLCDescriptor_write
53773 struct LDKCResult_HTLCDescriptorDecodeErrorZ HTLCDescriptor_read(struct LDKu8slice ser);
53776 * Returns the outpoint of the HTLC output in the commitment transaction. This is the outpoint
53777 * being spent by the HTLC input in the HTLC transaction.
53779 MUST_USE_RES struct LDKOutPoint HTLCDescriptor_outpoint(const struct LDKHTLCDescriptor *NONNULL_PTR this_arg);
53782 * Returns the UTXO to be spent by the HTLC input, which can be obtained via
53783 * [`Self::unsigned_tx_input`].
53785 MUST_USE_RES struct LDKTxOut HTLCDescriptor_previous_utxo(const struct LDKHTLCDescriptor *NONNULL_PTR this_arg);
53788 * Returns the unsigned transaction input spending the HTLC output in the commitment
53791 MUST_USE_RES struct LDKTxIn HTLCDescriptor_unsigned_tx_input(const struct LDKHTLCDescriptor *NONNULL_PTR this_arg);
53794 * Returns the delayed output created as a result of spending the HTLC output in the commitment
53797 MUST_USE_RES struct LDKTxOut HTLCDescriptor_tx_output(const struct LDKHTLCDescriptor *NONNULL_PTR this_arg);
53800 * Returns the witness script of the HTLC output in the commitment transaction.
53802 MUST_USE_RES struct LDKCVec_u8Z HTLCDescriptor_witness_script(const struct LDKHTLCDescriptor *NONNULL_PTR this_arg);
53805 * Returns the fully signed witness required to spend the HTLC output in the commitment
53808 MUST_USE_RES struct LDKWitness HTLCDescriptor_tx_input_witness(const struct LDKHTLCDescriptor *NONNULL_PTR this_arg, struct LDKECDSASignature signature, struct LDKu8slice witness_script);
53811 * Derives the channel signer required to sign the HTLC input.
53813 MUST_USE_RES struct LDKWriteableEcdsaChannelSigner HTLCDescriptor_derive_channel_signer(const struct LDKHTLCDescriptor *NONNULL_PTR this_arg, const struct LDKSignerProvider *NONNULL_PTR signer_provider);
53816 * Calls the free function if one is set
53818 void ChannelSigner_free(struct LDKChannelSigner this_ptr);
53821 * Creates a copy of the Recipient
53823 enum LDKRecipient Recipient_clone(const enum LDKRecipient *NONNULL_PTR orig);
53826 * Utility method to constructs a new Node-variant Recipient
53828 enum LDKRecipient Recipient_node(void);
53831 * Utility method to constructs a new PhantomNode-variant Recipient
53833 enum LDKRecipient Recipient_phantom_node(void);
53836 * Calls the free function if one is set
53838 void EntropySource_free(struct LDKEntropySource this_ptr);
53841 * Calls the free function if one is set
53843 void NodeSigner_free(struct LDKNodeSigner this_ptr);
53846 * Calls the free function if one is set
53848 void OutputSpender_free(struct LDKOutputSpender this_ptr);
53851 * Calls the free function if one is set
53853 void SignerProvider_free(struct LDKSignerProvider this_ptr);
53856 * Calls the free function if one is set
53858 void ChangeDestinationSource_free(struct LDKChangeDestinationSource this_ptr);
53861 * Frees any resources used by the InMemorySigner, if is_owned is set and inner is non-NULL.
53863 void InMemorySigner_free(struct LDKInMemorySigner this_obj);
53866 * Holder secret key in the 2-of-2 multisig script of a channel. This key also backs the
53867 * holder's anchor output in a commitment transaction, if one is present.
53869 const uint8_t (*InMemorySigner_get_funding_key(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32];
53872 * Holder secret key in the 2-of-2 multisig script of a channel. This key also backs the
53873 * holder's anchor output in a commitment transaction, if one is present.
53875 void InMemorySigner_set_funding_key(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKSecretKey val);
53878 * Holder secret key for blinded revocation pubkey.
53880 const uint8_t (*InMemorySigner_get_revocation_base_key(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32];
53883 * Holder secret key for blinded revocation pubkey.
53885 void InMemorySigner_set_revocation_base_key(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKSecretKey val);
53888 * Holder secret key used for our balance in counterparty-broadcasted commitment transactions.
53890 const uint8_t (*InMemorySigner_get_payment_key(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32];
53893 * Holder secret key used for our balance in counterparty-broadcasted commitment transactions.
53895 void InMemorySigner_set_payment_key(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKSecretKey val);
53898 * Holder secret key used in an HTLC transaction.
53900 const uint8_t (*InMemorySigner_get_delayed_payment_base_key(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32];
53903 * Holder secret key used in an HTLC transaction.
53905 void InMemorySigner_set_delayed_payment_base_key(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKSecretKey val);
53908 * Holder HTLC secret key used in commitment transaction HTLC outputs.
53910 const uint8_t (*InMemorySigner_get_htlc_base_key(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32];
53913 * Holder HTLC secret key used in commitment transaction HTLC outputs.
53915 void InMemorySigner_set_htlc_base_key(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKSecretKey val);
53920 const uint8_t (*InMemorySigner_get_commitment_seed(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32];
53925 void InMemorySigner_set_commitment_seed(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
53928 * Creates a copy of the InMemorySigner
53930 struct LDKInMemorySigner InMemorySigner_clone(const struct LDKInMemorySigner *NONNULL_PTR orig);
53933 * Creates a new [`InMemorySigner`].
53935 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);
53938 * Returns the counterparty's pubkeys.
53940 * Will return `None` if [`ChannelSigner::provide_channel_parameters`] has not been called.
53941 * In general, this is safe to `unwrap` only in [`ChannelSigner`] implementation.
53943 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
53945 MUST_USE_RES struct LDKChannelPublicKeys InMemorySigner_counterparty_pubkeys(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
53948 * Returns the `contest_delay` value specified by our counterparty and applied on holder-broadcastable
53949 * transactions, i.e., the amount of time that we have to wait to recover our funds if we
53950 * broadcast a transaction.
53952 * Will return `None` if [`ChannelSigner::provide_channel_parameters`] has not been called.
53953 * In general, this is safe to `unwrap` only in [`ChannelSigner`] implementation.
53955 MUST_USE_RES struct LDKCOption_u16Z InMemorySigner_counterparty_selected_contest_delay(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
53958 * Returns the `contest_delay` value specified by us and applied on transactions broadcastable
53959 * by our counterparty, i.e., the amount of time that they have to wait to recover their funds
53960 * if they broadcast a transaction.
53962 * Will return `None` if [`ChannelSigner::provide_channel_parameters`] has not been called.
53963 * In general, this is safe to `unwrap` only in [`ChannelSigner`] implementation.
53965 MUST_USE_RES struct LDKCOption_u16Z InMemorySigner_holder_selected_contest_delay(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
53968 * Returns whether the holder is the initiator.
53970 * Will return `None` if [`ChannelSigner::provide_channel_parameters`] has not been called.
53971 * In general, this is safe to `unwrap` only in [`ChannelSigner`] implementation.
53973 MUST_USE_RES struct LDKCOption_boolZ InMemorySigner_is_outbound(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
53978 * Will return `None` if [`ChannelSigner::provide_channel_parameters`] has not been called.
53979 * In general, this is safe to `unwrap` only in [`ChannelSigner`] implementation.
53981 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
53983 MUST_USE_RES struct LDKOutPoint InMemorySigner_funding_outpoint(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
53986 * Returns a [`ChannelTransactionParameters`] for this channel, to be used when verifying or
53987 * building transactions.
53989 * Will return `None` if [`ChannelSigner::provide_channel_parameters`] has not been called.
53990 * In general, this is safe to `unwrap` only in [`ChannelSigner`] implementation.
53992 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
53994 MUST_USE_RES struct LDKChannelTransactionParameters InMemorySigner_get_channel_parameters(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
53997 * Returns the channel type features of the channel parameters. Should be helpful for
53998 * determining a channel's category, i. e. legacy/anchors/taproot/etc.
54000 * Will return `None` if [`ChannelSigner::provide_channel_parameters`] has not been called.
54001 * In general, this is safe to `unwrap` only in [`ChannelSigner`] implementation.
54003 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
54005 MUST_USE_RES struct LDKChannelTypeFeatures InMemorySigner_channel_type_features(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
54008 * Sign the single input of `spend_tx` at index `input_idx`, which spends the output described
54009 * by `descriptor`, returning the witness stack for the input.
54011 * Returns an error if the input at `input_idx` does not exist, has a non-empty `script_sig`,
54012 * is not spending the outpoint described by [`descriptor.outpoint`],
54013 * or if an output descriptor `script_pubkey` does not match the one we can spend.
54015 * [`descriptor.outpoint`]: StaticPaymentOutputDescriptor::outpoint
54017 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);
54020 * Sign the single input of `spend_tx` at index `input_idx` which spends the output
54021 * described by `descriptor`, returning the witness stack for the input.
54023 * Returns an error if the input at `input_idx` does not exist, has a non-empty `script_sig`,
54024 * is not spending the outpoint described by [`descriptor.outpoint`], does not have a
54025 * sequence set to [`descriptor.to_self_delay`], or if an output descriptor
54026 * `script_pubkey` does not match the one we can spend.
54028 * [`descriptor.outpoint`]: DelayedPaymentOutputDescriptor::outpoint
54029 * [`descriptor.to_self_delay`]: DelayedPaymentOutputDescriptor::to_self_delay
54031 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);
54034 * Constructs a new EntropySource which calls the relevant methods on this_arg.
54035 * This copies the `inner` pointer in this_arg and thus the returned EntropySource must be freed before this_arg is
54037 struct LDKEntropySource InMemorySigner_as_EntropySource(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
54040 * Constructs a new ChannelSigner which calls the relevant methods on this_arg.
54041 * This copies the `inner` pointer in this_arg and thus the returned ChannelSigner must be freed before this_arg is
54043 struct LDKChannelSigner InMemorySigner_as_ChannelSigner(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
54046 * Constructs a new EcdsaChannelSigner which calls the relevant methods on this_arg.
54047 * This copies the `inner` pointer in this_arg and thus the returned EcdsaChannelSigner must be freed before this_arg is
54049 struct LDKEcdsaChannelSigner InMemorySigner_as_EcdsaChannelSigner(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
54052 * Constructs a new WriteableEcdsaChannelSigner which calls the relevant methods on this_arg.
54053 * This copies the `inner` pointer in this_arg and thus the returned WriteableEcdsaChannelSigner must be freed before this_arg is
54055 struct LDKWriteableEcdsaChannelSigner InMemorySigner_as_WriteableEcdsaChannelSigner(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
54058 * Serialize the InMemorySigner object into a byte array which can be read by InMemorySigner_read
54060 struct LDKCVec_u8Z InMemorySigner_write(const struct LDKInMemorySigner *NONNULL_PTR obj);
54063 * Read a InMemorySigner from a byte array, created by InMemorySigner_write
54065 struct LDKCResult_InMemorySignerDecodeErrorZ InMemorySigner_read(struct LDKu8slice ser, struct LDKEntropySource arg);
54068 * Frees any resources used by the KeysManager, if is_owned is set and inner is non-NULL.
54070 void KeysManager_free(struct LDKKeysManager this_obj);
54073 * Constructs a [`KeysManager`] from a 32-byte seed. If the seed is in some way biased (e.g.,
54074 * your CSRNG is busted) this may panic (but more importantly, you will possibly lose funds).
54075 * `starting_time` isn't strictly required to actually be a time, but it must absolutely,
54076 * without a doubt, be unique to this instance. ie if you start multiple times with the same
54077 * `seed`, `starting_time` must be unique to each run. Thus, the easiest way to achieve this
54078 * is to simply use the current time (with very high precision).
54080 * The `seed` MUST be backed up safely prior to use so that the keys can be re-created, however,
54081 * obviously, `starting_time` should be unique every time you reload the library - it is only
54082 * used to generate new ephemeral key data (which will be stored by the individual channel if
54085 * Note that the seed is required to recover certain on-chain funds independent of
54086 * [`ChannelMonitor`] data, though a current copy of [`ChannelMonitor`] data is also required
54087 * for any channel, and some on-chain during-closing funds.
54089 * [`ChannelMonitor`]: crate::chain::channelmonitor::ChannelMonitor
54091 MUST_USE_RES struct LDKKeysManager KeysManager_new(const uint8_t (*seed)[32], uint64_t starting_time_secs, uint32_t starting_time_nanos);
54094 * Gets the \"node_id\" secret key used to sign gossip announcements, decode onion data, etc.
54096 MUST_USE_RES struct LDKSecretKey KeysManager_get_node_secret_key(const struct LDKKeysManager *NONNULL_PTR this_arg);
54099 * Derive an old [`WriteableEcdsaChannelSigner`] containing per-channel secrets based on a key derivation parameters.
54101 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]);
54104 * Signs the given [`PartiallySignedTransaction`] which spends the given [`SpendableOutputDescriptor`]s.
54105 * The resulting inputs will be finalized and the PSBT will be ready for broadcast if there
54106 * are no other inputs that need signing.
54108 * Returns `Err(())` if the PSBT is missing a descriptor or if we fail to sign.
54110 * May panic if the [`SpendableOutputDescriptor`]s were not generated by channels which used
54111 * this [`KeysManager`] or one of the [`InMemorySigner`] created by this [`KeysManager`].
54113 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);
54116 * Constructs a new EntropySource which calls the relevant methods on this_arg.
54117 * This copies the `inner` pointer in this_arg and thus the returned EntropySource must be freed before this_arg is
54119 struct LDKEntropySource KeysManager_as_EntropySource(const struct LDKKeysManager *NONNULL_PTR this_arg);
54122 * Constructs a new NodeSigner which calls the relevant methods on this_arg.
54123 * This copies the `inner` pointer in this_arg and thus the returned NodeSigner must be freed before this_arg is
54125 struct LDKNodeSigner KeysManager_as_NodeSigner(const struct LDKKeysManager *NONNULL_PTR this_arg);
54128 * Constructs a new OutputSpender which calls the relevant methods on this_arg.
54129 * This copies the `inner` pointer in this_arg and thus the returned OutputSpender must be freed before this_arg is
54131 struct LDKOutputSpender KeysManager_as_OutputSpender(const struct LDKKeysManager *NONNULL_PTR this_arg);
54134 * Constructs a new SignerProvider which calls the relevant methods on this_arg.
54135 * This copies the `inner` pointer in this_arg and thus the returned SignerProvider must be freed before this_arg is
54137 struct LDKSignerProvider KeysManager_as_SignerProvider(const struct LDKKeysManager *NONNULL_PTR this_arg);
54140 * Frees any resources used by the PhantomKeysManager, if is_owned is set and inner is non-NULL.
54142 void PhantomKeysManager_free(struct LDKPhantomKeysManager this_obj);
54145 * Constructs a new EntropySource which calls the relevant methods on this_arg.
54146 * This copies the `inner` pointer in this_arg and thus the returned EntropySource must be freed before this_arg is
54148 struct LDKEntropySource PhantomKeysManager_as_EntropySource(const struct LDKPhantomKeysManager *NONNULL_PTR this_arg);
54151 * Constructs a new NodeSigner which calls the relevant methods on this_arg.
54152 * This copies the `inner` pointer in this_arg and thus the returned NodeSigner must be freed before this_arg is
54154 struct LDKNodeSigner PhantomKeysManager_as_NodeSigner(const struct LDKPhantomKeysManager *NONNULL_PTR this_arg);
54157 * Constructs a new OutputSpender which calls the relevant methods on this_arg.
54158 * This copies the `inner` pointer in this_arg and thus the returned OutputSpender must be freed before this_arg is
54160 struct LDKOutputSpender PhantomKeysManager_as_OutputSpender(const struct LDKPhantomKeysManager *NONNULL_PTR this_arg);
54163 * Constructs a new SignerProvider which calls the relevant methods on this_arg.
54164 * This copies the `inner` pointer in this_arg and thus the returned SignerProvider must be freed before this_arg is
54166 struct LDKSignerProvider PhantomKeysManager_as_SignerProvider(const struct LDKPhantomKeysManager *NONNULL_PTR this_arg);
54169 * Constructs a [`PhantomKeysManager`] given a 32-byte seed and an additional `cross_node_seed`
54170 * that is shared across all nodes that intend to participate in [phantom node payments]
54173 * See [`KeysManager::new`] for more information on `seed`, `starting_time_secs`, and
54174 * `starting_time_nanos`.
54176 * `cross_node_seed` must be the same across all phantom payment-receiving nodes and also the
54177 * same across restarts, or else inbound payments may fail.
54179 * [phantom node payments]: PhantomKeysManager
54181 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]);
54184 * See [`KeysManager::derive_channel_keys`] for documentation on this method.
54186 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]);
54189 * Gets the \"node_id\" secret key used to sign gossip announcements, decode onion data, etc.
54191 MUST_USE_RES struct LDKSecretKey PhantomKeysManager_get_node_secret_key(const struct LDKPhantomKeysManager *NONNULL_PTR this_arg);
54194 * Gets the \"node_id\" secret key of the phantom node used to sign invoices, decode the
54195 * last-hop onion data, etc.
54197 MUST_USE_RES struct LDKSecretKey PhantomKeysManager_get_phantom_node_secret_key(const struct LDKPhantomKeysManager *NONNULL_PTR this_arg);
54200 * Frees any resources used by the RandomBytes, if is_owned is set and inner is non-NULL.
54202 void RandomBytes_free(struct LDKRandomBytes this_obj);
54205 * Creates a new instance using the given seed.
54207 MUST_USE_RES struct LDKRandomBytes RandomBytes_new(struct LDKThirtyTwoBytes seed);
54210 * Constructs a new EntropySource which calls the relevant methods on this_arg.
54211 * This copies the `inner` pointer in this_arg and thus the returned EntropySource must be freed before this_arg is
54213 struct LDKEntropySource RandomBytes_as_EntropySource(const struct LDKRandomBytes *NONNULL_PTR this_arg);
54216 * Calls the free function if one is set
54218 void EcdsaChannelSigner_free(struct LDKEcdsaChannelSigner this_ptr);
54221 * Creates a copy of a WriteableEcdsaChannelSigner
54223 struct LDKWriteableEcdsaChannelSigner WriteableEcdsaChannelSigner_clone(const struct LDKWriteableEcdsaChannelSigner *NONNULL_PTR orig);
54226 * Calls the free function if one is set
54228 void WriteableEcdsaChannelSigner_free(struct LDKWriteableEcdsaChannelSigner this_ptr);
54231 * Frees any resources used by the OnionMessenger, if is_owned is set and inner is non-NULL.
54233 void OnionMessenger_free(struct LDKOnionMessenger this_obj);
54236 * Calls the free function if one is set
54238 void MessageRouter_free(struct LDKMessageRouter this_ptr);
54241 * Frees any resources used by the DefaultMessageRouter, if is_owned is set and inner is non-NULL.
54243 void DefaultMessageRouter_free(struct LDKDefaultMessageRouter this_obj);
54246 * Creates a [`DefaultMessageRouter`] using the given [`NetworkGraph`].
54248 MUST_USE_RES struct LDKDefaultMessageRouter DefaultMessageRouter_new(const struct LDKNetworkGraph *NONNULL_PTR network_graph, struct LDKEntropySource entropy_source);
54251 * Constructs a new MessageRouter which calls the relevant methods on this_arg.
54252 * This copies the `inner` pointer in this_arg and thus the returned MessageRouter must be freed before this_arg is
54254 struct LDKMessageRouter DefaultMessageRouter_as_MessageRouter(const struct LDKDefaultMessageRouter *NONNULL_PTR this_arg);
54257 * Frees any resources used by the OnionMessagePath, if is_owned is set and inner is non-NULL.
54259 void OnionMessagePath_free(struct LDKOnionMessagePath this_obj);
54262 * Nodes on the path between the sender and the destination.
54264 * Returns a copy of the field.
54266 struct LDKCVec_PublicKeyZ OnionMessagePath_get_intermediate_nodes(const struct LDKOnionMessagePath *NONNULL_PTR this_ptr);
54269 * Nodes on the path between the sender and the destination.
54271 void OnionMessagePath_set_intermediate_nodes(struct LDKOnionMessagePath *NONNULL_PTR this_ptr, struct LDKCVec_PublicKeyZ val);
54274 * The recipient of the message.
54276 struct LDKDestination OnionMessagePath_get_destination(const struct LDKOnionMessagePath *NONNULL_PTR this_ptr);
54279 * The recipient of the message.
54281 void OnionMessagePath_set_destination(struct LDKOnionMessagePath *NONNULL_PTR this_ptr, struct LDKDestination val);
54284 * Addresses that may be used to connect to [`OnionMessagePath::first_node`].
54286 * Only needs to be set if a connection to the node is required. [`OnionMessenger`] may use
54287 * this to initiate such a connection.
54289 * Returns a copy of the field.
54291 struct LDKCOption_CVec_SocketAddressZZ OnionMessagePath_get_first_node_addresses(const struct LDKOnionMessagePath *NONNULL_PTR this_ptr);
54294 * Addresses that may be used to connect to [`OnionMessagePath::first_node`].
54296 * Only needs to be set if a connection to the node is required. [`OnionMessenger`] may use
54297 * this to initiate such a connection.
54299 void OnionMessagePath_set_first_node_addresses(struct LDKOnionMessagePath *NONNULL_PTR this_ptr, struct LDKCOption_CVec_SocketAddressZZ val);
54302 * Constructs a new OnionMessagePath given each field
54304 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);
54307 * Creates a copy of the OnionMessagePath
54309 struct LDKOnionMessagePath OnionMessagePath_clone(const struct LDKOnionMessagePath *NONNULL_PTR orig);
54312 * Returns the first node in the path.
54314 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
54316 MUST_USE_RES struct LDKPublicKey OnionMessagePath_first_node(const struct LDKOnionMessagePath *NONNULL_PTR this_arg);
54319 * Frees any resources used by the Destination
54321 void Destination_free(struct LDKDestination this_ptr);
54324 * Creates a copy of the Destination
54326 struct LDKDestination Destination_clone(const struct LDKDestination *NONNULL_PTR orig);
54329 * Utility method to constructs a new Node-variant Destination
54331 struct LDKDestination Destination_node(struct LDKPublicKey a);
54334 * Utility method to constructs a new BlindedPath-variant Destination
54336 struct LDKDestination Destination_blinded_path(struct LDKBlindedPath a);
54339 * Generates a non-cryptographic 64-bit hash of the Destination.
54341 uint64_t Destination_hash(const struct LDKDestination *NONNULL_PTR o);
54344 * Checks if two Destinations contain equal inner contents.
54345 * This ignores pointers and is_owned flags and looks at the values in fields.
54347 bool Destination_eq(const struct LDKDestination *NONNULL_PTR a, const struct LDKDestination *NONNULL_PTR b);
54350 * Attempts to resolve the [`IntroductionNode::DirectedShortChannelId`] of a
54351 * [`Destination::BlindedPath`] to a [`IntroductionNode::NodeId`], if applicable, using the
54352 * provided [`ReadOnlyNetworkGraph`].
54354 void Destination_resolve(struct LDKDestination *NONNULL_PTR this_arg, const struct LDKReadOnlyNetworkGraph *NONNULL_PTR network_graph);
54357 * Frees any resources used by the SendSuccess
54359 void SendSuccess_free(struct LDKSendSuccess this_ptr);
54362 * Creates a copy of the SendSuccess
54364 struct LDKSendSuccess SendSuccess_clone(const struct LDKSendSuccess *NONNULL_PTR orig);
54367 * Utility method to constructs a new Buffered-variant SendSuccess
54369 struct LDKSendSuccess SendSuccess_buffered(void);
54372 * Utility method to constructs a new BufferedAwaitingConnection-variant SendSuccess
54374 struct LDKSendSuccess SendSuccess_buffered_awaiting_connection(struct LDKPublicKey a);
54377 * Generates a non-cryptographic 64-bit hash of the SendSuccess.
54379 uint64_t SendSuccess_hash(const struct LDKSendSuccess *NONNULL_PTR o);
54382 * Checks if two SendSuccesss contain equal inner contents.
54383 * This ignores pointers and is_owned flags and looks at the values in fields.
54385 bool SendSuccess_eq(const struct LDKSendSuccess *NONNULL_PTR a, const struct LDKSendSuccess *NONNULL_PTR b);
54388 * Frees any resources used by the SendError
54390 void SendError_free(struct LDKSendError this_ptr);
54393 * Creates a copy of the SendError
54395 struct LDKSendError SendError_clone(const struct LDKSendError *NONNULL_PTR orig);
54398 * Utility method to constructs a new Secp256k1-variant SendError
54400 struct LDKSendError SendError_secp256k1(enum LDKSecp256k1Error a);
54403 * Utility method to constructs a new TooBigPacket-variant SendError
54405 struct LDKSendError SendError_too_big_packet(void);
54408 * Utility method to constructs a new TooFewBlindedHops-variant SendError
54410 struct LDKSendError SendError_too_few_blinded_hops(void);
54413 * Utility method to constructs a new InvalidFirstHop-variant SendError
54415 struct LDKSendError SendError_invalid_first_hop(struct LDKPublicKey a);
54418 * Utility method to constructs a new PathNotFound-variant SendError
54420 struct LDKSendError SendError_path_not_found(void);
54423 * Utility method to constructs a new InvalidMessage-variant SendError
54425 struct LDKSendError SendError_invalid_message(void);
54428 * Utility method to constructs a new BufferFull-variant SendError
54430 struct LDKSendError SendError_buffer_full(void);
54433 * Utility method to constructs a new GetNodeIdFailed-variant SendError
54435 struct LDKSendError SendError_get_node_id_failed(void);
54438 * Utility method to constructs a new UnresolvedIntroductionNode-variant SendError
54440 struct LDKSendError SendError_unresolved_introduction_node(void);
54443 * Utility method to constructs a new BlindedPathAdvanceFailed-variant SendError
54445 struct LDKSendError SendError_blinded_path_advance_failed(void);
54448 * Generates a non-cryptographic 64-bit hash of the SendError.
54450 uint64_t SendError_hash(const struct LDKSendError *NONNULL_PTR o);
54453 * Checks if two SendErrors contain equal inner contents.
54454 * This ignores pointers and is_owned flags and looks at the values in fields.
54456 bool SendError_eq(const struct LDKSendError *NONNULL_PTR a, const struct LDKSendError *NONNULL_PTR b);
54459 * Calls the free function if one is set
54461 void CustomOnionMessageHandler_free(struct LDKCustomOnionMessageHandler this_ptr);
54464 * Frees any resources used by the PeeledOnion
54466 void PeeledOnion_free(struct LDKPeeledOnion this_ptr);
54469 * Creates a copy of the PeeledOnion
54471 struct LDKPeeledOnion PeeledOnion_clone(const struct LDKPeeledOnion *NONNULL_PTR orig);
54474 * Utility method to constructs a new Forward-variant PeeledOnion
54476 struct LDKPeeledOnion PeeledOnion_forward(struct LDKNextMessageHop a, struct LDKOnionMessage b);
54479 * Utility method to constructs a new Receive-variant PeeledOnion
54481 struct LDKPeeledOnion PeeledOnion_receive(struct LDKParsedOnionMessageContents a, struct LDKThirtyTwoBytes b, struct LDKBlindedPath c);
54484 * Creates an [`OnionMessage`] with the given `contents` for sending to the destination of
54485 * `path`, first calling [`Destination::resolve`] on `path.destination` with the given
54486 * [`ReadOnlyNetworkGraph`].
54488 * Returns the node id of the peer to send the message to, the message itself, and any addresses
54489 * needed to connect to the first node.
54491 * Note that reply_path (or a relevant inner pointer) may be NULL or all-0s to represent None
54493 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);
54496 * Creates an [`OnionMessage`] with the given `contents` for sending to the destination of
54499 * Returns the node id of the peer to send the message to, the message itself, and any addresses
54500 * needed to connect to the first node.
54502 * Returns [`SendError::UnresolvedIntroductionNode`] if:
54503 * - `destination` contains a blinded path with an [`IntroductionNode::DirectedShortChannelId`],
54504 * - unless it can be resolved by [`NodeIdLookUp::next_node_id`].
54505 * Use [`create_onion_message_resolving_destination`] instead to resolve the introduction node
54506 * first with a [`ReadOnlyNetworkGraph`].
54508 * Note that reply_path (or a relevant inner pointer) may be NULL or all-0s to represent None
54510 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);
54513 * Decode one layer of an incoming [`OnionMessage`].
54515 * Returns either the next layer of the onion for forwarding or the decrypted content for the
54518 struct LDKCResult_PeeledOnionNoneZ peel_onion_message(const struct LDKOnionMessage *NONNULL_PTR msg, struct LDKNodeSigner node_signer, struct LDKLogger logger, struct LDKCustomOnionMessageHandler custom_handler);
54521 * Constructs a new `OnionMessenger` to send, forward, and delegate received onion messages to
54522 * their respective handlers.
54524 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);
54527 * Sends an [`OnionMessage`] with the given `contents` to `destination`.
54529 * See [`OnionMessenger`] for example usage.
54531 * Note that reply_path (or a relevant inner pointer) may be NULL or all-0s to represent None
54533 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);
54536 * Constructs a new OnionMessageHandler which calls the relevant methods on this_arg.
54537 * This copies the `inner` pointer in this_arg and thus the returned OnionMessageHandler must be freed before this_arg is
54539 struct LDKOnionMessageHandler OnionMessenger_as_OnionMessageHandler(const struct LDKOnionMessenger *NONNULL_PTR this_arg);
54542 * Calls the free function if one is set
54544 void OffersMessageHandler_free(struct LDKOffersMessageHandler this_ptr);
54547 * Frees any resources used by the OffersMessage
54549 void OffersMessage_free(struct LDKOffersMessage this_ptr);
54552 * Creates a copy of the OffersMessage
54554 struct LDKOffersMessage OffersMessage_clone(const struct LDKOffersMessage *NONNULL_PTR orig);
54557 * Utility method to constructs a new InvoiceRequest-variant OffersMessage
54559 struct LDKOffersMessage OffersMessage_invoice_request(struct LDKInvoiceRequest a);
54562 * Utility method to constructs a new Invoice-variant OffersMessage
54564 struct LDKOffersMessage OffersMessage_invoice(struct LDKBolt12Invoice a);
54567 * Utility method to constructs a new InvoiceError-variant OffersMessage
54569 struct LDKOffersMessage OffersMessage_invoice_error(struct LDKInvoiceError a);
54572 * Returns whether `tlv_type` corresponds to a TLV record for Offers.
54574 MUST_USE_RES bool OffersMessage_is_known_type(uint64_t tlv_type);
54577 * Constructs a new OnionMessageContents which calls the relevant methods on this_arg.
54578 * This copies the `inner` pointer in this_arg and thus the returned OnionMessageContents must be freed before this_arg is
54580 struct LDKOnionMessageContents OffersMessage_as_OnionMessageContents(const struct LDKOffersMessage *NONNULL_PTR this_arg);
54583 * Serialize the OffersMessage object into a byte array which can be read by OffersMessage_read
54585 struct LDKCVec_u8Z OffersMessage_write(const struct LDKOffersMessage *NONNULL_PTR obj);
54588 * Read a OffersMessage from a byte array, created by OffersMessage_write
54590 struct LDKCResult_OffersMessageDecodeErrorZ OffersMessage_read(struct LDKu8slice ser, uint64_t arg_a, const struct LDKLogger *NONNULL_PTR arg_b);
54593 * Frees any resources used by the Packet, if is_owned is set and inner is non-NULL.
54595 void Packet_free(struct LDKPacket this_obj);
54598 * Bolt 04 version number
54600 uint8_t Packet_get_version(const struct LDKPacket *NONNULL_PTR this_ptr);
54603 * Bolt 04 version number
54605 void Packet_set_version(struct LDKPacket *NONNULL_PTR this_ptr, uint8_t val);
54608 * A random sepc256k1 point, used to build the ECDH shared secret to decrypt hop_data
54610 struct LDKPublicKey Packet_get_public_key(const struct LDKPacket *NONNULL_PTR this_ptr);
54613 * A random sepc256k1 point, used to build the ECDH shared secret to decrypt hop_data
54615 void Packet_set_public_key(struct LDKPacket *NONNULL_PTR this_ptr, struct LDKPublicKey val);
54618 * Encrypted payload for the next hop
54620 * Returns a copy of the field.
54622 struct LDKCVec_u8Z Packet_get_hop_data(const struct LDKPacket *NONNULL_PTR this_ptr);
54625 * Encrypted payload for the next hop
54627 void Packet_set_hop_data(struct LDKPacket *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val);
54630 * HMAC to verify the integrity of hop_data
54632 const uint8_t (*Packet_get_hmac(const struct LDKPacket *NONNULL_PTR this_ptr))[32];
54635 * HMAC to verify the integrity of hop_data
54637 void Packet_set_hmac(struct LDKPacket *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
54640 * Constructs a new Packet given each field
54642 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);
54645 * Creates a copy of the Packet
54647 struct LDKPacket Packet_clone(const struct LDKPacket *NONNULL_PTR orig);
54650 * Generates a non-cryptographic 64-bit hash of the Packet.
54652 uint64_t Packet_hash(const struct LDKPacket *NONNULL_PTR o);
54655 * Checks if two Packets contain equal inner contents.
54656 * This ignores pointers and is_owned flags and looks at the values in fields.
54657 * Two objects with NULL inner values will be considered "equal" here.
54659 bool Packet_eq(const struct LDKPacket *NONNULL_PTR a, const struct LDKPacket *NONNULL_PTR b);
54662 * Serialize the Packet object into a byte array which can be read by Packet_read
54664 struct LDKCVec_u8Z Packet_write(const struct LDKPacket *NONNULL_PTR obj);
54667 * Frees any resources used by the ParsedOnionMessageContents
54669 void ParsedOnionMessageContents_free(struct LDKParsedOnionMessageContents this_ptr);
54672 * Creates a copy of the ParsedOnionMessageContents
54674 struct LDKParsedOnionMessageContents ParsedOnionMessageContents_clone(const struct LDKParsedOnionMessageContents *NONNULL_PTR orig);
54677 * Utility method to constructs a new Offers-variant ParsedOnionMessageContents
54679 struct LDKParsedOnionMessageContents ParsedOnionMessageContents_offers(struct LDKOffersMessage a);
54682 * Utility method to constructs a new Custom-variant ParsedOnionMessageContents
54684 struct LDKParsedOnionMessageContents ParsedOnionMessageContents_custom(struct LDKOnionMessageContents a);
54687 * Constructs a new OnionMessageContents which calls the relevant methods on this_arg.
54688 * This copies the `inner` pointer in this_arg and thus the returned OnionMessageContents must be freed before this_arg is
54690 struct LDKOnionMessageContents ParsedOnionMessageContents_as_OnionMessageContents(const struct LDKParsedOnionMessageContents *NONNULL_PTR this_arg);
54693 * Serialize the ParsedOnionMessageContents object into a byte array which can be read by ParsedOnionMessageContents_read
54695 struct LDKCVec_u8Z ParsedOnionMessageContents_write(const struct LDKParsedOnionMessageContents *NONNULL_PTR obj);
54698 * Creates a copy of a OnionMessageContents
54700 struct LDKOnionMessageContents OnionMessageContents_clone(const struct LDKOnionMessageContents *NONNULL_PTR orig);
54703 * Calls the free function if one is set
54705 void OnionMessageContents_free(struct LDKOnionMessageContents this_ptr);
54708 * Frees any resources used by the NextMessageHop
54710 void NextMessageHop_free(struct LDKNextMessageHop this_ptr);
54713 * Creates a copy of the NextMessageHop
54715 struct LDKNextMessageHop NextMessageHop_clone(const struct LDKNextMessageHop *NONNULL_PTR orig);
54718 * Utility method to constructs a new NodeId-variant NextMessageHop
54720 struct LDKNextMessageHop NextMessageHop_node_id(struct LDKPublicKey a);
54723 * Utility method to constructs a new ShortChannelId-variant NextMessageHop
54725 struct LDKNextMessageHop NextMessageHop_short_channel_id(uint64_t a);
54728 * Generates a non-cryptographic 64-bit hash of the NextMessageHop.
54730 uint64_t NextMessageHop_hash(const struct LDKNextMessageHop *NONNULL_PTR o);
54733 * Checks if two NextMessageHops contain equal inner contents.
54734 * This ignores pointers and is_owned flags and looks at the values in fields.
54736 bool NextMessageHop_eq(const struct LDKNextMessageHop *NONNULL_PTR a, const struct LDKNextMessageHop *NONNULL_PTR b);
54739 * Frees any resources used by the BlindedPath, if is_owned is set and inner is non-NULL.
54741 void BlindedPath_free(struct LDKBlindedPath this_obj);
54744 * To send to a blinded path, the sender first finds a route to the unblinded
54745 * `introduction_node`, which can unblind its [`encrypted_payload`] to find out the onion
54746 * message or payment's next hop and forward it along.
54748 * [`encrypted_payload`]: BlindedHop::encrypted_payload
54750 struct LDKIntroductionNode BlindedPath_get_introduction_node(const struct LDKBlindedPath *NONNULL_PTR this_ptr);
54753 * To send to a blinded path, the sender first finds a route to the unblinded
54754 * `introduction_node`, which can unblind its [`encrypted_payload`] to find out the onion
54755 * message or payment's next hop and forward it along.
54757 * [`encrypted_payload`]: BlindedHop::encrypted_payload
54759 void BlindedPath_set_introduction_node(struct LDKBlindedPath *NONNULL_PTR this_ptr, struct LDKIntroductionNode val);
54762 * Used by the introduction node to decrypt its [`encrypted_payload`] to forward the onion
54763 * message or payment.
54765 * [`encrypted_payload`]: BlindedHop::encrypted_payload
54767 struct LDKPublicKey BlindedPath_get_blinding_point(const struct LDKBlindedPath *NONNULL_PTR this_ptr);
54770 * Used by the introduction node to decrypt its [`encrypted_payload`] to forward the onion
54771 * message or payment.
54773 * [`encrypted_payload`]: BlindedHop::encrypted_payload
54775 void BlindedPath_set_blinding_point(struct LDKBlindedPath *NONNULL_PTR this_ptr, struct LDKPublicKey val);
54778 * The hops composing the blinded path.
54780 struct LDKCVec_BlindedHopZ BlindedPath_get_blinded_hops(const struct LDKBlindedPath *NONNULL_PTR this_ptr);
54783 * The hops composing the blinded path.
54785 void BlindedPath_set_blinded_hops(struct LDKBlindedPath *NONNULL_PTR this_ptr, struct LDKCVec_BlindedHopZ val);
54788 * Constructs a new BlindedPath given each field
54790 MUST_USE_RES struct LDKBlindedPath BlindedPath_new(struct LDKIntroductionNode introduction_node_arg, struct LDKPublicKey blinding_point_arg, struct LDKCVec_BlindedHopZ blinded_hops_arg);
54793 * Creates a copy of the BlindedPath
54795 struct LDKBlindedPath BlindedPath_clone(const struct LDKBlindedPath *NONNULL_PTR orig);
54798 * Generates a non-cryptographic 64-bit hash of the BlindedPath.
54800 uint64_t BlindedPath_hash(const struct LDKBlindedPath *NONNULL_PTR o);
54803 * Checks if two BlindedPaths contain equal inner contents.
54804 * This ignores pointers and is_owned flags and looks at the values in fields.
54805 * Two objects with NULL inner values will be considered "equal" here.
54807 bool BlindedPath_eq(const struct LDKBlindedPath *NONNULL_PTR a, const struct LDKBlindedPath *NONNULL_PTR b);
54810 * Frees any resources used by the IntroductionNode
54812 void IntroductionNode_free(struct LDKIntroductionNode this_ptr);
54815 * Creates a copy of the IntroductionNode
54817 struct LDKIntroductionNode IntroductionNode_clone(const struct LDKIntroductionNode *NONNULL_PTR orig);
54820 * Utility method to constructs a new NodeId-variant IntroductionNode
54822 struct LDKIntroductionNode IntroductionNode_node_id(struct LDKPublicKey a);
54825 * Utility method to constructs a new DirectedShortChannelId-variant IntroductionNode
54827 struct LDKIntroductionNode IntroductionNode_directed_short_channel_id(enum LDKDirection a, uint64_t b);
54830 * Generates a non-cryptographic 64-bit hash of the IntroductionNode.
54832 uint64_t IntroductionNode_hash(const struct LDKIntroductionNode *NONNULL_PTR o);
54835 * Checks if two IntroductionNodes contain equal inner contents.
54836 * This ignores pointers and is_owned flags and looks at the values in fields.
54838 bool IntroductionNode_eq(const struct LDKIntroductionNode *NONNULL_PTR a, const struct LDKIntroductionNode *NONNULL_PTR b);
54841 * Creates a copy of the Direction
54843 enum LDKDirection Direction_clone(const enum LDKDirection *NONNULL_PTR orig);
54846 * Utility method to constructs a new NodeOne-variant Direction
54848 enum LDKDirection Direction_node_one(void);
54851 * Utility method to constructs a new NodeTwo-variant Direction
54853 enum LDKDirection Direction_node_two(void);
54856 * Generates a non-cryptographic 64-bit hash of the Direction.
54858 uint64_t Direction_hash(const enum LDKDirection *NONNULL_PTR o);
54861 * Checks if two Directions contain equal inner contents.
54862 * This ignores pointers and is_owned flags and looks at the values in fields.
54864 bool Direction_eq(const enum LDKDirection *NONNULL_PTR a, const enum LDKDirection *NONNULL_PTR b);
54867 * Calls the free function if one is set
54869 void NodeIdLookUp_free(struct LDKNodeIdLookUp this_ptr);
54872 * Frees any resources used by the EmptyNodeIdLookUp, if is_owned is set and inner is non-NULL.
54874 void EmptyNodeIdLookUp_free(struct LDKEmptyNodeIdLookUp this_obj);
54877 * Constructs a new EmptyNodeIdLookUp given each field
54879 MUST_USE_RES struct LDKEmptyNodeIdLookUp EmptyNodeIdLookUp_new(void);
54882 * Constructs a new NodeIdLookUp which calls the relevant methods on this_arg.
54883 * This copies the `inner` pointer in this_arg and thus the returned NodeIdLookUp must be freed before this_arg is
54885 struct LDKNodeIdLookUp EmptyNodeIdLookUp_as_NodeIdLookUp(const struct LDKEmptyNodeIdLookUp *NONNULL_PTR this_arg);
54888 * Frees any resources used by the BlindedHop, if is_owned is set and inner is non-NULL.
54890 void BlindedHop_free(struct LDKBlindedHop this_obj);
54893 * The blinded node id of this hop in a [`BlindedPath`].
54895 struct LDKPublicKey BlindedHop_get_blinded_node_id(const struct LDKBlindedHop *NONNULL_PTR this_ptr);
54898 * The blinded node id of this hop in a [`BlindedPath`].
54900 void BlindedHop_set_blinded_node_id(struct LDKBlindedHop *NONNULL_PTR this_ptr, struct LDKPublicKey val);
54903 * The encrypted payload intended for this hop in a [`BlindedPath`].
54905 * Returns a copy of the field.
54907 struct LDKCVec_u8Z BlindedHop_get_encrypted_payload(const struct LDKBlindedHop *NONNULL_PTR this_ptr);
54910 * The encrypted payload intended for this hop in a [`BlindedPath`].
54912 void BlindedHop_set_encrypted_payload(struct LDKBlindedHop *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val);
54915 * Constructs a new BlindedHop given each field
54917 MUST_USE_RES struct LDKBlindedHop BlindedHop_new(struct LDKPublicKey blinded_node_id_arg, struct LDKCVec_u8Z encrypted_payload_arg);
54920 * Creates a copy of the BlindedHop
54922 struct LDKBlindedHop BlindedHop_clone(const struct LDKBlindedHop *NONNULL_PTR orig);
54925 * Generates a non-cryptographic 64-bit hash of the BlindedHop.
54927 uint64_t BlindedHop_hash(const struct LDKBlindedHop *NONNULL_PTR o);
54930 * Checks if two BlindedHops contain equal inner contents.
54931 * This ignores pointers and is_owned flags and looks at the values in fields.
54932 * Two objects with NULL inner values will be considered "equal" here.
54934 bool BlindedHop_eq(const struct LDKBlindedHop *NONNULL_PTR a, const struct LDKBlindedHop *NONNULL_PTR b);
54937 * Create a one-hop blinded path for a message.
54939 MUST_USE_RES struct LDKCResult_BlindedPathNoneZ BlindedPath_one_hop_for_message(struct LDKPublicKey recipient_node_id, struct LDKEntropySource entropy_source);
54942 * Create a blinded path for an onion message, to be forwarded along `node_pks`. The last node
54943 * pubkey in `node_pks` will be the destination node.
54945 * Errors if no hops are provided or if `node_pk`(s) are invalid.
54947 MUST_USE_RES struct LDKCResult_BlindedPathNoneZ BlindedPath_new_for_message(struct LDKCVec_PublicKeyZ node_pks, struct LDKEntropySource entropy_source);
54950 * Create a one-hop blinded path for a payment.
54952 MUST_USE_RES struct LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ BlindedPath_one_hop_for_payment(struct LDKPublicKey payee_node_id, struct LDKReceiveTlvs payee_tlvs, uint16_t min_final_cltv_expiry_delta, struct LDKEntropySource entropy_source);
54955 * Create a blinded path for a payment, to be forwarded along `intermediate_nodes`.
54958 * * a provided node id is invalid
54959 * * [`BlindedPayInfo`] calculation results in an integer overflow
54960 * * any unknown features are required in the provided [`ForwardTlvs`]
54962 * [`ForwardTlvs`]: crate::blinded_path::payment::ForwardTlvs
54964 MUST_USE_RES struct LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ BlindedPath_new_for_payment(struct LDKCVec_ForwardNodeZ intermediate_nodes, struct LDKPublicKey payee_node_id, struct LDKReceiveTlvs payee_tlvs, uint64_t htlc_maximum_msat, uint16_t min_final_cltv_expiry_delta, struct LDKEntropySource entropy_source);
54967 * Returns the introduction [`NodeId`] of the blinded path, if it is publicly reachable (i.e.,
54968 * it is found in the network graph).
54970 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
54972 MUST_USE_RES struct LDKNodeId BlindedPath_public_introduction_node_id(const struct LDKBlindedPath *NONNULL_PTR this_arg, const struct LDKReadOnlyNetworkGraph *NONNULL_PTR network_graph);
54975 * Serialize the BlindedPath object into a byte array which can be read by BlindedPath_read
54977 struct LDKCVec_u8Z BlindedPath_write(const struct LDKBlindedPath *NONNULL_PTR obj);
54980 * Read a BlindedPath from a byte array, created by BlindedPath_write
54982 struct LDKCResult_BlindedPathDecodeErrorZ BlindedPath_read(struct LDKu8slice ser);
54985 * Serialize the BlindedHop object into a byte array which can be read by BlindedHop_read
54987 struct LDKCVec_u8Z BlindedHop_write(const struct LDKBlindedHop *NONNULL_PTR obj);
54990 * Read a BlindedHop from a byte array, created by BlindedHop_write
54992 struct LDKCResult_BlindedHopDecodeErrorZ BlindedHop_read(struct LDKu8slice ser);
54995 * Frees any resources used by the ForwardNode, if is_owned is set and inner is non-NULL.
54997 void ForwardNode_free(struct LDKForwardNode this_obj);
55000 * The TLVs for this node's [`BlindedHop`], where the fee parameters contained within are also
55001 * used for [`BlindedPayInfo`] construction.
55003 struct LDKForwardTlvs ForwardNode_get_tlvs(const struct LDKForwardNode *NONNULL_PTR this_ptr);
55006 * The TLVs for this node's [`BlindedHop`], where the fee parameters contained within are also
55007 * used for [`BlindedPayInfo`] construction.
55009 void ForwardNode_set_tlvs(struct LDKForwardNode *NONNULL_PTR this_ptr, struct LDKForwardTlvs val);
55012 * This node's pubkey.
55014 struct LDKPublicKey ForwardNode_get_node_id(const struct LDKForwardNode *NONNULL_PTR this_ptr);
55017 * This node's pubkey.
55019 void ForwardNode_set_node_id(struct LDKForwardNode *NONNULL_PTR this_ptr, struct LDKPublicKey val);
55022 * The maximum value, in msat, that may be accepted by this node.
55024 uint64_t ForwardNode_get_htlc_maximum_msat(const struct LDKForwardNode *NONNULL_PTR this_ptr);
55027 * The maximum value, in msat, that may be accepted by this node.
55029 void ForwardNode_set_htlc_maximum_msat(struct LDKForwardNode *NONNULL_PTR this_ptr, uint64_t val);
55032 * Constructs a new ForwardNode given each field
55034 MUST_USE_RES struct LDKForwardNode ForwardNode_new(struct LDKForwardTlvs tlvs_arg, struct LDKPublicKey node_id_arg, uint64_t htlc_maximum_msat_arg);
55037 * Creates a copy of the ForwardNode
55039 struct LDKForwardNode ForwardNode_clone(const struct LDKForwardNode *NONNULL_PTR orig);
55042 * Frees any resources used by the ForwardTlvs, if is_owned is set and inner is non-NULL.
55044 void ForwardTlvs_free(struct LDKForwardTlvs this_obj);
55047 * The short channel id this payment should be forwarded out over.
55049 uint64_t ForwardTlvs_get_short_channel_id(const struct LDKForwardTlvs *NONNULL_PTR this_ptr);
55052 * The short channel id this payment should be forwarded out over.
55054 void ForwardTlvs_set_short_channel_id(struct LDKForwardTlvs *NONNULL_PTR this_ptr, uint64_t val);
55057 * Payment parameters for relaying over [`Self::short_channel_id`].
55059 struct LDKPaymentRelay ForwardTlvs_get_payment_relay(const struct LDKForwardTlvs *NONNULL_PTR this_ptr);
55062 * Payment parameters for relaying over [`Self::short_channel_id`].
55064 void ForwardTlvs_set_payment_relay(struct LDKForwardTlvs *NONNULL_PTR this_ptr, struct LDKPaymentRelay val);
55067 * Payment constraints for relaying over [`Self::short_channel_id`].
55069 struct LDKPaymentConstraints ForwardTlvs_get_payment_constraints(const struct LDKForwardTlvs *NONNULL_PTR this_ptr);
55072 * Payment constraints for relaying over [`Self::short_channel_id`].
55074 void ForwardTlvs_set_payment_constraints(struct LDKForwardTlvs *NONNULL_PTR this_ptr, struct LDKPaymentConstraints val);
55077 * Supported and required features when relaying a payment onion containing this object's
55078 * corresponding [`BlindedHop::encrypted_payload`].
55080 * [`BlindedHop::encrypted_payload`]: crate::blinded_path::BlindedHop::encrypted_payload
55082 struct LDKBlindedHopFeatures ForwardTlvs_get_features(const struct LDKForwardTlvs *NONNULL_PTR this_ptr);
55085 * Supported and required features when relaying a payment onion containing this object's
55086 * corresponding [`BlindedHop::encrypted_payload`].
55088 * [`BlindedHop::encrypted_payload`]: crate::blinded_path::BlindedHop::encrypted_payload
55090 void ForwardTlvs_set_features(struct LDKForwardTlvs *NONNULL_PTR this_ptr, struct LDKBlindedHopFeatures val);
55093 * Constructs a new ForwardTlvs given each field
55095 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);
55098 * Creates a copy of the ForwardTlvs
55100 struct LDKForwardTlvs ForwardTlvs_clone(const struct LDKForwardTlvs *NONNULL_PTR orig);
55103 * Frees any resources used by the ReceiveTlvs, if is_owned is set and inner is non-NULL.
55105 void ReceiveTlvs_free(struct LDKReceiveTlvs this_obj);
55108 * Used to authenticate the sender of a payment to the receiver and tie MPP HTLCs together.
55110 const uint8_t (*ReceiveTlvs_get_payment_secret(const struct LDKReceiveTlvs *NONNULL_PTR this_ptr))[32];
55113 * Used to authenticate the sender of a payment to the receiver and tie MPP HTLCs together.
55115 void ReceiveTlvs_set_payment_secret(struct LDKReceiveTlvs *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
55118 * Constraints for the receiver of this payment.
55120 struct LDKPaymentConstraints ReceiveTlvs_get_payment_constraints(const struct LDKReceiveTlvs *NONNULL_PTR this_ptr);
55123 * Constraints for the receiver of this payment.
55125 void ReceiveTlvs_set_payment_constraints(struct LDKReceiveTlvs *NONNULL_PTR this_ptr, struct LDKPaymentConstraints val);
55128 * Context for the receiver of this payment.
55130 struct LDKPaymentContext ReceiveTlvs_get_payment_context(const struct LDKReceiveTlvs *NONNULL_PTR this_ptr);
55133 * Context for the receiver of this payment.
55135 void ReceiveTlvs_set_payment_context(struct LDKReceiveTlvs *NONNULL_PTR this_ptr, struct LDKPaymentContext val);
55138 * Constructs a new ReceiveTlvs given each field
55140 MUST_USE_RES struct LDKReceiveTlvs ReceiveTlvs_new(struct LDKThirtyTwoBytes payment_secret_arg, struct LDKPaymentConstraints payment_constraints_arg, struct LDKPaymentContext payment_context_arg);
55143 * Creates a copy of the ReceiveTlvs
55145 struct LDKReceiveTlvs ReceiveTlvs_clone(const struct LDKReceiveTlvs *NONNULL_PTR orig);
55148 * Frees any resources used by the PaymentRelay, if is_owned is set and inner is non-NULL.
55150 void PaymentRelay_free(struct LDKPaymentRelay this_obj);
55153 * Number of blocks subtracted from an incoming HTLC's `cltv_expiry` for this [`BlindedHop`].
55155 uint16_t PaymentRelay_get_cltv_expiry_delta(const struct LDKPaymentRelay *NONNULL_PTR this_ptr);
55158 * Number of blocks subtracted from an incoming HTLC's `cltv_expiry` for this [`BlindedHop`].
55160 void PaymentRelay_set_cltv_expiry_delta(struct LDKPaymentRelay *NONNULL_PTR this_ptr, uint16_t val);
55163 * Liquidity fee charged (in millionths of the amount transferred) for relaying a payment over
55164 * this [`BlindedHop`], (i.e., 10,000 is 1%).
55166 uint32_t PaymentRelay_get_fee_proportional_millionths(const struct LDKPaymentRelay *NONNULL_PTR this_ptr);
55169 * Liquidity fee charged (in millionths of the amount transferred) for relaying a payment over
55170 * this [`BlindedHop`], (i.e., 10,000 is 1%).
55172 void PaymentRelay_set_fee_proportional_millionths(struct LDKPaymentRelay *NONNULL_PTR this_ptr, uint32_t val);
55175 * Base fee charged (in millisatoshi) for relaying a payment over this [`BlindedHop`].
55177 uint32_t PaymentRelay_get_fee_base_msat(const struct LDKPaymentRelay *NONNULL_PTR this_ptr);
55180 * Base fee charged (in millisatoshi) for relaying a payment over this [`BlindedHop`].
55182 void PaymentRelay_set_fee_base_msat(struct LDKPaymentRelay *NONNULL_PTR this_ptr, uint32_t val);
55185 * Constructs a new PaymentRelay given each field
55187 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);
55190 * Creates a copy of the PaymentRelay
55192 struct LDKPaymentRelay PaymentRelay_clone(const struct LDKPaymentRelay *NONNULL_PTR orig);
55195 * Frees any resources used by the PaymentConstraints, if is_owned is set and inner is non-NULL.
55197 void PaymentConstraints_free(struct LDKPaymentConstraints this_obj);
55200 * The maximum total CLTV that is acceptable when relaying a payment over this [`BlindedHop`].
55202 uint32_t PaymentConstraints_get_max_cltv_expiry(const struct LDKPaymentConstraints *NONNULL_PTR this_ptr);
55205 * The maximum total CLTV that is acceptable when relaying a payment over this [`BlindedHop`].
55207 void PaymentConstraints_set_max_cltv_expiry(struct LDKPaymentConstraints *NONNULL_PTR this_ptr, uint32_t val);
55210 * The minimum value, in msat, that may be accepted by the node corresponding to this
55213 uint64_t PaymentConstraints_get_htlc_minimum_msat(const struct LDKPaymentConstraints *NONNULL_PTR this_ptr);
55216 * The minimum value, in msat, that may be accepted by the node corresponding to this
55219 void PaymentConstraints_set_htlc_minimum_msat(struct LDKPaymentConstraints *NONNULL_PTR this_ptr, uint64_t val);
55222 * Constructs a new PaymentConstraints given each field
55224 MUST_USE_RES struct LDKPaymentConstraints PaymentConstraints_new(uint32_t max_cltv_expiry_arg, uint64_t htlc_minimum_msat_arg);
55227 * Creates a copy of the PaymentConstraints
55229 struct LDKPaymentConstraints PaymentConstraints_clone(const struct LDKPaymentConstraints *NONNULL_PTR orig);
55232 * Frees any resources used by the PaymentContext
55234 void PaymentContext_free(struct LDKPaymentContext this_ptr);
55237 * Creates a copy of the PaymentContext
55239 struct LDKPaymentContext PaymentContext_clone(const struct LDKPaymentContext *NONNULL_PTR orig);
55242 * Utility method to constructs a new Unknown-variant PaymentContext
55244 struct LDKPaymentContext PaymentContext_unknown(struct LDKUnknownPaymentContext a);
55247 * Utility method to constructs a new Bolt12Offer-variant PaymentContext
55249 struct LDKPaymentContext PaymentContext_bolt12_offer(struct LDKBolt12OfferContext a);
55252 * Utility method to constructs a new Bolt12Refund-variant PaymentContext
55254 struct LDKPaymentContext PaymentContext_bolt12_refund(struct LDKBolt12RefundContext a);
55257 * Checks if two PaymentContexts contain equal inner contents.
55258 * This ignores pointers and is_owned flags and looks at the values in fields.
55260 bool PaymentContext_eq(const struct LDKPaymentContext *NONNULL_PTR a, const struct LDKPaymentContext *NONNULL_PTR b);
55263 * Frees any resources used by the UnknownPaymentContext, if is_owned is set and inner is non-NULL.
55265 void UnknownPaymentContext_free(struct LDKUnknownPaymentContext this_obj);
55268 * Creates a copy of the UnknownPaymentContext
55270 struct LDKUnknownPaymentContext UnknownPaymentContext_clone(const struct LDKUnknownPaymentContext *NONNULL_PTR orig);
55273 * Checks if two UnknownPaymentContexts contain equal inner contents.
55274 * This ignores pointers and is_owned flags and looks at the values in fields.
55275 * Two objects with NULL inner values will be considered "equal" here.
55277 bool UnknownPaymentContext_eq(const struct LDKUnknownPaymentContext *NONNULL_PTR a, const struct LDKUnknownPaymentContext *NONNULL_PTR b);
55280 * Frees any resources used by the Bolt12OfferContext, if is_owned is set and inner is non-NULL.
55282 void Bolt12OfferContext_free(struct LDKBolt12OfferContext this_obj);
55285 * The identifier of the [`Offer`].
55287 * [`Offer`]: crate::offers::offer::Offer
55289 struct LDKOfferId Bolt12OfferContext_get_offer_id(const struct LDKBolt12OfferContext *NONNULL_PTR this_ptr);
55292 * The identifier of the [`Offer`].
55294 * [`Offer`]: crate::offers::offer::Offer
55296 void Bolt12OfferContext_set_offer_id(struct LDKBolt12OfferContext *NONNULL_PTR this_ptr, struct LDKOfferId val);
55299 * Fields from an [`InvoiceRequest`] sent for a [`Bolt12Invoice`].
55301 * [`InvoiceRequest`]: crate::offers::invoice_request::InvoiceRequest
55302 * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice
55304 struct LDKInvoiceRequestFields Bolt12OfferContext_get_invoice_request(const struct LDKBolt12OfferContext *NONNULL_PTR this_ptr);
55307 * Fields from an [`InvoiceRequest`] sent for a [`Bolt12Invoice`].
55309 * [`InvoiceRequest`]: crate::offers::invoice_request::InvoiceRequest
55310 * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice
55312 void Bolt12OfferContext_set_invoice_request(struct LDKBolt12OfferContext *NONNULL_PTR this_ptr, struct LDKInvoiceRequestFields val);
55315 * Constructs a new Bolt12OfferContext given each field
55317 MUST_USE_RES struct LDKBolt12OfferContext Bolt12OfferContext_new(struct LDKOfferId offer_id_arg, struct LDKInvoiceRequestFields invoice_request_arg);
55320 * Creates a copy of the Bolt12OfferContext
55322 struct LDKBolt12OfferContext Bolt12OfferContext_clone(const struct LDKBolt12OfferContext *NONNULL_PTR orig);
55325 * Checks if two Bolt12OfferContexts contain equal inner contents.
55326 * This ignores pointers and is_owned flags and looks at the values in fields.
55327 * Two objects with NULL inner values will be considered "equal" here.
55329 bool Bolt12OfferContext_eq(const struct LDKBolt12OfferContext *NONNULL_PTR a, const struct LDKBolt12OfferContext *NONNULL_PTR b);
55332 * Frees any resources used by the Bolt12RefundContext, if is_owned is set and inner is non-NULL.
55334 void Bolt12RefundContext_free(struct LDKBolt12RefundContext this_obj);
55337 * Constructs a new Bolt12RefundContext given each field
55339 MUST_USE_RES struct LDKBolt12RefundContext Bolt12RefundContext_new(void);
55342 * Creates a copy of the Bolt12RefundContext
55344 struct LDKBolt12RefundContext Bolt12RefundContext_clone(const struct LDKBolt12RefundContext *NONNULL_PTR orig);
55347 * Checks if two Bolt12RefundContexts contain equal inner contents.
55348 * This ignores pointers and is_owned flags and looks at the values in fields.
55349 * Two objects with NULL inner values will be considered "equal" here.
55351 bool Bolt12RefundContext_eq(const struct LDKBolt12RefundContext *NONNULL_PTR a, const struct LDKBolt12RefundContext *NONNULL_PTR b);
55354 * Serialize the ForwardTlvs object into a byte array which can be read by ForwardTlvs_read
55356 struct LDKCVec_u8Z ForwardTlvs_write(const struct LDKForwardTlvs *NONNULL_PTR obj);
55359 * Serialize the ReceiveTlvs object into a byte array which can be read by ReceiveTlvs_read
55361 struct LDKCVec_u8Z ReceiveTlvs_write(const struct LDKReceiveTlvs *NONNULL_PTR obj);
55364 * Serialize the PaymentRelay object into a byte array which can be read by PaymentRelay_read
55366 struct LDKCVec_u8Z PaymentRelay_write(const struct LDKPaymentRelay *NONNULL_PTR obj);
55369 * Read a PaymentRelay from a byte array, created by PaymentRelay_write
55371 struct LDKCResult_PaymentRelayDecodeErrorZ PaymentRelay_read(struct LDKu8slice ser);
55374 * Serialize the PaymentConstraints object into a byte array which can be read by PaymentConstraints_read
55376 struct LDKCVec_u8Z PaymentConstraints_write(const struct LDKPaymentConstraints *NONNULL_PTR obj);
55379 * Read a PaymentConstraints from a byte array, created by PaymentConstraints_write
55381 struct LDKCResult_PaymentConstraintsDecodeErrorZ PaymentConstraints_read(struct LDKu8slice ser);
55384 * Serialize the PaymentContext object into a byte array which can be read by PaymentContext_read
55386 struct LDKCVec_u8Z PaymentContext_write(const struct LDKPaymentContext *NONNULL_PTR obj);
55389 * Read a PaymentContext from a byte array, created by PaymentContext_write
55391 struct LDKCResult_PaymentContextDecodeErrorZ PaymentContext_read(struct LDKu8slice ser);
55394 * Serialize the UnknownPaymentContext object into a byte array which can be read by UnknownPaymentContext_read
55396 struct LDKCVec_u8Z UnknownPaymentContext_write(const struct LDKUnknownPaymentContext *NONNULL_PTR obj);
55399 * Read a UnknownPaymentContext from a byte array, created by UnknownPaymentContext_write
55401 struct LDKCResult_UnknownPaymentContextDecodeErrorZ UnknownPaymentContext_read(struct LDKu8slice ser);
55404 * Serialize the Bolt12OfferContext object into a byte array which can be read by Bolt12OfferContext_read
55406 struct LDKCVec_u8Z Bolt12OfferContext_write(const struct LDKBolt12OfferContext *NONNULL_PTR obj);
55409 * Read a Bolt12OfferContext from a byte array, created by Bolt12OfferContext_write
55411 struct LDKCResult_Bolt12OfferContextDecodeErrorZ Bolt12OfferContext_read(struct LDKu8slice ser);
55414 * Serialize the Bolt12RefundContext object into a byte array which can be read by Bolt12RefundContext_read
55416 struct LDKCVec_u8Z Bolt12RefundContext_write(const struct LDKBolt12RefundContext *NONNULL_PTR obj);
55419 * Read a Bolt12RefundContext from a byte array, created by Bolt12RefundContext_write
55421 struct LDKCResult_Bolt12RefundContextDecodeErrorZ Bolt12RefundContext_read(struct LDKu8slice ser);
55424 * Frees any resources used by the PaymentPurpose
55426 void PaymentPurpose_free(struct LDKPaymentPurpose this_ptr);
55429 * Creates a copy of the PaymentPurpose
55431 struct LDKPaymentPurpose PaymentPurpose_clone(const struct LDKPaymentPurpose *NONNULL_PTR orig);
55434 * Utility method to constructs a new Bolt11InvoicePayment-variant PaymentPurpose
55436 struct LDKPaymentPurpose PaymentPurpose_bolt11_invoice_payment(struct LDKCOption_ThirtyTwoBytesZ payment_preimage, struct LDKThirtyTwoBytes payment_secret);
55439 * Utility method to constructs a new Bolt12OfferPayment-variant PaymentPurpose
55441 struct LDKPaymentPurpose PaymentPurpose_bolt12_offer_payment(struct LDKCOption_ThirtyTwoBytesZ payment_preimage, struct LDKThirtyTwoBytes payment_secret, struct LDKBolt12OfferContext payment_context);
55444 * Utility method to constructs a new Bolt12RefundPayment-variant PaymentPurpose
55446 struct LDKPaymentPurpose PaymentPurpose_bolt12_refund_payment(struct LDKCOption_ThirtyTwoBytesZ payment_preimage, struct LDKThirtyTwoBytes payment_secret, struct LDKBolt12RefundContext payment_context);
55449 * Utility method to constructs a new SpontaneousPayment-variant PaymentPurpose
55451 struct LDKPaymentPurpose PaymentPurpose_spontaneous_payment(struct LDKThirtyTwoBytes a);
55454 * Checks if two PaymentPurposes contain equal inner contents.
55455 * This ignores pointers and is_owned flags and looks at the values in fields.
55457 bool PaymentPurpose_eq(const struct LDKPaymentPurpose *NONNULL_PTR a, const struct LDKPaymentPurpose *NONNULL_PTR b);
55460 * Returns the preimage for this payment, if it is known.
55462 MUST_USE_RES struct LDKCOption_ThirtyTwoBytesZ PaymentPurpose_preimage(const struct LDKPaymentPurpose *NONNULL_PTR this_arg);
55465 * Serialize the PaymentPurpose object into a byte array which can be read by PaymentPurpose_read
55467 struct LDKCVec_u8Z PaymentPurpose_write(const struct LDKPaymentPurpose *NONNULL_PTR obj);
55470 * Read a PaymentPurpose from a byte array, created by PaymentPurpose_write
55472 struct LDKCResult_PaymentPurposeDecodeErrorZ PaymentPurpose_read(struct LDKu8slice ser);
55475 * Frees any resources used by the ClaimedHTLC, if is_owned is set and inner is non-NULL.
55477 void ClaimedHTLC_free(struct LDKClaimedHTLC this_obj);
55480 * The `channel_id` of the channel over which the HTLC was received.
55482 struct LDKChannelId ClaimedHTLC_get_channel_id(const struct LDKClaimedHTLC *NONNULL_PTR this_ptr);
55485 * The `channel_id` of the channel over which the HTLC was received.
55487 void ClaimedHTLC_set_channel_id(struct LDKClaimedHTLC *NONNULL_PTR this_ptr, struct LDKChannelId val);
55490 * The `user_channel_id` of the channel over which the HTLC was received. This is the value
55491 * passed in to [`ChannelManager::create_channel`] for outbound channels, or to
55492 * [`ChannelManager::accept_inbound_channel`] for inbound channels if
55493 * [`UserConfig::manually_accept_inbound_channels`] config flag is set to true. Otherwise
55494 * `user_channel_id` will be randomized for an inbound channel.
55496 * This field will be zero for a payment that was serialized prior to LDK version 0.0.117. (This
55497 * should only happen in the case that a payment was claimable prior to LDK version 0.0.117, but
55498 * was not actually claimed until after upgrading.)
55500 * [`ChannelManager::create_channel`]: crate::ln::channelmanager::ChannelManager::create_channel
55501 * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
55502 * [`UserConfig::manually_accept_inbound_channels`]: crate::util::config::UserConfig::manually_accept_inbound_channels
55504 struct LDKU128 ClaimedHTLC_get_user_channel_id(const struct LDKClaimedHTLC *NONNULL_PTR this_ptr);
55507 * The `user_channel_id` of the channel over which the HTLC was received. This is the value
55508 * passed in to [`ChannelManager::create_channel`] for outbound channels, or to
55509 * [`ChannelManager::accept_inbound_channel`] for inbound channels if
55510 * [`UserConfig::manually_accept_inbound_channels`] config flag is set to true. Otherwise
55511 * `user_channel_id` will be randomized for an inbound channel.
55513 * This field will be zero for a payment that was serialized prior to LDK version 0.0.117. (This
55514 * should only happen in the case that a payment was claimable prior to LDK version 0.0.117, but
55515 * was not actually claimed until after upgrading.)
55517 * [`ChannelManager::create_channel`]: crate::ln::channelmanager::ChannelManager::create_channel
55518 * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
55519 * [`UserConfig::manually_accept_inbound_channels`]: crate::util::config::UserConfig::manually_accept_inbound_channels
55521 void ClaimedHTLC_set_user_channel_id(struct LDKClaimedHTLC *NONNULL_PTR this_ptr, struct LDKU128 val);
55524 * The block height at which this HTLC expires.
55526 uint32_t ClaimedHTLC_get_cltv_expiry(const struct LDKClaimedHTLC *NONNULL_PTR this_ptr);
55529 * The block height at which this HTLC expires.
55531 void ClaimedHTLC_set_cltv_expiry(struct LDKClaimedHTLC *NONNULL_PTR this_ptr, uint32_t val);
55534 * The amount (in msats) of this part of an MPP.
55536 uint64_t ClaimedHTLC_get_value_msat(const struct LDKClaimedHTLC *NONNULL_PTR this_ptr);
55539 * The amount (in msats) of this part of an MPP.
55541 void ClaimedHTLC_set_value_msat(struct LDKClaimedHTLC *NONNULL_PTR this_ptr, uint64_t val);
55544 * The extra fee our counterparty skimmed off the top of this HTLC, if any.
55546 * This value will always be 0 for [`ClaimedHTLC`]s serialized with LDK versions prior to
55549 uint64_t ClaimedHTLC_get_counterparty_skimmed_fee_msat(const struct LDKClaimedHTLC *NONNULL_PTR this_ptr);
55552 * The extra fee our counterparty skimmed off the top of this HTLC, if any.
55554 * This value will always be 0 for [`ClaimedHTLC`]s serialized with LDK versions prior to
55557 void ClaimedHTLC_set_counterparty_skimmed_fee_msat(struct LDKClaimedHTLC *NONNULL_PTR this_ptr, uint64_t val);
55560 * Constructs a new ClaimedHTLC given each field
55562 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);
55565 * Creates a copy of the ClaimedHTLC
55567 struct LDKClaimedHTLC ClaimedHTLC_clone(const struct LDKClaimedHTLC *NONNULL_PTR orig);
55570 * Checks if two ClaimedHTLCs contain equal inner contents.
55571 * This ignores pointers and is_owned flags and looks at the values in fields.
55572 * Two objects with NULL inner values will be considered "equal" here.
55574 bool ClaimedHTLC_eq(const struct LDKClaimedHTLC *NONNULL_PTR a, const struct LDKClaimedHTLC *NONNULL_PTR b);
55577 * Serialize the ClaimedHTLC object into a byte array which can be read by ClaimedHTLC_read
55579 struct LDKCVec_u8Z ClaimedHTLC_write(const struct LDKClaimedHTLC *NONNULL_PTR obj);
55582 * Read a ClaimedHTLC from a byte array, created by ClaimedHTLC_write
55584 struct LDKCResult_ClaimedHTLCDecodeErrorZ ClaimedHTLC_read(struct LDKu8slice ser);
55587 * Frees any resources used by the PathFailure
55589 void PathFailure_free(struct LDKPathFailure this_ptr);
55592 * Creates a copy of the PathFailure
55594 struct LDKPathFailure PathFailure_clone(const struct LDKPathFailure *NONNULL_PTR orig);
55597 * Utility method to constructs a new InitialSend-variant PathFailure
55599 struct LDKPathFailure PathFailure_initial_send(struct LDKAPIError err);
55602 * Utility method to constructs a new OnPath-variant PathFailure
55604 struct LDKPathFailure PathFailure_on_path(struct LDKCOption_NetworkUpdateZ network_update);
55607 * Checks if two PathFailures contain equal inner contents.
55608 * This ignores pointers and is_owned flags and looks at the values in fields.
55610 bool PathFailure_eq(const struct LDKPathFailure *NONNULL_PTR a, const struct LDKPathFailure *NONNULL_PTR b);
55613 * Serialize the PathFailure object into a byte array which can be read by PathFailure_read
55615 struct LDKCVec_u8Z PathFailure_write(const struct LDKPathFailure *NONNULL_PTR obj);
55618 * Read a PathFailure from a byte array, created by PathFailure_write
55620 struct LDKCResult_COption_PathFailureZDecodeErrorZ PathFailure_read(struct LDKu8slice ser);
55623 * Frees any resources used by the ClosureReason
55625 void ClosureReason_free(struct LDKClosureReason this_ptr);
55628 * Creates a copy of the ClosureReason
55630 struct LDKClosureReason ClosureReason_clone(const struct LDKClosureReason *NONNULL_PTR orig);
55633 * Utility method to constructs a new CounterpartyForceClosed-variant ClosureReason
55635 struct LDKClosureReason ClosureReason_counterparty_force_closed(struct LDKUntrustedString peer_msg);
55638 * Utility method to constructs a new HolderForceClosed-variant ClosureReason
55640 struct LDKClosureReason ClosureReason_holder_force_closed(void);
55643 * Utility method to constructs a new LegacyCooperativeClosure-variant ClosureReason
55645 struct LDKClosureReason ClosureReason_legacy_cooperative_closure(void);
55648 * Utility method to constructs a new CounterpartyInitiatedCooperativeClosure-variant ClosureReason
55650 struct LDKClosureReason ClosureReason_counterparty_initiated_cooperative_closure(void);
55653 * Utility method to constructs a new LocallyInitiatedCooperativeClosure-variant ClosureReason
55655 struct LDKClosureReason ClosureReason_locally_initiated_cooperative_closure(void);
55658 * Utility method to constructs a new CommitmentTxConfirmed-variant ClosureReason
55660 struct LDKClosureReason ClosureReason_commitment_tx_confirmed(void);
55663 * Utility method to constructs a new FundingTimedOut-variant ClosureReason
55665 struct LDKClosureReason ClosureReason_funding_timed_out(void);
55668 * Utility method to constructs a new ProcessingError-variant ClosureReason
55670 struct LDKClosureReason ClosureReason_processing_error(struct LDKStr err);
55673 * Utility method to constructs a new DisconnectedPeer-variant ClosureReason
55675 struct LDKClosureReason ClosureReason_disconnected_peer(void);
55678 * Utility method to constructs a new OutdatedChannelManager-variant ClosureReason
55680 struct LDKClosureReason ClosureReason_outdated_channel_manager(void);
55683 * Utility method to constructs a new CounterpartyCoopClosedUnfundedChannel-variant ClosureReason
55685 struct LDKClosureReason ClosureReason_counterparty_coop_closed_unfunded_channel(void);
55688 * Utility method to constructs a new FundingBatchClosure-variant ClosureReason
55690 struct LDKClosureReason ClosureReason_funding_batch_closure(void);
55693 * Utility method to constructs a new HTLCsTimedOut-variant ClosureReason
55695 struct LDKClosureReason ClosureReason_htlcs_timed_out(void);
55698 * Checks if two ClosureReasons contain equal inner contents.
55699 * This ignores pointers and is_owned flags and looks at the values in fields.
55701 bool ClosureReason_eq(const struct LDKClosureReason *NONNULL_PTR a, const struct LDKClosureReason *NONNULL_PTR b);
55704 * Get the string representation of a ClosureReason object
55706 struct LDKStr ClosureReason_to_str(const struct LDKClosureReason *NONNULL_PTR o);
55709 * Serialize the ClosureReason object into a byte array which can be read by ClosureReason_read
55711 struct LDKCVec_u8Z ClosureReason_write(const struct LDKClosureReason *NONNULL_PTR obj);
55714 * Read a ClosureReason from a byte array, created by ClosureReason_write
55716 struct LDKCResult_COption_ClosureReasonZDecodeErrorZ ClosureReason_read(struct LDKu8slice ser);
55719 * Frees any resources used by the HTLCDestination
55721 void HTLCDestination_free(struct LDKHTLCDestination this_ptr);
55724 * Creates a copy of the HTLCDestination
55726 struct LDKHTLCDestination HTLCDestination_clone(const struct LDKHTLCDestination *NONNULL_PTR orig);
55729 * Utility method to constructs a new NextHopChannel-variant HTLCDestination
55731 struct LDKHTLCDestination HTLCDestination_next_hop_channel(struct LDKPublicKey node_id, struct LDKChannelId channel_id);
55734 * Utility method to constructs a new UnknownNextHop-variant HTLCDestination
55736 struct LDKHTLCDestination HTLCDestination_unknown_next_hop(uint64_t requested_forward_scid);
55739 * Utility method to constructs a new InvalidForward-variant HTLCDestination
55741 struct LDKHTLCDestination HTLCDestination_invalid_forward(uint64_t requested_forward_scid);
55744 * Utility method to constructs a new InvalidOnion-variant HTLCDestination
55746 struct LDKHTLCDestination HTLCDestination_invalid_onion(void);
55749 * Utility method to constructs a new FailedPayment-variant HTLCDestination
55751 struct LDKHTLCDestination HTLCDestination_failed_payment(struct LDKThirtyTwoBytes payment_hash);
55754 * Checks if two HTLCDestinations contain equal inner contents.
55755 * This ignores pointers and is_owned flags and looks at the values in fields.
55757 bool HTLCDestination_eq(const struct LDKHTLCDestination *NONNULL_PTR a, const struct LDKHTLCDestination *NONNULL_PTR b);
55760 * Serialize the HTLCDestination object into a byte array which can be read by HTLCDestination_read
55762 struct LDKCVec_u8Z HTLCDestination_write(const struct LDKHTLCDestination *NONNULL_PTR obj);
55765 * Read a HTLCDestination from a byte array, created by HTLCDestination_write
55767 struct LDKCResult_COption_HTLCDestinationZDecodeErrorZ HTLCDestination_read(struct LDKu8slice ser);
55770 * Creates a copy of the PaymentFailureReason
55772 enum LDKPaymentFailureReason PaymentFailureReason_clone(const enum LDKPaymentFailureReason *NONNULL_PTR orig);
55775 * Utility method to constructs a new RecipientRejected-variant PaymentFailureReason
55777 enum LDKPaymentFailureReason PaymentFailureReason_recipient_rejected(void);
55780 * Utility method to constructs a new UserAbandoned-variant PaymentFailureReason
55782 enum LDKPaymentFailureReason PaymentFailureReason_user_abandoned(void);
55785 * Utility method to constructs a new RetriesExhausted-variant PaymentFailureReason
55787 enum LDKPaymentFailureReason PaymentFailureReason_retries_exhausted(void);
55790 * Utility method to constructs a new PaymentExpired-variant PaymentFailureReason
55792 enum LDKPaymentFailureReason PaymentFailureReason_payment_expired(void);
55795 * Utility method to constructs a new RouteNotFound-variant PaymentFailureReason
55797 enum LDKPaymentFailureReason PaymentFailureReason_route_not_found(void);
55800 * Utility method to constructs a new UnexpectedError-variant PaymentFailureReason
55802 enum LDKPaymentFailureReason PaymentFailureReason_unexpected_error(void);
55805 * Checks if two PaymentFailureReasons contain equal inner contents.
55806 * This ignores pointers and is_owned flags and looks at the values in fields.
55808 bool PaymentFailureReason_eq(const enum LDKPaymentFailureReason *NONNULL_PTR a, const enum LDKPaymentFailureReason *NONNULL_PTR b);
55811 * Serialize the PaymentFailureReason object into a byte array which can be read by PaymentFailureReason_read
55813 struct LDKCVec_u8Z PaymentFailureReason_write(const enum LDKPaymentFailureReason *NONNULL_PTR obj);
55816 * Read a PaymentFailureReason from a byte array, created by PaymentFailureReason_write
55818 struct LDKCResult_PaymentFailureReasonDecodeErrorZ PaymentFailureReason_read(struct LDKu8slice ser);
55821 * Frees any resources used by the Event
55823 void Event_free(struct LDKEvent this_ptr);
55826 * Creates a copy of the Event
55828 struct LDKEvent Event_clone(const struct LDKEvent *NONNULL_PTR orig);
55831 * Utility method to constructs a new FundingGenerationReady-variant Event
55833 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);
55836 * Utility method to constructs a new PaymentClaimable-variant Event
55838 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);
55841 * Utility method to constructs a new PaymentClaimed-variant Event
55843 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);
55846 * Utility method to constructs a new ConnectionNeeded-variant Event
55848 struct LDKEvent Event_connection_needed(struct LDKPublicKey node_id, struct LDKCVec_SocketAddressZ addresses);
55851 * Utility method to constructs a new InvoiceRequestFailed-variant Event
55853 struct LDKEvent Event_invoice_request_failed(struct LDKThirtyTwoBytes payment_id);
55856 * Utility method to constructs a new PaymentSent-variant Event
55858 struct LDKEvent Event_payment_sent(struct LDKCOption_ThirtyTwoBytesZ payment_id, struct LDKThirtyTwoBytes payment_preimage, struct LDKThirtyTwoBytes payment_hash, struct LDKCOption_u64Z fee_paid_msat);
55861 * Utility method to constructs a new PaymentFailed-variant Event
55863 struct LDKEvent Event_payment_failed(struct LDKThirtyTwoBytes payment_id, struct LDKThirtyTwoBytes payment_hash, struct LDKCOption_PaymentFailureReasonZ reason);
55866 * Utility method to constructs a new PaymentPathSuccessful-variant Event
55868 struct LDKEvent Event_payment_path_successful(struct LDKThirtyTwoBytes payment_id, struct LDKCOption_ThirtyTwoBytesZ payment_hash, struct LDKPath path);
55871 * Utility method to constructs a new PaymentPathFailed-variant Event
55873 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);
55876 * Utility method to constructs a new ProbeSuccessful-variant Event
55878 struct LDKEvent Event_probe_successful(struct LDKThirtyTwoBytes payment_id, struct LDKThirtyTwoBytes payment_hash, struct LDKPath path);
55881 * Utility method to constructs a new ProbeFailed-variant Event
55883 struct LDKEvent Event_probe_failed(struct LDKThirtyTwoBytes payment_id, struct LDKThirtyTwoBytes payment_hash, struct LDKPath path, struct LDKCOption_u64Z short_channel_id);
55886 * Utility method to constructs a new PendingHTLCsForwardable-variant Event
55888 struct LDKEvent Event_pending_htlcs_forwardable(uint64_t time_forwardable);
55891 * Utility method to constructs a new HTLCIntercepted-variant Event
55893 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);
55896 * Utility method to constructs a new SpendableOutputs-variant Event
55898 struct LDKEvent Event_spendable_outputs(struct LDKCVec_SpendableOutputDescriptorZ outputs, struct LDKChannelId channel_id);
55901 * Utility method to constructs a new PaymentForwarded-variant Event
55903 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);
55906 * Utility method to constructs a new ChannelPending-variant Event
55908 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);
55911 * Utility method to constructs a new ChannelReady-variant Event
55913 struct LDKEvent Event_channel_ready(struct LDKChannelId channel_id, struct LDKU128 user_channel_id, struct LDKPublicKey counterparty_node_id, struct LDKChannelTypeFeatures channel_type);
55916 * Utility method to constructs a new ChannelClosed-variant Event
55918 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);
55921 * Utility method to constructs a new DiscardFunding-variant Event
55923 struct LDKEvent Event_discard_funding(struct LDKChannelId channel_id, struct LDKTransaction transaction);
55926 * Utility method to constructs a new OpenChannelRequest-variant Event
55928 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);
55931 * Utility method to constructs a new HTLCHandlingFailed-variant Event
55933 struct LDKEvent Event_htlchandling_failed(struct LDKChannelId prev_channel_id, struct LDKHTLCDestination failed_next_destination);
55936 * Utility method to constructs a new BumpTransaction-variant Event
55938 struct LDKEvent Event_bump_transaction(struct LDKBumpTransactionEvent a);
55941 * Checks if two Events contain equal inner contents.
55942 * This ignores pointers and is_owned flags and looks at the values in fields.
55944 bool Event_eq(const struct LDKEvent *NONNULL_PTR a, const struct LDKEvent *NONNULL_PTR b);
55947 * Serialize the Event object into a byte array which can be read by Event_read
55949 struct LDKCVec_u8Z Event_write(const struct LDKEvent *NONNULL_PTR obj);
55952 * Read a Event from a byte array, created by Event_write
55954 struct LDKCResult_COption_EventZDecodeErrorZ Event_read(struct LDKu8slice ser);
55957 * Frees any resources used by the MessageSendEvent
55959 void MessageSendEvent_free(struct LDKMessageSendEvent this_ptr);
55962 * Creates a copy of the MessageSendEvent
55964 struct LDKMessageSendEvent MessageSendEvent_clone(const struct LDKMessageSendEvent *NONNULL_PTR orig);
55967 * Utility method to constructs a new SendAcceptChannel-variant MessageSendEvent
55969 struct LDKMessageSendEvent MessageSendEvent_send_accept_channel(struct LDKPublicKey node_id, struct LDKAcceptChannel msg);
55972 * Utility method to constructs a new SendAcceptChannelV2-variant MessageSendEvent
55974 struct LDKMessageSendEvent MessageSendEvent_send_accept_channel_v2(struct LDKPublicKey node_id, struct LDKAcceptChannelV2 msg);
55977 * Utility method to constructs a new SendOpenChannel-variant MessageSendEvent
55979 struct LDKMessageSendEvent MessageSendEvent_send_open_channel(struct LDKPublicKey node_id, struct LDKOpenChannel msg);
55982 * Utility method to constructs a new SendOpenChannelV2-variant MessageSendEvent
55984 struct LDKMessageSendEvent MessageSendEvent_send_open_channel_v2(struct LDKPublicKey node_id, struct LDKOpenChannelV2 msg);
55987 * Utility method to constructs a new SendFundingCreated-variant MessageSendEvent
55989 struct LDKMessageSendEvent MessageSendEvent_send_funding_created(struct LDKPublicKey node_id, struct LDKFundingCreated msg);
55992 * Utility method to constructs a new SendFundingSigned-variant MessageSendEvent
55994 struct LDKMessageSendEvent MessageSendEvent_send_funding_signed(struct LDKPublicKey node_id, struct LDKFundingSigned msg);
55997 * Utility method to constructs a new SendStfu-variant MessageSendEvent
55999 struct LDKMessageSendEvent MessageSendEvent_send_stfu(struct LDKPublicKey node_id, struct LDKStfu msg);
56002 * Utility method to constructs a new SendSplice-variant MessageSendEvent
56004 struct LDKMessageSendEvent MessageSendEvent_send_splice(struct LDKPublicKey node_id, struct LDKSplice msg);
56007 * Utility method to constructs a new SendSpliceAck-variant MessageSendEvent
56009 struct LDKMessageSendEvent MessageSendEvent_send_splice_ack(struct LDKPublicKey node_id, struct LDKSpliceAck msg);
56012 * Utility method to constructs a new SendSpliceLocked-variant MessageSendEvent
56014 struct LDKMessageSendEvent MessageSendEvent_send_splice_locked(struct LDKPublicKey node_id, struct LDKSpliceLocked msg);
56017 * Utility method to constructs a new SendTxAddInput-variant MessageSendEvent
56019 struct LDKMessageSendEvent MessageSendEvent_send_tx_add_input(struct LDKPublicKey node_id, struct LDKTxAddInput msg);
56022 * Utility method to constructs a new SendTxAddOutput-variant MessageSendEvent
56024 struct LDKMessageSendEvent MessageSendEvent_send_tx_add_output(struct LDKPublicKey node_id, struct LDKTxAddOutput msg);
56027 * Utility method to constructs a new SendTxRemoveInput-variant MessageSendEvent
56029 struct LDKMessageSendEvent MessageSendEvent_send_tx_remove_input(struct LDKPublicKey node_id, struct LDKTxRemoveInput msg);
56032 * Utility method to constructs a new SendTxRemoveOutput-variant MessageSendEvent
56034 struct LDKMessageSendEvent MessageSendEvent_send_tx_remove_output(struct LDKPublicKey node_id, struct LDKTxRemoveOutput msg);
56037 * Utility method to constructs a new SendTxComplete-variant MessageSendEvent
56039 struct LDKMessageSendEvent MessageSendEvent_send_tx_complete(struct LDKPublicKey node_id, struct LDKTxComplete msg);
56042 * Utility method to constructs a new SendTxSignatures-variant MessageSendEvent
56044 struct LDKMessageSendEvent MessageSendEvent_send_tx_signatures(struct LDKPublicKey node_id, struct LDKTxSignatures msg);
56047 * Utility method to constructs a new SendTxInitRbf-variant MessageSendEvent
56049 struct LDKMessageSendEvent MessageSendEvent_send_tx_init_rbf(struct LDKPublicKey node_id, struct LDKTxInitRbf msg);
56052 * Utility method to constructs a new SendTxAckRbf-variant MessageSendEvent
56054 struct LDKMessageSendEvent MessageSendEvent_send_tx_ack_rbf(struct LDKPublicKey node_id, struct LDKTxAckRbf msg);
56057 * Utility method to constructs a new SendTxAbort-variant MessageSendEvent
56059 struct LDKMessageSendEvent MessageSendEvent_send_tx_abort(struct LDKPublicKey node_id, struct LDKTxAbort msg);
56062 * Utility method to constructs a new SendChannelReady-variant MessageSendEvent
56064 struct LDKMessageSendEvent MessageSendEvent_send_channel_ready(struct LDKPublicKey node_id, struct LDKChannelReady msg);
56067 * Utility method to constructs a new SendAnnouncementSignatures-variant MessageSendEvent
56069 struct LDKMessageSendEvent MessageSendEvent_send_announcement_signatures(struct LDKPublicKey node_id, struct LDKAnnouncementSignatures msg);
56072 * Utility method to constructs a new UpdateHTLCs-variant MessageSendEvent
56074 struct LDKMessageSendEvent MessageSendEvent_update_htlcs(struct LDKPublicKey node_id, struct LDKCommitmentUpdate updates);
56077 * Utility method to constructs a new SendRevokeAndACK-variant MessageSendEvent
56079 struct LDKMessageSendEvent MessageSendEvent_send_revoke_and_ack(struct LDKPublicKey node_id, struct LDKRevokeAndACK msg);
56082 * Utility method to constructs a new SendClosingSigned-variant MessageSendEvent
56084 struct LDKMessageSendEvent MessageSendEvent_send_closing_signed(struct LDKPublicKey node_id, struct LDKClosingSigned msg);
56087 * Utility method to constructs a new SendShutdown-variant MessageSendEvent
56089 struct LDKMessageSendEvent MessageSendEvent_send_shutdown(struct LDKPublicKey node_id, struct LDKShutdown msg);
56092 * Utility method to constructs a new SendChannelReestablish-variant MessageSendEvent
56094 struct LDKMessageSendEvent MessageSendEvent_send_channel_reestablish(struct LDKPublicKey node_id, struct LDKChannelReestablish msg);
56097 * Utility method to constructs a new SendChannelAnnouncement-variant MessageSendEvent
56099 struct LDKMessageSendEvent MessageSendEvent_send_channel_announcement(struct LDKPublicKey node_id, struct LDKChannelAnnouncement msg, struct LDKChannelUpdate update_msg);
56102 * Utility method to constructs a new BroadcastChannelAnnouncement-variant MessageSendEvent
56104 struct LDKMessageSendEvent MessageSendEvent_broadcast_channel_announcement(struct LDKChannelAnnouncement msg, struct LDKChannelUpdate update_msg);
56107 * Utility method to constructs a new BroadcastChannelUpdate-variant MessageSendEvent
56109 struct LDKMessageSendEvent MessageSendEvent_broadcast_channel_update(struct LDKChannelUpdate msg);
56112 * Utility method to constructs a new BroadcastNodeAnnouncement-variant MessageSendEvent
56114 struct LDKMessageSendEvent MessageSendEvent_broadcast_node_announcement(struct LDKNodeAnnouncement msg);
56117 * Utility method to constructs a new SendChannelUpdate-variant MessageSendEvent
56119 struct LDKMessageSendEvent MessageSendEvent_send_channel_update(struct LDKPublicKey node_id, struct LDKChannelUpdate msg);
56122 * Utility method to constructs a new HandleError-variant MessageSendEvent
56124 struct LDKMessageSendEvent MessageSendEvent_handle_error(struct LDKPublicKey node_id, struct LDKErrorAction action);
56127 * Utility method to constructs a new SendChannelRangeQuery-variant MessageSendEvent
56129 struct LDKMessageSendEvent MessageSendEvent_send_channel_range_query(struct LDKPublicKey node_id, struct LDKQueryChannelRange msg);
56132 * Utility method to constructs a new SendShortIdsQuery-variant MessageSendEvent
56134 struct LDKMessageSendEvent MessageSendEvent_send_short_ids_query(struct LDKPublicKey node_id, struct LDKQueryShortChannelIds msg);
56137 * Utility method to constructs a new SendReplyChannelRange-variant MessageSendEvent
56139 struct LDKMessageSendEvent MessageSendEvent_send_reply_channel_range(struct LDKPublicKey node_id, struct LDKReplyChannelRange msg);
56142 * Utility method to constructs a new SendGossipTimestampFilter-variant MessageSendEvent
56144 struct LDKMessageSendEvent MessageSendEvent_send_gossip_timestamp_filter(struct LDKPublicKey node_id, struct LDKGossipTimestampFilter msg);
56147 * Calls the free function if one is set
56149 void MessageSendEventsProvider_free(struct LDKMessageSendEventsProvider this_ptr);
56152 * Calls the free function if one is set
56154 void EventsProvider_free(struct LDKEventsProvider this_ptr);
56157 * Calls the free function if one is set
56159 void EventHandler_free(struct LDKEventHandler this_ptr);
56162 * Frees any resources used by the AnchorDescriptor, if is_owned is set and inner is non-NULL.
56164 void AnchorDescriptor_free(struct LDKAnchorDescriptor this_obj);
56167 * The parameters required to derive the signer for the anchor input.
56169 struct LDKChannelDerivationParameters AnchorDescriptor_get_channel_derivation_parameters(const struct LDKAnchorDescriptor *NONNULL_PTR this_ptr);
56172 * The parameters required to derive the signer for the anchor input.
56174 void AnchorDescriptor_set_channel_derivation_parameters(struct LDKAnchorDescriptor *NONNULL_PTR this_ptr, struct LDKChannelDerivationParameters val);
56177 * The transaction input's outpoint corresponding to the commitment transaction's anchor
56180 struct LDKOutPoint AnchorDescriptor_get_outpoint(const struct LDKAnchorDescriptor *NONNULL_PTR this_ptr);
56183 * The transaction input's outpoint corresponding to the commitment transaction's anchor
56186 void AnchorDescriptor_set_outpoint(struct LDKAnchorDescriptor *NONNULL_PTR this_ptr, struct LDKOutPoint val);
56189 * Constructs a new AnchorDescriptor given each field
56191 MUST_USE_RES struct LDKAnchorDescriptor AnchorDescriptor_new(struct LDKChannelDerivationParameters channel_derivation_parameters_arg, struct LDKOutPoint outpoint_arg);
56194 * Creates a copy of the AnchorDescriptor
56196 struct LDKAnchorDescriptor AnchorDescriptor_clone(const struct LDKAnchorDescriptor *NONNULL_PTR orig);
56199 * Checks if two AnchorDescriptors contain equal inner contents.
56200 * This ignores pointers and is_owned flags and looks at the values in fields.
56201 * Two objects with NULL inner values will be considered "equal" here.
56203 bool AnchorDescriptor_eq(const struct LDKAnchorDescriptor *NONNULL_PTR a, const struct LDKAnchorDescriptor *NONNULL_PTR b);
56206 * Returns the UTXO to be spent by the anchor input, which can be obtained via
56207 * [`Self::unsigned_tx_input`].
56209 MUST_USE_RES struct LDKTxOut AnchorDescriptor_previous_utxo(const struct LDKAnchorDescriptor *NONNULL_PTR this_arg);
56212 * Returns the unsigned transaction input spending the anchor output in the commitment
56215 MUST_USE_RES struct LDKTxIn AnchorDescriptor_unsigned_tx_input(const struct LDKAnchorDescriptor *NONNULL_PTR this_arg);
56218 * Returns the witness script of the anchor output in the commitment transaction.
56220 MUST_USE_RES struct LDKCVec_u8Z AnchorDescriptor_witness_script(const struct LDKAnchorDescriptor *NONNULL_PTR this_arg);
56223 * Returns the fully signed witness required to spend the anchor output in the commitment
56226 MUST_USE_RES struct LDKWitness AnchorDescriptor_tx_input_witness(const struct LDKAnchorDescriptor *NONNULL_PTR this_arg, struct LDKECDSASignature signature);
56229 * Derives the channel signer required to sign the anchor input.
56231 MUST_USE_RES struct LDKWriteableEcdsaChannelSigner AnchorDescriptor_derive_channel_signer(const struct LDKAnchorDescriptor *NONNULL_PTR this_arg, const struct LDKSignerProvider *NONNULL_PTR signer_provider);
56234 * Frees any resources used by the BumpTransactionEvent
56236 void BumpTransactionEvent_free(struct LDKBumpTransactionEvent this_ptr);
56239 * Creates a copy of the BumpTransactionEvent
56241 struct LDKBumpTransactionEvent BumpTransactionEvent_clone(const struct LDKBumpTransactionEvent *NONNULL_PTR orig);
56244 * Utility method to constructs a new ChannelClose-variant BumpTransactionEvent
56246 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);
56249 * Utility method to constructs a new HTLCResolution-variant BumpTransactionEvent
56251 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);
56254 * Checks if two BumpTransactionEvents contain equal inner contents.
56255 * This ignores pointers and is_owned flags and looks at the values in fields.
56257 bool BumpTransactionEvent_eq(const struct LDKBumpTransactionEvent *NONNULL_PTR a, const struct LDKBumpTransactionEvent *NONNULL_PTR b);
56260 * Frees any resources used by the Input, if is_owned is set and inner is non-NULL.
56262 void Input_free(struct LDKInput this_obj);
56265 * The unique identifier of the input.
56267 struct LDKOutPoint Input_get_outpoint(const struct LDKInput *NONNULL_PTR this_ptr);
56270 * The unique identifier of the input.
56272 void Input_set_outpoint(struct LDKInput *NONNULL_PTR this_ptr, struct LDKOutPoint val);
56275 * The UTXO being spent by the input.
56277 struct LDKTxOut Input_get_previous_utxo(const struct LDKInput *NONNULL_PTR this_ptr);
56280 * The UTXO being spent by the input.
56282 void Input_set_previous_utxo(struct LDKInput *NONNULL_PTR this_ptr, struct LDKTxOut val);
56285 * The upper-bound weight consumed by the input's full [`TxIn::script_sig`] and
56286 * [`TxIn::witness`], each with their lengths included, required to satisfy the output's
56289 uint64_t Input_get_satisfaction_weight(const struct LDKInput *NONNULL_PTR this_ptr);
56292 * The upper-bound weight consumed by the input's full [`TxIn::script_sig`] and
56293 * [`TxIn::witness`], each with their lengths included, required to satisfy the output's
56296 void Input_set_satisfaction_weight(struct LDKInput *NONNULL_PTR this_ptr, uint64_t val);
56299 * Constructs a new Input given each field
56301 MUST_USE_RES struct LDKInput Input_new(struct LDKOutPoint outpoint_arg, struct LDKTxOut previous_utxo_arg, uint64_t satisfaction_weight_arg);
56304 * Creates a copy of the Input
56306 struct LDKInput Input_clone(const struct LDKInput *NONNULL_PTR orig);
56309 * Generates a non-cryptographic 64-bit hash of the Input.
56311 uint64_t Input_hash(const struct LDKInput *NONNULL_PTR o);
56314 * Checks if two Inputs contain equal inner contents.
56315 * This ignores pointers and is_owned flags and looks at the values in fields.
56316 * Two objects with NULL inner values will be considered "equal" here.
56318 bool Input_eq(const struct LDKInput *NONNULL_PTR a, const struct LDKInput *NONNULL_PTR b);
56321 * Frees any resources used by the Utxo, if is_owned is set and inner is non-NULL.
56323 void Utxo_free(struct LDKUtxo this_obj);
56326 * The unique identifier of the output.
56328 struct LDKOutPoint Utxo_get_outpoint(const struct LDKUtxo *NONNULL_PTR this_ptr);
56331 * The unique identifier of the output.
56333 void Utxo_set_outpoint(struct LDKUtxo *NONNULL_PTR this_ptr, struct LDKOutPoint val);
56336 * The output to spend.
56338 struct LDKTxOut Utxo_get_output(const struct LDKUtxo *NONNULL_PTR this_ptr);
56341 * The output to spend.
56343 void Utxo_set_output(struct LDKUtxo *NONNULL_PTR this_ptr, struct LDKTxOut val);
56346 * The upper-bound weight consumed by the input's full [`TxIn::script_sig`] and [`TxIn::witness`], each
56347 * with their lengths included, required to satisfy the output's script. The weight consumed by
56348 * the input's `script_sig` must account for [`WITNESS_SCALE_FACTOR`].
56350 uint64_t Utxo_get_satisfaction_weight(const struct LDKUtxo *NONNULL_PTR this_ptr);
56353 * The upper-bound weight consumed by the input's full [`TxIn::script_sig`] and [`TxIn::witness`], each
56354 * with their lengths included, required to satisfy the output's script. The weight consumed by
56355 * the input's `script_sig` must account for [`WITNESS_SCALE_FACTOR`].
56357 void Utxo_set_satisfaction_weight(struct LDKUtxo *NONNULL_PTR this_ptr, uint64_t val);
56360 * Constructs a new Utxo given each field
56362 MUST_USE_RES struct LDKUtxo Utxo_new(struct LDKOutPoint outpoint_arg, struct LDKTxOut output_arg, uint64_t satisfaction_weight_arg);
56365 * Creates a copy of the Utxo
56367 struct LDKUtxo Utxo_clone(const struct LDKUtxo *NONNULL_PTR orig);
56370 * Generates a non-cryptographic 64-bit hash of the Utxo.
56372 uint64_t Utxo_hash(const struct LDKUtxo *NONNULL_PTR o);
56375 * Checks if two Utxos contain equal inner contents.
56376 * This ignores pointers and is_owned flags and looks at the values in fields.
56377 * Two objects with NULL inner values will be considered "equal" here.
56379 bool Utxo_eq(const struct LDKUtxo *NONNULL_PTR a, const struct LDKUtxo *NONNULL_PTR b);
56382 * Returns a `Utxo` with the `satisfaction_weight` estimate for a legacy P2PKH output.
56384 MUST_USE_RES struct LDKUtxo Utxo_new_p2pkh(struct LDKOutPoint outpoint, uint64_t value, const uint8_t (*pubkey_hash)[20]);
56387 * Frees any resources used by the CoinSelection, if is_owned is set and inner is non-NULL.
56389 void CoinSelection_free(struct LDKCoinSelection this_obj);
56392 * The set of UTXOs (with at least 1 confirmation) to spend and use within a transaction
56393 * requiring additional fees.
56395 struct LDKCVec_UtxoZ CoinSelection_get_confirmed_utxos(const struct LDKCoinSelection *NONNULL_PTR this_ptr);
56398 * The set of UTXOs (with at least 1 confirmation) to spend and use within a transaction
56399 * requiring additional fees.
56401 void CoinSelection_set_confirmed_utxos(struct LDKCoinSelection *NONNULL_PTR this_ptr, struct LDKCVec_UtxoZ val);
56404 * An additional output tracking whether any change remained after coin selection. This output
56405 * should always have a value above dust for its given `script_pubkey`. It should not be
56406 * spent until the transaction it belongs to confirms to ensure mempool descendant limits are
56407 * not met. This implies no other party should be able to spend it except us.
56409 struct LDKCOption_TxOutZ CoinSelection_get_change_output(const struct LDKCoinSelection *NONNULL_PTR this_ptr);
56412 * An additional output tracking whether any change remained after coin selection. This output
56413 * should always have a value above dust for its given `script_pubkey`. It should not be
56414 * spent until the transaction it belongs to confirms to ensure mempool descendant limits are
56415 * not met. This implies no other party should be able to spend it except us.
56417 void CoinSelection_set_change_output(struct LDKCoinSelection *NONNULL_PTR this_ptr, struct LDKCOption_TxOutZ val);
56420 * Constructs a new CoinSelection given each field
56422 MUST_USE_RES struct LDKCoinSelection CoinSelection_new(struct LDKCVec_UtxoZ confirmed_utxos_arg, struct LDKCOption_TxOutZ change_output_arg);
56425 * Creates a copy of the CoinSelection
56427 struct LDKCoinSelection CoinSelection_clone(const struct LDKCoinSelection *NONNULL_PTR orig);
56430 * Calls the free function if one is set
56432 void CoinSelectionSource_free(struct LDKCoinSelectionSource this_ptr);
56435 * Calls the free function if one is set
56437 void WalletSource_free(struct LDKWalletSource this_ptr);
56440 * Frees any resources used by the Wallet, if is_owned is set and inner is non-NULL.
56442 void Wallet_free(struct LDKWallet this_obj);
56445 * Returns a new instance backed by the given [`WalletSource`] that serves as an implementation
56446 * of [`CoinSelectionSource`].
56448 MUST_USE_RES struct LDKWallet Wallet_new(struct LDKWalletSource source, struct LDKLogger logger);
56451 * Constructs a new CoinSelectionSource which calls the relevant methods on this_arg.
56452 * This copies the `inner` pointer in this_arg and thus the returned CoinSelectionSource must be freed before this_arg is
56454 struct LDKCoinSelectionSource Wallet_as_CoinSelectionSource(const struct LDKWallet *NONNULL_PTR this_arg);
56457 * Frees any resources used by the BumpTransactionEventHandler, if is_owned is set and inner is non-NULL.
56459 void BumpTransactionEventHandler_free(struct LDKBumpTransactionEventHandler this_obj);
56462 * Returns a new instance capable of handling [`Event::BumpTransaction`] events.
56464 * [`Event::BumpTransaction`]: crate::events::Event::BumpTransaction
56466 MUST_USE_RES struct LDKBumpTransactionEventHandler BumpTransactionEventHandler_new(struct LDKBroadcasterInterface broadcaster, struct LDKCoinSelectionSource utxo_source, struct LDKSignerProvider signer_provider, struct LDKLogger logger);
56469 * Handles all variants of [`BumpTransactionEvent`].
56471 void BumpTransactionEventHandler_handle_event(const struct LDKBumpTransactionEventHandler *NONNULL_PTR this_arg, const struct LDKBumpTransactionEvent *NONNULL_PTR event);
56474 * Frees any resources used by the FilesystemStore, if is_owned is set and inner is non-NULL.
56476 void FilesystemStore_free(struct LDKFilesystemStore this_obj);
56479 * Constructs a new [`FilesystemStore`].
56481 MUST_USE_RES struct LDKFilesystemStore FilesystemStore_new(struct LDKStr data_dir);
56484 * Returns the data directory.
56486 MUST_USE_RES struct LDKStr FilesystemStore_get_data_dir(const struct LDKFilesystemStore *NONNULL_PTR this_arg);
56489 * Constructs a new KVStore which calls the relevant methods on this_arg.
56490 * This copies the `inner` pointer in this_arg and thus the returned KVStore must be freed before this_arg is
56492 struct LDKKVStore FilesystemStore_as_KVStore(const struct LDKFilesystemStore *NONNULL_PTR this_arg);
56495 * Frees any resources used by the BackgroundProcessor, if is_owned is set and inner is non-NULL.
56497 void BackgroundProcessor_free(struct LDKBackgroundProcessor this_obj);
56500 * Frees any resources used by the GossipSync
56502 void GossipSync_free(struct LDKGossipSync this_ptr);
56505 * Utility method to constructs a new P2P-variant GossipSync
56507 struct LDKGossipSync GossipSync_p2_p(const struct LDKP2PGossipSync *NONNULL_PTR a);
56510 * Utility method to constructs a new Rapid-variant GossipSync
56512 struct LDKGossipSync GossipSync_rapid(const struct LDKRapidGossipSync *NONNULL_PTR a);
56515 * Utility method to constructs a new None-variant GossipSync
56517 struct LDKGossipSync GossipSync_none(void);
56520 * Start a background thread that takes care of responsibilities enumerated in the [top-level
56523 * The thread runs indefinitely unless the object is dropped, [`stop`] is called, or
56524 * [`Persister::persist_manager`] returns an error. In case of an error, the error is retrieved by calling
56525 * either [`join`] or [`stop`].
56527 * # Data Persistence
56529 * [`Persister::persist_manager`] is responsible for writing out the [`ChannelManager`] to disk, and/or
56530 * uploading to one or more backup services. See [`ChannelManager::write`] for writing out a
56531 * [`ChannelManager`]. See the `lightning-persister` crate for LDK's
56532 * provided implementation.
56534 * [`Persister::persist_graph`] is responsible for writing out the [`NetworkGraph`] to disk, if
56535 * [`GossipSync`] is supplied. See [`NetworkGraph::write`] for writing out a [`NetworkGraph`].
56536 * See the `lightning-persister` crate for LDK's provided implementation.
56538 * Typically, users should either implement [`Persister::persist_manager`] to never return an
56539 * error or call [`join`] and handle any error that may arise. For the latter case,
56540 * `BackgroundProcessor` must be restarted by calling `start` again after handling the error.
56544 * `event_handler` is responsible for handling events that users should be notified of (e.g.,
56545 * payment failed). [`BackgroundProcessor`] may decorate the given [`EventHandler`] with common
56546 * functionality implemented by other handlers.
56547 * * [`P2PGossipSync`] if given will update the [`NetworkGraph`] based on payment failures.
56549 * # Rapid Gossip Sync
56551 * If rapid gossip sync is meant to run at startup, pass [`RapidGossipSync`] via `gossip_sync`
56552 * to indicate that the [`BackgroundProcessor`] should not prune the [`NetworkGraph`] instance
56553 * until the [`RapidGossipSync`] instance completes its first sync.
56555 * [top-level documentation]: BackgroundProcessor
56556 * [`join`]: Self::join
56557 * [`stop`]: Self::stop
56558 * [`ChannelManager`]: lightning::ln::channelmanager::ChannelManager
56559 * [`ChannelManager::write`]: lightning::ln::channelmanager::ChannelManager#impl-Writeable
56560 * [`Persister::persist_manager`]: lightning::util::persist::Persister::persist_manager
56561 * [`Persister::persist_graph`]: lightning::util::persist::Persister::persist_graph
56562 * [`NetworkGraph`]: lightning::routing::gossip::NetworkGraph
56563 * [`NetworkGraph::write`]: lightning::routing::gossip::NetworkGraph#impl-Writeable
56565 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);
56568 * Join `BackgroundProcessor`'s thread, returning any error that occurred while persisting
56569 * [`ChannelManager`].
56573 * This function panics if the background thread has panicked such as while persisting or
56576 * [`ChannelManager`]: lightning::ln::channelmanager::ChannelManager
56578 MUST_USE_RES struct LDKCResult_NoneIOErrorZ BackgroundProcessor_join(struct LDKBackgroundProcessor this_arg);
56581 * Stop `BackgroundProcessor`'s thread, returning any error that occurred while persisting
56582 * [`ChannelManager`].
56586 * This function panics if the background thread has panicked such as while persisting or
56589 * [`ChannelManager`]: lightning::ln::channelmanager::ChannelManager
56591 MUST_USE_RES struct LDKCResult_NoneIOErrorZ BackgroundProcessor_stop(struct LDKBackgroundProcessor this_arg);
56594 * Frees any resources used by the Bolt11ParseError
56596 void Bolt11ParseError_free(struct LDKBolt11ParseError this_ptr);
56599 * Creates a copy of the Bolt11ParseError
56601 struct LDKBolt11ParseError Bolt11ParseError_clone(const struct LDKBolt11ParseError *NONNULL_PTR orig);
56604 * Utility method to constructs a new Bech32Error-variant Bolt11ParseError
56606 struct LDKBolt11ParseError Bolt11ParseError_bech32_error(struct LDKBech32Error a);
56609 * Utility method to constructs a new ParseAmountError-variant Bolt11ParseError
56611 struct LDKBolt11ParseError Bolt11ParseError_parse_amount_error(struct LDKError a);
56614 * Utility method to constructs a new MalformedSignature-variant Bolt11ParseError
56616 struct LDKBolt11ParseError Bolt11ParseError_malformed_signature(enum LDKSecp256k1Error a);
56619 * Utility method to constructs a new BadPrefix-variant Bolt11ParseError
56621 struct LDKBolt11ParseError Bolt11ParseError_bad_prefix(void);
56624 * Utility method to constructs a new UnknownCurrency-variant Bolt11ParseError
56626 struct LDKBolt11ParseError Bolt11ParseError_unknown_currency(void);
56629 * Utility method to constructs a new UnknownSiPrefix-variant Bolt11ParseError
56631 struct LDKBolt11ParseError Bolt11ParseError_unknown_si_prefix(void);
56634 * Utility method to constructs a new MalformedHRP-variant Bolt11ParseError
56636 struct LDKBolt11ParseError Bolt11ParseError_malformed_hrp(void);
56639 * Utility method to constructs a new TooShortDataPart-variant Bolt11ParseError
56641 struct LDKBolt11ParseError Bolt11ParseError_too_short_data_part(void);
56644 * Utility method to constructs a new UnexpectedEndOfTaggedFields-variant Bolt11ParseError
56646 struct LDKBolt11ParseError Bolt11ParseError_unexpected_end_of_tagged_fields(void);
56649 * Utility method to constructs a new DescriptionDecodeError-variant Bolt11ParseError
56651 struct LDKBolt11ParseError Bolt11ParseError_description_decode_error(struct LDKError a);
56654 * Utility method to constructs a new PaddingError-variant Bolt11ParseError
56656 struct LDKBolt11ParseError Bolt11ParseError_padding_error(void);
56659 * Utility method to constructs a new IntegerOverflowError-variant Bolt11ParseError
56661 struct LDKBolt11ParseError Bolt11ParseError_integer_overflow_error(void);
56664 * Utility method to constructs a new InvalidSegWitProgramLength-variant Bolt11ParseError
56666 struct LDKBolt11ParseError Bolt11ParseError_invalid_seg_wit_program_length(void);
56669 * Utility method to constructs a new InvalidPubKeyHashLength-variant Bolt11ParseError
56671 struct LDKBolt11ParseError Bolt11ParseError_invalid_pub_key_hash_length(void);
56674 * Utility method to constructs a new InvalidScriptHashLength-variant Bolt11ParseError
56676 struct LDKBolt11ParseError Bolt11ParseError_invalid_script_hash_length(void);
56679 * Utility method to constructs a new InvalidRecoveryId-variant Bolt11ParseError
56681 struct LDKBolt11ParseError Bolt11ParseError_invalid_recovery_id(void);
56684 * Utility method to constructs a new InvalidSliceLength-variant Bolt11ParseError
56686 struct LDKBolt11ParseError Bolt11ParseError_invalid_slice_length(struct LDKStr a);
56689 * Utility method to constructs a new Skip-variant Bolt11ParseError
56691 struct LDKBolt11ParseError Bolt11ParseError_skip(void);
56694 * Checks if two Bolt11ParseErrors contain equal inner contents.
56695 * This ignores pointers and is_owned flags and looks at the values in fields.
56697 bool Bolt11ParseError_eq(const struct LDKBolt11ParseError *NONNULL_PTR a, const struct LDKBolt11ParseError *NONNULL_PTR b);
56700 * Frees any resources used by the ParseOrSemanticError
56702 void ParseOrSemanticError_free(struct LDKParseOrSemanticError this_ptr);
56705 * Creates a copy of the ParseOrSemanticError
56707 struct LDKParseOrSemanticError ParseOrSemanticError_clone(const struct LDKParseOrSemanticError *NONNULL_PTR orig);
56710 * Utility method to constructs a new ParseError-variant ParseOrSemanticError
56712 struct LDKParseOrSemanticError ParseOrSemanticError_parse_error(struct LDKBolt11ParseError a);
56715 * Utility method to constructs a new SemanticError-variant ParseOrSemanticError
56717 struct LDKParseOrSemanticError ParseOrSemanticError_semantic_error(enum LDKBolt11SemanticError a);
56720 * Checks if two ParseOrSemanticErrors contain equal inner contents.
56721 * This ignores pointers and is_owned flags and looks at the values in fields.
56723 bool ParseOrSemanticError_eq(const struct LDKParseOrSemanticError *NONNULL_PTR a, const struct LDKParseOrSemanticError *NONNULL_PTR b);
56726 * Frees any resources used by the Bolt11Invoice, if is_owned is set and inner is non-NULL.
56728 void Bolt11Invoice_free(struct LDKBolt11Invoice this_obj);
56731 * Checks if two Bolt11Invoices contain equal inner contents.
56732 * This ignores pointers and is_owned flags and looks at the values in fields.
56733 * Two objects with NULL inner values will be considered "equal" here.
56735 bool Bolt11Invoice_eq(const struct LDKBolt11Invoice *NONNULL_PTR a, const struct LDKBolt11Invoice *NONNULL_PTR b);
56738 * Creates a copy of the Bolt11Invoice
56740 struct LDKBolt11Invoice Bolt11Invoice_clone(const struct LDKBolt11Invoice *NONNULL_PTR orig);
56743 * Generates a non-cryptographic 64-bit hash of the Bolt11Invoice.
56745 uint64_t Bolt11Invoice_hash(const struct LDKBolt11Invoice *NONNULL_PTR o);
56748 * Frees any resources used by the SignedRawBolt11Invoice, if is_owned is set and inner is non-NULL.
56750 void SignedRawBolt11Invoice_free(struct LDKSignedRawBolt11Invoice this_obj);
56753 * Checks if two SignedRawBolt11Invoices contain equal inner contents.
56754 * This ignores pointers and is_owned flags and looks at the values in fields.
56755 * Two objects with NULL inner values will be considered "equal" here.
56757 bool SignedRawBolt11Invoice_eq(const struct LDKSignedRawBolt11Invoice *NONNULL_PTR a, const struct LDKSignedRawBolt11Invoice *NONNULL_PTR b);
56760 * Creates a copy of the SignedRawBolt11Invoice
56762 struct LDKSignedRawBolt11Invoice SignedRawBolt11Invoice_clone(const struct LDKSignedRawBolt11Invoice *NONNULL_PTR orig);
56765 * Generates a non-cryptographic 64-bit hash of the SignedRawBolt11Invoice.
56767 uint64_t SignedRawBolt11Invoice_hash(const struct LDKSignedRawBolt11Invoice *NONNULL_PTR o);
56770 * Frees any resources used by the RawBolt11Invoice, if is_owned is set and inner is non-NULL.
56772 void RawBolt11Invoice_free(struct LDKRawBolt11Invoice this_obj);
56777 struct LDKRawDataPart RawBolt11Invoice_get_data(const struct LDKRawBolt11Invoice *NONNULL_PTR this_ptr);
56782 void RawBolt11Invoice_set_data(struct LDKRawBolt11Invoice *NONNULL_PTR this_ptr, struct LDKRawDataPart val);
56785 * Checks if two RawBolt11Invoices contain equal inner contents.
56786 * This ignores pointers and is_owned flags and looks at the values in fields.
56787 * Two objects with NULL inner values will be considered "equal" here.
56789 bool RawBolt11Invoice_eq(const struct LDKRawBolt11Invoice *NONNULL_PTR a, const struct LDKRawBolt11Invoice *NONNULL_PTR b);
56792 * Creates a copy of the RawBolt11Invoice
56794 struct LDKRawBolt11Invoice RawBolt11Invoice_clone(const struct LDKRawBolt11Invoice *NONNULL_PTR orig);
56797 * Generates a non-cryptographic 64-bit hash of the RawBolt11Invoice.
56799 uint64_t RawBolt11Invoice_hash(const struct LDKRawBolt11Invoice *NONNULL_PTR o);
56802 * Frees any resources used by the RawDataPart, if is_owned is set and inner is non-NULL.
56804 void RawDataPart_free(struct LDKRawDataPart this_obj);
56807 * generation time of the invoice
56809 struct LDKPositiveTimestamp RawDataPart_get_timestamp(const struct LDKRawDataPart *NONNULL_PTR this_ptr);
56812 * generation time of the invoice
56814 void RawDataPart_set_timestamp(struct LDKRawDataPart *NONNULL_PTR this_ptr, struct LDKPositiveTimestamp val);
56817 * Checks if two RawDataParts contain equal inner contents.
56818 * This ignores pointers and is_owned flags and looks at the values in fields.
56819 * Two objects with NULL inner values will be considered "equal" here.
56821 bool RawDataPart_eq(const struct LDKRawDataPart *NONNULL_PTR a, const struct LDKRawDataPart *NONNULL_PTR b);
56824 * Creates a copy of the RawDataPart
56826 struct LDKRawDataPart RawDataPart_clone(const struct LDKRawDataPart *NONNULL_PTR orig);
56829 * Generates a non-cryptographic 64-bit hash of the RawDataPart.
56831 uint64_t RawDataPart_hash(const struct LDKRawDataPart *NONNULL_PTR o);
56834 * Frees any resources used by the PositiveTimestamp, if is_owned is set and inner is non-NULL.
56836 void PositiveTimestamp_free(struct LDKPositiveTimestamp this_obj);
56839 * Checks if two PositiveTimestamps contain equal inner contents.
56840 * This ignores pointers and is_owned flags and looks at the values in fields.
56841 * Two objects with NULL inner values will be considered "equal" here.
56843 bool PositiveTimestamp_eq(const struct LDKPositiveTimestamp *NONNULL_PTR a, const struct LDKPositiveTimestamp *NONNULL_PTR b);
56846 * Creates a copy of the PositiveTimestamp
56848 struct LDKPositiveTimestamp PositiveTimestamp_clone(const struct LDKPositiveTimestamp *NONNULL_PTR orig);
56851 * Generates a non-cryptographic 64-bit hash of the PositiveTimestamp.
56853 uint64_t PositiveTimestamp_hash(const struct LDKPositiveTimestamp *NONNULL_PTR o);
56856 * Creates a copy of the SiPrefix
56858 enum LDKSiPrefix SiPrefix_clone(const enum LDKSiPrefix *NONNULL_PTR orig);
56861 * Utility method to constructs a new Milli-variant SiPrefix
56863 enum LDKSiPrefix SiPrefix_milli(void);
56866 * Utility method to constructs a new Micro-variant SiPrefix
56868 enum LDKSiPrefix SiPrefix_micro(void);
56871 * Utility method to constructs a new Nano-variant SiPrefix
56873 enum LDKSiPrefix SiPrefix_nano(void);
56876 * Utility method to constructs a new Pico-variant SiPrefix
56878 enum LDKSiPrefix SiPrefix_pico(void);
56881 * Checks if two SiPrefixs contain equal inner contents.
56882 * This ignores pointers and is_owned flags and looks at the values in fields.
56884 bool SiPrefix_eq(const enum LDKSiPrefix *NONNULL_PTR a, const enum LDKSiPrefix *NONNULL_PTR b);
56887 * Generates a non-cryptographic 64-bit hash of the SiPrefix.
56889 uint64_t SiPrefix_hash(const enum LDKSiPrefix *NONNULL_PTR o);
56892 * Returns the multiplier to go from a BTC value to picoBTC implied by this SiPrefix.
56893 * This is effectively 10^12 * the prefix multiplier
56895 MUST_USE_RES uint64_t SiPrefix_multiplier(const enum LDKSiPrefix *NONNULL_PTR this_arg);
56898 * Creates a copy of the Currency
56900 enum LDKCurrency Currency_clone(const enum LDKCurrency *NONNULL_PTR orig);
56903 * Utility method to constructs a new Bitcoin-variant Currency
56905 enum LDKCurrency Currency_bitcoin(void);
56908 * Utility method to constructs a new BitcoinTestnet-variant Currency
56910 enum LDKCurrency Currency_bitcoin_testnet(void);
56913 * Utility method to constructs a new Regtest-variant Currency
56915 enum LDKCurrency Currency_regtest(void);
56918 * Utility method to constructs a new Simnet-variant Currency
56920 enum LDKCurrency Currency_simnet(void);
56923 * Utility method to constructs a new Signet-variant Currency
56925 enum LDKCurrency Currency_signet(void);
56928 * Generates a non-cryptographic 64-bit hash of the Currency.
56930 uint64_t Currency_hash(const enum LDKCurrency *NONNULL_PTR o);
56933 * Checks if two Currencys contain equal inner contents.
56934 * This ignores pointers and is_owned flags and looks at the values in fields.
56936 bool Currency_eq(const enum LDKCurrency *NONNULL_PTR a, const enum LDKCurrency *NONNULL_PTR b);
56939 * Frees any resources used by the Sha256, if is_owned is set and inner is non-NULL.
56941 void Sha256_free(struct LDKSha256 this_obj);
56944 * Creates a copy of the Sha256
56946 struct LDKSha256 Sha256_clone(const struct LDKSha256 *NONNULL_PTR orig);
56949 * Generates a non-cryptographic 64-bit hash of the Sha256.
56951 uint64_t Sha256_hash(const struct LDKSha256 *NONNULL_PTR o);
56954 * Checks if two Sha256s contain equal inner contents.
56955 * This ignores pointers and is_owned flags and looks at the values in fields.
56956 * Two objects with NULL inner values will be considered "equal" here.
56958 bool Sha256_eq(const struct LDKSha256 *NONNULL_PTR a, const struct LDKSha256 *NONNULL_PTR b);
56961 * Constructs a new [`Sha256`] from the given bytes, which are assumed to be the output of a
56962 * single sha256 hash.
56964 MUST_USE_RES struct LDKSha256 Sha256_from_bytes(const uint8_t (*bytes)[32]);
56967 * Frees any resources used by the Description, if is_owned is set and inner is non-NULL.
56969 void Description_free(struct LDKDescription this_obj);
56972 * Creates a copy of the Description
56974 struct LDKDescription Description_clone(const struct LDKDescription *NONNULL_PTR orig);
56977 * Generates a non-cryptographic 64-bit hash of the Description.
56979 uint64_t Description_hash(const struct LDKDescription *NONNULL_PTR o);
56982 * Checks if two Descriptions contain equal inner contents.
56983 * This ignores pointers and is_owned flags and looks at the values in fields.
56984 * Two objects with NULL inner values will be considered "equal" here.
56986 bool Description_eq(const struct LDKDescription *NONNULL_PTR a, const struct LDKDescription *NONNULL_PTR b);
56989 * Frees any resources used by the PayeePubKey, if is_owned is set and inner is non-NULL.
56991 void PayeePubKey_free(struct LDKPayeePubKey this_obj);
56993 struct LDKPublicKey PayeePubKey_get_a(const struct LDKPayeePubKey *NONNULL_PTR this_ptr);
56995 void PayeePubKey_set_a(struct LDKPayeePubKey *NONNULL_PTR this_ptr, struct LDKPublicKey val);
56998 * Constructs a new PayeePubKey given each field
57000 MUST_USE_RES struct LDKPayeePubKey PayeePubKey_new(struct LDKPublicKey a_arg);
57003 * Creates a copy of the PayeePubKey
57005 struct LDKPayeePubKey PayeePubKey_clone(const struct LDKPayeePubKey *NONNULL_PTR orig);
57008 * Generates a non-cryptographic 64-bit hash of the PayeePubKey.
57010 uint64_t PayeePubKey_hash(const struct LDKPayeePubKey *NONNULL_PTR o);
57013 * Checks if two PayeePubKeys contain equal inner contents.
57014 * This ignores pointers and is_owned flags and looks at the values in fields.
57015 * Two objects with NULL inner values will be considered "equal" here.
57017 bool PayeePubKey_eq(const struct LDKPayeePubKey *NONNULL_PTR a, const struct LDKPayeePubKey *NONNULL_PTR b);
57020 * Frees any resources used by the ExpiryTime, if is_owned is set and inner is non-NULL.
57022 void ExpiryTime_free(struct LDKExpiryTime this_obj);
57025 * Creates a copy of the ExpiryTime
57027 struct LDKExpiryTime ExpiryTime_clone(const struct LDKExpiryTime *NONNULL_PTR orig);
57030 * Generates a non-cryptographic 64-bit hash of the ExpiryTime.
57032 uint64_t ExpiryTime_hash(const struct LDKExpiryTime *NONNULL_PTR o);
57035 * Checks if two ExpiryTimes contain equal inner contents.
57036 * This ignores pointers and is_owned flags and looks at the values in fields.
57037 * Two objects with NULL inner values will be considered "equal" here.
57039 bool ExpiryTime_eq(const struct LDKExpiryTime *NONNULL_PTR a, const struct LDKExpiryTime *NONNULL_PTR b);
57042 * Frees any resources used by the MinFinalCltvExpiryDelta, if is_owned is set and inner is non-NULL.
57044 void MinFinalCltvExpiryDelta_free(struct LDKMinFinalCltvExpiryDelta this_obj);
57046 uint64_t MinFinalCltvExpiryDelta_get_a(const struct LDKMinFinalCltvExpiryDelta *NONNULL_PTR this_ptr);
57048 void MinFinalCltvExpiryDelta_set_a(struct LDKMinFinalCltvExpiryDelta *NONNULL_PTR this_ptr, uint64_t val);
57051 * Constructs a new MinFinalCltvExpiryDelta given each field
57053 MUST_USE_RES struct LDKMinFinalCltvExpiryDelta MinFinalCltvExpiryDelta_new(uint64_t a_arg);
57056 * Creates a copy of the MinFinalCltvExpiryDelta
57058 struct LDKMinFinalCltvExpiryDelta MinFinalCltvExpiryDelta_clone(const struct LDKMinFinalCltvExpiryDelta *NONNULL_PTR orig);
57061 * Generates a non-cryptographic 64-bit hash of the MinFinalCltvExpiryDelta.
57063 uint64_t MinFinalCltvExpiryDelta_hash(const struct LDKMinFinalCltvExpiryDelta *NONNULL_PTR o);
57066 * Checks if two MinFinalCltvExpiryDeltas contain equal inner contents.
57067 * This ignores pointers and is_owned flags and looks at the values in fields.
57068 * Two objects with NULL inner values will be considered "equal" here.
57070 bool MinFinalCltvExpiryDelta_eq(const struct LDKMinFinalCltvExpiryDelta *NONNULL_PTR a, const struct LDKMinFinalCltvExpiryDelta *NONNULL_PTR b);
57073 * Frees any resources used by the Fallback
57075 void Fallback_free(struct LDKFallback this_ptr);
57078 * Creates a copy of the Fallback
57080 struct LDKFallback Fallback_clone(const struct LDKFallback *NONNULL_PTR orig);
57083 * Utility method to constructs a new SegWitProgram-variant Fallback
57085 struct LDKFallback Fallback_seg_wit_program(struct LDKWitnessVersion version, struct LDKCVec_u8Z program);
57088 * Utility method to constructs a new PubKeyHash-variant Fallback
57090 struct LDKFallback Fallback_pub_key_hash(struct LDKTwentyBytes a);
57093 * Utility method to constructs a new ScriptHash-variant Fallback
57095 struct LDKFallback Fallback_script_hash(struct LDKTwentyBytes a);
57098 * Generates a non-cryptographic 64-bit hash of the Fallback.
57100 uint64_t Fallback_hash(const struct LDKFallback *NONNULL_PTR o);
57103 * Checks if two Fallbacks contain equal inner contents.
57104 * This ignores pointers and is_owned flags and looks at the values in fields.
57106 bool Fallback_eq(const struct LDKFallback *NONNULL_PTR a, const struct LDKFallback *NONNULL_PTR b);
57109 * Frees any resources used by the Bolt11InvoiceSignature, if is_owned is set and inner is non-NULL.
57111 void Bolt11InvoiceSignature_free(struct LDKBolt11InvoiceSignature this_obj);
57114 * Creates a copy of the Bolt11InvoiceSignature
57116 struct LDKBolt11InvoiceSignature Bolt11InvoiceSignature_clone(const struct LDKBolt11InvoiceSignature *NONNULL_PTR orig);
57119 * Generates a non-cryptographic 64-bit hash of the Bolt11InvoiceSignature.
57121 uint64_t Bolt11InvoiceSignature_hash(const struct LDKBolt11InvoiceSignature *NONNULL_PTR o);
57124 * Checks if two Bolt11InvoiceSignatures contain equal inner contents.
57125 * This ignores pointers and is_owned flags and looks at the values in fields.
57126 * Two objects with NULL inner values will be considered "equal" here.
57128 bool Bolt11InvoiceSignature_eq(const struct LDKBolt11InvoiceSignature *NONNULL_PTR a, const struct LDKBolt11InvoiceSignature *NONNULL_PTR b);
57131 * Frees any resources used by the PrivateRoute, if is_owned is set and inner is non-NULL.
57133 void PrivateRoute_free(struct LDKPrivateRoute this_obj);
57136 * Creates a copy of the PrivateRoute
57138 struct LDKPrivateRoute PrivateRoute_clone(const struct LDKPrivateRoute *NONNULL_PTR orig);
57141 * Generates a non-cryptographic 64-bit hash of the PrivateRoute.
57143 uint64_t PrivateRoute_hash(const struct LDKPrivateRoute *NONNULL_PTR o);
57146 * Checks if two PrivateRoutes contain equal inner contents.
57147 * This ignores pointers and is_owned flags and looks at the values in fields.
57148 * Two objects with NULL inner values will be considered "equal" here.
57150 bool PrivateRoute_eq(const struct LDKPrivateRoute *NONNULL_PTR a, const struct LDKPrivateRoute *NONNULL_PTR b);
57153 * Disassembles the `SignedRawBolt11Invoice` into its three parts:
57155 * 2. hash of the raw invoice
57158 MUST_USE_RES struct LDKC3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ SignedRawBolt11Invoice_into_parts(struct LDKSignedRawBolt11Invoice this_arg);
57161 * The [`RawBolt11Invoice`] which was signed.
57163 MUST_USE_RES struct LDKRawBolt11Invoice SignedRawBolt11Invoice_raw_invoice(const struct LDKSignedRawBolt11Invoice *NONNULL_PTR this_arg);
57166 * The hash of the [`RawBolt11Invoice`] that was signed.
57168 MUST_USE_RES const uint8_t (*SignedRawBolt11Invoice_signable_hash(const struct LDKSignedRawBolt11Invoice *NONNULL_PTR this_arg))[32];
57171 * Signature for the invoice.
57173 MUST_USE_RES struct LDKBolt11InvoiceSignature SignedRawBolt11Invoice_signature(const struct LDKSignedRawBolt11Invoice *NONNULL_PTR this_arg);
57176 * Recovers the public key used for signing the invoice from the recoverable signature.
57178 MUST_USE_RES struct LDKCResult_PayeePubKeySecp256k1ErrorZ SignedRawBolt11Invoice_recover_payee_pub_key(const struct LDKSignedRawBolt11Invoice *NONNULL_PTR this_arg);
57181 * Checks if the signature is valid for the included payee public key or if none exists if it's
57182 * valid for the recovered signature (which should always be true?).
57184 MUST_USE_RES bool SignedRawBolt11Invoice_check_signature(const struct LDKSignedRawBolt11Invoice *NONNULL_PTR this_arg);
57187 * Calculate the hash of the encoded `RawBolt11Invoice` which should be signed.
57189 MUST_USE_RES struct LDKThirtyTwoBytes RawBolt11Invoice_signable_hash(const struct LDKRawBolt11Invoice *NONNULL_PTR this_arg);
57193 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
57195 MUST_USE_RES struct LDKSha256 RawBolt11Invoice_payment_hash(const struct LDKRawBolt11Invoice *NONNULL_PTR this_arg);
57199 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
57201 MUST_USE_RES struct LDKDescription RawBolt11Invoice_description(const struct LDKRawBolt11Invoice *NONNULL_PTR this_arg);
57205 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
57207 MUST_USE_RES struct LDKPayeePubKey RawBolt11Invoice_payee_pub_key(const struct LDKRawBolt11Invoice *NONNULL_PTR this_arg);
57211 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
57213 MUST_USE_RES struct LDKSha256 RawBolt11Invoice_description_hash(const struct LDKRawBolt11Invoice *NONNULL_PTR this_arg);
57217 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
57219 MUST_USE_RES struct LDKExpiryTime RawBolt11Invoice_expiry_time(const struct LDKRawBolt11Invoice *NONNULL_PTR this_arg);
57223 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
57225 MUST_USE_RES struct LDKMinFinalCltvExpiryDelta RawBolt11Invoice_min_final_cltv_expiry_delta(const struct LDKRawBolt11Invoice *NONNULL_PTR this_arg);
57227 MUST_USE_RES struct LDKCOption_ThirtyTwoBytesZ RawBolt11Invoice_payment_secret(const struct LDKRawBolt11Invoice *NONNULL_PTR this_arg);
57229 MUST_USE_RES struct LDKCOption_CVec_u8ZZ RawBolt11Invoice_payment_metadata(const struct LDKRawBolt11Invoice *NONNULL_PTR this_arg);
57233 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
57235 MUST_USE_RES struct LDKBolt11InvoiceFeatures RawBolt11Invoice_features(const struct LDKRawBolt11Invoice *NONNULL_PTR this_arg);
57237 MUST_USE_RES struct LDKCVec_PrivateRouteZ RawBolt11Invoice_private_routes(const struct LDKRawBolt11Invoice *NONNULL_PTR this_arg);
57240 * Returns `None` if no amount is set or on overflow.
57242 MUST_USE_RES struct LDKCOption_u64Z RawBolt11Invoice_amount_pico_btc(const struct LDKRawBolt11Invoice *NONNULL_PTR this_arg);
57244 MUST_USE_RES enum LDKCurrency RawBolt11Invoice_currency(const struct LDKRawBolt11Invoice *NONNULL_PTR this_arg);
57247 * Creates a `PositiveTimestamp` from a Unix timestamp in the range `0..=MAX_TIMESTAMP`.
57249 * Otherwise, returns a [`CreationError::TimestampOutOfBounds`].
57251 MUST_USE_RES struct LDKCResult_PositiveTimestampCreationErrorZ PositiveTimestamp_from_unix_timestamp(uint64_t unix_seconds);
57254 * Creates a `PositiveTimestamp` from a [`SystemTime`] with a corresponding Unix timestamp in
57255 * the range `0..=MAX_TIMESTAMP`.
57257 * Note that the subsecond part is dropped as it is not representable in BOLT 11 invoices.
57259 * Otherwise, returns a [`CreationError::TimestampOutOfBounds`].
57261 MUST_USE_RES struct LDKCResult_PositiveTimestampCreationErrorZ PositiveTimestamp_from_system_time(uint64_t time);
57264 * Creates a `PositiveTimestamp` from a [`Duration`] since the Unix epoch in the range
57265 * `0..=MAX_TIMESTAMP`.
57267 * Note that the subsecond part is dropped as it is not representable in BOLT 11 invoices.
57269 * Otherwise, returns a [`CreationError::TimestampOutOfBounds`].
57271 MUST_USE_RES struct LDKCResult_PositiveTimestampCreationErrorZ PositiveTimestamp_from_duration_since_epoch(uint64_t duration);
57274 * Returns the Unix timestamp representing the stored time
57276 MUST_USE_RES uint64_t PositiveTimestamp_as_unix_timestamp(const struct LDKPositiveTimestamp *NONNULL_PTR this_arg);
57279 * Returns the duration of the stored time since the Unix epoch
57281 MUST_USE_RES uint64_t PositiveTimestamp_as_duration_since_epoch(const struct LDKPositiveTimestamp *NONNULL_PTR this_arg);
57284 * Returns the [`SystemTime`] representing the stored time
57286 MUST_USE_RES uint64_t PositiveTimestamp_as_time(const struct LDKPositiveTimestamp *NONNULL_PTR this_arg);
57289 * The hash of the [`RawBolt11Invoice`] that was signed.
57291 MUST_USE_RES struct LDKThirtyTwoBytes Bolt11Invoice_signable_hash(const struct LDKBolt11Invoice *NONNULL_PTR this_arg);
57294 * Transform the `Bolt11Invoice` into its unchecked version.
57296 MUST_USE_RES struct LDKSignedRawBolt11Invoice Bolt11Invoice_into_signed_raw(struct LDKBolt11Invoice this_arg);
57299 * Check that the invoice is signed correctly and that key recovery works
57301 MUST_USE_RES struct LDKCResult_NoneBolt11SemanticErrorZ Bolt11Invoice_check_signature(const struct LDKBolt11Invoice *NONNULL_PTR this_arg);
57304 * Constructs a `Bolt11Invoice` from a [`SignedRawBolt11Invoice`] by checking all its invariants.
57306 * use lightning_invoice::*;
57308 * let invoice = \"lnbc100p1psj9jhxdqud3jxktt5w46x7unfv9kz6mn0v3jsnp4q0d3p2sfluzdx45tqcs\\
57309 * h2pu5qc7lgq0xs578ngs6s0s68ua4h7cvspp5q6rmq35js88zp5dvwrv9m459tnk2zunwj5jalqtyxqulh0l\\
57310 * 5gflssp5nf55ny5gcrfl30xuhzj3nphgj27rstekmr9fw3ny5989s300gyus9qyysgqcqpcrzjqw2sxwe993\\
57311 * h5pcm4dxzpvttgza8zhkqxpgffcrf5v25nwpr3cmfg7z54kuqq8rgqqqqqqqq2qqqqq9qq9qrzjqd0ylaqcl\\
57312 * j9424x9m8h2vcukcgnm6s56xfgu3j78zyqzhgs4hlpzvznlugqq9vsqqqqqqqlgqqqqqeqq9qrzjqwldmj9d\\
57313 * ha74df76zhx6l9we0vjdquygcdt3kssupehe64g6yyp5yz5rhuqqwccqqyqqqqlgqqqqjcqq9qrzjqf9e58a\\
57314 * guqr0rcun0ajlvmzq3ek63cw2w282gv3z5uupmuwvgjtq2z55qsqqg6qqqyqqqrtnqqqzq3cqygrzjqvphms\\
57315 * ywntrrhqjcraumvc4y6r8v4z5v593trte429v4hredj7ms5z52usqq9ngqqqqqqqlgqqqqqqgq9qrzjq2v0v\\
57316 * p62g49p7569ev48cmulecsxe59lvaw3wlxm7r982zxa9zzj7z5l0cqqxusqqyqqqqlgqqqqqzsqygarl9fh3\\
57317 * 8s0gyuxjjgux34w75dnc6xp2l35j7es3jd4ugt3lu0xzre26yg5m7ke54n2d5sym4xcmxtl8238xxvw5h5h5\\
57318 * j5r6drg6k6zcqj0fcwg\";
57320 * let signed = invoice.parse::<SignedRawBolt11Invoice>().unwrap();
57322 * assert!(Bolt11Invoice::from_signed(signed).is_ok());
57325 MUST_USE_RES struct LDKCResult_Bolt11InvoiceBolt11SemanticErrorZ Bolt11Invoice_from_signed(struct LDKSignedRawBolt11Invoice signed_invoice);
57328 * Returns the `Bolt11Invoice`'s timestamp (should equal its creation time)
57330 MUST_USE_RES uint64_t Bolt11Invoice_timestamp(const struct LDKBolt11Invoice *NONNULL_PTR this_arg);
57333 * Returns the `Bolt11Invoice`'s timestamp as a duration since the Unix epoch
57335 MUST_USE_RES uint64_t Bolt11Invoice_duration_since_epoch(const struct LDKBolt11Invoice *NONNULL_PTR this_arg);
57338 * Returns the hash to which we will receive the preimage on completion of the payment
57340 MUST_USE_RES const uint8_t (*Bolt11Invoice_payment_hash(const struct LDKBolt11Invoice *NONNULL_PTR this_arg))[32];
57343 * Get the payee's public key if one was included in the invoice
57345 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
57347 MUST_USE_RES struct LDKPublicKey Bolt11Invoice_payee_pub_key(const struct LDKBolt11Invoice *NONNULL_PTR this_arg);
57350 * Get the payment secret if one was included in the invoice
57352 MUST_USE_RES const uint8_t (*Bolt11Invoice_payment_secret(const struct LDKBolt11Invoice *NONNULL_PTR this_arg))[32];
57355 * Get the payment metadata blob if one was included in the invoice
57357 MUST_USE_RES struct LDKCOption_CVec_u8ZZ Bolt11Invoice_payment_metadata(const struct LDKBolt11Invoice *NONNULL_PTR this_arg);
57360 * Get the invoice features if they were included in the invoice
57362 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
57364 MUST_USE_RES struct LDKBolt11InvoiceFeatures Bolt11Invoice_features(const struct LDKBolt11Invoice *NONNULL_PTR this_arg);
57367 * Recover the payee's public key (only to be used if none was included in the invoice)
57369 MUST_USE_RES struct LDKPublicKey Bolt11Invoice_recover_payee_pub_key(const struct LDKBolt11Invoice *NONNULL_PTR this_arg);
57372 * Recover the payee's public key if one was included in the invoice, otherwise return the
57373 * recovered public key from the signature
57375 MUST_USE_RES struct LDKPublicKey Bolt11Invoice_get_payee_pub_key(const struct LDKBolt11Invoice *NONNULL_PTR this_arg);
57378 * Returns the Duration since the Unix epoch at which the invoice expires.
57379 * Returning None if overflow occurred.
57381 MUST_USE_RES struct LDKCOption_u64Z Bolt11Invoice_expires_at(const struct LDKBolt11Invoice *NONNULL_PTR this_arg);
57384 * Returns the invoice's expiry time, if present, otherwise [`DEFAULT_EXPIRY_TIME`].
57386 MUST_USE_RES uint64_t Bolt11Invoice_expiry_time(const struct LDKBolt11Invoice *NONNULL_PTR this_arg);
57389 * Returns whether the invoice has expired.
57391 MUST_USE_RES bool Bolt11Invoice_is_expired(const struct LDKBolt11Invoice *NONNULL_PTR this_arg);
57394 * Returns the Duration remaining until the invoice expires.
57396 MUST_USE_RES uint64_t Bolt11Invoice_duration_until_expiry(const struct LDKBolt11Invoice *NONNULL_PTR this_arg);
57399 * Returns the Duration remaining until the invoice expires given the current time.
57400 * `time` is the timestamp as a duration since the Unix epoch.
57402 MUST_USE_RES uint64_t Bolt11Invoice_expiration_remaining_from_epoch(const struct LDKBolt11Invoice *NONNULL_PTR this_arg, uint64_t time);
57405 * Returns whether the expiry time would pass at the given point in time.
57406 * `at_time` is the timestamp as a duration since the Unix epoch.
57408 MUST_USE_RES bool Bolt11Invoice_would_expire(const struct LDKBolt11Invoice *NONNULL_PTR this_arg, uint64_t at_time);
57411 * Returns the invoice's `min_final_cltv_expiry_delta` time, if present, otherwise
57412 * [`DEFAULT_MIN_FINAL_CLTV_EXPIRY_DELTA`].
57414 MUST_USE_RES uint64_t Bolt11Invoice_min_final_cltv_expiry_delta(const struct LDKBolt11Invoice *NONNULL_PTR this_arg);
57417 * Returns a list of all fallback addresses as [`Address`]es
57419 MUST_USE_RES struct LDKCVec_StrZ Bolt11Invoice_fallback_addresses(const struct LDKBolt11Invoice *NONNULL_PTR this_arg);
57422 * Returns a list of all routes included in the invoice
57424 MUST_USE_RES struct LDKCVec_PrivateRouteZ Bolt11Invoice_private_routes(const struct LDKBolt11Invoice *NONNULL_PTR this_arg);
57427 * Returns a list of all routes included in the invoice as the underlying hints
57429 MUST_USE_RES struct LDKCVec_RouteHintZ Bolt11Invoice_route_hints(const struct LDKBolt11Invoice *NONNULL_PTR this_arg);
57432 * Returns the currency for which the invoice was issued
57434 MUST_USE_RES enum LDKCurrency Bolt11Invoice_currency(const struct LDKBolt11Invoice *NONNULL_PTR this_arg);
57437 * Returns the amount if specified in the invoice as millisatoshis.
57439 MUST_USE_RES struct LDKCOption_u64Z Bolt11Invoice_amount_milli_satoshis(const struct LDKBolt11Invoice *NONNULL_PTR this_arg);
57442 * Creates a new `Description` if `description` is at most 1023 __bytes__ long,
57443 * returns [`CreationError::DescriptionTooLong`] otherwise
57445 * Please note that single characters may use more than one byte due to UTF8 encoding.
57447 MUST_USE_RES struct LDKCResult_DescriptionCreationErrorZ Description_new(struct LDKStr description);
57450 * Returns the underlying description [`UntrustedString`]
57452 MUST_USE_RES struct LDKUntrustedString Description_into_inner(struct LDKDescription this_arg);
57455 * Get the string representation of a Description object
57457 struct LDKStr Description_to_str(const struct LDKDescription *NONNULL_PTR o);
57460 * Construct an `ExpiryTime` from seconds.
57462 MUST_USE_RES struct LDKExpiryTime ExpiryTime_from_seconds(uint64_t seconds);
57465 * Construct an `ExpiryTime` from a [`Duration`], dropping the sub-second part.
57467 MUST_USE_RES struct LDKExpiryTime ExpiryTime_from_duration(uint64_t duration);
57470 * Returns the expiry time in seconds
57472 MUST_USE_RES uint64_t ExpiryTime_as_seconds(const struct LDKExpiryTime *NONNULL_PTR this_arg);
57475 * Returns a reference to the underlying [`Duration`] (=expiry time)
57477 MUST_USE_RES uint64_t ExpiryTime_as_duration(const struct LDKExpiryTime *NONNULL_PTR this_arg);
57480 * Creates a new (partial) route from a list of hops
57482 MUST_USE_RES struct LDKCResult_PrivateRouteCreationErrorZ PrivateRoute_new(struct LDKRouteHint hops);
57485 * Returns the underlying list of hops
57487 MUST_USE_RES struct LDKRouteHint PrivateRoute_into_inner(struct LDKPrivateRoute this_arg);
57490 * Creates a copy of the CreationError
57492 enum LDKCreationError CreationError_clone(const enum LDKCreationError *NONNULL_PTR orig);
57495 * Utility method to constructs a new DescriptionTooLong-variant CreationError
57497 enum LDKCreationError CreationError_description_too_long(void);
57500 * Utility method to constructs a new RouteTooLong-variant CreationError
57502 enum LDKCreationError CreationError_route_too_long(void);
57505 * Utility method to constructs a new TimestampOutOfBounds-variant CreationError
57507 enum LDKCreationError CreationError_timestamp_out_of_bounds(void);
57510 * Utility method to constructs a new InvalidAmount-variant CreationError
57512 enum LDKCreationError CreationError_invalid_amount(void);
57515 * Utility method to constructs a new MissingRouteHints-variant CreationError
57517 enum LDKCreationError CreationError_missing_route_hints(void);
57520 * Utility method to constructs a new MinFinalCltvExpiryDeltaTooShort-variant CreationError
57522 enum LDKCreationError CreationError_min_final_cltv_expiry_delta_too_short(void);
57525 * Checks if two CreationErrors contain equal inner contents.
57526 * This ignores pointers and is_owned flags and looks at the values in fields.
57528 bool CreationError_eq(const enum LDKCreationError *NONNULL_PTR a, const enum LDKCreationError *NONNULL_PTR b);
57531 * Get the string representation of a CreationError object
57533 struct LDKStr CreationError_to_str(const enum LDKCreationError *NONNULL_PTR o);
57536 * Creates a copy of the Bolt11SemanticError
57538 enum LDKBolt11SemanticError Bolt11SemanticError_clone(const enum LDKBolt11SemanticError *NONNULL_PTR orig);
57541 * Utility method to constructs a new NoPaymentHash-variant Bolt11SemanticError
57543 enum LDKBolt11SemanticError Bolt11SemanticError_no_payment_hash(void);
57546 * Utility method to constructs a new MultiplePaymentHashes-variant Bolt11SemanticError
57548 enum LDKBolt11SemanticError Bolt11SemanticError_multiple_payment_hashes(void);
57551 * Utility method to constructs a new NoDescription-variant Bolt11SemanticError
57553 enum LDKBolt11SemanticError Bolt11SemanticError_no_description(void);
57556 * Utility method to constructs a new MultipleDescriptions-variant Bolt11SemanticError
57558 enum LDKBolt11SemanticError Bolt11SemanticError_multiple_descriptions(void);
57561 * Utility method to constructs a new NoPaymentSecret-variant Bolt11SemanticError
57563 enum LDKBolt11SemanticError Bolt11SemanticError_no_payment_secret(void);
57566 * Utility method to constructs a new MultiplePaymentSecrets-variant Bolt11SemanticError
57568 enum LDKBolt11SemanticError Bolt11SemanticError_multiple_payment_secrets(void);
57571 * Utility method to constructs a new InvalidFeatures-variant Bolt11SemanticError
57573 enum LDKBolt11SemanticError Bolt11SemanticError_invalid_features(void);
57576 * Utility method to constructs a new InvalidRecoveryId-variant Bolt11SemanticError
57578 enum LDKBolt11SemanticError Bolt11SemanticError_invalid_recovery_id(void);
57581 * Utility method to constructs a new InvalidSignature-variant Bolt11SemanticError
57583 enum LDKBolt11SemanticError Bolt11SemanticError_invalid_signature(void);
57586 * Utility method to constructs a new ImpreciseAmount-variant Bolt11SemanticError
57588 enum LDKBolt11SemanticError Bolt11SemanticError_imprecise_amount(void);
57591 * Checks if two Bolt11SemanticErrors contain equal inner contents.
57592 * This ignores pointers and is_owned flags and looks at the values in fields.
57594 bool Bolt11SemanticError_eq(const enum LDKBolt11SemanticError *NONNULL_PTR a, const enum LDKBolt11SemanticError *NONNULL_PTR b);
57597 * Get the string representation of a Bolt11SemanticError object
57599 struct LDKStr Bolt11SemanticError_to_str(const enum LDKBolt11SemanticError *NONNULL_PTR o);
57602 * Frees any resources used by the SignOrCreationError
57604 void SignOrCreationError_free(struct LDKSignOrCreationError this_ptr);
57607 * Creates a copy of the SignOrCreationError
57609 struct LDKSignOrCreationError SignOrCreationError_clone(const struct LDKSignOrCreationError *NONNULL_PTR orig);
57612 * Utility method to constructs a new SignError-variant SignOrCreationError
57614 struct LDKSignOrCreationError SignOrCreationError_sign_error(void);
57617 * Utility method to constructs a new CreationError-variant SignOrCreationError
57619 struct LDKSignOrCreationError SignOrCreationError_creation_error(enum LDKCreationError a);
57622 * Checks if two SignOrCreationErrors contain equal inner contents.
57623 * This ignores pointers and is_owned flags and looks at the values in fields.
57625 bool SignOrCreationError_eq(const struct LDKSignOrCreationError *NONNULL_PTR a, const struct LDKSignOrCreationError *NONNULL_PTR b);
57628 * Get the string representation of a SignOrCreationError object
57630 struct LDKStr SignOrCreationError_to_str(const struct LDKSignOrCreationError *NONNULL_PTR o);
57633 * Builds the necessary parameters to pay or pre-flight probe the given zero-amount
57634 * [`Bolt11Invoice`] using [`ChannelManager::send_payment`] or
57635 * [`ChannelManager::send_preflight_probes`].
57637 * Prior to paying, you must ensure that the [`Bolt11Invoice::payment_hash`] is unique and the
57638 * same [`PaymentHash`] has never been paid before.
57640 * Will always succeed unless the invoice has an amount specified, in which case
57641 * [`payment_parameters_from_invoice`] should be used.
57643 * [`ChannelManager::send_payment`]: lightning::ln::channelmanager::ChannelManager::send_payment
57644 * [`ChannelManager::send_preflight_probes`]: lightning::ln::channelmanager::ChannelManager::send_preflight_probes
57646 struct LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ payment_parameters_from_zero_amount_invoice(const struct LDKBolt11Invoice *NONNULL_PTR invoice, uint64_t amount_msat);
57649 * Builds the necessary parameters to pay or pre-flight probe the given [`Bolt11Invoice`] using
57650 * [`ChannelManager::send_payment`] or [`ChannelManager::send_preflight_probes`].
57652 * Prior to paying, you must ensure that the [`Bolt11Invoice::payment_hash`] is unique and the
57653 * same [`PaymentHash`] has never been paid before.
57655 * Will always succeed unless the invoice has no amount specified, in which case
57656 * [`payment_parameters_from_zero_amount_invoice`] should be used.
57658 * [`ChannelManager::send_payment`]: lightning::ln::channelmanager::ChannelManager::send_payment
57659 * [`ChannelManager::send_preflight_probes`]: lightning::ln::channelmanager::ChannelManager::send_preflight_probes
57661 struct LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ payment_parameters_from_invoice(const struct LDKBolt11Invoice *NONNULL_PTR invoice);
57664 * Utility to create an invoice that can be paid to one of multiple nodes, or a \"phantom invoice.\"
57665 * See [`PhantomKeysManager`] for more information on phantom node payments.
57667 * `phantom_route_hints` parameter:
57668 * * Contains channel info for all nodes participating in the phantom invoice
57669 * * Entries are retrieved from a call to [`ChannelManager::get_phantom_route_hints`] on each
57670 * participating node
57671 * * It is fine to cache `phantom_route_hints` and reuse it across invoices, as long as the data is
57672 * updated when a channel becomes disabled or closes
57673 * * Note that if too many channels are included in [`PhantomRouteHints::channels`], the invoice
57674 * may be too long for QR code scanning. To fix this, `PhantomRouteHints::channels` may be pared
57677 * `payment_hash` can be specified if you have a specific need for a custom payment hash (see the difference
57678 * between [`ChannelManager::create_inbound_payment`] and [`ChannelManager::create_inbound_payment_for_hash`]).
57679 * If `None` is provided for `payment_hash`, then one will be created.
57681 * `invoice_expiry_delta_secs` describes the number of seconds that the invoice is valid for
57682 * in excess of the current time.
57684 * `duration_since_epoch` is the current time since epoch in seconds.
57686 * You can specify a custom `min_final_cltv_expiry_delta`, or let LDK default it to
57687 * [`MIN_FINAL_CLTV_EXPIRY_DELTA`]. The provided expiry must be at least [`MIN_FINAL_CLTV_EXPIRY_DELTA`] - 3.
57688 * Note that LDK will add a buffer of 3 blocks to the delta to allow for up to a few new block
57689 * confirmations during routing.
57691 * Note that the provided `keys_manager`'s `NodeSigner` implementation must support phantom
57692 * invoices in its `sign_invoice` implementation ([`PhantomKeysManager`] satisfies this
57695 * [`PhantomKeysManager`]: lightning::sign::PhantomKeysManager
57696 * [`ChannelManager::get_phantom_route_hints`]: lightning::ln::channelmanager::ChannelManager::get_phantom_route_hints
57697 * [`ChannelManager::create_inbound_payment`]: lightning::ln::channelmanager::ChannelManager::create_inbound_payment
57698 * [`ChannelManager::create_inbound_payment_for_hash`]: lightning::ln::channelmanager::ChannelManager::create_inbound_payment_for_hash
57699 * [`PhantomRouteHints::channels`]: lightning::ln::channelmanager::PhantomRouteHints::channels
57700 * [`MIN_FINAL_CLTV_EXPIRY_DETLA`]: lightning::ln::channelmanager::MIN_FINAL_CLTV_EXPIRY_DELTA
57702 * This can be used in a `no_std` environment, where [`std::time::SystemTime`] is not
57703 * available and the current time is supplied by the caller.
57705 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);
57708 * Utility to create an invoice that can be paid to one of multiple nodes, or a \"phantom invoice.\"
57709 * See [`PhantomKeysManager`] for more information on phantom node payments.
57711 * `phantom_route_hints` parameter:
57712 * * Contains channel info for all nodes participating in the phantom invoice
57713 * * Entries are retrieved from a call to [`ChannelManager::get_phantom_route_hints`] on each
57714 * participating node
57715 * * It is fine to cache `phantom_route_hints` and reuse it across invoices, as long as the data is
57716 * updated when a channel becomes disabled or closes
57717 * * Note that the route hints generated from `phantom_route_hints` will be limited to a maximum
57718 * of 3 hints to ensure that the invoice can be scanned in a QR code. These hints are selected
57719 * in the order that the nodes in `PhantomRouteHints` are specified, selecting one hint per node
57720 * until the maximum is hit. Callers may provide as many `PhantomRouteHints::channels` as
57721 * desired, but note that some nodes will be trimmed if more than 3 nodes are provided.
57723 * `description_hash` is a SHA-256 hash of the description text
57725 * `payment_hash` can be specified if you have a specific need for a custom payment hash (see the difference
57726 * between [`ChannelManager::create_inbound_payment`] and [`ChannelManager::create_inbound_payment_for_hash`]).
57727 * If `None` is provided for `payment_hash`, then one will be created.
57729 * `invoice_expiry_delta_secs` describes the number of seconds that the invoice is valid for
57730 * in excess of the current time.
57732 * `duration_since_epoch` is the current time since epoch in seconds.
57734 * Note that the provided `keys_manager`'s `NodeSigner` implementation must support phantom
57735 * invoices in its `sign_invoice` implementation ([`PhantomKeysManager`] satisfies this
57738 * [`PhantomKeysManager`]: lightning::sign::PhantomKeysManager
57739 * [`ChannelManager::get_phantom_route_hints`]: lightning::ln::channelmanager::ChannelManager::get_phantom_route_hints
57740 * [`ChannelManager::create_inbound_payment`]: lightning::ln::channelmanager::ChannelManager::create_inbound_payment
57741 * [`ChannelManager::create_inbound_payment_for_hash`]: lightning::ln::channelmanager::ChannelManager::create_inbound_payment_for_hash
57742 * [`PhantomRouteHints::channels`]: lightning::ln::channelmanager::PhantomRouteHints::channels
57744 * This can be used in a `no_std` environment, where [`std::time::SystemTime`] is not
57745 * available and the current time is supplied by the caller.
57747 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);
57750 * Utility to construct an invoice. Generally, unless you want to do something like a custom
57751 * cltv_expiry, this is what you should be using to create an invoice. The reason being, this
57752 * method stores the invoice's payment secret and preimage in `ChannelManager`, so (a) the user
57753 * doesn't have to store preimage/payment secret information and (b) `ChannelManager` can verify
57754 * that the payment secret is valid when the invoice is paid.
57756 * `invoice_expiry_delta_secs` describes the number of seconds that the invoice is valid for
57757 * in excess of the current time.
57759 * You can specify a custom `min_final_cltv_expiry_delta`, or let LDK default it to
57760 * [`MIN_FINAL_CLTV_EXPIRY_DELTA`]. The provided expiry must be at least [`MIN_FINAL_CLTV_EXPIRY_DELTA`].
57761 * Note that LDK will add a buffer of 3 blocks to the delta to allow for up to a few new block
57762 * confirmations during routing.
57764 * [`MIN_FINAL_CLTV_EXPIRY_DETLA`]: lightning::ln::channelmanager::MIN_FINAL_CLTV_EXPIRY_DELTA
57766 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);
57769 * Utility to construct an invoice. Generally, unless you want to do something like a custom
57770 * cltv_expiry, this is what you should be using to create an invoice. The reason being, this
57771 * method stores the invoice's payment secret and preimage in `ChannelManager`, so (a) the user
57772 * doesn't have to store preimage/payment secret information and (b) `ChannelManager` can verify
57773 * that the payment secret is valid when the invoice is paid.
57774 * Use this variant if you want to pass the `description_hash` to the invoice.
57776 * `invoice_expiry_delta_secs` describes the number of seconds that the invoice is valid for
57777 * in excess of the current time.
57779 * You can specify a custom `min_final_cltv_expiry_delta`, or let LDK default it to
57780 * [`MIN_FINAL_CLTV_EXPIRY_DELTA`]. The provided expiry must be at least [`MIN_FINAL_CLTV_EXPIRY_DELTA`].
57781 * Note that LDK will add a buffer of 3 blocks to the delta to allow for up to a few new block
57782 * confirmations during routing.
57784 * [`MIN_FINAL_CLTV_EXPIRY_DETLA`]: lightning::ln::channelmanager::MIN_FINAL_CLTV_EXPIRY_DELTA
57786 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);
57789 * See [`create_invoice_from_channelmanager_with_description_hash`]
57790 * This version can be used in a `no_std` environment, where [`std::time::SystemTime`] is not
57791 * available and the current time is supplied by the caller.
57793 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);
57796 * See [`create_invoice_from_channelmanager`]
57797 * This version can be used in a `no_std` environment, where [`std::time::SystemTime`] is not
57798 * available and the current time is supplied by the caller.
57800 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);
57803 * See [`create_invoice_from_channelmanager_and_duration_since_epoch`]
57804 * This version allows for providing a custom [`PaymentHash`] for the invoice.
57805 * This may be useful if you're building an on-chain swap or involving another protocol where
57806 * the payment hash is also involved outside the scope of lightning.
57808 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);
57811 * Read a SiPrefix object from a string
57813 struct LDKCResult_SiPrefixBolt11ParseErrorZ SiPrefix_from_str(struct LDKStr s);
57816 * Read a Bolt11Invoice object from a string
57818 struct LDKCResult_Bolt11InvoiceParseOrSemanticErrorZ Bolt11Invoice_from_str(struct LDKStr s);
57821 * Read a SignedRawBolt11Invoice object from a string
57823 struct LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZ SignedRawBolt11Invoice_from_str(struct LDKStr s);
57826 * Get the string representation of a Bolt11ParseError object
57828 struct LDKStr Bolt11ParseError_to_str(const struct LDKBolt11ParseError *NONNULL_PTR o);
57831 * Get the string representation of a ParseOrSemanticError object
57833 struct LDKStr ParseOrSemanticError_to_str(const struct LDKParseOrSemanticError *NONNULL_PTR o);
57836 * Get the string representation of a Bolt11Invoice object
57838 struct LDKStr Bolt11Invoice_to_str(const struct LDKBolt11Invoice *NONNULL_PTR o);
57841 * Get the string representation of a SignedRawBolt11Invoice object
57843 struct LDKStr SignedRawBolt11Invoice_to_str(const struct LDKSignedRawBolt11Invoice *NONNULL_PTR o);
57846 * Get the string representation of a Currency object
57848 struct LDKStr Currency_to_str(const enum LDKCurrency *NONNULL_PTR o);
57851 * Get the string representation of a SiPrefix object
57853 struct LDKStr SiPrefix_to_str(const enum LDKSiPrefix *NONNULL_PTR o);
57856 * Frees any resources used by the GraphSyncError
57858 void GraphSyncError_free(struct LDKGraphSyncError this_ptr);
57861 * Creates a copy of the GraphSyncError
57863 struct LDKGraphSyncError GraphSyncError_clone(const struct LDKGraphSyncError *NONNULL_PTR orig);
57866 * Utility method to constructs a new DecodeError-variant GraphSyncError
57868 struct LDKGraphSyncError GraphSyncError_decode_error(struct LDKDecodeError a);
57871 * Utility method to constructs a new LightningError-variant GraphSyncError
57873 struct LDKGraphSyncError GraphSyncError_lightning_error(struct LDKLightningError a);
57876 * Frees any resources used by the RapidGossipSync, if is_owned is set and inner is non-NULL.
57878 void RapidGossipSync_free(struct LDKRapidGossipSync this_obj);
57881 * Instantiate a new [`RapidGossipSync`] instance.
57883 MUST_USE_RES struct LDKRapidGossipSync RapidGossipSync_new(const struct LDKNetworkGraph *NONNULL_PTR network_graph, struct LDKLogger logger);
57886 * Sync gossip data from a file.
57887 * Returns the last sync timestamp to be used the next time rapid sync data is queried.
57889 * `network_graph`: The network graph to apply the updates to
57891 * `sync_path`: Path to the file where the gossip update data is located
57894 MUST_USE_RES struct LDKCResult_u32GraphSyncErrorZ RapidGossipSync_sync_network_graph_with_file_path(const struct LDKRapidGossipSync *NONNULL_PTR this_arg, struct LDKStr sync_path);
57897 * Update network graph from binary data.
57898 * Returns the last sync timestamp to be used the next time rapid sync data is queried.
57900 * `update_data`: `&[u8]` binary stream that comprises the update data
57902 MUST_USE_RES struct LDKCResult_u32GraphSyncErrorZ RapidGossipSync_update_network_graph(const struct LDKRapidGossipSync *NONNULL_PTR this_arg, struct LDKu8slice update_data);
57905 * Update network graph from binary data.
57906 * Returns the last sync timestamp to be used the next time rapid sync data is queried.
57908 * `update_data`: `&[u8]` binary stream that comprises the update data
57909 * `current_time_unix`: `Option<u64>` optional current timestamp to verify data age
57911 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);
57914 * Returns whether a rapid gossip sync has completed at least once.
57916 MUST_USE_RES bool RapidGossipSync_is_initial_sync_complete(const struct LDKRapidGossipSync *NONNULL_PTR this_arg);
57918 #endif /* LDK_C_BINDINGS_H */
57920 #include "ldk_ver.h"