1 #ifndef LDK_C_BINDINGS_H
2 #define LDK_C_BINDINGS_H
4 /* Generated with cbindgen:0.24.5 */
6 /* Warning, this file is autogenerated by cbindgen. Don't modify this manually. */
11 #include "ldk_rust_types.h"
14 * Errors that may occur when converting a [`RawBolt11Invoice`] to a [`Bolt11Invoice`]. They relate to
15 * the requirements sections in BOLT #11
17 typedef enum LDKBolt11SemanticError {
19 * The invoice is missing the mandatory payment hash
21 LDKBolt11SemanticError_NoPaymentHash,
23 * The invoice has multiple payment hashes which isn't allowed
25 LDKBolt11SemanticError_MultiplePaymentHashes,
27 * No description or description hash are part of the invoice
29 LDKBolt11SemanticError_NoDescription,
31 * The invoice contains multiple descriptions and/or description hashes which isn't allowed
33 LDKBolt11SemanticError_MultipleDescriptions,
35 * The invoice is missing the mandatory payment secret, which all modern lightning nodes
38 LDKBolt11SemanticError_NoPaymentSecret,
40 * The invoice contains multiple payment secrets
42 LDKBolt11SemanticError_MultiplePaymentSecrets,
44 * The invoice's features are invalid
46 LDKBolt11SemanticError_InvalidFeatures,
48 * The recovery id doesn't fit the signature/pub key
50 LDKBolt11SemanticError_InvalidRecoveryId,
52 * The invoice's signature is invalid
54 LDKBolt11SemanticError_InvalidSignature,
56 * The invoice's amount was not a whole number of millisatoshis
58 LDKBolt11SemanticError_ImpreciseAmount,
60 * Must be last for serialization purposes
62 LDKBolt11SemanticError_Sentinel,
63 } LDKBolt11SemanticError;
66 * Error when interpreting a TLV stream as a specific type.
68 typedef enum LDKBolt12SemanticError {
70 * The current [`std::time::SystemTime`] is past the offer or invoice's expiration.
72 LDKBolt12SemanticError_AlreadyExpired,
74 * The provided chain hash does not correspond to a supported chain.
76 LDKBolt12SemanticError_UnsupportedChain,
78 * A chain was provided but was not expected.
80 LDKBolt12SemanticError_UnexpectedChain,
82 * An amount was expected but was missing.
84 LDKBolt12SemanticError_MissingAmount,
86 * The amount exceeded the total bitcoin supply.
88 LDKBolt12SemanticError_InvalidAmount,
90 * An amount was provided but was not sufficient in value.
92 LDKBolt12SemanticError_InsufficientAmount,
94 * An amount was provided but was not expected.
96 LDKBolt12SemanticError_UnexpectedAmount,
98 * A currency was provided that is not supported.
100 LDKBolt12SemanticError_UnsupportedCurrency,
102 * A feature was required but is unknown.
104 LDKBolt12SemanticError_UnknownRequiredFeatures,
106 * Features were provided but were not expected.
108 LDKBolt12SemanticError_UnexpectedFeatures,
110 * A required description was not provided.
112 LDKBolt12SemanticError_MissingDescription,
114 * A signing pubkey was not provided.
116 LDKBolt12SemanticError_MissingSigningPubkey,
118 * A signing pubkey was provided but a different one was expected.
120 LDKBolt12SemanticError_InvalidSigningPubkey,
122 * A signing pubkey was provided but was not expected.
124 LDKBolt12SemanticError_UnexpectedSigningPubkey,
126 * A quantity was expected but was missing.
128 LDKBolt12SemanticError_MissingQuantity,
130 * An unsupported quantity was provided.
132 LDKBolt12SemanticError_InvalidQuantity,
134 * A quantity or quantity bounds was provided but was not expected.
136 LDKBolt12SemanticError_UnexpectedQuantity,
138 * Metadata could not be used to verify the offers message.
140 LDKBolt12SemanticError_InvalidMetadata,
142 * Metadata was provided but was not expected.
144 LDKBolt12SemanticError_UnexpectedMetadata,
146 * Payer metadata was expected but was missing.
148 LDKBolt12SemanticError_MissingPayerMetadata,
150 * A payer id was expected but was missing.
152 LDKBolt12SemanticError_MissingPayerId,
154 * Blinded paths were expected but were missing.
156 LDKBolt12SemanticError_MissingPaths,
158 * The blinded payinfo given does not match the number of blinded path hops.
160 LDKBolt12SemanticError_InvalidPayInfo,
162 * An invoice creation time was expected but was missing.
164 LDKBolt12SemanticError_MissingCreationTime,
166 * An invoice payment hash was expected but was missing.
168 LDKBolt12SemanticError_MissingPaymentHash,
170 * A signature was expected but was missing.
172 LDKBolt12SemanticError_MissingSignature,
174 * Must be last for serialization purposes
176 LDKBolt12SemanticError_Sentinel,
177 } LDKBolt12SemanticError;
180 * An enum which can either contain a or not
182 typedef enum LDKCOption_NoneZ {
184 * When we're in this state, this COption_NoneZ contains a
186 LDKCOption_NoneZ_Some,
188 * When we're in this state, this COption_NoneZ contains nothing
190 LDKCOption_NoneZ_None,
192 * Must be last for serialization purposes
194 LDKCOption_NoneZ_Sentinel,
198 * An enum representing the status of a channel monitor update persistence.
200 * These are generally used as the return value for an implementation of [`Persist`] which is used
201 * as the storage layer for a [`ChainMonitor`]. See the docs on [`Persist`] for a high-level
202 * explanation of how to handle different cases.
204 * While `UnrecoverableError` is provided as a failure variant, it is not truly \"handled\" on the
205 * calling side, and generally results in an immediate panic. For those who prefer to avoid
206 * panics, `InProgress` can be used and you can retry the update operation in the background or
209 * Note that channels should generally *not* be force-closed after a persistence failure.
210 * Force-closing with the latest [`ChannelMonitorUpdate`] applied may result in a transaction
211 * being broadcast which can only be spent by the latest [`ChannelMonitor`]! Thus, if the
212 * latest [`ChannelMonitor`] is not durably persisted anywhere and exists only in memory, naively
213 * calling [`ChannelManager::force_close_broadcasting_latest_txn`] *may result in loss of funds*!
215 * [`Persist`]: chainmonitor::Persist
216 * [`ChainMonitor`]: chainmonitor::ChainMonitor
217 * [`ChannelManager::force_close_broadcasting_latest_txn`]: crate::ln::channelmanager::ChannelManager::force_close_broadcasting_latest_txn
219 typedef enum LDKChannelMonitorUpdateStatus {
221 * The update has been durably persisted and all copies of the relevant [`ChannelMonitor`]
224 * This includes performing any `fsync()` calls required to ensure the update is guaranteed to
225 * be available on restart even if the application crashes.
227 LDKChannelMonitorUpdateStatus_Completed,
229 * Indicates that the update will happen asynchronously in the background or that a transient
230 * failure occurred which is being retried in the background and will eventually complete.
232 * This will \"freeze\" a channel, preventing us from revoking old states or submitting a new
233 * commitment transaction to the counterparty. Once the update(s) which are `InProgress` have
234 * been completed, a [`MonitorEvent::Completed`] can be used to restore the channel to an
237 * Even when a channel has been \"frozen\", updates to the [`ChannelMonitor`] can continue to
238 * occur (e.g. if an inbound HTLC which we forwarded was claimed upstream, resulting in us
239 * attempting to claim it on this channel) and those updates must still be persisted.
241 * No updates to the channel will be made which could invalidate other [`ChannelMonitor`]s
242 * until a [`MonitorEvent::Completed`] is provided, even if you return no error on a later
243 * monitor update for the same channel.
245 * For deployments where a copy of [`ChannelMonitor`]s and other local state are backed up in
246 * a remote location (with local copies persisted immediately), it is anticipated that all
247 * updates will return [`InProgress`] until the remote copies could be updated.
249 * Note that while fully asynchronous persistence of [`ChannelMonitor`] data is generally
250 * reliable, this feature is considered beta, and a handful of edge-cases remain. Until the
251 * remaining cases are fixed, in rare cases, *using this feature may lead to funds loss*.
253 * [`InProgress`]: ChannelMonitorUpdateStatus::InProgress
255 LDKChannelMonitorUpdateStatus_InProgress,
257 * Indicates that an update has failed and will not complete at any point in the future.
259 * Currently returning this variant will cause LDK to immediately panic to encourage immediate
260 * shutdown. In the future this may be updated to disconnect peers and refuse to continue
261 * normal operation without a panic.
263 * Applications which wish to perform an orderly shutdown after failure should consider
264 * returning [`InProgress`] instead and simply shut down without ever marking the update
267 * [`InProgress`]: ChannelMonitorUpdateStatus::InProgress
269 LDKChannelMonitorUpdateStatus_UnrecoverableError,
271 * Must be last for serialization purposes
273 LDKChannelMonitorUpdateStatus_Sentinel,
274 } LDKChannelMonitorUpdateStatus;
277 * Further information on the details of the channel shutdown.
278 * Upon channels being forced closed (i.e. commitment transaction confirmation detected
279 * by `ChainMonitor`), ChannelShutdownState will be set to `ShutdownComplete` or
280 * the channel will be removed shortly.
281 * Also note, that in normal operation, peers could disconnect at any of these states
282 * and require peer re-connection before making progress onto other states
284 typedef enum LDKChannelShutdownState {
286 * Channel has not sent or received a shutdown message.
288 LDKChannelShutdownState_NotShuttingDown,
290 * Local node has sent a shutdown message for this channel.
292 LDKChannelShutdownState_ShutdownInitiated,
294 * Shutdown message exchanges have concluded and the channels are in the midst of
295 * resolving all existing open HTLCs before closing can continue.
297 LDKChannelShutdownState_ResolvingHTLCs,
299 * All HTLCs have been resolved, nodes are currently negotiating channel close onchain fee rates.
301 LDKChannelShutdownState_NegotiatingClosingFee,
303 * We've successfully negotiated a closing_signed dance. At this point `ChannelManager` is about
304 * to drop the channel.
306 LDKChannelShutdownState_ShutdownComplete,
308 * Must be last for serialization purposes
310 LDKChannelShutdownState_Sentinel,
311 } LDKChannelShutdownState;
314 * An enum that represents the priority at which we want a transaction to confirm used for feerate
317 typedef enum LDKConfirmationTarget {
319 * We'd like a transaction to confirm in the future, but don't want to commit most of the fees
320 * required to do so yet. The remaining fees will come via a Child-Pays-For-Parent (CPFP) fee
321 * bump of the transaction.
323 * The feerate returned should be the absolute minimum feerate required to enter most node
324 * mempools across the network. Note that if you are not able to obtain this feerate estimate,
325 * you should likely use the furthest-out estimate allowed by your fee estimator.
327 LDKConfirmationTarget_MempoolMinimum,
329 * We are happy with a transaction confirming slowly, at least within a day or so worth of
332 LDKConfirmationTarget_Background,
334 * We'd like a transaction to confirm without major delayed, i.e., within the next 12-24 blocks.
336 LDKConfirmationTarget_Normal,
338 * We'd like a transaction to confirm in the next few blocks.
340 LDKConfirmationTarget_HighPriority,
342 * Must be last for serialization purposes
344 LDKConfirmationTarget_Sentinel,
345 } LDKConfirmationTarget;
348 * Errors that may occur when constructing a new [`RawBolt11Invoice`] or [`Bolt11Invoice`]
350 typedef enum LDKCreationError {
352 * The supplied description string was longer than 639 __bytes__ (see [`Description::new`])
354 LDKCreationError_DescriptionTooLong,
356 * The specified route has too many hops and can't be encoded
358 LDKCreationError_RouteTooLong,
360 * The Unix timestamp of the supplied date is less than zero or greater than 35-bits
362 LDKCreationError_TimestampOutOfBounds,
364 * The supplied millisatoshi amount was greater than the total bitcoin supply.
366 LDKCreationError_InvalidAmount,
368 * Route hints were required for this invoice and were missing. Applies to
369 * [phantom invoices].
371 * [phantom invoices]: crate::utils::create_phantom_invoice
373 LDKCreationError_MissingRouteHints,
375 * The provided `min_final_cltv_expiry_delta` was less than [`MIN_FINAL_CLTV_EXPIRY_DELTA`].
377 * [`MIN_FINAL_CLTV_EXPIRY_DELTA`]: lightning::ln::channelmanager::MIN_FINAL_CLTV_EXPIRY_DELTA
379 LDKCreationError_MinFinalCltvExpiryDeltaTooShort,
381 * Must be last for serialization purposes
383 LDKCreationError_Sentinel,
387 * Enum representing the crypto currencies (or networks) supported by this library
389 typedef enum LDKCurrency {
397 LDKCurrency_BitcoinTestnet,
411 * Must be last for serialization purposes
413 LDKCurrency_Sentinel,
417 * Describes the type of HTLC claim as determined by analyzing the witness.
419 typedef enum LDKHTLCClaim {
421 * Claims an offered output on a commitment transaction through the timeout path.
423 LDKHTLCClaim_OfferedTimeout,
425 * Claims an offered output on a commitment transaction through the success path.
427 LDKHTLCClaim_OfferedPreimage,
429 * Claims an accepted output on a commitment transaction through the timeout path.
431 LDKHTLCClaim_AcceptedTimeout,
433 * Claims an accepted output on a commitment transaction through the success path.
435 LDKHTLCClaim_AcceptedPreimage,
437 * Claims an offered/accepted output on a commitment transaction through the revocation path.
439 LDKHTLCClaim_Revocation,
441 * Must be last for serialization purposes
443 LDKHTLCClaim_Sentinel,
447 * Represents an IO Error. Note that some information is lost in the conversion from Rust.
449 typedef enum LDKIOError {
451 LDKIOError_PermissionDenied,
452 LDKIOError_ConnectionRefused,
453 LDKIOError_ConnectionReset,
454 LDKIOError_ConnectionAborted,
455 LDKIOError_NotConnected,
456 LDKIOError_AddrInUse,
457 LDKIOError_AddrNotAvailable,
458 LDKIOError_BrokenPipe,
459 LDKIOError_AlreadyExists,
460 LDKIOError_WouldBlock,
461 LDKIOError_InvalidInput,
462 LDKIOError_InvalidData,
464 LDKIOError_WriteZero,
465 LDKIOError_Interrupted,
467 LDKIOError_UnexpectedEof,
469 * Must be last for serialization purposes
475 * An enum representing the available verbosity levels of the logger.
477 typedef enum LDKLevel {
479 * Designates extremely verbose information, including gossip-induced messages
483 * Designates very low priority, often extremely verbose, information
487 * Designates lower priority information
491 * Designates useful information
495 * Designates hazardous situations
499 * Designates very serious errors
503 * Must be last for serialization purposes
509 * An enum representing the possible Bitcoin or test networks which we can run on
511 typedef enum LDKNetwork {
513 * The main Bitcoin blockchain.
517 * The testnet3 blockchain.
521 * A local test blockchain.
525 * A blockchain on which blocks are signed instead of mined.
529 * Must be last for serialization purposes
535 * The reason the payment failed. Used in [`Event::PaymentFailed`].
537 typedef enum LDKPaymentFailureReason {
539 * The intended recipient rejected our payment.
541 LDKPaymentFailureReason_RecipientRejected,
543 * The user chose to abandon this payment by calling [`ChannelManager::abandon_payment`].
545 * [`ChannelManager::abandon_payment`]: crate::ln::channelmanager::ChannelManager::abandon_payment
547 LDKPaymentFailureReason_UserAbandoned,
549 * We exhausted all of our retry attempts while trying to send the payment, or we
550 * exhausted the [`Retry::Timeout`] if the user set one. If at any point a retry
551 * attempt failed while being forwarded along the path, an [`Event::PaymentPathFailed`] will
552 * have come before this.
554 * [`Retry::Timeout`]: crate::ln::channelmanager::Retry::Timeout
556 LDKPaymentFailureReason_RetriesExhausted,
558 * The payment expired while retrying, based on the provided
559 * [`PaymentParameters::expiry_time`].
561 * [`PaymentParameters::expiry_time`]: crate::routing::router::PaymentParameters::expiry_time
563 LDKPaymentFailureReason_PaymentExpired,
565 * We failed to find a route while retrying the payment.
567 LDKPaymentFailureReason_RouteNotFound,
569 * This error should generally never happen. This likely means that there is a problem with
572 LDKPaymentFailureReason_UnexpectedError,
574 * Must be last for serialization purposes
576 LDKPaymentFailureReason_Sentinel,
577 } LDKPaymentFailureReason;
580 * Specifies the recipient of an invoice.
582 * This indicates to [`NodeSigner::sign_invoice`] what node secret key should be used to sign
585 typedef enum LDKRecipient {
587 * The invoice should be signed with the local node secret key.
591 * The invoice should be signed with the phantom node secret key. This secret key must be the
592 * same for all nodes participating in the [phantom node payment].
594 * [phantom node payment]: PhantomKeysManager
596 LDKRecipient_PhantomNode,
598 * Must be last for serialization purposes
600 LDKRecipient_Sentinel,
604 * Indicates an immediate error on [`ChannelManager::send_payment`]. Further errors may be
605 * surfaced later via [`Event::PaymentPathFailed`] and [`Event::PaymentFailed`].
607 * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
608 * [`Event::PaymentPathFailed`]: crate::events::Event::PaymentPathFailed
609 * [`Event::PaymentFailed`]: crate::events::Event::PaymentFailed
611 typedef enum LDKRetryableSendFailure {
613 * The provided [`PaymentParameters::expiry_time`] indicated that the payment has expired. Note
614 * that this error is *not* caused by [`Retry::Timeout`].
616 * [`PaymentParameters::expiry_time`]: crate::routing::router::PaymentParameters::expiry_time
618 LDKRetryableSendFailure_PaymentExpired,
620 * We were unable to find a route to the destination.
622 LDKRetryableSendFailure_RouteNotFound,
624 * Indicates that a payment for the provided [`PaymentId`] is already in-flight and has not
625 * yet completed (i.e. generated an [`Event::PaymentSent`] or [`Event::PaymentFailed`]).
627 * [`PaymentId`]: crate::ln::channelmanager::PaymentId
628 * [`Event::PaymentSent`]: crate::events::Event::PaymentSent
629 * [`Event::PaymentFailed`]: crate::events::Event::PaymentFailed
631 LDKRetryableSendFailure_DuplicatePayment,
633 * Must be last for serialization purposes
635 LDKRetryableSendFailure_Sentinel,
636 } LDKRetryableSendFailure;
639 * Represents an error returned from libsecp256k1 during validation of some secp256k1 data
641 typedef enum LDKSecp256k1Error {
643 * Signature failed verification
645 LDKSecp256k1Error_IncorrectSignature,
647 * Badly sized message ("messages" are actually fixed-sized digests; see the MESSAGE_SIZE constant)
649 LDKSecp256k1Error_InvalidMessage,
653 LDKSecp256k1Error_InvalidPublicKey,
657 LDKSecp256k1Error_InvalidSignature,
661 LDKSecp256k1Error_InvalidSecretKey,
665 LDKSecp256k1Error_InvalidSharedSecret,
669 LDKSecp256k1Error_InvalidRecoveryId,
671 * Invalid tweak for add_assign or mul_assign
673 LDKSecp256k1Error_InvalidTweak,
675 * Didn't pass enough memory to context creation with preallocated memory
677 LDKSecp256k1Error_NotEnoughMemory,
679 * Bad set of public keys.
681 LDKSecp256k1Error_InvalidPublicKeySum,
683 * The only valid parity values are 0 or 1.
685 LDKSecp256k1Error_InvalidParityValue,
687 * Must be last for serialization purposes
689 LDKSecp256k1Error_Sentinel,
693 * SI prefixes for the human readable part
695 typedef enum LDKSiPrefix {
713 * Must be last for serialization purposes
715 LDKSiPrefix_Sentinel,
719 * [`SocketAddress`] error variants
721 typedef enum LDKSocketAddressParseError {
723 * Socket address (IPv4/IPv6) parsing error
725 LDKSocketAddressParseError_SocketAddrParse,
727 * Invalid input format
729 LDKSocketAddressParseError_InvalidInput,
733 LDKSocketAddressParseError_InvalidPort,
735 * Invalid onion v3 address
737 LDKSocketAddressParseError_InvalidOnionV3,
739 * Must be last for serialization purposes
741 LDKSocketAddressParseError_Sentinel,
742 } LDKSocketAddressParseError;
745 * An error when accessing the chain via [`UtxoLookup`].
747 typedef enum LDKUtxoLookupError {
749 * The requested chain is unknown.
751 LDKUtxoLookupError_UnknownChain,
753 * The requested transaction doesn't exist or hasn't confirmed.
755 LDKUtxoLookupError_UnknownTx,
757 * Must be last for serialization purposes
759 LDKUtxoLookupError_Sentinel,
760 } LDKUtxoLookupError;
763 * A Rust str object, ie a reference to a UTF8-valid string.
764 * This is *not* null-terminated so cannot be used directly as a C string!
766 typedef struct LDKStr {
768 * A pointer to the string's bytes, in UTF8 encoding
770 const uint8_t *chars;
772 * The number of bytes (not characters!) pointed to by `chars`
776 * Whether the data pointed to by `chars` should be freed or not.
782 * A 16-byte byte array.
784 typedef struct LDKSixteenBytes {
792 * Unsigned, 128-bit integer.
794 * Because LLVM implements an incorrect ABI for 128-bit integers, a wrapper type is defined here.
795 * See https://github.com/rust-lang/rust/issues/54341 for more details.
797 typedef struct LDKU128 {
799 * The 128-bit integer, as 16 little-endian bytes
801 uint8_t le_bytes[16];
805 * Represents a scalar value between zero and the secp256k1 curve order, in big endian.
807 typedef struct LDKBigEndianScalar {
809 * The bytes of the scalar value.
811 uint8_t big_endian_bytes[32];
812 } LDKBigEndianScalar;
815 * Arbitrary 32 bytes, which could represent one of a few different things. You probably want to
816 * look up the corresponding function in rust-lightning's docs.
818 typedef struct LDKThirtyTwoBytes {
820 * The thirty-two bytes
826 * Represents an error returned from the bech32 library during validation of some bech32 data
828 typedef enum LDKBech32Error_Tag {
830 * String does not contain the separator character
832 LDKBech32Error_MissingSeparator,
834 * The checksum does not match the rest of the data
836 LDKBech32Error_InvalidChecksum,
838 * The data or human-readable part is too long or too short
840 LDKBech32Error_InvalidLength,
842 * Some part of the string contains an invalid character
844 LDKBech32Error_InvalidChar,
846 * Some part of the data has an invalid value
848 LDKBech32Error_InvalidData,
850 * The bit conversion failed due to a padding issue
852 LDKBech32Error_InvalidPadding,
854 * The whole string must be of one case
856 LDKBech32Error_MixedCase,
858 * Must be last for serialization purposes
860 LDKBech32Error_Sentinel,
861 } LDKBech32Error_Tag;
863 typedef struct LDKBech32Error {
864 LDKBech32Error_Tag tag;
867 uint32_t invalid_char;
870 uint8_t invalid_data;
876 * A serialized transaction, in (pointer, length) form.
878 * This type optionally owns its own memory, and thus the semantics around access change based on
879 * the `data_is_owned` flag. If `data_is_owned` is set, you must call `Transaction_free` to free
880 * the underlying buffer before the object goes out of scope. If `data_is_owned` is not set, any
881 * access to the buffer after the scope in which the object was provided to you is invalid. eg,
882 * access after you return from the call in which a `!data_is_owned` `Transaction` is provided to
883 * you would be invalid.
885 * Note that, while it may change in the future, because transactions on the Rust side are stored
886 * in a deserialized form, all `Transaction`s generated on the Rust side will have `data_is_owned`
887 * set. Similarly, while it may change in the future, all `Transaction`s you pass to Rust may have
888 * `data_is_owned` either set or unset at your discretion.
890 typedef struct LDKTransaction {
892 * The serialized transaction data.
894 * This is non-const for your convenience, an object passed to Rust is never written to.
898 * The length of the serialized transaction
902 * Whether the data pointed to by `data` should be freed or not.
908 * A serialized witness.
910 typedef struct LDKWitness {
912 * The serialized transaction data.
914 * This is non-const for your convenience, an object passed to Rust is never written to.
918 * The length of the serialized transaction
922 * Whether the data pointed to by `data` should be freed or not.
928 * A dynamically-allocated array of u8s of arbitrary size.
929 * This corresponds to std::vector in C++
931 typedef struct LDKCVec_u8Z {
933 * The elements in the array.
934 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
938 * The number of elements pointed to by `data`.
944 * An input to a transaction.
946 * This contains the witness, the scriptSig and the previous outpoint and represents a single
947 * input to a transaction
949 typedef struct LDKTxIn {
951 * The witness which includes any signatures required to spend a segwit output.
953 struct LDKWitness witness;
955 * The script_sig which includes signatures requires to spend a pre-segwit output (or a
956 * P2SH-wrapped segwit output).
958 struct LDKCVec_u8Z script_sig;
960 * The sequence number of the transaction input
964 * The txid of the transaction being spent.
966 struct LDKThirtyTwoBytes previous_txid;
968 * The output index of the transaction being spent.
970 uint32_t previous_vout;
974 * A transaction output including a scriptPubKey and value.
975 * This type *does* own its own memory, so must be free'd appropriately.
977 typedef struct LDKTxOut {
979 * The script_pubkey in this output
981 struct LDKCVec_u8Z script_pubkey;
983 * The value, in satoshis, of this output
989 * An enum which can either contain a u64 or not
991 typedef enum LDKCOption_u64Z_Tag {
993 * When we're in this state, this COption_u64Z contains a u64
995 LDKCOption_u64Z_Some,
997 * When we're in this state, this COption_u64Z contains nothing
999 LDKCOption_u64Z_None,
1001 * Must be last for serialization purposes
1003 LDKCOption_u64Z_Sentinel,
1004 } LDKCOption_u64Z_Tag;
1006 typedef struct LDKCOption_u64Z {
1007 LDKCOption_u64Z_Tag tag;
1018 * Onion messages and payments can be sent and received to blinded paths, which serve to hide the
1019 * identity of the recipient.
1021 typedef struct MUST_USE_STRUCT LDKBlindedPath {
1023 * A pointer to the opaque Rust object.
1024 * Nearly everywhere, inner must be non-null, however in places where
1025 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1027 LDKnativeBlindedPath *inner;
1029 * Indicates that this is the only struct which contains the same pointer.
1030 * Rust functions which take ownership of an object provided via an argument require
1031 * this to be true and invalidate the object pointed to by inner.
1037 * A dynamically-allocated array of crate::lightning::blinded_path::BlindedPaths of arbitrary size.
1038 * This corresponds to std::vector in C++
1040 typedef struct LDKCVec_BlindedPathZ {
1042 * The elements in the array.
1043 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
1045 struct LDKBlindedPath *data;
1047 * The number of elements pointed to by `data`.
1050 } LDKCVec_BlindedPathZ;
1055 * A `Refund` is a request to send an [`Bolt12Invoice`] without a preceding [`Offer`].
1057 * Typically, after an invoice is paid, the recipient may publish a refund allowing the sender to
1058 * recoup their funds. A refund may be used more generally as an \"offer for money\", such as with a
1061 * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice
1062 * [`Offer`]: crate::offers::offer::Offer
1064 typedef struct MUST_USE_STRUCT LDKRefund {
1066 * A pointer to the opaque Rust object.
1067 * Nearly everywhere, inner must be non-null, however in places where
1068 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1070 LDKnativeRefund *inner;
1072 * Indicates that this is the only struct which contains the same pointer.
1073 * Rust functions which take ownership of an object provided via an argument require
1074 * this to be true and invalidate the object pointed to by inner.
1082 * Error when parsing a bech32 encoded message using [`str::parse`].
1084 typedef struct MUST_USE_STRUCT LDKBolt12ParseError {
1086 * A pointer to the opaque Rust object.
1087 * Nearly everywhere, inner must be non-null, however in places where
1088 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1090 LDKnativeBolt12ParseError *inner;
1092 * Indicates that this is the only struct which contains the same pointer.
1093 * Rust functions which take ownership of an object provided via an argument require
1094 * this to be true and invalidate the object pointed to by inner.
1097 } LDKBolt12ParseError;
1100 * The contents of CResult_RefundBolt12ParseErrorZ
1102 typedef union LDKCResult_RefundBolt12ParseErrorZPtr {
1104 * A pointer to the contents in the success state.
1105 * Reading from this pointer when `result_ok` is not set is undefined.
1107 struct LDKRefund *result;
1109 * A pointer to the contents in the error state.
1110 * Reading from this pointer when `result_ok` is set is undefined.
1112 struct LDKBolt12ParseError *err;
1113 } LDKCResult_RefundBolt12ParseErrorZPtr;
1116 * A CResult_RefundBolt12ParseErrorZ represents the result of a fallible operation,
1117 * containing a crate::lightning::offers::refund::Refund on success and a crate::lightning::offers::parse::Bolt12ParseError on failure.
1118 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1120 typedef struct LDKCResult_RefundBolt12ParseErrorZ {
1122 * The contents of this CResult_RefundBolt12ParseErrorZ, accessible via either
1123 * `err` or `result` depending on the state of `result_ok`.
1125 union LDKCResult_RefundBolt12ParseErrorZPtr contents;
1127 * Whether this CResult_RefundBolt12ParseErrorZ represents a success state.
1130 } LDKCResult_RefundBolt12ParseErrorZ;
1133 * Strategies available to retry payment path failures.
1135 typedef enum LDKRetry_Tag {
1137 * Max number of attempts to retry payment.
1139 * Each attempt may be multiple HTLCs along multiple paths if the router decides to split up a
1140 * retry, and may retry multiple failed HTLCs at once if they failed around the same time and
1141 * were retried along a route from a single call to [`Router::find_route_with_id`].
1145 * Time elapsed before abandoning retries for a payment. At least one attempt at payment is made;
1146 * see [`PaymentParameters::expiry_time`] to avoid any attempt at payment after a specific time.
1148 * [`PaymentParameters::expiry_time`]: crate::routing::router::PaymentParameters::expiry_time
1152 * Must be last for serialization purposes
1157 typedef struct MUST_USE_STRUCT LDKRetry {
1170 * An error in decoding a message or struct.
1172 typedef enum LDKDecodeError_Tag {
1174 * A version byte specified something we don't know how to handle.
1176 * Includes unknown realm byte in an onion hop data packet.
1178 LDKDecodeError_UnknownVersion,
1180 * Unknown feature mandating we fail to parse message (e.g., TLV with an even, unknown type)
1182 LDKDecodeError_UnknownRequiredFeature,
1184 * Value was invalid.
1186 * For example, a byte which was supposed to be a bool was something other than a 0
1187 * or 1, a public key/private key/signature was invalid, text wasn't UTF-8, TLV was
1188 * syntactically incorrect, etc.
1190 LDKDecodeError_InvalidValue,
1192 * The buffer to be read was too short.
1194 LDKDecodeError_ShortRead,
1196 * A length descriptor in the packet didn't describe the later data correctly.
1198 LDKDecodeError_BadLengthDescriptor,
1200 * Error from [`std::io`].
1204 * The message included zlib-compressed values, which we don't support.
1206 LDKDecodeError_UnsupportedCompression,
1208 * Must be last for serialization purposes
1210 LDKDecodeError_Sentinel,
1211 } LDKDecodeError_Tag;
1213 typedef struct MUST_USE_STRUCT LDKDecodeError {
1214 LDKDecodeError_Tag tag;
1223 * The contents of CResult_RetryDecodeErrorZ
1225 typedef union LDKCResult_RetryDecodeErrorZPtr {
1227 * A pointer to the contents in the success state.
1228 * Reading from this pointer when `result_ok` is not set is undefined.
1230 struct LDKRetry *result;
1232 * A pointer to the contents in the error state.
1233 * Reading from this pointer when `result_ok` is set is undefined.
1235 struct LDKDecodeError *err;
1236 } LDKCResult_RetryDecodeErrorZPtr;
1239 * A CResult_RetryDecodeErrorZ represents the result of a fallible operation,
1240 * containing a crate::lightning::ln::outbound_payment::Retry on success and a crate::lightning::ln::msgs::DecodeError on failure.
1241 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1243 typedef struct LDKCResult_RetryDecodeErrorZ {
1245 * The contents of this CResult_RetryDecodeErrorZ, accessible via either
1246 * `err` or `result` depending on the state of `result_ok`.
1248 union LDKCResult_RetryDecodeErrorZPtr contents;
1250 * Whether this CResult_RetryDecodeErrorZ represents a success state.
1253 } LDKCResult_RetryDecodeErrorZ;
1258 * A script pubkey for shutting down a channel as defined by [BOLT #2].
1260 * [BOLT #2]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md
1262 typedef struct MUST_USE_STRUCT LDKShutdownScript {
1264 * A pointer to the opaque Rust object.
1265 * Nearly everywhere, inner must be non-null, however in places where
1266 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1268 LDKnativeShutdownScript *inner;
1270 * Indicates that this is the only struct which contains the same pointer.
1271 * Rust functions which take ownership of an object provided via an argument require
1272 * this to be true and invalidate the object pointed to by inner.
1275 } LDKShutdownScript;
1278 * Indicates an error on the client's part (usually some variant of attempting to use too-low or
1281 typedef enum LDKAPIError_Tag {
1283 * Indicates the API was wholly misused (see err for more). Cases where these can be returned
1284 * are documented, but generally indicates some precondition of a function was violated.
1286 LDKAPIError_APIMisuseError,
1288 * Due to a high feerate, we were unable to complete the request.
1289 * For example, this may be returned if the feerate implies we cannot open a channel at the
1290 * requested value, but opening a larger channel would succeed.
1292 LDKAPIError_FeeRateTooHigh,
1294 * A malformed Route was provided (eg overflowed value, node id mismatch, overly-looped route,
1295 * too-many-hops, etc).
1297 LDKAPIError_InvalidRoute,
1299 * We were unable to complete the request as the Channel required to do so is unable to
1300 * complete the request (or was not found). This can take many forms, including disconnected
1301 * peer, channel at capacity, channel shutting down, etc.
1303 LDKAPIError_ChannelUnavailable,
1305 * An attempt to call [`chain::Watch::watch_channel`]/[`chain::Watch::update_channel`]
1306 * returned a [`ChannelMonitorUpdateStatus::InProgress`] indicating the persistence of a
1307 * monitor update is awaiting async resolution. Once it resolves the attempted action should
1308 * complete automatically.
1310 * [`chain::Watch::watch_channel`]: crate::chain::Watch::watch_channel
1311 * [`chain::Watch::update_channel`]: crate::chain::Watch::update_channel
1312 * [`ChannelMonitorUpdateStatus::InProgress`]: crate::chain::ChannelMonitorUpdateStatus::InProgress
1314 LDKAPIError_MonitorUpdateInProgress,
1316 * [`SignerProvider::get_shutdown_scriptpubkey`] returned a shutdown scriptpubkey incompatible
1317 * with the channel counterparty as negotiated in [`InitFeatures`].
1319 * Using a SegWit v0 script should resolve this issue. If you cannot, you won't be able to open
1320 * a channel or cooperatively close one with this peer (and will have to force-close instead).
1322 * [`SignerProvider::get_shutdown_scriptpubkey`]: crate::sign::SignerProvider::get_shutdown_scriptpubkey
1323 * [`InitFeatures`]: crate::ln::features::InitFeatures
1325 LDKAPIError_IncompatibleShutdownScript,
1327 * Must be last for serialization purposes
1329 LDKAPIError_Sentinel,
1332 typedef struct LDKAPIError_LDKAPIMisuseError_Body {
1334 * A human-readable error message
1337 } LDKAPIError_LDKAPIMisuseError_Body;
1339 typedef struct LDKAPIError_LDKFeeRateTooHigh_Body {
1341 * A human-readable error message
1345 * The feerate which was too high.
1348 } LDKAPIError_LDKFeeRateTooHigh_Body;
1350 typedef struct LDKAPIError_LDKInvalidRoute_Body {
1352 * A human-readable error message
1355 } LDKAPIError_LDKInvalidRoute_Body;
1357 typedef struct LDKAPIError_LDKChannelUnavailable_Body {
1359 * A human-readable error message
1362 } LDKAPIError_LDKChannelUnavailable_Body;
1364 typedef struct LDKAPIError_LDKIncompatibleShutdownScript_Body {
1366 * The incompatible shutdown script.
1368 struct LDKShutdownScript script;
1369 } LDKAPIError_LDKIncompatibleShutdownScript_Body;
1371 typedef struct MUST_USE_STRUCT LDKAPIError {
1372 LDKAPIError_Tag tag;
1374 LDKAPIError_LDKAPIMisuseError_Body api_misuse_error;
1375 LDKAPIError_LDKFeeRateTooHigh_Body fee_rate_too_high;
1376 LDKAPIError_LDKInvalidRoute_Body invalid_route;
1377 LDKAPIError_LDKChannelUnavailable_Body channel_unavailable;
1378 LDKAPIError_LDKIncompatibleShutdownScript_Body incompatible_shutdown_script;
1383 * The contents of CResult_NoneAPIErrorZ
1385 typedef union LDKCResult_NoneAPIErrorZPtr {
1387 * Note that this value is always NULL, as there are no contents in the OK variant
1391 * A pointer to the contents in the error state.
1392 * Reading from this pointer when `result_ok` is set is undefined.
1394 struct LDKAPIError *err;
1395 } LDKCResult_NoneAPIErrorZPtr;
1398 * A CResult_NoneAPIErrorZ represents the result of a fallible operation,
1399 * containing a () on success and a crate::lightning::util::errors::APIError on failure.
1400 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1402 typedef struct LDKCResult_NoneAPIErrorZ {
1404 * The contents of this CResult_NoneAPIErrorZ, accessible via either
1405 * `err` or `result` depending on the state of `result_ok`.
1407 union LDKCResult_NoneAPIErrorZPtr contents;
1409 * Whether this CResult_NoneAPIErrorZ represents a success state.
1412 } LDKCResult_NoneAPIErrorZ;
1415 * A dynamically-allocated array of crate::c_types::derived::CResult_NoneAPIErrorZs of arbitrary size.
1416 * This corresponds to std::vector in C++
1418 typedef struct LDKCVec_CResult_NoneAPIErrorZZ {
1420 * The elements in the array.
1421 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
1423 struct LDKCResult_NoneAPIErrorZ *data;
1425 * The number of elements pointed to by `data`.
1428 } LDKCVec_CResult_NoneAPIErrorZZ;
1431 * A dynamically-allocated array of crate::lightning::util::errors::APIErrors of arbitrary size.
1432 * This corresponds to std::vector in C++
1434 typedef struct LDKCVec_APIErrorZ {
1436 * The elements in the array.
1437 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
1439 struct LDKAPIError *data;
1441 * The number of elements pointed to by `data`.
1444 } LDKCVec_APIErrorZ;
1447 * An enum which can either contain a crate::c_types::ThirtyTwoBytes or not
1449 typedef enum LDKCOption_ThirtyTwoBytesZ_Tag {
1451 * When we're in this state, this COption_ThirtyTwoBytesZ contains a crate::c_types::ThirtyTwoBytes
1453 LDKCOption_ThirtyTwoBytesZ_Some,
1455 * When we're in this state, this COption_ThirtyTwoBytesZ contains nothing
1457 LDKCOption_ThirtyTwoBytesZ_None,
1459 * Must be last for serialization purposes
1461 LDKCOption_ThirtyTwoBytesZ_Sentinel,
1462 } LDKCOption_ThirtyTwoBytesZ_Tag;
1464 typedef struct LDKCOption_ThirtyTwoBytesZ {
1465 LDKCOption_ThirtyTwoBytesZ_Tag tag;
1468 struct LDKThirtyTwoBytes some;
1471 } LDKCOption_ThirtyTwoBytesZ;
1474 * An enum which can either contain a crate::c_types::derived::CVec_u8Z or not
1476 typedef enum LDKCOption_CVec_u8ZZ_Tag {
1478 * When we're in this state, this COption_CVec_u8ZZ contains a crate::c_types::derived::CVec_u8Z
1480 LDKCOption_CVec_u8ZZ_Some,
1482 * When we're in this state, this COption_CVec_u8ZZ contains nothing
1484 LDKCOption_CVec_u8ZZ_None,
1486 * Must be last for serialization purposes
1488 LDKCOption_CVec_u8ZZ_Sentinel,
1489 } LDKCOption_CVec_u8ZZ_Tag;
1491 typedef struct LDKCOption_CVec_u8ZZ {
1492 LDKCOption_CVec_u8ZZ_Tag tag;
1495 struct LDKCVec_u8Z some;
1498 } LDKCOption_CVec_u8ZZ;
1503 * Information which is provided, encrypted, to the payment recipient when sending HTLCs.
1505 * This should generally be constructed with data communicated to us from the recipient (via a
1506 * BOLT11 or BOLT12 invoice).
1508 typedef struct MUST_USE_STRUCT LDKRecipientOnionFields {
1510 * A pointer to the opaque Rust object.
1511 * Nearly everywhere, inner must be non-null, however in places where
1512 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1514 LDKnativeRecipientOnionFields *inner;
1516 * Indicates that this is the only struct which contains the same pointer.
1517 * Rust functions which take ownership of an object provided via an argument require
1518 * this to be true and invalidate the object pointed to by inner.
1521 } LDKRecipientOnionFields;
1524 * The contents of CResult_RecipientOnionFieldsDecodeErrorZ
1526 typedef union LDKCResult_RecipientOnionFieldsDecodeErrorZPtr {
1528 * A pointer to the contents in the success state.
1529 * Reading from this pointer when `result_ok` is not set is undefined.
1531 struct LDKRecipientOnionFields *result;
1533 * A pointer to the contents in the error state.
1534 * Reading from this pointer when `result_ok` is set is undefined.
1536 struct LDKDecodeError *err;
1537 } LDKCResult_RecipientOnionFieldsDecodeErrorZPtr;
1540 * A CResult_RecipientOnionFieldsDecodeErrorZ represents the result of a fallible operation,
1541 * containing a crate::lightning::ln::outbound_payment::RecipientOnionFields on success and a crate::lightning::ln::msgs::DecodeError on failure.
1542 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1544 typedef struct LDKCResult_RecipientOnionFieldsDecodeErrorZ {
1546 * The contents of this CResult_RecipientOnionFieldsDecodeErrorZ, accessible via either
1547 * `err` or `result` depending on the state of `result_ok`.
1549 union LDKCResult_RecipientOnionFieldsDecodeErrorZPtr contents;
1551 * Whether this CResult_RecipientOnionFieldsDecodeErrorZ represents a success state.
1554 } LDKCResult_RecipientOnionFieldsDecodeErrorZ;
1557 * A tuple of 2 elements. See the individual fields for the types contained.
1559 typedef struct LDKC2Tuple_u64CVec_u8ZZ {
1561 * The element at position 0
1565 * The element at position 1
1567 struct LDKCVec_u8Z b;
1568 } LDKC2Tuple_u64CVec_u8ZZ;
1571 * A dynamically-allocated array of crate::c_types::derived::C2Tuple_u64CVec_u8ZZs of arbitrary size.
1572 * This corresponds to std::vector in C++
1574 typedef struct LDKCVec_C2Tuple_u64CVec_u8ZZZ {
1576 * The elements in the array.
1577 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
1579 struct LDKC2Tuple_u64CVec_u8ZZ *data;
1581 * The number of elements pointed to by `data`.
1584 } LDKCVec_C2Tuple_u64CVec_u8ZZZ;
1587 * The contents of CResult_RecipientOnionFieldsNoneZ
1589 typedef union LDKCResult_RecipientOnionFieldsNoneZPtr {
1591 * A pointer to the contents in the success state.
1592 * Reading from this pointer when `result_ok` is not set is undefined.
1594 struct LDKRecipientOnionFields *result;
1596 * Note that this value is always NULL, as there are no contents in the Err variant
1599 } LDKCResult_RecipientOnionFieldsNoneZPtr;
1602 * A CResult_RecipientOnionFieldsNoneZ represents the result of a fallible operation,
1603 * containing a crate::lightning::ln::outbound_payment::RecipientOnionFields on success and a () on failure.
1604 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1606 typedef struct LDKCResult_RecipientOnionFieldsNoneZ {
1608 * The contents of this CResult_RecipientOnionFieldsNoneZ, accessible via either
1609 * `err` or `result` depending on the state of `result_ok`.
1611 union LDKCResult_RecipientOnionFieldsNoneZPtr contents;
1613 * Whether this CResult_RecipientOnionFieldsNoneZ represents a success state.
1616 } LDKCResult_RecipientOnionFieldsNoneZ;
1619 * A dynamically-allocated array of crate::c_types::ThirtyTwoBytess of arbitrary size.
1620 * This corresponds to std::vector in C++
1622 typedef struct LDKCVec_ThirtyTwoBytesZ {
1624 * The elements in the array.
1625 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
1627 struct LDKThirtyTwoBytes *data;
1629 * The number of elements pointed to by `data`.
1632 } LDKCVec_ThirtyTwoBytesZ;
1635 * An enum which can either contain a crate::c_types::derived::CVec_ThirtyTwoBytesZ or not
1637 typedef enum LDKCOption_CVec_ThirtyTwoBytesZZ_Tag {
1639 * When we're in this state, this COption_CVec_ThirtyTwoBytesZZ contains a crate::c_types::derived::CVec_ThirtyTwoBytesZ
1641 LDKCOption_CVec_ThirtyTwoBytesZZ_Some,
1643 * When we're in this state, this COption_CVec_ThirtyTwoBytesZZ contains nothing
1645 LDKCOption_CVec_ThirtyTwoBytesZZ_None,
1647 * Must be last for serialization purposes
1649 LDKCOption_CVec_ThirtyTwoBytesZZ_Sentinel,
1650 } LDKCOption_CVec_ThirtyTwoBytesZZ_Tag;
1652 typedef struct LDKCOption_CVec_ThirtyTwoBytesZZ {
1653 LDKCOption_CVec_ThirtyTwoBytesZZ_Tag tag;
1656 struct LDKCVec_ThirtyTwoBytesZ some;
1659 } LDKCOption_CVec_ThirtyTwoBytesZZ;
1662 * The contents of CResult_ThirtyTwoBytesNoneZ
1664 typedef union LDKCResult_ThirtyTwoBytesNoneZPtr {
1666 * A pointer to the contents in the success state.
1667 * Reading from this pointer when `result_ok` is not set is undefined.
1669 struct LDKThirtyTwoBytes *result;
1671 * Note that this value is always NULL, as there are no contents in the Err variant
1674 } LDKCResult_ThirtyTwoBytesNoneZPtr;
1677 * A CResult_ThirtyTwoBytesNoneZ represents the result of a fallible operation,
1678 * containing a crate::c_types::ThirtyTwoBytes on success and a () on failure.
1679 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1681 typedef struct LDKCResult_ThirtyTwoBytesNoneZ {
1683 * The contents of this CResult_ThirtyTwoBytesNoneZ, accessible via either
1684 * `err` or `result` depending on the state of `result_ok`.
1686 union LDKCResult_ThirtyTwoBytesNoneZPtr contents;
1688 * Whether this CResult_ThirtyTwoBytesNoneZ represents a success state.
1691 } LDKCResult_ThirtyTwoBytesNoneZ;
1696 * Information needed to route a payment across a [`BlindedPath`].
1698 typedef struct MUST_USE_STRUCT LDKBlindedPayInfo {
1700 * A pointer to the opaque Rust object.
1701 * Nearly everywhere, inner must be non-null, however in places where
1702 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1704 LDKnativeBlindedPayInfo *inner;
1706 * Indicates that this is the only struct which contains the same pointer.
1707 * Rust functions which take ownership of an object provided via an argument require
1708 * this to be true and invalidate the object pointed to by inner.
1711 } LDKBlindedPayInfo;
1714 * The contents of CResult_BlindedPayInfoDecodeErrorZ
1716 typedef union LDKCResult_BlindedPayInfoDecodeErrorZPtr {
1718 * A pointer to the contents in the success state.
1719 * Reading from this pointer when `result_ok` is not set is undefined.
1721 struct LDKBlindedPayInfo *result;
1723 * A pointer to the contents in the error state.
1724 * Reading from this pointer when `result_ok` is set is undefined.
1726 struct LDKDecodeError *err;
1727 } LDKCResult_BlindedPayInfoDecodeErrorZPtr;
1730 * A CResult_BlindedPayInfoDecodeErrorZ represents the result of a fallible operation,
1731 * containing a crate::lightning::offers::invoice::BlindedPayInfo on success and a crate::lightning::ln::msgs::DecodeError on failure.
1732 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1734 typedef struct LDKCResult_BlindedPayInfoDecodeErrorZ {
1736 * The contents of this CResult_BlindedPayInfoDecodeErrorZ, accessible via either
1737 * `err` or `result` depending on the state of `result_ok`.
1739 union LDKCResult_BlindedPayInfoDecodeErrorZPtr contents;
1741 * Whether this CResult_BlindedPayInfoDecodeErrorZ represents a success state.
1744 } LDKCResult_BlindedPayInfoDecodeErrorZ;
1749 * Information about a spendable output to a P2WSH script.
1751 * See [`SpendableOutputDescriptor::DelayedPaymentOutput`] for more details on how to spend this.
1753 typedef struct MUST_USE_STRUCT LDKDelayedPaymentOutputDescriptor {
1755 * A pointer to the opaque Rust object.
1756 * Nearly everywhere, inner must be non-null, however in places where
1757 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1759 LDKnativeDelayedPaymentOutputDescriptor *inner;
1761 * Indicates that this is the only struct which contains the same pointer.
1762 * Rust functions which take ownership of an object provided via an argument require
1763 * this to be true and invalidate the object pointed to by inner.
1766 } LDKDelayedPaymentOutputDescriptor;
1769 * The contents of CResult_DelayedPaymentOutputDescriptorDecodeErrorZ
1771 typedef union LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZPtr {
1773 * A pointer to the contents in the success state.
1774 * Reading from this pointer when `result_ok` is not set is undefined.
1776 struct LDKDelayedPaymentOutputDescriptor *result;
1778 * A pointer to the contents in the error state.
1779 * Reading from this pointer when `result_ok` is set is undefined.
1781 struct LDKDecodeError *err;
1782 } LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZPtr;
1785 * A CResult_DelayedPaymentOutputDescriptorDecodeErrorZ represents the result of a fallible operation,
1786 * containing a crate::lightning::sign::DelayedPaymentOutputDescriptor on success and a crate::lightning::ln::msgs::DecodeError on failure.
1787 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1789 typedef struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ {
1791 * The contents of this CResult_DelayedPaymentOutputDescriptorDecodeErrorZ, accessible via either
1792 * `err` or `result` depending on the state of `result_ok`.
1794 union LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZPtr contents;
1796 * Whether this CResult_DelayedPaymentOutputDescriptorDecodeErrorZ represents a success state.
1799 } LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ;
1804 * Information about a spendable output to our \"payment key\".
1806 * See [`SpendableOutputDescriptor::StaticPaymentOutput`] for more details on how to spend this.
1808 typedef struct MUST_USE_STRUCT LDKStaticPaymentOutputDescriptor {
1810 * A pointer to the opaque Rust object.
1811 * Nearly everywhere, inner must be non-null, however in places where
1812 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1814 LDKnativeStaticPaymentOutputDescriptor *inner;
1816 * Indicates that this is the only struct which contains the same pointer.
1817 * Rust functions which take ownership of an object provided via an argument require
1818 * this to be true and invalidate the object pointed to by inner.
1821 } LDKStaticPaymentOutputDescriptor;
1824 * The contents of CResult_StaticPaymentOutputDescriptorDecodeErrorZ
1826 typedef union LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZPtr {
1828 * A pointer to the contents in the success state.
1829 * Reading from this pointer when `result_ok` is not set is undefined.
1831 struct LDKStaticPaymentOutputDescriptor *result;
1833 * A pointer to the contents in the error state.
1834 * Reading from this pointer when `result_ok` is set is undefined.
1836 struct LDKDecodeError *err;
1837 } LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZPtr;
1840 * A CResult_StaticPaymentOutputDescriptorDecodeErrorZ represents the result of a fallible operation,
1841 * containing a crate::lightning::sign::StaticPaymentOutputDescriptor on success and a crate::lightning::ln::msgs::DecodeError on failure.
1842 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1844 typedef struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ {
1846 * The contents of this CResult_StaticPaymentOutputDescriptorDecodeErrorZ, accessible via either
1847 * `err` or `result` depending on the state of `result_ok`.
1849 union LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZPtr contents;
1851 * Whether this CResult_StaticPaymentOutputDescriptorDecodeErrorZ represents a success state.
1854 } LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ;
1859 * A reference to a transaction output.
1861 * Differs from bitcoin::blockdata::transaction::OutPoint as the index is a u16 instead of u32
1862 * due to LN's restrictions on index values. Should reduce (possibly) unsafe conversions this way.
1864 typedef struct MUST_USE_STRUCT LDKOutPoint {
1866 * A pointer to the opaque Rust object.
1867 * Nearly everywhere, inner must be non-null, however in places where
1868 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1870 LDKnativeOutPoint *inner;
1872 * Indicates that this is the only struct which contains the same pointer.
1873 * Rust functions which take ownership of an object provided via an argument require
1874 * this to be true and invalidate the object pointed to by inner.
1880 * Describes the necessary information to spend a spendable output.
1882 * When on-chain outputs are created by LDK (which our counterparty is not able to claim at any
1883 * point in the future) a [`SpendableOutputs`] event is generated which you must track and be able
1884 * to spend on-chain. The information needed to do this is provided in this enum, including the
1885 * outpoint describing which `txid` and output `index` is available, the full output which exists
1886 * at that `txid`/`index`, and any keys or other information required to sign.
1888 * [`SpendableOutputs`]: crate::events::Event::SpendableOutputs
1890 typedef enum LDKSpendableOutputDescriptor_Tag {
1892 * An output to a script which was provided via [`SignerProvider`] directly, either from
1893 * [`get_destination_script`] or [`get_shutdown_scriptpubkey`], thus you should already
1894 * know how to spend it. No secret keys are provided as LDK was never given any key.
1895 * These may include outputs from a transaction punishing our counterparty or claiming an HTLC
1896 * on-chain using the payment preimage or after it has timed out.
1898 * [`get_shutdown_scriptpubkey`]: SignerProvider::get_shutdown_scriptpubkey
1899 * [`get_destination_script`]: SignerProvider::get_shutdown_scriptpubkey
1901 LDKSpendableOutputDescriptor_StaticOutput,
1903 * An output to a P2WSH script which can be spent with a single signature after an `OP_CSV`
1906 * The witness in the spending input should be:
1908 * <BIP 143 signature> <empty vector> (MINIMALIF standard rule) <provided witnessScript>
1911 * Note that the `nSequence` field in the spending input must be set to
1912 * [`DelayedPaymentOutputDescriptor::to_self_delay`] (which means the transaction is not
1913 * broadcastable until at least [`DelayedPaymentOutputDescriptor::to_self_delay`] blocks after
1914 * the outpoint confirms, see [BIP
1915 * 68](https://github.com/bitcoin/bips/blob/master/bip-0068.mediawiki)). Also note that LDK
1916 * won't generate a [`SpendableOutputDescriptor`] until the corresponding block height
1919 * These are generally the result of a \"revocable\" output to us, spendable only by us unless
1920 * it is an output from an old state which we broadcast (which should never happen).
1922 * To derive the delayed payment key which is used to sign this input, you must pass the
1923 * holder [`InMemorySigner::delayed_payment_base_key`] (i.e., the private key which corresponds to the
1924 * [`ChannelPublicKeys::delayed_payment_basepoint`] in [`ChannelSigner::pubkeys`]) and the provided
1925 * [`DelayedPaymentOutputDescriptor::per_commitment_point`] to [`chan_utils::derive_private_key`]. The public key can be
1926 * generated without the secret key using [`chan_utils::derive_public_key`] and only the
1927 * [`ChannelPublicKeys::delayed_payment_basepoint`] which appears in [`ChannelSigner::pubkeys`].
1929 * To derive the [`DelayedPaymentOutputDescriptor::revocation_pubkey`] provided here (which is
1930 * used in the witness script generation), you must pass the counterparty
1931 * [`ChannelPublicKeys::revocation_basepoint`] (which appears in the call to
1932 * [`ChannelSigner::provide_channel_parameters`]) and the provided
1933 * [`DelayedPaymentOutputDescriptor::per_commitment_point`] to
1934 * [`chan_utils::derive_public_revocation_key`].
1936 * The witness script which is hashed and included in the output `script_pubkey` may be
1937 * regenerated by passing the [`DelayedPaymentOutputDescriptor::revocation_pubkey`] (derived
1938 * as explained above), our delayed payment pubkey (derived as explained above), and the
1939 * [`DelayedPaymentOutputDescriptor::to_self_delay`] contained here to
1940 * [`chan_utils::get_revokeable_redeemscript`].
1942 LDKSpendableOutputDescriptor_DelayedPaymentOutput,
1944 * An output spendable exclusively by our payment key (i.e., the private key that corresponds
1945 * to the `payment_point` in [`ChannelSigner::pubkeys`]). The output type depends on the
1946 * channel type negotiated.
1948 * On an anchor outputs channel, the witness in the spending input is:
1950 * <BIP 143 signature> <witness script>
1955 * <BIP 143 signature> <payment key>
1958 * These are generally the result of our counterparty having broadcast the current state,
1959 * allowing us to claim the non-HTLC-encumbered outputs immediately, or after one confirmation
1960 * in the case of anchor outputs channels.
1962 LDKSpendableOutputDescriptor_StaticPaymentOutput,
1964 * Must be last for serialization purposes
1966 LDKSpendableOutputDescriptor_Sentinel,
1967 } LDKSpendableOutputDescriptor_Tag;
1969 typedef struct LDKSpendableOutputDescriptor_LDKStaticOutput_Body {
1971 * The outpoint which is spendable.
1973 struct LDKOutPoint outpoint;
1975 * The output which is referenced by the given outpoint.
1977 struct LDKTxOut output;
1978 } LDKSpendableOutputDescriptor_LDKStaticOutput_Body;
1980 typedef struct MUST_USE_STRUCT LDKSpendableOutputDescriptor {
1981 LDKSpendableOutputDescriptor_Tag tag;
1983 LDKSpendableOutputDescriptor_LDKStaticOutput_Body static_output;
1985 struct LDKDelayedPaymentOutputDescriptor delayed_payment_output;
1988 struct LDKStaticPaymentOutputDescriptor static_payment_output;
1991 } LDKSpendableOutputDescriptor;
1994 * The contents of CResult_SpendableOutputDescriptorDecodeErrorZ
1996 typedef union LDKCResult_SpendableOutputDescriptorDecodeErrorZPtr {
1998 * A pointer to the contents in the success state.
1999 * Reading from this pointer when `result_ok` is not set is undefined.
2001 struct LDKSpendableOutputDescriptor *result;
2003 * A pointer to the contents in the error state.
2004 * Reading from this pointer when `result_ok` is set is undefined.
2006 struct LDKDecodeError *err;
2007 } LDKCResult_SpendableOutputDescriptorDecodeErrorZPtr;
2010 * A CResult_SpendableOutputDescriptorDecodeErrorZ represents the result of a fallible operation,
2011 * containing a crate::lightning::sign::SpendableOutputDescriptor on success and a crate::lightning::ln::msgs::DecodeError on failure.
2012 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
2014 typedef struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ {
2016 * The contents of this CResult_SpendableOutputDescriptorDecodeErrorZ, accessible via either
2017 * `err` or `result` depending on the state of `result_ok`.
2019 union LDKCResult_SpendableOutputDescriptorDecodeErrorZPtr contents;
2021 * Whether this CResult_SpendableOutputDescriptorDecodeErrorZ represents a success state.
2024 } LDKCResult_SpendableOutputDescriptorDecodeErrorZ;
2027 * A dynamically-allocated array of crate::lightning::sign::SpendableOutputDescriptors of arbitrary size.
2028 * This corresponds to std::vector in C++
2030 typedef struct LDKCVec_SpendableOutputDescriptorZ {
2032 * The elements in the array.
2033 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
2035 struct LDKSpendableOutputDescriptor *data;
2037 * The number of elements pointed to by `data`.
2040 } LDKCVec_SpendableOutputDescriptorZ;
2043 * A dynamically-allocated array of crate::c_types::TxOuts of arbitrary size.
2044 * This corresponds to std::vector in C++
2046 typedef struct LDKCVec_TxOutZ {
2048 * The elements in the array.
2049 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
2051 struct LDKTxOut *data;
2053 * The number of elements pointed to by `data`.
2059 * An enum which can either contain a u32 or not
2061 typedef enum LDKCOption_u32Z_Tag {
2063 * When we're in this state, this COption_u32Z contains a u32
2065 LDKCOption_u32Z_Some,
2067 * When we're in this state, this COption_u32Z contains nothing
2069 LDKCOption_u32Z_None,
2071 * Must be last for serialization purposes
2073 LDKCOption_u32Z_Sentinel,
2074 } LDKCOption_u32Z_Tag;
2076 typedef struct LDKCOption_u32Z {
2077 LDKCOption_u32Z_Tag tag;
2086 * A tuple of 2 elements. See the individual fields for the types contained.
2088 typedef struct LDKC2Tuple_CVec_u8ZusizeZ {
2090 * The element at position 0
2092 struct LDKCVec_u8Z a;
2094 * The element at position 1
2097 } LDKC2Tuple_CVec_u8ZusizeZ;
2100 * The contents of CResult_C2Tuple_CVec_u8ZusizeZNoneZ
2102 typedef union LDKCResult_C2Tuple_CVec_u8ZusizeZNoneZPtr {
2104 * A pointer to the contents in the success state.
2105 * Reading from this pointer when `result_ok` is not set is undefined.
2107 struct LDKC2Tuple_CVec_u8ZusizeZ *result;
2109 * Note that this value is always NULL, as there are no contents in the Err variant
2112 } LDKCResult_C2Tuple_CVec_u8ZusizeZNoneZPtr;
2115 * A CResult_C2Tuple_CVec_u8ZusizeZNoneZ represents the result of a fallible operation,
2116 * containing a crate::c_types::derived::C2Tuple_CVec_u8ZusizeZ on success and a () on failure.
2117 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
2119 typedef struct LDKCResult_C2Tuple_CVec_u8ZusizeZNoneZ {
2121 * The contents of this CResult_C2Tuple_CVec_u8ZusizeZNoneZ, accessible via either
2122 * `err` or `result` depending on the state of `result_ok`.
2124 union LDKCResult_C2Tuple_CVec_u8ZusizeZNoneZPtr contents;
2126 * Whether this CResult_C2Tuple_CVec_u8ZusizeZNoneZ represents a success state.
2129 } LDKCResult_C2Tuple_CVec_u8ZusizeZNoneZ;
2132 * The contents of CResult_NoneNoneZ
2134 typedef union LDKCResult_NoneNoneZPtr {
2136 * Note that this value is always NULL, as there are no contents in the OK variant
2140 * Note that this value is always NULL, as there are no contents in the Err variant
2143 } LDKCResult_NoneNoneZPtr;
2146 * A CResult_NoneNoneZ represents the result of a fallible operation,
2147 * containing a () on success and a () on failure.
2148 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
2150 typedef struct LDKCResult_NoneNoneZ {
2152 * The contents of this CResult_NoneNoneZ, accessible via either
2153 * `err` or `result` depending on the state of `result_ok`.
2155 union LDKCResult_NoneNoneZPtr contents;
2157 * Whether this CResult_NoneNoneZ represents a success state.
2160 } LDKCResult_NoneNoneZ;
2163 * Represents a secp256k1 ECDSA signature serialized as two 32-byte numbers
2165 typedef struct LDKECDSASignature {
2167 * The bytes of the signature in "compact" form
2169 uint8_t compact_form[64];
2170 } LDKECDSASignature;
2173 * A dynamically-allocated array of crate::c_types::ECDSASignatures of arbitrary size.
2174 * This corresponds to std::vector in C++
2176 typedef struct LDKCVec_ECDSASignatureZ {
2178 * The elements in the array.
2179 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
2181 struct LDKECDSASignature *data;
2183 * The number of elements pointed to by `data`.
2186 } LDKCVec_ECDSASignatureZ;
2189 * A tuple of 2 elements. See the individual fields for the types contained.
2191 typedef struct LDKC2Tuple_ECDSASignatureCVec_ECDSASignatureZZ {
2193 * The element at position 0
2195 struct LDKECDSASignature a;
2197 * The element at position 1
2199 struct LDKCVec_ECDSASignatureZ b;
2200 } LDKC2Tuple_ECDSASignatureCVec_ECDSASignatureZZ;
2203 * The contents of CResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ
2205 typedef union LDKCResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZPtr {
2207 * A pointer to the contents in the success state.
2208 * Reading from this pointer when `result_ok` is not set is undefined.
2210 struct LDKC2Tuple_ECDSASignatureCVec_ECDSASignatureZZ *result;
2212 * Note that this value is always NULL, as there are no contents in the Err variant
2215 } LDKCResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZPtr;
2218 * A CResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ represents the result of a fallible operation,
2219 * containing a crate::c_types::derived::C2Tuple_ECDSASignatureCVec_ECDSASignatureZZ on success and a () on failure.
2220 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
2222 typedef struct LDKCResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ {
2224 * The contents of this CResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ, accessible via either
2225 * `err` or `result` depending on the state of `result_ok`.
2227 union LDKCResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZPtr contents;
2229 * Whether this CResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ represents a success state.
2232 } LDKCResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ;
2235 * The contents of CResult_ECDSASignatureNoneZ
2237 typedef union LDKCResult_ECDSASignatureNoneZPtr {
2239 * A pointer to the contents in the success state.
2240 * Reading from this pointer when `result_ok` is not set is undefined.
2242 struct LDKECDSASignature *result;
2244 * Note that this value is always NULL, as there are no contents in the Err variant
2247 } LDKCResult_ECDSASignatureNoneZPtr;
2250 * A CResult_ECDSASignatureNoneZ represents the result of a fallible operation,
2251 * containing a crate::c_types::ECDSASignature on success and a () on failure.
2252 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
2254 typedef struct LDKCResult_ECDSASignatureNoneZ {
2256 * The contents of this CResult_ECDSASignatureNoneZ, accessible via either
2257 * `err` or `result` depending on the state of `result_ok`.
2259 union LDKCResult_ECDSASignatureNoneZPtr contents;
2261 * Whether this CResult_ECDSASignatureNoneZ represents a success state.
2264 } LDKCResult_ECDSASignatureNoneZ;
2267 * Represents a valid secp256k1 public key serialized in "compressed form" as a 33 byte array.
2269 typedef struct LDKPublicKey {
2271 * The bytes of the public key
2273 uint8_t compressed_form[33];
2277 * The contents of CResult_PublicKeyNoneZ
2279 typedef union LDKCResult_PublicKeyNoneZPtr {
2281 * A pointer to the contents in the success state.
2282 * Reading from this pointer when `result_ok` is not set is undefined.
2284 struct LDKPublicKey *result;
2286 * Note that this value is always NULL, as there are no contents in the Err variant
2289 } LDKCResult_PublicKeyNoneZPtr;
2292 * A CResult_PublicKeyNoneZ represents the result of a fallible operation,
2293 * containing a crate::c_types::PublicKey on success and a () on failure.
2294 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
2296 typedef struct LDKCResult_PublicKeyNoneZ {
2298 * The contents of this CResult_PublicKeyNoneZ, accessible via either
2299 * `err` or `result` depending on the state of `result_ok`.
2301 union LDKCResult_PublicKeyNoneZPtr contents;
2303 * Whether this CResult_PublicKeyNoneZ represents a success state.
2306 } LDKCResult_PublicKeyNoneZ;
2309 * An enum which can either contain a crate::c_types::BigEndianScalar or not
2311 typedef enum LDKCOption_BigEndianScalarZ_Tag {
2313 * When we're in this state, this COption_BigEndianScalarZ contains a crate::c_types::BigEndianScalar
2315 LDKCOption_BigEndianScalarZ_Some,
2317 * When we're in this state, this COption_BigEndianScalarZ contains nothing
2319 LDKCOption_BigEndianScalarZ_None,
2321 * Must be last for serialization purposes
2323 LDKCOption_BigEndianScalarZ_Sentinel,
2324 } LDKCOption_BigEndianScalarZ_Tag;
2326 typedef struct LDKCOption_BigEndianScalarZ {
2327 LDKCOption_BigEndianScalarZ_Tag tag;
2330 struct LDKBigEndianScalar some;
2333 } LDKCOption_BigEndianScalarZ;
2336 * Integer in the range `0..32`
2338 typedef struct LDKU5 {
2343 * A dynamically-allocated array of crate::c_types::U5s of arbitrary size.
2344 * This corresponds to std::vector in C++
2346 typedef struct LDKCVec_U5Z {
2348 * The elements in the array.
2349 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
2353 * The number of elements pointed to by `data`.
2359 * Represents a secp256k1 signature serialized as two 32-byte numbers as well as a tag which
2360 * allows recovering the exact public key which created the signature given the message.
2362 typedef struct LDKRecoverableSignature {
2364 * The bytes of the signature in "compact" form plus a "Recovery ID" which allows for
2367 uint8_t serialized_form[68];
2368 } LDKRecoverableSignature;
2371 * The contents of CResult_RecoverableSignatureNoneZ
2373 typedef union LDKCResult_RecoverableSignatureNoneZPtr {
2375 * A pointer to the contents in the success state.
2376 * Reading from this pointer when `result_ok` is not set is undefined.
2378 struct LDKRecoverableSignature *result;
2380 * Note that this value is always NULL, as there are no contents in the Err variant
2383 } LDKCResult_RecoverableSignatureNoneZPtr;
2386 * A CResult_RecoverableSignatureNoneZ represents the result of a fallible operation,
2387 * containing a crate::c_types::RecoverableSignature on success and a () on failure.
2388 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
2390 typedef struct LDKCResult_RecoverableSignatureNoneZ {
2392 * The contents of this CResult_RecoverableSignatureNoneZ, accessible via either
2393 * `err` or `result` depending on the state of `result_ok`.
2395 union LDKCResult_RecoverableSignatureNoneZPtr contents;
2397 * Whether this CResult_RecoverableSignatureNoneZ represents a success state.
2400 } LDKCResult_RecoverableSignatureNoneZ;
2403 * Represents a secp256k1 Schnorr signature serialized as two 32-byte numbers
2405 typedef struct LDKSchnorrSignature {
2407 * The bytes of the signature as two 32-byte numbers
2409 uint8_t compact_form[64];
2410 } LDKSchnorrSignature;
2413 * The contents of CResult_SchnorrSignatureNoneZ
2415 typedef union LDKCResult_SchnorrSignatureNoneZPtr {
2417 * A pointer to the contents in the success state.
2418 * Reading from this pointer when `result_ok` is not set is undefined.
2420 struct LDKSchnorrSignature *result;
2422 * Note that this value is always NULL, as there are no contents in the Err variant
2425 } LDKCResult_SchnorrSignatureNoneZPtr;
2428 * A CResult_SchnorrSignatureNoneZ represents the result of a fallible operation,
2429 * containing a crate::c_types::SchnorrSignature on success and a () on failure.
2430 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
2432 typedef struct LDKCResult_SchnorrSignatureNoneZ {
2434 * The contents of this CResult_SchnorrSignatureNoneZ, accessible via either
2435 * `err` or `result` depending on the state of `result_ok`.
2437 union LDKCResult_SchnorrSignatureNoneZPtr contents;
2439 * Whether this CResult_SchnorrSignatureNoneZ represents a success state.
2442 } LDKCResult_SchnorrSignatureNoneZ;
2447 * This class tracks the per-transaction information needed to build a commitment transaction and will
2448 * actually build it and sign. It is used for holder transactions that we sign only when needed
2449 * and for transactions we sign for the counterparty.
2451 * This class can be used inside a signer implementation to generate a signature given the relevant
2454 typedef struct MUST_USE_STRUCT LDKCommitmentTransaction {
2456 * A pointer to the opaque Rust object.
2457 * Nearly everywhere, inner must be non-null, however in places where
2458 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2460 LDKnativeCommitmentTransaction *inner;
2462 * Indicates that this is the only struct which contains the same pointer.
2463 * Rust functions which take ownership of an object provided via an argument require
2464 * this to be true and invalidate the object pointed to by inner.
2467 } LDKCommitmentTransaction;
2472 * Information needed to build and sign a holder's commitment transaction.
2474 * The transaction is only signed once we are ready to broadcast.
2476 typedef struct MUST_USE_STRUCT LDKHolderCommitmentTransaction {
2478 * A pointer to the opaque Rust object.
2479 * Nearly everywhere, inner must be non-null, however in places where
2480 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2482 LDKnativeHolderCommitmentTransaction *inner;
2484 * Indicates that this is the only struct which contains the same pointer.
2485 * Rust functions which take ownership of an object provided via an argument require
2486 * this to be true and invalidate the object pointed to by inner.
2489 } LDKHolderCommitmentTransaction;
2494 * Information about an HTLC as it appears in a commitment transaction
2496 typedef struct MUST_USE_STRUCT LDKHTLCOutputInCommitment {
2498 * A pointer to the opaque Rust object.
2499 * Nearly everywhere, inner must be non-null, however in places where
2500 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2502 LDKnativeHTLCOutputInCommitment *inner;
2504 * Indicates that this is the only struct which contains the same pointer.
2505 * Rust functions which take ownership of an object provided via an argument require
2506 * this to be true and invalidate the object pointed to by inner.
2509 } LDKHTLCOutputInCommitment;
2514 * A descriptor used to sign for a commitment transaction's HTLC output.
2516 typedef struct MUST_USE_STRUCT LDKHTLCDescriptor {
2518 * A pointer to the opaque Rust object.
2519 * Nearly everywhere, inner must be non-null, however in places where
2520 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2522 LDKnativeHTLCDescriptor *inner;
2524 * Indicates that this is the only struct which contains the same pointer.
2525 * Rust functions which take ownership of an object provided via an argument require
2526 * this to be true and invalidate the object pointed to by inner.
2529 } LDKHTLCDescriptor;
2534 * This class tracks the per-transaction information needed to build a closing transaction and will
2535 * actually build it and sign.
2537 * This class can be used inside a signer implementation to generate a signature given the relevant
2540 typedef struct MUST_USE_STRUCT LDKClosingTransaction {
2542 * A pointer to the opaque Rust object.
2543 * Nearly everywhere, inner must be non-null, however in places where
2544 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2546 LDKnativeClosingTransaction *inner;
2548 * Indicates that this is the only struct which contains the same pointer.
2549 * Rust functions which take ownership of an object provided via an argument require
2550 * this to be true and invalidate the object pointed to by inner.
2553 } LDKClosingTransaction;
2558 * The unsigned part of a [`channel_announcement`] message.
2560 * [`channel_announcement`]: https://github.com/lightning/bolts/blob/master/07-routing-gossip.md#the-channel_announcement-message
2562 typedef struct MUST_USE_STRUCT LDKUnsignedChannelAnnouncement {
2564 * A pointer to the opaque Rust object.
2565 * Nearly everywhere, inner must be non-null, however in places where
2566 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2568 LDKnativeUnsignedChannelAnnouncement *inner;
2570 * Indicates that this is the only struct which contains the same pointer.
2571 * Rust functions which take ownership of an object provided via an argument require
2572 * this to be true and invalidate the object pointed to by inner.
2575 } LDKUnsignedChannelAnnouncement;
2580 * One counterparty's public keys which do not change over the life of a channel.
2582 typedef struct MUST_USE_STRUCT LDKChannelPublicKeys {
2584 * A pointer to the opaque Rust object.
2585 * Nearly everywhere, inner must be non-null, however in places where
2586 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2588 LDKnativeChannelPublicKeys *inner;
2590 * Indicates that this is the only struct which contains the same pointer.
2591 * Rust functions which take ownership of an object provided via an argument require
2592 * this to be true and invalidate the object pointed to by inner.
2595 } LDKChannelPublicKeys;
2600 * Per-channel data used to build transactions in conjunction with the per-commitment data (CommitmentTransaction).
2601 * The fields are organized by holder/counterparty.
2603 * Normally, this is converted to the broadcaster/countersignatory-organized DirectedChannelTransactionParameters
2604 * before use, via the as_holder_broadcastable and as_counterparty_broadcastable functions.
2606 typedef struct MUST_USE_STRUCT LDKChannelTransactionParameters {
2608 * A pointer to the opaque Rust object.
2609 * Nearly everywhere, inner must be non-null, however in places where
2610 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2612 LDKnativeChannelTransactionParameters *inner;
2614 * Indicates that this is the only struct which contains the same pointer.
2615 * Rust functions which take ownership of an object provided via an argument require
2616 * this to be true and invalidate the object pointed to by inner.
2619 } LDKChannelTransactionParameters;
2622 * A trait to handle Lightning channel key material without concretizing the channel type or
2623 * the signature mechanism.
2625 typedef struct LDKChannelSigner {
2627 * An opaque pointer which is passed to your function implementations as an argument.
2628 * This has no meaning in the LDK, and can be NULL or any other value.
2632 * Gets the per-commitment point for a specific commitment number
2634 * Note that the commitment number starts at `(1 << 48) - 1` and counts backwards.
2636 struct LDKPublicKey (*get_per_commitment_point)(const void *this_arg, uint64_t idx);
2638 * Gets the commitment secret for a specific commitment number as part of the revocation process
2640 * An external signer implementation should error here if the commitment was already signed
2641 * and should refuse to sign it in the future.
2643 * May be called more than once for the same index.
2645 * Note that the commitment number starts at `(1 << 48) - 1` and counts backwards.
2647 struct LDKThirtyTwoBytes (*release_commitment_secret)(const void *this_arg, uint64_t idx);
2649 * Validate the counterparty's signatures on the holder commitment transaction and HTLCs.
2651 * This is required in order for the signer to make sure that releasing a commitment
2652 * secret won't leave us without a broadcastable holder transaction.
2653 * Policy checks should be implemented in this function, including checking the amount
2654 * sent to us and checking the HTLCs.
2656 * The preimages of outgoing HTLCs that were fulfilled since the last commitment are provided.
2657 * A validating signer should ensure that an HTLC output is removed only when the matching
2658 * preimage is provided, or when the value to holder is restored.
2660 * Note that all the relevant preimages will be provided, but there may also be additional
2661 * irrelevant or duplicate preimages.
2663 struct LDKCResult_NoneNoneZ (*validate_holder_commitment)(const void *this_arg, const struct LDKHolderCommitmentTransaction *NONNULL_PTR holder_tx, struct LDKCVec_ThirtyTwoBytesZ preimages);
2665 * Returns the holder's channel public keys and basepoints.
2667 struct LDKChannelPublicKeys pubkeys;
2669 * Fill in the pubkeys field as a reference to it will be given to Rust after this returns
2670 * Note that this takes a pointer to this object, not the this_ptr like other methods do
2671 * This function pointer may be NULL if pubkeys is filled in when this object is created and never needs updating.
2673 void (*set_pubkeys)(const struct LDKChannelSigner*NONNULL_PTR );
2675 * Returns an arbitrary identifier describing the set of keys which are provided back to you in
2676 * some [`SpendableOutputDescriptor`] types. This should be sufficient to identify this
2677 * [`EcdsaChannelSigner`] object uniquely and lookup or re-derive its keys.
2679 struct LDKThirtyTwoBytes (*channel_keys_id)(const void *this_arg);
2681 * Set the counterparty static channel data, including basepoints,
2682 * `counterparty_selected`/`holder_selected_contest_delay` and funding outpoint.
2684 * This data is static, and will never change for a channel once set. For a given [`ChannelSigner`]
2685 * instance, LDK will call this method exactly once - either immediately after construction
2686 * (not including if done via [`SignerProvider::read_chan_signer`]) or when the funding
2687 * information has been generated.
2689 * channel_parameters.is_populated() MUST be true.
2691 void (*provide_channel_parameters)(void *this_arg, const struct LDKChannelTransactionParameters *NONNULL_PTR channel_parameters);
2693 * Frees any resources associated with this object given its this_arg pointer.
2694 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
2696 void (*free)(void *this_arg);
2700 * A trait to sign Lightning channel transactions as described in
2701 * [BOLT 3](https://github.com/lightning/bolts/blob/master/03-transactions.md).
2703 * Signing services could be implemented on a hardware wallet and should implement signing
2704 * policies in order to be secure. Please refer to the [VLS Policy
2705 * Controls](https://gitlab.com/lightning-signer/validating-lightning-signer/-/blob/main/docs/policy-controls.md)
2706 * for an example of such policies.
2708 typedef struct LDKEcdsaChannelSigner {
2710 * An opaque pointer which is passed to your function implementations as an argument.
2711 * This has no meaning in the LDK, and can be NULL or any other value.
2715 * Create a signature for a counterparty's commitment transaction and associated HTLC transactions.
2717 * Note that if signing fails or is rejected, the channel will be force-closed.
2719 * Policy checks should be implemented in this function, including checking the amount
2720 * sent to us and checking the HTLCs.
2722 * The preimages of outgoing HTLCs that were fulfilled since the last commitment are provided.
2723 * A validating signer should ensure that an HTLC output is removed only when the matching
2724 * preimage is provided, or when the value to holder is restored.
2726 * Note that all the relevant preimages will be provided, but there may also be additional
2727 * irrelevant or duplicate preimages.
2729 struct LDKCResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ (*sign_counterparty_commitment)(const void *this_arg, const struct LDKCommitmentTransaction *NONNULL_PTR commitment_tx, struct LDKCVec_ThirtyTwoBytesZ preimages);
2731 * Validate the counterparty's revocation.
2733 * This is required in order for the signer to make sure that the state has moved
2734 * forward and it is safe to sign the next counterparty commitment.
2736 struct LDKCResult_NoneNoneZ (*validate_counterparty_revocation)(const void *this_arg, uint64_t idx, const uint8_t (*secret)[32]);
2738 * Creates a signature for a holder's commitment transaction and its claiming HTLC transactions.
2740 * This will be called
2741 * - with a non-revoked `commitment_tx`.
2742 * - with the latest `commitment_tx` when we initiate a force-close.
2743 * - with the previous `commitment_tx`, just to get claiming HTLC
2744 * signatures, if we are reacting to a [`ChannelMonitor`]
2745 * [replica](https://github.com/lightningdevkit/rust-lightning/blob/main/GLOSSARY.md#monitor-replicas)
2746 * that decided to broadcast before it had been updated to the latest `commitment_tx`.
2748 * This may be called multiple times for the same transaction.
2750 * An external signer implementation should check that the commitment has not been revoked.
2752 * [`ChannelMonitor`]: crate::chain::channelmonitor::ChannelMonitor
2754 struct LDKCResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ (*sign_holder_commitment_and_htlcs)(const void *this_arg, const struct LDKHolderCommitmentTransaction *NONNULL_PTR commitment_tx);
2756 * Create a signature for the given input in a transaction spending an HTLC transaction output
2757 * or a commitment transaction `to_local` output when our counterparty broadcasts an old state.
2759 * A justice transaction may claim multiple outputs at the same time if timelocks are
2760 * similar, but only a signature for the input at index `input` should be signed for here.
2761 * It may be called multiple times for same output(s) if a fee-bump is needed with regards
2762 * to an upcoming timelock expiration.
2764 * Amount is value of the output spent by this input, committed to in the BIP 143 signature.
2766 * `per_commitment_key` is revocation secret which was provided by our counterparty when they
2767 * revoked the state which they eventually broadcast. It's not a _holder_ secret key and does
2768 * not allow the spending of any funds by itself (you need our holder `revocation_secret` to do
2771 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]);
2773 * Create a signature for the given input in a transaction spending a commitment transaction
2774 * HTLC output when our counterparty broadcasts an old state.
2776 * A justice transaction may claim multiple outputs at the same time if timelocks are
2777 * similar, but only a signature for the input at index `input` should be signed for here.
2778 * It may be called multiple times for same output(s) if a fee-bump is needed with regards
2779 * to an upcoming timelock expiration.
2781 * `amount` is the value of the output spent by this input, committed to in the BIP 143
2784 * `per_commitment_key` is revocation secret which was provided by our counterparty when they
2785 * revoked the state which they eventually broadcast. It's not a _holder_ secret key and does
2786 * not allow the spending of any funds by itself (you need our holder revocation_secret to do
2789 * `htlc` holds HTLC elements (hash, timelock), thus changing the format of the witness script
2790 * (which is committed to in the BIP 143 signatures).
2792 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);
2794 * Computes the signature for a commitment transaction's HTLC output used as an input within
2795 * `htlc_tx`, which spends the commitment transaction at index `input`. The signature returned
2796 * must be be computed using [`EcdsaSighashType::All`]. Note that this should only be used to
2797 * sign HTLC transactions from channels supporting anchor outputs after all additional
2798 * inputs/outputs have been added to the transaction.
2800 * [`EcdsaSighashType::All`]: bitcoin::blockdata::transaction::EcdsaSighashType::All
2802 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);
2804 * Create a signature for a claiming transaction for a HTLC output on a counterparty's commitment
2805 * transaction, either offered or received.
2807 * Such a transaction may claim multiples offered outputs at same time if we know the
2808 * preimage for each when we create it, but only the input at index `input` should be
2809 * signed for here. It may be called multiple times for same output(s) if a fee-bump is
2810 * needed with regards to an upcoming timelock expiration.
2812 * `witness_script` is either an offered or received script as defined in BOLT3 for HTLC
2815 * `amount` is value of the output spent by this input, committed to in the BIP 143 signature.
2817 * `per_commitment_point` is the dynamic point corresponding to the channel state
2818 * detected onchain. It has been generated by our counterparty and is used to derive
2819 * channel state keys, which are then included in the witness script and committed to in the
2820 * BIP 143 signature.
2822 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);
2824 * Create a signature for a (proposed) closing transaction.
2826 * Note that, due to rounding, there may be one \"missing\" satoshi, and either party may have
2827 * chosen to forgo their output as dust.
2829 struct LDKCResult_ECDSASignatureNoneZ (*sign_closing_transaction)(const void *this_arg, const struct LDKClosingTransaction *NONNULL_PTR closing_tx);
2831 * Computes the signature for a commitment transaction's anchor output used as an
2832 * input within `anchor_tx`, which spends the commitment transaction, at index `input`.
2834 struct LDKCResult_ECDSASignatureNoneZ (*sign_holder_anchor_input)(const void *this_arg, struct LDKTransaction anchor_tx, uintptr_t input);
2836 * Signs a channel announcement message with our funding key proving it comes from one of the
2837 * channel participants.
2839 * Channel announcements also require a signature from each node's network key. Our node
2840 * signature is computed through [`NodeSigner::sign_gossip_message`].
2842 * Note that if this fails or is rejected, the channel will not be publicly announced and
2843 * our counterparty may (though likely will not) close the channel on us for violating the
2846 struct LDKCResult_ECDSASignatureNoneZ (*sign_channel_announcement_with_funding_key)(const void *this_arg, const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR msg);
2848 * Implementation of ChannelSigner for this object.
2850 struct LDKChannelSigner ChannelSigner;
2852 * Frees any resources associated with this object given its this_arg pointer.
2853 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
2855 void (*free)(void *this_arg);
2856 } LDKEcdsaChannelSigner;
2859 * A writeable signer.
2861 * There will always be two instances of a signer per channel, one occupied by the
2862 * [`ChannelManager`] and another by the channel's [`ChannelMonitor`].
2864 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
2865 * [`ChannelMonitor`]: crate::chain::channelmonitor::ChannelMonitor
2867 typedef struct LDKWriteableEcdsaChannelSigner {
2869 * An opaque pointer which is passed to your function implementations as an argument.
2870 * This has no meaning in the LDK, and can be NULL or any other value.
2874 * Implementation of EcdsaChannelSigner for this object.
2876 struct LDKEcdsaChannelSigner EcdsaChannelSigner;
2878 * Serialize the object into a byte array
2880 struct LDKCVec_u8Z (*write)(const void *this_arg);
2882 * Called, if set, after this WriteableEcdsaChannelSigner has been cloned into a duplicate object.
2883 * The new WriteableEcdsaChannelSigner is provided, and should be mutated as needed to perform a
2884 * deep copy of the object pointed to by this_arg or avoid any double-freeing.
2886 void (*cloned)(struct LDKWriteableEcdsaChannelSigner *NONNULL_PTR new_WriteableEcdsaChannelSigner);
2888 * Frees any resources associated with this object given its this_arg pointer.
2889 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
2891 void (*free)(void *this_arg);
2892 } LDKWriteableEcdsaChannelSigner;
2895 * The contents of CResult_WriteableEcdsaChannelSignerDecodeErrorZ
2897 typedef union LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZPtr {
2899 * A pointer to the contents in the success state.
2900 * Reading from this pointer when `result_ok` is not set is undefined.
2902 struct LDKWriteableEcdsaChannelSigner *result;
2904 * A pointer to the contents in the error state.
2905 * Reading from this pointer when `result_ok` is set is undefined.
2907 struct LDKDecodeError *err;
2908 } LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZPtr;
2911 * A CResult_WriteableEcdsaChannelSignerDecodeErrorZ represents the result of a fallible operation,
2912 * containing a crate::lightning::sign::WriteableEcdsaChannelSigner on success and a crate::lightning::ln::msgs::DecodeError on failure.
2913 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
2915 typedef struct LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ {
2917 * The contents of this CResult_WriteableEcdsaChannelSignerDecodeErrorZ, accessible via either
2918 * `err` or `result` depending on the state of `result_ok`.
2920 union LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZPtr contents;
2922 * Whether this CResult_WriteableEcdsaChannelSignerDecodeErrorZ represents a success state.
2925 } LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ;
2928 * The contents of CResult_CVec_u8ZNoneZ
2930 typedef union LDKCResult_CVec_u8ZNoneZPtr {
2932 * A pointer to the contents in the success state.
2933 * Reading from this pointer when `result_ok` is not set is undefined.
2935 struct LDKCVec_u8Z *result;
2937 * Note that this value is always NULL, as there are no contents in the Err variant
2940 } LDKCResult_CVec_u8ZNoneZPtr;
2943 * A CResult_CVec_u8ZNoneZ represents the result of a fallible operation,
2944 * containing a crate::c_types::derived::CVec_u8Z on success and a () on failure.
2945 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
2947 typedef struct LDKCResult_CVec_u8ZNoneZ {
2949 * The contents of this CResult_CVec_u8ZNoneZ, accessible via either
2950 * `err` or `result` depending on the state of `result_ok`.
2952 union LDKCResult_CVec_u8ZNoneZPtr contents;
2954 * Whether this CResult_CVec_u8ZNoneZ represents a success state.
2957 } LDKCResult_CVec_u8ZNoneZ;
2960 * The contents of CResult_ShutdownScriptNoneZ
2962 typedef union LDKCResult_ShutdownScriptNoneZPtr {
2964 * A pointer to the contents in the success state.
2965 * Reading from this pointer when `result_ok` is not set is undefined.
2967 struct LDKShutdownScript *result;
2969 * Note that this value is always NULL, as there are no contents in the Err variant
2972 } LDKCResult_ShutdownScriptNoneZPtr;
2975 * A CResult_ShutdownScriptNoneZ represents the result of a fallible operation,
2976 * containing a crate::lightning::ln::script::ShutdownScript on success and a () on failure.
2977 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
2979 typedef struct LDKCResult_ShutdownScriptNoneZ {
2981 * The contents of this CResult_ShutdownScriptNoneZ, accessible via either
2982 * `err` or `result` depending on the state of `result_ok`.
2984 union LDKCResult_ShutdownScriptNoneZPtr contents;
2986 * Whether this CResult_ShutdownScriptNoneZ represents a success state.
2989 } LDKCResult_ShutdownScriptNoneZ;
2992 * An enum which can either contain a u16 or not
2994 typedef enum LDKCOption_u16Z_Tag {
2996 * When we're in this state, this COption_u16Z contains a u16
2998 LDKCOption_u16Z_Some,
3000 * When we're in this state, this COption_u16Z contains nothing
3002 LDKCOption_u16Z_None,
3004 * Must be last for serialization purposes
3006 LDKCOption_u16Z_Sentinel,
3007 } LDKCOption_u16Z_Tag;
3009 typedef struct LDKCOption_u16Z {
3010 LDKCOption_u16Z_Tag tag;
3019 * An enum which can either contain a bool or not
3021 typedef enum LDKCOption_boolZ_Tag {
3023 * When we're in this state, this COption_boolZ contains a bool
3025 LDKCOption_boolZ_Some,
3027 * When we're in this state, this COption_boolZ contains nothing
3029 LDKCOption_boolZ_None,
3031 * Must be last for serialization purposes
3033 LDKCOption_boolZ_Sentinel,
3034 } LDKCOption_boolZ_Tag;
3036 typedef struct LDKCOption_boolZ {
3037 LDKCOption_boolZ_Tag tag;
3046 * A dynamically-allocated array of crate::c_types::derived::CVec_u8Zs of arbitrary size.
3047 * This corresponds to std::vector in C++
3049 typedef struct LDKCVec_CVec_u8ZZ {
3051 * The elements in the array.
3052 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
3054 struct LDKCVec_u8Z *data;
3056 * The number of elements pointed to by `data`.
3059 } LDKCVec_CVec_u8ZZ;
3062 * The contents of CResult_CVec_CVec_u8ZZNoneZ
3064 typedef union LDKCResult_CVec_CVec_u8ZZNoneZPtr {
3066 * A pointer to the contents in the success state.
3067 * Reading from this pointer when `result_ok` is not set is undefined.
3069 struct LDKCVec_CVec_u8ZZ *result;
3071 * Note that this value is always NULL, as there are no contents in the Err variant
3074 } LDKCResult_CVec_CVec_u8ZZNoneZPtr;
3077 * A CResult_CVec_CVec_u8ZZNoneZ represents the result of a fallible operation,
3078 * containing a crate::c_types::derived::CVec_CVec_u8ZZ on success and a () on failure.
3079 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
3081 typedef struct LDKCResult_CVec_CVec_u8ZZNoneZ {
3083 * The contents of this CResult_CVec_CVec_u8ZZNoneZ, accessible via either
3084 * `err` or `result` depending on the state of `result_ok`.
3086 union LDKCResult_CVec_CVec_u8ZZNoneZPtr contents;
3088 * Whether this CResult_CVec_CVec_u8ZZNoneZ represents a success state.
3091 } LDKCResult_CVec_CVec_u8ZZNoneZ;
3096 * A simple implementation of [`WriteableEcdsaChannelSigner`] that just keeps the private keys in memory.
3098 * This implementation performs no policy checks and is insufficient by itself as
3099 * a secure external signer.
3101 typedef struct MUST_USE_STRUCT LDKInMemorySigner {
3103 * A pointer to the opaque Rust object.
3104 * Nearly everywhere, inner must be non-null, however in places where
3105 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3107 LDKnativeInMemorySigner *inner;
3109 * Indicates that this is the only struct which contains the same pointer.
3110 * Rust functions which take ownership of an object provided via an argument require
3111 * this to be true and invalidate the object pointed to by inner.
3114 } LDKInMemorySigner;
3117 * The contents of CResult_InMemorySignerDecodeErrorZ
3119 typedef union LDKCResult_InMemorySignerDecodeErrorZPtr {
3121 * A pointer to the contents in the success state.
3122 * Reading from this pointer when `result_ok` is not set is undefined.
3124 struct LDKInMemorySigner *result;
3126 * A pointer to the contents in the error state.
3127 * Reading from this pointer when `result_ok` is set is undefined.
3129 struct LDKDecodeError *err;
3130 } LDKCResult_InMemorySignerDecodeErrorZPtr;
3133 * A CResult_InMemorySignerDecodeErrorZ represents the result of a fallible operation,
3134 * containing a crate::lightning::sign::InMemorySigner on success and a crate::lightning::ln::msgs::DecodeError on failure.
3135 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
3137 typedef struct LDKCResult_InMemorySignerDecodeErrorZ {
3139 * The contents of this CResult_InMemorySignerDecodeErrorZ, accessible via either
3140 * `err` or `result` depending on the state of `result_ok`.
3142 union LDKCResult_InMemorySignerDecodeErrorZPtr contents;
3144 * Whether this CResult_InMemorySignerDecodeErrorZ represents a success state.
3147 } LDKCResult_InMemorySignerDecodeErrorZ;
3150 * The contents of CResult_TransactionNoneZ
3152 typedef union LDKCResult_TransactionNoneZPtr {
3154 * A pointer to the contents in the success state.
3155 * Reading from this pointer when `result_ok` is not set is undefined.
3157 struct LDKTransaction *result;
3159 * Note that this value is always NULL, as there are no contents in the Err variant
3162 } LDKCResult_TransactionNoneZPtr;
3165 * A CResult_TransactionNoneZ represents the result of a fallible operation,
3166 * containing a crate::c_types::Transaction on success and a () on failure.
3167 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
3169 typedef struct LDKCResult_TransactionNoneZ {
3171 * The contents of this CResult_TransactionNoneZ, accessible via either
3172 * `err` or `result` depending on the state of `result_ok`.
3174 union LDKCResult_TransactionNoneZPtr contents;
3176 * Whether this CResult_TransactionNoneZ represents a success state.
3179 } LDKCResult_TransactionNoneZ;
3184 * Represents the compressed public key of a node
3186 typedef struct MUST_USE_STRUCT LDKNodeId {
3188 * A pointer to the opaque Rust object.
3189 * Nearly everywhere, inner must be non-null, however in places where
3190 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3192 LDKnativeNodeId *inner;
3194 * Indicates that this is the only struct which contains the same pointer.
3195 * Rust functions which take ownership of an object provided via an argument require
3196 * this to be true and invalidate the object pointed to by inner.
3204 * Proposed use of a channel passed as a parameter to [`ScoreLookUp::channel_penalty_msat`].
3206 typedef struct MUST_USE_STRUCT LDKChannelUsage {
3208 * A pointer to the opaque Rust object.
3209 * Nearly everywhere, inner must be non-null, however in places where
3210 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3212 LDKnativeChannelUsage *inner;
3214 * Indicates that this is the only struct which contains the same pointer.
3215 * Rust functions which take ownership of an object provided via an argument require
3216 * this to be true and invalidate the object pointed to by inner.
3224 * Parameters for configuring [`ProbabilisticScorer`].
3226 * Used to configure base, liquidity, and amount penalties, the sum of which comprises the channel
3227 * penalty (i.e., the amount in msats willing to be paid to avoid routing through the channel).
3229 * The penalty applied to any channel by the [`ProbabilisticScorer`] is the sum of each of the
3232 typedef struct MUST_USE_STRUCT LDKProbabilisticScoringFeeParameters {
3234 * A pointer to the opaque Rust object.
3235 * Nearly everywhere, inner must be non-null, however in places where
3236 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3238 LDKnativeProbabilisticScoringFeeParameters *inner;
3240 * Indicates that this is the only struct which contains the same pointer.
3241 * Rust functions which take ownership of an object provided via an argument require
3242 * this to be true and invalidate the object pointed to by inner.
3245 } LDKProbabilisticScoringFeeParameters;
3248 * An interface used to score payment channels for path finding.
3250 * `ScoreLookUp` is used to determine the penalty for a given channel.
3252 * Scoring is in terms of fees willing to be paid in order to avoid routing through a channel.
3254 typedef struct LDKScoreLookUp {
3256 * An opaque pointer which is passed to your function implementations as an argument.
3257 * This has no meaning in the LDK, and can be NULL or any other value.
3261 * Returns the fee in msats willing to be paid to avoid routing `send_amt_msat` through the
3262 * given channel in the direction from `source` to `target`.
3264 * The channel's capacity (less any other MPP parts that are also being considered for use in
3265 * the same payment) is given by `capacity_msat`. It may be determined from various sources
3266 * such as a chain data, network gossip, or invoice hints. For invoice hints, a capacity near
3267 * [`u64::max_value`] is given to indicate sufficient capacity for the invoice's full amount.
3268 * Thus, implementations should be overflow-safe.
3270 uint64_t (*channel_penalty_msat)(const void *this_arg, uint64_t short_channel_id, const struct LDKNodeId *NONNULL_PTR source, const struct LDKNodeId *NONNULL_PTR target, struct LDKChannelUsage usage, const struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR score_params);
3272 * Frees any resources associated with this object given its this_arg pointer.
3273 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
3275 void (*free)(void *this_arg);
3281 * A path in a [`Route`] to the payment recipient. Must always be at least length one.
3282 * If no [`Path::blinded_tail`] is present, then [`Path::hops`] length may be up to 19.
3284 typedef struct MUST_USE_STRUCT LDKPath {
3286 * A pointer to the opaque Rust object.
3287 * Nearly everywhere, inner must be non-null, however in places where
3288 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3290 LDKnativePath *inner;
3292 * Indicates that this is the only struct which contains the same pointer.
3293 * Rust functions which take ownership of an object provided via an argument require
3294 * this to be true and invalidate the object pointed to by inner.
3300 * `ScoreUpdate` is used to update the scorer's internal state after a payment attempt.
3302 typedef struct LDKScoreUpdate {
3304 * An opaque pointer which is passed to your function implementations as an argument.
3305 * This has no meaning in the LDK, and can be NULL or any other value.
3309 * Handles updating channel penalties after failing to route through a channel.
3311 void (*payment_path_failed)(void *this_arg, const struct LDKPath *NONNULL_PTR path, uint64_t short_channel_id);
3313 * Handles updating channel penalties after successfully routing along a path.
3315 void (*payment_path_successful)(void *this_arg, const struct LDKPath *NONNULL_PTR path);
3317 * Handles updating channel penalties after a probe over the given path failed.
3319 void (*probe_failed)(void *this_arg, const struct LDKPath *NONNULL_PTR path, uint64_t short_channel_id);
3321 * Handles updating channel penalties after a probe over the given path succeeded.
3323 void (*probe_successful)(void *this_arg, const struct LDKPath *NONNULL_PTR path);
3325 * Frees any resources associated with this object given its this_arg pointer.
3326 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
3328 void (*free)(void *this_arg);
3332 * A scorer that is accessed under a lock.
3334 * Needed so that calls to [`ScoreLookUp::channel_penalty_msat`] in [`find_route`] can be made while
3335 * having shared ownership of a scorer but without requiring internal locking in [`ScoreUpdate`]
3336 * implementations. Internal locking would be detrimental to route finding performance and could
3337 * result in [`ScoreLookUp::channel_penalty_msat`] returning a different value for the same channel.
3339 * [`find_route`]: crate::routing::router::find_route
3341 typedef struct LDKLockableScore {
3343 * An opaque pointer which is passed to your function implementations as an argument.
3344 * This has no meaning in the LDK, and can be NULL or any other value.
3348 * Returns read locked scorer.
3350 struct LDKScoreLookUp (*read_lock)(const void *this_arg);
3352 * Returns write locked scorer.
3354 struct LDKScoreUpdate (*write_lock)(const void *this_arg);
3356 * Frees any resources associated with this object given its this_arg pointer.
3357 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
3359 void (*free)(void *this_arg);
3363 * Refers to a scorer that is accessible under lock and also writeable to disk
3365 * We need this trait to be able to pass in a scorer to `lightning-background-processor` that will enable us to
3366 * use the Persister to persist it.
3368 typedef struct LDKWriteableScore {
3370 * An opaque pointer which is passed to your function implementations as an argument.
3371 * This has no meaning in the LDK, and can be NULL or any other value.
3375 * Implementation of LockableScore for this object.
3377 struct LDKLockableScore LockableScore;
3379 * Serialize the object into a byte array
3381 struct LDKCVec_u8Z (*write)(const void *this_arg);
3383 * Frees any resources associated with this object given its this_arg pointer.
3384 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
3386 void (*free)(void *this_arg);
3387 } LDKWriteableScore;
3390 * An enum which can either contain a crate::lightning::routing::scoring::WriteableScore or not
3392 typedef enum LDKCOption_WriteableScoreZ_Tag {
3394 * When we're in this state, this COption_WriteableScoreZ contains a crate::lightning::routing::scoring::WriteableScore
3396 LDKCOption_WriteableScoreZ_Some,
3398 * When we're in this state, this COption_WriteableScoreZ contains nothing
3400 LDKCOption_WriteableScoreZ_None,
3402 * Must be last for serialization purposes
3404 LDKCOption_WriteableScoreZ_Sentinel,
3405 } LDKCOption_WriteableScoreZ_Tag;
3407 typedef struct LDKCOption_WriteableScoreZ {
3408 LDKCOption_WriteableScoreZ_Tag tag;
3411 struct LDKWriteableScore some;
3414 } LDKCOption_WriteableScoreZ;
3417 * The contents of CResult_NoneIOErrorZ
3419 typedef union LDKCResult_NoneIOErrorZPtr {
3421 * Note that this value is always NULL, as there are no contents in the OK variant
3425 * A pointer to the contents in the error state.
3426 * Reading from this pointer when `result_ok` is set is undefined.
3428 enum LDKIOError *err;
3429 } LDKCResult_NoneIOErrorZPtr;
3432 * A CResult_NoneIOErrorZ represents the result of a fallible operation,
3433 * containing a () on success and a crate::c_types::IOError on failure.
3434 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
3436 typedef struct LDKCResult_NoneIOErrorZ {
3438 * The contents of this CResult_NoneIOErrorZ, accessible via either
3439 * `err` or `result` depending on the state of `result_ok`.
3441 union LDKCResult_NoneIOErrorZPtr contents;
3443 * Whether this CResult_NoneIOErrorZ represents a success state.
3446 } LDKCResult_NoneIOErrorZ;
3451 * Details of a channel, as returned by [`ChannelManager::list_channels`] and [`ChannelManager::list_usable_channels`]
3453 typedef struct MUST_USE_STRUCT LDKChannelDetails {
3455 * A pointer to the opaque Rust object.
3456 * Nearly everywhere, inner must be non-null, however in places where
3457 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3459 LDKnativeChannelDetails *inner;
3461 * Indicates that this is the only struct which contains the same pointer.
3462 * Rust functions which take ownership of an object provided via an argument require
3463 * this to be true and invalidate the object pointed to by inner.
3466 } LDKChannelDetails;
3469 * A dynamically-allocated array of crate::lightning::ln::channelmanager::ChannelDetailss of arbitrary size.
3470 * This corresponds to std::vector in C++
3472 typedef struct LDKCVec_ChannelDetailsZ {
3474 * The elements in the array.
3475 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
3477 struct LDKChannelDetails *data;
3479 * The number of elements pointed to by `data`.
3482 } LDKCVec_ChannelDetailsZ;
3487 * A route directs a payment from the sender (us) to the recipient. If the recipient supports MPP,
3488 * it can take multiple paths. Each path is composed of one or more hops through the network.
3490 typedef struct MUST_USE_STRUCT LDKRoute {
3492 * A pointer to the opaque Rust object.
3493 * Nearly everywhere, inner must be non-null, however in places where
3494 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3496 LDKnativeRoute *inner;
3498 * Indicates that this is the only struct which contains the same pointer.
3499 * Rust functions which take ownership of an object provided via an argument require
3500 * this to be true and invalidate the object pointed to by inner.
3508 * An Err type for failure to process messages.
3510 typedef struct MUST_USE_STRUCT LDKLightningError {
3512 * A pointer to the opaque Rust object.
3513 * Nearly everywhere, inner must be non-null, however in places where
3514 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3516 LDKnativeLightningError *inner;
3518 * Indicates that this is the only struct which contains the same pointer.
3519 * Rust functions which take ownership of an object provided via an argument require
3520 * this to be true and invalidate the object pointed to by inner.
3523 } LDKLightningError;
3526 * The contents of CResult_RouteLightningErrorZ
3528 typedef union LDKCResult_RouteLightningErrorZPtr {
3530 * A pointer to the contents in the success state.
3531 * Reading from this pointer when `result_ok` is not set is undefined.
3533 struct LDKRoute *result;
3535 * A pointer to the contents in the error state.
3536 * Reading from this pointer when `result_ok` is set is undefined.
3538 struct LDKLightningError *err;
3539 } LDKCResult_RouteLightningErrorZPtr;
3542 * A CResult_RouteLightningErrorZ represents the result of a fallible operation,
3543 * containing a crate::lightning::routing::router::Route on success and a crate::lightning::ln::msgs::LightningError on failure.
3544 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
3546 typedef struct LDKCResult_RouteLightningErrorZ {
3548 * The contents of this CResult_RouteLightningErrorZ, accessible via either
3549 * `err` or `result` depending on the state of `result_ok`.
3551 union LDKCResult_RouteLightningErrorZPtr contents;
3553 * Whether this CResult_RouteLightningErrorZ represents a success state.
3556 } LDKCResult_RouteLightningErrorZ;
3561 * A data structure for tracking in-flight HTLCs. May be used during pathfinding to account for
3562 * in-use channel liquidity.
3564 typedef struct MUST_USE_STRUCT LDKInFlightHtlcs {
3566 * A pointer to the opaque Rust object.
3567 * Nearly everywhere, inner must be non-null, however in places where
3568 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3570 LDKnativeInFlightHtlcs *inner;
3572 * Indicates that this is the only struct which contains the same pointer.
3573 * Rust functions which take ownership of an object provided via an argument require
3574 * this to be true and invalidate the object pointed to by inner.
3580 * The contents of CResult_InFlightHtlcsDecodeErrorZ
3582 typedef union LDKCResult_InFlightHtlcsDecodeErrorZPtr {
3584 * A pointer to the contents in the success state.
3585 * Reading from this pointer when `result_ok` is not set is undefined.
3587 struct LDKInFlightHtlcs *result;
3589 * A pointer to the contents in the error state.
3590 * Reading from this pointer when `result_ok` is set is undefined.
3592 struct LDKDecodeError *err;
3593 } LDKCResult_InFlightHtlcsDecodeErrorZPtr;
3596 * A CResult_InFlightHtlcsDecodeErrorZ represents the result of a fallible operation,
3597 * containing a crate::lightning::routing::router::InFlightHtlcs on success and a crate::lightning::ln::msgs::DecodeError on failure.
3598 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
3600 typedef struct LDKCResult_InFlightHtlcsDecodeErrorZ {
3602 * The contents of this CResult_InFlightHtlcsDecodeErrorZ, accessible via either
3603 * `err` or `result` depending on the state of `result_ok`.
3605 union LDKCResult_InFlightHtlcsDecodeErrorZPtr contents;
3607 * Whether this CResult_InFlightHtlcsDecodeErrorZ represents a success state.
3610 } LDKCResult_InFlightHtlcsDecodeErrorZ;
3615 * A hop in a route, and additional metadata about it. \"Hop\" is defined as a node and the channel
3618 typedef struct MUST_USE_STRUCT LDKRouteHop {
3620 * A pointer to the opaque Rust object.
3621 * Nearly everywhere, inner must be non-null, however in places where
3622 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3624 LDKnativeRouteHop *inner;
3626 * Indicates that this is the only struct which contains the same pointer.
3627 * Rust functions which take ownership of an object provided via an argument require
3628 * this to be true and invalidate the object pointed to by inner.
3634 * The contents of CResult_RouteHopDecodeErrorZ
3636 typedef union LDKCResult_RouteHopDecodeErrorZPtr {
3638 * A pointer to the contents in the success state.
3639 * Reading from this pointer when `result_ok` is not set is undefined.
3641 struct LDKRouteHop *result;
3643 * A pointer to the contents in the error state.
3644 * Reading from this pointer when `result_ok` is set is undefined.
3646 struct LDKDecodeError *err;
3647 } LDKCResult_RouteHopDecodeErrorZPtr;
3650 * A CResult_RouteHopDecodeErrorZ represents the result of a fallible operation,
3651 * containing a crate::lightning::routing::router::RouteHop on success and a crate::lightning::ln::msgs::DecodeError on failure.
3652 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
3654 typedef struct LDKCResult_RouteHopDecodeErrorZ {
3656 * The contents of this CResult_RouteHopDecodeErrorZ, accessible via either
3657 * `err` or `result` depending on the state of `result_ok`.
3659 union LDKCResult_RouteHopDecodeErrorZPtr contents;
3661 * Whether this CResult_RouteHopDecodeErrorZ represents a success state.
3664 } LDKCResult_RouteHopDecodeErrorZ;
3669 * An encrypted payload and node id corresponding to a hop in a payment or onion message path, to
3670 * be encoded in the sender's onion packet. These hops cannot be identified by outside observers
3671 * and thus can be used to hide the identity of the recipient.
3673 typedef struct MUST_USE_STRUCT LDKBlindedHop {
3675 * A pointer to the opaque Rust object.
3676 * Nearly everywhere, inner must be non-null, however in places where
3677 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3679 LDKnativeBlindedHop *inner;
3681 * Indicates that this is the only struct which contains the same pointer.
3682 * Rust functions which take ownership of an object provided via an argument require
3683 * this to be true and invalidate the object pointed to by inner.
3689 * A dynamically-allocated array of crate::lightning::blinded_path::BlindedHops of arbitrary size.
3690 * This corresponds to std::vector in C++
3692 typedef struct LDKCVec_BlindedHopZ {
3694 * The elements in the array.
3695 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
3697 struct LDKBlindedHop *data;
3699 * The number of elements pointed to by `data`.
3702 } LDKCVec_BlindedHopZ;
3707 * The blinded portion of a [`Path`], if we're routing to a recipient who provided blinded paths in
3708 * their [`Bolt12Invoice`].
3710 * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice
3712 typedef struct MUST_USE_STRUCT LDKBlindedTail {
3714 * A pointer to the opaque Rust object.
3715 * Nearly everywhere, inner must be non-null, however in places where
3716 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3718 LDKnativeBlindedTail *inner;
3720 * Indicates that this is the only struct which contains the same pointer.
3721 * Rust functions which take ownership of an object provided via an argument require
3722 * this to be true and invalidate the object pointed to by inner.
3728 * The contents of CResult_BlindedTailDecodeErrorZ
3730 typedef union LDKCResult_BlindedTailDecodeErrorZPtr {
3732 * A pointer to the contents in the success state.
3733 * Reading from this pointer when `result_ok` is not set is undefined.
3735 struct LDKBlindedTail *result;
3737 * A pointer to the contents in the error state.
3738 * Reading from this pointer when `result_ok` is set is undefined.
3740 struct LDKDecodeError *err;
3741 } LDKCResult_BlindedTailDecodeErrorZPtr;
3744 * A CResult_BlindedTailDecodeErrorZ represents the result of a fallible operation,
3745 * containing a crate::lightning::routing::router::BlindedTail on success and a crate::lightning::ln::msgs::DecodeError on failure.
3746 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
3748 typedef struct LDKCResult_BlindedTailDecodeErrorZ {
3750 * The contents of this CResult_BlindedTailDecodeErrorZ, accessible via either
3751 * `err` or `result` depending on the state of `result_ok`.
3753 union LDKCResult_BlindedTailDecodeErrorZPtr contents;
3755 * Whether this CResult_BlindedTailDecodeErrorZ represents a success state.
3758 } LDKCResult_BlindedTailDecodeErrorZ;
3761 * A dynamically-allocated array of crate::lightning::routing::router::RouteHops of arbitrary size.
3762 * This corresponds to std::vector in C++
3764 typedef struct LDKCVec_RouteHopZ {
3766 * The elements in the array.
3767 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
3769 struct LDKRouteHop *data;
3771 * The number of elements pointed to by `data`.
3774 } LDKCVec_RouteHopZ;
3777 * A dynamically-allocated array of crate::lightning::routing::router::Paths of arbitrary size.
3778 * This corresponds to std::vector in C++
3780 typedef struct LDKCVec_PathZ {
3782 * The elements in the array.
3783 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
3785 struct LDKPath *data;
3787 * The number of elements pointed to by `data`.
3793 * The contents of CResult_RouteDecodeErrorZ
3795 typedef union LDKCResult_RouteDecodeErrorZPtr {
3797 * A pointer to the contents in the success state.
3798 * Reading from this pointer when `result_ok` is not set is undefined.
3800 struct LDKRoute *result;
3802 * A pointer to the contents in the error state.
3803 * Reading from this pointer when `result_ok` is set is undefined.
3805 struct LDKDecodeError *err;
3806 } LDKCResult_RouteDecodeErrorZPtr;
3809 * A CResult_RouteDecodeErrorZ represents the result of a fallible operation,
3810 * containing a crate::lightning::routing::router::Route on success and a crate::lightning::ln::msgs::DecodeError on failure.
3811 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
3813 typedef struct LDKCResult_RouteDecodeErrorZ {
3815 * The contents of this CResult_RouteDecodeErrorZ, accessible via either
3816 * `err` or `result` depending on the state of `result_ok`.
3818 union LDKCResult_RouteDecodeErrorZPtr contents;
3820 * Whether this CResult_RouteDecodeErrorZ represents a success state.
3823 } LDKCResult_RouteDecodeErrorZ;
3828 * Parameters needed to find a [`Route`].
3830 * Passed to [`find_route`] and [`build_route_from_hops`].
3832 typedef struct MUST_USE_STRUCT LDKRouteParameters {
3834 * A pointer to the opaque Rust object.
3835 * Nearly everywhere, inner must be non-null, however in places where
3836 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3838 LDKnativeRouteParameters *inner;
3840 * Indicates that this is the only struct which contains the same pointer.
3841 * Rust functions which take ownership of an object provided via an argument require
3842 * this to be true and invalidate the object pointed to by inner.
3845 } LDKRouteParameters;
3848 * The contents of CResult_RouteParametersDecodeErrorZ
3850 typedef union LDKCResult_RouteParametersDecodeErrorZPtr {
3852 * A pointer to the contents in the success state.
3853 * Reading from this pointer when `result_ok` is not set is undefined.
3855 struct LDKRouteParameters *result;
3857 * A pointer to the contents in the error state.
3858 * Reading from this pointer when `result_ok` is set is undefined.
3860 struct LDKDecodeError *err;
3861 } LDKCResult_RouteParametersDecodeErrorZPtr;
3864 * A CResult_RouteParametersDecodeErrorZ represents the result of a fallible operation,
3865 * containing a crate::lightning::routing::router::RouteParameters on success and a crate::lightning::ln::msgs::DecodeError on failure.
3866 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
3868 typedef struct LDKCResult_RouteParametersDecodeErrorZ {
3870 * The contents of this CResult_RouteParametersDecodeErrorZ, accessible via either
3871 * `err` or `result` depending on the state of `result_ok`.
3873 union LDKCResult_RouteParametersDecodeErrorZPtr contents;
3875 * Whether this CResult_RouteParametersDecodeErrorZ represents a success state.
3878 } LDKCResult_RouteParametersDecodeErrorZ;
3881 * A dynamically-allocated array of u64s of arbitrary size.
3882 * This corresponds to std::vector in C++
3884 typedef struct LDKCVec_u64Z {
3886 * The elements in the array.
3887 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
3891 * The number of elements pointed to by `data`.
3899 * Information used to route a payment.
3901 typedef struct MUST_USE_STRUCT LDKPaymentParameters {
3903 * A pointer to the opaque Rust object.
3904 * Nearly everywhere, inner must be non-null, however in places where
3905 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3907 LDKnativePaymentParameters *inner;
3909 * Indicates that this is the only struct which contains the same pointer.
3910 * Rust functions which take ownership of an object provided via an argument require
3911 * this to be true and invalidate the object pointed to by inner.
3914 } LDKPaymentParameters;
3917 * The contents of CResult_PaymentParametersDecodeErrorZ
3919 typedef union LDKCResult_PaymentParametersDecodeErrorZPtr {
3921 * A pointer to the contents in the success state.
3922 * Reading from this pointer when `result_ok` is not set is undefined.
3924 struct LDKPaymentParameters *result;
3926 * A pointer to the contents in the error state.
3927 * Reading from this pointer when `result_ok` is set is undefined.
3929 struct LDKDecodeError *err;
3930 } LDKCResult_PaymentParametersDecodeErrorZPtr;
3933 * A CResult_PaymentParametersDecodeErrorZ represents the result of a fallible operation,
3934 * containing a crate::lightning::routing::router::PaymentParameters on success and a crate::lightning::ln::msgs::DecodeError on failure.
3935 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
3937 typedef struct LDKCResult_PaymentParametersDecodeErrorZ {
3939 * The contents of this CResult_PaymentParametersDecodeErrorZ, accessible via either
3940 * `err` or `result` depending on the state of `result_ok`.
3942 union LDKCResult_PaymentParametersDecodeErrorZPtr contents;
3944 * Whether this CResult_PaymentParametersDecodeErrorZ represents a success state.
3947 } LDKCResult_PaymentParametersDecodeErrorZ;
3950 * A tuple of 2 elements. See the individual fields for the types contained.
3952 typedef struct LDKC2Tuple_BlindedPayInfoBlindedPathZ {
3954 * The element at position 0
3956 struct LDKBlindedPayInfo a;
3958 * The element at position 1
3960 struct LDKBlindedPath b;
3961 } LDKC2Tuple_BlindedPayInfoBlindedPathZ;
3964 * A dynamically-allocated array of crate::c_types::derived::C2Tuple_BlindedPayInfoBlindedPathZs of arbitrary size.
3965 * This corresponds to std::vector in C++
3967 typedef struct LDKCVec_C2Tuple_BlindedPayInfoBlindedPathZZ {
3969 * The elements in the array.
3970 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
3972 struct LDKC2Tuple_BlindedPayInfoBlindedPathZ *data;
3974 * The number of elements pointed to by `data`.
3977 } LDKCVec_C2Tuple_BlindedPayInfoBlindedPathZZ;
3982 * A list of hops along a payment path terminating with a channel to the recipient.
3984 typedef struct MUST_USE_STRUCT LDKRouteHint {
3986 * A pointer to the opaque Rust object.
3987 * Nearly everywhere, inner must be non-null, however in places where
3988 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3990 LDKnativeRouteHint *inner;
3992 * Indicates that this is the only struct which contains the same pointer.
3993 * Rust functions which take ownership of an object provided via an argument require
3994 * this to be true and invalidate the object pointed to by inner.
4000 * A dynamically-allocated array of crate::lightning::routing::router::RouteHints of arbitrary size.
4001 * This corresponds to std::vector in C++
4003 typedef struct LDKCVec_RouteHintZ {
4005 * The elements in the array.
4006 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
4008 struct LDKRouteHint *data;
4010 * The number of elements pointed to by `data`.
4013 } LDKCVec_RouteHintZ;
4018 * A channel descriptor for a hop along a payment path.
4020 typedef struct MUST_USE_STRUCT LDKRouteHintHop {
4022 * A pointer to the opaque Rust object.
4023 * Nearly everywhere, inner must be non-null, however in places where
4024 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4026 LDKnativeRouteHintHop *inner;
4028 * Indicates that this is the only struct which contains the same pointer.
4029 * Rust functions which take ownership of an object provided via an argument require
4030 * this to be true and invalidate the object pointed to by inner.
4036 * A dynamically-allocated array of crate::lightning::routing::router::RouteHintHops of arbitrary size.
4037 * This corresponds to std::vector in C++
4039 typedef struct LDKCVec_RouteHintHopZ {
4041 * The elements in the array.
4042 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
4044 struct LDKRouteHintHop *data;
4046 * The number of elements pointed to by `data`.
4049 } LDKCVec_RouteHintHopZ;
4052 * The contents of CResult_RouteHintDecodeErrorZ
4054 typedef union LDKCResult_RouteHintDecodeErrorZPtr {
4056 * A pointer to the contents in the success state.
4057 * Reading from this pointer when `result_ok` is not set is undefined.
4059 struct LDKRouteHint *result;
4061 * A pointer to the contents in the error state.
4062 * Reading from this pointer when `result_ok` is set is undefined.
4064 struct LDKDecodeError *err;
4065 } LDKCResult_RouteHintDecodeErrorZPtr;
4068 * A CResult_RouteHintDecodeErrorZ represents the result of a fallible operation,
4069 * containing a crate::lightning::routing::router::RouteHint on success and a crate::lightning::ln::msgs::DecodeError on failure.
4070 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4072 typedef struct LDKCResult_RouteHintDecodeErrorZ {
4074 * The contents of this CResult_RouteHintDecodeErrorZ, accessible via either
4075 * `err` or `result` depending on the state of `result_ok`.
4077 union LDKCResult_RouteHintDecodeErrorZPtr contents;
4079 * Whether this CResult_RouteHintDecodeErrorZ represents a success state.
4082 } LDKCResult_RouteHintDecodeErrorZ;
4085 * The contents of CResult_RouteHintHopDecodeErrorZ
4087 typedef union LDKCResult_RouteHintHopDecodeErrorZPtr {
4089 * A pointer to the contents in the success state.
4090 * Reading from this pointer when `result_ok` is not set is undefined.
4092 struct LDKRouteHintHop *result;
4094 * A pointer to the contents in the error state.
4095 * Reading from this pointer when `result_ok` is set is undefined.
4097 struct LDKDecodeError *err;
4098 } LDKCResult_RouteHintHopDecodeErrorZPtr;
4101 * A CResult_RouteHintHopDecodeErrorZ represents the result of a fallible operation,
4102 * containing a crate::lightning::routing::router::RouteHintHop on success and a crate::lightning::ln::msgs::DecodeError on failure.
4103 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4105 typedef struct LDKCResult_RouteHintHopDecodeErrorZ {
4107 * The contents of this CResult_RouteHintHopDecodeErrorZ, accessible via either
4108 * `err` or `result` depending on the state of `result_ok`.
4110 union LDKCResult_RouteHintHopDecodeErrorZPtr contents;
4112 * Whether this CResult_RouteHintHopDecodeErrorZ represents a success state.
4115 } LDKCResult_RouteHintHopDecodeErrorZ;
4118 * A dynamically-allocated array of crate::c_types::PublicKeys of arbitrary size.
4119 * This corresponds to std::vector in C++
4121 typedef struct LDKCVec_PublicKeyZ {
4123 * The elements in the array.
4124 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
4126 struct LDKPublicKey *data;
4128 * The number of elements pointed to by `data`.
4131 } LDKCVec_PublicKeyZ;
4136 * [`ScoreLookUp`] implementation that uses a fixed penalty.
4138 typedef struct MUST_USE_STRUCT LDKFixedPenaltyScorer {
4140 * A pointer to the opaque Rust object.
4141 * Nearly everywhere, inner must be non-null, however in places where
4142 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4144 LDKnativeFixedPenaltyScorer *inner;
4146 * Indicates that this is the only struct which contains the same pointer.
4147 * Rust functions which take ownership of an object provided via an argument require
4148 * this to be true and invalidate the object pointed to by inner.
4151 } LDKFixedPenaltyScorer;
4154 * The contents of CResult_FixedPenaltyScorerDecodeErrorZ
4156 typedef union LDKCResult_FixedPenaltyScorerDecodeErrorZPtr {
4158 * A pointer to the contents in the success state.
4159 * Reading from this pointer when `result_ok` is not set is undefined.
4161 struct LDKFixedPenaltyScorer *result;
4163 * A pointer to the contents in the error state.
4164 * Reading from this pointer when `result_ok` is set is undefined.
4166 struct LDKDecodeError *err;
4167 } LDKCResult_FixedPenaltyScorerDecodeErrorZPtr;
4170 * A CResult_FixedPenaltyScorerDecodeErrorZ represents the result of a fallible operation,
4171 * containing a crate::lightning::routing::scoring::FixedPenaltyScorer on success and a crate::lightning::ln::msgs::DecodeError on failure.
4172 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4174 typedef struct LDKCResult_FixedPenaltyScorerDecodeErrorZ {
4176 * The contents of this CResult_FixedPenaltyScorerDecodeErrorZ, accessible via either
4177 * `err` or `result` depending on the state of `result_ok`.
4179 union LDKCResult_FixedPenaltyScorerDecodeErrorZPtr contents;
4181 * Whether this CResult_FixedPenaltyScorerDecodeErrorZ represents a success state.
4184 } LDKCResult_FixedPenaltyScorerDecodeErrorZ;
4187 * A dynamically-allocated array of crate::lightning::routing::gossip::NodeIds of arbitrary size.
4188 * This corresponds to std::vector in C++
4190 typedef struct LDKCVec_NodeIdZ {
4192 * The elements in the array.
4193 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
4195 struct LDKNodeId *data;
4197 * The number of elements pointed to by `data`.
4203 * A tuple of 2 elements. See the individual fields for the types contained.
4205 typedef struct LDKC2Tuple_u64u64Z {
4207 * The element at position 0
4211 * The element at position 1
4214 } LDKC2Tuple_u64u64Z;
4217 * An enum which can either contain a crate::c_types::derived::C2Tuple_u64u64Z or not
4219 typedef enum LDKCOption_C2Tuple_u64u64ZZ_Tag {
4221 * When we're in this state, this COption_C2Tuple_u64u64ZZ contains a crate::c_types::derived::C2Tuple_u64u64Z
4223 LDKCOption_C2Tuple_u64u64ZZ_Some,
4225 * When we're in this state, this COption_C2Tuple_u64u64ZZ contains nothing
4227 LDKCOption_C2Tuple_u64u64ZZ_None,
4229 * Must be last for serialization purposes
4231 LDKCOption_C2Tuple_u64u64ZZ_Sentinel,
4232 } LDKCOption_C2Tuple_u64u64ZZ_Tag;
4234 typedef struct LDKCOption_C2Tuple_u64u64ZZ {
4235 LDKCOption_C2Tuple_u64u64ZZ_Tag tag;
4238 struct LDKC2Tuple_u64u64Z some;
4241 } LDKCOption_C2Tuple_u64u64ZZ;
4246 typedef struct LDKThirtyTwoU16s {
4248 * The thirty-two 16-bit integers
4254 * A tuple of 2 elements. See the individual fields for the types contained.
4256 typedef struct LDKC2Tuple_Z {
4258 * The element at position 0
4260 struct LDKThirtyTwoU16s a;
4262 * The element at position 1
4264 struct LDKThirtyTwoU16s b;
4268 * A tuple of 2 elements. See the individual fields for the types contained.
4270 typedef struct LDKC2Tuple__u1632_u1632Z {
4272 * The element at position 0
4274 struct LDKThirtyTwoU16s a;
4276 * The element at position 1
4278 struct LDKThirtyTwoU16s b;
4279 } LDKC2Tuple__u1632_u1632Z;
4282 * An enum which can either contain a crate::c_types::derived::C2Tuple__u1632_u1632Z or not
4284 typedef enum LDKCOption_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ_Tag {
4286 * When we're in this state, this COption_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ contains a crate::c_types::derived::C2Tuple__u1632_u1632Z
4288 LDKCOption_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ_Some,
4290 * When we're in this state, this COption_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ contains nothing
4292 LDKCOption_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ_None,
4294 * Must be last for serialization purposes
4296 LDKCOption_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ_Sentinel,
4297 } LDKCOption_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ_Tag;
4299 typedef struct LDKCOption_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ {
4300 LDKCOption_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ_Tag tag;
4303 struct LDKC2Tuple__u1632_u1632Z some;
4306 } LDKCOption_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ;
4309 * An enum which can either contain a f64 or not
4311 typedef enum LDKCOption_f64Z_Tag {
4313 * When we're in this state, this COption_f64Z contains a f64
4315 LDKCOption_f64Z_Some,
4317 * When we're in this state, this COption_f64Z contains nothing
4319 LDKCOption_f64Z_None,
4321 * Must be last for serialization purposes
4323 LDKCOption_f64Z_Sentinel,
4324 } LDKCOption_f64Z_Tag;
4326 typedef struct LDKCOption_f64Z {
4327 LDKCOption_f64Z_Tag tag;
4338 * A Record, unit of logging output with Metadata to enable filtering
4339 * Module_path, file, line to inform on log's source
4341 typedef struct MUST_USE_STRUCT LDKRecord {
4343 * A pointer to the opaque Rust object.
4344 * Nearly everywhere, inner must be non-null, however in places where
4345 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4347 LDKnativeRecord *inner;
4349 * Indicates that this is the only struct which contains the same pointer.
4350 * Rust functions which take ownership of an object provided via an argument require
4351 * this to be true and invalidate the object pointed to by inner.
4357 * A trait encapsulating the operations required of a logger
4359 typedef struct LDKLogger {
4361 * An opaque pointer which is passed to your function implementations as an argument.
4362 * This has no meaning in the LDK, and can be NULL or any other value.
4368 void (*log)(const void *this_arg, const struct LDKRecord *NONNULL_PTR record);
4370 * Frees any resources associated with this object given its this_arg pointer.
4371 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
4373 void (*free)(void *this_arg);
4379 * Represents the network as nodes and channels between them
4381 typedef struct MUST_USE_STRUCT LDKNetworkGraph {
4383 * A pointer to the opaque Rust object.
4384 * Nearly everywhere, inner must be non-null, however in places where
4385 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4387 LDKnativeNetworkGraph *inner;
4389 * Indicates that this is the only struct which contains the same pointer.
4390 * Rust functions which take ownership of an object provided via an argument require
4391 * this to be true and invalidate the object pointed to by inner.
4399 * [`ScoreLookUp`] implementation using channel success probability distributions.
4401 * Channels are tracked with upper and lower liquidity bounds - when an HTLC fails at a channel,
4402 * we learn that the upper-bound on the available liquidity is lower than the amount of the HTLC.
4403 * When a payment is forwarded through a channel (but fails later in the route), we learn the
4404 * lower-bound on the channel's available liquidity must be at least the value of the HTLC.
4406 * These bounds are then used to determine a success probability using the formula from
4407 * *Optimally Reliable & Cheap Payment Flows on the Lightning Network* by Rene Pickhardt
4408 * and Stefan Richter [[1]] (i.e. `(upper_bound - payment_amount) / (upper_bound - lower_bound)`).
4410 * This probability is combined with the [`liquidity_penalty_multiplier_msat`] and
4411 * [`liquidity_penalty_amount_multiplier_msat`] parameters to calculate a concrete penalty in
4412 * milli-satoshis. The penalties, when added across all hops, have the property of being linear in
4413 * terms of the entire path's success probability. This allows the router to directly compare
4414 * penalties for different paths. See the documentation of those parameters for the exact formulas.
4416 * The liquidity bounds are decayed by halving them every [`liquidity_offset_half_life`].
4418 * Further, we track the history of our upper and lower liquidity bounds for each channel,
4419 * allowing us to assign a second penalty (using [`historical_liquidity_penalty_multiplier_msat`]
4420 * and [`historical_liquidity_penalty_amount_multiplier_msat`]) based on the same probability
4421 * formula, but using the history of a channel rather than our latest estimates for the liquidity
4426 * Mixing the `no-std` feature between serialization and deserialization results in undefined
4429 * [1]: https://arxiv.org/abs/2107.05322
4430 * [`liquidity_penalty_multiplier_msat`]: ProbabilisticScoringFeeParameters::liquidity_penalty_multiplier_msat
4431 * [`liquidity_penalty_amount_multiplier_msat`]: ProbabilisticScoringFeeParameters::liquidity_penalty_amount_multiplier_msat
4432 * [`liquidity_offset_half_life`]: ProbabilisticScoringDecayParameters::liquidity_offset_half_life
4433 * [`historical_liquidity_penalty_multiplier_msat`]: ProbabilisticScoringFeeParameters::historical_liquidity_penalty_multiplier_msat
4434 * [`historical_liquidity_penalty_amount_multiplier_msat`]: ProbabilisticScoringFeeParameters::historical_liquidity_penalty_amount_multiplier_msat
4436 typedef struct MUST_USE_STRUCT LDKProbabilisticScorer {
4438 * A pointer to the opaque Rust object.
4439 * Nearly everywhere, inner must be non-null, however in places where
4440 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4442 LDKnativeProbabilisticScorer *inner;
4444 * Indicates that this is the only struct which contains the same pointer.
4445 * Rust functions which take ownership of an object provided via an argument require
4446 * this to be true and invalidate the object pointed to by inner.
4449 } LDKProbabilisticScorer;
4452 * The contents of CResult_ProbabilisticScorerDecodeErrorZ
4454 typedef union LDKCResult_ProbabilisticScorerDecodeErrorZPtr {
4456 * A pointer to the contents in the success state.
4457 * Reading from this pointer when `result_ok` is not set is undefined.
4459 struct LDKProbabilisticScorer *result;
4461 * A pointer to the contents in the error state.
4462 * Reading from this pointer when `result_ok` is set is undefined.
4464 struct LDKDecodeError *err;
4465 } LDKCResult_ProbabilisticScorerDecodeErrorZPtr;
4468 * A CResult_ProbabilisticScorerDecodeErrorZ represents the result of a fallible operation,
4469 * containing a crate::lightning::routing::scoring::ProbabilisticScorer on success and a crate::lightning::ln::msgs::DecodeError on failure.
4470 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4472 typedef struct LDKCResult_ProbabilisticScorerDecodeErrorZ {
4474 * The contents of this CResult_ProbabilisticScorerDecodeErrorZ, accessible via either
4475 * `err` or `result` depending on the state of `result_ok`.
4477 union LDKCResult_ProbabilisticScorerDecodeErrorZPtr contents;
4479 * Whether this CResult_ProbabilisticScorerDecodeErrorZ represents a success state.
4482 } LDKCResult_ProbabilisticScorerDecodeErrorZ;
4485 * A tuple of 2 elements. See the individual fields for the types contained.
4487 typedef struct LDKC2Tuple_usizeTransactionZ {
4489 * The element at position 0
4493 * The element at position 1
4495 struct LDKTransaction b;
4496 } LDKC2Tuple_usizeTransactionZ;
4499 * A dynamically-allocated array of crate::c_types::derived::C2Tuple_usizeTransactionZs of arbitrary size.
4500 * This corresponds to std::vector in C++
4502 typedef struct LDKCVec_C2Tuple_usizeTransactionZZ {
4504 * The elements in the array.
4505 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
4507 struct LDKC2Tuple_usizeTransactionZ *data;
4509 * The number of elements pointed to by `data`.
4512 } LDKCVec_C2Tuple_usizeTransactionZZ;
4515 * A tuple of 2 elements. See the individual fields for the types contained.
4517 typedef struct LDKC2Tuple_ThirtyTwoBytesCOption_ThirtyTwoBytesZZ {
4519 * The element at position 0
4521 struct LDKThirtyTwoBytes a;
4523 * The element at position 1
4525 struct LDKCOption_ThirtyTwoBytesZ b;
4526 } LDKC2Tuple_ThirtyTwoBytesCOption_ThirtyTwoBytesZZ;
4529 * A dynamically-allocated array of crate::c_types::derived::C2Tuple_ThirtyTwoBytesCOption_ThirtyTwoBytesZZs of arbitrary size.
4530 * This corresponds to std::vector in C++
4532 typedef struct LDKCVec_C2Tuple_ThirtyTwoBytesCOption_ThirtyTwoBytesZZZ {
4534 * The elements in the array.
4535 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
4537 struct LDKC2Tuple_ThirtyTwoBytesCOption_ThirtyTwoBytesZZ *data;
4539 * The number of elements pointed to by `data`.
4542 } LDKCVec_C2Tuple_ThirtyTwoBytesCOption_ThirtyTwoBytesZZZ;
4545 * The contents of CResult_ChannelMonitorUpdateStatusNoneZ
4547 typedef union LDKCResult_ChannelMonitorUpdateStatusNoneZPtr {
4549 * A pointer to the contents in the success state.
4550 * Reading from this pointer when `result_ok` is not set is undefined.
4552 enum LDKChannelMonitorUpdateStatus *result;
4554 * Note that this value is always NULL, as there are no contents in the Err variant
4557 } LDKCResult_ChannelMonitorUpdateStatusNoneZPtr;
4560 * A CResult_ChannelMonitorUpdateStatusNoneZ represents the result of a fallible operation,
4561 * containing a crate::lightning::chain::ChannelMonitorUpdateStatus on success and a () on failure.
4562 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4564 typedef struct LDKCResult_ChannelMonitorUpdateStatusNoneZ {
4566 * The contents of this CResult_ChannelMonitorUpdateStatusNoneZ, accessible via either
4567 * `err` or `result` depending on the state of `result_ok`.
4569 union LDKCResult_ChannelMonitorUpdateStatusNoneZPtr contents;
4571 * Whether this CResult_ChannelMonitorUpdateStatusNoneZ represents a success state.
4574 } LDKCResult_ChannelMonitorUpdateStatusNoneZ;
4579 * Simple structure sent back by `chain::Watch` when an HTLC from a forward channel is detected on
4580 * chain. Used to update the corresponding HTLC in the backward channel. Failing to pass the
4581 * preimage claim backward will lead to loss of funds.
4583 typedef struct MUST_USE_STRUCT LDKHTLCUpdate {
4585 * A pointer to the opaque Rust object.
4586 * Nearly everywhere, inner must be non-null, however in places where
4587 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4589 LDKnativeHTLCUpdate *inner;
4591 * Indicates that this is the only struct which contains the same pointer.
4592 * Rust functions which take ownership of an object provided via an argument require
4593 * this to be true and invalidate the object pointed to by inner.
4599 * An event to be processed by the ChannelManager.
4601 typedef enum LDKMonitorEvent_Tag {
4603 * A monitor event containing an HTLCUpdate.
4605 LDKMonitorEvent_HTLCEvent,
4607 * A monitor event that the Channel's commitment transaction was confirmed.
4609 LDKMonitorEvent_HolderForceClosed,
4611 * Indicates a [`ChannelMonitor`] update has completed. See
4612 * [`ChannelMonitorUpdateStatus::InProgress`] for more information on how this is used.
4614 * [`ChannelMonitorUpdateStatus::InProgress`]: super::ChannelMonitorUpdateStatus::InProgress
4616 LDKMonitorEvent_Completed,
4618 * Must be last for serialization purposes
4620 LDKMonitorEvent_Sentinel,
4621 } LDKMonitorEvent_Tag;
4623 typedef struct LDKMonitorEvent_LDKCompleted_Body {
4625 * The funding outpoint of the [`ChannelMonitor`] that was updated
4627 struct LDKOutPoint funding_txo;
4629 * The Update ID from [`ChannelMonitorUpdate::update_id`] which was applied or
4630 * [`ChannelMonitor::get_latest_update_id`].
4632 * Note that this should only be set to a given update's ID if all previous updates for the
4633 * same [`ChannelMonitor`] have been applied and persisted.
4635 uint64_t monitor_update_id;
4636 } LDKMonitorEvent_LDKCompleted_Body;
4638 typedef struct MUST_USE_STRUCT LDKMonitorEvent {
4639 LDKMonitorEvent_Tag tag;
4642 struct LDKHTLCUpdate htlc_event;
4645 struct LDKOutPoint holder_force_closed;
4647 LDKMonitorEvent_LDKCompleted_Body completed;
4652 * A dynamically-allocated array of crate::lightning::chain::channelmonitor::MonitorEvents of arbitrary size.
4653 * This corresponds to std::vector in C++
4655 typedef struct LDKCVec_MonitorEventZ {
4657 * The elements in the array.
4658 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
4660 struct LDKMonitorEvent *data;
4662 * The number of elements pointed to by `data`.
4665 } LDKCVec_MonitorEventZ;
4668 * A tuple of 3 elements. See the individual fields for the types contained.
4670 typedef struct LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ {
4672 * The element at position 0
4674 struct LDKOutPoint a;
4676 * The element at position 1
4678 struct LDKCVec_MonitorEventZ b;
4680 * The element at position 2
4682 struct LDKPublicKey c;
4683 } LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ;
4686 * A dynamically-allocated array of crate::c_types::derived::C3Tuple_OutPointCVec_MonitorEventZPublicKeyZs of arbitrary size.
4687 * This corresponds to std::vector in C++
4689 typedef struct LDKCVec_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZZ {
4691 * The elements in the array.
4692 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
4694 struct LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ *data;
4696 * The number of elements pointed to by `data`.
4699 } LDKCVec_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZZ;
4704 * Features used within an `init` message.
4706 typedef struct MUST_USE_STRUCT LDKInitFeatures {
4708 * A pointer to the opaque Rust object.
4709 * Nearly everywhere, inner must be non-null, however in places where
4710 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4712 LDKnativeInitFeatures *inner;
4714 * Indicates that this is the only struct which contains the same pointer.
4715 * Rust functions which take ownership of an object provided via an argument require
4716 * this to be true and invalidate the object pointed to by inner.
4722 * The contents of CResult_InitFeaturesDecodeErrorZ
4724 typedef union LDKCResult_InitFeaturesDecodeErrorZPtr {
4726 * A pointer to the contents in the success state.
4727 * Reading from this pointer when `result_ok` is not set is undefined.
4729 struct LDKInitFeatures *result;
4731 * A pointer to the contents in the error state.
4732 * Reading from this pointer when `result_ok` is set is undefined.
4734 struct LDKDecodeError *err;
4735 } LDKCResult_InitFeaturesDecodeErrorZPtr;
4738 * A CResult_InitFeaturesDecodeErrorZ represents the result of a fallible operation,
4739 * containing a crate::lightning::ln::features::InitFeatures on success and a crate::lightning::ln::msgs::DecodeError on failure.
4740 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4742 typedef struct LDKCResult_InitFeaturesDecodeErrorZ {
4744 * The contents of this CResult_InitFeaturesDecodeErrorZ, accessible via either
4745 * `err` or `result` depending on the state of `result_ok`.
4747 union LDKCResult_InitFeaturesDecodeErrorZPtr contents;
4749 * Whether this CResult_InitFeaturesDecodeErrorZ represents a success state.
4752 } LDKCResult_InitFeaturesDecodeErrorZ;
4757 * Features used within a `channel_announcement` message.
4759 typedef struct MUST_USE_STRUCT LDKChannelFeatures {
4761 * A pointer to the opaque Rust object.
4762 * Nearly everywhere, inner must be non-null, however in places where
4763 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4765 LDKnativeChannelFeatures *inner;
4767 * Indicates that this is the only struct which contains the same pointer.
4768 * Rust functions which take ownership of an object provided via an argument require
4769 * this to be true and invalidate the object pointed to by inner.
4772 } LDKChannelFeatures;
4775 * The contents of CResult_ChannelFeaturesDecodeErrorZ
4777 typedef union LDKCResult_ChannelFeaturesDecodeErrorZPtr {
4779 * A pointer to the contents in the success state.
4780 * Reading from this pointer when `result_ok` is not set is undefined.
4782 struct LDKChannelFeatures *result;
4784 * A pointer to the contents in the error state.
4785 * Reading from this pointer when `result_ok` is set is undefined.
4787 struct LDKDecodeError *err;
4788 } LDKCResult_ChannelFeaturesDecodeErrorZPtr;
4791 * A CResult_ChannelFeaturesDecodeErrorZ represents the result of a fallible operation,
4792 * containing a crate::lightning::ln::features::ChannelFeatures on success and a crate::lightning::ln::msgs::DecodeError on failure.
4793 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4795 typedef struct LDKCResult_ChannelFeaturesDecodeErrorZ {
4797 * The contents of this CResult_ChannelFeaturesDecodeErrorZ, accessible via either
4798 * `err` or `result` depending on the state of `result_ok`.
4800 union LDKCResult_ChannelFeaturesDecodeErrorZPtr contents;
4802 * Whether this CResult_ChannelFeaturesDecodeErrorZ represents a success state.
4805 } LDKCResult_ChannelFeaturesDecodeErrorZ;
4810 * Features used within a `node_announcement` message.
4812 typedef struct MUST_USE_STRUCT LDKNodeFeatures {
4814 * A pointer to the opaque Rust object.
4815 * Nearly everywhere, inner must be non-null, however in places where
4816 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4818 LDKnativeNodeFeatures *inner;
4820 * Indicates that this is the only struct which contains the same pointer.
4821 * Rust functions which take ownership of an object provided via an argument require
4822 * this to be true and invalidate the object pointed to by inner.
4828 * The contents of CResult_NodeFeaturesDecodeErrorZ
4830 typedef union LDKCResult_NodeFeaturesDecodeErrorZPtr {
4832 * A pointer to the contents in the success state.
4833 * Reading from this pointer when `result_ok` is not set is undefined.
4835 struct LDKNodeFeatures *result;
4837 * A pointer to the contents in the error state.
4838 * Reading from this pointer when `result_ok` is set is undefined.
4840 struct LDKDecodeError *err;
4841 } LDKCResult_NodeFeaturesDecodeErrorZPtr;
4844 * A CResult_NodeFeaturesDecodeErrorZ represents the result of a fallible operation,
4845 * containing a crate::lightning::ln::features::NodeFeatures on success and a crate::lightning::ln::msgs::DecodeError on failure.
4846 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4848 typedef struct LDKCResult_NodeFeaturesDecodeErrorZ {
4850 * The contents of this CResult_NodeFeaturesDecodeErrorZ, accessible via either
4851 * `err` or `result` depending on the state of `result_ok`.
4853 union LDKCResult_NodeFeaturesDecodeErrorZPtr contents;
4855 * Whether this CResult_NodeFeaturesDecodeErrorZ represents a success state.
4858 } LDKCResult_NodeFeaturesDecodeErrorZ;
4863 * Features used within an invoice.
4865 typedef struct MUST_USE_STRUCT LDKBolt11InvoiceFeatures {
4867 * A pointer to the opaque Rust object.
4868 * Nearly everywhere, inner must be non-null, however in places where
4869 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4871 LDKnativeBolt11InvoiceFeatures *inner;
4873 * Indicates that this is the only struct which contains the same pointer.
4874 * Rust functions which take ownership of an object provided via an argument require
4875 * this to be true and invalidate the object pointed to by inner.
4878 } LDKBolt11InvoiceFeatures;
4881 * The contents of CResult_Bolt11InvoiceFeaturesDecodeErrorZ
4883 typedef union LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZPtr {
4885 * A pointer to the contents in the success state.
4886 * Reading from this pointer when `result_ok` is not set is undefined.
4888 struct LDKBolt11InvoiceFeatures *result;
4890 * A pointer to the contents in the error state.
4891 * Reading from this pointer when `result_ok` is set is undefined.
4893 struct LDKDecodeError *err;
4894 } LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZPtr;
4897 * A CResult_Bolt11InvoiceFeaturesDecodeErrorZ represents the result of a fallible operation,
4898 * containing a crate::lightning::ln::features::Bolt11InvoiceFeatures on success and a crate::lightning::ln::msgs::DecodeError on failure.
4899 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4901 typedef struct LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZ {
4903 * The contents of this CResult_Bolt11InvoiceFeaturesDecodeErrorZ, accessible via either
4904 * `err` or `result` depending on the state of `result_ok`.
4906 union LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZPtr contents;
4908 * Whether this CResult_Bolt11InvoiceFeaturesDecodeErrorZ represents a success state.
4911 } LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZ;
4916 * Features used within an `invoice`.
4918 typedef struct MUST_USE_STRUCT LDKBolt12InvoiceFeatures {
4920 * A pointer to the opaque Rust object.
4921 * Nearly everywhere, inner must be non-null, however in places where
4922 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4924 LDKnativeBolt12InvoiceFeatures *inner;
4926 * Indicates that this is the only struct which contains the same pointer.
4927 * Rust functions which take ownership of an object provided via an argument require
4928 * this to be true and invalidate the object pointed to by inner.
4931 } LDKBolt12InvoiceFeatures;
4934 * The contents of CResult_Bolt12InvoiceFeaturesDecodeErrorZ
4936 typedef union LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZPtr {
4938 * A pointer to the contents in the success state.
4939 * Reading from this pointer when `result_ok` is not set is undefined.
4941 struct LDKBolt12InvoiceFeatures *result;
4943 * A pointer to the contents in the error state.
4944 * Reading from this pointer when `result_ok` is set is undefined.
4946 struct LDKDecodeError *err;
4947 } LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZPtr;
4950 * A CResult_Bolt12InvoiceFeaturesDecodeErrorZ represents the result of a fallible operation,
4951 * containing a crate::lightning::ln::features::Bolt12InvoiceFeatures on success and a crate::lightning::ln::msgs::DecodeError on failure.
4952 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4954 typedef struct LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZ {
4956 * The contents of this CResult_Bolt12InvoiceFeaturesDecodeErrorZ, accessible via either
4957 * `err` or `result` depending on the state of `result_ok`.
4959 union LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZPtr contents;
4961 * Whether this CResult_Bolt12InvoiceFeaturesDecodeErrorZ represents a success state.
4964 } LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZ;
4969 * Features used within BOLT 4 encrypted_data_tlv and BOLT 12 blinded_payinfo
4971 typedef struct MUST_USE_STRUCT LDKBlindedHopFeatures {
4973 * A pointer to the opaque Rust object.
4974 * Nearly everywhere, inner must be non-null, however in places where
4975 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4977 LDKnativeBlindedHopFeatures *inner;
4979 * Indicates that this is the only struct which contains the same pointer.
4980 * Rust functions which take ownership of an object provided via an argument require
4981 * this to be true and invalidate the object pointed to by inner.
4984 } LDKBlindedHopFeatures;
4987 * The contents of CResult_BlindedHopFeaturesDecodeErrorZ
4989 typedef union LDKCResult_BlindedHopFeaturesDecodeErrorZPtr {
4991 * A pointer to the contents in the success state.
4992 * Reading from this pointer when `result_ok` is not set is undefined.
4994 struct LDKBlindedHopFeatures *result;
4996 * A pointer to the contents in the error state.
4997 * Reading from this pointer when `result_ok` is set is undefined.
4999 struct LDKDecodeError *err;
5000 } LDKCResult_BlindedHopFeaturesDecodeErrorZPtr;
5003 * A CResult_BlindedHopFeaturesDecodeErrorZ represents the result of a fallible operation,
5004 * containing a crate::lightning::ln::features::BlindedHopFeatures on success and a crate::lightning::ln::msgs::DecodeError on failure.
5005 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5007 typedef struct LDKCResult_BlindedHopFeaturesDecodeErrorZ {
5009 * The contents of this CResult_BlindedHopFeaturesDecodeErrorZ, accessible via either
5010 * `err` or `result` depending on the state of `result_ok`.
5012 union LDKCResult_BlindedHopFeaturesDecodeErrorZPtr contents;
5014 * Whether this CResult_BlindedHopFeaturesDecodeErrorZ represents a success state.
5017 } LDKCResult_BlindedHopFeaturesDecodeErrorZ;
5022 * Features used within the channel_type field in an OpenChannel message.
5024 * A channel is always of some known \"type\", describing the transaction formats used and the exact
5025 * semantics of our interaction with our peer.
5027 * Note that because a channel is a specific type which is proposed by the opener and accepted by
5028 * the counterparty, only required features are allowed here.
5030 * This is serialized differently from other feature types - it is not prefixed by a length, and
5031 * thus must only appear inside a TLV where its length is known in advance.
5033 typedef struct MUST_USE_STRUCT LDKChannelTypeFeatures {
5035 * A pointer to the opaque Rust object.
5036 * Nearly everywhere, inner must be non-null, however in places where
5037 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5039 LDKnativeChannelTypeFeatures *inner;
5041 * Indicates that this is the only struct which contains the same pointer.
5042 * Rust functions which take ownership of an object provided via an argument require
5043 * this to be true and invalidate the object pointed to by inner.
5046 } LDKChannelTypeFeatures;
5049 * The contents of CResult_ChannelTypeFeaturesDecodeErrorZ
5051 typedef union LDKCResult_ChannelTypeFeaturesDecodeErrorZPtr {
5053 * A pointer to the contents in the success state.
5054 * Reading from this pointer when `result_ok` is not set is undefined.
5056 struct LDKChannelTypeFeatures *result;
5058 * A pointer to the contents in the error state.
5059 * Reading from this pointer when `result_ok` is set is undefined.
5061 struct LDKDecodeError *err;
5062 } LDKCResult_ChannelTypeFeaturesDecodeErrorZPtr;
5065 * A CResult_ChannelTypeFeaturesDecodeErrorZ represents the result of a fallible operation,
5066 * containing a crate::lightning::ln::features::ChannelTypeFeatures on success and a crate::lightning::ln::msgs::DecodeError on failure.
5067 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5069 typedef struct LDKCResult_ChannelTypeFeaturesDecodeErrorZ {
5071 * The contents of this CResult_ChannelTypeFeaturesDecodeErrorZ, accessible via either
5072 * `err` or `result` depending on the state of `result_ok`.
5074 union LDKCResult_ChannelTypeFeaturesDecodeErrorZPtr contents;
5076 * Whether this CResult_ChannelTypeFeaturesDecodeErrorZ represents a success state.
5079 } LDKCResult_ChannelTypeFeaturesDecodeErrorZ;
5084 * An `Offer` is a potentially long-lived proposal for payment of a good or service.
5086 * An offer is a precursor to an [`InvoiceRequest`]. A merchant publishes an offer from which a
5087 * customer may request an [`Bolt12Invoice`] for a specific quantity and using an amount sufficient
5088 * to cover that quantity (i.e., at least `quantity * amount`). See [`Offer::amount`].
5090 * Offers may be denominated in currency other than bitcoin but are ultimately paid using the
5093 * Through the use of [`BlindedPath`]s, offers provide recipient privacy.
5095 * [`InvoiceRequest`]: crate::offers::invoice_request::InvoiceRequest
5096 * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice
5098 typedef struct MUST_USE_STRUCT LDKOffer {
5100 * A pointer to the opaque Rust object.
5101 * Nearly everywhere, inner must be non-null, however in places where
5102 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5104 LDKnativeOffer *inner;
5106 * Indicates that this is the only struct which contains the same pointer.
5107 * Rust functions which take ownership of an object provided via an argument require
5108 * this to be true and invalidate the object pointed to by inner.
5114 * The contents of CResult_OfferBolt12ParseErrorZ
5116 typedef union LDKCResult_OfferBolt12ParseErrorZPtr {
5118 * A pointer to the contents in the success state.
5119 * Reading from this pointer when `result_ok` is not set is undefined.
5121 struct LDKOffer *result;
5123 * A pointer to the contents in the error state.
5124 * Reading from this pointer when `result_ok` is set is undefined.
5126 struct LDKBolt12ParseError *err;
5127 } LDKCResult_OfferBolt12ParseErrorZPtr;
5130 * A CResult_OfferBolt12ParseErrorZ represents the result of a fallible operation,
5131 * containing a crate::lightning::offers::offer::Offer on success and a crate::lightning::offers::parse::Bolt12ParseError on failure.
5132 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5134 typedef struct LDKCResult_OfferBolt12ParseErrorZ {
5136 * The contents of this CResult_OfferBolt12ParseErrorZ, accessible via either
5137 * `err` or `result` depending on the state of `result_ok`.
5139 union LDKCResult_OfferBolt12ParseErrorZPtr contents;
5141 * Whether this CResult_OfferBolt12ParseErrorZ represents a success state.
5144 } LDKCResult_OfferBolt12ParseErrorZ;
5147 * The contents of CResult_PublicKeySecp256k1ErrorZ
5149 typedef union LDKCResult_PublicKeySecp256k1ErrorZPtr {
5151 * A pointer to the contents in the success state.
5152 * Reading from this pointer when `result_ok` is not set is undefined.
5154 struct LDKPublicKey *result;
5156 * A pointer to the contents in the error state.
5157 * Reading from this pointer when `result_ok` is set is undefined.
5159 enum LDKSecp256k1Error *err;
5160 } LDKCResult_PublicKeySecp256k1ErrorZPtr;
5163 * A CResult_PublicKeySecp256k1ErrorZ represents the result of a fallible operation,
5164 * containing a crate::c_types::PublicKey on success and a crate::c_types::Secp256k1Error on failure.
5165 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5167 typedef struct LDKCResult_PublicKeySecp256k1ErrorZ {
5169 * The contents of this CResult_PublicKeySecp256k1ErrorZ, accessible via either
5170 * `err` or `result` depending on the state of `result_ok`.
5172 union LDKCResult_PublicKeySecp256k1ErrorZPtr contents;
5174 * Whether this CResult_PublicKeySecp256k1ErrorZ represents a success state.
5177 } LDKCResult_PublicKeySecp256k1ErrorZ;
5180 * The contents of CResult_NodeIdDecodeErrorZ
5182 typedef union LDKCResult_NodeIdDecodeErrorZPtr {
5184 * A pointer to the contents in the success state.
5185 * Reading from this pointer when `result_ok` is not set is undefined.
5187 struct LDKNodeId *result;
5189 * A pointer to the contents in the error state.
5190 * Reading from this pointer when `result_ok` is set is undefined.
5192 struct LDKDecodeError *err;
5193 } LDKCResult_NodeIdDecodeErrorZPtr;
5196 * A CResult_NodeIdDecodeErrorZ represents the result of a fallible operation,
5197 * containing a crate::lightning::routing::gossip::NodeId on success and a crate::lightning::ln::msgs::DecodeError on failure.
5198 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5200 typedef struct LDKCResult_NodeIdDecodeErrorZ {
5202 * The contents of this CResult_NodeIdDecodeErrorZ, accessible via either
5203 * `err` or `result` depending on the state of `result_ok`.
5205 union LDKCResult_NodeIdDecodeErrorZPtr contents;
5207 * Whether this CResult_NodeIdDecodeErrorZ represents a success state.
5210 } LDKCResult_NodeIdDecodeErrorZ;
5215 * A [`channel_update`] message to be sent to or received from a peer.
5217 * [`channel_update`]: https://github.com/lightning/bolts/blob/master/07-routing-gossip.md#the-channel_update-message
5219 typedef struct MUST_USE_STRUCT LDKChannelUpdate {
5221 * A pointer to the opaque Rust object.
5222 * Nearly everywhere, inner must be non-null, however in places where
5223 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5225 LDKnativeChannelUpdate *inner;
5227 * Indicates that this is the only struct which contains the same pointer.
5228 * Rust functions which take ownership of an object provided via an argument require
5229 * this to be true and invalidate the object pointed to by inner.
5235 * Update to the [`NetworkGraph`] based on payment failure information conveyed via the Onion
5236 * return packet by a node along the route. See [BOLT #4] for details.
5238 * [BOLT #4]: https://github.com/lightning/bolts/blob/master/04-onion-routing.md
5240 typedef enum LDKNetworkUpdate_Tag {
5242 * An error indicating a `channel_update` messages should be applied via
5243 * [`NetworkGraph::update_channel`].
5245 LDKNetworkUpdate_ChannelUpdateMessage,
5247 * An error indicating that a channel failed to route a payment, which should be applied via
5248 * [`NetworkGraph::channel_failed_permanent`] if permanent.
5250 LDKNetworkUpdate_ChannelFailure,
5252 * An error indicating that a node failed to route a payment, which should be applied via
5253 * [`NetworkGraph::node_failed_permanent`] if permanent.
5255 LDKNetworkUpdate_NodeFailure,
5257 * Must be last for serialization purposes
5259 LDKNetworkUpdate_Sentinel,
5260 } LDKNetworkUpdate_Tag;
5262 typedef struct LDKNetworkUpdate_LDKChannelUpdateMessage_Body {
5264 * The update to apply via [`NetworkGraph::update_channel`].
5266 struct LDKChannelUpdate msg;
5267 } LDKNetworkUpdate_LDKChannelUpdateMessage_Body;
5269 typedef struct LDKNetworkUpdate_LDKChannelFailure_Body {
5271 * The short channel id of the closed channel.
5273 uint64_t short_channel_id;
5275 * Whether the channel should be permanently removed or temporarily disabled until a new
5276 * `channel_update` message is received.
5279 } LDKNetworkUpdate_LDKChannelFailure_Body;
5281 typedef struct LDKNetworkUpdate_LDKNodeFailure_Body {
5283 * The node id of the failed node.
5285 struct LDKPublicKey node_id;
5287 * Whether the node should be permanently removed from consideration or can be restored
5288 * when a new `channel_update` message is received.
5291 } LDKNetworkUpdate_LDKNodeFailure_Body;
5293 typedef struct MUST_USE_STRUCT LDKNetworkUpdate {
5294 LDKNetworkUpdate_Tag tag;
5296 LDKNetworkUpdate_LDKChannelUpdateMessage_Body channel_update_message;
5297 LDKNetworkUpdate_LDKChannelFailure_Body channel_failure;
5298 LDKNetworkUpdate_LDKNodeFailure_Body node_failure;
5303 * An enum which can either contain a crate::lightning::routing::gossip::NetworkUpdate or not
5305 typedef enum LDKCOption_NetworkUpdateZ_Tag {
5307 * When we're in this state, this COption_NetworkUpdateZ contains a crate::lightning::routing::gossip::NetworkUpdate
5309 LDKCOption_NetworkUpdateZ_Some,
5311 * When we're in this state, this COption_NetworkUpdateZ contains nothing
5313 LDKCOption_NetworkUpdateZ_None,
5315 * Must be last for serialization purposes
5317 LDKCOption_NetworkUpdateZ_Sentinel,
5318 } LDKCOption_NetworkUpdateZ_Tag;
5320 typedef struct LDKCOption_NetworkUpdateZ {
5321 LDKCOption_NetworkUpdateZ_Tag tag;
5324 struct LDKNetworkUpdate some;
5327 } LDKCOption_NetworkUpdateZ;
5330 * The contents of CResult_COption_NetworkUpdateZDecodeErrorZ
5332 typedef union LDKCResult_COption_NetworkUpdateZDecodeErrorZPtr {
5334 * A pointer to the contents in the success state.
5335 * Reading from this pointer when `result_ok` is not set is undefined.
5337 struct LDKCOption_NetworkUpdateZ *result;
5339 * A pointer to the contents in the error state.
5340 * Reading from this pointer when `result_ok` is set is undefined.
5342 struct LDKDecodeError *err;
5343 } LDKCResult_COption_NetworkUpdateZDecodeErrorZPtr;
5346 * A CResult_COption_NetworkUpdateZDecodeErrorZ represents the result of a fallible operation,
5347 * containing a crate::c_types::derived::COption_NetworkUpdateZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
5348 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5350 typedef struct LDKCResult_COption_NetworkUpdateZDecodeErrorZ {
5352 * The contents of this CResult_COption_NetworkUpdateZDecodeErrorZ, accessible via either
5353 * `err` or `result` depending on the state of `result_ok`.
5355 union LDKCResult_COption_NetworkUpdateZDecodeErrorZPtr contents;
5357 * Whether this CResult_COption_NetworkUpdateZDecodeErrorZ represents a success state.
5360 } LDKCResult_COption_NetworkUpdateZDecodeErrorZ;
5363 * The contents of CResult_TxOutUtxoLookupErrorZ
5365 typedef union LDKCResult_TxOutUtxoLookupErrorZPtr {
5367 * A pointer to the contents in the success state.
5368 * Reading from this pointer when `result_ok` is not set is undefined.
5370 struct LDKTxOut *result;
5372 * A pointer to the contents in the error state.
5373 * Reading from this pointer when `result_ok` is set is undefined.
5375 enum LDKUtxoLookupError *err;
5376 } LDKCResult_TxOutUtxoLookupErrorZPtr;
5379 * A CResult_TxOutUtxoLookupErrorZ represents the result of a fallible operation,
5380 * containing a crate::c_types::TxOut on success and a crate::lightning::routing::utxo::UtxoLookupError on failure.
5381 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5383 typedef struct LDKCResult_TxOutUtxoLookupErrorZ {
5385 * The contents of this CResult_TxOutUtxoLookupErrorZ, accessible via either
5386 * `err` or `result` depending on the state of `result_ok`.
5388 union LDKCResult_TxOutUtxoLookupErrorZPtr contents;
5390 * Whether this CResult_TxOutUtxoLookupErrorZ represents a success state.
5393 } LDKCResult_TxOutUtxoLookupErrorZ;
5398 * Represents a future resolution of a [`UtxoLookup::get_utxo`] query resolving async.
5400 * See [`UtxoResult::Async`] and [`UtxoFuture::resolve`] for more info.
5402 typedef struct MUST_USE_STRUCT LDKUtxoFuture {
5404 * A pointer to the opaque Rust object.
5405 * Nearly everywhere, inner must be non-null, however in places where
5406 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5408 LDKnativeUtxoFuture *inner;
5410 * Indicates that this is the only struct which contains the same pointer.
5411 * Rust functions which take ownership of an object provided via an argument require
5412 * this to be true and invalidate the object pointed to by inner.
5418 * The result of a [`UtxoLookup::get_utxo`] call. A call may resolve either synchronously,
5419 * returning the `Sync` variant, or asynchronously, returning an [`UtxoFuture`] in the `Async`
5422 typedef enum LDKUtxoResult_Tag {
5424 * A result which was resolved synchronously. It either includes a [`TxOut`] for the output
5425 * requested or a [`UtxoLookupError`].
5429 * A result which will be resolved asynchronously. It includes a [`UtxoFuture`], a `clone` of
5430 * which you must keep locally and call [`UtxoFuture::resolve`] on once the lookup completes.
5432 * Note that in order to avoid runaway memory usage, the number of parallel checks is limited,
5433 * but only fairly loosely. Because a pending checks block all message processing, leaving
5434 * checks pending for an extended time may cause DoS of other functions. It is recommended you
5435 * keep a tight timeout on lookups, on the order of a few seconds.
5437 LDKUtxoResult_Async,
5439 * Must be last for serialization purposes
5441 LDKUtxoResult_Sentinel,
5442 } LDKUtxoResult_Tag;
5444 typedef struct MUST_USE_STRUCT LDKUtxoResult {
5445 LDKUtxoResult_Tag tag;
5448 struct LDKCResult_TxOutUtxoLookupErrorZ sync;
5451 struct LDKUtxoFuture async;
5457 * The `UtxoLookup` trait defines behavior for accessing on-chain UTXOs.
5459 typedef struct LDKUtxoLookup {
5461 * An opaque pointer which is passed to your function implementations as an argument.
5462 * This has no meaning in the LDK, and can be NULL or any other value.
5466 * Returns the transaction output of a funding transaction encoded by [`short_channel_id`].
5467 * Returns an error if `genesis_hash` is for a different chain or if such a transaction output
5470 * [`short_channel_id`]: https://github.com/lightning/bolts/blob/master/07-routing-gossip.md#definition-of-short_channel_id
5472 struct LDKUtxoResult (*get_utxo)(const void *this_arg, const uint8_t (*genesis_hash)[32], uint64_t short_channel_id);
5474 * Frees any resources associated with this object given its this_arg pointer.
5475 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
5477 void (*free)(void *this_arg);
5481 * An enum which can either contain a crate::lightning::routing::utxo::UtxoLookup or not
5483 typedef enum LDKCOption_UtxoLookupZ_Tag {
5485 * When we're in this state, this COption_UtxoLookupZ contains a crate::lightning::routing::utxo::UtxoLookup
5487 LDKCOption_UtxoLookupZ_Some,
5489 * When we're in this state, this COption_UtxoLookupZ contains nothing
5491 LDKCOption_UtxoLookupZ_None,
5493 * Must be last for serialization purposes
5495 LDKCOption_UtxoLookupZ_Sentinel,
5496 } LDKCOption_UtxoLookupZ_Tag;
5498 typedef struct LDKCOption_UtxoLookupZ {
5499 LDKCOption_UtxoLookupZ_Tag tag;
5502 struct LDKUtxoLookup some;
5505 } LDKCOption_UtxoLookupZ;
5508 * The contents of CResult_NoneLightningErrorZ
5510 typedef union LDKCResult_NoneLightningErrorZPtr {
5512 * Note that this value is always NULL, as there are no contents in the OK variant
5516 * A pointer to the contents in the error state.
5517 * Reading from this pointer when `result_ok` is set is undefined.
5519 struct LDKLightningError *err;
5520 } LDKCResult_NoneLightningErrorZPtr;
5523 * A CResult_NoneLightningErrorZ represents the result of a fallible operation,
5524 * containing a () on success and a crate::lightning::ln::msgs::LightningError on failure.
5525 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5527 typedef struct LDKCResult_NoneLightningErrorZ {
5529 * The contents of this CResult_NoneLightningErrorZ, accessible via either
5530 * `err` or `result` depending on the state of `result_ok`.
5532 union LDKCResult_NoneLightningErrorZPtr contents;
5534 * Whether this CResult_NoneLightningErrorZ represents a success state.
5537 } LDKCResult_NoneLightningErrorZ;
5540 * The contents of CResult_boolLightningErrorZ
5542 typedef union LDKCResult_boolLightningErrorZPtr {
5544 * A pointer to the contents in the success state.
5545 * Reading from this pointer when `result_ok` is not set is undefined.
5549 * A pointer to the contents in the error state.
5550 * Reading from this pointer when `result_ok` is set is undefined.
5552 struct LDKLightningError *err;
5553 } LDKCResult_boolLightningErrorZPtr;
5556 * A CResult_boolLightningErrorZ represents the result of a fallible operation,
5557 * containing a bool on success and a crate::lightning::ln::msgs::LightningError on failure.
5558 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5560 typedef struct LDKCResult_boolLightningErrorZ {
5562 * The contents of this CResult_boolLightningErrorZ, accessible via either
5563 * `err` or `result` depending on the state of `result_ok`.
5565 union LDKCResult_boolLightningErrorZPtr contents;
5567 * Whether this CResult_boolLightningErrorZ represents a success state.
5570 } LDKCResult_boolLightningErrorZ;
5575 * A [`channel_announcement`] message to be sent to or received from a peer.
5577 * [`channel_announcement`]: https://github.com/lightning/bolts/blob/master/07-routing-gossip.md#the-channel_announcement-message
5579 typedef struct MUST_USE_STRUCT LDKChannelAnnouncement {
5581 * A pointer to the opaque Rust object.
5582 * Nearly everywhere, inner must be non-null, however in places where
5583 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5585 LDKnativeChannelAnnouncement *inner;
5587 * Indicates that this is the only struct which contains the same pointer.
5588 * Rust functions which take ownership of an object provided via an argument require
5589 * this to be true and invalidate the object pointed to by inner.
5592 } LDKChannelAnnouncement;
5595 * A tuple of 3 elements. See the individual fields for the types contained.
5597 typedef struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ {
5599 * The element at position 0
5601 struct LDKChannelAnnouncement a;
5603 * The element at position 1
5605 struct LDKChannelUpdate b;
5607 * The element at position 2
5609 struct LDKChannelUpdate c;
5610 } LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ;
5613 * An enum which can either contain a crate::c_types::derived::C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ or not
5615 typedef enum LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_Tag {
5617 * When we're in this state, this COption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ contains a crate::c_types::derived::C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ
5619 LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_Some,
5621 * When we're in this state, this COption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ contains nothing
5623 LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_None,
5625 * Must be last for serialization purposes
5627 LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_Sentinel,
5628 } LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_Tag;
5630 typedef struct LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ {
5631 LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_Tag tag;
5634 struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ some;
5637 } LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ;
5642 * An [`accept_channel`] message to be sent to or received from a peer.
5644 * Used in V1 channel establishment
5646 * [`accept_channel`]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md#the-accept_channel-message
5648 typedef struct MUST_USE_STRUCT LDKAcceptChannel {
5650 * A pointer to the opaque Rust object.
5651 * Nearly everywhere, inner must be non-null, however in places where
5652 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5654 LDKnativeAcceptChannel *inner;
5656 * Indicates that this is the only struct which contains the same pointer.
5657 * Rust functions which take ownership of an object provided via an argument require
5658 * this to be true and invalidate the object pointed to by inner.
5666 * An accept_channel2 message to be sent by or received from the channel accepter.
5668 * Used in V2 channel establishment
5671 typedef struct MUST_USE_STRUCT LDKAcceptChannelV2 {
5673 * A pointer to the opaque Rust object.
5674 * Nearly everywhere, inner must be non-null, however in places where
5675 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5677 LDKnativeAcceptChannelV2 *inner;
5679 * Indicates that this is the only struct which contains the same pointer.
5680 * Rust functions which take ownership of an object provided via an argument require
5681 * this to be true and invalidate the object pointed to by inner.
5684 } LDKAcceptChannelV2;
5689 * An [`open_channel`] message to be sent to or received from a peer.
5691 * Used in V1 channel establishment
5693 * [`open_channel`]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md#the-open_channel-message
5695 typedef struct MUST_USE_STRUCT LDKOpenChannel {
5697 * A pointer to the opaque Rust object.
5698 * Nearly everywhere, inner must be non-null, however in places where
5699 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5701 LDKnativeOpenChannel *inner;
5703 * Indicates that this is the only struct which contains the same pointer.
5704 * Rust functions which take ownership of an object provided via an argument require
5705 * this to be true and invalidate the object pointed to by inner.
5713 * An open_channel2 message to be sent by or received from the channel initiator.
5715 * Used in V2 channel establishment
5718 typedef struct MUST_USE_STRUCT LDKOpenChannelV2 {
5720 * A pointer to the opaque Rust object.
5721 * Nearly everywhere, inner must be non-null, however in places where
5722 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5724 LDKnativeOpenChannelV2 *inner;
5726 * Indicates that this is the only struct which contains the same pointer.
5727 * Rust functions which take ownership of an object provided via an argument require
5728 * this to be true and invalidate the object pointed to by inner.
5736 * A [`funding_created`] message to be sent to or received from a peer.
5738 * Used in V1 channel establishment
5740 * [`funding_created`]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md#the-funding_created-message
5742 typedef struct MUST_USE_STRUCT LDKFundingCreated {
5744 * A pointer to the opaque Rust object.
5745 * Nearly everywhere, inner must be non-null, however in places where
5746 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5748 LDKnativeFundingCreated *inner;
5750 * Indicates that this is the only struct which contains the same pointer.
5751 * Rust functions which take ownership of an object provided via an argument require
5752 * this to be true and invalidate the object pointed to by inner.
5755 } LDKFundingCreated;
5760 * A [`funding_signed`] message to be sent to or received from a peer.
5762 * Used in V1 channel establishment
5764 * [`funding_signed`]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md#the-funding_signed-message
5766 typedef struct MUST_USE_STRUCT LDKFundingSigned {
5768 * A pointer to the opaque Rust object.
5769 * Nearly everywhere, inner must be non-null, however in places where
5770 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5772 LDKnativeFundingSigned *inner;
5774 * Indicates that this is the only struct which contains the same pointer.
5775 * Rust functions which take ownership of an object provided via an argument require
5776 * this to be true and invalidate the object pointed to by inner.
5784 * A tx_add_input message for adding an input during interactive transaction construction
5787 typedef struct MUST_USE_STRUCT LDKTxAddInput {
5789 * A pointer to the opaque Rust object.
5790 * Nearly everywhere, inner must be non-null, however in places where
5791 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5793 LDKnativeTxAddInput *inner;
5795 * Indicates that this is the only struct which contains the same pointer.
5796 * Rust functions which take ownership of an object provided via an argument require
5797 * this to be true and invalidate the object pointed to by inner.
5805 * A tx_add_output message for adding an output during interactive transaction construction.
5808 typedef struct MUST_USE_STRUCT LDKTxAddOutput {
5810 * A pointer to the opaque Rust object.
5811 * Nearly everywhere, inner must be non-null, however in places where
5812 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5814 LDKnativeTxAddOutput *inner;
5816 * Indicates that this is the only struct which contains the same pointer.
5817 * Rust functions which take ownership of an object provided via an argument require
5818 * this to be true and invalidate the object pointed to by inner.
5826 * A tx_remove_input message for removing an input during interactive transaction construction.
5829 typedef struct MUST_USE_STRUCT LDKTxRemoveInput {
5831 * A pointer to the opaque Rust object.
5832 * Nearly everywhere, inner must be non-null, however in places where
5833 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5835 LDKnativeTxRemoveInput *inner;
5837 * Indicates that this is the only struct which contains the same pointer.
5838 * Rust functions which take ownership of an object provided via an argument require
5839 * this to be true and invalidate the object pointed to by inner.
5847 * A tx_remove_output message for removing an output during interactive transaction construction.
5850 typedef struct MUST_USE_STRUCT LDKTxRemoveOutput {
5852 * A pointer to the opaque Rust object.
5853 * Nearly everywhere, inner must be non-null, however in places where
5854 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5856 LDKnativeTxRemoveOutput *inner;
5858 * Indicates that this is the only struct which contains the same pointer.
5859 * Rust functions which take ownership of an object provided via an argument require
5860 * this to be true and invalidate the object pointed to by inner.
5863 } LDKTxRemoveOutput;
5868 * A tx_complete message signalling the conclusion of a peer's transaction contributions during
5869 * interactive transaction construction.
5872 typedef struct MUST_USE_STRUCT LDKTxComplete {
5874 * A pointer to the opaque Rust object.
5875 * Nearly everywhere, inner must be non-null, however in places where
5876 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5878 LDKnativeTxComplete *inner;
5880 * Indicates that this is the only struct which contains the same pointer.
5881 * Rust functions which take ownership of an object provided via an argument require
5882 * this to be true and invalidate the object pointed to by inner.
5890 * A tx_signatures message containing the sender's signatures for a transaction constructed with
5891 * interactive transaction construction.
5894 typedef struct MUST_USE_STRUCT LDKTxSignatures {
5896 * A pointer to the opaque Rust object.
5897 * Nearly everywhere, inner must be non-null, however in places where
5898 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5900 LDKnativeTxSignatures *inner;
5902 * Indicates that this is the only struct which contains the same pointer.
5903 * Rust functions which take ownership of an object provided via an argument require
5904 * this to be true and invalidate the object pointed to by inner.
5912 * A tx_init_rbf message which initiates a replacement of the transaction after it's been
5916 typedef struct MUST_USE_STRUCT LDKTxInitRbf {
5918 * A pointer to the opaque Rust object.
5919 * Nearly everywhere, inner must be non-null, however in places where
5920 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5922 LDKnativeTxInitRbf *inner;
5924 * Indicates that this is the only struct which contains the same pointer.
5925 * Rust functions which take ownership of an object provided via an argument require
5926 * this to be true and invalidate the object pointed to by inner.
5934 * A tx_ack_rbf message which acknowledges replacement of the transaction after it's been
5938 typedef struct MUST_USE_STRUCT LDKTxAckRbf {
5940 * A pointer to the opaque Rust object.
5941 * Nearly everywhere, inner must be non-null, however in places where
5942 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5944 LDKnativeTxAckRbf *inner;
5946 * Indicates that this is the only struct which contains the same pointer.
5947 * Rust functions which take ownership of an object provided via an argument require
5948 * this to be true and invalidate the object pointed to by inner.
5956 * A tx_abort message which signals the cancellation of an in-progress transaction negotiation.
5959 typedef struct MUST_USE_STRUCT LDKTxAbort {
5961 * A pointer to the opaque Rust object.
5962 * Nearly everywhere, inner must be non-null, however in places where
5963 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5965 LDKnativeTxAbort *inner;
5967 * Indicates that this is the only struct which contains the same pointer.
5968 * Rust functions which take ownership of an object provided via an argument require
5969 * this to be true and invalidate the object pointed to by inner.
5977 * A [`channel_ready`] message to be sent to or received from a peer.
5979 * [`channel_ready`]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md#the-channel_ready-message
5981 typedef struct MUST_USE_STRUCT LDKChannelReady {
5983 * A pointer to the opaque Rust object.
5984 * Nearly everywhere, inner must be non-null, however in places where
5985 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5987 LDKnativeChannelReady *inner;
5989 * Indicates that this is the only struct which contains the same pointer.
5990 * Rust functions which take ownership of an object provided via an argument require
5991 * this to be true and invalidate the object pointed to by inner.
5999 * An [`announcement_signatures`] message to be sent to or received from a peer.
6001 * [`announcement_signatures`]: https://github.com/lightning/bolts/blob/master/07-routing-gossip.md#the-announcement_signatures-message
6003 typedef struct MUST_USE_STRUCT LDKAnnouncementSignatures {
6005 * A pointer to the opaque Rust object.
6006 * Nearly everywhere, inner must be non-null, however in places where
6007 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6009 LDKnativeAnnouncementSignatures *inner;
6011 * Indicates that this is the only struct which contains the same pointer.
6012 * Rust functions which take ownership of an object provided via an argument require
6013 * this to be true and invalidate the object pointed to by inner.
6016 } LDKAnnouncementSignatures;
6021 * Struct used to return values from [`RevokeAndACK`] messages, containing a bunch of commitment
6022 * transaction updates if they were pending.
6024 typedef struct MUST_USE_STRUCT LDKCommitmentUpdate {
6026 * A pointer to the opaque Rust object.
6027 * Nearly everywhere, inner must be non-null, however in places where
6028 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6030 LDKnativeCommitmentUpdate *inner;
6032 * Indicates that this is the only struct which contains the same pointer.
6033 * Rust functions which take ownership of an object provided via an argument require
6034 * this to be true and invalidate the object pointed to by inner.
6037 } LDKCommitmentUpdate;
6042 * A [`revoke_and_ack`] message to be sent to or received from a peer.
6044 * [`revoke_and_ack`]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md#completing-the-transition-to-the-updated-state-revoke_and_ack
6046 typedef struct MUST_USE_STRUCT LDKRevokeAndACK {
6048 * A pointer to the opaque Rust object.
6049 * Nearly everywhere, inner must be non-null, however in places where
6050 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6052 LDKnativeRevokeAndACK *inner;
6054 * Indicates that this is the only struct which contains the same pointer.
6055 * Rust functions which take ownership of an object provided via an argument require
6056 * this to be true and invalidate the object pointed to by inner.
6064 * A [`closing_signed`] message to be sent to or received from a peer.
6066 * [`closing_signed`]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md#closing-negotiation-closing_signed
6068 typedef struct MUST_USE_STRUCT LDKClosingSigned {
6070 * A pointer to the opaque Rust object.
6071 * Nearly everywhere, inner must be non-null, however in places where
6072 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6074 LDKnativeClosingSigned *inner;
6076 * Indicates that this is the only struct which contains the same pointer.
6077 * Rust functions which take ownership of an object provided via an argument require
6078 * this to be true and invalidate the object pointed to by inner.
6086 * A [`shutdown`] message to be sent to or received from a peer.
6088 * [`shutdown`]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md#closing-initiation-shutdown
6090 typedef struct MUST_USE_STRUCT LDKShutdown {
6092 * A pointer to the opaque Rust object.
6093 * Nearly everywhere, inner must be non-null, however in places where
6094 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6096 LDKnativeShutdown *inner;
6098 * Indicates that this is the only struct which contains the same pointer.
6099 * Rust functions which take ownership of an object provided via an argument require
6100 * this to be true and invalidate the object pointed to by inner.
6108 * A [`channel_reestablish`] message to be sent to or received from a peer.
6110 * [`channel_reestablish`]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md#message-retransmission
6112 typedef struct MUST_USE_STRUCT LDKChannelReestablish {
6114 * A pointer to the opaque Rust object.
6115 * Nearly everywhere, inner must be non-null, however in places where
6116 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6118 LDKnativeChannelReestablish *inner;
6120 * Indicates that this is the only struct which contains the same pointer.
6121 * Rust functions which take ownership of an object provided via an argument require
6122 * this to be true and invalidate the object pointed to by inner.
6125 } LDKChannelReestablish;
6130 * A [`node_announcement`] message to be sent to or received from a peer.
6132 * [`node_announcement`]: https://github.com/lightning/bolts/blob/master/07-routing-gossip.md#the-node_announcement-message
6134 typedef struct MUST_USE_STRUCT LDKNodeAnnouncement {
6136 * A pointer to the opaque Rust object.
6137 * Nearly everywhere, inner must be non-null, however in places where
6138 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6140 LDKnativeNodeAnnouncement *inner;
6142 * Indicates that this is the only struct which contains the same pointer.
6143 * Rust functions which take ownership of an object provided via an argument require
6144 * this to be true and invalidate the object pointed to by inner.
6147 } LDKNodeAnnouncement;
6152 * An [`error`] message to be sent to or received from a peer.
6154 * [`error`]: https://github.com/lightning/bolts/blob/master/01-messaging.md#the-error-and-warning-messages
6156 typedef struct MUST_USE_STRUCT LDKErrorMessage {
6158 * A pointer to the opaque Rust object.
6159 * Nearly everywhere, inner must be non-null, however in places where
6160 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6162 LDKnativeErrorMessage *inner;
6164 * Indicates that this is the only struct which contains the same pointer.
6165 * Rust functions which take ownership of an object provided via an argument require
6166 * this to be true and invalidate the object pointed to by inner.
6174 * A [`warning`] message to be sent to or received from a peer.
6176 * [`warning`]: https://github.com/lightning/bolts/blob/master/01-messaging.md#the-error-and-warning-messages
6178 typedef struct MUST_USE_STRUCT LDKWarningMessage {
6180 * A pointer to the opaque Rust object.
6181 * Nearly everywhere, inner must be non-null, however in places where
6182 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6184 LDKnativeWarningMessage *inner;
6186 * Indicates that this is the only struct which contains the same pointer.
6187 * Rust functions which take ownership of an object provided via an argument require
6188 * this to be true and invalidate the object pointed to by inner.
6191 } LDKWarningMessage;
6194 * Used to put an error message in a [`LightningError`].
6196 typedef enum LDKErrorAction_Tag {
6198 * The peer took some action which made us think they were useless. Disconnect them.
6200 LDKErrorAction_DisconnectPeer,
6202 * The peer did something incorrect. Tell them without closing any channels and disconnect them.
6204 LDKErrorAction_DisconnectPeerWithWarning,
6206 * The peer did something harmless that we weren't able to process, just log and ignore
6208 LDKErrorAction_IgnoreError,
6210 * The peer did something harmless that we weren't able to meaningfully process.
6211 * If the error is logged, log it at the given level.
6213 LDKErrorAction_IgnoreAndLog,
6215 * The peer provided us with a gossip message which we'd already seen. In most cases this
6216 * should be ignored, but it may result in the message being forwarded if it is a duplicate of
6217 * our own channel announcements.
6219 LDKErrorAction_IgnoreDuplicateGossip,
6221 * The peer did something incorrect. Tell them.
6223 LDKErrorAction_SendErrorMessage,
6225 * The peer did something incorrect. Tell them without closing any channels.
6227 LDKErrorAction_SendWarningMessage,
6229 * Must be last for serialization purposes
6231 LDKErrorAction_Sentinel,
6232 } LDKErrorAction_Tag;
6234 typedef struct LDKErrorAction_LDKDisconnectPeer_Body {
6236 * An error message which we should make an effort to send before we disconnect.
6238 * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
6240 struct LDKErrorMessage msg;
6241 } LDKErrorAction_LDKDisconnectPeer_Body;
6243 typedef struct LDKErrorAction_LDKDisconnectPeerWithWarning_Body {
6245 * A warning message which we should make an effort to send before we disconnect.
6247 struct LDKWarningMessage msg;
6248 } LDKErrorAction_LDKDisconnectPeerWithWarning_Body;
6250 typedef struct LDKErrorAction_LDKSendErrorMessage_Body {
6252 * The message to send.
6254 struct LDKErrorMessage msg;
6255 } LDKErrorAction_LDKSendErrorMessage_Body;
6257 typedef struct LDKErrorAction_LDKSendWarningMessage_Body {
6259 * The message to send.
6261 struct LDKWarningMessage msg;
6263 * The peer may have done something harmless that we weren't able to meaningfully process,
6264 * though we should still tell them about it.
6265 * If this event is logged, log it at the given level.
6267 enum LDKLevel log_level;
6268 } LDKErrorAction_LDKSendWarningMessage_Body;
6270 typedef struct MUST_USE_STRUCT LDKErrorAction {
6271 LDKErrorAction_Tag tag;
6273 LDKErrorAction_LDKDisconnectPeer_Body disconnect_peer;
6274 LDKErrorAction_LDKDisconnectPeerWithWarning_Body disconnect_peer_with_warning;
6276 enum LDKLevel ignore_and_log;
6278 LDKErrorAction_LDKSendErrorMessage_Body send_error_message;
6279 LDKErrorAction_LDKSendWarningMessage_Body send_warning_message;
6286 * A [`query_channel_range`] message is used to query a peer for channel
6287 * UTXOs in a range of blocks. The recipient of a query makes a best
6288 * effort to reply to the query using one or more [`ReplyChannelRange`]
6291 * [`query_channel_range`]: https://github.com/lightning/bolts/blob/master/07-routing-gossip.md#the-query_channel_range-and-reply_channel_range-messages
6293 typedef struct MUST_USE_STRUCT LDKQueryChannelRange {
6295 * A pointer to the opaque Rust object.
6296 * Nearly everywhere, inner must be non-null, however in places where
6297 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6299 LDKnativeQueryChannelRange *inner;
6301 * Indicates that this is the only struct which contains the same pointer.
6302 * Rust functions which take ownership of an object provided via an argument require
6303 * this to be true and invalidate the object pointed to by inner.
6306 } LDKQueryChannelRange;
6311 * A [`query_short_channel_ids`] message is used to query a peer for
6312 * routing gossip messages related to one or more `short_channel_id`s.
6314 * The query recipient will reply with the latest, if available,
6315 * [`ChannelAnnouncement`], [`ChannelUpdate`] and [`NodeAnnouncement`] messages
6316 * it maintains for the requested `short_channel_id`s followed by a
6317 * [`ReplyShortChannelIdsEnd`] message. The `short_channel_id`s sent in
6318 * this query are encoded. We only support `encoding_type=0` uncompressed
6319 * serialization and do not support `encoding_type=1` zlib serialization.
6321 * [`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
6323 typedef struct MUST_USE_STRUCT LDKQueryShortChannelIds {
6325 * A pointer to the opaque Rust object.
6326 * Nearly everywhere, inner must be non-null, however in places where
6327 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6329 LDKnativeQueryShortChannelIds *inner;
6331 * Indicates that this is the only struct which contains the same pointer.
6332 * Rust functions which take ownership of an object provided via an argument require
6333 * this to be true and invalidate the object pointed to by inner.
6336 } LDKQueryShortChannelIds;
6341 * A [`reply_channel_range`] message is a reply to a [`QueryChannelRange`]
6344 * Multiple `reply_channel_range` messages can be sent in reply
6345 * to a single [`QueryChannelRange`] message. The query recipient makes a
6346 * best effort to respond based on their local network view which may
6347 * not be a perfect view of the network. The `short_channel_id`s in the
6348 * reply are encoded. We only support `encoding_type=0` uncompressed
6349 * serialization and do not support `encoding_type=1` zlib serialization.
6351 * [`reply_channel_range`]: https://github.com/lightning/bolts/blob/master/07-routing-gossip.md#the-query_channel_range-and-reply_channel_range-messages
6353 typedef struct MUST_USE_STRUCT LDKReplyChannelRange {
6355 * A pointer to the opaque Rust object.
6356 * Nearly everywhere, inner must be non-null, however in places where
6357 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6359 LDKnativeReplyChannelRange *inner;
6361 * Indicates that this is the only struct which contains the same pointer.
6362 * Rust functions which take ownership of an object provided via an argument require
6363 * this to be true and invalidate the object pointed to by inner.
6366 } LDKReplyChannelRange;
6371 * A [`gossip_timestamp_filter`] message is used by a node to request
6372 * gossip relay for messages in the requested time range when the
6373 * `gossip_queries` feature has been negotiated.
6375 * [`gossip_timestamp_filter`]: https://github.com/lightning/bolts/blob/master/07-routing-gossip.md#the-gossip_timestamp_filter-message
6377 typedef struct MUST_USE_STRUCT LDKGossipTimestampFilter {
6379 * A pointer to the opaque Rust object.
6380 * Nearly everywhere, inner must be non-null, however in places where
6381 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6383 LDKnativeGossipTimestampFilter *inner;
6385 * Indicates that this is the only struct which contains the same pointer.
6386 * Rust functions which take ownership of an object provided via an argument require
6387 * this to be true and invalidate the object pointed to by inner.
6390 } LDKGossipTimestampFilter;
6393 * An event generated by ChannelManager which indicates a message should be sent to a peer (or
6394 * broadcast to most peers).
6395 * These events are handled by PeerManager::process_events if you are using a PeerManager.
6397 typedef enum LDKMessageSendEvent_Tag {
6399 * Used to indicate that we've accepted a channel open and should send the accept_channel
6400 * message provided to the given peer.
6402 LDKMessageSendEvent_SendAcceptChannel,
6404 * Used to indicate that we've accepted a V2 channel open and should send the accept_channel2
6405 * message provided to the given peer.
6407 LDKMessageSendEvent_SendAcceptChannelV2,
6409 * Used to indicate that we've initiated a channel open and should send the open_channel
6410 * message provided to the given peer.
6412 LDKMessageSendEvent_SendOpenChannel,
6414 * Used to indicate that we've initiated a V2 channel open and should send the open_channel2
6415 * message provided to the given peer.
6417 LDKMessageSendEvent_SendOpenChannelV2,
6419 * Used to indicate that a funding_created message should be sent to the peer with the given node_id.
6421 LDKMessageSendEvent_SendFundingCreated,
6423 * Used to indicate that a funding_signed message should be sent to the peer with the given node_id.
6425 LDKMessageSendEvent_SendFundingSigned,
6427 * Used to indicate that a tx_add_input message should be sent to the peer with the given node_id.
6429 LDKMessageSendEvent_SendTxAddInput,
6431 * Used to indicate that a tx_add_output message should be sent to the peer with the given node_id.
6433 LDKMessageSendEvent_SendTxAddOutput,
6435 * Used to indicate that a tx_remove_input message should be sent to the peer with the given node_id.
6437 LDKMessageSendEvent_SendTxRemoveInput,
6439 * Used to indicate that a tx_remove_output message should be sent to the peer with the given node_id.
6441 LDKMessageSendEvent_SendTxRemoveOutput,
6443 * Used to indicate that a tx_complete message should be sent to the peer with the given node_id.
6445 LDKMessageSendEvent_SendTxComplete,
6447 * Used to indicate that a tx_signatures message should be sent to the peer with the given node_id.
6449 LDKMessageSendEvent_SendTxSignatures,
6451 * Used to indicate that a tx_init_rbf message should be sent to the peer with the given node_id.
6453 LDKMessageSendEvent_SendTxInitRbf,
6455 * Used to indicate that a tx_ack_rbf message should be sent to the peer with the given node_id.
6457 LDKMessageSendEvent_SendTxAckRbf,
6459 * Used to indicate that a tx_abort message should be sent to the peer with the given node_id.
6461 LDKMessageSendEvent_SendTxAbort,
6463 * Used to indicate that a channel_ready message should be sent to the peer with the given node_id.
6465 LDKMessageSendEvent_SendChannelReady,
6467 * Used to indicate that an announcement_signatures message should be sent to the peer with the given node_id.
6469 LDKMessageSendEvent_SendAnnouncementSignatures,
6471 * Used to indicate that a series of HTLC update messages, as well as a commitment_signed
6472 * message should be sent to the peer with the given node_id.
6474 LDKMessageSendEvent_UpdateHTLCs,
6476 * Used to indicate that a revoke_and_ack message should be sent to the peer with the given node_id.
6478 LDKMessageSendEvent_SendRevokeAndACK,
6480 * Used to indicate that a closing_signed message should be sent to the peer with the given node_id.
6482 LDKMessageSendEvent_SendClosingSigned,
6484 * Used to indicate that a shutdown message should be sent to the peer with the given node_id.
6486 LDKMessageSendEvent_SendShutdown,
6488 * Used to indicate that a channel_reestablish message should be sent to the peer with the given node_id.
6490 LDKMessageSendEvent_SendChannelReestablish,
6492 * Used to send a channel_announcement and channel_update to a specific peer, likely on
6493 * initial connection to ensure our peers know about our channels.
6495 LDKMessageSendEvent_SendChannelAnnouncement,
6497 * Used to indicate that a channel_announcement and channel_update should be broadcast to all
6498 * peers (except the peer with node_id either msg.contents.node_id_1 or msg.contents.node_id_2).
6500 * Note that after doing so, you very likely (unless you did so very recently) want to
6501 * broadcast a node_announcement (e.g. via [`PeerManager::broadcast_node_announcement`]). This
6502 * ensures that any nodes which see our channel_announcement also have a relevant
6503 * node_announcement, including relevant feature flags which may be important for routing
6506 * [`PeerManager::broadcast_node_announcement`]: crate::ln::peer_handler::PeerManager::broadcast_node_announcement
6508 LDKMessageSendEvent_BroadcastChannelAnnouncement,
6510 * Used to indicate that a channel_update should be broadcast to all peers.
6512 LDKMessageSendEvent_BroadcastChannelUpdate,
6514 * Used to indicate that a node_announcement should be broadcast to all peers.
6516 LDKMessageSendEvent_BroadcastNodeAnnouncement,
6518 * Used to indicate that a channel_update should be sent to a single peer.
6519 * In contrast to [`Self::BroadcastChannelUpdate`], this is used when the channel is a
6520 * private channel and we shouldn't be informing all of our peers of channel parameters.
6522 LDKMessageSendEvent_SendChannelUpdate,
6524 * Broadcast an error downstream to be handled
6526 LDKMessageSendEvent_HandleError,
6528 * Query a peer for channels with funding transaction UTXOs in a block range.
6530 LDKMessageSendEvent_SendChannelRangeQuery,
6532 * Request routing gossip messages from a peer for a list of channels identified by
6533 * their short_channel_ids.
6535 LDKMessageSendEvent_SendShortIdsQuery,
6537 * Sends a reply to a channel range query. This may be one of several SendReplyChannelRange events
6538 * emitted during processing of the query.
6540 LDKMessageSendEvent_SendReplyChannelRange,
6542 * Sends a timestamp filter for inbound gossip. This should be sent on each new connection to
6543 * enable receiving gossip messages from the peer.
6545 LDKMessageSendEvent_SendGossipTimestampFilter,
6547 * Must be last for serialization purposes
6549 LDKMessageSendEvent_Sentinel,
6550 } LDKMessageSendEvent_Tag;
6552 typedef struct LDKMessageSendEvent_LDKSendAcceptChannel_Body {
6554 * The node_id of the node which should receive this message
6556 struct LDKPublicKey node_id;
6558 * The message which should be sent.
6560 struct LDKAcceptChannel msg;
6561 } LDKMessageSendEvent_LDKSendAcceptChannel_Body;
6563 typedef struct LDKMessageSendEvent_LDKSendAcceptChannelV2_Body {
6565 * The node_id of the node which should receive this message
6567 struct LDKPublicKey node_id;
6569 * The message which should be sent.
6571 struct LDKAcceptChannelV2 msg;
6572 } LDKMessageSendEvent_LDKSendAcceptChannelV2_Body;
6574 typedef struct LDKMessageSendEvent_LDKSendOpenChannel_Body {
6576 * The node_id of the node which should receive this message
6578 struct LDKPublicKey node_id;
6580 * The message which should be sent.
6582 struct LDKOpenChannel msg;
6583 } LDKMessageSendEvent_LDKSendOpenChannel_Body;
6585 typedef struct LDKMessageSendEvent_LDKSendOpenChannelV2_Body {
6587 * The node_id of the node which should receive this message
6589 struct LDKPublicKey node_id;
6591 * The message which should be sent.
6593 struct LDKOpenChannelV2 msg;
6594 } LDKMessageSendEvent_LDKSendOpenChannelV2_Body;
6596 typedef struct LDKMessageSendEvent_LDKSendFundingCreated_Body {
6598 * The node_id of the node which should receive this message
6600 struct LDKPublicKey node_id;
6602 * The message which should be sent.
6604 struct LDKFundingCreated msg;
6605 } LDKMessageSendEvent_LDKSendFundingCreated_Body;
6607 typedef struct LDKMessageSendEvent_LDKSendFundingSigned_Body {
6609 * The node_id of the node which should receive this message
6611 struct LDKPublicKey node_id;
6613 * The message which should be sent.
6615 struct LDKFundingSigned msg;
6616 } LDKMessageSendEvent_LDKSendFundingSigned_Body;
6618 typedef struct LDKMessageSendEvent_LDKSendTxAddInput_Body {
6620 * The node_id of the node which should receive this message
6622 struct LDKPublicKey node_id;
6624 * The message which should be sent.
6626 struct LDKTxAddInput msg;
6627 } LDKMessageSendEvent_LDKSendTxAddInput_Body;
6629 typedef struct LDKMessageSendEvent_LDKSendTxAddOutput_Body {
6631 * The node_id of the node which should receive this message
6633 struct LDKPublicKey node_id;
6635 * The message which should be sent.
6637 struct LDKTxAddOutput msg;
6638 } LDKMessageSendEvent_LDKSendTxAddOutput_Body;
6640 typedef struct LDKMessageSendEvent_LDKSendTxRemoveInput_Body {
6642 * The node_id of the node which should receive this message
6644 struct LDKPublicKey node_id;
6646 * The message which should be sent.
6648 struct LDKTxRemoveInput msg;
6649 } LDKMessageSendEvent_LDKSendTxRemoveInput_Body;
6651 typedef struct LDKMessageSendEvent_LDKSendTxRemoveOutput_Body {
6653 * The node_id of the node which should receive this message
6655 struct LDKPublicKey node_id;
6657 * The message which should be sent.
6659 struct LDKTxRemoveOutput msg;
6660 } LDKMessageSendEvent_LDKSendTxRemoveOutput_Body;
6662 typedef struct LDKMessageSendEvent_LDKSendTxComplete_Body {
6664 * The node_id of the node which should receive this message
6666 struct LDKPublicKey node_id;
6668 * The message which should be sent.
6670 struct LDKTxComplete msg;
6671 } LDKMessageSendEvent_LDKSendTxComplete_Body;
6673 typedef struct LDKMessageSendEvent_LDKSendTxSignatures_Body {
6675 * The node_id of the node which should receive this message
6677 struct LDKPublicKey node_id;
6679 * The message which should be sent.
6681 struct LDKTxSignatures msg;
6682 } LDKMessageSendEvent_LDKSendTxSignatures_Body;
6684 typedef struct LDKMessageSendEvent_LDKSendTxInitRbf_Body {
6686 * The node_id of the node which should receive this message
6688 struct LDKPublicKey node_id;
6690 * The message which should be sent.
6692 struct LDKTxInitRbf msg;
6693 } LDKMessageSendEvent_LDKSendTxInitRbf_Body;
6695 typedef struct LDKMessageSendEvent_LDKSendTxAckRbf_Body {
6697 * The node_id of the node which should receive this message
6699 struct LDKPublicKey node_id;
6701 * The message which should be sent.
6703 struct LDKTxAckRbf msg;
6704 } LDKMessageSendEvent_LDKSendTxAckRbf_Body;
6706 typedef struct LDKMessageSendEvent_LDKSendTxAbort_Body {
6708 * The node_id of the node which should receive this message
6710 struct LDKPublicKey node_id;
6712 * The message which should be sent.
6714 struct LDKTxAbort msg;
6715 } LDKMessageSendEvent_LDKSendTxAbort_Body;
6717 typedef struct LDKMessageSendEvent_LDKSendChannelReady_Body {
6719 * The node_id of the node which should receive these message(s)
6721 struct LDKPublicKey node_id;
6723 * The channel_ready message which should be sent.
6725 struct LDKChannelReady msg;
6726 } LDKMessageSendEvent_LDKSendChannelReady_Body;
6728 typedef struct LDKMessageSendEvent_LDKSendAnnouncementSignatures_Body {
6730 * The node_id of the node which should receive these message(s)
6732 struct LDKPublicKey node_id;
6734 * The announcement_signatures message which should be sent.
6736 struct LDKAnnouncementSignatures msg;
6737 } LDKMessageSendEvent_LDKSendAnnouncementSignatures_Body;
6739 typedef struct LDKMessageSendEvent_LDKUpdateHTLCs_Body {
6741 * The node_id of the node which should receive these message(s)
6743 struct LDKPublicKey node_id;
6745 * The update messages which should be sent. ALL messages in the struct should be sent!
6747 struct LDKCommitmentUpdate updates;
6748 } LDKMessageSendEvent_LDKUpdateHTLCs_Body;
6750 typedef struct LDKMessageSendEvent_LDKSendRevokeAndACK_Body {
6752 * The node_id of the node which should receive this message
6754 struct LDKPublicKey node_id;
6756 * The message which should be sent.
6758 struct LDKRevokeAndACK msg;
6759 } LDKMessageSendEvent_LDKSendRevokeAndACK_Body;
6761 typedef struct LDKMessageSendEvent_LDKSendClosingSigned_Body {
6763 * The node_id of the node which should receive this message
6765 struct LDKPublicKey node_id;
6767 * The message which should be sent.
6769 struct LDKClosingSigned msg;
6770 } LDKMessageSendEvent_LDKSendClosingSigned_Body;
6772 typedef struct LDKMessageSendEvent_LDKSendShutdown_Body {
6774 * The node_id of the node which should receive this message
6776 struct LDKPublicKey node_id;
6778 * The message which should be sent.
6780 struct LDKShutdown msg;
6781 } LDKMessageSendEvent_LDKSendShutdown_Body;
6783 typedef struct LDKMessageSendEvent_LDKSendChannelReestablish_Body {
6785 * The node_id of the node which should receive this message
6787 struct LDKPublicKey node_id;
6789 * The message which should be sent.
6791 struct LDKChannelReestablish msg;
6792 } LDKMessageSendEvent_LDKSendChannelReestablish_Body;
6794 typedef struct LDKMessageSendEvent_LDKSendChannelAnnouncement_Body {
6796 * The node_id of the node which should receive this message
6798 struct LDKPublicKey node_id;
6800 * The channel_announcement which should be sent.
6802 struct LDKChannelAnnouncement msg;
6804 * The followup channel_update which should be sent.
6806 struct LDKChannelUpdate update_msg;
6807 } LDKMessageSendEvent_LDKSendChannelAnnouncement_Body;
6809 typedef struct LDKMessageSendEvent_LDKBroadcastChannelAnnouncement_Body {
6811 * The channel_announcement which should be sent.
6813 struct LDKChannelAnnouncement msg;
6815 * The followup channel_update which should be sent.
6817 * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
6819 struct LDKChannelUpdate update_msg;
6820 } LDKMessageSendEvent_LDKBroadcastChannelAnnouncement_Body;
6822 typedef struct LDKMessageSendEvent_LDKBroadcastChannelUpdate_Body {
6824 * The channel_update which should be sent.
6826 struct LDKChannelUpdate msg;
6827 } LDKMessageSendEvent_LDKBroadcastChannelUpdate_Body;
6829 typedef struct LDKMessageSendEvent_LDKBroadcastNodeAnnouncement_Body {
6831 * The node_announcement which should be sent.
6833 struct LDKNodeAnnouncement msg;
6834 } LDKMessageSendEvent_LDKBroadcastNodeAnnouncement_Body;
6836 typedef struct LDKMessageSendEvent_LDKSendChannelUpdate_Body {
6838 * The node_id of the node which should receive this message
6840 struct LDKPublicKey node_id;
6842 * The channel_update which should be sent.
6844 struct LDKChannelUpdate msg;
6845 } LDKMessageSendEvent_LDKSendChannelUpdate_Body;
6847 typedef struct LDKMessageSendEvent_LDKHandleError_Body {
6849 * The node_id of the node which should receive this message
6851 struct LDKPublicKey node_id;
6853 * The action which should be taken.
6855 struct LDKErrorAction action;
6856 } LDKMessageSendEvent_LDKHandleError_Body;
6858 typedef struct LDKMessageSendEvent_LDKSendChannelRangeQuery_Body {
6860 * The node_id of this message recipient
6862 struct LDKPublicKey node_id;
6864 * The query_channel_range which should be sent.
6866 struct LDKQueryChannelRange msg;
6867 } LDKMessageSendEvent_LDKSendChannelRangeQuery_Body;
6869 typedef struct LDKMessageSendEvent_LDKSendShortIdsQuery_Body {
6871 * The node_id of this message recipient
6873 struct LDKPublicKey node_id;
6875 * The query_short_channel_ids which should be sent.
6877 struct LDKQueryShortChannelIds msg;
6878 } LDKMessageSendEvent_LDKSendShortIdsQuery_Body;
6880 typedef struct LDKMessageSendEvent_LDKSendReplyChannelRange_Body {
6882 * The node_id of this message recipient
6884 struct LDKPublicKey node_id;
6886 * The reply_channel_range which should be sent.
6888 struct LDKReplyChannelRange msg;
6889 } LDKMessageSendEvent_LDKSendReplyChannelRange_Body;
6891 typedef struct LDKMessageSendEvent_LDKSendGossipTimestampFilter_Body {
6893 * The node_id of this message recipient
6895 struct LDKPublicKey node_id;
6897 * The gossip_timestamp_filter which should be sent.
6899 struct LDKGossipTimestampFilter msg;
6900 } LDKMessageSendEvent_LDKSendGossipTimestampFilter_Body;
6902 typedef struct MUST_USE_STRUCT LDKMessageSendEvent {
6903 LDKMessageSendEvent_Tag tag;
6905 LDKMessageSendEvent_LDKSendAcceptChannel_Body send_accept_channel;
6906 LDKMessageSendEvent_LDKSendAcceptChannelV2_Body send_accept_channel_v2;
6907 LDKMessageSendEvent_LDKSendOpenChannel_Body send_open_channel;
6908 LDKMessageSendEvent_LDKSendOpenChannelV2_Body send_open_channel_v2;
6909 LDKMessageSendEvent_LDKSendFundingCreated_Body send_funding_created;
6910 LDKMessageSendEvent_LDKSendFundingSigned_Body send_funding_signed;
6911 LDKMessageSendEvent_LDKSendTxAddInput_Body send_tx_add_input;
6912 LDKMessageSendEvent_LDKSendTxAddOutput_Body send_tx_add_output;
6913 LDKMessageSendEvent_LDKSendTxRemoveInput_Body send_tx_remove_input;
6914 LDKMessageSendEvent_LDKSendTxRemoveOutput_Body send_tx_remove_output;
6915 LDKMessageSendEvent_LDKSendTxComplete_Body send_tx_complete;
6916 LDKMessageSendEvent_LDKSendTxSignatures_Body send_tx_signatures;
6917 LDKMessageSendEvent_LDKSendTxInitRbf_Body send_tx_init_rbf;
6918 LDKMessageSendEvent_LDKSendTxAckRbf_Body send_tx_ack_rbf;
6919 LDKMessageSendEvent_LDKSendTxAbort_Body send_tx_abort;
6920 LDKMessageSendEvent_LDKSendChannelReady_Body send_channel_ready;
6921 LDKMessageSendEvent_LDKSendAnnouncementSignatures_Body send_announcement_signatures;
6922 LDKMessageSendEvent_LDKUpdateHTLCs_Body update_htl_cs;
6923 LDKMessageSendEvent_LDKSendRevokeAndACK_Body send_revoke_and_ack;
6924 LDKMessageSendEvent_LDKSendClosingSigned_Body send_closing_signed;
6925 LDKMessageSendEvent_LDKSendShutdown_Body send_shutdown;
6926 LDKMessageSendEvent_LDKSendChannelReestablish_Body send_channel_reestablish;
6927 LDKMessageSendEvent_LDKSendChannelAnnouncement_Body send_channel_announcement;
6928 LDKMessageSendEvent_LDKBroadcastChannelAnnouncement_Body broadcast_channel_announcement;
6929 LDKMessageSendEvent_LDKBroadcastChannelUpdate_Body broadcast_channel_update;
6930 LDKMessageSendEvent_LDKBroadcastNodeAnnouncement_Body broadcast_node_announcement;
6931 LDKMessageSendEvent_LDKSendChannelUpdate_Body send_channel_update;
6932 LDKMessageSendEvent_LDKHandleError_Body handle_error;
6933 LDKMessageSendEvent_LDKSendChannelRangeQuery_Body send_channel_range_query;
6934 LDKMessageSendEvent_LDKSendShortIdsQuery_Body send_short_ids_query;
6935 LDKMessageSendEvent_LDKSendReplyChannelRange_Body send_reply_channel_range;
6936 LDKMessageSendEvent_LDKSendGossipTimestampFilter_Body send_gossip_timestamp_filter;
6938 } LDKMessageSendEvent;
6941 * A dynamically-allocated array of crate::lightning::events::MessageSendEvents of arbitrary size.
6942 * This corresponds to std::vector in C++
6944 typedef struct LDKCVec_MessageSendEventZ {
6946 * The elements in the array.
6947 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
6949 struct LDKMessageSendEvent *data;
6951 * The number of elements pointed to by `data`.
6954 } LDKCVec_MessageSendEventZ;
6959 * Details about one direction of a channel as received within a [`ChannelUpdate`].
6961 typedef struct MUST_USE_STRUCT LDKChannelUpdateInfo {
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 LDKnativeChannelUpdateInfo *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.
6974 } LDKChannelUpdateInfo;
6977 * The contents of CResult_ChannelUpdateInfoDecodeErrorZ
6979 typedef union LDKCResult_ChannelUpdateInfoDecodeErrorZPtr {
6981 * A pointer to the contents in the success state.
6982 * Reading from this pointer when `result_ok` is not set is undefined.
6984 struct LDKChannelUpdateInfo *result;
6986 * A pointer to the contents in the error state.
6987 * Reading from this pointer when `result_ok` is set is undefined.
6989 struct LDKDecodeError *err;
6990 } LDKCResult_ChannelUpdateInfoDecodeErrorZPtr;
6993 * A CResult_ChannelUpdateInfoDecodeErrorZ represents the result of a fallible operation,
6994 * containing a crate::lightning::routing::gossip::ChannelUpdateInfo on success and a crate::lightning::ln::msgs::DecodeError on failure.
6995 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6997 typedef struct LDKCResult_ChannelUpdateInfoDecodeErrorZ {
6999 * The contents of this CResult_ChannelUpdateInfoDecodeErrorZ, accessible via either
7000 * `err` or `result` depending on the state of `result_ok`.
7002 union LDKCResult_ChannelUpdateInfoDecodeErrorZPtr contents;
7004 * Whether this CResult_ChannelUpdateInfoDecodeErrorZ represents a success state.
7007 } LDKCResult_ChannelUpdateInfoDecodeErrorZ;
7012 * Details about a channel (both directions).
7013 * Received within a channel announcement.
7015 typedef struct MUST_USE_STRUCT LDKChannelInfo {
7017 * A pointer to the opaque Rust object.
7018 * Nearly everywhere, inner must be non-null, however in places where
7019 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7021 LDKnativeChannelInfo *inner;
7023 * Indicates that this is the only struct which contains the same pointer.
7024 * Rust functions which take ownership of an object provided via an argument require
7025 * this to be true and invalidate the object pointed to by inner.
7031 * The contents of CResult_ChannelInfoDecodeErrorZ
7033 typedef union LDKCResult_ChannelInfoDecodeErrorZPtr {
7035 * A pointer to the contents in the success state.
7036 * Reading from this pointer when `result_ok` is not set is undefined.
7038 struct LDKChannelInfo *result;
7040 * A pointer to the contents in the error state.
7041 * Reading from this pointer when `result_ok` is set is undefined.
7043 struct LDKDecodeError *err;
7044 } LDKCResult_ChannelInfoDecodeErrorZPtr;
7047 * A CResult_ChannelInfoDecodeErrorZ represents the result of a fallible operation,
7048 * containing a crate::lightning::routing::gossip::ChannelInfo on success and a crate::lightning::ln::msgs::DecodeError on failure.
7049 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7051 typedef struct LDKCResult_ChannelInfoDecodeErrorZ {
7053 * The contents of this CResult_ChannelInfoDecodeErrorZ, accessible via either
7054 * `err` or `result` depending on the state of `result_ok`.
7056 union LDKCResult_ChannelInfoDecodeErrorZPtr contents;
7058 * Whether this CResult_ChannelInfoDecodeErrorZ represents a success state.
7061 } LDKCResult_ChannelInfoDecodeErrorZ;
7066 * Fees for routing via a given channel or a node
7068 typedef struct MUST_USE_STRUCT LDKRoutingFees {
7070 * A pointer to the opaque Rust object.
7071 * Nearly everywhere, inner must be non-null, however in places where
7072 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7074 LDKnativeRoutingFees *inner;
7076 * Indicates that this is the only struct which contains the same pointer.
7077 * Rust functions which take ownership of an object provided via an argument require
7078 * this to be true and invalidate the object pointed to by inner.
7084 * The contents of CResult_RoutingFeesDecodeErrorZ
7086 typedef union LDKCResult_RoutingFeesDecodeErrorZPtr {
7088 * A pointer to the contents in the success state.
7089 * Reading from this pointer when `result_ok` is not set is undefined.
7091 struct LDKRoutingFees *result;
7093 * A pointer to the contents in the error state.
7094 * Reading from this pointer when `result_ok` is set is undefined.
7096 struct LDKDecodeError *err;
7097 } LDKCResult_RoutingFeesDecodeErrorZPtr;
7100 * A CResult_RoutingFeesDecodeErrorZ represents the result of a fallible operation,
7101 * containing a crate::lightning::routing::gossip::RoutingFees on success and a crate::lightning::ln::msgs::DecodeError on failure.
7102 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7104 typedef struct LDKCResult_RoutingFeesDecodeErrorZ {
7106 * The contents of this CResult_RoutingFeesDecodeErrorZ, accessible via either
7107 * `err` or `result` depending on the state of `result_ok`.
7109 union LDKCResult_RoutingFeesDecodeErrorZPtr contents;
7111 * Whether this CResult_RoutingFeesDecodeErrorZ represents a success state.
7114 } LDKCResult_RoutingFeesDecodeErrorZ;
7117 * A 4-byte byte array.
7119 typedef struct LDKFourBytes {
7127 * A 12-byte byte array.
7129 typedef struct LDKTwelveBytes {
7139 * Represents a hostname for serialization purposes.
7140 * Only the character set and length will be validated.
7141 * The character set consists of ASCII alphanumeric characters, hyphens, and periods.
7142 * Its length is guaranteed to be representable by a single byte.
7143 * This serialization is used by [`BOLT 7`] hostnames.
7145 * [`BOLT 7`]: https://github.com/lightning/bolts/blob/master/07-routing-gossip.md
7147 typedef struct MUST_USE_STRUCT LDKHostname {
7149 * A pointer to the opaque Rust object.
7150 * Nearly everywhere, inner must be non-null, however in places where
7151 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7153 LDKnativeHostname *inner;
7155 * Indicates that this is the only struct which contains the same pointer.
7156 * Rust functions which take ownership of an object provided via an argument require
7157 * this to be true and invalidate the object pointed to by inner.
7163 * An address which can be used to connect to a remote peer.
7165 typedef enum LDKSocketAddress_Tag {
7167 * An IPv4 address and port on which the peer is listening.
7169 LDKSocketAddress_TcpIpV4,
7171 * An IPv6 address and port on which the peer is listening.
7173 LDKSocketAddress_TcpIpV6,
7175 * An old-style Tor onion address/port on which the peer is listening.
7177 * This field is deprecated and the Tor network generally no longer supports V2 Onion
7178 * addresses. Thus, the details are not parsed here.
7180 LDKSocketAddress_OnionV2,
7182 * A new-style Tor onion address/port on which the peer is listening.
7184 * To create the human-readable \"hostname\", concatenate the ED25519 pubkey, checksum, and version,
7185 * wrap as base32 and append \".onion\".
7187 LDKSocketAddress_OnionV3,
7189 * A hostname/port on which the peer is listening.
7191 LDKSocketAddress_Hostname,
7193 * Must be last for serialization purposes
7195 LDKSocketAddress_Sentinel,
7196 } LDKSocketAddress_Tag;
7198 typedef struct LDKSocketAddress_LDKTcpIpV4_Body {
7200 * The 4-byte IPv4 address
7202 struct LDKFourBytes addr;
7204 * The port on which the node is listening
7207 } LDKSocketAddress_LDKTcpIpV4_Body;
7209 typedef struct LDKSocketAddress_LDKTcpIpV6_Body {
7211 * The 16-byte IPv6 address
7213 struct LDKSixteenBytes addr;
7215 * The port on which the node is listening
7218 } LDKSocketAddress_LDKTcpIpV6_Body;
7220 typedef struct LDKSocketAddress_LDKOnionV3_Body {
7222 * The ed25519 long-term public key of the peer
7224 struct LDKThirtyTwoBytes ed25519_pubkey;
7226 * The checksum of the pubkey and version, as included in the onion address
7230 * The version byte, as defined by the Tor Onion v3 spec.
7234 * The port on which the node is listening
7237 } LDKSocketAddress_LDKOnionV3_Body;
7239 typedef struct LDKSocketAddress_LDKHostname_Body {
7241 * The hostname on which the node is listening.
7243 struct LDKHostname hostname;
7245 * The port on which the node is listening.
7248 } LDKSocketAddress_LDKHostname_Body;
7250 typedef struct MUST_USE_STRUCT LDKSocketAddress {
7251 LDKSocketAddress_Tag tag;
7253 LDKSocketAddress_LDKTcpIpV4_Body tcp_ip_v4;
7254 LDKSocketAddress_LDKTcpIpV6_Body tcp_ip_v6;
7256 struct LDKTwelveBytes onion_v2;
7258 LDKSocketAddress_LDKOnionV3_Body onion_v3;
7259 LDKSocketAddress_LDKHostname_Body hostname;
7264 * A dynamically-allocated array of crate::lightning::ln::msgs::SocketAddresss of arbitrary size.
7265 * This corresponds to std::vector in C++
7267 typedef struct LDKCVec_SocketAddressZ {
7269 * The elements in the array.
7270 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
7272 struct LDKSocketAddress *data;
7274 * The number of elements pointed to by `data`.
7277 } LDKCVec_SocketAddressZ;
7282 * Information received in the latest node_announcement from this node.
7284 typedef struct MUST_USE_STRUCT LDKNodeAnnouncementInfo {
7286 * A pointer to the opaque Rust object.
7287 * Nearly everywhere, inner must be non-null, however in places where
7288 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7290 LDKnativeNodeAnnouncementInfo *inner;
7292 * Indicates that this is the only struct which contains the same pointer.
7293 * Rust functions which take ownership of an object provided via an argument require
7294 * this to be true and invalidate the object pointed to by inner.
7297 } LDKNodeAnnouncementInfo;
7300 * The contents of CResult_NodeAnnouncementInfoDecodeErrorZ
7302 typedef union LDKCResult_NodeAnnouncementInfoDecodeErrorZPtr {
7304 * A pointer to the contents in the success state.
7305 * Reading from this pointer when `result_ok` is not set is undefined.
7307 struct LDKNodeAnnouncementInfo *result;
7309 * A pointer to the contents in the error state.
7310 * Reading from this pointer when `result_ok` is set is undefined.
7312 struct LDKDecodeError *err;
7313 } LDKCResult_NodeAnnouncementInfoDecodeErrorZPtr;
7316 * A CResult_NodeAnnouncementInfoDecodeErrorZ represents the result of a fallible operation,
7317 * containing a crate::lightning::routing::gossip::NodeAnnouncementInfo on success and a crate::lightning::ln::msgs::DecodeError on failure.
7318 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7320 typedef struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ {
7322 * The contents of this CResult_NodeAnnouncementInfoDecodeErrorZ, accessible via either
7323 * `err` or `result` depending on the state of `result_ok`.
7325 union LDKCResult_NodeAnnouncementInfoDecodeErrorZPtr contents;
7327 * Whether this CResult_NodeAnnouncementInfoDecodeErrorZ represents a success state.
7330 } LDKCResult_NodeAnnouncementInfoDecodeErrorZ;
7335 * A user-defined name for a node, which may be used when displaying the node in a graph.
7337 * Since node aliases are provided by third parties, they are a potential avenue for injection
7338 * attacks. Care must be taken when processing.
7340 typedef struct MUST_USE_STRUCT LDKNodeAlias {
7342 * A pointer to the opaque Rust object.
7343 * Nearly everywhere, inner must be non-null, however in places where
7344 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7346 LDKnativeNodeAlias *inner;
7348 * Indicates that this is the only struct which contains the same pointer.
7349 * Rust functions which take ownership of an object provided via an argument require
7350 * this to be true and invalidate the object pointed to by inner.
7356 * The contents of CResult_NodeAliasDecodeErrorZ
7358 typedef union LDKCResult_NodeAliasDecodeErrorZPtr {
7360 * A pointer to the contents in the success state.
7361 * Reading from this pointer when `result_ok` is not set is undefined.
7363 struct LDKNodeAlias *result;
7365 * A pointer to the contents in the error state.
7366 * Reading from this pointer when `result_ok` is set is undefined.
7368 struct LDKDecodeError *err;
7369 } LDKCResult_NodeAliasDecodeErrorZPtr;
7372 * A CResult_NodeAliasDecodeErrorZ represents the result of a fallible operation,
7373 * containing a crate::lightning::routing::gossip::NodeAlias on success and a crate::lightning::ln::msgs::DecodeError on failure.
7374 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7376 typedef struct LDKCResult_NodeAliasDecodeErrorZ {
7378 * The contents of this CResult_NodeAliasDecodeErrorZ, accessible via either
7379 * `err` or `result` depending on the state of `result_ok`.
7381 union LDKCResult_NodeAliasDecodeErrorZPtr contents;
7383 * Whether this CResult_NodeAliasDecodeErrorZ represents a success state.
7386 } LDKCResult_NodeAliasDecodeErrorZ;
7391 * Details about a node in the network, known from the network announcement.
7393 typedef struct MUST_USE_STRUCT LDKNodeInfo {
7395 * A pointer to the opaque Rust object.
7396 * Nearly everywhere, inner must be non-null, however in places where
7397 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7399 LDKnativeNodeInfo *inner;
7401 * Indicates that this is the only struct which contains the same pointer.
7402 * Rust functions which take ownership of an object provided via an argument require
7403 * this to be true and invalidate the object pointed to by inner.
7409 * The contents of CResult_NodeInfoDecodeErrorZ
7411 typedef union LDKCResult_NodeInfoDecodeErrorZPtr {
7413 * A pointer to the contents in the success state.
7414 * Reading from this pointer when `result_ok` is not set is undefined.
7416 struct LDKNodeInfo *result;
7418 * A pointer to the contents in the error state.
7419 * Reading from this pointer when `result_ok` is set is undefined.
7421 struct LDKDecodeError *err;
7422 } LDKCResult_NodeInfoDecodeErrorZPtr;
7425 * A CResult_NodeInfoDecodeErrorZ represents the result of a fallible operation,
7426 * containing a crate::lightning::routing::gossip::NodeInfo on success and a crate::lightning::ln::msgs::DecodeError on failure.
7427 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7429 typedef struct LDKCResult_NodeInfoDecodeErrorZ {
7431 * The contents of this CResult_NodeInfoDecodeErrorZ, accessible via either
7432 * `err` or `result` depending on the state of `result_ok`.
7434 union LDKCResult_NodeInfoDecodeErrorZPtr contents;
7436 * Whether this CResult_NodeInfoDecodeErrorZ represents a success state.
7439 } LDKCResult_NodeInfoDecodeErrorZ;
7442 * The contents of CResult_NetworkGraphDecodeErrorZ
7444 typedef union LDKCResult_NetworkGraphDecodeErrorZPtr {
7446 * A pointer to the contents in the success state.
7447 * Reading from this pointer when `result_ok` is not set is undefined.
7449 struct LDKNetworkGraph *result;
7451 * A pointer to the contents in the error state.
7452 * Reading from this pointer when `result_ok` is set is undefined.
7454 struct LDKDecodeError *err;
7455 } LDKCResult_NetworkGraphDecodeErrorZPtr;
7458 * A CResult_NetworkGraphDecodeErrorZ represents the result of a fallible operation,
7459 * containing a crate::lightning::routing::gossip::NetworkGraph on success and a crate::lightning::ln::msgs::DecodeError on failure.
7460 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7462 typedef struct LDKCResult_NetworkGraphDecodeErrorZ {
7464 * The contents of this CResult_NetworkGraphDecodeErrorZ, accessible via either
7465 * `err` or `result` depending on the state of `result_ok`.
7467 union LDKCResult_NetworkGraphDecodeErrorZPtr contents;
7469 * Whether this CResult_NetworkGraphDecodeErrorZ represents a success state.
7472 } LDKCResult_NetworkGraphDecodeErrorZ;
7475 * An enum which can either contain a crate::c_types::derived::CVec_SocketAddressZ or not
7477 typedef enum LDKCOption_CVec_SocketAddressZZ_Tag {
7479 * When we're in this state, this COption_CVec_SocketAddressZZ contains a crate::c_types::derived::CVec_SocketAddressZ
7481 LDKCOption_CVec_SocketAddressZZ_Some,
7483 * When we're in this state, this COption_CVec_SocketAddressZZ contains nothing
7485 LDKCOption_CVec_SocketAddressZZ_None,
7487 * Must be last for serialization purposes
7489 LDKCOption_CVec_SocketAddressZZ_Sentinel,
7490 } LDKCOption_CVec_SocketAddressZZ_Tag;
7492 typedef struct LDKCOption_CVec_SocketAddressZZ {
7493 LDKCOption_CVec_SocketAddressZZ_Tag tag;
7496 struct LDKCVec_SocketAddressZ some;
7499 } LDKCOption_CVec_SocketAddressZZ;
7504 * The parameters required to derive a channel signer via [`SignerProvider`].
7506 typedef struct MUST_USE_STRUCT LDKChannelDerivationParameters {
7508 * A pointer to the opaque Rust object.
7509 * Nearly everywhere, inner must be non-null, however in places where
7510 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7512 LDKnativeChannelDerivationParameters *inner;
7514 * Indicates that this is the only struct which contains the same pointer.
7515 * Rust functions which take ownership of an object provided via an argument require
7516 * this to be true and invalidate the object pointed to by inner.
7519 } LDKChannelDerivationParameters;
7522 * The contents of CResult_ChannelDerivationParametersDecodeErrorZ
7524 typedef union LDKCResult_ChannelDerivationParametersDecodeErrorZPtr {
7526 * A pointer to the contents in the success state.
7527 * Reading from this pointer when `result_ok` is not set is undefined.
7529 struct LDKChannelDerivationParameters *result;
7531 * A pointer to the contents in the error state.
7532 * Reading from this pointer when `result_ok` is set is undefined.
7534 struct LDKDecodeError *err;
7535 } LDKCResult_ChannelDerivationParametersDecodeErrorZPtr;
7538 * A CResult_ChannelDerivationParametersDecodeErrorZ represents the result of a fallible operation,
7539 * containing a crate::lightning::events::bump_transaction::ChannelDerivationParameters on success and a crate::lightning::ln::msgs::DecodeError on failure.
7540 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7542 typedef struct LDKCResult_ChannelDerivationParametersDecodeErrorZ {
7544 * The contents of this CResult_ChannelDerivationParametersDecodeErrorZ, accessible via either
7545 * `err` or `result` depending on the state of `result_ok`.
7547 union LDKCResult_ChannelDerivationParametersDecodeErrorZPtr contents;
7549 * Whether this CResult_ChannelDerivationParametersDecodeErrorZ represents a success state.
7552 } LDKCResult_ChannelDerivationParametersDecodeErrorZ;
7555 * The contents of CResult_HTLCDescriptorDecodeErrorZ
7557 typedef union LDKCResult_HTLCDescriptorDecodeErrorZPtr {
7559 * A pointer to the contents in the success state.
7560 * Reading from this pointer when `result_ok` is not set is undefined.
7562 struct LDKHTLCDescriptor *result;
7564 * A pointer to the contents in the error state.
7565 * Reading from this pointer when `result_ok` is set is undefined.
7567 struct LDKDecodeError *err;
7568 } LDKCResult_HTLCDescriptorDecodeErrorZPtr;
7571 * A CResult_HTLCDescriptorDecodeErrorZ represents the result of a fallible operation,
7572 * containing a crate::lightning::events::bump_transaction::HTLCDescriptor on success and a crate::lightning::ln::msgs::DecodeError on failure.
7573 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7575 typedef struct LDKCResult_HTLCDescriptorDecodeErrorZ {
7577 * The contents of this CResult_HTLCDescriptorDecodeErrorZ, accessible via either
7578 * `err` or `result` depending on the state of `result_ok`.
7580 union LDKCResult_HTLCDescriptorDecodeErrorZPtr contents;
7582 * Whether this CResult_HTLCDescriptorDecodeErrorZ represents a success state.
7585 } LDKCResult_HTLCDescriptorDecodeErrorZ;
7588 * A dynamically-allocated array of crate::lightning::ln::chan_utils::HTLCOutputInCommitments of arbitrary size.
7589 * This corresponds to std::vector in C++
7591 typedef struct LDKCVec_HTLCOutputInCommitmentZ {
7593 * The elements in the array.
7594 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
7596 struct LDKHTLCOutputInCommitment *data;
7598 * The number of elements pointed to by `data`.
7601 } LDKCVec_HTLCOutputInCommitmentZ;
7604 * A dynamically-allocated array of crate::lightning::events::bump_transaction::HTLCDescriptors of arbitrary size.
7605 * This corresponds to std::vector in C++
7607 typedef struct LDKCVec_HTLCDescriptorZ {
7609 * The elements in the array.
7610 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
7612 struct LDKHTLCDescriptor *data;
7614 * The number of elements pointed to by `data`.
7617 } LDKCVec_HTLCDescriptorZ;
7622 * An unspent transaction output that is available to spend resulting from a successful
7623 * [`CoinSelection`] attempt.
7625 typedef struct MUST_USE_STRUCT LDKUtxo {
7627 * A pointer to the opaque Rust object.
7628 * Nearly everywhere, inner must be non-null, however in places where
7629 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7631 LDKnativeUtxo *inner;
7633 * Indicates that this is the only struct which contains the same pointer.
7634 * Rust functions which take ownership of an object provided via an argument require
7635 * this to be true and invalidate the object pointed to by inner.
7641 * A dynamically-allocated array of crate::lightning::events::bump_transaction::Utxos of arbitrary size.
7642 * This corresponds to std::vector in C++
7644 typedef struct LDKCVec_UtxoZ {
7646 * The elements in the array.
7647 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
7649 struct LDKUtxo *data;
7651 * The number of elements pointed to by `data`.
7657 * An enum which can either contain a crate::c_types::TxOut or not
7659 typedef enum LDKCOption_TxOutZ_Tag {
7661 * When we're in this state, this COption_TxOutZ contains a crate::c_types::TxOut
7663 LDKCOption_TxOutZ_Some,
7665 * When we're in this state, this COption_TxOutZ contains nothing
7667 LDKCOption_TxOutZ_None,
7669 * Must be last for serialization purposes
7671 LDKCOption_TxOutZ_Sentinel,
7672 } LDKCOption_TxOutZ_Tag;
7674 typedef struct LDKCOption_TxOutZ {
7675 LDKCOption_TxOutZ_Tag tag;
7678 struct LDKTxOut some;
7681 } LDKCOption_TxOutZ;
7686 * An input that must be included in a transaction when performing coin selection through
7687 * [`CoinSelectionSource::select_confirmed_utxos`]. It is guaranteed to be a SegWit input, so it
7688 * must have an empty [`TxIn::script_sig`] when spent.
7690 typedef struct MUST_USE_STRUCT LDKInput {
7692 * A pointer to the opaque Rust object.
7693 * Nearly everywhere, inner must be non-null, however in places where
7694 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7696 LDKnativeInput *inner;
7698 * Indicates that this is the only struct which contains the same pointer.
7699 * Rust functions which take ownership of an object provided via an argument require
7700 * this to be true and invalidate the object pointed to by inner.
7706 * A dynamically-allocated array of crate::lightning::events::bump_transaction::Inputs of arbitrary size.
7707 * This corresponds to std::vector in C++
7709 typedef struct LDKCVec_InputZ {
7711 * The elements in the array.
7712 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
7714 struct LDKInput *data;
7716 * The number of elements pointed to by `data`.
7724 * The result of a successful coin selection attempt for a transaction requiring additional UTXOs
7725 * to cover its fees.
7727 typedef struct MUST_USE_STRUCT LDKCoinSelection {
7729 * A pointer to the opaque Rust object.
7730 * Nearly everywhere, inner must be non-null, however in places where
7731 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7733 LDKnativeCoinSelection *inner;
7735 * Indicates that this is the only struct which contains the same pointer.
7736 * Rust functions which take ownership of an object provided via an argument require
7737 * this to be true and invalidate the object pointed to by inner.
7743 * The contents of CResult_CoinSelectionNoneZ
7745 typedef union LDKCResult_CoinSelectionNoneZPtr {
7747 * A pointer to the contents in the success state.
7748 * Reading from this pointer when `result_ok` is not set is undefined.
7750 struct LDKCoinSelection *result;
7752 * Note that this value is always NULL, as there are no contents in the Err variant
7755 } LDKCResult_CoinSelectionNoneZPtr;
7758 * A CResult_CoinSelectionNoneZ represents the result of a fallible operation,
7759 * containing a crate::lightning::events::bump_transaction::CoinSelection on success and a () on failure.
7760 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7762 typedef struct LDKCResult_CoinSelectionNoneZ {
7764 * The contents of this CResult_CoinSelectionNoneZ, accessible via either
7765 * `err` or `result` depending on the state of `result_ok`.
7767 union LDKCResult_CoinSelectionNoneZPtr contents;
7769 * Whether this CResult_CoinSelectionNoneZ represents a success state.
7772 } LDKCResult_CoinSelectionNoneZ;
7775 * The contents of CResult_CVec_UtxoZNoneZ
7777 typedef union LDKCResult_CVec_UtxoZNoneZPtr {
7779 * A pointer to the contents in the success state.
7780 * Reading from this pointer when `result_ok` is not set is undefined.
7782 struct LDKCVec_UtxoZ *result;
7784 * Note that this value is always NULL, as there are no contents in the Err variant
7787 } LDKCResult_CVec_UtxoZNoneZPtr;
7790 * A CResult_CVec_UtxoZNoneZ represents the result of a fallible operation,
7791 * containing a crate::c_types::derived::CVec_UtxoZ on success and a () on failure.
7792 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7794 typedef struct LDKCResult_CVec_UtxoZNoneZ {
7796 * The contents of this CResult_CVec_UtxoZNoneZ, accessible via either
7797 * `err` or `result` depending on the state of `result_ok`.
7799 union LDKCResult_CVec_UtxoZNoneZPtr contents;
7801 * Whether this CResult_CVec_UtxoZNoneZ represents a success state.
7804 } LDKCResult_CVec_UtxoZNoneZ;
7807 * A tuple of 2 elements. See the individual fields for the types contained.
7809 typedef struct LDKC2Tuple_u64u16Z {
7811 * The element at position 0
7815 * The element at position 1
7818 } LDKC2Tuple_u64u16Z;
7821 * An enum which can either contain a crate::c_types::derived::C2Tuple_u64u16Z or not
7823 typedef enum LDKCOption_C2Tuple_u64u16ZZ_Tag {
7825 * When we're in this state, this COption_C2Tuple_u64u16ZZ contains a crate::c_types::derived::C2Tuple_u64u16Z
7827 LDKCOption_C2Tuple_u64u16ZZ_Some,
7829 * When we're in this state, this COption_C2Tuple_u64u16ZZ contains nothing
7831 LDKCOption_C2Tuple_u64u16ZZ_None,
7833 * Must be last for serialization purposes
7835 LDKCOption_C2Tuple_u64u16ZZ_Sentinel,
7836 } LDKCOption_C2Tuple_u64u16ZZ_Tag;
7838 typedef struct LDKCOption_C2Tuple_u64u16ZZ {
7839 LDKCOption_C2Tuple_u64u16ZZ_Tag tag;
7842 struct LDKC2Tuple_u64u16Z some;
7845 } LDKCOption_C2Tuple_u64u16ZZ;
7848 * An enum which can either contain a crate::lightning::ln::channelmanager::ChannelShutdownState or not
7850 typedef enum LDKCOption_ChannelShutdownStateZ_Tag {
7852 * When we're in this state, this COption_ChannelShutdownStateZ contains a crate::lightning::ln::channelmanager::ChannelShutdownState
7854 LDKCOption_ChannelShutdownStateZ_Some,
7856 * When we're in this state, this COption_ChannelShutdownStateZ contains nothing
7858 LDKCOption_ChannelShutdownStateZ_None,
7860 * Must be last for serialization purposes
7862 LDKCOption_ChannelShutdownStateZ_Sentinel,
7863 } LDKCOption_ChannelShutdownStateZ_Tag;
7865 typedef struct LDKCOption_ChannelShutdownStateZ {
7866 LDKCOption_ChannelShutdownStateZ_Tag tag;
7869 enum LDKChannelShutdownState some;
7872 } LDKCOption_ChannelShutdownStateZ;
7875 * The contents of CResult_ThirtyTwoBytesAPIErrorZ
7877 typedef union LDKCResult_ThirtyTwoBytesAPIErrorZPtr {
7879 * A pointer to the contents in the success state.
7880 * Reading from this pointer when `result_ok` is not set is undefined.
7882 struct LDKThirtyTwoBytes *result;
7884 * A pointer to the contents in the error state.
7885 * Reading from this pointer when `result_ok` is set is undefined.
7887 struct LDKAPIError *err;
7888 } LDKCResult_ThirtyTwoBytesAPIErrorZPtr;
7891 * A CResult_ThirtyTwoBytesAPIErrorZ represents the result of a fallible operation,
7892 * containing a crate::c_types::ThirtyTwoBytes on success and a crate::lightning::util::errors::APIError on failure.
7893 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7895 typedef struct LDKCResult_ThirtyTwoBytesAPIErrorZ {
7897 * The contents of this CResult_ThirtyTwoBytesAPIErrorZ, accessible via either
7898 * `err` or `result` depending on the state of `result_ok`.
7900 union LDKCResult_ThirtyTwoBytesAPIErrorZPtr contents;
7902 * Whether this CResult_ThirtyTwoBytesAPIErrorZ represents a success state.
7905 } LDKCResult_ThirtyTwoBytesAPIErrorZ;
7908 * Used by [`ChannelManager::list_recent_payments`] to express the status of recent payments.
7909 * These include payments that have yet to find a successful path, or have unresolved HTLCs.
7911 typedef enum LDKRecentPaymentDetails_Tag {
7913 * When an invoice was requested and thus a payment has not yet been sent.
7915 LDKRecentPaymentDetails_AwaitingInvoice,
7917 * When a payment is still being sent and awaiting successful delivery.
7919 LDKRecentPaymentDetails_Pending,
7921 * When a pending payment is fulfilled, we continue tracking it until all pending HTLCs have
7922 * been resolved. Upon receiving [`Event::PaymentSent`], we delay for a few minutes before the
7923 * payment is removed from tracking.
7925 LDKRecentPaymentDetails_Fulfilled,
7927 * After a payment's retries are exhausted per the provided [`Retry`], or it is explicitly
7928 * abandoned via [`ChannelManager::abandon_payment`], it is marked as abandoned until all
7929 * pending HTLCs for this payment resolve and an [`Event::PaymentFailed`] is generated.
7931 LDKRecentPaymentDetails_Abandoned,
7933 * Must be last for serialization purposes
7935 LDKRecentPaymentDetails_Sentinel,
7936 } LDKRecentPaymentDetails_Tag;
7938 typedef struct LDKRecentPaymentDetails_LDKAwaitingInvoice_Body {
7940 * A user-provided identifier in [`ChannelManager::send_payment`] used to uniquely identify
7941 * a payment and ensure idempotency in LDK.
7943 struct LDKThirtyTwoBytes payment_id;
7944 } LDKRecentPaymentDetails_LDKAwaitingInvoice_Body;
7946 typedef struct LDKRecentPaymentDetails_LDKPending_Body {
7948 * A user-provided identifier in [`ChannelManager::send_payment`] used to uniquely identify
7949 * a payment and ensure idempotency in LDK.
7951 struct LDKThirtyTwoBytes payment_id;
7953 * Hash of the payment that is currently being sent but has yet to be fulfilled or
7956 struct LDKThirtyTwoBytes payment_hash;
7958 * Total amount (in msat, excluding fees) across all paths for this payment,
7959 * not just the amount currently inflight.
7961 uint64_t total_msat;
7962 } LDKRecentPaymentDetails_LDKPending_Body;
7964 typedef struct LDKRecentPaymentDetails_LDKFulfilled_Body {
7966 * A user-provided identifier in [`ChannelManager::send_payment`] used to uniquely identify
7967 * a payment and ensure idempotency in LDK.
7969 struct LDKThirtyTwoBytes payment_id;
7971 * Hash of the payment that was claimed. `None` for serializations of [`ChannelManager`]
7972 * made before LDK version 0.0.104.
7974 struct LDKCOption_ThirtyTwoBytesZ payment_hash;
7975 } LDKRecentPaymentDetails_LDKFulfilled_Body;
7977 typedef struct LDKRecentPaymentDetails_LDKAbandoned_Body {
7979 * A user-provided identifier in [`ChannelManager::send_payment`] used to uniquely identify
7980 * a payment and ensure idempotency in LDK.
7982 struct LDKThirtyTwoBytes payment_id;
7984 * Hash of the payment that we have given up trying to send.
7986 struct LDKThirtyTwoBytes payment_hash;
7987 } LDKRecentPaymentDetails_LDKAbandoned_Body;
7989 typedef struct MUST_USE_STRUCT LDKRecentPaymentDetails {
7990 LDKRecentPaymentDetails_Tag tag;
7992 LDKRecentPaymentDetails_LDKAwaitingInvoice_Body awaiting_invoice;
7993 LDKRecentPaymentDetails_LDKPending_Body pending;
7994 LDKRecentPaymentDetails_LDKFulfilled_Body fulfilled;
7995 LDKRecentPaymentDetails_LDKAbandoned_Body abandoned;
7997 } LDKRecentPaymentDetails;
8000 * A dynamically-allocated array of crate::lightning::ln::channelmanager::RecentPaymentDetailss of arbitrary size.
8001 * This corresponds to std::vector in C++
8003 typedef struct LDKCVec_RecentPaymentDetailsZ {
8005 * The elements in the array.
8006 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
8008 struct LDKRecentPaymentDetails *data;
8010 * The number of elements pointed to by `data`.
8013 } LDKCVec_RecentPaymentDetailsZ;
8016 * If a payment fails to send with [`ChannelManager::send_payment_with_route`], it can be in one
8017 * of several states. This enum is returned as the Err() type describing which state the payment
8018 * is in, see the description of individual enum states for more.
8020 * [`ChannelManager::send_payment_with_route`]: crate::ln::channelmanager::ChannelManager::send_payment_with_route
8022 typedef enum LDKPaymentSendFailure_Tag {
8024 * A parameter which was passed to send_payment was invalid, preventing us from attempting to
8025 * send the payment at all.
8027 * You can freely resend the payment in full (with the parameter error fixed).
8029 * Because the payment failed outright, no payment tracking is done and no
8030 * [`Event::PaymentPathFailed`] or [`Event::PaymentFailed`] events will be generated.
8032 * [`Event::PaymentPathFailed`]: crate::events::Event::PaymentPathFailed
8033 * [`Event::PaymentFailed`]: crate::events::Event::PaymentFailed
8035 LDKPaymentSendFailure_ParameterError,
8037 * A parameter in a single path which was passed to send_payment was invalid, preventing us
8038 * from attempting to send the payment at all.
8040 * You can freely resend the payment in full (with the parameter error fixed).
8042 * Because the payment failed outright, no payment tracking is done and no
8043 * [`Event::PaymentPathFailed`] or [`Event::PaymentFailed`] events will be generated.
8045 * The results here are ordered the same as the paths in the route object which was passed to
8048 * [`Event::PaymentPathFailed`]: crate::events::Event::PaymentPathFailed
8049 * [`Event::PaymentFailed`]: crate::events::Event::PaymentFailed
8051 LDKPaymentSendFailure_PathParameterError,
8053 * All paths which were attempted failed to send, with no channel state change taking place.
8054 * You can freely resend the payment in full (though you probably want to do so over different
8055 * paths than the ones selected).
8057 * Because the payment failed outright, no payment tracking is done and no
8058 * [`Event::PaymentPathFailed`] or [`Event::PaymentFailed`] events will be generated.
8060 * [`Event::PaymentPathFailed`]: crate::events::Event::PaymentPathFailed
8061 * [`Event::PaymentFailed`]: crate::events::Event::PaymentFailed
8063 LDKPaymentSendFailure_AllFailedResendSafe,
8065 * Indicates that a payment for the provided [`PaymentId`] is already in-flight and has not
8066 * yet completed (i.e. generated an [`Event::PaymentSent`] or [`Event::PaymentFailed`]).
8068 * [`PaymentId`]: crate::ln::channelmanager::PaymentId
8069 * [`Event::PaymentSent`]: crate::events::Event::PaymentSent
8070 * [`Event::PaymentFailed`]: crate::events::Event::PaymentFailed
8072 LDKPaymentSendFailure_DuplicatePayment,
8074 * Some paths that were attempted failed to send, though some paths may have succeeded. At least
8075 * some paths have irrevocably committed to the HTLC.
8077 * The results here are ordered the same as the paths in the route object that was passed to
8080 * Any entries that contain `Err(APIError::MonitorUpdateInprogress)` will send once a
8081 * [`MonitorEvent::Completed`] is provided for the next-hop channel with the latest update_id.
8083 * [`MonitorEvent::Completed`]: crate::chain::channelmonitor::MonitorEvent::Completed
8085 LDKPaymentSendFailure_PartialFailure,
8087 * Must be last for serialization purposes
8089 LDKPaymentSendFailure_Sentinel,
8090 } LDKPaymentSendFailure_Tag;
8092 typedef struct LDKPaymentSendFailure_LDKPartialFailure_Body {
8094 * The errors themselves, in the same order as the paths from the route.
8096 struct LDKCVec_CResult_NoneAPIErrorZZ results;
8098 * If some paths failed without irrevocably committing to the new HTLC(s), this will
8099 * contain a [`RouteParameters`] object for the failing paths.
8101 * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
8103 struct LDKRouteParameters failed_paths_retry;
8105 * The payment id for the payment, which is now at least partially pending.
8107 struct LDKThirtyTwoBytes payment_id;
8108 } LDKPaymentSendFailure_LDKPartialFailure_Body;
8110 typedef struct MUST_USE_STRUCT LDKPaymentSendFailure {
8111 LDKPaymentSendFailure_Tag tag;
8114 struct LDKAPIError parameter_error;
8117 struct LDKCVec_CResult_NoneAPIErrorZZ path_parameter_error;
8120 struct LDKCVec_APIErrorZ all_failed_resend_safe;
8122 LDKPaymentSendFailure_LDKPartialFailure_Body partial_failure;
8124 } LDKPaymentSendFailure;
8127 * The contents of CResult_NonePaymentSendFailureZ
8129 typedef union LDKCResult_NonePaymentSendFailureZPtr {
8131 * Note that this value is always NULL, as there are no contents in the OK variant
8135 * A pointer to the contents in the error state.
8136 * Reading from this pointer when `result_ok` is set is undefined.
8138 struct LDKPaymentSendFailure *err;
8139 } LDKCResult_NonePaymentSendFailureZPtr;
8142 * A CResult_NonePaymentSendFailureZ represents the result of a fallible operation,
8143 * containing a () on success and a crate::lightning::ln::outbound_payment::PaymentSendFailure on failure.
8144 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8146 typedef struct LDKCResult_NonePaymentSendFailureZ {
8148 * The contents of this CResult_NonePaymentSendFailureZ, accessible via either
8149 * `err` or `result` depending on the state of `result_ok`.
8151 union LDKCResult_NonePaymentSendFailureZPtr contents;
8153 * Whether this CResult_NonePaymentSendFailureZ represents a success state.
8156 } LDKCResult_NonePaymentSendFailureZ;
8159 * The contents of CResult_NoneRetryableSendFailureZ
8161 typedef union LDKCResult_NoneRetryableSendFailureZPtr {
8163 * Note that this value is always NULL, as there are no contents in the OK variant
8167 * A pointer to the contents in the error state.
8168 * Reading from this pointer when `result_ok` is set is undefined.
8170 enum LDKRetryableSendFailure *err;
8171 } LDKCResult_NoneRetryableSendFailureZPtr;
8174 * A CResult_NoneRetryableSendFailureZ represents the result of a fallible operation,
8175 * containing a () on success and a crate::lightning::ln::outbound_payment::RetryableSendFailure on failure.
8176 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8178 typedef struct LDKCResult_NoneRetryableSendFailureZ {
8180 * The contents of this CResult_NoneRetryableSendFailureZ, accessible via either
8181 * `err` or `result` depending on the state of `result_ok`.
8183 union LDKCResult_NoneRetryableSendFailureZPtr contents;
8185 * Whether this CResult_NoneRetryableSendFailureZ represents a success state.
8188 } LDKCResult_NoneRetryableSendFailureZ;
8191 * The contents of CResult_ThirtyTwoBytesPaymentSendFailureZ
8193 typedef union LDKCResult_ThirtyTwoBytesPaymentSendFailureZPtr {
8195 * A pointer to the contents in the success state.
8196 * Reading from this pointer when `result_ok` is not set is undefined.
8198 struct LDKThirtyTwoBytes *result;
8200 * A pointer to the contents in the error state.
8201 * Reading from this pointer when `result_ok` is set is undefined.
8203 struct LDKPaymentSendFailure *err;
8204 } LDKCResult_ThirtyTwoBytesPaymentSendFailureZPtr;
8207 * A CResult_ThirtyTwoBytesPaymentSendFailureZ represents the result of a fallible operation,
8208 * containing a crate::c_types::ThirtyTwoBytes on success and a crate::lightning::ln::outbound_payment::PaymentSendFailure on failure.
8209 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8211 typedef struct LDKCResult_ThirtyTwoBytesPaymentSendFailureZ {
8213 * The contents of this CResult_ThirtyTwoBytesPaymentSendFailureZ, accessible via either
8214 * `err` or `result` depending on the state of `result_ok`.
8216 union LDKCResult_ThirtyTwoBytesPaymentSendFailureZPtr contents;
8218 * Whether this CResult_ThirtyTwoBytesPaymentSendFailureZ represents a success state.
8221 } LDKCResult_ThirtyTwoBytesPaymentSendFailureZ;
8224 * The contents of CResult_ThirtyTwoBytesRetryableSendFailureZ
8226 typedef union LDKCResult_ThirtyTwoBytesRetryableSendFailureZPtr {
8228 * A pointer to the contents in the success state.
8229 * Reading from this pointer when `result_ok` is not set is undefined.
8231 struct LDKThirtyTwoBytes *result;
8233 * A pointer to the contents in the error state.
8234 * Reading from this pointer when `result_ok` is set is undefined.
8236 enum LDKRetryableSendFailure *err;
8237 } LDKCResult_ThirtyTwoBytesRetryableSendFailureZPtr;
8240 * A CResult_ThirtyTwoBytesRetryableSendFailureZ represents the result of a fallible operation,
8241 * containing a crate::c_types::ThirtyTwoBytes on success and a crate::lightning::ln::outbound_payment::RetryableSendFailure on failure.
8242 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8244 typedef struct LDKCResult_ThirtyTwoBytesRetryableSendFailureZ {
8246 * The contents of this CResult_ThirtyTwoBytesRetryableSendFailureZ, accessible via either
8247 * `err` or `result` depending on the state of `result_ok`.
8249 union LDKCResult_ThirtyTwoBytesRetryableSendFailureZPtr contents;
8251 * Whether this CResult_ThirtyTwoBytesRetryableSendFailureZ represents a success state.
8254 } LDKCResult_ThirtyTwoBytesRetryableSendFailureZ;
8257 * A tuple of 2 elements. See the individual fields for the types contained.
8259 typedef struct LDKC2Tuple_ThirtyTwoBytesThirtyTwoBytesZ {
8261 * The element at position 0
8263 struct LDKThirtyTwoBytes a;
8265 * The element at position 1
8267 struct LDKThirtyTwoBytes b;
8268 } LDKC2Tuple_ThirtyTwoBytesThirtyTwoBytesZ;
8271 * The contents of CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ
8273 typedef union LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZPtr {
8275 * A pointer to the contents in the success state.
8276 * Reading from this pointer when `result_ok` is not set is undefined.
8278 struct LDKC2Tuple_ThirtyTwoBytesThirtyTwoBytesZ *result;
8280 * A pointer to the contents in the error state.
8281 * Reading from this pointer when `result_ok` is set is undefined.
8283 struct LDKPaymentSendFailure *err;
8284 } LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZPtr;
8287 * A CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ represents the result of a fallible operation,
8288 * containing a crate::c_types::derived::C2Tuple_ThirtyTwoBytesThirtyTwoBytesZ on success and a crate::lightning::ln::outbound_payment::PaymentSendFailure on failure.
8289 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8291 typedef struct LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ {
8293 * The contents of this CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ, accessible via either
8294 * `err` or `result` depending on the state of `result_ok`.
8296 union LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZPtr contents;
8298 * Whether this CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ represents a success state.
8301 } LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ;
8304 * A dynamically-allocated array of crate::c_types::derived::C2Tuple_ThirtyTwoBytesThirtyTwoBytesZs of arbitrary size.
8305 * This corresponds to std::vector in C++
8307 typedef struct LDKCVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZ {
8309 * The elements in the array.
8310 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
8312 struct LDKC2Tuple_ThirtyTwoBytesThirtyTwoBytesZ *data;
8314 * The number of elements pointed to by `data`.
8317 } LDKCVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZ;
8320 * Indicates that we failed to send a payment probe. Further errors may be surfaced later via
8321 * [`Event::ProbeFailed`].
8323 * [`Event::ProbeFailed`]: crate::events::Event::ProbeFailed
8325 typedef enum LDKProbeSendFailure_Tag {
8327 * We were unable to find a route to the destination.
8329 LDKProbeSendFailure_RouteNotFound,
8331 * We failed to send the payment probes.
8333 LDKProbeSendFailure_SendingFailed,
8335 * Must be last for serialization purposes
8337 LDKProbeSendFailure_Sentinel,
8338 } LDKProbeSendFailure_Tag;
8340 typedef struct MUST_USE_STRUCT LDKProbeSendFailure {
8341 LDKProbeSendFailure_Tag tag;
8344 struct LDKPaymentSendFailure sending_failed;
8347 } LDKProbeSendFailure;
8350 * The contents of CResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ
8352 typedef union LDKCResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZPtr {
8354 * A pointer to the contents in the success state.
8355 * Reading from this pointer when `result_ok` is not set is undefined.
8357 struct LDKCVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZ *result;
8359 * A pointer to the contents in the error state.
8360 * Reading from this pointer when `result_ok` is set is undefined.
8362 struct LDKProbeSendFailure *err;
8363 } LDKCResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZPtr;
8366 * A CResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ represents the result of a fallible operation,
8367 * containing a crate::c_types::derived::CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZ on success and a crate::lightning::ln::outbound_payment::ProbeSendFailure on failure.
8368 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8370 typedef struct LDKCResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ {
8372 * The contents of this CResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ, accessible via either
8373 * `err` or `result` depending on the state of `result_ok`.
8375 union LDKCResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZPtr contents;
8377 * Whether this CResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ represents a success state.
8380 } LDKCResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ;
8383 * A tuple of 2 elements. See the individual fields for the types contained.
8385 typedef struct LDKC2Tuple_ThirtyTwoBytesPublicKeyZ {
8387 * The element at position 0
8389 struct LDKThirtyTwoBytes a;
8391 * The element at position 1
8393 struct LDKPublicKey b;
8394 } LDKC2Tuple_ThirtyTwoBytesPublicKeyZ;
8397 * A dynamically-allocated array of crate::c_types::derived::C2Tuple_ThirtyTwoBytesPublicKeyZs of arbitrary size.
8398 * This corresponds to std::vector in C++
8400 typedef struct LDKCVec_C2Tuple_ThirtyTwoBytesPublicKeyZZ {
8402 * The elements in the array.
8403 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
8405 struct LDKC2Tuple_ThirtyTwoBytesPublicKeyZ *data;
8407 * The number of elements pointed to by `data`.
8410 } LDKCVec_C2Tuple_ThirtyTwoBytesPublicKeyZZ;
8413 * The contents of CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ
8415 typedef union LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZPtr {
8417 * A pointer to the contents in the success state.
8418 * Reading from this pointer when `result_ok` is not set is undefined.
8420 struct LDKC2Tuple_ThirtyTwoBytesThirtyTwoBytesZ *result;
8422 * Note that this value is always NULL, as there are no contents in the Err variant
8425 } LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZPtr;
8428 * A CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ represents the result of a fallible operation,
8429 * containing a crate::c_types::derived::C2Tuple_ThirtyTwoBytesThirtyTwoBytesZ on success and a () on failure.
8430 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8432 typedef struct LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ {
8434 * The contents of this CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ, accessible via either
8435 * `err` or `result` depending on the state of `result_ok`.
8437 union LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZPtr contents;
8439 * Whether this CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ represents a success state.
8442 } LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ;
8447 * Information needed for constructing an invoice route hint for this channel.
8449 typedef struct MUST_USE_STRUCT LDKCounterpartyForwardingInfo {
8451 * A pointer to the opaque Rust object.
8452 * Nearly everywhere, inner must be non-null, however in places where
8453 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8455 LDKnativeCounterpartyForwardingInfo *inner;
8457 * Indicates that this is the only struct which contains the same pointer.
8458 * Rust functions which take ownership of an object provided via an argument require
8459 * this to be true and invalidate the object pointed to by inner.
8462 } LDKCounterpartyForwardingInfo;
8465 * The contents of CResult_CounterpartyForwardingInfoDecodeErrorZ
8467 typedef union LDKCResult_CounterpartyForwardingInfoDecodeErrorZPtr {
8469 * A pointer to the contents in the success state.
8470 * Reading from this pointer when `result_ok` is not set is undefined.
8472 struct LDKCounterpartyForwardingInfo *result;
8474 * A pointer to the contents in the error state.
8475 * Reading from this pointer when `result_ok` is set is undefined.
8477 struct LDKDecodeError *err;
8478 } LDKCResult_CounterpartyForwardingInfoDecodeErrorZPtr;
8481 * A CResult_CounterpartyForwardingInfoDecodeErrorZ represents the result of a fallible operation,
8482 * containing a crate::lightning::ln::channelmanager::CounterpartyForwardingInfo on success and a crate::lightning::ln::msgs::DecodeError on failure.
8483 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8485 typedef struct LDKCResult_CounterpartyForwardingInfoDecodeErrorZ {
8487 * The contents of this CResult_CounterpartyForwardingInfoDecodeErrorZ, accessible via either
8488 * `err` or `result` depending on the state of `result_ok`.
8490 union LDKCResult_CounterpartyForwardingInfoDecodeErrorZPtr contents;
8492 * Whether this CResult_CounterpartyForwardingInfoDecodeErrorZ represents a success state.
8495 } LDKCResult_CounterpartyForwardingInfoDecodeErrorZ;
8500 * Channel parameters which apply to our counterparty. These are split out from [`ChannelDetails`]
8501 * to better separate parameters.
8503 typedef struct MUST_USE_STRUCT LDKChannelCounterparty {
8505 * A pointer to the opaque Rust object.
8506 * Nearly everywhere, inner must be non-null, however in places where
8507 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8509 LDKnativeChannelCounterparty *inner;
8511 * Indicates that this is the only struct which contains the same pointer.
8512 * Rust functions which take ownership of an object provided via an argument require
8513 * this to be true and invalidate the object pointed to by inner.
8516 } LDKChannelCounterparty;
8519 * The contents of CResult_ChannelCounterpartyDecodeErrorZ
8521 typedef union LDKCResult_ChannelCounterpartyDecodeErrorZPtr {
8523 * A pointer to the contents in the success state.
8524 * Reading from this pointer when `result_ok` is not set is undefined.
8526 struct LDKChannelCounterparty *result;
8528 * A pointer to the contents in the error state.
8529 * Reading from this pointer when `result_ok` is set is undefined.
8531 struct LDKDecodeError *err;
8532 } LDKCResult_ChannelCounterpartyDecodeErrorZPtr;
8535 * A CResult_ChannelCounterpartyDecodeErrorZ represents the result of a fallible operation,
8536 * containing a crate::lightning::ln::channelmanager::ChannelCounterparty on success and a crate::lightning::ln::msgs::DecodeError on failure.
8537 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8539 typedef struct LDKCResult_ChannelCounterpartyDecodeErrorZ {
8541 * The contents of this CResult_ChannelCounterpartyDecodeErrorZ, accessible via either
8542 * `err` or `result` depending on the state of `result_ok`.
8544 union LDKCResult_ChannelCounterpartyDecodeErrorZPtr contents;
8546 * Whether this CResult_ChannelCounterpartyDecodeErrorZ represents a success state.
8549 } LDKCResult_ChannelCounterpartyDecodeErrorZ;
8552 * The contents of CResult_ChannelDetailsDecodeErrorZ
8554 typedef union LDKCResult_ChannelDetailsDecodeErrorZPtr {
8556 * A pointer to the contents in the success state.
8557 * Reading from this pointer when `result_ok` is not set is undefined.
8559 struct LDKChannelDetails *result;
8561 * A pointer to the contents in the error state.
8562 * Reading from this pointer when `result_ok` is set is undefined.
8564 struct LDKDecodeError *err;
8565 } LDKCResult_ChannelDetailsDecodeErrorZPtr;
8568 * A CResult_ChannelDetailsDecodeErrorZ represents the result of a fallible operation,
8569 * containing a crate::lightning::ln::channelmanager::ChannelDetails on success and a crate::lightning::ln::msgs::DecodeError on failure.
8570 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8572 typedef struct LDKCResult_ChannelDetailsDecodeErrorZ {
8574 * The contents of this CResult_ChannelDetailsDecodeErrorZ, accessible via either
8575 * `err` or `result` depending on the state of `result_ok`.
8577 union LDKCResult_ChannelDetailsDecodeErrorZPtr contents;
8579 * Whether this CResult_ChannelDetailsDecodeErrorZ represents a success state.
8582 } LDKCResult_ChannelDetailsDecodeErrorZ;
8587 * Route hints used in constructing invoices for [phantom node payents].
8589 * [phantom node payments]: crate::sign::PhantomKeysManager
8591 typedef struct MUST_USE_STRUCT LDKPhantomRouteHints {
8593 * A pointer to the opaque Rust object.
8594 * Nearly everywhere, inner must be non-null, however in places where
8595 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8597 LDKnativePhantomRouteHints *inner;
8599 * Indicates that this is the only struct which contains the same pointer.
8600 * Rust functions which take ownership of an object provided via an argument require
8601 * this to be true and invalidate the object pointed to by inner.
8604 } LDKPhantomRouteHints;
8607 * The contents of CResult_PhantomRouteHintsDecodeErrorZ
8609 typedef union LDKCResult_PhantomRouteHintsDecodeErrorZPtr {
8611 * A pointer to the contents in the success state.
8612 * Reading from this pointer when `result_ok` is not set is undefined.
8614 struct LDKPhantomRouteHints *result;
8616 * A pointer to the contents in the error state.
8617 * Reading from this pointer when `result_ok` is set is undefined.
8619 struct LDKDecodeError *err;
8620 } LDKCResult_PhantomRouteHintsDecodeErrorZPtr;
8623 * A CResult_PhantomRouteHintsDecodeErrorZ represents the result of a fallible operation,
8624 * containing a crate::lightning::ln::channelmanager::PhantomRouteHints on success and a crate::lightning::ln::msgs::DecodeError on failure.
8625 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8627 typedef struct LDKCResult_PhantomRouteHintsDecodeErrorZ {
8629 * The contents of this CResult_PhantomRouteHintsDecodeErrorZ, accessible via either
8630 * `err` or `result` depending on the state of `result_ok`.
8632 union LDKCResult_PhantomRouteHintsDecodeErrorZPtr contents;
8634 * Whether this CResult_PhantomRouteHintsDecodeErrorZ represents a success state.
8637 } LDKCResult_PhantomRouteHintsDecodeErrorZ;
8640 * The contents of CResult_ChannelShutdownStateDecodeErrorZ
8642 typedef union LDKCResult_ChannelShutdownStateDecodeErrorZPtr {
8644 * A pointer to the contents in the success state.
8645 * Reading from this pointer when `result_ok` is not set is undefined.
8647 enum LDKChannelShutdownState *result;
8649 * A pointer to the contents in the error state.
8650 * Reading from this pointer when `result_ok` is set is undefined.
8652 struct LDKDecodeError *err;
8653 } LDKCResult_ChannelShutdownStateDecodeErrorZPtr;
8656 * A CResult_ChannelShutdownStateDecodeErrorZ represents the result of a fallible operation,
8657 * containing a crate::lightning::ln::channelmanager::ChannelShutdownState on success and a crate::lightning::ln::msgs::DecodeError on failure.
8658 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8660 typedef struct LDKCResult_ChannelShutdownStateDecodeErrorZ {
8662 * The contents of this CResult_ChannelShutdownStateDecodeErrorZ, accessible via either
8663 * `err` or `result` depending on the state of `result_ok`.
8665 union LDKCResult_ChannelShutdownStateDecodeErrorZPtr contents;
8667 * Whether this CResult_ChannelShutdownStateDecodeErrorZ represents a success state.
8670 } LDKCResult_ChannelShutdownStateDecodeErrorZ;
8675 * A ChannelMonitor handles chain events (blocks connected and disconnected) and generates
8676 * on-chain transactions to ensure no loss of funds occurs.
8678 * You MUST ensure that no ChannelMonitors for a given channel anywhere contain out-of-date
8679 * information and are actively monitoring the chain.
8681 * Note that the deserializer is only implemented for (BlockHash, ChannelMonitor), which
8682 * tells you the last block hash which was block_connect()ed. You MUST rescan any blocks along
8683 * the \"reorg path\" (ie disconnecting blocks until you find a common ancestor from both the
8684 * returned block hash and the the current chain and then reconnecting blocks to get to the
8685 * best chain) upon deserializing the object!
8687 typedef struct MUST_USE_STRUCT LDKChannelMonitor {
8689 * A pointer to the opaque Rust object.
8690 * Nearly everywhere, inner must be non-null, however in places where
8691 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8693 LDKnativeChannelMonitor *inner;
8695 * Indicates that this is the only struct which contains the same pointer.
8696 * Rust functions which take ownership of an object provided via an argument require
8697 * this to be true and invalidate the object pointed to by inner.
8700 } LDKChannelMonitor;
8703 * A dynamically-allocated array of crate::lightning::chain::channelmonitor::ChannelMonitors of arbitrary size.
8704 * This corresponds to std::vector in C++
8706 typedef struct LDKCVec_ChannelMonitorZ {
8708 * The elements in the array.
8709 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
8711 struct LDKChannelMonitor *data;
8713 * The number of elements pointed to by `data`.
8716 } LDKCVec_ChannelMonitorZ;
8721 * An update generated by the underlying channel itself which contains some new information the
8722 * [`ChannelMonitor`] should be made aware of.
8724 * Because this represents only a small number of updates to the underlying state, it is generally
8725 * much smaller than a full [`ChannelMonitor`]. However, for large single commitment transaction
8726 * updates (e.g. ones during which there are hundreds of HTLCs pending on the commitment
8727 * transaction), a single update may reach upwards of 1 MiB in serialized size.
8729 typedef struct MUST_USE_STRUCT LDKChannelMonitorUpdate {
8731 * A pointer to the opaque Rust object.
8732 * Nearly everywhere, inner must be non-null, however in places where
8733 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8735 LDKnativeChannelMonitorUpdate *inner;
8737 * Indicates that this is the only struct which contains the same pointer.
8738 * Rust functions which take ownership of an object provided via an argument require
8739 * this to be true and invalidate the object pointed to by inner.
8742 } LDKChannelMonitorUpdate;
8745 * The `Watch` trait defines behavior for watching on-chain activity pertaining to channels as
8746 * blocks are connected and disconnected.
8748 * Each channel is associated with a [`ChannelMonitor`]. Implementations of this trait are
8749 * responsible for maintaining a set of monitors such that they can be updated as channel state
8750 * changes. On each update, *all copies* of a [`ChannelMonitor`] must be updated and the update
8751 * persisted to disk to ensure that the latest [`ChannelMonitor`] state can be reloaded if the
8752 * application crashes.
8754 * See method documentation and [`ChannelMonitorUpdateStatus`] for specific requirements.
8756 typedef struct LDKWatch {
8758 * An opaque pointer which is passed to your function implementations as an argument.
8759 * This has no meaning in the LDK, and can be NULL or any other value.
8763 * Watches a channel identified by `funding_txo` using `monitor`.
8765 * Implementations are responsible for watching the chain for the funding transaction along
8766 * with any spends of outputs returned by [`get_outputs_to_watch`]. In practice, this means
8767 * calling [`block_connected`] and [`block_disconnected`] on the monitor.
8769 * A return of `Err(())` indicates that the channel should immediately be force-closed without
8770 * broadcasting the funding transaction.
8772 * If the given `funding_txo` has previously been registered via `watch_channel`, `Err(())`
8775 * [`get_outputs_to_watch`]: channelmonitor::ChannelMonitor::get_outputs_to_watch
8776 * [`block_connected`]: channelmonitor::ChannelMonitor::block_connected
8777 * [`block_disconnected`]: channelmonitor::ChannelMonitor::block_disconnected
8779 struct LDKCResult_ChannelMonitorUpdateStatusNoneZ (*watch_channel)(const void *this_arg, struct LDKOutPoint funding_txo, struct LDKChannelMonitor monitor);
8781 * Updates a channel identified by `funding_txo` by applying `update` to its monitor.
8783 * Implementations must call [`ChannelMonitor::update_monitor`] with the given update. This
8784 * may fail (returning an `Err(())`), in which case this should return
8785 * [`ChannelMonitorUpdateStatus::InProgress`] (and the update should never complete). This
8786 * generally implies the channel has been closed (either by the funding outpoint being spent
8787 * on-chain or the [`ChannelMonitor`] having decided to do so and broadcasted a transaction),
8788 * and the [`ChannelManager`] state will be updated once it sees the funding spend on-chain.
8790 * In general, persistence failures should be retried after returning
8791 * [`ChannelMonitorUpdateStatus::InProgress`] and eventually complete. If a failure truly
8792 * cannot be retried, the node should shut down immediately after returning
8793 * [`ChannelMonitorUpdateStatus::UnrecoverableError`], see its documentation for more info.
8795 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
8797 enum LDKChannelMonitorUpdateStatus (*update_channel)(const void *this_arg, struct LDKOutPoint funding_txo, const struct LDKChannelMonitorUpdate *NONNULL_PTR update);
8799 * Returns any monitor events since the last call. Subsequent calls must only return new
8802 * Note that after any block- or transaction-connection calls to a [`ChannelMonitor`], no
8803 * further events may be returned here until the [`ChannelMonitor`] has been fully persisted
8806 * For details on asynchronous [`ChannelMonitor`] updating and returning
8807 * [`MonitorEvent::Completed`] here, see [`ChannelMonitorUpdateStatus::InProgress`].
8809 struct LDKCVec_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZZ (*release_pending_monitor_events)(const void *this_arg);
8811 * Frees any resources associated with this object given its this_arg pointer.
8812 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
8814 void (*free)(void *this_arg);
8818 * A dynamically-allocated array of crate::c_types::Transactions of arbitrary size.
8819 * This corresponds to std::vector in C++
8821 typedef struct LDKCVec_TransactionZ {
8823 * The elements in the array.
8824 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
8826 struct LDKTransaction *data;
8828 * The number of elements pointed to by `data`.
8831 } LDKCVec_TransactionZ;
8834 * An interface to send a transaction to the Bitcoin network.
8836 typedef struct LDKBroadcasterInterface {
8838 * An opaque pointer which is passed to your function implementations as an argument.
8839 * This has no meaning in the LDK, and can be NULL or any other value.
8843 * Sends a list of transactions out to (hopefully) be mined.
8844 * This only needs to handle the actual broadcasting of transactions, LDK will automatically
8845 * rebroadcast transactions that haven't made it into a block.
8847 * In some cases LDK may attempt to broadcast a transaction which double-spends another
8848 * and this isn't a bug and can be safely ignored.
8850 * If more than one transaction is given, these transactions should be considered to be a
8851 * package and broadcast together. Some of the transactions may or may not depend on each other,
8852 * be sure to manage both cases correctly.
8854 * Bitcoin transaction packages are defined in BIP 331 and here:
8855 * https://github.com/bitcoin/bitcoin/blob/master/doc/policy/packages.md
8857 void (*broadcast_transactions)(const void *this_arg, struct LDKCVec_TransactionZ txs);
8859 * Frees any resources associated with this object given its this_arg pointer.
8860 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
8862 void (*free)(void *this_arg);
8863 } LDKBroadcasterInterface;
8866 * A trait that describes a source of entropy.
8868 typedef struct LDKEntropySource {
8870 * An opaque pointer which is passed to your function implementations as an argument.
8871 * This has no meaning in the LDK, and can be NULL or any other value.
8875 * Gets a unique, cryptographically-secure, random 32-byte value. This method must return a
8876 * different value each time it is called.
8878 struct LDKThirtyTwoBytes (*get_secure_random_bytes)(const void *this_arg);
8880 * Frees any resources associated with this object given its this_arg pointer.
8881 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
8883 void (*free)(void *this_arg);
8887 * A "slice" referencing some byte array. This is simply a length-tagged pointer which does not
8888 * own the memory pointed to by data.
8890 typedef struct LDKu8slice {
8892 * A pointer to the byte buffer
8894 const uint8_t *data;
8896 * The number of bytes pointed to by `data`.
8904 * A semantically valid [`InvoiceRequest`] that hasn't been signed.
8908 * This is serialized as a TLV stream, which includes TLV records from the originating message. As
8909 * such, it may include unknown, odd TLV records.
8911 typedef struct MUST_USE_STRUCT LDKUnsignedInvoiceRequest {
8913 * A pointer to the opaque Rust object.
8914 * Nearly everywhere, inner must be non-null, however in places where
8915 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8917 LDKnativeUnsignedInvoiceRequest *inner;
8919 * Indicates that this is the only struct which contains the same pointer.
8920 * Rust functions which take ownership of an object provided via an argument require
8921 * this to be true and invalidate the object pointed to by inner.
8924 } LDKUnsignedInvoiceRequest;
8929 * A semantically valid [`Bolt12Invoice`] that hasn't been signed.
8933 * This is serialized as a TLV stream, which includes TLV records from the originating message. As
8934 * such, it may include unknown, odd TLV records.
8936 typedef struct MUST_USE_STRUCT LDKUnsignedBolt12Invoice {
8938 * A pointer to the opaque Rust object.
8939 * Nearly everywhere, inner must be non-null, however in places where
8940 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8942 LDKnativeUnsignedBolt12Invoice *inner;
8944 * Indicates that this is the only struct which contains the same pointer.
8945 * Rust functions which take ownership of an object provided via an argument require
8946 * this to be true and invalidate the object pointed to by inner.
8949 } LDKUnsignedBolt12Invoice;
8954 * The unsigned part of a [`channel_update`] message.
8956 * [`channel_update`]: https://github.com/lightning/bolts/blob/master/07-routing-gossip.md#the-channel_update-message
8958 typedef struct MUST_USE_STRUCT LDKUnsignedChannelUpdate {
8960 * A pointer to the opaque Rust object.
8961 * Nearly everywhere, inner must be non-null, however in places where
8962 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8964 LDKnativeUnsignedChannelUpdate *inner;
8966 * Indicates that this is the only struct which contains the same pointer.
8967 * Rust functions which take ownership of an object provided via an argument require
8968 * this to be true and invalidate the object pointed to by inner.
8971 } LDKUnsignedChannelUpdate;
8976 * The unsigned part of a [`node_announcement`] message.
8978 * [`node_announcement`]: https://github.com/lightning/bolts/blob/master/07-routing-gossip.md#the-node_announcement-message
8980 typedef struct MUST_USE_STRUCT LDKUnsignedNodeAnnouncement {
8982 * A pointer to the opaque Rust object.
8983 * Nearly everywhere, inner must be non-null, however in places where
8984 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8986 LDKnativeUnsignedNodeAnnouncement *inner;
8988 * Indicates that this is the only struct which contains the same pointer.
8989 * Rust functions which take ownership of an object provided via an argument require
8990 * this to be true and invalidate the object pointed to by inner.
8993 } LDKUnsignedNodeAnnouncement;
8996 * Represents the set of gossip messages that require a signature from a node's identity key.
8998 typedef enum LDKUnsignedGossipMessage_Tag {
9000 * An unsigned channel announcement.
9002 LDKUnsignedGossipMessage_ChannelAnnouncement,
9004 * An unsigned channel update.
9006 LDKUnsignedGossipMessage_ChannelUpdate,
9008 * An unsigned node announcement.
9010 LDKUnsignedGossipMessage_NodeAnnouncement,
9012 * Must be last for serialization purposes
9014 LDKUnsignedGossipMessage_Sentinel,
9015 } LDKUnsignedGossipMessage_Tag;
9017 typedef struct MUST_USE_STRUCT LDKUnsignedGossipMessage {
9018 LDKUnsignedGossipMessage_Tag tag;
9021 struct LDKUnsignedChannelAnnouncement channel_announcement;
9024 struct LDKUnsignedChannelUpdate channel_update;
9027 struct LDKUnsignedNodeAnnouncement node_announcement;
9030 } LDKUnsignedGossipMessage;
9033 * A trait that can handle cryptographic operations at the scope level of a node.
9035 typedef struct LDKNodeSigner {
9037 * An opaque pointer which is passed to your function implementations as an argument.
9038 * This has no meaning in the LDK, and can be NULL or any other value.
9042 * Get secret key material as bytes for use in encrypting and decrypting inbound payment data.
9044 * If the implementor of this trait supports [phantom node payments], then every node that is
9045 * intended to be included in the phantom invoice route hints must return the same value from
9048 * This method must return the same value each time it is called.
9050 * [phantom node payments]: PhantomKeysManager
9052 struct LDKThirtyTwoBytes (*get_inbound_payment_key_material)(const void *this_arg);
9054 * Get node id based on the provided [`Recipient`].
9056 * This method must return the same value each time it is called with a given [`Recipient`]
9059 * Errors if the [`Recipient`] variant is not supported by the implementation.
9061 struct LDKCResult_PublicKeyNoneZ (*get_node_id)(const void *this_arg, enum LDKRecipient recipient);
9063 * Gets the ECDH shared secret of our node secret and `other_key`, multiplying by `tweak` if
9064 * one is provided. Note that this tweak can be applied to `other_key` instead of our node
9065 * secret, though this is less efficient.
9067 * Note that if this fails while attempting to forward an HTLC, LDK will panic. The error
9068 * should be resolved to allow LDK to resume forwarding HTLCs.
9070 * Errors if the [`Recipient`] variant is not supported by the implementation.
9072 struct LDKCResult_ThirtyTwoBytesNoneZ (*ecdh)(const void *this_arg, enum LDKRecipient recipient, struct LDKPublicKey other_key, struct LDKCOption_BigEndianScalarZ tweak);
9076 * By parameterizing by the raw invoice bytes instead of the hash, we allow implementors of
9077 * this trait to parse the invoice and make sure they're signing what they expect, rather than
9078 * blindly signing the hash.
9080 * The `hrp_bytes` are ASCII bytes, while the `invoice_data` is base32.
9082 * The secret key used to sign the invoice is dependent on the [`Recipient`].
9084 * Errors if the [`Recipient`] variant is not supported by the implementation.
9086 struct LDKCResult_RecoverableSignatureNoneZ (*sign_invoice)(const void *this_arg, struct LDKu8slice hrp_bytes, struct LDKCVec_U5Z invoice_data, enum LDKRecipient recipient);
9088 * Signs the [`TaggedHash`] of a BOLT 12 invoice request.
9090 * May be called by a function passed to [`UnsignedInvoiceRequest::sign`] where
9091 * `invoice_request` is the callee.
9093 * Implementors may check that the `invoice_request` is expected rather than blindly signing
9094 * the tagged hash. An `Ok` result should sign `invoice_request.tagged_hash().as_digest()` with
9095 * the node's signing key or an ephemeral key to preserve privacy, whichever is associated with
9096 * [`UnsignedInvoiceRequest::payer_id`].
9098 * [`TaggedHash`]: crate::offers::merkle::TaggedHash
9100 struct LDKCResult_SchnorrSignatureNoneZ (*sign_bolt12_invoice_request)(const void *this_arg, const struct LDKUnsignedInvoiceRequest *NONNULL_PTR invoice_request);
9102 * Signs the [`TaggedHash`] of a BOLT 12 invoice.
9104 * May be called by a function passed to [`UnsignedBolt12Invoice::sign`] where `invoice` is the
9107 * Implementors may check that the `invoice` is expected rather than blindly signing the tagged
9108 * hash. An `Ok` result should sign `invoice.tagged_hash().as_digest()` with the node's signing
9109 * key or an ephemeral key to preserve privacy, whichever is associated with
9110 * [`UnsignedBolt12Invoice::signing_pubkey`].
9112 * [`TaggedHash`]: crate::offers::merkle::TaggedHash
9114 struct LDKCResult_SchnorrSignatureNoneZ (*sign_bolt12_invoice)(const void *this_arg, const struct LDKUnsignedBolt12Invoice *NONNULL_PTR invoice);
9116 * Sign a gossip message.
9118 * Note that if this fails, LDK may panic and the message will not be broadcast to the network
9119 * or a possible channel counterparty. If LDK panics, the error should be resolved to allow the
9120 * message to be broadcast, as otherwise it may prevent one from receiving funds over the
9121 * corresponding channel.
9123 struct LDKCResult_ECDSASignatureNoneZ (*sign_gossip_message)(const void *this_arg, struct LDKUnsignedGossipMessage msg);
9125 * Frees any resources associated with this object given its this_arg pointer.
9126 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
9128 void (*free)(void *this_arg);
9132 * A trait that can return signer instances for individual channels.
9134 typedef struct LDKSignerProvider {
9136 * An opaque pointer which is passed to your function implementations as an argument.
9137 * This has no meaning in the LDK, and can be NULL or any other value.
9141 * Generates a unique `channel_keys_id` that can be used to obtain a [`Self::Signer`] through
9142 * [`SignerProvider::derive_channel_signer`]. The `user_channel_id` is provided to allow
9143 * implementations of [`SignerProvider`] to maintain a mapping between itself and the generated
9144 * `channel_keys_id`.
9146 * This method must return a different value each time it is called.
9148 struct LDKThirtyTwoBytes (*generate_channel_keys_id)(const void *this_arg, bool inbound, uint64_t channel_value_satoshis, struct LDKU128 user_channel_id);
9150 * Derives the private key material backing a `Signer`.
9152 * To derive a new `Signer`, a fresh `channel_keys_id` should be obtained through
9153 * [`SignerProvider::generate_channel_keys_id`]. Otherwise, an existing `Signer` can be
9154 * re-derived from its `channel_keys_id`, which can be obtained through its trait method
9155 * [`ChannelSigner::channel_keys_id`].
9157 struct LDKWriteableEcdsaChannelSigner (*derive_channel_signer)(const void *this_arg, uint64_t channel_value_satoshis, struct LDKThirtyTwoBytes channel_keys_id);
9159 * Reads a [`Signer`] for this [`SignerProvider`] from the given input stream.
9160 * This is only called during deserialization of other objects which contain
9161 * [`WriteableEcdsaChannelSigner`]-implementing objects (i.e., [`ChannelMonitor`]s and [`ChannelManager`]s).
9162 * The bytes are exactly those which `<Self::Signer as Writeable>::write()` writes, and
9163 * contain no versioning scheme. You may wish to include your own version prefix and ensure
9164 * you've read all of the provided bytes to ensure no corruption occurred.
9166 * This method is slowly being phased out -- it will only be called when reading objects
9167 * written by LDK versions prior to 0.0.113.
9169 * [`Signer`]: Self::Signer
9170 * [`ChannelMonitor`]: crate::chain::channelmonitor::ChannelMonitor
9171 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
9173 struct LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ (*read_chan_signer)(const void *this_arg, struct LDKu8slice reader);
9175 * Get a script pubkey which we send funds to when claiming on-chain contestable outputs.
9177 * If this function returns an error, this will result in a channel failing to open.
9179 * This method should return a different value each time it is called, to avoid linking
9180 * on-chain funds across channels as controlled to the same user.
9182 struct LDKCResult_CVec_u8ZNoneZ (*get_destination_script)(const void *this_arg);
9184 * Get a script pubkey which we will send funds to when closing a channel.
9186 * If this function returns an error, this will result in a channel failing to open or close.
9187 * In the event of a failure when the counterparty is initiating a close, this can result in a
9188 * channel force close.
9190 * This method should return a different value each time it is called, to avoid linking
9191 * on-chain funds across channels as controlled to the same user.
9193 struct LDKCResult_ShutdownScriptNoneZ (*get_shutdown_scriptpubkey)(const void *this_arg);
9195 * Frees any resources associated with this object given its this_arg pointer.
9196 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
9198 void (*free)(void *this_arg);
9199 } LDKSignerProvider;
9202 * A trait which should be implemented to provide feerate information on a number of time
9205 * If access to a local mempool is not feasible, feerate estimates should be fetched from a set of
9206 * third-parties hosting them. Note that this enables them to affect the propagation of your
9207 * pre-signed transactions at any time and therefore endangers the safety of channels funds. It
9208 * should be considered carefully as a deployment.
9210 * Note that all of the functions implemented here *must* be reentrant-safe (obviously - they're
9211 * called from inside the library in response to chain events, P2P events, or timer events).
9213 typedef struct LDKFeeEstimator {
9215 * An opaque pointer which is passed to your function implementations as an argument.
9216 * This has no meaning in the LDK, and can be NULL or any other value.
9220 * Gets estimated satoshis of fee required per 1000 Weight-Units.
9222 * LDK will wrap this method and ensure that the value returned is no smaller than 253
9223 * (ie 1 satoshi-per-byte rounded up to ensure later round-downs don't put us below 1 satoshi-per-byte).
9225 * The following unit conversions can be used to convert to sats/KW:
9226 * * satoshis-per-byte * 250
9227 * * satoshis-per-kbyte / 4
9229 uint32_t (*get_est_sat_per_1000_weight)(const void *this_arg, enum LDKConfirmationTarget confirmation_target);
9231 * Frees any resources associated with this object given its this_arg pointer.
9232 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
9234 void (*free)(void *this_arg);
9238 * A trait defining behavior for routing a payment.
9240 typedef struct LDKRouter {
9242 * An opaque pointer which is passed to your function implementations as an argument.
9243 * This has no meaning in the LDK, and can be NULL or any other value.
9247 * Finds a [`Route`] for a payment between the given `payer` and a payee.
9249 * The `payee` and the payment's value are given in [`RouteParameters::payment_params`]
9250 * and [`RouteParameters::final_value_msat`], respectively.
9252 * Note that first_hops (or a relevant inner pointer) may be NULL or all-0s to represent None
9254 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);
9256 * Finds a [`Route`] for a payment between the given `payer` and a payee.
9258 * The `payee` and the payment's value are given in [`RouteParameters::payment_params`]
9259 * and [`RouteParameters::final_value_msat`], respectively.
9261 * Includes a [`PaymentHash`] and a [`PaymentId`] to be able to correlate the request with a specific
9264 * Note that first_hops (or a relevant inner pointer) may be NULL or all-0s to represent None
9266 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);
9268 * Frees any resources associated with this object given its this_arg pointer.
9269 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
9271 void (*free)(void *this_arg);
9277 * Manager which keeps track of a number of channels and sends messages to the appropriate
9278 * channel, also tracking HTLC preimages and forwarding onion packets appropriately.
9280 * Implements [`ChannelMessageHandler`], handling the multi-channel parts and passing things through
9281 * to individual Channels.
9283 * Implements [`Writeable`] to write out all channel state to disk. Implies [`peer_disconnected`] for
9284 * all peers during write/read (though does not modify this instance, only the instance being
9285 * serialized). This will result in any channels which have not yet exchanged [`funding_created`] (i.e.,
9286 * called [`funding_transaction_generated`] for outbound channels) being closed.
9288 * Note that you can be a bit lazier about writing out `ChannelManager` than you can be with
9289 * [`ChannelMonitor`]. With [`ChannelMonitor`] you MUST durably write each
9290 * [`ChannelMonitorUpdate`] before returning from
9291 * [`chain::Watch::watch_channel`]/[`update_channel`] or before completing async writes. With
9292 * `ChannelManager`s, writing updates happens out-of-band (and will prevent any other
9293 * `ChannelManager` operations from occurring during the serialization process). If the
9294 * deserialized version is out-of-date compared to the [`ChannelMonitor`] passed by reference to
9295 * [`read`], those channels will be force-closed based on the `ChannelMonitor` state and no funds
9296 * will be lost (modulo on-chain transaction fees).
9298 * Note that the deserializer is only implemented for `(`[`BlockHash`]`, `[`ChannelManager`]`)`, which
9299 * tells you the last block hash which was connected. You should get the best block tip before using the manager.
9300 * See [`chain::Listen`] and [`chain::Confirm`] for more details.
9302 * Note that `ChannelManager` is responsible for tracking liveness of its channels and generating
9303 * [`ChannelUpdate`] messages informing peers that the channel is temporarily disabled. To avoid
9304 * spam due to quick disconnection/reconnection, updates are not sent until the channel has been
9305 * offline for a full minute. In order to track this, you must call
9306 * [`timer_tick_occurred`] roughly once per minute, though it doesn't have to be perfect.
9308 * To avoid trivial DoS issues, `ChannelManager` limits the number of inbound connections and
9309 * inbound channels without confirmed funding transactions. This may result in nodes which we do
9310 * not have a channel with being unable to connect to us or open new channels with us if we have
9311 * many peers with unfunded channels.
9313 * Because it is an indication of trust, inbound channels which we've accepted as 0conf are
9314 * exempted from the count of unfunded channels. Similarly, outbound channels and connections are
9315 * never limited. Please ensure you limit the count of such channels yourself.
9317 * Rather than using a plain `ChannelManager`, it is preferable to use either a [`SimpleArcChannelManager`]
9318 * a [`SimpleRefChannelManager`], for conciseness. See their documentation for more details, but
9319 * essentially you should default to using a [`SimpleRefChannelManager`], and use a
9320 * [`SimpleArcChannelManager`] when you require a `ChannelManager` with a static lifetime, such as when
9321 * you're using lightning-net-tokio.
9323 * [`peer_disconnected`]: msgs::ChannelMessageHandler::peer_disconnected
9324 * [`funding_created`]: msgs::FundingCreated
9325 * [`funding_transaction_generated`]: Self::funding_transaction_generated
9326 * [`BlockHash`]: bitcoin::hash_types::BlockHash
9327 * [`update_channel`]: chain::Watch::update_channel
9328 * [`ChannelUpdate`]: msgs::ChannelUpdate
9329 * [`timer_tick_occurred`]: Self::timer_tick_occurred
9330 * [`read`]: ReadableArgs::read
9332 typedef struct MUST_USE_STRUCT LDKChannelManager {
9334 * A pointer to the opaque Rust object.
9335 * Nearly everywhere, inner must be non-null, however in places where
9336 * the Rust equivalent takes an Option, it may be set to null to indicate None.
9338 LDKnativeChannelManager *inner;
9340 * Indicates that this is the only struct which contains the same pointer.
9341 * Rust functions which take ownership of an object provided via an argument require
9342 * this to be true and invalidate the object pointed to by inner.
9345 } LDKChannelManager;
9348 * A tuple of 2 elements. See the individual fields for the types contained.
9350 typedef struct LDKC2Tuple_ThirtyTwoBytesChannelManagerZ {
9352 * The element at position 0
9354 struct LDKThirtyTwoBytes a;
9356 * The element at position 1
9358 struct LDKChannelManager b;
9359 } LDKC2Tuple_ThirtyTwoBytesChannelManagerZ;
9362 * The contents of CResult_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ
9364 typedef union LDKCResult_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZPtr {
9366 * A pointer to the contents in the success state.
9367 * Reading from this pointer when `result_ok` is not set is undefined.
9369 struct LDKC2Tuple_ThirtyTwoBytesChannelManagerZ *result;
9371 * A pointer to the contents in the error state.
9372 * Reading from this pointer when `result_ok` is set is undefined.
9374 struct LDKDecodeError *err;
9375 } LDKCResult_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZPtr;
9378 * A CResult_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ represents the result of a fallible operation,
9379 * containing a crate::c_types::derived::C2Tuple_ThirtyTwoBytesChannelManagerZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
9380 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9382 typedef struct LDKCResult_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ {
9384 * The contents of this CResult_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ, accessible via either
9385 * `err` or `result` depending on the state of `result_ok`.
9387 union LDKCResult_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZPtr contents;
9389 * Whether this CResult_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ represents a success state.
9392 } LDKCResult_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ;
9395 * Options for how to set the max dust HTLC exposure allowed on a channel. See
9396 * [`ChannelConfig::max_dust_htlc_exposure`] for details.
9398 typedef enum LDKMaxDustHTLCExposure_Tag {
9400 * This sets a fixed limit on the total dust exposure in millisatoshis. Setting this too low
9401 * may prevent the sending or receipt of low-value HTLCs on high-traffic nodes, however this
9402 * limit is very important to prevent stealing of large amounts of dust HTLCs by miners
9403 * through [fee griefing
9404 * attacks](https://lists.linuxfoundation.org/pipermail/lightning-dev/2020-May/002714.html).
9406 * Note that if the feerate increases significantly, without a manual increase
9407 * to this maximum the channel may be unable to send/receive HTLCs between the maximum dust
9408 * exposure and the new minimum value for HTLCs to be economically viable to claim.
9410 LDKMaxDustHTLCExposure_FixedLimitMsat,
9412 * This sets a multiplier on the estimated high priority feerate (sats/KW, as obtained from
9413 * [`FeeEstimator`]) to determine the maximum allowed dust exposure. If this variant is used
9414 * then the maximum dust exposure in millisatoshis is calculated as:
9415 * `high_priority_feerate_per_kw * value`. For example, with our default value
9416 * `FeeRateMultiplier(5000)`:
9418 * - For the minimum fee rate of 1 sat/vByte (250 sat/KW, although the minimum
9419 * defaults to 253 sats/KW for rounding, see [`FeeEstimator`]), the max dust exposure would
9420 * be 253 * 5000 = 1,265,000 msats.
9421 * - For a fee rate of 30 sat/vByte (7500 sat/KW), the max dust exposure would be
9422 * 7500 * 5000 = 37,500,000 msats.
9424 * This allows the maximum dust exposure to automatically scale with fee rate changes.
9426 * Note, if you're using a third-party fee estimator, this may leave you more exposed to a
9427 * fee griefing attack, where your fee estimator may purposely overestimate the fee rate,
9428 * causing you to accept more dust HTLCs than you would otherwise.
9430 * This variant is primarily meant to serve pre-anchor channels, as HTLC fees being included
9431 * on HTLC outputs means your channel may be subject to more dust exposure in the event of
9432 * increases in fee rate.
9434 * # Backwards Compatibility
9435 * This variant only became available in LDK 0.0.116, so if you downgrade to a prior version
9436 * by default this will be set to a [`Self::FixedLimitMsat`] of 5,000,000 msat.
9438 * [`FeeEstimator`]: crate::chain::chaininterface::FeeEstimator
9440 LDKMaxDustHTLCExposure_FeeRateMultiplier,
9442 * Must be last for serialization purposes
9444 LDKMaxDustHTLCExposure_Sentinel,
9445 } LDKMaxDustHTLCExposure_Tag;
9447 typedef struct MUST_USE_STRUCT LDKMaxDustHTLCExposure {
9448 LDKMaxDustHTLCExposure_Tag tag;
9451 uint64_t fixed_limit_msat;
9454 uint64_t fee_rate_multiplier;
9457 } LDKMaxDustHTLCExposure;
9460 * The contents of CResult_MaxDustHTLCExposureDecodeErrorZ
9462 typedef union LDKCResult_MaxDustHTLCExposureDecodeErrorZPtr {
9464 * A pointer to the contents in the success state.
9465 * Reading from this pointer when `result_ok` is not set is undefined.
9467 struct LDKMaxDustHTLCExposure *result;
9469 * A pointer to the contents in the error state.
9470 * Reading from this pointer when `result_ok` is set is undefined.
9472 struct LDKDecodeError *err;
9473 } LDKCResult_MaxDustHTLCExposureDecodeErrorZPtr;
9476 * A CResult_MaxDustHTLCExposureDecodeErrorZ represents the result of a fallible operation,
9477 * containing a crate::lightning::util::config::MaxDustHTLCExposure on success and a crate::lightning::ln::msgs::DecodeError on failure.
9478 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9480 typedef struct LDKCResult_MaxDustHTLCExposureDecodeErrorZ {
9482 * The contents of this CResult_MaxDustHTLCExposureDecodeErrorZ, accessible via either
9483 * `err` or `result` depending on the state of `result_ok`.
9485 union LDKCResult_MaxDustHTLCExposureDecodeErrorZPtr contents;
9487 * Whether this CResult_MaxDustHTLCExposureDecodeErrorZ represents a success state.
9490 } LDKCResult_MaxDustHTLCExposureDecodeErrorZ;
9495 * Options which apply on a per-channel basis and may change at runtime or based on negotiation
9496 * with our counterparty.
9498 typedef struct MUST_USE_STRUCT LDKChannelConfig {
9500 * A pointer to the opaque Rust object.
9501 * Nearly everywhere, inner must be non-null, however in places where
9502 * the Rust equivalent takes an Option, it may be set to null to indicate None.
9504 LDKnativeChannelConfig *inner;
9506 * Indicates that this is the only struct which contains the same pointer.
9507 * Rust functions which take ownership of an object provided via an argument require
9508 * this to be true and invalidate the object pointed to by inner.
9514 * The contents of CResult_ChannelConfigDecodeErrorZ
9516 typedef union LDKCResult_ChannelConfigDecodeErrorZPtr {
9518 * A pointer to the contents in the success state.
9519 * Reading from this pointer when `result_ok` is not set is undefined.
9521 struct LDKChannelConfig *result;
9523 * A pointer to the contents in the error state.
9524 * Reading from this pointer when `result_ok` is set is undefined.
9526 struct LDKDecodeError *err;
9527 } LDKCResult_ChannelConfigDecodeErrorZPtr;
9530 * A CResult_ChannelConfigDecodeErrorZ represents the result of a fallible operation,
9531 * containing a crate::lightning::util::config::ChannelConfig on success and a crate::lightning::ln::msgs::DecodeError on failure.
9532 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9534 typedef struct LDKCResult_ChannelConfigDecodeErrorZ {
9536 * The contents of this CResult_ChannelConfigDecodeErrorZ, accessible via either
9537 * `err` or `result` depending on the state of `result_ok`.
9539 union LDKCResult_ChannelConfigDecodeErrorZPtr contents;
9541 * Whether this CResult_ChannelConfigDecodeErrorZ represents a success state.
9544 } LDKCResult_ChannelConfigDecodeErrorZ;
9547 * An enum which can either contain a crate::lightning::util::config::MaxDustHTLCExposure or not
9549 typedef enum LDKCOption_MaxDustHTLCExposureZ_Tag {
9551 * When we're in this state, this COption_MaxDustHTLCExposureZ contains a crate::lightning::util::config::MaxDustHTLCExposure
9553 LDKCOption_MaxDustHTLCExposureZ_Some,
9555 * When we're in this state, this COption_MaxDustHTLCExposureZ contains nothing
9557 LDKCOption_MaxDustHTLCExposureZ_None,
9559 * Must be last for serialization purposes
9561 LDKCOption_MaxDustHTLCExposureZ_Sentinel,
9562 } LDKCOption_MaxDustHTLCExposureZ_Tag;
9564 typedef struct LDKCOption_MaxDustHTLCExposureZ {
9565 LDKCOption_MaxDustHTLCExposureZ_Tag tag;
9568 struct LDKMaxDustHTLCExposure some;
9571 } LDKCOption_MaxDustHTLCExposureZ;
9574 * An enum which can either contain a crate::lightning::util::errors::APIError or not
9576 typedef enum LDKCOption_APIErrorZ_Tag {
9578 * When we're in this state, this COption_APIErrorZ contains a crate::lightning::util::errors::APIError
9580 LDKCOption_APIErrorZ_Some,
9582 * When we're in this state, this COption_APIErrorZ contains nothing
9584 LDKCOption_APIErrorZ_None,
9586 * Must be last for serialization purposes
9588 LDKCOption_APIErrorZ_Sentinel,
9589 } LDKCOption_APIErrorZ_Tag;
9591 typedef struct LDKCOption_APIErrorZ {
9592 LDKCOption_APIErrorZ_Tag tag;
9595 struct LDKAPIError some;
9598 } LDKCOption_APIErrorZ;
9601 * The contents of CResult_COption_APIErrorZDecodeErrorZ
9603 typedef union LDKCResult_COption_APIErrorZDecodeErrorZPtr {
9605 * A pointer to the contents in the success state.
9606 * Reading from this pointer when `result_ok` is not set is undefined.
9608 struct LDKCOption_APIErrorZ *result;
9610 * A pointer to the contents in the error state.
9611 * Reading from this pointer when `result_ok` is set is undefined.
9613 struct LDKDecodeError *err;
9614 } LDKCResult_COption_APIErrorZDecodeErrorZPtr;
9617 * A CResult_COption_APIErrorZDecodeErrorZ represents the result of a fallible operation,
9618 * containing a crate::c_types::derived::COption_APIErrorZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
9619 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9621 typedef struct LDKCResult_COption_APIErrorZDecodeErrorZ {
9623 * The contents of this CResult_COption_APIErrorZDecodeErrorZ, accessible via either
9624 * `err` or `result` depending on the state of `result_ok`.
9626 union LDKCResult_COption_APIErrorZDecodeErrorZPtr contents;
9628 * Whether this CResult_COption_APIErrorZDecodeErrorZ represents a success state.
9631 } LDKCResult_COption_APIErrorZDecodeErrorZ;
9634 * The contents of CResult_ChannelMonitorUpdateDecodeErrorZ
9636 typedef union LDKCResult_ChannelMonitorUpdateDecodeErrorZPtr {
9638 * A pointer to the contents in the success state.
9639 * Reading from this pointer when `result_ok` is not set is undefined.
9641 struct LDKChannelMonitorUpdate *result;
9643 * A pointer to the contents in the error state.
9644 * Reading from this pointer when `result_ok` is set is undefined.
9646 struct LDKDecodeError *err;
9647 } LDKCResult_ChannelMonitorUpdateDecodeErrorZPtr;
9650 * A CResult_ChannelMonitorUpdateDecodeErrorZ represents the result of a fallible operation,
9651 * containing a crate::lightning::chain::channelmonitor::ChannelMonitorUpdate on success and a crate::lightning::ln::msgs::DecodeError on failure.
9652 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9654 typedef struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ {
9656 * The contents of this CResult_ChannelMonitorUpdateDecodeErrorZ, accessible via either
9657 * `err` or `result` depending on the state of `result_ok`.
9659 union LDKCResult_ChannelMonitorUpdateDecodeErrorZPtr contents;
9661 * Whether this CResult_ChannelMonitorUpdateDecodeErrorZ represents a success state.
9664 } LDKCResult_ChannelMonitorUpdateDecodeErrorZ;
9667 * An enum which can either contain a crate::lightning::chain::channelmonitor::MonitorEvent or not
9669 typedef enum LDKCOption_MonitorEventZ_Tag {
9671 * When we're in this state, this COption_MonitorEventZ contains a crate::lightning::chain::channelmonitor::MonitorEvent
9673 LDKCOption_MonitorEventZ_Some,
9675 * When we're in this state, this COption_MonitorEventZ contains nothing
9677 LDKCOption_MonitorEventZ_None,
9679 * Must be last for serialization purposes
9681 LDKCOption_MonitorEventZ_Sentinel,
9682 } LDKCOption_MonitorEventZ_Tag;
9684 typedef struct LDKCOption_MonitorEventZ {
9685 LDKCOption_MonitorEventZ_Tag tag;
9688 struct LDKMonitorEvent some;
9691 } LDKCOption_MonitorEventZ;
9694 * The contents of CResult_COption_MonitorEventZDecodeErrorZ
9696 typedef union LDKCResult_COption_MonitorEventZDecodeErrorZPtr {
9698 * A pointer to the contents in the success state.
9699 * Reading from this pointer when `result_ok` is not set is undefined.
9701 struct LDKCOption_MonitorEventZ *result;
9703 * A pointer to the contents in the error state.
9704 * Reading from this pointer when `result_ok` is set is undefined.
9706 struct LDKDecodeError *err;
9707 } LDKCResult_COption_MonitorEventZDecodeErrorZPtr;
9710 * A CResult_COption_MonitorEventZDecodeErrorZ represents the result of a fallible operation,
9711 * containing a crate::c_types::derived::COption_MonitorEventZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
9712 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9714 typedef struct LDKCResult_COption_MonitorEventZDecodeErrorZ {
9716 * The contents of this CResult_COption_MonitorEventZDecodeErrorZ, accessible via either
9717 * `err` or `result` depending on the state of `result_ok`.
9719 union LDKCResult_COption_MonitorEventZDecodeErrorZPtr contents;
9721 * Whether this CResult_COption_MonitorEventZDecodeErrorZ represents a success state.
9724 } LDKCResult_COption_MonitorEventZDecodeErrorZ;
9727 * The contents of CResult_HTLCUpdateDecodeErrorZ
9729 typedef union LDKCResult_HTLCUpdateDecodeErrorZPtr {
9731 * A pointer to the contents in the success state.
9732 * Reading from this pointer when `result_ok` is not set is undefined.
9734 struct LDKHTLCUpdate *result;
9736 * A pointer to the contents in the error state.
9737 * Reading from this pointer when `result_ok` is set is undefined.
9739 struct LDKDecodeError *err;
9740 } LDKCResult_HTLCUpdateDecodeErrorZPtr;
9743 * A CResult_HTLCUpdateDecodeErrorZ represents the result of a fallible operation,
9744 * containing a crate::lightning::chain::channelmonitor::HTLCUpdate on success and a crate::lightning::ln::msgs::DecodeError on failure.
9745 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9747 typedef struct LDKCResult_HTLCUpdateDecodeErrorZ {
9749 * The contents of this CResult_HTLCUpdateDecodeErrorZ, accessible via either
9750 * `err` or `result` depending on the state of `result_ok`.
9752 union LDKCResult_HTLCUpdateDecodeErrorZPtr contents;
9754 * Whether this CResult_HTLCUpdateDecodeErrorZ represents a success state.
9757 } LDKCResult_HTLCUpdateDecodeErrorZ;
9760 * A tuple of 2 elements. See the individual fields for the types contained.
9762 typedef struct LDKC2Tuple_OutPointCVec_u8ZZ {
9764 * The element at position 0
9766 struct LDKOutPoint a;
9768 * The element at position 1
9770 struct LDKCVec_u8Z b;
9771 } LDKC2Tuple_OutPointCVec_u8ZZ;
9774 * A tuple of 2 elements. See the individual fields for the types contained.
9776 typedef struct LDKC2Tuple_u32CVec_u8ZZ {
9778 * The element at position 0
9782 * The element at position 1
9784 struct LDKCVec_u8Z b;
9785 } LDKC2Tuple_u32CVec_u8ZZ;
9788 * A dynamically-allocated array of crate::c_types::derived::C2Tuple_u32CVec_u8ZZs of arbitrary size.
9789 * This corresponds to std::vector in C++
9791 typedef struct LDKCVec_C2Tuple_u32CVec_u8ZZZ {
9793 * The elements in the array.
9794 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
9796 struct LDKC2Tuple_u32CVec_u8ZZ *data;
9798 * The number of elements pointed to by `data`.
9801 } LDKCVec_C2Tuple_u32CVec_u8ZZZ;
9804 * A tuple of 2 elements. See the individual fields for the types contained.
9806 typedef struct LDKC2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZ {
9808 * The element at position 0
9810 struct LDKThirtyTwoBytes a;
9812 * The element at position 1
9814 struct LDKCVec_C2Tuple_u32CVec_u8ZZZ b;
9815 } LDKC2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZ;
9818 * A dynamically-allocated array of crate::c_types::derived::C2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZs of arbitrary size.
9819 * This corresponds to std::vector in C++
9821 typedef struct LDKCVec_C2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZZ {
9823 * The elements in the array.
9824 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
9826 struct LDKC2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZ *data;
9828 * The number of elements pointed to by `data`.
9831 } LDKCVec_C2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZZ;
9834 * A dynamically-allocated array of crate::lightning::ln::chan_utils::CommitmentTransactions of arbitrary size.
9835 * This corresponds to std::vector in C++
9837 typedef struct LDKCVec_CommitmentTransactionZ {
9839 * The elements in the array.
9840 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
9842 struct LDKCommitmentTransaction *data;
9844 * The number of elements pointed to by `data`.
9847 } LDKCVec_CommitmentTransactionZ;
9850 * A tuple of 2 elements. See the individual fields for the types contained.
9852 typedef struct LDKC2Tuple_u32TxOutZ {
9854 * The element at position 0
9858 * The element at position 1
9861 } LDKC2Tuple_u32TxOutZ;
9864 * A dynamically-allocated array of crate::c_types::derived::C2Tuple_u32TxOutZs of arbitrary size.
9865 * This corresponds to std::vector in C++
9867 typedef struct LDKCVec_C2Tuple_u32TxOutZZ {
9869 * The elements in the array.
9870 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
9872 struct LDKC2Tuple_u32TxOutZ *data;
9874 * The number of elements pointed to by `data`.
9877 } LDKCVec_C2Tuple_u32TxOutZZ;
9880 * A tuple of 2 elements. See the individual fields for the types contained.
9882 typedef struct LDKC2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32TxOutZZZ {
9884 * The element at position 0
9886 struct LDKThirtyTwoBytes a;
9888 * The element at position 1
9890 struct LDKCVec_C2Tuple_u32TxOutZZ b;
9891 } LDKC2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32TxOutZZZ;
9894 * A dynamically-allocated array of crate::c_types::derived::C2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32TxOutZZZs of arbitrary size.
9895 * This corresponds to std::vector in C++
9897 typedef struct LDKCVec_TransactionOutputsZ {
9899 * The elements in the array.
9900 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
9902 struct LDKC2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32TxOutZZZ *data;
9904 * The number of elements pointed to by `data`.
9907 } LDKCVec_TransactionOutputsZ;
9910 * Details about the balance(s) available for spending once the channel appears on chain.
9912 * See [`ChannelMonitor::get_claimable_balances`] for more details on when these will or will not
9915 typedef enum LDKBalance_Tag {
9917 * The channel is not yet closed (or the commitment or closing transaction has not yet
9918 * appeared in a block). The given balance is claimable (less on-chain fees) if the channel is
9921 LDKBalance_ClaimableOnChannelClose,
9923 * The channel has been closed, and the given balance is ours but awaiting confirmations until
9924 * we consider it spendable.
9926 LDKBalance_ClaimableAwaitingConfirmations,
9928 * The channel has been closed, and the given balance should be ours but awaiting spending
9929 * transaction confirmation. If the spending transaction does not confirm in time, it is
9930 * possible our counterparty can take the funds by broadcasting an HTLC timeout on-chain.
9932 * Once the spending transaction confirms, before it has reached enough confirmations to be
9933 * considered safe from chain reorganizations, the balance will instead be provided via
9934 * [`Balance::ClaimableAwaitingConfirmations`].
9936 LDKBalance_ContentiousClaimable,
9938 * HTLCs which we sent to our counterparty which are claimable after a timeout (less on-chain
9939 * fees) if the counterparty does not know the preimage for the HTLCs. These are somewhat
9940 * likely to be claimed by our counterparty before we do.
9942 LDKBalance_MaybeTimeoutClaimableHTLC,
9944 * HTLCs which we received from our counterparty which are claimable with a preimage which we
9945 * do not currently have. This will only be claimable if we receive the preimage from the node
9946 * to which we forwarded this HTLC before the timeout.
9948 LDKBalance_MaybePreimageClaimableHTLC,
9950 * The channel has been closed, and our counterparty broadcasted a revoked commitment
9953 * Thus, we're able to claim all outputs in the commitment transaction, one of which has the
9956 LDKBalance_CounterpartyRevokedOutputClaimable,
9958 * Must be last for serialization purposes
9960 LDKBalance_Sentinel,
9963 typedef struct LDKBalance_LDKClaimableOnChannelClose_Body {
9965 * The amount available to claim, in satoshis, excluding the on-chain fees which will be
9966 * required to do so.
9968 uint64_t amount_satoshis;
9969 } LDKBalance_LDKClaimableOnChannelClose_Body;
9971 typedef struct LDKBalance_LDKClaimableAwaitingConfirmations_Body {
9973 * The amount available to claim, in satoshis, possibly excluding the on-chain fees which
9974 * were spent in broadcasting the transaction.
9976 uint64_t amount_satoshis;
9978 * The height at which an [`Event::SpendableOutputs`] event will be generated for this
9981 uint32_t confirmation_height;
9982 } LDKBalance_LDKClaimableAwaitingConfirmations_Body;
9984 typedef struct LDKBalance_LDKContentiousClaimable_Body {
9986 * The amount available to claim, in satoshis, excluding the on-chain fees which will be
9987 * required to do so.
9989 uint64_t amount_satoshis;
9991 * The height at which the counterparty may be able to claim the balance if we have not
9994 uint32_t timeout_height;
9996 * The payment hash that locks this HTLC.
9998 struct LDKThirtyTwoBytes payment_hash;
10000 * The preimage that can be used to claim this HTLC.
10002 struct LDKThirtyTwoBytes payment_preimage;
10003 } LDKBalance_LDKContentiousClaimable_Body;
10005 typedef struct LDKBalance_LDKMaybeTimeoutClaimableHTLC_Body {
10007 * The amount potentially available to claim, in satoshis, excluding the on-chain fees
10008 * which will be required to do so.
10010 uint64_t amount_satoshis;
10012 * The height at which we will be able to claim the balance if our counterparty has not
10015 uint32_t claimable_height;
10017 * The payment hash whose preimage our counterparty needs to claim this HTLC.
10019 struct LDKThirtyTwoBytes payment_hash;
10020 } LDKBalance_LDKMaybeTimeoutClaimableHTLC_Body;
10022 typedef struct LDKBalance_LDKMaybePreimageClaimableHTLC_Body {
10024 * The amount potentially available to claim, in satoshis, excluding the on-chain fees
10025 * which will be required to do so.
10027 uint64_t amount_satoshis;
10029 * The height at which our counterparty will be able to claim the balance if we have not
10030 * yet received the preimage and claimed it ourselves.
10032 uint32_t expiry_height;
10034 * The payment hash whose preimage we need to claim this HTLC.
10036 struct LDKThirtyTwoBytes payment_hash;
10037 } LDKBalance_LDKMaybePreimageClaimableHTLC_Body;
10039 typedef struct LDKBalance_LDKCounterpartyRevokedOutputClaimable_Body {
10041 * The amount, in satoshis, of the output which we can claim.
10043 * Note that for outputs from HTLC balances this may be excluding some on-chain fees that
10044 * were already spent.
10046 uint64_t amount_satoshis;
10047 } LDKBalance_LDKCounterpartyRevokedOutputClaimable_Body;
10049 typedef struct MUST_USE_STRUCT LDKBalance {
10050 LDKBalance_Tag tag;
10052 LDKBalance_LDKClaimableOnChannelClose_Body claimable_on_channel_close;
10053 LDKBalance_LDKClaimableAwaitingConfirmations_Body claimable_awaiting_confirmations;
10054 LDKBalance_LDKContentiousClaimable_Body contentious_claimable;
10055 LDKBalance_LDKMaybeTimeoutClaimableHTLC_Body maybe_timeout_claimable_htlc;
10056 LDKBalance_LDKMaybePreimageClaimableHTLC_Body maybe_preimage_claimable_htlc;
10057 LDKBalance_LDKCounterpartyRevokedOutputClaimable_Body counterparty_revoked_output_claimable;
10062 * A dynamically-allocated array of crate::lightning::chain::channelmonitor::Balances of arbitrary size.
10063 * This corresponds to std::vector in C++
10065 typedef struct LDKCVec_BalanceZ {
10067 * The elements in the array.
10068 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
10070 struct LDKBalance *data;
10072 * The number of elements pointed to by `data`.
10075 } LDKCVec_BalanceZ;
10078 * A tuple of 2 elements. See the individual fields for the types contained.
10080 typedef struct LDKC2Tuple_ThirtyTwoBytesChannelMonitorZ {
10082 * The element at position 0
10084 struct LDKThirtyTwoBytes a;
10086 * The element at position 1
10088 struct LDKChannelMonitor b;
10089 } LDKC2Tuple_ThirtyTwoBytesChannelMonitorZ;
10092 * The contents of CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ
10094 typedef union LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZPtr {
10096 * A pointer to the contents in the success state.
10097 * Reading from this pointer when `result_ok` is not set is undefined.
10099 struct LDKC2Tuple_ThirtyTwoBytesChannelMonitorZ *result;
10101 * A pointer to the contents in the error state.
10102 * Reading from this pointer when `result_ok` is set is undefined.
10104 struct LDKDecodeError *err;
10105 } LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZPtr;
10108 * A CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ represents the result of a fallible operation,
10109 * containing a crate::c_types::derived::C2Tuple_ThirtyTwoBytesChannelMonitorZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
10110 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10112 typedef struct LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ {
10114 * The contents of this CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ, accessible via either
10115 * `err` or `result` depending on the state of `result_ok`.
10117 union LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZPtr contents;
10119 * Whether this CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ represents a success state.
10122 } LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ;
10125 * Defines a type identifier for sending messages over the wire.
10127 * Messages implementing this trait specify a type and must be [`Writeable`].
10129 typedef struct LDKType {
10131 * An opaque pointer which is passed to your function implementations as an argument.
10132 * This has no meaning in the LDK, and can be NULL or any other value.
10136 * Returns the type identifying the message payload.
10138 uint16_t (*type_id)(const void *this_arg);
10140 * Return a human-readable "debug" string describing this object
10142 struct LDKStr (*debug_str)(const void *this_arg);
10144 * Serialize the object into a byte array
10146 struct LDKCVec_u8Z (*write)(const void *this_arg);
10148 * Called, if set, after this Type has been cloned into a duplicate object.
10149 * The new Type is provided, and should be mutated as needed to perform a
10150 * deep copy of the object pointed to by this_arg or avoid any double-freeing.
10152 void (*cloned)(struct LDKType *NONNULL_PTR new_Type);
10154 * Frees any resources associated with this object given its this_arg pointer.
10155 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
10157 void (*free)(void *this_arg);
10161 * A tuple of 2 elements. See the individual fields for the types contained.
10163 typedef struct LDKC2Tuple_PublicKeyTypeZ {
10165 * The element at position 0
10167 struct LDKPublicKey a;
10169 * The element at position 1
10172 } LDKC2Tuple_PublicKeyTypeZ;
10175 * A dynamically-allocated array of crate::c_types::derived::C2Tuple_PublicKeyTypeZs of arbitrary size.
10176 * This corresponds to std::vector in C++
10178 typedef struct LDKCVec_C2Tuple_PublicKeyTypeZZ {
10180 * The elements in the array.
10181 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
10183 struct LDKC2Tuple_PublicKeyTypeZ *data;
10185 * The number of elements pointed to by `data`.
10188 } LDKCVec_C2Tuple_PublicKeyTypeZZ;
10193 * An `InvoiceRequest` is a request for a [`Bolt12Invoice`] formulated from an [`Offer`].
10195 * An offer may provide choices such as quantity, amount, chain, features, etc. An invoice request
10196 * specifies these such that its recipient can send an invoice for payment.
10198 * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice
10199 * [`Offer`]: crate::offers::offer::Offer
10201 typedef struct MUST_USE_STRUCT LDKInvoiceRequest {
10203 * A pointer to the opaque Rust object.
10204 * Nearly everywhere, inner must be non-null, however in places where
10205 * the Rust equivalent takes an Option, it may be set to null to indicate None.
10207 LDKnativeInvoiceRequest *inner;
10209 * Indicates that this is the only struct which contains the same pointer.
10210 * Rust functions which take ownership of an object provided via an argument require
10211 * this to be true and invalidate the object pointed to by inner.
10214 } LDKInvoiceRequest;
10219 * A `Bolt12Invoice` is a payment request, typically corresponding to an [`Offer`] or a [`Refund`].
10221 * An invoice may be sent in response to an [`InvoiceRequest`] in the case of an offer or sent
10222 * directly after scanning a refund. It includes all the information needed to pay a recipient.
10224 * [`Offer`]: crate::offers::offer::Offer
10225 * [`Refund`]: crate::offers::refund::Refund
10226 * [`InvoiceRequest`]: crate::offers::invoice_request::InvoiceRequest
10228 typedef struct MUST_USE_STRUCT LDKBolt12Invoice {
10230 * A pointer to the opaque Rust object.
10231 * Nearly everywhere, inner must be non-null, however in places where
10232 * the Rust equivalent takes an Option, it may be set to null to indicate None.
10234 LDKnativeBolt12Invoice *inner;
10236 * Indicates that this is the only struct which contains the same pointer.
10237 * Rust functions which take ownership of an object provided via an argument require
10238 * this to be true and invalidate the object pointed to by inner.
10241 } LDKBolt12Invoice;
10246 * An error in response to an [`InvoiceRequest`] or an [`Bolt12Invoice`].
10248 * [`InvoiceRequest`]: crate::offers::invoice_request::InvoiceRequest
10249 * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice
10251 typedef struct MUST_USE_STRUCT LDKInvoiceError {
10253 * A pointer to the opaque Rust object.
10254 * Nearly everywhere, inner must be non-null, however in places where
10255 * the Rust equivalent takes an Option, it may be set to null to indicate None.
10257 LDKnativeInvoiceError *inner;
10259 * Indicates that this is the only struct which contains the same pointer.
10260 * Rust functions which take ownership of an object provided via an argument require
10261 * this to be true and invalidate the object pointed to by inner.
10267 * Possible BOLT 12 Offers messages sent and received via an [`OnionMessage`].
10269 * [`OnionMessage`]: crate::ln::msgs::OnionMessage
10271 typedef enum LDKOffersMessage_Tag {
10273 * A request for a [`Bolt12Invoice`] for a particular [`Offer`].
10275 * [`Offer`]: crate::offers::offer::Offer
10277 LDKOffersMessage_InvoiceRequest,
10279 * A [`Bolt12Invoice`] sent in response to an [`InvoiceRequest`] or a [`Refund`].
10281 * [`Refund`]: crate::offers::refund::Refund
10283 LDKOffersMessage_Invoice,
10285 * An error from handling an [`OffersMessage`].
10287 LDKOffersMessage_InvoiceError,
10289 * Must be last for serialization purposes
10291 LDKOffersMessage_Sentinel,
10292 } LDKOffersMessage_Tag;
10294 typedef struct MUST_USE_STRUCT LDKOffersMessage {
10295 LDKOffersMessage_Tag tag;
10298 struct LDKInvoiceRequest invoice_request;
10301 struct LDKBolt12Invoice invoice;
10304 struct LDKInvoiceError invoice_error;
10307 } LDKOffersMessage;
10310 * An enum which can either contain a crate::lightning::onion_message::offers::OffersMessage or not
10312 typedef enum LDKCOption_OffersMessageZ_Tag {
10314 * When we're in this state, this COption_OffersMessageZ contains a crate::lightning::onion_message::offers::OffersMessage
10316 LDKCOption_OffersMessageZ_Some,
10318 * When we're in this state, this COption_OffersMessageZ contains nothing
10320 LDKCOption_OffersMessageZ_None,
10322 * Must be last for serialization purposes
10324 LDKCOption_OffersMessageZ_Sentinel,
10325 } LDKCOption_OffersMessageZ_Tag;
10327 typedef struct LDKCOption_OffersMessageZ {
10328 LDKCOption_OffersMessageZ_Tag tag;
10331 struct LDKOffersMessage some;
10334 } LDKCOption_OffersMessageZ;
10337 * The contents of a custom onion message.
10339 typedef struct LDKCustomOnionMessageContents {
10341 * An opaque pointer which is passed to your function implementations as an argument.
10342 * This has no meaning in the LDK, and can be NULL or any other value.
10346 * Returns the TLV type identifying the message contents. MUST be >= 64.
10348 uint64_t (*tlv_type)(const void *this_arg);
10350 * Serialize the object into a byte array
10352 struct LDKCVec_u8Z (*write)(const void *this_arg);
10354 * Called, if set, after this CustomOnionMessageContents has been cloned into a duplicate object.
10355 * The new CustomOnionMessageContents is provided, and should be mutated as needed to perform a
10356 * deep copy of the object pointed to by this_arg or avoid any double-freeing.
10358 void (*cloned)(struct LDKCustomOnionMessageContents *NONNULL_PTR new_CustomOnionMessageContents);
10360 * Frees any resources associated with this object given its this_arg pointer.
10361 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
10363 void (*free)(void *this_arg);
10364 } LDKCustomOnionMessageContents;
10367 * An enum which can either contain a crate::lightning::onion_message::packet::CustomOnionMessageContents or not
10369 typedef enum LDKCOption_CustomOnionMessageContentsZ_Tag {
10371 * When we're in this state, this COption_CustomOnionMessageContentsZ contains a crate::lightning::onion_message::packet::CustomOnionMessageContents
10373 LDKCOption_CustomOnionMessageContentsZ_Some,
10375 * When we're in this state, this COption_CustomOnionMessageContentsZ contains nothing
10377 LDKCOption_CustomOnionMessageContentsZ_None,
10379 * Must be last for serialization purposes
10381 LDKCOption_CustomOnionMessageContentsZ_Sentinel,
10382 } LDKCOption_CustomOnionMessageContentsZ_Tag;
10384 typedef struct LDKCOption_CustomOnionMessageContentsZ {
10385 LDKCOption_CustomOnionMessageContentsZ_Tag tag;
10388 struct LDKCustomOnionMessageContents some;
10391 } LDKCOption_CustomOnionMessageContentsZ;
10394 * The contents of CResult_COption_CustomOnionMessageContentsZDecodeErrorZ
10396 typedef union LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZPtr {
10398 * A pointer to the contents in the success state.
10399 * Reading from this pointer when `result_ok` is not set is undefined.
10401 struct LDKCOption_CustomOnionMessageContentsZ *result;
10403 * A pointer to the contents in the error state.
10404 * Reading from this pointer when `result_ok` is set is undefined.
10406 struct LDKDecodeError *err;
10407 } LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZPtr;
10410 * A CResult_COption_CustomOnionMessageContentsZDecodeErrorZ represents the result of a fallible operation,
10411 * containing a crate::c_types::derived::COption_CustomOnionMessageContentsZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
10412 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10414 typedef struct LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ {
10416 * The contents of this CResult_COption_CustomOnionMessageContentsZDecodeErrorZ, accessible via either
10417 * `err` or `result` depending on the state of `result_ok`.
10419 union LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZPtr contents;
10421 * Whether this CResult_COption_CustomOnionMessageContentsZDecodeErrorZ represents a success state.
10424 } LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ;
10427 * An enum which can either contain a crate::lightning::ln::wire::Type or not
10429 typedef enum LDKCOption_TypeZ_Tag {
10431 * When we're in this state, this COption_TypeZ contains a crate::lightning::ln::wire::Type
10433 LDKCOption_TypeZ_Some,
10435 * When we're in this state, this COption_TypeZ contains nothing
10437 LDKCOption_TypeZ_None,
10439 * Must be last for serialization purposes
10441 LDKCOption_TypeZ_Sentinel,
10442 } LDKCOption_TypeZ_Tag;
10444 typedef struct LDKCOption_TypeZ {
10445 LDKCOption_TypeZ_Tag tag;
10448 struct LDKType some;
10451 } LDKCOption_TypeZ;
10454 * The contents of CResult_COption_TypeZDecodeErrorZ
10456 typedef union LDKCResult_COption_TypeZDecodeErrorZPtr {
10458 * A pointer to the contents in the success state.
10459 * Reading from this pointer when `result_ok` is not set is undefined.
10461 struct LDKCOption_TypeZ *result;
10463 * A pointer to the contents in the error state.
10464 * Reading from this pointer when `result_ok` is set is undefined.
10466 struct LDKDecodeError *err;
10467 } LDKCResult_COption_TypeZDecodeErrorZPtr;
10470 * A CResult_COption_TypeZDecodeErrorZ represents the result of a fallible operation,
10471 * containing a crate::c_types::derived::COption_TypeZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
10472 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10474 typedef struct LDKCResult_COption_TypeZDecodeErrorZ {
10476 * The contents of this CResult_COption_TypeZDecodeErrorZ, accessible via either
10477 * `err` or `result` depending on the state of `result_ok`.
10479 union LDKCResult_COption_TypeZDecodeErrorZPtr contents;
10481 * Whether this CResult_COption_TypeZDecodeErrorZ represents a success state.
10484 } LDKCResult_COption_TypeZDecodeErrorZ;
10487 * An enum which can either contain a crate::lightning::ln::msgs::SocketAddress or not
10489 typedef enum LDKCOption_SocketAddressZ_Tag {
10491 * When we're in this state, this COption_SocketAddressZ contains a crate::lightning::ln::msgs::SocketAddress
10493 LDKCOption_SocketAddressZ_Some,
10495 * When we're in this state, this COption_SocketAddressZ contains nothing
10497 LDKCOption_SocketAddressZ_None,
10499 * Must be last for serialization purposes
10501 LDKCOption_SocketAddressZ_Sentinel,
10502 } LDKCOption_SocketAddressZ_Tag;
10504 typedef struct LDKCOption_SocketAddressZ {
10505 LDKCOption_SocketAddressZ_Tag tag;
10508 struct LDKSocketAddress some;
10511 } LDKCOption_SocketAddressZ;
10514 * A tuple of 2 elements. See the individual fields for the types contained.
10516 typedef struct LDKC2Tuple_PublicKeyCOption_SocketAddressZZ {
10518 * The element at position 0
10520 struct LDKPublicKey a;
10522 * The element at position 1
10524 struct LDKCOption_SocketAddressZ b;
10525 } LDKC2Tuple_PublicKeyCOption_SocketAddressZZ;
10528 * A dynamically-allocated array of crate::c_types::derived::C2Tuple_PublicKeyCOption_SocketAddressZZs of arbitrary size.
10529 * This corresponds to std::vector in C++
10531 typedef struct LDKCVec_C2Tuple_PublicKeyCOption_SocketAddressZZZ {
10533 * The elements in the array.
10534 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
10536 struct LDKC2Tuple_PublicKeyCOption_SocketAddressZZ *data;
10538 * The number of elements pointed to by `data`.
10541 } LDKCVec_C2Tuple_PublicKeyCOption_SocketAddressZZZ;
10546 * Error for PeerManager errors. If you get one of these, you must disconnect the socket and
10547 * generate no further read_event/write_buffer_space_avail/socket_disconnected calls for the
10550 typedef struct MUST_USE_STRUCT LDKPeerHandleError {
10552 * A pointer to the opaque Rust object.
10553 * Nearly everywhere, inner must be non-null, however in places where
10554 * the Rust equivalent takes an Option, it may be set to null to indicate None.
10556 LDKnativePeerHandleError *inner;
10558 * Indicates that this is the only struct which contains the same pointer.
10559 * Rust functions which take ownership of an object provided via an argument require
10560 * this to be true and invalidate the object pointed to by inner.
10563 } LDKPeerHandleError;
10566 * The contents of CResult_CVec_u8ZPeerHandleErrorZ
10568 typedef union LDKCResult_CVec_u8ZPeerHandleErrorZPtr {
10570 * A pointer to the contents in the success state.
10571 * Reading from this pointer when `result_ok` is not set is undefined.
10573 struct LDKCVec_u8Z *result;
10575 * A pointer to the contents in the error state.
10576 * Reading from this pointer when `result_ok` is set is undefined.
10578 struct LDKPeerHandleError *err;
10579 } LDKCResult_CVec_u8ZPeerHandleErrorZPtr;
10582 * A CResult_CVec_u8ZPeerHandleErrorZ represents the result of a fallible operation,
10583 * containing a crate::c_types::derived::CVec_u8Z on success and a crate::lightning::ln::peer_handler::PeerHandleError on failure.
10584 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10586 typedef struct LDKCResult_CVec_u8ZPeerHandleErrorZ {
10588 * The contents of this CResult_CVec_u8ZPeerHandleErrorZ, accessible via either
10589 * `err` or `result` depending on the state of `result_ok`.
10591 union LDKCResult_CVec_u8ZPeerHandleErrorZPtr contents;
10593 * Whether this CResult_CVec_u8ZPeerHandleErrorZ represents a success state.
10596 } LDKCResult_CVec_u8ZPeerHandleErrorZ;
10599 * The contents of CResult_NonePeerHandleErrorZ
10601 typedef union LDKCResult_NonePeerHandleErrorZPtr {
10603 * Note that this value is always NULL, as there are no contents in the OK variant
10607 * A pointer to the contents in the error state.
10608 * Reading from this pointer when `result_ok` is set is undefined.
10610 struct LDKPeerHandleError *err;
10611 } LDKCResult_NonePeerHandleErrorZPtr;
10614 * A CResult_NonePeerHandleErrorZ represents the result of a fallible operation,
10615 * containing a () on success and a crate::lightning::ln::peer_handler::PeerHandleError on failure.
10616 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10618 typedef struct LDKCResult_NonePeerHandleErrorZ {
10620 * The contents of this CResult_NonePeerHandleErrorZ, accessible via either
10621 * `err` or `result` depending on the state of `result_ok`.
10623 union LDKCResult_NonePeerHandleErrorZPtr contents;
10625 * Whether this CResult_NonePeerHandleErrorZ represents a success state.
10628 } LDKCResult_NonePeerHandleErrorZ;
10631 * The contents of CResult_boolPeerHandleErrorZ
10633 typedef union LDKCResult_boolPeerHandleErrorZPtr {
10635 * A pointer to the contents in the success state.
10636 * Reading from this pointer when `result_ok` is not set is undefined.
10640 * A pointer to the contents in the error state.
10641 * Reading from this pointer when `result_ok` is set is undefined.
10643 struct LDKPeerHandleError *err;
10644 } LDKCResult_boolPeerHandleErrorZPtr;
10647 * A CResult_boolPeerHandleErrorZ represents the result of a fallible operation,
10648 * containing a bool on success and a crate::lightning::ln::peer_handler::PeerHandleError on failure.
10649 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10651 typedef struct LDKCResult_boolPeerHandleErrorZ {
10653 * The contents of this CResult_boolPeerHandleErrorZ, accessible via either
10654 * `err` or `result` depending on the state of `result_ok`.
10656 union LDKCResult_boolPeerHandleErrorZPtr contents;
10658 * Whether this CResult_boolPeerHandleErrorZ represents a success state.
10661 } LDKCResult_boolPeerHandleErrorZ;
10664 * All-encompassing standard error type that processing can return
10666 typedef enum LDKGraphSyncError_Tag {
10668 * Error trying to read the update data, typically due to an erroneous data length indication
10669 * that is greater than the actual amount of data provided
10671 LDKGraphSyncError_DecodeError,
10673 * Error applying the patch to the network graph, usually the result of updates that are too
10674 * old or missing prerequisite data to the application of updates out of order
10676 LDKGraphSyncError_LightningError,
10678 * Must be last for serialization purposes
10680 LDKGraphSyncError_Sentinel,
10681 } LDKGraphSyncError_Tag;
10683 typedef struct MUST_USE_STRUCT LDKGraphSyncError {
10684 LDKGraphSyncError_Tag tag;
10687 struct LDKDecodeError decode_error;
10690 struct LDKLightningError lightning_error;
10693 } LDKGraphSyncError;
10696 * The contents of CResult_u32GraphSyncErrorZ
10698 typedef union LDKCResult_u32GraphSyncErrorZPtr {
10700 * A pointer to the contents in the success state.
10701 * Reading from this pointer when `result_ok` is not set is undefined.
10705 * A pointer to the contents in the error state.
10706 * Reading from this pointer when `result_ok` is set is undefined.
10708 struct LDKGraphSyncError *err;
10709 } LDKCResult_u32GraphSyncErrorZPtr;
10712 * A CResult_u32GraphSyncErrorZ represents the result of a fallible operation,
10713 * containing a u32 on success and a crate::lightning_rapid_gossip_sync::error::GraphSyncError on failure.
10714 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10716 typedef struct LDKCResult_u32GraphSyncErrorZ {
10718 * The contents of this CResult_u32GraphSyncErrorZ, accessible via either
10719 * `err` or `result` depending on the state of `result_ok`.
10721 union LDKCResult_u32GraphSyncErrorZPtr contents;
10723 * Whether this CResult_u32GraphSyncErrorZ represents a success state.
10726 } LDKCResult_u32GraphSyncErrorZ;
10729 * The contents of CResult_CVec_u8ZIOErrorZ
10731 typedef union LDKCResult_CVec_u8ZIOErrorZPtr {
10733 * A pointer to the contents in the success state.
10734 * Reading from this pointer when `result_ok` is not set is undefined.
10736 struct LDKCVec_u8Z *result;
10738 * A pointer to the contents in the error state.
10739 * Reading from this pointer when `result_ok` is set is undefined.
10741 enum LDKIOError *err;
10742 } LDKCResult_CVec_u8ZIOErrorZPtr;
10745 * A CResult_CVec_u8ZIOErrorZ represents the result of a fallible operation,
10746 * containing a crate::c_types::derived::CVec_u8Z on success and a crate::c_types::IOError on failure.
10747 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10749 typedef struct LDKCResult_CVec_u8ZIOErrorZ {
10751 * The contents of this CResult_CVec_u8ZIOErrorZ, accessible via either
10752 * `err` or `result` depending on the state of `result_ok`.
10754 union LDKCResult_CVec_u8ZIOErrorZPtr contents;
10756 * Whether this CResult_CVec_u8ZIOErrorZ represents a success state.
10759 } LDKCResult_CVec_u8ZIOErrorZ;
10762 * A dynamically-allocated array of crate::c_types::Strs of arbitrary size.
10763 * This corresponds to std::vector in C++
10765 typedef struct LDKCVec_StrZ {
10767 * The elements in the array.
10768 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
10770 struct LDKStr *data;
10772 * The number of elements pointed to by `data`.
10778 * The contents of CResult_CVec_StrZIOErrorZ
10780 typedef union LDKCResult_CVec_StrZIOErrorZPtr {
10782 * A pointer to the contents in the success state.
10783 * Reading from this pointer when `result_ok` is not set is undefined.
10785 struct LDKCVec_StrZ *result;
10787 * A pointer to the contents in the error state.
10788 * Reading from this pointer when `result_ok` is set is undefined.
10790 enum LDKIOError *err;
10791 } LDKCResult_CVec_StrZIOErrorZPtr;
10794 * A CResult_CVec_StrZIOErrorZ represents the result of a fallible operation,
10795 * containing a crate::c_types::derived::CVec_StrZ on success and a crate::c_types::IOError on failure.
10796 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10798 typedef struct LDKCResult_CVec_StrZIOErrorZ {
10800 * The contents of this CResult_CVec_StrZIOErrorZ, accessible via either
10801 * `err` or `result` depending on the state of `result_ok`.
10803 union LDKCResult_CVec_StrZIOErrorZPtr contents;
10805 * Whether this CResult_CVec_StrZIOErrorZ represents a success state.
10808 } LDKCResult_CVec_StrZIOErrorZ;
10811 * A dynamically-allocated array of crate::c_types::derived::C2Tuple_ThirtyTwoBytesChannelMonitorZs of arbitrary size.
10812 * This corresponds to std::vector in C++
10814 typedef struct LDKCVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZ {
10816 * The elements in the array.
10817 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
10819 struct LDKC2Tuple_ThirtyTwoBytesChannelMonitorZ *data;
10821 * The number of elements pointed to by `data`.
10824 } LDKCVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZ;
10827 * The contents of CResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ
10829 typedef union LDKCResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZPtr {
10831 * A pointer to the contents in the success state.
10832 * Reading from this pointer when `result_ok` is not set is undefined.
10834 struct LDKCVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZ *result;
10836 * A pointer to the contents in the error state.
10837 * Reading from this pointer when `result_ok` is set is undefined.
10839 enum LDKIOError *err;
10840 } LDKCResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZPtr;
10843 * A CResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ represents the result of a fallible operation,
10844 * containing a crate::c_types::derived::CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZ on success and a crate::c_types::IOError on failure.
10845 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10847 typedef struct LDKCResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ {
10849 * The contents of this CResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ, accessible via either
10850 * `err` or `result` depending on the state of `result_ok`.
10852 union LDKCResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZPtr contents;
10854 * Whether this CResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ represents a success state.
10857 } LDKCResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ;
10860 * The contents of CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ
10862 typedef union LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZPtr {
10864 * A pointer to the contents in the success state.
10865 * Reading from this pointer when `result_ok` is not set is undefined.
10867 struct LDKC2Tuple_ThirtyTwoBytesChannelMonitorZ *result;
10869 * A pointer to the contents in the error state.
10870 * Reading from this pointer when `result_ok` is set is undefined.
10872 enum LDKIOError *err;
10873 } LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZPtr;
10876 * A CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ represents the result of a fallible operation,
10877 * containing a crate::c_types::derived::C2Tuple_ThirtyTwoBytesChannelMonitorZ on success and a crate::c_types::IOError on failure.
10878 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10880 typedef struct LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ {
10882 * The contents of this CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ, accessible via either
10883 * `err` or `result` depending on the state of `result_ok`.
10885 union LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZPtr contents;
10887 * Whether this CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ represents a success state.
10890 } LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ;
10893 * Represents a valid secp256k1 secret key serialized as a 32 byte array.
10895 typedef struct LDKSecretKey {
10897 * The bytes of the secret key
10903 * An enum which can either contain a crate::c_types::SecretKey or not
10905 typedef enum LDKCOption_SecretKeyZ_Tag {
10907 * When we're in this state, this COption_SecretKeyZ contains a crate::c_types::SecretKey
10909 LDKCOption_SecretKeyZ_Some,
10911 * When we're in this state, this COption_SecretKeyZ contains nothing
10913 LDKCOption_SecretKeyZ_None,
10915 * Must be last for serialization purposes
10917 LDKCOption_SecretKeyZ_Sentinel,
10918 } LDKCOption_SecretKeyZ_Tag;
10920 typedef struct LDKCOption_SecretKeyZ {
10921 LDKCOption_SecretKeyZ_Tag tag;
10924 struct LDKSecretKey some;
10927 } LDKCOption_SecretKeyZ;
10932 * An [`InvoiceRequest`] that has been verified by [`InvoiceRequest::verify`] and exposes different
10933 * ways to respond depending on whether the signing keys were derived.
10935 typedef struct MUST_USE_STRUCT LDKVerifiedInvoiceRequest {
10937 * A pointer to the opaque Rust object.
10938 * Nearly everywhere, inner must be non-null, however in places where
10939 * the Rust equivalent takes an Option, it may be set to null to indicate None.
10941 LDKnativeVerifiedInvoiceRequest *inner;
10943 * Indicates that this is the only struct which contains the same pointer.
10944 * Rust functions which take ownership of an object provided via an argument require
10945 * this to be true and invalidate the object pointed to by inner.
10948 } LDKVerifiedInvoiceRequest;
10951 * The contents of CResult_VerifiedInvoiceRequestNoneZ
10953 typedef union LDKCResult_VerifiedInvoiceRequestNoneZPtr {
10955 * A pointer to the contents in the success state.
10956 * Reading from this pointer when `result_ok` is not set is undefined.
10958 struct LDKVerifiedInvoiceRequest *result;
10960 * Note that this value is always NULL, as there are no contents in the Err variant
10963 } LDKCResult_VerifiedInvoiceRequestNoneZPtr;
10966 * A CResult_VerifiedInvoiceRequestNoneZ represents the result of a fallible operation,
10967 * containing a crate::lightning::offers::invoice_request::VerifiedInvoiceRequest on success and a () on failure.
10968 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10970 typedef struct LDKCResult_VerifiedInvoiceRequestNoneZ {
10972 * The contents of this CResult_VerifiedInvoiceRequestNoneZ, accessible via either
10973 * `err` or `result` depending on the state of `result_ok`.
10975 union LDKCResult_VerifiedInvoiceRequestNoneZPtr contents;
10977 * Whether this CResult_VerifiedInvoiceRequestNoneZ represents a success state.
10980 } LDKCResult_VerifiedInvoiceRequestNoneZ;
10983 * A dynamically-allocated array of crate::c_types::Witnesss of arbitrary size.
10984 * This corresponds to std::vector in C++
10986 typedef struct LDKCVec_WitnessZ {
10988 * The elements in the array.
10989 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
10991 struct LDKWitness *data;
10993 * The number of elements pointed to by `data`.
10996 } LDKCVec_WitnessZ;
10999 * An enum which can either contain a i64 or not
11001 typedef enum LDKCOption_i64Z_Tag {
11003 * When we're in this state, this COption_i64Z contains a i64
11005 LDKCOption_i64Z_Some,
11007 * When we're in this state, this COption_i64Z contains nothing
11009 LDKCOption_i64Z_None,
11011 * Must be last for serialization purposes
11013 LDKCOption_i64Z_Sentinel,
11014 } LDKCOption_i64Z_Tag;
11016 typedef struct LDKCOption_i64Z {
11017 LDKCOption_i64Z_Tag tag;
11026 * The contents of CResult_SocketAddressDecodeErrorZ
11028 typedef union LDKCResult_SocketAddressDecodeErrorZPtr {
11030 * A pointer to the contents in the success state.
11031 * Reading from this pointer when `result_ok` is not set is undefined.
11033 struct LDKSocketAddress *result;
11035 * A pointer to the contents in the error state.
11036 * Reading from this pointer when `result_ok` is set is undefined.
11038 struct LDKDecodeError *err;
11039 } LDKCResult_SocketAddressDecodeErrorZPtr;
11042 * A CResult_SocketAddressDecodeErrorZ represents the result of a fallible operation,
11043 * containing a crate::lightning::ln::msgs::SocketAddress on success and a crate::lightning::ln::msgs::DecodeError on failure.
11044 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
11046 typedef struct LDKCResult_SocketAddressDecodeErrorZ {
11048 * The contents of this CResult_SocketAddressDecodeErrorZ, accessible via either
11049 * `err` or `result` depending on the state of `result_ok`.
11051 union LDKCResult_SocketAddressDecodeErrorZPtr contents;
11053 * Whether this CResult_SocketAddressDecodeErrorZ represents a success state.
11056 } LDKCResult_SocketAddressDecodeErrorZ;
11059 * The contents of CResult_SocketAddressSocketAddressParseErrorZ
11061 typedef union LDKCResult_SocketAddressSocketAddressParseErrorZPtr {
11063 * A pointer to the contents in the success state.
11064 * Reading from this pointer when `result_ok` is not set is undefined.
11066 struct LDKSocketAddress *result;
11068 * A pointer to the contents in the error state.
11069 * Reading from this pointer when `result_ok` is set is undefined.
11071 enum LDKSocketAddressParseError *err;
11072 } LDKCResult_SocketAddressSocketAddressParseErrorZPtr;
11075 * A CResult_SocketAddressSocketAddressParseErrorZ represents the result of a fallible operation,
11076 * containing a crate::lightning::ln::msgs::SocketAddress on success and a crate::lightning::ln::msgs::SocketAddressParseError on failure.
11077 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
11079 typedef struct LDKCResult_SocketAddressSocketAddressParseErrorZ {
11081 * The contents of this CResult_SocketAddressSocketAddressParseErrorZ, accessible via either
11082 * `err` or `result` depending on the state of `result_ok`.
11084 union LDKCResult_SocketAddressSocketAddressParseErrorZPtr contents;
11086 * Whether this CResult_SocketAddressSocketAddressParseErrorZ represents a success state.
11089 } LDKCResult_SocketAddressSocketAddressParseErrorZ;
11094 * An [`update_add_htlc`] message to be sent to or received from a peer.
11096 * [`update_add_htlc`]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md#adding-an-htlc-update_add_htlc
11098 typedef struct MUST_USE_STRUCT LDKUpdateAddHTLC {
11100 * A pointer to the opaque Rust object.
11101 * Nearly everywhere, inner must be non-null, however in places where
11102 * the Rust equivalent takes an Option, it may be set to null to indicate None.
11104 LDKnativeUpdateAddHTLC *inner;
11106 * Indicates that this is the only struct which contains the same pointer.
11107 * Rust functions which take ownership of an object provided via an argument require
11108 * this to be true and invalidate the object pointed to by inner.
11111 } LDKUpdateAddHTLC;
11114 * A dynamically-allocated array of crate::lightning::ln::msgs::UpdateAddHTLCs of arbitrary size.
11115 * This corresponds to std::vector in C++
11117 typedef struct LDKCVec_UpdateAddHTLCZ {
11119 * The elements in the array.
11120 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
11122 struct LDKUpdateAddHTLC *data;
11124 * The number of elements pointed to by `data`.
11127 } LDKCVec_UpdateAddHTLCZ;
11132 * An [`update_fulfill_htlc`] message to be sent to or received from a peer.
11134 * [`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
11136 typedef struct MUST_USE_STRUCT LDKUpdateFulfillHTLC {
11138 * A pointer to the opaque Rust object.
11139 * Nearly everywhere, inner must be non-null, however in places where
11140 * the Rust equivalent takes an Option, it may be set to null to indicate None.
11142 LDKnativeUpdateFulfillHTLC *inner;
11144 * Indicates that this is the only struct which contains the same pointer.
11145 * Rust functions which take ownership of an object provided via an argument require
11146 * this to be true and invalidate the object pointed to by inner.
11149 } LDKUpdateFulfillHTLC;
11152 * A dynamically-allocated array of crate::lightning::ln::msgs::UpdateFulfillHTLCs of arbitrary size.
11153 * This corresponds to std::vector in C++
11155 typedef struct LDKCVec_UpdateFulfillHTLCZ {
11157 * The elements in the array.
11158 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
11160 struct LDKUpdateFulfillHTLC *data;
11162 * The number of elements pointed to by `data`.
11165 } LDKCVec_UpdateFulfillHTLCZ;
11170 * An [`update_fail_htlc`] message to be sent to or received from a peer.
11172 * [`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
11174 typedef struct MUST_USE_STRUCT LDKUpdateFailHTLC {
11176 * A pointer to the opaque Rust object.
11177 * Nearly everywhere, inner must be non-null, however in places where
11178 * the Rust equivalent takes an Option, it may be set to null to indicate None.
11180 LDKnativeUpdateFailHTLC *inner;
11182 * Indicates that this is the only struct which contains the same pointer.
11183 * Rust functions which take ownership of an object provided via an argument require
11184 * this to be true and invalidate the object pointed to by inner.
11187 } LDKUpdateFailHTLC;
11190 * A dynamically-allocated array of crate::lightning::ln::msgs::UpdateFailHTLCs of arbitrary size.
11191 * This corresponds to std::vector in C++
11193 typedef struct LDKCVec_UpdateFailHTLCZ {
11195 * The elements in the array.
11196 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
11198 struct LDKUpdateFailHTLC *data;
11200 * The number of elements pointed to by `data`.
11203 } LDKCVec_UpdateFailHTLCZ;
11208 * An [`update_fail_malformed_htlc`] message to be sent to or received from a peer.
11210 * [`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
11212 typedef struct MUST_USE_STRUCT LDKUpdateFailMalformedHTLC {
11214 * A pointer to the opaque Rust object.
11215 * Nearly everywhere, inner must be non-null, however in places where
11216 * the Rust equivalent takes an Option, it may be set to null to indicate None.
11218 LDKnativeUpdateFailMalformedHTLC *inner;
11220 * Indicates that this is the only struct which contains the same pointer.
11221 * Rust functions which take ownership of an object provided via an argument require
11222 * this to be true and invalidate the object pointed to by inner.
11225 } LDKUpdateFailMalformedHTLC;
11228 * A dynamically-allocated array of crate::lightning::ln::msgs::UpdateFailMalformedHTLCs of arbitrary size.
11229 * This corresponds to std::vector in C++
11231 typedef struct LDKCVec_UpdateFailMalformedHTLCZ {
11233 * The elements in the array.
11234 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
11236 struct LDKUpdateFailMalformedHTLC *data;
11238 * The number of elements pointed to by `data`.
11241 } LDKCVec_UpdateFailMalformedHTLCZ;
11244 * The contents of CResult_AcceptChannelDecodeErrorZ
11246 typedef union LDKCResult_AcceptChannelDecodeErrorZPtr {
11248 * A pointer to the contents in the success state.
11249 * Reading from this pointer when `result_ok` is not set is undefined.
11251 struct LDKAcceptChannel *result;
11253 * A pointer to the contents in the error state.
11254 * Reading from this pointer when `result_ok` is set is undefined.
11256 struct LDKDecodeError *err;
11257 } LDKCResult_AcceptChannelDecodeErrorZPtr;
11260 * A CResult_AcceptChannelDecodeErrorZ represents the result of a fallible operation,
11261 * containing a crate::lightning::ln::msgs::AcceptChannel on success and a crate::lightning::ln::msgs::DecodeError on failure.
11262 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
11264 typedef struct LDKCResult_AcceptChannelDecodeErrorZ {
11266 * The contents of this CResult_AcceptChannelDecodeErrorZ, accessible via either
11267 * `err` or `result` depending on the state of `result_ok`.
11269 union LDKCResult_AcceptChannelDecodeErrorZPtr contents;
11271 * Whether this CResult_AcceptChannelDecodeErrorZ represents a success state.
11274 } LDKCResult_AcceptChannelDecodeErrorZ;
11277 * The contents of CResult_AcceptChannelV2DecodeErrorZ
11279 typedef union LDKCResult_AcceptChannelV2DecodeErrorZPtr {
11281 * A pointer to the contents in the success state.
11282 * Reading from this pointer when `result_ok` is not set is undefined.
11284 struct LDKAcceptChannelV2 *result;
11286 * A pointer to the contents in the error state.
11287 * Reading from this pointer when `result_ok` is set is undefined.
11289 struct LDKDecodeError *err;
11290 } LDKCResult_AcceptChannelV2DecodeErrorZPtr;
11293 * A CResult_AcceptChannelV2DecodeErrorZ represents the result of a fallible operation,
11294 * containing a crate::lightning::ln::msgs::AcceptChannelV2 on success and a crate::lightning::ln::msgs::DecodeError on failure.
11295 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
11297 typedef struct LDKCResult_AcceptChannelV2DecodeErrorZ {
11299 * The contents of this CResult_AcceptChannelV2DecodeErrorZ, accessible via either
11300 * `err` or `result` depending on the state of `result_ok`.
11302 union LDKCResult_AcceptChannelV2DecodeErrorZPtr contents;
11304 * Whether this CResult_AcceptChannelV2DecodeErrorZ represents a success state.
11307 } LDKCResult_AcceptChannelV2DecodeErrorZ;
11310 * The contents of CResult_TxAddInputDecodeErrorZ
11312 typedef union LDKCResult_TxAddInputDecodeErrorZPtr {
11314 * A pointer to the contents in the success state.
11315 * Reading from this pointer when `result_ok` is not set is undefined.
11317 struct LDKTxAddInput *result;
11319 * A pointer to the contents in the error state.
11320 * Reading from this pointer when `result_ok` is set is undefined.
11322 struct LDKDecodeError *err;
11323 } LDKCResult_TxAddInputDecodeErrorZPtr;
11326 * A CResult_TxAddInputDecodeErrorZ represents the result of a fallible operation,
11327 * containing a crate::lightning::ln::msgs::TxAddInput on success and a crate::lightning::ln::msgs::DecodeError on failure.
11328 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
11330 typedef struct LDKCResult_TxAddInputDecodeErrorZ {
11332 * The contents of this CResult_TxAddInputDecodeErrorZ, accessible via either
11333 * `err` or `result` depending on the state of `result_ok`.
11335 union LDKCResult_TxAddInputDecodeErrorZPtr contents;
11337 * Whether this CResult_TxAddInputDecodeErrorZ represents a success state.
11340 } LDKCResult_TxAddInputDecodeErrorZ;
11343 * The contents of CResult_TxAddOutputDecodeErrorZ
11345 typedef union LDKCResult_TxAddOutputDecodeErrorZPtr {
11347 * A pointer to the contents in the success state.
11348 * Reading from this pointer when `result_ok` is not set is undefined.
11350 struct LDKTxAddOutput *result;
11352 * A pointer to the contents in the error state.
11353 * Reading from this pointer when `result_ok` is set is undefined.
11355 struct LDKDecodeError *err;
11356 } LDKCResult_TxAddOutputDecodeErrorZPtr;
11359 * A CResult_TxAddOutputDecodeErrorZ represents the result of a fallible operation,
11360 * containing a crate::lightning::ln::msgs::TxAddOutput on success and a crate::lightning::ln::msgs::DecodeError on failure.
11361 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
11363 typedef struct LDKCResult_TxAddOutputDecodeErrorZ {
11365 * The contents of this CResult_TxAddOutputDecodeErrorZ, accessible via either
11366 * `err` or `result` depending on the state of `result_ok`.
11368 union LDKCResult_TxAddOutputDecodeErrorZPtr contents;
11370 * Whether this CResult_TxAddOutputDecodeErrorZ represents a success state.
11373 } LDKCResult_TxAddOutputDecodeErrorZ;
11376 * The contents of CResult_TxRemoveInputDecodeErrorZ
11378 typedef union LDKCResult_TxRemoveInputDecodeErrorZPtr {
11380 * A pointer to the contents in the success state.
11381 * Reading from this pointer when `result_ok` is not set is undefined.
11383 struct LDKTxRemoveInput *result;
11385 * A pointer to the contents in the error state.
11386 * Reading from this pointer when `result_ok` is set is undefined.
11388 struct LDKDecodeError *err;
11389 } LDKCResult_TxRemoveInputDecodeErrorZPtr;
11392 * A CResult_TxRemoveInputDecodeErrorZ represents the result of a fallible operation,
11393 * containing a crate::lightning::ln::msgs::TxRemoveInput on success and a crate::lightning::ln::msgs::DecodeError on failure.
11394 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
11396 typedef struct LDKCResult_TxRemoveInputDecodeErrorZ {
11398 * The contents of this CResult_TxRemoveInputDecodeErrorZ, accessible via either
11399 * `err` or `result` depending on the state of `result_ok`.
11401 union LDKCResult_TxRemoveInputDecodeErrorZPtr contents;
11403 * Whether this CResult_TxRemoveInputDecodeErrorZ represents a success state.
11406 } LDKCResult_TxRemoveInputDecodeErrorZ;
11409 * The contents of CResult_TxRemoveOutputDecodeErrorZ
11411 typedef union LDKCResult_TxRemoveOutputDecodeErrorZPtr {
11413 * A pointer to the contents in the success state.
11414 * Reading from this pointer when `result_ok` is not set is undefined.
11416 struct LDKTxRemoveOutput *result;
11418 * A pointer to the contents in the error state.
11419 * Reading from this pointer when `result_ok` is set is undefined.
11421 struct LDKDecodeError *err;
11422 } LDKCResult_TxRemoveOutputDecodeErrorZPtr;
11425 * A CResult_TxRemoveOutputDecodeErrorZ represents the result of a fallible operation,
11426 * containing a crate::lightning::ln::msgs::TxRemoveOutput on success and a crate::lightning::ln::msgs::DecodeError on failure.
11427 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
11429 typedef struct LDKCResult_TxRemoveOutputDecodeErrorZ {
11431 * The contents of this CResult_TxRemoveOutputDecodeErrorZ, accessible via either
11432 * `err` or `result` depending on the state of `result_ok`.
11434 union LDKCResult_TxRemoveOutputDecodeErrorZPtr contents;
11436 * Whether this CResult_TxRemoveOutputDecodeErrorZ represents a success state.
11439 } LDKCResult_TxRemoveOutputDecodeErrorZ;
11442 * The contents of CResult_TxCompleteDecodeErrorZ
11444 typedef union LDKCResult_TxCompleteDecodeErrorZPtr {
11446 * A pointer to the contents in the success state.
11447 * Reading from this pointer when `result_ok` is not set is undefined.
11449 struct LDKTxComplete *result;
11451 * A pointer to the contents in the error state.
11452 * Reading from this pointer when `result_ok` is set is undefined.
11454 struct LDKDecodeError *err;
11455 } LDKCResult_TxCompleteDecodeErrorZPtr;
11458 * A CResult_TxCompleteDecodeErrorZ represents the result of a fallible operation,
11459 * containing a crate::lightning::ln::msgs::TxComplete on success and a crate::lightning::ln::msgs::DecodeError on failure.
11460 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
11462 typedef struct LDKCResult_TxCompleteDecodeErrorZ {
11464 * The contents of this CResult_TxCompleteDecodeErrorZ, accessible via either
11465 * `err` or `result` depending on the state of `result_ok`.
11467 union LDKCResult_TxCompleteDecodeErrorZPtr contents;
11469 * Whether this CResult_TxCompleteDecodeErrorZ represents a success state.
11472 } LDKCResult_TxCompleteDecodeErrorZ;
11475 * The contents of CResult_TxSignaturesDecodeErrorZ
11477 typedef union LDKCResult_TxSignaturesDecodeErrorZPtr {
11479 * A pointer to the contents in the success state.
11480 * Reading from this pointer when `result_ok` is not set is undefined.
11482 struct LDKTxSignatures *result;
11484 * A pointer to the contents in the error state.
11485 * Reading from this pointer when `result_ok` is set is undefined.
11487 struct LDKDecodeError *err;
11488 } LDKCResult_TxSignaturesDecodeErrorZPtr;
11491 * A CResult_TxSignaturesDecodeErrorZ represents the result of a fallible operation,
11492 * containing a crate::lightning::ln::msgs::TxSignatures on success and a crate::lightning::ln::msgs::DecodeError on failure.
11493 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
11495 typedef struct LDKCResult_TxSignaturesDecodeErrorZ {
11497 * The contents of this CResult_TxSignaturesDecodeErrorZ, accessible via either
11498 * `err` or `result` depending on the state of `result_ok`.
11500 union LDKCResult_TxSignaturesDecodeErrorZPtr contents;
11502 * Whether this CResult_TxSignaturesDecodeErrorZ represents a success state.
11505 } LDKCResult_TxSignaturesDecodeErrorZ;
11508 * The contents of CResult_TxInitRbfDecodeErrorZ
11510 typedef union LDKCResult_TxInitRbfDecodeErrorZPtr {
11512 * A pointer to the contents in the success state.
11513 * Reading from this pointer when `result_ok` is not set is undefined.
11515 struct LDKTxInitRbf *result;
11517 * A pointer to the contents in the error state.
11518 * Reading from this pointer when `result_ok` is set is undefined.
11520 struct LDKDecodeError *err;
11521 } LDKCResult_TxInitRbfDecodeErrorZPtr;
11524 * A CResult_TxInitRbfDecodeErrorZ represents the result of a fallible operation,
11525 * containing a crate::lightning::ln::msgs::TxInitRbf on success and a crate::lightning::ln::msgs::DecodeError on failure.
11526 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
11528 typedef struct LDKCResult_TxInitRbfDecodeErrorZ {
11530 * The contents of this CResult_TxInitRbfDecodeErrorZ, accessible via either
11531 * `err` or `result` depending on the state of `result_ok`.
11533 union LDKCResult_TxInitRbfDecodeErrorZPtr contents;
11535 * Whether this CResult_TxInitRbfDecodeErrorZ represents a success state.
11538 } LDKCResult_TxInitRbfDecodeErrorZ;
11541 * The contents of CResult_TxAckRbfDecodeErrorZ
11543 typedef union LDKCResult_TxAckRbfDecodeErrorZPtr {
11545 * A pointer to the contents in the success state.
11546 * Reading from this pointer when `result_ok` is not set is undefined.
11548 struct LDKTxAckRbf *result;
11550 * A pointer to the contents in the error state.
11551 * Reading from this pointer when `result_ok` is set is undefined.
11553 struct LDKDecodeError *err;
11554 } LDKCResult_TxAckRbfDecodeErrorZPtr;
11557 * A CResult_TxAckRbfDecodeErrorZ represents the result of a fallible operation,
11558 * containing a crate::lightning::ln::msgs::TxAckRbf on success and a crate::lightning::ln::msgs::DecodeError on failure.
11559 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
11561 typedef struct LDKCResult_TxAckRbfDecodeErrorZ {
11563 * The contents of this CResult_TxAckRbfDecodeErrorZ, accessible via either
11564 * `err` or `result` depending on the state of `result_ok`.
11566 union LDKCResult_TxAckRbfDecodeErrorZPtr contents;
11568 * Whether this CResult_TxAckRbfDecodeErrorZ represents a success state.
11571 } LDKCResult_TxAckRbfDecodeErrorZ;
11574 * The contents of CResult_TxAbortDecodeErrorZ
11576 typedef union LDKCResult_TxAbortDecodeErrorZPtr {
11578 * A pointer to the contents in the success state.
11579 * Reading from this pointer when `result_ok` is not set is undefined.
11581 struct LDKTxAbort *result;
11583 * A pointer to the contents in the error state.
11584 * Reading from this pointer when `result_ok` is set is undefined.
11586 struct LDKDecodeError *err;
11587 } LDKCResult_TxAbortDecodeErrorZPtr;
11590 * A CResult_TxAbortDecodeErrorZ represents the result of a fallible operation,
11591 * containing a crate::lightning::ln::msgs::TxAbort on success and a crate::lightning::ln::msgs::DecodeError on failure.
11592 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
11594 typedef struct LDKCResult_TxAbortDecodeErrorZ {
11596 * The contents of this CResult_TxAbortDecodeErrorZ, accessible via either
11597 * `err` or `result` depending on the state of `result_ok`.
11599 union LDKCResult_TxAbortDecodeErrorZPtr contents;
11601 * Whether this CResult_TxAbortDecodeErrorZ represents a success state.
11604 } LDKCResult_TxAbortDecodeErrorZ;
11607 * The contents of CResult_AnnouncementSignaturesDecodeErrorZ
11609 typedef union LDKCResult_AnnouncementSignaturesDecodeErrorZPtr {
11611 * A pointer to the contents in the success state.
11612 * Reading from this pointer when `result_ok` is not set is undefined.
11614 struct LDKAnnouncementSignatures *result;
11616 * A pointer to the contents in the error state.
11617 * Reading from this pointer when `result_ok` is set is undefined.
11619 struct LDKDecodeError *err;
11620 } LDKCResult_AnnouncementSignaturesDecodeErrorZPtr;
11623 * A CResult_AnnouncementSignaturesDecodeErrorZ represents the result of a fallible operation,
11624 * containing a crate::lightning::ln::msgs::AnnouncementSignatures on success and a crate::lightning::ln::msgs::DecodeError on failure.
11625 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
11627 typedef struct LDKCResult_AnnouncementSignaturesDecodeErrorZ {
11629 * The contents of this CResult_AnnouncementSignaturesDecodeErrorZ, accessible via either
11630 * `err` or `result` depending on the state of `result_ok`.
11632 union LDKCResult_AnnouncementSignaturesDecodeErrorZPtr contents;
11634 * Whether this CResult_AnnouncementSignaturesDecodeErrorZ represents a success state.
11637 } LDKCResult_AnnouncementSignaturesDecodeErrorZ;
11640 * The contents of CResult_ChannelReestablishDecodeErrorZ
11642 typedef union LDKCResult_ChannelReestablishDecodeErrorZPtr {
11644 * A pointer to the contents in the success state.
11645 * Reading from this pointer when `result_ok` is not set is undefined.
11647 struct LDKChannelReestablish *result;
11649 * A pointer to the contents in the error state.
11650 * Reading from this pointer when `result_ok` is set is undefined.
11652 struct LDKDecodeError *err;
11653 } LDKCResult_ChannelReestablishDecodeErrorZPtr;
11656 * A CResult_ChannelReestablishDecodeErrorZ represents the result of a fallible operation,
11657 * containing a crate::lightning::ln::msgs::ChannelReestablish on success and a crate::lightning::ln::msgs::DecodeError on failure.
11658 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
11660 typedef struct LDKCResult_ChannelReestablishDecodeErrorZ {
11662 * The contents of this CResult_ChannelReestablishDecodeErrorZ, accessible via either
11663 * `err` or `result` depending on the state of `result_ok`.
11665 union LDKCResult_ChannelReestablishDecodeErrorZPtr contents;
11667 * Whether this CResult_ChannelReestablishDecodeErrorZ represents a success state.
11670 } LDKCResult_ChannelReestablishDecodeErrorZ;
11673 * The contents of CResult_ClosingSignedDecodeErrorZ
11675 typedef union LDKCResult_ClosingSignedDecodeErrorZPtr {
11677 * A pointer to the contents in the success state.
11678 * Reading from this pointer when `result_ok` is not set is undefined.
11680 struct LDKClosingSigned *result;
11682 * A pointer to the contents in the error state.
11683 * Reading from this pointer when `result_ok` is set is undefined.
11685 struct LDKDecodeError *err;
11686 } LDKCResult_ClosingSignedDecodeErrorZPtr;
11689 * A CResult_ClosingSignedDecodeErrorZ represents the result of a fallible operation,
11690 * containing a crate::lightning::ln::msgs::ClosingSigned on success and a crate::lightning::ln::msgs::DecodeError on failure.
11691 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
11693 typedef struct LDKCResult_ClosingSignedDecodeErrorZ {
11695 * The contents of this CResult_ClosingSignedDecodeErrorZ, accessible via either
11696 * `err` or `result` depending on the state of `result_ok`.
11698 union LDKCResult_ClosingSignedDecodeErrorZPtr contents;
11700 * Whether this CResult_ClosingSignedDecodeErrorZ represents a success state.
11703 } LDKCResult_ClosingSignedDecodeErrorZ;
11708 * The minimum and maximum fees which the sender is willing to place on the closing transaction.
11710 * This is provided in [`ClosingSigned`] by both sides to indicate the fee range they are willing
11713 typedef struct MUST_USE_STRUCT LDKClosingSignedFeeRange {
11715 * A pointer to the opaque Rust object.
11716 * Nearly everywhere, inner must be non-null, however in places where
11717 * the Rust equivalent takes an Option, it may be set to null to indicate None.
11719 LDKnativeClosingSignedFeeRange *inner;
11721 * Indicates that this is the only struct which contains the same pointer.
11722 * Rust functions which take ownership of an object provided via an argument require
11723 * this to be true and invalidate the object pointed to by inner.
11726 } LDKClosingSignedFeeRange;
11729 * The contents of CResult_ClosingSignedFeeRangeDecodeErrorZ
11731 typedef union LDKCResult_ClosingSignedFeeRangeDecodeErrorZPtr {
11733 * A pointer to the contents in the success state.
11734 * Reading from this pointer when `result_ok` is not set is undefined.
11736 struct LDKClosingSignedFeeRange *result;
11738 * A pointer to the contents in the error state.
11739 * Reading from this pointer when `result_ok` is set is undefined.
11741 struct LDKDecodeError *err;
11742 } LDKCResult_ClosingSignedFeeRangeDecodeErrorZPtr;
11745 * A CResult_ClosingSignedFeeRangeDecodeErrorZ represents the result of a fallible operation,
11746 * containing a crate::lightning::ln::msgs::ClosingSignedFeeRange on success and a crate::lightning::ln::msgs::DecodeError on failure.
11747 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
11749 typedef struct LDKCResult_ClosingSignedFeeRangeDecodeErrorZ {
11751 * The contents of this CResult_ClosingSignedFeeRangeDecodeErrorZ, accessible via either
11752 * `err` or `result` depending on the state of `result_ok`.
11754 union LDKCResult_ClosingSignedFeeRangeDecodeErrorZPtr contents;
11756 * Whether this CResult_ClosingSignedFeeRangeDecodeErrorZ represents a success state.
11759 } LDKCResult_ClosingSignedFeeRangeDecodeErrorZ;
11764 * A [`commitment_signed`] message to be sent to or received from a peer.
11766 * [`commitment_signed`]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md#committing-updates-so-far-commitment_signed
11768 typedef struct MUST_USE_STRUCT LDKCommitmentSigned {
11770 * A pointer to the opaque Rust object.
11771 * Nearly everywhere, inner must be non-null, however in places where
11772 * the Rust equivalent takes an Option, it may be set to null to indicate None.
11774 LDKnativeCommitmentSigned *inner;
11776 * Indicates that this is the only struct which contains the same pointer.
11777 * Rust functions which take ownership of an object provided via an argument require
11778 * this to be true and invalidate the object pointed to by inner.
11781 } LDKCommitmentSigned;
11784 * The contents of CResult_CommitmentSignedDecodeErrorZ
11786 typedef union LDKCResult_CommitmentSignedDecodeErrorZPtr {
11788 * A pointer to the contents in the success state.
11789 * Reading from this pointer when `result_ok` is not set is undefined.
11791 struct LDKCommitmentSigned *result;
11793 * A pointer to the contents in the error state.
11794 * Reading from this pointer when `result_ok` is set is undefined.
11796 struct LDKDecodeError *err;
11797 } LDKCResult_CommitmentSignedDecodeErrorZPtr;
11800 * A CResult_CommitmentSignedDecodeErrorZ represents the result of a fallible operation,
11801 * containing a crate::lightning::ln::msgs::CommitmentSigned on success and a crate::lightning::ln::msgs::DecodeError on failure.
11802 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
11804 typedef struct LDKCResult_CommitmentSignedDecodeErrorZ {
11806 * The contents of this CResult_CommitmentSignedDecodeErrorZ, accessible via either
11807 * `err` or `result` depending on the state of `result_ok`.
11809 union LDKCResult_CommitmentSignedDecodeErrorZPtr contents;
11811 * Whether this CResult_CommitmentSignedDecodeErrorZ represents a success state.
11814 } LDKCResult_CommitmentSignedDecodeErrorZ;
11817 * The contents of CResult_FundingCreatedDecodeErrorZ
11819 typedef union LDKCResult_FundingCreatedDecodeErrorZPtr {
11821 * A pointer to the contents in the success state.
11822 * Reading from this pointer when `result_ok` is not set is undefined.
11824 struct LDKFundingCreated *result;
11826 * A pointer to the contents in the error state.
11827 * Reading from this pointer when `result_ok` is set is undefined.
11829 struct LDKDecodeError *err;
11830 } LDKCResult_FundingCreatedDecodeErrorZPtr;
11833 * A CResult_FundingCreatedDecodeErrorZ represents the result of a fallible operation,
11834 * containing a crate::lightning::ln::msgs::FundingCreated on success and a crate::lightning::ln::msgs::DecodeError on failure.
11835 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
11837 typedef struct LDKCResult_FundingCreatedDecodeErrorZ {
11839 * The contents of this CResult_FundingCreatedDecodeErrorZ, accessible via either
11840 * `err` or `result` depending on the state of `result_ok`.
11842 union LDKCResult_FundingCreatedDecodeErrorZPtr contents;
11844 * Whether this CResult_FundingCreatedDecodeErrorZ represents a success state.
11847 } LDKCResult_FundingCreatedDecodeErrorZ;
11850 * The contents of CResult_FundingSignedDecodeErrorZ
11852 typedef union LDKCResult_FundingSignedDecodeErrorZPtr {
11854 * A pointer to the contents in the success state.
11855 * Reading from this pointer when `result_ok` is not set is undefined.
11857 struct LDKFundingSigned *result;
11859 * A pointer to the contents in the error state.
11860 * Reading from this pointer when `result_ok` is set is undefined.
11862 struct LDKDecodeError *err;
11863 } LDKCResult_FundingSignedDecodeErrorZPtr;
11866 * A CResult_FundingSignedDecodeErrorZ represents the result of a fallible operation,
11867 * containing a crate::lightning::ln::msgs::FundingSigned on success and a crate::lightning::ln::msgs::DecodeError on failure.
11868 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
11870 typedef struct LDKCResult_FundingSignedDecodeErrorZ {
11872 * The contents of this CResult_FundingSignedDecodeErrorZ, accessible via either
11873 * `err` or `result` depending on the state of `result_ok`.
11875 union LDKCResult_FundingSignedDecodeErrorZPtr contents;
11877 * Whether this CResult_FundingSignedDecodeErrorZ represents a success state.
11880 } LDKCResult_FundingSignedDecodeErrorZ;
11883 * The contents of CResult_ChannelReadyDecodeErrorZ
11885 typedef union LDKCResult_ChannelReadyDecodeErrorZPtr {
11887 * A pointer to the contents in the success state.
11888 * Reading from this pointer when `result_ok` is not set is undefined.
11890 struct LDKChannelReady *result;
11892 * A pointer to the contents in the error state.
11893 * Reading from this pointer when `result_ok` is set is undefined.
11895 struct LDKDecodeError *err;
11896 } LDKCResult_ChannelReadyDecodeErrorZPtr;
11899 * A CResult_ChannelReadyDecodeErrorZ represents the result of a fallible operation,
11900 * containing a crate::lightning::ln::msgs::ChannelReady on success and a crate::lightning::ln::msgs::DecodeError on failure.
11901 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
11903 typedef struct LDKCResult_ChannelReadyDecodeErrorZ {
11905 * The contents of this CResult_ChannelReadyDecodeErrorZ, accessible via either
11906 * `err` or `result` depending on the state of `result_ok`.
11908 union LDKCResult_ChannelReadyDecodeErrorZPtr contents;
11910 * Whether this CResult_ChannelReadyDecodeErrorZ represents a success state.
11913 } LDKCResult_ChannelReadyDecodeErrorZ;
11918 * An [`init`] message to be sent to or received from a peer.
11920 * [`init`]: https://github.com/lightning/bolts/blob/master/01-messaging.md#the-init-message
11922 typedef struct MUST_USE_STRUCT LDKInit {
11924 * A pointer to the opaque Rust object.
11925 * Nearly everywhere, inner must be non-null, however in places where
11926 * the Rust equivalent takes an Option, it may be set to null to indicate None.
11928 LDKnativeInit *inner;
11930 * Indicates that this is the only struct which contains the same pointer.
11931 * Rust functions which take ownership of an object provided via an argument require
11932 * this to be true and invalidate the object pointed to by inner.
11938 * The contents of CResult_InitDecodeErrorZ
11940 typedef union LDKCResult_InitDecodeErrorZPtr {
11942 * A pointer to the contents in the success state.
11943 * Reading from this pointer when `result_ok` is not set is undefined.
11945 struct LDKInit *result;
11947 * A pointer to the contents in the error state.
11948 * Reading from this pointer when `result_ok` is set is undefined.
11950 struct LDKDecodeError *err;
11951 } LDKCResult_InitDecodeErrorZPtr;
11954 * A CResult_InitDecodeErrorZ represents the result of a fallible operation,
11955 * containing a crate::lightning::ln::msgs::Init on success and a crate::lightning::ln::msgs::DecodeError on failure.
11956 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
11958 typedef struct LDKCResult_InitDecodeErrorZ {
11960 * The contents of this CResult_InitDecodeErrorZ, accessible via either
11961 * `err` or `result` depending on the state of `result_ok`.
11963 union LDKCResult_InitDecodeErrorZPtr contents;
11965 * Whether this CResult_InitDecodeErrorZ represents a success state.
11968 } LDKCResult_InitDecodeErrorZ;
11971 * The contents of CResult_OpenChannelDecodeErrorZ
11973 typedef union LDKCResult_OpenChannelDecodeErrorZPtr {
11975 * A pointer to the contents in the success state.
11976 * Reading from this pointer when `result_ok` is not set is undefined.
11978 struct LDKOpenChannel *result;
11980 * A pointer to the contents in the error state.
11981 * Reading from this pointer when `result_ok` is set is undefined.
11983 struct LDKDecodeError *err;
11984 } LDKCResult_OpenChannelDecodeErrorZPtr;
11987 * A CResult_OpenChannelDecodeErrorZ represents the result of a fallible operation,
11988 * containing a crate::lightning::ln::msgs::OpenChannel on success and a crate::lightning::ln::msgs::DecodeError on failure.
11989 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
11991 typedef struct LDKCResult_OpenChannelDecodeErrorZ {
11993 * The contents of this CResult_OpenChannelDecodeErrorZ, accessible via either
11994 * `err` or `result` depending on the state of `result_ok`.
11996 union LDKCResult_OpenChannelDecodeErrorZPtr contents;
11998 * Whether this CResult_OpenChannelDecodeErrorZ represents a success state.
12001 } LDKCResult_OpenChannelDecodeErrorZ;
12004 * The contents of CResult_OpenChannelV2DecodeErrorZ
12006 typedef union LDKCResult_OpenChannelV2DecodeErrorZPtr {
12008 * A pointer to the contents in the success state.
12009 * Reading from this pointer when `result_ok` is not set is undefined.
12011 struct LDKOpenChannelV2 *result;
12013 * A pointer to the contents in the error state.
12014 * Reading from this pointer when `result_ok` is set is undefined.
12016 struct LDKDecodeError *err;
12017 } LDKCResult_OpenChannelV2DecodeErrorZPtr;
12020 * A CResult_OpenChannelV2DecodeErrorZ represents the result of a fallible operation,
12021 * containing a crate::lightning::ln::msgs::OpenChannelV2 on success and a crate::lightning::ln::msgs::DecodeError on failure.
12022 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
12024 typedef struct LDKCResult_OpenChannelV2DecodeErrorZ {
12026 * The contents of this CResult_OpenChannelV2DecodeErrorZ, accessible via either
12027 * `err` or `result` depending on the state of `result_ok`.
12029 union LDKCResult_OpenChannelV2DecodeErrorZPtr contents;
12031 * Whether this CResult_OpenChannelV2DecodeErrorZ represents a success state.
12034 } LDKCResult_OpenChannelV2DecodeErrorZ;
12037 * The contents of CResult_RevokeAndACKDecodeErrorZ
12039 typedef union LDKCResult_RevokeAndACKDecodeErrorZPtr {
12041 * A pointer to the contents in the success state.
12042 * Reading from this pointer when `result_ok` is not set is undefined.
12044 struct LDKRevokeAndACK *result;
12046 * A pointer to the contents in the error state.
12047 * Reading from this pointer when `result_ok` is set is undefined.
12049 struct LDKDecodeError *err;
12050 } LDKCResult_RevokeAndACKDecodeErrorZPtr;
12053 * A CResult_RevokeAndACKDecodeErrorZ represents the result of a fallible operation,
12054 * containing a crate::lightning::ln::msgs::RevokeAndACK on success and a crate::lightning::ln::msgs::DecodeError on failure.
12055 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
12057 typedef struct LDKCResult_RevokeAndACKDecodeErrorZ {
12059 * The contents of this CResult_RevokeAndACKDecodeErrorZ, accessible via either
12060 * `err` or `result` depending on the state of `result_ok`.
12062 union LDKCResult_RevokeAndACKDecodeErrorZPtr contents;
12064 * Whether this CResult_RevokeAndACKDecodeErrorZ represents a success state.
12067 } LDKCResult_RevokeAndACKDecodeErrorZ;
12070 * The contents of CResult_ShutdownDecodeErrorZ
12072 typedef union LDKCResult_ShutdownDecodeErrorZPtr {
12074 * A pointer to the contents in the success state.
12075 * Reading from this pointer when `result_ok` is not set is undefined.
12077 struct LDKShutdown *result;
12079 * A pointer to the contents in the error state.
12080 * Reading from this pointer when `result_ok` is set is undefined.
12082 struct LDKDecodeError *err;
12083 } LDKCResult_ShutdownDecodeErrorZPtr;
12086 * A CResult_ShutdownDecodeErrorZ represents the result of a fallible operation,
12087 * containing a crate::lightning::ln::msgs::Shutdown on success and a crate::lightning::ln::msgs::DecodeError on failure.
12088 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
12090 typedef struct LDKCResult_ShutdownDecodeErrorZ {
12092 * The contents of this CResult_ShutdownDecodeErrorZ, accessible via either
12093 * `err` or `result` depending on the state of `result_ok`.
12095 union LDKCResult_ShutdownDecodeErrorZPtr contents;
12097 * Whether this CResult_ShutdownDecodeErrorZ represents a success state.
12100 } LDKCResult_ShutdownDecodeErrorZ;
12103 * The contents of CResult_UpdateFailHTLCDecodeErrorZ
12105 typedef union LDKCResult_UpdateFailHTLCDecodeErrorZPtr {
12107 * A pointer to the contents in the success state.
12108 * Reading from this pointer when `result_ok` is not set is undefined.
12110 struct LDKUpdateFailHTLC *result;
12112 * A pointer to the contents in the error state.
12113 * Reading from this pointer when `result_ok` is set is undefined.
12115 struct LDKDecodeError *err;
12116 } LDKCResult_UpdateFailHTLCDecodeErrorZPtr;
12119 * A CResult_UpdateFailHTLCDecodeErrorZ represents the result of a fallible operation,
12120 * containing a crate::lightning::ln::msgs::UpdateFailHTLC on success and a crate::lightning::ln::msgs::DecodeError on failure.
12121 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
12123 typedef struct LDKCResult_UpdateFailHTLCDecodeErrorZ {
12125 * The contents of this CResult_UpdateFailHTLCDecodeErrorZ, accessible via either
12126 * `err` or `result` depending on the state of `result_ok`.
12128 union LDKCResult_UpdateFailHTLCDecodeErrorZPtr contents;
12130 * Whether this CResult_UpdateFailHTLCDecodeErrorZ represents a success state.
12133 } LDKCResult_UpdateFailHTLCDecodeErrorZ;
12136 * The contents of CResult_UpdateFailMalformedHTLCDecodeErrorZ
12138 typedef union LDKCResult_UpdateFailMalformedHTLCDecodeErrorZPtr {
12140 * A pointer to the contents in the success state.
12141 * Reading from this pointer when `result_ok` is not set is undefined.
12143 struct LDKUpdateFailMalformedHTLC *result;
12145 * A pointer to the contents in the error state.
12146 * Reading from this pointer when `result_ok` is set is undefined.
12148 struct LDKDecodeError *err;
12149 } LDKCResult_UpdateFailMalformedHTLCDecodeErrorZPtr;
12152 * A CResult_UpdateFailMalformedHTLCDecodeErrorZ represents the result of a fallible operation,
12153 * containing a crate::lightning::ln::msgs::UpdateFailMalformedHTLC on success and a crate::lightning::ln::msgs::DecodeError on failure.
12154 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
12156 typedef struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ {
12158 * The contents of this CResult_UpdateFailMalformedHTLCDecodeErrorZ, accessible via either
12159 * `err` or `result` depending on the state of `result_ok`.
12161 union LDKCResult_UpdateFailMalformedHTLCDecodeErrorZPtr contents;
12163 * Whether this CResult_UpdateFailMalformedHTLCDecodeErrorZ represents a success state.
12166 } LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ;
12171 * An [`update_fee`] message to be sent to or received from a peer
12173 * [`update_fee`]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md#updating-fees-update_fee
12175 typedef struct MUST_USE_STRUCT LDKUpdateFee {
12177 * A pointer to the opaque Rust object.
12178 * Nearly everywhere, inner must be non-null, however in places where
12179 * the Rust equivalent takes an Option, it may be set to null to indicate None.
12181 LDKnativeUpdateFee *inner;
12183 * Indicates that this is the only struct which contains the same pointer.
12184 * Rust functions which take ownership of an object provided via an argument require
12185 * this to be true and invalidate the object pointed to by inner.
12191 * The contents of CResult_UpdateFeeDecodeErrorZ
12193 typedef union LDKCResult_UpdateFeeDecodeErrorZPtr {
12195 * A pointer to the contents in the success state.
12196 * Reading from this pointer when `result_ok` is not set is undefined.
12198 struct LDKUpdateFee *result;
12200 * A pointer to the contents in the error state.
12201 * Reading from this pointer when `result_ok` is set is undefined.
12203 struct LDKDecodeError *err;
12204 } LDKCResult_UpdateFeeDecodeErrorZPtr;
12207 * A CResult_UpdateFeeDecodeErrorZ represents the result of a fallible operation,
12208 * containing a crate::lightning::ln::msgs::UpdateFee on success and a crate::lightning::ln::msgs::DecodeError on failure.
12209 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
12211 typedef struct LDKCResult_UpdateFeeDecodeErrorZ {
12213 * The contents of this CResult_UpdateFeeDecodeErrorZ, accessible via either
12214 * `err` or `result` depending on the state of `result_ok`.
12216 union LDKCResult_UpdateFeeDecodeErrorZPtr contents;
12218 * Whether this CResult_UpdateFeeDecodeErrorZ represents a success state.
12221 } LDKCResult_UpdateFeeDecodeErrorZ;
12224 * The contents of CResult_UpdateFulfillHTLCDecodeErrorZ
12226 typedef union LDKCResult_UpdateFulfillHTLCDecodeErrorZPtr {
12228 * A pointer to the contents in the success state.
12229 * Reading from this pointer when `result_ok` is not set is undefined.
12231 struct LDKUpdateFulfillHTLC *result;
12233 * A pointer to the contents in the error state.
12234 * Reading from this pointer when `result_ok` is set is undefined.
12236 struct LDKDecodeError *err;
12237 } LDKCResult_UpdateFulfillHTLCDecodeErrorZPtr;
12240 * A CResult_UpdateFulfillHTLCDecodeErrorZ represents the result of a fallible operation,
12241 * containing a crate::lightning::ln::msgs::UpdateFulfillHTLC on success and a crate::lightning::ln::msgs::DecodeError on failure.
12242 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
12244 typedef struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ {
12246 * The contents of this CResult_UpdateFulfillHTLCDecodeErrorZ, accessible via either
12247 * `err` or `result` depending on the state of `result_ok`.
12249 union LDKCResult_UpdateFulfillHTLCDecodeErrorZPtr contents;
12251 * Whether this CResult_UpdateFulfillHTLCDecodeErrorZ represents a success state.
12254 } LDKCResult_UpdateFulfillHTLCDecodeErrorZ;
12257 * The contents of CResult_UpdateAddHTLCDecodeErrorZ
12259 typedef union LDKCResult_UpdateAddHTLCDecodeErrorZPtr {
12261 * A pointer to the contents in the success state.
12262 * Reading from this pointer when `result_ok` is not set is undefined.
12264 struct LDKUpdateAddHTLC *result;
12266 * A pointer to the contents in the error state.
12267 * Reading from this pointer when `result_ok` is set is undefined.
12269 struct LDKDecodeError *err;
12270 } LDKCResult_UpdateAddHTLCDecodeErrorZPtr;
12273 * A CResult_UpdateAddHTLCDecodeErrorZ represents the result of a fallible operation,
12274 * containing a crate::lightning::ln::msgs::UpdateAddHTLC on success and a crate::lightning::ln::msgs::DecodeError on failure.
12275 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
12277 typedef struct LDKCResult_UpdateAddHTLCDecodeErrorZ {
12279 * The contents of this CResult_UpdateAddHTLCDecodeErrorZ, accessible via either
12280 * `err` or `result` depending on the state of `result_ok`.
12282 union LDKCResult_UpdateAddHTLCDecodeErrorZPtr contents;
12284 * Whether this CResult_UpdateAddHTLCDecodeErrorZ represents a success state.
12287 } LDKCResult_UpdateAddHTLCDecodeErrorZ;
12292 * An onion message to be sent to or received from a peer.
12295 typedef struct MUST_USE_STRUCT LDKOnionMessage {
12297 * A pointer to the opaque Rust object.
12298 * Nearly everywhere, inner must be non-null, however in places where
12299 * the Rust equivalent takes an Option, it may be set to null to indicate None.
12301 LDKnativeOnionMessage *inner;
12303 * Indicates that this is the only struct which contains the same pointer.
12304 * Rust functions which take ownership of an object provided via an argument require
12305 * this to be true and invalidate the object pointed to by inner.
12311 * The contents of CResult_OnionMessageDecodeErrorZ
12313 typedef union LDKCResult_OnionMessageDecodeErrorZPtr {
12315 * A pointer to the contents in the success state.
12316 * Reading from this pointer when `result_ok` is not set is undefined.
12318 struct LDKOnionMessage *result;
12320 * A pointer to the contents in the error state.
12321 * Reading from this pointer when `result_ok` is set is undefined.
12323 struct LDKDecodeError *err;
12324 } LDKCResult_OnionMessageDecodeErrorZPtr;
12327 * A CResult_OnionMessageDecodeErrorZ represents the result of a fallible operation,
12328 * containing a crate::lightning::ln::msgs::OnionMessage on success and a crate::lightning::ln::msgs::DecodeError on failure.
12329 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
12331 typedef struct LDKCResult_OnionMessageDecodeErrorZ {
12333 * The contents of this CResult_OnionMessageDecodeErrorZ, accessible via either
12334 * `err` or `result` depending on the state of `result_ok`.
12336 union LDKCResult_OnionMessageDecodeErrorZPtr contents;
12338 * Whether this CResult_OnionMessageDecodeErrorZ represents a success state.
12341 } LDKCResult_OnionMessageDecodeErrorZ;
12346 * A [`ping`] message to be sent to or received from a peer.
12348 * [`ping`]: https://github.com/lightning/bolts/blob/master/01-messaging.md#the-ping-and-pong-messages
12350 typedef struct MUST_USE_STRUCT LDKPing {
12352 * A pointer to the opaque Rust object.
12353 * Nearly everywhere, inner must be non-null, however in places where
12354 * the Rust equivalent takes an Option, it may be set to null to indicate None.
12356 LDKnativePing *inner;
12358 * Indicates that this is the only struct which contains the same pointer.
12359 * Rust functions which take ownership of an object provided via an argument require
12360 * this to be true and invalidate the object pointed to by inner.
12366 * The contents of CResult_PingDecodeErrorZ
12368 typedef union LDKCResult_PingDecodeErrorZPtr {
12370 * A pointer to the contents in the success state.
12371 * Reading from this pointer when `result_ok` is not set is undefined.
12373 struct LDKPing *result;
12375 * A pointer to the contents in the error state.
12376 * Reading from this pointer when `result_ok` is set is undefined.
12378 struct LDKDecodeError *err;
12379 } LDKCResult_PingDecodeErrorZPtr;
12382 * A CResult_PingDecodeErrorZ represents the result of a fallible operation,
12383 * containing a crate::lightning::ln::msgs::Ping on success and a crate::lightning::ln::msgs::DecodeError on failure.
12384 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
12386 typedef struct LDKCResult_PingDecodeErrorZ {
12388 * The contents of this CResult_PingDecodeErrorZ, accessible via either
12389 * `err` or `result` depending on the state of `result_ok`.
12391 union LDKCResult_PingDecodeErrorZPtr contents;
12393 * Whether this CResult_PingDecodeErrorZ represents a success state.
12396 } LDKCResult_PingDecodeErrorZ;
12401 * A [`pong`] message to be sent to or received from a peer.
12403 * [`pong`]: https://github.com/lightning/bolts/blob/master/01-messaging.md#the-ping-and-pong-messages
12405 typedef struct MUST_USE_STRUCT LDKPong {
12407 * A pointer to the opaque Rust object.
12408 * Nearly everywhere, inner must be non-null, however in places where
12409 * the Rust equivalent takes an Option, it may be set to null to indicate None.
12411 LDKnativePong *inner;
12413 * Indicates that this is the only struct which contains the same pointer.
12414 * Rust functions which take ownership of an object provided via an argument require
12415 * this to be true and invalidate the object pointed to by inner.
12421 * The contents of CResult_PongDecodeErrorZ
12423 typedef union LDKCResult_PongDecodeErrorZPtr {
12425 * A pointer to the contents in the success state.
12426 * Reading from this pointer when `result_ok` is not set is undefined.
12428 struct LDKPong *result;
12430 * A pointer to the contents in the error state.
12431 * Reading from this pointer when `result_ok` is set is undefined.
12433 struct LDKDecodeError *err;
12434 } LDKCResult_PongDecodeErrorZPtr;
12437 * A CResult_PongDecodeErrorZ represents the result of a fallible operation,
12438 * containing a crate::lightning::ln::msgs::Pong on success and a crate::lightning::ln::msgs::DecodeError on failure.
12439 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
12441 typedef struct LDKCResult_PongDecodeErrorZ {
12443 * The contents of this CResult_PongDecodeErrorZ, accessible via either
12444 * `err` or `result` depending on the state of `result_ok`.
12446 union LDKCResult_PongDecodeErrorZPtr contents;
12448 * Whether this CResult_PongDecodeErrorZ represents a success state.
12451 } LDKCResult_PongDecodeErrorZ;
12454 * The contents of CResult_UnsignedChannelAnnouncementDecodeErrorZ
12456 typedef union LDKCResult_UnsignedChannelAnnouncementDecodeErrorZPtr {
12458 * A pointer to the contents in the success state.
12459 * Reading from this pointer when `result_ok` is not set is undefined.
12461 struct LDKUnsignedChannelAnnouncement *result;
12463 * A pointer to the contents in the error state.
12464 * Reading from this pointer when `result_ok` is set is undefined.
12466 struct LDKDecodeError *err;
12467 } LDKCResult_UnsignedChannelAnnouncementDecodeErrorZPtr;
12470 * A CResult_UnsignedChannelAnnouncementDecodeErrorZ represents the result of a fallible operation,
12471 * containing a crate::lightning::ln::msgs::UnsignedChannelAnnouncement on success and a crate::lightning::ln::msgs::DecodeError on failure.
12472 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
12474 typedef struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ {
12476 * The contents of this CResult_UnsignedChannelAnnouncementDecodeErrorZ, accessible via either
12477 * `err` or `result` depending on the state of `result_ok`.
12479 union LDKCResult_UnsignedChannelAnnouncementDecodeErrorZPtr contents;
12481 * Whether this CResult_UnsignedChannelAnnouncementDecodeErrorZ represents a success state.
12484 } LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ;
12487 * The contents of CResult_ChannelAnnouncementDecodeErrorZ
12489 typedef union LDKCResult_ChannelAnnouncementDecodeErrorZPtr {
12491 * A pointer to the contents in the success state.
12492 * Reading from this pointer when `result_ok` is not set is undefined.
12494 struct LDKChannelAnnouncement *result;
12496 * A pointer to the contents in the error state.
12497 * Reading from this pointer when `result_ok` is set is undefined.
12499 struct LDKDecodeError *err;
12500 } LDKCResult_ChannelAnnouncementDecodeErrorZPtr;
12503 * A CResult_ChannelAnnouncementDecodeErrorZ represents the result of a fallible operation,
12504 * containing a crate::lightning::ln::msgs::ChannelAnnouncement on success and a crate::lightning::ln::msgs::DecodeError on failure.
12505 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
12507 typedef struct LDKCResult_ChannelAnnouncementDecodeErrorZ {
12509 * The contents of this CResult_ChannelAnnouncementDecodeErrorZ, accessible via either
12510 * `err` or `result` depending on the state of `result_ok`.
12512 union LDKCResult_ChannelAnnouncementDecodeErrorZPtr contents;
12514 * Whether this CResult_ChannelAnnouncementDecodeErrorZ represents a success state.
12517 } LDKCResult_ChannelAnnouncementDecodeErrorZ;
12520 * The contents of CResult_UnsignedChannelUpdateDecodeErrorZ
12522 typedef union LDKCResult_UnsignedChannelUpdateDecodeErrorZPtr {
12524 * A pointer to the contents in the success state.
12525 * Reading from this pointer when `result_ok` is not set is undefined.
12527 struct LDKUnsignedChannelUpdate *result;
12529 * A pointer to the contents in the error state.
12530 * Reading from this pointer when `result_ok` is set is undefined.
12532 struct LDKDecodeError *err;
12533 } LDKCResult_UnsignedChannelUpdateDecodeErrorZPtr;
12536 * A CResult_UnsignedChannelUpdateDecodeErrorZ represents the result of a fallible operation,
12537 * containing a crate::lightning::ln::msgs::UnsignedChannelUpdate on success and a crate::lightning::ln::msgs::DecodeError on failure.
12538 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
12540 typedef struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ {
12542 * The contents of this CResult_UnsignedChannelUpdateDecodeErrorZ, accessible via either
12543 * `err` or `result` depending on the state of `result_ok`.
12545 union LDKCResult_UnsignedChannelUpdateDecodeErrorZPtr contents;
12547 * Whether this CResult_UnsignedChannelUpdateDecodeErrorZ represents a success state.
12550 } LDKCResult_UnsignedChannelUpdateDecodeErrorZ;
12553 * The contents of CResult_ChannelUpdateDecodeErrorZ
12555 typedef union LDKCResult_ChannelUpdateDecodeErrorZPtr {
12557 * A pointer to the contents in the success state.
12558 * Reading from this pointer when `result_ok` is not set is undefined.
12560 struct LDKChannelUpdate *result;
12562 * A pointer to the contents in the error state.
12563 * Reading from this pointer when `result_ok` is set is undefined.
12565 struct LDKDecodeError *err;
12566 } LDKCResult_ChannelUpdateDecodeErrorZPtr;
12569 * A CResult_ChannelUpdateDecodeErrorZ represents the result of a fallible operation,
12570 * containing a crate::lightning::ln::msgs::ChannelUpdate on success and a crate::lightning::ln::msgs::DecodeError on failure.
12571 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
12573 typedef struct LDKCResult_ChannelUpdateDecodeErrorZ {
12575 * The contents of this CResult_ChannelUpdateDecodeErrorZ, accessible via either
12576 * `err` or `result` depending on the state of `result_ok`.
12578 union LDKCResult_ChannelUpdateDecodeErrorZPtr contents;
12580 * Whether this CResult_ChannelUpdateDecodeErrorZ represents a success state.
12583 } LDKCResult_ChannelUpdateDecodeErrorZ;
12586 * The contents of CResult_ErrorMessageDecodeErrorZ
12588 typedef union LDKCResult_ErrorMessageDecodeErrorZPtr {
12590 * A pointer to the contents in the success state.
12591 * Reading from this pointer when `result_ok` is not set is undefined.
12593 struct LDKErrorMessage *result;
12595 * A pointer to the contents in the error state.
12596 * Reading from this pointer when `result_ok` is set is undefined.
12598 struct LDKDecodeError *err;
12599 } LDKCResult_ErrorMessageDecodeErrorZPtr;
12602 * A CResult_ErrorMessageDecodeErrorZ represents the result of a fallible operation,
12603 * containing a crate::lightning::ln::msgs::ErrorMessage on success and a crate::lightning::ln::msgs::DecodeError on failure.
12604 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
12606 typedef struct LDKCResult_ErrorMessageDecodeErrorZ {
12608 * The contents of this CResult_ErrorMessageDecodeErrorZ, accessible via either
12609 * `err` or `result` depending on the state of `result_ok`.
12611 union LDKCResult_ErrorMessageDecodeErrorZPtr contents;
12613 * Whether this CResult_ErrorMessageDecodeErrorZ represents a success state.
12616 } LDKCResult_ErrorMessageDecodeErrorZ;
12619 * The contents of CResult_WarningMessageDecodeErrorZ
12621 typedef union LDKCResult_WarningMessageDecodeErrorZPtr {
12623 * A pointer to the contents in the success state.
12624 * Reading from this pointer when `result_ok` is not set is undefined.
12626 struct LDKWarningMessage *result;
12628 * A pointer to the contents in the error state.
12629 * Reading from this pointer when `result_ok` is set is undefined.
12631 struct LDKDecodeError *err;
12632 } LDKCResult_WarningMessageDecodeErrorZPtr;
12635 * A CResult_WarningMessageDecodeErrorZ represents the result of a fallible operation,
12636 * containing a crate::lightning::ln::msgs::WarningMessage on success and a crate::lightning::ln::msgs::DecodeError on failure.
12637 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
12639 typedef struct LDKCResult_WarningMessageDecodeErrorZ {
12641 * The contents of this CResult_WarningMessageDecodeErrorZ, accessible via either
12642 * `err` or `result` depending on the state of `result_ok`.
12644 union LDKCResult_WarningMessageDecodeErrorZPtr contents;
12646 * Whether this CResult_WarningMessageDecodeErrorZ represents a success state.
12649 } LDKCResult_WarningMessageDecodeErrorZ;
12652 * The contents of CResult_UnsignedNodeAnnouncementDecodeErrorZ
12654 typedef union LDKCResult_UnsignedNodeAnnouncementDecodeErrorZPtr {
12656 * A pointer to the contents in the success state.
12657 * Reading from this pointer when `result_ok` is not set is undefined.
12659 struct LDKUnsignedNodeAnnouncement *result;
12661 * A pointer to the contents in the error state.
12662 * Reading from this pointer when `result_ok` is set is undefined.
12664 struct LDKDecodeError *err;
12665 } LDKCResult_UnsignedNodeAnnouncementDecodeErrorZPtr;
12668 * A CResult_UnsignedNodeAnnouncementDecodeErrorZ represents the result of a fallible operation,
12669 * containing a crate::lightning::ln::msgs::UnsignedNodeAnnouncement on success and a crate::lightning::ln::msgs::DecodeError on failure.
12670 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
12672 typedef struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ {
12674 * The contents of this CResult_UnsignedNodeAnnouncementDecodeErrorZ, accessible via either
12675 * `err` or `result` depending on the state of `result_ok`.
12677 union LDKCResult_UnsignedNodeAnnouncementDecodeErrorZPtr contents;
12679 * Whether this CResult_UnsignedNodeAnnouncementDecodeErrorZ represents a success state.
12682 } LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ;
12685 * The contents of CResult_NodeAnnouncementDecodeErrorZ
12687 typedef union LDKCResult_NodeAnnouncementDecodeErrorZPtr {
12689 * A pointer to the contents in the success state.
12690 * Reading from this pointer when `result_ok` is not set is undefined.
12692 struct LDKNodeAnnouncement *result;
12694 * A pointer to the contents in the error state.
12695 * Reading from this pointer when `result_ok` is set is undefined.
12697 struct LDKDecodeError *err;
12698 } LDKCResult_NodeAnnouncementDecodeErrorZPtr;
12701 * A CResult_NodeAnnouncementDecodeErrorZ represents the result of a fallible operation,
12702 * containing a crate::lightning::ln::msgs::NodeAnnouncement on success and a crate::lightning::ln::msgs::DecodeError on failure.
12703 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
12705 typedef struct LDKCResult_NodeAnnouncementDecodeErrorZ {
12707 * The contents of this CResult_NodeAnnouncementDecodeErrorZ, accessible via either
12708 * `err` or `result` depending on the state of `result_ok`.
12710 union LDKCResult_NodeAnnouncementDecodeErrorZPtr contents;
12712 * Whether this CResult_NodeAnnouncementDecodeErrorZ represents a success state.
12715 } LDKCResult_NodeAnnouncementDecodeErrorZ;
12718 * The contents of CResult_QueryShortChannelIdsDecodeErrorZ
12720 typedef union LDKCResult_QueryShortChannelIdsDecodeErrorZPtr {
12722 * A pointer to the contents in the success state.
12723 * Reading from this pointer when `result_ok` is not set is undefined.
12725 struct LDKQueryShortChannelIds *result;
12727 * A pointer to the contents in the error state.
12728 * Reading from this pointer when `result_ok` is set is undefined.
12730 struct LDKDecodeError *err;
12731 } LDKCResult_QueryShortChannelIdsDecodeErrorZPtr;
12734 * A CResult_QueryShortChannelIdsDecodeErrorZ represents the result of a fallible operation,
12735 * containing a crate::lightning::ln::msgs::QueryShortChannelIds on success and a crate::lightning::ln::msgs::DecodeError on failure.
12736 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
12738 typedef struct LDKCResult_QueryShortChannelIdsDecodeErrorZ {
12740 * The contents of this CResult_QueryShortChannelIdsDecodeErrorZ, accessible via either
12741 * `err` or `result` depending on the state of `result_ok`.
12743 union LDKCResult_QueryShortChannelIdsDecodeErrorZPtr contents;
12745 * Whether this CResult_QueryShortChannelIdsDecodeErrorZ represents a success state.
12748 } LDKCResult_QueryShortChannelIdsDecodeErrorZ;
12753 * A [`reply_short_channel_ids_end`] message is sent as a reply to a
12754 * message. The query recipient makes a best
12755 * effort to respond based on their local network view which may not be
12756 * a perfect view of the network.
12758 * [`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
12760 typedef struct MUST_USE_STRUCT LDKReplyShortChannelIdsEnd {
12762 * A pointer to the opaque Rust object.
12763 * Nearly everywhere, inner must be non-null, however in places where
12764 * the Rust equivalent takes an Option, it may be set to null to indicate None.
12766 LDKnativeReplyShortChannelIdsEnd *inner;
12768 * Indicates that this is the only struct which contains the same pointer.
12769 * Rust functions which take ownership of an object provided via an argument require
12770 * this to be true and invalidate the object pointed to by inner.
12773 } LDKReplyShortChannelIdsEnd;
12776 * The contents of CResult_ReplyShortChannelIdsEndDecodeErrorZ
12778 typedef union LDKCResult_ReplyShortChannelIdsEndDecodeErrorZPtr {
12780 * A pointer to the contents in the success state.
12781 * Reading from this pointer when `result_ok` is not set is undefined.
12783 struct LDKReplyShortChannelIdsEnd *result;
12785 * A pointer to the contents in the error state.
12786 * Reading from this pointer when `result_ok` is set is undefined.
12788 struct LDKDecodeError *err;
12789 } LDKCResult_ReplyShortChannelIdsEndDecodeErrorZPtr;
12792 * A CResult_ReplyShortChannelIdsEndDecodeErrorZ represents the result of a fallible operation,
12793 * containing a crate::lightning::ln::msgs::ReplyShortChannelIdsEnd on success and a crate::lightning::ln::msgs::DecodeError on failure.
12794 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
12796 typedef struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ {
12798 * The contents of this CResult_ReplyShortChannelIdsEndDecodeErrorZ, accessible via either
12799 * `err` or `result` depending on the state of `result_ok`.
12801 union LDKCResult_ReplyShortChannelIdsEndDecodeErrorZPtr contents;
12803 * Whether this CResult_ReplyShortChannelIdsEndDecodeErrorZ represents a success state.
12806 } LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ;
12809 * The contents of CResult_QueryChannelRangeDecodeErrorZ
12811 typedef union LDKCResult_QueryChannelRangeDecodeErrorZPtr {
12813 * A pointer to the contents in the success state.
12814 * Reading from this pointer when `result_ok` is not set is undefined.
12816 struct LDKQueryChannelRange *result;
12818 * A pointer to the contents in the error state.
12819 * Reading from this pointer when `result_ok` is set is undefined.
12821 struct LDKDecodeError *err;
12822 } LDKCResult_QueryChannelRangeDecodeErrorZPtr;
12825 * A CResult_QueryChannelRangeDecodeErrorZ represents the result of a fallible operation,
12826 * containing a crate::lightning::ln::msgs::QueryChannelRange on success and a crate::lightning::ln::msgs::DecodeError on failure.
12827 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
12829 typedef struct LDKCResult_QueryChannelRangeDecodeErrorZ {
12831 * The contents of this CResult_QueryChannelRangeDecodeErrorZ, accessible via either
12832 * `err` or `result` depending on the state of `result_ok`.
12834 union LDKCResult_QueryChannelRangeDecodeErrorZPtr contents;
12836 * Whether this CResult_QueryChannelRangeDecodeErrorZ represents a success state.
12839 } LDKCResult_QueryChannelRangeDecodeErrorZ;
12842 * The contents of CResult_ReplyChannelRangeDecodeErrorZ
12844 typedef union LDKCResult_ReplyChannelRangeDecodeErrorZPtr {
12846 * A pointer to the contents in the success state.
12847 * Reading from this pointer when `result_ok` is not set is undefined.
12849 struct LDKReplyChannelRange *result;
12851 * A pointer to the contents in the error state.
12852 * Reading from this pointer when `result_ok` is set is undefined.
12854 struct LDKDecodeError *err;
12855 } LDKCResult_ReplyChannelRangeDecodeErrorZPtr;
12858 * A CResult_ReplyChannelRangeDecodeErrorZ represents the result of a fallible operation,
12859 * containing a crate::lightning::ln::msgs::ReplyChannelRange on success and a crate::lightning::ln::msgs::DecodeError on failure.
12860 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
12862 typedef struct LDKCResult_ReplyChannelRangeDecodeErrorZ {
12864 * The contents of this CResult_ReplyChannelRangeDecodeErrorZ, accessible via either
12865 * `err` or `result` depending on the state of `result_ok`.
12867 union LDKCResult_ReplyChannelRangeDecodeErrorZPtr contents;
12869 * Whether this CResult_ReplyChannelRangeDecodeErrorZ represents a success state.
12872 } LDKCResult_ReplyChannelRangeDecodeErrorZ;
12875 * The contents of CResult_GossipTimestampFilterDecodeErrorZ
12877 typedef union LDKCResult_GossipTimestampFilterDecodeErrorZPtr {
12879 * A pointer to the contents in the success state.
12880 * Reading from this pointer when `result_ok` is not set is undefined.
12882 struct LDKGossipTimestampFilter *result;
12884 * A pointer to the contents in the error state.
12885 * Reading from this pointer when `result_ok` is set is undefined.
12887 struct LDKDecodeError *err;
12888 } LDKCResult_GossipTimestampFilterDecodeErrorZPtr;
12891 * A CResult_GossipTimestampFilterDecodeErrorZ represents the result of a fallible operation,
12892 * containing a crate::lightning::ln::msgs::GossipTimestampFilter on success and a crate::lightning::ln::msgs::DecodeError on failure.
12893 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
12895 typedef struct LDKCResult_GossipTimestampFilterDecodeErrorZ {
12897 * The contents of this CResult_GossipTimestampFilterDecodeErrorZ, accessible via either
12898 * `err` or `result` depending on the state of `result_ok`.
12900 union LDKCResult_GossipTimestampFilterDecodeErrorZPtr contents;
12902 * Whether this CResult_GossipTimestampFilterDecodeErrorZ represents a success state.
12905 } LDKCResult_GossipTimestampFilterDecodeErrorZ;
12908 * A dynamically-allocated array of crate::lightning::ln::channelmanager::PhantomRouteHintss of arbitrary size.
12909 * This corresponds to std::vector in C++
12911 typedef struct LDKCVec_PhantomRouteHintsZ {
12913 * The elements in the array.
12914 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
12916 struct LDKPhantomRouteHints *data;
12918 * The number of elements pointed to by `data`.
12921 } LDKCVec_PhantomRouteHintsZ;
12926 * Represents a syntactically and semantically correct lightning BOLT11 invoice.
12928 * There are three ways to construct a `Bolt11Invoice`:
12929 * 1. using [`InvoiceBuilder`]
12930 * 2. using [`Bolt11Invoice::from_signed`]
12931 * 3. using `str::parse::<Bolt11Invoice>(&str)` (see [`Bolt11Invoice::from_str`])
12933 * [`Bolt11Invoice::from_str`]: crate::Bolt11Invoice#impl-FromStr
12935 typedef struct MUST_USE_STRUCT LDKBolt11Invoice {
12937 * A pointer to the opaque Rust object.
12938 * Nearly everywhere, inner must be non-null, however in places where
12939 * the Rust equivalent takes an Option, it may be set to null to indicate None.
12941 LDKnativeBolt11Invoice *inner;
12943 * Indicates that this is the only struct which contains the same pointer.
12944 * Rust functions which take ownership of an object provided via an argument require
12945 * this to be true and invalidate the object pointed to by inner.
12948 } LDKBolt11Invoice;
12951 * When signing using a fallible method either an user-supplied `SignError` or a [`CreationError`]
12954 typedef enum LDKSignOrCreationError_Tag {
12956 * An error occurred during signing
12958 LDKSignOrCreationError_SignError,
12960 * An error occurred while building the transaction
12962 LDKSignOrCreationError_CreationError,
12964 * Must be last for serialization purposes
12966 LDKSignOrCreationError_Sentinel,
12967 } LDKSignOrCreationError_Tag;
12969 typedef struct MUST_USE_STRUCT LDKSignOrCreationError {
12970 LDKSignOrCreationError_Tag tag;
12973 enum LDKCreationError creation_error;
12976 } LDKSignOrCreationError;
12979 * The contents of CResult_Bolt11InvoiceSignOrCreationErrorZ
12981 typedef union LDKCResult_Bolt11InvoiceSignOrCreationErrorZPtr {
12983 * A pointer to the contents in the success state.
12984 * Reading from this pointer when `result_ok` is not set is undefined.
12986 struct LDKBolt11Invoice *result;
12988 * A pointer to the contents in the error state.
12989 * Reading from this pointer when `result_ok` is set is undefined.
12991 struct LDKSignOrCreationError *err;
12992 } LDKCResult_Bolt11InvoiceSignOrCreationErrorZPtr;
12995 * A CResult_Bolt11InvoiceSignOrCreationErrorZ represents the result of a fallible operation,
12996 * containing a crate::lightning_invoice::Bolt11Invoice on success and a crate::lightning_invoice::SignOrCreationError on failure.
12997 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
12999 typedef struct LDKCResult_Bolt11InvoiceSignOrCreationErrorZ {
13001 * The contents of this CResult_Bolt11InvoiceSignOrCreationErrorZ, accessible via either
13002 * `err` or `result` depending on the state of `result_ok`.
13004 union LDKCResult_Bolt11InvoiceSignOrCreationErrorZPtr contents;
13006 * Whether this CResult_Bolt11InvoiceSignOrCreationErrorZ represents a success state.
13009 } LDKCResult_Bolt11InvoiceSignOrCreationErrorZ;
13014 * A simple future which can complete once, and calls some callback(s) when it does so.
13016 * Clones can be made and all futures cloned from the same source will complete at the same time.
13018 typedef struct MUST_USE_STRUCT LDKFuture {
13020 * A pointer to the opaque Rust object.
13021 * Nearly everywhere, inner must be non-null, however in places where
13022 * the Rust equivalent takes an Option, it may be set to null to indicate None.
13024 LDKnativeFuture *inner;
13026 * Indicates that this is the only struct which contains the same pointer.
13027 * Rust functions which take ownership of an object provided via an argument require
13028 * this to be true and invalidate the object pointed to by inner.
13034 * A dynamically-allocated array of crate::lightning::util::wakers::Futures of arbitrary size.
13035 * This corresponds to std::vector in C++
13037 typedef struct LDKCVec_FutureZ {
13039 * The elements in the array.
13040 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
13042 struct LDKFuture *data;
13044 * The number of elements pointed to by `data`.
13050 * The contents of CResult_OffersMessageDecodeErrorZ
13052 typedef union LDKCResult_OffersMessageDecodeErrorZPtr {
13054 * A pointer to the contents in the success state.
13055 * Reading from this pointer when `result_ok` is not set is undefined.
13057 struct LDKOffersMessage *result;
13059 * A pointer to the contents in the error state.
13060 * Reading from this pointer when `result_ok` is set is undefined.
13062 struct LDKDecodeError *err;
13063 } LDKCResult_OffersMessageDecodeErrorZPtr;
13066 * A CResult_OffersMessageDecodeErrorZ represents the result of a fallible operation,
13067 * containing a crate::lightning::onion_message::offers::OffersMessage on success and a crate::lightning::ln::msgs::DecodeError on failure.
13068 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
13070 typedef struct LDKCResult_OffersMessageDecodeErrorZ {
13072 * The contents of this CResult_OffersMessageDecodeErrorZ, accessible via either
13073 * `err` or `result` depending on the state of `result_ok`.
13075 union LDKCResult_OffersMessageDecodeErrorZPtr contents;
13077 * Whether this CResult_OffersMessageDecodeErrorZ represents a success state.
13080 } LDKCResult_OffersMessageDecodeErrorZ;
13083 * An enum which can either contain a crate::lightning::ln::chan_utils::HTLCClaim or not
13085 typedef enum LDKCOption_HTLCClaimZ_Tag {
13087 * When we're in this state, this COption_HTLCClaimZ contains a crate::lightning::ln::chan_utils::HTLCClaim
13089 LDKCOption_HTLCClaimZ_Some,
13091 * When we're in this state, this COption_HTLCClaimZ contains nothing
13093 LDKCOption_HTLCClaimZ_None,
13095 * Must be last for serialization purposes
13097 LDKCOption_HTLCClaimZ_Sentinel,
13098 } LDKCOption_HTLCClaimZ_Tag;
13100 typedef struct LDKCOption_HTLCClaimZ {
13101 LDKCOption_HTLCClaimZ_Tag tag;
13104 enum LDKHTLCClaim some;
13107 } LDKCOption_HTLCClaimZ;
13112 * Implements the per-commitment secret storage scheme from
13113 * [BOLT 3](https://github.com/lightning/bolts/blob/dcbf8583976df087c79c3ce0b535311212e6812d/03-transactions.md#efficient-per-commitment-secret-storage).
13115 * Allows us to keep track of all of the revocation secrets of our counterparty in just 50*32 bytes
13118 typedef struct MUST_USE_STRUCT LDKCounterpartyCommitmentSecrets {
13120 * A pointer to the opaque Rust object.
13121 * Nearly everywhere, inner must be non-null, however in places where
13122 * the Rust equivalent takes an Option, it may be set to null to indicate None.
13124 LDKnativeCounterpartyCommitmentSecrets *inner;
13126 * Indicates that this is the only struct which contains the same pointer.
13127 * Rust functions which take ownership of an object provided via an argument require
13128 * this to be true and invalidate the object pointed to by inner.
13131 } LDKCounterpartyCommitmentSecrets;
13134 * The contents of CResult_CounterpartyCommitmentSecretsDecodeErrorZ
13136 typedef union LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZPtr {
13138 * A pointer to the contents in the success state.
13139 * Reading from this pointer when `result_ok` is not set is undefined.
13141 struct LDKCounterpartyCommitmentSecrets *result;
13143 * A pointer to the contents in the error state.
13144 * Reading from this pointer when `result_ok` is set is undefined.
13146 struct LDKDecodeError *err;
13147 } LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZPtr;
13150 * A CResult_CounterpartyCommitmentSecretsDecodeErrorZ represents the result of a fallible operation,
13151 * containing a crate::lightning::ln::chan_utils::CounterpartyCommitmentSecrets on success and a crate::lightning::ln::msgs::DecodeError on failure.
13152 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
13154 typedef struct LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ {
13156 * The contents of this CResult_CounterpartyCommitmentSecretsDecodeErrorZ, accessible via either
13157 * `err` or `result` depending on the state of `result_ok`.
13159 union LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZPtr contents;
13161 * Whether this CResult_CounterpartyCommitmentSecretsDecodeErrorZ represents a success state.
13164 } LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ;
13169 * The set of public keys which are used in the creation of one commitment transaction.
13170 * These are derived from the channel base keys and per-commitment data.
13172 * A broadcaster key is provided from potential broadcaster of the computed transaction.
13173 * A countersignatory key is coming from a protocol participant unable to broadcast the
13176 * These keys are assumed to be good, either because the code derived them from
13177 * channel basepoints via the new function, or they were obtained via
13178 * CommitmentTransaction.trust().keys() because we trusted the source of the
13179 * pre-calculated keys.
13181 typedef struct MUST_USE_STRUCT LDKTxCreationKeys {
13183 * A pointer to the opaque Rust object.
13184 * Nearly everywhere, inner must be non-null, however in places where
13185 * the Rust equivalent takes an Option, it may be set to null to indicate None.
13187 LDKnativeTxCreationKeys *inner;
13189 * Indicates that this is the only struct which contains the same pointer.
13190 * Rust functions which take ownership of an object provided via an argument require
13191 * this to be true and invalidate the object pointed to by inner.
13194 } LDKTxCreationKeys;
13197 * The contents of CResult_TxCreationKeysDecodeErrorZ
13199 typedef union LDKCResult_TxCreationKeysDecodeErrorZPtr {
13201 * A pointer to the contents in the success state.
13202 * Reading from this pointer when `result_ok` is not set is undefined.
13204 struct LDKTxCreationKeys *result;
13206 * A pointer to the contents in the error state.
13207 * Reading from this pointer when `result_ok` is set is undefined.
13209 struct LDKDecodeError *err;
13210 } LDKCResult_TxCreationKeysDecodeErrorZPtr;
13213 * A CResult_TxCreationKeysDecodeErrorZ represents the result of a fallible operation,
13214 * containing a crate::lightning::ln::chan_utils::TxCreationKeys on success and a crate::lightning::ln::msgs::DecodeError on failure.
13215 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
13217 typedef struct LDKCResult_TxCreationKeysDecodeErrorZ {
13219 * The contents of this CResult_TxCreationKeysDecodeErrorZ, accessible via either
13220 * `err` or `result` depending on the state of `result_ok`.
13222 union LDKCResult_TxCreationKeysDecodeErrorZPtr contents;
13224 * Whether this CResult_TxCreationKeysDecodeErrorZ represents a success state.
13227 } LDKCResult_TxCreationKeysDecodeErrorZ;
13230 * The contents of CResult_ChannelPublicKeysDecodeErrorZ
13232 typedef union LDKCResult_ChannelPublicKeysDecodeErrorZPtr {
13234 * A pointer to the contents in the success state.
13235 * Reading from this pointer when `result_ok` is not set is undefined.
13237 struct LDKChannelPublicKeys *result;
13239 * A pointer to the contents in the error state.
13240 * Reading from this pointer when `result_ok` is set is undefined.
13242 struct LDKDecodeError *err;
13243 } LDKCResult_ChannelPublicKeysDecodeErrorZPtr;
13246 * A CResult_ChannelPublicKeysDecodeErrorZ represents the result of a fallible operation,
13247 * containing a crate::lightning::ln::chan_utils::ChannelPublicKeys on success and a crate::lightning::ln::msgs::DecodeError on failure.
13248 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
13250 typedef struct LDKCResult_ChannelPublicKeysDecodeErrorZ {
13252 * The contents of this CResult_ChannelPublicKeysDecodeErrorZ, accessible via either
13253 * `err` or `result` depending on the state of `result_ok`.
13255 union LDKCResult_ChannelPublicKeysDecodeErrorZPtr contents;
13257 * Whether this CResult_ChannelPublicKeysDecodeErrorZ represents a success state.
13260 } LDKCResult_ChannelPublicKeysDecodeErrorZ;
13263 * The contents of CResult_HTLCOutputInCommitmentDecodeErrorZ
13265 typedef union LDKCResult_HTLCOutputInCommitmentDecodeErrorZPtr {
13267 * A pointer to the contents in the success state.
13268 * Reading from this pointer when `result_ok` is not set is undefined.
13270 struct LDKHTLCOutputInCommitment *result;
13272 * A pointer to the contents in the error state.
13273 * Reading from this pointer when `result_ok` is set is undefined.
13275 struct LDKDecodeError *err;
13276 } LDKCResult_HTLCOutputInCommitmentDecodeErrorZPtr;
13279 * A CResult_HTLCOutputInCommitmentDecodeErrorZ represents the result of a fallible operation,
13280 * containing a crate::lightning::ln::chan_utils::HTLCOutputInCommitment on success and a crate::lightning::ln::msgs::DecodeError on failure.
13281 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
13283 typedef struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ {
13285 * The contents of this CResult_HTLCOutputInCommitmentDecodeErrorZ, accessible via either
13286 * `err` or `result` depending on the state of `result_ok`.
13288 union LDKCResult_HTLCOutputInCommitmentDecodeErrorZPtr contents;
13290 * Whether this CResult_HTLCOutputInCommitmentDecodeErrorZ represents a success state.
13293 } LDKCResult_HTLCOutputInCommitmentDecodeErrorZ;
13298 * Late-bound per-channel counterparty data used to build transactions.
13300 typedef struct MUST_USE_STRUCT LDKCounterpartyChannelTransactionParameters {
13302 * A pointer to the opaque Rust object.
13303 * Nearly everywhere, inner must be non-null, however in places where
13304 * the Rust equivalent takes an Option, it may be set to null to indicate None.
13306 LDKnativeCounterpartyChannelTransactionParameters *inner;
13308 * Indicates that this is the only struct which contains the same pointer.
13309 * Rust functions which take ownership of an object provided via an argument require
13310 * this to be true and invalidate the object pointed to by inner.
13313 } LDKCounterpartyChannelTransactionParameters;
13316 * The contents of CResult_CounterpartyChannelTransactionParametersDecodeErrorZ
13318 typedef union LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZPtr {
13320 * A pointer to the contents in the success state.
13321 * Reading from this pointer when `result_ok` is not set is undefined.
13323 struct LDKCounterpartyChannelTransactionParameters *result;
13325 * A pointer to the contents in the error state.
13326 * Reading from this pointer when `result_ok` is set is undefined.
13328 struct LDKDecodeError *err;
13329 } LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZPtr;
13332 * A CResult_CounterpartyChannelTransactionParametersDecodeErrorZ represents the result of a fallible operation,
13333 * containing a crate::lightning::ln::chan_utils::CounterpartyChannelTransactionParameters on success and a crate::lightning::ln::msgs::DecodeError on failure.
13334 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
13336 typedef struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ {
13338 * The contents of this CResult_CounterpartyChannelTransactionParametersDecodeErrorZ, accessible via either
13339 * `err` or `result` depending on the state of `result_ok`.
13341 union LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZPtr contents;
13343 * Whether this CResult_CounterpartyChannelTransactionParametersDecodeErrorZ represents a success state.
13346 } LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ;
13349 * The contents of CResult_ChannelTransactionParametersDecodeErrorZ
13351 typedef union LDKCResult_ChannelTransactionParametersDecodeErrorZPtr {
13353 * A pointer to the contents in the success state.
13354 * Reading from this pointer when `result_ok` is not set is undefined.
13356 struct LDKChannelTransactionParameters *result;
13358 * A pointer to the contents in the error state.
13359 * Reading from this pointer when `result_ok` is set is undefined.
13361 struct LDKDecodeError *err;
13362 } LDKCResult_ChannelTransactionParametersDecodeErrorZPtr;
13365 * A CResult_ChannelTransactionParametersDecodeErrorZ represents the result of a fallible operation,
13366 * containing a crate::lightning::ln::chan_utils::ChannelTransactionParameters on success and a crate::lightning::ln::msgs::DecodeError on failure.
13367 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
13369 typedef struct LDKCResult_ChannelTransactionParametersDecodeErrorZ {
13371 * The contents of this CResult_ChannelTransactionParametersDecodeErrorZ, accessible via either
13372 * `err` or `result` depending on the state of `result_ok`.
13374 union LDKCResult_ChannelTransactionParametersDecodeErrorZPtr contents;
13376 * Whether this CResult_ChannelTransactionParametersDecodeErrorZ represents a success state.
13379 } LDKCResult_ChannelTransactionParametersDecodeErrorZ;
13382 * The contents of CResult_HolderCommitmentTransactionDecodeErrorZ
13384 typedef union LDKCResult_HolderCommitmentTransactionDecodeErrorZPtr {
13386 * A pointer to the contents in the success state.
13387 * Reading from this pointer when `result_ok` is not set is undefined.
13389 struct LDKHolderCommitmentTransaction *result;
13391 * A pointer to the contents in the error state.
13392 * Reading from this pointer when `result_ok` is set is undefined.
13394 struct LDKDecodeError *err;
13395 } LDKCResult_HolderCommitmentTransactionDecodeErrorZPtr;
13398 * A CResult_HolderCommitmentTransactionDecodeErrorZ represents the result of a fallible operation,
13399 * containing a crate::lightning::ln::chan_utils::HolderCommitmentTransaction on success and a crate::lightning::ln::msgs::DecodeError on failure.
13400 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
13402 typedef struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ {
13404 * The contents of this CResult_HolderCommitmentTransactionDecodeErrorZ, accessible via either
13405 * `err` or `result` depending on the state of `result_ok`.
13407 union LDKCResult_HolderCommitmentTransactionDecodeErrorZPtr contents;
13409 * Whether this CResult_HolderCommitmentTransactionDecodeErrorZ represents a success state.
13412 } LDKCResult_HolderCommitmentTransactionDecodeErrorZ;
13417 * A pre-built Bitcoin commitment transaction and its txid.
13419 typedef struct MUST_USE_STRUCT LDKBuiltCommitmentTransaction {
13421 * A pointer to the opaque Rust object.
13422 * Nearly everywhere, inner must be non-null, however in places where
13423 * the Rust equivalent takes an Option, it may be set to null to indicate None.
13425 LDKnativeBuiltCommitmentTransaction *inner;
13427 * Indicates that this is the only struct which contains the same pointer.
13428 * Rust functions which take ownership of an object provided via an argument require
13429 * this to be true and invalidate the object pointed to by inner.
13432 } LDKBuiltCommitmentTransaction;
13435 * The contents of CResult_BuiltCommitmentTransactionDecodeErrorZ
13437 typedef union LDKCResult_BuiltCommitmentTransactionDecodeErrorZPtr {
13439 * A pointer to the contents in the success state.
13440 * Reading from this pointer when `result_ok` is not set is undefined.
13442 struct LDKBuiltCommitmentTransaction *result;
13444 * A pointer to the contents in the error state.
13445 * Reading from this pointer when `result_ok` is set is undefined.
13447 struct LDKDecodeError *err;
13448 } LDKCResult_BuiltCommitmentTransactionDecodeErrorZPtr;
13451 * A CResult_BuiltCommitmentTransactionDecodeErrorZ represents the result of a fallible operation,
13452 * containing a crate::lightning::ln::chan_utils::BuiltCommitmentTransaction on success and a crate::lightning::ln::msgs::DecodeError on failure.
13453 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
13455 typedef struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ {
13457 * The contents of this CResult_BuiltCommitmentTransactionDecodeErrorZ, accessible via either
13458 * `err` or `result` depending on the state of `result_ok`.
13460 union LDKCResult_BuiltCommitmentTransactionDecodeErrorZPtr contents;
13462 * Whether this CResult_BuiltCommitmentTransactionDecodeErrorZ represents a success state.
13465 } LDKCResult_BuiltCommitmentTransactionDecodeErrorZ;
13470 * A wrapper on ClosingTransaction indicating that the built bitcoin
13471 * transaction is trusted.
13473 * See trust() and verify() functions on CommitmentTransaction.
13475 * This structure implements Deref.
13477 typedef struct MUST_USE_STRUCT LDKTrustedClosingTransaction {
13479 * A pointer to the opaque Rust object.
13480 * Nearly everywhere, inner must be non-null, however in places where
13481 * the Rust equivalent takes an Option, it may be set to null to indicate None.
13483 LDKnativeTrustedClosingTransaction *inner;
13485 * Indicates that this is the only struct which contains the same pointer.
13486 * Rust functions which take ownership of an object provided via an argument require
13487 * this to be true and invalidate the object pointed to by inner.
13490 } LDKTrustedClosingTransaction;
13493 * The contents of CResult_TrustedClosingTransactionNoneZ
13495 typedef union LDKCResult_TrustedClosingTransactionNoneZPtr {
13497 * A pointer to the contents in the success state.
13498 * Reading from this pointer when `result_ok` is not set is undefined.
13500 struct LDKTrustedClosingTransaction *result;
13502 * Note that this value is always NULL, as there are no contents in the Err variant
13505 } LDKCResult_TrustedClosingTransactionNoneZPtr;
13508 * A CResult_TrustedClosingTransactionNoneZ represents the result of a fallible operation,
13509 * containing a crate::lightning::ln::chan_utils::TrustedClosingTransaction on success and a () on failure.
13510 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
13512 typedef struct LDKCResult_TrustedClosingTransactionNoneZ {
13514 * The contents of this CResult_TrustedClosingTransactionNoneZ, accessible via either
13515 * `err` or `result` depending on the state of `result_ok`.
13517 union LDKCResult_TrustedClosingTransactionNoneZPtr contents;
13519 * Whether this CResult_TrustedClosingTransactionNoneZ represents a success state.
13522 } LDKCResult_TrustedClosingTransactionNoneZ;
13525 * The contents of CResult_CommitmentTransactionDecodeErrorZ
13527 typedef union LDKCResult_CommitmentTransactionDecodeErrorZPtr {
13529 * A pointer to the contents in the success state.
13530 * Reading from this pointer when `result_ok` is not set is undefined.
13532 struct LDKCommitmentTransaction *result;
13534 * A pointer to the contents in the error state.
13535 * Reading from this pointer when `result_ok` is set is undefined.
13537 struct LDKDecodeError *err;
13538 } LDKCResult_CommitmentTransactionDecodeErrorZPtr;
13541 * A CResult_CommitmentTransactionDecodeErrorZ represents the result of a fallible operation,
13542 * containing a crate::lightning::ln::chan_utils::CommitmentTransaction on success and a crate::lightning::ln::msgs::DecodeError on failure.
13543 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
13545 typedef struct LDKCResult_CommitmentTransactionDecodeErrorZ {
13547 * The contents of this CResult_CommitmentTransactionDecodeErrorZ, accessible via either
13548 * `err` or `result` depending on the state of `result_ok`.
13550 union LDKCResult_CommitmentTransactionDecodeErrorZPtr contents;
13552 * Whether this CResult_CommitmentTransactionDecodeErrorZ represents a success state.
13555 } LDKCResult_CommitmentTransactionDecodeErrorZ;
13560 * A wrapper on CommitmentTransaction indicating that the derived fields (the built bitcoin
13561 * transaction and the transaction creation keys) are trusted.
13563 * See trust() and verify() functions on CommitmentTransaction.
13565 * This structure implements Deref.
13567 typedef struct MUST_USE_STRUCT LDKTrustedCommitmentTransaction {
13569 * A pointer to the opaque Rust object.
13570 * Nearly everywhere, inner must be non-null, however in places where
13571 * the Rust equivalent takes an Option, it may be set to null to indicate None.
13573 LDKnativeTrustedCommitmentTransaction *inner;
13575 * Indicates that this is the only struct which contains the same pointer.
13576 * Rust functions which take ownership of an object provided via an argument require
13577 * this to be true and invalidate the object pointed to by inner.
13580 } LDKTrustedCommitmentTransaction;
13583 * The contents of CResult_TrustedCommitmentTransactionNoneZ
13585 typedef union LDKCResult_TrustedCommitmentTransactionNoneZPtr {
13587 * A pointer to the contents in the success state.
13588 * Reading from this pointer when `result_ok` is not set is undefined.
13590 struct LDKTrustedCommitmentTransaction *result;
13592 * Note that this value is always NULL, as there are no contents in the Err variant
13595 } LDKCResult_TrustedCommitmentTransactionNoneZPtr;
13598 * A CResult_TrustedCommitmentTransactionNoneZ represents the result of a fallible operation,
13599 * containing a crate::lightning::ln::chan_utils::TrustedCommitmentTransaction on success and a () on failure.
13600 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
13602 typedef struct LDKCResult_TrustedCommitmentTransactionNoneZ {
13604 * The contents of this CResult_TrustedCommitmentTransactionNoneZ, accessible via either
13605 * `err` or `result` depending on the state of `result_ok`.
13607 union LDKCResult_TrustedCommitmentTransactionNoneZPtr contents;
13609 * Whether this CResult_TrustedCommitmentTransactionNoneZ represents a success state.
13612 } LDKCResult_TrustedCommitmentTransactionNoneZ;
13615 * The contents of CResult_CVec_ECDSASignatureZNoneZ
13617 typedef union LDKCResult_CVec_ECDSASignatureZNoneZPtr {
13619 * A pointer to the contents in the success state.
13620 * Reading from this pointer when `result_ok` is not set is undefined.
13622 struct LDKCVec_ECDSASignatureZ *result;
13624 * Note that this value is always NULL, as there are no contents in the Err variant
13627 } LDKCResult_CVec_ECDSASignatureZNoneZPtr;
13630 * A CResult_CVec_ECDSASignatureZNoneZ represents the result of a fallible operation,
13631 * containing a crate::c_types::derived::CVec_ECDSASignatureZ on success and a () on failure.
13632 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
13634 typedef struct LDKCResult_CVec_ECDSASignatureZNoneZ {
13636 * The contents of this CResult_CVec_ECDSASignatureZNoneZ, accessible via either
13637 * `err` or `result` depending on the state of `result_ok`.
13639 union LDKCResult_CVec_ECDSASignatureZNoneZPtr contents;
13641 * Whether this CResult_CVec_ECDSASignatureZNoneZ represents a success state.
13644 } LDKCResult_CVec_ECDSASignatureZNoneZ;
13647 * An enum which can either contain a usize or not
13649 typedef enum LDKCOption_usizeZ_Tag {
13651 * When we're in this state, this COption_usizeZ contains a usize
13653 LDKCOption_usizeZ_Some,
13655 * When we're in this state, this COption_usizeZ contains nothing
13657 LDKCOption_usizeZ_None,
13659 * Must be last for serialization purposes
13661 LDKCOption_usizeZ_Sentinel,
13662 } LDKCOption_usizeZ_Tag;
13664 typedef struct LDKCOption_usizeZ {
13665 LDKCOption_usizeZ_Tag tag;
13671 } LDKCOption_usizeZ;
13674 * The contents of CResult_ShutdownScriptDecodeErrorZ
13676 typedef union LDKCResult_ShutdownScriptDecodeErrorZPtr {
13678 * A pointer to the contents in the success state.
13679 * Reading from this pointer when `result_ok` is not set is undefined.
13681 struct LDKShutdownScript *result;
13683 * A pointer to the contents in the error state.
13684 * Reading from this pointer when `result_ok` is set is undefined.
13686 struct LDKDecodeError *err;
13687 } LDKCResult_ShutdownScriptDecodeErrorZPtr;
13690 * A CResult_ShutdownScriptDecodeErrorZ represents the result of a fallible operation,
13691 * containing a crate::lightning::ln::script::ShutdownScript on success and a crate::lightning::ln::msgs::DecodeError on failure.
13692 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
13694 typedef struct LDKCResult_ShutdownScriptDecodeErrorZ {
13696 * The contents of this CResult_ShutdownScriptDecodeErrorZ, accessible via either
13697 * `err` or `result` depending on the state of `result_ok`.
13699 union LDKCResult_ShutdownScriptDecodeErrorZPtr contents;
13701 * Whether this CResult_ShutdownScriptDecodeErrorZ represents a success state.
13704 } LDKCResult_ShutdownScriptDecodeErrorZ;
13709 * An error occurring when converting from [`Script`] to [`ShutdownScript`].
13711 typedef struct MUST_USE_STRUCT LDKInvalidShutdownScript {
13713 * A pointer to the opaque Rust object.
13714 * Nearly everywhere, inner must be non-null, however in places where
13715 * the Rust equivalent takes an Option, it may be set to null to indicate None.
13717 LDKnativeInvalidShutdownScript *inner;
13719 * Indicates that this is the only struct which contains the same pointer.
13720 * Rust functions which take ownership of an object provided via an argument require
13721 * this to be true and invalidate the object pointed to by inner.
13724 } LDKInvalidShutdownScript;
13727 * The contents of CResult_ShutdownScriptInvalidShutdownScriptZ
13729 typedef union LDKCResult_ShutdownScriptInvalidShutdownScriptZPtr {
13731 * A pointer to the contents in the success state.
13732 * Reading from this pointer when `result_ok` is not set is undefined.
13734 struct LDKShutdownScript *result;
13736 * A pointer to the contents in the error state.
13737 * Reading from this pointer when `result_ok` is set is undefined.
13739 struct LDKInvalidShutdownScript *err;
13740 } LDKCResult_ShutdownScriptInvalidShutdownScriptZPtr;
13743 * A CResult_ShutdownScriptInvalidShutdownScriptZ represents the result of a fallible operation,
13744 * containing a crate::lightning::ln::script::ShutdownScript on success and a crate::lightning::ln::script::InvalidShutdownScript on failure.
13745 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
13747 typedef struct LDKCResult_ShutdownScriptInvalidShutdownScriptZ {
13749 * The contents of this CResult_ShutdownScriptInvalidShutdownScriptZ, accessible via either
13750 * `err` or `result` depending on the state of `result_ok`.
13752 union LDKCResult_ShutdownScriptInvalidShutdownScriptZPtr contents;
13754 * Whether this CResult_ShutdownScriptInvalidShutdownScriptZ represents a success state.
13757 } LDKCResult_ShutdownScriptInvalidShutdownScriptZ;
13760 * Some information provided on receipt of payment depends on whether the payment received is a
13761 * spontaneous payment or a \"conventional\" lightning payment that's paying an invoice.
13763 typedef enum LDKPaymentPurpose_Tag {
13765 * Information for receiving a payment that we generated an invoice for.
13767 LDKPaymentPurpose_InvoicePayment,
13769 * Because this is a spontaneous payment, the payer generated their own preimage rather than us
13770 * (the payee) providing a preimage.
13772 LDKPaymentPurpose_SpontaneousPayment,
13774 * Must be last for serialization purposes
13776 LDKPaymentPurpose_Sentinel,
13777 } LDKPaymentPurpose_Tag;
13779 typedef struct LDKPaymentPurpose_LDKInvoicePayment_Body {
13781 * The preimage to the payment_hash, if the payment hash (and secret) were fetched via
13782 * [`ChannelManager::create_inbound_payment`]. If provided, this can be handed directly to
13783 * [`ChannelManager::claim_funds`].
13785 * [`ChannelManager::create_inbound_payment`]: crate::ln::channelmanager::ChannelManager::create_inbound_payment
13786 * [`ChannelManager::claim_funds`]: crate::ln::channelmanager::ChannelManager::claim_funds
13788 struct LDKCOption_ThirtyTwoBytesZ payment_preimage;
13790 * The \"payment secret\". This authenticates the sender to the recipient, preventing a
13791 * number of deanonymization attacks during the routing process.
13792 * It is provided here for your reference, however its accuracy is enforced directly by
13793 * [`ChannelManager`] using the values you previously provided to
13794 * [`ChannelManager::create_inbound_payment`] or
13795 * [`ChannelManager::create_inbound_payment_for_hash`].
13797 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
13798 * [`ChannelManager::create_inbound_payment`]: crate::ln::channelmanager::ChannelManager::create_inbound_payment
13799 * [`ChannelManager::create_inbound_payment_for_hash`]: crate::ln::channelmanager::ChannelManager::create_inbound_payment_for_hash
13801 struct LDKThirtyTwoBytes payment_secret;
13802 } LDKPaymentPurpose_LDKInvoicePayment_Body;
13804 typedef struct MUST_USE_STRUCT LDKPaymentPurpose {
13805 LDKPaymentPurpose_Tag tag;
13807 LDKPaymentPurpose_LDKInvoicePayment_Body invoice_payment;
13809 struct LDKThirtyTwoBytes spontaneous_payment;
13812 } LDKPaymentPurpose;
13815 * The contents of CResult_PaymentPurposeDecodeErrorZ
13817 typedef union LDKCResult_PaymentPurposeDecodeErrorZPtr {
13819 * A pointer to the contents in the success state.
13820 * Reading from this pointer when `result_ok` is not set is undefined.
13822 struct LDKPaymentPurpose *result;
13824 * A pointer to the contents in the error state.
13825 * Reading from this pointer when `result_ok` is set is undefined.
13827 struct LDKDecodeError *err;
13828 } LDKCResult_PaymentPurposeDecodeErrorZPtr;
13831 * A CResult_PaymentPurposeDecodeErrorZ represents the result of a fallible operation,
13832 * containing a crate::lightning::events::PaymentPurpose on success and a crate::lightning::ln::msgs::DecodeError on failure.
13833 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
13835 typedef struct LDKCResult_PaymentPurposeDecodeErrorZ {
13837 * The contents of this CResult_PaymentPurposeDecodeErrorZ, accessible via either
13838 * `err` or `result` depending on the state of `result_ok`.
13840 union LDKCResult_PaymentPurposeDecodeErrorZPtr contents;
13842 * Whether this CResult_PaymentPurposeDecodeErrorZ represents a success state.
13845 } LDKCResult_PaymentPurposeDecodeErrorZ;
13850 * Information about an HTLC that is part of a payment that can be claimed.
13852 typedef struct MUST_USE_STRUCT LDKClaimedHTLC {
13854 * A pointer to the opaque Rust object.
13855 * Nearly everywhere, inner must be non-null, however in places where
13856 * the Rust equivalent takes an Option, it may be set to null to indicate None.
13858 LDKnativeClaimedHTLC *inner;
13860 * Indicates that this is the only struct which contains the same pointer.
13861 * Rust functions which take ownership of an object provided via an argument require
13862 * this to be true and invalidate the object pointed to by inner.
13868 * The contents of CResult_ClaimedHTLCDecodeErrorZ
13870 typedef union LDKCResult_ClaimedHTLCDecodeErrorZPtr {
13872 * A pointer to the contents in the success state.
13873 * Reading from this pointer when `result_ok` is not set is undefined.
13875 struct LDKClaimedHTLC *result;
13877 * A pointer to the contents in the error state.
13878 * Reading from this pointer when `result_ok` is set is undefined.
13880 struct LDKDecodeError *err;
13881 } LDKCResult_ClaimedHTLCDecodeErrorZPtr;
13884 * A CResult_ClaimedHTLCDecodeErrorZ represents the result of a fallible operation,
13885 * containing a crate::lightning::events::ClaimedHTLC on success and a crate::lightning::ln::msgs::DecodeError on failure.
13886 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
13888 typedef struct LDKCResult_ClaimedHTLCDecodeErrorZ {
13890 * The contents of this CResult_ClaimedHTLCDecodeErrorZ, accessible via either
13891 * `err` or `result` depending on the state of `result_ok`.
13893 union LDKCResult_ClaimedHTLCDecodeErrorZPtr contents;
13895 * Whether this CResult_ClaimedHTLCDecodeErrorZ represents a success state.
13898 } LDKCResult_ClaimedHTLCDecodeErrorZ;
13901 * When the payment path failure took place and extra details about it. [`PathFailure::OnPath`] may
13902 * contain a [`NetworkUpdate`] that needs to be applied to the [`NetworkGraph`].
13904 * [`NetworkUpdate`]: crate::routing::gossip::NetworkUpdate
13905 * [`NetworkGraph`]: crate::routing::gossip::NetworkGraph
13907 typedef enum LDKPathFailure_Tag {
13909 * We failed to initially send the payment and no HTLC was committed to. Contains the relevant
13912 LDKPathFailure_InitialSend,
13914 * A hop on the path failed to forward our payment.
13916 LDKPathFailure_OnPath,
13918 * Must be last for serialization purposes
13920 LDKPathFailure_Sentinel,
13921 } LDKPathFailure_Tag;
13923 typedef struct LDKPathFailure_LDKInitialSend_Body {
13925 * The error surfaced from initial send.
13927 struct LDKAPIError err;
13928 } LDKPathFailure_LDKInitialSend_Body;
13930 typedef struct LDKPathFailure_LDKOnPath_Body {
13932 * If present, this [`NetworkUpdate`] should be applied to the [`NetworkGraph`] so that routing
13933 * decisions can take into account the update.
13935 * [`NetworkUpdate`]: crate::routing::gossip::NetworkUpdate
13936 * [`NetworkGraph`]: crate::routing::gossip::NetworkGraph
13938 struct LDKCOption_NetworkUpdateZ network_update;
13939 } LDKPathFailure_LDKOnPath_Body;
13941 typedef struct MUST_USE_STRUCT LDKPathFailure {
13942 LDKPathFailure_Tag tag;
13944 LDKPathFailure_LDKInitialSend_Body initial_send;
13945 LDKPathFailure_LDKOnPath_Body on_path;
13950 * An enum which can either contain a crate::lightning::events::PathFailure or not
13952 typedef enum LDKCOption_PathFailureZ_Tag {
13954 * When we're in this state, this COption_PathFailureZ contains a crate::lightning::events::PathFailure
13956 LDKCOption_PathFailureZ_Some,
13958 * When we're in this state, this COption_PathFailureZ contains nothing
13960 LDKCOption_PathFailureZ_None,
13962 * Must be last for serialization purposes
13964 LDKCOption_PathFailureZ_Sentinel,
13965 } LDKCOption_PathFailureZ_Tag;
13967 typedef struct LDKCOption_PathFailureZ {
13968 LDKCOption_PathFailureZ_Tag tag;
13971 struct LDKPathFailure some;
13974 } LDKCOption_PathFailureZ;
13977 * The contents of CResult_COption_PathFailureZDecodeErrorZ
13979 typedef union LDKCResult_COption_PathFailureZDecodeErrorZPtr {
13981 * A pointer to the contents in the success state.
13982 * Reading from this pointer when `result_ok` is not set is undefined.
13984 struct LDKCOption_PathFailureZ *result;
13986 * A pointer to the contents in the error state.
13987 * Reading from this pointer when `result_ok` is set is undefined.
13989 struct LDKDecodeError *err;
13990 } LDKCResult_COption_PathFailureZDecodeErrorZPtr;
13993 * A CResult_COption_PathFailureZDecodeErrorZ represents the result of a fallible operation,
13994 * containing a crate::c_types::derived::COption_PathFailureZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
13995 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
13997 typedef struct LDKCResult_COption_PathFailureZDecodeErrorZ {
13999 * The contents of this CResult_COption_PathFailureZDecodeErrorZ, accessible via either
14000 * `err` or `result` depending on the state of `result_ok`.
14002 union LDKCResult_COption_PathFailureZDecodeErrorZPtr contents;
14004 * Whether this CResult_COption_PathFailureZDecodeErrorZ represents a success state.
14007 } LDKCResult_COption_PathFailureZDecodeErrorZ;
14012 * Struct to `Display` fields in a safe way using `PrintableString`
14014 typedef struct MUST_USE_STRUCT LDKUntrustedString {
14016 * A pointer to the opaque Rust object.
14017 * Nearly everywhere, inner must be non-null, however in places where
14018 * the Rust equivalent takes an Option, it may be set to null to indicate None.
14020 LDKnativeUntrustedString *inner;
14022 * Indicates that this is the only struct which contains the same pointer.
14023 * Rust functions which take ownership of an object provided via an argument require
14024 * this to be true and invalidate the object pointed to by inner.
14027 } LDKUntrustedString;
14030 * The reason the channel was closed. See individual variants for more details.
14032 typedef enum LDKClosureReason_Tag {
14034 * Closure generated from receiving a peer error message.
14036 * Our counterparty may have broadcasted their latest commitment state, and we have
14039 LDKClosureReason_CounterpartyForceClosed,
14041 * Closure generated from [`ChannelManager::force_close_channel`], called by the user.
14043 * [`ChannelManager::force_close_channel`]: crate::ln::channelmanager::ChannelManager::force_close_channel.
14045 LDKClosureReason_HolderForceClosed,
14047 * The channel was closed after negotiating a cooperative close and we've now broadcasted
14048 * the cooperative close transaction. Note the shutdown may have been initiated by us.
14050 LDKClosureReason_CooperativeClosure,
14052 * A commitment transaction was confirmed on chain, closing the channel. Most likely this
14053 * commitment transaction came from our counterparty, but it may also have come from
14054 * a copy of our own `ChannelMonitor`.
14056 LDKClosureReason_CommitmentTxConfirmed,
14058 * The funding transaction failed to confirm in a timely manner on an inbound channel.
14060 LDKClosureReason_FundingTimedOut,
14062 * Closure generated from processing an event, likely a HTLC forward/relay/reception.
14064 LDKClosureReason_ProcessingError,
14066 * The peer disconnected prior to funding completing. In this case the spec mandates that we
14067 * forget the channel entirely - we can attempt again if the peer reconnects.
14069 * This includes cases where we restarted prior to funding completion, including prior to the
14070 * initial [`ChannelMonitor`] persistence completing.
14072 * In LDK versions prior to 0.0.107 this could also occur if we were unable to connect to the
14073 * peer because of mutual incompatibility between us and our channel counterparty.
14075 * [`ChannelMonitor`]: crate::chain::channelmonitor::ChannelMonitor
14077 LDKClosureReason_DisconnectedPeer,
14079 * Closure generated from `ChannelManager::read` if the [`ChannelMonitor`] is newer than
14080 * the [`ChannelManager`] deserialized.
14082 * [`ChannelMonitor`]: crate::chain::channelmonitor::ChannelMonitor
14083 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
14085 LDKClosureReason_OutdatedChannelManager,
14087 * The counterparty requested a cooperative close of a channel that had not been funded yet.
14088 * The channel has been immediately closed.
14090 LDKClosureReason_CounterpartyCoopClosedUnfundedChannel,
14092 * Another channel in the same funding batch closed before the funding transaction
14093 * was ready to be broadcast.
14095 LDKClosureReason_FundingBatchClosure,
14097 * Must be last for serialization purposes
14099 LDKClosureReason_Sentinel,
14100 } LDKClosureReason_Tag;
14102 typedef struct LDKClosureReason_LDKCounterpartyForceClosed_Body {
14104 * The error which the peer sent us.
14106 * Be careful about printing the peer_msg, a well-crafted message could exploit
14107 * a security vulnerability in the terminal emulator or the logging subsystem.
14108 * To be safe, use `Display` on `UntrustedString`
14110 * [`UntrustedString`]: crate::util::string::UntrustedString
14112 struct LDKUntrustedString peer_msg;
14113 } LDKClosureReason_LDKCounterpartyForceClosed_Body;
14115 typedef struct LDKClosureReason_LDKProcessingError_Body {
14117 * A developer-readable error message which we generated.
14120 } LDKClosureReason_LDKProcessingError_Body;
14122 typedef struct MUST_USE_STRUCT LDKClosureReason {
14123 LDKClosureReason_Tag tag;
14125 LDKClosureReason_LDKCounterpartyForceClosed_Body counterparty_force_closed;
14126 LDKClosureReason_LDKProcessingError_Body processing_error;
14128 } LDKClosureReason;
14131 * An enum which can either contain a crate::lightning::events::ClosureReason or not
14133 typedef enum LDKCOption_ClosureReasonZ_Tag {
14135 * When we're in this state, this COption_ClosureReasonZ contains a crate::lightning::events::ClosureReason
14137 LDKCOption_ClosureReasonZ_Some,
14139 * When we're in this state, this COption_ClosureReasonZ contains nothing
14141 LDKCOption_ClosureReasonZ_None,
14143 * Must be last for serialization purposes
14145 LDKCOption_ClosureReasonZ_Sentinel,
14146 } LDKCOption_ClosureReasonZ_Tag;
14148 typedef struct LDKCOption_ClosureReasonZ {
14149 LDKCOption_ClosureReasonZ_Tag tag;
14152 struct LDKClosureReason some;
14155 } LDKCOption_ClosureReasonZ;
14158 * The contents of CResult_COption_ClosureReasonZDecodeErrorZ
14160 typedef union LDKCResult_COption_ClosureReasonZDecodeErrorZPtr {
14162 * A pointer to the contents in the success state.
14163 * Reading from this pointer when `result_ok` is not set is undefined.
14165 struct LDKCOption_ClosureReasonZ *result;
14167 * A pointer to the contents in the error state.
14168 * Reading from this pointer when `result_ok` is set is undefined.
14170 struct LDKDecodeError *err;
14171 } LDKCResult_COption_ClosureReasonZDecodeErrorZPtr;
14174 * A CResult_COption_ClosureReasonZDecodeErrorZ represents the result of a fallible operation,
14175 * containing a crate::c_types::derived::COption_ClosureReasonZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
14176 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
14178 typedef struct LDKCResult_COption_ClosureReasonZDecodeErrorZ {
14180 * The contents of this CResult_COption_ClosureReasonZDecodeErrorZ, accessible via either
14181 * `err` or `result` depending on the state of `result_ok`.
14183 union LDKCResult_COption_ClosureReasonZDecodeErrorZPtr contents;
14185 * Whether this CResult_COption_ClosureReasonZDecodeErrorZ represents a success state.
14188 } LDKCResult_COption_ClosureReasonZDecodeErrorZ;
14191 * Intended destination of a failed HTLC as indicated in [`Event::HTLCHandlingFailed`].
14193 typedef enum LDKHTLCDestination_Tag {
14195 * We tried forwarding to a channel but failed to do so. An example of such an instance is when
14196 * there is insufficient capacity in our outbound channel.
14198 LDKHTLCDestination_NextHopChannel,
14200 * Scenario where we are unsure of the next node to forward the HTLC to.
14202 LDKHTLCDestination_UnknownNextHop,
14204 * We couldn't forward to the outgoing scid. An example would be attempting to send a duplicate
14207 LDKHTLCDestination_InvalidForward,
14209 * Failure scenario where an HTLC may have been forwarded to be intended for us,
14210 * but is invalid for some reason, so we reject it.
14212 * Some of the reasons may include:
14214 * * Excess HTLCs for a payment that we have already fully received, over-paying for the
14216 * * The counterparty node modified the HTLC in transit,
14217 * * A probing attack where an intermediary node is trying to detect if we are the ultimate
14218 * recipient for a payment.
14220 LDKHTLCDestination_FailedPayment,
14222 * Must be last for serialization purposes
14224 LDKHTLCDestination_Sentinel,
14225 } LDKHTLCDestination_Tag;
14227 typedef struct LDKHTLCDestination_LDKNextHopChannel_Body {
14229 * The `node_id` of the next node. For backwards compatibility, this field is
14230 * marked as optional, versions prior to 0.0.110 may not always be able to provide
14231 * counterparty node information.
14233 * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
14235 struct LDKPublicKey node_id;
14237 * The outgoing `channel_id` between us and the next node.
14239 struct LDKThirtyTwoBytes channel_id;
14240 } LDKHTLCDestination_LDKNextHopChannel_Body;
14242 typedef struct LDKHTLCDestination_LDKUnknownNextHop_Body {
14244 * Short channel id we are requesting to forward an HTLC to.
14246 uint64_t requested_forward_scid;
14247 } LDKHTLCDestination_LDKUnknownNextHop_Body;
14249 typedef struct LDKHTLCDestination_LDKInvalidForward_Body {
14251 * Short channel id we are requesting to forward an HTLC to.
14253 uint64_t requested_forward_scid;
14254 } LDKHTLCDestination_LDKInvalidForward_Body;
14256 typedef struct LDKHTLCDestination_LDKFailedPayment_Body {
14258 * The payment hash of the payment we attempted to process.
14260 struct LDKThirtyTwoBytes payment_hash;
14261 } LDKHTLCDestination_LDKFailedPayment_Body;
14263 typedef struct MUST_USE_STRUCT LDKHTLCDestination {
14264 LDKHTLCDestination_Tag tag;
14266 LDKHTLCDestination_LDKNextHopChannel_Body next_hop_channel;
14267 LDKHTLCDestination_LDKUnknownNextHop_Body unknown_next_hop;
14268 LDKHTLCDestination_LDKInvalidForward_Body invalid_forward;
14269 LDKHTLCDestination_LDKFailedPayment_Body failed_payment;
14271 } LDKHTLCDestination;
14274 * An enum which can either contain a crate::lightning::events::HTLCDestination or not
14276 typedef enum LDKCOption_HTLCDestinationZ_Tag {
14278 * When we're in this state, this COption_HTLCDestinationZ contains a crate::lightning::events::HTLCDestination
14280 LDKCOption_HTLCDestinationZ_Some,
14282 * When we're in this state, this COption_HTLCDestinationZ contains nothing
14284 LDKCOption_HTLCDestinationZ_None,
14286 * Must be last for serialization purposes
14288 LDKCOption_HTLCDestinationZ_Sentinel,
14289 } LDKCOption_HTLCDestinationZ_Tag;
14291 typedef struct LDKCOption_HTLCDestinationZ {
14292 LDKCOption_HTLCDestinationZ_Tag tag;
14295 struct LDKHTLCDestination some;
14298 } LDKCOption_HTLCDestinationZ;
14301 * The contents of CResult_COption_HTLCDestinationZDecodeErrorZ
14303 typedef union LDKCResult_COption_HTLCDestinationZDecodeErrorZPtr {
14305 * A pointer to the contents in the success state.
14306 * Reading from this pointer when `result_ok` is not set is undefined.
14308 struct LDKCOption_HTLCDestinationZ *result;
14310 * A pointer to the contents in the error state.
14311 * Reading from this pointer when `result_ok` is set is undefined.
14313 struct LDKDecodeError *err;
14314 } LDKCResult_COption_HTLCDestinationZDecodeErrorZPtr;
14317 * A CResult_COption_HTLCDestinationZDecodeErrorZ represents the result of a fallible operation,
14318 * containing a crate::c_types::derived::COption_HTLCDestinationZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
14319 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
14321 typedef struct LDKCResult_COption_HTLCDestinationZDecodeErrorZ {
14323 * The contents of this CResult_COption_HTLCDestinationZDecodeErrorZ, accessible via either
14324 * `err` or `result` depending on the state of `result_ok`.
14326 union LDKCResult_COption_HTLCDestinationZDecodeErrorZPtr contents;
14328 * Whether this CResult_COption_HTLCDestinationZDecodeErrorZ represents a success state.
14331 } LDKCResult_COption_HTLCDestinationZDecodeErrorZ;
14334 * The contents of CResult_PaymentFailureReasonDecodeErrorZ
14336 typedef union LDKCResult_PaymentFailureReasonDecodeErrorZPtr {
14338 * A pointer to the contents in the success state.
14339 * Reading from this pointer when `result_ok` is not set is undefined.
14341 enum LDKPaymentFailureReason *result;
14343 * A pointer to the contents in the error state.
14344 * Reading from this pointer when `result_ok` is set is undefined.
14346 struct LDKDecodeError *err;
14347 } LDKCResult_PaymentFailureReasonDecodeErrorZPtr;
14350 * A CResult_PaymentFailureReasonDecodeErrorZ represents the result of a fallible operation,
14351 * containing a crate::lightning::events::PaymentFailureReason on success and a crate::lightning::ln::msgs::DecodeError on failure.
14352 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
14354 typedef struct LDKCResult_PaymentFailureReasonDecodeErrorZ {
14356 * The contents of this CResult_PaymentFailureReasonDecodeErrorZ, accessible via either
14357 * `err` or `result` depending on the state of `result_ok`.
14359 union LDKCResult_PaymentFailureReasonDecodeErrorZPtr contents;
14361 * Whether this CResult_PaymentFailureReasonDecodeErrorZ represents a success state.
14364 } LDKCResult_PaymentFailureReasonDecodeErrorZ;
14367 * An enum which can either contain a crate::c_types::U128 or not
14369 typedef enum LDKCOption_U128Z_Tag {
14371 * When we're in this state, this COption_U128Z contains a crate::c_types::U128
14373 LDKCOption_U128Z_Some,
14375 * When we're in this state, this COption_U128Z contains nothing
14377 LDKCOption_U128Z_None,
14379 * Must be last for serialization purposes
14381 LDKCOption_U128Z_Sentinel,
14382 } LDKCOption_U128Z_Tag;
14384 typedef struct LDKCOption_U128Z {
14385 LDKCOption_U128Z_Tag tag;
14388 struct LDKU128 some;
14391 } LDKCOption_U128Z;
14394 * A dynamically-allocated array of crate::lightning::events::ClaimedHTLCs of arbitrary size.
14395 * This corresponds to std::vector in C++
14397 typedef struct LDKCVec_ClaimedHTLCZ {
14399 * The elements in the array.
14400 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
14402 struct LDKClaimedHTLC *data;
14404 * The number of elements pointed to by `data`.
14407 } LDKCVec_ClaimedHTLCZ;
14410 * An enum which can either contain a crate::lightning::events::PaymentFailureReason or not
14412 typedef enum LDKCOption_PaymentFailureReasonZ_Tag {
14414 * When we're in this state, this COption_PaymentFailureReasonZ contains a crate::lightning::events::PaymentFailureReason
14416 LDKCOption_PaymentFailureReasonZ_Some,
14418 * When we're in this state, this COption_PaymentFailureReasonZ contains nothing
14420 LDKCOption_PaymentFailureReasonZ_None,
14422 * Must be last for serialization purposes
14424 LDKCOption_PaymentFailureReasonZ_Sentinel,
14425 } LDKCOption_PaymentFailureReasonZ_Tag;
14427 typedef struct LDKCOption_PaymentFailureReasonZ {
14428 LDKCOption_PaymentFailureReasonZ_Tag tag;
14431 enum LDKPaymentFailureReason some;
14434 } LDKCOption_PaymentFailureReasonZ;
14439 * A descriptor used to sign for a commitment transaction's anchor output.
14441 typedef struct MUST_USE_STRUCT LDKAnchorDescriptor {
14443 * A pointer to the opaque Rust object.
14444 * Nearly everywhere, inner must be non-null, however in places where
14445 * the Rust equivalent takes an Option, it may be set to null to indicate None.
14447 LDKnativeAnchorDescriptor *inner;
14449 * Indicates that this is the only struct which contains the same pointer.
14450 * Rust functions which take ownership of an object provided via an argument require
14451 * this to be true and invalidate the object pointed to by inner.
14454 } LDKAnchorDescriptor;
14457 * Represents the different types of transactions, originating from LDK, to be bumped.
14459 typedef enum LDKBumpTransactionEvent_Tag {
14461 * Indicates that a channel featuring anchor outputs is to be closed by broadcasting the local
14462 * commitment transaction. Since commitment transactions have a static feerate pre-agreed upon,
14463 * they may need additional fees to be attached through a child transaction using the popular
14464 * [Child-Pays-For-Parent](https://bitcoinops.org/en/topics/cpfp) fee bumping technique. This
14465 * child transaction must include the anchor input described within `anchor_descriptor` along
14466 * with additional inputs to meet the target feerate. Failure to meet the target feerate
14467 * decreases the confirmation odds of the transaction package (which includes the commitment
14468 * and child anchor transactions), possibly resulting in a loss of funds. Once the transaction
14469 * is constructed, it must be fully signed for and broadcast by the consumer of the event
14470 * along with the `commitment_tx` enclosed. Note that the `commitment_tx` must always be
14471 * broadcast first, as the child anchor transaction depends on it.
14473 * The consumer should be able to sign for any of the additional inputs included within the
14474 * child anchor transaction. To sign its anchor input, an [`EcdsaChannelSigner`] should be
14475 * re-derived through [`AnchorDescriptor::derive_channel_signer`]. The anchor input signature
14476 * can be computed with [`EcdsaChannelSigner::sign_holder_anchor_input`], which can then be
14477 * provided to [`build_anchor_input_witness`] along with the `funding_pubkey` to obtain the
14478 * full witness required to spend.
14480 * It is possible to receive more than one instance of this event if a valid child anchor
14481 * transaction is never broadcast or is but not with a sufficient fee to be mined. Care should
14482 * be taken by the consumer of the event to ensure any future iterations of the child anchor
14483 * transaction adhere to the [Replace-By-Fee
14484 * rules](https://github.com/bitcoin/bitcoin/blob/master/doc/policy/mempool-replacements.md)
14485 * for fee bumps to be accepted into the mempool, and eventually the chain. As the frequency of
14486 * these events is not user-controlled, users may ignore/drop the event if they are no longer
14487 * able to commit external confirmed funds to the child anchor transaction.
14489 * The set of `pending_htlcs` on the commitment transaction to be broadcast can be inspected to
14490 * determine whether a significant portion of the channel's funds are allocated to HTLCs,
14491 * enabling users to make their own decisions regarding the importance of the commitment
14492 * transaction's confirmation. Note that this is not required, but simply exists as an option
14493 * for users to override LDK's behavior. On commitments with no HTLCs (indicated by those with
14494 * an empty `pending_htlcs`), confirmation of the commitment transaction can be considered to
14497 * [`EcdsaChannelSigner`]: crate::sign::EcdsaChannelSigner
14498 * [`EcdsaChannelSigner::sign_holder_anchor_input`]: crate::sign::EcdsaChannelSigner::sign_holder_anchor_input
14499 * [`build_anchor_input_witness`]: crate::ln::chan_utils::build_anchor_input_witness
14501 LDKBumpTransactionEvent_ChannelClose,
14503 * Indicates that a channel featuring anchor outputs has unilaterally closed on-chain by a
14504 * holder commitment transaction and its HTLC(s) need to be resolved on-chain. With the
14505 * zero-HTLC-transaction-fee variant of anchor outputs, the pre-signed HTLC
14506 * transactions have a zero fee, thus requiring additional inputs and/or outputs to be attached
14507 * for a timely confirmation within the chain. These additional inputs and/or outputs must be
14508 * appended to the resulting HTLC transaction to meet the target feerate. Failure to meet the
14509 * target feerate decreases the confirmation odds of the transaction, possibly resulting in a
14510 * loss of funds. Once the transaction meets the target feerate, it must be signed for and
14511 * broadcast by the consumer of the event.
14513 * The consumer should be able to sign for any of the non-HTLC inputs added to the resulting
14514 * HTLC transaction. To sign HTLC inputs, an [`EcdsaChannelSigner`] should be re-derived
14515 * through [`HTLCDescriptor::derive_channel_signer`]. Each HTLC input's signature can be
14516 * computed with [`EcdsaChannelSigner::sign_holder_htlc_transaction`], which can then be
14517 * provided to [`HTLCDescriptor::tx_input_witness`] to obtain the fully signed witness required
14520 * It is possible to receive more than one instance of this event if a valid HTLC transaction
14521 * is never broadcast or is but not with a sufficient fee to be mined. Care should be taken by
14522 * the consumer of the event to ensure any future iterations of the HTLC transaction adhere to
14523 * the [Replace-By-Fee
14524 * rules](https://github.com/bitcoin/bitcoin/blob/master/doc/policy/mempool-replacements.md)
14525 * for fee bumps to be accepted into the mempool, and eventually the chain. As the frequency of
14526 * these events is not user-controlled, users may ignore/drop the event if either they are no
14527 * longer able to commit external confirmed funds to the HTLC transaction or the fee committed
14528 * to the HTLC transaction is greater in value than the HTLCs being claimed.
14530 * [`EcdsaChannelSigner`]: crate::sign::EcdsaChannelSigner
14531 * [`EcdsaChannelSigner::sign_holder_htlc_transaction`]: crate::sign::EcdsaChannelSigner::sign_holder_htlc_transaction
14532 * [`HTLCDescriptor::tx_input_witness`]: HTLCDescriptor::tx_input_witness
14534 LDKBumpTransactionEvent_HTLCResolution,
14536 * Must be last for serialization purposes
14538 LDKBumpTransactionEvent_Sentinel,
14539 } LDKBumpTransactionEvent_Tag;
14541 typedef struct LDKBumpTransactionEvent_LDKChannelClose_Body {
14543 * The unique identifier for the claim of the anchor output in the commitment transaction.
14545 * The identifier must map to the set of external UTXOs assigned to the claim, such that
14546 * they can be reused when a new claim with the same identifier needs to be made, resulting
14547 * in a fee-bumping attempt.
14549 struct LDKThirtyTwoBytes claim_id;
14551 * The target feerate that the transaction package, which consists of the commitment
14552 * transaction and the to-be-crafted child anchor transaction, must meet.
14554 uint32_t package_target_feerate_sat_per_1000_weight;
14556 * The channel's commitment transaction to bump the fee of. This transaction should be
14557 * broadcast along with the anchor transaction constructed as a result of consuming this
14560 struct LDKTransaction commitment_tx;
14562 * The absolute fee in satoshis of the commitment transaction. This can be used along the
14563 * with weight of the commitment transaction to determine its feerate.
14565 uint64_t commitment_tx_fee_satoshis;
14567 * The descriptor to sign the anchor input of the anchor transaction constructed as a
14568 * result of consuming this event.
14570 struct LDKAnchorDescriptor anchor_descriptor;
14572 * The set of pending HTLCs on the commitment transaction that need to be resolved once the
14573 * commitment transaction confirms.
14575 struct LDKCVec_HTLCOutputInCommitmentZ pending_htlcs;
14576 } LDKBumpTransactionEvent_LDKChannelClose_Body;
14578 typedef struct LDKBumpTransactionEvent_LDKHTLCResolution_Body {
14580 * The unique identifier for the claim of the HTLCs in the confirmed commitment
14583 * The identifier must map to the set of external UTXOs assigned to the claim, such that
14584 * they can be reused when a new claim with the same identifier needs to be made, resulting
14585 * in a fee-bumping attempt.
14587 struct LDKThirtyTwoBytes claim_id;
14589 * The target feerate that the resulting HTLC transaction must meet.
14591 uint32_t target_feerate_sat_per_1000_weight;
14593 * The set of pending HTLCs on the confirmed commitment that need to be claimed, preferably
14594 * by the same transaction.
14596 struct LDKCVec_HTLCDescriptorZ htlc_descriptors;
14598 * The locktime required for the resulting HTLC transaction.
14600 uint32_t tx_lock_time;
14601 } LDKBumpTransactionEvent_LDKHTLCResolution_Body;
14603 typedef struct MUST_USE_STRUCT LDKBumpTransactionEvent {
14604 LDKBumpTransactionEvent_Tag tag;
14606 LDKBumpTransactionEvent_LDKChannelClose_Body channel_close;
14607 LDKBumpTransactionEvent_LDKHTLCResolution_Body htlc_resolution;
14609 } LDKBumpTransactionEvent;
14612 * An Event which you should probably take some action in response to.
14614 * Note that while Writeable and Readable are implemented for Event, you probably shouldn't use
14615 * them directly as they don't round-trip exactly (for example FundingGenerationReady is never
14616 * written as it makes no sense to respond to it after reconnecting to peers).
14618 typedef enum LDKEvent_Tag {
14620 * Used to indicate that the client should generate a funding transaction with the given
14621 * parameters and then call [`ChannelManager::funding_transaction_generated`].
14622 * Generated in [`ChannelManager`] message handling.
14623 * Note that *all inputs* in the funding transaction must spend SegWit outputs or your
14624 * counterparty can steal your funds!
14626 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
14627 * [`ChannelManager::funding_transaction_generated`]: crate::ln::channelmanager::ChannelManager::funding_transaction_generated
14629 LDKEvent_FundingGenerationReady,
14631 * Indicates that we've been offered a payment and it needs to be claimed via calling
14632 * [`ChannelManager::claim_funds`] with the preimage given in [`PaymentPurpose`].
14634 * Note that if the preimage is not known, you should call
14635 * [`ChannelManager::fail_htlc_backwards`] or [`ChannelManager::fail_htlc_backwards_with_reason`]
14636 * to free up resources for this HTLC and avoid network congestion.
14638 * If [`Event::PaymentClaimable::onion_fields`] is `Some`, and includes custom TLVs with even type
14639 * numbers, you should use [`ChannelManager::fail_htlc_backwards_with_reason`] with
14640 * [`FailureCode::InvalidOnionPayload`] if you fail to understand and handle the contents, or
14641 * [`ChannelManager::claim_funds_with_known_custom_tlvs`] upon successful handling.
14642 * If you don't intend to check for custom TLVs, you can simply use
14643 * [`ChannelManager::claim_funds`], which will automatically fail back even custom TLVs.
14645 * If you fail to call [`ChannelManager::claim_funds`],
14646 * [`ChannelManager::claim_funds_with_known_custom_tlvs`],
14647 * [`ChannelManager::fail_htlc_backwards`], or
14648 * [`ChannelManager::fail_htlc_backwards_with_reason`] within the HTLC's timeout, the HTLC will
14649 * be automatically failed.
14652 * LDK will not stop an inbound payment from being paid multiple times, so multiple
14653 * `PaymentClaimable` events may be generated for the same payment. In such a case it is
14654 * polite (and required in the lightning specification) to fail the payment the second time
14655 * and give the sender their money back rather than accepting double payment.
14658 * This event used to be called `PaymentReceived` in LDK versions 0.0.112 and earlier.
14660 * [`ChannelManager::claim_funds`]: crate::ln::channelmanager::ChannelManager::claim_funds
14661 * [`ChannelManager::claim_funds_with_known_custom_tlvs`]: crate::ln::channelmanager::ChannelManager::claim_funds_with_known_custom_tlvs
14662 * [`FailureCode::InvalidOnionPayload`]: crate::ln::channelmanager::FailureCode::InvalidOnionPayload
14663 * [`ChannelManager::fail_htlc_backwards`]: crate::ln::channelmanager::ChannelManager::fail_htlc_backwards
14664 * [`ChannelManager::fail_htlc_backwards_with_reason`]: crate::ln::channelmanager::ChannelManager::fail_htlc_backwards_with_reason
14666 LDKEvent_PaymentClaimable,
14668 * Indicates a payment has been claimed and we've received money!
14670 * This most likely occurs when [`ChannelManager::claim_funds`] has been called in response
14671 * to an [`Event::PaymentClaimable`]. However, if we previously crashed during a
14672 * [`ChannelManager::claim_funds`] call you may see this event without a corresponding
14673 * [`Event::PaymentClaimable`] event.
14676 * LDK will not stop an inbound payment from being paid multiple times, so multiple
14677 * `PaymentClaimable` events may be generated for the same payment. If you then call
14678 * [`ChannelManager::claim_funds`] twice for the same [`Event::PaymentClaimable`] you may get
14679 * multiple `PaymentClaimed` events.
14681 * [`ChannelManager::claim_funds`]: crate::ln::channelmanager::ChannelManager::claim_funds
14683 LDKEvent_PaymentClaimed,
14685 * Indicates an outbound payment we made succeeded (i.e. it made it all the way to its target
14686 * and we got back the payment preimage for it).
14688 * Note for MPP payments: in rare cases, this event may be preceded by a `PaymentPathFailed`
14689 * event. In this situation, you SHOULD treat this payment as having succeeded.
14691 LDKEvent_PaymentSent,
14693 * Indicates an outbound payment failed. Individual [`Event::PaymentPathFailed`] events
14694 * provide failure information for each path attempt in the payment, including retries.
14696 * This event is provided once there are no further pending HTLCs for the payment and the
14697 * payment is no longer retryable, due either to the [`Retry`] provided or
14698 * [`ChannelManager::abandon_payment`] having been called for the corresponding payment.
14700 * In exceedingly rare cases, it is possible that an [`Event::PaymentFailed`] is generated for
14701 * a payment after an [`Event::PaymentSent`] event for this same payment has already been
14702 * received and processed. In this case, the [`Event::PaymentFailed`] event MUST be ignored,
14703 * and the payment MUST be treated as having succeeded.
14705 * [`Retry`]: crate::ln::channelmanager::Retry
14706 * [`ChannelManager::abandon_payment`]: crate::ln::channelmanager::ChannelManager::abandon_payment
14708 LDKEvent_PaymentFailed,
14710 * Indicates that a path for an outbound payment was successful.
14712 * Always generated after [`Event::PaymentSent`] and thus useful for scoring channels. See
14713 * [`Event::PaymentSent`] for obtaining the payment preimage.
14715 LDKEvent_PaymentPathSuccessful,
14717 * Indicates an outbound HTLC we sent failed, likely due to an intermediary node being unable to
14720 * Note that this does *not* indicate that all paths for an MPP payment have failed, see
14721 * [`Event::PaymentFailed`].
14723 * See [`ChannelManager::abandon_payment`] for giving up on this payment before its retries have
14726 * [`ChannelManager::abandon_payment`]: crate::ln::channelmanager::ChannelManager::abandon_payment
14728 LDKEvent_PaymentPathFailed,
14730 * Indicates that a probe payment we sent returned successful, i.e., only failed at the destination.
14732 LDKEvent_ProbeSuccessful,
14734 * Indicates that a probe payment we sent failed at an intermediary node on the path.
14736 LDKEvent_ProbeFailed,
14738 * Used to indicate that [`ChannelManager::process_pending_htlc_forwards`] should be called at
14739 * a time in the future.
14741 * [`ChannelManager::process_pending_htlc_forwards`]: crate::ln::channelmanager::ChannelManager::process_pending_htlc_forwards
14743 LDKEvent_PendingHTLCsForwardable,
14745 * Used to indicate that we've intercepted an HTLC forward. This event will only be generated if
14746 * you've encoded an intercept scid in the receiver's invoice route hints using
14747 * [`ChannelManager::get_intercept_scid`] and have set [`UserConfig::accept_intercept_htlcs`].
14749 * [`ChannelManager::forward_intercepted_htlc`] or
14750 * [`ChannelManager::fail_intercepted_htlc`] MUST be called in response to this event. See
14751 * their docs for more information.
14753 * [`ChannelManager::get_intercept_scid`]: crate::ln::channelmanager::ChannelManager::get_intercept_scid
14754 * [`UserConfig::accept_intercept_htlcs`]: crate::util::config::UserConfig::accept_intercept_htlcs
14755 * [`ChannelManager::forward_intercepted_htlc`]: crate::ln::channelmanager::ChannelManager::forward_intercepted_htlc
14756 * [`ChannelManager::fail_intercepted_htlc`]: crate::ln::channelmanager::ChannelManager::fail_intercepted_htlc
14758 LDKEvent_HTLCIntercepted,
14760 * Used to indicate that an output which you should know how to spend was confirmed on chain
14761 * and is now spendable.
14762 * Such an output will *not* ever be spent by rust-lightning, and are not at risk of your
14763 * counterparty spending them due to some kind of timeout. Thus, you need to store them
14764 * somewhere and spend them when you create on-chain transactions.
14766 LDKEvent_SpendableOutputs,
14768 * This event is generated when a payment has been successfully forwarded through us and a
14769 * forwarding fee earned.
14771 LDKEvent_PaymentForwarded,
14773 * Used to indicate that a channel with the given `channel_id` is being opened and pending
14774 * confirmation on-chain.
14776 * This event is emitted when the funding transaction has been signed and is broadcast to the
14777 * network. For 0conf channels it will be immediately followed by the corresponding
14778 * [`Event::ChannelReady`] event.
14780 LDKEvent_ChannelPending,
14782 * Used to indicate that a channel with the given `channel_id` is ready to
14783 * be used. This event is emitted either when the funding transaction has been confirmed
14784 * on-chain, or, in case of a 0conf channel, when both parties have confirmed the channel
14787 LDKEvent_ChannelReady,
14789 * Used to indicate that a previously opened channel with the given `channel_id` is in the
14790 * process of closure.
14792 * Note that this event is only triggered for accepted channels: if the
14793 * [`UserConfig::manually_accept_inbound_channels`] config flag is set to true and the channel is
14794 * rejected, no `ChannelClosed` event will be sent.
14796 * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
14797 * [`UserConfig::manually_accept_inbound_channels`]: crate::util::config::UserConfig::manually_accept_inbound_channels
14799 LDKEvent_ChannelClosed,
14801 * Used to indicate to the user that they can abandon the funding transaction and recycle the
14802 * inputs for another purpose.
14804 * This event is not guaranteed to be generated for channels that are closed due to a restart.
14806 LDKEvent_DiscardFunding,
14808 * Indicates a request to open a new channel by a peer.
14810 * To accept the request, call [`ChannelManager::accept_inbound_channel`]. To reject the request,
14811 * call [`ChannelManager::force_close_without_broadcasting_txn`]. Note that a ['ChannelClosed`]
14812 * event will _not_ be triggered if the channel is rejected.
14814 * The event is only triggered when a new open channel request is received and the
14815 * [`UserConfig::manually_accept_inbound_channels`] config flag is set to true.
14817 * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
14818 * [`ChannelManager::force_close_without_broadcasting_txn`]: crate::ln::channelmanager::ChannelManager::force_close_without_broadcasting_txn
14819 * [`UserConfig::manually_accept_inbound_channels`]: crate::util::config::UserConfig::manually_accept_inbound_channels
14821 LDKEvent_OpenChannelRequest,
14823 * Indicates that the HTLC was accepted, but could not be processed when or after attempting to
14826 * Some scenarios where this event may be sent include:
14827 * * Insufficient capacity in the outbound channel
14828 * * While waiting to forward the HTLC, the channel it is meant to be forwarded through closes
14829 * * When an unknown SCID is requested for forwarding a payment.
14830 * * Expected MPP amount has already been reached
14831 * * The HTLC has timed out
14833 * This event, however, does not get generated if an HTLC fails to meet the forwarding
14834 * requirements (i.e. insufficient fees paid, or a CLTV that is too soon).
14836 LDKEvent_HTLCHandlingFailed,
14838 * Indicates that a transaction originating from LDK needs to have its fee bumped. This event
14839 * requires confirmed external funds to be readily available to spend.
14841 * LDK does not currently generate this event unless the
14842 * [`ChannelHandshakeConfig::negotiate_anchors_zero_fee_htlc_tx`] config flag is set to true.
14843 * It is limited to the scope of channels with anchor outputs.
14845 * [`ChannelHandshakeConfig::negotiate_anchors_zero_fee_htlc_tx`]: crate::util::config::ChannelHandshakeConfig::negotiate_anchors_zero_fee_htlc_tx
14847 LDKEvent_BumpTransaction,
14849 * Must be last for serialization purposes
14854 typedef struct LDKEvent_LDKFundingGenerationReady_Body {
14856 * The random channel_id we picked which you'll need to pass into
14857 * [`ChannelManager::funding_transaction_generated`].
14859 * [`ChannelManager::funding_transaction_generated`]: crate::ln::channelmanager::ChannelManager::funding_transaction_generated
14861 struct LDKThirtyTwoBytes temporary_channel_id;
14863 * The counterparty's node_id, which you'll need to pass back into
14864 * [`ChannelManager::funding_transaction_generated`].
14866 * [`ChannelManager::funding_transaction_generated`]: crate::ln::channelmanager::ChannelManager::funding_transaction_generated
14868 struct LDKPublicKey counterparty_node_id;
14870 * The value, in satoshis, that the output should have.
14872 uint64_t channel_value_satoshis;
14874 * The script which should be used in the transaction output.
14876 struct LDKCVec_u8Z output_script;
14878 * The `user_channel_id` value passed in to [`ChannelManager::create_channel`] for outbound
14879 * channels, or to [`ChannelManager::accept_inbound_channel`] for inbound channels if
14880 * [`UserConfig::manually_accept_inbound_channels`] config flag is set to true. Otherwise
14881 * `user_channel_id` will be randomized for an inbound channel. This may be zero for objects
14882 * serialized with LDK versions prior to 0.0.113.
14884 * [`ChannelManager::create_channel`]: crate::ln::channelmanager::ChannelManager::create_channel
14885 * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
14886 * [`UserConfig::manually_accept_inbound_channels`]: crate::util::config::UserConfig::manually_accept_inbound_channels
14888 struct LDKU128 user_channel_id;
14889 } LDKEvent_LDKFundingGenerationReady_Body;
14891 typedef struct LDKEvent_LDKPaymentClaimable_Body {
14893 * The node that will receive the payment after it has been claimed.
14894 * This is useful to identify payments received via [phantom nodes].
14895 * This field will always be filled in when the event was generated by LDK versions
14896 * 0.0.113 and above.
14898 * [phantom nodes]: crate::sign::PhantomKeysManager
14900 * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
14902 struct LDKPublicKey receiver_node_id;
14904 * The hash for which the preimage should be handed to the ChannelManager. Note that LDK will
14905 * not stop you from registering duplicate payment hashes for inbound payments.
14907 struct LDKThirtyTwoBytes payment_hash;
14909 * The fields in the onion which were received with each HTLC. Only fields which were
14910 * identical in each HTLC involved in the payment will be included here.
14912 * Payments received on LDK versions prior to 0.0.115 will have this field unset.
14914 * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
14916 struct LDKRecipientOnionFields onion_fields;
14918 * The value, in thousandths of a satoshi, that this payment is claimable for. May be greater
14919 * than the invoice amount.
14921 * May be less than the invoice amount if [`ChannelConfig::accept_underpaying_htlcs`] is set
14922 * and the previous hop took an extra fee.
14925 * If [`ChannelConfig::accept_underpaying_htlcs`] is set and you claim without verifying this
14926 * field, you may lose money!
14928 * [`ChannelConfig::accept_underpaying_htlcs`]: crate::util::config::ChannelConfig::accept_underpaying_htlcs
14930 uint64_t amount_msat;
14932 * The value, in thousands of a satoshi, that was skimmed off of this payment as an extra fee
14933 * taken by our channel counterparty.
14935 * Will always be 0 unless [`ChannelConfig::accept_underpaying_htlcs`] is set.
14937 * [`ChannelConfig::accept_underpaying_htlcs`]: crate::util::config::ChannelConfig::accept_underpaying_htlcs
14939 uint64_t counterparty_skimmed_fee_msat;
14941 * Information for claiming this received payment, based on whether the purpose of the
14942 * payment is to pay an invoice or to send a spontaneous payment.
14944 struct LDKPaymentPurpose purpose;
14946 * The `channel_id` indicating over which channel we received the payment.
14948 struct LDKCOption_ThirtyTwoBytesZ via_channel_id;
14950 * The `user_channel_id` indicating over which channel we received the payment.
14952 struct LDKCOption_U128Z via_user_channel_id;
14954 * The block height at which this payment will be failed back and will no longer be
14955 * eligible for claiming.
14957 * Prior to this height, a call to [`ChannelManager::claim_funds`] is guaranteed to
14958 * succeed, however you should wait for [`Event::PaymentClaimed`] to be sure.
14960 * [`ChannelManager::claim_funds`]: crate::ln::channelmanager::ChannelManager::claim_funds
14962 struct LDKCOption_u32Z claim_deadline;
14963 } LDKEvent_LDKPaymentClaimable_Body;
14965 typedef struct LDKEvent_LDKPaymentClaimed_Body {
14967 * The node that received the payment.
14968 * This is useful to identify payments which were received via [phantom nodes].
14969 * This field will always be filled in when the event was generated by LDK versions
14970 * 0.0.113 and above.
14972 * [phantom nodes]: crate::sign::PhantomKeysManager
14974 * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
14976 struct LDKPublicKey receiver_node_id;
14978 * The payment hash of the claimed payment. Note that LDK will not stop you from
14979 * registering duplicate payment hashes for inbound payments.
14981 struct LDKThirtyTwoBytes payment_hash;
14983 * The value, in thousandths of a satoshi, that this payment is for. May be greater than the
14986 uint64_t amount_msat;
14988 * The purpose of the claimed payment, i.e. whether the payment was for an invoice or a
14989 * spontaneous payment.
14991 struct LDKPaymentPurpose purpose;
14993 * The HTLCs that comprise the claimed payment. This will be empty for events serialized prior
14994 * to LDK version 0.0.117.
14996 struct LDKCVec_ClaimedHTLCZ htlcs;
14998 * The sender-intended sum total of all the MPP parts. This will be `None` for events
14999 * serialized prior to LDK version 0.0.117.
15001 struct LDKCOption_u64Z sender_intended_total_msat;
15002 } LDKEvent_LDKPaymentClaimed_Body;
15004 typedef struct LDKEvent_LDKPaymentSent_Body {
15006 * The `payment_id` passed to [`ChannelManager::send_payment`].
15008 * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
15010 struct LDKCOption_ThirtyTwoBytesZ payment_id;
15012 * The preimage to the hash given to ChannelManager::send_payment.
15013 * Note that this serves as a payment receipt, if you wish to have such a thing, you must
15014 * store it somehow!
15016 struct LDKThirtyTwoBytes payment_preimage;
15018 * The hash that was given to [`ChannelManager::send_payment`].
15020 * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
15022 struct LDKThirtyTwoBytes payment_hash;
15024 * The total fee which was spent at intermediate hops in this payment, across all paths.
15026 * Note that, like [`Route::get_total_fees`] this does *not* include any potential
15027 * overpayment to the recipient node.
15029 * If the recipient or an intermediate node misbehaves and gives us free money, this may
15030 * overstate the amount paid, though this is unlikely.
15032 * [`Route::get_total_fees`]: crate::routing::router::Route::get_total_fees
15034 struct LDKCOption_u64Z fee_paid_msat;
15035 } LDKEvent_LDKPaymentSent_Body;
15037 typedef struct LDKEvent_LDKPaymentFailed_Body {
15039 * The `payment_id` passed to [`ChannelManager::send_payment`].
15041 * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
15043 struct LDKThirtyTwoBytes payment_id;
15045 * The hash that was given to [`ChannelManager::send_payment`].
15047 * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
15049 struct LDKThirtyTwoBytes payment_hash;
15051 * The reason the payment failed. This is only `None` for events generated or serialized
15052 * by versions prior to 0.0.115.
15054 struct LDKCOption_PaymentFailureReasonZ reason;
15055 } LDKEvent_LDKPaymentFailed_Body;
15057 typedef struct LDKEvent_LDKPaymentPathSuccessful_Body {
15059 * The `payment_id` passed to [`ChannelManager::send_payment`].
15061 * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
15063 struct LDKThirtyTwoBytes payment_id;
15065 * The hash that was given to [`ChannelManager::send_payment`].
15067 * This will be `Some` for all payments which completed on LDK 0.0.104 or later.
15069 * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
15071 struct LDKCOption_ThirtyTwoBytesZ payment_hash;
15073 * The payment path that was successful.
15075 * May contain a closed channel if the HTLC sent along the path was fulfilled on chain.
15077 struct LDKPath path;
15078 } LDKEvent_LDKPaymentPathSuccessful_Body;
15080 typedef struct LDKEvent_LDKPaymentPathFailed_Body {
15082 * The `payment_id` passed to [`ChannelManager::send_payment`].
15084 * This will be `Some` for all payment paths which failed on LDK 0.0.103 or later.
15086 * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
15087 * [`ChannelManager::abandon_payment`]: crate::ln::channelmanager::ChannelManager::abandon_payment
15089 struct LDKCOption_ThirtyTwoBytesZ payment_id;
15091 * The hash that was given to [`ChannelManager::send_payment`].
15093 * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
15095 struct LDKThirtyTwoBytes payment_hash;
15097 * Indicates the payment was rejected for some reason by the recipient. This implies that
15098 * the payment has failed, not just the route in question. If this is not set, the payment may
15099 * be retried via a different route.
15101 bool payment_failed_permanently;
15103 * Extra error details based on the failure type. May contain an update that needs to be
15104 * applied to the [`NetworkGraph`].
15106 * [`NetworkGraph`]: crate::routing::gossip::NetworkGraph
15108 struct LDKPathFailure failure;
15110 * The payment path that failed.
15112 struct LDKPath path;
15114 * The channel responsible for the failed payment path.
15116 * Note that for route hints or for the first hop in a path this may be an SCID alias and
15117 * may not refer to a channel in the public network graph. These aliases may also collide
15118 * with channels in the public network graph.
15120 * If this is `Some`, then the corresponding channel should be avoided when the payment is
15121 * retried. May be `None` for older [`Event`] serializations.
15123 struct LDKCOption_u64Z short_channel_id;
15124 } LDKEvent_LDKPaymentPathFailed_Body;
15126 typedef struct LDKEvent_LDKProbeSuccessful_Body {
15128 * The id returned by [`ChannelManager::send_probe`].
15130 * [`ChannelManager::send_probe`]: crate::ln::channelmanager::ChannelManager::send_probe
15132 struct LDKThirtyTwoBytes payment_id;
15134 * The hash generated by [`ChannelManager::send_probe`].
15136 * [`ChannelManager::send_probe`]: crate::ln::channelmanager::ChannelManager::send_probe
15138 struct LDKThirtyTwoBytes payment_hash;
15140 * The payment path that was successful.
15142 struct LDKPath path;
15143 } LDKEvent_LDKProbeSuccessful_Body;
15145 typedef struct LDKEvent_LDKProbeFailed_Body {
15147 * The id returned by [`ChannelManager::send_probe`].
15149 * [`ChannelManager::send_probe`]: crate::ln::channelmanager::ChannelManager::send_probe
15151 struct LDKThirtyTwoBytes payment_id;
15153 * The hash generated by [`ChannelManager::send_probe`].
15155 * [`ChannelManager::send_probe`]: crate::ln::channelmanager::ChannelManager::send_probe
15157 struct LDKThirtyTwoBytes payment_hash;
15159 * The payment path that failed.
15161 struct LDKPath path;
15163 * The channel responsible for the failed probe.
15165 * Note that for route hints or for the first hop in a path this may be an SCID alias and
15166 * may not refer to a channel in the public network graph. These aliases may also collide
15167 * with channels in the public network graph.
15169 struct LDKCOption_u64Z short_channel_id;
15170 } LDKEvent_LDKProbeFailed_Body;
15172 typedef struct LDKEvent_LDKPendingHTLCsForwardable_Body {
15174 * The minimum amount of time that should be waited prior to calling
15175 * process_pending_htlc_forwards. To increase the effort required to correlate payments,
15176 * you should wait a random amount of time in roughly the range (now + time_forwardable,
15177 * now + 5*time_forwardable).
15179 uint64_t time_forwardable;
15180 } LDKEvent_LDKPendingHTLCsForwardable_Body;
15182 typedef struct LDKEvent_LDKHTLCIntercepted_Body {
15184 * An id to help LDK identify which HTLC is being forwarded or failed.
15186 struct LDKThirtyTwoBytes intercept_id;
15188 * The fake scid that was programmed as the next hop's scid, generated using
15189 * [`ChannelManager::get_intercept_scid`].
15191 * [`ChannelManager::get_intercept_scid`]: crate::ln::channelmanager::ChannelManager::get_intercept_scid
15193 uint64_t requested_next_hop_scid;
15195 * The payment hash used for this HTLC.
15197 struct LDKThirtyTwoBytes payment_hash;
15199 * How many msats were received on the inbound edge of this HTLC.
15201 uint64_t inbound_amount_msat;
15203 * How many msats the payer intended to route to the next node. Depending on the reason you are
15204 * intercepting this payment, you might take a fee by forwarding less than this amount.
15205 * Forwarding less than this amount may break compatibility with LDK versions prior to 0.0.116.
15207 * Note that LDK will NOT check that expected fees were factored into this value. You MUST
15208 * check that whatever fee you want has been included here or subtract it as required. Further,
15209 * LDK will not stop you from forwarding more than you received.
15211 uint64_t expected_outbound_amount_msat;
15212 } LDKEvent_LDKHTLCIntercepted_Body;
15214 typedef struct LDKEvent_LDKSpendableOutputs_Body {
15216 * The outputs which you should store as spendable by you.
15218 struct LDKCVec_SpendableOutputDescriptorZ outputs;
15220 * The `channel_id` indicating which channel the spendable outputs belong to.
15222 * This will always be `Some` for events generated by LDK versions 0.0.117 and above.
15224 struct LDKCOption_ThirtyTwoBytesZ channel_id;
15225 } LDKEvent_LDKSpendableOutputs_Body;
15227 typedef struct LDKEvent_LDKPaymentForwarded_Body {
15229 * The incoming channel between the previous node and us. This is only `None` for events
15230 * generated or serialized by versions prior to 0.0.107.
15232 struct LDKCOption_ThirtyTwoBytesZ prev_channel_id;
15234 * The outgoing channel between the next node and us. This is only `None` for events
15235 * generated or serialized by versions prior to 0.0.107.
15237 struct LDKCOption_ThirtyTwoBytesZ next_channel_id;
15239 * The fee, in milli-satoshis, which was earned as a result of the payment.
15241 * Note that if we force-closed the channel over which we forwarded an HTLC while the HTLC
15242 * was pending, the amount the next hop claimed will have been rounded down to the nearest
15243 * whole satoshi. Thus, the fee calculated here may be higher than expected as we still
15244 * claimed the full value in millisatoshis from the source. In this case,
15245 * `claim_from_onchain_tx` will be set.
15247 * If the channel which sent us the payment has been force-closed, we will claim the funds
15248 * via an on-chain transaction. In that case we do not yet know the on-chain transaction
15249 * fees which we will spend and will instead set this to `None`. It is possible duplicate
15250 * `PaymentForwarded` events are generated for the same payment iff `fee_earned_msat` is
15253 struct LDKCOption_u64Z fee_earned_msat;
15255 * If this is `true`, the forwarded HTLC was claimed by our counterparty via an on-chain
15258 bool claim_from_onchain_tx;
15260 * The final amount forwarded, in milli-satoshis, after the fee is deducted.
15262 * The caveat described above the `fee_earned_msat` field applies here as well.
15264 struct LDKCOption_u64Z outbound_amount_forwarded_msat;
15265 } LDKEvent_LDKPaymentForwarded_Body;
15267 typedef struct LDKEvent_LDKChannelPending_Body {
15269 * The `channel_id` of the channel that is pending confirmation.
15271 struct LDKThirtyTwoBytes channel_id;
15273 * The `user_channel_id` value passed in to [`ChannelManager::create_channel`] for outbound
15274 * channels, or to [`ChannelManager::accept_inbound_channel`] for inbound channels if
15275 * [`UserConfig::manually_accept_inbound_channels`] config flag is set to true. Otherwise
15276 * `user_channel_id` will be randomized for an inbound channel.
15278 * [`ChannelManager::create_channel`]: crate::ln::channelmanager::ChannelManager::create_channel
15279 * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
15280 * [`UserConfig::manually_accept_inbound_channels`]: crate::util::config::UserConfig::manually_accept_inbound_channels
15282 struct LDKU128 user_channel_id;
15284 * The `temporary_channel_id` this channel used to be known by during channel establishment.
15286 * Will be `None` for channels created prior to LDK version 0.0.115.
15288 struct LDKCOption_ThirtyTwoBytesZ former_temporary_channel_id;
15290 * The `node_id` of the channel counterparty.
15292 struct LDKPublicKey counterparty_node_id;
15294 * The outpoint of the channel's funding transaction.
15296 struct LDKOutPoint funding_txo;
15297 } LDKEvent_LDKChannelPending_Body;
15299 typedef struct LDKEvent_LDKChannelReady_Body {
15301 * The `channel_id` of the channel that is ready.
15303 struct LDKThirtyTwoBytes channel_id;
15305 * The `user_channel_id` value passed in to [`ChannelManager::create_channel`] for outbound
15306 * channels, or to [`ChannelManager::accept_inbound_channel`] for inbound channels if
15307 * [`UserConfig::manually_accept_inbound_channels`] config flag is set to true. Otherwise
15308 * `user_channel_id` will be randomized for an inbound channel.
15310 * [`ChannelManager::create_channel`]: crate::ln::channelmanager::ChannelManager::create_channel
15311 * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
15312 * [`UserConfig::manually_accept_inbound_channels`]: crate::util::config::UserConfig::manually_accept_inbound_channels
15314 struct LDKU128 user_channel_id;
15316 * The `node_id` of the channel counterparty.
15318 struct LDKPublicKey counterparty_node_id;
15320 * The features that this channel will operate with.
15322 struct LDKChannelTypeFeatures channel_type;
15323 } LDKEvent_LDKChannelReady_Body;
15325 typedef struct LDKEvent_LDKChannelClosed_Body {
15327 * The `channel_id` of the channel which has been closed. Note that on-chain transactions
15328 * resolving the channel are likely still awaiting confirmation.
15330 struct LDKThirtyTwoBytes channel_id;
15332 * The `user_channel_id` value passed in to [`ChannelManager::create_channel`] for outbound
15333 * channels, or to [`ChannelManager::accept_inbound_channel`] for inbound channels if
15334 * [`UserConfig::manually_accept_inbound_channels`] config flag is set to true. Otherwise
15335 * `user_channel_id` will be randomized for inbound channels.
15336 * This may be zero for inbound channels serialized prior to 0.0.113 and will always be
15337 * zero for objects serialized with LDK versions prior to 0.0.102.
15339 * [`ChannelManager::create_channel`]: crate::ln::channelmanager::ChannelManager::create_channel
15340 * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
15341 * [`UserConfig::manually_accept_inbound_channels`]: crate::util::config::UserConfig::manually_accept_inbound_channels
15343 struct LDKU128 user_channel_id;
15345 * The reason the channel was closed.
15347 struct LDKClosureReason reason;
15349 * Counterparty in the closed channel.
15351 * This field will be `None` for objects serialized prior to LDK 0.0.117.
15353 * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
15355 struct LDKPublicKey counterparty_node_id;
15357 * Channel capacity of the closing channel (sats).
15359 * This field will be `None` for objects serialized prior to LDK 0.0.117.
15361 struct LDKCOption_u64Z channel_capacity_sats;
15362 } LDKEvent_LDKChannelClosed_Body;
15364 typedef struct LDKEvent_LDKDiscardFunding_Body {
15366 * The channel_id of the channel which has been closed.
15368 struct LDKThirtyTwoBytes channel_id;
15370 * The full transaction received from the user
15372 struct LDKTransaction transaction;
15373 } LDKEvent_LDKDiscardFunding_Body;
15375 typedef struct LDKEvent_LDKOpenChannelRequest_Body {
15377 * The temporary channel ID of the channel requested to be opened.
15379 * When responding to the request, the `temporary_channel_id` should be passed
15380 * back to the ChannelManager through [`ChannelManager::accept_inbound_channel`] to accept,
15381 * or through [`ChannelManager::force_close_without_broadcasting_txn`] to reject.
15383 * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
15384 * [`ChannelManager::force_close_without_broadcasting_txn`]: crate::ln::channelmanager::ChannelManager::force_close_without_broadcasting_txn
15386 struct LDKThirtyTwoBytes temporary_channel_id;
15388 * The node_id of the counterparty requesting to open the channel.
15390 * When responding to the request, the `counterparty_node_id` should be passed
15391 * back to the `ChannelManager` through [`ChannelManager::accept_inbound_channel`] to
15392 * accept the request, or through [`ChannelManager::force_close_without_broadcasting_txn`] to reject the
15395 * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
15396 * [`ChannelManager::force_close_without_broadcasting_txn`]: crate::ln::channelmanager::ChannelManager::force_close_without_broadcasting_txn
15398 struct LDKPublicKey counterparty_node_id;
15400 * The channel value of the requested channel.
15402 uint64_t funding_satoshis;
15404 * Our starting balance in the channel if the request is accepted, in milli-satoshi.
15406 uint64_t push_msat;
15408 * The features that this channel will operate with. If you reject the channel, a
15409 * well-behaved counterparty may automatically re-attempt the channel with a new set of
15412 * Note that if [`ChannelTypeFeatures::supports_scid_privacy`] returns true on this type,
15413 * the resulting [`ChannelManager`] will not be readable by versions of LDK prior to
15416 * Furthermore, note that if [`ChannelTypeFeatures::supports_zero_conf`] returns true on this type,
15417 * the resulting [`ChannelManager`] will not be readable by versions of LDK prior to
15418 * 0.0.107. Channels setting this type also need to get manually accepted via
15419 * [`crate::ln::channelmanager::ChannelManager::accept_inbound_channel_from_trusted_peer_0conf`],
15420 * or will be rejected otherwise.
15422 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
15424 struct LDKChannelTypeFeatures channel_type;
15425 } LDKEvent_LDKOpenChannelRequest_Body;
15427 typedef struct LDKEvent_LDKHTLCHandlingFailed_Body {
15429 * The channel over which the HTLC was received.
15431 struct LDKThirtyTwoBytes prev_channel_id;
15433 * Destination of the HTLC that failed to be processed.
15435 struct LDKHTLCDestination failed_next_destination;
15436 } LDKEvent_LDKHTLCHandlingFailed_Body;
15438 typedef struct MUST_USE_STRUCT LDKEvent {
15441 LDKEvent_LDKFundingGenerationReady_Body funding_generation_ready;
15442 LDKEvent_LDKPaymentClaimable_Body payment_claimable;
15443 LDKEvent_LDKPaymentClaimed_Body payment_claimed;
15444 LDKEvent_LDKPaymentSent_Body payment_sent;
15445 LDKEvent_LDKPaymentFailed_Body payment_failed;
15446 LDKEvent_LDKPaymentPathSuccessful_Body payment_path_successful;
15447 LDKEvent_LDKPaymentPathFailed_Body payment_path_failed;
15448 LDKEvent_LDKProbeSuccessful_Body probe_successful;
15449 LDKEvent_LDKProbeFailed_Body probe_failed;
15450 LDKEvent_LDKPendingHTLCsForwardable_Body pending_htl_cs_forwardable;
15451 LDKEvent_LDKHTLCIntercepted_Body htlc_intercepted;
15452 LDKEvent_LDKSpendableOutputs_Body spendable_outputs;
15453 LDKEvent_LDKPaymentForwarded_Body payment_forwarded;
15454 LDKEvent_LDKChannelPending_Body channel_pending;
15455 LDKEvent_LDKChannelReady_Body channel_ready;
15456 LDKEvent_LDKChannelClosed_Body channel_closed;
15457 LDKEvent_LDKDiscardFunding_Body discard_funding;
15458 LDKEvent_LDKOpenChannelRequest_Body open_channel_request;
15459 LDKEvent_LDKHTLCHandlingFailed_Body htlc_handling_failed;
15461 struct LDKBumpTransactionEvent bump_transaction;
15467 * An enum which can either contain a crate::lightning::events::Event or not
15469 typedef enum LDKCOption_EventZ_Tag {
15471 * When we're in this state, this COption_EventZ contains a crate::lightning::events::Event
15473 LDKCOption_EventZ_Some,
15475 * When we're in this state, this COption_EventZ contains nothing
15477 LDKCOption_EventZ_None,
15479 * Must be last for serialization purposes
15481 LDKCOption_EventZ_Sentinel,
15482 } LDKCOption_EventZ_Tag;
15484 typedef struct LDKCOption_EventZ {
15485 LDKCOption_EventZ_Tag tag;
15488 struct LDKEvent some;
15491 } LDKCOption_EventZ;
15494 * The contents of CResult_COption_EventZDecodeErrorZ
15496 typedef union LDKCResult_COption_EventZDecodeErrorZPtr {
15498 * A pointer to the contents in the success state.
15499 * Reading from this pointer when `result_ok` is not set is undefined.
15501 struct LDKCOption_EventZ *result;
15503 * A pointer to the contents in the error state.
15504 * Reading from this pointer when `result_ok` is set is undefined.
15506 struct LDKDecodeError *err;
15507 } LDKCResult_COption_EventZDecodeErrorZPtr;
15510 * A CResult_COption_EventZDecodeErrorZ represents the result of a fallible operation,
15511 * containing a crate::c_types::derived::COption_EventZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
15512 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
15514 typedef struct LDKCResult_COption_EventZDecodeErrorZ {
15516 * The contents of this CResult_COption_EventZDecodeErrorZ, accessible via either
15517 * `err` or `result` depending on the state of `result_ok`.
15519 union LDKCResult_COption_EventZDecodeErrorZPtr contents;
15521 * Whether this CResult_COption_EventZDecodeErrorZ represents a success state.
15524 } LDKCResult_COption_EventZDecodeErrorZ;
15527 * Sub-errors which don't have specific information in them use this type.
15529 typedef struct LDKError {
15531 * Zero-Sized_types aren't consistent across Rust/C/C++, so we add some size here
15537 * Errors that indicate what is wrong with the invoice. They have some granularity for debug
15538 * reasons, but should generally result in an \"invalid BOLT11 invoice\" message for the user.
15540 typedef enum LDKBolt11ParseError_Tag {
15541 LDKBolt11ParseError_Bech32Error,
15542 LDKBolt11ParseError_ParseAmountError,
15543 LDKBolt11ParseError_MalformedSignature,
15544 LDKBolt11ParseError_BadPrefix,
15545 LDKBolt11ParseError_UnknownCurrency,
15546 LDKBolt11ParseError_UnknownSiPrefix,
15547 LDKBolt11ParseError_MalformedHRP,
15548 LDKBolt11ParseError_TooShortDataPart,
15549 LDKBolt11ParseError_UnexpectedEndOfTaggedFields,
15550 LDKBolt11ParseError_DescriptionDecodeError,
15551 LDKBolt11ParseError_PaddingError,
15552 LDKBolt11ParseError_IntegerOverflowError,
15553 LDKBolt11ParseError_InvalidSegWitProgramLength,
15554 LDKBolt11ParseError_InvalidPubKeyHashLength,
15555 LDKBolt11ParseError_InvalidScriptHashLength,
15556 LDKBolt11ParseError_InvalidRecoveryId,
15557 LDKBolt11ParseError_InvalidSliceLength,
15559 * Not an error, but used internally to signal that a part of the invoice should be ignored
15560 * according to BOLT11
15562 LDKBolt11ParseError_Skip,
15564 * Must be last for serialization purposes
15566 LDKBolt11ParseError_Sentinel,
15567 } LDKBolt11ParseError_Tag;
15569 typedef struct MUST_USE_STRUCT LDKBolt11ParseError {
15570 LDKBolt11ParseError_Tag tag;
15573 struct LDKBech32Error bech32_error;
15576 struct LDKError parse_amount_error;
15579 enum LDKSecp256k1Error malformed_signature;
15582 struct LDKError description_decode_error;
15585 struct LDKStr invalid_slice_length;
15588 } LDKBolt11ParseError;
15591 * The contents of CResult_SiPrefixBolt11ParseErrorZ
15593 typedef union LDKCResult_SiPrefixBolt11ParseErrorZPtr {
15595 * A pointer to the contents in the success state.
15596 * Reading from this pointer when `result_ok` is not set is undefined.
15598 enum LDKSiPrefix *result;
15600 * A pointer to the contents in the error state.
15601 * Reading from this pointer when `result_ok` is set is undefined.
15603 struct LDKBolt11ParseError *err;
15604 } LDKCResult_SiPrefixBolt11ParseErrorZPtr;
15607 * A CResult_SiPrefixBolt11ParseErrorZ represents the result of a fallible operation,
15608 * containing a crate::lightning_invoice::SiPrefix on success and a crate::lightning_invoice::Bolt11ParseError on failure.
15609 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
15611 typedef struct LDKCResult_SiPrefixBolt11ParseErrorZ {
15613 * The contents of this CResult_SiPrefixBolt11ParseErrorZ, accessible via either
15614 * `err` or `result` depending on the state of `result_ok`.
15616 union LDKCResult_SiPrefixBolt11ParseErrorZPtr contents;
15618 * Whether this CResult_SiPrefixBolt11ParseErrorZ represents a success state.
15621 } LDKCResult_SiPrefixBolt11ParseErrorZ;
15624 * Indicates that something went wrong while parsing or validating the invoice. Parsing errors
15625 * should be mostly seen as opaque and are only there for debugging reasons. Semantic errors
15626 * like wrong signatures, missing fields etc. could mean that someone tampered with the invoice.
15628 typedef enum LDKParseOrSemanticError_Tag {
15630 * The invoice couldn't be decoded
15632 LDKParseOrSemanticError_ParseError,
15634 * The invoice could be decoded but violates the BOLT11 standard
15636 LDKParseOrSemanticError_SemanticError,
15638 * Must be last for serialization purposes
15640 LDKParseOrSemanticError_Sentinel,
15641 } LDKParseOrSemanticError_Tag;
15643 typedef struct MUST_USE_STRUCT LDKParseOrSemanticError {
15644 LDKParseOrSemanticError_Tag tag;
15647 struct LDKBolt11ParseError parse_error;
15650 enum LDKBolt11SemanticError semantic_error;
15653 } LDKParseOrSemanticError;
15656 * The contents of CResult_Bolt11InvoiceParseOrSemanticErrorZ
15658 typedef union LDKCResult_Bolt11InvoiceParseOrSemanticErrorZPtr {
15660 * A pointer to the contents in the success state.
15661 * Reading from this pointer when `result_ok` is not set is undefined.
15663 struct LDKBolt11Invoice *result;
15665 * A pointer to the contents in the error state.
15666 * Reading from this pointer when `result_ok` is set is undefined.
15668 struct LDKParseOrSemanticError *err;
15669 } LDKCResult_Bolt11InvoiceParseOrSemanticErrorZPtr;
15672 * A CResult_Bolt11InvoiceParseOrSemanticErrorZ represents the result of a fallible operation,
15673 * containing a crate::lightning_invoice::Bolt11Invoice on success and a crate::lightning_invoice::ParseOrSemanticError on failure.
15674 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
15676 typedef struct LDKCResult_Bolt11InvoiceParseOrSemanticErrorZ {
15678 * The contents of this CResult_Bolt11InvoiceParseOrSemanticErrorZ, accessible via either
15679 * `err` or `result` depending on the state of `result_ok`.
15681 union LDKCResult_Bolt11InvoiceParseOrSemanticErrorZPtr contents;
15683 * Whether this CResult_Bolt11InvoiceParseOrSemanticErrorZ represents a success state.
15686 } LDKCResult_Bolt11InvoiceParseOrSemanticErrorZ;
15691 * Represents a signed [`RawBolt11Invoice`] with cached hash. The signature is not checked and may be
15695 * The hash has to be either from the deserialized invoice or from the serialized [`RawBolt11Invoice`].
15697 typedef struct MUST_USE_STRUCT LDKSignedRawBolt11Invoice {
15699 * A pointer to the opaque Rust object.
15700 * Nearly everywhere, inner must be non-null, however in places where
15701 * the Rust equivalent takes an Option, it may be set to null to indicate None.
15703 LDKnativeSignedRawBolt11Invoice *inner;
15705 * Indicates that this is the only struct which contains the same pointer.
15706 * Rust functions which take ownership of an object provided via an argument require
15707 * this to be true and invalidate the object pointed to by inner.
15710 } LDKSignedRawBolt11Invoice;
15713 * The contents of CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ
15715 typedef union LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZPtr {
15717 * A pointer to the contents in the success state.
15718 * Reading from this pointer when `result_ok` is not set is undefined.
15720 struct LDKSignedRawBolt11Invoice *result;
15722 * A pointer to the contents in the error state.
15723 * Reading from this pointer when `result_ok` is set is undefined.
15725 struct LDKBolt11ParseError *err;
15726 } LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZPtr;
15729 * A CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ represents the result of a fallible operation,
15730 * containing a crate::lightning_invoice::SignedRawBolt11Invoice on success and a crate::lightning_invoice::Bolt11ParseError on failure.
15731 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
15733 typedef struct LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZ {
15735 * The contents of this CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ, accessible via either
15736 * `err` or `result` depending on the state of `result_ok`.
15738 union LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZPtr contents;
15740 * Whether this CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ represents a success state.
15743 } LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZ;
15748 * Represents an syntactically correct [`Bolt11Invoice`] for a payment on the lightning network,
15749 * but without the signature information.
15750 * Decoding and encoding should not lead to information loss but may lead to different hashes.
15752 * For methods without docs see the corresponding methods in [`Bolt11Invoice`].
15754 typedef struct MUST_USE_STRUCT LDKRawBolt11Invoice {
15756 * A pointer to the opaque Rust object.
15757 * Nearly everywhere, inner must be non-null, however in places where
15758 * the Rust equivalent takes an Option, it may be set to null to indicate None.
15760 LDKnativeRawBolt11Invoice *inner;
15762 * Indicates that this is the only struct which contains the same pointer.
15763 * Rust functions which take ownership of an object provided via an argument require
15764 * this to be true and invalidate the object pointed to by inner.
15767 } LDKRawBolt11Invoice;
15772 * Recoverable signature
15774 typedef struct MUST_USE_STRUCT LDKBolt11InvoiceSignature {
15776 * A pointer to the opaque Rust object.
15777 * Nearly everywhere, inner must be non-null, however in places where
15778 * the Rust equivalent takes an Option, it may be set to null to indicate None.
15780 LDKnativeBolt11InvoiceSignature *inner;
15782 * Indicates that this is the only struct which contains the same pointer.
15783 * Rust functions which take ownership of an object provided via an argument require
15784 * this to be true and invalidate the object pointed to by inner.
15787 } LDKBolt11InvoiceSignature;
15790 * A tuple of 3 elements. See the individual fields for the types contained.
15792 typedef struct LDKC3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ {
15794 * The element at position 0
15796 struct LDKRawBolt11Invoice a;
15798 * The element at position 1
15800 struct LDKThirtyTwoBytes b;
15802 * The element at position 2
15804 struct LDKBolt11InvoiceSignature c;
15805 } LDKC3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ;
15812 typedef struct MUST_USE_STRUCT LDKPayeePubKey {
15814 * A pointer to the opaque Rust object.
15815 * Nearly everywhere, inner must be non-null, however in places where
15816 * the Rust equivalent takes an Option, it may be set to null to indicate None.
15818 LDKnativePayeePubKey *inner;
15820 * Indicates that this is the only struct which contains the same pointer.
15821 * Rust functions which take ownership of an object provided via an argument require
15822 * this to be true and invalidate the object pointed to by inner.
15828 * The contents of CResult_PayeePubKeySecp256k1ErrorZ
15830 typedef union LDKCResult_PayeePubKeySecp256k1ErrorZPtr {
15832 * A pointer to the contents in the success state.
15833 * Reading from this pointer when `result_ok` is not set is undefined.
15835 struct LDKPayeePubKey *result;
15837 * A pointer to the contents in the error state.
15838 * Reading from this pointer when `result_ok` is set is undefined.
15840 enum LDKSecp256k1Error *err;
15841 } LDKCResult_PayeePubKeySecp256k1ErrorZPtr;
15844 * A CResult_PayeePubKeySecp256k1ErrorZ represents the result of a fallible operation,
15845 * containing a crate::lightning_invoice::PayeePubKey on success and a crate::c_types::Secp256k1Error on failure.
15846 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
15848 typedef struct LDKCResult_PayeePubKeySecp256k1ErrorZ {
15850 * The contents of this CResult_PayeePubKeySecp256k1ErrorZ, accessible via either
15851 * `err` or `result` depending on the state of `result_ok`.
15853 union LDKCResult_PayeePubKeySecp256k1ErrorZPtr contents;
15855 * Whether this CResult_PayeePubKeySecp256k1ErrorZ represents a success state.
15858 } LDKCResult_PayeePubKeySecp256k1ErrorZ;
15863 * Private routing information
15866 * The encoded route has to be <1024 5bit characters long (<=639 bytes or <=12 hops)
15869 typedef struct MUST_USE_STRUCT LDKPrivateRoute {
15871 * A pointer to the opaque Rust object.
15872 * Nearly everywhere, inner must be non-null, however in places where
15873 * the Rust equivalent takes an Option, it may be set to null to indicate None.
15875 LDKnativePrivateRoute *inner;
15877 * Indicates that this is the only struct which contains the same pointer.
15878 * Rust functions which take ownership of an object provided via an argument require
15879 * this to be true and invalidate the object pointed to by inner.
15885 * A dynamically-allocated array of crate::lightning_invoice::PrivateRoutes of arbitrary size.
15886 * This corresponds to std::vector in C++
15888 typedef struct LDKCVec_PrivateRouteZ {
15890 * The elements in the array.
15891 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
15893 struct LDKPrivateRoute *data;
15895 * The number of elements pointed to by `data`.
15898 } LDKCVec_PrivateRouteZ;
15903 * A timestamp that refers to a date after 1 January 1970.
15907 * The Unix timestamp representing the stored time has to be positive and no greater than
15908 * [`MAX_TIMESTAMP`].
15910 typedef struct MUST_USE_STRUCT LDKPositiveTimestamp {
15912 * A pointer to the opaque Rust object.
15913 * Nearly everywhere, inner must be non-null, however in places where
15914 * the Rust equivalent takes an Option, it may be set to null to indicate None.
15916 LDKnativePositiveTimestamp *inner;
15918 * Indicates that this is the only struct which contains the same pointer.
15919 * Rust functions which take ownership of an object provided via an argument require
15920 * this to be true and invalidate the object pointed to by inner.
15923 } LDKPositiveTimestamp;
15926 * The contents of CResult_PositiveTimestampCreationErrorZ
15928 typedef union LDKCResult_PositiveTimestampCreationErrorZPtr {
15930 * A pointer to the contents in the success state.
15931 * Reading from this pointer when `result_ok` is not set is undefined.
15933 struct LDKPositiveTimestamp *result;
15935 * A pointer to the contents in the error state.
15936 * Reading from this pointer when `result_ok` is set is undefined.
15938 enum LDKCreationError *err;
15939 } LDKCResult_PositiveTimestampCreationErrorZPtr;
15942 * A CResult_PositiveTimestampCreationErrorZ represents the result of a fallible operation,
15943 * containing a crate::lightning_invoice::PositiveTimestamp on success and a crate::lightning_invoice::CreationError on failure.
15944 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
15946 typedef struct LDKCResult_PositiveTimestampCreationErrorZ {
15948 * The contents of this CResult_PositiveTimestampCreationErrorZ, accessible via either
15949 * `err` or `result` depending on the state of `result_ok`.
15951 union LDKCResult_PositiveTimestampCreationErrorZPtr contents;
15953 * Whether this CResult_PositiveTimestampCreationErrorZ represents a success state.
15956 } LDKCResult_PositiveTimestampCreationErrorZ;
15959 * The contents of CResult_NoneBolt11SemanticErrorZ
15961 typedef union LDKCResult_NoneBolt11SemanticErrorZPtr {
15963 * Note that this value is always NULL, as there are no contents in the OK variant
15967 * A pointer to the contents in the error state.
15968 * Reading from this pointer when `result_ok` is set is undefined.
15970 enum LDKBolt11SemanticError *err;
15971 } LDKCResult_NoneBolt11SemanticErrorZPtr;
15974 * A CResult_NoneBolt11SemanticErrorZ represents the result of a fallible operation,
15975 * containing a () on success and a crate::lightning_invoice::Bolt11SemanticError on failure.
15976 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
15978 typedef struct LDKCResult_NoneBolt11SemanticErrorZ {
15980 * The contents of this CResult_NoneBolt11SemanticErrorZ, accessible via either
15981 * `err` or `result` depending on the state of `result_ok`.
15983 union LDKCResult_NoneBolt11SemanticErrorZPtr contents;
15985 * Whether this CResult_NoneBolt11SemanticErrorZ represents a success state.
15988 } LDKCResult_NoneBolt11SemanticErrorZ;
15991 * The contents of CResult_Bolt11InvoiceBolt11SemanticErrorZ
15993 typedef union LDKCResult_Bolt11InvoiceBolt11SemanticErrorZPtr {
15995 * A pointer to the contents in the success state.
15996 * Reading from this pointer when `result_ok` is not set is undefined.
15998 struct LDKBolt11Invoice *result;
16000 * A pointer to the contents in the error state.
16001 * Reading from this pointer when `result_ok` is set is undefined.
16003 enum LDKBolt11SemanticError *err;
16004 } LDKCResult_Bolt11InvoiceBolt11SemanticErrorZPtr;
16007 * A CResult_Bolt11InvoiceBolt11SemanticErrorZ represents the result of a fallible operation,
16008 * containing a crate::lightning_invoice::Bolt11Invoice on success and a crate::lightning_invoice::Bolt11SemanticError on failure.
16009 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
16011 typedef struct LDKCResult_Bolt11InvoiceBolt11SemanticErrorZ {
16013 * The contents of this CResult_Bolt11InvoiceBolt11SemanticErrorZ, accessible via either
16014 * `err` or `result` depending on the state of `result_ok`.
16016 union LDKCResult_Bolt11InvoiceBolt11SemanticErrorZPtr contents;
16018 * Whether this CResult_Bolt11InvoiceBolt11SemanticErrorZ represents a success state.
16021 } LDKCResult_Bolt11InvoiceBolt11SemanticErrorZ;
16026 * Description string
16029 * The description can be at most 639 __bytes__ long
16031 typedef struct MUST_USE_STRUCT LDKDescription {
16033 * A pointer to the opaque Rust object.
16034 * Nearly everywhere, inner must be non-null, however in places where
16035 * the Rust equivalent takes an Option, it may be set to null to indicate None.
16037 LDKnativeDescription *inner;
16039 * Indicates that this is the only struct which contains the same pointer.
16040 * Rust functions which take ownership of an object provided via an argument require
16041 * this to be true and invalidate the object pointed to by inner.
16047 * The contents of CResult_DescriptionCreationErrorZ
16049 typedef union LDKCResult_DescriptionCreationErrorZPtr {
16051 * A pointer to the contents in the success state.
16052 * Reading from this pointer when `result_ok` is not set is undefined.
16054 struct LDKDescription *result;
16056 * A pointer to the contents in the error state.
16057 * Reading from this pointer when `result_ok` is set is undefined.
16059 enum LDKCreationError *err;
16060 } LDKCResult_DescriptionCreationErrorZPtr;
16063 * A CResult_DescriptionCreationErrorZ represents the result of a fallible operation,
16064 * containing a crate::lightning_invoice::Description on success and a crate::lightning_invoice::CreationError on failure.
16065 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
16067 typedef struct LDKCResult_DescriptionCreationErrorZ {
16069 * The contents of this CResult_DescriptionCreationErrorZ, accessible via either
16070 * `err` or `result` depending on the state of `result_ok`.
16072 union LDKCResult_DescriptionCreationErrorZPtr contents;
16074 * Whether this CResult_DescriptionCreationErrorZ represents a success state.
16077 } LDKCResult_DescriptionCreationErrorZ;
16080 * The contents of CResult_PrivateRouteCreationErrorZ
16082 typedef union LDKCResult_PrivateRouteCreationErrorZPtr {
16084 * A pointer to the contents in the success state.
16085 * Reading from this pointer when `result_ok` is not set is undefined.
16087 struct LDKPrivateRoute *result;
16089 * A pointer to the contents in the error state.
16090 * Reading from this pointer when `result_ok` is set is undefined.
16092 enum LDKCreationError *err;
16093 } LDKCResult_PrivateRouteCreationErrorZPtr;
16096 * A CResult_PrivateRouteCreationErrorZ represents the result of a fallible operation,
16097 * containing a crate::lightning_invoice::PrivateRoute on success and a crate::lightning_invoice::CreationError on failure.
16098 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
16100 typedef struct LDKCResult_PrivateRouteCreationErrorZ {
16102 * The contents of this CResult_PrivateRouteCreationErrorZ, accessible via either
16103 * `err` or `result` depending on the state of `result_ok`.
16105 union LDKCResult_PrivateRouteCreationErrorZPtr contents;
16107 * Whether this CResult_PrivateRouteCreationErrorZ represents a success state.
16110 } LDKCResult_PrivateRouteCreationErrorZ;
16113 * The contents of CResult_OutPointDecodeErrorZ
16115 typedef union LDKCResult_OutPointDecodeErrorZPtr {
16117 * A pointer to the contents in the success state.
16118 * Reading from this pointer when `result_ok` is not set is undefined.
16120 struct LDKOutPoint *result;
16122 * A pointer to the contents in the error state.
16123 * Reading from this pointer when `result_ok` is set is undefined.
16125 struct LDKDecodeError *err;
16126 } LDKCResult_OutPointDecodeErrorZPtr;
16129 * A CResult_OutPointDecodeErrorZ represents the result of a fallible operation,
16130 * containing a crate::lightning::chain::transaction::OutPoint on success and a crate::lightning::ln::msgs::DecodeError on failure.
16131 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
16133 typedef struct LDKCResult_OutPointDecodeErrorZ {
16135 * The contents of this CResult_OutPointDecodeErrorZ, accessible via either
16136 * `err` or `result` depending on the state of `result_ok`.
16138 union LDKCResult_OutPointDecodeErrorZPtr contents;
16140 * Whether this CResult_OutPointDecodeErrorZ represents a success state.
16143 } LDKCResult_OutPointDecodeErrorZ;
16148 * Lightning TLV uses a custom variable-length integer called `BigSize`. It is similar to Bitcoin's
16149 * variable-length integers except that it is serialized in big-endian instead of little-endian.
16151 * Like Bitcoin's variable-length integer, it exhibits ambiguity in that certain values can be
16152 * encoded in several different ways, which we must check for at deserialization-time. Thus, if
16153 * you're looking for an example of a variable-length integer to use for your own project, move
16154 * along, this is a rather poor design.
16156 typedef struct MUST_USE_STRUCT LDKBigSize {
16158 * A pointer to the opaque Rust object.
16159 * Nearly everywhere, inner must be non-null, however in places where
16160 * the Rust equivalent takes an Option, it may be set to null to indicate None.
16162 LDKnativeBigSize *inner;
16164 * Indicates that this is the only struct which contains the same pointer.
16165 * Rust functions which take ownership of an object provided via an argument require
16166 * this to be true and invalidate the object pointed to by inner.
16172 * The contents of CResult_BigSizeDecodeErrorZ
16174 typedef union LDKCResult_BigSizeDecodeErrorZPtr {
16176 * A pointer to the contents in the success state.
16177 * Reading from this pointer when `result_ok` is not set is undefined.
16179 struct LDKBigSize *result;
16181 * A pointer to the contents in the error state.
16182 * Reading from this pointer when `result_ok` is set is undefined.
16184 struct LDKDecodeError *err;
16185 } LDKCResult_BigSizeDecodeErrorZPtr;
16188 * A CResult_BigSizeDecodeErrorZ represents the result of a fallible operation,
16189 * containing a crate::lightning::util::ser::BigSize on success and a crate::lightning::ln::msgs::DecodeError on failure.
16190 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
16192 typedef struct LDKCResult_BigSizeDecodeErrorZ {
16194 * The contents of this CResult_BigSizeDecodeErrorZ, accessible via either
16195 * `err` or `result` depending on the state of `result_ok`.
16197 union LDKCResult_BigSizeDecodeErrorZPtr contents;
16199 * Whether this CResult_BigSizeDecodeErrorZ represents a success state.
16202 } LDKCResult_BigSizeDecodeErrorZ;
16205 * The contents of CResult_HostnameDecodeErrorZ
16207 typedef union LDKCResult_HostnameDecodeErrorZPtr {
16209 * A pointer to the contents in the success state.
16210 * Reading from this pointer when `result_ok` is not set is undefined.
16212 struct LDKHostname *result;
16214 * A pointer to the contents in the error state.
16215 * Reading from this pointer when `result_ok` is set is undefined.
16217 struct LDKDecodeError *err;
16218 } LDKCResult_HostnameDecodeErrorZPtr;
16221 * A CResult_HostnameDecodeErrorZ represents the result of a fallible operation,
16222 * containing a crate::lightning::util::ser::Hostname on success and a crate::lightning::ln::msgs::DecodeError on failure.
16223 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
16225 typedef struct LDKCResult_HostnameDecodeErrorZ {
16227 * The contents of this CResult_HostnameDecodeErrorZ, accessible via either
16228 * `err` or `result` depending on the state of `result_ok`.
16230 union LDKCResult_HostnameDecodeErrorZPtr contents;
16232 * Whether this CResult_HostnameDecodeErrorZ represents a success state.
16235 } LDKCResult_HostnameDecodeErrorZ;
16240 * A wrapper for a `Transaction` which can only be constructed with [`TransactionU16LenLimited::new`]
16241 * if the `Transaction`'s consensus-serialized length is <= u16::MAX.
16243 * Use [`TransactionU16LenLimited::into_transaction`] to convert into the contained `Transaction`.
16245 typedef struct MUST_USE_STRUCT LDKTransactionU16LenLimited {
16247 * A pointer to the opaque Rust object.
16248 * Nearly everywhere, inner must be non-null, however in places where
16249 * the Rust equivalent takes an Option, it may be set to null to indicate None.
16251 LDKnativeTransactionU16LenLimited *inner;
16253 * Indicates that this is the only struct which contains the same pointer.
16254 * Rust functions which take ownership of an object provided via an argument require
16255 * this to be true and invalidate the object pointed to by inner.
16258 } LDKTransactionU16LenLimited;
16261 * The contents of CResult_TransactionU16LenLimitedNoneZ
16263 typedef union LDKCResult_TransactionU16LenLimitedNoneZPtr {
16265 * A pointer to the contents in the success state.
16266 * Reading from this pointer when `result_ok` is not set is undefined.
16268 struct LDKTransactionU16LenLimited *result;
16270 * Note that this value is always NULL, as there are no contents in the Err variant
16273 } LDKCResult_TransactionU16LenLimitedNoneZPtr;
16276 * A CResult_TransactionU16LenLimitedNoneZ represents the result of a fallible operation,
16277 * containing a crate::lightning::util::ser::TransactionU16LenLimited on success and a () on failure.
16278 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
16280 typedef struct LDKCResult_TransactionU16LenLimitedNoneZ {
16282 * The contents of this CResult_TransactionU16LenLimitedNoneZ, accessible via either
16283 * `err` or `result` depending on the state of `result_ok`.
16285 union LDKCResult_TransactionU16LenLimitedNoneZPtr contents;
16287 * Whether this CResult_TransactionU16LenLimitedNoneZ represents a success state.
16290 } LDKCResult_TransactionU16LenLimitedNoneZ;
16293 * The contents of CResult_TransactionU16LenLimitedDecodeErrorZ
16295 typedef union LDKCResult_TransactionU16LenLimitedDecodeErrorZPtr {
16297 * A pointer to the contents in the success state.
16298 * Reading from this pointer when `result_ok` is not set is undefined.
16300 struct LDKTransactionU16LenLimited *result;
16302 * A pointer to the contents in the error state.
16303 * Reading from this pointer when `result_ok` is set is undefined.
16305 struct LDKDecodeError *err;
16306 } LDKCResult_TransactionU16LenLimitedDecodeErrorZPtr;
16309 * A CResult_TransactionU16LenLimitedDecodeErrorZ represents the result of a fallible operation,
16310 * containing a crate::lightning::util::ser::TransactionU16LenLimited on success and a crate::lightning::ln::msgs::DecodeError on failure.
16311 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
16313 typedef struct LDKCResult_TransactionU16LenLimitedDecodeErrorZ {
16315 * The contents of this CResult_TransactionU16LenLimitedDecodeErrorZ, accessible via either
16316 * `err` or `result` depending on the state of `result_ok`.
16318 union LDKCResult_TransactionU16LenLimitedDecodeErrorZPtr contents;
16320 * Whether this CResult_TransactionU16LenLimitedDecodeErrorZ represents a success state.
16323 } LDKCResult_TransactionU16LenLimitedDecodeErrorZ;
16326 * The contents of CResult_UntrustedStringDecodeErrorZ
16328 typedef union LDKCResult_UntrustedStringDecodeErrorZPtr {
16330 * A pointer to the contents in the success state.
16331 * Reading from this pointer when `result_ok` is not set is undefined.
16333 struct LDKUntrustedString *result;
16335 * A pointer to the contents in the error state.
16336 * Reading from this pointer when `result_ok` is set is undefined.
16338 struct LDKDecodeError *err;
16339 } LDKCResult_UntrustedStringDecodeErrorZPtr;
16342 * A CResult_UntrustedStringDecodeErrorZ represents the result of a fallible operation,
16343 * containing a crate::lightning::util::string::UntrustedString on success and a crate::lightning::ln::msgs::DecodeError on failure.
16344 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
16346 typedef struct LDKCResult_UntrustedStringDecodeErrorZ {
16348 * The contents of this CResult_UntrustedStringDecodeErrorZ, accessible via either
16349 * `err` or `result` depending on the state of `result_ok`.
16351 union LDKCResult_UntrustedStringDecodeErrorZPtr contents;
16353 * Whether this CResult_UntrustedStringDecodeErrorZ represents a success state.
16356 } LDKCResult_UntrustedStringDecodeErrorZ;
16361 * Data to construct a [`BlindedHop`] for receiving a payment. This payload is custom to LDK and
16362 * may not be valid if received by another lightning implementation.
16364 typedef struct MUST_USE_STRUCT LDKReceiveTlvs {
16366 * A pointer to the opaque Rust object.
16367 * Nearly everywhere, inner must be non-null, however in places where
16368 * the Rust equivalent takes an Option, it may be set to null to indicate None.
16370 LDKnativeReceiveTlvs *inner;
16372 * Indicates that this is the only struct which contains the same pointer.
16373 * Rust functions which take ownership of an object provided via an argument require
16374 * this to be true and invalidate the object pointed to by inner.
16380 * The contents of CResult_ReceiveTlvsDecodeErrorZ
16382 typedef union LDKCResult_ReceiveTlvsDecodeErrorZPtr {
16384 * A pointer to the contents in the success state.
16385 * Reading from this pointer when `result_ok` is not set is undefined.
16387 struct LDKReceiveTlvs *result;
16389 * A pointer to the contents in the error state.
16390 * Reading from this pointer when `result_ok` is set is undefined.
16392 struct LDKDecodeError *err;
16393 } LDKCResult_ReceiveTlvsDecodeErrorZPtr;
16396 * A CResult_ReceiveTlvsDecodeErrorZ represents the result of a fallible operation,
16397 * containing a crate::lightning::blinded_path::payment::ReceiveTlvs on success and a crate::lightning::ln::msgs::DecodeError on failure.
16398 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
16400 typedef struct LDKCResult_ReceiveTlvsDecodeErrorZ {
16402 * The contents of this CResult_ReceiveTlvsDecodeErrorZ, accessible via either
16403 * `err` or `result` depending on the state of `result_ok`.
16405 union LDKCResult_ReceiveTlvsDecodeErrorZPtr contents;
16407 * Whether this CResult_ReceiveTlvsDecodeErrorZ represents a success state.
16410 } LDKCResult_ReceiveTlvsDecodeErrorZ;
16415 * Parameters for relaying over a given [`BlindedHop`].
16417 * [`BlindedHop`]: crate::blinded_path::BlindedHop
16419 typedef struct MUST_USE_STRUCT LDKPaymentRelay {
16421 * A pointer to the opaque Rust object.
16422 * Nearly everywhere, inner must be non-null, however in places where
16423 * the Rust equivalent takes an Option, it may be set to null to indicate None.
16425 LDKnativePaymentRelay *inner;
16427 * Indicates that this is the only struct which contains the same pointer.
16428 * Rust functions which take ownership of an object provided via an argument require
16429 * this to be true and invalidate the object pointed to by inner.
16435 * The contents of CResult_PaymentRelayDecodeErrorZ
16437 typedef union LDKCResult_PaymentRelayDecodeErrorZPtr {
16439 * A pointer to the contents in the success state.
16440 * Reading from this pointer when `result_ok` is not set is undefined.
16442 struct LDKPaymentRelay *result;
16444 * A pointer to the contents in the error state.
16445 * Reading from this pointer when `result_ok` is set is undefined.
16447 struct LDKDecodeError *err;
16448 } LDKCResult_PaymentRelayDecodeErrorZPtr;
16451 * A CResult_PaymentRelayDecodeErrorZ represents the result of a fallible operation,
16452 * containing a crate::lightning::blinded_path::payment::PaymentRelay on success and a crate::lightning::ln::msgs::DecodeError on failure.
16453 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
16455 typedef struct LDKCResult_PaymentRelayDecodeErrorZ {
16457 * The contents of this CResult_PaymentRelayDecodeErrorZ, accessible via either
16458 * `err` or `result` depending on the state of `result_ok`.
16460 union LDKCResult_PaymentRelayDecodeErrorZPtr contents;
16462 * Whether this CResult_PaymentRelayDecodeErrorZ represents a success state.
16465 } LDKCResult_PaymentRelayDecodeErrorZ;
16470 * Constraints for relaying over a given [`BlindedHop`].
16472 * [`BlindedHop`]: crate::blinded_path::BlindedHop
16474 typedef struct MUST_USE_STRUCT LDKPaymentConstraints {
16476 * A pointer to the opaque Rust object.
16477 * Nearly everywhere, inner must be non-null, however in places where
16478 * the Rust equivalent takes an Option, it may be set to null to indicate None.
16480 LDKnativePaymentConstraints *inner;
16482 * Indicates that this is the only struct which contains the same pointer.
16483 * Rust functions which take ownership of an object provided via an argument require
16484 * this to be true and invalidate the object pointed to by inner.
16487 } LDKPaymentConstraints;
16490 * The contents of CResult_PaymentConstraintsDecodeErrorZ
16492 typedef union LDKCResult_PaymentConstraintsDecodeErrorZPtr {
16494 * A pointer to the contents in the success state.
16495 * Reading from this pointer when `result_ok` is not set is undefined.
16497 struct LDKPaymentConstraints *result;
16499 * A pointer to the contents in the error state.
16500 * Reading from this pointer when `result_ok` is set is undefined.
16502 struct LDKDecodeError *err;
16503 } LDKCResult_PaymentConstraintsDecodeErrorZPtr;
16506 * A CResult_PaymentConstraintsDecodeErrorZ represents the result of a fallible operation,
16507 * containing a crate::lightning::blinded_path::payment::PaymentConstraints on success and a crate::lightning::ln::msgs::DecodeError on failure.
16508 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
16510 typedef struct LDKCResult_PaymentConstraintsDecodeErrorZ {
16512 * The contents of this CResult_PaymentConstraintsDecodeErrorZ, accessible via either
16513 * `err` or `result` depending on the state of `result_ok`.
16515 union LDKCResult_PaymentConstraintsDecodeErrorZPtr contents;
16517 * Whether this CResult_PaymentConstraintsDecodeErrorZ represents a success state.
16520 } LDKCResult_PaymentConstraintsDecodeErrorZ;
16523 * An error that may occur when making a payment.
16525 typedef enum LDKPaymentError_Tag {
16527 * An error resulting from the provided [`Bolt11Invoice`] or payment hash.
16529 LDKPaymentError_Invoice,
16531 * An error occurring when sending a payment.
16533 LDKPaymentError_Sending,
16535 * Must be last for serialization purposes
16537 LDKPaymentError_Sentinel,
16538 } LDKPaymentError_Tag;
16540 typedef struct MUST_USE_STRUCT LDKPaymentError {
16541 LDKPaymentError_Tag tag;
16544 struct LDKStr invoice;
16547 enum LDKRetryableSendFailure sending;
16553 * The contents of CResult_ThirtyTwoBytesPaymentErrorZ
16555 typedef union LDKCResult_ThirtyTwoBytesPaymentErrorZPtr {
16557 * A pointer to the contents in the success state.
16558 * Reading from this pointer when `result_ok` is not set is undefined.
16560 struct LDKThirtyTwoBytes *result;
16562 * A pointer to the contents in the error state.
16563 * Reading from this pointer when `result_ok` is set is undefined.
16565 struct LDKPaymentError *err;
16566 } LDKCResult_ThirtyTwoBytesPaymentErrorZPtr;
16569 * A CResult_ThirtyTwoBytesPaymentErrorZ represents the result of a fallible operation,
16570 * containing a crate::c_types::ThirtyTwoBytes on success and a crate::lightning_invoice::payment::PaymentError on failure.
16571 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
16573 typedef struct LDKCResult_ThirtyTwoBytesPaymentErrorZ {
16575 * The contents of this CResult_ThirtyTwoBytesPaymentErrorZ, accessible via either
16576 * `err` or `result` depending on the state of `result_ok`.
16578 union LDKCResult_ThirtyTwoBytesPaymentErrorZPtr contents;
16580 * Whether this CResult_ThirtyTwoBytesPaymentErrorZ represents a success state.
16583 } LDKCResult_ThirtyTwoBytesPaymentErrorZ;
16586 * The contents of CResult_NonePaymentErrorZ
16588 typedef union LDKCResult_NonePaymentErrorZPtr {
16590 * Note that this value is always NULL, as there are no contents in the OK variant
16594 * A pointer to the contents in the error state.
16595 * Reading from this pointer when `result_ok` is set is undefined.
16597 struct LDKPaymentError *err;
16598 } LDKCResult_NonePaymentErrorZPtr;
16601 * A CResult_NonePaymentErrorZ represents the result of a fallible operation,
16602 * containing a () on success and a crate::lightning_invoice::payment::PaymentError on failure.
16603 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
16605 typedef struct LDKCResult_NonePaymentErrorZ {
16607 * The contents of this CResult_NonePaymentErrorZ, accessible via either
16608 * `err` or `result` depending on the state of `result_ok`.
16610 union LDKCResult_NonePaymentErrorZPtr contents;
16612 * Whether this CResult_NonePaymentErrorZ represents a success state.
16615 } LDKCResult_NonePaymentErrorZ;
16618 * An error that may occur when sending a payment probe.
16620 typedef enum LDKProbingError_Tag {
16622 * An error resulting from the provided [`Bolt11Invoice`].
16624 LDKProbingError_Invoice,
16626 * An error occurring when sending a payment probe.
16628 LDKProbingError_Sending,
16630 * Must be last for serialization purposes
16632 LDKProbingError_Sentinel,
16633 } LDKProbingError_Tag;
16635 typedef struct MUST_USE_STRUCT LDKProbingError {
16636 LDKProbingError_Tag tag;
16639 struct LDKStr invoice;
16642 struct LDKProbeSendFailure sending;
16648 * The contents of CResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbingErrorZ
16650 typedef union LDKCResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbingErrorZPtr {
16652 * A pointer to the contents in the success state.
16653 * Reading from this pointer when `result_ok` is not set is undefined.
16655 struct LDKCVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZ *result;
16657 * A pointer to the contents in the error state.
16658 * Reading from this pointer when `result_ok` is set is undefined.
16660 struct LDKProbingError *err;
16661 } LDKCResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbingErrorZPtr;
16664 * A CResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbingErrorZ represents the result of a fallible operation,
16665 * containing a crate::c_types::derived::CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZ on success and a crate::lightning_invoice::payment::ProbingError on failure.
16666 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
16668 typedef struct LDKCResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbingErrorZ {
16670 * The contents of this CResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbingErrorZ, accessible via either
16671 * `err` or `result` depending on the state of `result_ok`.
16673 union LDKCResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbingErrorZPtr contents;
16675 * Whether this CResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbingErrorZ represents a success state.
16678 } LDKCResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbingErrorZ;
16681 * The contents of CResult_StrSecp256k1ErrorZ
16683 typedef union LDKCResult_StrSecp256k1ErrorZPtr {
16685 * A pointer to the contents in the success state.
16686 * Reading from this pointer when `result_ok` is not set is undefined.
16688 struct LDKStr *result;
16690 * A pointer to the contents in the error state.
16691 * Reading from this pointer when `result_ok` is set is undefined.
16693 enum LDKSecp256k1Error *err;
16694 } LDKCResult_StrSecp256k1ErrorZPtr;
16697 * A CResult_StrSecp256k1ErrorZ represents the result of a fallible operation,
16698 * containing a crate::c_types::Str on success and a crate::c_types::Secp256k1Error on failure.
16699 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
16701 typedef struct LDKCResult_StrSecp256k1ErrorZ {
16703 * The contents of this CResult_StrSecp256k1ErrorZ, accessible via either
16704 * `err` or `result` depending on the state of `result_ok`.
16706 union LDKCResult_StrSecp256k1ErrorZPtr contents;
16708 * Whether this CResult_StrSecp256k1ErrorZ represents a success state.
16711 } LDKCResult_StrSecp256k1ErrorZ;
16716 * A path for sending an [`msgs::OnionMessage`].
16718 typedef struct MUST_USE_STRUCT LDKOnionMessagePath {
16720 * A pointer to the opaque Rust object.
16721 * Nearly everywhere, inner must be non-null, however in places where
16722 * the Rust equivalent takes an Option, it may be set to null to indicate None.
16724 LDKnativeOnionMessagePath *inner;
16726 * Indicates that this is the only struct which contains the same pointer.
16727 * Rust functions which take ownership of an object provided via an argument require
16728 * this to be true and invalidate the object pointed to by inner.
16731 } LDKOnionMessagePath;
16734 * The contents of CResult_OnionMessagePathNoneZ
16736 typedef union LDKCResult_OnionMessagePathNoneZPtr {
16738 * A pointer to the contents in the success state.
16739 * Reading from this pointer when `result_ok` is not set is undefined.
16741 struct LDKOnionMessagePath *result;
16743 * Note that this value is always NULL, as there are no contents in the Err variant
16746 } LDKCResult_OnionMessagePathNoneZPtr;
16749 * A CResult_OnionMessagePathNoneZ represents the result of a fallible operation,
16750 * containing a crate::lightning::onion_message::messenger::OnionMessagePath on success and a () on failure.
16751 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
16753 typedef struct LDKCResult_OnionMessagePathNoneZ {
16755 * The contents of this CResult_OnionMessagePathNoneZ, accessible via either
16756 * `err` or `result` depending on the state of `result_ok`.
16758 union LDKCResult_OnionMessagePathNoneZPtr contents;
16760 * Whether this CResult_OnionMessagePathNoneZ represents a success state.
16763 } LDKCResult_OnionMessagePathNoneZ;
16766 * A tuple of 2 elements. See the individual fields for the types contained.
16768 typedef struct LDKC2Tuple_PublicKeyOnionMessageZ {
16770 * The element at position 0
16772 struct LDKPublicKey a;
16774 * The element at position 1
16776 struct LDKOnionMessage b;
16777 } LDKC2Tuple_PublicKeyOnionMessageZ;
16780 * Errors that may occur when [sending an onion message].
16782 * [sending an onion message]: OnionMessenger::send_onion_message
16784 typedef enum LDKSendError_Tag {
16786 * Errored computing onion message packet keys.
16788 LDKSendError_Secp256k1,
16790 * Because implementations such as Eclair will drop onion messages where the message packet
16791 * exceeds 32834 bytes, we refuse to send messages where the packet exceeds this size.
16793 LDKSendError_TooBigPacket,
16795 * The provided [`Destination`] was an invalid [`BlindedPath`], due to having fewer than two
16798 LDKSendError_TooFewBlindedHops,
16800 * Our next-hop peer was offline or does not support onion message forwarding.
16802 LDKSendError_InvalidFirstHop,
16804 * Onion message contents must have a TLV type >= 64.
16806 LDKSendError_InvalidMessage,
16808 * Our next-hop peer's buffer was full or our total outbound buffer was full.
16810 LDKSendError_BufferFull,
16812 * Failed to retrieve our node id from the provided [`NodeSigner`].
16814 * [`NodeSigner`]: crate::sign::NodeSigner
16816 LDKSendError_GetNodeIdFailed,
16818 * We attempted to send to a blinded path where we are the introduction node, and failed to
16819 * advance the blinded path to make the second hop the new introduction node. Either
16820 * [`NodeSigner::ecdh`] failed, we failed to tweak the current blinding point to get the
16821 * new blinding point, or we were attempting to send to ourselves.
16823 LDKSendError_BlindedPathAdvanceFailed,
16825 * Must be last for serialization purposes
16827 LDKSendError_Sentinel,
16828 } LDKSendError_Tag;
16830 typedef struct MUST_USE_STRUCT LDKSendError {
16831 LDKSendError_Tag tag;
16834 enum LDKSecp256k1Error secp256k1;
16840 * The contents of CResult_C2Tuple_PublicKeyOnionMessageZSendErrorZ
16842 typedef union LDKCResult_C2Tuple_PublicKeyOnionMessageZSendErrorZPtr {
16844 * A pointer to the contents in the success state.
16845 * Reading from this pointer when `result_ok` is not set is undefined.
16847 struct LDKC2Tuple_PublicKeyOnionMessageZ *result;
16849 * A pointer to the contents in the error state.
16850 * Reading from this pointer when `result_ok` is set is undefined.
16852 struct LDKSendError *err;
16853 } LDKCResult_C2Tuple_PublicKeyOnionMessageZSendErrorZPtr;
16856 * A CResult_C2Tuple_PublicKeyOnionMessageZSendErrorZ represents the result of a fallible operation,
16857 * containing a crate::c_types::derived::C2Tuple_PublicKeyOnionMessageZ on success and a crate::lightning::onion_message::messenger::SendError on failure.
16858 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
16860 typedef struct LDKCResult_C2Tuple_PublicKeyOnionMessageZSendErrorZ {
16862 * The contents of this CResult_C2Tuple_PublicKeyOnionMessageZSendErrorZ, accessible via either
16863 * `err` or `result` depending on the state of `result_ok`.
16865 union LDKCResult_C2Tuple_PublicKeyOnionMessageZSendErrorZPtr contents;
16867 * Whether this CResult_C2Tuple_PublicKeyOnionMessageZSendErrorZ represents a success state.
16870 } LDKCResult_C2Tuple_PublicKeyOnionMessageZSendErrorZ;
16873 * The contents of CResult_NoneSendErrorZ
16875 typedef union LDKCResult_NoneSendErrorZPtr {
16877 * Note that this value is always NULL, as there are no contents in the OK variant
16881 * A pointer to the contents in the error state.
16882 * Reading from this pointer when `result_ok` is set is undefined.
16884 struct LDKSendError *err;
16885 } LDKCResult_NoneSendErrorZPtr;
16888 * A CResult_NoneSendErrorZ represents the result of a fallible operation,
16889 * containing a () on success and a crate::lightning::onion_message::messenger::SendError on failure.
16890 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
16892 typedef struct LDKCResult_NoneSendErrorZ {
16894 * The contents of this CResult_NoneSendErrorZ, accessible via either
16895 * `err` or `result` depending on the state of `result_ok`.
16897 union LDKCResult_NoneSendErrorZPtr contents;
16899 * Whether this CResult_NoneSendErrorZ represents a success state.
16902 } LDKCResult_NoneSendErrorZ;
16905 * The contents of CResult_BlindedPathNoneZ
16907 typedef union LDKCResult_BlindedPathNoneZPtr {
16909 * A pointer to the contents in the success state.
16910 * Reading from this pointer when `result_ok` is not set is undefined.
16912 struct LDKBlindedPath *result;
16914 * Note that this value is always NULL, as there are no contents in the Err variant
16917 } LDKCResult_BlindedPathNoneZPtr;
16920 * A CResult_BlindedPathNoneZ represents the result of a fallible operation,
16921 * containing a crate::lightning::blinded_path::BlindedPath on success and a () on failure.
16922 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
16924 typedef struct LDKCResult_BlindedPathNoneZ {
16926 * The contents of this CResult_BlindedPathNoneZ, accessible via either
16927 * `err` or `result` depending on the state of `result_ok`.
16929 union LDKCResult_BlindedPathNoneZPtr contents;
16931 * Whether this CResult_BlindedPathNoneZ represents a success state.
16934 } LDKCResult_BlindedPathNoneZ;
16937 * The contents of CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ
16939 typedef union LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZPtr {
16941 * A pointer to the contents in the success state.
16942 * Reading from this pointer when `result_ok` is not set is undefined.
16944 struct LDKC2Tuple_BlindedPayInfoBlindedPathZ *result;
16946 * Note that this value is always NULL, as there are no contents in the Err variant
16949 } LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZPtr;
16952 * A CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ represents the result of a fallible operation,
16953 * containing a crate::c_types::derived::C2Tuple_BlindedPayInfoBlindedPathZ on success and a () on failure.
16954 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
16956 typedef struct LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ {
16958 * The contents of this CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ, accessible via either
16959 * `err` or `result` depending on the state of `result_ok`.
16961 union LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZPtr contents;
16963 * Whether this CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ represents a success state.
16966 } LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ;
16969 * The contents of CResult_BlindedPathDecodeErrorZ
16971 typedef union LDKCResult_BlindedPathDecodeErrorZPtr {
16973 * A pointer to the contents in the success state.
16974 * Reading from this pointer when `result_ok` is not set is undefined.
16976 struct LDKBlindedPath *result;
16978 * A pointer to the contents in the error state.
16979 * Reading from this pointer when `result_ok` is set is undefined.
16981 struct LDKDecodeError *err;
16982 } LDKCResult_BlindedPathDecodeErrorZPtr;
16985 * A CResult_BlindedPathDecodeErrorZ represents the result of a fallible operation,
16986 * containing a crate::lightning::blinded_path::BlindedPath on success and a crate::lightning::ln::msgs::DecodeError on failure.
16987 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
16989 typedef struct LDKCResult_BlindedPathDecodeErrorZ {
16991 * The contents of this CResult_BlindedPathDecodeErrorZ, accessible via either
16992 * `err` or `result` depending on the state of `result_ok`.
16994 union LDKCResult_BlindedPathDecodeErrorZPtr contents;
16996 * Whether this CResult_BlindedPathDecodeErrorZ represents a success state.
16999 } LDKCResult_BlindedPathDecodeErrorZ;
17002 * The contents of CResult_BlindedHopDecodeErrorZ
17004 typedef union LDKCResult_BlindedHopDecodeErrorZPtr {
17006 * A pointer to the contents in the success state.
17007 * Reading from this pointer when `result_ok` is not set is undefined.
17009 struct LDKBlindedHop *result;
17011 * A pointer to the contents in the error state.
17012 * Reading from this pointer when `result_ok` is set is undefined.
17014 struct LDKDecodeError *err;
17015 } LDKCResult_BlindedHopDecodeErrorZPtr;
17018 * A CResult_BlindedHopDecodeErrorZ represents the result of a fallible operation,
17019 * containing a crate::lightning::blinded_path::BlindedHop on success and a crate::lightning::ln::msgs::DecodeError on failure.
17020 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
17022 typedef struct LDKCResult_BlindedHopDecodeErrorZ {
17024 * The contents of this CResult_BlindedHopDecodeErrorZ, accessible via either
17025 * `err` or `result` depending on the state of `result_ok`.
17027 union LDKCResult_BlindedHopDecodeErrorZPtr contents;
17029 * Whether this CResult_BlindedHopDecodeErrorZ represents a success state.
17032 } LDKCResult_BlindedHopDecodeErrorZ;
17035 * The contents of CResult_InvoiceErrorDecodeErrorZ
17037 typedef union LDKCResult_InvoiceErrorDecodeErrorZPtr {
17039 * A pointer to the contents in the success state.
17040 * Reading from this pointer when `result_ok` is not set is undefined.
17042 struct LDKInvoiceError *result;
17044 * A pointer to the contents in the error state.
17045 * Reading from this pointer when `result_ok` is set is undefined.
17047 struct LDKDecodeError *err;
17048 } LDKCResult_InvoiceErrorDecodeErrorZPtr;
17051 * A CResult_InvoiceErrorDecodeErrorZ represents the result of a fallible operation,
17052 * containing a crate::lightning::offers::invoice_error::InvoiceError on success and a crate::lightning::ln::msgs::DecodeError on failure.
17053 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
17055 typedef struct LDKCResult_InvoiceErrorDecodeErrorZ {
17057 * The contents of this CResult_InvoiceErrorDecodeErrorZ, accessible via either
17058 * `err` or `result` depending on the state of `result_ok`.
17060 union LDKCResult_InvoiceErrorDecodeErrorZPtr contents;
17062 * Whether this CResult_InvoiceErrorDecodeErrorZ represents a success state.
17065 } LDKCResult_InvoiceErrorDecodeErrorZ;
17070 * A transaction output watched by a [`ChannelMonitor`] for spends on-chain.
17072 * Used to convey to a [`Filter`] such an output with a given spending condition. Any transaction
17073 * spending the output must be given to [`ChannelMonitor::block_connected`] either directly or via
17074 * [`Confirm::transactions_confirmed`].
17076 * If `block_hash` is `Some`, this indicates the output was created in the corresponding block and
17077 * may have been spent there. See [`Filter::register_output`] for details.
17079 * [`ChannelMonitor`]: channelmonitor::ChannelMonitor
17080 * [`ChannelMonitor::block_connected`]: channelmonitor::ChannelMonitor::block_connected
17082 typedef struct MUST_USE_STRUCT LDKWatchedOutput {
17084 * A pointer to the opaque Rust object.
17085 * Nearly everywhere, inner must be non-null, however in places where
17086 * the Rust equivalent takes an Option, it may be set to null to indicate None.
17088 LDKnativeWatchedOutput *inner;
17090 * Indicates that this is the only struct which contains the same pointer.
17091 * Rust functions which take ownership of an object provided via an argument require
17092 * this to be true and invalidate the object pointed to by inner.
17095 } LDKWatchedOutput;
17098 * The `Filter` trait defines behavior for indicating chain activity of interest pertaining to
17101 * This is useful in order to have a [`Watch`] implementation convey to a chain source which
17102 * transactions to be notified of. Notification may take the form of pre-filtering blocks or, in
17103 * the case of [BIP 157]/[BIP 158], only fetching a block if the compact filter matches. If
17104 * receiving full blocks from a chain source, any further filtering is unnecessary.
17106 * After an output has been registered, subsequent block retrievals from the chain source must not
17107 * exclude any transactions matching the new criteria nor any in-block descendants of such
17110 * Note that use as part of a [`Watch`] implementation involves reentrancy. Therefore, the `Filter`
17111 * should not block on I/O. Implementations should instead queue the newly monitored data to be
17112 * processed later. Then, in order to block until the data has been processed, any [`Watch`]
17113 * invocation that has called the `Filter` must return [`InProgress`].
17115 * [`InProgress`]: ChannelMonitorUpdateStatus::InProgress
17116 * [BIP 157]: https://github.com/bitcoin/bips/blob/master/bip-0157.mediawiki
17117 * [BIP 158]: https://github.com/bitcoin/bips/blob/master/bip-0158.mediawiki
17119 typedef struct LDKFilter {
17121 * An opaque pointer which is passed to your function implementations as an argument.
17122 * This has no meaning in the LDK, and can be NULL or any other value.
17126 * Registers interest in a transaction with `txid` and having an output with `script_pubkey` as
17127 * a spending condition.
17129 void (*register_tx)(const void *this_arg, const uint8_t (*txid)[32], struct LDKu8slice script_pubkey);
17131 * Registers interest in spends of a transaction output.
17133 * Note that this method might be called during processing of a new block. You therefore need
17134 * to ensure that also dependent output spents within an already connected block are correctly
17135 * handled, e.g., by re-scanning the block in question whenever new outputs have been
17136 * registered mid-processing.
17138 void (*register_output)(const void *this_arg, struct LDKWatchedOutput output);
17140 * Frees any resources associated with this object given its this_arg pointer.
17141 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
17143 void (*free)(void *this_arg);
17147 * An enum which can either contain a crate::lightning::chain::Filter or not
17149 typedef enum LDKCOption_FilterZ_Tag {
17151 * When we're in this state, this COption_FilterZ contains a crate::lightning::chain::Filter
17153 LDKCOption_FilterZ_Some,
17155 * When we're in this state, this COption_FilterZ contains nothing
17157 LDKCOption_FilterZ_None,
17159 * Must be last for serialization purposes
17161 LDKCOption_FilterZ_Sentinel,
17162 } LDKCOption_FilterZ_Tag;
17164 typedef struct LDKCOption_FilterZ {
17165 LDKCOption_FilterZ_Tag tag;
17168 struct LDKFilter some;
17171 } LDKCOption_FilterZ;
17176 * A read-only reference to a current ChannelMonitor.
17178 * Note that this holds a mutex in [`ChainMonitor`] and may block other events until it is
17181 typedef struct MUST_USE_STRUCT LDKLockedChannelMonitor {
17183 * A pointer to the opaque Rust object.
17184 * Nearly everywhere, inner must be non-null, however in places where
17185 * the Rust equivalent takes an Option, it may be set to null to indicate None.
17187 LDKnativeLockedChannelMonitor *inner;
17189 * Indicates that this is the only struct which contains the same pointer.
17190 * Rust functions which take ownership of an object provided via an argument require
17191 * this to be true and invalidate the object pointed to by inner.
17194 } LDKLockedChannelMonitor;
17197 * The contents of CResult_LockedChannelMonitorNoneZ
17199 typedef union LDKCResult_LockedChannelMonitorNoneZPtr {
17201 * A pointer to the contents in the success state.
17202 * Reading from this pointer when `result_ok` is not set is undefined.
17204 struct LDKLockedChannelMonitor *result;
17206 * Note that this value is always NULL, as there are no contents in the Err variant
17209 } LDKCResult_LockedChannelMonitorNoneZPtr;
17212 * A CResult_LockedChannelMonitorNoneZ represents the result of a fallible operation,
17213 * containing a crate::lightning::chain::chainmonitor::LockedChannelMonitor on success and a () on failure.
17214 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
17216 typedef struct LDKCResult_LockedChannelMonitorNoneZ {
17218 * The contents of this CResult_LockedChannelMonitorNoneZ, accessible via either
17219 * `err` or `result` depending on the state of `result_ok`.
17221 union LDKCResult_LockedChannelMonitorNoneZPtr contents;
17223 * Whether this CResult_LockedChannelMonitorNoneZ represents a success state.
17226 } LDKCResult_LockedChannelMonitorNoneZ;
17229 * A dynamically-allocated array of crate::lightning::chain::transaction::OutPoints of arbitrary size.
17230 * This corresponds to std::vector in C++
17232 typedef struct LDKCVec_OutPointZ {
17234 * The elements in the array.
17235 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
17237 struct LDKOutPoint *data;
17239 * The number of elements pointed to by `data`.
17242 } LDKCVec_OutPointZ;
17247 * An opaque identifier describing a specific [`Persist`] method call.
17249 typedef struct MUST_USE_STRUCT LDKMonitorUpdateId {
17251 * A pointer to the opaque Rust object.
17252 * Nearly everywhere, inner must be non-null, however in places where
17253 * the Rust equivalent takes an Option, it may be set to null to indicate None.
17255 LDKnativeMonitorUpdateId *inner;
17257 * Indicates that this is the only struct which contains the same pointer.
17258 * Rust functions which take ownership of an object provided via an argument require
17259 * this to be true and invalidate the object pointed to by inner.
17262 } LDKMonitorUpdateId;
17265 * A dynamically-allocated array of crate::lightning::chain::chainmonitor::MonitorUpdateIds of arbitrary size.
17266 * This corresponds to std::vector in C++
17268 typedef struct LDKCVec_MonitorUpdateIdZ {
17270 * The elements in the array.
17271 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
17273 struct LDKMonitorUpdateId *data;
17275 * The number of elements pointed to by `data`.
17278 } LDKCVec_MonitorUpdateIdZ;
17281 * A tuple of 2 elements. See the individual fields for the types contained.
17283 typedef struct LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ {
17285 * The element at position 0
17287 struct LDKOutPoint a;
17289 * The element at position 1
17291 struct LDKCVec_MonitorUpdateIdZ b;
17292 } LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ;
17295 * A dynamically-allocated array of crate::c_types::derived::C2Tuple_OutPointCVec_MonitorUpdateIdZZs of arbitrary size.
17296 * This corresponds to std::vector in C++
17298 typedef struct LDKCVec_C2Tuple_OutPointCVec_MonitorUpdateIdZZZ {
17300 * The elements in the array.
17301 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
17303 struct LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ *data;
17305 * The number of elements pointed to by `data`.
17308 } LDKCVec_C2Tuple_OutPointCVec_MonitorUpdateIdZZZ;
17311 * Provides an interface that allows storage and retrieval of persisted values that are associated
17314 * In order to avoid collisions the key space is segmented based on the given `primary_namespace`s
17315 * and `secondary_namespace`s. Implementations of this trait are free to handle them in different
17316 * ways, as long as per-namespace key uniqueness is asserted.
17318 * Keys and namespaces are required to be valid ASCII strings in the range of
17319 * [`KVSTORE_NAMESPACE_KEY_ALPHABET`] and no longer than [`KVSTORE_NAMESPACE_KEY_MAX_LEN`]. Empty
17320 * primary namespaces and secondary namespaces (`\"\"`) are assumed to be a valid, however, if
17321 * `primary_namespace` is empty, `secondary_namespace` is required to be empty, too. This means
17322 * that concerns should always be separated by primary namespace first, before secondary
17323 * namespaces are used. While the number of primary namespaces will be relatively small and is
17324 * determined at compile time, there may be many secondary namespaces per primary namespace. Note
17325 * that per-namespace uniqueness needs to also hold for keys *and* namespaces in any given
17326 * namespace, i.e., conflicts between keys and equally named
17327 * primary namespaces/secondary namespaces must be avoided.
17329 * **Note:** Users migrating custom persistence backends from the pre-v0.0.117 `KVStorePersister`
17330 * interface can use a concatenation of `[{primary_namespace}/[{secondary_namespace}/]]{key}` to
17331 * recover a `key` compatible with the data model previously assumed by `KVStorePersister::persist`.
17333 typedef struct LDKKVStore {
17335 * An opaque pointer which is passed to your function implementations as an argument.
17336 * This has no meaning in the LDK, and can be NULL or any other value.
17340 * Returns the data stored for the given `primary_namespace`, `secondary_namespace`, and
17343 * Returns an [`ErrorKind::NotFound`] if the given `key` could not be found in the given
17344 * `primary_namespace` and `secondary_namespace`.
17346 * [`ErrorKind::NotFound`]: io::ErrorKind::NotFound
17348 struct LDKCResult_CVec_u8ZIOErrorZ (*read)(const void *this_arg, struct LDKStr primary_namespace, struct LDKStr secondary_namespace, struct LDKStr key);
17350 * Persists the given data under the given `key`.
17352 * Will create the given `primary_namespace` and `secondary_namespace` if not already present
17355 struct LDKCResult_NoneIOErrorZ (*write)(const void *this_arg, struct LDKStr primary_namespace, struct LDKStr secondary_namespace, struct LDKStr key, struct LDKu8slice buf);
17357 * Removes any data that had previously been persisted under the given `key`.
17359 * If the `lazy` flag is set to `true`, the backend implementation might choose to lazily
17360 * remove the given `key` at some point in time after the method returns, e.g., as part of an
17361 * eventual batch deletion of multiple keys. As a consequence, subsequent calls to
17362 * [`KVStore::list`] might include the removed key until the changes are actually persisted.
17364 * Note that while setting the `lazy` flag reduces the I/O burden of multiple subsequent
17365 * `remove` calls, it also influences the atomicity guarantees as lazy `remove`s could
17366 * potentially get lost on crash after the method returns. Therefore, this flag should only be
17367 * set for `remove` operations that can be safely replayed at a later time.
17369 * Returns successfully if no data will be stored for the given `primary_namespace`,
17370 * `secondary_namespace`, and `key`, independently of whether it was present before its
17371 * invokation or not.
17373 struct LDKCResult_NoneIOErrorZ (*remove)(const void *this_arg, struct LDKStr primary_namespace, struct LDKStr secondary_namespace, struct LDKStr key, bool lazy);
17375 * Returns a list of keys that are stored under the given `secondary_namespace` in
17376 * `primary_namespace`.
17378 * Returns the keys in arbitrary order, so users requiring a particular order need to sort the
17379 * returned keys. Returns an empty list if `primary_namespace` or `secondary_namespace` is unknown.
17381 struct LDKCResult_CVec_StrZIOErrorZ (*list)(const void *this_arg, struct LDKStr primary_namespace, struct LDKStr secondary_namespace);
17383 * Frees any resources associated with this object given its this_arg pointer.
17384 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
17386 void (*free)(void *this_arg);
17390 * Trait that handles persisting a [`ChannelManager`], [`NetworkGraph`], and [`WriteableScore`] to disk.
17392 typedef struct LDKPersister {
17394 * An opaque pointer which is passed to your function implementations as an argument.
17395 * This has no meaning in the LDK, and can be NULL or any other value.
17399 * Persist the given ['ChannelManager'] to disk, returning an error if persistence failed.
17401 struct LDKCResult_NoneIOErrorZ (*persist_manager)(const void *this_arg, const struct LDKChannelManager *NONNULL_PTR channel_manager);
17403 * Persist the given [`NetworkGraph`] to disk, returning an error if persistence failed.
17405 struct LDKCResult_NoneIOErrorZ (*persist_graph)(const void *this_arg, const struct LDKNetworkGraph *NONNULL_PTR network_graph);
17407 * Persist the given [`WriteableScore`] to disk, returning an error if persistence failed.
17409 struct LDKCResult_NoneIOErrorZ (*persist_scorer)(const void *this_arg, const struct LDKWriteableScore *NONNULL_PTR scorer);
17411 * Frees any resources associated with this object given its this_arg pointer.
17412 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
17414 void (*free)(void *this_arg);
17420 * Implements [`Persist`] in a way that writes and reads both [`ChannelMonitor`]s and
17421 * [`ChannelMonitorUpdate`]s.
17425 * The main benefit this provides over the [`KVStore`]'s [`Persist`] implementation is decreased
17426 * I/O bandwidth and storage churn, at the expense of more IOPS (including listing, reading, and
17427 * deleting) and complexity. This is because it writes channel monitor differential updates,
17428 * whereas the other (default) implementation rewrites the entire monitor on each update. For
17429 * routing nodes, updates can happen many times per second to a channel, and monitors can be tens
17430 * of megabytes (or more). Updates can be as small as a few hundred bytes.
17432 * Note that monitors written with `MonitorUpdatingPersister` are _not_ backward-compatible with
17433 * the default [`KVStore`]'s [`Persist`] implementation. They have a prepended byte sequence,
17434 * [`MONITOR_UPDATING_PERSISTER_PREPEND_SENTINEL`], applied to prevent deserialization with other
17435 * persisters. This is because monitors written by this struct _may_ have unapplied updates. In
17436 * order to downgrade, you must ensure that all updates are applied to the monitor, and remove the
17439 * # Storing monitors
17441 * Monitors are stored by implementing the [`Persist`] trait, which has two functions:
17443 * - [`Persist::persist_new_channel`], which persists whole [`ChannelMonitor`]s.
17444 * - [`Persist::update_persisted_channel`], which persists only a [`ChannelMonitorUpdate`]
17446 * Whole [`ChannelMonitor`]s are stored in the [`CHANNEL_MONITOR_PERSISTENCE_PRIMARY_NAMESPACE`],
17447 * using the familiar encoding of an [`OutPoint`] (for example, `[SOME-64-CHAR-HEX-STRING]_1`).
17449 * Each [`ChannelMonitorUpdate`] is stored in a dynamic secondary namespace, as follows:
17451 * - primary namespace: [`CHANNEL_MONITOR_UPDATE_PERSISTENCE_PRIMARY_NAMESPACE`]
17452 * - secondary namespace: [the monitor's encoded outpoint name]
17454 * Under that secondary namespace, each update is stored with a number string, like `21`, which
17455 * represents its `update_id` value.
17457 * For example, consider this channel, named for its transaction ID and index, or [`OutPoint`]:
17459 * - Transaction ID: `deadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeef`
17462 * Full channel monitors would be stored at a single key:
17464 * `[CHANNEL_MONITOR_PERSISTENCE_PRIMARY_NAMESPACE]/deadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeef_1`
17466 * Updates would be stored as follows (with `/` delimiting primary_namespace/secondary_namespace/key):
17469 * [CHANNEL_MONITOR_UPDATE_PERSISTENCE_PRIMARY_NAMESPACE]/deadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeef_1/1
17470 * [CHANNEL_MONITOR_UPDATE_PERSISTENCE_PRIMARY_NAMESPACE]/deadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeef_1/2
17471 * [CHANNEL_MONITOR_UPDATE_PERSISTENCE_PRIMARY_NAMESPACE]/deadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeef_1/3
17475 * # Reading channel state from storage
17477 * Channel state can be reconstructed by calling
17478 * [`MonitorUpdatingPersister::read_all_channel_monitors_with_updates`]. Alternatively, users can
17479 * list channel monitors themselves and load channels individually using
17480 * [`MonitorUpdatingPersister::read_channel_monitor_with_updates`].
17482 * ## EXTREMELY IMPORTANT
17484 * It is extremely important that your [`KVStore::read`] implementation uses the
17485 * [`io::ErrorKind::NotFound`] variant correctly: that is, when a file is not found, and _only_ in
17486 * that circumstance (not when there is really a permissions error, for example). This is because
17487 * neither channel monitor reading function lists updates. Instead, either reads the monitor, and
17488 * using its stored `update_id`, synthesizes update storage keys, and tries them in sequence until
17489 * one is not found. All _other_ errors will be bubbled up in the function's [`Result`].
17491 * # Pruning stale channel updates
17493 * Stale updates are pruned when a full monitor is written. The old monitor is first read, and if
17494 * that succeeds, updates in the range between the old and new monitors are deleted. The `lazy`
17495 * flag is used on the [`KVStore::remove`] method, so there are no guarantees that the deletions
17496 * will complete. However, stale updates are not a problem for data integrity, since updates are
17497 * only read that are higher than the stored [`ChannelMonitor`]'s `update_id`.
17499 * If you have many stale updates stored (such as after a crash with pending lazy deletes), and
17500 * would like to get rid of them, consider using the
17501 * [`MonitorUpdatingPersister::cleanup_stale_updates`] function.
17503 typedef struct MUST_USE_STRUCT LDKMonitorUpdatingPersister {
17505 * A pointer to the opaque Rust object.
17506 * Nearly everywhere, inner must be non-null, however in places where
17507 * the Rust equivalent takes an Option, it may be set to null to indicate None.
17509 LDKnativeMonitorUpdatingPersister *inner;
17511 * Indicates that this is the only struct which contains the same pointer.
17512 * Rust functions which take ownership of an object provided via an argument require
17513 * this to be true and invalidate the object pointed to by inner.
17516 } LDKMonitorUpdatingPersister;
17519 * `Persist` defines behavior for persisting channel monitors: this could mean
17520 * writing once to disk, and/or uploading to one or more backup services.
17522 * Persistence can happen in one of two ways - synchronously completing before the trait method
17523 * calls return or asynchronously in the background.
17525 * # For those implementing synchronous persistence
17527 * * If persistence completes fully (including any relevant `fsync()` calls), the implementation
17528 * should return [`ChannelMonitorUpdateStatus::Completed`], indicating normal channel operation
17531 * * If persistence fails for some reason, implementations should consider returning
17532 * [`ChannelMonitorUpdateStatus::InProgress`] and retry all pending persistence operations in
17533 * the background with [`ChainMonitor::list_pending_monitor_updates`] and
17534 * [`ChainMonitor::get_monitor`].
17536 * Once a full [`ChannelMonitor`] has been persisted, all pending updates for that channel can
17537 * be marked as complete via [`ChainMonitor::channel_monitor_updated`].
17539 * If at some point no further progress can be made towards persisting the pending updates, the
17540 * node should simply shut down.
17542 * * If the persistence has failed and cannot be retried further (e.g. because of an outage),
17543 * [`ChannelMonitorUpdateStatus::UnrecoverableError`] can be used, though this will result in
17544 * an immediate panic and future operations in LDK generally failing.
17546 * # For those implementing asynchronous persistence
17548 * All calls should generally spawn a background task and immediately return
17549 * [`ChannelMonitorUpdateStatus::InProgress`]. Once the update completes,
17550 * [`ChainMonitor::channel_monitor_updated`] should be called with the corresponding
17551 * [`MonitorUpdateId`].
17553 * Note that unlike the direct [`chain::Watch`] interface,
17554 * [`ChainMonitor::channel_monitor_updated`] must be called once for *each* update which occurs.
17556 * If at some point no further progress can be made towards persisting a pending update, the node
17557 * should simply shut down. Until then, the background task should either loop indefinitely, or
17558 * persistence should be regularly retried with [`ChainMonitor::list_pending_monitor_updates`]
17559 * and [`ChainMonitor::get_monitor`] (note that if a full monitor is persisted all pending
17560 * monitor updates may be marked completed).
17562 * # Using remote watchtowers
17564 * Watchtowers may be updated as a part of an implementation of this trait, utilizing the async
17565 * update process described above while the watchtower is being updated. The following methods are
17566 * provided for bulding transactions for a watchtower:
17567 * [`ChannelMonitor::initial_counterparty_commitment_tx`],
17568 * [`ChannelMonitor::counterparty_commitment_txs_from_update`],
17569 * [`ChannelMonitor::sign_to_local_justice_tx`], [`TrustedCommitmentTransaction::revokeable_output_index`],
17570 * [`TrustedCommitmentTransaction::build_to_local_justice_tx`].
17572 * [`TrustedCommitmentTransaction::revokeable_output_index`]: crate::ln::chan_utils::TrustedCommitmentTransaction::revokeable_output_index
17573 * [`TrustedCommitmentTransaction::build_to_local_justice_tx`]: crate::ln::chan_utils::TrustedCommitmentTransaction::build_to_local_justice_tx
17575 typedef struct LDKPersist {
17577 * An opaque pointer which is passed to your function implementations as an argument.
17578 * This has no meaning in the LDK, and can be NULL or any other value.
17582 * Persist a new channel's data in response to a [`chain::Watch::watch_channel`] call. This is
17583 * called by [`ChannelManager`] for new channels, or may be called directly, e.g. on startup.
17585 * The data can be stored any way you want, but the identifier provided by LDK is the
17586 * channel's outpoint (and it is up to you to maintain a correct mapping between the outpoint
17587 * and the stored channel data). Note that you **must** persist every new monitor to disk.
17589 * The `update_id` is used to identify this call to [`ChainMonitor::channel_monitor_updated`],
17590 * if you return [`ChannelMonitorUpdateStatus::InProgress`].
17592 * See [`Writeable::write`] on [`ChannelMonitor`] for writing out a `ChannelMonitor`
17593 * and [`ChannelMonitorUpdateStatus`] for requirements when returning errors.
17595 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
17596 * [`Writeable::write`]: crate::util::ser::Writeable::write
17598 enum LDKChannelMonitorUpdateStatus (*persist_new_channel)(const void *this_arg, struct LDKOutPoint channel_id, const struct LDKChannelMonitor *NONNULL_PTR data, struct LDKMonitorUpdateId update_id);
17600 * Update one channel's data. The provided [`ChannelMonitor`] has already applied the given
17603 * Note that on every update, you **must** persist either the [`ChannelMonitorUpdate`] or the
17604 * updated monitor itself to disk/backups. See the [`Persist`] trait documentation for more
17607 * During blockchain synchronization operations, and in some rare cases, this may be called with
17608 * no [`ChannelMonitorUpdate`], in which case the full [`ChannelMonitor`] needs to be persisted.
17609 * Note that after the full [`ChannelMonitor`] is persisted any previous
17610 * [`ChannelMonitorUpdate`]s which were persisted should be discarded - they can no longer be
17611 * applied to the persisted [`ChannelMonitor`] as they were already applied.
17613 * If an implementer chooses to persist the updates only, they need to make
17614 * sure that all the updates are applied to the `ChannelMonitors` *before*
17615 * the set of channel monitors is given to the `ChannelManager`
17616 * deserialization routine. See [`ChannelMonitor::update_monitor`] for
17617 * applying a monitor update to a monitor. If full `ChannelMonitors` are
17618 * persisted, then there is no need to persist individual updates.
17620 * Note that there could be a performance tradeoff between persisting complete
17621 * channel monitors on every update vs. persisting only updates and applying
17622 * them in batches. The size of each monitor grows `O(number of state updates)`
17623 * whereas updates are small and `O(1)`.
17625 * The `update_id` is used to identify this call to [`ChainMonitor::channel_monitor_updated`],
17626 * if you return [`ChannelMonitorUpdateStatus::InProgress`].
17628 * See [`Writeable::write`] on [`ChannelMonitor`] for writing out a `ChannelMonitor`,
17629 * [`Writeable::write`] on [`ChannelMonitorUpdate`] for writing out an update, and
17630 * [`ChannelMonitorUpdateStatus`] for requirements when returning errors.
17632 * [`Writeable::write`]: crate::util::ser::Writeable::write
17634 * Note that update (or a relevant inner pointer) may be NULL or all-0s to represent None
17636 enum LDKChannelMonitorUpdateStatus (*update_persisted_channel)(const void *this_arg, struct LDKOutPoint channel_id, struct LDKChannelMonitorUpdate update, const struct LDKChannelMonitor *NONNULL_PTR data, struct LDKMonitorUpdateId update_id);
17638 * Frees any resources associated with this object given its this_arg pointer.
17639 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
17641 void (*free)(void *this_arg);
17647 * A string that displays only printable characters, replacing control characters with
17648 * [`core::char::REPLACEMENT_CHARACTER`].
17650 typedef struct MUST_USE_STRUCT LDKPrintableString {
17652 * A pointer to the opaque Rust object.
17653 * Nearly everywhere, inner must be non-null, however in places where
17654 * the Rust equivalent takes an Option, it may be set to null to indicate None.
17656 LDKnativePrintableString *inner;
17658 * Indicates that this is the only struct which contains the same pointer.
17659 * Rust functions which take ownership of an object provided via an argument require
17660 * this to be true and invalidate the object pointed to by inner.
17663 } LDKPrintableString;
17666 * A callback which is called when a [`Future`] completes.
17668 * Note that this MUST NOT call back into LDK directly, it must instead schedule actions to be
17669 * taken later. Rust users should use the [`std::future::Future`] implementation for [`Future`]
17672 * Note that the [`std::future::Future`] implementation may only work for runtimes which schedule
17673 * futures when they receive a wake, rather than immediately executing them.
17675 typedef struct LDKFutureCallback {
17677 * An opaque pointer which is passed to your function implementations as an argument.
17678 * This has no meaning in the LDK, and can be NULL or any other value.
17682 * The method which is called.
17684 void (*call)(const void *this_arg);
17686 * Frees any resources associated with this object given its this_arg pointer.
17687 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
17689 void (*free)(void *this_arg);
17690 } LDKFutureCallback;
17695 * A struct which can be used to select across many [`Future`]s at once without relying on a full
17698 typedef struct MUST_USE_STRUCT LDKSleeper {
17700 * A pointer to the opaque Rust object.
17701 * Nearly everywhere, inner must be non-null, however in places where
17702 * the Rust equivalent takes an Option, it may be set to null to indicate None.
17704 LDKnativeSleeper *inner;
17706 * Indicates that this is the only struct which contains the same pointer.
17707 * Rust functions which take ownership of an object provided via an argument require
17708 * this to be true and invalidate the object pointed to by inner.
17716 * Configuration we set when applicable.
17718 * Default::default() provides sane defaults.
17720 typedef struct MUST_USE_STRUCT LDKChannelHandshakeConfig {
17722 * A pointer to the opaque Rust object.
17723 * Nearly everywhere, inner must be non-null, however in places where
17724 * the Rust equivalent takes an Option, it may be set to null to indicate None.
17726 LDKnativeChannelHandshakeConfig *inner;
17728 * Indicates that this is the only struct which contains the same pointer.
17729 * Rust functions which take ownership of an object provided via an argument require
17730 * this to be true and invalidate the object pointed to by inner.
17733 } LDKChannelHandshakeConfig;
17738 * Optional channel limits which are applied during channel creation.
17740 * These limits are only applied to our counterparty's limits, not our own.
17742 * Use 0/`<type>::max_value()` as appropriate to skip checking.
17744 * Provides sane defaults for most configurations.
17746 * Most additional limits are disabled except those with which specify a default in individual
17747 * field documentation. Note that this may result in barely-usable channels, but since they
17748 * are applied mostly only to incoming channels that's not much of a problem.
17750 typedef struct MUST_USE_STRUCT LDKChannelHandshakeLimits {
17752 * A pointer to the opaque Rust object.
17753 * Nearly everywhere, inner must be non-null, however in places where
17754 * the Rust equivalent takes an Option, it may be set to null to indicate None.
17756 LDKnativeChannelHandshakeLimits *inner;
17758 * Indicates that this is the only struct which contains the same pointer.
17759 * Rust functions which take ownership of an object provided via an argument require
17760 * this to be true and invalidate the object pointed to by inner.
17763 } LDKChannelHandshakeLimits;
17768 * A parallel struct to [`ChannelConfig`] to define partial updates.
17770 typedef struct MUST_USE_STRUCT LDKChannelConfigUpdate {
17772 * A pointer to the opaque Rust object.
17773 * Nearly everywhere, inner must be non-null, however in places where
17774 * the Rust equivalent takes an Option, it may be set to null to indicate None.
17776 LDKnativeChannelConfigUpdate *inner;
17778 * Indicates that this is the only struct which contains the same pointer.
17779 * Rust functions which take ownership of an object provided via an argument require
17780 * this to be true and invalidate the object pointed to by inner.
17783 } LDKChannelConfigUpdate;
17788 * Top-level config which holds ChannelHandshakeLimits and ChannelConfig.
17790 * Default::default() provides sane defaults for most configurations
17791 * (but currently with 0 relay fees!)
17793 typedef struct MUST_USE_STRUCT LDKUserConfig {
17795 * A pointer to the opaque Rust object.
17796 * Nearly everywhere, inner must be non-null, however in places where
17797 * the Rust equivalent takes an Option, it may be set to null to indicate None.
17799 LDKnativeUserConfig *inner;
17801 * Indicates that this is the only struct which contains the same pointer.
17802 * Rust functions which take ownership of an object provided via an argument require
17803 * this to be true and invalidate the object pointed to by inner.
17811 * The best known block as identified by its hash and height.
17813 typedef struct MUST_USE_STRUCT LDKBestBlock {
17815 * A pointer to the opaque Rust object.
17816 * Nearly everywhere, inner must be non-null, however in places where
17817 * the Rust equivalent takes an Option, it may be set to null to indicate None.
17819 LDKnativeBestBlock *inner;
17821 * Indicates that this is the only struct which contains the same pointer.
17822 * Rust functions which take ownership of an object provided via an argument require
17823 * this to be true and invalidate the object pointed to by inner.
17829 * The `Listen` trait is used to notify when blocks have been connected or disconnected from the
17832 * Useful when needing to replay chain data upon startup or as new chain events occur. Clients
17833 * sourcing chain data using a block-oriented API should prefer this interface over [`Confirm`].
17834 * Such clients fetch the entire header chain whereas clients using [`Confirm`] only fetch headers
17837 * By using [`Listen::filtered_block_connected`] this interface supports clients fetching the
17838 * entire header chain and only blocks with matching transaction data using BIP 157 filters or
17839 * other similar filtering.
17841 typedef struct LDKListen {
17843 * An opaque pointer which is passed to your function implementations as an argument.
17844 * This has no meaning in the LDK, and can be NULL or any other value.
17848 * Notifies the listener that a block was added at the given height, with the transaction data
17849 * possibly filtered.
17851 void (*filtered_block_connected)(const void *this_arg, const uint8_t (*header)[80], struct LDKCVec_C2Tuple_usizeTransactionZZ txdata, uint32_t height);
17853 * Notifies the listener that a block was added at the given height.
17855 void (*block_connected)(const void *this_arg, struct LDKu8slice block, uint32_t height);
17857 * Notifies the listener that a block was removed at the given height.
17859 void (*block_disconnected)(const void *this_arg, const uint8_t (*header)[80], uint32_t height);
17861 * Frees any resources associated with this object given its this_arg pointer.
17862 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
17864 void (*free)(void *this_arg);
17868 * The `Confirm` trait is used to notify LDK when relevant transactions have been confirmed on
17869 * chain or unconfirmed during a chain reorganization.
17871 * Clients sourcing chain data using a transaction-oriented API should prefer this interface over
17872 * [`Listen`]. For instance, an Electrum-based transaction sync implementation may implement
17873 * [`Filter`] to subscribe to relevant transactions and unspent outputs it should monitor for
17874 * on-chain activity. Then, it needs to notify LDK via this interface upon observing any changes
17875 * with reference to the confirmation status of the monitored objects.
17878 * The intended use is as follows:
17879 * - Call [`transactions_confirmed`] to notify LDK whenever any of the registered transactions or
17880 * outputs are, respectively, confirmed or spent on chain.
17881 * - Call [`transaction_unconfirmed`] to notify LDK whenever any transaction returned by
17882 * [`get_relevant_txids`] is no longer confirmed in the block with the given block hash.
17883 * - Call [`best_block_updated`] to notify LDK whenever a new chain tip becomes available.
17887 * Clients must call these methods in chain order. Specifically:
17888 * - Transactions which are confirmed in a particular block must be given before transactions
17889 * confirmed in a later block.
17890 * - Dependent transactions within the same block must be given in topological order, possibly in
17892 * - All unconfirmed transactions must be given after the original confirmations and before *any*
17893 * reconfirmations, i.e., [`transactions_confirmed`] and [`transaction_unconfirmed`] calls should
17894 * never be interleaved, but always conduced *en bloc*.
17895 * - Any reconfirmed transactions need to be explicitly unconfirmed before they are reconfirmed
17896 * in regard to the new block.
17898 * See individual method documentation for further details.
17900 * [`transactions_confirmed`]: Self::transactions_confirmed
17901 * [`transaction_unconfirmed`]: Self::transaction_unconfirmed
17902 * [`best_block_updated`]: Self::best_block_updated
17903 * [`get_relevant_txids`]: Self::get_relevant_txids
17905 typedef struct LDKConfirm {
17907 * An opaque pointer which is passed to your function implementations as an argument.
17908 * This has no meaning in the LDK, and can be NULL or any other value.
17912 * Notifies LDK of transactions confirmed in a block with a given header and height.
17914 * Must be called for any transactions registered by [`Filter::register_tx`] or any
17915 * transactions spending an output registered by [`Filter::register_output`]. Such transactions
17916 * appearing in the same block do not need to be included in the same call; instead, multiple
17917 * calls with additional transactions may be made so long as they are made in [chain order].
17919 * May be called before or after [`best_block_updated`] for the corresponding block. However,
17920 * in the event of a chain reorganization, it must not be called with a `header` that is no
17921 * longer in the chain as of the last call to [`best_block_updated`].
17923 * [chain order]: Confirm#order
17924 * [`best_block_updated`]: Self::best_block_updated
17926 void (*transactions_confirmed)(const void *this_arg, const uint8_t (*header)[80], struct LDKCVec_C2Tuple_usizeTransactionZZ txdata, uint32_t height);
17928 * Notifies LDK of a transaction that is no longer confirmed as result of a chain reorganization.
17930 * Must be called for any transaction returned by [`get_relevant_txids`] if it has been
17931 * reorganized out of the best chain or if it is no longer confirmed in the block with the
17932 * given block hash. Once called, the given transaction will not be returned
17933 * by [`get_relevant_txids`], unless it has been reconfirmed via [`transactions_confirmed`].
17935 * [`get_relevant_txids`]: Self::get_relevant_txids
17936 * [`transactions_confirmed`]: Self::transactions_confirmed
17938 void (*transaction_unconfirmed)(const void *this_arg, const uint8_t (*txid)[32]);
17940 * Notifies LDK of an update to the best header connected at the given height.
17942 * Must be called whenever a new chain tip becomes available. May be skipped for intermediary
17945 void (*best_block_updated)(const void *this_arg, const uint8_t (*header)[80], uint32_t height);
17947 * Returns transactions that must be monitored for reorganization out of the chain along
17948 * with the hash of the block as part of which it had been previously confirmed.
17950 * Note that the returned `Option<BlockHash>` might be `None` for channels created with LDK
17951 * 0.0.112 and prior, in which case you need to manually track previous confirmations.
17953 * Will include any transactions passed to [`transactions_confirmed`] that have insufficient
17954 * confirmations to be safe from a chain reorganization. Will not include any transactions
17955 * passed to [`transaction_unconfirmed`], unless later reconfirmed.
17957 * Must be called to determine the subset of transactions that must be monitored for
17958 * reorganization. Will be idempotent between calls but may change as a result of calls to the
17959 * other interface methods. Thus, this is useful to determine which transactions must be
17960 * given to [`transaction_unconfirmed`].
17962 * If any of the returned transactions are confirmed in a block other than the one with the
17963 * given hash, they need to be unconfirmed and reconfirmed via [`transaction_unconfirmed`] and
17964 * [`transactions_confirmed`], respectively.
17966 * [`transactions_confirmed`]: Self::transactions_confirmed
17967 * [`transaction_unconfirmed`]: Self::transaction_unconfirmed
17969 struct LDKCVec_C2Tuple_ThirtyTwoBytesCOption_ThirtyTwoBytesZZZ (*get_relevant_txids)(const void *this_arg);
17971 * Frees any resources associated with this object given its this_arg pointer.
17972 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
17974 void (*free)(void *this_arg);
17980 * An implementation of [`chain::Watch`] for monitoring channels.
17982 * Connected and disconnected blocks must be provided to `ChainMonitor` as documented by
17983 * [`chain::Watch`]. May be used in conjunction with [`ChannelManager`] to monitor channels locally
17984 * or used independently to monitor channels remotely. See the [module-level documentation] for
17987 * Note that `ChainMonitor` should regularly trigger rebroadcasts/fee bumps of pending claims from
17988 * a force-closed channel. This is crucial in preventing certain classes of pinning attacks,
17989 * detecting substantial mempool feerate changes between blocks, and ensuring reliability if
17990 * broadcasting fails. We recommend invoking this every 30 seconds, or lower if running in an
17991 * environment with spotty connections, like on mobile.
17993 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
17994 * [module-level documentation]: crate::chain::chainmonitor
17995 * [`rebroadcast_pending_claims`]: Self::rebroadcast_pending_claims
17997 typedef struct MUST_USE_STRUCT LDKChainMonitor {
17999 * A pointer to the opaque Rust object.
18000 * Nearly everywhere, inner must be non-null, however in places where
18001 * the Rust equivalent takes an Option, it may be set to null to indicate None.
18003 LDKnativeChainMonitor *inner;
18005 * Indicates that this is the only struct which contains the same pointer.
18006 * Rust functions which take ownership of an object provided via an argument require
18007 * this to be true and invalidate the object pointed to by inner.
18013 * A trait implemented for objects handling events from [`EventsProvider`].
18015 * An async variation also exists for implementations of [`EventsProvider`] that support async
18016 * event handling. The async event handler should satisfy the generic bounds: `F:
18017 * core::future::Future, H: Fn(Event) -> F`.
18019 typedef struct LDKEventHandler {
18021 * An opaque pointer which is passed to your function implementations as an argument.
18022 * This has no meaning in the LDK, and can be NULL or any other value.
18026 * Handles the given [`Event`].
18028 * See [`EventsProvider`] for details that must be considered when implementing this method.
18030 void (*handle_event)(const void *this_arg, struct LDKEvent event);
18032 * Frees any resources associated with this object given its this_arg pointer.
18033 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
18035 void (*free)(void *this_arg);
18039 * A trait indicating an object may generate events.
18041 * Events are processed by passing an [`EventHandler`] to [`process_pending_events`].
18043 * Implementations of this trait may also feature an async version of event handling, as shown with
18044 * [`ChannelManager::process_pending_events_async`] and
18045 * [`ChainMonitor::process_pending_events_async`].
18049 * When using this trait, [`process_pending_events`] will call [`handle_event`] for each pending
18050 * event since the last invocation.
18052 * In order to ensure no [`Event`]s are lost, implementors of this trait will persist [`Event`]s
18053 * and replay any unhandled events on startup. An [`Event`] is considered handled when
18054 * [`process_pending_events`] returns, thus handlers MUST fully handle [`Event`]s and persist any
18055 * relevant changes to disk *before* returning.
18057 * Further, because an application may crash between an [`Event`] being handled and the
18058 * implementor of this trait being re-serialized, [`Event`] handling must be idempotent - in
18059 * effect, [`Event`]s may be replayed.
18061 * Note, handlers may call back into the provider and thus deadlocking must be avoided. Be sure to
18062 * consult the provider's documentation on the implication of processing events and how a handler
18063 * may safely use the provider (e.g., see [`ChannelManager::process_pending_events`] and
18064 * [`ChainMonitor::process_pending_events`]).
18066 * (C-not implementable) As there is likely no reason for a user to implement this trait on their
18069 * [`process_pending_events`]: Self::process_pending_events
18070 * [`handle_event`]: EventHandler::handle_event
18071 * [`ChannelManager::process_pending_events`]: crate::ln::channelmanager::ChannelManager#method.process_pending_events
18072 * [`ChainMonitor::process_pending_events`]: crate::chain::chainmonitor::ChainMonitor#method.process_pending_events
18073 * [`ChannelManager::process_pending_events_async`]: crate::ln::channelmanager::ChannelManager::process_pending_events_async
18074 * [`ChainMonitor::process_pending_events_async`]: crate::chain::chainmonitor::ChainMonitor::process_pending_events_async
18076 typedef struct LDKEventsProvider {
18078 * An opaque pointer which is passed to your function implementations as an argument.
18079 * This has no meaning in the LDK, and can be NULL or any other value.
18083 * Processes any events generated since the last call using the given event handler.
18085 * See the trait-level documentation for requirements.
18087 void (*process_pending_events)(const void *this_arg, struct LDKEventHandler handler);
18089 * Frees any resources associated with this object given its this_arg pointer.
18090 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
18092 void (*free)(void *this_arg);
18093 } LDKEventsProvider;
18096 * This enum is used to specify which error data to send to peers when failing back an HTLC
18097 * using [`ChannelManager::fail_htlc_backwards_with_reason`].
18099 * For more info on failure codes, see <https://github.com/lightning/bolts/blob/master/04-onion-routing.md#failure-messages>.
18101 typedef enum LDKFailureCode_Tag {
18103 * We had a temporary error processing the payment. Useful if no other error codes fit
18104 * and you want to indicate that the payer may want to retry.
18106 LDKFailureCode_TemporaryNodeFailure,
18108 * We have a required feature which was not in this onion. For example, you may require
18109 * some additional metadata that was not provided with this payment.
18111 LDKFailureCode_RequiredNodeFeatureMissing,
18113 * You may wish to use this when a `payment_preimage` is unknown, or the CLTV expiry of
18114 * the HTLC is too close to the current block height for safe handling.
18115 * Using this failure code in [`ChannelManager::fail_htlc_backwards_with_reason`] is
18116 * equivalent to calling [`ChannelManager::fail_htlc_backwards`].
18118 LDKFailureCode_IncorrectOrUnknownPaymentDetails,
18120 * We failed to process the payload after the onion was decrypted. You may wish to
18121 * use this when receiving custom HTLC TLVs with even type numbers that you don't recognize.
18123 * If available, the tuple data may include the type number and byte offset in the
18124 * decrypted byte stream where the failure occurred.
18126 LDKFailureCode_InvalidOnionPayload,
18128 * Must be last for serialization purposes
18130 LDKFailureCode_Sentinel,
18131 } LDKFailureCode_Tag;
18133 typedef struct MUST_USE_STRUCT LDKFailureCode {
18134 LDKFailureCode_Tag tag;
18137 struct LDKCOption_C2Tuple_u64u16ZZ invalid_onion_payload;
18145 * Chain-related parameters used to construct a new `ChannelManager`.
18147 * Typically, the block-specific parameters are derived from the best block hash for the network,
18148 * as a newly constructed `ChannelManager` will not have created any channels yet. These parameters
18149 * are not needed when deserializing a previously constructed `ChannelManager`.
18151 typedef struct MUST_USE_STRUCT LDKChainParameters {
18153 * A pointer to the opaque Rust object.
18154 * Nearly everywhere, inner must be non-null, however in places where
18155 * the Rust equivalent takes an Option, it may be set to null to indicate None.
18157 LDKnativeChainParameters *inner;
18159 * Indicates that this is the only struct which contains the same pointer.
18160 * Rust functions which take ownership of an object provided via an argument require
18161 * this to be true and invalidate the object pointed to by inner.
18164 } LDKChainParameters;
18167 * A trait indicating an object may generate message send events
18169 typedef struct LDKMessageSendEventsProvider {
18171 * An opaque pointer which is passed to your function implementations as an argument.
18172 * This has no meaning in the LDK, and can be NULL or any other value.
18176 * Gets the list of pending events which were generated by previous actions, clearing the list
18179 struct LDKCVec_MessageSendEventZ (*get_and_clear_pending_msg_events)(const void *this_arg);
18181 * Frees any resources associated with this object given its this_arg pointer.
18182 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
18184 void (*free)(void *this_arg);
18185 } LDKMessageSendEventsProvider;
18188 * A trait to describe an object which can receive channel messages.
18190 * Messages MAY be called in parallel when they originate from different `their_node_ids`, however
18191 * they MUST NOT be called in parallel when the two calls have the same `their_node_id`.
18193 typedef struct LDKChannelMessageHandler {
18195 * An opaque pointer which is passed to your function implementations as an argument.
18196 * This has no meaning in the LDK, and can be NULL or any other value.
18200 * Handle an incoming `open_channel` message from the given peer.
18202 void (*handle_open_channel)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKOpenChannel *NONNULL_PTR msg);
18204 * Handle an incoming `open_channel2` message from the given peer.
18206 void (*handle_open_channel_v2)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKOpenChannelV2 *NONNULL_PTR msg);
18208 * Handle an incoming `accept_channel` message from the given peer.
18210 void (*handle_accept_channel)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKAcceptChannel *NONNULL_PTR msg);
18212 * Handle an incoming `accept_channel2` message from the given peer.
18214 void (*handle_accept_channel_v2)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKAcceptChannelV2 *NONNULL_PTR msg);
18216 * Handle an incoming `funding_created` message from the given peer.
18218 void (*handle_funding_created)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKFundingCreated *NONNULL_PTR msg);
18220 * Handle an incoming `funding_signed` message from the given peer.
18222 void (*handle_funding_signed)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKFundingSigned *NONNULL_PTR msg);
18224 * Handle an incoming `channel_ready` message from the given peer.
18226 void (*handle_channel_ready)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKChannelReady *NONNULL_PTR msg);
18228 * Handle an incoming `shutdown` message from the given peer.
18230 void (*handle_shutdown)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKShutdown *NONNULL_PTR msg);
18232 * Handle an incoming `closing_signed` message from the given peer.
18234 void (*handle_closing_signed)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKClosingSigned *NONNULL_PTR msg);
18236 * Handle an incoming `tx_add_input message` from the given peer.
18238 void (*handle_tx_add_input)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKTxAddInput *NONNULL_PTR msg);
18240 * Handle an incoming `tx_add_output` message from the given peer.
18242 void (*handle_tx_add_output)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKTxAddOutput *NONNULL_PTR msg);
18244 * Handle an incoming `tx_remove_input` message from the given peer.
18246 void (*handle_tx_remove_input)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKTxRemoveInput *NONNULL_PTR msg);
18248 * Handle an incoming `tx_remove_output` message from the given peer.
18250 void (*handle_tx_remove_output)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKTxRemoveOutput *NONNULL_PTR msg);
18252 * Handle an incoming `tx_complete message` from the given peer.
18254 void (*handle_tx_complete)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKTxComplete *NONNULL_PTR msg);
18256 * Handle an incoming `tx_signatures` message from the given peer.
18258 void (*handle_tx_signatures)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKTxSignatures *NONNULL_PTR msg);
18260 * Handle an incoming `tx_init_rbf` message from the given peer.
18262 void (*handle_tx_init_rbf)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKTxInitRbf *NONNULL_PTR msg);
18264 * Handle an incoming `tx_ack_rbf` message from the given peer.
18266 void (*handle_tx_ack_rbf)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKTxAckRbf *NONNULL_PTR msg);
18268 * Handle an incoming `tx_abort message` from the given peer.
18270 void (*handle_tx_abort)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKTxAbort *NONNULL_PTR msg);
18272 * Handle an incoming `update_add_htlc` message from the given peer.
18274 void (*handle_update_add_htlc)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKUpdateAddHTLC *NONNULL_PTR msg);
18276 * Handle an incoming `update_fulfill_htlc` message from the given peer.
18278 void (*handle_update_fulfill_htlc)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKUpdateFulfillHTLC *NONNULL_PTR msg);
18280 * Handle an incoming `update_fail_htlc` message from the given peer.
18282 void (*handle_update_fail_htlc)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKUpdateFailHTLC *NONNULL_PTR msg);
18284 * Handle an incoming `update_fail_malformed_htlc` message from the given peer.
18286 void (*handle_update_fail_malformed_htlc)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR msg);
18288 * Handle an incoming `commitment_signed` message from the given peer.
18290 void (*handle_commitment_signed)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKCommitmentSigned *NONNULL_PTR msg);
18292 * Handle an incoming `revoke_and_ack` message from the given peer.
18294 void (*handle_revoke_and_ack)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKRevokeAndACK *NONNULL_PTR msg);
18296 * Handle an incoming `update_fee` message from the given peer.
18298 void (*handle_update_fee)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKUpdateFee *NONNULL_PTR msg);
18300 * Handle an incoming `announcement_signatures` message from the given peer.
18302 void (*handle_announcement_signatures)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKAnnouncementSignatures *NONNULL_PTR msg);
18304 * Indicates a connection to the peer failed/an existing connection was lost.
18306 void (*peer_disconnected)(const void *this_arg, struct LDKPublicKey their_node_id);
18308 * Handle a peer reconnecting, possibly generating `channel_reestablish` message(s).
18310 * May return an `Err(())` if the features the peer supports are not sufficient to communicate
18311 * with us. Implementors should be somewhat conservative about doing so, however, as other
18312 * message handlers may still wish to communicate with this peer.
18314 struct LDKCResult_NoneNoneZ (*peer_connected)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKInit *NONNULL_PTR msg, bool inbound);
18316 * Handle an incoming `channel_reestablish` message from the given peer.
18318 void (*handle_channel_reestablish)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKChannelReestablish *NONNULL_PTR msg);
18320 * Handle an incoming `channel_update` message from the given peer.
18322 void (*handle_channel_update)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKChannelUpdate *NONNULL_PTR msg);
18324 * Handle an incoming `error` message from the given peer.
18326 void (*handle_error)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKErrorMessage *NONNULL_PTR msg);
18328 * Gets the node feature flags which this handler itself supports. All available handlers are
18329 * queried similarly and their feature flags are OR'd together to form the [`NodeFeatures`]
18330 * which are broadcasted in our [`NodeAnnouncement`] message.
18332 struct LDKNodeFeatures (*provided_node_features)(const void *this_arg);
18334 * Gets the init feature flags which should be sent to the given peer. All available handlers
18335 * are queried similarly and their feature flags are OR'd together to form the [`InitFeatures`]
18336 * which are sent in our [`Init`] message.
18338 * Note that this method is called before [`Self::peer_connected`].
18340 struct LDKInitFeatures (*provided_init_features)(const void *this_arg, struct LDKPublicKey their_node_id);
18342 * Gets the genesis hashes for this `ChannelMessageHandler` indicating which chains it supports.
18344 * If it's `None`, then no particular network chain hash compatibility will be enforced when
18345 * connecting to peers.
18347 struct LDKCOption_CVec_ThirtyTwoBytesZZ (*get_genesis_hashes)(const void *this_arg);
18349 * Implementation of MessageSendEventsProvider for this object.
18351 struct LDKMessageSendEventsProvider MessageSendEventsProvider;
18353 * Frees any resources associated with this object given its this_arg pointer.
18354 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
18356 void (*free)(void *this_arg);
18357 } LDKChannelMessageHandler;
18362 * Arguments for the creation of a ChannelManager that are not deserialized.
18364 * At a high-level, the process for deserializing a ChannelManager and resuming normal operation
18366 * 1) Deserialize all stored [`ChannelMonitor`]s.
18367 * 2) Deserialize the [`ChannelManager`] by filling in this struct and calling:
18368 * `<(BlockHash, ChannelManager)>::read(reader, args)`
18369 * This may result in closing some channels if the [`ChannelMonitor`] is newer than the stored
18370 * [`ChannelManager`] state to ensure no loss of funds. Thus, transactions may be broadcasted.
18371 * 3) If you are not fetching full blocks, register all relevant [`ChannelMonitor`] outpoints the
18372 * same way you would handle a [`chain::Filter`] call using
18373 * [`ChannelMonitor::get_outputs_to_watch`] and [`ChannelMonitor::get_funding_txo`].
18374 * 4) Reconnect blocks on your [`ChannelMonitor`]s.
18375 * 5) Disconnect/connect blocks on the [`ChannelManager`].
18376 * 6) Re-persist the [`ChannelMonitor`]s to ensure the latest state is on disk.
18377 * Note that if you're using a [`ChainMonitor`] for your [`chain::Watch`] implementation, you
18378 * will likely accomplish this as a side-effect of calling [`chain::Watch::watch_channel`] in
18380 * 7) Move the [`ChannelMonitor`]s into your local [`chain::Watch`]. If you're using a
18381 * [`ChainMonitor`], this is done by calling [`chain::Watch::watch_channel`].
18383 * Note that the ordering of #4-7 is not of importance, however all four must occur before you
18384 * call any other methods on the newly-deserialized [`ChannelManager`].
18386 * Note that because some channels may be closed during deserialization, it is critical that you
18387 * always deserialize only the latest version of a ChannelManager and ChannelMonitors available to
18388 * you. If you deserialize an old ChannelManager (during which force-closure transactions may be
18389 * broadcast), and then later deserialize a newer version of the same ChannelManager (which will
18390 * not force-close the same channels but consider them live), you may end up revoking a state for
18391 * which you've already broadcasted the transaction.
18393 * [`ChainMonitor`]: crate::chain::chainmonitor::ChainMonitor
18395 typedef struct MUST_USE_STRUCT LDKChannelManagerReadArgs {
18397 * A pointer to the opaque Rust object.
18398 * Nearly everywhere, inner must be non-null, however in places where
18399 * the Rust equivalent takes an Option, it may be set to null to indicate None.
18401 LDKnativeChannelManagerReadArgs *inner;
18403 * Indicates that this is the only struct which contains the same pointer.
18404 * Rust functions which take ownership of an object provided via an argument require
18405 * this to be true and invalidate the object pointed to by inner.
18408 } LDKChannelManagerReadArgs;
18413 * A set of keys that were HKDF-expanded from an initial call to
18414 * [`NodeSigner::get_inbound_payment_key_material`].
18416 * [`NodeSigner::get_inbound_payment_key_material`]: crate::sign::NodeSigner::get_inbound_payment_key_material
18418 typedef struct MUST_USE_STRUCT LDKExpandedKey {
18420 * A pointer to the opaque Rust object.
18421 * Nearly everywhere, inner must be non-null, however in places where
18422 * the Rust equivalent takes an Option, it may be set to null to indicate None.
18424 LDKnativeExpandedKey *inner;
18426 * Indicates that this is the only struct which contains the same pointer.
18427 * Rust functions which take ownership of an object provided via an argument require
18428 * this to be true and invalidate the object pointed to by inner.
18436 * Packet of hop data for next peer
18438 typedef struct MUST_USE_STRUCT LDKPacket {
18440 * A pointer to the opaque Rust object.
18441 * Nearly everywhere, inner must be non-null, however in places where
18442 * the Rust equivalent takes an Option, it may be set to null to indicate None.
18444 LDKnativePacket *inner;
18446 * Indicates that this is the only struct which contains the same pointer.
18447 * Rust functions which take ownership of an object provided via an argument require
18448 * this to be true and invalidate the object pointed to by inner.
18454 * A 3-byte byte array.
18456 typedef struct LDKThreeBytes {
18464 * A trait to describe an object which can receive routing messages.
18466 * # Implementor DoS Warnings
18468 * For messages enabled with the `gossip_queries` feature there are potential DoS vectors when
18469 * handling inbound queries. Implementors using an on-disk network graph should be aware of
18470 * repeated disk I/O for queries accessing different parts of the network graph.
18472 typedef struct LDKRoutingMessageHandler {
18474 * An opaque pointer which is passed to your function implementations as an argument.
18475 * This has no meaning in the LDK, and can be NULL or any other value.
18479 * Handle an incoming `node_announcement` message, returning `true` if it should be forwarded on,
18480 * `false` or returning an `Err` otherwise.
18482 struct LDKCResult_boolLightningErrorZ (*handle_node_announcement)(const void *this_arg, const struct LDKNodeAnnouncement *NONNULL_PTR msg);
18484 * Handle a `channel_announcement` message, returning `true` if it should be forwarded on, `false`
18485 * or returning an `Err` otherwise.
18487 struct LDKCResult_boolLightningErrorZ (*handle_channel_announcement)(const void *this_arg, const struct LDKChannelAnnouncement *NONNULL_PTR msg);
18489 * Handle an incoming `channel_update` message, returning true if it should be forwarded on,
18490 * `false` or returning an `Err` otherwise.
18492 struct LDKCResult_boolLightningErrorZ (*handle_channel_update)(const void *this_arg, const struct LDKChannelUpdate *NONNULL_PTR msg);
18494 * Gets channel announcements and updates required to dump our routing table to a remote node,
18495 * starting at the `short_channel_id` indicated by `starting_point` and including announcements
18496 * for a single channel.
18498 struct LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ (*get_next_channel_announcement)(const void *this_arg, uint64_t starting_point);
18500 * Gets a node announcement required to dump our routing table to a remote node, starting at
18501 * the node *after* the provided pubkey and including up to one announcement immediately
18502 * higher (as defined by `<PublicKey as Ord>::cmp`) than `starting_point`.
18503 * If `None` is provided for `starting_point`, we start at the first node.
18505 * Note that starting_point (or a relevant inner pointer) may be NULL or all-0s to represent None
18506 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
18508 struct LDKNodeAnnouncement (*get_next_node_announcement)(const void *this_arg, struct LDKNodeId starting_point);
18510 * Called when a connection is established with a peer. This can be used to
18511 * perform routing table synchronization using a strategy defined by the
18514 * May return an `Err(())` if the features the peer supports are not sufficient to communicate
18515 * with us. Implementors should be somewhat conservative about doing so, however, as other
18516 * message handlers may still wish to communicate with this peer.
18518 struct LDKCResult_NoneNoneZ (*peer_connected)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKInit *NONNULL_PTR init, bool inbound);
18520 * Handles the reply of a query we initiated to learn about channels
18521 * for a given range of blocks. We can expect to receive one or more
18522 * replies to a single query.
18524 struct LDKCResult_NoneLightningErrorZ (*handle_reply_channel_range)(const void *this_arg, struct LDKPublicKey their_node_id, struct LDKReplyChannelRange msg);
18526 * Handles the reply of a query we initiated asking for routing gossip
18527 * messages for a list of channels. We should receive this message when
18528 * a node has completed its best effort to send us the pertaining routing
18531 struct LDKCResult_NoneLightningErrorZ (*handle_reply_short_channel_ids_end)(const void *this_arg, struct LDKPublicKey their_node_id, struct LDKReplyShortChannelIdsEnd msg);
18533 * Handles when a peer asks us to send a list of `short_channel_id`s
18534 * for the requested range of blocks.
18536 struct LDKCResult_NoneLightningErrorZ (*handle_query_channel_range)(const void *this_arg, struct LDKPublicKey their_node_id, struct LDKQueryChannelRange msg);
18538 * Handles when a peer asks us to send routing gossip messages for a
18539 * list of `short_channel_id`s.
18541 struct LDKCResult_NoneLightningErrorZ (*handle_query_short_channel_ids)(const void *this_arg, struct LDKPublicKey their_node_id, struct LDKQueryShortChannelIds msg);
18543 * Indicates that there are a large number of [`ChannelAnnouncement`] (or other) messages
18544 * pending some async action. While there is no guarantee of the rate of future messages, the
18545 * caller should seek to reduce the rate of new gossip messages handled, especially
18546 * [`ChannelAnnouncement`]s.
18548 bool (*processing_queue_high)(const void *this_arg);
18550 * Gets the node feature flags which this handler itself supports. All available handlers are
18551 * queried similarly and their feature flags are OR'd together to form the [`NodeFeatures`]
18552 * which are broadcasted in our [`NodeAnnouncement`] message.
18554 struct LDKNodeFeatures (*provided_node_features)(const void *this_arg);
18556 * Gets the init feature flags which should be sent to the given peer. All available handlers
18557 * are queried similarly and their feature flags are OR'd together to form the [`InitFeatures`]
18558 * which are sent in our [`Init`] message.
18560 * Note that this method is called before [`Self::peer_connected`].
18562 struct LDKInitFeatures (*provided_init_features)(const void *this_arg, struct LDKPublicKey their_node_id);
18564 * Implementation of MessageSendEventsProvider for this object.
18566 struct LDKMessageSendEventsProvider MessageSendEventsProvider;
18568 * Frees any resources associated with this object given its this_arg pointer.
18569 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
18571 void (*free)(void *this_arg);
18572 } LDKRoutingMessageHandler;
18575 * A trait indicating an object may generate onion messages to send
18577 typedef struct LDKOnionMessageProvider {
18579 * An opaque pointer which is passed to your function implementations as an argument.
18580 * This has no meaning in the LDK, and can be NULL or any other value.
18584 * Gets the next pending onion message for the peer with the given node id.
18586 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
18588 struct LDKOnionMessage (*next_onion_message_for_peer)(const void *this_arg, struct LDKPublicKey peer_node_id);
18590 * Frees any resources associated with this object given its this_arg pointer.
18591 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
18593 void (*free)(void *this_arg);
18594 } LDKOnionMessageProvider;
18597 * A trait to describe an object that can receive onion messages.
18599 typedef struct LDKOnionMessageHandler {
18601 * An opaque pointer which is passed to your function implementations as an argument.
18602 * This has no meaning in the LDK, and can be NULL or any other value.
18606 * Handle an incoming `onion_message` message from the given peer.
18608 void (*handle_onion_message)(const void *this_arg, struct LDKPublicKey peer_node_id, const struct LDKOnionMessage *NONNULL_PTR msg);
18610 * Called when a connection is established with a peer. Can be used to track which peers
18611 * advertise onion message support and are online.
18613 * May return an `Err(())` if the features the peer supports are not sufficient to communicate
18614 * with us. Implementors should be somewhat conservative about doing so, however, as other
18615 * message handlers may still wish to communicate with this peer.
18617 struct LDKCResult_NoneNoneZ (*peer_connected)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKInit *NONNULL_PTR init, bool inbound);
18619 * Indicates a connection to the peer failed/an existing connection was lost. Allows handlers to
18620 * drop and refuse to forward onion messages to this peer.
18622 void (*peer_disconnected)(const void *this_arg, struct LDKPublicKey their_node_id);
18624 * Gets the node feature flags which this handler itself supports. All available handlers are
18625 * queried similarly and their feature flags are OR'd together to form the [`NodeFeatures`]
18626 * which are broadcasted in our [`NodeAnnouncement`] message.
18628 struct LDKNodeFeatures (*provided_node_features)(const void *this_arg);
18630 * Gets the init feature flags which should be sent to the given peer. All available handlers
18631 * are queried similarly and their feature flags are OR'd together to form the [`InitFeatures`]
18632 * which are sent in our [`Init`] message.
18634 * Note that this method is called before [`Self::peer_connected`].
18636 struct LDKInitFeatures (*provided_init_features)(const void *this_arg, struct LDKPublicKey their_node_id);
18638 * Implementation of OnionMessageProvider for this object.
18640 struct LDKOnionMessageProvider OnionMessageProvider;
18642 * Frees any resources associated with this object given its this_arg pointer.
18643 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
18645 void (*free)(void *this_arg);
18646 } LDKOnionMessageHandler;
18649 * Trait to be implemented by custom message (unrelated to the channel/gossip LN layers)
18652 typedef struct LDKCustomMessageReader {
18654 * An opaque pointer which is passed to your function implementations as an argument.
18655 * This has no meaning in the LDK, and can be NULL or any other value.
18659 * Decodes a custom message to `CustomMessageType`. If the given message type is known to the
18660 * implementation and the message could be decoded, must return `Ok(Some(message))`. If the
18661 * message type is unknown to the implementation, must return `Ok(None)`. If a decoding error
18662 * occur, must return `Err(DecodeError::X)` where `X` details the encountered error.
18664 struct LDKCResult_COption_TypeZDecodeErrorZ (*read)(const void *this_arg, uint16_t message_type, struct LDKu8slice buffer);
18666 * Frees any resources associated with this object given its this_arg pointer.
18667 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
18669 void (*free)(void *this_arg);
18670 } LDKCustomMessageReader;
18673 * A handler provided to [`PeerManager`] for reading and handling custom messages.
18675 * [BOLT 1] specifies a custom message type range for use with experimental or application-specific
18676 * messages. `CustomMessageHandler` allows for user-defined handling of such types. See the
18677 * [`lightning_custom_message`] crate for tools useful in composing more than one custom handler.
18679 * [BOLT 1]: https://github.com/lightning/bolts/blob/master/01-messaging.md
18680 * [`lightning_custom_message`]: https://docs.rs/lightning_custom_message/latest/lightning_custom_message
18682 typedef struct LDKCustomMessageHandler {
18684 * An opaque pointer which is passed to your function implementations as an argument.
18685 * This has no meaning in the LDK, and can be NULL or any other value.
18689 * Handles the given message sent from `sender_node_id`, possibly producing messages for
18690 * [`CustomMessageHandler::get_and_clear_pending_msg`] to return and thus for [`PeerManager`]
18693 struct LDKCResult_NoneLightningErrorZ (*handle_custom_message)(const void *this_arg, struct LDKType msg, struct LDKPublicKey sender_node_id);
18695 * Returns the list of pending messages that were generated by the handler, clearing the list
18696 * in the process. Each message is paired with the node id of the intended recipient. If no
18697 * connection to the node exists, then the message is simply not sent.
18699 struct LDKCVec_C2Tuple_PublicKeyTypeZZ (*get_and_clear_pending_msg)(const void *this_arg);
18701 * Gets the node feature flags which this handler itself supports. All available handlers are
18702 * queried similarly and their feature flags are OR'd together to form the [`NodeFeatures`]
18703 * which are broadcasted in our [`NodeAnnouncement`] message.
18705 * [`NodeAnnouncement`]: crate::ln::msgs::NodeAnnouncement
18707 struct LDKNodeFeatures (*provided_node_features)(const void *this_arg);
18709 * Gets the init feature flags which should be sent to the given peer. All available handlers
18710 * are queried similarly and their feature flags are OR'd together to form the [`InitFeatures`]
18711 * which are sent in our [`Init`] message.
18713 * [`Init`]: crate::ln::msgs::Init
18715 struct LDKInitFeatures (*provided_init_features)(const void *this_arg, struct LDKPublicKey their_node_id);
18717 * Implementation of CustomMessageReader for this object.
18719 struct LDKCustomMessageReader CustomMessageReader;
18721 * Frees any resources associated with this object given its this_arg pointer.
18722 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
18724 void (*free)(void *this_arg);
18725 } LDKCustomMessageHandler;
18730 * A dummy struct which implements `RoutingMessageHandler` without storing any routing information
18731 * or doing any processing. You can provide one of these as the route_handler in a MessageHandler.
18733 typedef struct MUST_USE_STRUCT LDKIgnoringMessageHandler {
18735 * A pointer to the opaque Rust object.
18736 * Nearly everywhere, inner must be non-null, however in places where
18737 * the Rust equivalent takes an Option, it may be set to null to indicate None.
18739 LDKnativeIgnoringMessageHandler *inner;
18741 * Indicates that this is the only struct which contains the same pointer.
18742 * Rust functions which take ownership of an object provided via an argument require
18743 * this to be true and invalidate the object pointed to by inner.
18746 } LDKIgnoringMessageHandler;
18749 * A handler for an [`OnionMessage`] containing a BOLT 12 Offers message as its payload.
18751 * [`OnionMessage`]: crate::ln::msgs::OnionMessage
18753 typedef struct LDKOffersMessageHandler {
18755 * An opaque pointer which is passed to your function implementations as an argument.
18756 * This has no meaning in the LDK, and can be NULL or any other value.
18760 * Handles the given message by either responding with an [`Bolt12Invoice`], sending a payment,
18761 * or replying with an error.
18763 struct LDKCOption_OffersMessageZ (*handle_message)(const void *this_arg, struct LDKOffersMessage message);
18765 * Frees any resources associated with this object given its this_arg pointer.
18766 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
18768 void (*free)(void *this_arg);
18769 } LDKOffersMessageHandler;
18772 * Handler for custom onion messages. If you are using [`SimpleArcOnionMessenger`],
18773 * [`SimpleRefOnionMessenger`], or prefer to ignore inbound custom onion messages,
18774 * [`IgnoringMessageHandler`] must be provided to [`OnionMessenger::new`]. Otherwise, a custom
18775 * implementation of this trait must be provided, with [`CustomMessage`] specifying the supported
18778 * See [`OnionMessenger`] for example usage.
18780 * [`IgnoringMessageHandler`]: crate::ln::peer_handler::IgnoringMessageHandler
18781 * [`CustomMessage`]: Self::CustomMessage
18783 typedef struct LDKCustomOnionMessageHandler {
18785 * An opaque pointer which is passed to your function implementations as an argument.
18786 * This has no meaning in the LDK, and can be NULL or any other value.
18790 * Called with the custom message that was received, returning a response to send, if any.
18792 struct LDKCOption_CustomOnionMessageContentsZ (*handle_custom_message)(const void *this_arg, struct LDKCustomOnionMessageContents msg);
18794 * Read a custom message of type `message_type` from `buffer`, returning `Ok(None)` if the
18795 * message type is unknown.
18797 struct LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ (*read_custom_message)(const void *this_arg, uint64_t message_type, struct LDKu8slice buffer);
18799 * Frees any resources associated with this object given its this_arg pointer.
18800 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
18802 void (*free)(void *this_arg);
18803 } LDKCustomOnionMessageHandler;
18808 * A dummy struct which implements `ChannelMessageHandler` without having any channels.
18809 * You can provide one of these as the route_handler in a MessageHandler.
18811 typedef struct MUST_USE_STRUCT LDKErroringMessageHandler {
18813 * A pointer to the opaque Rust object.
18814 * Nearly everywhere, inner must be non-null, however in places where
18815 * the Rust equivalent takes an Option, it may be set to null to indicate None.
18817 LDKnativeErroringMessageHandler *inner;
18819 * Indicates that this is the only struct which contains the same pointer.
18820 * Rust functions which take ownership of an object provided via an argument require
18821 * this to be true and invalidate the object pointed to by inner.
18824 } LDKErroringMessageHandler;
18829 * Provides references to trait impls which handle different types of messages.
18831 typedef struct MUST_USE_STRUCT LDKMessageHandler {
18833 * A pointer to the opaque Rust object.
18834 * Nearly everywhere, inner must be non-null, however in places where
18835 * the Rust equivalent takes an Option, it may be set to null to indicate None.
18837 LDKnativeMessageHandler *inner;
18839 * Indicates that this is the only struct which contains the same pointer.
18840 * Rust functions which take ownership of an object provided via an argument require
18841 * this to be true and invalidate the object pointed to by inner.
18844 } LDKMessageHandler;
18847 * Provides an object which can be used to send data to and which uniquely identifies a connection
18848 * to a remote host. You will need to be able to generate multiple of these which meet Eq and
18849 * implement Hash to meet the PeerManager API.
18851 * For efficiency, [`Clone`] should be relatively cheap for this type.
18853 * Two descriptors may compare equal (by [`cmp::Eq`] and [`hash::Hash`]) as long as the original
18854 * has been disconnected, the [`PeerManager`] has been informed of the disconnection (either by it
18855 * having triggered the disconnection or a call to [`PeerManager::socket_disconnected`]), and no
18856 * further calls to the [`PeerManager`] related to the original socket occur. This allows you to
18857 * use a file descriptor for your SocketDescriptor directly, however for simplicity you may wish
18858 * to simply use another value which is guaranteed to be globally unique instead.
18860 typedef struct LDKSocketDescriptor {
18862 * An opaque pointer which is passed to your function implementations as an argument.
18863 * This has no meaning in the LDK, and can be NULL or any other value.
18867 * Attempts to send some data from the given slice to the peer.
18869 * Returns the amount of data which was sent, possibly 0 if the socket has since disconnected.
18870 * Note that in the disconnected case, [`PeerManager::socket_disconnected`] must still be
18871 * called and further write attempts may occur until that time.
18873 * If the returned size is smaller than `data.len()`, a
18874 * [`PeerManager::write_buffer_space_avail`] call must be made the next time more data can be
18875 * written. Additionally, until a `send_data` event completes fully, no further
18876 * [`PeerManager::read_event`] calls should be made for the same peer! Because this is to
18877 * prevent denial-of-service issues, you should not read or buffer any data from the socket
18880 * If a [`PeerManager::read_event`] call on this descriptor had previously returned true
18881 * (indicating that read events should be paused to prevent DoS in the send buffer),
18882 * `resume_read` may be set indicating that read events on this descriptor should resume. A
18883 * `resume_read` of false carries no meaning, and should not cause any action.
18885 uintptr_t (*send_data)(void *this_arg, struct LDKu8slice data, bool resume_read);
18887 * Disconnect the socket pointed to by this SocketDescriptor.
18889 * You do *not* need to call [`PeerManager::socket_disconnected`] with this socket after this
18890 * call (doing so is a noop).
18892 void (*disconnect_socket)(void *this_arg);
18894 * Checks if two objects are equal given this object's this_arg pointer and another object.
18896 bool (*eq)(const void *this_arg, const struct LDKSocketDescriptor *NONNULL_PTR other_arg);
18898 * Calculate a succinct non-cryptographic hash for an object given its this_arg pointer.
18899 * This is used, for example, for inclusion of this object in a hash map.
18901 uint64_t (*hash)(const void *this_arg);
18903 * Called, if set, after this SocketDescriptor has been cloned into a duplicate object.
18904 * The new SocketDescriptor is provided, and should be mutated as needed to perform a
18905 * deep copy of the object pointed to by this_arg or avoid any double-freeing.
18907 void (*cloned)(struct LDKSocketDescriptor *NONNULL_PTR new_SocketDescriptor);
18909 * Frees any resources associated with this object given its this_arg pointer.
18910 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
18912 void (*free)(void *this_arg);
18913 } LDKSocketDescriptor;
18918 * A PeerManager manages a set of peers, described by their [`SocketDescriptor`] and marshalls
18919 * socket events into messages which it passes on to its [`MessageHandler`].
18921 * Locks are taken internally, so you must never assume that reentrancy from a
18922 * [`SocketDescriptor`] call back into [`PeerManager`] methods will not deadlock.
18924 * Calls to [`read_event`] will decode relevant messages and pass them to the
18925 * [`ChannelMessageHandler`], likely doing message processing in-line. Thus, the primary form of
18926 * parallelism in Rust-Lightning is in calls to [`read_event`]. Note, however, that calls to any
18927 * [`PeerManager`] functions related to the same connection must occur only in serial, making new
18928 * calls only after previous ones have returned.
18930 * Rather than using a plain [`PeerManager`], it is preferable to use either a [`SimpleArcPeerManager`]
18931 * a [`SimpleRefPeerManager`], for conciseness. See their documentation for more details, but
18932 * essentially you should default to using a [`SimpleRefPeerManager`], and use a
18933 * [`SimpleArcPeerManager`] when you require a `PeerManager` with a static lifetime, such as when
18934 * you're using lightning-net-tokio.
18936 * [`read_event`]: PeerManager::read_event
18938 typedef struct MUST_USE_STRUCT LDKPeerManager {
18940 * A pointer to the opaque Rust object.
18941 * Nearly everywhere, inner must be non-null, however in places where
18942 * the Rust equivalent takes an Option, it may be set to null to indicate None.
18944 LDKnativePeerManager *inner;
18946 * Indicates that this is the only struct which contains the same pointer.
18947 * Rust functions which take ownership of an object provided via an argument require
18948 * this to be true and invalidate the object pointed to by inner.
18956 * Static channel fields used to build transactions given per-commitment fields, organized by
18957 * broadcaster/countersignatory.
18959 * This is derived from the holder/counterparty-organized ChannelTransactionParameters via the
18960 * as_holder_broadcastable and as_counterparty_broadcastable functions.
18962 typedef struct MUST_USE_STRUCT LDKDirectedChannelTransactionParameters {
18964 * A pointer to the opaque Rust object.
18965 * Nearly everywhere, inner must be non-null, however in places where
18966 * the Rust equivalent takes an Option, it may be set to null to indicate None.
18968 LDKnativeDirectedChannelTransactionParameters *inner;
18970 * Indicates that this is the only struct which contains the same pointer.
18971 * Rust functions which take ownership of an object provided via an argument require
18972 * this to be true and invalidate the object pointed to by inner.
18975 } LDKDirectedChannelTransactionParameters;
18980 * Features used within an `offer`.
18982 typedef struct MUST_USE_STRUCT LDKOfferFeatures {
18984 * A pointer to the opaque Rust object.
18985 * Nearly everywhere, inner must be non-null, however in places where
18986 * the Rust equivalent takes an Option, it may be set to null to indicate None.
18988 LDKnativeOfferFeatures *inner;
18990 * Indicates that this is the only struct which contains the same pointer.
18991 * Rust functions which take ownership of an object provided via an argument require
18992 * this to be true and invalidate the object pointed to by inner.
18995 } LDKOfferFeatures;
19000 * Features used within an `invoice_request`.
19002 typedef struct MUST_USE_STRUCT LDKInvoiceRequestFeatures {
19004 * A pointer to the opaque Rust object.
19005 * Nearly everywhere, inner must be non-null, however in places where
19006 * the Rust equivalent takes an Option, it may be set to null to indicate None.
19008 LDKnativeInvoiceRequestFeatures *inner;
19010 * Indicates that this is the only struct which contains the same pointer.
19011 * Rust functions which take ownership of an object provided via an argument require
19012 * this to be true and invalidate the object pointed to by inner.
19015 } LDKInvoiceRequestFeatures;
19018 * Integer in the range `0..=16`
19020 typedef struct LDKWitnessVersion {
19022 } LDKWitnessVersion;
19027 * The minimum amount required for an item in an [`Offer`], denominated in either bitcoin or
19028 * another currency.
19030 typedef struct MUST_USE_STRUCT LDKAmount {
19032 * A pointer to the opaque Rust object.
19033 * Nearly everywhere, inner must be non-null, however in places where
19034 * the Rust equivalent takes an Option, it may be set to null to indicate None.
19036 LDKnativeAmount *inner;
19038 * Indicates that this is the only struct which contains the same pointer.
19039 * Rust functions which take ownership of an object provided via an argument require
19040 * this to be true and invalidate the object pointed to by inner.
19048 * Quantity of items supported by an [`Offer`].
19050 typedef struct MUST_USE_STRUCT LDKQuantity {
19052 * A pointer to the opaque Rust object.
19053 * Nearly everywhere, inner must be non-null, however in places where
19054 * the Rust equivalent takes an Option, it may be set to null to indicate None.
19056 LDKnativeQuantity *inner;
19058 * Indicates that this is the only struct which contains the same pointer.
19059 * Rust functions which take ownership of an object provided via an argument require
19060 * this to be true and invalidate the object pointed to by inner.
19068 * A hash for use in a specific context by tweaking with a context-dependent tag as per [BIP 340]
19069 * and computed over the merkle root of a TLV stream to sign as defined in [BOLT 12].
19071 * [BIP 340]: https://github.com/bitcoin/bips/blob/master/bip-0340.mediawiki
19072 * [BOLT 12]: https://github.com/rustyrussell/lightning-rfc/blob/guilt/offers/12-offer-encoding.md#signature-calculation
19074 typedef struct MUST_USE_STRUCT LDKTaggedHash {
19076 * A pointer to the opaque Rust object.
19077 * Nearly everywhere, inner must be non-null, however in places where
19078 * the Rust equivalent takes an Option, it may be set to null to indicate None.
19080 LDKnativeTaggedHash *inner;
19082 * Indicates that this is the only struct which contains the same pointer.
19083 * Rust functions which take ownership of an object provided via an argument require
19084 * this to be true and invalidate the object pointed to by inner.
19092 * The field in the [`InvoiceRequest`] or the [`Bolt12Invoice`] that contained an error.
19094 * [`InvoiceRequest`]: crate::offers::invoice_request::InvoiceRequest
19095 * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice
19097 typedef struct MUST_USE_STRUCT LDKErroneousField {
19099 * A pointer to the opaque Rust object.
19100 * Nearly everywhere, inner must be non-null, however in places where
19101 * the Rust equivalent takes an Option, it may be set to null to indicate None.
19103 LDKnativeErroneousField *inner;
19105 * Indicates that this is the only struct which contains the same pointer.
19106 * Rust functions which take ownership of an object provided via an argument require
19107 * this to be true and invalidate the object pointed to by inner.
19110 } LDKErroneousField;
19115 * Receives and validates network updates from peers,
19116 * stores authentic and relevant data as a network graph.
19117 * This network graph is then used for routing payments.
19118 * Provides interface to help with initial routing sync by
19119 * serving historical announcements.
19121 typedef struct MUST_USE_STRUCT LDKP2PGossipSync {
19123 * A pointer to the opaque Rust object.
19124 * Nearly everywhere, inner must be non-null, however in places where
19125 * the Rust equivalent takes an Option, it may be set to null to indicate None.
19127 LDKnativeP2PGossipSync *inner;
19129 * Indicates that this is the only struct which contains the same pointer.
19130 * Rust functions which take ownership of an object provided via an argument require
19131 * this to be true and invalidate the object pointed to by inner.
19134 } LDKP2PGossipSync;
19139 * A read-only view of [`NetworkGraph`].
19141 typedef struct MUST_USE_STRUCT LDKReadOnlyNetworkGraph {
19143 * A pointer to the opaque Rust object.
19144 * Nearly everywhere, inner must be non-null, however in places where
19145 * the Rust equivalent takes an Option, it may be set to null to indicate None.
19147 LDKnativeReadOnlyNetworkGraph *inner;
19149 * Indicates that this is the only struct which contains the same pointer.
19150 * Rust functions which take ownership of an object provided via an argument require
19151 * this to be true and invalidate the object pointed to by inner.
19154 } LDKReadOnlyNetworkGraph;
19159 * A wrapper around [`ChannelInfo`] representing information about the channel as directed from a
19160 * source node to a target node.
19162 typedef struct MUST_USE_STRUCT LDKDirectedChannelInfo {
19164 * A pointer to the opaque Rust object.
19165 * Nearly everywhere, inner must be non-null, however in places where
19166 * the Rust equivalent takes an Option, it may be set to null to indicate None.
19168 LDKnativeDirectedChannelInfo *inner;
19170 * Indicates that this is the only struct which contains the same pointer.
19171 * Rust functions which take ownership of an object provided via an argument require
19172 * this to be true and invalidate the object pointed to by inner.
19175 } LDKDirectedChannelInfo;
19178 * The effective capacity of a channel for routing purposes.
19180 * While this may be smaller than the actual channel capacity, amounts greater than
19181 * [`Self::as_msat`] should not be routed through the channel.
19183 typedef enum LDKEffectiveCapacity_Tag {
19185 * The available liquidity in the channel known from being a channel counterparty, and thus a
19188 LDKEffectiveCapacity_ExactLiquidity,
19190 * The maximum HTLC amount in one direction as advertised on the gossip network.
19192 LDKEffectiveCapacity_AdvertisedMaxHTLC,
19194 * The total capacity of the channel as determined by the funding transaction.
19196 LDKEffectiveCapacity_Total,
19198 * A capacity sufficient to route any payment, typically used for private channels provided by
19201 LDKEffectiveCapacity_Infinite,
19203 * The maximum HTLC amount as provided by an invoice route hint.
19205 LDKEffectiveCapacity_HintMaxHTLC,
19207 * A capacity that is unknown possibly because either the chain state is unavailable to know
19208 * the total capacity or the `htlc_maximum_msat` was not advertised on the gossip network.
19210 LDKEffectiveCapacity_Unknown,
19212 * Must be last for serialization purposes
19214 LDKEffectiveCapacity_Sentinel,
19215 } LDKEffectiveCapacity_Tag;
19217 typedef struct LDKEffectiveCapacity_LDKExactLiquidity_Body {
19219 * Either the inbound or outbound liquidity depending on the direction, denominated in
19222 uint64_t liquidity_msat;
19223 } LDKEffectiveCapacity_LDKExactLiquidity_Body;
19225 typedef struct LDKEffectiveCapacity_LDKAdvertisedMaxHTLC_Body {
19227 * The maximum HTLC amount denominated in millisatoshi.
19229 uint64_t amount_msat;
19230 } LDKEffectiveCapacity_LDKAdvertisedMaxHTLC_Body;
19232 typedef struct LDKEffectiveCapacity_LDKTotal_Body {
19234 * The funding amount denominated in millisatoshi.
19236 uint64_t capacity_msat;
19238 * The maximum HTLC amount denominated in millisatoshi.
19240 uint64_t htlc_maximum_msat;
19241 } LDKEffectiveCapacity_LDKTotal_Body;
19243 typedef struct LDKEffectiveCapacity_LDKHintMaxHTLC_Body {
19245 * The maximum HTLC amount denominated in millisatoshi.
19247 uint64_t amount_msat;
19248 } LDKEffectiveCapacity_LDKHintMaxHTLC_Body;
19250 typedef struct MUST_USE_STRUCT LDKEffectiveCapacity {
19251 LDKEffectiveCapacity_Tag tag;
19253 LDKEffectiveCapacity_LDKExactLiquidity_Body exact_liquidity;
19254 LDKEffectiveCapacity_LDKAdvertisedMaxHTLC_Body advertised_max_htlc;
19255 LDKEffectiveCapacity_LDKTotal_Body total;
19256 LDKEffectiveCapacity_LDKHintMaxHTLC_Body hint_max_htlc;
19258 } LDKEffectiveCapacity;
19263 * A [`Router`] implemented using [`find_route`].
19265 typedef struct MUST_USE_STRUCT LDKDefaultRouter {
19267 * A pointer to the opaque Rust object.
19268 * Nearly everywhere, inner must be non-null, however in places where
19269 * the Rust equivalent takes an Option, it may be set to null to indicate None.
19271 LDKnativeDefaultRouter *inner;
19273 * Indicates that this is the only struct which contains the same pointer.
19274 * Rust functions which take ownership of an object provided via an argument require
19275 * this to be true and invalidate the object pointed to by inner.
19278 } LDKDefaultRouter;
19283 * [`ScoreLookUp`] implementation that factors in in-flight HTLC liquidity.
19285 * Useful for custom [`Router`] implementations to wrap their [`ScoreLookUp`] on-the-fly when calling
19288 * [`ScoreLookUp`]: crate::routing::scoring::ScoreLookUp
19290 typedef struct MUST_USE_STRUCT LDKScorerAccountingForInFlightHtlcs {
19292 * A pointer to the opaque Rust object.
19293 * Nearly everywhere, inner must be non-null, however in places where
19294 * the Rust equivalent takes an Option, it may be set to null to indicate None.
19296 LDKnativeScorerAccountingForInFlightHtlcs *inner;
19298 * Indicates that this is the only struct which contains the same pointer.
19299 * Rust functions which take ownership of an object provided via an argument require
19300 * this to be true and invalidate the object pointed to by inner.
19303 } LDKScorerAccountingForInFlightHtlcs;
19306 * The recipient of a payment, differing based on whether they've hidden their identity with route
19309 typedef enum LDKPayee_Tag {
19311 * The recipient provided blinded paths and payinfo to reach them. The blinded paths themselves
19312 * will be included in the final [`Route`].
19316 * The recipient included these route hints in their BOLT11 invoice.
19320 * Must be last for serialization purposes
19325 typedef struct LDKPayee_LDKBlinded_Body {
19327 * Aggregated routing info and blinded paths, for routing to the payee without knowing their
19330 struct LDKCVec_C2Tuple_BlindedPayInfoBlindedPathZZ route_hints;
19332 * Features supported by the payee.
19334 * May be set from the payee's invoice. May be `None` if the invoice does not contain any
19337 * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
19339 struct LDKBolt12InvoiceFeatures features;
19340 } LDKPayee_LDKBlinded_Body;
19342 typedef struct LDKPayee_LDKClear_Body {
19344 * The node id of the payee.
19346 struct LDKPublicKey node_id;
19348 * Hints for routing to the payee, containing channels connecting the payee to public nodes.
19350 struct LDKCVec_RouteHintZ route_hints;
19352 * Features supported by the payee.
19354 * May be set from the payee's invoice or via [`for_keysend`]. May be `None` if the invoice
19355 * does not contain any features.
19357 * [`for_keysend`]: PaymentParameters::for_keysend
19359 * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
19361 struct LDKBolt11InvoiceFeatures features;
19363 * The minimum CLTV delta at the end of the route. This value must not be zero.
19365 uint32_t final_cltv_expiry_delta;
19366 } LDKPayee_LDKClear_Body;
19368 typedef struct MUST_USE_STRUCT LDKPayee {
19371 LDKPayee_LDKBlinded_Body blinded;
19372 LDKPayee_LDKClear_Body clear;
19377 * A trait which can both lookup and update routing channel penalty scores.
19379 * This is used in places where both bounds are required and implemented for all types which
19380 * implement [`ScoreLookUp`] and [`ScoreUpdate`].
19382 * Bindings users may need to manually implement this for their custom scoring implementations.
19384 typedef struct LDKScore {
19386 * An opaque pointer which is passed to your function implementations as an argument.
19387 * This has no meaning in the LDK, and can be NULL or any other value.
19391 * Implementation of ScoreLookUp for this object.
19393 struct LDKScoreLookUp ScoreLookUp;
19395 * Implementation of ScoreUpdate for this object.
19397 struct LDKScoreUpdate ScoreUpdate;
19399 * Serialize the object into a byte array
19401 struct LDKCVec_u8Z (*write)(const void *this_arg);
19403 * Frees any resources associated with this object given its this_arg pointer.
19404 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
19406 void (*free)(void *this_arg);
19412 * A concrete implementation of [`LockableScore`] which supports multi-threading.
19414 typedef struct MUST_USE_STRUCT LDKMultiThreadedLockableScore {
19416 * A pointer to the opaque Rust object.
19417 * Nearly everywhere, inner must be non-null, however in places where
19418 * the Rust equivalent takes an Option, it may be set to null to indicate None.
19420 LDKnativeMultiThreadedLockableScore *inner;
19422 * Indicates that this is the only struct which contains the same pointer.
19423 * Rust functions which take ownership of an object provided via an argument require
19424 * this to be true and invalidate the object pointed to by inner.
19427 } LDKMultiThreadedLockableScore;
19432 * A locked `MultiThreadedLockableScore`.
19434 typedef struct MUST_USE_STRUCT LDKMultiThreadedScoreLockRead {
19436 * A pointer to the opaque Rust object.
19437 * Nearly everywhere, inner must be non-null, however in places where
19438 * the Rust equivalent takes an Option, it may be set to null to indicate None.
19440 LDKnativeMultiThreadedScoreLockRead *inner;
19442 * Indicates that this is the only struct which contains the same pointer.
19443 * Rust functions which take ownership of an object provided via an argument require
19444 * this to be true and invalidate the object pointed to by inner.
19447 } LDKMultiThreadedScoreLockRead;
19452 * A locked `MultiThreadedLockableScore`.
19454 typedef struct MUST_USE_STRUCT LDKMultiThreadedScoreLockWrite {
19456 * A pointer to the opaque Rust object.
19457 * Nearly everywhere, inner must be non-null, however in places where
19458 * the Rust equivalent takes an Option, it may be set to null to indicate None.
19460 LDKnativeMultiThreadedScoreLockWrite *inner;
19462 * Indicates that this is the only struct which contains the same pointer.
19463 * Rust functions which take ownership of an object provided via an argument require
19464 * this to be true and invalidate the object pointed to by inner.
19467 } LDKMultiThreadedScoreLockWrite;
19472 * Parameters for configuring [`ProbabilisticScorer`].
19474 * Used to configure decay parameters that are static throughout the lifetime of the scorer.
19475 * these decay parameters affect the score of the channel penalty and are not changed on a
19476 * per-route penalty cost call.
19478 typedef struct MUST_USE_STRUCT LDKProbabilisticScoringDecayParameters {
19480 * A pointer to the opaque Rust object.
19481 * Nearly everywhere, inner must be non-null, however in places where
19482 * the Rust equivalent takes an Option, it may be set to null to indicate None.
19484 LDKnativeProbabilisticScoringDecayParameters *inner;
19486 * Indicates that this is the only struct which contains the same pointer.
19487 * Rust functions which take ownership of an object provided via an argument require
19488 * this to be true and invalidate the object pointed to by inner.
19491 } LDKProbabilisticScoringDecayParameters;
19496 * Simple implementation of [`EntropySource`], [`NodeSigner`], and [`SignerProvider`] that takes a
19497 * 32-byte seed for use as a BIP 32 extended key and derives keys from that.
19499 * Your `node_id` is seed/0'.
19500 * Unilateral closes may use seed/1'.
19501 * Cooperative closes may use seed/2'.
19502 * The two close keys may be needed to claim on-chain funds!
19504 * This struct cannot be used for nodes that wish to support receiving phantom payments;
19505 * [`PhantomKeysManager`] must be used instead.
19507 * Note that switching between this struct and [`PhantomKeysManager`] will invalidate any
19508 * previously issued invoices and attempts to pay previous invoices will fail.
19510 typedef struct MUST_USE_STRUCT LDKKeysManager {
19512 * A pointer to the opaque Rust object.
19513 * Nearly everywhere, inner must be non-null, however in places where
19514 * the Rust equivalent takes an Option, it may be set to null to indicate None.
19516 LDKnativeKeysManager *inner;
19518 * Indicates that this is the only struct which contains the same pointer.
19519 * Rust functions which take ownership of an object provided via an argument require
19520 * this to be true and invalidate the object pointed to by inner.
19528 * Similar to [`KeysManager`], but allows the node using this struct to receive phantom node
19531 * A phantom node payment is a payment made to a phantom invoice, which is an invoice that can be
19532 * paid to one of multiple nodes. This works because we encode the invoice route hints such that
19533 * LDK will recognize an incoming payment as destined for a phantom node, and collect the payment
19534 * itself without ever needing to forward to this fake node.
19536 * Phantom node payments are useful for load balancing between multiple LDK nodes. They also
19537 * provide some fault tolerance, because payers will automatically retry paying other provided
19538 * nodes in the case that one node goes down.
19540 * Note that multi-path payments are not supported in phantom invoices for security reasons.
19541 * Switching between this struct and [`KeysManager`] will invalidate any previously issued
19542 * invoices and attempts to pay previous invoices will fail.
19544 typedef struct MUST_USE_STRUCT LDKPhantomKeysManager {
19546 * A pointer to the opaque Rust object.
19547 * Nearly everywhere, inner must be non-null, however in places where
19548 * the Rust equivalent takes an Option, it may be set to null to indicate None.
19550 LDKnativePhantomKeysManager *inner;
19552 * Indicates that this is the only struct which contains the same pointer.
19553 * Rust functions which take ownership of an object provided via an argument require
19554 * this to be true and invalidate the object pointed to by inner.
19557 } LDKPhantomKeysManager;
19560 * The destination of an onion message.
19562 typedef enum LDKDestination_Tag {
19564 * We're sending this onion message to a node.
19566 LDKDestination_Node,
19568 * We're sending this onion message to a blinded path.
19570 LDKDestination_BlindedPath,
19572 * Must be last for serialization purposes
19574 LDKDestination_Sentinel,
19575 } LDKDestination_Tag;
19577 typedef struct MUST_USE_STRUCT LDKDestination {
19578 LDKDestination_Tag tag;
19581 struct LDKPublicKey node;
19584 struct LDKBlindedPath blinded_path;
19590 * A trait defining behavior for routing an [`OnionMessage`].
19592 * [`OnionMessage`]: msgs::OnionMessage
19594 typedef struct LDKMessageRouter {
19596 * An opaque pointer which is passed to your function implementations as an argument.
19597 * This has no meaning in the LDK, and can be NULL or any other value.
19601 * Returns a route for sending an [`OnionMessage`] to the given [`Destination`].
19603 * [`OnionMessage`]: msgs::OnionMessage
19605 struct LDKCResult_OnionMessagePathNoneZ (*find_path)(const void *this_arg, struct LDKPublicKey sender, struct LDKCVec_PublicKeyZ peers, struct LDKDestination destination);
19607 * Frees any resources associated with this object given its this_arg pointer.
19608 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
19610 void (*free)(void *this_arg);
19611 } LDKMessageRouter;
19616 * A sender, receiver and forwarder of onion messages. In upcoming releases, this object will be
19617 * used to retrieve invoices and fulfill invoice requests from [offers]. Currently, only sending
19618 * and receiving custom onion messages is supported.
19623 * # extern crate bitcoin;
19624 * # use bitcoin::hashes::_export::_core::time::Duration;
19625 * # use bitcoin::secp256k1::{PublicKey, Secp256k1, SecretKey};
19626 * # use lightning::blinded_path::BlindedPath;
19627 * # use lightning::sign::KeysManager;
19628 * # use lightning::ln::peer_handler::IgnoringMessageHandler;
19629 * # use lightning::onion_message::messenger::{Destination, MessageRouter, OnionMessenger, OnionMessagePath};
19630 * # use lightning::onion_message::packet::{CustomOnionMessageContents, OnionMessageContents};
19631 * # use lightning::util::logger::{Logger, Record};
19632 * # use lightning::util::ser::{Writeable, Writer};
19633 * # use lightning::io;
19634 * # use std::sync::Arc;
19635 * # struct FakeLogger;
19636 * # impl Logger for FakeLogger {
19637 * # fn log(&self, record: &Record) { unimplemented!() }
19639 * # struct FakeMessageRouter {}
19640 * # impl MessageRouter for FakeMessageRouter {
19641 * # fn find_path(&self, sender: PublicKey, peers: Vec<PublicKey>, destination: Destination) -> Result<OnionMessagePath, ()> {
19642 * # unimplemented!()
19645 * # let seed = [42u8; 32];
19646 * # let time = Duration::from_secs(123456);
19647 * # let keys_manager = KeysManager::new(&seed, time.as_secs(), time.subsec_nanos());
19648 * # let logger = Arc::new(FakeLogger {});
19649 * # let node_secret = SecretKey::from_slice(&hex::decode(\"0101010101010101010101010101010101010101010101010101010101010101\").unwrap()[..]).unwrap();
19650 * # let secp_ctx = Secp256k1::new();
19651 * # let hop_node_id1 = PublicKey::from_secret_key(&secp_ctx, &node_secret);
19652 * # let (hop_node_id2, hop_node_id3, hop_node_id4) = (hop_node_id1, hop_node_id1, hop_node_id1);
19653 * # let destination_node_id = hop_node_id1;
19654 * # let message_router = Arc::new(FakeMessageRouter {});
19655 * # let custom_message_handler = IgnoringMessageHandler {};
19656 * # let offers_message_handler = IgnoringMessageHandler {};
19657 * // Create the onion messenger. This must use the same `keys_manager` as is passed to your
19658 * // ChannelManager.
19659 * let onion_messenger = OnionMessenger::new(
19660 * &keys_manager, &keys_manager, logger, message_router, &offers_message_handler,
19661 * &custom_message_handler
19664 * # #[derive(Clone)]
19665 * # struct YourCustomMessage {}
19666 * impl Writeable for YourCustomMessage {
19667 * \tfn write<W: Writer>(&self, w: &mut W) -> Result<(), io::Error> {
19669 * \t\t// Write your custom onion message to `w`
19672 * impl CustomOnionMessageContents for YourCustomMessage {
19673 * \tfn tlv_type(&self) -> u64 {
19674 * \t\t# let your_custom_message_type = 42;
19675 * \t\tyour_custom_message_type
19678 * // Send a custom onion message to a node id.
19679 * let path = OnionMessagePath {
19680 * \tintermediate_nodes: vec![hop_node_id1, hop_node_id2],
19681 * \tdestination: Destination::Node(destination_node_id),
19683 * let reply_path = None;
19684 * # let your_custom_message = YourCustomMessage {};
19685 * let message = OnionMessageContents::Custom(your_custom_message);
19686 * onion_messenger.send_onion_message(path, message, reply_path);
19688 * // Create a blinded path to yourself, for someone to send an onion message to.
19689 * # let your_node_id = hop_node_id1;
19690 * let hops = [hop_node_id3, hop_node_id4, your_node_id];
19691 * let blinded_path = BlindedPath::new_for_message(&hops, &keys_manager, &secp_ctx).unwrap();
19693 * // Send a custom onion message to a blinded path.
19694 * let path = OnionMessagePath {
19695 * \tintermediate_nodes: vec![hop_node_id1, hop_node_id2],
19696 * \tdestination: Destination::BlindedPath(blinded_path),
19698 * let reply_path = None;
19699 * # let your_custom_message = YourCustomMessage {};
19700 * let message = OnionMessageContents::Custom(your_custom_message);
19701 * onion_messenger.send_onion_message(path, message, reply_path);
19704 * [offers]: <https://github.com/lightning/bolts/pull/798>
19705 * [`OnionMessenger`]: crate::onion_message::OnionMessenger
19707 typedef struct MUST_USE_STRUCT LDKOnionMessenger {
19709 * A pointer to the opaque Rust object.
19710 * Nearly everywhere, inner must be non-null, however in places where
19711 * the Rust equivalent takes an Option, it may be set to null to indicate None.
19713 LDKnativeOnionMessenger *inner;
19715 * Indicates that this is the only struct which contains the same pointer.
19716 * Rust functions which take ownership of an object provided via an argument require
19717 * this to be true and invalidate the object pointed to by inner.
19720 } LDKOnionMessenger;
19725 * A [`MessageRouter`] that always fails.
19727 typedef struct MUST_USE_STRUCT LDKDefaultMessageRouter {
19729 * A pointer to the opaque Rust object.
19730 * Nearly everywhere, inner must be non-null, however in places where
19731 * the Rust equivalent takes an Option, it may be set to null to indicate None.
19733 LDKnativeDefaultMessageRouter *inner;
19735 * Indicates that this is the only struct which contains the same pointer.
19736 * Rust functions which take ownership of an object provided via an argument require
19737 * this to be true and invalidate the object pointed to by inner.
19740 } LDKDefaultMessageRouter;
19743 * The contents of an onion message. In the context of offers, this would be the invoice, invoice
19744 * request, or invoice error.
19746 typedef enum LDKOnionMessageContents_Tag {
19748 * A message related to BOLT 12 Offers.
19750 LDKOnionMessageContents_Offers,
19752 * A custom onion message specified by the user.
19754 LDKOnionMessageContents_Custom,
19756 * Must be last for serialization purposes
19758 LDKOnionMessageContents_Sentinel,
19759 } LDKOnionMessageContents_Tag;
19761 typedef struct MUST_USE_STRUCT LDKOnionMessageContents {
19762 LDKOnionMessageContents_Tag tag;
19765 struct LDKOffersMessage offers;
19768 struct LDKCustomOnionMessageContents custom;
19771 } LDKOnionMessageContents;
19776 * An intermediate node, its outbound channel, and relay parameters.
19778 typedef struct MUST_USE_STRUCT LDKForwardNode {
19780 * A pointer to the opaque Rust object.
19781 * Nearly everywhere, inner must be non-null, however in places where
19782 * the Rust equivalent takes an Option, it may be set to null to indicate None.
19784 LDKnativeForwardNode *inner;
19786 * Indicates that this is the only struct which contains the same pointer.
19787 * Rust functions which take ownership of an object provided via an argument require
19788 * this to be true and invalidate the object pointed to by inner.
19796 * Data to construct a [`BlindedHop`] for forwarding a payment.
19798 typedef struct MUST_USE_STRUCT LDKForwardTlvs {
19800 * A pointer to the opaque Rust object.
19801 * Nearly everywhere, inner must be non-null, however in places where
19802 * the Rust equivalent takes an Option, it may be set to null to indicate None.
19804 LDKnativeForwardTlvs *inner;
19806 * Indicates that this is the only struct which contains the same pointer.
19807 * Rust functions which take ownership of an object provided via an argument require
19808 * this to be true and invalidate the object pointed to by inner.
19814 * An abstraction over a bitcoin wallet that can perform coin selection over a set of UTXOs and can
19815 * sign for them. The coin selection method aims to mimic Bitcoin Core's `fundrawtransaction` RPC,
19816 * which most wallets should be able to satisfy. Otherwise, consider implementing [`WalletSource`],
19817 * which can provide a default implementation of this trait when used with [`Wallet`].
19819 typedef struct LDKCoinSelectionSource {
19821 * An opaque pointer which is passed to your function implementations as an argument.
19822 * This has no meaning in the LDK, and can be NULL or any other value.
19826 * Performs coin selection of a set of UTXOs, with at least 1 confirmation each, that are
19827 * available to spend. Implementations are free to pick their coin selection algorithm of
19828 * choice, as long as the following requirements are met:
19830 * 1. `must_spend` contains a set of [`Input`]s that must be included in the transaction
19831 * throughout coin selection, but must not be returned as part of the result.
19832 * 2. `must_pay_to` contains a set of [`TxOut`]s that must be included in the transaction
19833 * throughout coin selection. In some cases, like when funding an anchor transaction, this
19834 * set is empty. Implementations should ensure they handle this correctly on their end,
19835 * e.g., Bitcoin Core's `fundrawtransaction` RPC requires at least one output to be
19836 * provided, in which case a zero-value empty OP_RETURN output can be used instead.
19837 * 3. Enough inputs must be selected/contributed for the resulting transaction (including the
19838 * inputs and outputs noted above) to meet `target_feerate_sat_per_1000_weight`.
19840 * Implementations must take note that [`Input::satisfaction_weight`] only tracks the weight of
19841 * the input's `script_sig` and `witness`. Some wallets, like Bitcoin Core's, may require
19842 * providing the full input weight. Failing to do so may lead to underestimating fee bumps and
19843 * delaying block inclusion.
19845 * The `claim_id` must map to the set of external UTXOs assigned to the claim, such that they
19846 * can be re-used within new fee-bumped iterations of the original claiming transaction,
19847 * ensuring that claims don't double spend each other. If a specific `claim_id` has never had a
19848 * transaction associated with it, and all of the available UTXOs have already been assigned to
19849 * other claims, implementations must be willing to double spend their UTXOs. The choice of
19850 * which UTXOs to double spend is left to the implementation, but it must strive to keep the
19851 * set of other claims being double spent to a minimum.
19853 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);
19855 * Signs and provides the full witness for all inputs within the transaction known to the
19856 * trait (i.e., any provided via [`CoinSelectionSource::select_confirmed_utxos`]).
19858 struct LDKCResult_TransactionNoneZ (*sign_tx)(const void *this_arg, struct LDKTransaction tx);
19860 * Frees any resources associated with this object given its this_arg pointer.
19861 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
19863 void (*free)(void *this_arg);
19864 } LDKCoinSelectionSource;
19867 * An alternative to [`CoinSelectionSource`] that can be implemented and used along [`Wallet`] to
19868 * provide a default implementation to [`CoinSelectionSource`].
19870 typedef struct LDKWalletSource {
19872 * An opaque pointer which is passed to your function implementations as an argument.
19873 * This has no meaning in the LDK, and can be NULL or any other value.
19877 * Returns all UTXOs, with at least 1 confirmation each, that are available to spend.
19879 struct LDKCResult_CVec_UtxoZNoneZ (*list_confirmed_utxos)(const void *this_arg);
19881 * Returns a script to use for change above dust resulting from a successful coin selection
19884 struct LDKCResult_CVec_u8ZNoneZ (*get_change_script)(const void *this_arg);
19886 * Signs and provides the full [`TxIn::script_sig`] and [`TxIn::witness`] for all inputs within
19887 * the transaction known to the wallet (i.e., any provided via
19888 * [`WalletSource::list_confirmed_utxos`]).
19890 struct LDKCResult_TransactionNoneZ (*sign_tx)(const void *this_arg, struct LDKTransaction tx);
19892 * Frees any resources associated with this object given its this_arg pointer.
19893 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
19895 void (*free)(void *this_arg);
19901 * A wrapper over [`WalletSource`] that implements [`CoinSelection`] by preferring UTXOs that would
19902 * avoid conflicting double spends. If not enough UTXOs are available to do so, conflicting double
19903 * spends may happen.
19905 typedef struct MUST_USE_STRUCT LDKWallet {
19907 * A pointer to the opaque Rust object.
19908 * Nearly everywhere, inner must be non-null, however in places where
19909 * the Rust equivalent takes an Option, it may be set to null to indicate None.
19911 LDKnativeWallet *inner;
19913 * Indicates that this is the only struct which contains the same pointer.
19914 * Rust functions which take ownership of an object provided via an argument require
19915 * this to be true and invalidate the object pointed to by inner.
19923 * A handler for [`Event::BumpTransaction`] events that sources confirmed UTXOs from a
19924 * [`CoinSelectionSource`] to fee bump transactions via Child-Pays-For-Parent (CPFP) or
19925 * Replace-By-Fee (RBF).
19927 * [`Event::BumpTransaction`]: crate::events::Event::BumpTransaction
19929 typedef struct MUST_USE_STRUCT LDKBumpTransactionEventHandler {
19931 * A pointer to the opaque Rust object.
19932 * Nearly everywhere, inner must be non-null, however in places where
19933 * the Rust equivalent takes an Option, it may be set to null to indicate None.
19935 LDKnativeBumpTransactionEventHandler *inner;
19937 * Indicates that this is the only struct which contains the same pointer.
19938 * Rust functions which take ownership of an object provided via an argument require
19939 * this to be true and invalidate the object pointed to by inner.
19942 } LDKBumpTransactionEventHandler;
19947 * A [`KVStore`] implementation that writes to and reads from the file system.
19949 typedef struct MUST_USE_STRUCT LDKFilesystemStore {
19951 * A pointer to the opaque Rust object.
19952 * Nearly everywhere, inner must be non-null, however in places where
19953 * the Rust equivalent takes an Option, it may be set to null to indicate None.
19955 LDKnativeFilesystemStore *inner;
19957 * Indicates that this is the only struct which contains the same pointer.
19958 * Rust functions which take ownership of an object provided via an argument require
19959 * this to be true and invalidate the object pointed to by inner.
19962 } LDKFilesystemStore;
19967 * `BackgroundProcessor` takes care of tasks that (1) need to happen periodically to keep
19968 * Rust-Lightning running properly, and (2) either can or should be run in the background. Its
19969 * responsibilities are:
19970 * * Processing [`Event`]s with a user-provided [`EventHandler`].
19971 * * Monitoring whether the [`ChannelManager`] needs to be re-persisted to disk, and if so,
19972 * writing it to disk/backups by invoking the callback given to it at startup.
19973 * [`ChannelManager`] persistence should be done in the background.
19974 * * Calling [`ChannelManager::timer_tick_occurred`], [`ChainMonitor::rebroadcast_pending_claims`]
19975 * and [`PeerManager::timer_tick_occurred`] at the appropriate intervals.
19976 * * Calling [`NetworkGraph::remove_stale_channels_and_tracking`] (if a [`GossipSync`] with a
19977 * [`NetworkGraph`] is provided to [`BackgroundProcessor::start`]).
19979 * It will also call [`PeerManager::process_events`] periodically though this shouldn't be relied
19980 * upon as doing so may result in high latency.
19984 * If [`ChannelManager`] persistence fails and the persisted manager becomes out-of-date, then
19985 * there is a risk of channels force-closing on startup when the manager realizes it's outdated.
19986 * However, as long as [`ChannelMonitor`] backups are sound, no funds besides those used for
19987 * unilateral chain closure fees are at risk.
19989 * [`ChannelMonitor`]: lightning::chain::channelmonitor::ChannelMonitor
19990 * [`Event`]: lightning::events::Event
19991 * [`PeerManager::timer_tick_occurred`]: lightning::ln::peer_handler::PeerManager::timer_tick_occurred
19992 * [`PeerManager::process_events`]: lightning::ln::peer_handler::PeerManager::process_events
19993 *BackgroundProcessor will immediately stop on drop. It should be stored until shutdown.
19995 typedef struct MUST_USE_STRUCT LDKBackgroundProcessor {
19997 * A pointer to the opaque Rust object.
19998 * Nearly everywhere, inner must be non-null, however in places where
19999 * the Rust equivalent takes an Option, it may be set to null to indicate None.
20001 LDKnativeBackgroundProcessor *inner;
20003 * Indicates that this is the only struct which contains the same pointer.
20004 * Rust functions which take ownership of an object provided via an argument require
20005 * this to be true and invalidate the object pointed to by inner.
20008 } LDKBackgroundProcessor;
20013 * The main Rapid Gossip Sync object.
20015 * See [crate-level documentation] for usage.
20017 * [crate-level documentation]: crate
20019 typedef struct MUST_USE_STRUCT LDKRapidGossipSync {
20021 * A pointer to the opaque Rust object.
20022 * Nearly everywhere, inner must be non-null, however in places where
20023 * the Rust equivalent takes an Option, it may be set to null to indicate None.
20025 LDKnativeRapidGossipSync *inner;
20027 * Indicates that this is the only struct which contains the same pointer.
20028 * Rust functions which take ownership of an object provided via an argument require
20029 * this to be true and invalidate the object pointed to by inner.
20032 } LDKRapidGossipSync;
20035 * Either [`P2PGossipSync`] or [`RapidGossipSync`].
20037 typedef enum LDKGossipSync_Tag {
20039 * Gossip sync via the lightning peer-to-peer network as defined by BOLT 7.
20043 * Rapid gossip sync from a trusted server.
20045 LDKGossipSync_Rapid,
20049 LDKGossipSync_None,
20051 * Must be last for serialization purposes
20053 LDKGossipSync_Sentinel,
20054 } LDKGossipSync_Tag;
20056 typedef struct MUST_USE_STRUCT LDKGossipSync {
20057 LDKGossipSync_Tag tag;
20061 * Note that this field is expected to be a reference.
20063 struct LDKP2PGossipSync p2p;
20067 * Note that this field is expected to be a reference.
20069 struct LDKRapidGossipSync rapid;
20077 * Data of the [`RawBolt11Invoice`] that is encoded in the data part
20079 typedef struct MUST_USE_STRUCT LDKRawDataPart {
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 LDKnativeRawDataPart *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.
20099 typedef struct MUST_USE_STRUCT LDKSha256 {
20101 * A pointer to the opaque Rust object.
20102 * Nearly everywhere, inner must be non-null, however in places where
20103 * the Rust equivalent takes an Option, it may be set to null to indicate None.
20105 LDKnativeSha256 *inner;
20107 * Indicates that this is the only struct which contains the same pointer.
20108 * Rust functions which take ownership of an object provided via an argument require
20109 * this to be true and invalidate the object pointed to by inner.
20117 * Positive duration that defines when (relatively to the timestamp) in the future the invoice
20120 typedef struct MUST_USE_STRUCT LDKExpiryTime {
20122 * A pointer to the opaque Rust object.
20123 * Nearly everywhere, inner must be non-null, however in places where
20124 * the Rust equivalent takes an Option, it may be set to null to indicate None.
20126 LDKnativeExpiryTime *inner;
20128 * Indicates that this is the only struct which contains the same pointer.
20129 * Rust functions which take ownership of an object provided via an argument require
20130 * this to be true and invalidate the object pointed to by inner.
20138 * `min_final_cltv_expiry_delta` to use for the last HTLC in the route
20140 typedef struct MUST_USE_STRUCT LDKMinFinalCltvExpiryDelta {
20142 * A pointer to the opaque Rust object.
20143 * Nearly everywhere, inner must be non-null, however in places where
20144 * the Rust equivalent takes an Option, it may be set to null to indicate None.
20146 LDKnativeMinFinalCltvExpiryDelta *inner;
20148 * Indicates that this is the only struct which contains the same pointer.
20149 * Rust functions which take ownership of an object provided via an argument require
20150 * this to be true and invalidate the object pointed to by inner.
20153 } LDKMinFinalCltvExpiryDelta;
20156 * A 20-byte byte array.
20158 typedef struct LDKTwentyBytes {
20166 * Fallback address in case no LN payment is possible
20168 typedef enum LDKFallback_Tag {
20169 LDKFallback_SegWitProgram,
20170 LDKFallback_PubKeyHash,
20171 LDKFallback_ScriptHash,
20173 * Must be last for serialization purposes
20175 LDKFallback_Sentinel,
20178 typedef struct LDKFallback_LDKSegWitProgram_Body {
20179 struct LDKWitnessVersion version;
20180 struct LDKCVec_u8Z program;
20181 } LDKFallback_LDKSegWitProgram_Body;
20183 typedef struct MUST_USE_STRUCT LDKFallback {
20184 LDKFallback_Tag tag;
20186 LDKFallback_LDKSegWitProgram_Body seg_wit_program;
20188 struct LDKTwentyBytes pub_key_hash;
20191 struct LDKTwentyBytes script_hash;
20196 extern const uintptr_t MAX_BUF_SIZE;
20198 extern const uintptr_t KVSTORE_NAMESPACE_KEY_MAX_LEN;
20200 extern const uint64_t MIN_RELAY_FEE_SAT_PER_1000_WEIGHT;
20202 extern const uint32_t FEERATE_FLOOR_SATS_PER_KW;
20204 extern const uint64_t CLOSED_CHANNEL_UPDATE_ID;
20206 extern const uint32_t ANTI_REORG_DELAY;
20208 extern const uint16_t BREAKDOWN_TIMEOUT;
20210 extern const uint16_t MIN_CLTV_EXPIRY_DELTA;
20212 extern const uint16_t MIN_FINAL_CLTV_EXPIRY_DELTA;
20214 extern const uint16_t MAX_HTLCS;
20216 extern const uintptr_t OFFERED_HTLC_SCRIPT_WEIGHT;
20218 extern const uintptr_t OFFERED_HTLC_SCRIPT_WEIGHT_ANCHORS;
20220 extern const uintptr_t MAX_ACCEPTED_HTLC_SCRIPT_WEIGHT;
20222 extern const uint64_t ANCHOR_INPUT_WITNESS_WEIGHT;
20224 extern const uint64_t HTLC_TIMEOUT_INPUT_ANCHOR_WITNESS_WEIGHT;
20226 extern const uint64_t HTLC_SUCCESS_INPUT_ANCHOR_WITNESS_WEIGHT;
20228 extern const uintptr_t REVOKEABLE_REDEEMSCRIPT_MAX_LENGTH;
20230 extern const uint64_t UNKNOWN_CHANNEL_CAPACITY_MSAT;
20232 extern const uint32_t DEFAULT_MAX_TOTAL_CLTV_EXPIRY_DELTA;
20234 extern const uint8_t DEFAULT_MAX_PATH_COUNT;
20236 extern const uint64_t MAX_TIMESTAMP;
20238 extern const uint64_t DEFAULT_EXPIRY_TIME;
20240 extern const uint64_t DEFAULT_MIN_FINAL_CLTV_EXPIRY_DELTA;
20242 extern const uint8_t TAG_PAYMENT_HASH;
20244 extern const uint8_t TAG_DESCRIPTION;
20246 extern const uint8_t TAG_PAYEE_PUB_KEY;
20248 extern const uint8_t TAG_DESCRIPTION_HASH;
20250 extern const uint8_t TAG_EXPIRY_TIME;
20252 extern const uint8_t TAG_MIN_FINAL_CLTV_EXPIRY_DELTA;
20254 extern const uint8_t TAG_FALLBACK;
20256 extern const uint8_t TAG_PRIVATE_ROUTE;
20258 extern const uint8_t TAG_PAYMENT_SECRET;
20260 extern const uint8_t TAG_PAYMENT_METADATA;
20262 extern const uint8_t TAG_FEATURES;
20264 struct LDKStr _ldk_get_compiled_version(void);
20266 struct LDKStr _ldk_c_bindings_get_compiled_version(void);
20269 * Gets the 128-bit integer, as 16 little-endian bytes
20271 struct LDKSixteenBytes U128_le_bytes(struct LDKU128 val);
20274 * Constructs a new U128 from 16 little-endian bytes
20276 struct LDKU128 U128_new(struct LDKSixteenBytes le_bytes);
20279 * Convenience function for constructing a new BigEndianScalar
20281 struct LDKBigEndianScalar BigEndianScalar_new(struct LDKThirtyTwoBytes big_endian_bytes);
20284 * Creates a new Bech32Error which has the same data as `orig`
20286 struct LDKBech32Error Bech32Error_clone(const struct LDKBech32Error *NONNULL_PTR orig);
20289 * Releases any memory held by the given `Bech32Error` (which is currently none)
20291 void Bech32Error_free(struct LDKBech32Error o);
20294 * Frees the data buffer, if data_is_owned is set and datalen > 0.
20296 void Transaction_free(struct LDKTransaction _res);
20299 * Creates a new Witness which has the same data as `orig` but with a new buffer.
20301 struct LDKWitness Witness_clone(const struct LDKWitness *NONNULL_PTR orig);
20304 * Frees the data pointed to by data
20306 void Witness_free(struct LDKWitness _res);
20309 * Frees the witness and script_sig in a TxIn
20311 void TxIn_free(struct LDKTxIn _res);
20314 * Convenience function for constructing a new TxIn
20316 struct LDKTxIn TxIn_new(struct LDKWitness witness, struct LDKCVec_u8Z script_sig, uint32_t sequence, struct LDKThirtyTwoBytes previous_txid, uint32_t previous_vout);
20319 * Convenience function for constructing a new TxOut
20321 struct LDKTxOut TxOut_new(struct LDKCVec_u8Z script_pubkey, uint64_t value);
20324 * Frees the data pointed to by script_pubkey.
20326 void TxOut_free(struct LDKTxOut _res);
20329 * Creates a new TxOut which has the same data as `orig` but with a new script buffer.
20331 struct LDKTxOut TxOut_clone(const struct LDKTxOut *NONNULL_PTR orig);
20334 * Frees the data buffer, if chars_is_owned is set and len > 0.
20336 void Str_free(struct LDKStr _res);
20338 #if defined(LDK_DEBUG_BUILD)
20340 * This function exists for memory safety testing purposes. It should never be used in production
20343 const void *__unmangle_inner_ptr(const void *ptr);
20347 * Constructs a new COption_u64Z containing a u64
20349 struct LDKCOption_u64Z COption_u64Z_some(uint64_t o);
20352 * Constructs a new COption_u64Z containing nothing
20354 struct LDKCOption_u64Z COption_u64Z_none(void);
20357 * Frees any resources associated with the u64, if we are in the Some state
20359 void COption_u64Z_free(struct LDKCOption_u64Z _res);
20362 * Creates a new COption_u64Z which has the same data as `orig`
20363 * but with all dynamically-allocated buffers duplicated in new buffers.
20365 struct LDKCOption_u64Z COption_u64Z_clone(const struct LDKCOption_u64Z *NONNULL_PTR orig);
20368 * Frees the buffer pointed to by `data` if `datalen` is non-0.
20370 void CVec_BlindedPathZ_free(struct LDKCVec_BlindedPathZ _res);
20373 * Creates a new CResult_RefundBolt12ParseErrorZ in the success state.
20375 struct LDKCResult_RefundBolt12ParseErrorZ CResult_RefundBolt12ParseErrorZ_ok(struct LDKRefund o);
20378 * Creates a new CResult_RefundBolt12ParseErrorZ in the error state.
20380 struct LDKCResult_RefundBolt12ParseErrorZ CResult_RefundBolt12ParseErrorZ_err(struct LDKBolt12ParseError e);
20383 * Checks if the given object is currently in the success state
20385 bool CResult_RefundBolt12ParseErrorZ_is_ok(const struct LDKCResult_RefundBolt12ParseErrorZ *NONNULL_PTR o);
20388 * Frees any resources used by the CResult_RefundBolt12ParseErrorZ.
20390 void CResult_RefundBolt12ParseErrorZ_free(struct LDKCResult_RefundBolt12ParseErrorZ _res);
20393 * Creates a new CResult_RefundBolt12ParseErrorZ which has the same data as `orig`
20394 * but with all dynamically-allocated buffers duplicated in new buffers.
20396 struct LDKCResult_RefundBolt12ParseErrorZ CResult_RefundBolt12ParseErrorZ_clone(const struct LDKCResult_RefundBolt12ParseErrorZ *NONNULL_PTR orig);
20399 * Creates a new CResult_RetryDecodeErrorZ in the success state.
20401 struct LDKCResult_RetryDecodeErrorZ CResult_RetryDecodeErrorZ_ok(struct LDKRetry o);
20404 * Creates a new CResult_RetryDecodeErrorZ in the error state.
20406 struct LDKCResult_RetryDecodeErrorZ CResult_RetryDecodeErrorZ_err(struct LDKDecodeError e);
20409 * Checks if the given object is currently in the success state
20411 bool CResult_RetryDecodeErrorZ_is_ok(const struct LDKCResult_RetryDecodeErrorZ *NONNULL_PTR o);
20414 * Frees any resources used by the CResult_RetryDecodeErrorZ.
20416 void CResult_RetryDecodeErrorZ_free(struct LDKCResult_RetryDecodeErrorZ _res);
20419 * Creates a new CResult_RetryDecodeErrorZ which has the same data as `orig`
20420 * but with all dynamically-allocated buffers duplicated in new buffers.
20422 struct LDKCResult_RetryDecodeErrorZ CResult_RetryDecodeErrorZ_clone(const struct LDKCResult_RetryDecodeErrorZ *NONNULL_PTR orig);
20425 * Creates a new CResult_NoneAPIErrorZ in the success state.
20427 struct LDKCResult_NoneAPIErrorZ CResult_NoneAPIErrorZ_ok(void);
20430 * Creates a new CResult_NoneAPIErrorZ in the error state.
20432 struct LDKCResult_NoneAPIErrorZ CResult_NoneAPIErrorZ_err(struct LDKAPIError e);
20435 * Checks if the given object is currently in the success state
20437 bool CResult_NoneAPIErrorZ_is_ok(const struct LDKCResult_NoneAPIErrorZ *NONNULL_PTR o);
20440 * Frees any resources used by the CResult_NoneAPIErrorZ.
20442 void CResult_NoneAPIErrorZ_free(struct LDKCResult_NoneAPIErrorZ _res);
20445 * Creates a new CResult_NoneAPIErrorZ which has the same data as `orig`
20446 * but with all dynamically-allocated buffers duplicated in new buffers.
20448 struct LDKCResult_NoneAPIErrorZ CResult_NoneAPIErrorZ_clone(const struct LDKCResult_NoneAPIErrorZ *NONNULL_PTR orig);
20451 * Frees the buffer pointed to by `data` if `datalen` is non-0.
20453 void CVec_CResult_NoneAPIErrorZZ_free(struct LDKCVec_CResult_NoneAPIErrorZZ _res);
20456 * Frees the buffer pointed to by `data` if `datalen` is non-0.
20458 void CVec_APIErrorZ_free(struct LDKCVec_APIErrorZ _res);
20461 * Constructs a new COption_ThirtyTwoBytesZ containing a crate::c_types::ThirtyTwoBytes
20463 struct LDKCOption_ThirtyTwoBytesZ COption_ThirtyTwoBytesZ_some(struct LDKThirtyTwoBytes o);
20466 * Constructs a new COption_ThirtyTwoBytesZ containing nothing
20468 struct LDKCOption_ThirtyTwoBytesZ COption_ThirtyTwoBytesZ_none(void);
20471 * Frees any resources associated with the crate::c_types::ThirtyTwoBytes, if we are in the Some state
20473 void COption_ThirtyTwoBytesZ_free(struct LDKCOption_ThirtyTwoBytesZ _res);
20476 * Creates a new COption_ThirtyTwoBytesZ which has the same data as `orig`
20477 * but with all dynamically-allocated buffers duplicated in new buffers.
20479 struct LDKCOption_ThirtyTwoBytesZ COption_ThirtyTwoBytesZ_clone(const struct LDKCOption_ThirtyTwoBytesZ *NONNULL_PTR orig);
20482 * Frees the buffer pointed to by `data` if `datalen` is non-0.
20484 void CVec_u8Z_free(struct LDKCVec_u8Z _res);
20487 * Constructs a new COption_CVec_u8ZZ containing a crate::c_types::derived::CVec_u8Z
20489 struct LDKCOption_CVec_u8ZZ COption_CVec_u8ZZ_some(struct LDKCVec_u8Z o);
20492 * Constructs a new COption_CVec_u8ZZ containing nothing
20494 struct LDKCOption_CVec_u8ZZ COption_CVec_u8ZZ_none(void);
20497 * Frees any resources associated with the crate::c_types::derived::CVec_u8Z, if we are in the Some state
20499 void COption_CVec_u8ZZ_free(struct LDKCOption_CVec_u8ZZ _res);
20502 * Creates a new COption_CVec_u8ZZ which has the same data as `orig`
20503 * but with all dynamically-allocated buffers duplicated in new buffers.
20505 struct LDKCOption_CVec_u8ZZ COption_CVec_u8ZZ_clone(const struct LDKCOption_CVec_u8ZZ *NONNULL_PTR orig);
20508 * Creates a new CResult_RecipientOnionFieldsDecodeErrorZ in the success state.
20510 struct LDKCResult_RecipientOnionFieldsDecodeErrorZ CResult_RecipientOnionFieldsDecodeErrorZ_ok(struct LDKRecipientOnionFields o);
20513 * Creates a new CResult_RecipientOnionFieldsDecodeErrorZ in the error state.
20515 struct LDKCResult_RecipientOnionFieldsDecodeErrorZ CResult_RecipientOnionFieldsDecodeErrorZ_err(struct LDKDecodeError e);
20518 * Checks if the given object is currently in the success state
20520 bool CResult_RecipientOnionFieldsDecodeErrorZ_is_ok(const struct LDKCResult_RecipientOnionFieldsDecodeErrorZ *NONNULL_PTR o);
20523 * Frees any resources used by the CResult_RecipientOnionFieldsDecodeErrorZ.
20525 void CResult_RecipientOnionFieldsDecodeErrorZ_free(struct LDKCResult_RecipientOnionFieldsDecodeErrorZ _res);
20528 * Creates a new CResult_RecipientOnionFieldsDecodeErrorZ which has the same data as `orig`
20529 * but with all dynamically-allocated buffers duplicated in new buffers.
20531 struct LDKCResult_RecipientOnionFieldsDecodeErrorZ CResult_RecipientOnionFieldsDecodeErrorZ_clone(const struct LDKCResult_RecipientOnionFieldsDecodeErrorZ *NONNULL_PTR orig);
20534 * Creates a new tuple which has the same data as `orig`
20535 * but with all dynamically-allocated buffers duplicated in new buffers.
20537 struct LDKC2Tuple_u64CVec_u8ZZ C2Tuple_u64CVec_u8ZZ_clone(const struct LDKC2Tuple_u64CVec_u8ZZ *NONNULL_PTR orig);
20540 * Creates a new C2Tuple_u64CVec_u8ZZ from the contained elements.
20542 struct LDKC2Tuple_u64CVec_u8ZZ C2Tuple_u64CVec_u8ZZ_new(uint64_t a, struct LDKCVec_u8Z b);
20545 * Frees any resources used by the C2Tuple_u64CVec_u8ZZ.
20547 void C2Tuple_u64CVec_u8ZZ_free(struct LDKC2Tuple_u64CVec_u8ZZ _res);
20550 * Frees the buffer pointed to by `data` if `datalen` is non-0.
20552 void CVec_C2Tuple_u64CVec_u8ZZZ_free(struct LDKCVec_C2Tuple_u64CVec_u8ZZZ _res);
20555 * Creates a new CResult_RecipientOnionFieldsNoneZ in the success state.
20557 struct LDKCResult_RecipientOnionFieldsNoneZ CResult_RecipientOnionFieldsNoneZ_ok(struct LDKRecipientOnionFields o);
20560 * Creates a new CResult_RecipientOnionFieldsNoneZ in the error state.
20562 struct LDKCResult_RecipientOnionFieldsNoneZ CResult_RecipientOnionFieldsNoneZ_err(void);
20565 * Checks if the given object is currently in the success state
20567 bool CResult_RecipientOnionFieldsNoneZ_is_ok(const struct LDKCResult_RecipientOnionFieldsNoneZ *NONNULL_PTR o);
20570 * Frees any resources used by the CResult_RecipientOnionFieldsNoneZ.
20572 void CResult_RecipientOnionFieldsNoneZ_free(struct LDKCResult_RecipientOnionFieldsNoneZ _res);
20575 * Creates a new CResult_RecipientOnionFieldsNoneZ which has the same data as `orig`
20576 * but with all dynamically-allocated buffers duplicated in new buffers.
20578 struct LDKCResult_RecipientOnionFieldsNoneZ CResult_RecipientOnionFieldsNoneZ_clone(const struct LDKCResult_RecipientOnionFieldsNoneZ *NONNULL_PTR orig);
20581 * Frees the buffer pointed to by `data` if `datalen` is non-0.
20583 void CVec_ThirtyTwoBytesZ_free(struct LDKCVec_ThirtyTwoBytesZ _res);
20586 * Constructs a new COption_CVec_ThirtyTwoBytesZZ containing a crate::c_types::derived::CVec_ThirtyTwoBytesZ
20588 struct LDKCOption_CVec_ThirtyTwoBytesZZ COption_CVec_ThirtyTwoBytesZZ_some(struct LDKCVec_ThirtyTwoBytesZ o);
20591 * Constructs a new COption_CVec_ThirtyTwoBytesZZ containing nothing
20593 struct LDKCOption_CVec_ThirtyTwoBytesZZ COption_CVec_ThirtyTwoBytesZZ_none(void);
20596 * Frees any resources associated with the crate::c_types::derived::CVec_ThirtyTwoBytesZ, if we are in the Some state
20598 void COption_CVec_ThirtyTwoBytesZZ_free(struct LDKCOption_CVec_ThirtyTwoBytesZZ _res);
20601 * Creates a new COption_CVec_ThirtyTwoBytesZZ which has the same data as `orig`
20602 * but with all dynamically-allocated buffers duplicated in new buffers.
20604 struct LDKCOption_CVec_ThirtyTwoBytesZZ COption_CVec_ThirtyTwoBytesZZ_clone(const struct LDKCOption_CVec_ThirtyTwoBytesZZ *NONNULL_PTR orig);
20607 * Creates a new CResult_ThirtyTwoBytesNoneZ in the success state.
20609 struct LDKCResult_ThirtyTwoBytesNoneZ CResult_ThirtyTwoBytesNoneZ_ok(struct LDKThirtyTwoBytes o);
20612 * Creates a new CResult_ThirtyTwoBytesNoneZ in the error state.
20614 struct LDKCResult_ThirtyTwoBytesNoneZ CResult_ThirtyTwoBytesNoneZ_err(void);
20617 * Checks if the given object is currently in the success state
20619 bool CResult_ThirtyTwoBytesNoneZ_is_ok(const struct LDKCResult_ThirtyTwoBytesNoneZ *NONNULL_PTR o);
20622 * Frees any resources used by the CResult_ThirtyTwoBytesNoneZ.
20624 void CResult_ThirtyTwoBytesNoneZ_free(struct LDKCResult_ThirtyTwoBytesNoneZ _res);
20627 * Creates a new CResult_ThirtyTwoBytesNoneZ which has the same data as `orig`
20628 * but with all dynamically-allocated buffers duplicated in new buffers.
20630 struct LDKCResult_ThirtyTwoBytesNoneZ CResult_ThirtyTwoBytesNoneZ_clone(const struct LDKCResult_ThirtyTwoBytesNoneZ *NONNULL_PTR orig);
20633 * Creates a new CResult_BlindedPayInfoDecodeErrorZ in the success state.
20635 struct LDKCResult_BlindedPayInfoDecodeErrorZ CResult_BlindedPayInfoDecodeErrorZ_ok(struct LDKBlindedPayInfo o);
20638 * Creates a new CResult_BlindedPayInfoDecodeErrorZ in the error state.
20640 struct LDKCResult_BlindedPayInfoDecodeErrorZ CResult_BlindedPayInfoDecodeErrorZ_err(struct LDKDecodeError e);
20643 * Checks if the given object is currently in the success state
20645 bool CResult_BlindedPayInfoDecodeErrorZ_is_ok(const struct LDKCResult_BlindedPayInfoDecodeErrorZ *NONNULL_PTR o);
20648 * Frees any resources used by the CResult_BlindedPayInfoDecodeErrorZ.
20650 void CResult_BlindedPayInfoDecodeErrorZ_free(struct LDKCResult_BlindedPayInfoDecodeErrorZ _res);
20653 * Creates a new CResult_BlindedPayInfoDecodeErrorZ which has the same data as `orig`
20654 * but with all dynamically-allocated buffers duplicated in new buffers.
20656 struct LDKCResult_BlindedPayInfoDecodeErrorZ CResult_BlindedPayInfoDecodeErrorZ_clone(const struct LDKCResult_BlindedPayInfoDecodeErrorZ *NONNULL_PTR orig);
20659 * Creates a new CResult_DelayedPaymentOutputDescriptorDecodeErrorZ in the success state.
20661 struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_ok(struct LDKDelayedPaymentOutputDescriptor o);
20664 * Creates a new CResult_DelayedPaymentOutputDescriptorDecodeErrorZ in the error state.
20666 struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_err(struct LDKDecodeError e);
20669 * Checks if the given object is currently in the success state
20671 bool CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_is_ok(const struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ *NONNULL_PTR o);
20674 * Frees any resources used by the CResult_DelayedPaymentOutputDescriptorDecodeErrorZ.
20676 void CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_free(struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ _res);
20679 * Creates a new CResult_DelayedPaymentOutputDescriptorDecodeErrorZ which has the same data as `orig`
20680 * but with all dynamically-allocated buffers duplicated in new buffers.
20682 struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_clone(const struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ *NONNULL_PTR orig);
20685 * Creates a new CResult_StaticPaymentOutputDescriptorDecodeErrorZ in the success state.
20687 struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ CResult_StaticPaymentOutputDescriptorDecodeErrorZ_ok(struct LDKStaticPaymentOutputDescriptor o);
20690 * Creates a new CResult_StaticPaymentOutputDescriptorDecodeErrorZ in the error state.
20692 struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ CResult_StaticPaymentOutputDescriptorDecodeErrorZ_err(struct LDKDecodeError e);
20695 * Checks if the given object is currently in the success state
20697 bool CResult_StaticPaymentOutputDescriptorDecodeErrorZ_is_ok(const struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ *NONNULL_PTR o);
20700 * Frees any resources used by the CResult_StaticPaymentOutputDescriptorDecodeErrorZ.
20702 void CResult_StaticPaymentOutputDescriptorDecodeErrorZ_free(struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ _res);
20705 * Creates a new CResult_StaticPaymentOutputDescriptorDecodeErrorZ which has the same data as `orig`
20706 * but with all dynamically-allocated buffers duplicated in new buffers.
20708 struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ CResult_StaticPaymentOutputDescriptorDecodeErrorZ_clone(const struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ *NONNULL_PTR orig);
20711 * Creates a new CResult_SpendableOutputDescriptorDecodeErrorZ in the success state.
20713 struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ CResult_SpendableOutputDescriptorDecodeErrorZ_ok(struct LDKSpendableOutputDescriptor o);
20716 * Creates a new CResult_SpendableOutputDescriptorDecodeErrorZ in the error state.
20718 struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ CResult_SpendableOutputDescriptorDecodeErrorZ_err(struct LDKDecodeError e);
20721 * Checks if the given object is currently in the success state
20723 bool CResult_SpendableOutputDescriptorDecodeErrorZ_is_ok(const struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ *NONNULL_PTR o);
20726 * Frees any resources used by the CResult_SpendableOutputDescriptorDecodeErrorZ.
20728 void CResult_SpendableOutputDescriptorDecodeErrorZ_free(struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ _res);
20731 * Creates a new CResult_SpendableOutputDescriptorDecodeErrorZ which has the same data as `orig`
20732 * but with all dynamically-allocated buffers duplicated in new buffers.
20734 struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ CResult_SpendableOutputDescriptorDecodeErrorZ_clone(const struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ *NONNULL_PTR orig);
20737 * Frees the buffer pointed to by `data` if `datalen` is non-0.
20739 void CVec_SpendableOutputDescriptorZ_free(struct LDKCVec_SpendableOutputDescriptorZ _res);
20742 * Frees the buffer pointed to by `data` if `datalen` is non-0.
20744 void CVec_TxOutZ_free(struct LDKCVec_TxOutZ _res);
20747 * Constructs a new COption_u32Z containing a u32
20749 struct LDKCOption_u32Z COption_u32Z_some(uint32_t o);
20752 * Constructs a new COption_u32Z containing nothing
20754 struct LDKCOption_u32Z COption_u32Z_none(void);
20757 * Frees any resources associated with the u32, if we are in the Some state
20759 void COption_u32Z_free(struct LDKCOption_u32Z _res);
20762 * Creates a new COption_u32Z which has the same data as `orig`
20763 * but with all dynamically-allocated buffers duplicated in new buffers.
20765 struct LDKCOption_u32Z COption_u32Z_clone(const struct LDKCOption_u32Z *NONNULL_PTR orig);
20768 * Creates a new tuple which has the same data as `orig`
20769 * but with all dynamically-allocated buffers duplicated in new buffers.
20771 struct LDKC2Tuple_CVec_u8ZusizeZ C2Tuple_CVec_u8ZusizeZ_clone(const struct LDKC2Tuple_CVec_u8ZusizeZ *NONNULL_PTR orig);
20774 * Creates a new C2Tuple_CVec_u8ZusizeZ from the contained elements.
20776 struct LDKC2Tuple_CVec_u8ZusizeZ C2Tuple_CVec_u8ZusizeZ_new(struct LDKCVec_u8Z a, uintptr_t b);
20779 * Frees any resources used by the C2Tuple_CVec_u8ZusizeZ.
20781 void C2Tuple_CVec_u8ZusizeZ_free(struct LDKC2Tuple_CVec_u8ZusizeZ _res);
20784 * Creates a new CResult_C2Tuple_CVec_u8ZusizeZNoneZ in the success state.
20786 struct LDKCResult_C2Tuple_CVec_u8ZusizeZNoneZ CResult_C2Tuple_CVec_u8ZusizeZNoneZ_ok(struct LDKC2Tuple_CVec_u8ZusizeZ o);
20789 * Creates a new CResult_C2Tuple_CVec_u8ZusizeZNoneZ in the error state.
20791 struct LDKCResult_C2Tuple_CVec_u8ZusizeZNoneZ CResult_C2Tuple_CVec_u8ZusizeZNoneZ_err(void);
20794 * Checks if the given object is currently in the success state
20796 bool CResult_C2Tuple_CVec_u8ZusizeZNoneZ_is_ok(const struct LDKCResult_C2Tuple_CVec_u8ZusizeZNoneZ *NONNULL_PTR o);
20799 * Frees any resources used by the CResult_C2Tuple_CVec_u8ZusizeZNoneZ.
20801 void CResult_C2Tuple_CVec_u8ZusizeZNoneZ_free(struct LDKCResult_C2Tuple_CVec_u8ZusizeZNoneZ _res);
20804 * Creates a new CResult_C2Tuple_CVec_u8ZusizeZNoneZ which has the same data as `orig`
20805 * but with all dynamically-allocated buffers duplicated in new buffers.
20807 struct LDKCResult_C2Tuple_CVec_u8ZusizeZNoneZ CResult_C2Tuple_CVec_u8ZusizeZNoneZ_clone(const struct LDKCResult_C2Tuple_CVec_u8ZusizeZNoneZ *NONNULL_PTR orig);
20810 * Creates a new CResult_NoneNoneZ in the success state.
20812 struct LDKCResult_NoneNoneZ CResult_NoneNoneZ_ok(void);
20815 * Creates a new CResult_NoneNoneZ in the error state.
20817 struct LDKCResult_NoneNoneZ CResult_NoneNoneZ_err(void);
20820 * Checks if the given object is currently in the success state
20822 bool CResult_NoneNoneZ_is_ok(const struct LDKCResult_NoneNoneZ *NONNULL_PTR o);
20825 * Frees any resources used by the CResult_NoneNoneZ.
20827 void CResult_NoneNoneZ_free(struct LDKCResult_NoneNoneZ _res);
20830 * Creates a new CResult_NoneNoneZ which has the same data as `orig`
20831 * but with all dynamically-allocated buffers duplicated in new buffers.
20833 struct LDKCResult_NoneNoneZ CResult_NoneNoneZ_clone(const struct LDKCResult_NoneNoneZ *NONNULL_PTR orig);
20836 * Frees the buffer pointed to by `data` if `datalen` is non-0.
20838 void CVec_ECDSASignatureZ_free(struct LDKCVec_ECDSASignatureZ _res);
20841 * Creates a new tuple which has the same data as `orig`
20842 * but with all dynamically-allocated buffers duplicated in new buffers.
20844 struct LDKC2Tuple_ECDSASignatureCVec_ECDSASignatureZZ C2Tuple_ECDSASignatureCVec_ECDSASignatureZZ_clone(const struct LDKC2Tuple_ECDSASignatureCVec_ECDSASignatureZZ *NONNULL_PTR orig);
20847 * Creates a new C2Tuple_ECDSASignatureCVec_ECDSASignatureZZ from the contained elements.
20849 struct LDKC2Tuple_ECDSASignatureCVec_ECDSASignatureZZ C2Tuple_ECDSASignatureCVec_ECDSASignatureZZ_new(struct LDKECDSASignature a, struct LDKCVec_ECDSASignatureZ b);
20852 * Frees any resources used by the C2Tuple_ECDSASignatureCVec_ECDSASignatureZZ.
20854 void C2Tuple_ECDSASignatureCVec_ECDSASignatureZZ_free(struct LDKC2Tuple_ECDSASignatureCVec_ECDSASignatureZZ _res);
20857 * Creates a new CResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ in the success state.
20859 struct LDKCResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ CResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ_ok(struct LDKC2Tuple_ECDSASignatureCVec_ECDSASignatureZZ o);
20862 * Creates a new CResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ in the error state.
20864 struct LDKCResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ CResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ_err(void);
20867 * Checks if the given object is currently in the success state
20869 bool CResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ_is_ok(const struct LDKCResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ *NONNULL_PTR o);
20872 * Frees any resources used by the CResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ.
20874 void CResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ_free(struct LDKCResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ _res);
20877 * Creates a new CResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ which has the same data as `orig`
20878 * but with all dynamically-allocated buffers duplicated in new buffers.
20880 struct LDKCResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ CResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ_clone(const struct LDKCResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ *NONNULL_PTR orig);
20883 * Creates a new CResult_ECDSASignatureNoneZ in the success state.
20885 struct LDKCResult_ECDSASignatureNoneZ CResult_ECDSASignatureNoneZ_ok(struct LDKECDSASignature o);
20888 * Creates a new CResult_ECDSASignatureNoneZ in the error state.
20890 struct LDKCResult_ECDSASignatureNoneZ CResult_ECDSASignatureNoneZ_err(void);
20893 * Checks if the given object is currently in the success state
20895 bool CResult_ECDSASignatureNoneZ_is_ok(const struct LDKCResult_ECDSASignatureNoneZ *NONNULL_PTR o);
20898 * Frees any resources used by the CResult_ECDSASignatureNoneZ.
20900 void CResult_ECDSASignatureNoneZ_free(struct LDKCResult_ECDSASignatureNoneZ _res);
20903 * Creates a new CResult_ECDSASignatureNoneZ which has the same data as `orig`
20904 * but with all dynamically-allocated buffers duplicated in new buffers.
20906 struct LDKCResult_ECDSASignatureNoneZ CResult_ECDSASignatureNoneZ_clone(const struct LDKCResult_ECDSASignatureNoneZ *NONNULL_PTR orig);
20909 * Creates a new CResult_PublicKeyNoneZ in the success state.
20911 struct LDKCResult_PublicKeyNoneZ CResult_PublicKeyNoneZ_ok(struct LDKPublicKey o);
20914 * Creates a new CResult_PublicKeyNoneZ in the error state.
20916 struct LDKCResult_PublicKeyNoneZ CResult_PublicKeyNoneZ_err(void);
20919 * Checks if the given object is currently in the success state
20921 bool CResult_PublicKeyNoneZ_is_ok(const struct LDKCResult_PublicKeyNoneZ *NONNULL_PTR o);
20924 * Frees any resources used by the CResult_PublicKeyNoneZ.
20926 void CResult_PublicKeyNoneZ_free(struct LDKCResult_PublicKeyNoneZ _res);
20929 * Creates a new CResult_PublicKeyNoneZ which has the same data as `orig`
20930 * but with all dynamically-allocated buffers duplicated in new buffers.
20932 struct LDKCResult_PublicKeyNoneZ CResult_PublicKeyNoneZ_clone(const struct LDKCResult_PublicKeyNoneZ *NONNULL_PTR orig);
20935 * Constructs a new COption_BigEndianScalarZ containing a crate::c_types::BigEndianScalar
20937 struct LDKCOption_BigEndianScalarZ COption_BigEndianScalarZ_some(struct LDKBigEndianScalar o);
20940 * Constructs a new COption_BigEndianScalarZ containing nothing
20942 struct LDKCOption_BigEndianScalarZ COption_BigEndianScalarZ_none(void);
20945 * Frees any resources associated with the crate::c_types::BigEndianScalar, if we are in the Some state
20947 void COption_BigEndianScalarZ_free(struct LDKCOption_BigEndianScalarZ _res);
20950 * Creates a new COption_BigEndianScalarZ which has the same data as `orig`
20951 * but with all dynamically-allocated buffers duplicated in new buffers.
20953 struct LDKCOption_BigEndianScalarZ COption_BigEndianScalarZ_clone(const struct LDKCOption_BigEndianScalarZ *NONNULL_PTR orig);
20956 * Frees the buffer pointed to by `data` if `datalen` is non-0.
20958 void CVec_U5Z_free(struct LDKCVec_U5Z _res);
20961 * Creates a new CResult_RecoverableSignatureNoneZ in the success state.
20963 struct LDKCResult_RecoverableSignatureNoneZ CResult_RecoverableSignatureNoneZ_ok(struct LDKRecoverableSignature o);
20966 * Creates a new CResult_RecoverableSignatureNoneZ in the error state.
20968 struct LDKCResult_RecoverableSignatureNoneZ CResult_RecoverableSignatureNoneZ_err(void);
20971 * Checks if the given object is currently in the success state
20973 bool CResult_RecoverableSignatureNoneZ_is_ok(const struct LDKCResult_RecoverableSignatureNoneZ *NONNULL_PTR o);
20976 * Frees any resources used by the CResult_RecoverableSignatureNoneZ.
20978 void CResult_RecoverableSignatureNoneZ_free(struct LDKCResult_RecoverableSignatureNoneZ _res);
20981 * Creates a new CResult_RecoverableSignatureNoneZ which has the same data as `orig`
20982 * but with all dynamically-allocated buffers duplicated in new buffers.
20984 struct LDKCResult_RecoverableSignatureNoneZ CResult_RecoverableSignatureNoneZ_clone(const struct LDKCResult_RecoverableSignatureNoneZ *NONNULL_PTR orig);
20987 * Creates a new CResult_SchnorrSignatureNoneZ in the success state.
20989 struct LDKCResult_SchnorrSignatureNoneZ CResult_SchnorrSignatureNoneZ_ok(struct LDKSchnorrSignature o);
20992 * Creates a new CResult_SchnorrSignatureNoneZ in the error state.
20994 struct LDKCResult_SchnorrSignatureNoneZ CResult_SchnorrSignatureNoneZ_err(void);
20997 * Checks if the given object is currently in the success state
20999 bool CResult_SchnorrSignatureNoneZ_is_ok(const struct LDKCResult_SchnorrSignatureNoneZ *NONNULL_PTR o);
21002 * Frees any resources used by the CResult_SchnorrSignatureNoneZ.
21004 void CResult_SchnorrSignatureNoneZ_free(struct LDKCResult_SchnorrSignatureNoneZ _res);
21007 * Creates a new CResult_SchnorrSignatureNoneZ which has the same data as `orig`
21008 * but with all dynamically-allocated buffers duplicated in new buffers.
21010 struct LDKCResult_SchnorrSignatureNoneZ CResult_SchnorrSignatureNoneZ_clone(const struct LDKCResult_SchnorrSignatureNoneZ *NONNULL_PTR orig);
21013 * Creates a new CResult_WriteableEcdsaChannelSignerDecodeErrorZ in the success state.
21015 struct LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ CResult_WriteableEcdsaChannelSignerDecodeErrorZ_ok(struct LDKWriteableEcdsaChannelSigner o);
21018 * Creates a new CResult_WriteableEcdsaChannelSignerDecodeErrorZ in the error state.
21020 struct LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ CResult_WriteableEcdsaChannelSignerDecodeErrorZ_err(struct LDKDecodeError e);
21023 * Checks if the given object is currently in the success state
21025 bool CResult_WriteableEcdsaChannelSignerDecodeErrorZ_is_ok(const struct LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ *NONNULL_PTR o);
21028 * Frees any resources used by the CResult_WriteableEcdsaChannelSignerDecodeErrorZ.
21030 void CResult_WriteableEcdsaChannelSignerDecodeErrorZ_free(struct LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ _res);
21033 * Creates a new CResult_WriteableEcdsaChannelSignerDecodeErrorZ which has the same data as `orig`
21034 * but with all dynamically-allocated buffers duplicated in new buffers.
21036 struct LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ CResult_WriteableEcdsaChannelSignerDecodeErrorZ_clone(const struct LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ *NONNULL_PTR orig);
21039 * Creates a new CResult_CVec_u8ZNoneZ in the success state.
21041 struct LDKCResult_CVec_u8ZNoneZ CResult_CVec_u8ZNoneZ_ok(struct LDKCVec_u8Z o);
21044 * Creates a new CResult_CVec_u8ZNoneZ in the error state.
21046 struct LDKCResult_CVec_u8ZNoneZ CResult_CVec_u8ZNoneZ_err(void);
21049 * Checks if the given object is currently in the success state
21051 bool CResult_CVec_u8ZNoneZ_is_ok(const struct LDKCResult_CVec_u8ZNoneZ *NONNULL_PTR o);
21054 * Frees any resources used by the CResult_CVec_u8ZNoneZ.
21056 void CResult_CVec_u8ZNoneZ_free(struct LDKCResult_CVec_u8ZNoneZ _res);
21059 * Creates a new CResult_CVec_u8ZNoneZ which has the same data as `orig`
21060 * but with all dynamically-allocated buffers duplicated in new buffers.
21062 struct LDKCResult_CVec_u8ZNoneZ CResult_CVec_u8ZNoneZ_clone(const struct LDKCResult_CVec_u8ZNoneZ *NONNULL_PTR orig);
21065 * Creates a new CResult_ShutdownScriptNoneZ in the success state.
21067 struct LDKCResult_ShutdownScriptNoneZ CResult_ShutdownScriptNoneZ_ok(struct LDKShutdownScript o);
21070 * Creates a new CResult_ShutdownScriptNoneZ in the error state.
21072 struct LDKCResult_ShutdownScriptNoneZ CResult_ShutdownScriptNoneZ_err(void);
21075 * Checks if the given object is currently in the success state
21077 bool CResult_ShutdownScriptNoneZ_is_ok(const struct LDKCResult_ShutdownScriptNoneZ *NONNULL_PTR o);
21080 * Frees any resources used by the CResult_ShutdownScriptNoneZ.
21082 void CResult_ShutdownScriptNoneZ_free(struct LDKCResult_ShutdownScriptNoneZ _res);
21085 * Creates a new CResult_ShutdownScriptNoneZ which has the same data as `orig`
21086 * but with all dynamically-allocated buffers duplicated in new buffers.
21088 struct LDKCResult_ShutdownScriptNoneZ CResult_ShutdownScriptNoneZ_clone(const struct LDKCResult_ShutdownScriptNoneZ *NONNULL_PTR orig);
21091 * Constructs a new COption_u16Z containing a u16
21093 struct LDKCOption_u16Z COption_u16Z_some(uint16_t o);
21096 * Constructs a new COption_u16Z containing nothing
21098 struct LDKCOption_u16Z COption_u16Z_none(void);
21101 * Frees any resources associated with the u16, if we are in the Some state
21103 void COption_u16Z_free(struct LDKCOption_u16Z _res);
21106 * Creates a new COption_u16Z which has the same data as `orig`
21107 * but with all dynamically-allocated buffers duplicated in new buffers.
21109 struct LDKCOption_u16Z COption_u16Z_clone(const struct LDKCOption_u16Z *NONNULL_PTR orig);
21112 * Constructs a new COption_boolZ containing a bool
21114 struct LDKCOption_boolZ COption_boolZ_some(bool o);
21117 * Constructs a new COption_boolZ containing nothing
21119 struct LDKCOption_boolZ COption_boolZ_none(void);
21122 * Frees any resources associated with the bool, if we are in the Some state
21124 void COption_boolZ_free(struct LDKCOption_boolZ _res);
21127 * Creates a new COption_boolZ which has the same data as `orig`
21128 * but with all dynamically-allocated buffers duplicated in new buffers.
21130 struct LDKCOption_boolZ COption_boolZ_clone(const struct LDKCOption_boolZ *NONNULL_PTR orig);
21133 * Frees the buffer pointed to by `data` if `datalen` is non-0.
21135 void CVec_CVec_u8ZZ_free(struct LDKCVec_CVec_u8ZZ _res);
21138 * Creates a new CResult_CVec_CVec_u8ZZNoneZ in the success state.
21140 struct LDKCResult_CVec_CVec_u8ZZNoneZ CResult_CVec_CVec_u8ZZNoneZ_ok(struct LDKCVec_CVec_u8ZZ o);
21143 * Creates a new CResult_CVec_CVec_u8ZZNoneZ in the error state.
21145 struct LDKCResult_CVec_CVec_u8ZZNoneZ CResult_CVec_CVec_u8ZZNoneZ_err(void);
21148 * Checks if the given object is currently in the success state
21150 bool CResult_CVec_CVec_u8ZZNoneZ_is_ok(const struct LDKCResult_CVec_CVec_u8ZZNoneZ *NONNULL_PTR o);
21153 * Frees any resources used by the CResult_CVec_CVec_u8ZZNoneZ.
21155 void CResult_CVec_CVec_u8ZZNoneZ_free(struct LDKCResult_CVec_CVec_u8ZZNoneZ _res);
21158 * Creates a new CResult_CVec_CVec_u8ZZNoneZ which has the same data as `orig`
21159 * but with all dynamically-allocated buffers duplicated in new buffers.
21161 struct LDKCResult_CVec_CVec_u8ZZNoneZ CResult_CVec_CVec_u8ZZNoneZ_clone(const struct LDKCResult_CVec_CVec_u8ZZNoneZ *NONNULL_PTR orig);
21164 * Creates a new CResult_InMemorySignerDecodeErrorZ in the success state.
21166 struct LDKCResult_InMemorySignerDecodeErrorZ CResult_InMemorySignerDecodeErrorZ_ok(struct LDKInMemorySigner o);
21169 * Creates a new CResult_InMemorySignerDecodeErrorZ in the error state.
21171 struct LDKCResult_InMemorySignerDecodeErrorZ CResult_InMemorySignerDecodeErrorZ_err(struct LDKDecodeError e);
21174 * Checks if the given object is currently in the success state
21176 bool CResult_InMemorySignerDecodeErrorZ_is_ok(const struct LDKCResult_InMemorySignerDecodeErrorZ *NONNULL_PTR o);
21179 * Frees any resources used by the CResult_InMemorySignerDecodeErrorZ.
21181 void CResult_InMemorySignerDecodeErrorZ_free(struct LDKCResult_InMemorySignerDecodeErrorZ _res);
21184 * Creates a new CResult_InMemorySignerDecodeErrorZ which has the same data as `orig`
21185 * but with all dynamically-allocated buffers duplicated in new buffers.
21187 struct LDKCResult_InMemorySignerDecodeErrorZ CResult_InMemorySignerDecodeErrorZ_clone(const struct LDKCResult_InMemorySignerDecodeErrorZ *NONNULL_PTR orig);
21190 * Creates a new CResult_TransactionNoneZ in the success state.
21192 struct LDKCResult_TransactionNoneZ CResult_TransactionNoneZ_ok(struct LDKTransaction o);
21195 * Creates a new CResult_TransactionNoneZ in the error state.
21197 struct LDKCResult_TransactionNoneZ CResult_TransactionNoneZ_err(void);
21200 * Checks if the given object is currently in the success state
21202 bool CResult_TransactionNoneZ_is_ok(const struct LDKCResult_TransactionNoneZ *NONNULL_PTR o);
21205 * Frees any resources used by the CResult_TransactionNoneZ.
21207 void CResult_TransactionNoneZ_free(struct LDKCResult_TransactionNoneZ _res);
21210 * Creates a new CResult_TransactionNoneZ which has the same data as `orig`
21211 * but with all dynamically-allocated buffers duplicated in new buffers.
21213 struct LDKCResult_TransactionNoneZ CResult_TransactionNoneZ_clone(const struct LDKCResult_TransactionNoneZ *NONNULL_PTR orig);
21216 * Constructs a new COption_WriteableScoreZ containing a crate::lightning::routing::scoring::WriteableScore
21218 struct LDKCOption_WriteableScoreZ COption_WriteableScoreZ_some(struct LDKWriteableScore o);
21221 * Constructs a new COption_WriteableScoreZ containing nothing
21223 struct LDKCOption_WriteableScoreZ COption_WriteableScoreZ_none(void);
21226 * Frees any resources associated with the crate::lightning::routing::scoring::WriteableScore, if we are in the Some state
21228 void COption_WriteableScoreZ_free(struct LDKCOption_WriteableScoreZ _res);
21231 * Creates a new CResult_NoneIOErrorZ in the success state.
21233 struct LDKCResult_NoneIOErrorZ CResult_NoneIOErrorZ_ok(void);
21236 * Creates a new CResult_NoneIOErrorZ in the error state.
21238 struct LDKCResult_NoneIOErrorZ CResult_NoneIOErrorZ_err(enum LDKIOError e);
21241 * Checks if the given object is currently in the success state
21243 bool CResult_NoneIOErrorZ_is_ok(const struct LDKCResult_NoneIOErrorZ *NONNULL_PTR o);
21246 * Frees any resources used by the CResult_NoneIOErrorZ.
21248 void CResult_NoneIOErrorZ_free(struct LDKCResult_NoneIOErrorZ _res);
21251 * Creates a new CResult_NoneIOErrorZ which has the same data as `orig`
21252 * but with all dynamically-allocated buffers duplicated in new buffers.
21254 struct LDKCResult_NoneIOErrorZ CResult_NoneIOErrorZ_clone(const struct LDKCResult_NoneIOErrorZ *NONNULL_PTR orig);
21257 * Frees the buffer pointed to by `data` if `datalen` is non-0.
21259 void CVec_ChannelDetailsZ_free(struct LDKCVec_ChannelDetailsZ _res);
21262 * Creates a new CResult_RouteLightningErrorZ in the success state.
21264 struct LDKCResult_RouteLightningErrorZ CResult_RouteLightningErrorZ_ok(struct LDKRoute o);
21267 * Creates a new CResult_RouteLightningErrorZ in the error state.
21269 struct LDKCResult_RouteLightningErrorZ CResult_RouteLightningErrorZ_err(struct LDKLightningError e);
21272 * Checks if the given object is currently in the success state
21274 bool CResult_RouteLightningErrorZ_is_ok(const struct LDKCResult_RouteLightningErrorZ *NONNULL_PTR o);
21277 * Frees any resources used by the CResult_RouteLightningErrorZ.
21279 void CResult_RouteLightningErrorZ_free(struct LDKCResult_RouteLightningErrorZ _res);
21282 * Creates a new CResult_RouteLightningErrorZ which has the same data as `orig`
21283 * but with all dynamically-allocated buffers duplicated in new buffers.
21285 struct LDKCResult_RouteLightningErrorZ CResult_RouteLightningErrorZ_clone(const struct LDKCResult_RouteLightningErrorZ *NONNULL_PTR orig);
21288 * Creates a new CResult_InFlightHtlcsDecodeErrorZ in the success state.
21290 struct LDKCResult_InFlightHtlcsDecodeErrorZ CResult_InFlightHtlcsDecodeErrorZ_ok(struct LDKInFlightHtlcs o);
21293 * Creates a new CResult_InFlightHtlcsDecodeErrorZ in the error state.
21295 struct LDKCResult_InFlightHtlcsDecodeErrorZ CResult_InFlightHtlcsDecodeErrorZ_err(struct LDKDecodeError e);
21298 * Checks if the given object is currently in the success state
21300 bool CResult_InFlightHtlcsDecodeErrorZ_is_ok(const struct LDKCResult_InFlightHtlcsDecodeErrorZ *NONNULL_PTR o);
21303 * Frees any resources used by the CResult_InFlightHtlcsDecodeErrorZ.
21305 void CResult_InFlightHtlcsDecodeErrorZ_free(struct LDKCResult_InFlightHtlcsDecodeErrorZ _res);
21308 * Creates a new CResult_InFlightHtlcsDecodeErrorZ which has the same data as `orig`
21309 * but with all dynamically-allocated buffers duplicated in new buffers.
21311 struct LDKCResult_InFlightHtlcsDecodeErrorZ CResult_InFlightHtlcsDecodeErrorZ_clone(const struct LDKCResult_InFlightHtlcsDecodeErrorZ *NONNULL_PTR orig);
21314 * Creates a new CResult_RouteHopDecodeErrorZ in the success state.
21316 struct LDKCResult_RouteHopDecodeErrorZ CResult_RouteHopDecodeErrorZ_ok(struct LDKRouteHop o);
21319 * Creates a new CResult_RouteHopDecodeErrorZ in the error state.
21321 struct LDKCResult_RouteHopDecodeErrorZ CResult_RouteHopDecodeErrorZ_err(struct LDKDecodeError e);
21324 * Checks if the given object is currently in the success state
21326 bool CResult_RouteHopDecodeErrorZ_is_ok(const struct LDKCResult_RouteHopDecodeErrorZ *NONNULL_PTR o);
21329 * Frees any resources used by the CResult_RouteHopDecodeErrorZ.
21331 void CResult_RouteHopDecodeErrorZ_free(struct LDKCResult_RouteHopDecodeErrorZ _res);
21334 * Creates a new CResult_RouteHopDecodeErrorZ which has the same data as `orig`
21335 * but with all dynamically-allocated buffers duplicated in new buffers.
21337 struct LDKCResult_RouteHopDecodeErrorZ CResult_RouteHopDecodeErrorZ_clone(const struct LDKCResult_RouteHopDecodeErrorZ *NONNULL_PTR orig);
21340 * Frees the buffer pointed to by `data` if `datalen` is non-0.
21342 void CVec_BlindedHopZ_free(struct LDKCVec_BlindedHopZ _res);
21345 * Creates a new CResult_BlindedTailDecodeErrorZ in the success state.
21347 struct LDKCResult_BlindedTailDecodeErrorZ CResult_BlindedTailDecodeErrorZ_ok(struct LDKBlindedTail o);
21350 * Creates a new CResult_BlindedTailDecodeErrorZ in the error state.
21352 struct LDKCResult_BlindedTailDecodeErrorZ CResult_BlindedTailDecodeErrorZ_err(struct LDKDecodeError e);
21355 * Checks if the given object is currently in the success state
21357 bool CResult_BlindedTailDecodeErrorZ_is_ok(const struct LDKCResult_BlindedTailDecodeErrorZ *NONNULL_PTR o);
21360 * Frees any resources used by the CResult_BlindedTailDecodeErrorZ.
21362 void CResult_BlindedTailDecodeErrorZ_free(struct LDKCResult_BlindedTailDecodeErrorZ _res);
21365 * Creates a new CResult_BlindedTailDecodeErrorZ which has the same data as `orig`
21366 * but with all dynamically-allocated buffers duplicated in new buffers.
21368 struct LDKCResult_BlindedTailDecodeErrorZ CResult_BlindedTailDecodeErrorZ_clone(const struct LDKCResult_BlindedTailDecodeErrorZ *NONNULL_PTR orig);
21371 * Frees the buffer pointed to by `data` if `datalen` is non-0.
21373 void CVec_RouteHopZ_free(struct LDKCVec_RouteHopZ _res);
21376 * Frees the buffer pointed to by `data` if `datalen` is non-0.
21378 void CVec_PathZ_free(struct LDKCVec_PathZ _res);
21381 * Creates a new CResult_RouteDecodeErrorZ in the success state.
21383 struct LDKCResult_RouteDecodeErrorZ CResult_RouteDecodeErrorZ_ok(struct LDKRoute o);
21386 * Creates a new CResult_RouteDecodeErrorZ in the error state.
21388 struct LDKCResult_RouteDecodeErrorZ CResult_RouteDecodeErrorZ_err(struct LDKDecodeError e);
21391 * Checks if the given object is currently in the success state
21393 bool CResult_RouteDecodeErrorZ_is_ok(const struct LDKCResult_RouteDecodeErrorZ *NONNULL_PTR o);
21396 * Frees any resources used by the CResult_RouteDecodeErrorZ.
21398 void CResult_RouteDecodeErrorZ_free(struct LDKCResult_RouteDecodeErrorZ _res);
21401 * Creates a new CResult_RouteDecodeErrorZ which has the same data as `orig`
21402 * but with all dynamically-allocated buffers duplicated in new buffers.
21404 struct LDKCResult_RouteDecodeErrorZ CResult_RouteDecodeErrorZ_clone(const struct LDKCResult_RouteDecodeErrorZ *NONNULL_PTR orig);
21407 * Creates a new CResult_RouteParametersDecodeErrorZ in the success state.
21409 struct LDKCResult_RouteParametersDecodeErrorZ CResult_RouteParametersDecodeErrorZ_ok(struct LDKRouteParameters o);
21412 * Creates a new CResult_RouteParametersDecodeErrorZ in the error state.
21414 struct LDKCResult_RouteParametersDecodeErrorZ CResult_RouteParametersDecodeErrorZ_err(struct LDKDecodeError e);
21417 * Checks if the given object is currently in the success state
21419 bool CResult_RouteParametersDecodeErrorZ_is_ok(const struct LDKCResult_RouteParametersDecodeErrorZ *NONNULL_PTR o);
21422 * Frees any resources used by the CResult_RouteParametersDecodeErrorZ.
21424 void CResult_RouteParametersDecodeErrorZ_free(struct LDKCResult_RouteParametersDecodeErrorZ _res);
21427 * Creates a new CResult_RouteParametersDecodeErrorZ which has the same data as `orig`
21428 * but with all dynamically-allocated buffers duplicated in new buffers.
21430 struct LDKCResult_RouteParametersDecodeErrorZ CResult_RouteParametersDecodeErrorZ_clone(const struct LDKCResult_RouteParametersDecodeErrorZ *NONNULL_PTR orig);
21433 * Frees the buffer pointed to by `data` if `datalen` is non-0.
21435 void CVec_u64Z_free(struct LDKCVec_u64Z _res);
21438 * Creates a new CResult_PaymentParametersDecodeErrorZ in the success state.
21440 struct LDKCResult_PaymentParametersDecodeErrorZ CResult_PaymentParametersDecodeErrorZ_ok(struct LDKPaymentParameters o);
21443 * Creates a new CResult_PaymentParametersDecodeErrorZ in the error state.
21445 struct LDKCResult_PaymentParametersDecodeErrorZ CResult_PaymentParametersDecodeErrorZ_err(struct LDKDecodeError e);
21448 * Checks if the given object is currently in the success state
21450 bool CResult_PaymentParametersDecodeErrorZ_is_ok(const struct LDKCResult_PaymentParametersDecodeErrorZ *NONNULL_PTR o);
21453 * Frees any resources used by the CResult_PaymentParametersDecodeErrorZ.
21455 void CResult_PaymentParametersDecodeErrorZ_free(struct LDKCResult_PaymentParametersDecodeErrorZ _res);
21458 * Creates a new CResult_PaymentParametersDecodeErrorZ which has the same data as `orig`
21459 * but with all dynamically-allocated buffers duplicated in new buffers.
21461 struct LDKCResult_PaymentParametersDecodeErrorZ CResult_PaymentParametersDecodeErrorZ_clone(const struct LDKCResult_PaymentParametersDecodeErrorZ *NONNULL_PTR orig);
21464 * Creates a new tuple which has the same data as `orig`
21465 * but with all dynamically-allocated buffers duplicated in new buffers.
21467 struct LDKC2Tuple_BlindedPayInfoBlindedPathZ C2Tuple_BlindedPayInfoBlindedPathZ_clone(const struct LDKC2Tuple_BlindedPayInfoBlindedPathZ *NONNULL_PTR orig);
21470 * Creates a new C2Tuple_BlindedPayInfoBlindedPathZ from the contained elements.
21472 struct LDKC2Tuple_BlindedPayInfoBlindedPathZ C2Tuple_BlindedPayInfoBlindedPathZ_new(struct LDKBlindedPayInfo a, struct LDKBlindedPath b);
21475 * Frees any resources used by the C2Tuple_BlindedPayInfoBlindedPathZ.
21477 void C2Tuple_BlindedPayInfoBlindedPathZ_free(struct LDKC2Tuple_BlindedPayInfoBlindedPathZ _res);
21480 * Frees the buffer pointed to by `data` if `datalen` is non-0.
21482 void CVec_C2Tuple_BlindedPayInfoBlindedPathZZ_free(struct LDKCVec_C2Tuple_BlindedPayInfoBlindedPathZZ _res);
21485 * Frees the buffer pointed to by `data` if `datalen` is non-0.
21487 void CVec_RouteHintZ_free(struct LDKCVec_RouteHintZ _res);
21490 * Frees the buffer pointed to by `data` if `datalen` is non-0.
21492 void CVec_RouteHintHopZ_free(struct LDKCVec_RouteHintHopZ _res);
21495 * Creates a new CResult_RouteHintDecodeErrorZ in the success state.
21497 struct LDKCResult_RouteHintDecodeErrorZ CResult_RouteHintDecodeErrorZ_ok(struct LDKRouteHint o);
21500 * Creates a new CResult_RouteHintDecodeErrorZ in the error state.
21502 struct LDKCResult_RouteHintDecodeErrorZ CResult_RouteHintDecodeErrorZ_err(struct LDKDecodeError e);
21505 * Checks if the given object is currently in the success state
21507 bool CResult_RouteHintDecodeErrorZ_is_ok(const struct LDKCResult_RouteHintDecodeErrorZ *NONNULL_PTR o);
21510 * Frees any resources used by the CResult_RouteHintDecodeErrorZ.
21512 void CResult_RouteHintDecodeErrorZ_free(struct LDKCResult_RouteHintDecodeErrorZ _res);
21515 * Creates a new CResult_RouteHintDecodeErrorZ which has the same data as `orig`
21516 * but with all dynamically-allocated buffers duplicated in new buffers.
21518 struct LDKCResult_RouteHintDecodeErrorZ CResult_RouteHintDecodeErrorZ_clone(const struct LDKCResult_RouteHintDecodeErrorZ *NONNULL_PTR orig);
21521 * Creates a new CResult_RouteHintHopDecodeErrorZ in the success state.
21523 struct LDKCResult_RouteHintHopDecodeErrorZ CResult_RouteHintHopDecodeErrorZ_ok(struct LDKRouteHintHop o);
21526 * Creates a new CResult_RouteHintHopDecodeErrorZ in the error state.
21528 struct LDKCResult_RouteHintHopDecodeErrorZ CResult_RouteHintHopDecodeErrorZ_err(struct LDKDecodeError e);
21531 * Checks if the given object is currently in the success state
21533 bool CResult_RouteHintHopDecodeErrorZ_is_ok(const struct LDKCResult_RouteHintHopDecodeErrorZ *NONNULL_PTR o);
21536 * Frees any resources used by the CResult_RouteHintHopDecodeErrorZ.
21538 void CResult_RouteHintHopDecodeErrorZ_free(struct LDKCResult_RouteHintHopDecodeErrorZ _res);
21541 * Creates a new CResult_RouteHintHopDecodeErrorZ which has the same data as `orig`
21542 * but with all dynamically-allocated buffers duplicated in new buffers.
21544 struct LDKCResult_RouteHintHopDecodeErrorZ CResult_RouteHintHopDecodeErrorZ_clone(const struct LDKCResult_RouteHintHopDecodeErrorZ *NONNULL_PTR orig);
21547 * Frees the buffer pointed to by `data` if `datalen` is non-0.
21549 void CVec_PublicKeyZ_free(struct LDKCVec_PublicKeyZ _res);
21552 * Creates a new CResult_FixedPenaltyScorerDecodeErrorZ in the success state.
21554 struct LDKCResult_FixedPenaltyScorerDecodeErrorZ CResult_FixedPenaltyScorerDecodeErrorZ_ok(struct LDKFixedPenaltyScorer o);
21557 * Creates a new CResult_FixedPenaltyScorerDecodeErrorZ in the error state.
21559 struct LDKCResult_FixedPenaltyScorerDecodeErrorZ CResult_FixedPenaltyScorerDecodeErrorZ_err(struct LDKDecodeError e);
21562 * Checks if the given object is currently in the success state
21564 bool CResult_FixedPenaltyScorerDecodeErrorZ_is_ok(const struct LDKCResult_FixedPenaltyScorerDecodeErrorZ *NONNULL_PTR o);
21567 * Frees any resources used by the CResult_FixedPenaltyScorerDecodeErrorZ.
21569 void CResult_FixedPenaltyScorerDecodeErrorZ_free(struct LDKCResult_FixedPenaltyScorerDecodeErrorZ _res);
21572 * Creates a new CResult_FixedPenaltyScorerDecodeErrorZ which has the same data as `orig`
21573 * but with all dynamically-allocated buffers duplicated in new buffers.
21575 struct LDKCResult_FixedPenaltyScorerDecodeErrorZ CResult_FixedPenaltyScorerDecodeErrorZ_clone(const struct LDKCResult_FixedPenaltyScorerDecodeErrorZ *NONNULL_PTR orig);
21578 * Frees the buffer pointed to by `data` if `datalen` is non-0.
21580 void CVec_NodeIdZ_free(struct LDKCVec_NodeIdZ _res);
21583 * Creates a new tuple which has the same data as `orig`
21584 * but with all dynamically-allocated buffers duplicated in new buffers.
21586 struct LDKC2Tuple_u64u64Z C2Tuple_u64u64Z_clone(const struct LDKC2Tuple_u64u64Z *NONNULL_PTR orig);
21589 * Creates a new C2Tuple_u64u64Z from the contained elements.
21591 struct LDKC2Tuple_u64u64Z C2Tuple_u64u64Z_new(uint64_t a, uint64_t b);
21594 * Frees any resources used by the C2Tuple_u64u64Z.
21596 void C2Tuple_u64u64Z_free(struct LDKC2Tuple_u64u64Z _res);
21599 * Constructs a new COption_C2Tuple_u64u64ZZ containing a crate::c_types::derived::C2Tuple_u64u64Z
21601 struct LDKCOption_C2Tuple_u64u64ZZ COption_C2Tuple_u64u64ZZ_some(struct LDKC2Tuple_u64u64Z o);
21604 * Constructs a new COption_C2Tuple_u64u64ZZ containing nothing
21606 struct LDKCOption_C2Tuple_u64u64ZZ COption_C2Tuple_u64u64ZZ_none(void);
21609 * Frees any resources associated with the crate::c_types::derived::C2Tuple_u64u64Z, if we are in the Some state
21611 void COption_C2Tuple_u64u64ZZ_free(struct LDKCOption_C2Tuple_u64u64ZZ _res);
21614 * Creates a new COption_C2Tuple_u64u64ZZ which has the same data as `orig`
21615 * but with all dynamically-allocated buffers duplicated in new buffers.
21617 struct LDKCOption_C2Tuple_u64u64ZZ COption_C2Tuple_u64u64ZZ_clone(const struct LDKCOption_C2Tuple_u64u64ZZ *NONNULL_PTR orig);
21620 * Creates a new C2Tuple_Z from the contained elements.
21622 struct LDKC2Tuple_Z C2Tuple_Z_new(struct LDKThirtyTwoU16s a, struct LDKThirtyTwoU16s b);
21625 * Frees any resources used by the C2Tuple_Z.
21627 void C2Tuple_Z_free(struct LDKC2Tuple_Z _res);
21630 * Creates a new C2Tuple__u1632_u1632Z from the contained elements.
21632 struct LDKC2Tuple__u1632_u1632Z C2Tuple__u1632_u1632Z_new(struct LDKThirtyTwoU16s a, struct LDKThirtyTwoU16s b);
21635 * Frees any resources used by the C2Tuple__u1632_u1632Z.
21637 void C2Tuple__u1632_u1632Z_free(struct LDKC2Tuple__u1632_u1632Z _res);
21640 * Constructs a new COption_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ containing a crate::c_types::derived::C2Tuple__u1632_u1632Z
21642 struct LDKCOption_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ COption_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ_some(struct LDKC2Tuple__u1632_u1632Z o);
21645 * Constructs a new COption_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ containing nothing
21647 struct LDKCOption_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ COption_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ_none(void);
21650 * Frees any resources associated with the crate::c_types::derived::C2Tuple__u1632_u1632Z, if we are in the Some state
21652 void COption_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ_free(struct LDKCOption_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ _res);
21655 * Constructs a new COption_f64Z containing a f64
21657 struct LDKCOption_f64Z COption_f64Z_some(double o);
21660 * Constructs a new COption_f64Z containing nothing
21662 struct LDKCOption_f64Z COption_f64Z_none(void);
21665 * Frees any resources associated with the f64, if we are in the Some state
21667 void COption_f64Z_free(struct LDKCOption_f64Z _res);
21670 * Creates a new COption_f64Z which has the same data as `orig`
21671 * but with all dynamically-allocated buffers duplicated in new buffers.
21673 struct LDKCOption_f64Z COption_f64Z_clone(const struct LDKCOption_f64Z *NONNULL_PTR orig);
21676 * Creates a new CResult_ProbabilisticScorerDecodeErrorZ in the success state.
21678 struct LDKCResult_ProbabilisticScorerDecodeErrorZ CResult_ProbabilisticScorerDecodeErrorZ_ok(struct LDKProbabilisticScorer o);
21681 * Creates a new CResult_ProbabilisticScorerDecodeErrorZ in the error state.
21683 struct LDKCResult_ProbabilisticScorerDecodeErrorZ CResult_ProbabilisticScorerDecodeErrorZ_err(struct LDKDecodeError e);
21686 * Checks if the given object is currently in the success state
21688 bool CResult_ProbabilisticScorerDecodeErrorZ_is_ok(const struct LDKCResult_ProbabilisticScorerDecodeErrorZ *NONNULL_PTR o);
21691 * Frees any resources used by the CResult_ProbabilisticScorerDecodeErrorZ.
21693 void CResult_ProbabilisticScorerDecodeErrorZ_free(struct LDKCResult_ProbabilisticScorerDecodeErrorZ _res);
21696 * Creates a new tuple which has the same data as `orig`
21697 * but with all dynamically-allocated buffers duplicated in new buffers.
21699 struct LDKC2Tuple_usizeTransactionZ C2Tuple_usizeTransactionZ_clone(const struct LDKC2Tuple_usizeTransactionZ *NONNULL_PTR orig);
21702 * Creates a new C2Tuple_usizeTransactionZ from the contained elements.
21704 struct LDKC2Tuple_usizeTransactionZ C2Tuple_usizeTransactionZ_new(uintptr_t a, struct LDKTransaction b);
21707 * Frees any resources used by the C2Tuple_usizeTransactionZ.
21709 void C2Tuple_usizeTransactionZ_free(struct LDKC2Tuple_usizeTransactionZ _res);
21712 * Frees the buffer pointed to by `data` if `datalen` is non-0.
21714 void CVec_C2Tuple_usizeTransactionZZ_free(struct LDKCVec_C2Tuple_usizeTransactionZZ _res);
21717 * Creates a new tuple which has the same data as `orig`
21718 * but with all dynamically-allocated buffers duplicated in new buffers.
21720 struct LDKC2Tuple_ThirtyTwoBytesCOption_ThirtyTwoBytesZZ C2Tuple_ThirtyTwoBytesCOption_ThirtyTwoBytesZZ_clone(const struct LDKC2Tuple_ThirtyTwoBytesCOption_ThirtyTwoBytesZZ *NONNULL_PTR orig);
21723 * Creates a new C2Tuple_ThirtyTwoBytesCOption_ThirtyTwoBytesZZ from the contained elements.
21725 struct LDKC2Tuple_ThirtyTwoBytesCOption_ThirtyTwoBytesZZ C2Tuple_ThirtyTwoBytesCOption_ThirtyTwoBytesZZ_new(struct LDKThirtyTwoBytes a, struct LDKCOption_ThirtyTwoBytesZ b);
21728 * Frees any resources used by the C2Tuple_ThirtyTwoBytesCOption_ThirtyTwoBytesZZ.
21730 void C2Tuple_ThirtyTwoBytesCOption_ThirtyTwoBytesZZ_free(struct LDKC2Tuple_ThirtyTwoBytesCOption_ThirtyTwoBytesZZ _res);
21733 * Frees the buffer pointed to by `data` if `datalen` is non-0.
21735 void CVec_C2Tuple_ThirtyTwoBytesCOption_ThirtyTwoBytesZZZ_free(struct LDKCVec_C2Tuple_ThirtyTwoBytesCOption_ThirtyTwoBytesZZZ _res);
21738 * Creates a new CResult_ChannelMonitorUpdateStatusNoneZ in the success state.
21740 struct LDKCResult_ChannelMonitorUpdateStatusNoneZ CResult_ChannelMonitorUpdateStatusNoneZ_ok(enum LDKChannelMonitorUpdateStatus o);
21743 * Creates a new CResult_ChannelMonitorUpdateStatusNoneZ in the error state.
21745 struct LDKCResult_ChannelMonitorUpdateStatusNoneZ CResult_ChannelMonitorUpdateStatusNoneZ_err(void);
21748 * Checks if the given object is currently in the success state
21750 bool CResult_ChannelMonitorUpdateStatusNoneZ_is_ok(const struct LDKCResult_ChannelMonitorUpdateStatusNoneZ *NONNULL_PTR o);
21753 * Frees any resources used by the CResult_ChannelMonitorUpdateStatusNoneZ.
21755 void CResult_ChannelMonitorUpdateStatusNoneZ_free(struct LDKCResult_ChannelMonitorUpdateStatusNoneZ _res);
21758 * Creates a new CResult_ChannelMonitorUpdateStatusNoneZ which has the same data as `orig`
21759 * but with all dynamically-allocated buffers duplicated in new buffers.
21761 struct LDKCResult_ChannelMonitorUpdateStatusNoneZ CResult_ChannelMonitorUpdateStatusNoneZ_clone(const struct LDKCResult_ChannelMonitorUpdateStatusNoneZ *NONNULL_PTR orig);
21764 * Frees the buffer pointed to by `data` if `datalen` is non-0.
21766 void CVec_MonitorEventZ_free(struct LDKCVec_MonitorEventZ _res);
21769 * Creates a new tuple which has the same data as `orig`
21770 * but with all dynamically-allocated buffers duplicated in new buffers.
21772 struct LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_clone(const struct LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ *NONNULL_PTR orig);
21775 * Creates a new C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ from the contained elements.
21777 struct LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_new(struct LDKOutPoint a, struct LDKCVec_MonitorEventZ b, struct LDKPublicKey c);
21780 * Frees any resources used by the C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ.
21782 void C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_free(struct LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ _res);
21785 * Frees the buffer pointed to by `data` if `datalen` is non-0.
21787 void CVec_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZZ_free(struct LDKCVec_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZZ _res);
21790 * Creates a new CResult_InitFeaturesDecodeErrorZ in the success state.
21792 struct LDKCResult_InitFeaturesDecodeErrorZ CResult_InitFeaturesDecodeErrorZ_ok(struct LDKInitFeatures o);
21795 * Creates a new CResult_InitFeaturesDecodeErrorZ in the error state.
21797 struct LDKCResult_InitFeaturesDecodeErrorZ CResult_InitFeaturesDecodeErrorZ_err(struct LDKDecodeError e);
21800 * Checks if the given object is currently in the success state
21802 bool CResult_InitFeaturesDecodeErrorZ_is_ok(const struct LDKCResult_InitFeaturesDecodeErrorZ *NONNULL_PTR o);
21805 * Frees any resources used by the CResult_InitFeaturesDecodeErrorZ.
21807 void CResult_InitFeaturesDecodeErrorZ_free(struct LDKCResult_InitFeaturesDecodeErrorZ _res);
21810 * Creates a new CResult_InitFeaturesDecodeErrorZ which has the same data as `orig`
21811 * but with all dynamically-allocated buffers duplicated in new buffers.
21813 struct LDKCResult_InitFeaturesDecodeErrorZ CResult_InitFeaturesDecodeErrorZ_clone(const struct LDKCResult_InitFeaturesDecodeErrorZ *NONNULL_PTR orig);
21816 * Creates a new CResult_ChannelFeaturesDecodeErrorZ in the success state.
21818 struct LDKCResult_ChannelFeaturesDecodeErrorZ CResult_ChannelFeaturesDecodeErrorZ_ok(struct LDKChannelFeatures o);
21821 * Creates a new CResult_ChannelFeaturesDecodeErrorZ in the error state.
21823 struct LDKCResult_ChannelFeaturesDecodeErrorZ CResult_ChannelFeaturesDecodeErrorZ_err(struct LDKDecodeError e);
21826 * Checks if the given object is currently in the success state
21828 bool CResult_ChannelFeaturesDecodeErrorZ_is_ok(const struct LDKCResult_ChannelFeaturesDecodeErrorZ *NONNULL_PTR o);
21831 * Frees any resources used by the CResult_ChannelFeaturesDecodeErrorZ.
21833 void CResult_ChannelFeaturesDecodeErrorZ_free(struct LDKCResult_ChannelFeaturesDecodeErrorZ _res);
21836 * Creates a new CResult_ChannelFeaturesDecodeErrorZ which has the same data as `orig`
21837 * but with all dynamically-allocated buffers duplicated in new buffers.
21839 struct LDKCResult_ChannelFeaturesDecodeErrorZ CResult_ChannelFeaturesDecodeErrorZ_clone(const struct LDKCResult_ChannelFeaturesDecodeErrorZ *NONNULL_PTR orig);
21842 * Creates a new CResult_NodeFeaturesDecodeErrorZ in the success state.
21844 struct LDKCResult_NodeFeaturesDecodeErrorZ CResult_NodeFeaturesDecodeErrorZ_ok(struct LDKNodeFeatures o);
21847 * Creates a new CResult_NodeFeaturesDecodeErrorZ in the error state.
21849 struct LDKCResult_NodeFeaturesDecodeErrorZ CResult_NodeFeaturesDecodeErrorZ_err(struct LDKDecodeError e);
21852 * Checks if the given object is currently in the success state
21854 bool CResult_NodeFeaturesDecodeErrorZ_is_ok(const struct LDKCResult_NodeFeaturesDecodeErrorZ *NONNULL_PTR o);
21857 * Frees any resources used by the CResult_NodeFeaturesDecodeErrorZ.
21859 void CResult_NodeFeaturesDecodeErrorZ_free(struct LDKCResult_NodeFeaturesDecodeErrorZ _res);
21862 * Creates a new CResult_NodeFeaturesDecodeErrorZ which has the same data as `orig`
21863 * but with all dynamically-allocated buffers duplicated in new buffers.
21865 struct LDKCResult_NodeFeaturesDecodeErrorZ CResult_NodeFeaturesDecodeErrorZ_clone(const struct LDKCResult_NodeFeaturesDecodeErrorZ *NONNULL_PTR orig);
21868 * Creates a new CResult_Bolt11InvoiceFeaturesDecodeErrorZ in the success state.
21870 struct LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZ CResult_Bolt11InvoiceFeaturesDecodeErrorZ_ok(struct LDKBolt11InvoiceFeatures o);
21873 * Creates a new CResult_Bolt11InvoiceFeaturesDecodeErrorZ in the error state.
21875 struct LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZ CResult_Bolt11InvoiceFeaturesDecodeErrorZ_err(struct LDKDecodeError e);
21878 * Checks if the given object is currently in the success state
21880 bool CResult_Bolt11InvoiceFeaturesDecodeErrorZ_is_ok(const struct LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZ *NONNULL_PTR o);
21883 * Frees any resources used by the CResult_Bolt11InvoiceFeaturesDecodeErrorZ.
21885 void CResult_Bolt11InvoiceFeaturesDecodeErrorZ_free(struct LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZ _res);
21888 * Creates a new CResult_Bolt11InvoiceFeaturesDecodeErrorZ which has the same data as `orig`
21889 * but with all dynamically-allocated buffers duplicated in new buffers.
21891 struct LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZ CResult_Bolt11InvoiceFeaturesDecodeErrorZ_clone(const struct LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZ *NONNULL_PTR orig);
21894 * Creates a new CResult_Bolt12InvoiceFeaturesDecodeErrorZ in the success state.
21896 struct LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZ CResult_Bolt12InvoiceFeaturesDecodeErrorZ_ok(struct LDKBolt12InvoiceFeatures o);
21899 * Creates a new CResult_Bolt12InvoiceFeaturesDecodeErrorZ in the error state.
21901 struct LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZ CResult_Bolt12InvoiceFeaturesDecodeErrorZ_err(struct LDKDecodeError e);
21904 * Checks if the given object is currently in the success state
21906 bool CResult_Bolt12InvoiceFeaturesDecodeErrorZ_is_ok(const struct LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZ *NONNULL_PTR o);
21909 * Frees any resources used by the CResult_Bolt12InvoiceFeaturesDecodeErrorZ.
21911 void CResult_Bolt12InvoiceFeaturesDecodeErrorZ_free(struct LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZ _res);
21914 * Creates a new CResult_Bolt12InvoiceFeaturesDecodeErrorZ which has the same data as `orig`
21915 * but with all dynamically-allocated buffers duplicated in new buffers.
21917 struct LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZ CResult_Bolt12InvoiceFeaturesDecodeErrorZ_clone(const struct LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZ *NONNULL_PTR orig);
21920 * Creates a new CResult_BlindedHopFeaturesDecodeErrorZ in the success state.
21922 struct LDKCResult_BlindedHopFeaturesDecodeErrorZ CResult_BlindedHopFeaturesDecodeErrorZ_ok(struct LDKBlindedHopFeatures o);
21925 * Creates a new CResult_BlindedHopFeaturesDecodeErrorZ in the error state.
21927 struct LDKCResult_BlindedHopFeaturesDecodeErrorZ CResult_BlindedHopFeaturesDecodeErrorZ_err(struct LDKDecodeError e);
21930 * Checks if the given object is currently in the success state
21932 bool CResult_BlindedHopFeaturesDecodeErrorZ_is_ok(const struct LDKCResult_BlindedHopFeaturesDecodeErrorZ *NONNULL_PTR o);
21935 * Frees any resources used by the CResult_BlindedHopFeaturesDecodeErrorZ.
21937 void CResult_BlindedHopFeaturesDecodeErrorZ_free(struct LDKCResult_BlindedHopFeaturesDecodeErrorZ _res);
21940 * Creates a new CResult_BlindedHopFeaturesDecodeErrorZ which has the same data as `orig`
21941 * but with all dynamically-allocated buffers duplicated in new buffers.
21943 struct LDKCResult_BlindedHopFeaturesDecodeErrorZ CResult_BlindedHopFeaturesDecodeErrorZ_clone(const struct LDKCResult_BlindedHopFeaturesDecodeErrorZ *NONNULL_PTR orig);
21946 * Creates a new CResult_ChannelTypeFeaturesDecodeErrorZ in the success state.
21948 struct LDKCResult_ChannelTypeFeaturesDecodeErrorZ CResult_ChannelTypeFeaturesDecodeErrorZ_ok(struct LDKChannelTypeFeatures o);
21951 * Creates a new CResult_ChannelTypeFeaturesDecodeErrorZ in the error state.
21953 struct LDKCResult_ChannelTypeFeaturesDecodeErrorZ CResult_ChannelTypeFeaturesDecodeErrorZ_err(struct LDKDecodeError e);
21956 * Checks if the given object is currently in the success state
21958 bool CResult_ChannelTypeFeaturesDecodeErrorZ_is_ok(const struct LDKCResult_ChannelTypeFeaturesDecodeErrorZ *NONNULL_PTR o);
21961 * Frees any resources used by the CResult_ChannelTypeFeaturesDecodeErrorZ.
21963 void CResult_ChannelTypeFeaturesDecodeErrorZ_free(struct LDKCResult_ChannelTypeFeaturesDecodeErrorZ _res);
21966 * Creates a new CResult_ChannelTypeFeaturesDecodeErrorZ which has the same data as `orig`
21967 * but with all dynamically-allocated buffers duplicated in new buffers.
21969 struct LDKCResult_ChannelTypeFeaturesDecodeErrorZ CResult_ChannelTypeFeaturesDecodeErrorZ_clone(const struct LDKCResult_ChannelTypeFeaturesDecodeErrorZ *NONNULL_PTR orig);
21972 * Creates a new CResult_OfferBolt12ParseErrorZ in the success state.
21974 struct LDKCResult_OfferBolt12ParseErrorZ CResult_OfferBolt12ParseErrorZ_ok(struct LDKOffer o);
21977 * Creates a new CResult_OfferBolt12ParseErrorZ in the error state.
21979 struct LDKCResult_OfferBolt12ParseErrorZ CResult_OfferBolt12ParseErrorZ_err(struct LDKBolt12ParseError e);
21982 * Checks if the given object is currently in the success state
21984 bool CResult_OfferBolt12ParseErrorZ_is_ok(const struct LDKCResult_OfferBolt12ParseErrorZ *NONNULL_PTR o);
21987 * Frees any resources used by the CResult_OfferBolt12ParseErrorZ.
21989 void CResult_OfferBolt12ParseErrorZ_free(struct LDKCResult_OfferBolt12ParseErrorZ _res);
21992 * Creates a new CResult_OfferBolt12ParseErrorZ which has the same data as `orig`
21993 * but with all dynamically-allocated buffers duplicated in new buffers.
21995 struct LDKCResult_OfferBolt12ParseErrorZ CResult_OfferBolt12ParseErrorZ_clone(const struct LDKCResult_OfferBolt12ParseErrorZ *NONNULL_PTR orig);
21998 * Creates a new CResult_PublicKeySecp256k1ErrorZ in the success state.
22000 struct LDKCResult_PublicKeySecp256k1ErrorZ CResult_PublicKeySecp256k1ErrorZ_ok(struct LDKPublicKey o);
22003 * Creates a new CResult_PublicKeySecp256k1ErrorZ in the error state.
22005 struct LDKCResult_PublicKeySecp256k1ErrorZ CResult_PublicKeySecp256k1ErrorZ_err(enum LDKSecp256k1Error e);
22008 * Checks if the given object is currently in the success state
22010 bool CResult_PublicKeySecp256k1ErrorZ_is_ok(const struct LDKCResult_PublicKeySecp256k1ErrorZ *NONNULL_PTR o);
22013 * Frees any resources used by the CResult_PublicKeySecp256k1ErrorZ.
22015 void CResult_PublicKeySecp256k1ErrorZ_free(struct LDKCResult_PublicKeySecp256k1ErrorZ _res);
22018 * Creates a new CResult_PublicKeySecp256k1ErrorZ which has the same data as `orig`
22019 * but with all dynamically-allocated buffers duplicated in new buffers.
22021 struct LDKCResult_PublicKeySecp256k1ErrorZ CResult_PublicKeySecp256k1ErrorZ_clone(const struct LDKCResult_PublicKeySecp256k1ErrorZ *NONNULL_PTR orig);
22024 * Creates a new CResult_NodeIdDecodeErrorZ in the success state.
22026 struct LDKCResult_NodeIdDecodeErrorZ CResult_NodeIdDecodeErrorZ_ok(struct LDKNodeId o);
22029 * Creates a new CResult_NodeIdDecodeErrorZ in the error state.
22031 struct LDKCResult_NodeIdDecodeErrorZ CResult_NodeIdDecodeErrorZ_err(struct LDKDecodeError e);
22034 * Checks if the given object is currently in the success state
22036 bool CResult_NodeIdDecodeErrorZ_is_ok(const struct LDKCResult_NodeIdDecodeErrorZ *NONNULL_PTR o);
22039 * Frees any resources used by the CResult_NodeIdDecodeErrorZ.
22041 void CResult_NodeIdDecodeErrorZ_free(struct LDKCResult_NodeIdDecodeErrorZ _res);
22044 * Creates a new CResult_NodeIdDecodeErrorZ which has the same data as `orig`
22045 * but with all dynamically-allocated buffers duplicated in new buffers.
22047 struct LDKCResult_NodeIdDecodeErrorZ CResult_NodeIdDecodeErrorZ_clone(const struct LDKCResult_NodeIdDecodeErrorZ *NONNULL_PTR orig);
22050 * Constructs a new COption_NetworkUpdateZ containing a crate::lightning::routing::gossip::NetworkUpdate
22052 struct LDKCOption_NetworkUpdateZ COption_NetworkUpdateZ_some(struct LDKNetworkUpdate o);
22055 * Constructs a new COption_NetworkUpdateZ containing nothing
22057 struct LDKCOption_NetworkUpdateZ COption_NetworkUpdateZ_none(void);
22060 * Frees any resources associated with the crate::lightning::routing::gossip::NetworkUpdate, if we are in the Some state
22062 void COption_NetworkUpdateZ_free(struct LDKCOption_NetworkUpdateZ _res);
22065 * Creates a new COption_NetworkUpdateZ which has the same data as `orig`
22066 * but with all dynamically-allocated buffers duplicated in new buffers.
22068 struct LDKCOption_NetworkUpdateZ COption_NetworkUpdateZ_clone(const struct LDKCOption_NetworkUpdateZ *NONNULL_PTR orig);
22071 * Creates a new CResult_COption_NetworkUpdateZDecodeErrorZ in the success state.
22073 struct LDKCResult_COption_NetworkUpdateZDecodeErrorZ CResult_COption_NetworkUpdateZDecodeErrorZ_ok(struct LDKCOption_NetworkUpdateZ o);
22076 * Creates a new CResult_COption_NetworkUpdateZDecodeErrorZ in the error state.
22078 struct LDKCResult_COption_NetworkUpdateZDecodeErrorZ CResult_COption_NetworkUpdateZDecodeErrorZ_err(struct LDKDecodeError e);
22081 * Checks if the given object is currently in the success state
22083 bool CResult_COption_NetworkUpdateZDecodeErrorZ_is_ok(const struct LDKCResult_COption_NetworkUpdateZDecodeErrorZ *NONNULL_PTR o);
22086 * Frees any resources used by the CResult_COption_NetworkUpdateZDecodeErrorZ.
22088 void CResult_COption_NetworkUpdateZDecodeErrorZ_free(struct LDKCResult_COption_NetworkUpdateZDecodeErrorZ _res);
22091 * Creates a new CResult_COption_NetworkUpdateZDecodeErrorZ which has the same data as `orig`
22092 * but with all dynamically-allocated buffers duplicated in new buffers.
22094 struct LDKCResult_COption_NetworkUpdateZDecodeErrorZ CResult_COption_NetworkUpdateZDecodeErrorZ_clone(const struct LDKCResult_COption_NetworkUpdateZDecodeErrorZ *NONNULL_PTR orig);
22097 * Constructs a new COption_UtxoLookupZ containing a crate::lightning::routing::utxo::UtxoLookup
22099 struct LDKCOption_UtxoLookupZ COption_UtxoLookupZ_some(struct LDKUtxoLookup o);
22102 * Constructs a new COption_UtxoLookupZ containing nothing
22104 struct LDKCOption_UtxoLookupZ COption_UtxoLookupZ_none(void);
22107 * Frees any resources associated with the crate::lightning::routing::utxo::UtxoLookup, if we are in the Some state
22109 void COption_UtxoLookupZ_free(struct LDKCOption_UtxoLookupZ _res);
22112 * Creates a new CResult_NoneLightningErrorZ in the success state.
22114 struct LDKCResult_NoneLightningErrorZ CResult_NoneLightningErrorZ_ok(void);
22117 * Creates a new CResult_NoneLightningErrorZ in the error state.
22119 struct LDKCResult_NoneLightningErrorZ CResult_NoneLightningErrorZ_err(struct LDKLightningError e);
22122 * Checks if the given object is currently in the success state
22124 bool CResult_NoneLightningErrorZ_is_ok(const struct LDKCResult_NoneLightningErrorZ *NONNULL_PTR o);
22127 * Frees any resources used by the CResult_NoneLightningErrorZ.
22129 void CResult_NoneLightningErrorZ_free(struct LDKCResult_NoneLightningErrorZ _res);
22132 * Creates a new CResult_NoneLightningErrorZ which has the same data as `orig`
22133 * but with all dynamically-allocated buffers duplicated in new buffers.
22135 struct LDKCResult_NoneLightningErrorZ CResult_NoneLightningErrorZ_clone(const struct LDKCResult_NoneLightningErrorZ *NONNULL_PTR orig);
22138 * Creates a new CResult_boolLightningErrorZ in the success state.
22140 struct LDKCResult_boolLightningErrorZ CResult_boolLightningErrorZ_ok(bool o);
22143 * Creates a new CResult_boolLightningErrorZ in the error state.
22145 struct LDKCResult_boolLightningErrorZ CResult_boolLightningErrorZ_err(struct LDKLightningError e);
22148 * Checks if the given object is currently in the success state
22150 bool CResult_boolLightningErrorZ_is_ok(const struct LDKCResult_boolLightningErrorZ *NONNULL_PTR o);
22153 * Frees any resources used by the CResult_boolLightningErrorZ.
22155 void CResult_boolLightningErrorZ_free(struct LDKCResult_boolLightningErrorZ _res);
22158 * Creates a new CResult_boolLightningErrorZ which has the same data as `orig`
22159 * but with all dynamically-allocated buffers duplicated in new buffers.
22161 struct LDKCResult_boolLightningErrorZ CResult_boolLightningErrorZ_clone(const struct LDKCResult_boolLightningErrorZ *NONNULL_PTR orig);
22164 * Creates a new tuple which has the same data as `orig`
22165 * but with all dynamically-allocated buffers duplicated in new buffers.
22167 struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_clone(const struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ *NONNULL_PTR orig);
22170 * Creates a new C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ from the contained elements.
22172 struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_new(struct LDKChannelAnnouncement a, struct LDKChannelUpdate b, struct LDKChannelUpdate c);
22175 * Frees any resources used by the C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ.
22177 void C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_free(struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ _res);
22180 * Constructs a new COption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ containing a crate::c_types::derived::C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ
22182 struct LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ COption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_some(struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ o);
22185 * Constructs a new COption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ containing nothing
22187 struct LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ COption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_none(void);
22190 * Frees any resources associated with the crate::c_types::derived::C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ, if we are in the Some state
22192 void COption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_free(struct LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ _res);
22195 * Creates a new COption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ which has the same data as `orig`
22196 * but with all dynamically-allocated buffers duplicated in new buffers.
22198 struct LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ COption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_clone(const struct LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ *NONNULL_PTR orig);
22201 * Frees the buffer pointed to by `data` if `datalen` is non-0.
22203 void CVec_MessageSendEventZ_free(struct LDKCVec_MessageSendEventZ _res);
22206 * Creates a new CResult_ChannelUpdateInfoDecodeErrorZ in the success state.
22208 struct LDKCResult_ChannelUpdateInfoDecodeErrorZ CResult_ChannelUpdateInfoDecodeErrorZ_ok(struct LDKChannelUpdateInfo o);
22211 * Creates a new CResult_ChannelUpdateInfoDecodeErrorZ in the error state.
22213 struct LDKCResult_ChannelUpdateInfoDecodeErrorZ CResult_ChannelUpdateInfoDecodeErrorZ_err(struct LDKDecodeError e);
22216 * Checks if the given object is currently in the success state
22218 bool CResult_ChannelUpdateInfoDecodeErrorZ_is_ok(const struct LDKCResult_ChannelUpdateInfoDecodeErrorZ *NONNULL_PTR o);
22221 * Frees any resources used by the CResult_ChannelUpdateInfoDecodeErrorZ.
22223 void CResult_ChannelUpdateInfoDecodeErrorZ_free(struct LDKCResult_ChannelUpdateInfoDecodeErrorZ _res);
22226 * Creates a new CResult_ChannelUpdateInfoDecodeErrorZ which has the same data as `orig`
22227 * but with all dynamically-allocated buffers duplicated in new buffers.
22229 struct LDKCResult_ChannelUpdateInfoDecodeErrorZ CResult_ChannelUpdateInfoDecodeErrorZ_clone(const struct LDKCResult_ChannelUpdateInfoDecodeErrorZ *NONNULL_PTR orig);
22232 * Creates a new CResult_ChannelInfoDecodeErrorZ in the success state.
22234 struct LDKCResult_ChannelInfoDecodeErrorZ CResult_ChannelInfoDecodeErrorZ_ok(struct LDKChannelInfo o);
22237 * Creates a new CResult_ChannelInfoDecodeErrorZ in the error state.
22239 struct LDKCResult_ChannelInfoDecodeErrorZ CResult_ChannelInfoDecodeErrorZ_err(struct LDKDecodeError e);
22242 * Checks if the given object is currently in the success state
22244 bool CResult_ChannelInfoDecodeErrorZ_is_ok(const struct LDKCResult_ChannelInfoDecodeErrorZ *NONNULL_PTR o);
22247 * Frees any resources used by the CResult_ChannelInfoDecodeErrorZ.
22249 void CResult_ChannelInfoDecodeErrorZ_free(struct LDKCResult_ChannelInfoDecodeErrorZ _res);
22252 * Creates a new CResult_ChannelInfoDecodeErrorZ which has the same data as `orig`
22253 * but with all dynamically-allocated buffers duplicated in new buffers.
22255 struct LDKCResult_ChannelInfoDecodeErrorZ CResult_ChannelInfoDecodeErrorZ_clone(const struct LDKCResult_ChannelInfoDecodeErrorZ *NONNULL_PTR orig);
22258 * Creates a new CResult_RoutingFeesDecodeErrorZ in the success state.
22260 struct LDKCResult_RoutingFeesDecodeErrorZ CResult_RoutingFeesDecodeErrorZ_ok(struct LDKRoutingFees o);
22263 * Creates a new CResult_RoutingFeesDecodeErrorZ in the error state.
22265 struct LDKCResult_RoutingFeesDecodeErrorZ CResult_RoutingFeesDecodeErrorZ_err(struct LDKDecodeError e);
22268 * Checks if the given object is currently in the success state
22270 bool CResult_RoutingFeesDecodeErrorZ_is_ok(const struct LDKCResult_RoutingFeesDecodeErrorZ *NONNULL_PTR o);
22273 * Frees any resources used by the CResult_RoutingFeesDecodeErrorZ.
22275 void CResult_RoutingFeesDecodeErrorZ_free(struct LDKCResult_RoutingFeesDecodeErrorZ _res);
22278 * Creates a new CResult_RoutingFeesDecodeErrorZ which has the same data as `orig`
22279 * but with all dynamically-allocated buffers duplicated in new buffers.
22281 struct LDKCResult_RoutingFeesDecodeErrorZ CResult_RoutingFeesDecodeErrorZ_clone(const struct LDKCResult_RoutingFeesDecodeErrorZ *NONNULL_PTR orig);
22284 * Frees the buffer pointed to by `data` if `datalen` is non-0.
22286 void CVec_SocketAddressZ_free(struct LDKCVec_SocketAddressZ _res);
22289 * Creates a new CResult_NodeAnnouncementInfoDecodeErrorZ in the success state.
22291 struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ CResult_NodeAnnouncementInfoDecodeErrorZ_ok(struct LDKNodeAnnouncementInfo o);
22294 * Creates a new CResult_NodeAnnouncementInfoDecodeErrorZ in the error state.
22296 struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ CResult_NodeAnnouncementInfoDecodeErrorZ_err(struct LDKDecodeError e);
22299 * Checks if the given object is currently in the success state
22301 bool CResult_NodeAnnouncementInfoDecodeErrorZ_is_ok(const struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ *NONNULL_PTR o);
22304 * Frees any resources used by the CResult_NodeAnnouncementInfoDecodeErrorZ.
22306 void CResult_NodeAnnouncementInfoDecodeErrorZ_free(struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ _res);
22309 * Creates a new CResult_NodeAnnouncementInfoDecodeErrorZ which has the same data as `orig`
22310 * but with all dynamically-allocated buffers duplicated in new buffers.
22312 struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ CResult_NodeAnnouncementInfoDecodeErrorZ_clone(const struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ *NONNULL_PTR orig);
22315 * Creates a new CResult_NodeAliasDecodeErrorZ in the success state.
22317 struct LDKCResult_NodeAliasDecodeErrorZ CResult_NodeAliasDecodeErrorZ_ok(struct LDKNodeAlias o);
22320 * Creates a new CResult_NodeAliasDecodeErrorZ in the error state.
22322 struct LDKCResult_NodeAliasDecodeErrorZ CResult_NodeAliasDecodeErrorZ_err(struct LDKDecodeError e);
22325 * Checks if the given object is currently in the success state
22327 bool CResult_NodeAliasDecodeErrorZ_is_ok(const struct LDKCResult_NodeAliasDecodeErrorZ *NONNULL_PTR o);
22330 * Frees any resources used by the CResult_NodeAliasDecodeErrorZ.
22332 void CResult_NodeAliasDecodeErrorZ_free(struct LDKCResult_NodeAliasDecodeErrorZ _res);
22335 * Creates a new CResult_NodeAliasDecodeErrorZ which has the same data as `orig`
22336 * but with all dynamically-allocated buffers duplicated in new buffers.
22338 struct LDKCResult_NodeAliasDecodeErrorZ CResult_NodeAliasDecodeErrorZ_clone(const struct LDKCResult_NodeAliasDecodeErrorZ *NONNULL_PTR orig);
22341 * Creates a new CResult_NodeInfoDecodeErrorZ in the success state.
22343 struct LDKCResult_NodeInfoDecodeErrorZ CResult_NodeInfoDecodeErrorZ_ok(struct LDKNodeInfo o);
22346 * Creates a new CResult_NodeInfoDecodeErrorZ in the error state.
22348 struct LDKCResult_NodeInfoDecodeErrorZ CResult_NodeInfoDecodeErrorZ_err(struct LDKDecodeError e);
22351 * Checks if the given object is currently in the success state
22353 bool CResult_NodeInfoDecodeErrorZ_is_ok(const struct LDKCResult_NodeInfoDecodeErrorZ *NONNULL_PTR o);
22356 * Frees any resources used by the CResult_NodeInfoDecodeErrorZ.
22358 void CResult_NodeInfoDecodeErrorZ_free(struct LDKCResult_NodeInfoDecodeErrorZ _res);
22361 * Creates a new CResult_NodeInfoDecodeErrorZ which has the same data as `orig`
22362 * but with all dynamically-allocated buffers duplicated in new buffers.
22364 struct LDKCResult_NodeInfoDecodeErrorZ CResult_NodeInfoDecodeErrorZ_clone(const struct LDKCResult_NodeInfoDecodeErrorZ *NONNULL_PTR orig);
22367 * Creates a new CResult_NetworkGraphDecodeErrorZ in the success state.
22369 struct LDKCResult_NetworkGraphDecodeErrorZ CResult_NetworkGraphDecodeErrorZ_ok(struct LDKNetworkGraph o);
22372 * Creates a new CResult_NetworkGraphDecodeErrorZ in the error state.
22374 struct LDKCResult_NetworkGraphDecodeErrorZ CResult_NetworkGraphDecodeErrorZ_err(struct LDKDecodeError e);
22377 * Checks if the given object is currently in the success state
22379 bool CResult_NetworkGraphDecodeErrorZ_is_ok(const struct LDKCResult_NetworkGraphDecodeErrorZ *NONNULL_PTR o);
22382 * Frees any resources used by the CResult_NetworkGraphDecodeErrorZ.
22384 void CResult_NetworkGraphDecodeErrorZ_free(struct LDKCResult_NetworkGraphDecodeErrorZ _res);
22387 * Constructs a new COption_CVec_SocketAddressZZ containing a crate::c_types::derived::CVec_SocketAddressZ
22389 struct LDKCOption_CVec_SocketAddressZZ COption_CVec_SocketAddressZZ_some(struct LDKCVec_SocketAddressZ o);
22392 * Constructs a new COption_CVec_SocketAddressZZ containing nothing
22394 struct LDKCOption_CVec_SocketAddressZZ COption_CVec_SocketAddressZZ_none(void);
22397 * Frees any resources associated with the crate::c_types::derived::CVec_SocketAddressZ, if we are in the Some state
22399 void COption_CVec_SocketAddressZZ_free(struct LDKCOption_CVec_SocketAddressZZ _res);
22402 * Creates a new COption_CVec_SocketAddressZZ which has the same data as `orig`
22403 * but with all dynamically-allocated buffers duplicated in new buffers.
22405 struct LDKCOption_CVec_SocketAddressZZ COption_CVec_SocketAddressZZ_clone(const struct LDKCOption_CVec_SocketAddressZZ *NONNULL_PTR orig);
22408 * Creates a new CResult_ChannelDerivationParametersDecodeErrorZ in the success state.
22410 struct LDKCResult_ChannelDerivationParametersDecodeErrorZ CResult_ChannelDerivationParametersDecodeErrorZ_ok(struct LDKChannelDerivationParameters o);
22413 * Creates a new CResult_ChannelDerivationParametersDecodeErrorZ in the error state.
22415 struct LDKCResult_ChannelDerivationParametersDecodeErrorZ CResult_ChannelDerivationParametersDecodeErrorZ_err(struct LDKDecodeError e);
22418 * Checks if the given object is currently in the success state
22420 bool CResult_ChannelDerivationParametersDecodeErrorZ_is_ok(const struct LDKCResult_ChannelDerivationParametersDecodeErrorZ *NONNULL_PTR o);
22423 * Frees any resources used by the CResult_ChannelDerivationParametersDecodeErrorZ.
22425 void CResult_ChannelDerivationParametersDecodeErrorZ_free(struct LDKCResult_ChannelDerivationParametersDecodeErrorZ _res);
22428 * Creates a new CResult_ChannelDerivationParametersDecodeErrorZ which has the same data as `orig`
22429 * but with all dynamically-allocated buffers duplicated in new buffers.
22431 struct LDKCResult_ChannelDerivationParametersDecodeErrorZ CResult_ChannelDerivationParametersDecodeErrorZ_clone(const struct LDKCResult_ChannelDerivationParametersDecodeErrorZ *NONNULL_PTR orig);
22434 * Creates a new CResult_HTLCDescriptorDecodeErrorZ in the success state.
22436 struct LDKCResult_HTLCDescriptorDecodeErrorZ CResult_HTLCDescriptorDecodeErrorZ_ok(struct LDKHTLCDescriptor o);
22439 * Creates a new CResult_HTLCDescriptorDecodeErrorZ in the error state.
22441 struct LDKCResult_HTLCDescriptorDecodeErrorZ CResult_HTLCDescriptorDecodeErrorZ_err(struct LDKDecodeError e);
22444 * Checks if the given object is currently in the success state
22446 bool CResult_HTLCDescriptorDecodeErrorZ_is_ok(const struct LDKCResult_HTLCDescriptorDecodeErrorZ *NONNULL_PTR o);
22449 * Frees any resources used by the CResult_HTLCDescriptorDecodeErrorZ.
22451 void CResult_HTLCDescriptorDecodeErrorZ_free(struct LDKCResult_HTLCDescriptorDecodeErrorZ _res);
22454 * Creates a new CResult_HTLCDescriptorDecodeErrorZ which has the same data as `orig`
22455 * but with all dynamically-allocated buffers duplicated in new buffers.
22457 struct LDKCResult_HTLCDescriptorDecodeErrorZ CResult_HTLCDescriptorDecodeErrorZ_clone(const struct LDKCResult_HTLCDescriptorDecodeErrorZ *NONNULL_PTR orig);
22460 * Frees the buffer pointed to by `data` if `datalen` is non-0.
22462 void CVec_HTLCOutputInCommitmentZ_free(struct LDKCVec_HTLCOutputInCommitmentZ _res);
22465 * Frees the buffer pointed to by `data` if `datalen` is non-0.
22467 void CVec_HTLCDescriptorZ_free(struct LDKCVec_HTLCDescriptorZ _res);
22470 * Frees the buffer pointed to by `data` if `datalen` is non-0.
22472 void CVec_UtxoZ_free(struct LDKCVec_UtxoZ _res);
22475 * Constructs a new COption_TxOutZ containing a crate::c_types::TxOut
22477 struct LDKCOption_TxOutZ COption_TxOutZ_some(struct LDKTxOut o);
22480 * Constructs a new COption_TxOutZ containing nothing
22482 struct LDKCOption_TxOutZ COption_TxOutZ_none(void);
22485 * Frees any resources associated with the crate::c_types::TxOut, if we are in the Some state
22487 void COption_TxOutZ_free(struct LDKCOption_TxOutZ _res);
22490 * Creates a new COption_TxOutZ which has the same data as `orig`
22491 * but with all dynamically-allocated buffers duplicated in new buffers.
22493 struct LDKCOption_TxOutZ COption_TxOutZ_clone(const struct LDKCOption_TxOutZ *NONNULL_PTR orig);
22496 * Frees the buffer pointed to by `data` if `datalen` is non-0.
22498 void CVec_InputZ_free(struct LDKCVec_InputZ _res);
22501 * Creates a new CResult_CoinSelectionNoneZ in the success state.
22503 struct LDKCResult_CoinSelectionNoneZ CResult_CoinSelectionNoneZ_ok(struct LDKCoinSelection o);
22506 * Creates a new CResult_CoinSelectionNoneZ in the error state.
22508 struct LDKCResult_CoinSelectionNoneZ CResult_CoinSelectionNoneZ_err(void);
22511 * Checks if the given object is currently in the success state
22513 bool CResult_CoinSelectionNoneZ_is_ok(const struct LDKCResult_CoinSelectionNoneZ *NONNULL_PTR o);
22516 * Frees any resources used by the CResult_CoinSelectionNoneZ.
22518 void CResult_CoinSelectionNoneZ_free(struct LDKCResult_CoinSelectionNoneZ _res);
22521 * Creates a new CResult_CoinSelectionNoneZ which has the same data as `orig`
22522 * but with all dynamically-allocated buffers duplicated in new buffers.
22524 struct LDKCResult_CoinSelectionNoneZ CResult_CoinSelectionNoneZ_clone(const struct LDKCResult_CoinSelectionNoneZ *NONNULL_PTR orig);
22527 * Creates a new CResult_CVec_UtxoZNoneZ in the success state.
22529 struct LDKCResult_CVec_UtxoZNoneZ CResult_CVec_UtxoZNoneZ_ok(struct LDKCVec_UtxoZ o);
22532 * Creates a new CResult_CVec_UtxoZNoneZ in the error state.
22534 struct LDKCResult_CVec_UtxoZNoneZ CResult_CVec_UtxoZNoneZ_err(void);
22537 * Checks if the given object is currently in the success state
22539 bool CResult_CVec_UtxoZNoneZ_is_ok(const struct LDKCResult_CVec_UtxoZNoneZ *NONNULL_PTR o);
22542 * Frees any resources used by the CResult_CVec_UtxoZNoneZ.
22544 void CResult_CVec_UtxoZNoneZ_free(struct LDKCResult_CVec_UtxoZNoneZ _res);
22547 * Creates a new CResult_CVec_UtxoZNoneZ which has the same data as `orig`
22548 * but with all dynamically-allocated buffers duplicated in new buffers.
22550 struct LDKCResult_CVec_UtxoZNoneZ CResult_CVec_UtxoZNoneZ_clone(const struct LDKCResult_CVec_UtxoZNoneZ *NONNULL_PTR orig);
22553 * Creates a new tuple which has the same data as `orig`
22554 * but with all dynamically-allocated buffers duplicated in new buffers.
22556 struct LDKC2Tuple_u64u16Z C2Tuple_u64u16Z_clone(const struct LDKC2Tuple_u64u16Z *NONNULL_PTR orig);
22559 * Creates a new C2Tuple_u64u16Z from the contained elements.
22561 struct LDKC2Tuple_u64u16Z C2Tuple_u64u16Z_new(uint64_t a, uint16_t b);
22564 * Frees any resources used by the C2Tuple_u64u16Z.
22566 void C2Tuple_u64u16Z_free(struct LDKC2Tuple_u64u16Z _res);
22569 * Constructs a new COption_C2Tuple_u64u16ZZ containing a crate::c_types::derived::C2Tuple_u64u16Z
22571 struct LDKCOption_C2Tuple_u64u16ZZ COption_C2Tuple_u64u16ZZ_some(struct LDKC2Tuple_u64u16Z o);
22574 * Constructs a new COption_C2Tuple_u64u16ZZ containing nothing
22576 struct LDKCOption_C2Tuple_u64u16ZZ COption_C2Tuple_u64u16ZZ_none(void);
22579 * Frees any resources associated with the crate::c_types::derived::C2Tuple_u64u16Z, if we are in the Some state
22581 void COption_C2Tuple_u64u16ZZ_free(struct LDKCOption_C2Tuple_u64u16ZZ _res);
22584 * Creates a new COption_C2Tuple_u64u16ZZ which has the same data as `orig`
22585 * but with all dynamically-allocated buffers duplicated in new buffers.
22587 struct LDKCOption_C2Tuple_u64u16ZZ COption_C2Tuple_u64u16ZZ_clone(const struct LDKCOption_C2Tuple_u64u16ZZ *NONNULL_PTR orig);
22590 * Constructs a new COption_ChannelShutdownStateZ containing a crate::lightning::ln::channelmanager::ChannelShutdownState
22592 struct LDKCOption_ChannelShutdownStateZ COption_ChannelShutdownStateZ_some(enum LDKChannelShutdownState o);
22595 * Constructs a new COption_ChannelShutdownStateZ containing nothing
22597 struct LDKCOption_ChannelShutdownStateZ COption_ChannelShutdownStateZ_none(void);
22600 * Frees any resources associated with the crate::lightning::ln::channelmanager::ChannelShutdownState, if we are in the Some state
22602 void COption_ChannelShutdownStateZ_free(struct LDKCOption_ChannelShutdownStateZ _res);
22605 * Creates a new COption_ChannelShutdownStateZ which has the same data as `orig`
22606 * but with all dynamically-allocated buffers duplicated in new buffers.
22608 struct LDKCOption_ChannelShutdownStateZ COption_ChannelShutdownStateZ_clone(const struct LDKCOption_ChannelShutdownStateZ *NONNULL_PTR orig);
22611 * Creates a new CResult_ThirtyTwoBytesAPIErrorZ in the success state.
22613 struct LDKCResult_ThirtyTwoBytesAPIErrorZ CResult_ThirtyTwoBytesAPIErrorZ_ok(struct LDKThirtyTwoBytes o);
22616 * Creates a new CResult_ThirtyTwoBytesAPIErrorZ in the error state.
22618 struct LDKCResult_ThirtyTwoBytesAPIErrorZ CResult_ThirtyTwoBytesAPIErrorZ_err(struct LDKAPIError e);
22621 * Checks if the given object is currently in the success state
22623 bool CResult_ThirtyTwoBytesAPIErrorZ_is_ok(const struct LDKCResult_ThirtyTwoBytesAPIErrorZ *NONNULL_PTR o);
22626 * Frees any resources used by the CResult_ThirtyTwoBytesAPIErrorZ.
22628 void CResult_ThirtyTwoBytesAPIErrorZ_free(struct LDKCResult_ThirtyTwoBytesAPIErrorZ _res);
22631 * Creates a new CResult_ThirtyTwoBytesAPIErrorZ which has the same data as `orig`
22632 * but with all dynamically-allocated buffers duplicated in new buffers.
22634 struct LDKCResult_ThirtyTwoBytesAPIErrorZ CResult_ThirtyTwoBytesAPIErrorZ_clone(const struct LDKCResult_ThirtyTwoBytesAPIErrorZ *NONNULL_PTR orig);
22637 * Frees the buffer pointed to by `data` if `datalen` is non-0.
22639 void CVec_RecentPaymentDetailsZ_free(struct LDKCVec_RecentPaymentDetailsZ _res);
22642 * Creates a new CResult_NonePaymentSendFailureZ in the success state.
22644 struct LDKCResult_NonePaymentSendFailureZ CResult_NonePaymentSendFailureZ_ok(void);
22647 * Creates a new CResult_NonePaymentSendFailureZ in the error state.
22649 struct LDKCResult_NonePaymentSendFailureZ CResult_NonePaymentSendFailureZ_err(struct LDKPaymentSendFailure e);
22652 * Checks if the given object is currently in the success state
22654 bool CResult_NonePaymentSendFailureZ_is_ok(const struct LDKCResult_NonePaymentSendFailureZ *NONNULL_PTR o);
22657 * Frees any resources used by the CResult_NonePaymentSendFailureZ.
22659 void CResult_NonePaymentSendFailureZ_free(struct LDKCResult_NonePaymentSendFailureZ _res);
22662 * Creates a new CResult_NonePaymentSendFailureZ which has the same data as `orig`
22663 * but with all dynamically-allocated buffers duplicated in new buffers.
22665 struct LDKCResult_NonePaymentSendFailureZ CResult_NonePaymentSendFailureZ_clone(const struct LDKCResult_NonePaymentSendFailureZ *NONNULL_PTR orig);
22668 * Creates a new CResult_NoneRetryableSendFailureZ in the success state.
22670 struct LDKCResult_NoneRetryableSendFailureZ CResult_NoneRetryableSendFailureZ_ok(void);
22673 * Creates a new CResult_NoneRetryableSendFailureZ in the error state.
22675 struct LDKCResult_NoneRetryableSendFailureZ CResult_NoneRetryableSendFailureZ_err(enum LDKRetryableSendFailure e);
22678 * Checks if the given object is currently in the success state
22680 bool CResult_NoneRetryableSendFailureZ_is_ok(const struct LDKCResult_NoneRetryableSendFailureZ *NONNULL_PTR o);
22683 * Frees any resources used by the CResult_NoneRetryableSendFailureZ.
22685 void CResult_NoneRetryableSendFailureZ_free(struct LDKCResult_NoneRetryableSendFailureZ _res);
22688 * Creates a new CResult_NoneRetryableSendFailureZ which has the same data as `orig`
22689 * but with all dynamically-allocated buffers duplicated in new buffers.
22691 struct LDKCResult_NoneRetryableSendFailureZ CResult_NoneRetryableSendFailureZ_clone(const struct LDKCResult_NoneRetryableSendFailureZ *NONNULL_PTR orig);
22694 * Creates a new CResult_ThirtyTwoBytesPaymentSendFailureZ in the success state.
22696 struct LDKCResult_ThirtyTwoBytesPaymentSendFailureZ CResult_ThirtyTwoBytesPaymentSendFailureZ_ok(struct LDKThirtyTwoBytes o);
22699 * Creates a new CResult_ThirtyTwoBytesPaymentSendFailureZ in the error state.
22701 struct LDKCResult_ThirtyTwoBytesPaymentSendFailureZ CResult_ThirtyTwoBytesPaymentSendFailureZ_err(struct LDKPaymentSendFailure e);
22704 * Checks if the given object is currently in the success state
22706 bool CResult_ThirtyTwoBytesPaymentSendFailureZ_is_ok(const struct LDKCResult_ThirtyTwoBytesPaymentSendFailureZ *NONNULL_PTR o);
22709 * Frees any resources used by the CResult_ThirtyTwoBytesPaymentSendFailureZ.
22711 void CResult_ThirtyTwoBytesPaymentSendFailureZ_free(struct LDKCResult_ThirtyTwoBytesPaymentSendFailureZ _res);
22714 * Creates a new CResult_ThirtyTwoBytesPaymentSendFailureZ which has the same data as `orig`
22715 * but with all dynamically-allocated buffers duplicated in new buffers.
22717 struct LDKCResult_ThirtyTwoBytesPaymentSendFailureZ CResult_ThirtyTwoBytesPaymentSendFailureZ_clone(const struct LDKCResult_ThirtyTwoBytesPaymentSendFailureZ *NONNULL_PTR orig);
22720 * Creates a new CResult_ThirtyTwoBytesRetryableSendFailureZ in the success state.
22722 struct LDKCResult_ThirtyTwoBytesRetryableSendFailureZ CResult_ThirtyTwoBytesRetryableSendFailureZ_ok(struct LDKThirtyTwoBytes o);
22725 * Creates a new CResult_ThirtyTwoBytesRetryableSendFailureZ in the error state.
22727 struct LDKCResult_ThirtyTwoBytesRetryableSendFailureZ CResult_ThirtyTwoBytesRetryableSendFailureZ_err(enum LDKRetryableSendFailure e);
22730 * Checks if the given object is currently in the success state
22732 bool CResult_ThirtyTwoBytesRetryableSendFailureZ_is_ok(const struct LDKCResult_ThirtyTwoBytesRetryableSendFailureZ *NONNULL_PTR o);
22735 * Frees any resources used by the CResult_ThirtyTwoBytesRetryableSendFailureZ.
22737 void CResult_ThirtyTwoBytesRetryableSendFailureZ_free(struct LDKCResult_ThirtyTwoBytesRetryableSendFailureZ _res);
22740 * Creates a new CResult_ThirtyTwoBytesRetryableSendFailureZ which has the same data as `orig`
22741 * but with all dynamically-allocated buffers duplicated in new buffers.
22743 struct LDKCResult_ThirtyTwoBytesRetryableSendFailureZ CResult_ThirtyTwoBytesRetryableSendFailureZ_clone(const struct LDKCResult_ThirtyTwoBytesRetryableSendFailureZ *NONNULL_PTR orig);
22746 * Creates a new tuple which has the same data as `orig`
22747 * but with all dynamically-allocated buffers duplicated in new buffers.
22749 struct LDKC2Tuple_ThirtyTwoBytesThirtyTwoBytesZ C2Tuple_ThirtyTwoBytesThirtyTwoBytesZ_clone(const struct LDKC2Tuple_ThirtyTwoBytesThirtyTwoBytesZ *NONNULL_PTR orig);
22752 * Creates a new C2Tuple_ThirtyTwoBytesThirtyTwoBytesZ from the contained elements.
22754 struct LDKC2Tuple_ThirtyTwoBytesThirtyTwoBytesZ C2Tuple_ThirtyTwoBytesThirtyTwoBytesZ_new(struct LDKThirtyTwoBytes a, struct LDKThirtyTwoBytes b);
22757 * Frees any resources used by the C2Tuple_ThirtyTwoBytesThirtyTwoBytesZ.
22759 void C2Tuple_ThirtyTwoBytesThirtyTwoBytesZ_free(struct LDKC2Tuple_ThirtyTwoBytesThirtyTwoBytesZ _res);
22762 * Creates a new CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ in the success state.
22764 struct LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ_ok(struct LDKC2Tuple_ThirtyTwoBytesThirtyTwoBytesZ o);
22767 * Creates a new CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ in the error state.
22769 struct LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ_err(struct LDKPaymentSendFailure e);
22772 * Checks if the given object is currently in the success state
22774 bool CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ_is_ok(const struct LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ *NONNULL_PTR o);
22777 * Frees any resources used by the CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ.
22779 void CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ_free(struct LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ _res);
22782 * Creates a new CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ which has the same data as `orig`
22783 * but with all dynamically-allocated buffers duplicated in new buffers.
22785 struct LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ_clone(const struct LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ *NONNULL_PTR orig);
22788 * Frees the buffer pointed to by `data` if `datalen` is non-0.
22790 void CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZ_free(struct LDKCVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZ _res);
22793 * Creates a new CResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ in the success state.
22795 struct LDKCResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ CResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ_ok(struct LDKCVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZ o);
22798 * Creates a new CResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ in the error state.
22800 struct LDKCResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ CResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ_err(struct LDKProbeSendFailure e);
22803 * Checks if the given object is currently in the success state
22805 bool CResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ_is_ok(const struct LDKCResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ *NONNULL_PTR o);
22808 * Frees any resources used by the CResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ.
22810 void CResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ_free(struct LDKCResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ _res);
22813 * Creates a new CResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ which has the same data as `orig`
22814 * but with all dynamically-allocated buffers duplicated in new buffers.
22816 struct LDKCResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ CResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ_clone(const struct LDKCResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ *NONNULL_PTR orig);
22819 * Creates a new tuple which has the same data as `orig`
22820 * but with all dynamically-allocated buffers duplicated in new buffers.
22822 struct LDKC2Tuple_ThirtyTwoBytesPublicKeyZ C2Tuple_ThirtyTwoBytesPublicKeyZ_clone(const struct LDKC2Tuple_ThirtyTwoBytesPublicKeyZ *NONNULL_PTR orig);
22825 * Creates a new C2Tuple_ThirtyTwoBytesPublicKeyZ from the contained elements.
22827 struct LDKC2Tuple_ThirtyTwoBytesPublicKeyZ C2Tuple_ThirtyTwoBytesPublicKeyZ_new(struct LDKThirtyTwoBytes a, struct LDKPublicKey b);
22830 * Frees any resources used by the C2Tuple_ThirtyTwoBytesPublicKeyZ.
22832 void C2Tuple_ThirtyTwoBytesPublicKeyZ_free(struct LDKC2Tuple_ThirtyTwoBytesPublicKeyZ _res);
22835 * Frees the buffer pointed to by `data` if `datalen` is non-0.
22837 void CVec_C2Tuple_ThirtyTwoBytesPublicKeyZZ_free(struct LDKCVec_C2Tuple_ThirtyTwoBytesPublicKeyZZ _res);
22840 * Creates a new CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ in the success state.
22842 struct LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ_ok(struct LDKC2Tuple_ThirtyTwoBytesThirtyTwoBytesZ o);
22845 * Creates a new CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ in the error state.
22847 struct LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ_err(void);
22850 * Checks if the given object is currently in the success state
22852 bool CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ_is_ok(const struct LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ *NONNULL_PTR o);
22855 * Frees any resources used by the CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ.
22857 void CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ_free(struct LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ _res);
22860 * Creates a new CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ which has the same data as `orig`
22861 * but with all dynamically-allocated buffers duplicated in new buffers.
22863 struct LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ_clone(const struct LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ *NONNULL_PTR orig);
22866 * Creates a new CResult_CounterpartyForwardingInfoDecodeErrorZ in the success state.
22868 struct LDKCResult_CounterpartyForwardingInfoDecodeErrorZ CResult_CounterpartyForwardingInfoDecodeErrorZ_ok(struct LDKCounterpartyForwardingInfo o);
22871 * Creates a new CResult_CounterpartyForwardingInfoDecodeErrorZ in the error state.
22873 struct LDKCResult_CounterpartyForwardingInfoDecodeErrorZ CResult_CounterpartyForwardingInfoDecodeErrorZ_err(struct LDKDecodeError e);
22876 * Checks if the given object is currently in the success state
22878 bool CResult_CounterpartyForwardingInfoDecodeErrorZ_is_ok(const struct LDKCResult_CounterpartyForwardingInfoDecodeErrorZ *NONNULL_PTR o);
22881 * Frees any resources used by the CResult_CounterpartyForwardingInfoDecodeErrorZ.
22883 void CResult_CounterpartyForwardingInfoDecodeErrorZ_free(struct LDKCResult_CounterpartyForwardingInfoDecodeErrorZ _res);
22886 * Creates a new CResult_CounterpartyForwardingInfoDecodeErrorZ which has the same data as `orig`
22887 * but with all dynamically-allocated buffers duplicated in new buffers.
22889 struct LDKCResult_CounterpartyForwardingInfoDecodeErrorZ CResult_CounterpartyForwardingInfoDecodeErrorZ_clone(const struct LDKCResult_CounterpartyForwardingInfoDecodeErrorZ *NONNULL_PTR orig);
22892 * Creates a new CResult_ChannelCounterpartyDecodeErrorZ in the success state.
22894 struct LDKCResult_ChannelCounterpartyDecodeErrorZ CResult_ChannelCounterpartyDecodeErrorZ_ok(struct LDKChannelCounterparty o);
22897 * Creates a new CResult_ChannelCounterpartyDecodeErrorZ in the error state.
22899 struct LDKCResult_ChannelCounterpartyDecodeErrorZ CResult_ChannelCounterpartyDecodeErrorZ_err(struct LDKDecodeError e);
22902 * Checks if the given object is currently in the success state
22904 bool CResult_ChannelCounterpartyDecodeErrorZ_is_ok(const struct LDKCResult_ChannelCounterpartyDecodeErrorZ *NONNULL_PTR o);
22907 * Frees any resources used by the CResult_ChannelCounterpartyDecodeErrorZ.
22909 void CResult_ChannelCounterpartyDecodeErrorZ_free(struct LDKCResult_ChannelCounterpartyDecodeErrorZ _res);
22912 * Creates a new CResult_ChannelCounterpartyDecodeErrorZ which has the same data as `orig`
22913 * but with all dynamically-allocated buffers duplicated in new buffers.
22915 struct LDKCResult_ChannelCounterpartyDecodeErrorZ CResult_ChannelCounterpartyDecodeErrorZ_clone(const struct LDKCResult_ChannelCounterpartyDecodeErrorZ *NONNULL_PTR orig);
22918 * Creates a new CResult_ChannelDetailsDecodeErrorZ in the success state.
22920 struct LDKCResult_ChannelDetailsDecodeErrorZ CResult_ChannelDetailsDecodeErrorZ_ok(struct LDKChannelDetails o);
22923 * Creates a new CResult_ChannelDetailsDecodeErrorZ in the error state.
22925 struct LDKCResult_ChannelDetailsDecodeErrorZ CResult_ChannelDetailsDecodeErrorZ_err(struct LDKDecodeError e);
22928 * Checks if the given object is currently in the success state
22930 bool CResult_ChannelDetailsDecodeErrorZ_is_ok(const struct LDKCResult_ChannelDetailsDecodeErrorZ *NONNULL_PTR o);
22933 * Frees any resources used by the CResult_ChannelDetailsDecodeErrorZ.
22935 void CResult_ChannelDetailsDecodeErrorZ_free(struct LDKCResult_ChannelDetailsDecodeErrorZ _res);
22938 * Creates a new CResult_ChannelDetailsDecodeErrorZ which has the same data as `orig`
22939 * but with all dynamically-allocated buffers duplicated in new buffers.
22941 struct LDKCResult_ChannelDetailsDecodeErrorZ CResult_ChannelDetailsDecodeErrorZ_clone(const struct LDKCResult_ChannelDetailsDecodeErrorZ *NONNULL_PTR orig);
22944 * Creates a new CResult_PhantomRouteHintsDecodeErrorZ in the success state.
22946 struct LDKCResult_PhantomRouteHintsDecodeErrorZ CResult_PhantomRouteHintsDecodeErrorZ_ok(struct LDKPhantomRouteHints o);
22949 * Creates a new CResult_PhantomRouteHintsDecodeErrorZ in the error state.
22951 struct LDKCResult_PhantomRouteHintsDecodeErrorZ CResult_PhantomRouteHintsDecodeErrorZ_err(struct LDKDecodeError e);
22954 * Checks if the given object is currently in the success state
22956 bool CResult_PhantomRouteHintsDecodeErrorZ_is_ok(const struct LDKCResult_PhantomRouteHintsDecodeErrorZ *NONNULL_PTR o);
22959 * Frees any resources used by the CResult_PhantomRouteHintsDecodeErrorZ.
22961 void CResult_PhantomRouteHintsDecodeErrorZ_free(struct LDKCResult_PhantomRouteHintsDecodeErrorZ _res);
22964 * Creates a new CResult_PhantomRouteHintsDecodeErrorZ which has the same data as `orig`
22965 * but with all dynamically-allocated buffers duplicated in new buffers.
22967 struct LDKCResult_PhantomRouteHintsDecodeErrorZ CResult_PhantomRouteHintsDecodeErrorZ_clone(const struct LDKCResult_PhantomRouteHintsDecodeErrorZ *NONNULL_PTR orig);
22970 * Creates a new CResult_ChannelShutdownStateDecodeErrorZ in the success state.
22972 struct LDKCResult_ChannelShutdownStateDecodeErrorZ CResult_ChannelShutdownStateDecodeErrorZ_ok(enum LDKChannelShutdownState o);
22975 * Creates a new CResult_ChannelShutdownStateDecodeErrorZ in the error state.
22977 struct LDKCResult_ChannelShutdownStateDecodeErrorZ CResult_ChannelShutdownStateDecodeErrorZ_err(struct LDKDecodeError e);
22980 * Checks if the given object is currently in the success state
22982 bool CResult_ChannelShutdownStateDecodeErrorZ_is_ok(const struct LDKCResult_ChannelShutdownStateDecodeErrorZ *NONNULL_PTR o);
22985 * Frees any resources used by the CResult_ChannelShutdownStateDecodeErrorZ.
22987 void CResult_ChannelShutdownStateDecodeErrorZ_free(struct LDKCResult_ChannelShutdownStateDecodeErrorZ _res);
22990 * Creates a new CResult_ChannelShutdownStateDecodeErrorZ which has the same data as `orig`
22991 * but with all dynamically-allocated buffers duplicated in new buffers.
22993 struct LDKCResult_ChannelShutdownStateDecodeErrorZ CResult_ChannelShutdownStateDecodeErrorZ_clone(const struct LDKCResult_ChannelShutdownStateDecodeErrorZ *NONNULL_PTR orig);
22996 * Frees the buffer pointed to by `data` if `datalen` is non-0.
22998 void CVec_ChannelMonitorZ_free(struct LDKCVec_ChannelMonitorZ _res);
23001 * Creates a new C2Tuple_ThirtyTwoBytesChannelManagerZ from the contained elements.
23003 struct LDKC2Tuple_ThirtyTwoBytesChannelManagerZ C2Tuple_ThirtyTwoBytesChannelManagerZ_new(struct LDKThirtyTwoBytes a, struct LDKChannelManager b);
23006 * Frees any resources used by the C2Tuple_ThirtyTwoBytesChannelManagerZ.
23008 void C2Tuple_ThirtyTwoBytesChannelManagerZ_free(struct LDKC2Tuple_ThirtyTwoBytesChannelManagerZ _res);
23011 * Creates a new CResult_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ in the success state.
23013 struct LDKCResult_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ CResult_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ_ok(struct LDKC2Tuple_ThirtyTwoBytesChannelManagerZ o);
23016 * Creates a new CResult_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ in the error state.
23018 struct LDKCResult_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ CResult_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ_err(struct LDKDecodeError e);
23021 * Checks if the given object is currently in the success state
23023 bool CResult_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ_is_ok(const struct LDKCResult_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ *NONNULL_PTR o);
23026 * Frees any resources used by the CResult_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ.
23028 void CResult_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ_free(struct LDKCResult_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ _res);
23031 * Creates a new CResult_MaxDustHTLCExposureDecodeErrorZ in the success state.
23033 struct LDKCResult_MaxDustHTLCExposureDecodeErrorZ CResult_MaxDustHTLCExposureDecodeErrorZ_ok(struct LDKMaxDustHTLCExposure o);
23036 * Creates a new CResult_MaxDustHTLCExposureDecodeErrorZ in the error state.
23038 struct LDKCResult_MaxDustHTLCExposureDecodeErrorZ CResult_MaxDustHTLCExposureDecodeErrorZ_err(struct LDKDecodeError e);
23041 * Checks if the given object is currently in the success state
23043 bool CResult_MaxDustHTLCExposureDecodeErrorZ_is_ok(const struct LDKCResult_MaxDustHTLCExposureDecodeErrorZ *NONNULL_PTR o);
23046 * Frees any resources used by the CResult_MaxDustHTLCExposureDecodeErrorZ.
23048 void CResult_MaxDustHTLCExposureDecodeErrorZ_free(struct LDKCResult_MaxDustHTLCExposureDecodeErrorZ _res);
23051 * Creates a new CResult_MaxDustHTLCExposureDecodeErrorZ which has the same data as `orig`
23052 * but with all dynamically-allocated buffers duplicated in new buffers.
23054 struct LDKCResult_MaxDustHTLCExposureDecodeErrorZ CResult_MaxDustHTLCExposureDecodeErrorZ_clone(const struct LDKCResult_MaxDustHTLCExposureDecodeErrorZ *NONNULL_PTR orig);
23057 * Creates a new CResult_ChannelConfigDecodeErrorZ in the success state.
23059 struct LDKCResult_ChannelConfigDecodeErrorZ CResult_ChannelConfigDecodeErrorZ_ok(struct LDKChannelConfig o);
23062 * Creates a new CResult_ChannelConfigDecodeErrorZ in the error state.
23064 struct LDKCResult_ChannelConfigDecodeErrorZ CResult_ChannelConfigDecodeErrorZ_err(struct LDKDecodeError e);
23067 * Checks if the given object is currently in the success state
23069 bool CResult_ChannelConfigDecodeErrorZ_is_ok(const struct LDKCResult_ChannelConfigDecodeErrorZ *NONNULL_PTR o);
23072 * Frees any resources used by the CResult_ChannelConfigDecodeErrorZ.
23074 void CResult_ChannelConfigDecodeErrorZ_free(struct LDKCResult_ChannelConfigDecodeErrorZ _res);
23077 * Creates a new CResult_ChannelConfigDecodeErrorZ which has the same data as `orig`
23078 * but with all dynamically-allocated buffers duplicated in new buffers.
23080 struct LDKCResult_ChannelConfigDecodeErrorZ CResult_ChannelConfigDecodeErrorZ_clone(const struct LDKCResult_ChannelConfigDecodeErrorZ *NONNULL_PTR orig);
23083 * Constructs a new COption_MaxDustHTLCExposureZ containing a crate::lightning::util::config::MaxDustHTLCExposure
23085 struct LDKCOption_MaxDustHTLCExposureZ COption_MaxDustHTLCExposureZ_some(struct LDKMaxDustHTLCExposure o);
23088 * Constructs a new COption_MaxDustHTLCExposureZ containing nothing
23090 struct LDKCOption_MaxDustHTLCExposureZ COption_MaxDustHTLCExposureZ_none(void);
23093 * Frees any resources associated with the crate::lightning::util::config::MaxDustHTLCExposure, if we are in the Some state
23095 void COption_MaxDustHTLCExposureZ_free(struct LDKCOption_MaxDustHTLCExposureZ _res);
23098 * Creates a new COption_MaxDustHTLCExposureZ which has the same data as `orig`
23099 * but with all dynamically-allocated buffers duplicated in new buffers.
23101 struct LDKCOption_MaxDustHTLCExposureZ COption_MaxDustHTLCExposureZ_clone(const struct LDKCOption_MaxDustHTLCExposureZ *NONNULL_PTR orig);
23104 * Constructs a new COption_APIErrorZ containing a crate::lightning::util::errors::APIError
23106 struct LDKCOption_APIErrorZ COption_APIErrorZ_some(struct LDKAPIError o);
23109 * Constructs a new COption_APIErrorZ containing nothing
23111 struct LDKCOption_APIErrorZ COption_APIErrorZ_none(void);
23114 * Frees any resources associated with the crate::lightning::util::errors::APIError, if we are in the Some state
23116 void COption_APIErrorZ_free(struct LDKCOption_APIErrorZ _res);
23119 * Creates a new COption_APIErrorZ which has the same data as `orig`
23120 * but with all dynamically-allocated buffers duplicated in new buffers.
23122 struct LDKCOption_APIErrorZ COption_APIErrorZ_clone(const struct LDKCOption_APIErrorZ *NONNULL_PTR orig);
23125 * Creates a new CResult_COption_APIErrorZDecodeErrorZ in the success state.
23127 struct LDKCResult_COption_APIErrorZDecodeErrorZ CResult_COption_APIErrorZDecodeErrorZ_ok(struct LDKCOption_APIErrorZ o);
23130 * Creates a new CResult_COption_APIErrorZDecodeErrorZ in the error state.
23132 struct LDKCResult_COption_APIErrorZDecodeErrorZ CResult_COption_APIErrorZDecodeErrorZ_err(struct LDKDecodeError e);
23135 * Checks if the given object is currently in the success state
23137 bool CResult_COption_APIErrorZDecodeErrorZ_is_ok(const struct LDKCResult_COption_APIErrorZDecodeErrorZ *NONNULL_PTR o);
23140 * Frees any resources used by the CResult_COption_APIErrorZDecodeErrorZ.
23142 void CResult_COption_APIErrorZDecodeErrorZ_free(struct LDKCResult_COption_APIErrorZDecodeErrorZ _res);
23145 * Creates a new CResult_COption_APIErrorZDecodeErrorZ which has the same data as `orig`
23146 * but with all dynamically-allocated buffers duplicated in new buffers.
23148 struct LDKCResult_COption_APIErrorZDecodeErrorZ CResult_COption_APIErrorZDecodeErrorZ_clone(const struct LDKCResult_COption_APIErrorZDecodeErrorZ *NONNULL_PTR orig);
23151 * Creates a new CResult_ChannelMonitorUpdateDecodeErrorZ in the success state.
23153 struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ CResult_ChannelMonitorUpdateDecodeErrorZ_ok(struct LDKChannelMonitorUpdate o);
23156 * Creates a new CResult_ChannelMonitorUpdateDecodeErrorZ in the error state.
23158 struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ CResult_ChannelMonitorUpdateDecodeErrorZ_err(struct LDKDecodeError e);
23161 * Checks if the given object is currently in the success state
23163 bool CResult_ChannelMonitorUpdateDecodeErrorZ_is_ok(const struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ *NONNULL_PTR o);
23166 * Frees any resources used by the CResult_ChannelMonitorUpdateDecodeErrorZ.
23168 void CResult_ChannelMonitorUpdateDecodeErrorZ_free(struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ _res);
23171 * Creates a new CResult_ChannelMonitorUpdateDecodeErrorZ which has the same data as `orig`
23172 * but with all dynamically-allocated buffers duplicated in new buffers.
23174 struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ CResult_ChannelMonitorUpdateDecodeErrorZ_clone(const struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ *NONNULL_PTR orig);
23177 * Constructs a new COption_MonitorEventZ containing a crate::lightning::chain::channelmonitor::MonitorEvent
23179 struct LDKCOption_MonitorEventZ COption_MonitorEventZ_some(struct LDKMonitorEvent o);
23182 * Constructs a new COption_MonitorEventZ containing nothing
23184 struct LDKCOption_MonitorEventZ COption_MonitorEventZ_none(void);
23187 * Frees any resources associated with the crate::lightning::chain::channelmonitor::MonitorEvent, if we are in the Some state
23189 void COption_MonitorEventZ_free(struct LDKCOption_MonitorEventZ _res);
23192 * Creates a new COption_MonitorEventZ which has the same data as `orig`
23193 * but with all dynamically-allocated buffers duplicated in new buffers.
23195 struct LDKCOption_MonitorEventZ COption_MonitorEventZ_clone(const struct LDKCOption_MonitorEventZ *NONNULL_PTR orig);
23198 * Creates a new CResult_COption_MonitorEventZDecodeErrorZ in the success state.
23200 struct LDKCResult_COption_MonitorEventZDecodeErrorZ CResult_COption_MonitorEventZDecodeErrorZ_ok(struct LDKCOption_MonitorEventZ o);
23203 * Creates a new CResult_COption_MonitorEventZDecodeErrorZ in the error state.
23205 struct LDKCResult_COption_MonitorEventZDecodeErrorZ CResult_COption_MonitorEventZDecodeErrorZ_err(struct LDKDecodeError e);
23208 * Checks if the given object is currently in the success state
23210 bool CResult_COption_MonitorEventZDecodeErrorZ_is_ok(const struct LDKCResult_COption_MonitorEventZDecodeErrorZ *NONNULL_PTR o);
23213 * Frees any resources used by the CResult_COption_MonitorEventZDecodeErrorZ.
23215 void CResult_COption_MonitorEventZDecodeErrorZ_free(struct LDKCResult_COption_MonitorEventZDecodeErrorZ _res);
23218 * Creates a new CResult_COption_MonitorEventZDecodeErrorZ which has the same data as `orig`
23219 * but with all dynamically-allocated buffers duplicated in new buffers.
23221 struct LDKCResult_COption_MonitorEventZDecodeErrorZ CResult_COption_MonitorEventZDecodeErrorZ_clone(const struct LDKCResult_COption_MonitorEventZDecodeErrorZ *NONNULL_PTR orig);
23224 * Creates a new CResult_HTLCUpdateDecodeErrorZ in the success state.
23226 struct LDKCResult_HTLCUpdateDecodeErrorZ CResult_HTLCUpdateDecodeErrorZ_ok(struct LDKHTLCUpdate o);
23229 * Creates a new CResult_HTLCUpdateDecodeErrorZ in the error state.
23231 struct LDKCResult_HTLCUpdateDecodeErrorZ CResult_HTLCUpdateDecodeErrorZ_err(struct LDKDecodeError e);
23234 * Checks if the given object is currently in the success state
23236 bool CResult_HTLCUpdateDecodeErrorZ_is_ok(const struct LDKCResult_HTLCUpdateDecodeErrorZ *NONNULL_PTR o);
23239 * Frees any resources used by the CResult_HTLCUpdateDecodeErrorZ.
23241 void CResult_HTLCUpdateDecodeErrorZ_free(struct LDKCResult_HTLCUpdateDecodeErrorZ _res);
23244 * Creates a new CResult_HTLCUpdateDecodeErrorZ which has the same data as `orig`
23245 * but with all dynamically-allocated buffers duplicated in new buffers.
23247 struct LDKCResult_HTLCUpdateDecodeErrorZ CResult_HTLCUpdateDecodeErrorZ_clone(const struct LDKCResult_HTLCUpdateDecodeErrorZ *NONNULL_PTR orig);
23250 * Creates a new tuple which has the same data as `orig`
23251 * but with all dynamically-allocated buffers duplicated in new buffers.
23253 struct LDKC2Tuple_OutPointCVec_u8ZZ C2Tuple_OutPointCVec_u8ZZ_clone(const struct LDKC2Tuple_OutPointCVec_u8ZZ *NONNULL_PTR orig);
23256 * Creates a new C2Tuple_OutPointCVec_u8ZZ from the contained elements.
23258 struct LDKC2Tuple_OutPointCVec_u8ZZ C2Tuple_OutPointCVec_u8ZZ_new(struct LDKOutPoint a, struct LDKCVec_u8Z b);
23261 * Frees any resources used by the C2Tuple_OutPointCVec_u8ZZ.
23263 void C2Tuple_OutPointCVec_u8ZZ_free(struct LDKC2Tuple_OutPointCVec_u8ZZ _res);
23266 * Creates a new tuple which has the same data as `orig`
23267 * but with all dynamically-allocated buffers duplicated in new buffers.
23269 struct LDKC2Tuple_u32CVec_u8ZZ C2Tuple_u32CVec_u8ZZ_clone(const struct LDKC2Tuple_u32CVec_u8ZZ *NONNULL_PTR orig);
23272 * Creates a new C2Tuple_u32CVec_u8ZZ from the contained elements.
23274 struct LDKC2Tuple_u32CVec_u8ZZ C2Tuple_u32CVec_u8ZZ_new(uint32_t a, struct LDKCVec_u8Z b);
23277 * Frees any resources used by the C2Tuple_u32CVec_u8ZZ.
23279 void C2Tuple_u32CVec_u8ZZ_free(struct LDKC2Tuple_u32CVec_u8ZZ _res);
23282 * Frees the buffer pointed to by `data` if `datalen` is non-0.
23284 void CVec_C2Tuple_u32CVec_u8ZZZ_free(struct LDKCVec_C2Tuple_u32CVec_u8ZZZ _res);
23287 * Creates a new tuple which has the same data as `orig`
23288 * but with all dynamically-allocated buffers duplicated in new buffers.
23290 struct LDKC2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZ C2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZ_clone(const struct LDKC2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZ *NONNULL_PTR orig);
23293 * Creates a new C2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZ from the contained elements.
23295 struct LDKC2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZ C2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZ_new(struct LDKThirtyTwoBytes a, struct LDKCVec_C2Tuple_u32CVec_u8ZZZ b);
23298 * Frees any resources used by the C2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZ.
23300 void C2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZ_free(struct LDKC2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZ _res);
23303 * Frees the buffer pointed to by `data` if `datalen` is non-0.
23305 void CVec_C2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZZ_free(struct LDKCVec_C2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZZ _res);
23308 * Frees the buffer pointed to by `data` if `datalen` is non-0.
23310 void CVec_CommitmentTransactionZ_free(struct LDKCVec_CommitmentTransactionZ _res);
23313 * Frees the buffer pointed to by `data` if `datalen` is non-0.
23315 void CVec_TransactionZ_free(struct LDKCVec_TransactionZ _res);
23318 * Creates a new tuple which has the same data as `orig`
23319 * but with all dynamically-allocated buffers duplicated in new buffers.
23321 struct LDKC2Tuple_u32TxOutZ C2Tuple_u32TxOutZ_clone(const struct LDKC2Tuple_u32TxOutZ *NONNULL_PTR orig);
23324 * Creates a new C2Tuple_u32TxOutZ from the contained elements.
23326 struct LDKC2Tuple_u32TxOutZ C2Tuple_u32TxOutZ_new(uint32_t a, struct LDKTxOut b);
23329 * Frees any resources used by the C2Tuple_u32TxOutZ.
23331 void C2Tuple_u32TxOutZ_free(struct LDKC2Tuple_u32TxOutZ _res);
23334 * Frees the buffer pointed to by `data` if `datalen` is non-0.
23336 void CVec_C2Tuple_u32TxOutZZ_free(struct LDKCVec_C2Tuple_u32TxOutZZ _res);
23339 * Creates a new tuple which has the same data as `orig`
23340 * but with all dynamically-allocated buffers duplicated in new buffers.
23342 struct LDKC2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32TxOutZZZ C2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32TxOutZZZ_clone(const struct LDKC2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32TxOutZZZ *NONNULL_PTR orig);
23345 * Creates a new C2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32TxOutZZZ from the contained elements.
23347 struct LDKC2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32TxOutZZZ C2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32TxOutZZZ_new(struct LDKThirtyTwoBytes a, struct LDKCVec_C2Tuple_u32TxOutZZ b);
23350 * Frees any resources used by the C2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32TxOutZZZ.
23352 void C2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32TxOutZZZ_free(struct LDKC2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32TxOutZZZ _res);
23355 * Frees the buffer pointed to by `data` if `datalen` is non-0.
23357 void CVec_TransactionOutputsZ_free(struct LDKCVec_TransactionOutputsZ _res);
23360 * Frees the buffer pointed to by `data` if `datalen` is non-0.
23362 void CVec_BalanceZ_free(struct LDKCVec_BalanceZ _res);
23365 * Creates a new tuple which has the same data as `orig`
23366 * but with all dynamically-allocated buffers duplicated in new buffers.
23368 struct LDKC2Tuple_ThirtyTwoBytesChannelMonitorZ C2Tuple_ThirtyTwoBytesChannelMonitorZ_clone(const struct LDKC2Tuple_ThirtyTwoBytesChannelMonitorZ *NONNULL_PTR orig);
23371 * Creates a new C2Tuple_ThirtyTwoBytesChannelMonitorZ from the contained elements.
23373 struct LDKC2Tuple_ThirtyTwoBytesChannelMonitorZ C2Tuple_ThirtyTwoBytesChannelMonitorZ_new(struct LDKThirtyTwoBytes a, struct LDKChannelMonitor b);
23376 * Frees any resources used by the C2Tuple_ThirtyTwoBytesChannelMonitorZ.
23378 void C2Tuple_ThirtyTwoBytesChannelMonitorZ_free(struct LDKC2Tuple_ThirtyTwoBytesChannelMonitorZ _res);
23381 * Creates a new CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ in the success state.
23383 struct LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ_ok(struct LDKC2Tuple_ThirtyTwoBytesChannelMonitorZ o);
23386 * Creates a new CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ in the error state.
23388 struct LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ_err(struct LDKDecodeError e);
23391 * Checks if the given object is currently in the success state
23393 bool CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ_is_ok(const struct LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ *NONNULL_PTR o);
23396 * Frees any resources used by the CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ.
23398 void CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ_free(struct LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ _res);
23401 * Creates a new CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ which has the same data as `orig`
23402 * but with all dynamically-allocated buffers duplicated in new buffers.
23404 struct LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ_clone(const struct LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ *NONNULL_PTR orig);
23407 * Creates a new tuple which has the same data as `orig`
23408 * but with all dynamically-allocated buffers duplicated in new buffers.
23410 struct LDKC2Tuple_PublicKeyTypeZ C2Tuple_PublicKeyTypeZ_clone(const struct LDKC2Tuple_PublicKeyTypeZ *NONNULL_PTR orig);
23413 * Creates a new C2Tuple_PublicKeyTypeZ from the contained elements.
23415 struct LDKC2Tuple_PublicKeyTypeZ C2Tuple_PublicKeyTypeZ_new(struct LDKPublicKey a, struct LDKType b);
23418 * Frees any resources used by the C2Tuple_PublicKeyTypeZ.
23420 void C2Tuple_PublicKeyTypeZ_free(struct LDKC2Tuple_PublicKeyTypeZ _res);
23423 * Frees the buffer pointed to by `data` if `datalen` is non-0.
23425 void CVec_C2Tuple_PublicKeyTypeZZ_free(struct LDKCVec_C2Tuple_PublicKeyTypeZZ _res);
23428 * Constructs a new COption_OffersMessageZ containing a crate::lightning::onion_message::offers::OffersMessage
23430 struct LDKCOption_OffersMessageZ COption_OffersMessageZ_some(struct LDKOffersMessage o);
23433 * Constructs a new COption_OffersMessageZ containing nothing
23435 struct LDKCOption_OffersMessageZ COption_OffersMessageZ_none(void);
23438 * Frees any resources associated with the crate::lightning::onion_message::offers::OffersMessage, if we are in the Some state
23440 void COption_OffersMessageZ_free(struct LDKCOption_OffersMessageZ _res);
23443 * Creates a new COption_OffersMessageZ which has the same data as `orig`
23444 * but with all dynamically-allocated buffers duplicated in new buffers.
23446 struct LDKCOption_OffersMessageZ COption_OffersMessageZ_clone(const struct LDKCOption_OffersMessageZ *NONNULL_PTR orig);
23449 * Constructs a new COption_CustomOnionMessageContentsZ containing a crate::lightning::onion_message::packet::CustomOnionMessageContents
23451 struct LDKCOption_CustomOnionMessageContentsZ COption_CustomOnionMessageContentsZ_some(struct LDKCustomOnionMessageContents o);
23454 * Constructs a new COption_CustomOnionMessageContentsZ containing nothing
23456 struct LDKCOption_CustomOnionMessageContentsZ COption_CustomOnionMessageContentsZ_none(void);
23459 * Frees any resources associated with the crate::lightning::onion_message::packet::CustomOnionMessageContents, if we are in the Some state
23461 void COption_CustomOnionMessageContentsZ_free(struct LDKCOption_CustomOnionMessageContentsZ _res);
23464 * Creates a new COption_CustomOnionMessageContentsZ which has the same data as `orig`
23465 * but with all dynamically-allocated buffers duplicated in new buffers.
23467 struct LDKCOption_CustomOnionMessageContentsZ COption_CustomOnionMessageContentsZ_clone(const struct LDKCOption_CustomOnionMessageContentsZ *NONNULL_PTR orig);
23470 * Creates a new CResult_COption_CustomOnionMessageContentsZDecodeErrorZ in the success state.
23472 struct LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ CResult_COption_CustomOnionMessageContentsZDecodeErrorZ_ok(struct LDKCOption_CustomOnionMessageContentsZ o);
23475 * Creates a new CResult_COption_CustomOnionMessageContentsZDecodeErrorZ in the error state.
23477 struct LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ CResult_COption_CustomOnionMessageContentsZDecodeErrorZ_err(struct LDKDecodeError e);
23480 * Checks if the given object is currently in the success state
23482 bool CResult_COption_CustomOnionMessageContentsZDecodeErrorZ_is_ok(const struct LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ *NONNULL_PTR o);
23485 * Frees any resources used by the CResult_COption_CustomOnionMessageContentsZDecodeErrorZ.
23487 void CResult_COption_CustomOnionMessageContentsZDecodeErrorZ_free(struct LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ _res);
23490 * Creates a new CResult_COption_CustomOnionMessageContentsZDecodeErrorZ which has the same data as `orig`
23491 * but with all dynamically-allocated buffers duplicated in new buffers.
23493 struct LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ CResult_COption_CustomOnionMessageContentsZDecodeErrorZ_clone(const struct LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ *NONNULL_PTR orig);
23496 * Constructs a new COption_TypeZ containing a crate::lightning::ln::wire::Type
23498 struct LDKCOption_TypeZ COption_TypeZ_some(struct LDKType o);
23501 * Constructs a new COption_TypeZ containing nothing
23503 struct LDKCOption_TypeZ COption_TypeZ_none(void);
23506 * Frees any resources associated with the crate::lightning::ln::wire::Type, if we are in the Some state
23508 void COption_TypeZ_free(struct LDKCOption_TypeZ _res);
23511 * Creates a new COption_TypeZ which has the same data as `orig`
23512 * but with all dynamically-allocated buffers duplicated in new buffers.
23514 struct LDKCOption_TypeZ COption_TypeZ_clone(const struct LDKCOption_TypeZ *NONNULL_PTR orig);
23517 * Creates a new CResult_COption_TypeZDecodeErrorZ in the success state.
23519 struct LDKCResult_COption_TypeZDecodeErrorZ CResult_COption_TypeZDecodeErrorZ_ok(struct LDKCOption_TypeZ o);
23522 * Creates a new CResult_COption_TypeZDecodeErrorZ in the error state.
23524 struct LDKCResult_COption_TypeZDecodeErrorZ CResult_COption_TypeZDecodeErrorZ_err(struct LDKDecodeError e);
23527 * Checks if the given object is currently in the success state
23529 bool CResult_COption_TypeZDecodeErrorZ_is_ok(const struct LDKCResult_COption_TypeZDecodeErrorZ *NONNULL_PTR o);
23532 * Frees any resources used by the CResult_COption_TypeZDecodeErrorZ.
23534 void CResult_COption_TypeZDecodeErrorZ_free(struct LDKCResult_COption_TypeZDecodeErrorZ _res);
23537 * Creates a new CResult_COption_TypeZDecodeErrorZ which has the same data as `orig`
23538 * but with all dynamically-allocated buffers duplicated in new buffers.
23540 struct LDKCResult_COption_TypeZDecodeErrorZ CResult_COption_TypeZDecodeErrorZ_clone(const struct LDKCResult_COption_TypeZDecodeErrorZ *NONNULL_PTR orig);
23543 * Constructs a new COption_SocketAddressZ containing a crate::lightning::ln::msgs::SocketAddress
23545 struct LDKCOption_SocketAddressZ COption_SocketAddressZ_some(struct LDKSocketAddress o);
23548 * Constructs a new COption_SocketAddressZ containing nothing
23550 struct LDKCOption_SocketAddressZ COption_SocketAddressZ_none(void);
23553 * Frees any resources associated with the crate::lightning::ln::msgs::SocketAddress, if we are in the Some state
23555 void COption_SocketAddressZ_free(struct LDKCOption_SocketAddressZ _res);
23558 * Creates a new COption_SocketAddressZ which has the same data as `orig`
23559 * but with all dynamically-allocated buffers duplicated in new buffers.
23561 struct LDKCOption_SocketAddressZ COption_SocketAddressZ_clone(const struct LDKCOption_SocketAddressZ *NONNULL_PTR orig);
23564 * Creates a new tuple which has the same data as `orig`
23565 * but with all dynamically-allocated buffers duplicated in new buffers.
23567 struct LDKC2Tuple_PublicKeyCOption_SocketAddressZZ C2Tuple_PublicKeyCOption_SocketAddressZZ_clone(const struct LDKC2Tuple_PublicKeyCOption_SocketAddressZZ *NONNULL_PTR orig);
23570 * Creates a new C2Tuple_PublicKeyCOption_SocketAddressZZ from the contained elements.
23572 struct LDKC2Tuple_PublicKeyCOption_SocketAddressZZ C2Tuple_PublicKeyCOption_SocketAddressZZ_new(struct LDKPublicKey a, struct LDKCOption_SocketAddressZ b);
23575 * Frees any resources used by the C2Tuple_PublicKeyCOption_SocketAddressZZ.
23577 void C2Tuple_PublicKeyCOption_SocketAddressZZ_free(struct LDKC2Tuple_PublicKeyCOption_SocketAddressZZ _res);
23580 * Frees the buffer pointed to by `data` if `datalen` is non-0.
23582 void CVec_C2Tuple_PublicKeyCOption_SocketAddressZZZ_free(struct LDKCVec_C2Tuple_PublicKeyCOption_SocketAddressZZZ _res);
23585 * Creates a new CResult_CVec_u8ZPeerHandleErrorZ in the success state.
23587 struct LDKCResult_CVec_u8ZPeerHandleErrorZ CResult_CVec_u8ZPeerHandleErrorZ_ok(struct LDKCVec_u8Z o);
23590 * Creates a new CResult_CVec_u8ZPeerHandleErrorZ in the error state.
23592 struct LDKCResult_CVec_u8ZPeerHandleErrorZ CResult_CVec_u8ZPeerHandleErrorZ_err(struct LDKPeerHandleError e);
23595 * Checks if the given object is currently in the success state
23597 bool CResult_CVec_u8ZPeerHandleErrorZ_is_ok(const struct LDKCResult_CVec_u8ZPeerHandleErrorZ *NONNULL_PTR o);
23600 * Frees any resources used by the CResult_CVec_u8ZPeerHandleErrorZ.
23602 void CResult_CVec_u8ZPeerHandleErrorZ_free(struct LDKCResult_CVec_u8ZPeerHandleErrorZ _res);
23605 * Creates a new CResult_CVec_u8ZPeerHandleErrorZ which has the same data as `orig`
23606 * but with all dynamically-allocated buffers duplicated in new buffers.
23608 struct LDKCResult_CVec_u8ZPeerHandleErrorZ CResult_CVec_u8ZPeerHandleErrorZ_clone(const struct LDKCResult_CVec_u8ZPeerHandleErrorZ *NONNULL_PTR orig);
23611 * Creates a new CResult_NonePeerHandleErrorZ in the success state.
23613 struct LDKCResult_NonePeerHandleErrorZ CResult_NonePeerHandleErrorZ_ok(void);
23616 * Creates a new CResult_NonePeerHandleErrorZ in the error state.
23618 struct LDKCResult_NonePeerHandleErrorZ CResult_NonePeerHandleErrorZ_err(struct LDKPeerHandleError e);
23621 * Checks if the given object is currently in the success state
23623 bool CResult_NonePeerHandleErrorZ_is_ok(const struct LDKCResult_NonePeerHandleErrorZ *NONNULL_PTR o);
23626 * Frees any resources used by the CResult_NonePeerHandleErrorZ.
23628 void CResult_NonePeerHandleErrorZ_free(struct LDKCResult_NonePeerHandleErrorZ _res);
23631 * Creates a new CResult_NonePeerHandleErrorZ which has the same data as `orig`
23632 * but with all dynamically-allocated buffers duplicated in new buffers.
23634 struct LDKCResult_NonePeerHandleErrorZ CResult_NonePeerHandleErrorZ_clone(const struct LDKCResult_NonePeerHandleErrorZ *NONNULL_PTR orig);
23637 * Creates a new CResult_boolPeerHandleErrorZ in the success state.
23639 struct LDKCResult_boolPeerHandleErrorZ CResult_boolPeerHandleErrorZ_ok(bool o);
23642 * Creates a new CResult_boolPeerHandleErrorZ in the error state.
23644 struct LDKCResult_boolPeerHandleErrorZ CResult_boolPeerHandleErrorZ_err(struct LDKPeerHandleError e);
23647 * Checks if the given object is currently in the success state
23649 bool CResult_boolPeerHandleErrorZ_is_ok(const struct LDKCResult_boolPeerHandleErrorZ *NONNULL_PTR o);
23652 * Frees any resources used by the CResult_boolPeerHandleErrorZ.
23654 void CResult_boolPeerHandleErrorZ_free(struct LDKCResult_boolPeerHandleErrorZ _res);
23657 * Creates a new CResult_boolPeerHandleErrorZ which has the same data as `orig`
23658 * but with all dynamically-allocated buffers duplicated in new buffers.
23660 struct LDKCResult_boolPeerHandleErrorZ CResult_boolPeerHandleErrorZ_clone(const struct LDKCResult_boolPeerHandleErrorZ *NONNULL_PTR orig);
23663 * Creates a new CResult_u32GraphSyncErrorZ in the success state.
23665 struct LDKCResult_u32GraphSyncErrorZ CResult_u32GraphSyncErrorZ_ok(uint32_t o);
23668 * Creates a new CResult_u32GraphSyncErrorZ in the error state.
23670 struct LDKCResult_u32GraphSyncErrorZ CResult_u32GraphSyncErrorZ_err(struct LDKGraphSyncError e);
23673 * Checks if the given object is currently in the success state
23675 bool CResult_u32GraphSyncErrorZ_is_ok(const struct LDKCResult_u32GraphSyncErrorZ *NONNULL_PTR o);
23678 * Frees any resources used by the CResult_u32GraphSyncErrorZ.
23680 void CResult_u32GraphSyncErrorZ_free(struct LDKCResult_u32GraphSyncErrorZ _res);
23683 * Creates a new CResult_CVec_u8ZIOErrorZ in the success state.
23685 struct LDKCResult_CVec_u8ZIOErrorZ CResult_CVec_u8ZIOErrorZ_ok(struct LDKCVec_u8Z o);
23688 * Creates a new CResult_CVec_u8ZIOErrorZ in the error state.
23690 struct LDKCResult_CVec_u8ZIOErrorZ CResult_CVec_u8ZIOErrorZ_err(enum LDKIOError e);
23693 * Checks if the given object is currently in the success state
23695 bool CResult_CVec_u8ZIOErrorZ_is_ok(const struct LDKCResult_CVec_u8ZIOErrorZ *NONNULL_PTR o);
23698 * Frees any resources used by the CResult_CVec_u8ZIOErrorZ.
23700 void CResult_CVec_u8ZIOErrorZ_free(struct LDKCResult_CVec_u8ZIOErrorZ _res);
23703 * Creates a new CResult_CVec_u8ZIOErrorZ which has the same data as `orig`
23704 * but with all dynamically-allocated buffers duplicated in new buffers.
23706 struct LDKCResult_CVec_u8ZIOErrorZ CResult_CVec_u8ZIOErrorZ_clone(const struct LDKCResult_CVec_u8ZIOErrorZ *NONNULL_PTR orig);
23709 * Frees the buffer pointed to by `data` if `datalen` is non-0.
23711 void CVec_StrZ_free(struct LDKCVec_StrZ _res);
23714 * Creates a new CResult_CVec_StrZIOErrorZ in the success state.
23716 struct LDKCResult_CVec_StrZIOErrorZ CResult_CVec_StrZIOErrorZ_ok(struct LDKCVec_StrZ o);
23719 * Creates a new CResult_CVec_StrZIOErrorZ in the error state.
23721 struct LDKCResult_CVec_StrZIOErrorZ CResult_CVec_StrZIOErrorZ_err(enum LDKIOError e);
23724 * Checks if the given object is currently in the success state
23726 bool CResult_CVec_StrZIOErrorZ_is_ok(const struct LDKCResult_CVec_StrZIOErrorZ *NONNULL_PTR o);
23729 * Frees any resources used by the CResult_CVec_StrZIOErrorZ.
23731 void CResult_CVec_StrZIOErrorZ_free(struct LDKCResult_CVec_StrZIOErrorZ _res);
23734 * Creates a new CResult_CVec_StrZIOErrorZ which has the same data as `orig`
23735 * but with all dynamically-allocated buffers duplicated in new buffers.
23737 struct LDKCResult_CVec_StrZIOErrorZ CResult_CVec_StrZIOErrorZ_clone(const struct LDKCResult_CVec_StrZIOErrorZ *NONNULL_PTR orig);
23740 * Frees the buffer pointed to by `data` if `datalen` is non-0.
23742 void CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZ_free(struct LDKCVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZ _res);
23745 * Creates a new CResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ in the success state.
23747 struct LDKCResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ CResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ_ok(struct LDKCVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZ o);
23750 * Creates a new CResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ in the error state.
23752 struct LDKCResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ CResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ_err(enum LDKIOError e);
23755 * Checks if the given object is currently in the success state
23757 bool CResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ_is_ok(const struct LDKCResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ *NONNULL_PTR o);
23760 * Frees any resources used by the CResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ.
23762 void CResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ_free(struct LDKCResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ _res);
23765 * Creates a new CResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ which has the same data as `orig`
23766 * but with all dynamically-allocated buffers duplicated in new buffers.
23768 struct LDKCResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ CResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ_clone(const struct LDKCResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ *NONNULL_PTR orig);
23771 * Creates a new CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ in the success state.
23773 struct LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ_ok(struct LDKC2Tuple_ThirtyTwoBytesChannelMonitorZ o);
23776 * Creates a new CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ in the error state.
23778 struct LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ_err(enum LDKIOError e);
23781 * Checks if the given object is currently in the success state
23783 bool CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ_is_ok(const struct LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ *NONNULL_PTR o);
23786 * Frees any resources used by the CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ.
23788 void CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ_free(struct LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ _res);
23791 * Creates a new CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ which has the same data as `orig`
23792 * but with all dynamically-allocated buffers duplicated in new buffers.
23794 struct LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ_clone(const struct LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ *NONNULL_PTR orig);
23797 * Constructs a new COption_SecretKeyZ containing a crate::c_types::SecretKey
23799 struct LDKCOption_SecretKeyZ COption_SecretKeyZ_some(struct LDKSecretKey o);
23802 * Constructs a new COption_SecretKeyZ containing nothing
23804 struct LDKCOption_SecretKeyZ COption_SecretKeyZ_none(void);
23807 * Frees any resources associated with the crate::c_types::SecretKey, if we are in the Some state
23809 void COption_SecretKeyZ_free(struct LDKCOption_SecretKeyZ _res);
23812 * Creates a new COption_SecretKeyZ which has the same data as `orig`
23813 * but with all dynamically-allocated buffers duplicated in new buffers.
23815 struct LDKCOption_SecretKeyZ COption_SecretKeyZ_clone(const struct LDKCOption_SecretKeyZ *NONNULL_PTR orig);
23818 * Creates a new CResult_VerifiedInvoiceRequestNoneZ in the success state.
23820 struct LDKCResult_VerifiedInvoiceRequestNoneZ CResult_VerifiedInvoiceRequestNoneZ_ok(struct LDKVerifiedInvoiceRequest o);
23823 * Creates a new CResult_VerifiedInvoiceRequestNoneZ in the error state.
23825 struct LDKCResult_VerifiedInvoiceRequestNoneZ CResult_VerifiedInvoiceRequestNoneZ_err(void);
23828 * Checks if the given object is currently in the success state
23830 bool CResult_VerifiedInvoiceRequestNoneZ_is_ok(const struct LDKCResult_VerifiedInvoiceRequestNoneZ *NONNULL_PTR o);
23833 * Frees any resources used by the CResult_VerifiedInvoiceRequestNoneZ.
23835 void CResult_VerifiedInvoiceRequestNoneZ_free(struct LDKCResult_VerifiedInvoiceRequestNoneZ _res);
23838 * Creates a new CResult_VerifiedInvoiceRequestNoneZ which has the same data as `orig`
23839 * but with all dynamically-allocated buffers duplicated in new buffers.
23841 struct LDKCResult_VerifiedInvoiceRequestNoneZ CResult_VerifiedInvoiceRequestNoneZ_clone(const struct LDKCResult_VerifiedInvoiceRequestNoneZ *NONNULL_PTR orig);
23844 * Constructs a new COption_NoneZ containing a
23846 enum LDKCOption_NoneZ COption_NoneZ_some(void);
23849 * Constructs a new COption_NoneZ containing nothing
23851 enum LDKCOption_NoneZ COption_NoneZ_none(void);
23854 * Frees any resources associated with the , if we are in the Some state
23856 void COption_NoneZ_free(enum LDKCOption_NoneZ _res);
23859 * Frees the buffer pointed to by `data` if `datalen` is non-0.
23861 void CVec_WitnessZ_free(struct LDKCVec_WitnessZ _res);
23864 * Constructs a new COption_i64Z containing a i64
23866 struct LDKCOption_i64Z COption_i64Z_some(int64_t o);
23869 * Constructs a new COption_i64Z containing nothing
23871 struct LDKCOption_i64Z COption_i64Z_none(void);
23874 * Frees any resources associated with the i64, if we are in the Some state
23876 void COption_i64Z_free(struct LDKCOption_i64Z _res);
23879 * Creates a new COption_i64Z which has the same data as `orig`
23880 * but with all dynamically-allocated buffers duplicated in new buffers.
23882 struct LDKCOption_i64Z COption_i64Z_clone(const struct LDKCOption_i64Z *NONNULL_PTR orig);
23885 * Creates a new CResult_SocketAddressDecodeErrorZ in the success state.
23887 struct LDKCResult_SocketAddressDecodeErrorZ CResult_SocketAddressDecodeErrorZ_ok(struct LDKSocketAddress o);
23890 * Creates a new CResult_SocketAddressDecodeErrorZ in the error state.
23892 struct LDKCResult_SocketAddressDecodeErrorZ CResult_SocketAddressDecodeErrorZ_err(struct LDKDecodeError e);
23895 * Checks if the given object is currently in the success state
23897 bool CResult_SocketAddressDecodeErrorZ_is_ok(const struct LDKCResult_SocketAddressDecodeErrorZ *NONNULL_PTR o);
23900 * Frees any resources used by the CResult_SocketAddressDecodeErrorZ.
23902 void CResult_SocketAddressDecodeErrorZ_free(struct LDKCResult_SocketAddressDecodeErrorZ _res);
23905 * Creates a new CResult_SocketAddressDecodeErrorZ which has the same data as `orig`
23906 * but with all dynamically-allocated buffers duplicated in new buffers.
23908 struct LDKCResult_SocketAddressDecodeErrorZ CResult_SocketAddressDecodeErrorZ_clone(const struct LDKCResult_SocketAddressDecodeErrorZ *NONNULL_PTR orig);
23911 * Creates a new CResult_SocketAddressSocketAddressParseErrorZ in the success state.
23913 struct LDKCResult_SocketAddressSocketAddressParseErrorZ CResult_SocketAddressSocketAddressParseErrorZ_ok(struct LDKSocketAddress o);
23916 * Creates a new CResult_SocketAddressSocketAddressParseErrorZ in the error state.
23918 struct LDKCResult_SocketAddressSocketAddressParseErrorZ CResult_SocketAddressSocketAddressParseErrorZ_err(enum LDKSocketAddressParseError e);
23921 * Checks if the given object is currently in the success state
23923 bool CResult_SocketAddressSocketAddressParseErrorZ_is_ok(const struct LDKCResult_SocketAddressSocketAddressParseErrorZ *NONNULL_PTR o);
23926 * Frees any resources used by the CResult_SocketAddressSocketAddressParseErrorZ.
23928 void CResult_SocketAddressSocketAddressParseErrorZ_free(struct LDKCResult_SocketAddressSocketAddressParseErrorZ _res);
23931 * Creates a new CResult_SocketAddressSocketAddressParseErrorZ which has the same data as `orig`
23932 * but with all dynamically-allocated buffers duplicated in new buffers.
23934 struct LDKCResult_SocketAddressSocketAddressParseErrorZ CResult_SocketAddressSocketAddressParseErrorZ_clone(const struct LDKCResult_SocketAddressSocketAddressParseErrorZ *NONNULL_PTR orig);
23937 * Frees the buffer pointed to by `data` if `datalen` is non-0.
23939 void CVec_UpdateAddHTLCZ_free(struct LDKCVec_UpdateAddHTLCZ _res);
23942 * Frees the buffer pointed to by `data` if `datalen` is non-0.
23944 void CVec_UpdateFulfillHTLCZ_free(struct LDKCVec_UpdateFulfillHTLCZ _res);
23947 * Frees the buffer pointed to by `data` if `datalen` is non-0.
23949 void CVec_UpdateFailHTLCZ_free(struct LDKCVec_UpdateFailHTLCZ _res);
23952 * Frees the buffer pointed to by `data` if `datalen` is non-0.
23954 void CVec_UpdateFailMalformedHTLCZ_free(struct LDKCVec_UpdateFailMalformedHTLCZ _res);
23957 * Creates a new CResult_AcceptChannelDecodeErrorZ in the success state.
23959 struct LDKCResult_AcceptChannelDecodeErrorZ CResult_AcceptChannelDecodeErrorZ_ok(struct LDKAcceptChannel o);
23962 * Creates a new CResult_AcceptChannelDecodeErrorZ in the error state.
23964 struct LDKCResult_AcceptChannelDecodeErrorZ CResult_AcceptChannelDecodeErrorZ_err(struct LDKDecodeError e);
23967 * Checks if the given object is currently in the success state
23969 bool CResult_AcceptChannelDecodeErrorZ_is_ok(const struct LDKCResult_AcceptChannelDecodeErrorZ *NONNULL_PTR o);
23972 * Frees any resources used by the CResult_AcceptChannelDecodeErrorZ.
23974 void CResult_AcceptChannelDecodeErrorZ_free(struct LDKCResult_AcceptChannelDecodeErrorZ _res);
23977 * Creates a new CResult_AcceptChannelDecodeErrorZ which has the same data as `orig`
23978 * but with all dynamically-allocated buffers duplicated in new buffers.
23980 struct LDKCResult_AcceptChannelDecodeErrorZ CResult_AcceptChannelDecodeErrorZ_clone(const struct LDKCResult_AcceptChannelDecodeErrorZ *NONNULL_PTR orig);
23983 * Creates a new CResult_AcceptChannelV2DecodeErrorZ in the success state.
23985 struct LDKCResult_AcceptChannelV2DecodeErrorZ CResult_AcceptChannelV2DecodeErrorZ_ok(struct LDKAcceptChannelV2 o);
23988 * Creates a new CResult_AcceptChannelV2DecodeErrorZ in the error state.
23990 struct LDKCResult_AcceptChannelV2DecodeErrorZ CResult_AcceptChannelV2DecodeErrorZ_err(struct LDKDecodeError e);
23993 * Checks if the given object is currently in the success state
23995 bool CResult_AcceptChannelV2DecodeErrorZ_is_ok(const struct LDKCResult_AcceptChannelV2DecodeErrorZ *NONNULL_PTR o);
23998 * Frees any resources used by the CResult_AcceptChannelV2DecodeErrorZ.
24000 void CResult_AcceptChannelV2DecodeErrorZ_free(struct LDKCResult_AcceptChannelV2DecodeErrorZ _res);
24003 * Creates a new CResult_AcceptChannelV2DecodeErrorZ which has the same data as `orig`
24004 * but with all dynamically-allocated buffers duplicated in new buffers.
24006 struct LDKCResult_AcceptChannelV2DecodeErrorZ CResult_AcceptChannelV2DecodeErrorZ_clone(const struct LDKCResult_AcceptChannelV2DecodeErrorZ *NONNULL_PTR orig);
24009 * Creates a new CResult_TxAddInputDecodeErrorZ in the success state.
24011 struct LDKCResult_TxAddInputDecodeErrorZ CResult_TxAddInputDecodeErrorZ_ok(struct LDKTxAddInput o);
24014 * Creates a new CResult_TxAddInputDecodeErrorZ in the error state.
24016 struct LDKCResult_TxAddInputDecodeErrorZ CResult_TxAddInputDecodeErrorZ_err(struct LDKDecodeError e);
24019 * Checks if the given object is currently in the success state
24021 bool CResult_TxAddInputDecodeErrorZ_is_ok(const struct LDKCResult_TxAddInputDecodeErrorZ *NONNULL_PTR o);
24024 * Frees any resources used by the CResult_TxAddInputDecodeErrorZ.
24026 void CResult_TxAddInputDecodeErrorZ_free(struct LDKCResult_TxAddInputDecodeErrorZ _res);
24029 * Creates a new CResult_TxAddInputDecodeErrorZ which has the same data as `orig`
24030 * but with all dynamically-allocated buffers duplicated in new buffers.
24032 struct LDKCResult_TxAddInputDecodeErrorZ CResult_TxAddInputDecodeErrorZ_clone(const struct LDKCResult_TxAddInputDecodeErrorZ *NONNULL_PTR orig);
24035 * Creates a new CResult_TxAddOutputDecodeErrorZ in the success state.
24037 struct LDKCResult_TxAddOutputDecodeErrorZ CResult_TxAddOutputDecodeErrorZ_ok(struct LDKTxAddOutput o);
24040 * Creates a new CResult_TxAddOutputDecodeErrorZ in the error state.
24042 struct LDKCResult_TxAddOutputDecodeErrorZ CResult_TxAddOutputDecodeErrorZ_err(struct LDKDecodeError e);
24045 * Checks if the given object is currently in the success state
24047 bool CResult_TxAddOutputDecodeErrorZ_is_ok(const struct LDKCResult_TxAddOutputDecodeErrorZ *NONNULL_PTR o);
24050 * Frees any resources used by the CResult_TxAddOutputDecodeErrorZ.
24052 void CResult_TxAddOutputDecodeErrorZ_free(struct LDKCResult_TxAddOutputDecodeErrorZ _res);
24055 * Creates a new CResult_TxAddOutputDecodeErrorZ which has the same data as `orig`
24056 * but with all dynamically-allocated buffers duplicated in new buffers.
24058 struct LDKCResult_TxAddOutputDecodeErrorZ CResult_TxAddOutputDecodeErrorZ_clone(const struct LDKCResult_TxAddOutputDecodeErrorZ *NONNULL_PTR orig);
24061 * Creates a new CResult_TxRemoveInputDecodeErrorZ in the success state.
24063 struct LDKCResult_TxRemoveInputDecodeErrorZ CResult_TxRemoveInputDecodeErrorZ_ok(struct LDKTxRemoveInput o);
24066 * Creates a new CResult_TxRemoveInputDecodeErrorZ in the error state.
24068 struct LDKCResult_TxRemoveInputDecodeErrorZ CResult_TxRemoveInputDecodeErrorZ_err(struct LDKDecodeError e);
24071 * Checks if the given object is currently in the success state
24073 bool CResult_TxRemoveInputDecodeErrorZ_is_ok(const struct LDKCResult_TxRemoveInputDecodeErrorZ *NONNULL_PTR o);
24076 * Frees any resources used by the CResult_TxRemoveInputDecodeErrorZ.
24078 void CResult_TxRemoveInputDecodeErrorZ_free(struct LDKCResult_TxRemoveInputDecodeErrorZ _res);
24081 * Creates a new CResult_TxRemoveInputDecodeErrorZ which has the same data as `orig`
24082 * but with all dynamically-allocated buffers duplicated in new buffers.
24084 struct LDKCResult_TxRemoveInputDecodeErrorZ CResult_TxRemoveInputDecodeErrorZ_clone(const struct LDKCResult_TxRemoveInputDecodeErrorZ *NONNULL_PTR orig);
24087 * Creates a new CResult_TxRemoveOutputDecodeErrorZ in the success state.
24089 struct LDKCResult_TxRemoveOutputDecodeErrorZ CResult_TxRemoveOutputDecodeErrorZ_ok(struct LDKTxRemoveOutput o);
24092 * Creates a new CResult_TxRemoveOutputDecodeErrorZ in the error state.
24094 struct LDKCResult_TxRemoveOutputDecodeErrorZ CResult_TxRemoveOutputDecodeErrorZ_err(struct LDKDecodeError e);
24097 * Checks if the given object is currently in the success state
24099 bool CResult_TxRemoveOutputDecodeErrorZ_is_ok(const struct LDKCResult_TxRemoveOutputDecodeErrorZ *NONNULL_PTR o);
24102 * Frees any resources used by the CResult_TxRemoveOutputDecodeErrorZ.
24104 void CResult_TxRemoveOutputDecodeErrorZ_free(struct LDKCResult_TxRemoveOutputDecodeErrorZ _res);
24107 * Creates a new CResult_TxRemoveOutputDecodeErrorZ which has the same data as `orig`
24108 * but with all dynamically-allocated buffers duplicated in new buffers.
24110 struct LDKCResult_TxRemoveOutputDecodeErrorZ CResult_TxRemoveOutputDecodeErrorZ_clone(const struct LDKCResult_TxRemoveOutputDecodeErrorZ *NONNULL_PTR orig);
24113 * Creates a new CResult_TxCompleteDecodeErrorZ in the success state.
24115 struct LDKCResult_TxCompleteDecodeErrorZ CResult_TxCompleteDecodeErrorZ_ok(struct LDKTxComplete o);
24118 * Creates a new CResult_TxCompleteDecodeErrorZ in the error state.
24120 struct LDKCResult_TxCompleteDecodeErrorZ CResult_TxCompleteDecodeErrorZ_err(struct LDKDecodeError e);
24123 * Checks if the given object is currently in the success state
24125 bool CResult_TxCompleteDecodeErrorZ_is_ok(const struct LDKCResult_TxCompleteDecodeErrorZ *NONNULL_PTR o);
24128 * Frees any resources used by the CResult_TxCompleteDecodeErrorZ.
24130 void CResult_TxCompleteDecodeErrorZ_free(struct LDKCResult_TxCompleteDecodeErrorZ _res);
24133 * Creates a new CResult_TxCompleteDecodeErrorZ which has the same data as `orig`
24134 * but with all dynamically-allocated buffers duplicated in new buffers.
24136 struct LDKCResult_TxCompleteDecodeErrorZ CResult_TxCompleteDecodeErrorZ_clone(const struct LDKCResult_TxCompleteDecodeErrorZ *NONNULL_PTR orig);
24139 * Creates a new CResult_TxSignaturesDecodeErrorZ in the success state.
24141 struct LDKCResult_TxSignaturesDecodeErrorZ CResult_TxSignaturesDecodeErrorZ_ok(struct LDKTxSignatures o);
24144 * Creates a new CResult_TxSignaturesDecodeErrorZ in the error state.
24146 struct LDKCResult_TxSignaturesDecodeErrorZ CResult_TxSignaturesDecodeErrorZ_err(struct LDKDecodeError e);
24149 * Checks if the given object is currently in the success state
24151 bool CResult_TxSignaturesDecodeErrorZ_is_ok(const struct LDKCResult_TxSignaturesDecodeErrorZ *NONNULL_PTR o);
24154 * Frees any resources used by the CResult_TxSignaturesDecodeErrorZ.
24156 void CResult_TxSignaturesDecodeErrorZ_free(struct LDKCResult_TxSignaturesDecodeErrorZ _res);
24159 * Creates a new CResult_TxSignaturesDecodeErrorZ which has the same data as `orig`
24160 * but with all dynamically-allocated buffers duplicated in new buffers.
24162 struct LDKCResult_TxSignaturesDecodeErrorZ CResult_TxSignaturesDecodeErrorZ_clone(const struct LDKCResult_TxSignaturesDecodeErrorZ *NONNULL_PTR orig);
24165 * Creates a new CResult_TxInitRbfDecodeErrorZ in the success state.
24167 struct LDKCResult_TxInitRbfDecodeErrorZ CResult_TxInitRbfDecodeErrorZ_ok(struct LDKTxInitRbf o);
24170 * Creates a new CResult_TxInitRbfDecodeErrorZ in the error state.
24172 struct LDKCResult_TxInitRbfDecodeErrorZ CResult_TxInitRbfDecodeErrorZ_err(struct LDKDecodeError e);
24175 * Checks if the given object is currently in the success state
24177 bool CResult_TxInitRbfDecodeErrorZ_is_ok(const struct LDKCResult_TxInitRbfDecodeErrorZ *NONNULL_PTR o);
24180 * Frees any resources used by the CResult_TxInitRbfDecodeErrorZ.
24182 void CResult_TxInitRbfDecodeErrorZ_free(struct LDKCResult_TxInitRbfDecodeErrorZ _res);
24185 * Creates a new CResult_TxInitRbfDecodeErrorZ which has the same data as `orig`
24186 * but with all dynamically-allocated buffers duplicated in new buffers.
24188 struct LDKCResult_TxInitRbfDecodeErrorZ CResult_TxInitRbfDecodeErrorZ_clone(const struct LDKCResult_TxInitRbfDecodeErrorZ *NONNULL_PTR orig);
24191 * Creates a new CResult_TxAckRbfDecodeErrorZ in the success state.
24193 struct LDKCResult_TxAckRbfDecodeErrorZ CResult_TxAckRbfDecodeErrorZ_ok(struct LDKTxAckRbf o);
24196 * Creates a new CResult_TxAckRbfDecodeErrorZ in the error state.
24198 struct LDKCResult_TxAckRbfDecodeErrorZ CResult_TxAckRbfDecodeErrorZ_err(struct LDKDecodeError e);
24201 * Checks if the given object is currently in the success state
24203 bool CResult_TxAckRbfDecodeErrorZ_is_ok(const struct LDKCResult_TxAckRbfDecodeErrorZ *NONNULL_PTR o);
24206 * Frees any resources used by the CResult_TxAckRbfDecodeErrorZ.
24208 void CResult_TxAckRbfDecodeErrorZ_free(struct LDKCResult_TxAckRbfDecodeErrorZ _res);
24211 * Creates a new CResult_TxAckRbfDecodeErrorZ which has the same data as `orig`
24212 * but with all dynamically-allocated buffers duplicated in new buffers.
24214 struct LDKCResult_TxAckRbfDecodeErrorZ CResult_TxAckRbfDecodeErrorZ_clone(const struct LDKCResult_TxAckRbfDecodeErrorZ *NONNULL_PTR orig);
24217 * Creates a new CResult_TxAbortDecodeErrorZ in the success state.
24219 struct LDKCResult_TxAbortDecodeErrorZ CResult_TxAbortDecodeErrorZ_ok(struct LDKTxAbort o);
24222 * Creates a new CResult_TxAbortDecodeErrorZ in the error state.
24224 struct LDKCResult_TxAbortDecodeErrorZ CResult_TxAbortDecodeErrorZ_err(struct LDKDecodeError e);
24227 * Checks if the given object is currently in the success state
24229 bool CResult_TxAbortDecodeErrorZ_is_ok(const struct LDKCResult_TxAbortDecodeErrorZ *NONNULL_PTR o);
24232 * Frees any resources used by the CResult_TxAbortDecodeErrorZ.
24234 void CResult_TxAbortDecodeErrorZ_free(struct LDKCResult_TxAbortDecodeErrorZ _res);
24237 * Creates a new CResult_TxAbortDecodeErrorZ which has the same data as `orig`
24238 * but with all dynamically-allocated buffers duplicated in new buffers.
24240 struct LDKCResult_TxAbortDecodeErrorZ CResult_TxAbortDecodeErrorZ_clone(const struct LDKCResult_TxAbortDecodeErrorZ *NONNULL_PTR orig);
24243 * Creates a new CResult_AnnouncementSignaturesDecodeErrorZ in the success state.
24245 struct LDKCResult_AnnouncementSignaturesDecodeErrorZ CResult_AnnouncementSignaturesDecodeErrorZ_ok(struct LDKAnnouncementSignatures o);
24248 * Creates a new CResult_AnnouncementSignaturesDecodeErrorZ in the error state.
24250 struct LDKCResult_AnnouncementSignaturesDecodeErrorZ CResult_AnnouncementSignaturesDecodeErrorZ_err(struct LDKDecodeError e);
24253 * Checks if the given object is currently in the success state
24255 bool CResult_AnnouncementSignaturesDecodeErrorZ_is_ok(const struct LDKCResult_AnnouncementSignaturesDecodeErrorZ *NONNULL_PTR o);
24258 * Frees any resources used by the CResult_AnnouncementSignaturesDecodeErrorZ.
24260 void CResult_AnnouncementSignaturesDecodeErrorZ_free(struct LDKCResult_AnnouncementSignaturesDecodeErrorZ _res);
24263 * Creates a new CResult_AnnouncementSignaturesDecodeErrorZ which has the same data as `orig`
24264 * but with all dynamically-allocated buffers duplicated in new buffers.
24266 struct LDKCResult_AnnouncementSignaturesDecodeErrorZ CResult_AnnouncementSignaturesDecodeErrorZ_clone(const struct LDKCResult_AnnouncementSignaturesDecodeErrorZ *NONNULL_PTR orig);
24269 * Creates a new CResult_ChannelReestablishDecodeErrorZ in the success state.
24271 struct LDKCResult_ChannelReestablishDecodeErrorZ CResult_ChannelReestablishDecodeErrorZ_ok(struct LDKChannelReestablish o);
24274 * Creates a new CResult_ChannelReestablishDecodeErrorZ in the error state.
24276 struct LDKCResult_ChannelReestablishDecodeErrorZ CResult_ChannelReestablishDecodeErrorZ_err(struct LDKDecodeError e);
24279 * Checks if the given object is currently in the success state
24281 bool CResult_ChannelReestablishDecodeErrorZ_is_ok(const struct LDKCResult_ChannelReestablishDecodeErrorZ *NONNULL_PTR o);
24284 * Frees any resources used by the CResult_ChannelReestablishDecodeErrorZ.
24286 void CResult_ChannelReestablishDecodeErrorZ_free(struct LDKCResult_ChannelReestablishDecodeErrorZ _res);
24289 * Creates a new CResult_ChannelReestablishDecodeErrorZ which has the same data as `orig`
24290 * but with all dynamically-allocated buffers duplicated in new buffers.
24292 struct LDKCResult_ChannelReestablishDecodeErrorZ CResult_ChannelReestablishDecodeErrorZ_clone(const struct LDKCResult_ChannelReestablishDecodeErrorZ *NONNULL_PTR orig);
24295 * Creates a new CResult_ClosingSignedDecodeErrorZ in the success state.
24297 struct LDKCResult_ClosingSignedDecodeErrorZ CResult_ClosingSignedDecodeErrorZ_ok(struct LDKClosingSigned o);
24300 * Creates a new CResult_ClosingSignedDecodeErrorZ in the error state.
24302 struct LDKCResult_ClosingSignedDecodeErrorZ CResult_ClosingSignedDecodeErrorZ_err(struct LDKDecodeError e);
24305 * Checks if the given object is currently in the success state
24307 bool CResult_ClosingSignedDecodeErrorZ_is_ok(const struct LDKCResult_ClosingSignedDecodeErrorZ *NONNULL_PTR o);
24310 * Frees any resources used by the CResult_ClosingSignedDecodeErrorZ.
24312 void CResult_ClosingSignedDecodeErrorZ_free(struct LDKCResult_ClosingSignedDecodeErrorZ _res);
24315 * Creates a new CResult_ClosingSignedDecodeErrorZ which has the same data as `orig`
24316 * but with all dynamically-allocated buffers duplicated in new buffers.
24318 struct LDKCResult_ClosingSignedDecodeErrorZ CResult_ClosingSignedDecodeErrorZ_clone(const struct LDKCResult_ClosingSignedDecodeErrorZ *NONNULL_PTR orig);
24321 * Creates a new CResult_ClosingSignedFeeRangeDecodeErrorZ in the success state.
24323 struct LDKCResult_ClosingSignedFeeRangeDecodeErrorZ CResult_ClosingSignedFeeRangeDecodeErrorZ_ok(struct LDKClosingSignedFeeRange o);
24326 * Creates a new CResult_ClosingSignedFeeRangeDecodeErrorZ in the error state.
24328 struct LDKCResult_ClosingSignedFeeRangeDecodeErrorZ CResult_ClosingSignedFeeRangeDecodeErrorZ_err(struct LDKDecodeError e);
24331 * Checks if the given object is currently in the success state
24333 bool CResult_ClosingSignedFeeRangeDecodeErrorZ_is_ok(const struct LDKCResult_ClosingSignedFeeRangeDecodeErrorZ *NONNULL_PTR o);
24336 * Frees any resources used by the CResult_ClosingSignedFeeRangeDecodeErrorZ.
24338 void CResult_ClosingSignedFeeRangeDecodeErrorZ_free(struct LDKCResult_ClosingSignedFeeRangeDecodeErrorZ _res);
24341 * Creates a new CResult_ClosingSignedFeeRangeDecodeErrorZ which has the same data as `orig`
24342 * but with all dynamically-allocated buffers duplicated in new buffers.
24344 struct LDKCResult_ClosingSignedFeeRangeDecodeErrorZ CResult_ClosingSignedFeeRangeDecodeErrorZ_clone(const struct LDKCResult_ClosingSignedFeeRangeDecodeErrorZ *NONNULL_PTR orig);
24347 * Creates a new CResult_CommitmentSignedDecodeErrorZ in the success state.
24349 struct LDKCResult_CommitmentSignedDecodeErrorZ CResult_CommitmentSignedDecodeErrorZ_ok(struct LDKCommitmentSigned o);
24352 * Creates a new CResult_CommitmentSignedDecodeErrorZ in the error state.
24354 struct LDKCResult_CommitmentSignedDecodeErrorZ CResult_CommitmentSignedDecodeErrorZ_err(struct LDKDecodeError e);
24357 * Checks if the given object is currently in the success state
24359 bool CResult_CommitmentSignedDecodeErrorZ_is_ok(const struct LDKCResult_CommitmentSignedDecodeErrorZ *NONNULL_PTR o);
24362 * Frees any resources used by the CResult_CommitmentSignedDecodeErrorZ.
24364 void CResult_CommitmentSignedDecodeErrorZ_free(struct LDKCResult_CommitmentSignedDecodeErrorZ _res);
24367 * Creates a new CResult_CommitmentSignedDecodeErrorZ which has the same data as `orig`
24368 * but with all dynamically-allocated buffers duplicated in new buffers.
24370 struct LDKCResult_CommitmentSignedDecodeErrorZ CResult_CommitmentSignedDecodeErrorZ_clone(const struct LDKCResult_CommitmentSignedDecodeErrorZ *NONNULL_PTR orig);
24373 * Creates a new CResult_FundingCreatedDecodeErrorZ in the success state.
24375 struct LDKCResult_FundingCreatedDecodeErrorZ CResult_FundingCreatedDecodeErrorZ_ok(struct LDKFundingCreated o);
24378 * Creates a new CResult_FundingCreatedDecodeErrorZ in the error state.
24380 struct LDKCResult_FundingCreatedDecodeErrorZ CResult_FundingCreatedDecodeErrorZ_err(struct LDKDecodeError e);
24383 * Checks if the given object is currently in the success state
24385 bool CResult_FundingCreatedDecodeErrorZ_is_ok(const struct LDKCResult_FundingCreatedDecodeErrorZ *NONNULL_PTR o);
24388 * Frees any resources used by the CResult_FundingCreatedDecodeErrorZ.
24390 void CResult_FundingCreatedDecodeErrorZ_free(struct LDKCResult_FundingCreatedDecodeErrorZ _res);
24393 * Creates a new CResult_FundingCreatedDecodeErrorZ which has the same data as `orig`
24394 * but with all dynamically-allocated buffers duplicated in new buffers.
24396 struct LDKCResult_FundingCreatedDecodeErrorZ CResult_FundingCreatedDecodeErrorZ_clone(const struct LDKCResult_FundingCreatedDecodeErrorZ *NONNULL_PTR orig);
24399 * Creates a new CResult_FundingSignedDecodeErrorZ in the success state.
24401 struct LDKCResult_FundingSignedDecodeErrorZ CResult_FundingSignedDecodeErrorZ_ok(struct LDKFundingSigned o);
24404 * Creates a new CResult_FundingSignedDecodeErrorZ in the error state.
24406 struct LDKCResult_FundingSignedDecodeErrorZ CResult_FundingSignedDecodeErrorZ_err(struct LDKDecodeError e);
24409 * Checks if the given object is currently in the success state
24411 bool CResult_FundingSignedDecodeErrorZ_is_ok(const struct LDKCResult_FundingSignedDecodeErrorZ *NONNULL_PTR o);
24414 * Frees any resources used by the CResult_FundingSignedDecodeErrorZ.
24416 void CResult_FundingSignedDecodeErrorZ_free(struct LDKCResult_FundingSignedDecodeErrorZ _res);
24419 * Creates a new CResult_FundingSignedDecodeErrorZ which has the same data as `orig`
24420 * but with all dynamically-allocated buffers duplicated in new buffers.
24422 struct LDKCResult_FundingSignedDecodeErrorZ CResult_FundingSignedDecodeErrorZ_clone(const struct LDKCResult_FundingSignedDecodeErrorZ *NONNULL_PTR orig);
24425 * Creates a new CResult_ChannelReadyDecodeErrorZ in the success state.
24427 struct LDKCResult_ChannelReadyDecodeErrorZ CResult_ChannelReadyDecodeErrorZ_ok(struct LDKChannelReady o);
24430 * Creates a new CResult_ChannelReadyDecodeErrorZ in the error state.
24432 struct LDKCResult_ChannelReadyDecodeErrorZ CResult_ChannelReadyDecodeErrorZ_err(struct LDKDecodeError e);
24435 * Checks if the given object is currently in the success state
24437 bool CResult_ChannelReadyDecodeErrorZ_is_ok(const struct LDKCResult_ChannelReadyDecodeErrorZ *NONNULL_PTR o);
24440 * Frees any resources used by the CResult_ChannelReadyDecodeErrorZ.
24442 void CResult_ChannelReadyDecodeErrorZ_free(struct LDKCResult_ChannelReadyDecodeErrorZ _res);
24445 * Creates a new CResult_ChannelReadyDecodeErrorZ which has the same data as `orig`
24446 * but with all dynamically-allocated buffers duplicated in new buffers.
24448 struct LDKCResult_ChannelReadyDecodeErrorZ CResult_ChannelReadyDecodeErrorZ_clone(const struct LDKCResult_ChannelReadyDecodeErrorZ *NONNULL_PTR orig);
24451 * Creates a new CResult_InitDecodeErrorZ in the success state.
24453 struct LDKCResult_InitDecodeErrorZ CResult_InitDecodeErrorZ_ok(struct LDKInit o);
24456 * Creates a new CResult_InitDecodeErrorZ in the error state.
24458 struct LDKCResult_InitDecodeErrorZ CResult_InitDecodeErrorZ_err(struct LDKDecodeError e);
24461 * Checks if the given object is currently in the success state
24463 bool CResult_InitDecodeErrorZ_is_ok(const struct LDKCResult_InitDecodeErrorZ *NONNULL_PTR o);
24466 * Frees any resources used by the CResult_InitDecodeErrorZ.
24468 void CResult_InitDecodeErrorZ_free(struct LDKCResult_InitDecodeErrorZ _res);
24471 * Creates a new CResult_InitDecodeErrorZ which has the same data as `orig`
24472 * but with all dynamically-allocated buffers duplicated in new buffers.
24474 struct LDKCResult_InitDecodeErrorZ CResult_InitDecodeErrorZ_clone(const struct LDKCResult_InitDecodeErrorZ *NONNULL_PTR orig);
24477 * Creates a new CResult_OpenChannelDecodeErrorZ in the success state.
24479 struct LDKCResult_OpenChannelDecodeErrorZ CResult_OpenChannelDecodeErrorZ_ok(struct LDKOpenChannel o);
24482 * Creates a new CResult_OpenChannelDecodeErrorZ in the error state.
24484 struct LDKCResult_OpenChannelDecodeErrorZ CResult_OpenChannelDecodeErrorZ_err(struct LDKDecodeError e);
24487 * Checks if the given object is currently in the success state
24489 bool CResult_OpenChannelDecodeErrorZ_is_ok(const struct LDKCResult_OpenChannelDecodeErrorZ *NONNULL_PTR o);
24492 * Frees any resources used by the CResult_OpenChannelDecodeErrorZ.
24494 void CResult_OpenChannelDecodeErrorZ_free(struct LDKCResult_OpenChannelDecodeErrorZ _res);
24497 * Creates a new CResult_OpenChannelDecodeErrorZ which has the same data as `orig`
24498 * but with all dynamically-allocated buffers duplicated in new buffers.
24500 struct LDKCResult_OpenChannelDecodeErrorZ CResult_OpenChannelDecodeErrorZ_clone(const struct LDKCResult_OpenChannelDecodeErrorZ *NONNULL_PTR orig);
24503 * Creates a new CResult_OpenChannelV2DecodeErrorZ in the success state.
24505 struct LDKCResult_OpenChannelV2DecodeErrorZ CResult_OpenChannelV2DecodeErrorZ_ok(struct LDKOpenChannelV2 o);
24508 * Creates a new CResult_OpenChannelV2DecodeErrorZ in the error state.
24510 struct LDKCResult_OpenChannelV2DecodeErrorZ CResult_OpenChannelV2DecodeErrorZ_err(struct LDKDecodeError e);
24513 * Checks if the given object is currently in the success state
24515 bool CResult_OpenChannelV2DecodeErrorZ_is_ok(const struct LDKCResult_OpenChannelV2DecodeErrorZ *NONNULL_PTR o);
24518 * Frees any resources used by the CResult_OpenChannelV2DecodeErrorZ.
24520 void CResult_OpenChannelV2DecodeErrorZ_free(struct LDKCResult_OpenChannelV2DecodeErrorZ _res);
24523 * Creates a new CResult_OpenChannelV2DecodeErrorZ which has the same data as `orig`
24524 * but with all dynamically-allocated buffers duplicated in new buffers.
24526 struct LDKCResult_OpenChannelV2DecodeErrorZ CResult_OpenChannelV2DecodeErrorZ_clone(const struct LDKCResult_OpenChannelV2DecodeErrorZ *NONNULL_PTR orig);
24529 * Creates a new CResult_RevokeAndACKDecodeErrorZ in the success state.
24531 struct LDKCResult_RevokeAndACKDecodeErrorZ CResult_RevokeAndACKDecodeErrorZ_ok(struct LDKRevokeAndACK o);
24534 * Creates a new CResult_RevokeAndACKDecodeErrorZ in the error state.
24536 struct LDKCResult_RevokeAndACKDecodeErrorZ CResult_RevokeAndACKDecodeErrorZ_err(struct LDKDecodeError e);
24539 * Checks if the given object is currently in the success state
24541 bool CResult_RevokeAndACKDecodeErrorZ_is_ok(const struct LDKCResult_RevokeAndACKDecodeErrorZ *NONNULL_PTR o);
24544 * Frees any resources used by the CResult_RevokeAndACKDecodeErrorZ.
24546 void CResult_RevokeAndACKDecodeErrorZ_free(struct LDKCResult_RevokeAndACKDecodeErrorZ _res);
24549 * Creates a new CResult_RevokeAndACKDecodeErrorZ which has the same data as `orig`
24550 * but with all dynamically-allocated buffers duplicated in new buffers.
24552 struct LDKCResult_RevokeAndACKDecodeErrorZ CResult_RevokeAndACKDecodeErrorZ_clone(const struct LDKCResult_RevokeAndACKDecodeErrorZ *NONNULL_PTR orig);
24555 * Creates a new CResult_ShutdownDecodeErrorZ in the success state.
24557 struct LDKCResult_ShutdownDecodeErrorZ CResult_ShutdownDecodeErrorZ_ok(struct LDKShutdown o);
24560 * Creates a new CResult_ShutdownDecodeErrorZ in the error state.
24562 struct LDKCResult_ShutdownDecodeErrorZ CResult_ShutdownDecodeErrorZ_err(struct LDKDecodeError e);
24565 * Checks if the given object is currently in the success state
24567 bool CResult_ShutdownDecodeErrorZ_is_ok(const struct LDKCResult_ShutdownDecodeErrorZ *NONNULL_PTR o);
24570 * Frees any resources used by the CResult_ShutdownDecodeErrorZ.
24572 void CResult_ShutdownDecodeErrorZ_free(struct LDKCResult_ShutdownDecodeErrorZ _res);
24575 * Creates a new CResult_ShutdownDecodeErrorZ which has the same data as `orig`
24576 * but with all dynamically-allocated buffers duplicated in new buffers.
24578 struct LDKCResult_ShutdownDecodeErrorZ CResult_ShutdownDecodeErrorZ_clone(const struct LDKCResult_ShutdownDecodeErrorZ *NONNULL_PTR orig);
24581 * Creates a new CResult_UpdateFailHTLCDecodeErrorZ in the success state.
24583 struct LDKCResult_UpdateFailHTLCDecodeErrorZ CResult_UpdateFailHTLCDecodeErrorZ_ok(struct LDKUpdateFailHTLC o);
24586 * Creates a new CResult_UpdateFailHTLCDecodeErrorZ in the error state.
24588 struct LDKCResult_UpdateFailHTLCDecodeErrorZ CResult_UpdateFailHTLCDecodeErrorZ_err(struct LDKDecodeError e);
24591 * Checks if the given object is currently in the success state
24593 bool CResult_UpdateFailHTLCDecodeErrorZ_is_ok(const struct LDKCResult_UpdateFailHTLCDecodeErrorZ *NONNULL_PTR o);
24596 * Frees any resources used by the CResult_UpdateFailHTLCDecodeErrorZ.
24598 void CResult_UpdateFailHTLCDecodeErrorZ_free(struct LDKCResult_UpdateFailHTLCDecodeErrorZ _res);
24601 * Creates a new CResult_UpdateFailHTLCDecodeErrorZ which has the same data as `orig`
24602 * but with all dynamically-allocated buffers duplicated in new buffers.
24604 struct LDKCResult_UpdateFailHTLCDecodeErrorZ CResult_UpdateFailHTLCDecodeErrorZ_clone(const struct LDKCResult_UpdateFailHTLCDecodeErrorZ *NONNULL_PTR orig);
24607 * Creates a new CResult_UpdateFailMalformedHTLCDecodeErrorZ in the success state.
24609 struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ CResult_UpdateFailMalformedHTLCDecodeErrorZ_ok(struct LDKUpdateFailMalformedHTLC o);
24612 * Creates a new CResult_UpdateFailMalformedHTLCDecodeErrorZ in the error state.
24614 struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ CResult_UpdateFailMalformedHTLCDecodeErrorZ_err(struct LDKDecodeError e);
24617 * Checks if the given object is currently in the success state
24619 bool CResult_UpdateFailMalformedHTLCDecodeErrorZ_is_ok(const struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ *NONNULL_PTR o);
24622 * Frees any resources used by the CResult_UpdateFailMalformedHTLCDecodeErrorZ.
24624 void CResult_UpdateFailMalformedHTLCDecodeErrorZ_free(struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ _res);
24627 * Creates a new CResult_UpdateFailMalformedHTLCDecodeErrorZ which has the same data as `orig`
24628 * but with all dynamically-allocated buffers duplicated in new buffers.
24630 struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ CResult_UpdateFailMalformedHTLCDecodeErrorZ_clone(const struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ *NONNULL_PTR orig);
24633 * Creates a new CResult_UpdateFeeDecodeErrorZ in the success state.
24635 struct LDKCResult_UpdateFeeDecodeErrorZ CResult_UpdateFeeDecodeErrorZ_ok(struct LDKUpdateFee o);
24638 * Creates a new CResult_UpdateFeeDecodeErrorZ in the error state.
24640 struct LDKCResult_UpdateFeeDecodeErrorZ CResult_UpdateFeeDecodeErrorZ_err(struct LDKDecodeError e);
24643 * Checks if the given object is currently in the success state
24645 bool CResult_UpdateFeeDecodeErrorZ_is_ok(const struct LDKCResult_UpdateFeeDecodeErrorZ *NONNULL_PTR o);
24648 * Frees any resources used by the CResult_UpdateFeeDecodeErrorZ.
24650 void CResult_UpdateFeeDecodeErrorZ_free(struct LDKCResult_UpdateFeeDecodeErrorZ _res);
24653 * Creates a new CResult_UpdateFeeDecodeErrorZ which has the same data as `orig`
24654 * but with all dynamically-allocated buffers duplicated in new buffers.
24656 struct LDKCResult_UpdateFeeDecodeErrorZ CResult_UpdateFeeDecodeErrorZ_clone(const struct LDKCResult_UpdateFeeDecodeErrorZ *NONNULL_PTR orig);
24659 * Creates a new CResult_UpdateFulfillHTLCDecodeErrorZ in the success state.
24661 struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ CResult_UpdateFulfillHTLCDecodeErrorZ_ok(struct LDKUpdateFulfillHTLC o);
24664 * Creates a new CResult_UpdateFulfillHTLCDecodeErrorZ in the error state.
24666 struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ CResult_UpdateFulfillHTLCDecodeErrorZ_err(struct LDKDecodeError e);
24669 * Checks if the given object is currently in the success state
24671 bool CResult_UpdateFulfillHTLCDecodeErrorZ_is_ok(const struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ *NONNULL_PTR o);
24674 * Frees any resources used by the CResult_UpdateFulfillHTLCDecodeErrorZ.
24676 void CResult_UpdateFulfillHTLCDecodeErrorZ_free(struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ _res);
24679 * Creates a new CResult_UpdateFulfillHTLCDecodeErrorZ which has the same data as `orig`
24680 * but with all dynamically-allocated buffers duplicated in new buffers.
24682 struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ CResult_UpdateFulfillHTLCDecodeErrorZ_clone(const struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ *NONNULL_PTR orig);
24685 * Creates a new CResult_UpdateAddHTLCDecodeErrorZ in the success state.
24687 struct LDKCResult_UpdateAddHTLCDecodeErrorZ CResult_UpdateAddHTLCDecodeErrorZ_ok(struct LDKUpdateAddHTLC o);
24690 * Creates a new CResult_UpdateAddHTLCDecodeErrorZ in the error state.
24692 struct LDKCResult_UpdateAddHTLCDecodeErrorZ CResult_UpdateAddHTLCDecodeErrorZ_err(struct LDKDecodeError e);
24695 * Checks if the given object is currently in the success state
24697 bool CResult_UpdateAddHTLCDecodeErrorZ_is_ok(const struct LDKCResult_UpdateAddHTLCDecodeErrorZ *NONNULL_PTR o);
24700 * Frees any resources used by the CResult_UpdateAddHTLCDecodeErrorZ.
24702 void CResult_UpdateAddHTLCDecodeErrorZ_free(struct LDKCResult_UpdateAddHTLCDecodeErrorZ _res);
24705 * Creates a new CResult_UpdateAddHTLCDecodeErrorZ which has the same data as `orig`
24706 * but with all dynamically-allocated buffers duplicated in new buffers.
24708 struct LDKCResult_UpdateAddHTLCDecodeErrorZ CResult_UpdateAddHTLCDecodeErrorZ_clone(const struct LDKCResult_UpdateAddHTLCDecodeErrorZ *NONNULL_PTR orig);
24711 * Creates a new CResult_OnionMessageDecodeErrorZ in the success state.
24713 struct LDKCResult_OnionMessageDecodeErrorZ CResult_OnionMessageDecodeErrorZ_ok(struct LDKOnionMessage o);
24716 * Creates a new CResult_OnionMessageDecodeErrorZ in the error state.
24718 struct LDKCResult_OnionMessageDecodeErrorZ CResult_OnionMessageDecodeErrorZ_err(struct LDKDecodeError e);
24721 * Checks if the given object is currently in the success state
24723 bool CResult_OnionMessageDecodeErrorZ_is_ok(const struct LDKCResult_OnionMessageDecodeErrorZ *NONNULL_PTR o);
24726 * Frees any resources used by the CResult_OnionMessageDecodeErrorZ.
24728 void CResult_OnionMessageDecodeErrorZ_free(struct LDKCResult_OnionMessageDecodeErrorZ _res);
24731 * Creates a new CResult_OnionMessageDecodeErrorZ which has the same data as `orig`
24732 * but with all dynamically-allocated buffers duplicated in new buffers.
24734 struct LDKCResult_OnionMessageDecodeErrorZ CResult_OnionMessageDecodeErrorZ_clone(const struct LDKCResult_OnionMessageDecodeErrorZ *NONNULL_PTR orig);
24737 * Creates a new CResult_PingDecodeErrorZ in the success state.
24739 struct LDKCResult_PingDecodeErrorZ CResult_PingDecodeErrorZ_ok(struct LDKPing o);
24742 * Creates a new CResult_PingDecodeErrorZ in the error state.
24744 struct LDKCResult_PingDecodeErrorZ CResult_PingDecodeErrorZ_err(struct LDKDecodeError e);
24747 * Checks if the given object is currently in the success state
24749 bool CResult_PingDecodeErrorZ_is_ok(const struct LDKCResult_PingDecodeErrorZ *NONNULL_PTR o);
24752 * Frees any resources used by the CResult_PingDecodeErrorZ.
24754 void CResult_PingDecodeErrorZ_free(struct LDKCResult_PingDecodeErrorZ _res);
24757 * Creates a new CResult_PingDecodeErrorZ which has the same data as `orig`
24758 * but with all dynamically-allocated buffers duplicated in new buffers.
24760 struct LDKCResult_PingDecodeErrorZ CResult_PingDecodeErrorZ_clone(const struct LDKCResult_PingDecodeErrorZ *NONNULL_PTR orig);
24763 * Creates a new CResult_PongDecodeErrorZ in the success state.
24765 struct LDKCResult_PongDecodeErrorZ CResult_PongDecodeErrorZ_ok(struct LDKPong o);
24768 * Creates a new CResult_PongDecodeErrorZ in the error state.
24770 struct LDKCResult_PongDecodeErrorZ CResult_PongDecodeErrorZ_err(struct LDKDecodeError e);
24773 * Checks if the given object is currently in the success state
24775 bool CResult_PongDecodeErrorZ_is_ok(const struct LDKCResult_PongDecodeErrorZ *NONNULL_PTR o);
24778 * Frees any resources used by the CResult_PongDecodeErrorZ.
24780 void CResult_PongDecodeErrorZ_free(struct LDKCResult_PongDecodeErrorZ _res);
24783 * Creates a new CResult_PongDecodeErrorZ which has the same data as `orig`
24784 * but with all dynamically-allocated buffers duplicated in new buffers.
24786 struct LDKCResult_PongDecodeErrorZ CResult_PongDecodeErrorZ_clone(const struct LDKCResult_PongDecodeErrorZ *NONNULL_PTR orig);
24789 * Creates a new CResult_UnsignedChannelAnnouncementDecodeErrorZ in the success state.
24791 struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ CResult_UnsignedChannelAnnouncementDecodeErrorZ_ok(struct LDKUnsignedChannelAnnouncement o);
24794 * Creates a new CResult_UnsignedChannelAnnouncementDecodeErrorZ in the error state.
24796 struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ CResult_UnsignedChannelAnnouncementDecodeErrorZ_err(struct LDKDecodeError e);
24799 * Checks if the given object is currently in the success state
24801 bool CResult_UnsignedChannelAnnouncementDecodeErrorZ_is_ok(const struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ *NONNULL_PTR o);
24804 * Frees any resources used by the CResult_UnsignedChannelAnnouncementDecodeErrorZ.
24806 void CResult_UnsignedChannelAnnouncementDecodeErrorZ_free(struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ _res);
24809 * Creates a new CResult_UnsignedChannelAnnouncementDecodeErrorZ which has the same data as `orig`
24810 * but with all dynamically-allocated buffers duplicated in new buffers.
24812 struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ CResult_UnsignedChannelAnnouncementDecodeErrorZ_clone(const struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ *NONNULL_PTR orig);
24815 * Creates a new CResult_ChannelAnnouncementDecodeErrorZ in the success state.
24817 struct LDKCResult_ChannelAnnouncementDecodeErrorZ CResult_ChannelAnnouncementDecodeErrorZ_ok(struct LDKChannelAnnouncement o);
24820 * Creates a new CResult_ChannelAnnouncementDecodeErrorZ in the error state.
24822 struct LDKCResult_ChannelAnnouncementDecodeErrorZ CResult_ChannelAnnouncementDecodeErrorZ_err(struct LDKDecodeError e);
24825 * Checks if the given object is currently in the success state
24827 bool CResult_ChannelAnnouncementDecodeErrorZ_is_ok(const struct LDKCResult_ChannelAnnouncementDecodeErrorZ *NONNULL_PTR o);
24830 * Frees any resources used by the CResult_ChannelAnnouncementDecodeErrorZ.
24832 void CResult_ChannelAnnouncementDecodeErrorZ_free(struct LDKCResult_ChannelAnnouncementDecodeErrorZ _res);
24835 * Creates a new CResult_ChannelAnnouncementDecodeErrorZ which has the same data as `orig`
24836 * but with all dynamically-allocated buffers duplicated in new buffers.
24838 struct LDKCResult_ChannelAnnouncementDecodeErrorZ CResult_ChannelAnnouncementDecodeErrorZ_clone(const struct LDKCResult_ChannelAnnouncementDecodeErrorZ *NONNULL_PTR orig);
24841 * Creates a new CResult_UnsignedChannelUpdateDecodeErrorZ in the success state.
24843 struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ CResult_UnsignedChannelUpdateDecodeErrorZ_ok(struct LDKUnsignedChannelUpdate o);
24846 * Creates a new CResult_UnsignedChannelUpdateDecodeErrorZ in the error state.
24848 struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ CResult_UnsignedChannelUpdateDecodeErrorZ_err(struct LDKDecodeError e);
24851 * Checks if the given object is currently in the success state
24853 bool CResult_UnsignedChannelUpdateDecodeErrorZ_is_ok(const struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ *NONNULL_PTR o);
24856 * Frees any resources used by the CResult_UnsignedChannelUpdateDecodeErrorZ.
24858 void CResult_UnsignedChannelUpdateDecodeErrorZ_free(struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ _res);
24861 * Creates a new CResult_UnsignedChannelUpdateDecodeErrorZ which has the same data as `orig`
24862 * but with all dynamically-allocated buffers duplicated in new buffers.
24864 struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ CResult_UnsignedChannelUpdateDecodeErrorZ_clone(const struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ *NONNULL_PTR orig);
24867 * Creates a new CResult_ChannelUpdateDecodeErrorZ in the success state.
24869 struct LDKCResult_ChannelUpdateDecodeErrorZ CResult_ChannelUpdateDecodeErrorZ_ok(struct LDKChannelUpdate o);
24872 * Creates a new CResult_ChannelUpdateDecodeErrorZ in the error state.
24874 struct LDKCResult_ChannelUpdateDecodeErrorZ CResult_ChannelUpdateDecodeErrorZ_err(struct LDKDecodeError e);
24877 * Checks if the given object is currently in the success state
24879 bool CResult_ChannelUpdateDecodeErrorZ_is_ok(const struct LDKCResult_ChannelUpdateDecodeErrorZ *NONNULL_PTR o);
24882 * Frees any resources used by the CResult_ChannelUpdateDecodeErrorZ.
24884 void CResult_ChannelUpdateDecodeErrorZ_free(struct LDKCResult_ChannelUpdateDecodeErrorZ _res);
24887 * Creates a new CResult_ChannelUpdateDecodeErrorZ which has the same data as `orig`
24888 * but with all dynamically-allocated buffers duplicated in new buffers.
24890 struct LDKCResult_ChannelUpdateDecodeErrorZ CResult_ChannelUpdateDecodeErrorZ_clone(const struct LDKCResult_ChannelUpdateDecodeErrorZ *NONNULL_PTR orig);
24893 * Creates a new CResult_ErrorMessageDecodeErrorZ in the success state.
24895 struct LDKCResult_ErrorMessageDecodeErrorZ CResult_ErrorMessageDecodeErrorZ_ok(struct LDKErrorMessage o);
24898 * Creates a new CResult_ErrorMessageDecodeErrorZ in the error state.
24900 struct LDKCResult_ErrorMessageDecodeErrorZ CResult_ErrorMessageDecodeErrorZ_err(struct LDKDecodeError e);
24903 * Checks if the given object is currently in the success state
24905 bool CResult_ErrorMessageDecodeErrorZ_is_ok(const struct LDKCResult_ErrorMessageDecodeErrorZ *NONNULL_PTR o);
24908 * Frees any resources used by the CResult_ErrorMessageDecodeErrorZ.
24910 void CResult_ErrorMessageDecodeErrorZ_free(struct LDKCResult_ErrorMessageDecodeErrorZ _res);
24913 * Creates a new CResult_ErrorMessageDecodeErrorZ which has the same data as `orig`
24914 * but with all dynamically-allocated buffers duplicated in new buffers.
24916 struct LDKCResult_ErrorMessageDecodeErrorZ CResult_ErrorMessageDecodeErrorZ_clone(const struct LDKCResult_ErrorMessageDecodeErrorZ *NONNULL_PTR orig);
24919 * Creates a new CResult_WarningMessageDecodeErrorZ in the success state.
24921 struct LDKCResult_WarningMessageDecodeErrorZ CResult_WarningMessageDecodeErrorZ_ok(struct LDKWarningMessage o);
24924 * Creates a new CResult_WarningMessageDecodeErrorZ in the error state.
24926 struct LDKCResult_WarningMessageDecodeErrorZ CResult_WarningMessageDecodeErrorZ_err(struct LDKDecodeError e);
24929 * Checks if the given object is currently in the success state
24931 bool CResult_WarningMessageDecodeErrorZ_is_ok(const struct LDKCResult_WarningMessageDecodeErrorZ *NONNULL_PTR o);
24934 * Frees any resources used by the CResult_WarningMessageDecodeErrorZ.
24936 void CResult_WarningMessageDecodeErrorZ_free(struct LDKCResult_WarningMessageDecodeErrorZ _res);
24939 * Creates a new CResult_WarningMessageDecodeErrorZ which has the same data as `orig`
24940 * but with all dynamically-allocated buffers duplicated in new buffers.
24942 struct LDKCResult_WarningMessageDecodeErrorZ CResult_WarningMessageDecodeErrorZ_clone(const struct LDKCResult_WarningMessageDecodeErrorZ *NONNULL_PTR orig);
24945 * Creates a new CResult_UnsignedNodeAnnouncementDecodeErrorZ in the success state.
24947 struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ CResult_UnsignedNodeAnnouncementDecodeErrorZ_ok(struct LDKUnsignedNodeAnnouncement o);
24950 * Creates a new CResult_UnsignedNodeAnnouncementDecodeErrorZ in the error state.
24952 struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ CResult_UnsignedNodeAnnouncementDecodeErrorZ_err(struct LDKDecodeError e);
24955 * Checks if the given object is currently in the success state
24957 bool CResult_UnsignedNodeAnnouncementDecodeErrorZ_is_ok(const struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ *NONNULL_PTR o);
24960 * Frees any resources used by the CResult_UnsignedNodeAnnouncementDecodeErrorZ.
24962 void CResult_UnsignedNodeAnnouncementDecodeErrorZ_free(struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ _res);
24965 * Creates a new CResult_UnsignedNodeAnnouncementDecodeErrorZ which has the same data as `orig`
24966 * but with all dynamically-allocated buffers duplicated in new buffers.
24968 struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ CResult_UnsignedNodeAnnouncementDecodeErrorZ_clone(const struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ *NONNULL_PTR orig);
24971 * Creates a new CResult_NodeAnnouncementDecodeErrorZ in the success state.
24973 struct LDKCResult_NodeAnnouncementDecodeErrorZ CResult_NodeAnnouncementDecodeErrorZ_ok(struct LDKNodeAnnouncement o);
24976 * Creates a new CResult_NodeAnnouncementDecodeErrorZ in the error state.
24978 struct LDKCResult_NodeAnnouncementDecodeErrorZ CResult_NodeAnnouncementDecodeErrorZ_err(struct LDKDecodeError e);
24981 * Checks if the given object is currently in the success state
24983 bool CResult_NodeAnnouncementDecodeErrorZ_is_ok(const struct LDKCResult_NodeAnnouncementDecodeErrorZ *NONNULL_PTR o);
24986 * Frees any resources used by the CResult_NodeAnnouncementDecodeErrorZ.
24988 void CResult_NodeAnnouncementDecodeErrorZ_free(struct LDKCResult_NodeAnnouncementDecodeErrorZ _res);
24991 * Creates a new CResult_NodeAnnouncementDecodeErrorZ which has the same data as `orig`
24992 * but with all dynamically-allocated buffers duplicated in new buffers.
24994 struct LDKCResult_NodeAnnouncementDecodeErrorZ CResult_NodeAnnouncementDecodeErrorZ_clone(const struct LDKCResult_NodeAnnouncementDecodeErrorZ *NONNULL_PTR orig);
24997 * Creates a new CResult_QueryShortChannelIdsDecodeErrorZ in the success state.
24999 struct LDKCResult_QueryShortChannelIdsDecodeErrorZ CResult_QueryShortChannelIdsDecodeErrorZ_ok(struct LDKQueryShortChannelIds o);
25002 * Creates a new CResult_QueryShortChannelIdsDecodeErrorZ in the error state.
25004 struct LDKCResult_QueryShortChannelIdsDecodeErrorZ CResult_QueryShortChannelIdsDecodeErrorZ_err(struct LDKDecodeError e);
25007 * Checks if the given object is currently in the success state
25009 bool CResult_QueryShortChannelIdsDecodeErrorZ_is_ok(const struct LDKCResult_QueryShortChannelIdsDecodeErrorZ *NONNULL_PTR o);
25012 * Frees any resources used by the CResult_QueryShortChannelIdsDecodeErrorZ.
25014 void CResult_QueryShortChannelIdsDecodeErrorZ_free(struct LDKCResult_QueryShortChannelIdsDecodeErrorZ _res);
25017 * Creates a new CResult_QueryShortChannelIdsDecodeErrorZ which has the same data as `orig`
25018 * but with all dynamically-allocated buffers duplicated in new buffers.
25020 struct LDKCResult_QueryShortChannelIdsDecodeErrorZ CResult_QueryShortChannelIdsDecodeErrorZ_clone(const struct LDKCResult_QueryShortChannelIdsDecodeErrorZ *NONNULL_PTR orig);
25023 * Creates a new CResult_ReplyShortChannelIdsEndDecodeErrorZ in the success state.
25025 struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ CResult_ReplyShortChannelIdsEndDecodeErrorZ_ok(struct LDKReplyShortChannelIdsEnd o);
25028 * Creates a new CResult_ReplyShortChannelIdsEndDecodeErrorZ in the error state.
25030 struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ CResult_ReplyShortChannelIdsEndDecodeErrorZ_err(struct LDKDecodeError e);
25033 * Checks if the given object is currently in the success state
25035 bool CResult_ReplyShortChannelIdsEndDecodeErrorZ_is_ok(const struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ *NONNULL_PTR o);
25038 * Frees any resources used by the CResult_ReplyShortChannelIdsEndDecodeErrorZ.
25040 void CResult_ReplyShortChannelIdsEndDecodeErrorZ_free(struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ _res);
25043 * Creates a new CResult_ReplyShortChannelIdsEndDecodeErrorZ which has the same data as `orig`
25044 * but with all dynamically-allocated buffers duplicated in new buffers.
25046 struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ CResult_ReplyShortChannelIdsEndDecodeErrorZ_clone(const struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ *NONNULL_PTR orig);
25049 * Creates a new CResult_QueryChannelRangeDecodeErrorZ in the success state.
25051 struct LDKCResult_QueryChannelRangeDecodeErrorZ CResult_QueryChannelRangeDecodeErrorZ_ok(struct LDKQueryChannelRange o);
25054 * Creates a new CResult_QueryChannelRangeDecodeErrorZ in the error state.
25056 struct LDKCResult_QueryChannelRangeDecodeErrorZ CResult_QueryChannelRangeDecodeErrorZ_err(struct LDKDecodeError e);
25059 * Checks if the given object is currently in the success state
25061 bool CResult_QueryChannelRangeDecodeErrorZ_is_ok(const struct LDKCResult_QueryChannelRangeDecodeErrorZ *NONNULL_PTR o);
25064 * Frees any resources used by the CResult_QueryChannelRangeDecodeErrorZ.
25066 void CResult_QueryChannelRangeDecodeErrorZ_free(struct LDKCResult_QueryChannelRangeDecodeErrorZ _res);
25069 * Creates a new CResult_QueryChannelRangeDecodeErrorZ which has the same data as `orig`
25070 * but with all dynamically-allocated buffers duplicated in new buffers.
25072 struct LDKCResult_QueryChannelRangeDecodeErrorZ CResult_QueryChannelRangeDecodeErrorZ_clone(const struct LDKCResult_QueryChannelRangeDecodeErrorZ *NONNULL_PTR orig);
25075 * Creates a new CResult_ReplyChannelRangeDecodeErrorZ in the success state.
25077 struct LDKCResult_ReplyChannelRangeDecodeErrorZ CResult_ReplyChannelRangeDecodeErrorZ_ok(struct LDKReplyChannelRange o);
25080 * Creates a new CResult_ReplyChannelRangeDecodeErrorZ in the error state.
25082 struct LDKCResult_ReplyChannelRangeDecodeErrorZ CResult_ReplyChannelRangeDecodeErrorZ_err(struct LDKDecodeError e);
25085 * Checks if the given object is currently in the success state
25087 bool CResult_ReplyChannelRangeDecodeErrorZ_is_ok(const struct LDKCResult_ReplyChannelRangeDecodeErrorZ *NONNULL_PTR o);
25090 * Frees any resources used by the CResult_ReplyChannelRangeDecodeErrorZ.
25092 void CResult_ReplyChannelRangeDecodeErrorZ_free(struct LDKCResult_ReplyChannelRangeDecodeErrorZ _res);
25095 * Creates a new CResult_ReplyChannelRangeDecodeErrorZ which has the same data as `orig`
25096 * but with all dynamically-allocated buffers duplicated in new buffers.
25098 struct LDKCResult_ReplyChannelRangeDecodeErrorZ CResult_ReplyChannelRangeDecodeErrorZ_clone(const struct LDKCResult_ReplyChannelRangeDecodeErrorZ *NONNULL_PTR orig);
25101 * Creates a new CResult_GossipTimestampFilterDecodeErrorZ in the success state.
25103 struct LDKCResult_GossipTimestampFilterDecodeErrorZ CResult_GossipTimestampFilterDecodeErrorZ_ok(struct LDKGossipTimestampFilter o);
25106 * Creates a new CResult_GossipTimestampFilterDecodeErrorZ in the error state.
25108 struct LDKCResult_GossipTimestampFilterDecodeErrorZ CResult_GossipTimestampFilterDecodeErrorZ_err(struct LDKDecodeError e);
25111 * Checks if the given object is currently in the success state
25113 bool CResult_GossipTimestampFilterDecodeErrorZ_is_ok(const struct LDKCResult_GossipTimestampFilterDecodeErrorZ *NONNULL_PTR o);
25116 * Frees any resources used by the CResult_GossipTimestampFilterDecodeErrorZ.
25118 void CResult_GossipTimestampFilterDecodeErrorZ_free(struct LDKCResult_GossipTimestampFilterDecodeErrorZ _res);
25121 * Creates a new CResult_GossipTimestampFilterDecodeErrorZ which has the same data as `orig`
25122 * but with all dynamically-allocated buffers duplicated in new buffers.
25124 struct LDKCResult_GossipTimestampFilterDecodeErrorZ CResult_GossipTimestampFilterDecodeErrorZ_clone(const struct LDKCResult_GossipTimestampFilterDecodeErrorZ *NONNULL_PTR orig);
25127 * Frees the buffer pointed to by `data` if `datalen` is non-0.
25129 void CVec_PhantomRouteHintsZ_free(struct LDKCVec_PhantomRouteHintsZ _res);
25132 * Creates a new CResult_Bolt11InvoiceSignOrCreationErrorZ in the success state.
25134 struct LDKCResult_Bolt11InvoiceSignOrCreationErrorZ CResult_Bolt11InvoiceSignOrCreationErrorZ_ok(struct LDKBolt11Invoice o);
25137 * Creates a new CResult_Bolt11InvoiceSignOrCreationErrorZ in the error state.
25139 struct LDKCResult_Bolt11InvoiceSignOrCreationErrorZ CResult_Bolt11InvoiceSignOrCreationErrorZ_err(struct LDKSignOrCreationError e);
25142 * Checks if the given object is currently in the success state
25144 bool CResult_Bolt11InvoiceSignOrCreationErrorZ_is_ok(const struct LDKCResult_Bolt11InvoiceSignOrCreationErrorZ *NONNULL_PTR o);
25147 * Frees any resources used by the CResult_Bolt11InvoiceSignOrCreationErrorZ.
25149 void CResult_Bolt11InvoiceSignOrCreationErrorZ_free(struct LDKCResult_Bolt11InvoiceSignOrCreationErrorZ _res);
25152 * Creates a new CResult_Bolt11InvoiceSignOrCreationErrorZ which has the same data as `orig`
25153 * but with all dynamically-allocated buffers duplicated in new buffers.
25155 struct LDKCResult_Bolt11InvoiceSignOrCreationErrorZ CResult_Bolt11InvoiceSignOrCreationErrorZ_clone(const struct LDKCResult_Bolt11InvoiceSignOrCreationErrorZ *NONNULL_PTR orig);
25158 * Frees the buffer pointed to by `data` if `datalen` is non-0.
25160 void CVec_FutureZ_free(struct LDKCVec_FutureZ _res);
25163 * Creates a new CResult_OffersMessageDecodeErrorZ in the success state.
25165 struct LDKCResult_OffersMessageDecodeErrorZ CResult_OffersMessageDecodeErrorZ_ok(struct LDKOffersMessage o);
25168 * Creates a new CResult_OffersMessageDecodeErrorZ in the error state.
25170 struct LDKCResult_OffersMessageDecodeErrorZ CResult_OffersMessageDecodeErrorZ_err(struct LDKDecodeError e);
25173 * Checks if the given object is currently in the success state
25175 bool CResult_OffersMessageDecodeErrorZ_is_ok(const struct LDKCResult_OffersMessageDecodeErrorZ *NONNULL_PTR o);
25178 * Frees any resources used by the CResult_OffersMessageDecodeErrorZ.
25180 void CResult_OffersMessageDecodeErrorZ_free(struct LDKCResult_OffersMessageDecodeErrorZ _res);
25183 * Creates a new CResult_OffersMessageDecodeErrorZ which has the same data as `orig`
25184 * but with all dynamically-allocated buffers duplicated in new buffers.
25186 struct LDKCResult_OffersMessageDecodeErrorZ CResult_OffersMessageDecodeErrorZ_clone(const struct LDKCResult_OffersMessageDecodeErrorZ *NONNULL_PTR orig);
25189 * Constructs a new COption_HTLCClaimZ containing a crate::lightning::ln::chan_utils::HTLCClaim
25191 struct LDKCOption_HTLCClaimZ COption_HTLCClaimZ_some(enum LDKHTLCClaim o);
25194 * Constructs a new COption_HTLCClaimZ containing nothing
25196 struct LDKCOption_HTLCClaimZ COption_HTLCClaimZ_none(void);
25199 * Frees any resources associated with the crate::lightning::ln::chan_utils::HTLCClaim, if we are in the Some state
25201 void COption_HTLCClaimZ_free(struct LDKCOption_HTLCClaimZ _res);
25204 * Creates a new CResult_CounterpartyCommitmentSecretsDecodeErrorZ in the success state.
25206 struct LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ CResult_CounterpartyCommitmentSecretsDecodeErrorZ_ok(struct LDKCounterpartyCommitmentSecrets o);
25209 * Creates a new CResult_CounterpartyCommitmentSecretsDecodeErrorZ in the error state.
25211 struct LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ CResult_CounterpartyCommitmentSecretsDecodeErrorZ_err(struct LDKDecodeError e);
25214 * Checks if the given object is currently in the success state
25216 bool CResult_CounterpartyCommitmentSecretsDecodeErrorZ_is_ok(const struct LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ *NONNULL_PTR o);
25219 * Frees any resources used by the CResult_CounterpartyCommitmentSecretsDecodeErrorZ.
25221 void CResult_CounterpartyCommitmentSecretsDecodeErrorZ_free(struct LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ _res);
25224 * Creates a new CResult_CounterpartyCommitmentSecretsDecodeErrorZ which has the same data as `orig`
25225 * but with all dynamically-allocated buffers duplicated in new buffers.
25227 struct LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ CResult_CounterpartyCommitmentSecretsDecodeErrorZ_clone(const struct LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ *NONNULL_PTR orig);
25230 * Creates a new CResult_TxCreationKeysDecodeErrorZ in the success state.
25232 struct LDKCResult_TxCreationKeysDecodeErrorZ CResult_TxCreationKeysDecodeErrorZ_ok(struct LDKTxCreationKeys o);
25235 * Creates a new CResult_TxCreationKeysDecodeErrorZ in the error state.
25237 struct LDKCResult_TxCreationKeysDecodeErrorZ CResult_TxCreationKeysDecodeErrorZ_err(struct LDKDecodeError e);
25240 * Checks if the given object is currently in the success state
25242 bool CResult_TxCreationKeysDecodeErrorZ_is_ok(const struct LDKCResult_TxCreationKeysDecodeErrorZ *NONNULL_PTR o);
25245 * Frees any resources used by the CResult_TxCreationKeysDecodeErrorZ.
25247 void CResult_TxCreationKeysDecodeErrorZ_free(struct LDKCResult_TxCreationKeysDecodeErrorZ _res);
25250 * Creates a new CResult_TxCreationKeysDecodeErrorZ which has the same data as `orig`
25251 * but with all dynamically-allocated buffers duplicated in new buffers.
25253 struct LDKCResult_TxCreationKeysDecodeErrorZ CResult_TxCreationKeysDecodeErrorZ_clone(const struct LDKCResult_TxCreationKeysDecodeErrorZ *NONNULL_PTR orig);
25256 * Creates a new CResult_ChannelPublicKeysDecodeErrorZ in the success state.
25258 struct LDKCResult_ChannelPublicKeysDecodeErrorZ CResult_ChannelPublicKeysDecodeErrorZ_ok(struct LDKChannelPublicKeys o);
25261 * Creates a new CResult_ChannelPublicKeysDecodeErrorZ in the error state.
25263 struct LDKCResult_ChannelPublicKeysDecodeErrorZ CResult_ChannelPublicKeysDecodeErrorZ_err(struct LDKDecodeError e);
25266 * Checks if the given object is currently in the success state
25268 bool CResult_ChannelPublicKeysDecodeErrorZ_is_ok(const struct LDKCResult_ChannelPublicKeysDecodeErrorZ *NONNULL_PTR o);
25271 * Frees any resources used by the CResult_ChannelPublicKeysDecodeErrorZ.
25273 void CResult_ChannelPublicKeysDecodeErrorZ_free(struct LDKCResult_ChannelPublicKeysDecodeErrorZ _res);
25276 * Creates a new CResult_ChannelPublicKeysDecodeErrorZ which has the same data as `orig`
25277 * but with all dynamically-allocated buffers duplicated in new buffers.
25279 struct LDKCResult_ChannelPublicKeysDecodeErrorZ CResult_ChannelPublicKeysDecodeErrorZ_clone(const struct LDKCResult_ChannelPublicKeysDecodeErrorZ *NONNULL_PTR orig);
25282 * Creates a new CResult_HTLCOutputInCommitmentDecodeErrorZ in the success state.
25284 struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ CResult_HTLCOutputInCommitmentDecodeErrorZ_ok(struct LDKHTLCOutputInCommitment o);
25287 * Creates a new CResult_HTLCOutputInCommitmentDecodeErrorZ in the error state.
25289 struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ CResult_HTLCOutputInCommitmentDecodeErrorZ_err(struct LDKDecodeError e);
25292 * Checks if the given object is currently in the success state
25294 bool CResult_HTLCOutputInCommitmentDecodeErrorZ_is_ok(const struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ *NONNULL_PTR o);
25297 * Frees any resources used by the CResult_HTLCOutputInCommitmentDecodeErrorZ.
25299 void CResult_HTLCOutputInCommitmentDecodeErrorZ_free(struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ _res);
25302 * Creates a new CResult_HTLCOutputInCommitmentDecodeErrorZ which has the same data as `orig`
25303 * but with all dynamically-allocated buffers duplicated in new buffers.
25305 struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ CResult_HTLCOutputInCommitmentDecodeErrorZ_clone(const struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ *NONNULL_PTR orig);
25308 * Creates a new CResult_CounterpartyChannelTransactionParametersDecodeErrorZ in the success state.
25310 struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_ok(struct LDKCounterpartyChannelTransactionParameters o);
25313 * Creates a new CResult_CounterpartyChannelTransactionParametersDecodeErrorZ in the error state.
25315 struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_err(struct LDKDecodeError e);
25318 * Checks if the given object is currently in the success state
25320 bool CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_is_ok(const struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ *NONNULL_PTR o);
25323 * Frees any resources used by the CResult_CounterpartyChannelTransactionParametersDecodeErrorZ.
25325 void CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_free(struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ _res);
25328 * Creates a new CResult_CounterpartyChannelTransactionParametersDecodeErrorZ which has the same data as `orig`
25329 * but with all dynamically-allocated buffers duplicated in new buffers.
25331 struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_clone(const struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ *NONNULL_PTR orig);
25334 * Creates a new CResult_ChannelTransactionParametersDecodeErrorZ in the success state.
25336 struct LDKCResult_ChannelTransactionParametersDecodeErrorZ CResult_ChannelTransactionParametersDecodeErrorZ_ok(struct LDKChannelTransactionParameters o);
25339 * Creates a new CResult_ChannelTransactionParametersDecodeErrorZ in the error state.
25341 struct LDKCResult_ChannelTransactionParametersDecodeErrorZ CResult_ChannelTransactionParametersDecodeErrorZ_err(struct LDKDecodeError e);
25344 * Checks if the given object is currently in the success state
25346 bool CResult_ChannelTransactionParametersDecodeErrorZ_is_ok(const struct LDKCResult_ChannelTransactionParametersDecodeErrorZ *NONNULL_PTR o);
25349 * Frees any resources used by the CResult_ChannelTransactionParametersDecodeErrorZ.
25351 void CResult_ChannelTransactionParametersDecodeErrorZ_free(struct LDKCResult_ChannelTransactionParametersDecodeErrorZ _res);
25354 * Creates a new CResult_ChannelTransactionParametersDecodeErrorZ which has the same data as `orig`
25355 * but with all dynamically-allocated buffers duplicated in new buffers.
25357 struct LDKCResult_ChannelTransactionParametersDecodeErrorZ CResult_ChannelTransactionParametersDecodeErrorZ_clone(const struct LDKCResult_ChannelTransactionParametersDecodeErrorZ *NONNULL_PTR orig);
25360 * Creates a new CResult_HolderCommitmentTransactionDecodeErrorZ in the success state.
25362 struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ CResult_HolderCommitmentTransactionDecodeErrorZ_ok(struct LDKHolderCommitmentTransaction o);
25365 * Creates a new CResult_HolderCommitmentTransactionDecodeErrorZ in the error state.
25367 struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ CResult_HolderCommitmentTransactionDecodeErrorZ_err(struct LDKDecodeError e);
25370 * Checks if the given object is currently in the success state
25372 bool CResult_HolderCommitmentTransactionDecodeErrorZ_is_ok(const struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ *NONNULL_PTR o);
25375 * Frees any resources used by the CResult_HolderCommitmentTransactionDecodeErrorZ.
25377 void CResult_HolderCommitmentTransactionDecodeErrorZ_free(struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ _res);
25380 * Creates a new CResult_HolderCommitmentTransactionDecodeErrorZ which has the same data as `orig`
25381 * but with all dynamically-allocated buffers duplicated in new buffers.
25383 struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ CResult_HolderCommitmentTransactionDecodeErrorZ_clone(const struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ *NONNULL_PTR orig);
25386 * Creates a new CResult_BuiltCommitmentTransactionDecodeErrorZ in the success state.
25388 struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ CResult_BuiltCommitmentTransactionDecodeErrorZ_ok(struct LDKBuiltCommitmentTransaction o);
25391 * Creates a new CResult_BuiltCommitmentTransactionDecodeErrorZ in the error state.
25393 struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ CResult_BuiltCommitmentTransactionDecodeErrorZ_err(struct LDKDecodeError e);
25396 * Checks if the given object is currently in the success state
25398 bool CResult_BuiltCommitmentTransactionDecodeErrorZ_is_ok(const struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ *NONNULL_PTR o);
25401 * Frees any resources used by the CResult_BuiltCommitmentTransactionDecodeErrorZ.
25403 void CResult_BuiltCommitmentTransactionDecodeErrorZ_free(struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ _res);
25406 * Creates a new CResult_BuiltCommitmentTransactionDecodeErrorZ which has the same data as `orig`
25407 * but with all dynamically-allocated buffers duplicated in new buffers.
25409 struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ CResult_BuiltCommitmentTransactionDecodeErrorZ_clone(const struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ *NONNULL_PTR orig);
25412 * Creates a new CResult_TrustedClosingTransactionNoneZ in the success state.
25414 struct LDKCResult_TrustedClosingTransactionNoneZ CResult_TrustedClosingTransactionNoneZ_ok(struct LDKTrustedClosingTransaction o);
25417 * Creates a new CResult_TrustedClosingTransactionNoneZ in the error state.
25419 struct LDKCResult_TrustedClosingTransactionNoneZ CResult_TrustedClosingTransactionNoneZ_err(void);
25422 * Checks if the given object is currently in the success state
25424 bool CResult_TrustedClosingTransactionNoneZ_is_ok(const struct LDKCResult_TrustedClosingTransactionNoneZ *NONNULL_PTR o);
25427 * Frees any resources used by the CResult_TrustedClosingTransactionNoneZ.
25429 void CResult_TrustedClosingTransactionNoneZ_free(struct LDKCResult_TrustedClosingTransactionNoneZ _res);
25432 * Creates a new CResult_CommitmentTransactionDecodeErrorZ in the success state.
25434 struct LDKCResult_CommitmentTransactionDecodeErrorZ CResult_CommitmentTransactionDecodeErrorZ_ok(struct LDKCommitmentTransaction o);
25437 * Creates a new CResult_CommitmentTransactionDecodeErrorZ in the error state.
25439 struct LDKCResult_CommitmentTransactionDecodeErrorZ CResult_CommitmentTransactionDecodeErrorZ_err(struct LDKDecodeError e);
25442 * Checks if the given object is currently in the success state
25444 bool CResult_CommitmentTransactionDecodeErrorZ_is_ok(const struct LDKCResult_CommitmentTransactionDecodeErrorZ *NONNULL_PTR o);
25447 * Frees any resources used by the CResult_CommitmentTransactionDecodeErrorZ.
25449 void CResult_CommitmentTransactionDecodeErrorZ_free(struct LDKCResult_CommitmentTransactionDecodeErrorZ _res);
25452 * Creates a new CResult_CommitmentTransactionDecodeErrorZ which has the same data as `orig`
25453 * but with all dynamically-allocated buffers duplicated in new buffers.
25455 struct LDKCResult_CommitmentTransactionDecodeErrorZ CResult_CommitmentTransactionDecodeErrorZ_clone(const struct LDKCResult_CommitmentTransactionDecodeErrorZ *NONNULL_PTR orig);
25458 * Creates a new CResult_TrustedCommitmentTransactionNoneZ in the success state.
25460 struct LDKCResult_TrustedCommitmentTransactionNoneZ CResult_TrustedCommitmentTransactionNoneZ_ok(struct LDKTrustedCommitmentTransaction o);
25463 * Creates a new CResult_TrustedCommitmentTransactionNoneZ in the error state.
25465 struct LDKCResult_TrustedCommitmentTransactionNoneZ CResult_TrustedCommitmentTransactionNoneZ_err(void);
25468 * Checks if the given object is currently in the success state
25470 bool CResult_TrustedCommitmentTransactionNoneZ_is_ok(const struct LDKCResult_TrustedCommitmentTransactionNoneZ *NONNULL_PTR o);
25473 * Frees any resources used by the CResult_TrustedCommitmentTransactionNoneZ.
25475 void CResult_TrustedCommitmentTransactionNoneZ_free(struct LDKCResult_TrustedCommitmentTransactionNoneZ _res);
25478 * Creates a new CResult_CVec_ECDSASignatureZNoneZ in the success state.
25480 struct LDKCResult_CVec_ECDSASignatureZNoneZ CResult_CVec_ECDSASignatureZNoneZ_ok(struct LDKCVec_ECDSASignatureZ o);
25483 * Creates a new CResult_CVec_ECDSASignatureZNoneZ in the error state.
25485 struct LDKCResult_CVec_ECDSASignatureZNoneZ CResult_CVec_ECDSASignatureZNoneZ_err(void);
25488 * Checks if the given object is currently in the success state
25490 bool CResult_CVec_ECDSASignatureZNoneZ_is_ok(const struct LDKCResult_CVec_ECDSASignatureZNoneZ *NONNULL_PTR o);
25493 * Frees any resources used by the CResult_CVec_ECDSASignatureZNoneZ.
25495 void CResult_CVec_ECDSASignatureZNoneZ_free(struct LDKCResult_CVec_ECDSASignatureZNoneZ _res);
25498 * Creates a new CResult_CVec_ECDSASignatureZNoneZ which has the same data as `orig`
25499 * but with all dynamically-allocated buffers duplicated in new buffers.
25501 struct LDKCResult_CVec_ECDSASignatureZNoneZ CResult_CVec_ECDSASignatureZNoneZ_clone(const struct LDKCResult_CVec_ECDSASignatureZNoneZ *NONNULL_PTR orig);
25504 * Constructs a new COption_usizeZ containing a usize
25506 struct LDKCOption_usizeZ COption_usizeZ_some(uintptr_t o);
25509 * Constructs a new COption_usizeZ containing nothing
25511 struct LDKCOption_usizeZ COption_usizeZ_none(void);
25514 * Frees any resources associated with the usize, if we are in the Some state
25516 void COption_usizeZ_free(struct LDKCOption_usizeZ _res);
25519 * Creates a new COption_usizeZ which has the same data as `orig`
25520 * but with all dynamically-allocated buffers duplicated in new buffers.
25522 struct LDKCOption_usizeZ COption_usizeZ_clone(const struct LDKCOption_usizeZ *NONNULL_PTR orig);
25525 * Creates a new CResult_ShutdownScriptDecodeErrorZ in the success state.
25527 struct LDKCResult_ShutdownScriptDecodeErrorZ CResult_ShutdownScriptDecodeErrorZ_ok(struct LDKShutdownScript o);
25530 * Creates a new CResult_ShutdownScriptDecodeErrorZ in the error state.
25532 struct LDKCResult_ShutdownScriptDecodeErrorZ CResult_ShutdownScriptDecodeErrorZ_err(struct LDKDecodeError e);
25535 * Checks if the given object is currently in the success state
25537 bool CResult_ShutdownScriptDecodeErrorZ_is_ok(const struct LDKCResult_ShutdownScriptDecodeErrorZ *NONNULL_PTR o);
25540 * Frees any resources used by the CResult_ShutdownScriptDecodeErrorZ.
25542 void CResult_ShutdownScriptDecodeErrorZ_free(struct LDKCResult_ShutdownScriptDecodeErrorZ _res);
25545 * Creates a new CResult_ShutdownScriptDecodeErrorZ which has the same data as `orig`
25546 * but with all dynamically-allocated buffers duplicated in new buffers.
25548 struct LDKCResult_ShutdownScriptDecodeErrorZ CResult_ShutdownScriptDecodeErrorZ_clone(const struct LDKCResult_ShutdownScriptDecodeErrorZ *NONNULL_PTR orig);
25551 * Creates a new CResult_ShutdownScriptInvalidShutdownScriptZ in the success state.
25553 struct LDKCResult_ShutdownScriptInvalidShutdownScriptZ CResult_ShutdownScriptInvalidShutdownScriptZ_ok(struct LDKShutdownScript o);
25556 * Creates a new CResult_ShutdownScriptInvalidShutdownScriptZ in the error state.
25558 struct LDKCResult_ShutdownScriptInvalidShutdownScriptZ CResult_ShutdownScriptInvalidShutdownScriptZ_err(struct LDKInvalidShutdownScript e);
25561 * Checks if the given object is currently in the success state
25563 bool CResult_ShutdownScriptInvalidShutdownScriptZ_is_ok(const struct LDKCResult_ShutdownScriptInvalidShutdownScriptZ *NONNULL_PTR o);
25566 * Frees any resources used by the CResult_ShutdownScriptInvalidShutdownScriptZ.
25568 void CResult_ShutdownScriptInvalidShutdownScriptZ_free(struct LDKCResult_ShutdownScriptInvalidShutdownScriptZ _res);
25571 * Creates a new CResult_ShutdownScriptInvalidShutdownScriptZ which has the same data as `orig`
25572 * but with all dynamically-allocated buffers duplicated in new buffers.
25574 struct LDKCResult_ShutdownScriptInvalidShutdownScriptZ CResult_ShutdownScriptInvalidShutdownScriptZ_clone(const struct LDKCResult_ShutdownScriptInvalidShutdownScriptZ *NONNULL_PTR orig);
25577 * Creates a new CResult_PaymentPurposeDecodeErrorZ in the success state.
25579 struct LDKCResult_PaymentPurposeDecodeErrorZ CResult_PaymentPurposeDecodeErrorZ_ok(struct LDKPaymentPurpose o);
25582 * Creates a new CResult_PaymentPurposeDecodeErrorZ in the error state.
25584 struct LDKCResult_PaymentPurposeDecodeErrorZ CResult_PaymentPurposeDecodeErrorZ_err(struct LDKDecodeError e);
25587 * Checks if the given object is currently in the success state
25589 bool CResult_PaymentPurposeDecodeErrorZ_is_ok(const struct LDKCResult_PaymentPurposeDecodeErrorZ *NONNULL_PTR o);
25592 * Frees any resources used by the CResult_PaymentPurposeDecodeErrorZ.
25594 void CResult_PaymentPurposeDecodeErrorZ_free(struct LDKCResult_PaymentPurposeDecodeErrorZ _res);
25597 * Creates a new CResult_PaymentPurposeDecodeErrorZ which has the same data as `orig`
25598 * but with all dynamically-allocated buffers duplicated in new buffers.
25600 struct LDKCResult_PaymentPurposeDecodeErrorZ CResult_PaymentPurposeDecodeErrorZ_clone(const struct LDKCResult_PaymentPurposeDecodeErrorZ *NONNULL_PTR orig);
25603 * Creates a new CResult_ClaimedHTLCDecodeErrorZ in the success state.
25605 struct LDKCResult_ClaimedHTLCDecodeErrorZ CResult_ClaimedHTLCDecodeErrorZ_ok(struct LDKClaimedHTLC o);
25608 * Creates a new CResult_ClaimedHTLCDecodeErrorZ in the error state.
25610 struct LDKCResult_ClaimedHTLCDecodeErrorZ CResult_ClaimedHTLCDecodeErrorZ_err(struct LDKDecodeError e);
25613 * Checks if the given object is currently in the success state
25615 bool CResult_ClaimedHTLCDecodeErrorZ_is_ok(const struct LDKCResult_ClaimedHTLCDecodeErrorZ *NONNULL_PTR o);
25618 * Frees any resources used by the CResult_ClaimedHTLCDecodeErrorZ.
25620 void CResult_ClaimedHTLCDecodeErrorZ_free(struct LDKCResult_ClaimedHTLCDecodeErrorZ _res);
25623 * Creates a new CResult_ClaimedHTLCDecodeErrorZ which has the same data as `orig`
25624 * but with all dynamically-allocated buffers duplicated in new buffers.
25626 struct LDKCResult_ClaimedHTLCDecodeErrorZ CResult_ClaimedHTLCDecodeErrorZ_clone(const struct LDKCResult_ClaimedHTLCDecodeErrorZ *NONNULL_PTR orig);
25629 * Constructs a new COption_PathFailureZ containing a crate::lightning::events::PathFailure
25631 struct LDKCOption_PathFailureZ COption_PathFailureZ_some(struct LDKPathFailure o);
25634 * Constructs a new COption_PathFailureZ containing nothing
25636 struct LDKCOption_PathFailureZ COption_PathFailureZ_none(void);
25639 * Frees any resources associated with the crate::lightning::events::PathFailure, if we are in the Some state
25641 void COption_PathFailureZ_free(struct LDKCOption_PathFailureZ _res);
25644 * Creates a new COption_PathFailureZ which has the same data as `orig`
25645 * but with all dynamically-allocated buffers duplicated in new buffers.
25647 struct LDKCOption_PathFailureZ COption_PathFailureZ_clone(const struct LDKCOption_PathFailureZ *NONNULL_PTR orig);
25650 * Creates a new CResult_COption_PathFailureZDecodeErrorZ in the success state.
25652 struct LDKCResult_COption_PathFailureZDecodeErrorZ CResult_COption_PathFailureZDecodeErrorZ_ok(struct LDKCOption_PathFailureZ o);
25655 * Creates a new CResult_COption_PathFailureZDecodeErrorZ in the error state.
25657 struct LDKCResult_COption_PathFailureZDecodeErrorZ CResult_COption_PathFailureZDecodeErrorZ_err(struct LDKDecodeError e);
25660 * Checks if the given object is currently in the success state
25662 bool CResult_COption_PathFailureZDecodeErrorZ_is_ok(const struct LDKCResult_COption_PathFailureZDecodeErrorZ *NONNULL_PTR o);
25665 * Frees any resources used by the CResult_COption_PathFailureZDecodeErrorZ.
25667 void CResult_COption_PathFailureZDecodeErrorZ_free(struct LDKCResult_COption_PathFailureZDecodeErrorZ _res);
25670 * Creates a new CResult_COption_PathFailureZDecodeErrorZ which has the same data as `orig`
25671 * but with all dynamically-allocated buffers duplicated in new buffers.
25673 struct LDKCResult_COption_PathFailureZDecodeErrorZ CResult_COption_PathFailureZDecodeErrorZ_clone(const struct LDKCResult_COption_PathFailureZDecodeErrorZ *NONNULL_PTR orig);
25676 * Constructs a new COption_ClosureReasonZ containing a crate::lightning::events::ClosureReason
25678 struct LDKCOption_ClosureReasonZ COption_ClosureReasonZ_some(struct LDKClosureReason o);
25681 * Constructs a new COption_ClosureReasonZ containing nothing
25683 struct LDKCOption_ClosureReasonZ COption_ClosureReasonZ_none(void);
25686 * Frees any resources associated with the crate::lightning::events::ClosureReason, if we are in the Some state
25688 void COption_ClosureReasonZ_free(struct LDKCOption_ClosureReasonZ _res);
25691 * Creates a new COption_ClosureReasonZ which has the same data as `orig`
25692 * but with all dynamically-allocated buffers duplicated in new buffers.
25694 struct LDKCOption_ClosureReasonZ COption_ClosureReasonZ_clone(const struct LDKCOption_ClosureReasonZ *NONNULL_PTR orig);
25697 * Creates a new CResult_COption_ClosureReasonZDecodeErrorZ in the success state.
25699 struct LDKCResult_COption_ClosureReasonZDecodeErrorZ CResult_COption_ClosureReasonZDecodeErrorZ_ok(struct LDKCOption_ClosureReasonZ o);
25702 * Creates a new CResult_COption_ClosureReasonZDecodeErrorZ in the error state.
25704 struct LDKCResult_COption_ClosureReasonZDecodeErrorZ CResult_COption_ClosureReasonZDecodeErrorZ_err(struct LDKDecodeError e);
25707 * Checks if the given object is currently in the success state
25709 bool CResult_COption_ClosureReasonZDecodeErrorZ_is_ok(const struct LDKCResult_COption_ClosureReasonZDecodeErrorZ *NONNULL_PTR o);
25712 * Frees any resources used by the CResult_COption_ClosureReasonZDecodeErrorZ.
25714 void CResult_COption_ClosureReasonZDecodeErrorZ_free(struct LDKCResult_COption_ClosureReasonZDecodeErrorZ _res);
25717 * Creates a new CResult_COption_ClosureReasonZDecodeErrorZ which has the same data as `orig`
25718 * but with all dynamically-allocated buffers duplicated in new buffers.
25720 struct LDKCResult_COption_ClosureReasonZDecodeErrorZ CResult_COption_ClosureReasonZDecodeErrorZ_clone(const struct LDKCResult_COption_ClosureReasonZDecodeErrorZ *NONNULL_PTR orig);
25723 * Constructs a new COption_HTLCDestinationZ containing a crate::lightning::events::HTLCDestination
25725 struct LDKCOption_HTLCDestinationZ COption_HTLCDestinationZ_some(struct LDKHTLCDestination o);
25728 * Constructs a new COption_HTLCDestinationZ containing nothing
25730 struct LDKCOption_HTLCDestinationZ COption_HTLCDestinationZ_none(void);
25733 * Frees any resources associated with the crate::lightning::events::HTLCDestination, if we are in the Some state
25735 void COption_HTLCDestinationZ_free(struct LDKCOption_HTLCDestinationZ _res);
25738 * Creates a new COption_HTLCDestinationZ which has the same data as `orig`
25739 * but with all dynamically-allocated buffers duplicated in new buffers.
25741 struct LDKCOption_HTLCDestinationZ COption_HTLCDestinationZ_clone(const struct LDKCOption_HTLCDestinationZ *NONNULL_PTR orig);
25744 * Creates a new CResult_COption_HTLCDestinationZDecodeErrorZ in the success state.
25746 struct LDKCResult_COption_HTLCDestinationZDecodeErrorZ CResult_COption_HTLCDestinationZDecodeErrorZ_ok(struct LDKCOption_HTLCDestinationZ o);
25749 * Creates a new CResult_COption_HTLCDestinationZDecodeErrorZ in the error state.
25751 struct LDKCResult_COption_HTLCDestinationZDecodeErrorZ CResult_COption_HTLCDestinationZDecodeErrorZ_err(struct LDKDecodeError e);
25754 * Checks if the given object is currently in the success state
25756 bool CResult_COption_HTLCDestinationZDecodeErrorZ_is_ok(const struct LDKCResult_COption_HTLCDestinationZDecodeErrorZ *NONNULL_PTR o);
25759 * Frees any resources used by the CResult_COption_HTLCDestinationZDecodeErrorZ.
25761 void CResult_COption_HTLCDestinationZDecodeErrorZ_free(struct LDKCResult_COption_HTLCDestinationZDecodeErrorZ _res);
25764 * Creates a new CResult_COption_HTLCDestinationZDecodeErrorZ which has the same data as `orig`
25765 * but with all dynamically-allocated buffers duplicated in new buffers.
25767 struct LDKCResult_COption_HTLCDestinationZDecodeErrorZ CResult_COption_HTLCDestinationZDecodeErrorZ_clone(const struct LDKCResult_COption_HTLCDestinationZDecodeErrorZ *NONNULL_PTR orig);
25770 * Creates a new CResult_PaymentFailureReasonDecodeErrorZ in the success state.
25772 struct LDKCResult_PaymentFailureReasonDecodeErrorZ CResult_PaymentFailureReasonDecodeErrorZ_ok(enum LDKPaymentFailureReason o);
25775 * Creates a new CResult_PaymentFailureReasonDecodeErrorZ in the error state.
25777 struct LDKCResult_PaymentFailureReasonDecodeErrorZ CResult_PaymentFailureReasonDecodeErrorZ_err(struct LDKDecodeError e);
25780 * Checks if the given object is currently in the success state
25782 bool CResult_PaymentFailureReasonDecodeErrorZ_is_ok(const struct LDKCResult_PaymentFailureReasonDecodeErrorZ *NONNULL_PTR o);
25785 * Frees any resources used by the CResult_PaymentFailureReasonDecodeErrorZ.
25787 void CResult_PaymentFailureReasonDecodeErrorZ_free(struct LDKCResult_PaymentFailureReasonDecodeErrorZ _res);
25790 * Creates a new CResult_PaymentFailureReasonDecodeErrorZ which has the same data as `orig`
25791 * but with all dynamically-allocated buffers duplicated in new buffers.
25793 struct LDKCResult_PaymentFailureReasonDecodeErrorZ CResult_PaymentFailureReasonDecodeErrorZ_clone(const struct LDKCResult_PaymentFailureReasonDecodeErrorZ *NONNULL_PTR orig);
25796 * Constructs a new COption_U128Z containing a crate::c_types::U128
25798 struct LDKCOption_U128Z COption_U128Z_some(struct LDKU128 o);
25801 * Constructs a new COption_U128Z containing nothing
25803 struct LDKCOption_U128Z COption_U128Z_none(void);
25806 * Frees any resources associated with the crate::c_types::U128, if we are in the Some state
25808 void COption_U128Z_free(struct LDKCOption_U128Z _res);
25811 * Creates a new COption_U128Z which has the same data as `orig`
25812 * but with all dynamically-allocated buffers duplicated in new buffers.
25814 struct LDKCOption_U128Z COption_U128Z_clone(const struct LDKCOption_U128Z *NONNULL_PTR orig);
25817 * Frees the buffer pointed to by `data` if `datalen` is non-0.
25819 void CVec_ClaimedHTLCZ_free(struct LDKCVec_ClaimedHTLCZ _res);
25822 * Constructs a new COption_PaymentFailureReasonZ containing a crate::lightning::events::PaymentFailureReason
25824 struct LDKCOption_PaymentFailureReasonZ COption_PaymentFailureReasonZ_some(enum LDKPaymentFailureReason o);
25827 * Constructs a new COption_PaymentFailureReasonZ containing nothing
25829 struct LDKCOption_PaymentFailureReasonZ COption_PaymentFailureReasonZ_none(void);
25832 * Frees any resources associated with the crate::lightning::events::PaymentFailureReason, if we are in the Some state
25834 void COption_PaymentFailureReasonZ_free(struct LDKCOption_PaymentFailureReasonZ _res);
25837 * Creates a new COption_PaymentFailureReasonZ which has the same data as `orig`
25838 * but with all dynamically-allocated buffers duplicated in new buffers.
25840 struct LDKCOption_PaymentFailureReasonZ COption_PaymentFailureReasonZ_clone(const struct LDKCOption_PaymentFailureReasonZ *NONNULL_PTR orig);
25843 * Constructs a new COption_EventZ containing a crate::lightning::events::Event
25845 struct LDKCOption_EventZ COption_EventZ_some(struct LDKEvent o);
25848 * Constructs a new COption_EventZ containing nothing
25850 struct LDKCOption_EventZ COption_EventZ_none(void);
25853 * Frees any resources associated with the crate::lightning::events::Event, if we are in the Some state
25855 void COption_EventZ_free(struct LDKCOption_EventZ _res);
25858 * Creates a new COption_EventZ which has the same data as `orig`
25859 * but with all dynamically-allocated buffers duplicated in new buffers.
25861 struct LDKCOption_EventZ COption_EventZ_clone(const struct LDKCOption_EventZ *NONNULL_PTR orig);
25864 * Creates a new CResult_COption_EventZDecodeErrorZ in the success state.
25866 struct LDKCResult_COption_EventZDecodeErrorZ CResult_COption_EventZDecodeErrorZ_ok(struct LDKCOption_EventZ o);
25869 * Creates a new CResult_COption_EventZDecodeErrorZ in the error state.
25871 struct LDKCResult_COption_EventZDecodeErrorZ CResult_COption_EventZDecodeErrorZ_err(struct LDKDecodeError e);
25874 * Checks if the given object is currently in the success state
25876 bool CResult_COption_EventZDecodeErrorZ_is_ok(const struct LDKCResult_COption_EventZDecodeErrorZ *NONNULL_PTR o);
25879 * Frees any resources used by the CResult_COption_EventZDecodeErrorZ.
25881 void CResult_COption_EventZDecodeErrorZ_free(struct LDKCResult_COption_EventZDecodeErrorZ _res);
25884 * Creates a new CResult_COption_EventZDecodeErrorZ which has the same data as `orig`
25885 * but with all dynamically-allocated buffers duplicated in new buffers.
25887 struct LDKCResult_COption_EventZDecodeErrorZ CResult_COption_EventZDecodeErrorZ_clone(const struct LDKCResult_COption_EventZDecodeErrorZ *NONNULL_PTR orig);
25890 * Creates a new CResult_SiPrefixBolt11ParseErrorZ in the success state.
25892 struct LDKCResult_SiPrefixBolt11ParseErrorZ CResult_SiPrefixBolt11ParseErrorZ_ok(enum LDKSiPrefix o);
25895 * Creates a new CResult_SiPrefixBolt11ParseErrorZ in the error state.
25897 struct LDKCResult_SiPrefixBolt11ParseErrorZ CResult_SiPrefixBolt11ParseErrorZ_err(struct LDKBolt11ParseError e);
25900 * Checks if the given object is currently in the success state
25902 bool CResult_SiPrefixBolt11ParseErrorZ_is_ok(const struct LDKCResult_SiPrefixBolt11ParseErrorZ *NONNULL_PTR o);
25905 * Frees any resources used by the CResult_SiPrefixBolt11ParseErrorZ.
25907 void CResult_SiPrefixBolt11ParseErrorZ_free(struct LDKCResult_SiPrefixBolt11ParseErrorZ _res);
25910 * Creates a new CResult_SiPrefixBolt11ParseErrorZ which has the same data as `orig`
25911 * but with all dynamically-allocated buffers duplicated in new buffers.
25913 struct LDKCResult_SiPrefixBolt11ParseErrorZ CResult_SiPrefixBolt11ParseErrorZ_clone(const struct LDKCResult_SiPrefixBolt11ParseErrorZ *NONNULL_PTR orig);
25916 * Creates a new CResult_Bolt11InvoiceParseOrSemanticErrorZ in the success state.
25918 struct LDKCResult_Bolt11InvoiceParseOrSemanticErrorZ CResult_Bolt11InvoiceParseOrSemanticErrorZ_ok(struct LDKBolt11Invoice o);
25921 * Creates a new CResult_Bolt11InvoiceParseOrSemanticErrorZ in the error state.
25923 struct LDKCResult_Bolt11InvoiceParseOrSemanticErrorZ CResult_Bolt11InvoiceParseOrSemanticErrorZ_err(struct LDKParseOrSemanticError e);
25926 * Checks if the given object is currently in the success state
25928 bool CResult_Bolt11InvoiceParseOrSemanticErrorZ_is_ok(const struct LDKCResult_Bolt11InvoiceParseOrSemanticErrorZ *NONNULL_PTR o);
25931 * Frees any resources used by the CResult_Bolt11InvoiceParseOrSemanticErrorZ.
25933 void CResult_Bolt11InvoiceParseOrSemanticErrorZ_free(struct LDKCResult_Bolt11InvoiceParseOrSemanticErrorZ _res);
25936 * Creates a new CResult_Bolt11InvoiceParseOrSemanticErrorZ which has the same data as `orig`
25937 * but with all dynamically-allocated buffers duplicated in new buffers.
25939 struct LDKCResult_Bolt11InvoiceParseOrSemanticErrorZ CResult_Bolt11InvoiceParseOrSemanticErrorZ_clone(const struct LDKCResult_Bolt11InvoiceParseOrSemanticErrorZ *NONNULL_PTR orig);
25942 * Creates a new CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ in the success state.
25944 struct LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZ CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ_ok(struct LDKSignedRawBolt11Invoice o);
25947 * Creates a new CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ in the error state.
25949 struct LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZ CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ_err(struct LDKBolt11ParseError e);
25952 * Checks if the given object is currently in the success state
25954 bool CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ_is_ok(const struct LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZ *NONNULL_PTR o);
25957 * Frees any resources used by the CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ.
25959 void CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ_free(struct LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZ _res);
25962 * Creates a new CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ which has the same data as `orig`
25963 * but with all dynamically-allocated buffers duplicated in new buffers.
25965 struct LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZ CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ_clone(const struct LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZ *NONNULL_PTR orig);
25968 * Creates a new tuple which has the same data as `orig`
25969 * but with all dynamically-allocated buffers duplicated in new buffers.
25971 struct LDKC3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ C3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ_clone(const struct LDKC3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ *NONNULL_PTR orig);
25974 * Creates a new C3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ from the contained elements.
25976 struct LDKC3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ C3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ_new(struct LDKRawBolt11Invoice a, struct LDKThirtyTwoBytes b, struct LDKBolt11InvoiceSignature c);
25979 * Frees any resources used by the C3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ.
25981 void C3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ_free(struct LDKC3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ _res);
25984 * Creates a new CResult_PayeePubKeySecp256k1ErrorZ in the success state.
25986 struct LDKCResult_PayeePubKeySecp256k1ErrorZ CResult_PayeePubKeySecp256k1ErrorZ_ok(struct LDKPayeePubKey o);
25989 * Creates a new CResult_PayeePubKeySecp256k1ErrorZ in the error state.
25991 struct LDKCResult_PayeePubKeySecp256k1ErrorZ CResult_PayeePubKeySecp256k1ErrorZ_err(enum LDKSecp256k1Error e);
25994 * Checks if the given object is currently in the success state
25996 bool CResult_PayeePubKeySecp256k1ErrorZ_is_ok(const struct LDKCResult_PayeePubKeySecp256k1ErrorZ *NONNULL_PTR o);
25999 * Frees any resources used by the CResult_PayeePubKeySecp256k1ErrorZ.
26001 void CResult_PayeePubKeySecp256k1ErrorZ_free(struct LDKCResult_PayeePubKeySecp256k1ErrorZ _res);
26004 * Creates a new CResult_PayeePubKeySecp256k1ErrorZ which has the same data as `orig`
26005 * but with all dynamically-allocated buffers duplicated in new buffers.
26007 struct LDKCResult_PayeePubKeySecp256k1ErrorZ CResult_PayeePubKeySecp256k1ErrorZ_clone(const struct LDKCResult_PayeePubKeySecp256k1ErrorZ *NONNULL_PTR orig);
26010 * Frees the buffer pointed to by `data` if `datalen` is non-0.
26012 void CVec_PrivateRouteZ_free(struct LDKCVec_PrivateRouteZ _res);
26015 * Creates a new CResult_PositiveTimestampCreationErrorZ in the success state.
26017 struct LDKCResult_PositiveTimestampCreationErrorZ CResult_PositiveTimestampCreationErrorZ_ok(struct LDKPositiveTimestamp o);
26020 * Creates a new CResult_PositiveTimestampCreationErrorZ in the error state.
26022 struct LDKCResult_PositiveTimestampCreationErrorZ CResult_PositiveTimestampCreationErrorZ_err(enum LDKCreationError e);
26025 * Checks if the given object is currently in the success state
26027 bool CResult_PositiveTimestampCreationErrorZ_is_ok(const struct LDKCResult_PositiveTimestampCreationErrorZ *NONNULL_PTR o);
26030 * Frees any resources used by the CResult_PositiveTimestampCreationErrorZ.
26032 void CResult_PositiveTimestampCreationErrorZ_free(struct LDKCResult_PositiveTimestampCreationErrorZ _res);
26035 * Creates a new CResult_PositiveTimestampCreationErrorZ which has the same data as `orig`
26036 * but with all dynamically-allocated buffers duplicated in new buffers.
26038 struct LDKCResult_PositiveTimestampCreationErrorZ CResult_PositiveTimestampCreationErrorZ_clone(const struct LDKCResult_PositiveTimestampCreationErrorZ *NONNULL_PTR orig);
26041 * Creates a new CResult_NoneBolt11SemanticErrorZ in the success state.
26043 struct LDKCResult_NoneBolt11SemanticErrorZ CResult_NoneBolt11SemanticErrorZ_ok(void);
26046 * Creates a new CResult_NoneBolt11SemanticErrorZ in the error state.
26048 struct LDKCResult_NoneBolt11SemanticErrorZ CResult_NoneBolt11SemanticErrorZ_err(enum LDKBolt11SemanticError e);
26051 * Checks if the given object is currently in the success state
26053 bool CResult_NoneBolt11SemanticErrorZ_is_ok(const struct LDKCResult_NoneBolt11SemanticErrorZ *NONNULL_PTR o);
26056 * Frees any resources used by the CResult_NoneBolt11SemanticErrorZ.
26058 void CResult_NoneBolt11SemanticErrorZ_free(struct LDKCResult_NoneBolt11SemanticErrorZ _res);
26061 * Creates a new CResult_NoneBolt11SemanticErrorZ which has the same data as `orig`
26062 * but with all dynamically-allocated buffers duplicated in new buffers.
26064 struct LDKCResult_NoneBolt11SemanticErrorZ CResult_NoneBolt11SemanticErrorZ_clone(const struct LDKCResult_NoneBolt11SemanticErrorZ *NONNULL_PTR orig);
26067 * Creates a new CResult_Bolt11InvoiceBolt11SemanticErrorZ in the success state.
26069 struct LDKCResult_Bolt11InvoiceBolt11SemanticErrorZ CResult_Bolt11InvoiceBolt11SemanticErrorZ_ok(struct LDKBolt11Invoice o);
26072 * Creates a new CResult_Bolt11InvoiceBolt11SemanticErrorZ in the error state.
26074 struct LDKCResult_Bolt11InvoiceBolt11SemanticErrorZ CResult_Bolt11InvoiceBolt11SemanticErrorZ_err(enum LDKBolt11SemanticError e);
26077 * Checks if the given object is currently in the success state
26079 bool CResult_Bolt11InvoiceBolt11SemanticErrorZ_is_ok(const struct LDKCResult_Bolt11InvoiceBolt11SemanticErrorZ *NONNULL_PTR o);
26082 * Frees any resources used by the CResult_Bolt11InvoiceBolt11SemanticErrorZ.
26084 void CResult_Bolt11InvoiceBolt11SemanticErrorZ_free(struct LDKCResult_Bolt11InvoiceBolt11SemanticErrorZ _res);
26087 * Creates a new CResult_Bolt11InvoiceBolt11SemanticErrorZ which has the same data as `orig`
26088 * but with all dynamically-allocated buffers duplicated in new buffers.
26090 struct LDKCResult_Bolt11InvoiceBolt11SemanticErrorZ CResult_Bolt11InvoiceBolt11SemanticErrorZ_clone(const struct LDKCResult_Bolt11InvoiceBolt11SemanticErrorZ *NONNULL_PTR orig);
26093 * Creates a new CResult_DescriptionCreationErrorZ in the success state.
26095 struct LDKCResult_DescriptionCreationErrorZ CResult_DescriptionCreationErrorZ_ok(struct LDKDescription o);
26098 * Creates a new CResult_DescriptionCreationErrorZ in the error state.
26100 struct LDKCResult_DescriptionCreationErrorZ CResult_DescriptionCreationErrorZ_err(enum LDKCreationError e);
26103 * Checks if the given object is currently in the success state
26105 bool CResult_DescriptionCreationErrorZ_is_ok(const struct LDKCResult_DescriptionCreationErrorZ *NONNULL_PTR o);
26108 * Frees any resources used by the CResult_DescriptionCreationErrorZ.
26110 void CResult_DescriptionCreationErrorZ_free(struct LDKCResult_DescriptionCreationErrorZ _res);
26113 * Creates a new CResult_DescriptionCreationErrorZ which has the same data as `orig`
26114 * but with all dynamically-allocated buffers duplicated in new buffers.
26116 struct LDKCResult_DescriptionCreationErrorZ CResult_DescriptionCreationErrorZ_clone(const struct LDKCResult_DescriptionCreationErrorZ *NONNULL_PTR orig);
26119 * Creates a new CResult_PrivateRouteCreationErrorZ in the success state.
26121 struct LDKCResult_PrivateRouteCreationErrorZ CResult_PrivateRouteCreationErrorZ_ok(struct LDKPrivateRoute o);
26124 * Creates a new CResult_PrivateRouteCreationErrorZ in the error state.
26126 struct LDKCResult_PrivateRouteCreationErrorZ CResult_PrivateRouteCreationErrorZ_err(enum LDKCreationError e);
26129 * Checks if the given object is currently in the success state
26131 bool CResult_PrivateRouteCreationErrorZ_is_ok(const struct LDKCResult_PrivateRouteCreationErrorZ *NONNULL_PTR o);
26134 * Frees any resources used by the CResult_PrivateRouteCreationErrorZ.
26136 void CResult_PrivateRouteCreationErrorZ_free(struct LDKCResult_PrivateRouteCreationErrorZ _res);
26139 * Creates a new CResult_PrivateRouteCreationErrorZ which has the same data as `orig`
26140 * but with all dynamically-allocated buffers duplicated in new buffers.
26142 struct LDKCResult_PrivateRouteCreationErrorZ CResult_PrivateRouteCreationErrorZ_clone(const struct LDKCResult_PrivateRouteCreationErrorZ *NONNULL_PTR orig);
26145 * Creates a new CResult_OutPointDecodeErrorZ in the success state.
26147 struct LDKCResult_OutPointDecodeErrorZ CResult_OutPointDecodeErrorZ_ok(struct LDKOutPoint o);
26150 * Creates a new CResult_OutPointDecodeErrorZ in the error state.
26152 struct LDKCResult_OutPointDecodeErrorZ CResult_OutPointDecodeErrorZ_err(struct LDKDecodeError e);
26155 * Checks if the given object is currently in the success state
26157 bool CResult_OutPointDecodeErrorZ_is_ok(const struct LDKCResult_OutPointDecodeErrorZ *NONNULL_PTR o);
26160 * Frees any resources used by the CResult_OutPointDecodeErrorZ.
26162 void CResult_OutPointDecodeErrorZ_free(struct LDKCResult_OutPointDecodeErrorZ _res);
26165 * Creates a new CResult_OutPointDecodeErrorZ which has the same data as `orig`
26166 * but with all dynamically-allocated buffers duplicated in new buffers.
26168 struct LDKCResult_OutPointDecodeErrorZ CResult_OutPointDecodeErrorZ_clone(const struct LDKCResult_OutPointDecodeErrorZ *NONNULL_PTR orig);
26171 * Creates a new CResult_BigSizeDecodeErrorZ in the success state.
26173 struct LDKCResult_BigSizeDecodeErrorZ CResult_BigSizeDecodeErrorZ_ok(struct LDKBigSize o);
26176 * Creates a new CResult_BigSizeDecodeErrorZ in the error state.
26178 struct LDKCResult_BigSizeDecodeErrorZ CResult_BigSizeDecodeErrorZ_err(struct LDKDecodeError e);
26181 * Checks if the given object is currently in the success state
26183 bool CResult_BigSizeDecodeErrorZ_is_ok(const struct LDKCResult_BigSizeDecodeErrorZ *NONNULL_PTR o);
26186 * Frees any resources used by the CResult_BigSizeDecodeErrorZ.
26188 void CResult_BigSizeDecodeErrorZ_free(struct LDKCResult_BigSizeDecodeErrorZ _res);
26191 * Creates a new CResult_BigSizeDecodeErrorZ which has the same data as `orig`
26192 * but with all dynamically-allocated buffers duplicated in new buffers.
26194 struct LDKCResult_BigSizeDecodeErrorZ CResult_BigSizeDecodeErrorZ_clone(const struct LDKCResult_BigSizeDecodeErrorZ *NONNULL_PTR orig);
26197 * Creates a new CResult_HostnameDecodeErrorZ in the success state.
26199 struct LDKCResult_HostnameDecodeErrorZ CResult_HostnameDecodeErrorZ_ok(struct LDKHostname o);
26202 * Creates a new CResult_HostnameDecodeErrorZ in the error state.
26204 struct LDKCResult_HostnameDecodeErrorZ CResult_HostnameDecodeErrorZ_err(struct LDKDecodeError e);
26207 * Checks if the given object is currently in the success state
26209 bool CResult_HostnameDecodeErrorZ_is_ok(const struct LDKCResult_HostnameDecodeErrorZ *NONNULL_PTR o);
26212 * Frees any resources used by the CResult_HostnameDecodeErrorZ.
26214 void CResult_HostnameDecodeErrorZ_free(struct LDKCResult_HostnameDecodeErrorZ _res);
26217 * Creates a new CResult_HostnameDecodeErrorZ which has the same data as `orig`
26218 * but with all dynamically-allocated buffers duplicated in new buffers.
26220 struct LDKCResult_HostnameDecodeErrorZ CResult_HostnameDecodeErrorZ_clone(const struct LDKCResult_HostnameDecodeErrorZ *NONNULL_PTR orig);
26223 * Creates a new CResult_TransactionU16LenLimitedNoneZ in the success state.
26225 struct LDKCResult_TransactionU16LenLimitedNoneZ CResult_TransactionU16LenLimitedNoneZ_ok(struct LDKTransactionU16LenLimited o);
26228 * Creates a new CResult_TransactionU16LenLimitedNoneZ in the error state.
26230 struct LDKCResult_TransactionU16LenLimitedNoneZ CResult_TransactionU16LenLimitedNoneZ_err(void);
26233 * Checks if the given object is currently in the success state
26235 bool CResult_TransactionU16LenLimitedNoneZ_is_ok(const struct LDKCResult_TransactionU16LenLimitedNoneZ *NONNULL_PTR o);
26238 * Frees any resources used by the CResult_TransactionU16LenLimitedNoneZ.
26240 void CResult_TransactionU16LenLimitedNoneZ_free(struct LDKCResult_TransactionU16LenLimitedNoneZ _res);
26243 * Creates a new CResult_TransactionU16LenLimitedNoneZ which has the same data as `orig`
26244 * but with all dynamically-allocated buffers duplicated in new buffers.
26246 struct LDKCResult_TransactionU16LenLimitedNoneZ CResult_TransactionU16LenLimitedNoneZ_clone(const struct LDKCResult_TransactionU16LenLimitedNoneZ *NONNULL_PTR orig);
26249 * Creates a new CResult_TransactionU16LenLimitedDecodeErrorZ in the success state.
26251 struct LDKCResult_TransactionU16LenLimitedDecodeErrorZ CResult_TransactionU16LenLimitedDecodeErrorZ_ok(struct LDKTransactionU16LenLimited o);
26254 * Creates a new CResult_TransactionU16LenLimitedDecodeErrorZ in the error state.
26256 struct LDKCResult_TransactionU16LenLimitedDecodeErrorZ CResult_TransactionU16LenLimitedDecodeErrorZ_err(struct LDKDecodeError e);
26259 * Checks if the given object is currently in the success state
26261 bool CResult_TransactionU16LenLimitedDecodeErrorZ_is_ok(const struct LDKCResult_TransactionU16LenLimitedDecodeErrorZ *NONNULL_PTR o);
26264 * Frees any resources used by the CResult_TransactionU16LenLimitedDecodeErrorZ.
26266 void CResult_TransactionU16LenLimitedDecodeErrorZ_free(struct LDKCResult_TransactionU16LenLimitedDecodeErrorZ _res);
26269 * Creates a new CResult_TransactionU16LenLimitedDecodeErrorZ which has the same data as `orig`
26270 * but with all dynamically-allocated buffers duplicated in new buffers.
26272 struct LDKCResult_TransactionU16LenLimitedDecodeErrorZ CResult_TransactionU16LenLimitedDecodeErrorZ_clone(const struct LDKCResult_TransactionU16LenLimitedDecodeErrorZ *NONNULL_PTR orig);
26275 * Creates a new CResult_UntrustedStringDecodeErrorZ in the success state.
26277 struct LDKCResult_UntrustedStringDecodeErrorZ CResult_UntrustedStringDecodeErrorZ_ok(struct LDKUntrustedString o);
26280 * Creates a new CResult_UntrustedStringDecodeErrorZ in the error state.
26282 struct LDKCResult_UntrustedStringDecodeErrorZ CResult_UntrustedStringDecodeErrorZ_err(struct LDKDecodeError e);
26285 * Checks if the given object is currently in the success state
26287 bool CResult_UntrustedStringDecodeErrorZ_is_ok(const struct LDKCResult_UntrustedStringDecodeErrorZ *NONNULL_PTR o);
26290 * Frees any resources used by the CResult_UntrustedStringDecodeErrorZ.
26292 void CResult_UntrustedStringDecodeErrorZ_free(struct LDKCResult_UntrustedStringDecodeErrorZ _res);
26295 * Creates a new CResult_UntrustedStringDecodeErrorZ which has the same data as `orig`
26296 * but with all dynamically-allocated buffers duplicated in new buffers.
26298 struct LDKCResult_UntrustedStringDecodeErrorZ CResult_UntrustedStringDecodeErrorZ_clone(const struct LDKCResult_UntrustedStringDecodeErrorZ *NONNULL_PTR orig);
26301 * Creates a new CResult_ReceiveTlvsDecodeErrorZ in the success state.
26303 struct LDKCResult_ReceiveTlvsDecodeErrorZ CResult_ReceiveTlvsDecodeErrorZ_ok(struct LDKReceiveTlvs o);
26306 * Creates a new CResult_ReceiveTlvsDecodeErrorZ in the error state.
26308 struct LDKCResult_ReceiveTlvsDecodeErrorZ CResult_ReceiveTlvsDecodeErrorZ_err(struct LDKDecodeError e);
26311 * Checks if the given object is currently in the success state
26313 bool CResult_ReceiveTlvsDecodeErrorZ_is_ok(const struct LDKCResult_ReceiveTlvsDecodeErrorZ *NONNULL_PTR o);
26316 * Frees any resources used by the CResult_ReceiveTlvsDecodeErrorZ.
26318 void CResult_ReceiveTlvsDecodeErrorZ_free(struct LDKCResult_ReceiveTlvsDecodeErrorZ _res);
26321 * Creates a new CResult_ReceiveTlvsDecodeErrorZ which has the same data as `orig`
26322 * but with all dynamically-allocated buffers duplicated in new buffers.
26324 struct LDKCResult_ReceiveTlvsDecodeErrorZ CResult_ReceiveTlvsDecodeErrorZ_clone(const struct LDKCResult_ReceiveTlvsDecodeErrorZ *NONNULL_PTR orig);
26327 * Creates a new CResult_PaymentRelayDecodeErrorZ in the success state.
26329 struct LDKCResult_PaymentRelayDecodeErrorZ CResult_PaymentRelayDecodeErrorZ_ok(struct LDKPaymentRelay o);
26332 * Creates a new CResult_PaymentRelayDecodeErrorZ in the error state.
26334 struct LDKCResult_PaymentRelayDecodeErrorZ CResult_PaymentRelayDecodeErrorZ_err(struct LDKDecodeError e);
26337 * Checks if the given object is currently in the success state
26339 bool CResult_PaymentRelayDecodeErrorZ_is_ok(const struct LDKCResult_PaymentRelayDecodeErrorZ *NONNULL_PTR o);
26342 * Frees any resources used by the CResult_PaymentRelayDecodeErrorZ.
26344 void CResult_PaymentRelayDecodeErrorZ_free(struct LDKCResult_PaymentRelayDecodeErrorZ _res);
26347 * Creates a new CResult_PaymentRelayDecodeErrorZ which has the same data as `orig`
26348 * but with all dynamically-allocated buffers duplicated in new buffers.
26350 struct LDKCResult_PaymentRelayDecodeErrorZ CResult_PaymentRelayDecodeErrorZ_clone(const struct LDKCResult_PaymentRelayDecodeErrorZ *NONNULL_PTR orig);
26353 * Creates a new CResult_PaymentConstraintsDecodeErrorZ in the success state.
26355 struct LDKCResult_PaymentConstraintsDecodeErrorZ CResult_PaymentConstraintsDecodeErrorZ_ok(struct LDKPaymentConstraints o);
26358 * Creates a new CResult_PaymentConstraintsDecodeErrorZ in the error state.
26360 struct LDKCResult_PaymentConstraintsDecodeErrorZ CResult_PaymentConstraintsDecodeErrorZ_err(struct LDKDecodeError e);
26363 * Checks if the given object is currently in the success state
26365 bool CResult_PaymentConstraintsDecodeErrorZ_is_ok(const struct LDKCResult_PaymentConstraintsDecodeErrorZ *NONNULL_PTR o);
26368 * Frees any resources used by the CResult_PaymentConstraintsDecodeErrorZ.
26370 void CResult_PaymentConstraintsDecodeErrorZ_free(struct LDKCResult_PaymentConstraintsDecodeErrorZ _res);
26373 * Creates a new CResult_PaymentConstraintsDecodeErrorZ which has the same data as `orig`
26374 * but with all dynamically-allocated buffers duplicated in new buffers.
26376 struct LDKCResult_PaymentConstraintsDecodeErrorZ CResult_PaymentConstraintsDecodeErrorZ_clone(const struct LDKCResult_PaymentConstraintsDecodeErrorZ *NONNULL_PTR orig);
26379 * Creates a new CResult_ThirtyTwoBytesPaymentErrorZ in the success state.
26381 struct LDKCResult_ThirtyTwoBytesPaymentErrorZ CResult_ThirtyTwoBytesPaymentErrorZ_ok(struct LDKThirtyTwoBytes o);
26384 * Creates a new CResult_ThirtyTwoBytesPaymentErrorZ in the error state.
26386 struct LDKCResult_ThirtyTwoBytesPaymentErrorZ CResult_ThirtyTwoBytesPaymentErrorZ_err(struct LDKPaymentError e);
26389 * Checks if the given object is currently in the success state
26391 bool CResult_ThirtyTwoBytesPaymentErrorZ_is_ok(const struct LDKCResult_ThirtyTwoBytesPaymentErrorZ *NONNULL_PTR o);
26394 * Frees any resources used by the CResult_ThirtyTwoBytesPaymentErrorZ.
26396 void CResult_ThirtyTwoBytesPaymentErrorZ_free(struct LDKCResult_ThirtyTwoBytesPaymentErrorZ _res);
26399 * Creates a new CResult_ThirtyTwoBytesPaymentErrorZ which has the same data as `orig`
26400 * but with all dynamically-allocated buffers duplicated in new buffers.
26402 struct LDKCResult_ThirtyTwoBytesPaymentErrorZ CResult_ThirtyTwoBytesPaymentErrorZ_clone(const struct LDKCResult_ThirtyTwoBytesPaymentErrorZ *NONNULL_PTR orig);
26405 * Creates a new CResult_NonePaymentErrorZ in the success state.
26407 struct LDKCResult_NonePaymentErrorZ CResult_NonePaymentErrorZ_ok(void);
26410 * Creates a new CResult_NonePaymentErrorZ in the error state.
26412 struct LDKCResult_NonePaymentErrorZ CResult_NonePaymentErrorZ_err(struct LDKPaymentError e);
26415 * Checks if the given object is currently in the success state
26417 bool CResult_NonePaymentErrorZ_is_ok(const struct LDKCResult_NonePaymentErrorZ *NONNULL_PTR o);
26420 * Frees any resources used by the CResult_NonePaymentErrorZ.
26422 void CResult_NonePaymentErrorZ_free(struct LDKCResult_NonePaymentErrorZ _res);
26425 * Creates a new CResult_NonePaymentErrorZ which has the same data as `orig`
26426 * but with all dynamically-allocated buffers duplicated in new buffers.
26428 struct LDKCResult_NonePaymentErrorZ CResult_NonePaymentErrorZ_clone(const struct LDKCResult_NonePaymentErrorZ *NONNULL_PTR orig);
26431 * Creates a new CResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbingErrorZ in the success state.
26433 struct LDKCResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbingErrorZ CResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbingErrorZ_ok(struct LDKCVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZ o);
26436 * Creates a new CResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbingErrorZ in the error state.
26438 struct LDKCResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbingErrorZ CResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbingErrorZ_err(struct LDKProbingError e);
26441 * Checks if the given object is currently in the success state
26443 bool CResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbingErrorZ_is_ok(const struct LDKCResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbingErrorZ *NONNULL_PTR o);
26446 * Frees any resources used by the CResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbingErrorZ.
26448 void CResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbingErrorZ_free(struct LDKCResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbingErrorZ _res);
26451 * Creates a new CResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbingErrorZ which has the same data as `orig`
26452 * but with all dynamically-allocated buffers duplicated in new buffers.
26454 struct LDKCResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbingErrorZ CResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbingErrorZ_clone(const struct LDKCResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbingErrorZ *NONNULL_PTR orig);
26457 * Creates a new CResult_StrSecp256k1ErrorZ in the success state.
26459 struct LDKCResult_StrSecp256k1ErrorZ CResult_StrSecp256k1ErrorZ_ok(struct LDKStr o);
26462 * Creates a new CResult_StrSecp256k1ErrorZ in the error state.
26464 struct LDKCResult_StrSecp256k1ErrorZ CResult_StrSecp256k1ErrorZ_err(enum LDKSecp256k1Error e);
26467 * Checks if the given object is currently in the success state
26469 bool CResult_StrSecp256k1ErrorZ_is_ok(const struct LDKCResult_StrSecp256k1ErrorZ *NONNULL_PTR o);
26472 * Frees any resources used by the CResult_StrSecp256k1ErrorZ.
26474 void CResult_StrSecp256k1ErrorZ_free(struct LDKCResult_StrSecp256k1ErrorZ _res);
26477 * Creates a new CResult_StrSecp256k1ErrorZ which has the same data as `orig`
26478 * but with all dynamically-allocated buffers duplicated in new buffers.
26480 struct LDKCResult_StrSecp256k1ErrorZ CResult_StrSecp256k1ErrorZ_clone(const struct LDKCResult_StrSecp256k1ErrorZ *NONNULL_PTR orig);
26483 * Creates a new CResult_TxOutUtxoLookupErrorZ in the success state.
26485 struct LDKCResult_TxOutUtxoLookupErrorZ CResult_TxOutUtxoLookupErrorZ_ok(struct LDKTxOut o);
26488 * Creates a new CResult_TxOutUtxoLookupErrorZ in the error state.
26490 struct LDKCResult_TxOutUtxoLookupErrorZ CResult_TxOutUtxoLookupErrorZ_err(enum LDKUtxoLookupError e);
26493 * Checks if the given object is currently in the success state
26495 bool CResult_TxOutUtxoLookupErrorZ_is_ok(const struct LDKCResult_TxOutUtxoLookupErrorZ *NONNULL_PTR o);
26498 * Frees any resources used by the CResult_TxOutUtxoLookupErrorZ.
26500 void CResult_TxOutUtxoLookupErrorZ_free(struct LDKCResult_TxOutUtxoLookupErrorZ _res);
26503 * Creates a new CResult_TxOutUtxoLookupErrorZ which has the same data as `orig`
26504 * but with all dynamically-allocated buffers duplicated in new buffers.
26506 struct LDKCResult_TxOutUtxoLookupErrorZ CResult_TxOutUtxoLookupErrorZ_clone(const struct LDKCResult_TxOutUtxoLookupErrorZ *NONNULL_PTR orig);
26509 * Creates a new CResult_OnionMessagePathNoneZ in the success state.
26511 struct LDKCResult_OnionMessagePathNoneZ CResult_OnionMessagePathNoneZ_ok(struct LDKOnionMessagePath o);
26514 * Creates a new CResult_OnionMessagePathNoneZ in the error state.
26516 struct LDKCResult_OnionMessagePathNoneZ CResult_OnionMessagePathNoneZ_err(void);
26519 * Checks if the given object is currently in the success state
26521 bool CResult_OnionMessagePathNoneZ_is_ok(const struct LDKCResult_OnionMessagePathNoneZ *NONNULL_PTR o);
26524 * Frees any resources used by the CResult_OnionMessagePathNoneZ.
26526 void CResult_OnionMessagePathNoneZ_free(struct LDKCResult_OnionMessagePathNoneZ _res);
26529 * Creates a new CResult_OnionMessagePathNoneZ which has the same data as `orig`
26530 * but with all dynamically-allocated buffers duplicated in new buffers.
26532 struct LDKCResult_OnionMessagePathNoneZ CResult_OnionMessagePathNoneZ_clone(const struct LDKCResult_OnionMessagePathNoneZ *NONNULL_PTR orig);
26535 * Creates a new tuple which has the same data as `orig`
26536 * but with all dynamically-allocated buffers duplicated in new buffers.
26538 struct LDKC2Tuple_PublicKeyOnionMessageZ C2Tuple_PublicKeyOnionMessageZ_clone(const struct LDKC2Tuple_PublicKeyOnionMessageZ *NONNULL_PTR orig);
26541 * Creates a new C2Tuple_PublicKeyOnionMessageZ from the contained elements.
26543 struct LDKC2Tuple_PublicKeyOnionMessageZ C2Tuple_PublicKeyOnionMessageZ_new(struct LDKPublicKey a, struct LDKOnionMessage b);
26546 * Frees any resources used by the C2Tuple_PublicKeyOnionMessageZ.
26548 void C2Tuple_PublicKeyOnionMessageZ_free(struct LDKC2Tuple_PublicKeyOnionMessageZ _res);
26551 * Creates a new CResult_C2Tuple_PublicKeyOnionMessageZSendErrorZ in the success state.
26553 struct LDKCResult_C2Tuple_PublicKeyOnionMessageZSendErrorZ CResult_C2Tuple_PublicKeyOnionMessageZSendErrorZ_ok(struct LDKC2Tuple_PublicKeyOnionMessageZ o);
26556 * Creates a new CResult_C2Tuple_PublicKeyOnionMessageZSendErrorZ in the error state.
26558 struct LDKCResult_C2Tuple_PublicKeyOnionMessageZSendErrorZ CResult_C2Tuple_PublicKeyOnionMessageZSendErrorZ_err(struct LDKSendError e);
26561 * Checks if the given object is currently in the success state
26563 bool CResult_C2Tuple_PublicKeyOnionMessageZSendErrorZ_is_ok(const struct LDKCResult_C2Tuple_PublicKeyOnionMessageZSendErrorZ *NONNULL_PTR o);
26566 * Frees any resources used by the CResult_C2Tuple_PublicKeyOnionMessageZSendErrorZ.
26568 void CResult_C2Tuple_PublicKeyOnionMessageZSendErrorZ_free(struct LDKCResult_C2Tuple_PublicKeyOnionMessageZSendErrorZ _res);
26571 * Creates a new CResult_NoneSendErrorZ in the success state.
26573 struct LDKCResult_NoneSendErrorZ CResult_NoneSendErrorZ_ok(void);
26576 * Creates a new CResult_NoneSendErrorZ in the error state.
26578 struct LDKCResult_NoneSendErrorZ CResult_NoneSendErrorZ_err(struct LDKSendError e);
26581 * Checks if the given object is currently in the success state
26583 bool CResult_NoneSendErrorZ_is_ok(const struct LDKCResult_NoneSendErrorZ *NONNULL_PTR o);
26586 * Frees any resources used by the CResult_NoneSendErrorZ.
26588 void CResult_NoneSendErrorZ_free(struct LDKCResult_NoneSendErrorZ _res);
26591 * Creates a new CResult_BlindedPathNoneZ in the success state.
26593 struct LDKCResult_BlindedPathNoneZ CResult_BlindedPathNoneZ_ok(struct LDKBlindedPath o);
26596 * Creates a new CResult_BlindedPathNoneZ in the error state.
26598 struct LDKCResult_BlindedPathNoneZ CResult_BlindedPathNoneZ_err(void);
26601 * Checks if the given object is currently in the success state
26603 bool CResult_BlindedPathNoneZ_is_ok(const struct LDKCResult_BlindedPathNoneZ *NONNULL_PTR o);
26606 * Frees any resources used by the CResult_BlindedPathNoneZ.
26608 void CResult_BlindedPathNoneZ_free(struct LDKCResult_BlindedPathNoneZ _res);
26611 * Creates a new CResult_BlindedPathNoneZ which has the same data as `orig`
26612 * but with all dynamically-allocated buffers duplicated in new buffers.
26614 struct LDKCResult_BlindedPathNoneZ CResult_BlindedPathNoneZ_clone(const struct LDKCResult_BlindedPathNoneZ *NONNULL_PTR orig);
26617 * Creates a new CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ in the success state.
26619 struct LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ_ok(struct LDKC2Tuple_BlindedPayInfoBlindedPathZ o);
26622 * Creates a new CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ in the error state.
26624 struct LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ_err(void);
26627 * Checks if the given object is currently in the success state
26629 bool CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ_is_ok(const struct LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ *NONNULL_PTR o);
26632 * Frees any resources used by the CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ.
26634 void CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ_free(struct LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ _res);
26637 * Creates a new CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ which has the same data as `orig`
26638 * but with all dynamically-allocated buffers duplicated in new buffers.
26640 struct LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ_clone(const struct LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ *NONNULL_PTR orig);
26643 * Creates a new CResult_BlindedPathDecodeErrorZ in the success state.
26645 struct LDKCResult_BlindedPathDecodeErrorZ CResult_BlindedPathDecodeErrorZ_ok(struct LDKBlindedPath o);
26648 * Creates a new CResult_BlindedPathDecodeErrorZ in the error state.
26650 struct LDKCResult_BlindedPathDecodeErrorZ CResult_BlindedPathDecodeErrorZ_err(struct LDKDecodeError e);
26653 * Checks if the given object is currently in the success state
26655 bool CResult_BlindedPathDecodeErrorZ_is_ok(const struct LDKCResult_BlindedPathDecodeErrorZ *NONNULL_PTR o);
26658 * Frees any resources used by the CResult_BlindedPathDecodeErrorZ.
26660 void CResult_BlindedPathDecodeErrorZ_free(struct LDKCResult_BlindedPathDecodeErrorZ _res);
26663 * Creates a new CResult_BlindedPathDecodeErrorZ which has the same data as `orig`
26664 * but with all dynamically-allocated buffers duplicated in new buffers.
26666 struct LDKCResult_BlindedPathDecodeErrorZ CResult_BlindedPathDecodeErrorZ_clone(const struct LDKCResult_BlindedPathDecodeErrorZ *NONNULL_PTR orig);
26669 * Creates a new CResult_BlindedHopDecodeErrorZ in the success state.
26671 struct LDKCResult_BlindedHopDecodeErrorZ CResult_BlindedHopDecodeErrorZ_ok(struct LDKBlindedHop o);
26674 * Creates a new CResult_BlindedHopDecodeErrorZ in the error state.
26676 struct LDKCResult_BlindedHopDecodeErrorZ CResult_BlindedHopDecodeErrorZ_err(struct LDKDecodeError e);
26679 * Checks if the given object is currently in the success state
26681 bool CResult_BlindedHopDecodeErrorZ_is_ok(const struct LDKCResult_BlindedHopDecodeErrorZ *NONNULL_PTR o);
26684 * Frees any resources used by the CResult_BlindedHopDecodeErrorZ.
26686 void CResult_BlindedHopDecodeErrorZ_free(struct LDKCResult_BlindedHopDecodeErrorZ _res);
26689 * Creates a new CResult_BlindedHopDecodeErrorZ which has the same data as `orig`
26690 * but with all dynamically-allocated buffers duplicated in new buffers.
26692 struct LDKCResult_BlindedHopDecodeErrorZ CResult_BlindedHopDecodeErrorZ_clone(const struct LDKCResult_BlindedHopDecodeErrorZ *NONNULL_PTR orig);
26695 * Creates a new CResult_InvoiceErrorDecodeErrorZ in the success state.
26697 struct LDKCResult_InvoiceErrorDecodeErrorZ CResult_InvoiceErrorDecodeErrorZ_ok(struct LDKInvoiceError o);
26700 * Creates a new CResult_InvoiceErrorDecodeErrorZ in the error state.
26702 struct LDKCResult_InvoiceErrorDecodeErrorZ CResult_InvoiceErrorDecodeErrorZ_err(struct LDKDecodeError e);
26705 * Checks if the given object is currently in the success state
26707 bool CResult_InvoiceErrorDecodeErrorZ_is_ok(const struct LDKCResult_InvoiceErrorDecodeErrorZ *NONNULL_PTR o);
26710 * Frees any resources used by the CResult_InvoiceErrorDecodeErrorZ.
26712 void CResult_InvoiceErrorDecodeErrorZ_free(struct LDKCResult_InvoiceErrorDecodeErrorZ _res);
26715 * Creates a new CResult_InvoiceErrorDecodeErrorZ which has the same data as `orig`
26716 * but with all dynamically-allocated buffers duplicated in new buffers.
26718 struct LDKCResult_InvoiceErrorDecodeErrorZ CResult_InvoiceErrorDecodeErrorZ_clone(const struct LDKCResult_InvoiceErrorDecodeErrorZ *NONNULL_PTR orig);
26721 * Constructs a new COption_FilterZ containing a crate::lightning::chain::Filter
26723 struct LDKCOption_FilterZ COption_FilterZ_some(struct LDKFilter o);
26726 * Constructs a new COption_FilterZ containing nothing
26728 struct LDKCOption_FilterZ COption_FilterZ_none(void);
26731 * Frees any resources associated with the crate::lightning::chain::Filter, if we are in the Some state
26733 void COption_FilterZ_free(struct LDKCOption_FilterZ _res);
26736 * Creates a new CResult_LockedChannelMonitorNoneZ in the success state.
26738 struct LDKCResult_LockedChannelMonitorNoneZ CResult_LockedChannelMonitorNoneZ_ok(struct LDKLockedChannelMonitor o);
26741 * Creates a new CResult_LockedChannelMonitorNoneZ in the error state.
26743 struct LDKCResult_LockedChannelMonitorNoneZ CResult_LockedChannelMonitorNoneZ_err(void);
26746 * Checks if the given object is currently in the success state
26748 bool CResult_LockedChannelMonitorNoneZ_is_ok(const struct LDKCResult_LockedChannelMonitorNoneZ *NONNULL_PTR o);
26751 * Frees any resources used by the CResult_LockedChannelMonitorNoneZ.
26753 void CResult_LockedChannelMonitorNoneZ_free(struct LDKCResult_LockedChannelMonitorNoneZ _res);
26756 * Frees the buffer pointed to by `data` if `datalen` is non-0.
26758 void CVec_OutPointZ_free(struct LDKCVec_OutPointZ _res);
26761 * Frees the buffer pointed to by `data` if `datalen` is non-0.
26763 void CVec_MonitorUpdateIdZ_free(struct LDKCVec_MonitorUpdateIdZ _res);
26766 * Creates a new tuple which has the same data as `orig`
26767 * but with all dynamically-allocated buffers duplicated in new buffers.
26769 struct LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ C2Tuple_OutPointCVec_MonitorUpdateIdZZ_clone(const struct LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ *NONNULL_PTR orig);
26772 * Creates a new C2Tuple_OutPointCVec_MonitorUpdateIdZZ from the contained elements.
26774 struct LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ C2Tuple_OutPointCVec_MonitorUpdateIdZZ_new(struct LDKOutPoint a, struct LDKCVec_MonitorUpdateIdZ b);
26777 * Frees any resources used by the C2Tuple_OutPointCVec_MonitorUpdateIdZZ.
26779 void C2Tuple_OutPointCVec_MonitorUpdateIdZZ_free(struct LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ _res);
26782 * Frees the buffer pointed to by `data` if `datalen` is non-0.
26784 void CVec_C2Tuple_OutPointCVec_MonitorUpdateIdZZZ_free(struct LDKCVec_C2Tuple_OutPointCVec_MonitorUpdateIdZZZ _res);
26787 * Frees any resources used by the APIError
26789 void APIError_free(struct LDKAPIError this_ptr);
26792 * Creates a copy of the APIError
26794 struct LDKAPIError APIError_clone(const struct LDKAPIError *NONNULL_PTR orig);
26797 * Utility method to constructs a new APIMisuseError-variant APIError
26799 struct LDKAPIError APIError_apimisuse_error(struct LDKStr err);
26802 * Utility method to constructs a new FeeRateTooHigh-variant APIError
26804 struct LDKAPIError APIError_fee_rate_too_high(struct LDKStr err, uint32_t feerate);
26807 * Utility method to constructs a new InvalidRoute-variant APIError
26809 struct LDKAPIError APIError_invalid_route(struct LDKStr err);
26812 * Utility method to constructs a new ChannelUnavailable-variant APIError
26814 struct LDKAPIError APIError_channel_unavailable(struct LDKStr err);
26817 * Utility method to constructs a new MonitorUpdateInProgress-variant APIError
26819 struct LDKAPIError APIError_monitor_update_in_progress(void);
26822 * Utility method to constructs a new IncompatibleShutdownScript-variant APIError
26824 struct LDKAPIError APIError_incompatible_shutdown_script(struct LDKShutdownScript script);
26827 * Checks if two APIErrors contain equal inner contents.
26828 * This ignores pointers and is_owned flags and looks at the values in fields.
26830 bool APIError_eq(const struct LDKAPIError *NONNULL_PTR a, const struct LDKAPIError *NONNULL_PTR b);
26833 * Serialize the APIError object into a byte array which can be read by APIError_read
26835 struct LDKCVec_u8Z APIError_write(const struct LDKAPIError *NONNULL_PTR obj);
26838 * Read a APIError from a byte array, created by APIError_write
26840 struct LDKCResult_COption_APIErrorZDecodeErrorZ APIError_read(struct LDKu8slice ser);
26843 * Frees any resources used by the BigSize, if is_owned is set and inner is non-NULL.
26845 void BigSize_free(struct LDKBigSize this_obj);
26847 uint64_t BigSize_get_a(const struct LDKBigSize *NONNULL_PTR this_ptr);
26849 void BigSize_set_a(struct LDKBigSize *NONNULL_PTR this_ptr, uint64_t val);
26852 * Constructs a new BigSize given each field
26854 MUST_USE_RES struct LDKBigSize BigSize_new(uint64_t a_arg);
26857 * Creates a copy of the BigSize
26859 struct LDKBigSize BigSize_clone(const struct LDKBigSize *NONNULL_PTR orig);
26862 * Generates a non-cryptographic 64-bit hash of the BigSize.
26864 uint64_t BigSize_hash(const struct LDKBigSize *NONNULL_PTR o);
26867 * Checks if two BigSizes contain equal inner contents.
26868 * This ignores pointers and is_owned flags and looks at the values in fields.
26869 * Two objects with NULL inner values will be considered "equal" here.
26871 bool BigSize_eq(const struct LDKBigSize *NONNULL_PTR a, const struct LDKBigSize *NONNULL_PTR b);
26874 * Serialize the BigSize object into a byte array which can be read by BigSize_read
26876 struct LDKCVec_u8Z BigSize_write(const struct LDKBigSize *NONNULL_PTR obj);
26879 * Read a BigSize from a byte array, created by BigSize_write
26881 struct LDKCResult_BigSizeDecodeErrorZ BigSize_read(struct LDKu8slice ser);
26884 * Frees any resources used by the Hostname, if is_owned is set and inner is non-NULL.
26886 void Hostname_free(struct LDKHostname this_obj);
26889 * Creates a copy of the Hostname
26891 struct LDKHostname Hostname_clone(const struct LDKHostname *NONNULL_PTR orig);
26894 * Checks if two Hostnames contain equal inner contents.
26895 * This ignores pointers and is_owned flags and looks at the values in fields.
26896 * Two objects with NULL inner values will be considered "equal" here.
26898 bool Hostname_eq(const struct LDKHostname *NONNULL_PTR a, const struct LDKHostname *NONNULL_PTR b);
26901 * Returns the length of the hostname.
26903 MUST_USE_RES uint8_t Hostname_len(const struct LDKHostname *NONNULL_PTR this_arg);
26906 * Serialize the Hostname object into a byte array which can be read by Hostname_read
26908 struct LDKCVec_u8Z Hostname_write(const struct LDKHostname *NONNULL_PTR obj);
26911 * Read a Hostname from a byte array, created by Hostname_write
26913 struct LDKCResult_HostnameDecodeErrorZ Hostname_read(struct LDKu8slice ser);
26916 * Frees any resources used by the TransactionU16LenLimited, if is_owned is set and inner is non-NULL.
26918 void TransactionU16LenLimited_free(struct LDKTransactionU16LenLimited this_obj);
26921 * Creates a copy of the TransactionU16LenLimited
26923 struct LDKTransactionU16LenLimited TransactionU16LenLimited_clone(const struct LDKTransactionU16LenLimited *NONNULL_PTR orig);
26926 * Checks if two TransactionU16LenLimiteds contain equal inner contents.
26927 * This ignores pointers and is_owned flags and looks at the values in fields.
26928 * Two objects with NULL inner values will be considered "equal" here.
26930 bool TransactionU16LenLimited_eq(const struct LDKTransactionU16LenLimited *NONNULL_PTR a, const struct LDKTransactionU16LenLimited *NONNULL_PTR b);
26933 * Constructs a new `TransactionU16LenLimited` from a `Transaction` only if it's consensus-
26934 * serialized length is <= u16::MAX.
26936 MUST_USE_RES struct LDKCResult_TransactionU16LenLimitedNoneZ TransactionU16LenLimited_new(struct LDKTransaction transaction);
26939 * Consumes this `TransactionU16LenLimited` and returns its contained `Transaction`.
26941 MUST_USE_RES struct LDKTransaction TransactionU16LenLimited_into_transaction(struct LDKTransactionU16LenLimited this_arg);
26944 * Serialize the TransactionU16LenLimited object into a byte array which can be read by TransactionU16LenLimited_read
26946 struct LDKCVec_u8Z TransactionU16LenLimited_write(const struct LDKTransactionU16LenLimited *NONNULL_PTR obj);
26949 * Read a TransactionU16LenLimited from a byte array, created by TransactionU16LenLimited_write
26951 struct LDKCResult_TransactionU16LenLimitedDecodeErrorZ TransactionU16LenLimited_read(struct LDKu8slice ser);
26954 * Creates a digital signature of a message given a SecretKey, like the node's secret.
26955 * 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.
26956 * Signatures are EC recoverable, meaning that given the message and the signature the PublicKey of the signer can be extracted.
26958 struct LDKCResult_StrSecp256k1ErrorZ sign(struct LDKu8slice msg, const uint8_t (*sk)[32]);
26961 * Recovers the PublicKey of the signer of the message given the message and the signature.
26963 struct LDKCResult_PublicKeySecp256k1ErrorZ recover_pk(struct LDKu8slice msg, struct LDKStr sig);
26966 * Verifies a message was signed by a PrivateKey that derives to a given PublicKey, given a message, a signature,
26967 * and the PublicKey.
26969 bool verify(struct LDKu8slice msg, struct LDKStr sig, struct LDKPublicKey pk);
26972 * Construct the invoice's HRP and signatureless data into a preimage to be hashed.
26974 struct LDKCVec_u8Z construct_invoice_preimage(struct LDKu8slice hrp_bytes, struct LDKCVec_U5Z data_without_signature);
26977 * Calls the free function if one is set
26979 void KVStore_free(struct LDKKVStore this_ptr);
26982 * Calls the free function if one is set
26984 void Persister_free(struct LDKPersister this_ptr);
26987 * Read previously persisted [`ChannelMonitor`]s from the store.
26989 struct LDKCResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ read_channel_monitors(struct LDKKVStore kv_store, struct LDKEntropySource entropy_source, struct LDKSignerProvider signer_provider);
26992 * Frees any resources used by the MonitorUpdatingPersister, if is_owned is set and inner is non-NULL.
26994 void MonitorUpdatingPersister_free(struct LDKMonitorUpdatingPersister this_obj);
26997 * Constructs a new [`MonitorUpdatingPersister`].
26999 * The `maximum_pending_updates` parameter controls how many updates may be stored before a
27000 * [`MonitorUpdatingPersister`] consolidates updates by writing a full monitor. Note that
27001 * consolidation will frequently occur with fewer updates than what you set here; this number
27002 * is merely the maximum that may be stored. When setting this value, consider that for higher
27003 * values of `maximum_pending_updates`:
27005 * - [`MonitorUpdatingPersister`] will tend to write more [`ChannelMonitorUpdate`]s than
27006 * [`ChannelMonitor`]s, approaching one [`ChannelMonitor`] write for every
27007 * `maximum_pending_updates` [`ChannelMonitorUpdate`]s.
27008 * - [`MonitorUpdatingPersister`] will issue deletes differently. Lazy deletes will come in
27009 * \"waves\" for each [`ChannelMonitor`] write. A larger `maximum_pending_updates` means bigger,
27010 * less frequent \"waves.\"
27011 * - [`MonitorUpdatingPersister`] will potentially have more listing to do if you need to run
27012 * [`MonitorUpdatingPersister::cleanup_stale_updates`].
27014 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);
27017 * Reads all stored channel monitors, along with any stored updates for them.
27019 * It is extremely important that your [`KVStore::read`] implementation uses the
27020 * [`io::ErrorKind::NotFound`] variant correctly. For more information, please see the
27021 * documentation for [`MonitorUpdatingPersister`].
27023 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);
27026 * Read a single channel monitor, along with any stored updates for it.
27028 * It is extremely important that your [`KVStore::read`] implementation uses the
27029 * [`io::ErrorKind::NotFound`] variant correctly. For more information, please see the
27030 * documentation for [`MonitorUpdatingPersister`].
27032 * For `monitor_key`, channel storage keys be the channel's transaction ID and index, or
27033 * [`OutPoint`], with an underscore `_` between them. For example, given:
27035 * - Transaction ID: `deadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeef`
27038 * The correct `monitor_key` would be:
27039 * `deadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeef_1`
27041 * Loading a large number of monitors will be faster if done in parallel. You can use this
27042 * function to accomplish this. Take care to limit the number of parallel readers.
27044 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);
27047 * Cleans up stale updates for all monitors.
27049 * This function works by first listing all monitors, and then for each of them, listing all
27050 * updates. The updates that have an `update_id` less than or equal to than the stored monitor
27051 * are deleted. The deletion can either be lazy or non-lazy based on the `lazy` flag; this will
27052 * be passed to [`KVStore::remove`].
27054 MUST_USE_RES struct LDKCResult_NoneIOErrorZ MonitorUpdatingPersister_cleanup_stale_updates(const struct LDKMonitorUpdatingPersister *NONNULL_PTR this_arg, bool lazy);
27057 * Constructs a new Persist which calls the relevant methods on this_arg.
27058 * This copies the `inner` pointer in this_arg and thus the returned Persist must be freed before this_arg is
27060 struct LDKPersist MonitorUpdatingPersister_as_Persist(const struct LDKMonitorUpdatingPersister *NONNULL_PTR this_arg);
27063 * Frees any resources used by the UntrustedString, if is_owned is set and inner is non-NULL.
27065 void UntrustedString_free(struct LDKUntrustedString this_obj);
27067 struct LDKStr UntrustedString_get_a(const struct LDKUntrustedString *NONNULL_PTR this_ptr);
27069 void UntrustedString_set_a(struct LDKUntrustedString *NONNULL_PTR this_ptr, struct LDKStr val);
27072 * Constructs a new UntrustedString given each field
27074 MUST_USE_RES struct LDKUntrustedString UntrustedString_new(struct LDKStr a_arg);
27077 * Creates a copy of the UntrustedString
27079 struct LDKUntrustedString UntrustedString_clone(const struct LDKUntrustedString *NONNULL_PTR orig);
27082 * Checks if two UntrustedStrings contain equal inner contents.
27083 * This ignores pointers and is_owned flags and looks at the values in fields.
27084 * Two objects with NULL inner values will be considered "equal" here.
27086 bool UntrustedString_eq(const struct LDKUntrustedString *NONNULL_PTR a, const struct LDKUntrustedString *NONNULL_PTR b);
27089 * Serialize the UntrustedString object into a byte array which can be read by UntrustedString_read
27091 struct LDKCVec_u8Z UntrustedString_write(const struct LDKUntrustedString *NONNULL_PTR obj);
27094 * Read a UntrustedString from a byte array, created by UntrustedString_write
27096 struct LDKCResult_UntrustedStringDecodeErrorZ UntrustedString_read(struct LDKu8slice ser);
27099 * Frees any resources used by the PrintableString, if is_owned is set and inner is non-NULL.
27101 void PrintableString_free(struct LDKPrintableString this_obj);
27103 struct LDKStr PrintableString_get_a(const struct LDKPrintableString *NONNULL_PTR this_ptr);
27105 void PrintableString_set_a(struct LDKPrintableString *NONNULL_PTR this_ptr, struct LDKStr val);
27108 * Constructs a new PrintableString given each field
27110 MUST_USE_RES struct LDKPrintableString PrintableString_new(struct LDKStr a_arg);
27113 * Calls the free function if one is set
27115 void FutureCallback_free(struct LDKFutureCallback this_ptr);
27118 * Frees any resources used by the Future, if is_owned is set and inner is non-NULL.
27120 void Future_free(struct LDKFuture this_obj);
27123 * Creates a copy of the Future
27125 struct LDKFuture Future_clone(const struct LDKFuture *NONNULL_PTR orig);
27128 * Registers a callback to be called upon completion of this future. If the future has already
27129 * completed, the callback will be called immediately.
27131 void Future_register_callback_fn(const struct LDKFuture *NONNULL_PTR this_arg, struct LDKFutureCallback callback);
27134 * Waits until this [`Future`] completes.
27136 void Future_wait(struct LDKFuture this_arg);
27139 * Waits until this [`Future`] completes or the given amount of time has elapsed.
27141 * Returns true if the [`Future`] completed, false if the time elapsed.
27143 MUST_USE_RES bool Future_wait_timeout(struct LDKFuture this_arg, uint64_t max_wait);
27146 * Frees any resources used by the Sleeper, if is_owned is set and inner is non-NULL.
27148 void Sleeper_free(struct LDKSleeper this_obj);
27151 * Constructs a new sleeper from one future, allowing blocking on it.
27153 MUST_USE_RES struct LDKSleeper Sleeper_from_single_future(struct LDKFuture future);
27156 * Constructs a new sleeper from two futures, allowing blocking on both at once.
27158 MUST_USE_RES struct LDKSleeper Sleeper_from_two_futures(struct LDKFuture fut_a, struct LDKFuture fut_b);
27161 * Constructs a new sleeper on many futures, allowing blocking on all at once.
27163 MUST_USE_RES struct LDKSleeper Sleeper_new(struct LDKCVec_FutureZ futures);
27166 * Wait until one of the [`Future`]s registered with this [`Sleeper`] has completed.
27168 void Sleeper_wait(const struct LDKSleeper *NONNULL_PTR this_arg);
27171 * Wait until one of the [`Future`]s registered with this [`Sleeper`] has completed or the
27172 * given amount of time has elapsed. Returns true if a [`Future`] completed, false if the time
27175 MUST_USE_RES bool Sleeper_wait_timeout(const struct LDKSleeper *NONNULL_PTR this_arg, uint64_t max_wait);
27178 * Creates a copy of the Level
27180 enum LDKLevel Level_clone(const enum LDKLevel *NONNULL_PTR orig);
27183 * Utility method to constructs a new Gossip-variant Level
27185 enum LDKLevel Level_gossip(void);
27188 * Utility method to constructs a new Trace-variant Level
27190 enum LDKLevel Level_trace(void);
27193 * Utility method to constructs a new Debug-variant Level
27195 enum LDKLevel Level_debug(void);
27198 * Utility method to constructs a new Info-variant Level
27200 enum LDKLevel Level_info(void);
27203 * Utility method to constructs a new Warn-variant Level
27205 enum LDKLevel Level_warn(void);
27208 * Utility method to constructs a new Error-variant Level
27210 enum LDKLevel Level_error(void);
27213 * Checks if two Levels contain equal inner contents.
27214 * This ignores pointers and is_owned flags and looks at the values in fields.
27216 bool Level_eq(const enum LDKLevel *NONNULL_PTR a, const enum LDKLevel *NONNULL_PTR b);
27219 * Generates a non-cryptographic 64-bit hash of the Level.
27221 uint64_t Level_hash(const enum LDKLevel *NONNULL_PTR o);
27224 * Returns the most verbose logging level.
27226 MUST_USE_RES enum LDKLevel Level_max(void);
27229 * Frees any resources used by the Record, if is_owned is set and inner is non-NULL.
27231 void Record_free(struct LDKRecord this_obj);
27234 * The verbosity level of the message.
27236 enum LDKLevel Record_get_level(const struct LDKRecord *NONNULL_PTR this_ptr);
27239 * The verbosity level of the message.
27241 void Record_set_level(struct LDKRecord *NONNULL_PTR this_ptr, enum LDKLevel val);
27244 * The message body.
27246 struct LDKStr Record_get_args(const struct LDKRecord *NONNULL_PTR this_ptr);
27249 * The message body.
27251 void Record_set_args(struct LDKRecord *NONNULL_PTR this_ptr, struct LDKStr val);
27254 * The module path of the message.
27256 struct LDKStr Record_get_module_path(const struct LDKRecord *NONNULL_PTR this_ptr);
27259 * The module path of the message.
27261 void Record_set_module_path(struct LDKRecord *NONNULL_PTR this_ptr, struct LDKStr val);
27264 * The source file containing the message.
27266 struct LDKStr Record_get_file(const struct LDKRecord *NONNULL_PTR this_ptr);
27269 * The source file containing the message.
27271 void Record_set_file(struct LDKRecord *NONNULL_PTR this_ptr, struct LDKStr val);
27274 * The line containing the message.
27276 uint32_t Record_get_line(const struct LDKRecord *NONNULL_PTR this_ptr);
27279 * The line containing the message.
27281 void Record_set_line(struct LDKRecord *NONNULL_PTR this_ptr, uint32_t val);
27284 * Creates a copy of the Record
27286 struct LDKRecord Record_clone(const struct LDKRecord *NONNULL_PTR orig);
27289 * Calls the free function if one is set
27291 void Logger_free(struct LDKLogger this_ptr);
27294 * Frees any resources used by the ChannelHandshakeConfig, if is_owned is set and inner is non-NULL.
27296 void ChannelHandshakeConfig_free(struct LDKChannelHandshakeConfig this_obj);
27299 * Confirmations we will wait for before considering the channel locked in.
27300 * Applied only for inbound channels (see ChannelHandshakeLimits::max_minimum_depth for the
27301 * equivalent limit applied to outbound channels).
27303 * A lower-bound of 1 is applied, requiring all channels to have a confirmed commitment
27304 * transaction before operation. If you wish to accept channels with zero confirmations, see
27305 * [`UserConfig::manually_accept_inbound_channels`] and
27306 * [`ChannelManager::accept_inbound_channel_from_trusted_peer_0conf`].
27308 * Default value: 6.
27310 * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
27311 * [`ChannelManager::accept_inbound_channel_from_trusted_peer_0conf`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel_from_trusted_peer_0conf
27313 uint32_t ChannelHandshakeConfig_get_minimum_depth(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr);
27316 * Confirmations we will wait for before considering the channel locked in.
27317 * Applied only for inbound channels (see ChannelHandshakeLimits::max_minimum_depth for the
27318 * equivalent limit applied to outbound channels).
27320 * A lower-bound of 1 is applied, requiring all channels to have a confirmed commitment
27321 * transaction before operation. If you wish to accept channels with zero confirmations, see
27322 * [`UserConfig::manually_accept_inbound_channels`] and
27323 * [`ChannelManager::accept_inbound_channel_from_trusted_peer_0conf`].
27325 * Default value: 6.
27327 * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
27328 * [`ChannelManager::accept_inbound_channel_from_trusted_peer_0conf`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel_from_trusted_peer_0conf
27330 void ChannelHandshakeConfig_set_minimum_depth(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, uint32_t val);
27333 * Set to the number of blocks we require our counterparty to wait to claim their money (ie
27334 * the number of blocks we have to punish our counterparty if they broadcast a revoked
27337 * This is one of the main parameters of our security model. We (or one of our watchtowers) MUST
27338 * be online to check for revoked transactions on-chain at least once every our_to_self_delay
27339 * blocks (minus some margin to allow us enough time to broadcast and confirm a transaction,
27340 * possibly with time in between to RBF the spending transaction).
27342 * Meanwhile, asking for a too high delay, we bother peer to freeze funds for nothing in
27343 * case of an honest unilateral channel close, which implicitly decrease the economic value of
27346 * Default value: [`BREAKDOWN_TIMEOUT`], we enforce it as a minimum at channel opening so you
27347 * can tweak config to ask for more security, not less.
27349 uint16_t ChannelHandshakeConfig_get_our_to_self_delay(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr);
27352 * Set to the number of blocks we require our counterparty to wait to claim their money (ie
27353 * the number of blocks we have to punish our counterparty if they broadcast a revoked
27356 * This is one of the main parameters of our security model. We (or one of our watchtowers) MUST
27357 * be online to check for revoked transactions on-chain at least once every our_to_self_delay
27358 * blocks (minus some margin to allow us enough time to broadcast and confirm a transaction,
27359 * possibly with time in between to RBF the spending transaction).
27361 * Meanwhile, asking for a too high delay, we bother peer to freeze funds for nothing in
27362 * case of an honest unilateral channel close, which implicitly decrease the economic value of
27365 * Default value: [`BREAKDOWN_TIMEOUT`], we enforce it as a minimum at channel opening so you
27366 * can tweak config to ask for more security, not less.
27368 void ChannelHandshakeConfig_set_our_to_self_delay(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, uint16_t val);
27371 * Set to the smallest value HTLC we will accept to process.
27373 * This value is sent to our counterparty on channel-open and we close the channel any time
27374 * our counterparty misbehaves by sending us an HTLC with a value smaller than this.
27376 * Default value: 1. If the value is less than 1, it is ignored and set to 1, as is required
27379 uint64_t ChannelHandshakeConfig_get_our_htlc_minimum_msat(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr);
27382 * Set to the smallest value HTLC we will accept to process.
27384 * This value is sent to our counterparty on channel-open and we close the channel any time
27385 * our counterparty misbehaves by sending us an HTLC with a value smaller than this.
27387 * Default value: 1. If the value is less than 1, it is ignored and set to 1, as is required
27390 void ChannelHandshakeConfig_set_our_htlc_minimum_msat(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, uint64_t val);
27393 * Sets the percentage of the channel value we will cap the total value of outstanding inbound
27396 * This can be set to a value between 1-100, where the value corresponds to the percent of the
27397 * channel value in whole percentages.
27400 * * If configured to another value than the default value 10, any new channels created with
27401 * the non default value will cause versions of LDK prior to 0.0.104 to refuse to read the
27402 * `ChannelManager`.
27404 * * This caps the total value for inbound HTLCs in-flight only, and there's currently
27405 * no way to configure the cap for the total value of outbound HTLCs in-flight.
27407 * * The requirements for your node being online to ensure the safety of HTLC-encumbered funds
27408 * are different from the non-HTLC-encumbered funds. This makes this an important knob to
27409 * restrict exposure to loss due to being offline for too long.
27410 * See [`ChannelHandshakeConfig::our_to_self_delay`] and [`ChannelConfig::cltv_expiry_delta`]
27411 * for more information.
27413 * Default value: 10.
27414 * Minimum value: 1, any values less than 1 will be treated as 1 instead.
27415 * Maximum value: 100, any values larger than 100 will be treated as 100 instead.
27417 uint8_t ChannelHandshakeConfig_get_max_inbound_htlc_value_in_flight_percent_of_channel(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr);
27420 * Sets the percentage of the channel value we will cap the total value of outstanding inbound
27423 * This can be set to a value between 1-100, where the value corresponds to the percent of the
27424 * channel value in whole percentages.
27427 * * If configured to another value than the default value 10, any new channels created with
27428 * the non default value will cause versions of LDK prior to 0.0.104 to refuse to read the
27429 * `ChannelManager`.
27431 * * This caps the total value for inbound HTLCs in-flight only, and there's currently
27432 * no way to configure the cap for the total value of outbound HTLCs in-flight.
27434 * * The requirements for your node being online to ensure the safety of HTLC-encumbered funds
27435 * are different from the non-HTLC-encumbered funds. This makes this an important knob to
27436 * restrict exposure to loss due to being offline for too long.
27437 * See [`ChannelHandshakeConfig::our_to_self_delay`] and [`ChannelConfig::cltv_expiry_delta`]
27438 * for more information.
27440 * Default value: 10.
27441 * Minimum value: 1, any values less than 1 will be treated as 1 instead.
27442 * Maximum value: 100, any values larger than 100 will be treated as 100 instead.
27444 void ChannelHandshakeConfig_set_max_inbound_htlc_value_in_flight_percent_of_channel(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, uint8_t val);
27447 * If set, we attempt to negotiate the `scid_privacy` (referred to as `scid_alias` in the
27448 * BOLTs) option for outbound private channels. This provides better privacy by not including
27449 * our real on-chain channel UTXO in each invoice and requiring that our counterparty only
27450 * relay HTLCs to us using the channel's SCID alias.
27452 * If this option is set, channels may be created that will not be readable by LDK versions
27453 * prior to 0.0.106, causing [`ChannelManager`]'s read method to return a
27454 * [`DecodeError::InvalidValue`].
27456 * Note that setting this to true does *not* prevent us from opening channels with
27457 * counterparties that do not support the `scid_alias` option; we will simply fall back to a
27458 * private channel without that option.
27460 * Ignored if the channel is negotiated to be announced, see
27461 * [`ChannelHandshakeConfig::announced_channel`] and
27462 * [`ChannelHandshakeLimits::force_announced_channel_preference`] for more.
27464 * Default value: false. This value is likely to change to true in the future.
27466 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
27467 * [`DecodeError::InvalidValue`]: crate::ln::msgs::DecodeError::InvalidValue
27469 bool ChannelHandshakeConfig_get_negotiate_scid_privacy(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr);
27472 * If set, we attempt to negotiate the `scid_privacy` (referred to as `scid_alias` in the
27473 * BOLTs) option for outbound private channels. This provides better privacy by not including
27474 * our real on-chain channel UTXO in each invoice and requiring that our counterparty only
27475 * relay HTLCs to us using the channel's SCID alias.
27477 * If this option is set, channels may be created that will not be readable by LDK versions
27478 * prior to 0.0.106, causing [`ChannelManager`]'s read method to return a
27479 * [`DecodeError::InvalidValue`].
27481 * Note that setting this to true does *not* prevent us from opening channels with
27482 * counterparties that do not support the `scid_alias` option; we will simply fall back to a
27483 * private channel without that option.
27485 * Ignored if the channel is negotiated to be announced, see
27486 * [`ChannelHandshakeConfig::announced_channel`] and
27487 * [`ChannelHandshakeLimits::force_announced_channel_preference`] for more.
27489 * Default value: false. This value is likely to change to true in the future.
27491 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
27492 * [`DecodeError::InvalidValue`]: crate::ln::msgs::DecodeError::InvalidValue
27494 void ChannelHandshakeConfig_set_negotiate_scid_privacy(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, bool val);
27497 * Set to announce the channel publicly and notify all nodes that they can route via this
27500 * This should only be set to true for nodes which expect to be online reliably.
27502 * As the node which funds a channel picks this value this will only apply for new outbound
27503 * channels unless [`ChannelHandshakeLimits::force_announced_channel_preference`] is set.
27505 * Default value: false.
27507 bool ChannelHandshakeConfig_get_announced_channel(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr);
27510 * Set to announce the channel publicly and notify all nodes that they can route via this
27513 * This should only be set to true for nodes which expect to be online reliably.
27515 * As the node which funds a channel picks this value this will only apply for new outbound
27516 * channels unless [`ChannelHandshakeLimits::force_announced_channel_preference`] is set.
27518 * Default value: false.
27520 void ChannelHandshakeConfig_set_announced_channel(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, bool val);
27523 * When set, we commit to an upfront shutdown_pubkey at channel open. If our counterparty
27524 * supports it, they will then enforce the mutual-close output to us matches what we provided
27525 * at intialization, preventing us from closing to an alternate pubkey.
27527 * This is set to true by default to provide a slight increase in security, though ultimately
27528 * any attacker who is able to take control of a channel can just as easily send the funds via
27529 * lightning payments, so we never require that our counterparties support this option.
27531 * The upfront key committed is provided from [`SignerProvider::get_shutdown_scriptpubkey`].
27533 * Default value: true.
27535 * [`SignerProvider::get_shutdown_scriptpubkey`]: crate::sign::SignerProvider::get_shutdown_scriptpubkey
27537 bool ChannelHandshakeConfig_get_commit_upfront_shutdown_pubkey(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr);
27540 * When set, we commit to an upfront shutdown_pubkey at channel open. If our counterparty
27541 * supports it, they will then enforce the mutual-close output to us matches what we provided
27542 * at intialization, preventing us from closing to an alternate pubkey.
27544 * This is set to true by default to provide a slight increase in security, though ultimately
27545 * any attacker who is able to take control of a channel can just as easily send the funds via
27546 * lightning payments, so we never require that our counterparties support this option.
27548 * The upfront key committed is provided from [`SignerProvider::get_shutdown_scriptpubkey`].
27550 * Default value: true.
27552 * [`SignerProvider::get_shutdown_scriptpubkey`]: crate::sign::SignerProvider::get_shutdown_scriptpubkey
27554 void ChannelHandshakeConfig_set_commit_upfront_shutdown_pubkey(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, bool val);
27557 * The Proportion of the channel value to configure as counterparty's channel reserve,
27558 * i.e., `their_channel_reserve_satoshis` for both outbound and inbound channels.
27560 * `their_channel_reserve_satoshis` is the minimum balance that the other node has to maintain
27561 * on their side, at all times.
27562 * This ensures that if our counterparty broadcasts a revoked state, we can punish them by
27563 * claiming at least this value on chain.
27565 * Channel reserve values greater than 30% could be considered highly unreasonable, since that
27566 * amount can never be used for payments.
27567 * Also, if our selected channel reserve for counterparty and counterparty's selected
27568 * channel reserve for us sum up to equal or greater than channel value, channel negotiations
27571 * Note: Versions of LDK earlier than v0.0.104 will fail to read channels with any channel reserve
27572 * other than the default value.
27574 * Default value: 1% of channel value, i.e., configured as 10,000 millionths.
27575 * Minimum value: If the calculated proportional value is less than 1000 sats, it will be treated
27576 * as 1000 sats instead, which is a safe implementation-specific lower bound.
27577 * Maximum value: 1,000,000, any values larger than 1 Million will be treated as 1 Million (or 100%)
27578 * instead, although channel negotiations will fail in that case.
27580 uint32_t ChannelHandshakeConfig_get_their_channel_reserve_proportional_millionths(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr);
27583 * The Proportion of the channel value to configure as counterparty's channel reserve,
27584 * i.e., `their_channel_reserve_satoshis` for both outbound and inbound channels.
27586 * `their_channel_reserve_satoshis` is the minimum balance that the other node has to maintain
27587 * on their side, at all times.
27588 * This ensures that if our counterparty broadcasts a revoked state, we can punish them by
27589 * claiming at least this value on chain.
27591 * Channel reserve values greater than 30% could be considered highly unreasonable, since that
27592 * amount can never be used for payments.
27593 * Also, if our selected channel reserve for counterparty and counterparty's selected
27594 * channel reserve for us sum up to equal or greater than channel value, channel negotiations
27597 * Note: Versions of LDK earlier than v0.0.104 will fail to read channels with any channel reserve
27598 * other than the default value.
27600 * Default value: 1% of channel value, i.e., configured as 10,000 millionths.
27601 * Minimum value: If the calculated proportional value is less than 1000 sats, it will be treated
27602 * as 1000 sats instead, which is a safe implementation-specific lower bound.
27603 * Maximum value: 1,000,000, any values larger than 1 Million will be treated as 1 Million (or 100%)
27604 * instead, although channel negotiations will fail in that case.
27606 void ChannelHandshakeConfig_set_their_channel_reserve_proportional_millionths(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, uint32_t val);
27609 * If set, we attempt to negotiate the `anchors_zero_fee_htlc_tx`option for all future
27610 * channels. This feature requires having a reserve of onchain funds readily available to bump
27611 * transactions in the event of a channel force close to avoid the possibility of losing funds.
27613 * Note that if you wish accept inbound channels with anchor outputs, you must enable
27614 * [`UserConfig::manually_accept_inbound_channels`] and manually accept them with
27615 * [`ChannelManager::accept_inbound_channel`]. This is done to give you the chance to check
27616 * whether your reserve of onchain funds is enough to cover the fees for all existing and new
27617 * channels featuring anchor outputs in the event of a force close.
27619 * If this option is set, channels may be created that will not be readable by LDK versions
27620 * prior to 0.0.116, causing [`ChannelManager`]'s read method to return a
27621 * [`DecodeError::InvalidValue`].
27623 * Note that setting this to true does *not* prevent us from opening channels with
27624 * counterparties that do not support the `anchors_zero_fee_htlc_tx` option; we will simply
27625 * fall back to a `static_remote_key` channel.
27627 * LDK will not support the legacy `option_anchors` commitment version due to a discovered
27628 * vulnerability after its deployment. For more context, see the [`SIGHASH_SINGLE + update_fee
27629 * Considered Harmful`] mailing list post.
27631 * Default value: false. This value is likely to change to true in the future.
27633 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
27634 * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
27635 * [`DecodeError::InvalidValue`]: crate::ln::msgs::DecodeError::InvalidValue
27636 * [`SIGHASH_SINGLE + update_fee Considered Harmful`]: https://lists.linuxfoundation.org/pipermail/lightning-dev/2020-September/002796.html
27638 bool ChannelHandshakeConfig_get_negotiate_anchors_zero_fee_htlc_tx(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr);
27641 * If set, we attempt to negotiate the `anchors_zero_fee_htlc_tx`option for all future
27642 * channels. This feature requires having a reserve of onchain funds readily available to bump
27643 * transactions in the event of a channel force close to avoid the possibility of losing funds.
27645 * Note that if you wish accept inbound channels with anchor outputs, you must enable
27646 * [`UserConfig::manually_accept_inbound_channels`] and manually accept them with
27647 * [`ChannelManager::accept_inbound_channel`]. This is done to give you the chance to check
27648 * whether your reserve of onchain funds is enough to cover the fees for all existing and new
27649 * channels featuring anchor outputs in the event of a force close.
27651 * If this option is set, channels may be created that will not be readable by LDK versions
27652 * prior to 0.0.116, causing [`ChannelManager`]'s read method to return a
27653 * [`DecodeError::InvalidValue`].
27655 * Note that setting this to true does *not* prevent us from opening channels with
27656 * counterparties that do not support the `anchors_zero_fee_htlc_tx` option; we will simply
27657 * fall back to a `static_remote_key` channel.
27659 * LDK will not support the legacy `option_anchors` commitment version due to a discovered
27660 * vulnerability after its deployment. For more context, see the [`SIGHASH_SINGLE + update_fee
27661 * Considered Harmful`] mailing list post.
27663 * Default value: false. This value is likely to change to true in the future.
27665 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
27666 * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
27667 * [`DecodeError::InvalidValue`]: crate::ln::msgs::DecodeError::InvalidValue
27668 * [`SIGHASH_SINGLE + update_fee Considered Harmful`]: https://lists.linuxfoundation.org/pipermail/lightning-dev/2020-September/002796.html
27670 void ChannelHandshakeConfig_set_negotiate_anchors_zero_fee_htlc_tx(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, bool val);
27673 * The maximum number of HTLCs in-flight from our counterparty towards us at the same time.
27675 * Increasing the value can help improve liquidity and stability in
27676 * routing at the cost of higher long term disk / DB usage.
27678 * Note: Versions of LDK earlier than v0.0.115 will fail to read channels with a configuration
27679 * other than the default value.
27681 * Default value: 50
27682 * Maximum value: 483, any values larger will be treated as 483.
27683 * This is the BOLT #2 spec limit on `max_accepted_htlcs`.
27685 uint16_t ChannelHandshakeConfig_get_our_max_accepted_htlcs(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr);
27688 * The maximum number of HTLCs in-flight from our counterparty towards us at the same time.
27690 * Increasing the value can help improve liquidity and stability in
27691 * routing at the cost of higher long term disk / DB usage.
27693 * Note: Versions of LDK earlier than v0.0.115 will fail to read channels with a configuration
27694 * other than the default value.
27696 * Default value: 50
27697 * Maximum value: 483, any values larger will be treated as 483.
27698 * This is the BOLT #2 spec limit on `max_accepted_htlcs`.
27700 void ChannelHandshakeConfig_set_our_max_accepted_htlcs(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, uint16_t val);
27703 * Constructs a new ChannelHandshakeConfig given each field
27705 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);
27708 * Creates a copy of the ChannelHandshakeConfig
27710 struct LDKChannelHandshakeConfig ChannelHandshakeConfig_clone(const struct LDKChannelHandshakeConfig *NONNULL_PTR orig);
27713 * Creates a "default" ChannelHandshakeConfig. See struct and individual field documentaiton for details on which values are used.
27715 MUST_USE_RES struct LDKChannelHandshakeConfig ChannelHandshakeConfig_default(void);
27718 * Frees any resources used by the ChannelHandshakeLimits, if is_owned is set and inner is non-NULL.
27720 void ChannelHandshakeLimits_free(struct LDKChannelHandshakeLimits this_obj);
27723 * Minimum allowed satoshis when a channel is funded. This is supplied by the sender and so
27724 * only applies to inbound channels.
27726 * Default value: 0.
27728 uint64_t ChannelHandshakeLimits_get_min_funding_satoshis(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
27731 * Minimum allowed satoshis when a channel is funded. This is supplied by the sender and so
27732 * only applies to inbound channels.
27734 * Default value: 0.
27736 void ChannelHandshakeLimits_set_min_funding_satoshis(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint64_t val);
27739 * Maximum allowed satoshis when a channel is funded. This is supplied by the sender and so
27740 * only applies to inbound channels.
27742 * Default value: 2^24 - 1.
27744 uint64_t ChannelHandshakeLimits_get_max_funding_satoshis(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
27747 * Maximum allowed satoshis when a channel is funded. This is supplied by the sender and so
27748 * only applies to inbound channels.
27750 * Default value: 2^24 - 1.
27752 void ChannelHandshakeLimits_set_max_funding_satoshis(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint64_t val);
27755 * The remote node sets a limit on the minimum size of HTLCs we can send to them. This allows
27756 * you to limit the maximum minimum-size they can require.
27758 * Default value: u64::max_value.
27760 uint64_t ChannelHandshakeLimits_get_max_htlc_minimum_msat(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
27763 * The remote node sets a limit on the minimum size of HTLCs we can send to them. This allows
27764 * you to limit the maximum minimum-size they can require.
27766 * Default value: u64::max_value.
27768 void ChannelHandshakeLimits_set_max_htlc_minimum_msat(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint64_t val);
27771 * The remote node sets a limit on the maximum value of pending HTLCs to them at any given
27772 * time to limit their funds exposure to HTLCs. This allows you to set a minimum such value.
27774 * Default value: 0.
27776 uint64_t ChannelHandshakeLimits_get_min_max_htlc_value_in_flight_msat(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
27779 * The remote node sets a limit on the maximum value of pending HTLCs to them at any given
27780 * time to limit their funds exposure to HTLCs. This allows you to set a minimum such value.
27782 * Default value: 0.
27784 void ChannelHandshakeLimits_set_min_max_htlc_value_in_flight_msat(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint64_t val);
27787 * The remote node will require we keep a certain amount in direct payment to ourselves at all
27788 * time, ensuring that we are able to be punished if we broadcast an old state. This allows to
27789 * you limit the amount which we will have to keep to ourselves (and cannot use for HTLCs).
27791 * Default value: u64::max_value.
27793 uint64_t ChannelHandshakeLimits_get_max_channel_reserve_satoshis(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
27796 * The remote node will require we keep a certain amount in direct payment to ourselves at all
27797 * time, ensuring that we are able to be punished if we broadcast an old state. This allows to
27798 * you limit the amount which we will have to keep to ourselves (and cannot use for HTLCs).
27800 * Default value: u64::max_value.
27802 void ChannelHandshakeLimits_set_max_channel_reserve_satoshis(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint64_t val);
27805 * The remote node sets a limit on the maximum number of pending HTLCs to them at any given
27806 * time. This allows you to set a minimum such value.
27808 * Default value: 0.
27810 uint16_t ChannelHandshakeLimits_get_min_max_accepted_htlcs(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
27813 * The remote node sets a limit on the maximum number of pending HTLCs to them at any given
27814 * time. This allows you to set a minimum such value.
27816 * Default value: 0.
27818 void ChannelHandshakeLimits_set_min_max_accepted_htlcs(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint16_t val);
27821 * Before a channel is usable the funding transaction will need to be confirmed by at least a
27822 * certain number of blocks, specified by the node which is not the funder (as the funder can
27823 * assume they aren't going to double-spend themselves).
27824 * This config allows you to set a limit on the maximum amount of time to wait.
27826 * Default value: 144, or roughly one day and only applies to outbound channels.
27828 uint32_t ChannelHandshakeLimits_get_max_minimum_depth(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
27831 * Before a channel is usable the funding transaction will need to be confirmed by at least a
27832 * certain number of blocks, specified by the node which is not the funder (as the funder can
27833 * assume they aren't going to double-spend themselves).
27834 * This config allows you to set a limit on the maximum amount of time to wait.
27836 * Default value: 144, or roughly one day and only applies to outbound channels.
27838 void ChannelHandshakeLimits_set_max_minimum_depth(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint32_t val);
27841 * Whether we implicitly trust funding transactions generated by us for our own outbound
27842 * channels to not be double-spent.
27844 * If this is set, we assume that our own funding transactions are *never* double-spent, and
27845 * thus we can trust them without any confirmations. This is generally a reasonable
27846 * assumption, given we're the only ones who could ever double-spend it (assuming we have sole
27847 * control of the signing keys).
27849 * You may wish to un-set this if you allow the user to (or do in an automated fashion)
27850 * double-spend the funding transaction to RBF with an alternative channel open.
27852 * This only applies if our counterparty set their confirmations-required value to 0, and we
27853 * always trust our own funding transaction at 1 confirmation irrespective of this value.
27854 * Thus, this effectively acts as a `min_minimum_depth`, with the only possible values being
27855 * `true` (0) and `false` (1).
27857 * Default value: true
27859 bool ChannelHandshakeLimits_get_trust_own_funding_0conf(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
27862 * Whether we implicitly trust funding transactions generated by us for our own outbound
27863 * channels to not be double-spent.
27865 * If this is set, we assume that our own funding transactions are *never* double-spent, and
27866 * thus we can trust them without any confirmations. This is generally a reasonable
27867 * assumption, given we're the only ones who could ever double-spend it (assuming we have sole
27868 * control of the signing keys).
27870 * You may wish to un-set this if you allow the user to (or do in an automated fashion)
27871 * double-spend the funding transaction to RBF with an alternative channel open.
27873 * This only applies if our counterparty set their confirmations-required value to 0, and we
27874 * always trust our own funding transaction at 1 confirmation irrespective of this value.
27875 * Thus, this effectively acts as a `min_minimum_depth`, with the only possible values being
27876 * `true` (0) and `false` (1).
27878 * Default value: true
27880 void ChannelHandshakeLimits_set_trust_own_funding_0conf(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, bool val);
27883 * Set to force an incoming channel to match our announced channel preference in
27884 * [`ChannelHandshakeConfig::announced_channel`].
27886 * For a node which is not online reliably, this should be set to true and
27887 * [`ChannelHandshakeConfig::announced_channel`] set to false, ensuring that no announced (aka public)
27888 * channels will ever be opened.
27890 * Default value: true.
27892 bool ChannelHandshakeLimits_get_force_announced_channel_preference(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
27895 * Set to force an incoming channel to match our announced channel preference in
27896 * [`ChannelHandshakeConfig::announced_channel`].
27898 * For a node which is not online reliably, this should be set to true and
27899 * [`ChannelHandshakeConfig::announced_channel`] set to false, ensuring that no announced (aka public)
27900 * channels will ever be opened.
27902 * Default value: true.
27904 void ChannelHandshakeLimits_set_force_announced_channel_preference(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, bool val);
27907 * Set to the amount of time we're willing to wait to claim money back to us.
27909 * Not checking this value would be a security issue, as our peer would be able to set it to
27910 * max relative lock-time (a year) and we would \"lose\" money as it would be locked for a long time.
27912 * Default value: 2016, which we also enforce as a maximum value so you can tweak config to
27913 * reduce the loss of having useless locked funds (if your peer accepts)
27915 uint16_t ChannelHandshakeLimits_get_their_to_self_delay(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
27918 * Set to the amount of time we're willing to wait to claim money back to us.
27920 * Not checking this value would be a security issue, as our peer would be able to set it to
27921 * max relative lock-time (a year) and we would \"lose\" money as it would be locked for a long time.
27923 * Default value: 2016, which we also enforce as a maximum value so you can tweak config to
27924 * reduce the loss of having useless locked funds (if your peer accepts)
27926 void ChannelHandshakeLimits_set_their_to_self_delay(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint16_t val);
27929 * Constructs a new ChannelHandshakeLimits given each field
27931 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);
27934 * Creates a copy of the ChannelHandshakeLimits
27936 struct LDKChannelHandshakeLimits ChannelHandshakeLimits_clone(const struct LDKChannelHandshakeLimits *NONNULL_PTR orig);
27939 * Creates a "default" ChannelHandshakeLimits. See struct and individual field documentaiton for details on which values are used.
27941 MUST_USE_RES struct LDKChannelHandshakeLimits ChannelHandshakeLimits_default(void);
27944 * Frees any resources used by the MaxDustHTLCExposure
27946 void MaxDustHTLCExposure_free(struct LDKMaxDustHTLCExposure this_ptr);
27949 * Creates a copy of the MaxDustHTLCExposure
27951 struct LDKMaxDustHTLCExposure MaxDustHTLCExposure_clone(const struct LDKMaxDustHTLCExposure *NONNULL_PTR orig);
27954 * Utility method to constructs a new FixedLimitMsat-variant MaxDustHTLCExposure
27956 struct LDKMaxDustHTLCExposure MaxDustHTLCExposure_fixed_limit_msat(uint64_t a);
27959 * Utility method to constructs a new FeeRateMultiplier-variant MaxDustHTLCExposure
27961 struct LDKMaxDustHTLCExposure MaxDustHTLCExposure_fee_rate_multiplier(uint64_t a);
27964 * Checks if two MaxDustHTLCExposures contain equal inner contents.
27965 * This ignores pointers and is_owned flags and looks at the values in fields.
27967 bool MaxDustHTLCExposure_eq(const struct LDKMaxDustHTLCExposure *NONNULL_PTR a, const struct LDKMaxDustHTLCExposure *NONNULL_PTR b);
27970 * Serialize the MaxDustHTLCExposure object into a byte array which can be read by MaxDustHTLCExposure_read
27972 struct LDKCVec_u8Z MaxDustHTLCExposure_write(const struct LDKMaxDustHTLCExposure *NONNULL_PTR obj);
27975 * Read a MaxDustHTLCExposure from a byte array, created by MaxDustHTLCExposure_write
27977 struct LDKCResult_MaxDustHTLCExposureDecodeErrorZ MaxDustHTLCExposure_read(struct LDKu8slice ser);
27980 * Frees any resources used by the ChannelConfig, if is_owned is set and inner is non-NULL.
27982 void ChannelConfig_free(struct LDKChannelConfig this_obj);
27985 * Amount (in millionths of a satoshi) charged per satoshi for payments forwarded outbound
27986 * over the channel.
27987 * This may be allowed to change at runtime in a later update, however doing so must result in
27988 * update messages sent to notify all nodes of our updated relay fee.
27990 * Default value: 0.
27992 uint32_t ChannelConfig_get_forwarding_fee_proportional_millionths(const struct LDKChannelConfig *NONNULL_PTR this_ptr);
27995 * Amount (in millionths of a satoshi) charged per satoshi for payments forwarded outbound
27996 * over the channel.
27997 * This may be allowed to change at runtime in a later update, however doing so must result in
27998 * update messages sent to notify all nodes of our updated relay fee.
28000 * Default value: 0.
28002 void ChannelConfig_set_forwarding_fee_proportional_millionths(struct LDKChannelConfig *NONNULL_PTR this_ptr, uint32_t val);
28005 * Amount (in milli-satoshi) charged for payments forwarded outbound over the channel, in
28006 * excess of [`forwarding_fee_proportional_millionths`].
28007 * This may be allowed to change at runtime in a later update, however doing so must result in
28008 * update messages sent to notify all nodes of our updated relay fee.
28010 * The default value of a single satoshi roughly matches the market rate on many routing nodes
28011 * as of July 2021. Adjusting it upwards or downwards may change whether nodes route through
28014 * Default value: 1000.
28016 * [`forwarding_fee_proportional_millionths`]: ChannelConfig::forwarding_fee_proportional_millionths
28018 uint32_t ChannelConfig_get_forwarding_fee_base_msat(const struct LDKChannelConfig *NONNULL_PTR this_ptr);
28021 * Amount (in milli-satoshi) charged for payments forwarded outbound over the channel, in
28022 * excess of [`forwarding_fee_proportional_millionths`].
28023 * This may be allowed to change at runtime in a later update, however doing so must result in
28024 * update messages sent to notify all nodes of our updated relay fee.
28026 * The default value of a single satoshi roughly matches the market rate on many routing nodes
28027 * as of July 2021. Adjusting it upwards or downwards may change whether nodes route through
28030 * Default value: 1000.
28032 * [`forwarding_fee_proportional_millionths`]: ChannelConfig::forwarding_fee_proportional_millionths
28034 void ChannelConfig_set_forwarding_fee_base_msat(struct LDKChannelConfig *NONNULL_PTR this_ptr, uint32_t val);
28037 * The difference in the CLTV value between incoming HTLCs and an outbound HTLC forwarded over
28038 * the channel this config applies to.
28040 * This is analogous to [`ChannelHandshakeConfig::our_to_self_delay`] but applies to in-flight
28041 * HTLC balance when a channel appears on-chain whereas
28042 * [`ChannelHandshakeConfig::our_to_self_delay`] applies to the remaining
28043 * (non-HTLC-encumbered) balance.
28045 * Thus, for HTLC-encumbered balances to be enforced on-chain when a channel is force-closed,
28046 * we (or one of our watchtowers) MUST be online to check for broadcast of the current
28047 * commitment transaction at least once per this many blocks (minus some margin to allow us
28048 * enough time to broadcast and confirm a transaction, possibly with time in between to RBF
28049 * the spending transaction).
28051 * Default value: 72 (12 hours at an average of 6 blocks/hour).
28052 * Minimum value: [`MIN_CLTV_EXPIRY_DELTA`], any values less than this will be treated as
28053 * [`MIN_CLTV_EXPIRY_DELTA`] instead.
28055 * [`MIN_CLTV_EXPIRY_DELTA`]: crate::ln::channelmanager::MIN_CLTV_EXPIRY_DELTA
28057 uint16_t ChannelConfig_get_cltv_expiry_delta(const struct LDKChannelConfig *NONNULL_PTR this_ptr);
28060 * The difference in the CLTV value between incoming HTLCs and an outbound HTLC forwarded over
28061 * the channel this config applies to.
28063 * This is analogous to [`ChannelHandshakeConfig::our_to_self_delay`] but applies to in-flight
28064 * HTLC balance when a channel appears on-chain whereas
28065 * [`ChannelHandshakeConfig::our_to_self_delay`] applies to the remaining
28066 * (non-HTLC-encumbered) balance.
28068 * Thus, for HTLC-encumbered balances to be enforced on-chain when a channel is force-closed,
28069 * we (or one of our watchtowers) MUST be online to check for broadcast of the current
28070 * commitment transaction at least once per this many blocks (minus some margin to allow us
28071 * enough time to broadcast and confirm a transaction, possibly with time in between to RBF
28072 * the spending transaction).
28074 * Default value: 72 (12 hours at an average of 6 blocks/hour).
28075 * Minimum value: [`MIN_CLTV_EXPIRY_DELTA`], any values less than this will be treated as
28076 * [`MIN_CLTV_EXPIRY_DELTA`] instead.
28078 * [`MIN_CLTV_EXPIRY_DELTA`]: crate::ln::channelmanager::MIN_CLTV_EXPIRY_DELTA
28080 void ChannelConfig_set_cltv_expiry_delta(struct LDKChannelConfig *NONNULL_PTR this_ptr, uint16_t val);
28083 * Limit our total exposure to in-flight HTLCs which are burned to fees as they are too
28084 * small to claim on-chain.
28086 * When an HTLC present in one of our channels is below a \"dust\" threshold, the HTLC will
28087 * not be claimable on-chain, instead being turned into additional miner fees if either
28088 * party force-closes the channel. Because the threshold is per-HTLC, our total exposure
28089 * to such payments may be sustantial if there are many dust HTLCs present when the
28090 * channel is force-closed.
28092 * The dust threshold for each HTLC is based on the `dust_limit_satoshis` for each party in a
28093 * channel negotiated throughout the channel open process, along with the fees required to have
28094 * a broadcastable HTLC spending transaction. When a channel supports anchor outputs
28095 * (specifically the zero fee HTLC transaction variant), this threshold no longer takes into
28096 * account the HTLC transaction fee as it is zero. Because of this, you may want to set this
28097 * value to a fixed limit for channels using anchor outputs, while the fee rate multiplier
28098 * variant is primarily intended for use with pre-anchor channels.
28100 * The selected limit is applied for sent, forwarded, and received HTLCs and limits the total
28101 * exposure across all three types per-channel.
28103 * Default value: [`MaxDustHTLCExposure::FeeRateMultiplier`] with a multiplier of 5000.
28105 struct LDKMaxDustHTLCExposure ChannelConfig_get_max_dust_htlc_exposure(const struct LDKChannelConfig *NONNULL_PTR this_ptr);
28108 * Limit our total exposure to in-flight HTLCs which are burned to fees as they are too
28109 * small to claim on-chain.
28111 * When an HTLC present in one of our channels is below a \"dust\" threshold, the HTLC will
28112 * not be claimable on-chain, instead being turned into additional miner fees if either
28113 * party force-closes the channel. Because the threshold is per-HTLC, our total exposure
28114 * to such payments may be sustantial if there are many dust HTLCs present when the
28115 * channel is force-closed.
28117 * The dust threshold for each HTLC is based on the `dust_limit_satoshis` for each party in a
28118 * channel negotiated throughout the channel open process, along with the fees required to have
28119 * a broadcastable HTLC spending transaction. When a channel supports anchor outputs
28120 * (specifically the zero fee HTLC transaction variant), this threshold no longer takes into
28121 * account the HTLC transaction fee as it is zero. Because of this, you may want to set this
28122 * value to a fixed limit for channels using anchor outputs, while the fee rate multiplier
28123 * variant is primarily intended for use with pre-anchor channels.
28125 * The selected limit is applied for sent, forwarded, and received HTLCs and limits the total
28126 * exposure across all three types per-channel.
28128 * Default value: [`MaxDustHTLCExposure::FeeRateMultiplier`] with a multiplier of 5000.
28130 void ChannelConfig_set_max_dust_htlc_exposure(struct LDKChannelConfig *NONNULL_PTR this_ptr, struct LDKMaxDustHTLCExposure val);
28133 * The additional fee we're willing to pay to avoid waiting for the counterparty's
28134 * `to_self_delay` to reclaim funds.
28136 * When we close a channel cooperatively with our counterparty, we negotiate a fee for the
28137 * closing transaction which both sides find acceptable, ultimately paid by the channel
28138 * funder/initiator.
28140 * When we are the funder, because we have to pay the channel closing fee, we bound the
28141 * acceptable fee by our [`Background`] and [`Normal`] fees, with the upper bound increased by
28142 * this value. Because the on-chain fee we'd pay to force-close the channel is kept near our
28143 * [`Normal`] feerate during normal operation, this value represents the additional fee we're
28144 * willing to pay in order to avoid waiting for our counterparty's to_self_delay to reclaim our
28147 * When we are not the funder, we require the closing transaction fee pay at least our
28148 * [`Background`] fee estimate, but allow our counterparty to pay as much fee as they like.
28149 * Thus, this value is ignored when we are not the funder.
28151 * Default value: 1000 satoshis.
28153 * [`Normal`]: crate::chain::chaininterface::ConfirmationTarget::Normal
28154 * [`Background`]: crate::chain::chaininterface::ConfirmationTarget::Background
28156 uint64_t ChannelConfig_get_force_close_avoidance_max_fee_satoshis(const struct LDKChannelConfig *NONNULL_PTR this_ptr);
28159 * The additional fee we're willing to pay to avoid waiting for the counterparty's
28160 * `to_self_delay` to reclaim funds.
28162 * When we close a channel cooperatively with our counterparty, we negotiate a fee for the
28163 * closing transaction which both sides find acceptable, ultimately paid by the channel
28164 * funder/initiator.
28166 * When we are the funder, because we have to pay the channel closing fee, we bound the
28167 * acceptable fee by our [`Background`] and [`Normal`] fees, with the upper bound increased by
28168 * this value. Because the on-chain fee we'd pay to force-close the channel is kept near our
28169 * [`Normal`] feerate during normal operation, this value represents the additional fee we're
28170 * willing to pay in order to avoid waiting for our counterparty's to_self_delay to reclaim our
28173 * When we are not the funder, we require the closing transaction fee pay at least our
28174 * [`Background`] fee estimate, but allow our counterparty to pay as much fee as they like.
28175 * Thus, this value is ignored when we are not the funder.
28177 * Default value: 1000 satoshis.
28179 * [`Normal`]: crate::chain::chaininterface::ConfirmationTarget::Normal
28180 * [`Background`]: crate::chain::chaininterface::ConfirmationTarget::Background
28182 void ChannelConfig_set_force_close_avoidance_max_fee_satoshis(struct LDKChannelConfig *NONNULL_PTR this_ptr, uint64_t val);
28185 * If set, allows this channel's counterparty to skim an additional fee off this node's inbound
28186 * HTLCs. Useful for liquidity providers to offload on-chain channel costs to end users.
28189 * - The payee will set this option and set its invoice route hints to use [intercept scids]
28190 * generated by this channel's counterparty.
28191 * - The counterparty will get an [`HTLCIntercepted`] event upon payment forward, and call
28192 * [`forward_intercepted_htlc`] with less than the amount provided in
28193 * [`HTLCIntercepted::expected_outbound_amount_msat`]. The difference between the expected and
28194 * actual forward amounts is their fee.
28197 * It's important for payee wallet software to verify that [`PaymentClaimable::amount_msat`] is
28198 * as-expected if this feature is activated, otherwise they may lose money!
28199 * [`PaymentClaimable::counterparty_skimmed_fee_msat`] provides the fee taken by the
28203 * Switching this config flag on may break compatibility with versions of LDK prior to 0.0.116.
28204 * Unsetting this flag between restarts may lead to payment receive failures.
28206 * Default value: false.
28208 * [intercept scids]: crate::ln::channelmanager::ChannelManager::get_intercept_scid
28209 * [`forward_intercepted_htlc`]: crate::ln::channelmanager::ChannelManager::forward_intercepted_htlc
28210 * [`HTLCIntercepted`]: crate::events::Event::HTLCIntercepted
28211 * [`HTLCIntercepted::expected_outbound_amount_msat`]: crate::events::Event::HTLCIntercepted::expected_outbound_amount_msat
28212 * [`PaymentClaimable::amount_msat`]: crate::events::Event::PaymentClaimable::amount_msat
28213 * [`PaymentClaimable::counterparty_skimmed_fee_msat`]: crate::events::Event::PaymentClaimable::counterparty_skimmed_fee_msat
28215 bool ChannelConfig_get_accept_underpaying_htlcs(const struct LDKChannelConfig *NONNULL_PTR this_ptr);
28218 * If set, allows this channel's counterparty to skim an additional fee off this node's inbound
28219 * HTLCs. Useful for liquidity providers to offload on-chain channel costs to end users.
28222 * - The payee will set this option and set its invoice route hints to use [intercept scids]
28223 * generated by this channel's counterparty.
28224 * - The counterparty will get an [`HTLCIntercepted`] event upon payment forward, and call
28225 * [`forward_intercepted_htlc`] with less than the amount provided in
28226 * [`HTLCIntercepted::expected_outbound_amount_msat`]. The difference between the expected and
28227 * actual forward amounts is their fee.
28230 * It's important for payee wallet software to verify that [`PaymentClaimable::amount_msat`] is
28231 * as-expected if this feature is activated, otherwise they may lose money!
28232 * [`PaymentClaimable::counterparty_skimmed_fee_msat`] provides the fee taken by the
28236 * Switching this config flag on may break compatibility with versions of LDK prior to 0.0.116.
28237 * Unsetting this flag between restarts may lead to payment receive failures.
28239 * Default value: false.
28241 * [intercept scids]: crate::ln::channelmanager::ChannelManager::get_intercept_scid
28242 * [`forward_intercepted_htlc`]: crate::ln::channelmanager::ChannelManager::forward_intercepted_htlc
28243 * [`HTLCIntercepted`]: crate::events::Event::HTLCIntercepted
28244 * [`HTLCIntercepted::expected_outbound_amount_msat`]: crate::events::Event::HTLCIntercepted::expected_outbound_amount_msat
28245 * [`PaymentClaimable::amount_msat`]: crate::events::Event::PaymentClaimable::amount_msat
28246 * [`PaymentClaimable::counterparty_skimmed_fee_msat`]: crate::events::Event::PaymentClaimable::counterparty_skimmed_fee_msat
28248 void ChannelConfig_set_accept_underpaying_htlcs(struct LDKChannelConfig *NONNULL_PTR this_ptr, bool val);
28251 * Constructs a new ChannelConfig given each field
28253 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);
28256 * Creates a copy of the ChannelConfig
28258 struct LDKChannelConfig ChannelConfig_clone(const struct LDKChannelConfig *NONNULL_PTR orig);
28261 * Checks if two ChannelConfigs contain equal inner contents.
28262 * This ignores pointers and is_owned flags and looks at the values in fields.
28263 * Two objects with NULL inner values will be considered "equal" here.
28265 bool ChannelConfig_eq(const struct LDKChannelConfig *NONNULL_PTR a, const struct LDKChannelConfig *NONNULL_PTR b);
28268 * Applies the given [`ChannelConfigUpdate`] as a partial update to the [`ChannelConfig`].
28270 void ChannelConfig_apply(struct LDKChannelConfig *NONNULL_PTR this_arg, const struct LDKChannelConfigUpdate *NONNULL_PTR update);
28273 * Creates a "default" ChannelConfig. See struct and individual field documentaiton for details on which values are used.
28275 MUST_USE_RES struct LDKChannelConfig ChannelConfig_default(void);
28278 * Serialize the ChannelConfig object into a byte array which can be read by ChannelConfig_read
28280 struct LDKCVec_u8Z ChannelConfig_write(const struct LDKChannelConfig *NONNULL_PTR obj);
28283 * Read a ChannelConfig from a byte array, created by ChannelConfig_write
28285 struct LDKCResult_ChannelConfigDecodeErrorZ ChannelConfig_read(struct LDKu8slice ser);
28288 * Frees any resources used by the ChannelConfigUpdate, if is_owned is set and inner is non-NULL.
28290 void ChannelConfigUpdate_free(struct LDKChannelConfigUpdate this_obj);
28292 struct LDKCOption_u32Z ChannelConfigUpdate_get_forwarding_fee_proportional_millionths(const struct LDKChannelConfigUpdate *NONNULL_PTR this_ptr);
28294 void ChannelConfigUpdate_set_forwarding_fee_proportional_millionths(struct LDKChannelConfigUpdate *NONNULL_PTR this_ptr, struct LDKCOption_u32Z val);
28296 struct LDKCOption_u32Z ChannelConfigUpdate_get_forwarding_fee_base_msat(const struct LDKChannelConfigUpdate *NONNULL_PTR this_ptr);
28298 void ChannelConfigUpdate_set_forwarding_fee_base_msat(struct LDKChannelConfigUpdate *NONNULL_PTR this_ptr, struct LDKCOption_u32Z val);
28300 struct LDKCOption_u16Z ChannelConfigUpdate_get_cltv_expiry_delta(const struct LDKChannelConfigUpdate *NONNULL_PTR this_ptr);
28302 void ChannelConfigUpdate_set_cltv_expiry_delta(struct LDKChannelConfigUpdate *NONNULL_PTR this_ptr, struct LDKCOption_u16Z val);
28306 * Returns a copy of the field.
28308 struct LDKCOption_MaxDustHTLCExposureZ ChannelConfigUpdate_get_max_dust_htlc_exposure_msat(const struct LDKChannelConfigUpdate *NONNULL_PTR this_ptr);
28310 void ChannelConfigUpdate_set_max_dust_htlc_exposure_msat(struct LDKChannelConfigUpdate *NONNULL_PTR this_ptr, struct LDKCOption_MaxDustHTLCExposureZ val);
28312 struct LDKCOption_u64Z ChannelConfigUpdate_get_force_close_avoidance_max_fee_satoshis(const struct LDKChannelConfigUpdate *NONNULL_PTR this_ptr);
28314 void ChannelConfigUpdate_set_force_close_avoidance_max_fee_satoshis(struct LDKChannelConfigUpdate *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
28317 * Constructs a new ChannelConfigUpdate given each field
28319 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);
28322 * Creates a "default" ChannelConfigUpdate. See struct and individual field documentaiton for details on which values are used.
28324 MUST_USE_RES struct LDKChannelConfigUpdate ChannelConfigUpdate_default(void);
28327 * Frees any resources used by the UserConfig, if is_owned is set and inner is non-NULL.
28329 void UserConfig_free(struct LDKUserConfig this_obj);
28332 * Channel handshake config that we propose to our counterparty.
28334 struct LDKChannelHandshakeConfig UserConfig_get_channel_handshake_config(const struct LDKUserConfig *NONNULL_PTR this_ptr);
28337 * Channel handshake config that we propose to our counterparty.
28339 void UserConfig_set_channel_handshake_config(struct LDKUserConfig *NONNULL_PTR this_ptr, struct LDKChannelHandshakeConfig val);
28342 * Limits applied to our counterparty's proposed channel handshake config settings.
28344 struct LDKChannelHandshakeLimits UserConfig_get_channel_handshake_limits(const struct LDKUserConfig *NONNULL_PTR this_ptr);
28347 * Limits applied to our counterparty's proposed channel handshake config settings.
28349 void UserConfig_set_channel_handshake_limits(struct LDKUserConfig *NONNULL_PTR this_ptr, struct LDKChannelHandshakeLimits val);
28352 * Channel config which affects behavior during channel lifetime.
28354 struct LDKChannelConfig UserConfig_get_channel_config(const struct LDKUserConfig *NONNULL_PTR this_ptr);
28357 * Channel config which affects behavior during channel lifetime.
28359 void UserConfig_set_channel_config(struct LDKUserConfig *NONNULL_PTR this_ptr, struct LDKChannelConfig val);
28362 * If this is set to false, we will reject any HTLCs which were to be forwarded over private
28363 * channels. This prevents us from taking on HTLC-forwarding risk when we intend to run as a
28364 * node which is not online reliably.
28366 * For nodes which are not online reliably, you should set all channels to *not* be announced
28367 * (using [`ChannelHandshakeConfig::announced_channel`] and
28368 * [`ChannelHandshakeLimits::force_announced_channel_preference`]) and set this to false to
28369 * ensure you are not exposed to any forwarding risk.
28371 * Note that because you cannot change a channel's announced state after creation, there is no
28372 * way to disable forwarding on public channels retroactively. Thus, in order to change a node
28373 * from a publicly-announced forwarding node to a private non-forwarding node you must close
28374 * all your channels and open new ones. For privacy, you should also change your node_id
28375 * (swapping all private and public key material for new ones) at that time.
28377 * Default value: false.
28379 bool UserConfig_get_accept_forwards_to_priv_channels(const struct LDKUserConfig *NONNULL_PTR this_ptr);
28382 * If this is set to false, we will reject any HTLCs which were to be forwarded over private
28383 * channels. This prevents us from taking on HTLC-forwarding risk when we intend to run as a
28384 * node which is not online reliably.
28386 * For nodes which are not online reliably, you should set all channels to *not* be announced
28387 * (using [`ChannelHandshakeConfig::announced_channel`] and
28388 * [`ChannelHandshakeLimits::force_announced_channel_preference`]) and set this to false to
28389 * ensure you are not exposed to any forwarding risk.
28391 * Note that because you cannot change a channel's announced state after creation, there is no
28392 * way to disable forwarding on public channels retroactively. Thus, in order to change a node
28393 * from a publicly-announced forwarding node to a private non-forwarding node you must close
28394 * all your channels and open new ones. For privacy, you should also change your node_id
28395 * (swapping all private and public key material for new ones) at that time.
28397 * Default value: false.
28399 void UserConfig_set_accept_forwards_to_priv_channels(struct LDKUserConfig *NONNULL_PTR this_ptr, bool val);
28402 * If this is set to false, we do not accept inbound requests to open a new channel.
28403 * Default value: true.
28405 bool UserConfig_get_accept_inbound_channels(const struct LDKUserConfig *NONNULL_PTR this_ptr);
28408 * If this is set to false, we do not accept inbound requests to open a new channel.
28409 * Default value: true.
28411 void UserConfig_set_accept_inbound_channels(struct LDKUserConfig *NONNULL_PTR this_ptr, bool val);
28414 * If this is set to true, the user needs to manually accept inbound requests to open a new
28417 * When set to true, [`Event::OpenChannelRequest`] will be triggered once a request to open a
28418 * new inbound channel is received through a [`msgs::OpenChannel`] message. In that case, a
28419 * [`msgs::AcceptChannel`] message will not be sent back to the counterparty node unless the
28420 * user explicitly chooses to accept the request.
28422 * Default value: false.
28424 * [`Event::OpenChannelRequest`]: crate::events::Event::OpenChannelRequest
28425 * [`msgs::OpenChannel`]: crate::ln::msgs::OpenChannel
28426 * [`msgs::AcceptChannel`]: crate::ln::msgs::AcceptChannel
28428 bool UserConfig_get_manually_accept_inbound_channels(const struct LDKUserConfig *NONNULL_PTR this_ptr);
28431 * If this is set to true, the user needs to manually accept inbound requests to open a new
28434 * When set to true, [`Event::OpenChannelRequest`] will be triggered once a request to open a
28435 * new inbound channel is received through a [`msgs::OpenChannel`] message. In that case, a
28436 * [`msgs::AcceptChannel`] message will not be sent back to the counterparty node unless the
28437 * user explicitly chooses to accept the request.
28439 * Default value: false.
28441 * [`Event::OpenChannelRequest`]: crate::events::Event::OpenChannelRequest
28442 * [`msgs::OpenChannel`]: crate::ln::msgs::OpenChannel
28443 * [`msgs::AcceptChannel`]: crate::ln::msgs::AcceptChannel
28445 void UserConfig_set_manually_accept_inbound_channels(struct LDKUserConfig *NONNULL_PTR this_ptr, bool val);
28448 * If this is set to true, LDK will intercept HTLCs that are attempting to be forwarded over
28449 * fake short channel ids generated via [`ChannelManager::get_intercept_scid`]. Upon HTLC
28450 * intercept, LDK will generate an [`Event::HTLCIntercepted`] which MUST be handled by the user.
28452 * Setting this to true may break backwards compatibility with LDK versions < 0.0.113.
28454 * Default value: false.
28456 * [`ChannelManager::get_intercept_scid`]: crate::ln::channelmanager::ChannelManager::get_intercept_scid
28457 * [`Event::HTLCIntercepted`]: crate::events::Event::HTLCIntercepted
28459 bool UserConfig_get_accept_intercept_htlcs(const struct LDKUserConfig *NONNULL_PTR this_ptr);
28462 * If this is set to true, LDK will intercept HTLCs that are attempting to be forwarded over
28463 * fake short channel ids generated via [`ChannelManager::get_intercept_scid`]. Upon HTLC
28464 * intercept, LDK will generate an [`Event::HTLCIntercepted`] which MUST be handled by the user.
28466 * Setting this to true may break backwards compatibility with LDK versions < 0.0.113.
28468 * Default value: false.
28470 * [`ChannelManager::get_intercept_scid`]: crate::ln::channelmanager::ChannelManager::get_intercept_scid
28471 * [`Event::HTLCIntercepted`]: crate::events::Event::HTLCIntercepted
28473 void UserConfig_set_accept_intercept_htlcs(struct LDKUserConfig *NONNULL_PTR this_ptr, bool val);
28476 * If this is set to false, when receiving a keysend payment we'll fail it if it has multiple
28477 * parts. If this is set to true, we'll accept the payment.
28479 * Setting this to true will break backwards compatibility upon downgrading to an LDK
28480 * version < 0.0.116 while receiving an MPP keysend. If we have already received an MPP
28481 * keysend, downgrading will cause us to fail to deserialize [`ChannelManager`].
28483 * Default value: false.
28485 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
28487 bool UserConfig_get_accept_mpp_keysend(const struct LDKUserConfig *NONNULL_PTR this_ptr);
28490 * If this is set to false, when receiving a keysend payment we'll fail it if it has multiple
28491 * parts. If this is set to true, we'll accept the payment.
28493 * Setting this to true will break backwards compatibility upon downgrading to an LDK
28494 * version < 0.0.116 while receiving an MPP keysend. If we have already received an MPP
28495 * keysend, downgrading will cause us to fail to deserialize [`ChannelManager`].
28497 * Default value: false.
28499 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
28501 void UserConfig_set_accept_mpp_keysend(struct LDKUserConfig *NONNULL_PTR this_ptr, bool val);
28504 * Constructs a new UserConfig given each field
28506 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);
28509 * Creates a copy of the UserConfig
28511 struct LDKUserConfig UserConfig_clone(const struct LDKUserConfig *NONNULL_PTR orig);
28514 * Creates a "default" UserConfig. See struct and individual field documentaiton for details on which values are used.
28516 MUST_USE_RES struct LDKUserConfig UserConfig_default(void);
28519 * Frees any resources used by the BestBlock, if is_owned is set and inner is non-NULL.
28521 void BestBlock_free(struct LDKBestBlock this_obj);
28524 * Creates a copy of the BestBlock
28526 struct LDKBestBlock BestBlock_clone(const struct LDKBestBlock *NONNULL_PTR orig);
28529 * Checks if two BestBlocks contain equal inner contents.
28530 * This ignores pointers and is_owned flags and looks at the values in fields.
28531 * Two objects with NULL inner values will be considered "equal" here.
28533 bool BestBlock_eq(const struct LDKBestBlock *NONNULL_PTR a, const struct LDKBestBlock *NONNULL_PTR b);
28536 * Constructs a `BestBlock` that represents the genesis block at height 0 of the given
28539 MUST_USE_RES struct LDKBestBlock BestBlock_from_network(enum LDKNetwork network);
28542 * Returns a `BestBlock` as identified by the given block hash and height.
28544 MUST_USE_RES struct LDKBestBlock BestBlock_new(struct LDKThirtyTwoBytes block_hash, uint32_t height);
28547 * Returns the best block hash.
28549 MUST_USE_RES struct LDKThirtyTwoBytes BestBlock_block_hash(const struct LDKBestBlock *NONNULL_PTR this_arg);
28552 * Returns the best block height.
28554 MUST_USE_RES uint32_t BestBlock_height(const struct LDKBestBlock *NONNULL_PTR this_arg);
28557 * Calls the free function if one is set
28559 void Listen_free(struct LDKListen this_ptr);
28562 * Calls the free function if one is set
28564 void Confirm_free(struct LDKConfirm this_ptr);
28567 * Creates a copy of the ChannelMonitorUpdateStatus
28569 enum LDKChannelMonitorUpdateStatus ChannelMonitorUpdateStatus_clone(const enum LDKChannelMonitorUpdateStatus *NONNULL_PTR orig);
28572 * Utility method to constructs a new Completed-variant ChannelMonitorUpdateStatus
28574 enum LDKChannelMonitorUpdateStatus ChannelMonitorUpdateStatus_completed(void);
28577 * Utility method to constructs a new InProgress-variant ChannelMonitorUpdateStatus
28579 enum LDKChannelMonitorUpdateStatus ChannelMonitorUpdateStatus_in_progress(void);
28582 * Utility method to constructs a new UnrecoverableError-variant ChannelMonitorUpdateStatus
28584 enum LDKChannelMonitorUpdateStatus ChannelMonitorUpdateStatus_unrecoverable_error(void);
28587 * Checks if two ChannelMonitorUpdateStatuss contain equal inner contents.
28588 * This ignores pointers and is_owned flags and looks at the values in fields.
28590 bool ChannelMonitorUpdateStatus_eq(const enum LDKChannelMonitorUpdateStatus *NONNULL_PTR a, const enum LDKChannelMonitorUpdateStatus *NONNULL_PTR b);
28593 * Calls the free function if one is set
28595 void Watch_free(struct LDKWatch this_ptr);
28598 * Calls the free function if one is set
28600 void Filter_free(struct LDKFilter this_ptr);
28603 * Frees any resources used by the WatchedOutput, if is_owned is set and inner is non-NULL.
28605 void WatchedOutput_free(struct LDKWatchedOutput this_obj);
28608 * First block where the transaction output may have been spent.
28610 struct LDKCOption_ThirtyTwoBytesZ WatchedOutput_get_block_hash(const struct LDKWatchedOutput *NONNULL_PTR this_ptr);
28613 * First block where the transaction output may have been spent.
28615 void WatchedOutput_set_block_hash(struct LDKWatchedOutput *NONNULL_PTR this_ptr, struct LDKCOption_ThirtyTwoBytesZ val);
28618 * Outpoint identifying the transaction output.
28620 struct LDKOutPoint WatchedOutput_get_outpoint(const struct LDKWatchedOutput *NONNULL_PTR this_ptr);
28623 * Outpoint identifying the transaction output.
28625 void WatchedOutput_set_outpoint(struct LDKWatchedOutput *NONNULL_PTR this_ptr, struct LDKOutPoint val);
28628 * Spending condition of the transaction output.
28630 struct LDKu8slice WatchedOutput_get_script_pubkey(const struct LDKWatchedOutput *NONNULL_PTR this_ptr);
28633 * Spending condition of the transaction output.
28635 void WatchedOutput_set_script_pubkey(struct LDKWatchedOutput *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val);
28638 * Constructs a new WatchedOutput given each field
28640 MUST_USE_RES struct LDKWatchedOutput WatchedOutput_new(struct LDKCOption_ThirtyTwoBytesZ block_hash_arg, struct LDKOutPoint outpoint_arg, struct LDKCVec_u8Z script_pubkey_arg);
28643 * Creates a copy of the WatchedOutput
28645 struct LDKWatchedOutput WatchedOutput_clone(const struct LDKWatchedOutput *NONNULL_PTR orig);
28648 * Checks if two WatchedOutputs contain equal inner contents.
28649 * This ignores pointers and is_owned flags and looks at the values in fields.
28650 * Two objects with NULL inner values will be considered "equal" here.
28652 bool WatchedOutput_eq(const struct LDKWatchedOutput *NONNULL_PTR a, const struct LDKWatchedOutput *NONNULL_PTR b);
28655 * Generates a non-cryptographic 64-bit hash of the WatchedOutput.
28657 uint64_t WatchedOutput_hash(const struct LDKWatchedOutput *NONNULL_PTR o);
28660 * Calls the free function if one is set
28662 void BroadcasterInterface_free(struct LDKBroadcasterInterface this_ptr);
28665 * Creates a copy of the ConfirmationTarget
28667 enum LDKConfirmationTarget ConfirmationTarget_clone(const enum LDKConfirmationTarget *NONNULL_PTR orig);
28670 * Utility method to constructs a new MempoolMinimum-variant ConfirmationTarget
28672 enum LDKConfirmationTarget ConfirmationTarget_mempool_minimum(void);
28675 * Utility method to constructs a new Background-variant ConfirmationTarget
28677 enum LDKConfirmationTarget ConfirmationTarget_background(void);
28680 * Utility method to constructs a new Normal-variant ConfirmationTarget
28682 enum LDKConfirmationTarget ConfirmationTarget_normal(void);
28685 * Utility method to constructs a new HighPriority-variant ConfirmationTarget
28687 enum LDKConfirmationTarget ConfirmationTarget_high_priority(void);
28690 * Generates a non-cryptographic 64-bit hash of the ConfirmationTarget.
28692 uint64_t ConfirmationTarget_hash(const enum LDKConfirmationTarget *NONNULL_PTR o);
28695 * Checks if two ConfirmationTargets contain equal inner contents.
28696 * This ignores pointers and is_owned flags and looks at the values in fields.
28698 bool ConfirmationTarget_eq(const enum LDKConfirmationTarget *NONNULL_PTR a, const enum LDKConfirmationTarget *NONNULL_PTR b);
28701 * Calls the free function if one is set
28703 void FeeEstimator_free(struct LDKFeeEstimator this_ptr);
28706 * Frees any resources used by the MonitorUpdateId, if is_owned is set and inner is non-NULL.
28708 void MonitorUpdateId_free(struct LDKMonitorUpdateId this_obj);
28711 * Creates a copy of the MonitorUpdateId
28713 struct LDKMonitorUpdateId MonitorUpdateId_clone(const struct LDKMonitorUpdateId *NONNULL_PTR orig);
28716 * Generates a non-cryptographic 64-bit hash of the MonitorUpdateId.
28718 uint64_t MonitorUpdateId_hash(const struct LDKMonitorUpdateId *NONNULL_PTR o);
28721 * Checks if two MonitorUpdateIds contain equal inner contents.
28722 * This ignores pointers and is_owned flags and looks at the values in fields.
28723 * Two objects with NULL inner values will be considered "equal" here.
28725 bool MonitorUpdateId_eq(const struct LDKMonitorUpdateId *NONNULL_PTR a, const struct LDKMonitorUpdateId *NONNULL_PTR b);
28728 * Calls the free function if one is set
28730 void Persist_free(struct LDKPersist this_ptr);
28733 * Frees any resources used by the LockedChannelMonitor, if is_owned is set and inner is non-NULL.
28735 void LockedChannelMonitor_free(struct LDKLockedChannelMonitor this_obj);
28738 * Frees any resources used by the ChainMonitor, if is_owned is set and inner is non-NULL.
28740 void ChainMonitor_free(struct LDKChainMonitor this_obj);
28743 * Creates a new `ChainMonitor` used to watch on-chain activity pertaining to channels.
28745 * When an optional chain source implementing [`chain::Filter`] is provided, the chain monitor
28746 * will call back to it indicating transactions and outputs of interest. This allows clients to
28747 * pre-filter blocks or only fetch blocks matching a compact filter. Otherwise, clients may
28748 * always need to fetch full blocks absent another means for determining which blocks contain
28749 * transactions relevant to the watched channels.
28751 MUST_USE_RES struct LDKChainMonitor ChainMonitor_new(struct LDKCOption_FilterZ chain_source, struct LDKBroadcasterInterface broadcaster, struct LDKLogger logger, struct LDKFeeEstimator feeest, struct LDKPersist persister);
28754 * Gets the balances in the contained [`ChannelMonitor`]s which are claimable on-chain or
28755 * claims which are awaiting confirmation.
28757 * Includes the balances from each [`ChannelMonitor`] *except* those included in
28758 * `ignored_channels`, allowing you to filter out balances from channels which are still open
28759 * (and whose balance should likely be pulled from the [`ChannelDetails`]).
28761 * See [`ChannelMonitor::get_claimable_balances`] for more details on the exact criteria for
28762 * inclusion in the return value.
28764 MUST_USE_RES struct LDKCVec_BalanceZ ChainMonitor_get_claimable_balances(const struct LDKChainMonitor *NONNULL_PTR this_arg, struct LDKCVec_ChannelDetailsZ ignored_channels);
28767 * Gets the [`LockedChannelMonitor`] for a given funding outpoint, returning an `Err` if no
28768 * such [`ChannelMonitor`] is currently being monitored for.
28770 * Note that the result holds a mutex over our monitor set, and should not be held
28773 MUST_USE_RES struct LDKCResult_LockedChannelMonitorNoneZ ChainMonitor_get_monitor(const struct LDKChainMonitor *NONNULL_PTR this_arg, struct LDKOutPoint funding_txo);
28776 * Lists the funding outpoint of each [`ChannelMonitor`] being monitored.
28778 * Note that [`ChannelMonitor`]s are not removed when a channel is closed as they are always
28779 * monitoring for on-chain state resolutions.
28781 MUST_USE_RES struct LDKCVec_OutPointZ ChainMonitor_list_monitors(const struct LDKChainMonitor *NONNULL_PTR this_arg);
28784 * Lists the pending updates for each [`ChannelMonitor`] (by `OutPoint` being monitored).
28786 MUST_USE_RES struct LDKCVec_C2Tuple_OutPointCVec_MonitorUpdateIdZZZ ChainMonitor_list_pending_monitor_updates(const struct LDKChainMonitor *NONNULL_PTR this_arg);
28789 * Indicates the persistence of a [`ChannelMonitor`] has completed after
28790 * [`ChannelMonitorUpdateStatus::InProgress`] was returned from an update operation.
28792 * Thus, the anticipated use is, at a high level:
28793 * 1) This [`ChainMonitor`] calls [`Persist::update_persisted_channel`] which stores the
28794 * update to disk and begins updating any remote (e.g. watchtower/backup) copies,
28795 * returning [`ChannelMonitorUpdateStatus::InProgress`],
28796 * 2) once all remote copies are updated, you call this function with the
28797 * `completed_update_id` that completed, and once all pending updates have completed the
28798 * channel will be re-enabled.
28800 * Returns an [`APIError::APIMisuseError`] if `funding_txo` does not match any currently
28801 * registered [`ChannelMonitor`]s.
28803 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);
28806 * Gets a [`Future`] that completes when an event is available either via
28807 * [`chain::Watch::release_pending_monitor_events`] or
28808 * [`EventsProvider::process_pending_events`].
28810 * Note that callbacks registered on the [`Future`] MUST NOT call back into this
28811 * [`ChainMonitor`] and should instead register actions to be taken later.
28813 * [`EventsProvider::process_pending_events`]: crate::events::EventsProvider::process_pending_events
28815 MUST_USE_RES struct LDKFuture ChainMonitor_get_update_future(const struct LDKChainMonitor *NONNULL_PTR this_arg);
28818 * Triggers rebroadcasts/fee-bumps of pending claims from a force-closed channel. This is
28819 * crucial in preventing certain classes of pinning attacks, detecting substantial mempool
28820 * feerate changes between blocks, and ensuring reliability if broadcasting fails. We recommend
28821 * invoking this every 30 seconds, or lower if running in an environment with spotty
28822 * connections, like on mobile.
28824 void ChainMonitor_rebroadcast_pending_claims(const struct LDKChainMonitor *NONNULL_PTR this_arg);
28827 * Constructs a new Listen which calls the relevant methods on this_arg.
28828 * This copies the `inner` pointer in this_arg and thus the returned Listen must be freed before this_arg is
28830 struct LDKListen ChainMonitor_as_Listen(const struct LDKChainMonitor *NONNULL_PTR this_arg);
28833 * Constructs a new Confirm which calls the relevant methods on this_arg.
28834 * This copies the `inner` pointer in this_arg and thus the returned Confirm must be freed before this_arg is
28836 struct LDKConfirm ChainMonitor_as_Confirm(const struct LDKChainMonitor *NONNULL_PTR this_arg);
28839 * Constructs a new Watch which calls the relevant methods on this_arg.
28840 * This copies the `inner` pointer in this_arg and thus the returned Watch must be freed before this_arg is
28842 struct LDKWatch ChainMonitor_as_Watch(const struct LDKChainMonitor *NONNULL_PTR this_arg);
28845 * Constructs a new EventsProvider which calls the relevant methods on this_arg.
28846 * This copies the `inner` pointer in this_arg and thus the returned EventsProvider must be freed before this_arg is
28848 struct LDKEventsProvider ChainMonitor_as_EventsProvider(const struct LDKChainMonitor *NONNULL_PTR this_arg);
28851 * Frees any resources used by the ChannelMonitorUpdate, if is_owned is set and inner is non-NULL.
28853 void ChannelMonitorUpdate_free(struct LDKChannelMonitorUpdate this_obj);
28856 * The sequence number of this update. Updates *must* be replayed in-order according to this
28857 * sequence number (and updates may panic if they are not). The update_id values are strictly
28858 * increasing and increase by one for each new update, with two exceptions specified below.
28860 * This sequence number is also used to track up to which points updates which returned
28861 * [`ChannelMonitorUpdateStatus::InProgress`] have been applied to all copies of a given
28862 * ChannelMonitor when ChannelManager::channel_monitor_updated is called.
28864 * The only instances we allow where update_id values are not strictly increasing have a
28865 * special update ID of [`CLOSED_CHANNEL_UPDATE_ID`]. This update ID is used for updates that
28866 * will force close the channel by broadcasting the latest commitment transaction or
28867 * special post-force-close updates, like providing preimages necessary to claim outputs on the
28868 * broadcast commitment transaction. See its docs for more details.
28870 * [`ChannelMonitorUpdateStatus::InProgress`]: super::ChannelMonitorUpdateStatus::InProgress
28872 uint64_t ChannelMonitorUpdate_get_update_id(const struct LDKChannelMonitorUpdate *NONNULL_PTR this_ptr);
28875 * The sequence number of this update. Updates *must* be replayed in-order according to this
28876 * sequence number (and updates may panic if they are not). The update_id values are strictly
28877 * increasing and increase by one for each new update, with two exceptions specified below.
28879 * This sequence number is also used to track up to which points updates which returned
28880 * [`ChannelMonitorUpdateStatus::InProgress`] have been applied to all copies of a given
28881 * ChannelMonitor when ChannelManager::channel_monitor_updated is called.
28883 * The only instances we allow where update_id values are not strictly increasing have a
28884 * special update ID of [`CLOSED_CHANNEL_UPDATE_ID`]. This update ID is used for updates that
28885 * will force close the channel by broadcasting the latest commitment transaction or
28886 * special post-force-close updates, like providing preimages necessary to claim outputs on the
28887 * broadcast commitment transaction. See its docs for more details.
28889 * [`ChannelMonitorUpdateStatus::InProgress`]: super::ChannelMonitorUpdateStatus::InProgress
28891 void ChannelMonitorUpdate_set_update_id(struct LDKChannelMonitorUpdate *NONNULL_PTR this_ptr, uint64_t val);
28894 * Creates a copy of the ChannelMonitorUpdate
28896 struct LDKChannelMonitorUpdate ChannelMonitorUpdate_clone(const struct LDKChannelMonitorUpdate *NONNULL_PTR orig);
28899 * Checks if two ChannelMonitorUpdates contain equal inner contents.
28900 * This ignores pointers and is_owned flags and looks at the values in fields.
28901 * Two objects with NULL inner values will be considered "equal" here.
28903 bool ChannelMonitorUpdate_eq(const struct LDKChannelMonitorUpdate *NONNULL_PTR a, const struct LDKChannelMonitorUpdate *NONNULL_PTR b);
28906 * Serialize the ChannelMonitorUpdate object into a byte array which can be read by ChannelMonitorUpdate_read
28908 struct LDKCVec_u8Z ChannelMonitorUpdate_write(const struct LDKChannelMonitorUpdate *NONNULL_PTR obj);
28911 * Read a ChannelMonitorUpdate from a byte array, created by ChannelMonitorUpdate_write
28913 struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ ChannelMonitorUpdate_read(struct LDKu8slice ser);
28916 * Frees any resources used by the MonitorEvent
28918 void MonitorEvent_free(struct LDKMonitorEvent this_ptr);
28921 * Creates a copy of the MonitorEvent
28923 struct LDKMonitorEvent MonitorEvent_clone(const struct LDKMonitorEvent *NONNULL_PTR orig);
28926 * Utility method to constructs a new HTLCEvent-variant MonitorEvent
28928 struct LDKMonitorEvent MonitorEvent_htlcevent(struct LDKHTLCUpdate a);
28931 * Utility method to constructs a new HolderForceClosed-variant MonitorEvent
28933 struct LDKMonitorEvent MonitorEvent_holder_force_closed(struct LDKOutPoint a);
28936 * Utility method to constructs a new Completed-variant MonitorEvent
28938 struct LDKMonitorEvent MonitorEvent_completed(struct LDKOutPoint funding_txo, uint64_t monitor_update_id);
28941 * Checks if two MonitorEvents contain equal inner contents.
28942 * This ignores pointers and is_owned flags and looks at the values in fields.
28944 bool MonitorEvent_eq(const struct LDKMonitorEvent *NONNULL_PTR a, const struct LDKMonitorEvent *NONNULL_PTR b);
28947 * Serialize the MonitorEvent object into a byte array which can be read by MonitorEvent_read
28949 struct LDKCVec_u8Z MonitorEvent_write(const struct LDKMonitorEvent *NONNULL_PTR obj);
28952 * Read a MonitorEvent from a byte array, created by MonitorEvent_write
28954 struct LDKCResult_COption_MonitorEventZDecodeErrorZ MonitorEvent_read(struct LDKu8slice ser);
28957 * Frees any resources used by the HTLCUpdate, if is_owned is set and inner is non-NULL.
28959 void HTLCUpdate_free(struct LDKHTLCUpdate this_obj);
28962 * Creates a copy of the HTLCUpdate
28964 struct LDKHTLCUpdate HTLCUpdate_clone(const struct LDKHTLCUpdate *NONNULL_PTR orig);
28967 * Checks if two HTLCUpdates contain equal inner contents.
28968 * This ignores pointers and is_owned flags and looks at the values in fields.
28969 * Two objects with NULL inner values will be considered "equal" here.
28971 bool HTLCUpdate_eq(const struct LDKHTLCUpdate *NONNULL_PTR a, const struct LDKHTLCUpdate *NONNULL_PTR b);
28974 * Serialize the HTLCUpdate object into a byte array which can be read by HTLCUpdate_read
28976 struct LDKCVec_u8Z HTLCUpdate_write(const struct LDKHTLCUpdate *NONNULL_PTR obj);
28979 * Read a HTLCUpdate from a byte array, created by HTLCUpdate_write
28981 struct LDKCResult_HTLCUpdateDecodeErrorZ HTLCUpdate_read(struct LDKu8slice ser);
28984 * Frees any resources used by the Balance
28986 void Balance_free(struct LDKBalance this_ptr);
28989 * Creates a copy of the Balance
28991 struct LDKBalance Balance_clone(const struct LDKBalance *NONNULL_PTR orig);
28994 * Utility method to constructs a new ClaimableOnChannelClose-variant Balance
28996 struct LDKBalance Balance_claimable_on_channel_close(uint64_t amount_satoshis);
28999 * Utility method to constructs a new ClaimableAwaitingConfirmations-variant Balance
29001 struct LDKBalance Balance_claimable_awaiting_confirmations(uint64_t amount_satoshis, uint32_t confirmation_height);
29004 * Utility method to constructs a new ContentiousClaimable-variant Balance
29006 struct LDKBalance Balance_contentious_claimable(uint64_t amount_satoshis, uint32_t timeout_height, struct LDKThirtyTwoBytes payment_hash, struct LDKThirtyTwoBytes payment_preimage);
29009 * Utility method to constructs a new MaybeTimeoutClaimableHTLC-variant Balance
29011 struct LDKBalance Balance_maybe_timeout_claimable_htlc(uint64_t amount_satoshis, uint32_t claimable_height, struct LDKThirtyTwoBytes payment_hash);
29014 * Utility method to constructs a new MaybePreimageClaimableHTLC-variant Balance
29016 struct LDKBalance Balance_maybe_preimage_claimable_htlc(uint64_t amount_satoshis, uint32_t expiry_height, struct LDKThirtyTwoBytes payment_hash);
29019 * Utility method to constructs a new CounterpartyRevokedOutputClaimable-variant Balance
29021 struct LDKBalance Balance_counterparty_revoked_output_claimable(uint64_t amount_satoshis);
29024 * Checks if two Balances contain equal inner contents.
29025 * This ignores pointers and is_owned flags and looks at the values in fields.
29027 bool Balance_eq(const struct LDKBalance *NONNULL_PTR a, const struct LDKBalance *NONNULL_PTR b);
29030 * The amount claimable, in satoshis. This excludes balances that we are unsure if we are able
29031 * to claim, this is because we are waiting for a preimage or for a timeout to expire. For more
29032 * information on these balances see [`Balance::MaybeTimeoutClaimableHTLC`] and
29033 * [`Balance::MaybePreimageClaimableHTLC`].
29035 * On-chain fees required to claim the balance are not included in this amount.
29037 MUST_USE_RES uint64_t Balance_claimable_amount_satoshis(const struct LDKBalance *NONNULL_PTR this_arg);
29040 * Frees any resources used by the ChannelMonitor, if is_owned is set and inner is non-NULL.
29042 void ChannelMonitor_free(struct LDKChannelMonitor this_obj);
29045 * Creates a copy of the ChannelMonitor
29047 struct LDKChannelMonitor ChannelMonitor_clone(const struct LDKChannelMonitor *NONNULL_PTR orig);
29050 * Serialize the ChannelMonitor object into a byte array which can be read by ChannelMonitor_read
29052 struct LDKCVec_u8Z ChannelMonitor_write(const struct LDKChannelMonitor *NONNULL_PTR obj);
29055 * Updates a ChannelMonitor on the basis of some new information provided by the Channel
29058 * panics if the given update is not the next update by update_id.
29060 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);
29063 * Gets the update_id from the latest ChannelMonitorUpdate which was applied to this
29066 MUST_USE_RES uint64_t ChannelMonitor_get_latest_update_id(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
29069 * Gets the funding transaction outpoint of the channel this ChannelMonitor is monitoring for.
29071 MUST_USE_RES struct LDKC2Tuple_OutPointCVec_u8ZZ ChannelMonitor_get_funding_txo(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
29074 * Gets a list of txids, with their output scripts (in the order they appear in the
29075 * transaction), which we must learn about spends of via block_connected().
29077 MUST_USE_RES struct LDKCVec_C2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZZ ChannelMonitor_get_outputs_to_watch(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
29080 * Loads the funding txo and outputs to watch into the given `chain::Filter` by repeatedly
29081 * calling `chain::Filter::register_output` and `chain::Filter::register_tx` until all outputs
29082 * have been registered.
29084 void ChannelMonitor_load_outputs_to_watch(const struct LDKChannelMonitor *NONNULL_PTR this_arg, const struct LDKFilter *NONNULL_PTR filter);
29087 * Get the list of HTLCs who's status has been updated on chain. This should be called by
29088 * ChannelManager via [`chain::Watch::release_pending_monitor_events`].
29090 MUST_USE_RES struct LDKCVec_MonitorEventZ ChannelMonitor_get_and_clear_pending_monitor_events(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
29093 * Processes [`SpendableOutputs`] events produced from each [`ChannelMonitor`] upon maturity.
29095 * For channels featuring anchor outputs, this method will also process [`BumpTransaction`]
29096 * events produced from each [`ChannelMonitor`] while there is a balance to claim onchain
29097 * within each channel. As the confirmation of a commitment transaction may be critical to the
29098 * safety of funds, we recommend invoking this every 30 seconds, or lower if running in an
29099 * environment with spotty connections, like on mobile.
29101 * An [`EventHandler`] may safely call back to the provider, though this shouldn't be needed in
29102 * order to handle these events.
29104 * [`SpendableOutputs`]: crate::events::Event::SpendableOutputs
29105 * [`BumpTransaction`]: crate::events::Event::BumpTransaction
29107 void ChannelMonitor_process_pending_events(const struct LDKChannelMonitor *NONNULL_PTR this_arg, const struct LDKEventHandler *NONNULL_PTR handler);
29110 * Gets the counterparty's initial commitment transaction. The returned commitment
29111 * transaction is unsigned. This is intended to be called during the initial persistence of
29112 * the monitor (inside an implementation of [`Persist::persist_new_channel`]), to allow for
29113 * watchtowers in the persistence pipeline to have enough data to form justice transactions.
29115 * This is similar to [`Self::counterparty_commitment_txs_from_update`], except
29116 * that for the initial commitment transaction, we don't have a corresponding update.
29118 * This will only return `Some` for channel monitors that have been created after upgrading
29121 * [`Persist::persist_new_channel`]: crate::chain::chainmonitor::Persist::persist_new_channel
29123 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
29125 MUST_USE_RES struct LDKCommitmentTransaction ChannelMonitor_initial_counterparty_commitment_tx(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
29128 * Gets all of the counterparty commitment transactions provided by the given update. This
29129 * may be empty if the update doesn't include any new counterparty commitments. Returned
29130 * commitment transactions are unsigned.
29132 * This is provided so that watchtower clients in the persistence pipeline are able to build
29133 * justice transactions for each counterparty commitment upon each update. It's intended to be
29134 * used within an implementation of [`Persist::update_persisted_channel`], which is provided
29135 * with a monitor and an update. Once revoked, signing a justice transaction can be done using
29136 * [`Self::sign_to_local_justice_tx`].
29138 * It is expected that a watchtower client may use this method to retrieve the latest counterparty
29139 * commitment transaction(s), and then hold the necessary data until a later update in which
29140 * the monitor has been updated with the corresponding revocation data, at which point the
29141 * monitor can sign the justice transaction.
29143 * This will only return a non-empty list for monitor updates that have been created after
29144 * upgrading to LDK 0.0.117+. Note that no restriction lies on the monitors themselves, which
29145 * may have been created prior to upgrading.
29147 * [`Persist::update_persisted_channel`]: crate::chain::chainmonitor::Persist::update_persisted_channel
29149 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);
29152 * Wrapper around [`EcdsaChannelSigner::sign_justice_revoked_output`] to make
29153 * signing the justice transaction easier for implementors of
29154 * [`chain::chainmonitor::Persist`]. On success this method returns the provided transaction
29155 * signing the input at `input_idx`. This method will only produce a valid signature for
29156 * a transaction spending the `to_local` output of a commitment transaction, i.e. this cannot
29157 * be used for revoked HTLC outputs.
29159 * `Value` is the value of the output being spent by the input at `input_idx`, committed
29160 * in the BIP 143 signature.
29162 * This method will only succeed if this monitor has received the revocation secret for the
29163 * provided `commitment_number`. If a commitment number is provided that does not correspond
29164 * to the commitment transaction being revoked, this will return a signed transaction, but
29165 * the signature will not be valid.
29167 * [`EcdsaChannelSigner::sign_justice_revoked_output`]: crate::sign::EcdsaChannelSigner::sign_justice_revoked_output
29168 * [`Persist`]: crate::chain::chainmonitor::Persist
29170 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);
29173 * Gets the `node_id` of the counterparty for this channel.
29175 * Will be `None` for channels constructed on LDK versions prior to 0.0.110 and always `Some`
29178 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
29180 MUST_USE_RES struct LDKPublicKey ChannelMonitor_get_counterparty_node_id(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
29183 * Used by [`ChannelManager`] deserialization to broadcast the latest holder state if its copy
29184 * of the channel state was out-of-date.
29186 * You may also use this to broadcast the latest local commitment transaction, either because
29187 * a monitor update failed or because we've fallen behind (i.e. we've received proof that our
29188 * counterparty side knows a revocation secret we gave them that they shouldn't know).
29190 * Broadcasting these transactions in the second case is UNSAFE, as they allow counterparty
29191 * side to punish you. Nevertheless you may want to broadcast them if counterparty doesn't
29192 * close channel with their commitment transaction after a substantial amount of time. Best
29193 * may be to contact the other node operator out-of-band to coordinate other options available
29196 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
29198 MUST_USE_RES struct LDKCVec_TransactionZ ChannelMonitor_get_latest_holder_commitment_txn(const struct LDKChannelMonitor *NONNULL_PTR this_arg, const struct LDKLogger *NONNULL_PTR logger);
29201 * Processes transactions in a newly connected block, which may result in any of the following:
29202 * - update the monitor's state against resolved HTLCs
29203 * - punish the counterparty in the case of seeing a revoked commitment transaction
29204 * - force close the channel and claim/timeout incoming/outgoing HTLCs if near expiration
29205 * - detect settled outputs for later spending
29206 * - schedule and bump any in-flight claims
29208 * Returns any new outputs to watch from `txdata`; after called, these are also included in
29209 * [`get_outputs_to_watch`].
29211 * [`get_outputs_to_watch`]: #method.get_outputs_to_watch
29213 MUST_USE_RES struct LDKCVec_TransactionOutputsZ ChannelMonitor_block_connected(const struct LDKChannelMonitor *NONNULL_PTR this_arg, const uint8_t (*header)[80], struct LDKCVec_C2Tuple_usizeTransactionZZ txdata, uint32_t height, struct LDKBroadcasterInterface broadcaster, struct LDKFeeEstimator fee_estimator, struct LDKLogger logger);
29216 * Determines if the disconnected block contained any transactions of interest and updates
29219 void ChannelMonitor_block_disconnected(const struct LDKChannelMonitor *NONNULL_PTR this_arg, const uint8_t (*header)[80], uint32_t height, struct LDKBroadcasterInterface broadcaster, struct LDKFeeEstimator fee_estimator, struct LDKLogger logger);
29222 * Processes transactions confirmed in a block with the given header and height, returning new
29223 * outputs to watch. See [`block_connected`] for details.
29225 * Used instead of [`block_connected`] by clients that are notified of transactions rather than
29226 * blocks. See [`chain::Confirm`] for calling expectations.
29228 * [`block_connected`]: Self::block_connected
29230 MUST_USE_RES struct LDKCVec_TransactionOutputsZ ChannelMonitor_transactions_confirmed(const struct LDKChannelMonitor *NONNULL_PTR this_arg, const uint8_t (*header)[80], struct LDKCVec_C2Tuple_usizeTransactionZZ txdata, uint32_t height, struct LDKBroadcasterInterface broadcaster, struct LDKFeeEstimator fee_estimator, struct LDKLogger logger);
29233 * Processes a transaction that was reorganized out of the chain.
29235 * Used instead of [`block_disconnected`] by clients that are notified of transactions rather
29236 * than blocks. See [`chain::Confirm`] for calling expectations.
29238 * [`block_disconnected`]: Self::block_disconnected
29240 void ChannelMonitor_transaction_unconfirmed(const struct LDKChannelMonitor *NONNULL_PTR this_arg, const uint8_t (*txid)[32], struct LDKBroadcasterInterface broadcaster, struct LDKFeeEstimator fee_estimator, struct LDKLogger logger);
29243 * Updates the monitor with the current best chain tip, returning new outputs to watch. See
29244 * [`block_connected`] for details.
29246 * Used instead of [`block_connected`] by clients that are notified of transactions rather than
29247 * blocks. See [`chain::Confirm`] for calling expectations.
29249 * [`block_connected`]: Self::block_connected
29251 MUST_USE_RES struct LDKCVec_TransactionOutputsZ ChannelMonitor_best_block_updated(const struct LDKChannelMonitor *NONNULL_PTR this_arg, const uint8_t (*header)[80], uint32_t height, struct LDKBroadcasterInterface broadcaster, struct LDKFeeEstimator fee_estimator, struct LDKLogger logger);
29254 * Returns the set of txids that should be monitored for re-organization out of the chain.
29256 MUST_USE_RES struct LDKCVec_C2Tuple_ThirtyTwoBytesCOption_ThirtyTwoBytesZZZ ChannelMonitor_get_relevant_txids(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
29259 * Gets the latest best block which was connected either via the [`chain::Listen`] or
29260 * [`chain::Confirm`] interfaces.
29262 MUST_USE_RES struct LDKBestBlock ChannelMonitor_current_best_block(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
29265 * Triggers rebroadcasts/fee-bumps of pending claims from a force-closed channel. This is
29266 * crucial in preventing certain classes of pinning attacks, detecting substantial mempool
29267 * feerate changes between blocks, and ensuring reliability if broadcasting fails. We recommend
29268 * invoking this every 30 seconds, or lower if running in an environment with spotty
29269 * connections, like on mobile.
29271 void ChannelMonitor_rebroadcast_pending_claims(const struct LDKChannelMonitor *NONNULL_PTR this_arg, struct LDKBroadcasterInterface broadcaster, struct LDKFeeEstimator fee_estimator, struct LDKLogger logger);
29274 * Returns the descriptors for relevant outputs (i.e., those that we can spend) within the
29275 * transaction if they exist and the transaction has at least [`ANTI_REORG_DELAY`]
29276 * confirmations. For [`SpendableOutputDescriptor::DelayedPaymentOutput`] descriptors to be
29277 * returned, the transaction must have at least `max(ANTI_REORG_DELAY, to_self_delay)`
29280 * Descriptors returned by this method are primarily exposed via [`Event::SpendableOutputs`]
29281 * once they are no longer under reorg risk. This method serves as a way to retrieve these
29282 * descriptors at a later time, either for historical purposes, or to replay any
29283 * missed/unhandled descriptors. For the purpose of gathering historical records, if the
29284 * channel close has fully resolved (i.e., [`ChannelMonitor::get_claimable_balances`] returns
29285 * an empty set), you can retrieve all spendable outputs by providing all descendant spending
29286 * transactions starting from the channel's funding transaction and going down three levels.
29288 * `tx` is a transaction we'll scan the outputs of. Any transaction can be provided. If any
29289 * outputs which can be spent by us are found, at least one descriptor is returned.
29291 * `confirmation_height` must be the height of the block in which `tx` was included in.
29293 MUST_USE_RES struct LDKCVec_SpendableOutputDescriptorZ ChannelMonitor_get_spendable_outputs(const struct LDKChannelMonitor *NONNULL_PTR this_arg, struct LDKTransaction tx, uint32_t confirmation_height);
29296 * Gets the balances in this channel which are either claimable by us if we were to
29297 * force-close the channel now or which are claimable on-chain (possibly awaiting
29300 * Any balances in the channel which are available on-chain (excluding on-chain fees) are
29301 * included here until an [`Event::SpendableOutputs`] event has been generated for the
29302 * balance, or until our counterparty has claimed the balance and accrued several
29303 * confirmations on the claim transaction.
29305 * Note that for `ChannelMonitors` which track a channel which went on-chain with versions of
29306 * LDK prior to 0.0.111, not all or excess balances may be included.
29308 * See [`Balance`] for additional details on the types of claimable balances which
29309 * may be returned here and their meanings.
29311 MUST_USE_RES struct LDKCVec_BalanceZ ChannelMonitor_get_claimable_balances(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
29314 * Read a C2Tuple_ThirtyTwoBytesChannelMonitorZ from a byte array, created by C2Tuple_ThirtyTwoBytesChannelMonitorZ_write
29316 struct LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ C2Tuple_ThirtyTwoBytesChannelMonitorZ_read(struct LDKu8slice ser, const struct LDKEntropySource *NONNULL_PTR arg_a, const struct LDKSignerProvider *NONNULL_PTR arg_b);
29319 * Frees any resources used by the OutPoint, if is_owned is set and inner is non-NULL.
29321 void OutPoint_free(struct LDKOutPoint this_obj);
29324 * The referenced transaction's txid.
29326 const uint8_t (*OutPoint_get_txid(const struct LDKOutPoint *NONNULL_PTR this_ptr))[32];
29329 * The referenced transaction's txid.
29331 void OutPoint_set_txid(struct LDKOutPoint *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
29334 * The index of the referenced output in its transaction's vout.
29336 uint16_t OutPoint_get_index(const struct LDKOutPoint *NONNULL_PTR this_ptr);
29339 * The index of the referenced output in its transaction's vout.
29341 void OutPoint_set_index(struct LDKOutPoint *NONNULL_PTR this_ptr, uint16_t val);
29344 * Constructs a new OutPoint given each field
29346 MUST_USE_RES struct LDKOutPoint OutPoint_new(struct LDKThirtyTwoBytes txid_arg, uint16_t index_arg);
29349 * Creates a copy of the OutPoint
29351 struct LDKOutPoint OutPoint_clone(const struct LDKOutPoint *NONNULL_PTR orig);
29354 * Checks if two OutPoints contain equal inner contents.
29355 * This ignores pointers and is_owned flags and looks at the values in fields.
29356 * Two objects with NULL inner values will be considered "equal" here.
29358 bool OutPoint_eq(const struct LDKOutPoint *NONNULL_PTR a, const struct LDKOutPoint *NONNULL_PTR b);
29361 * Generates a non-cryptographic 64-bit hash of the OutPoint.
29363 uint64_t OutPoint_hash(const struct LDKOutPoint *NONNULL_PTR o);
29366 * Convert an `OutPoint` to a lightning channel id.
29368 MUST_USE_RES struct LDKThirtyTwoBytes OutPoint_to_channel_id(const struct LDKOutPoint *NONNULL_PTR this_arg);
29371 * Serialize the OutPoint object into a byte array which can be read by OutPoint_read
29373 struct LDKCVec_u8Z OutPoint_write(const struct LDKOutPoint *NONNULL_PTR obj);
29376 * Read a OutPoint from a byte array, created by OutPoint_write
29378 struct LDKCResult_OutPointDecodeErrorZ OutPoint_read(struct LDKu8slice ser);
29381 * Frees any resources used by the FailureCode
29383 void FailureCode_free(struct LDKFailureCode this_ptr);
29386 * Creates a copy of the FailureCode
29388 struct LDKFailureCode FailureCode_clone(const struct LDKFailureCode *NONNULL_PTR orig);
29391 * Utility method to constructs a new TemporaryNodeFailure-variant FailureCode
29393 struct LDKFailureCode FailureCode_temporary_node_failure(void);
29396 * Utility method to constructs a new RequiredNodeFeatureMissing-variant FailureCode
29398 struct LDKFailureCode FailureCode_required_node_feature_missing(void);
29401 * Utility method to constructs a new IncorrectOrUnknownPaymentDetails-variant FailureCode
29403 struct LDKFailureCode FailureCode_incorrect_or_unknown_payment_details(void);
29406 * Utility method to constructs a new InvalidOnionPayload-variant FailureCode
29408 struct LDKFailureCode FailureCode_invalid_onion_payload(struct LDKCOption_C2Tuple_u64u16ZZ a);
29411 * Frees any resources used by the ChannelManager, if is_owned is set and inner is non-NULL.
29413 void ChannelManager_free(struct LDKChannelManager this_obj);
29416 * Frees any resources used by the ChainParameters, if is_owned is set and inner is non-NULL.
29418 void ChainParameters_free(struct LDKChainParameters this_obj);
29421 * The network for determining the `chain_hash` in Lightning messages.
29423 enum LDKNetwork ChainParameters_get_network(const struct LDKChainParameters *NONNULL_PTR this_ptr);
29426 * The network for determining the `chain_hash` in Lightning messages.
29428 void ChainParameters_set_network(struct LDKChainParameters *NONNULL_PTR this_ptr, enum LDKNetwork val);
29431 * The hash and height of the latest block successfully connected.
29433 * Used to track on-chain channel funding outputs and send payments with reliable timelocks.
29435 struct LDKBestBlock ChainParameters_get_best_block(const struct LDKChainParameters *NONNULL_PTR this_ptr);
29438 * The hash and height of the latest block successfully connected.
29440 * Used to track on-chain channel funding outputs and send payments with reliable timelocks.
29442 void ChainParameters_set_best_block(struct LDKChainParameters *NONNULL_PTR this_ptr, struct LDKBestBlock val);
29445 * Constructs a new ChainParameters given each field
29447 MUST_USE_RES struct LDKChainParameters ChainParameters_new(enum LDKNetwork network_arg, struct LDKBestBlock best_block_arg);
29450 * Creates a copy of the ChainParameters
29452 struct LDKChainParameters ChainParameters_clone(const struct LDKChainParameters *NONNULL_PTR orig);
29455 * Frees any resources used by the CounterpartyForwardingInfo, if is_owned is set and inner is non-NULL.
29457 void CounterpartyForwardingInfo_free(struct LDKCounterpartyForwardingInfo this_obj);
29460 * Base routing fee in millisatoshis.
29462 uint32_t CounterpartyForwardingInfo_get_fee_base_msat(const struct LDKCounterpartyForwardingInfo *NONNULL_PTR this_ptr);
29465 * Base routing fee in millisatoshis.
29467 void CounterpartyForwardingInfo_set_fee_base_msat(struct LDKCounterpartyForwardingInfo *NONNULL_PTR this_ptr, uint32_t val);
29470 * Amount in millionths of a satoshi the channel will charge per transferred satoshi.
29472 uint32_t CounterpartyForwardingInfo_get_fee_proportional_millionths(const struct LDKCounterpartyForwardingInfo *NONNULL_PTR this_ptr);
29475 * Amount in millionths of a satoshi the channel will charge per transferred satoshi.
29477 void CounterpartyForwardingInfo_set_fee_proportional_millionths(struct LDKCounterpartyForwardingInfo *NONNULL_PTR this_ptr, uint32_t val);
29480 * The minimum difference in cltv_expiry between an ingoing HTLC and its outgoing counterpart,
29481 * such that the outgoing HTLC is forwardable to this counterparty. See `msgs::ChannelUpdate`'s
29482 * `cltv_expiry_delta` for more details.
29484 uint16_t CounterpartyForwardingInfo_get_cltv_expiry_delta(const struct LDKCounterpartyForwardingInfo *NONNULL_PTR this_ptr);
29487 * The minimum difference in cltv_expiry between an ingoing HTLC and its outgoing counterpart,
29488 * such that the outgoing HTLC is forwardable to this counterparty. See `msgs::ChannelUpdate`'s
29489 * `cltv_expiry_delta` for more details.
29491 void CounterpartyForwardingInfo_set_cltv_expiry_delta(struct LDKCounterpartyForwardingInfo *NONNULL_PTR this_ptr, uint16_t val);
29494 * Constructs a new CounterpartyForwardingInfo given each field
29496 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);
29499 * Creates a copy of the CounterpartyForwardingInfo
29501 struct LDKCounterpartyForwardingInfo CounterpartyForwardingInfo_clone(const struct LDKCounterpartyForwardingInfo *NONNULL_PTR orig);
29504 * Frees any resources used by the ChannelCounterparty, if is_owned is set and inner is non-NULL.
29506 void ChannelCounterparty_free(struct LDKChannelCounterparty this_obj);
29509 * The node_id of our counterparty
29511 struct LDKPublicKey ChannelCounterparty_get_node_id(const struct LDKChannelCounterparty *NONNULL_PTR this_ptr);
29514 * The node_id of our counterparty
29516 void ChannelCounterparty_set_node_id(struct LDKChannelCounterparty *NONNULL_PTR this_ptr, struct LDKPublicKey val);
29519 * The Features the channel counterparty provided upon last connection.
29520 * Useful for routing as it is the most up-to-date copy of the counterparty's features and
29521 * many routing-relevant features are present in the init context.
29523 struct LDKInitFeatures ChannelCounterparty_get_features(const struct LDKChannelCounterparty *NONNULL_PTR this_ptr);
29526 * The Features the channel counterparty provided upon last connection.
29527 * Useful for routing as it is the most up-to-date copy of the counterparty's features and
29528 * many routing-relevant features are present in the init context.
29530 void ChannelCounterparty_set_features(struct LDKChannelCounterparty *NONNULL_PTR this_ptr, struct LDKInitFeatures val);
29533 * The value, in satoshis, that must always be held in the channel for our counterparty. This
29534 * value ensures that if our counterparty broadcasts a revoked state, we can punish them by
29535 * claiming at least this value on chain.
29537 * This value is not included in [`inbound_capacity_msat`] as it can never be spent.
29539 * [`inbound_capacity_msat`]: ChannelDetails::inbound_capacity_msat
29541 uint64_t ChannelCounterparty_get_unspendable_punishment_reserve(const struct LDKChannelCounterparty *NONNULL_PTR this_ptr);
29544 * The value, in satoshis, that must always be held in the channel for our counterparty. This
29545 * value ensures that if our counterparty broadcasts a revoked state, we can punish them by
29546 * claiming at least this value on chain.
29548 * This value is not included in [`inbound_capacity_msat`] as it can never be spent.
29550 * [`inbound_capacity_msat`]: ChannelDetails::inbound_capacity_msat
29552 void ChannelCounterparty_set_unspendable_punishment_reserve(struct LDKChannelCounterparty *NONNULL_PTR this_ptr, uint64_t val);
29555 * Information on the fees and requirements that the counterparty requires when forwarding
29556 * payments to us through this channel.
29558 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
29560 struct LDKCounterpartyForwardingInfo ChannelCounterparty_get_forwarding_info(const struct LDKChannelCounterparty *NONNULL_PTR this_ptr);
29563 * Information on the fees and requirements that the counterparty requires when forwarding
29564 * payments to us through this channel.
29566 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
29568 void ChannelCounterparty_set_forwarding_info(struct LDKChannelCounterparty *NONNULL_PTR this_ptr, struct LDKCounterpartyForwardingInfo val);
29571 * The smallest value HTLC (in msat) the remote peer will accept, for this channel. This field
29572 * is only `None` before we have received either the `OpenChannel` or `AcceptChannel` message
29573 * from the remote peer, or for `ChannelCounterparty` objects serialized prior to LDK 0.0.107.
29575 struct LDKCOption_u64Z ChannelCounterparty_get_outbound_htlc_minimum_msat(const struct LDKChannelCounterparty *NONNULL_PTR this_ptr);
29578 * The smallest value HTLC (in msat) the remote peer will accept, for this channel. This field
29579 * is only `None` before we have received either the `OpenChannel` or `AcceptChannel` message
29580 * from the remote peer, or for `ChannelCounterparty` objects serialized prior to LDK 0.0.107.
29582 void ChannelCounterparty_set_outbound_htlc_minimum_msat(struct LDKChannelCounterparty *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
29585 * The largest value HTLC (in msat) the remote peer currently will accept, for this channel.
29587 struct LDKCOption_u64Z ChannelCounterparty_get_outbound_htlc_maximum_msat(const struct LDKChannelCounterparty *NONNULL_PTR this_ptr);
29590 * The largest value HTLC (in msat) the remote peer currently will accept, for this channel.
29592 void ChannelCounterparty_set_outbound_htlc_maximum_msat(struct LDKChannelCounterparty *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
29595 * Constructs a new ChannelCounterparty given each field
29597 * Note that forwarding_info_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
29599 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);
29602 * Creates a copy of the ChannelCounterparty
29604 struct LDKChannelCounterparty ChannelCounterparty_clone(const struct LDKChannelCounterparty *NONNULL_PTR orig);
29607 * Frees any resources used by the ChannelDetails, if is_owned is set and inner is non-NULL.
29609 void ChannelDetails_free(struct LDKChannelDetails this_obj);
29612 * The channel's ID (prior to funding transaction generation, this is a random 32 bytes,
29613 * thereafter this is the txid of the funding transaction xor the funding transaction output).
29614 * Note that this means this value is *not* persistent - it can change once during the
29615 * lifetime of the channel.
29617 const uint8_t (*ChannelDetails_get_channel_id(const struct LDKChannelDetails *NONNULL_PTR this_ptr))[32];
29620 * The channel's ID (prior to funding transaction generation, this is a random 32 bytes,
29621 * thereafter this is the txid of the funding transaction xor the funding transaction output).
29622 * Note that this means this value is *not* persistent - it can change once during the
29623 * lifetime of the channel.
29625 void ChannelDetails_set_channel_id(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
29628 * Parameters which apply to our counterparty. See individual fields for more information.
29630 struct LDKChannelCounterparty ChannelDetails_get_counterparty(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
29633 * Parameters which apply to our counterparty. See individual fields for more information.
29635 void ChannelDetails_set_counterparty(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKChannelCounterparty val);
29638 * The Channel's funding transaction output, if we've negotiated the funding transaction with
29639 * our counterparty already.
29641 * Note that, if this has been set, `channel_id` will be equivalent to
29642 * `funding_txo.unwrap().to_channel_id()`.
29644 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
29646 struct LDKOutPoint ChannelDetails_get_funding_txo(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
29649 * The Channel's funding transaction output, if we've negotiated the funding transaction with
29650 * our counterparty already.
29652 * Note that, if this has been set, `channel_id` will be equivalent to
29653 * `funding_txo.unwrap().to_channel_id()`.
29655 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
29657 void ChannelDetails_set_funding_txo(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKOutPoint val);
29660 * The features which this channel operates with. See individual features for more info.
29662 * `None` until negotiation completes and the channel type is finalized.
29664 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
29666 struct LDKChannelTypeFeatures ChannelDetails_get_channel_type(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
29669 * The features which this channel operates with. See individual features for more info.
29671 * `None` until negotiation completes and the channel type is finalized.
29673 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
29675 void ChannelDetails_set_channel_type(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKChannelTypeFeatures val);
29678 * The position of the funding transaction in the chain. None if the funding transaction has
29679 * not yet been confirmed and the channel fully opened.
29681 * Note that if [`inbound_scid_alias`] is set, it must be used for invoices and inbound
29682 * payments instead of this. See [`get_inbound_payment_scid`].
29684 * For channels with [`confirmations_required`] set to `Some(0)`, [`outbound_scid_alias`] may
29685 * be used in place of this in outbound routes. See [`get_outbound_payment_scid`].
29687 * [`inbound_scid_alias`]: Self::inbound_scid_alias
29688 * [`outbound_scid_alias`]: Self::outbound_scid_alias
29689 * [`get_inbound_payment_scid`]: Self::get_inbound_payment_scid
29690 * [`get_outbound_payment_scid`]: Self::get_outbound_payment_scid
29691 * [`confirmations_required`]: Self::confirmations_required
29693 struct LDKCOption_u64Z ChannelDetails_get_short_channel_id(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
29696 * The position of the funding transaction in the chain. None if the funding transaction has
29697 * not yet been confirmed and the channel fully opened.
29699 * Note that if [`inbound_scid_alias`] is set, it must be used for invoices and inbound
29700 * payments instead of this. See [`get_inbound_payment_scid`].
29702 * For channels with [`confirmations_required`] set to `Some(0)`, [`outbound_scid_alias`] may
29703 * be used in place of this in outbound routes. See [`get_outbound_payment_scid`].
29705 * [`inbound_scid_alias`]: Self::inbound_scid_alias
29706 * [`outbound_scid_alias`]: Self::outbound_scid_alias
29707 * [`get_inbound_payment_scid`]: Self::get_inbound_payment_scid
29708 * [`get_outbound_payment_scid`]: Self::get_outbound_payment_scid
29709 * [`confirmations_required`]: Self::confirmations_required
29711 void ChannelDetails_set_short_channel_id(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
29714 * An optional [`short_channel_id`] alias for this channel, randomly generated by us and
29715 * usable in place of [`short_channel_id`] to reference the channel in outbound routes when
29716 * the channel has not yet been confirmed (as long as [`confirmations_required`] is
29719 * This will be `None` as long as the channel is not available for routing outbound payments.
29721 * [`short_channel_id`]: Self::short_channel_id
29722 * [`confirmations_required`]: Self::confirmations_required
29724 struct LDKCOption_u64Z ChannelDetails_get_outbound_scid_alias(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
29727 * An optional [`short_channel_id`] alias for this channel, randomly generated by us and
29728 * usable in place of [`short_channel_id`] to reference the channel in outbound routes when
29729 * the channel has not yet been confirmed (as long as [`confirmations_required`] is
29732 * This will be `None` as long as the channel is not available for routing outbound payments.
29734 * [`short_channel_id`]: Self::short_channel_id
29735 * [`confirmations_required`]: Self::confirmations_required
29737 void ChannelDetails_set_outbound_scid_alias(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
29740 * An optional [`short_channel_id`] alias for this channel, randomly generated by our
29741 * counterparty and usable in place of [`short_channel_id`] in invoice route hints. Our
29742 * counterparty will recognize the alias provided here in place of the [`short_channel_id`]
29743 * when they see a payment to be routed to us.
29745 * Our counterparty may choose to rotate this value at any time, though will always recognize
29746 * previous values for inbound payment forwarding.
29748 * [`short_channel_id`]: Self::short_channel_id
29750 struct LDKCOption_u64Z ChannelDetails_get_inbound_scid_alias(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
29753 * An optional [`short_channel_id`] alias for this channel, randomly generated by our
29754 * counterparty and usable in place of [`short_channel_id`] in invoice route hints. Our
29755 * counterparty will recognize the alias provided here in place of the [`short_channel_id`]
29756 * when they see a payment to be routed to us.
29758 * Our counterparty may choose to rotate this value at any time, though will always recognize
29759 * previous values for inbound payment forwarding.
29761 * [`short_channel_id`]: Self::short_channel_id
29763 void ChannelDetails_set_inbound_scid_alias(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
29766 * The value, in satoshis, of this channel as appears in the funding output
29768 uint64_t ChannelDetails_get_channel_value_satoshis(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
29771 * The value, in satoshis, of this channel as appears in the funding output
29773 void ChannelDetails_set_channel_value_satoshis(struct LDKChannelDetails *NONNULL_PTR this_ptr, uint64_t val);
29776 * The value, in satoshis, that must always be held in the channel for us. This value ensures
29777 * that if we broadcast a revoked state, our counterparty can punish us by claiming at least
29778 * this value on chain.
29780 * This value is not included in [`outbound_capacity_msat`] as it can never be spent.
29782 * This value will be `None` for outbound channels until the counterparty accepts the channel.
29784 * [`outbound_capacity_msat`]: ChannelDetails::outbound_capacity_msat
29786 struct LDKCOption_u64Z ChannelDetails_get_unspendable_punishment_reserve(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
29789 * The value, in satoshis, that must always be held in the channel for us. This value ensures
29790 * that if we broadcast a revoked state, our counterparty can punish us by claiming at least
29791 * this value on chain.
29793 * This value is not included in [`outbound_capacity_msat`] as it can never be spent.
29795 * This value will be `None` for outbound channels until the counterparty accepts the channel.
29797 * [`outbound_capacity_msat`]: ChannelDetails::outbound_capacity_msat
29799 void ChannelDetails_set_unspendable_punishment_reserve(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
29802 * The `user_channel_id` value passed in to [`ChannelManager::create_channel`] for outbound
29803 * channels, or to [`ChannelManager::accept_inbound_channel`] for inbound channels if
29804 * [`UserConfig::manually_accept_inbound_channels`] config flag is set to true. Otherwise
29805 * `user_channel_id` will be randomized for an inbound channel. This may be zero for objects
29806 * serialized with LDK versions prior to 0.0.113.
29808 * [`ChannelManager::create_channel`]: crate::ln::channelmanager::ChannelManager::create_channel
29809 * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
29810 * [`UserConfig::manually_accept_inbound_channels`]: crate::util::config::UserConfig::manually_accept_inbound_channels
29812 struct LDKU128 ChannelDetails_get_user_channel_id(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
29815 * The `user_channel_id` value passed in to [`ChannelManager::create_channel`] for outbound
29816 * channels, or to [`ChannelManager::accept_inbound_channel`] for inbound channels if
29817 * [`UserConfig::manually_accept_inbound_channels`] config flag is set to true. Otherwise
29818 * `user_channel_id` will be randomized for an inbound channel. This may be zero for objects
29819 * serialized with LDK versions prior to 0.0.113.
29821 * [`ChannelManager::create_channel`]: crate::ln::channelmanager::ChannelManager::create_channel
29822 * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
29823 * [`UserConfig::manually_accept_inbound_channels`]: crate::util::config::UserConfig::manually_accept_inbound_channels
29825 void ChannelDetails_set_user_channel_id(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKU128 val);
29828 * The currently negotiated fee rate denominated in satoshi per 1000 weight units,
29829 * which is applied to commitment and HTLC transactions.
29831 * This value will be `None` for objects serialized with LDK versions prior to 0.0.115.
29833 struct LDKCOption_u32Z ChannelDetails_get_feerate_sat_per_1000_weight(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
29836 * The currently negotiated fee rate denominated in satoshi per 1000 weight units,
29837 * which is applied to commitment and HTLC transactions.
29839 * This value will be `None` for objects serialized with LDK versions prior to 0.0.115.
29841 void ChannelDetails_set_feerate_sat_per_1000_weight(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u32Z val);
29844 * Our total balance. This is the amount we would get if we close the channel.
29845 * This value is not exact. Due to various in-flight changes and feerate changes, exactly this
29846 * amount is not likely to be recoverable on close.
29848 * This does not include any pending HTLCs which are not yet fully resolved (and, thus, whose
29849 * balance is not available for inclusion in new outbound HTLCs). This further does not include
29850 * any pending outgoing HTLCs which are awaiting some other resolution to be sent.
29851 * This does not consider any on-chain fees.
29853 * See also [`ChannelDetails::outbound_capacity_msat`]
29855 uint64_t ChannelDetails_get_balance_msat(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
29858 * Our total balance. This is the amount we would get if we close the channel.
29859 * This value is not exact. Due to various in-flight changes and feerate changes, exactly this
29860 * amount is not likely to be recoverable on close.
29862 * This does not include any pending HTLCs which are not yet fully resolved (and, thus, whose
29863 * balance is not available for inclusion in new outbound HTLCs). This further does not include
29864 * any pending outgoing HTLCs which are awaiting some other resolution to be sent.
29865 * This does not consider any on-chain fees.
29867 * See also [`ChannelDetails::outbound_capacity_msat`]
29869 void ChannelDetails_set_balance_msat(struct LDKChannelDetails *NONNULL_PTR this_ptr, uint64_t val);
29872 * The available outbound capacity for sending HTLCs to the remote peer. This does not include
29873 * any pending HTLCs which are not yet fully resolved (and, thus, whose balance is not
29874 * available for inclusion in new outbound HTLCs). This further does not include any pending
29875 * outgoing HTLCs which are awaiting some other resolution to be sent.
29877 * See also [`ChannelDetails::balance_msat`]
29879 * This value is not exact. Due to various in-flight changes, feerate changes, and our
29880 * conflict-avoidance policy, exactly this amount is not likely to be spendable. However, we
29881 * should be able to spend nearly this amount.
29883 uint64_t ChannelDetails_get_outbound_capacity_msat(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
29886 * The available outbound capacity for sending HTLCs to the remote peer. This does not include
29887 * any pending HTLCs which are not yet fully resolved (and, thus, whose balance is not
29888 * available for inclusion in new outbound HTLCs). This further does not include any pending
29889 * outgoing HTLCs which are awaiting some other resolution to be sent.
29891 * See also [`ChannelDetails::balance_msat`]
29893 * This value is not exact. Due to various in-flight changes, feerate changes, and our
29894 * conflict-avoidance policy, exactly this amount is not likely to be spendable. However, we
29895 * should be able to spend nearly this amount.
29897 void ChannelDetails_set_outbound_capacity_msat(struct LDKChannelDetails *NONNULL_PTR this_ptr, uint64_t val);
29900 * The available outbound capacity for sending a single HTLC to the remote peer. This is
29901 * similar to [`ChannelDetails::outbound_capacity_msat`] but it may be further restricted by
29902 * the current state and per-HTLC limit(s). This is intended for use when routing, allowing us
29903 * to use a limit as close as possible to the HTLC limit we can currently send.
29905 * See also [`ChannelDetails::next_outbound_htlc_minimum_msat`],
29906 * [`ChannelDetails::balance_msat`], and [`ChannelDetails::outbound_capacity_msat`].
29908 uint64_t ChannelDetails_get_next_outbound_htlc_limit_msat(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
29911 * The available outbound capacity for sending a single HTLC to the remote peer. This is
29912 * similar to [`ChannelDetails::outbound_capacity_msat`] but it may be further restricted by
29913 * the current state and per-HTLC limit(s). This is intended for use when routing, allowing us
29914 * to use a limit as close as possible to the HTLC limit we can currently send.
29916 * See also [`ChannelDetails::next_outbound_htlc_minimum_msat`],
29917 * [`ChannelDetails::balance_msat`], and [`ChannelDetails::outbound_capacity_msat`].
29919 void ChannelDetails_set_next_outbound_htlc_limit_msat(struct LDKChannelDetails *NONNULL_PTR this_ptr, uint64_t val);
29922 * The minimum value for sending a single HTLC to the remote peer. This is the equivalent of
29923 * [`ChannelDetails::next_outbound_htlc_limit_msat`] but represents a lower-bound, rather than
29924 * an upper-bound. This is intended for use when routing, allowing us to ensure we pick a
29925 * route which is valid.
29927 uint64_t ChannelDetails_get_next_outbound_htlc_minimum_msat(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
29930 * The minimum value for sending a single HTLC to the remote peer. This is the equivalent of
29931 * [`ChannelDetails::next_outbound_htlc_limit_msat`] but represents a lower-bound, rather than
29932 * an upper-bound. This is intended for use when routing, allowing us to ensure we pick a
29933 * route which is valid.
29935 void ChannelDetails_set_next_outbound_htlc_minimum_msat(struct LDKChannelDetails *NONNULL_PTR this_ptr, uint64_t val);
29938 * The available inbound capacity for the remote peer to send HTLCs to us. This does not
29939 * include any pending HTLCs which are not yet fully resolved (and, thus, whose balance is not
29940 * available for inclusion in new inbound HTLCs).
29941 * Note that there are some corner cases not fully handled here, so the actual available
29942 * inbound capacity may be slightly higher than this.
29944 * This value is not exact. Due to various in-flight changes, feerate changes, and our
29945 * counterparty's conflict-avoidance policy, exactly this amount is not likely to be spendable.
29946 * However, our counterparty should be able to spend nearly this amount.
29948 uint64_t ChannelDetails_get_inbound_capacity_msat(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
29951 * The available inbound capacity for the remote peer to send HTLCs to us. This does not
29952 * include any pending HTLCs which are not yet fully resolved (and, thus, whose balance is not
29953 * available for inclusion in new inbound HTLCs).
29954 * Note that there are some corner cases not fully handled here, so the actual available
29955 * inbound capacity may be slightly higher than this.
29957 * This value is not exact. Due to various in-flight changes, feerate changes, and our
29958 * counterparty's conflict-avoidance policy, exactly this amount is not likely to be spendable.
29959 * However, our counterparty should be able to spend nearly this amount.
29961 void ChannelDetails_set_inbound_capacity_msat(struct LDKChannelDetails *NONNULL_PTR this_ptr, uint64_t val);
29964 * The number of required confirmations on the funding transaction before the funding will be
29965 * considered \"locked\". This number is selected by the channel fundee (i.e. us if
29966 * [`is_outbound`] is *not* set), and can be selected for inbound channels with
29967 * [`ChannelHandshakeConfig::minimum_depth`] or limited for outbound channels with
29968 * [`ChannelHandshakeLimits::max_minimum_depth`].
29970 * This value will be `None` for outbound channels until the counterparty accepts the channel.
29972 * [`is_outbound`]: ChannelDetails::is_outbound
29973 * [`ChannelHandshakeConfig::minimum_depth`]: crate::util::config::ChannelHandshakeConfig::minimum_depth
29974 * [`ChannelHandshakeLimits::max_minimum_depth`]: crate::util::config::ChannelHandshakeLimits::max_minimum_depth
29976 struct LDKCOption_u32Z ChannelDetails_get_confirmations_required(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
29979 * The number of required confirmations on the funding transaction before the funding will be
29980 * considered \"locked\". This number is selected by the channel fundee (i.e. us if
29981 * [`is_outbound`] is *not* set), and can be selected for inbound channels with
29982 * [`ChannelHandshakeConfig::minimum_depth`] or limited for outbound channels with
29983 * [`ChannelHandshakeLimits::max_minimum_depth`].
29985 * This value will be `None` for outbound channels until the counterparty accepts the channel.
29987 * [`is_outbound`]: ChannelDetails::is_outbound
29988 * [`ChannelHandshakeConfig::minimum_depth`]: crate::util::config::ChannelHandshakeConfig::minimum_depth
29989 * [`ChannelHandshakeLimits::max_minimum_depth`]: crate::util::config::ChannelHandshakeLimits::max_minimum_depth
29991 void ChannelDetails_set_confirmations_required(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u32Z val);
29994 * The current number of confirmations on the funding transaction.
29996 * This value will be `None` for objects serialized with LDK versions prior to 0.0.113.
29998 struct LDKCOption_u32Z ChannelDetails_get_confirmations(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
30001 * The current number of confirmations on the funding transaction.
30003 * This value will be `None` for objects serialized with LDK versions prior to 0.0.113.
30005 void ChannelDetails_set_confirmations(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u32Z val);
30008 * The number of blocks (after our commitment transaction confirms) that we will need to wait
30009 * until we can claim our funds after we force-close the channel. During this time our
30010 * counterparty is allowed to punish us if we broadcasted a stale state. If our counterparty
30011 * force-closes the channel and broadcasts a commitment transaction we do not have to wait any
30012 * time to claim our non-HTLC-encumbered funds.
30014 * This value will be `None` for outbound channels until the counterparty accepts the channel.
30016 struct LDKCOption_u16Z ChannelDetails_get_force_close_spend_delay(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
30019 * The number of blocks (after our commitment transaction confirms) that we will need to wait
30020 * until we can claim our funds after we force-close the channel. During this time our
30021 * counterparty is allowed to punish us if we broadcasted a stale state. If our counterparty
30022 * force-closes the channel and broadcasts a commitment transaction we do not have to wait any
30023 * time to claim our non-HTLC-encumbered funds.
30025 * This value will be `None` for outbound channels until the counterparty accepts the channel.
30027 void ChannelDetails_set_force_close_spend_delay(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u16Z val);
30030 * True if the channel was initiated (and thus funded) by us.
30032 bool ChannelDetails_get_is_outbound(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
30035 * True if the channel was initiated (and thus funded) by us.
30037 void ChannelDetails_set_is_outbound(struct LDKChannelDetails *NONNULL_PTR this_ptr, bool val);
30040 * True if the channel is confirmed, channel_ready messages have been exchanged, and the
30041 * channel is not currently being shut down. `channel_ready` message exchange implies the
30042 * required confirmation count has been reached (and we were connected to the peer at some
30043 * point after the funding transaction received enough confirmations). The required
30044 * confirmation count is provided in [`confirmations_required`].
30046 * [`confirmations_required`]: ChannelDetails::confirmations_required
30048 bool ChannelDetails_get_is_channel_ready(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
30051 * True if the channel is confirmed, channel_ready messages have been exchanged, and the
30052 * channel is not currently being shut down. `channel_ready` message exchange implies the
30053 * required confirmation count has been reached (and we were connected to the peer at some
30054 * point after the funding transaction received enough confirmations). The required
30055 * confirmation count is provided in [`confirmations_required`].
30057 * [`confirmations_required`]: ChannelDetails::confirmations_required
30059 void ChannelDetails_set_is_channel_ready(struct LDKChannelDetails *NONNULL_PTR this_ptr, bool val);
30062 * The stage of the channel's shutdown.
30063 * `None` for `ChannelDetails` serialized on LDK versions prior to 0.0.116.
30065 * Returns a copy of the field.
30067 struct LDKCOption_ChannelShutdownStateZ ChannelDetails_get_channel_shutdown_state(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
30070 * The stage of the channel's shutdown.
30071 * `None` for `ChannelDetails` serialized on LDK versions prior to 0.0.116.
30073 void ChannelDetails_set_channel_shutdown_state(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_ChannelShutdownStateZ val);
30076 * True if the channel is (a) confirmed and channel_ready messages have been exchanged, (b)
30077 * the peer is connected, and (c) the channel is not currently negotiating a shutdown.
30079 * This is a strict superset of `is_channel_ready`.
30081 bool ChannelDetails_get_is_usable(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
30084 * True if the channel is (a) confirmed and channel_ready messages have been exchanged, (b)
30085 * the peer is connected, and (c) the channel is not currently negotiating a shutdown.
30087 * This is a strict superset of `is_channel_ready`.
30089 void ChannelDetails_set_is_usable(struct LDKChannelDetails *NONNULL_PTR this_ptr, bool val);
30092 * True if this channel is (or will be) publicly-announced.
30094 bool ChannelDetails_get_is_public(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
30097 * True if this channel is (or will be) publicly-announced.
30099 void ChannelDetails_set_is_public(struct LDKChannelDetails *NONNULL_PTR this_ptr, bool val);
30102 * The smallest value HTLC (in msat) we will accept, for this channel. This field
30103 * is only `None` for `ChannelDetails` objects serialized prior to LDK 0.0.107
30105 struct LDKCOption_u64Z ChannelDetails_get_inbound_htlc_minimum_msat(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
30108 * The smallest value HTLC (in msat) we will accept, for this channel. This field
30109 * is only `None` for `ChannelDetails` objects serialized prior to LDK 0.0.107
30111 void ChannelDetails_set_inbound_htlc_minimum_msat(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
30114 * The largest value HTLC (in msat) we currently will accept, for this channel.
30116 struct LDKCOption_u64Z ChannelDetails_get_inbound_htlc_maximum_msat(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
30119 * The largest value HTLC (in msat) we currently will accept, for this channel.
30121 void ChannelDetails_set_inbound_htlc_maximum_msat(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
30124 * Set of configurable parameters that affect channel operation.
30126 * This field is only `None` for `ChannelDetails` objects serialized prior to LDK 0.0.109.
30128 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
30130 struct LDKChannelConfig ChannelDetails_get_config(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
30133 * Set of configurable parameters that affect channel operation.
30135 * This field is only `None` for `ChannelDetails` objects serialized prior to LDK 0.0.109.
30137 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
30139 void ChannelDetails_set_config(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKChannelConfig val);
30142 * Constructs a new ChannelDetails given each field
30144 * Note that funding_txo_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
30145 * Note that channel_type_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
30146 * Note that config_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
30148 MUST_USE_RES struct LDKChannelDetails ChannelDetails_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKChannelCounterparty counterparty_arg, struct LDKOutPoint funding_txo_arg, struct LDKChannelTypeFeatures channel_type_arg, struct LDKCOption_u64Z short_channel_id_arg, struct LDKCOption_u64Z outbound_scid_alias_arg, struct LDKCOption_u64Z inbound_scid_alias_arg, uint64_t channel_value_satoshis_arg, struct LDKCOption_u64Z unspendable_punishment_reserve_arg, struct LDKU128 user_channel_id_arg, struct LDKCOption_u32Z feerate_sat_per_1000_weight_arg, uint64_t balance_msat_arg, uint64_t outbound_capacity_msat_arg, uint64_t next_outbound_htlc_limit_msat_arg, uint64_t next_outbound_htlc_minimum_msat_arg, uint64_t inbound_capacity_msat_arg, struct LDKCOption_u32Z confirmations_required_arg, struct LDKCOption_u32Z confirmations_arg, struct LDKCOption_u16Z force_close_spend_delay_arg, bool is_outbound_arg, bool is_channel_ready_arg, struct LDKCOption_ChannelShutdownStateZ channel_shutdown_state_arg, bool is_usable_arg, bool is_public_arg, struct LDKCOption_u64Z inbound_htlc_minimum_msat_arg, struct LDKCOption_u64Z inbound_htlc_maximum_msat_arg, struct LDKChannelConfig config_arg);
30151 * Creates a copy of the ChannelDetails
30153 struct LDKChannelDetails ChannelDetails_clone(const struct LDKChannelDetails *NONNULL_PTR orig);
30156 * Gets the current SCID which should be used to identify this channel for inbound payments.
30157 * This should be used for providing invoice hints or in any other context where our
30158 * counterparty will forward a payment to us.
30160 * This is either the [`ChannelDetails::inbound_scid_alias`], if set, or the
30161 * [`ChannelDetails::short_channel_id`]. See those for more information.
30163 MUST_USE_RES struct LDKCOption_u64Z ChannelDetails_get_inbound_payment_scid(const struct LDKChannelDetails *NONNULL_PTR this_arg);
30166 * Gets the current SCID which should be used to identify this channel for outbound payments.
30167 * This should be used in [`Route`]s to describe the first hop or in other contexts where
30168 * we're sending or forwarding a payment outbound over this channel.
30170 * This is either the [`ChannelDetails::short_channel_id`], if set, or the
30171 * [`ChannelDetails::outbound_scid_alias`]. See those for more information.
30173 MUST_USE_RES struct LDKCOption_u64Z ChannelDetails_get_outbound_payment_scid(const struct LDKChannelDetails *NONNULL_PTR this_arg);
30176 * Creates a copy of the ChannelShutdownState
30178 enum LDKChannelShutdownState ChannelShutdownState_clone(const enum LDKChannelShutdownState *NONNULL_PTR orig);
30181 * Utility method to constructs a new NotShuttingDown-variant ChannelShutdownState
30183 enum LDKChannelShutdownState ChannelShutdownState_not_shutting_down(void);
30186 * Utility method to constructs a new ShutdownInitiated-variant ChannelShutdownState
30188 enum LDKChannelShutdownState ChannelShutdownState_shutdown_initiated(void);
30191 * Utility method to constructs a new ResolvingHTLCs-variant ChannelShutdownState
30193 enum LDKChannelShutdownState ChannelShutdownState_resolving_htlcs(void);
30196 * Utility method to constructs a new NegotiatingClosingFee-variant ChannelShutdownState
30198 enum LDKChannelShutdownState ChannelShutdownState_negotiating_closing_fee(void);
30201 * Utility method to constructs a new ShutdownComplete-variant ChannelShutdownState
30203 enum LDKChannelShutdownState ChannelShutdownState_shutdown_complete(void);
30206 * Checks if two ChannelShutdownStates contain equal inner contents.
30207 * This ignores pointers and is_owned flags and looks at the values in fields.
30209 bool ChannelShutdownState_eq(const enum LDKChannelShutdownState *NONNULL_PTR a, const enum LDKChannelShutdownState *NONNULL_PTR b);
30212 * Frees any resources used by the RecentPaymentDetails
30214 void RecentPaymentDetails_free(struct LDKRecentPaymentDetails this_ptr);
30217 * Creates a copy of the RecentPaymentDetails
30219 struct LDKRecentPaymentDetails RecentPaymentDetails_clone(const struct LDKRecentPaymentDetails *NONNULL_PTR orig);
30222 * Utility method to constructs a new AwaitingInvoice-variant RecentPaymentDetails
30224 struct LDKRecentPaymentDetails RecentPaymentDetails_awaiting_invoice(struct LDKThirtyTwoBytes payment_id);
30227 * Utility method to constructs a new Pending-variant RecentPaymentDetails
30229 struct LDKRecentPaymentDetails RecentPaymentDetails_pending(struct LDKThirtyTwoBytes payment_id, struct LDKThirtyTwoBytes payment_hash, uint64_t total_msat);
30232 * Utility method to constructs a new Fulfilled-variant RecentPaymentDetails
30234 struct LDKRecentPaymentDetails RecentPaymentDetails_fulfilled(struct LDKThirtyTwoBytes payment_id, struct LDKCOption_ThirtyTwoBytesZ payment_hash);
30237 * Utility method to constructs a new Abandoned-variant RecentPaymentDetails
30239 struct LDKRecentPaymentDetails RecentPaymentDetails_abandoned(struct LDKThirtyTwoBytes payment_id, struct LDKThirtyTwoBytes payment_hash);
30242 * Frees any resources used by the PhantomRouteHints, if is_owned is set and inner is non-NULL.
30244 void PhantomRouteHints_free(struct LDKPhantomRouteHints this_obj);
30247 * The list of channels to be included in the invoice route hints.
30249 struct LDKCVec_ChannelDetailsZ PhantomRouteHints_get_channels(const struct LDKPhantomRouteHints *NONNULL_PTR this_ptr);
30252 * The list of channels to be included in the invoice route hints.
30254 void PhantomRouteHints_set_channels(struct LDKPhantomRouteHints *NONNULL_PTR this_ptr, struct LDKCVec_ChannelDetailsZ val);
30257 * A fake scid used for representing the phantom node's fake channel in generating the invoice
30260 uint64_t PhantomRouteHints_get_phantom_scid(const struct LDKPhantomRouteHints *NONNULL_PTR this_ptr);
30263 * A fake scid used for representing the phantom node's fake channel in generating the invoice
30266 void PhantomRouteHints_set_phantom_scid(struct LDKPhantomRouteHints *NONNULL_PTR this_ptr, uint64_t val);
30269 * The pubkey of the real backing node that would ultimately receive the payment.
30271 struct LDKPublicKey PhantomRouteHints_get_real_node_pubkey(const struct LDKPhantomRouteHints *NONNULL_PTR this_ptr);
30274 * The pubkey of the real backing node that would ultimately receive the payment.
30276 void PhantomRouteHints_set_real_node_pubkey(struct LDKPhantomRouteHints *NONNULL_PTR this_ptr, struct LDKPublicKey val);
30279 * Constructs a new PhantomRouteHints given each field
30281 MUST_USE_RES struct LDKPhantomRouteHints PhantomRouteHints_new(struct LDKCVec_ChannelDetailsZ channels_arg, uint64_t phantom_scid_arg, struct LDKPublicKey real_node_pubkey_arg);
30284 * Creates a copy of the PhantomRouteHints
30286 struct LDKPhantomRouteHints PhantomRouteHints_clone(const struct LDKPhantomRouteHints *NONNULL_PTR orig);
30289 * Constructs a new `ChannelManager` to hold several channels and route between them.
30291 * The current time or latest block header time can be provided as the `current_timestamp`.
30293 * This is the main \"logic hub\" for all channel-related actions, and implements
30294 * [`ChannelMessageHandler`].
30296 * Non-proportional fees are fixed according to our risk using the provided fee estimator.
30298 * Users need to notify the new `ChannelManager` when a new block is connected or
30299 * disconnected using its [`block_connected`] and [`block_disconnected`] methods, starting
30300 * from after [`params.best_block.block_hash`]. See [`chain::Listen`] and [`chain::Confirm`] for
30303 * [`block_connected`]: chain::Listen::block_connected
30304 * [`block_disconnected`]: chain::Listen::block_disconnected
30305 * [`params.best_block.block_hash`]: chain::BestBlock::block_hash
30307 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);
30310 * Gets the current configuration applied to all new channels.
30312 MUST_USE_RES struct LDKUserConfig ChannelManager_get_current_default_configuration(const struct LDKChannelManager *NONNULL_PTR this_arg);
30315 * Creates a new outbound channel to the given remote node and with the given value.
30317 * `user_channel_id` will be provided back as in
30318 * [`Event::FundingGenerationReady::user_channel_id`] to allow tracking of which events
30319 * correspond with which `create_channel` call. Note that the `user_channel_id` defaults to a
30320 * randomized value for inbound channels. `user_channel_id` has no meaning inside of LDK, it
30321 * is simply copied to events and otherwise ignored.
30323 * Raises [`APIError::APIMisuseError`] when `channel_value_satoshis` > 2**24 or `push_msat` is
30324 * greater than `channel_value_satoshis * 1k` or `channel_value_satoshis < 1000`.
30326 * Raises [`APIError::ChannelUnavailable`] if the channel cannot be opened due to failing to
30327 * generate a shutdown scriptpubkey or destination script set by
30328 * [`SignerProvider::get_shutdown_scriptpubkey`] or [`SignerProvider::get_destination_script`].
30330 * Note that we do not check if you are currently connected to the given peer. If no
30331 * connection is available, the outbound `open_channel` message may fail to send, resulting in
30332 * the channel eventually being silently forgotten (dropped on reload).
30334 * Returns the new Channel's temporary `channel_id`. This ID will appear as
30335 * [`Event::FundingGenerationReady::temporary_channel_id`] and in
30336 * [`ChannelDetails::channel_id`] until after
30337 * [`ChannelManager::funding_transaction_generated`] is called, swapping the Channel's ID for
30338 * one derived from the funding transaction's TXID. If the counterparty rejects the channel
30339 * immediately, this temporary ID will appear in [`Event::ChannelClosed::channel_id`].
30341 * [`Event::FundingGenerationReady::user_channel_id`]: events::Event::FundingGenerationReady::user_channel_id
30342 * [`Event::FundingGenerationReady::temporary_channel_id`]: events::Event::FundingGenerationReady::temporary_channel_id
30343 * [`Event::ChannelClosed::channel_id`]: events::Event::ChannelClosed::channel_id
30345 * Note that override_config (or a relevant inner pointer) may be NULL or all-0s to represent None
30347 MUST_USE_RES struct LDKCResult_ThirtyTwoBytesAPIErrorZ ChannelManager_create_channel(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKPublicKey their_network_key, uint64_t channel_value_satoshis, uint64_t push_msat, struct LDKU128 user_channel_id, struct LDKUserConfig override_config);
30350 * Gets the list of open channels, in random order. See [`ChannelDetails`] field documentation for
30351 * more information.
30353 MUST_USE_RES struct LDKCVec_ChannelDetailsZ ChannelManager_list_channels(const struct LDKChannelManager *NONNULL_PTR this_arg);
30356 * Gets the list of usable channels, in random order. Useful as an argument to
30357 * [`Router::find_route`] to ensure non-announced channels are used.
30359 * These are guaranteed to have their [`ChannelDetails::is_usable`] value set to true, see the
30360 * documentation for [`ChannelDetails::is_usable`] for more info on exactly what the criteria
30363 MUST_USE_RES struct LDKCVec_ChannelDetailsZ ChannelManager_list_usable_channels(const struct LDKChannelManager *NONNULL_PTR this_arg);
30366 * Gets the list of channels we have with a given counterparty, in random order.
30368 MUST_USE_RES struct LDKCVec_ChannelDetailsZ ChannelManager_list_channels_with_counterparty(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKPublicKey counterparty_node_id);
30371 * Returns in an undefined order recent payments that -- if not fulfilled -- have yet to find a
30372 * successful path, or have unresolved HTLCs.
30374 * This can be useful for payments that may have been prepared, but ultimately not sent, as a
30375 * result of a crash. If such a payment exists, is not listed here, and an
30376 * [`Event::PaymentSent`] has not been received, you may consider resending the payment.
30378 * [`Event::PaymentSent`]: events::Event::PaymentSent
30380 MUST_USE_RES struct LDKCVec_RecentPaymentDetailsZ ChannelManager_list_recent_payments(const struct LDKChannelManager *NONNULL_PTR this_arg);
30383 * Begins the process of closing a channel. After this call (plus some timeout), no new HTLCs
30384 * will be accepted on the given channel, and after additional timeout/the closing of all
30385 * pending HTLCs, the channel will be closed on chain.
30387 * * If we are the channel initiator, we will pay between our [`Background`] and
30388 * [`ChannelConfig::force_close_avoidance_max_fee_satoshis`] plus our [`Normal`] fee
30390 * * If our counterparty is the channel initiator, we will require a channel closing
30391 * transaction feerate of at least our [`Background`] feerate or the feerate which
30392 * would appear on a force-closure transaction, whichever is lower. We will allow our
30393 * counterparty to pay as much fee as they'd like, however.
30395 * May generate a [`SendShutdown`] message event on success, which should be relayed.
30397 * Raises [`APIError::ChannelUnavailable`] if the channel cannot be closed due to failing to
30398 * generate a shutdown scriptpubkey or destination script set by
30399 * [`SignerProvider::get_shutdown_scriptpubkey`]. A force-closure may be needed to close the
30402 * [`ChannelConfig::force_close_avoidance_max_fee_satoshis`]: crate::util::config::ChannelConfig::force_close_avoidance_max_fee_satoshis
30403 * [`Background`]: crate::chain::chaininterface::ConfirmationTarget::Background
30404 * [`Normal`]: crate::chain::chaininterface::ConfirmationTarget::Normal
30405 * [`SendShutdown`]: crate::events::MessageSendEvent::SendShutdown
30407 MUST_USE_RES struct LDKCResult_NoneAPIErrorZ ChannelManager_close_channel(const struct LDKChannelManager *NONNULL_PTR this_arg, const uint8_t (*channel_id)[32], struct LDKPublicKey counterparty_node_id);
30410 * Begins the process of closing a channel. After this call (plus some timeout), no new HTLCs
30411 * will be accepted on the given channel, and after additional timeout/the closing of all
30412 * pending HTLCs, the channel will be closed on chain.
30414 * `target_feerate_sat_per_1000_weight` has different meanings depending on if we initiated
30415 * the channel being closed or not:
30416 * * If we are the channel initiator, we will pay at least this feerate on the closing
30417 * transaction. The upper-bound is set by
30418 * [`ChannelConfig::force_close_avoidance_max_fee_satoshis`] plus our [`Normal`] fee
30419 * estimate (or `target_feerate_sat_per_1000_weight`, if it is greater).
30420 * * If our counterparty is the channel initiator, we will refuse to accept a channel closure
30421 * transaction feerate below `target_feerate_sat_per_1000_weight` (or the feerate which
30422 * will appear on a force-closure transaction, whichever is lower).
30424 * The `shutdown_script` provided will be used as the `scriptPubKey` for the closing transaction.
30425 * Will fail if a shutdown script has already been set for this channel by
30426 * ['ChannelHandshakeConfig::commit_upfront_shutdown_pubkey`]. The given shutdown script must
30427 * also be compatible with our and the counterparty's features.
30429 * May generate a [`SendShutdown`] message event on success, which should be relayed.
30431 * Raises [`APIError::ChannelUnavailable`] if the channel cannot be closed due to failing to
30432 * generate a shutdown scriptpubkey or destination script set by
30433 * [`SignerProvider::get_shutdown_scriptpubkey`]. A force-closure may be needed to close the
30436 * [`ChannelConfig::force_close_avoidance_max_fee_satoshis`]: crate::util::config::ChannelConfig::force_close_avoidance_max_fee_satoshis
30437 * [`Background`]: crate::chain::chaininterface::ConfirmationTarget::Background
30438 * [`Normal`]: crate::chain::chaininterface::ConfirmationTarget::Normal
30439 * [`SendShutdown`]: crate::events::MessageSendEvent::SendShutdown
30441 * Note that shutdown_script (or a relevant inner pointer) may be NULL or all-0s to represent None
30443 MUST_USE_RES struct LDKCResult_NoneAPIErrorZ ChannelManager_close_channel_with_feerate_and_script(const struct LDKChannelManager *NONNULL_PTR this_arg, const uint8_t (*channel_id)[32], struct LDKPublicKey counterparty_node_id, struct LDKCOption_u32Z target_feerate_sats_per_1000_weight, struct LDKShutdownScript shutdown_script);
30446 * Force closes a channel, immediately broadcasting the latest local transaction(s) and
30447 * rejecting new HTLCs on the given channel. Fails if `channel_id` is unknown to
30448 * the manager, or if the `counterparty_node_id` isn't the counterparty of the corresponding
30451 MUST_USE_RES struct LDKCResult_NoneAPIErrorZ ChannelManager_force_close_broadcasting_latest_txn(const struct LDKChannelManager *NONNULL_PTR this_arg, const uint8_t (*channel_id)[32], struct LDKPublicKey counterparty_node_id);
30454 * Force closes a channel, rejecting new HTLCs on the given channel but skips broadcasting
30455 * the latest local transaction(s). Fails if `channel_id` is unknown to the manager, or if the
30456 * `counterparty_node_id` isn't the counterparty of the corresponding channel.
30458 * You can always get the latest local transaction(s) to broadcast from
30459 * [`ChannelMonitor::get_latest_holder_commitment_txn`].
30461 MUST_USE_RES struct LDKCResult_NoneAPIErrorZ ChannelManager_force_close_without_broadcasting_txn(const struct LDKChannelManager *NONNULL_PTR this_arg, const uint8_t (*channel_id)[32], struct LDKPublicKey counterparty_node_id);
30464 * Force close all channels, immediately broadcasting the latest local commitment transaction
30465 * for each to the chain and rejecting new HTLCs on each.
30467 void ChannelManager_force_close_all_channels_broadcasting_latest_txn(const struct LDKChannelManager *NONNULL_PTR this_arg);
30470 * Force close all channels rejecting new HTLCs on each but without broadcasting the latest
30471 * local transaction(s).
30473 void ChannelManager_force_close_all_channels_without_broadcasting_txn(const struct LDKChannelManager *NONNULL_PTR this_arg);
30476 * Sends a payment along a given route.
30478 * Value parameters are provided via the last hop in route, see documentation for [`RouteHop`]
30479 * fields for more info.
30481 * May generate [`UpdateHTLCs`] message(s) event on success, which should be relayed (e.g. via
30482 * [`PeerManager::process_events`]).
30484 * # Avoiding Duplicate Payments
30486 * If a pending payment is currently in-flight with the same [`PaymentId`] provided, this
30487 * method will error with an [`APIError::InvalidRoute`]. Note, however, that once a payment
30488 * is no longer pending (either via [`ChannelManager::abandon_payment`], or handling of an
30489 * [`Event::PaymentSent`] or [`Event::PaymentFailed`]) LDK will not stop you from sending a
30490 * second payment with the same [`PaymentId`].
30492 * Thus, in order to ensure duplicate payments are not sent, you should implement your own
30493 * tracking of payments, including state to indicate once a payment has completed. Because you
30494 * should also ensure that [`PaymentHash`]es are not re-used, for simplicity, you should
30495 * consider using the [`PaymentHash`] as the key for tracking payments. In that case, the
30496 * [`PaymentId`] should be a copy of the [`PaymentHash`] bytes.
30498 * Additionally, in the scenario where we begin the process of sending a payment, but crash
30499 * before `send_payment` returns (or prior to [`ChannelMonitorUpdate`] persistence if you're
30500 * using [`ChannelMonitorUpdateStatus::InProgress`]), the payment may be lost on restart. See
30501 * [`ChannelManager::list_recent_payments`] for more information.
30503 * # Possible Error States on [`PaymentSendFailure`]
30505 * Each path may have a different return value, and [`PaymentSendFailure`] may return a `Vec` with
30506 * each entry matching the corresponding-index entry in the route paths, see
30507 * [`PaymentSendFailure`] for more info.
30509 * In general, a path may raise:
30510 * * [`APIError::InvalidRoute`] when an invalid route or forwarding parameter (cltv_delta, fee,
30511 * node public key) is specified.
30512 * * [`APIError::ChannelUnavailable`] if the next-hop channel is not available as it has been
30513 * closed, doesn't exist, or the peer is currently disconnected.
30514 * * [`APIError::MonitorUpdateInProgress`] if a new monitor update failure prevented sending the
30515 * relevant updates.
30517 * Note that depending on the type of the [`PaymentSendFailure`] the HTLC may have been
30518 * irrevocably committed to on our end. In such a case, do NOT retry the payment with a
30519 * different route unless you intend to pay twice!
30521 * [`RouteHop`]: crate::routing::router::RouteHop
30522 * [`Event::PaymentSent`]: events::Event::PaymentSent
30523 * [`Event::PaymentFailed`]: events::Event::PaymentFailed
30524 * [`UpdateHTLCs`]: events::MessageSendEvent::UpdateHTLCs
30525 * [`PeerManager::process_events`]: crate::ln::peer_handler::PeerManager::process_events
30526 * [`ChannelMonitorUpdateStatus::InProgress`]: crate::chain::ChannelMonitorUpdateStatus::InProgress
30528 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);
30531 * Similar to [`ChannelManager::send_payment_with_route`], but will automatically find a route based on
30532 * `route_params` and retry failed payment paths based on `retry_strategy`.
30534 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);
30537 * Signals that no further attempts for the given payment should occur. Useful if you have a
30538 * pending outbound payment with retries remaining, but wish to stop retrying the payment before
30539 * retries are exhausted.
30541 * # Event Generation
30543 * If no [`Event::PaymentFailed`] event had been generated before, one will be generated as soon
30544 * as there are no remaining pending HTLCs for this payment.
30546 * Note that calling this method does *not* prevent a payment from succeeding. You must still
30547 * wait until you receive either a [`Event::PaymentFailed`] or [`Event::PaymentSent`] event to
30548 * determine the ultimate status of a payment.
30550 * # Restart Behavior
30552 * If an [`Event::PaymentFailed`] is generated and we restart without first persisting the
30553 * [`ChannelManager`], another [`Event::PaymentFailed`] may be generated.
30555 void ChannelManager_abandon_payment(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKThirtyTwoBytes payment_id);
30558 * Send a spontaneous payment, which is a payment that does not require the recipient to have
30559 * generated an invoice. Optionally, you may specify the preimage. If you do choose to specify
30560 * the preimage, it must be a cryptographically secure random value that no intermediate node
30561 * would be able to guess -- otherwise, an intermediate node may claim the payment and it will
30562 * never reach the recipient.
30564 * See [`send_payment`] documentation for more details on the return value of this function
30565 * and idempotency guarantees provided by the [`PaymentId`] key.
30567 * Similar to regular payments, you MUST NOT reuse a `payment_preimage` value. See
30568 * [`send_payment`] for more information about the risks of duplicate preimage usage.
30570 * [`send_payment`]: Self::send_payment
30572 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);
30575 * Similar to [`ChannelManager::send_spontaneous_payment`], but will automatically find a route
30576 * based on `route_params` and retry failed payment paths based on `retry_strategy`.
30578 * See [`PaymentParameters::for_keysend`] for help in constructing `route_params` for spontaneous
30581 * [`PaymentParameters::for_keysend`]: crate::routing::router::PaymentParameters::for_keysend
30583 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);
30586 * Send a payment that is probing the given route for liquidity. We calculate the
30587 * [`PaymentHash`] of probes based on a static secret and a random [`PaymentId`], which allows
30588 * us to easily discern them from real payments.
30590 MUST_USE_RES struct LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ ChannelManager_send_probe(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKPath path);
30593 * Sends payment probes over all paths of a route that would be used to pay the given
30594 * amount to the given `node_id`.
30596 * See [`ChannelManager::send_preflight_probes`] for more information.
30598 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);
30601 * Sends payment probes over all paths of a route that would be used to pay a route found
30602 * according to the given [`RouteParameters`].
30604 * This may be used to send \"pre-flight\" probes, i.e., to train our scorer before conducting
30605 * the actual payment. Note this is only useful if there likely is sufficient time for the
30606 * probe to settle before sending out the actual payment, e.g., when waiting for user
30607 * confirmation in a wallet UI.
30609 * Otherwise, there is a chance the probe could take up some liquidity needed to complete the
30610 * actual payment. Users should therefore be cautious and might avoid sending probes if
30611 * liquidity is scarce and/or they don't expect the probe to return before they send the
30612 * payment. To mitigate this issue, channels with available liquidity less than the required
30613 * amount times the given `liquidity_limit_multiplier` won't be used to send pre-flight
30614 * probes. If `None` is given as `liquidity_limit_multiplier`, it defaults to `3`.
30616 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);
30619 * Call this upon creation of a funding transaction for the given channel.
30621 * Returns an [`APIError::APIMisuseError`] if the funding_transaction spent non-SegWit outputs
30622 * or if no output was found which matches the parameters in [`Event::FundingGenerationReady`].
30624 * Returns [`APIError::APIMisuseError`] if the funding transaction is not final for propagation
30625 * across the p2p network.
30627 * Returns [`APIError::ChannelUnavailable`] if a funding transaction has already been provided
30628 * for the channel or if the channel has been closed as indicated by [`Event::ChannelClosed`].
30630 * May panic if the output found in the funding transaction is duplicative with some other
30631 * channel (note that this should be trivially prevented by using unique funding transaction
30632 * keys per-channel).
30634 * Do NOT broadcast the funding transaction yourself. When we have safely received our
30635 * counterparty's signature the funding transaction will automatically be broadcast via the
30636 * [`BroadcasterInterface`] provided when this `ChannelManager` was constructed.
30638 * Note that this includes RBF or similar transaction replacement strategies - lightning does
30639 * not currently support replacing a funding transaction on an existing channel. Instead,
30640 * create a new channel with a conflicting funding transaction.
30642 * Note to keep the miner incentives aligned in moving the blockchain forward, we recommend
30643 * the wallet software generating the funding transaction to apply anti-fee sniping as
30644 * implemented by Bitcoin Core wallet. See <https://bitcoinops.org/en/topics/fee-sniping/>
30645 * for more details.
30647 * [`Event::FundingGenerationReady`]: crate::events::Event::FundingGenerationReady
30648 * [`Event::ChannelClosed`]: crate::events::Event::ChannelClosed
30650 MUST_USE_RES struct LDKCResult_NoneAPIErrorZ ChannelManager_funding_transaction_generated(const struct LDKChannelManager *NONNULL_PTR this_arg, const uint8_t (*temporary_channel_id)[32], struct LDKPublicKey counterparty_node_id, struct LDKTransaction funding_transaction);
30653 * Call this upon creation of a batch funding transaction for the given channels.
30655 * Return values are identical to [`Self::funding_transaction_generated`], respective to
30656 * each individual channel and transaction output.
30658 * Do NOT broadcast the funding transaction yourself. This batch funding transcaction
30659 * will only be broadcast when we have safely received and persisted the counterparty's
30660 * signature for each channel.
30662 * If there is an error, all channels in the batch are to be considered closed.
30664 MUST_USE_RES struct LDKCResult_NoneAPIErrorZ ChannelManager_batch_funding_transaction_generated(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKCVec_C2Tuple_ThirtyTwoBytesPublicKeyZZ temporary_channels, struct LDKTransaction funding_transaction);
30667 * Atomically applies partial updates to the [`ChannelConfig`] of the given channels.
30669 * Once the updates are applied, each eligible channel (advertised with a known short channel
30670 * ID and a change in [`forwarding_fee_proportional_millionths`], [`forwarding_fee_base_msat`],
30671 * or [`cltv_expiry_delta`]) has a [`BroadcastChannelUpdate`] event message generated
30672 * containing the new [`ChannelUpdate`] message which should be broadcast to the network.
30674 * Returns [`ChannelUnavailable`] when a channel is not found or an incorrect
30675 * `counterparty_node_id` is provided.
30677 * Returns [`APIMisuseError`] when a [`cltv_expiry_delta`] update is to be applied with a value
30678 * below [`MIN_CLTV_EXPIRY_DELTA`].
30680 * If an error is returned, none of the updates should be considered applied.
30682 * [`forwarding_fee_proportional_millionths`]: ChannelConfig::forwarding_fee_proportional_millionths
30683 * [`forwarding_fee_base_msat`]: ChannelConfig::forwarding_fee_base_msat
30684 * [`cltv_expiry_delta`]: ChannelConfig::cltv_expiry_delta
30685 * [`BroadcastChannelUpdate`]: events::MessageSendEvent::BroadcastChannelUpdate
30686 * [`ChannelUpdate`]: msgs::ChannelUpdate
30687 * [`ChannelUnavailable`]: APIError::ChannelUnavailable
30688 * [`APIMisuseError`]: APIError::APIMisuseError
30690 MUST_USE_RES struct LDKCResult_NoneAPIErrorZ ChannelManager_update_partial_channel_config(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKPublicKey counterparty_node_id, struct LDKCVec_ThirtyTwoBytesZ channel_ids, const struct LDKChannelConfigUpdate *NONNULL_PTR config_update);
30693 * Atomically updates the [`ChannelConfig`] for the given channels.
30695 * Once the updates are applied, each eligible channel (advertised with a known short channel
30696 * ID and a change in [`forwarding_fee_proportional_millionths`], [`forwarding_fee_base_msat`],
30697 * or [`cltv_expiry_delta`]) has a [`BroadcastChannelUpdate`] event message generated
30698 * containing the new [`ChannelUpdate`] message which should be broadcast to the network.
30700 * Returns [`ChannelUnavailable`] when a channel is not found or an incorrect
30701 * `counterparty_node_id` is provided.
30703 * Returns [`APIMisuseError`] when a [`cltv_expiry_delta`] update is to be applied with a value
30704 * below [`MIN_CLTV_EXPIRY_DELTA`].
30706 * If an error is returned, none of the updates should be considered applied.
30708 * [`forwarding_fee_proportional_millionths`]: ChannelConfig::forwarding_fee_proportional_millionths
30709 * [`forwarding_fee_base_msat`]: ChannelConfig::forwarding_fee_base_msat
30710 * [`cltv_expiry_delta`]: ChannelConfig::cltv_expiry_delta
30711 * [`BroadcastChannelUpdate`]: events::MessageSendEvent::BroadcastChannelUpdate
30712 * [`ChannelUpdate`]: msgs::ChannelUpdate
30713 * [`ChannelUnavailable`]: APIError::ChannelUnavailable
30714 * [`APIMisuseError`]: APIError::APIMisuseError
30716 MUST_USE_RES struct LDKCResult_NoneAPIErrorZ ChannelManager_update_channel_config(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKPublicKey counterparty_node_id, struct LDKCVec_ThirtyTwoBytesZ channel_ids, const struct LDKChannelConfig *NONNULL_PTR config);
30719 * Attempts to forward an intercepted HTLC over the provided channel id and with the provided
30720 * amount to forward. Should only be called in response to an [`HTLCIntercepted`] event.
30722 * Intercepted HTLCs can be useful for Lightning Service Providers (LSPs) to open a just-in-time
30723 * channel to a receiving node if the node lacks sufficient inbound liquidity.
30725 * To make use of intercepted HTLCs, set [`UserConfig::accept_intercept_htlcs`] and use
30726 * [`ChannelManager::get_intercept_scid`] to generate short channel id(s) to put in the
30727 * receiver's invoice route hints. These route hints will signal to LDK to generate an
30728 * [`HTLCIntercepted`] event when it receives the forwarded HTLC, and this method or
30729 * [`ChannelManager::fail_intercepted_htlc`] MUST be called in response to the event.
30731 * Note that LDK does not enforce fee requirements in `amt_to_forward_msat`, and will not stop
30732 * you from forwarding more than you received. See
30733 * [`HTLCIntercepted::expected_outbound_amount_msat`] for more on forwarding a different amount
30736 * Errors if the event was not handled in time, in which case the HTLC was automatically failed
30739 * [`UserConfig::accept_intercept_htlcs`]: crate::util::config::UserConfig::accept_intercept_htlcs
30740 * [`HTLCIntercepted`]: events::Event::HTLCIntercepted
30741 * [`HTLCIntercepted::expected_outbound_amount_msat`]: events::Event::HTLCIntercepted::expected_outbound_amount_msat
30743 MUST_USE_RES struct LDKCResult_NoneAPIErrorZ ChannelManager_forward_intercepted_htlc(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKThirtyTwoBytes intercept_id, const uint8_t (*next_hop_channel_id)[32], struct LDKPublicKey next_node_id, uint64_t amt_to_forward_msat);
30746 * Fails the intercepted HTLC indicated by intercept_id. Should only be called in response to
30747 * an [`HTLCIntercepted`] event. See [`ChannelManager::forward_intercepted_htlc`].
30749 * Errors if the event was not handled in time, in which case the HTLC was automatically failed
30752 * [`HTLCIntercepted`]: events::Event::HTLCIntercepted
30754 MUST_USE_RES struct LDKCResult_NoneAPIErrorZ ChannelManager_fail_intercepted_htlc(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKThirtyTwoBytes intercept_id);
30757 * Processes HTLCs which are pending waiting on random forward delay.
30759 * Should only really ever be called in response to a PendingHTLCsForwardable event.
30760 * Will likely generate further events.
30762 void ChannelManager_process_pending_htlc_forwards(const struct LDKChannelManager *NONNULL_PTR this_arg);
30765 * Performs actions which should happen on startup and roughly once per minute thereafter.
30767 * This currently includes:
30768 * * Increasing or decreasing the on-chain feerate estimates for our outbound channels,
30769 * * Broadcasting [`ChannelUpdate`] messages if we've been disconnected from our peer for more
30770 * than a minute, informing the network that they should no longer attempt to route over
30772 * * Expiring a channel's previous [`ChannelConfig`] if necessary to only allow forwarding HTLCs
30773 * with the current [`ChannelConfig`].
30774 * * Removing peers which have disconnected but and no longer have any channels.
30775 * * Force-closing and removing channels which have not completed establishment in a timely manner.
30777 * Note that this may cause reentrancy through [`chain::Watch::update_channel`] calls or feerate
30778 * estimate fetches.
30780 * [`ChannelUpdate`]: msgs::ChannelUpdate
30781 * [`ChannelConfig`]: crate::util::config::ChannelConfig
30783 void ChannelManager_timer_tick_occurred(const struct LDKChannelManager *NONNULL_PTR this_arg);
30786 * Indicates that the preimage for payment_hash is unknown or the received amount is incorrect
30787 * after a PaymentClaimable event, failing the HTLC back to its origin and freeing resources
30788 * along the path (including in our own channel on which we received it).
30790 * Note that in some cases around unclean shutdown, it is possible the payment may have
30791 * already been claimed by you via [`ChannelManager::claim_funds`] prior to you seeing (a
30792 * second copy of) the [`events::Event::PaymentClaimable`] event. Alternatively, the payment
30793 * may have already been failed automatically by LDK if it was nearing its expiration time.
30795 * While LDK will never claim a payment automatically on your behalf (i.e. without you calling
30796 * [`ChannelManager::claim_funds`]), you should still monitor for
30797 * [`events::Event::PaymentClaimed`] events even for payments you intend to fail, especially on
30798 * startup during which time claims that were in-progress at shutdown may be replayed.
30800 void ChannelManager_fail_htlc_backwards(const struct LDKChannelManager *NONNULL_PTR this_arg, const uint8_t (*payment_hash)[32]);
30803 * This is a variant of [`ChannelManager::fail_htlc_backwards`] that allows you to specify the
30804 * reason for the failure.
30806 * See [`FailureCode`] for valid failure codes.
30808 void ChannelManager_fail_htlc_backwards_with_reason(const struct LDKChannelManager *NONNULL_PTR this_arg, const uint8_t (*payment_hash)[32], struct LDKFailureCode failure_code);
30811 * Provides a payment preimage in response to [`Event::PaymentClaimable`], generating any
30812 * [`MessageSendEvent`]s needed to claim the payment.
30814 * This method is guaranteed to ensure the payment has been claimed but only if the current
30815 * height is strictly below [`Event::PaymentClaimable::claim_deadline`]. To avoid race
30816 * conditions, you should wait for an [`Event::PaymentClaimed`] before considering the payment
30817 * successful. It will generally be available in the next [`process_pending_events`] call.
30819 * Note that if you did not set an `amount_msat` when calling [`create_inbound_payment`] or
30820 * [`create_inbound_payment_for_hash`] you must check that the amount in the `PaymentClaimable`
30821 * event matches your expectation. If you fail to do so and call this method, you may provide
30822 * the sender \"proof-of-payment\" when they did not fulfill the full expected payment.
30824 * This function will fail the payment if it has custom TLVs with even type numbers, as we
30825 * will assume they are unknown. If you intend to accept even custom TLVs, you should use
30826 * [`claim_funds_with_known_custom_tlvs`].
30828 * [`Event::PaymentClaimable`]: crate::events::Event::PaymentClaimable
30829 * [`Event::PaymentClaimable::claim_deadline`]: crate::events::Event::PaymentClaimable::claim_deadline
30830 * [`Event::PaymentClaimed`]: crate::events::Event::PaymentClaimed
30831 * [`process_pending_events`]: EventsProvider::process_pending_events
30832 * [`create_inbound_payment`]: Self::create_inbound_payment
30833 * [`create_inbound_payment_for_hash`]: Self::create_inbound_payment_for_hash
30834 * [`claim_funds_with_known_custom_tlvs`]: Self::claim_funds_with_known_custom_tlvs
30836 void ChannelManager_claim_funds(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKThirtyTwoBytes payment_preimage);
30839 * This is a variant of [`claim_funds`] that allows accepting a payment with custom TLVs with
30840 * even type numbers.
30844 * You MUST check you've understood all even TLVs before using this to
30845 * claim, otherwise you may unintentionally agree to some protocol you do not understand.
30847 * [`claim_funds`]: Self::claim_funds
30849 void ChannelManager_claim_funds_with_known_custom_tlvs(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKThirtyTwoBytes payment_preimage);
30852 * Gets the node_id held by this ChannelManager
30854 MUST_USE_RES struct LDKPublicKey ChannelManager_get_our_node_id(const struct LDKChannelManager *NONNULL_PTR this_arg);
30857 * Accepts a request to open a channel after a [`Event::OpenChannelRequest`].
30859 * The `temporary_channel_id` parameter indicates which inbound channel should be accepted,
30860 * and the `counterparty_node_id` parameter is the id of the peer which has requested to open
30863 * The `user_channel_id` parameter will be provided back in
30864 * [`Event::ChannelClosed::user_channel_id`] to allow tracking of which events correspond
30865 * with which `accept_inbound_channel`/`accept_inbound_channel_from_trusted_peer_0conf` call.
30867 * Note that this method will return an error and reject the channel, if it requires support
30868 * for zero confirmations. Instead, `accept_inbound_channel_from_trusted_peer_0conf` must be
30869 * used to accept such channels.
30871 * [`Event::OpenChannelRequest`]: events::Event::OpenChannelRequest
30872 * [`Event::ChannelClosed::user_channel_id`]: events::Event::ChannelClosed::user_channel_id
30874 MUST_USE_RES struct LDKCResult_NoneAPIErrorZ ChannelManager_accept_inbound_channel(const struct LDKChannelManager *NONNULL_PTR this_arg, const uint8_t (*temporary_channel_id)[32], struct LDKPublicKey counterparty_node_id, struct LDKU128 user_channel_id);
30877 * Accepts a request to open a channel after a [`events::Event::OpenChannelRequest`], treating
30878 * it as confirmed immediately.
30880 * The `user_channel_id` parameter will be provided back in
30881 * [`Event::ChannelClosed::user_channel_id`] to allow tracking of which events correspond
30882 * with which `accept_inbound_channel`/`accept_inbound_channel_from_trusted_peer_0conf` call.
30884 * Unlike [`ChannelManager::accept_inbound_channel`], this method accepts the incoming channel
30885 * and (if the counterparty agrees), enables forwarding of payments immediately.
30887 * This fully trusts that the counterparty has honestly and correctly constructed the funding
30888 * transaction and blindly assumes that it will eventually confirm.
30890 * If it does not confirm before we decide to close the channel, or if the funding transaction
30891 * does not pay to the correct script the correct amount, *you will lose funds*.
30893 * [`Event::OpenChannelRequest`]: events::Event::OpenChannelRequest
30894 * [`Event::ChannelClosed::user_channel_id`]: events::Event::ChannelClosed::user_channel_id
30896 MUST_USE_RES struct LDKCResult_NoneAPIErrorZ ChannelManager_accept_inbound_channel_from_trusted_peer_0conf(const struct LDKChannelManager *NONNULL_PTR this_arg, const uint8_t (*temporary_channel_id)[32], struct LDKPublicKey counterparty_node_id, struct LDKU128 user_channel_id);
30899 * Gets a payment secret and payment hash for use in an invoice given to a third party wishing
30902 * This differs from [`create_inbound_payment_for_hash`] only in that it generates the
30903 * [`PaymentHash`] and [`PaymentPreimage`] for you.
30905 * The [`PaymentPreimage`] will ultimately be returned to you in the [`PaymentClaimable`], which
30906 * will have the [`PaymentClaimable::purpose`] be [`PaymentPurpose::InvoicePayment`] with
30907 * its [`PaymentPurpose::InvoicePayment::payment_preimage`] field filled in. That should then be
30908 * passed directly to [`claim_funds`].
30910 * See [`create_inbound_payment_for_hash`] for detailed documentation on behavior and requirements.
30912 * Note that a malicious eavesdropper can intuit whether an inbound payment was created by
30913 * `create_inbound_payment` or `create_inbound_payment_for_hash` based on runtime.
30917 * If you register an inbound payment with this method, then serialize the `ChannelManager`, then
30918 * deserialize it with a node running 0.0.103 and earlier, the payment will fail to be received.
30920 * Errors if `min_value_msat` is greater than total bitcoin supply.
30922 * If `min_final_cltv_expiry_delta` is set to some value, then the payment will not be receivable
30923 * on versions of LDK prior to 0.0.114.
30925 * [`claim_funds`]: Self::claim_funds
30926 * [`PaymentClaimable`]: events::Event::PaymentClaimable
30927 * [`PaymentClaimable::purpose`]: events::Event::PaymentClaimable::purpose
30928 * [`PaymentPurpose::InvoicePayment`]: events::PaymentPurpose::InvoicePayment
30929 * [`PaymentPurpose::InvoicePayment::payment_preimage`]: events::PaymentPurpose::InvoicePayment::payment_preimage
30930 * [`create_inbound_payment_for_hash`]: Self::create_inbound_payment_for_hash
30932 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);
30935 * Gets a [`PaymentSecret`] for a given [`PaymentHash`], for which the payment preimage is
30936 * stored external to LDK.
30938 * A [`PaymentClaimable`] event will only be generated if the [`PaymentSecret`] matches a
30939 * payment secret fetched via this method or [`create_inbound_payment`], and which is at least
30940 * the `min_value_msat` provided here, if one is provided.
30942 * The [`PaymentHash`] (and corresponding [`PaymentPreimage`]) should be globally unique, though
30943 * note that LDK will not stop you from registering duplicate payment hashes for inbound
30946 * `min_value_msat` should be set if the invoice being generated contains a value. Any payment
30947 * received for the returned [`PaymentHash`] will be required to be at least `min_value_msat`
30948 * before a [`PaymentClaimable`] event will be generated, ensuring that we do not provide the
30949 * sender \"proof-of-payment\" unless they have paid the required amount.
30951 * `invoice_expiry_delta_secs` describes the number of seconds that the invoice is valid for
30952 * in excess of the current time. This should roughly match the expiry time set in the invoice.
30953 * After this many seconds, we will remove the inbound payment, resulting in any attempts to
30954 * pay the invoice failing. The BOLT spec suggests 3,600 secs as a default validity time for
30955 * invoices when no timeout is set.
30957 * Note that we use block header time to time-out pending inbound payments (with some margin
30958 * to compensate for the inaccuracy of block header timestamps). Thus, in practice we will
30959 * accept a payment and generate a [`PaymentClaimable`] event for some time after the expiry.
30960 * If you need exact expiry semantics, you should enforce them upon receipt of
30961 * [`PaymentClaimable`].
30963 * Note that invoices generated for inbound payments should have their `min_final_cltv_expiry_delta`
30964 * set to at least [`MIN_FINAL_CLTV_EXPIRY_DELTA`].
30966 * Note that a malicious eavesdropper can intuit whether an inbound payment was created by
30967 * `create_inbound_payment` or `create_inbound_payment_for_hash` based on runtime.
30971 * If you register an inbound payment with this method, then serialize the `ChannelManager`, then
30972 * deserialize it with a node running 0.0.103 and earlier, the payment will fail to be received.
30974 * Errors if `min_value_msat` is greater than total bitcoin supply.
30976 * If `min_final_cltv_expiry_delta` is set to some value, then the payment will not be receivable
30977 * on versions of LDK prior to 0.0.114.
30979 * [`create_inbound_payment`]: Self::create_inbound_payment
30980 * [`PaymentClaimable`]: events::Event::PaymentClaimable
30982 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);
30985 * Gets an LDK-generated payment preimage from a payment hash and payment secret that were
30986 * previously returned from [`create_inbound_payment`].
30988 * [`create_inbound_payment`]: Self::create_inbound_payment
30990 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);
30993 * Gets a fake short channel id for use in receiving [phantom node payments]. These fake scids
30994 * are used when constructing the phantom invoice's route hints.
30996 * [phantom node payments]: crate::sign::PhantomKeysManager
30998 MUST_USE_RES uint64_t ChannelManager_get_phantom_scid(const struct LDKChannelManager *NONNULL_PTR this_arg);
31001 * Gets route hints for use in receiving [phantom node payments].
31003 * [phantom node payments]: crate::sign::PhantomKeysManager
31005 MUST_USE_RES struct LDKPhantomRouteHints ChannelManager_get_phantom_route_hints(const struct LDKChannelManager *NONNULL_PTR this_arg);
31008 * Gets a fake short channel id for use in receiving intercepted payments. These fake scids are
31009 * used when constructing the route hints for HTLCs intended to be intercepted. See
31010 * [`ChannelManager::forward_intercepted_htlc`].
31012 * Note that this method is not guaranteed to return unique values, you may need to call it a few
31013 * times to get a unique scid.
31015 MUST_USE_RES uint64_t ChannelManager_get_intercept_scid(const struct LDKChannelManager *NONNULL_PTR this_arg);
31018 * Gets inflight HTLC information by processing pending outbound payments that are in
31019 * our channels. May be used during pathfinding to account for in-use channel liquidity.
31021 MUST_USE_RES struct LDKInFlightHtlcs ChannelManager_compute_inflight_htlcs(const struct LDKChannelManager *NONNULL_PTR this_arg);
31024 * Constructs a new MessageSendEventsProvider which calls the relevant methods on this_arg.
31025 * This copies the `inner` pointer in this_arg and thus the returned MessageSendEventsProvider must be freed before this_arg is
31027 struct LDKMessageSendEventsProvider ChannelManager_as_MessageSendEventsProvider(const struct LDKChannelManager *NONNULL_PTR this_arg);
31030 * Constructs a new EventsProvider which calls the relevant methods on this_arg.
31031 * This copies the `inner` pointer in this_arg and thus the returned EventsProvider must be freed before this_arg is
31033 struct LDKEventsProvider ChannelManager_as_EventsProvider(const struct LDKChannelManager *NONNULL_PTR this_arg);
31036 * Constructs a new Listen which calls the relevant methods on this_arg.
31037 * This copies the `inner` pointer in this_arg and thus the returned Listen must be freed before this_arg is
31039 struct LDKListen ChannelManager_as_Listen(const struct LDKChannelManager *NONNULL_PTR this_arg);
31042 * Constructs a new Confirm which calls the relevant methods on this_arg.
31043 * This copies the `inner` pointer in this_arg and thus the returned Confirm must be freed before this_arg is
31045 struct LDKConfirm ChannelManager_as_Confirm(const struct LDKChannelManager *NONNULL_PTR this_arg);
31048 * Gets a [`Future`] that completes when this [`ChannelManager`] may need to be persisted or
31049 * may have events that need processing.
31051 * In order to check if this [`ChannelManager`] needs persisting, call
31052 * [`Self::get_and_clear_needs_persistence`].
31054 * Note that callbacks registered on the [`Future`] MUST NOT call back into this
31055 * [`ChannelManager`] and should instead register actions to be taken later.
31057 MUST_USE_RES struct LDKFuture ChannelManager_get_event_or_persistence_needed_future(const struct LDKChannelManager *NONNULL_PTR this_arg);
31060 * Returns true if this [`ChannelManager`] needs to be persisted.
31062 MUST_USE_RES bool ChannelManager_get_and_clear_needs_persistence(const struct LDKChannelManager *NONNULL_PTR this_arg);
31065 * Gets the latest best block which was connected either via the [`chain::Listen`] or
31066 * [`chain::Confirm`] interfaces.
31068 MUST_USE_RES struct LDKBestBlock ChannelManager_current_best_block(const struct LDKChannelManager *NONNULL_PTR this_arg);
31071 * Fetches the set of [`NodeFeatures`] flags which are provided by or required by
31072 * [`ChannelManager`].
31074 MUST_USE_RES struct LDKNodeFeatures ChannelManager_node_features(const struct LDKChannelManager *NONNULL_PTR this_arg);
31077 * Fetches the set of [`ChannelFeatures`] flags which are provided by or required by
31078 * [`ChannelManager`].
31080 MUST_USE_RES struct LDKChannelFeatures ChannelManager_channel_features(const struct LDKChannelManager *NONNULL_PTR this_arg);
31083 * Fetches the set of [`ChannelTypeFeatures`] flags which are provided by or required by
31084 * [`ChannelManager`].
31086 MUST_USE_RES struct LDKChannelTypeFeatures ChannelManager_channel_type_features(const struct LDKChannelManager *NONNULL_PTR this_arg);
31089 * Fetches the set of [`InitFeatures`] flags which are provided by or required by
31090 * [`ChannelManager`].
31092 MUST_USE_RES struct LDKInitFeatures ChannelManager_init_features(const struct LDKChannelManager *NONNULL_PTR this_arg);
31095 * Constructs a new ChannelMessageHandler which calls the relevant methods on this_arg.
31096 * This copies the `inner` pointer in this_arg and thus the returned ChannelMessageHandler must be freed before this_arg is
31098 struct LDKChannelMessageHandler ChannelManager_as_ChannelMessageHandler(const struct LDKChannelManager *NONNULL_PTR this_arg);
31101 * Fetches the set of [`InitFeatures`] flags which are provided by or required by
31102 * [`ChannelManager`].
31104 struct LDKInitFeatures provided_init_features(const struct LDKUserConfig *NONNULL_PTR config);
31107 * Serialize the CounterpartyForwardingInfo object into a byte array which can be read by CounterpartyForwardingInfo_read
31109 struct LDKCVec_u8Z CounterpartyForwardingInfo_write(const struct LDKCounterpartyForwardingInfo *NONNULL_PTR obj);
31112 * Read a CounterpartyForwardingInfo from a byte array, created by CounterpartyForwardingInfo_write
31114 struct LDKCResult_CounterpartyForwardingInfoDecodeErrorZ CounterpartyForwardingInfo_read(struct LDKu8slice ser);
31117 * Serialize the ChannelCounterparty object into a byte array which can be read by ChannelCounterparty_read
31119 struct LDKCVec_u8Z ChannelCounterparty_write(const struct LDKChannelCounterparty *NONNULL_PTR obj);
31122 * Read a ChannelCounterparty from a byte array, created by ChannelCounterparty_write
31124 struct LDKCResult_ChannelCounterpartyDecodeErrorZ ChannelCounterparty_read(struct LDKu8slice ser);
31127 * Serialize the ChannelDetails object into a byte array which can be read by ChannelDetails_read
31129 struct LDKCVec_u8Z ChannelDetails_write(const struct LDKChannelDetails *NONNULL_PTR obj);
31132 * Read a ChannelDetails from a byte array, created by ChannelDetails_write
31134 struct LDKCResult_ChannelDetailsDecodeErrorZ ChannelDetails_read(struct LDKu8slice ser);
31137 * Serialize the PhantomRouteHints object into a byte array which can be read by PhantomRouteHints_read
31139 struct LDKCVec_u8Z PhantomRouteHints_write(const struct LDKPhantomRouteHints *NONNULL_PTR obj);
31142 * Read a PhantomRouteHints from a byte array, created by PhantomRouteHints_write
31144 struct LDKCResult_PhantomRouteHintsDecodeErrorZ PhantomRouteHints_read(struct LDKu8slice ser);
31147 * Serialize the ChannelManager object into a byte array which can be read by ChannelManager_read
31149 struct LDKCVec_u8Z ChannelManager_write(const struct LDKChannelManager *NONNULL_PTR obj);
31152 * Serialize the ChannelShutdownState object into a byte array which can be read by ChannelShutdownState_read
31154 struct LDKCVec_u8Z ChannelShutdownState_write(const enum LDKChannelShutdownState *NONNULL_PTR obj);
31157 * Read a ChannelShutdownState from a byte array, created by ChannelShutdownState_write
31159 struct LDKCResult_ChannelShutdownStateDecodeErrorZ ChannelShutdownState_read(struct LDKu8slice ser);
31162 * Frees any resources used by the ChannelManagerReadArgs, if is_owned is set and inner is non-NULL.
31164 void ChannelManagerReadArgs_free(struct LDKChannelManagerReadArgs this_obj);
31167 * A cryptographically secure source of entropy.
31169 const struct LDKEntropySource *ChannelManagerReadArgs_get_entropy_source(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
31172 * A cryptographically secure source of entropy.
31174 void ChannelManagerReadArgs_set_entropy_source(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKEntropySource val);
31177 * A signer that is able to perform node-scoped cryptographic operations.
31179 const struct LDKNodeSigner *ChannelManagerReadArgs_get_node_signer(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
31182 * A signer that is able to perform node-scoped cryptographic operations.
31184 void ChannelManagerReadArgs_set_node_signer(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKNodeSigner val);
31187 * The keys provider which will give us relevant keys. Some keys will be loaded during
31188 * deserialization and KeysInterface::read_chan_signer will be used to read per-Channel
31191 const struct LDKSignerProvider *ChannelManagerReadArgs_get_signer_provider(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
31194 * The keys provider which will give us relevant keys. Some keys will be loaded during
31195 * deserialization and KeysInterface::read_chan_signer will be used to read per-Channel
31198 void ChannelManagerReadArgs_set_signer_provider(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKSignerProvider val);
31201 * The fee_estimator for use in the ChannelManager in the future.
31203 * No calls to the FeeEstimator will be made during deserialization.
31205 const struct LDKFeeEstimator *ChannelManagerReadArgs_get_fee_estimator(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
31208 * The fee_estimator for use in the ChannelManager in the future.
31210 * No calls to the FeeEstimator will be made during deserialization.
31212 void ChannelManagerReadArgs_set_fee_estimator(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKFeeEstimator val);
31215 * The chain::Watch for use in the ChannelManager in the future.
31217 * No calls to the chain::Watch will be made during deserialization. It is assumed that
31218 * you have deserialized ChannelMonitors separately and will add them to your
31219 * chain::Watch after deserializing this ChannelManager.
31221 const struct LDKWatch *ChannelManagerReadArgs_get_chain_monitor(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
31224 * The chain::Watch for use in the ChannelManager in the future.
31226 * No calls to the chain::Watch will be made during deserialization. It is assumed that
31227 * you have deserialized ChannelMonitors separately and will add them to your
31228 * chain::Watch after deserializing this ChannelManager.
31230 void ChannelManagerReadArgs_set_chain_monitor(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKWatch val);
31233 * The BroadcasterInterface which will be used in the ChannelManager in the future and may be
31234 * used to broadcast the latest local commitment transactions of channels which must be
31235 * force-closed during deserialization.
31237 const struct LDKBroadcasterInterface *ChannelManagerReadArgs_get_tx_broadcaster(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
31240 * The BroadcasterInterface which will be used in the ChannelManager in the future and may be
31241 * used to broadcast the latest local commitment transactions of channels which must be
31242 * force-closed during deserialization.
31244 void ChannelManagerReadArgs_set_tx_broadcaster(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKBroadcasterInterface val);
31247 * The router which will be used in the ChannelManager in the future for finding routes
31248 * on-the-fly for trampoline payments. Absent in private nodes that don't support forwarding.
31250 * No calls to the router will be made during deserialization.
31252 const struct LDKRouter *ChannelManagerReadArgs_get_router(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
31255 * The router which will be used in the ChannelManager in the future for finding routes
31256 * on-the-fly for trampoline payments. Absent in private nodes that don't support forwarding.
31258 * No calls to the router will be made during deserialization.
31260 void ChannelManagerReadArgs_set_router(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKRouter val);
31263 * The Logger for use in the ChannelManager and which may be used to log information during
31266 const struct LDKLogger *ChannelManagerReadArgs_get_logger(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
31269 * The Logger for use in the ChannelManager and which may be used to log information during
31272 void ChannelManagerReadArgs_set_logger(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKLogger val);
31275 * Default settings used for new channels. Any existing channels will continue to use the
31276 * runtime settings which were stored when the ChannelManager was serialized.
31278 struct LDKUserConfig ChannelManagerReadArgs_get_default_config(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
31281 * Default settings used for new channels. Any existing channels will continue to use the
31282 * runtime settings which were stored when the ChannelManager was serialized.
31284 void ChannelManagerReadArgs_set_default_config(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKUserConfig val);
31287 * Simple utility function to create a ChannelManagerReadArgs which creates the monitor
31288 * HashMap for you. This is primarily useful for C bindings where it is not practical to
31289 * populate a HashMap directly from C.
31291 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);
31294 * Read a C2Tuple_ThirtyTwoBytesChannelManagerZ from a byte array, created by C2Tuple_ThirtyTwoBytesChannelManagerZ_write
31296 struct LDKCResult_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ C2Tuple_ThirtyTwoBytesChannelManagerZ_read(struct LDKu8slice ser, struct LDKChannelManagerReadArgs arg);
31299 * Frees any resources used by the ExpandedKey, if is_owned is set and inner is non-NULL.
31301 void ExpandedKey_free(struct LDKExpandedKey this_obj);
31304 * Create a new [`ExpandedKey`] for generating an inbound payment hash and secret.
31306 * It is recommended to cache this value and not regenerate it for each new inbound payment.
31308 MUST_USE_RES struct LDKExpandedKey ExpandedKey_new(const uint8_t (*key_material)[32]);
31311 * Equivalent to [`crate::ln::channelmanager::ChannelManager::create_inbound_payment`], but no
31312 * `ChannelManager` is required. Useful for generating invoices for [phantom node payments] without
31313 * a `ChannelManager`.
31315 * `keys` is generated by calling [`NodeSigner::get_inbound_payment_key_material`] and then
31316 * calling [`ExpandedKey::new`] with its result. It is recommended to cache this value and not
31317 * regenerate it for each new inbound payment.
31319 * `current_time` is a Unix timestamp representing the current time.
31321 * Note that if `min_final_cltv_expiry_delta` is set to some value, then the payment will not be receivable
31322 * on versions of LDK prior to 0.0.114.
31324 * [phantom node payments]: crate::sign::PhantomKeysManager
31325 * [`NodeSigner::get_inbound_payment_key_material`]: crate::sign::NodeSigner::get_inbound_payment_key_material
31327 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);
31330 * Equivalent to [`crate::ln::channelmanager::ChannelManager::create_inbound_payment_for_hash`],
31331 * but no `ChannelManager` is required. Useful for generating invoices for [phantom node payments]
31332 * without a `ChannelManager`.
31334 * See [`create`] for information on the `keys` and `current_time` parameters.
31336 * Note that if `min_final_cltv_expiry_delta` is set to some value, then the payment will not be receivable
31337 * on versions of LDK prior to 0.0.114.
31339 * [phantom node payments]: crate::sign::PhantomKeysManager
31341 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);
31344 * Frees any resources used by the DecodeError
31346 void DecodeError_free(struct LDKDecodeError this_ptr);
31349 * Creates a copy of the DecodeError
31351 struct LDKDecodeError DecodeError_clone(const struct LDKDecodeError *NONNULL_PTR orig);
31354 * Utility method to constructs a new UnknownVersion-variant DecodeError
31356 struct LDKDecodeError DecodeError_unknown_version(void);
31359 * Utility method to constructs a new UnknownRequiredFeature-variant DecodeError
31361 struct LDKDecodeError DecodeError_unknown_required_feature(void);
31364 * Utility method to constructs a new InvalidValue-variant DecodeError
31366 struct LDKDecodeError DecodeError_invalid_value(void);
31369 * Utility method to constructs a new ShortRead-variant DecodeError
31371 struct LDKDecodeError DecodeError_short_read(void);
31374 * Utility method to constructs a new BadLengthDescriptor-variant DecodeError
31376 struct LDKDecodeError DecodeError_bad_length_descriptor(void);
31379 * Utility method to constructs a new Io-variant DecodeError
31381 struct LDKDecodeError DecodeError_io(enum LDKIOError a);
31384 * Utility method to constructs a new UnsupportedCompression-variant DecodeError
31386 struct LDKDecodeError DecodeError_unsupported_compression(void);
31389 * Checks if two DecodeErrors contain equal inner contents.
31390 * This ignores pointers and is_owned flags and looks at the values in fields.
31392 bool DecodeError_eq(const struct LDKDecodeError *NONNULL_PTR a, const struct LDKDecodeError *NONNULL_PTR b);
31395 * Frees any resources used by the Init, if is_owned is set and inner is non-NULL.
31397 void Init_free(struct LDKInit this_obj);
31400 * The relevant features which the sender supports.
31402 struct LDKInitFeatures Init_get_features(const struct LDKInit *NONNULL_PTR this_ptr);
31405 * The relevant features which the sender supports.
31407 void Init_set_features(struct LDKInit *NONNULL_PTR this_ptr, struct LDKInitFeatures val);
31410 * Indicates chains the sender is interested in.
31412 * If there are no common chains, the connection will be closed.
31414 * Returns a copy of the field.
31416 struct LDKCOption_CVec_ThirtyTwoBytesZZ Init_get_networks(const struct LDKInit *NONNULL_PTR this_ptr);
31419 * Indicates chains the sender is interested in.
31421 * If there are no common chains, the connection will be closed.
31423 void Init_set_networks(struct LDKInit *NONNULL_PTR this_ptr, struct LDKCOption_CVec_ThirtyTwoBytesZZ val);
31426 * The receipient's network address.
31428 * This adds the option to report a remote IP address back to a connecting peer using the init
31429 * message. A node can decide to use that information to discover a potential update to its
31430 * public IPv4 address (NAT) and use that for a [`NodeAnnouncement`] update message containing
31433 struct LDKCOption_SocketAddressZ Init_get_remote_network_address(const struct LDKInit *NONNULL_PTR this_ptr);
31436 * The receipient's network address.
31438 * This adds the option to report a remote IP address back to a connecting peer using the init
31439 * message. A node can decide to use that information to discover a potential update to its
31440 * public IPv4 address (NAT) and use that for a [`NodeAnnouncement`] update message containing
31443 void Init_set_remote_network_address(struct LDKInit *NONNULL_PTR this_ptr, struct LDKCOption_SocketAddressZ val);
31446 * Constructs a new Init given each field
31448 MUST_USE_RES struct LDKInit Init_new(struct LDKInitFeatures features_arg, struct LDKCOption_CVec_ThirtyTwoBytesZZ networks_arg, struct LDKCOption_SocketAddressZ remote_network_address_arg);
31451 * Creates a copy of the Init
31453 struct LDKInit Init_clone(const struct LDKInit *NONNULL_PTR orig);
31456 * Checks if two Inits contain equal inner contents.
31457 * This ignores pointers and is_owned flags and looks at the values in fields.
31458 * Two objects with NULL inner values will be considered "equal" here.
31460 bool Init_eq(const struct LDKInit *NONNULL_PTR a, const struct LDKInit *NONNULL_PTR b);
31463 * Frees any resources used by the ErrorMessage, if is_owned is set and inner is non-NULL.
31465 void ErrorMessage_free(struct LDKErrorMessage this_obj);
31468 * The channel ID involved in the error.
31470 * All-0s indicates a general error unrelated to a specific channel, after which all channels
31471 * with the sending peer should be closed.
31473 const uint8_t (*ErrorMessage_get_channel_id(const struct LDKErrorMessage *NONNULL_PTR this_ptr))[32];
31476 * The channel ID involved in the error.
31478 * All-0s indicates a general error unrelated to a specific channel, after which all channels
31479 * with the sending peer should be closed.
31481 void ErrorMessage_set_channel_id(struct LDKErrorMessage *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
31484 * A possibly human-readable error description.
31486 * The string should be sanitized before it is used (e.g., emitted to logs or printed to
31487 * `stdout`). Otherwise, a well crafted error message may trigger a security vulnerability in
31488 * the terminal emulator or the logging subsystem.
31490 struct LDKStr ErrorMessage_get_data(const struct LDKErrorMessage *NONNULL_PTR this_ptr);
31493 * A possibly human-readable error description.
31495 * The string should be sanitized before it is used (e.g., emitted to logs or printed to
31496 * `stdout`). Otherwise, a well crafted error message may trigger a security vulnerability in
31497 * the terminal emulator or the logging subsystem.
31499 void ErrorMessage_set_data(struct LDKErrorMessage *NONNULL_PTR this_ptr, struct LDKStr val);
31502 * Constructs a new ErrorMessage given each field
31504 MUST_USE_RES struct LDKErrorMessage ErrorMessage_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKStr data_arg);
31507 * Creates a copy of the ErrorMessage
31509 struct LDKErrorMessage ErrorMessage_clone(const struct LDKErrorMessage *NONNULL_PTR orig);
31512 * Checks if two ErrorMessages contain equal inner contents.
31513 * This ignores pointers and is_owned flags and looks at the values in fields.
31514 * Two objects with NULL inner values will be considered "equal" here.
31516 bool ErrorMessage_eq(const struct LDKErrorMessage *NONNULL_PTR a, const struct LDKErrorMessage *NONNULL_PTR b);
31519 * Frees any resources used by the WarningMessage, if is_owned is set and inner is non-NULL.
31521 void WarningMessage_free(struct LDKWarningMessage this_obj);
31524 * The channel ID involved in the warning.
31526 * All-0s indicates a warning unrelated to a specific channel.
31528 const uint8_t (*WarningMessage_get_channel_id(const struct LDKWarningMessage *NONNULL_PTR this_ptr))[32];
31531 * The channel ID involved in the warning.
31533 * All-0s indicates a warning unrelated to a specific channel.
31535 void WarningMessage_set_channel_id(struct LDKWarningMessage *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
31538 * A possibly human-readable warning description.
31540 * The string should be sanitized before it is used (e.g. emitted to logs or printed to
31541 * stdout). Otherwise, a well crafted error message may trigger a security vulnerability in
31542 * the terminal emulator or the logging subsystem.
31544 struct LDKStr WarningMessage_get_data(const struct LDKWarningMessage *NONNULL_PTR this_ptr);
31547 * A possibly human-readable warning description.
31549 * The string should be sanitized before it is used (e.g. emitted to logs or printed to
31550 * stdout). Otherwise, a well crafted error message may trigger a security vulnerability in
31551 * the terminal emulator or the logging subsystem.
31553 void WarningMessage_set_data(struct LDKWarningMessage *NONNULL_PTR this_ptr, struct LDKStr val);
31556 * Constructs a new WarningMessage given each field
31558 MUST_USE_RES struct LDKWarningMessage WarningMessage_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKStr data_arg);
31561 * Creates a copy of the WarningMessage
31563 struct LDKWarningMessage WarningMessage_clone(const struct LDKWarningMessage *NONNULL_PTR orig);
31566 * Checks if two WarningMessages contain equal inner contents.
31567 * This ignores pointers and is_owned flags and looks at the values in fields.
31568 * Two objects with NULL inner values will be considered "equal" here.
31570 bool WarningMessage_eq(const struct LDKWarningMessage *NONNULL_PTR a, const struct LDKWarningMessage *NONNULL_PTR b);
31573 * Frees any resources used by the Ping, if is_owned is set and inner is non-NULL.
31575 void Ping_free(struct LDKPing this_obj);
31578 * The desired response length.
31580 uint16_t Ping_get_ponglen(const struct LDKPing *NONNULL_PTR this_ptr);
31583 * The desired response length.
31585 void Ping_set_ponglen(struct LDKPing *NONNULL_PTR this_ptr, uint16_t val);
31588 * The ping packet size.
31590 * This field is not sent on the wire. byteslen zeros are sent.
31592 uint16_t Ping_get_byteslen(const struct LDKPing *NONNULL_PTR this_ptr);
31595 * The ping packet size.
31597 * This field is not sent on the wire. byteslen zeros are sent.
31599 void Ping_set_byteslen(struct LDKPing *NONNULL_PTR this_ptr, uint16_t val);
31602 * Constructs a new Ping given each field
31604 MUST_USE_RES struct LDKPing Ping_new(uint16_t ponglen_arg, uint16_t byteslen_arg);
31607 * Creates a copy of the Ping
31609 struct LDKPing Ping_clone(const struct LDKPing *NONNULL_PTR orig);
31612 * Checks if two Pings contain equal inner contents.
31613 * This ignores pointers and is_owned flags and looks at the values in fields.
31614 * Two objects with NULL inner values will be considered "equal" here.
31616 bool Ping_eq(const struct LDKPing *NONNULL_PTR a, const struct LDKPing *NONNULL_PTR b);
31619 * Frees any resources used by the Pong, if is_owned is set and inner is non-NULL.
31621 void Pong_free(struct LDKPong this_obj);
31624 * The pong packet size.
31626 * This field is not sent on the wire. byteslen zeros are sent.
31628 uint16_t Pong_get_byteslen(const struct LDKPong *NONNULL_PTR this_ptr);
31631 * The pong packet size.
31633 * This field is not sent on the wire. byteslen zeros are sent.
31635 void Pong_set_byteslen(struct LDKPong *NONNULL_PTR this_ptr, uint16_t val);
31638 * Constructs a new Pong given each field
31640 MUST_USE_RES struct LDKPong Pong_new(uint16_t byteslen_arg);
31643 * Creates a copy of the Pong
31645 struct LDKPong Pong_clone(const struct LDKPong *NONNULL_PTR orig);
31648 * Checks if two Pongs contain equal inner contents.
31649 * This ignores pointers and is_owned flags and looks at the values in fields.
31650 * Two objects with NULL inner values will be considered "equal" here.
31652 bool Pong_eq(const struct LDKPong *NONNULL_PTR a, const struct LDKPong *NONNULL_PTR b);
31655 * Frees any resources used by the OpenChannel, if is_owned is set and inner is non-NULL.
31657 void OpenChannel_free(struct LDKOpenChannel this_obj);
31660 * The genesis hash of the blockchain where the channel is to be opened
31662 const uint8_t (*OpenChannel_get_chain_hash(const struct LDKOpenChannel *NONNULL_PTR this_ptr))[32];
31665 * The genesis hash of the blockchain where the channel is to be opened
31667 void OpenChannel_set_chain_hash(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
31670 * A temporary channel ID, until the funding outpoint is announced
31672 const uint8_t (*OpenChannel_get_temporary_channel_id(const struct LDKOpenChannel *NONNULL_PTR this_ptr))[32];
31675 * A temporary channel ID, until the funding outpoint is announced
31677 void OpenChannel_set_temporary_channel_id(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
31680 * The channel value
31682 uint64_t OpenChannel_get_funding_satoshis(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
31685 * The channel value
31687 void OpenChannel_set_funding_satoshis(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint64_t val);
31690 * The amount to push to the counterparty as part of the open, in milli-satoshi
31692 uint64_t OpenChannel_get_push_msat(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
31695 * The amount to push to the counterparty as part of the open, in milli-satoshi
31697 void OpenChannel_set_push_msat(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint64_t val);
31700 * The threshold below which outputs on transactions broadcast by sender will be omitted
31702 uint64_t OpenChannel_get_dust_limit_satoshis(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
31705 * The threshold below which outputs on transactions broadcast by sender will be omitted
31707 void OpenChannel_set_dust_limit_satoshis(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint64_t val);
31710 * The maximum inbound HTLC value in flight towards sender, in milli-satoshi
31712 uint64_t OpenChannel_get_max_htlc_value_in_flight_msat(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
31715 * The maximum inbound HTLC value in flight towards sender, in milli-satoshi
31717 void OpenChannel_set_max_htlc_value_in_flight_msat(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint64_t val);
31720 * The minimum value unencumbered by HTLCs for the counterparty to keep in the channel
31722 uint64_t OpenChannel_get_channel_reserve_satoshis(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
31725 * The minimum value unencumbered by HTLCs for the counterparty to keep in the channel
31727 void OpenChannel_set_channel_reserve_satoshis(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint64_t val);
31730 * The minimum HTLC size incoming to sender, in milli-satoshi
31732 uint64_t OpenChannel_get_htlc_minimum_msat(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
31735 * The minimum HTLC size incoming to sender, in milli-satoshi
31737 void OpenChannel_set_htlc_minimum_msat(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint64_t val);
31740 * The feerate per 1000-weight of sender generated transactions, until updated by
31743 uint32_t OpenChannel_get_feerate_per_kw(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
31746 * The feerate per 1000-weight of sender generated transactions, until updated by
31749 void OpenChannel_set_feerate_per_kw(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint32_t val);
31752 * The number of blocks which the counterparty will have to wait to claim on-chain funds if
31753 * they broadcast a commitment transaction
31755 uint16_t OpenChannel_get_to_self_delay(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
31758 * The number of blocks which the counterparty will have to wait to claim on-chain funds if
31759 * they broadcast a commitment transaction
31761 void OpenChannel_set_to_self_delay(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint16_t val);
31764 * The maximum number of inbound HTLCs towards sender
31766 uint16_t OpenChannel_get_max_accepted_htlcs(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
31769 * The maximum number of inbound HTLCs towards sender
31771 void OpenChannel_set_max_accepted_htlcs(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint16_t val);
31774 * The sender's key controlling the funding transaction
31776 struct LDKPublicKey OpenChannel_get_funding_pubkey(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
31779 * The sender's key controlling the funding transaction
31781 void OpenChannel_set_funding_pubkey(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
31784 * Used to derive a revocation key for transactions broadcast by counterparty
31786 struct LDKPublicKey OpenChannel_get_revocation_basepoint(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
31789 * Used to derive a revocation key for transactions broadcast by counterparty
31791 void OpenChannel_set_revocation_basepoint(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
31794 * A payment key to sender for transactions broadcast by counterparty
31796 struct LDKPublicKey OpenChannel_get_payment_point(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
31799 * A payment key to sender for transactions broadcast by counterparty
31801 void OpenChannel_set_payment_point(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
31804 * Used to derive a payment key to sender for transactions broadcast by sender
31806 struct LDKPublicKey OpenChannel_get_delayed_payment_basepoint(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
31809 * Used to derive a payment key to sender for transactions broadcast by sender
31811 void OpenChannel_set_delayed_payment_basepoint(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
31814 * Used to derive an HTLC payment key to sender
31816 struct LDKPublicKey OpenChannel_get_htlc_basepoint(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
31819 * Used to derive an HTLC payment key to sender
31821 void OpenChannel_set_htlc_basepoint(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
31824 * The first to-be-broadcast-by-sender transaction's per commitment point
31826 struct LDKPublicKey OpenChannel_get_first_per_commitment_point(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
31829 * The first to-be-broadcast-by-sender transaction's per commitment point
31831 void OpenChannel_set_first_per_commitment_point(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
31834 * The channel flags to be used
31836 uint8_t OpenChannel_get_channel_flags(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
31839 * The channel flags to be used
31841 void OpenChannel_set_channel_flags(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint8_t val);
31844 * A request to pre-set the to-sender output's `scriptPubkey` for when we collaboratively close
31846 struct LDKCOption_CVec_u8ZZ OpenChannel_get_shutdown_scriptpubkey(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
31849 * A request to pre-set the to-sender output's `scriptPubkey` for when we collaboratively close
31851 void OpenChannel_set_shutdown_scriptpubkey(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKCOption_CVec_u8ZZ val);
31854 * The channel type that this channel will represent
31856 * If this is `None`, we derive the channel type from the intersection of our
31857 * feature bits with our counterparty's feature bits from the [`Init`] message.
31859 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
31861 struct LDKChannelTypeFeatures OpenChannel_get_channel_type(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
31864 * The channel type that this channel will represent
31866 * If this is `None`, we derive the channel type from the intersection of our
31867 * feature bits with our counterparty's feature bits from the [`Init`] message.
31869 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
31871 void OpenChannel_set_channel_type(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKChannelTypeFeatures val);
31874 * Constructs a new OpenChannel given each field
31876 * Note that channel_type_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
31878 MUST_USE_RES struct LDKOpenChannel OpenChannel_new(struct LDKThirtyTwoBytes chain_hash_arg, struct LDKThirtyTwoBytes temporary_channel_id_arg, uint64_t funding_satoshis_arg, uint64_t push_msat_arg, uint64_t dust_limit_satoshis_arg, uint64_t max_htlc_value_in_flight_msat_arg, uint64_t channel_reserve_satoshis_arg, uint64_t htlc_minimum_msat_arg, uint32_t feerate_per_kw_arg, uint16_t to_self_delay_arg, uint16_t max_accepted_htlcs_arg, struct LDKPublicKey funding_pubkey_arg, struct LDKPublicKey revocation_basepoint_arg, struct LDKPublicKey payment_point_arg, struct LDKPublicKey delayed_payment_basepoint_arg, struct LDKPublicKey htlc_basepoint_arg, struct LDKPublicKey first_per_commitment_point_arg, uint8_t channel_flags_arg, struct LDKCOption_CVec_u8ZZ shutdown_scriptpubkey_arg, struct LDKChannelTypeFeatures channel_type_arg);
31881 * Creates a copy of the OpenChannel
31883 struct LDKOpenChannel OpenChannel_clone(const struct LDKOpenChannel *NONNULL_PTR orig);
31886 * Checks if two OpenChannels contain equal inner contents.
31887 * This ignores pointers and is_owned flags and looks at the values in fields.
31888 * Two objects with NULL inner values will be considered "equal" here.
31890 bool OpenChannel_eq(const struct LDKOpenChannel *NONNULL_PTR a, const struct LDKOpenChannel *NONNULL_PTR b);
31893 * Frees any resources used by the OpenChannelV2, if is_owned is set and inner is non-NULL.
31895 void OpenChannelV2_free(struct LDKOpenChannelV2 this_obj);
31898 * The genesis hash of the blockchain where the channel is to be opened
31900 const uint8_t (*OpenChannelV2_get_chain_hash(const struct LDKOpenChannelV2 *NONNULL_PTR this_ptr))[32];
31903 * The genesis hash of the blockchain where the channel is to be opened
31905 void OpenChannelV2_set_chain_hash(struct LDKOpenChannelV2 *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
31908 * A temporary channel ID derived using a zeroed out value for the channel acceptor's revocation basepoint
31910 const uint8_t (*OpenChannelV2_get_temporary_channel_id(const struct LDKOpenChannelV2 *NONNULL_PTR this_ptr))[32];
31913 * A temporary channel ID derived using a zeroed out value for the channel acceptor's revocation basepoint
31915 void OpenChannelV2_set_temporary_channel_id(struct LDKOpenChannelV2 *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
31918 * The feerate for the funding transaction set by the channel initiator
31920 uint32_t OpenChannelV2_get_funding_feerate_sat_per_1000_weight(const struct LDKOpenChannelV2 *NONNULL_PTR this_ptr);
31923 * The feerate for the funding transaction set by the channel initiator
31925 void OpenChannelV2_set_funding_feerate_sat_per_1000_weight(struct LDKOpenChannelV2 *NONNULL_PTR this_ptr, uint32_t val);
31928 * The feerate for the commitment transaction set by the channel initiator
31930 uint32_t OpenChannelV2_get_commitment_feerate_sat_per_1000_weight(const struct LDKOpenChannelV2 *NONNULL_PTR this_ptr);
31933 * The feerate for the commitment transaction set by the channel initiator
31935 void OpenChannelV2_set_commitment_feerate_sat_per_1000_weight(struct LDKOpenChannelV2 *NONNULL_PTR this_ptr, uint32_t val);
31938 * Part of the channel value contributed by the channel initiator
31940 uint64_t OpenChannelV2_get_funding_satoshis(const struct LDKOpenChannelV2 *NONNULL_PTR this_ptr);
31943 * Part of the channel value contributed by the channel initiator
31945 void OpenChannelV2_set_funding_satoshis(struct LDKOpenChannelV2 *NONNULL_PTR this_ptr, uint64_t val);
31948 * The threshold below which outputs on transactions broadcast by the channel initiator will be
31951 uint64_t OpenChannelV2_get_dust_limit_satoshis(const struct LDKOpenChannelV2 *NONNULL_PTR this_ptr);
31954 * The threshold below which outputs on transactions broadcast by the channel initiator will be
31957 void OpenChannelV2_set_dust_limit_satoshis(struct LDKOpenChannelV2 *NONNULL_PTR this_ptr, uint64_t val);
31960 * The maximum inbound HTLC value in flight towards channel initiator, in milli-satoshi
31962 uint64_t OpenChannelV2_get_max_htlc_value_in_flight_msat(const struct LDKOpenChannelV2 *NONNULL_PTR this_ptr);
31965 * The maximum inbound HTLC value in flight towards channel initiator, in milli-satoshi
31967 void OpenChannelV2_set_max_htlc_value_in_flight_msat(struct LDKOpenChannelV2 *NONNULL_PTR this_ptr, uint64_t val);
31970 * The minimum HTLC size incoming to channel initiator, in milli-satoshi
31972 uint64_t OpenChannelV2_get_htlc_minimum_msat(const struct LDKOpenChannelV2 *NONNULL_PTR this_ptr);
31975 * The minimum HTLC size incoming to channel initiator, in milli-satoshi
31977 void OpenChannelV2_set_htlc_minimum_msat(struct LDKOpenChannelV2 *NONNULL_PTR this_ptr, uint64_t val);
31980 * The number of blocks which the counterparty will have to wait to claim on-chain funds if they
31981 * broadcast a commitment transaction
31983 uint16_t OpenChannelV2_get_to_self_delay(const struct LDKOpenChannelV2 *NONNULL_PTR this_ptr);
31986 * The number of blocks which the counterparty will have to wait to claim on-chain funds if they
31987 * broadcast a commitment transaction
31989 void OpenChannelV2_set_to_self_delay(struct LDKOpenChannelV2 *NONNULL_PTR this_ptr, uint16_t val);
31992 * The maximum number of inbound HTLCs towards channel initiator
31994 uint16_t OpenChannelV2_get_max_accepted_htlcs(const struct LDKOpenChannelV2 *NONNULL_PTR this_ptr);
31997 * The maximum number of inbound HTLCs towards channel initiator
31999 void OpenChannelV2_set_max_accepted_htlcs(struct LDKOpenChannelV2 *NONNULL_PTR this_ptr, uint16_t val);
32002 * The locktime for the funding transaction
32004 uint32_t OpenChannelV2_get_locktime(const struct LDKOpenChannelV2 *NONNULL_PTR this_ptr);
32007 * The locktime for the funding transaction
32009 void OpenChannelV2_set_locktime(struct LDKOpenChannelV2 *NONNULL_PTR this_ptr, uint32_t val);
32012 * The channel initiator's key controlling the funding transaction
32014 struct LDKPublicKey OpenChannelV2_get_funding_pubkey(const struct LDKOpenChannelV2 *NONNULL_PTR this_ptr);
32017 * The channel initiator's key controlling the funding transaction
32019 void OpenChannelV2_set_funding_pubkey(struct LDKOpenChannelV2 *NONNULL_PTR this_ptr, struct LDKPublicKey val);
32022 * Used to derive a revocation key for transactions broadcast by counterparty
32024 struct LDKPublicKey OpenChannelV2_get_revocation_basepoint(const struct LDKOpenChannelV2 *NONNULL_PTR this_ptr);
32027 * Used to derive a revocation key for transactions broadcast by counterparty
32029 void OpenChannelV2_set_revocation_basepoint(struct LDKOpenChannelV2 *NONNULL_PTR this_ptr, struct LDKPublicKey val);
32032 * A payment key to channel initiator for transactions broadcast by counterparty
32034 struct LDKPublicKey OpenChannelV2_get_payment_basepoint(const struct LDKOpenChannelV2 *NONNULL_PTR this_ptr);
32037 * A payment key to channel initiator for transactions broadcast by counterparty
32039 void OpenChannelV2_set_payment_basepoint(struct LDKOpenChannelV2 *NONNULL_PTR this_ptr, struct LDKPublicKey val);
32042 * Used to derive a payment key to channel initiator for transactions broadcast by channel
32045 struct LDKPublicKey OpenChannelV2_get_delayed_payment_basepoint(const struct LDKOpenChannelV2 *NONNULL_PTR this_ptr);
32048 * Used to derive a payment key to channel initiator for transactions broadcast by channel
32051 void OpenChannelV2_set_delayed_payment_basepoint(struct LDKOpenChannelV2 *NONNULL_PTR this_ptr, struct LDKPublicKey val);
32054 * Used to derive an HTLC payment key to channel initiator
32056 struct LDKPublicKey OpenChannelV2_get_htlc_basepoint(const struct LDKOpenChannelV2 *NONNULL_PTR this_ptr);
32059 * Used to derive an HTLC payment key to channel initiator
32061 void OpenChannelV2_set_htlc_basepoint(struct LDKOpenChannelV2 *NONNULL_PTR this_ptr, struct LDKPublicKey val);
32064 * The first to-be-broadcast-by-channel-initiator transaction's per commitment point
32066 struct LDKPublicKey OpenChannelV2_get_first_per_commitment_point(const struct LDKOpenChannelV2 *NONNULL_PTR this_ptr);
32069 * The first to-be-broadcast-by-channel-initiator transaction's per commitment point
32071 void OpenChannelV2_set_first_per_commitment_point(struct LDKOpenChannelV2 *NONNULL_PTR this_ptr, struct LDKPublicKey val);
32074 * The second to-be-broadcast-by-channel-initiator transaction's per commitment point
32076 struct LDKPublicKey OpenChannelV2_get_second_per_commitment_point(const struct LDKOpenChannelV2 *NONNULL_PTR this_ptr);
32079 * The second to-be-broadcast-by-channel-initiator transaction's per commitment point
32081 void OpenChannelV2_set_second_per_commitment_point(struct LDKOpenChannelV2 *NONNULL_PTR this_ptr, struct LDKPublicKey val);
32086 uint8_t OpenChannelV2_get_channel_flags(const struct LDKOpenChannelV2 *NONNULL_PTR this_ptr);
32091 void OpenChannelV2_set_channel_flags(struct LDKOpenChannelV2 *NONNULL_PTR this_ptr, uint8_t val);
32094 * Optionally, a request to pre-set the to-channel-initiator output's scriptPubkey for when we
32095 * collaboratively close
32097 struct LDKCOption_CVec_u8ZZ OpenChannelV2_get_shutdown_scriptpubkey(const struct LDKOpenChannelV2 *NONNULL_PTR this_ptr);
32100 * Optionally, a request to pre-set the to-channel-initiator output's scriptPubkey for when we
32101 * collaboratively close
32103 void OpenChannelV2_set_shutdown_scriptpubkey(struct LDKOpenChannelV2 *NONNULL_PTR this_ptr, struct LDKCOption_CVec_u8ZZ val);
32106 * The channel type that this channel will represent. If none is set, we derive the channel
32107 * type from the intersection of our feature bits with our counterparty's feature bits from
32108 * the Init message.
32110 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
32112 struct LDKChannelTypeFeatures OpenChannelV2_get_channel_type(const struct LDKOpenChannelV2 *NONNULL_PTR this_ptr);
32115 * The channel type that this channel will represent. If none is set, we derive the channel
32116 * type from the intersection of our feature bits with our counterparty's feature bits from
32117 * the Init message.
32119 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
32121 void OpenChannelV2_set_channel_type(struct LDKOpenChannelV2 *NONNULL_PTR this_ptr, struct LDKChannelTypeFeatures val);
32124 * Optionally, a requirement that only confirmed inputs can be added
32126 enum LDKCOption_NoneZ OpenChannelV2_get_require_confirmed_inputs(const struct LDKOpenChannelV2 *NONNULL_PTR this_ptr);
32129 * Optionally, a requirement that only confirmed inputs can be added
32131 void OpenChannelV2_set_require_confirmed_inputs(struct LDKOpenChannelV2 *NONNULL_PTR this_ptr, enum LDKCOption_NoneZ val);
32134 * Constructs a new OpenChannelV2 given each field
32136 * Note that channel_type_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
32138 MUST_USE_RES struct LDKOpenChannelV2 OpenChannelV2_new(struct LDKThirtyTwoBytes chain_hash_arg, struct LDKThirtyTwoBytes temporary_channel_id_arg, uint32_t funding_feerate_sat_per_1000_weight_arg, uint32_t commitment_feerate_sat_per_1000_weight_arg, uint64_t funding_satoshis_arg, uint64_t dust_limit_satoshis_arg, uint64_t max_htlc_value_in_flight_msat_arg, uint64_t htlc_minimum_msat_arg, uint16_t to_self_delay_arg, uint16_t max_accepted_htlcs_arg, uint32_t locktime_arg, struct LDKPublicKey funding_pubkey_arg, struct LDKPublicKey revocation_basepoint_arg, struct LDKPublicKey payment_basepoint_arg, struct LDKPublicKey delayed_payment_basepoint_arg, struct LDKPublicKey htlc_basepoint_arg, struct LDKPublicKey first_per_commitment_point_arg, struct LDKPublicKey second_per_commitment_point_arg, uint8_t channel_flags_arg, struct LDKCOption_CVec_u8ZZ shutdown_scriptpubkey_arg, struct LDKChannelTypeFeatures channel_type_arg, enum LDKCOption_NoneZ require_confirmed_inputs_arg);
32141 * Creates a copy of the OpenChannelV2
32143 struct LDKOpenChannelV2 OpenChannelV2_clone(const struct LDKOpenChannelV2 *NONNULL_PTR orig);
32146 * Checks if two OpenChannelV2s contain equal inner contents.
32147 * This ignores pointers and is_owned flags and looks at the values in fields.
32148 * Two objects with NULL inner values will be considered "equal" here.
32150 bool OpenChannelV2_eq(const struct LDKOpenChannelV2 *NONNULL_PTR a, const struct LDKOpenChannelV2 *NONNULL_PTR b);
32153 * Frees any resources used by the AcceptChannel, if is_owned is set and inner is non-NULL.
32155 void AcceptChannel_free(struct LDKAcceptChannel this_obj);
32158 * A temporary channel ID, until the funding outpoint is announced
32160 const uint8_t (*AcceptChannel_get_temporary_channel_id(const struct LDKAcceptChannel *NONNULL_PTR this_ptr))[32];
32163 * A temporary channel ID, until the funding outpoint is announced
32165 void AcceptChannel_set_temporary_channel_id(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
32168 * The threshold below which outputs on transactions broadcast by sender will be omitted
32170 uint64_t AcceptChannel_get_dust_limit_satoshis(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
32173 * The threshold below which outputs on transactions broadcast by sender will be omitted
32175 void AcceptChannel_set_dust_limit_satoshis(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint64_t val);
32178 * The maximum inbound HTLC value in flight towards sender, in milli-satoshi
32180 uint64_t AcceptChannel_get_max_htlc_value_in_flight_msat(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
32183 * The maximum inbound HTLC value in flight towards sender, in milli-satoshi
32185 void AcceptChannel_set_max_htlc_value_in_flight_msat(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint64_t val);
32188 * The minimum value unencumbered by HTLCs for the counterparty to keep in the channel
32190 uint64_t AcceptChannel_get_channel_reserve_satoshis(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
32193 * The minimum value unencumbered by HTLCs for the counterparty to keep in the channel
32195 void AcceptChannel_set_channel_reserve_satoshis(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint64_t val);
32198 * The minimum HTLC size incoming to sender, in milli-satoshi
32200 uint64_t AcceptChannel_get_htlc_minimum_msat(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
32203 * The minimum HTLC size incoming to sender, in milli-satoshi
32205 void AcceptChannel_set_htlc_minimum_msat(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint64_t val);
32208 * Minimum depth of the funding transaction before the channel is considered open
32210 uint32_t AcceptChannel_get_minimum_depth(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
32213 * Minimum depth of the funding transaction before the channel is considered open
32215 void AcceptChannel_set_minimum_depth(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint32_t val);
32218 * The number of blocks which the counterparty will have to wait to claim on-chain funds if they broadcast a commitment transaction
32220 uint16_t AcceptChannel_get_to_self_delay(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
32223 * The number of blocks which the counterparty will have to wait to claim on-chain funds if they broadcast a commitment transaction
32225 void AcceptChannel_set_to_self_delay(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint16_t val);
32228 * The maximum number of inbound HTLCs towards sender
32230 uint16_t AcceptChannel_get_max_accepted_htlcs(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
32233 * The maximum number of inbound HTLCs towards sender
32235 void AcceptChannel_set_max_accepted_htlcs(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint16_t val);
32238 * The sender's key controlling the funding transaction
32240 struct LDKPublicKey AcceptChannel_get_funding_pubkey(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
32243 * The sender's key controlling the funding transaction
32245 void AcceptChannel_set_funding_pubkey(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
32248 * Used to derive a revocation key for transactions broadcast by counterparty
32250 struct LDKPublicKey AcceptChannel_get_revocation_basepoint(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
32253 * Used to derive a revocation key for transactions broadcast by counterparty
32255 void AcceptChannel_set_revocation_basepoint(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
32258 * A payment key to sender for transactions broadcast by counterparty
32260 struct LDKPublicKey AcceptChannel_get_payment_point(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
32263 * A payment key to sender for transactions broadcast by counterparty
32265 void AcceptChannel_set_payment_point(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
32268 * Used to derive a payment key to sender for transactions broadcast by sender
32270 struct LDKPublicKey AcceptChannel_get_delayed_payment_basepoint(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
32273 * Used to derive a payment key to sender for transactions broadcast by sender
32275 void AcceptChannel_set_delayed_payment_basepoint(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
32278 * Used to derive an HTLC payment key to sender for transactions broadcast by counterparty
32280 struct LDKPublicKey AcceptChannel_get_htlc_basepoint(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
32283 * Used to derive an HTLC payment key to sender for transactions broadcast by counterparty
32285 void AcceptChannel_set_htlc_basepoint(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
32288 * The first to-be-broadcast-by-sender transaction's per commitment point
32290 struct LDKPublicKey AcceptChannel_get_first_per_commitment_point(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
32293 * The first to-be-broadcast-by-sender transaction's per commitment point
32295 void AcceptChannel_set_first_per_commitment_point(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
32298 * A request to pre-set the to-sender output's scriptPubkey for when we collaboratively close
32300 struct LDKCOption_CVec_u8ZZ AcceptChannel_get_shutdown_scriptpubkey(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
32303 * A request to pre-set the to-sender output's scriptPubkey for when we collaboratively close
32305 void AcceptChannel_set_shutdown_scriptpubkey(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKCOption_CVec_u8ZZ val);
32308 * The channel type that this channel will represent.
32310 * If this is `None`, we derive the channel type from the intersection of
32311 * our feature bits with our counterparty's feature bits from the [`Init`] message.
32312 * This is required to match the equivalent field in [`OpenChannel::channel_type`].
32314 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
32316 struct LDKChannelTypeFeatures AcceptChannel_get_channel_type(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
32319 * The channel type that this channel will represent.
32321 * If this is `None`, we derive the channel type from the intersection of
32322 * our feature bits with our counterparty's feature bits from the [`Init`] message.
32323 * This is required to match the equivalent field in [`OpenChannel::channel_type`].
32325 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
32327 void AcceptChannel_set_channel_type(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKChannelTypeFeatures val);
32330 * Constructs a new AcceptChannel given each field
32332 * Note that channel_type_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
32334 MUST_USE_RES struct LDKAcceptChannel AcceptChannel_new(struct LDKThirtyTwoBytes temporary_channel_id_arg, uint64_t dust_limit_satoshis_arg, uint64_t max_htlc_value_in_flight_msat_arg, uint64_t channel_reserve_satoshis_arg, uint64_t htlc_minimum_msat_arg, uint32_t minimum_depth_arg, uint16_t to_self_delay_arg, uint16_t max_accepted_htlcs_arg, struct LDKPublicKey funding_pubkey_arg, struct LDKPublicKey revocation_basepoint_arg, struct LDKPublicKey payment_point_arg, struct LDKPublicKey delayed_payment_basepoint_arg, struct LDKPublicKey htlc_basepoint_arg, struct LDKPublicKey first_per_commitment_point_arg, struct LDKCOption_CVec_u8ZZ shutdown_scriptpubkey_arg, struct LDKChannelTypeFeatures channel_type_arg);
32337 * Creates a copy of the AcceptChannel
32339 struct LDKAcceptChannel AcceptChannel_clone(const struct LDKAcceptChannel *NONNULL_PTR orig);
32342 * Checks if two AcceptChannels contain equal inner contents.
32343 * This ignores pointers and is_owned flags and looks at the values in fields.
32344 * Two objects with NULL inner values will be considered "equal" here.
32346 bool AcceptChannel_eq(const struct LDKAcceptChannel *NONNULL_PTR a, const struct LDKAcceptChannel *NONNULL_PTR b);
32349 * Frees any resources used by the AcceptChannelV2, if is_owned is set and inner is non-NULL.
32351 void AcceptChannelV2_free(struct LDKAcceptChannelV2 this_obj);
32354 * The same `temporary_channel_id` received from the initiator's `open_channel2` message.
32356 const uint8_t (*AcceptChannelV2_get_temporary_channel_id(const struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr))[32];
32359 * The same `temporary_channel_id` received from the initiator's `open_channel2` message.
32361 void AcceptChannelV2_set_temporary_channel_id(struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
32364 * Part of the channel value contributed by the channel acceptor
32366 uint64_t AcceptChannelV2_get_funding_satoshis(const struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr);
32369 * Part of the channel value contributed by the channel acceptor
32371 void AcceptChannelV2_set_funding_satoshis(struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr, uint64_t val);
32374 * The threshold below which outputs on transactions broadcast by the channel acceptor will be
32377 uint64_t AcceptChannelV2_get_dust_limit_satoshis(const struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr);
32380 * The threshold below which outputs on transactions broadcast by the channel acceptor will be
32383 void AcceptChannelV2_set_dust_limit_satoshis(struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr, uint64_t val);
32386 * The maximum inbound HTLC value in flight towards channel acceptor, in milli-satoshi
32388 uint64_t AcceptChannelV2_get_max_htlc_value_in_flight_msat(const struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr);
32391 * The maximum inbound HTLC value in flight towards channel acceptor, in milli-satoshi
32393 void AcceptChannelV2_set_max_htlc_value_in_flight_msat(struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr, uint64_t val);
32396 * The minimum HTLC size incoming to channel acceptor, in milli-satoshi
32398 uint64_t AcceptChannelV2_get_htlc_minimum_msat(const struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr);
32401 * The minimum HTLC size incoming to channel acceptor, in milli-satoshi
32403 void AcceptChannelV2_set_htlc_minimum_msat(struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr, uint64_t val);
32406 * Minimum depth of the funding transaction before the channel is considered open
32408 uint32_t AcceptChannelV2_get_minimum_depth(const struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr);
32411 * Minimum depth of the funding transaction before the channel is considered open
32413 void AcceptChannelV2_set_minimum_depth(struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr, uint32_t val);
32416 * The number of blocks which the counterparty will have to wait to claim on-chain funds if they
32417 * broadcast a commitment transaction
32419 uint16_t AcceptChannelV2_get_to_self_delay(const struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr);
32422 * The number of blocks which the counterparty will have to wait to claim on-chain funds if they
32423 * broadcast a commitment transaction
32425 void AcceptChannelV2_set_to_self_delay(struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr, uint16_t val);
32428 * The maximum number of inbound HTLCs towards channel acceptor
32430 uint16_t AcceptChannelV2_get_max_accepted_htlcs(const struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr);
32433 * The maximum number of inbound HTLCs towards channel acceptor
32435 void AcceptChannelV2_set_max_accepted_htlcs(struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr, uint16_t val);
32438 * The channel acceptor's key controlling the funding transaction
32440 struct LDKPublicKey AcceptChannelV2_get_funding_pubkey(const struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr);
32443 * The channel acceptor's key controlling the funding transaction
32445 void AcceptChannelV2_set_funding_pubkey(struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr, struct LDKPublicKey val);
32448 * Used to derive a revocation key for transactions broadcast by counterparty
32450 struct LDKPublicKey AcceptChannelV2_get_revocation_basepoint(const struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr);
32453 * Used to derive a revocation key for transactions broadcast by counterparty
32455 void AcceptChannelV2_set_revocation_basepoint(struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr, struct LDKPublicKey val);
32458 * A payment key to channel acceptor for transactions broadcast by counterparty
32460 struct LDKPublicKey AcceptChannelV2_get_payment_basepoint(const struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr);
32463 * A payment key to channel acceptor for transactions broadcast by counterparty
32465 void AcceptChannelV2_set_payment_basepoint(struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr, struct LDKPublicKey val);
32468 * Used to derive a payment key to channel acceptor for transactions broadcast by channel
32471 struct LDKPublicKey AcceptChannelV2_get_delayed_payment_basepoint(const struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr);
32474 * Used to derive a payment key to channel acceptor for transactions broadcast by channel
32477 void AcceptChannelV2_set_delayed_payment_basepoint(struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr, struct LDKPublicKey val);
32480 * Used to derive an HTLC payment key to channel acceptor for transactions broadcast by counterparty
32482 struct LDKPublicKey AcceptChannelV2_get_htlc_basepoint(const struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr);
32485 * Used to derive an HTLC payment key to channel acceptor for transactions broadcast by counterparty
32487 void AcceptChannelV2_set_htlc_basepoint(struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr, struct LDKPublicKey val);
32490 * The first to-be-broadcast-by-channel-acceptor transaction's per commitment point
32492 struct LDKPublicKey AcceptChannelV2_get_first_per_commitment_point(const struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr);
32495 * The first to-be-broadcast-by-channel-acceptor transaction's per commitment point
32497 void AcceptChannelV2_set_first_per_commitment_point(struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr, struct LDKPublicKey val);
32500 * The second to-be-broadcast-by-channel-acceptor transaction's per commitment point
32502 struct LDKPublicKey AcceptChannelV2_get_second_per_commitment_point(const struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr);
32505 * The second to-be-broadcast-by-channel-acceptor transaction's per commitment point
32507 void AcceptChannelV2_set_second_per_commitment_point(struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr, struct LDKPublicKey val);
32510 * Optionally, a request to pre-set the to-channel-acceptor output's scriptPubkey for when we
32511 * collaboratively close
32513 struct LDKCOption_CVec_u8ZZ AcceptChannelV2_get_shutdown_scriptpubkey(const struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr);
32516 * Optionally, a request to pre-set the to-channel-acceptor output's scriptPubkey for when we
32517 * collaboratively close
32519 void AcceptChannelV2_set_shutdown_scriptpubkey(struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr, struct LDKCOption_CVec_u8ZZ val);
32522 * The channel type that this channel will represent. If none is set, we derive the channel
32523 * type from the intersection of our feature bits with our counterparty's feature bits from
32524 * the Init message.
32526 * This is required to match the equivalent field in [`OpenChannelV2::channel_type`].
32528 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
32530 struct LDKChannelTypeFeatures AcceptChannelV2_get_channel_type(const struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr);
32533 * The channel type that this channel will represent. If none is set, we derive the channel
32534 * type from the intersection of our feature bits with our counterparty's feature bits from
32535 * the Init message.
32537 * This is required to match the equivalent field in [`OpenChannelV2::channel_type`].
32539 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
32541 void AcceptChannelV2_set_channel_type(struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr, struct LDKChannelTypeFeatures val);
32544 * Optionally, a requirement that only confirmed inputs can be added
32546 enum LDKCOption_NoneZ AcceptChannelV2_get_require_confirmed_inputs(const struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr);
32549 * Optionally, a requirement that only confirmed inputs can be added
32551 void AcceptChannelV2_set_require_confirmed_inputs(struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr, enum LDKCOption_NoneZ val);
32554 * Constructs a new AcceptChannelV2 given each field
32556 * Note that channel_type_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
32558 MUST_USE_RES struct LDKAcceptChannelV2 AcceptChannelV2_new(struct LDKThirtyTwoBytes temporary_channel_id_arg, uint64_t funding_satoshis_arg, uint64_t dust_limit_satoshis_arg, uint64_t max_htlc_value_in_flight_msat_arg, uint64_t htlc_minimum_msat_arg, uint32_t minimum_depth_arg, uint16_t to_self_delay_arg, uint16_t max_accepted_htlcs_arg, struct LDKPublicKey funding_pubkey_arg, struct LDKPublicKey revocation_basepoint_arg, struct LDKPublicKey payment_basepoint_arg, struct LDKPublicKey delayed_payment_basepoint_arg, struct LDKPublicKey htlc_basepoint_arg, struct LDKPublicKey first_per_commitment_point_arg, struct LDKPublicKey second_per_commitment_point_arg, struct LDKCOption_CVec_u8ZZ shutdown_scriptpubkey_arg, struct LDKChannelTypeFeatures channel_type_arg, enum LDKCOption_NoneZ require_confirmed_inputs_arg);
32561 * Creates a copy of the AcceptChannelV2
32563 struct LDKAcceptChannelV2 AcceptChannelV2_clone(const struct LDKAcceptChannelV2 *NONNULL_PTR orig);
32566 * Checks if two AcceptChannelV2s contain equal inner contents.
32567 * This ignores pointers and is_owned flags and looks at the values in fields.
32568 * Two objects with NULL inner values will be considered "equal" here.
32570 bool AcceptChannelV2_eq(const struct LDKAcceptChannelV2 *NONNULL_PTR a, const struct LDKAcceptChannelV2 *NONNULL_PTR b);
32573 * Frees any resources used by the FundingCreated, if is_owned is set and inner is non-NULL.
32575 void FundingCreated_free(struct LDKFundingCreated this_obj);
32578 * A temporary channel ID, until the funding is established
32580 const uint8_t (*FundingCreated_get_temporary_channel_id(const struct LDKFundingCreated *NONNULL_PTR this_ptr))[32];
32583 * A temporary channel ID, until the funding is established
32585 void FundingCreated_set_temporary_channel_id(struct LDKFundingCreated *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
32588 * The funding transaction ID
32590 const uint8_t (*FundingCreated_get_funding_txid(const struct LDKFundingCreated *NONNULL_PTR this_ptr))[32];
32593 * The funding transaction ID
32595 void FundingCreated_set_funding_txid(struct LDKFundingCreated *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
32598 * The specific output index funding this channel
32600 uint16_t FundingCreated_get_funding_output_index(const struct LDKFundingCreated *NONNULL_PTR this_ptr);
32603 * The specific output index funding this channel
32605 void FundingCreated_set_funding_output_index(struct LDKFundingCreated *NONNULL_PTR this_ptr, uint16_t val);
32608 * The signature of the channel initiator (funder) on the initial commitment transaction
32610 struct LDKECDSASignature FundingCreated_get_signature(const struct LDKFundingCreated *NONNULL_PTR this_ptr);
32613 * The signature of the channel initiator (funder) on the initial commitment transaction
32615 void FundingCreated_set_signature(struct LDKFundingCreated *NONNULL_PTR this_ptr, struct LDKECDSASignature val);
32618 * Constructs a new FundingCreated given each field
32620 MUST_USE_RES struct LDKFundingCreated FundingCreated_new(struct LDKThirtyTwoBytes temporary_channel_id_arg, struct LDKThirtyTwoBytes funding_txid_arg, uint16_t funding_output_index_arg, struct LDKECDSASignature signature_arg);
32623 * Creates a copy of the FundingCreated
32625 struct LDKFundingCreated FundingCreated_clone(const struct LDKFundingCreated *NONNULL_PTR orig);
32628 * Checks if two FundingCreateds contain equal inner contents.
32629 * This ignores pointers and is_owned flags and looks at the values in fields.
32630 * Two objects with NULL inner values will be considered "equal" here.
32632 bool FundingCreated_eq(const struct LDKFundingCreated *NONNULL_PTR a, const struct LDKFundingCreated *NONNULL_PTR b);
32635 * Frees any resources used by the FundingSigned, if is_owned is set and inner is non-NULL.
32637 void FundingSigned_free(struct LDKFundingSigned this_obj);
32642 const uint8_t (*FundingSigned_get_channel_id(const struct LDKFundingSigned *NONNULL_PTR this_ptr))[32];
32647 void FundingSigned_set_channel_id(struct LDKFundingSigned *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
32650 * The signature of the channel acceptor (fundee) on the initial commitment transaction
32652 struct LDKECDSASignature FundingSigned_get_signature(const struct LDKFundingSigned *NONNULL_PTR this_ptr);
32655 * The signature of the channel acceptor (fundee) on the initial commitment transaction
32657 void FundingSigned_set_signature(struct LDKFundingSigned *NONNULL_PTR this_ptr, struct LDKECDSASignature val);
32660 * Constructs a new FundingSigned given each field
32662 MUST_USE_RES struct LDKFundingSigned FundingSigned_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKECDSASignature signature_arg);
32665 * Creates a copy of the FundingSigned
32667 struct LDKFundingSigned FundingSigned_clone(const struct LDKFundingSigned *NONNULL_PTR orig);
32670 * Checks if two FundingSigneds contain equal inner contents.
32671 * This ignores pointers and is_owned flags and looks at the values in fields.
32672 * Two objects with NULL inner values will be considered "equal" here.
32674 bool FundingSigned_eq(const struct LDKFundingSigned *NONNULL_PTR a, const struct LDKFundingSigned *NONNULL_PTR b);
32677 * Frees any resources used by the ChannelReady, if is_owned is set and inner is non-NULL.
32679 void ChannelReady_free(struct LDKChannelReady this_obj);
32684 const uint8_t (*ChannelReady_get_channel_id(const struct LDKChannelReady *NONNULL_PTR this_ptr))[32];
32689 void ChannelReady_set_channel_id(struct LDKChannelReady *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
32692 * The per-commitment point of the second commitment transaction
32694 struct LDKPublicKey ChannelReady_get_next_per_commitment_point(const struct LDKChannelReady *NONNULL_PTR this_ptr);
32697 * The per-commitment point of the second commitment transaction
32699 void ChannelReady_set_next_per_commitment_point(struct LDKChannelReady *NONNULL_PTR this_ptr, struct LDKPublicKey val);
32702 * If set, provides a `short_channel_id` alias for this channel.
32704 * The sender will accept payments to be forwarded over this SCID and forward them to this
32705 * messages' recipient.
32707 struct LDKCOption_u64Z ChannelReady_get_short_channel_id_alias(const struct LDKChannelReady *NONNULL_PTR this_ptr);
32710 * If set, provides a `short_channel_id` alias for this channel.
32712 * The sender will accept payments to be forwarded over this SCID and forward them to this
32713 * messages' recipient.
32715 void ChannelReady_set_short_channel_id_alias(struct LDKChannelReady *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
32718 * Constructs a new ChannelReady given each field
32720 MUST_USE_RES struct LDKChannelReady ChannelReady_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKPublicKey next_per_commitment_point_arg, struct LDKCOption_u64Z short_channel_id_alias_arg);
32723 * Creates a copy of the ChannelReady
32725 struct LDKChannelReady ChannelReady_clone(const struct LDKChannelReady *NONNULL_PTR orig);
32728 * Checks if two ChannelReadys contain equal inner contents.
32729 * This ignores pointers and is_owned flags and looks at the values in fields.
32730 * Two objects with NULL inner values will be considered "equal" here.
32732 bool ChannelReady_eq(const struct LDKChannelReady *NONNULL_PTR a, const struct LDKChannelReady *NONNULL_PTR b);
32735 * Frees any resources used by the TxAddInput, if is_owned is set and inner is non-NULL.
32737 void TxAddInput_free(struct LDKTxAddInput this_obj);
32742 const uint8_t (*TxAddInput_get_channel_id(const struct LDKTxAddInput *NONNULL_PTR this_ptr))[32];
32747 void TxAddInput_set_channel_id(struct LDKTxAddInput *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
32750 * A randomly chosen unique identifier for this input, which is even for initiators and odd for
32753 uint64_t TxAddInput_get_serial_id(const struct LDKTxAddInput *NONNULL_PTR this_ptr);
32756 * A randomly chosen unique identifier for this input, which is even for initiators and odd for
32759 void TxAddInput_set_serial_id(struct LDKTxAddInput *NONNULL_PTR this_ptr, uint64_t val);
32762 * Serialized transaction that contains the output this input spends to verify that it is non
32765 struct LDKTransactionU16LenLimited TxAddInput_get_prevtx(const struct LDKTxAddInput *NONNULL_PTR this_ptr);
32768 * Serialized transaction that contains the output this input spends to verify that it is non
32771 void TxAddInput_set_prevtx(struct LDKTxAddInput *NONNULL_PTR this_ptr, struct LDKTransactionU16LenLimited val);
32774 * The index of the output being spent
32776 uint32_t TxAddInput_get_prevtx_out(const struct LDKTxAddInput *NONNULL_PTR this_ptr);
32779 * The index of the output being spent
32781 void TxAddInput_set_prevtx_out(struct LDKTxAddInput *NONNULL_PTR this_ptr, uint32_t val);
32784 * The sequence number of this input
32786 uint32_t TxAddInput_get_sequence(const struct LDKTxAddInput *NONNULL_PTR this_ptr);
32789 * The sequence number of this input
32791 void TxAddInput_set_sequence(struct LDKTxAddInput *NONNULL_PTR this_ptr, uint32_t val);
32794 * Constructs a new TxAddInput given each field
32796 MUST_USE_RES struct LDKTxAddInput TxAddInput_new(struct LDKThirtyTwoBytes channel_id_arg, uint64_t serial_id_arg, struct LDKTransactionU16LenLimited prevtx_arg, uint32_t prevtx_out_arg, uint32_t sequence_arg);
32799 * Creates a copy of the TxAddInput
32801 struct LDKTxAddInput TxAddInput_clone(const struct LDKTxAddInput *NONNULL_PTR orig);
32804 * Checks if two TxAddInputs contain equal inner contents.
32805 * This ignores pointers and is_owned flags and looks at the values in fields.
32806 * Two objects with NULL inner values will be considered "equal" here.
32808 bool TxAddInput_eq(const struct LDKTxAddInput *NONNULL_PTR a, const struct LDKTxAddInput *NONNULL_PTR b);
32811 * Frees any resources used by the TxAddOutput, if is_owned is set and inner is non-NULL.
32813 void TxAddOutput_free(struct LDKTxAddOutput this_obj);
32818 const uint8_t (*TxAddOutput_get_channel_id(const struct LDKTxAddOutput *NONNULL_PTR this_ptr))[32];
32823 void TxAddOutput_set_channel_id(struct LDKTxAddOutput *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
32826 * A randomly chosen unique identifier for this output, which is even for initiators and odd for
32829 uint64_t TxAddOutput_get_serial_id(const struct LDKTxAddOutput *NONNULL_PTR this_ptr);
32832 * A randomly chosen unique identifier for this output, which is even for initiators and odd for
32835 void TxAddOutput_set_serial_id(struct LDKTxAddOutput *NONNULL_PTR this_ptr, uint64_t val);
32838 * The satoshi value of the output
32840 uint64_t TxAddOutput_get_sats(const struct LDKTxAddOutput *NONNULL_PTR this_ptr);
32843 * The satoshi value of the output
32845 void TxAddOutput_set_sats(struct LDKTxAddOutput *NONNULL_PTR this_ptr, uint64_t val);
32848 * The scriptPubKey for the output
32850 struct LDKu8slice TxAddOutput_get_script(const struct LDKTxAddOutput *NONNULL_PTR this_ptr);
32853 * The scriptPubKey for the output
32855 void TxAddOutput_set_script(struct LDKTxAddOutput *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val);
32858 * Constructs a new TxAddOutput given each field
32860 MUST_USE_RES struct LDKTxAddOutput TxAddOutput_new(struct LDKThirtyTwoBytes channel_id_arg, uint64_t serial_id_arg, uint64_t sats_arg, struct LDKCVec_u8Z script_arg);
32863 * Creates a copy of the TxAddOutput
32865 struct LDKTxAddOutput TxAddOutput_clone(const struct LDKTxAddOutput *NONNULL_PTR orig);
32868 * Checks if two TxAddOutputs contain equal inner contents.
32869 * This ignores pointers and is_owned flags and looks at the values in fields.
32870 * Two objects with NULL inner values will be considered "equal" here.
32872 bool TxAddOutput_eq(const struct LDKTxAddOutput *NONNULL_PTR a, const struct LDKTxAddOutput *NONNULL_PTR b);
32875 * Frees any resources used by the TxRemoveInput, if is_owned is set and inner is non-NULL.
32877 void TxRemoveInput_free(struct LDKTxRemoveInput this_obj);
32882 const uint8_t (*TxRemoveInput_get_channel_id(const struct LDKTxRemoveInput *NONNULL_PTR this_ptr))[32];
32887 void TxRemoveInput_set_channel_id(struct LDKTxRemoveInput *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
32890 * The serial ID of the input to be removed
32892 uint64_t TxRemoveInput_get_serial_id(const struct LDKTxRemoveInput *NONNULL_PTR this_ptr);
32895 * The serial ID of the input to be removed
32897 void TxRemoveInput_set_serial_id(struct LDKTxRemoveInput *NONNULL_PTR this_ptr, uint64_t val);
32900 * Constructs a new TxRemoveInput given each field
32902 MUST_USE_RES struct LDKTxRemoveInput TxRemoveInput_new(struct LDKThirtyTwoBytes channel_id_arg, uint64_t serial_id_arg);
32905 * Creates a copy of the TxRemoveInput
32907 struct LDKTxRemoveInput TxRemoveInput_clone(const struct LDKTxRemoveInput *NONNULL_PTR orig);
32910 * Checks if two TxRemoveInputs contain equal inner contents.
32911 * This ignores pointers and is_owned flags and looks at the values in fields.
32912 * Two objects with NULL inner values will be considered "equal" here.
32914 bool TxRemoveInput_eq(const struct LDKTxRemoveInput *NONNULL_PTR a, const struct LDKTxRemoveInput *NONNULL_PTR b);
32917 * Frees any resources used by the TxRemoveOutput, if is_owned is set and inner is non-NULL.
32919 void TxRemoveOutput_free(struct LDKTxRemoveOutput this_obj);
32924 const uint8_t (*TxRemoveOutput_get_channel_id(const struct LDKTxRemoveOutput *NONNULL_PTR this_ptr))[32];
32929 void TxRemoveOutput_set_channel_id(struct LDKTxRemoveOutput *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
32932 * The serial ID of the output to be removed
32934 uint64_t TxRemoveOutput_get_serial_id(const struct LDKTxRemoveOutput *NONNULL_PTR this_ptr);
32937 * The serial ID of the output to be removed
32939 void TxRemoveOutput_set_serial_id(struct LDKTxRemoveOutput *NONNULL_PTR this_ptr, uint64_t val);
32942 * Constructs a new TxRemoveOutput given each field
32944 MUST_USE_RES struct LDKTxRemoveOutput TxRemoveOutput_new(struct LDKThirtyTwoBytes channel_id_arg, uint64_t serial_id_arg);
32947 * Creates a copy of the TxRemoveOutput
32949 struct LDKTxRemoveOutput TxRemoveOutput_clone(const struct LDKTxRemoveOutput *NONNULL_PTR orig);
32952 * Checks if two TxRemoveOutputs contain equal inner contents.
32953 * This ignores pointers and is_owned flags and looks at the values in fields.
32954 * Two objects with NULL inner values will be considered "equal" here.
32956 bool TxRemoveOutput_eq(const struct LDKTxRemoveOutput *NONNULL_PTR a, const struct LDKTxRemoveOutput *NONNULL_PTR b);
32959 * Frees any resources used by the TxComplete, if is_owned is set and inner is non-NULL.
32961 void TxComplete_free(struct LDKTxComplete this_obj);
32966 const uint8_t (*TxComplete_get_channel_id(const struct LDKTxComplete *NONNULL_PTR this_ptr))[32];
32971 void TxComplete_set_channel_id(struct LDKTxComplete *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
32974 * Constructs a new TxComplete given each field
32976 MUST_USE_RES struct LDKTxComplete TxComplete_new(struct LDKThirtyTwoBytes channel_id_arg);
32979 * Creates a copy of the TxComplete
32981 struct LDKTxComplete TxComplete_clone(const struct LDKTxComplete *NONNULL_PTR orig);
32984 * Checks if two TxCompletes contain equal inner contents.
32985 * This ignores pointers and is_owned flags and looks at the values in fields.
32986 * Two objects with NULL inner values will be considered "equal" here.
32988 bool TxComplete_eq(const struct LDKTxComplete *NONNULL_PTR a, const struct LDKTxComplete *NONNULL_PTR b);
32991 * Frees any resources used by the TxSignatures, if is_owned is set and inner is non-NULL.
32993 void TxSignatures_free(struct LDKTxSignatures this_obj);
32998 const uint8_t (*TxSignatures_get_channel_id(const struct LDKTxSignatures *NONNULL_PTR this_ptr))[32];
33003 void TxSignatures_set_channel_id(struct LDKTxSignatures *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
33008 const uint8_t (*TxSignatures_get_tx_hash(const struct LDKTxSignatures *NONNULL_PTR this_ptr))[32];
33013 void TxSignatures_set_tx_hash(struct LDKTxSignatures *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
33016 * The list of witnesses
33018 * Returns a copy of the field.
33020 struct LDKCVec_WitnessZ TxSignatures_get_witnesses(const struct LDKTxSignatures *NONNULL_PTR this_ptr);
33023 * The list of witnesses
33025 void TxSignatures_set_witnesses(struct LDKTxSignatures *NONNULL_PTR this_ptr, struct LDKCVec_WitnessZ val);
33028 * Constructs a new TxSignatures given each field
33030 MUST_USE_RES struct LDKTxSignatures TxSignatures_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKThirtyTwoBytes tx_hash_arg, struct LDKCVec_WitnessZ witnesses_arg);
33033 * Creates a copy of the TxSignatures
33035 struct LDKTxSignatures TxSignatures_clone(const struct LDKTxSignatures *NONNULL_PTR orig);
33038 * Checks if two TxSignaturess contain equal inner contents.
33039 * This ignores pointers and is_owned flags and looks at the values in fields.
33040 * Two objects with NULL inner values will be considered "equal" here.
33042 bool TxSignatures_eq(const struct LDKTxSignatures *NONNULL_PTR a, const struct LDKTxSignatures *NONNULL_PTR b);
33045 * Frees any resources used by the TxInitRbf, if is_owned is set and inner is non-NULL.
33047 void TxInitRbf_free(struct LDKTxInitRbf this_obj);
33052 const uint8_t (*TxInitRbf_get_channel_id(const struct LDKTxInitRbf *NONNULL_PTR this_ptr))[32];
33057 void TxInitRbf_set_channel_id(struct LDKTxInitRbf *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
33060 * The locktime of the transaction
33062 uint32_t TxInitRbf_get_locktime(const struct LDKTxInitRbf *NONNULL_PTR this_ptr);
33065 * The locktime of the transaction
33067 void TxInitRbf_set_locktime(struct LDKTxInitRbf *NONNULL_PTR this_ptr, uint32_t val);
33070 * The feerate of the transaction
33072 uint32_t TxInitRbf_get_feerate_sat_per_1000_weight(const struct LDKTxInitRbf *NONNULL_PTR this_ptr);
33075 * The feerate of the transaction
33077 void TxInitRbf_set_feerate_sat_per_1000_weight(struct LDKTxInitRbf *NONNULL_PTR this_ptr, uint32_t val);
33080 * The number of satoshis the sender will contribute to or, if negative, remove from
33081 * (e.g. splice-out) the funding output of the transaction
33083 struct LDKCOption_i64Z TxInitRbf_get_funding_output_contribution(const struct LDKTxInitRbf *NONNULL_PTR this_ptr);
33086 * The number of satoshis the sender will contribute to or, if negative, remove from
33087 * (e.g. splice-out) the funding output of the transaction
33089 void TxInitRbf_set_funding_output_contribution(struct LDKTxInitRbf *NONNULL_PTR this_ptr, struct LDKCOption_i64Z val);
33092 * Constructs a new TxInitRbf given each field
33094 MUST_USE_RES struct LDKTxInitRbf TxInitRbf_new(struct LDKThirtyTwoBytes channel_id_arg, uint32_t locktime_arg, uint32_t feerate_sat_per_1000_weight_arg, struct LDKCOption_i64Z funding_output_contribution_arg);
33097 * Creates a copy of the TxInitRbf
33099 struct LDKTxInitRbf TxInitRbf_clone(const struct LDKTxInitRbf *NONNULL_PTR orig);
33102 * Checks if two TxInitRbfs contain equal inner contents.
33103 * This ignores pointers and is_owned flags and looks at the values in fields.
33104 * Two objects with NULL inner values will be considered "equal" here.
33106 bool TxInitRbf_eq(const struct LDKTxInitRbf *NONNULL_PTR a, const struct LDKTxInitRbf *NONNULL_PTR b);
33109 * Frees any resources used by the TxAckRbf, if is_owned is set and inner is non-NULL.
33111 void TxAckRbf_free(struct LDKTxAckRbf this_obj);
33116 const uint8_t (*TxAckRbf_get_channel_id(const struct LDKTxAckRbf *NONNULL_PTR this_ptr))[32];
33121 void TxAckRbf_set_channel_id(struct LDKTxAckRbf *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
33124 * The number of satoshis the sender will contribute to or, if negative, remove from
33125 * (e.g. splice-out) the funding output of the transaction
33127 struct LDKCOption_i64Z TxAckRbf_get_funding_output_contribution(const struct LDKTxAckRbf *NONNULL_PTR this_ptr);
33130 * The number of satoshis the sender will contribute to or, if negative, remove from
33131 * (e.g. splice-out) the funding output of the transaction
33133 void TxAckRbf_set_funding_output_contribution(struct LDKTxAckRbf *NONNULL_PTR this_ptr, struct LDKCOption_i64Z val);
33136 * Constructs a new TxAckRbf given each field
33138 MUST_USE_RES struct LDKTxAckRbf TxAckRbf_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKCOption_i64Z funding_output_contribution_arg);
33141 * Creates a copy of the TxAckRbf
33143 struct LDKTxAckRbf TxAckRbf_clone(const struct LDKTxAckRbf *NONNULL_PTR orig);
33146 * Checks if two TxAckRbfs contain equal inner contents.
33147 * This ignores pointers and is_owned flags and looks at the values in fields.
33148 * Two objects with NULL inner values will be considered "equal" here.
33150 bool TxAckRbf_eq(const struct LDKTxAckRbf *NONNULL_PTR a, const struct LDKTxAckRbf *NONNULL_PTR b);
33153 * Frees any resources used by the TxAbort, if is_owned is set and inner is non-NULL.
33155 void TxAbort_free(struct LDKTxAbort this_obj);
33160 const uint8_t (*TxAbort_get_channel_id(const struct LDKTxAbort *NONNULL_PTR this_ptr))[32];
33165 void TxAbort_set_channel_id(struct LDKTxAbort *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
33170 * Returns a copy of the field.
33172 struct LDKCVec_u8Z TxAbort_get_data(const struct LDKTxAbort *NONNULL_PTR this_ptr);
33177 void TxAbort_set_data(struct LDKTxAbort *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val);
33180 * Constructs a new TxAbort given each field
33182 MUST_USE_RES struct LDKTxAbort TxAbort_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKCVec_u8Z data_arg);
33185 * Creates a copy of the TxAbort
33187 struct LDKTxAbort TxAbort_clone(const struct LDKTxAbort *NONNULL_PTR orig);
33190 * Checks if two TxAborts contain equal inner contents.
33191 * This ignores pointers and is_owned flags and looks at the values in fields.
33192 * Two objects with NULL inner values will be considered "equal" here.
33194 bool TxAbort_eq(const struct LDKTxAbort *NONNULL_PTR a, const struct LDKTxAbort *NONNULL_PTR b);
33197 * Frees any resources used by the Shutdown, if is_owned is set and inner is non-NULL.
33199 void Shutdown_free(struct LDKShutdown this_obj);
33204 const uint8_t (*Shutdown_get_channel_id(const struct LDKShutdown *NONNULL_PTR this_ptr))[32];
33209 void Shutdown_set_channel_id(struct LDKShutdown *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
33212 * The destination of this peer's funds on closing.
33214 * Must be in one of these forms: P2PKH, P2SH, P2WPKH, P2WSH, P2TR.
33216 struct LDKu8slice Shutdown_get_scriptpubkey(const struct LDKShutdown *NONNULL_PTR this_ptr);
33219 * The destination of this peer's funds on closing.
33221 * Must be in one of these forms: P2PKH, P2SH, P2WPKH, P2WSH, P2TR.
33223 void Shutdown_set_scriptpubkey(struct LDKShutdown *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val);
33226 * Constructs a new Shutdown given each field
33228 MUST_USE_RES struct LDKShutdown Shutdown_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKCVec_u8Z scriptpubkey_arg);
33231 * Creates a copy of the Shutdown
33233 struct LDKShutdown Shutdown_clone(const struct LDKShutdown *NONNULL_PTR orig);
33236 * Checks if two Shutdowns contain equal inner contents.
33237 * This ignores pointers and is_owned flags and looks at the values in fields.
33238 * Two objects with NULL inner values will be considered "equal" here.
33240 bool Shutdown_eq(const struct LDKShutdown *NONNULL_PTR a, const struct LDKShutdown *NONNULL_PTR b);
33243 * Frees any resources used by the ClosingSignedFeeRange, if is_owned is set and inner is non-NULL.
33245 void ClosingSignedFeeRange_free(struct LDKClosingSignedFeeRange this_obj);
33248 * The minimum absolute fee, in satoshis, which the sender is willing to place on the closing
33251 uint64_t ClosingSignedFeeRange_get_min_fee_satoshis(const struct LDKClosingSignedFeeRange *NONNULL_PTR this_ptr);
33254 * The minimum absolute fee, in satoshis, which the sender is willing to place on the closing
33257 void ClosingSignedFeeRange_set_min_fee_satoshis(struct LDKClosingSignedFeeRange *NONNULL_PTR this_ptr, uint64_t val);
33260 * The maximum absolute fee, in satoshis, which the sender is willing to place on the closing
33263 uint64_t ClosingSignedFeeRange_get_max_fee_satoshis(const struct LDKClosingSignedFeeRange *NONNULL_PTR this_ptr);
33266 * The maximum absolute fee, in satoshis, which the sender is willing to place on the closing
33269 void ClosingSignedFeeRange_set_max_fee_satoshis(struct LDKClosingSignedFeeRange *NONNULL_PTR this_ptr, uint64_t val);
33272 * Constructs a new ClosingSignedFeeRange given each field
33274 MUST_USE_RES struct LDKClosingSignedFeeRange ClosingSignedFeeRange_new(uint64_t min_fee_satoshis_arg, uint64_t max_fee_satoshis_arg);
33277 * Creates a copy of the ClosingSignedFeeRange
33279 struct LDKClosingSignedFeeRange ClosingSignedFeeRange_clone(const struct LDKClosingSignedFeeRange *NONNULL_PTR orig);
33282 * Checks if two ClosingSignedFeeRanges contain equal inner contents.
33283 * This ignores pointers and is_owned flags and looks at the values in fields.
33284 * Two objects with NULL inner values will be considered "equal" here.
33286 bool ClosingSignedFeeRange_eq(const struct LDKClosingSignedFeeRange *NONNULL_PTR a, const struct LDKClosingSignedFeeRange *NONNULL_PTR b);
33289 * Frees any resources used by the ClosingSigned, if is_owned is set and inner is non-NULL.
33291 void ClosingSigned_free(struct LDKClosingSigned this_obj);
33296 const uint8_t (*ClosingSigned_get_channel_id(const struct LDKClosingSigned *NONNULL_PTR this_ptr))[32];
33301 void ClosingSigned_set_channel_id(struct LDKClosingSigned *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
33304 * The proposed total fee for the closing transaction
33306 uint64_t ClosingSigned_get_fee_satoshis(const struct LDKClosingSigned *NONNULL_PTR this_ptr);
33309 * The proposed total fee for the closing transaction
33311 void ClosingSigned_set_fee_satoshis(struct LDKClosingSigned *NONNULL_PTR this_ptr, uint64_t val);
33314 * A signature on the closing transaction
33316 struct LDKECDSASignature ClosingSigned_get_signature(const struct LDKClosingSigned *NONNULL_PTR this_ptr);
33319 * A signature on the closing transaction
33321 void ClosingSigned_set_signature(struct LDKClosingSigned *NONNULL_PTR this_ptr, struct LDKECDSASignature val);
33324 * The minimum and maximum fees which the sender is willing to accept, provided only by new
33327 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
33329 struct LDKClosingSignedFeeRange ClosingSigned_get_fee_range(const struct LDKClosingSigned *NONNULL_PTR this_ptr);
33332 * The minimum and maximum fees which the sender is willing to accept, provided only by new
33335 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
33337 void ClosingSigned_set_fee_range(struct LDKClosingSigned *NONNULL_PTR this_ptr, struct LDKClosingSignedFeeRange val);
33340 * Constructs a new ClosingSigned given each field
33342 * Note that fee_range_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
33344 MUST_USE_RES struct LDKClosingSigned ClosingSigned_new(struct LDKThirtyTwoBytes channel_id_arg, uint64_t fee_satoshis_arg, struct LDKECDSASignature signature_arg, struct LDKClosingSignedFeeRange fee_range_arg);
33347 * Creates a copy of the ClosingSigned
33349 struct LDKClosingSigned ClosingSigned_clone(const struct LDKClosingSigned *NONNULL_PTR orig);
33352 * Checks if two ClosingSigneds contain equal inner contents.
33353 * This ignores pointers and is_owned flags and looks at the values in fields.
33354 * Two objects with NULL inner values will be considered "equal" here.
33356 bool ClosingSigned_eq(const struct LDKClosingSigned *NONNULL_PTR a, const struct LDKClosingSigned *NONNULL_PTR b);
33359 * Frees any resources used by the UpdateAddHTLC, if is_owned is set and inner is non-NULL.
33361 void UpdateAddHTLC_free(struct LDKUpdateAddHTLC this_obj);
33366 const uint8_t (*UpdateAddHTLC_get_channel_id(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr))[32];
33371 void UpdateAddHTLC_set_channel_id(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
33376 uint64_t UpdateAddHTLC_get_htlc_id(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr);
33381 void UpdateAddHTLC_set_htlc_id(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, uint64_t val);
33384 * The HTLC value in milli-satoshi
33386 uint64_t UpdateAddHTLC_get_amount_msat(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr);
33389 * The HTLC value in milli-satoshi
33391 void UpdateAddHTLC_set_amount_msat(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, uint64_t val);
33394 * The payment hash, the pre-image of which controls HTLC redemption
33396 const uint8_t (*UpdateAddHTLC_get_payment_hash(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr))[32];
33399 * The payment hash, the pre-image of which controls HTLC redemption
33401 void UpdateAddHTLC_set_payment_hash(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
33404 * The expiry height of the HTLC
33406 uint32_t UpdateAddHTLC_get_cltv_expiry(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr);
33409 * The expiry height of the HTLC
33411 void UpdateAddHTLC_set_cltv_expiry(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, uint32_t val);
33414 * The extra fee skimmed by the sender of this message. See
33415 * [`ChannelConfig::accept_underpaying_htlcs`].
33417 * [`ChannelConfig::accept_underpaying_htlcs`]: crate::util::config::ChannelConfig::accept_underpaying_htlcs
33419 struct LDKCOption_u64Z UpdateAddHTLC_get_skimmed_fee_msat(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr);
33422 * The extra fee skimmed by the sender of this message. See
33423 * [`ChannelConfig::accept_underpaying_htlcs`].
33425 * [`ChannelConfig::accept_underpaying_htlcs`]: crate::util::config::ChannelConfig::accept_underpaying_htlcs
33427 void UpdateAddHTLC_set_skimmed_fee_msat(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
33430 * Creates a copy of the UpdateAddHTLC
33432 struct LDKUpdateAddHTLC UpdateAddHTLC_clone(const struct LDKUpdateAddHTLC *NONNULL_PTR orig);
33435 * Checks if two UpdateAddHTLCs contain equal inner contents.
33436 * This ignores pointers and is_owned flags and looks at the values in fields.
33437 * Two objects with NULL inner values will be considered "equal" here.
33439 bool UpdateAddHTLC_eq(const struct LDKUpdateAddHTLC *NONNULL_PTR a, const struct LDKUpdateAddHTLC *NONNULL_PTR b);
33442 * Frees any resources used by the OnionMessage, if is_owned is set and inner is non-NULL.
33444 void OnionMessage_free(struct LDKOnionMessage this_obj);
33447 * Used in decrypting the onion packet's payload.
33449 struct LDKPublicKey OnionMessage_get_blinding_point(const struct LDKOnionMessage *NONNULL_PTR this_ptr);
33452 * Used in decrypting the onion packet's payload.
33454 void OnionMessage_set_blinding_point(struct LDKOnionMessage *NONNULL_PTR this_ptr, struct LDKPublicKey val);
33457 * The full onion packet including hop data, pubkey, and hmac
33459 struct LDKPacket OnionMessage_get_onion_routing_packet(const struct LDKOnionMessage *NONNULL_PTR this_ptr);
33462 * The full onion packet including hop data, pubkey, and hmac
33464 void OnionMessage_set_onion_routing_packet(struct LDKOnionMessage *NONNULL_PTR this_ptr, struct LDKPacket val);
33467 * Constructs a new OnionMessage given each field
33469 MUST_USE_RES struct LDKOnionMessage OnionMessage_new(struct LDKPublicKey blinding_point_arg, struct LDKPacket onion_routing_packet_arg);
33472 * Creates a copy of the OnionMessage
33474 struct LDKOnionMessage OnionMessage_clone(const struct LDKOnionMessage *NONNULL_PTR orig);
33477 * Checks if two OnionMessages contain equal inner contents.
33478 * This ignores pointers and is_owned flags and looks at the values in fields.
33479 * Two objects with NULL inner values will be considered "equal" here.
33481 bool OnionMessage_eq(const struct LDKOnionMessage *NONNULL_PTR a, const struct LDKOnionMessage *NONNULL_PTR b);
33484 * Frees any resources used by the UpdateFulfillHTLC, if is_owned is set and inner is non-NULL.
33486 void UpdateFulfillHTLC_free(struct LDKUpdateFulfillHTLC this_obj);
33491 const uint8_t (*UpdateFulfillHTLC_get_channel_id(const struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr))[32];
33496 void UpdateFulfillHTLC_set_channel_id(struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
33501 uint64_t UpdateFulfillHTLC_get_htlc_id(const struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr);
33506 void UpdateFulfillHTLC_set_htlc_id(struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr, uint64_t val);
33509 * The pre-image of the payment hash, allowing HTLC redemption
33511 const uint8_t (*UpdateFulfillHTLC_get_payment_preimage(const struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr))[32];
33514 * The pre-image of the payment hash, allowing HTLC redemption
33516 void UpdateFulfillHTLC_set_payment_preimage(struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
33519 * Constructs a new UpdateFulfillHTLC given each field
33521 MUST_USE_RES struct LDKUpdateFulfillHTLC UpdateFulfillHTLC_new(struct LDKThirtyTwoBytes channel_id_arg, uint64_t htlc_id_arg, struct LDKThirtyTwoBytes payment_preimage_arg);
33524 * Creates a copy of the UpdateFulfillHTLC
33526 struct LDKUpdateFulfillHTLC UpdateFulfillHTLC_clone(const struct LDKUpdateFulfillHTLC *NONNULL_PTR orig);
33529 * Checks if two UpdateFulfillHTLCs contain equal inner contents.
33530 * This ignores pointers and is_owned flags and looks at the values in fields.
33531 * Two objects with NULL inner values will be considered "equal" here.
33533 bool UpdateFulfillHTLC_eq(const struct LDKUpdateFulfillHTLC *NONNULL_PTR a, const struct LDKUpdateFulfillHTLC *NONNULL_PTR b);
33536 * Frees any resources used by the UpdateFailHTLC, if is_owned is set and inner is non-NULL.
33538 void UpdateFailHTLC_free(struct LDKUpdateFailHTLC this_obj);
33543 const uint8_t (*UpdateFailHTLC_get_channel_id(const struct LDKUpdateFailHTLC *NONNULL_PTR this_ptr))[32];
33548 void UpdateFailHTLC_set_channel_id(struct LDKUpdateFailHTLC *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
33553 uint64_t UpdateFailHTLC_get_htlc_id(const struct LDKUpdateFailHTLC *NONNULL_PTR this_ptr);
33558 void UpdateFailHTLC_set_htlc_id(struct LDKUpdateFailHTLC *NONNULL_PTR this_ptr, uint64_t val);
33561 * Creates a copy of the UpdateFailHTLC
33563 struct LDKUpdateFailHTLC UpdateFailHTLC_clone(const struct LDKUpdateFailHTLC *NONNULL_PTR orig);
33566 * Checks if two UpdateFailHTLCs contain equal inner contents.
33567 * This ignores pointers and is_owned flags and looks at the values in fields.
33568 * Two objects with NULL inner values will be considered "equal" here.
33570 bool UpdateFailHTLC_eq(const struct LDKUpdateFailHTLC *NONNULL_PTR a, const struct LDKUpdateFailHTLC *NONNULL_PTR b);
33573 * Frees any resources used by the UpdateFailMalformedHTLC, if is_owned is set and inner is non-NULL.
33575 void UpdateFailMalformedHTLC_free(struct LDKUpdateFailMalformedHTLC this_obj);
33580 const uint8_t (*UpdateFailMalformedHTLC_get_channel_id(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr))[32];
33585 void UpdateFailMalformedHTLC_set_channel_id(struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
33590 uint64_t UpdateFailMalformedHTLC_get_htlc_id(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr);
33595 void UpdateFailMalformedHTLC_set_htlc_id(struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr, uint64_t val);
33600 uint16_t UpdateFailMalformedHTLC_get_failure_code(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr);
33605 void UpdateFailMalformedHTLC_set_failure_code(struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr, uint16_t val);
33608 * Creates a copy of the UpdateFailMalformedHTLC
33610 struct LDKUpdateFailMalformedHTLC UpdateFailMalformedHTLC_clone(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR orig);
33613 * Checks if two UpdateFailMalformedHTLCs contain equal inner contents.
33614 * This ignores pointers and is_owned flags and looks at the values in fields.
33615 * Two objects with NULL inner values will be considered "equal" here.
33617 bool UpdateFailMalformedHTLC_eq(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR a, const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR b);
33620 * Frees any resources used by the CommitmentSigned, if is_owned is set and inner is non-NULL.
33622 void CommitmentSigned_free(struct LDKCommitmentSigned this_obj);
33627 const uint8_t (*CommitmentSigned_get_channel_id(const struct LDKCommitmentSigned *NONNULL_PTR this_ptr))[32];
33632 void CommitmentSigned_set_channel_id(struct LDKCommitmentSigned *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
33635 * A signature on the commitment transaction
33637 struct LDKECDSASignature CommitmentSigned_get_signature(const struct LDKCommitmentSigned *NONNULL_PTR this_ptr);
33640 * A signature on the commitment transaction
33642 void CommitmentSigned_set_signature(struct LDKCommitmentSigned *NONNULL_PTR this_ptr, struct LDKECDSASignature val);
33645 * Signatures on the HTLC transactions
33647 * Returns a copy of the field.
33649 struct LDKCVec_ECDSASignatureZ CommitmentSigned_get_htlc_signatures(const struct LDKCommitmentSigned *NONNULL_PTR this_ptr);
33652 * Signatures on the HTLC transactions
33654 void CommitmentSigned_set_htlc_signatures(struct LDKCommitmentSigned *NONNULL_PTR this_ptr, struct LDKCVec_ECDSASignatureZ val);
33657 * Constructs a new CommitmentSigned given each field
33659 MUST_USE_RES struct LDKCommitmentSigned CommitmentSigned_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKECDSASignature signature_arg, struct LDKCVec_ECDSASignatureZ htlc_signatures_arg);
33662 * Creates a copy of the CommitmentSigned
33664 struct LDKCommitmentSigned CommitmentSigned_clone(const struct LDKCommitmentSigned *NONNULL_PTR orig);
33667 * Checks if two CommitmentSigneds contain equal inner contents.
33668 * This ignores pointers and is_owned flags and looks at the values in fields.
33669 * Two objects with NULL inner values will be considered "equal" here.
33671 bool CommitmentSigned_eq(const struct LDKCommitmentSigned *NONNULL_PTR a, const struct LDKCommitmentSigned *NONNULL_PTR b);
33674 * Frees any resources used by the RevokeAndACK, if is_owned is set and inner is non-NULL.
33676 void RevokeAndACK_free(struct LDKRevokeAndACK this_obj);
33681 const uint8_t (*RevokeAndACK_get_channel_id(const struct LDKRevokeAndACK *NONNULL_PTR this_ptr))[32];
33686 void RevokeAndACK_set_channel_id(struct LDKRevokeAndACK *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
33689 * The secret corresponding to the per-commitment point
33691 const uint8_t (*RevokeAndACK_get_per_commitment_secret(const struct LDKRevokeAndACK *NONNULL_PTR this_ptr))[32];
33694 * The secret corresponding to the per-commitment point
33696 void RevokeAndACK_set_per_commitment_secret(struct LDKRevokeAndACK *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
33699 * The next sender-broadcast commitment transaction's per-commitment point
33701 struct LDKPublicKey RevokeAndACK_get_next_per_commitment_point(const struct LDKRevokeAndACK *NONNULL_PTR this_ptr);
33704 * The next sender-broadcast commitment transaction's per-commitment point
33706 void RevokeAndACK_set_next_per_commitment_point(struct LDKRevokeAndACK *NONNULL_PTR this_ptr, struct LDKPublicKey val);
33709 * Constructs a new RevokeAndACK given each field
33711 MUST_USE_RES struct LDKRevokeAndACK RevokeAndACK_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKThirtyTwoBytes per_commitment_secret_arg, struct LDKPublicKey next_per_commitment_point_arg);
33714 * Creates a copy of the RevokeAndACK
33716 struct LDKRevokeAndACK RevokeAndACK_clone(const struct LDKRevokeAndACK *NONNULL_PTR orig);
33719 * Checks if two RevokeAndACKs contain equal inner contents.
33720 * This ignores pointers and is_owned flags and looks at the values in fields.
33721 * Two objects with NULL inner values will be considered "equal" here.
33723 bool RevokeAndACK_eq(const struct LDKRevokeAndACK *NONNULL_PTR a, const struct LDKRevokeAndACK *NONNULL_PTR b);
33726 * Frees any resources used by the UpdateFee, if is_owned is set and inner is non-NULL.
33728 void UpdateFee_free(struct LDKUpdateFee this_obj);
33733 const uint8_t (*UpdateFee_get_channel_id(const struct LDKUpdateFee *NONNULL_PTR this_ptr))[32];
33738 void UpdateFee_set_channel_id(struct LDKUpdateFee *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
33741 * Fee rate per 1000-weight of the transaction
33743 uint32_t UpdateFee_get_feerate_per_kw(const struct LDKUpdateFee *NONNULL_PTR this_ptr);
33746 * Fee rate per 1000-weight of the transaction
33748 void UpdateFee_set_feerate_per_kw(struct LDKUpdateFee *NONNULL_PTR this_ptr, uint32_t val);
33751 * Constructs a new UpdateFee given each field
33753 MUST_USE_RES struct LDKUpdateFee UpdateFee_new(struct LDKThirtyTwoBytes channel_id_arg, uint32_t feerate_per_kw_arg);
33756 * Creates a copy of the UpdateFee
33758 struct LDKUpdateFee UpdateFee_clone(const struct LDKUpdateFee *NONNULL_PTR orig);
33761 * Checks if two UpdateFees contain equal inner contents.
33762 * This ignores pointers and is_owned flags and looks at the values in fields.
33763 * Two objects with NULL inner values will be considered "equal" here.
33765 bool UpdateFee_eq(const struct LDKUpdateFee *NONNULL_PTR a, const struct LDKUpdateFee *NONNULL_PTR b);
33768 * Frees any resources used by the ChannelReestablish, if is_owned is set and inner is non-NULL.
33770 void ChannelReestablish_free(struct LDKChannelReestablish this_obj);
33775 const uint8_t (*ChannelReestablish_get_channel_id(const struct LDKChannelReestablish *NONNULL_PTR this_ptr))[32];
33780 void ChannelReestablish_set_channel_id(struct LDKChannelReestablish *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
33783 * The next commitment number for the sender
33785 uint64_t ChannelReestablish_get_next_local_commitment_number(const struct LDKChannelReestablish *NONNULL_PTR this_ptr);
33788 * The next commitment number for the sender
33790 void ChannelReestablish_set_next_local_commitment_number(struct LDKChannelReestablish *NONNULL_PTR this_ptr, uint64_t val);
33793 * The next commitment number for the recipient
33795 uint64_t ChannelReestablish_get_next_remote_commitment_number(const struct LDKChannelReestablish *NONNULL_PTR this_ptr);
33798 * The next commitment number for the recipient
33800 void ChannelReestablish_set_next_remote_commitment_number(struct LDKChannelReestablish *NONNULL_PTR this_ptr, uint64_t val);
33803 * Proof that the sender knows the per-commitment secret of a specific commitment transaction
33804 * belonging to the recipient
33806 const uint8_t (*ChannelReestablish_get_your_last_per_commitment_secret(const struct LDKChannelReestablish *NONNULL_PTR this_ptr))[32];
33809 * Proof that the sender knows the per-commitment secret of a specific commitment transaction
33810 * belonging to the recipient
33812 void ChannelReestablish_set_your_last_per_commitment_secret(struct LDKChannelReestablish *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
33815 * The sender's per-commitment point for their current commitment transaction
33817 struct LDKPublicKey ChannelReestablish_get_my_current_per_commitment_point(const struct LDKChannelReestablish *NONNULL_PTR this_ptr);
33820 * The sender's per-commitment point for their current commitment transaction
33822 void ChannelReestablish_set_my_current_per_commitment_point(struct LDKChannelReestablish *NONNULL_PTR this_ptr, struct LDKPublicKey val);
33825 * The next funding transaction ID
33827 struct LDKCOption_ThirtyTwoBytesZ ChannelReestablish_get_next_funding_txid(const struct LDKChannelReestablish *NONNULL_PTR this_ptr);
33830 * The next funding transaction ID
33832 void ChannelReestablish_set_next_funding_txid(struct LDKChannelReestablish *NONNULL_PTR this_ptr, struct LDKCOption_ThirtyTwoBytesZ val);
33835 * Constructs a new ChannelReestablish given each field
33837 MUST_USE_RES struct LDKChannelReestablish ChannelReestablish_new(struct LDKThirtyTwoBytes channel_id_arg, uint64_t next_local_commitment_number_arg, uint64_t next_remote_commitment_number_arg, struct LDKThirtyTwoBytes your_last_per_commitment_secret_arg, struct LDKPublicKey my_current_per_commitment_point_arg, struct LDKCOption_ThirtyTwoBytesZ next_funding_txid_arg);
33840 * Creates a copy of the ChannelReestablish
33842 struct LDKChannelReestablish ChannelReestablish_clone(const struct LDKChannelReestablish *NONNULL_PTR orig);
33845 * Checks if two ChannelReestablishs contain equal inner contents.
33846 * This ignores pointers and is_owned flags and looks at the values in fields.
33847 * Two objects with NULL inner values will be considered "equal" here.
33849 bool ChannelReestablish_eq(const struct LDKChannelReestablish *NONNULL_PTR a, const struct LDKChannelReestablish *NONNULL_PTR b);
33852 * Frees any resources used by the AnnouncementSignatures, if is_owned is set and inner is non-NULL.
33854 void AnnouncementSignatures_free(struct LDKAnnouncementSignatures this_obj);
33859 const uint8_t (*AnnouncementSignatures_get_channel_id(const struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr))[32];
33864 void AnnouncementSignatures_set_channel_id(struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
33867 * The short channel ID
33869 uint64_t AnnouncementSignatures_get_short_channel_id(const struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr);
33872 * The short channel ID
33874 void AnnouncementSignatures_set_short_channel_id(struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr, uint64_t val);
33877 * A signature by the node key
33879 struct LDKECDSASignature AnnouncementSignatures_get_node_signature(const struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr);
33882 * A signature by the node key
33884 void AnnouncementSignatures_set_node_signature(struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr, struct LDKECDSASignature val);
33887 * A signature by the funding key
33889 struct LDKECDSASignature AnnouncementSignatures_get_bitcoin_signature(const struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr);
33892 * A signature by the funding key
33894 void AnnouncementSignatures_set_bitcoin_signature(struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr, struct LDKECDSASignature val);
33897 * Constructs a new AnnouncementSignatures given each field
33899 MUST_USE_RES struct LDKAnnouncementSignatures AnnouncementSignatures_new(struct LDKThirtyTwoBytes channel_id_arg, uint64_t short_channel_id_arg, struct LDKECDSASignature node_signature_arg, struct LDKECDSASignature bitcoin_signature_arg);
33902 * Creates a copy of the AnnouncementSignatures
33904 struct LDKAnnouncementSignatures AnnouncementSignatures_clone(const struct LDKAnnouncementSignatures *NONNULL_PTR orig);
33907 * Checks if two AnnouncementSignaturess contain equal inner contents.
33908 * This ignores pointers and is_owned flags and looks at the values in fields.
33909 * Two objects with NULL inner values will be considered "equal" here.
33911 bool AnnouncementSignatures_eq(const struct LDKAnnouncementSignatures *NONNULL_PTR a, const struct LDKAnnouncementSignatures *NONNULL_PTR b);
33914 * Frees any resources used by the SocketAddress
33916 void SocketAddress_free(struct LDKSocketAddress this_ptr);
33919 * Creates a copy of the SocketAddress
33921 struct LDKSocketAddress SocketAddress_clone(const struct LDKSocketAddress *NONNULL_PTR orig);
33924 * Utility method to constructs a new TcpIpV4-variant SocketAddress
33926 struct LDKSocketAddress SocketAddress_tcp_ip_v4(struct LDKFourBytes addr, uint16_t port);
33929 * Utility method to constructs a new TcpIpV6-variant SocketAddress
33931 struct LDKSocketAddress SocketAddress_tcp_ip_v6(struct LDKSixteenBytes addr, uint16_t port);
33934 * Utility method to constructs a new OnionV2-variant SocketAddress
33936 struct LDKSocketAddress SocketAddress_onion_v2(struct LDKTwelveBytes a);
33939 * Utility method to constructs a new OnionV3-variant SocketAddress
33941 struct LDKSocketAddress SocketAddress_onion_v3(struct LDKThirtyTwoBytes ed25519_pubkey, uint16_t checksum, uint8_t version, uint16_t port);
33944 * Utility method to constructs a new Hostname-variant SocketAddress
33946 struct LDKSocketAddress SocketAddress_hostname(struct LDKHostname hostname, uint16_t port);
33949 * Checks if two SocketAddresss contain equal inner contents.
33950 * This ignores pointers and is_owned flags and looks at the values in fields.
33952 bool SocketAddress_eq(const struct LDKSocketAddress *NONNULL_PTR a, const struct LDKSocketAddress *NONNULL_PTR b);
33955 * Serialize the SocketAddress object into a byte array which can be read by SocketAddress_read
33957 struct LDKCVec_u8Z SocketAddress_write(const struct LDKSocketAddress *NONNULL_PTR obj);
33960 * Read a SocketAddress from a byte array, created by SocketAddress_write
33962 struct LDKCResult_SocketAddressDecodeErrorZ SocketAddress_read(struct LDKu8slice ser);
33965 * Creates a copy of the SocketAddressParseError
33967 enum LDKSocketAddressParseError SocketAddressParseError_clone(const enum LDKSocketAddressParseError *NONNULL_PTR orig);
33970 * Utility method to constructs a new SocketAddrParse-variant SocketAddressParseError
33972 enum LDKSocketAddressParseError SocketAddressParseError_socket_addr_parse(void);
33975 * Utility method to constructs a new InvalidInput-variant SocketAddressParseError
33977 enum LDKSocketAddressParseError SocketAddressParseError_invalid_input(void);
33980 * Utility method to constructs a new InvalidPort-variant SocketAddressParseError
33982 enum LDKSocketAddressParseError SocketAddressParseError_invalid_port(void);
33985 * Utility method to constructs a new InvalidOnionV3-variant SocketAddressParseError
33987 enum LDKSocketAddressParseError SocketAddressParseError_invalid_onion_v3(void);
33990 * Checks if two SocketAddressParseErrors contain equal inner contents.
33991 * This ignores pointers and is_owned flags and looks at the values in fields.
33993 bool SocketAddressParseError_eq(const enum LDKSocketAddressParseError *NONNULL_PTR a, const enum LDKSocketAddressParseError *NONNULL_PTR b);
33996 * Parses an OnionV3 host and port into a [`SocketAddress::OnionV3`].
33998 * The host part must end with \".onion\".
34000 struct LDKCResult_SocketAddressSocketAddressParseErrorZ parse_onion_address(struct LDKStr host, uint16_t port);
34003 * Read a SocketAddress object from a string
34005 struct LDKCResult_SocketAddressSocketAddressParseErrorZ SocketAddress_from_str(struct LDKStr s);
34008 * Frees any resources used by the UnsignedGossipMessage
34010 void UnsignedGossipMessage_free(struct LDKUnsignedGossipMessage this_ptr);
34013 * Creates a copy of the UnsignedGossipMessage
34015 struct LDKUnsignedGossipMessage UnsignedGossipMessage_clone(const struct LDKUnsignedGossipMessage *NONNULL_PTR orig);
34018 * Utility method to constructs a new ChannelAnnouncement-variant UnsignedGossipMessage
34020 struct LDKUnsignedGossipMessage UnsignedGossipMessage_channel_announcement(struct LDKUnsignedChannelAnnouncement a);
34023 * Utility method to constructs a new ChannelUpdate-variant UnsignedGossipMessage
34025 struct LDKUnsignedGossipMessage UnsignedGossipMessage_channel_update(struct LDKUnsignedChannelUpdate a);
34028 * Utility method to constructs a new NodeAnnouncement-variant UnsignedGossipMessage
34030 struct LDKUnsignedGossipMessage UnsignedGossipMessage_node_announcement(struct LDKUnsignedNodeAnnouncement a);
34033 * Serialize the UnsignedGossipMessage object into a byte array which can be read by UnsignedGossipMessage_read
34035 struct LDKCVec_u8Z UnsignedGossipMessage_write(const struct LDKUnsignedGossipMessage *NONNULL_PTR obj);
34038 * Frees any resources used by the UnsignedNodeAnnouncement, if is_owned is set and inner is non-NULL.
34040 void UnsignedNodeAnnouncement_free(struct LDKUnsignedNodeAnnouncement this_obj);
34043 * The advertised features
34045 struct LDKNodeFeatures UnsignedNodeAnnouncement_get_features(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr);
34048 * The advertised features
34050 void UnsignedNodeAnnouncement_set_features(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKNodeFeatures val);
34053 * A strictly monotonic announcement counter, with gaps allowed
34055 uint32_t UnsignedNodeAnnouncement_get_timestamp(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr);
34058 * A strictly monotonic announcement counter, with gaps allowed
34060 void UnsignedNodeAnnouncement_set_timestamp(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, uint32_t val);
34063 * The `node_id` this announcement originated from (don't rebroadcast the `node_announcement` back
34066 struct LDKNodeId UnsignedNodeAnnouncement_get_node_id(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr);
34069 * The `node_id` this announcement originated from (don't rebroadcast the `node_announcement` back
34072 void UnsignedNodeAnnouncement_set_node_id(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKNodeId val);
34075 * An RGB color for UI purposes
34077 const uint8_t (*UnsignedNodeAnnouncement_get_rgb(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr))[3];
34080 * An RGB color for UI purposes
34082 void UnsignedNodeAnnouncement_set_rgb(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKThreeBytes val);
34085 * An alias, for UI purposes.
34087 * This should be sanitized before use. There is no guarantee of uniqueness.
34089 struct LDKNodeAlias UnsignedNodeAnnouncement_get_alias(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr);
34092 * An alias, for UI purposes.
34094 * This should be sanitized before use. There is no guarantee of uniqueness.
34096 void UnsignedNodeAnnouncement_set_alias(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKNodeAlias val);
34099 * List of addresses on which this node is reachable
34101 * Returns a copy of the field.
34103 struct LDKCVec_SocketAddressZ UnsignedNodeAnnouncement_get_addresses(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr);
34106 * List of addresses on which this node is reachable
34108 void UnsignedNodeAnnouncement_set_addresses(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKCVec_SocketAddressZ val);
34111 * Creates a copy of the UnsignedNodeAnnouncement
34113 struct LDKUnsignedNodeAnnouncement UnsignedNodeAnnouncement_clone(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR orig);
34116 * Checks if two UnsignedNodeAnnouncements contain equal inner contents.
34117 * This ignores pointers and is_owned flags and looks at the values in fields.
34118 * Two objects with NULL inner values will be considered "equal" here.
34120 bool UnsignedNodeAnnouncement_eq(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR a, const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR b);
34123 * Frees any resources used by the NodeAnnouncement, if is_owned is set and inner is non-NULL.
34125 void NodeAnnouncement_free(struct LDKNodeAnnouncement this_obj);
34128 * The signature by the node key
34130 struct LDKECDSASignature NodeAnnouncement_get_signature(const struct LDKNodeAnnouncement *NONNULL_PTR this_ptr);
34133 * The signature by the node key
34135 void NodeAnnouncement_set_signature(struct LDKNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKECDSASignature val);
34138 * The actual content of the announcement
34140 struct LDKUnsignedNodeAnnouncement NodeAnnouncement_get_contents(const struct LDKNodeAnnouncement *NONNULL_PTR this_ptr);
34143 * The actual content of the announcement
34145 void NodeAnnouncement_set_contents(struct LDKNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKUnsignedNodeAnnouncement val);
34148 * Constructs a new NodeAnnouncement given each field
34150 MUST_USE_RES struct LDKNodeAnnouncement NodeAnnouncement_new(struct LDKECDSASignature signature_arg, struct LDKUnsignedNodeAnnouncement contents_arg);
34153 * Creates a copy of the NodeAnnouncement
34155 struct LDKNodeAnnouncement NodeAnnouncement_clone(const struct LDKNodeAnnouncement *NONNULL_PTR orig);
34158 * Checks if two NodeAnnouncements contain equal inner contents.
34159 * This ignores pointers and is_owned flags and looks at the values in fields.
34160 * Two objects with NULL inner values will be considered "equal" here.
34162 bool NodeAnnouncement_eq(const struct LDKNodeAnnouncement *NONNULL_PTR a, const struct LDKNodeAnnouncement *NONNULL_PTR b);
34165 * Frees any resources used by the UnsignedChannelAnnouncement, if is_owned is set and inner is non-NULL.
34167 void UnsignedChannelAnnouncement_free(struct LDKUnsignedChannelAnnouncement this_obj);
34170 * The advertised channel features
34172 struct LDKChannelFeatures UnsignedChannelAnnouncement_get_features(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
34175 * The advertised channel features
34177 void UnsignedChannelAnnouncement_set_features(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKChannelFeatures val);
34180 * The genesis hash of the blockchain where the channel is to be opened
34182 const uint8_t (*UnsignedChannelAnnouncement_get_chain_hash(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr))[32];
34185 * The genesis hash of the blockchain where the channel is to be opened
34187 void UnsignedChannelAnnouncement_set_chain_hash(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
34190 * The short channel ID
34192 uint64_t UnsignedChannelAnnouncement_get_short_channel_id(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
34195 * The short channel ID
34197 void UnsignedChannelAnnouncement_set_short_channel_id(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, uint64_t val);
34200 * One of the two `node_id`s which are endpoints of this channel
34202 struct LDKNodeId UnsignedChannelAnnouncement_get_node_id_1(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
34205 * One of the two `node_id`s which are endpoints of this channel
34207 void UnsignedChannelAnnouncement_set_node_id_1(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKNodeId val);
34210 * The other of the two `node_id`s which are endpoints of this channel
34212 struct LDKNodeId UnsignedChannelAnnouncement_get_node_id_2(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
34215 * The other of the two `node_id`s which are endpoints of this channel
34217 void UnsignedChannelAnnouncement_set_node_id_2(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKNodeId val);
34220 * The funding key for the first node
34222 struct LDKNodeId UnsignedChannelAnnouncement_get_bitcoin_key_1(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
34225 * The funding key for the first node
34227 void UnsignedChannelAnnouncement_set_bitcoin_key_1(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKNodeId val);
34230 * The funding key for the second node
34232 struct LDKNodeId UnsignedChannelAnnouncement_get_bitcoin_key_2(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
34235 * The funding key for the second node
34237 void UnsignedChannelAnnouncement_set_bitcoin_key_2(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKNodeId val);
34240 * Excess data which was signed as a part of the message which we do not (yet) understand how
34243 * This is stored to ensure forward-compatibility as new fields are added to the lightning gossip protocol.
34245 * Returns a copy of the field.
34247 struct LDKCVec_u8Z UnsignedChannelAnnouncement_get_excess_data(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
34250 * Excess data which was signed as a part of the message which we do not (yet) understand how
34253 * This is stored to ensure forward-compatibility as new fields are added to the lightning gossip protocol.
34255 void UnsignedChannelAnnouncement_set_excess_data(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val);
34258 * Constructs a new UnsignedChannelAnnouncement given each field
34260 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);
34263 * Creates a copy of the UnsignedChannelAnnouncement
34265 struct LDKUnsignedChannelAnnouncement UnsignedChannelAnnouncement_clone(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR orig);
34268 * Checks if two UnsignedChannelAnnouncements contain equal inner contents.
34269 * This ignores pointers and is_owned flags and looks at the values in fields.
34270 * Two objects with NULL inner values will be considered "equal" here.
34272 bool UnsignedChannelAnnouncement_eq(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR a, const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR b);
34275 * Frees any resources used by the ChannelAnnouncement, if is_owned is set and inner is non-NULL.
34277 void ChannelAnnouncement_free(struct LDKChannelAnnouncement this_obj);
34280 * Authentication of the announcement by the first public node
34282 struct LDKECDSASignature ChannelAnnouncement_get_node_signature_1(const struct LDKChannelAnnouncement *NONNULL_PTR this_ptr);
34285 * Authentication of the announcement by the first public node
34287 void ChannelAnnouncement_set_node_signature_1(struct LDKChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKECDSASignature val);
34290 * Authentication of the announcement by the second public node
34292 struct LDKECDSASignature ChannelAnnouncement_get_node_signature_2(const struct LDKChannelAnnouncement *NONNULL_PTR this_ptr);
34295 * Authentication of the announcement by the second public node
34297 void ChannelAnnouncement_set_node_signature_2(struct LDKChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKECDSASignature val);
34300 * Proof of funding UTXO ownership by the first public node
34302 struct LDKECDSASignature ChannelAnnouncement_get_bitcoin_signature_1(const struct LDKChannelAnnouncement *NONNULL_PTR this_ptr);
34305 * Proof of funding UTXO ownership by the first public node
34307 void ChannelAnnouncement_set_bitcoin_signature_1(struct LDKChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKECDSASignature val);
34310 * Proof of funding UTXO ownership by the second public node
34312 struct LDKECDSASignature ChannelAnnouncement_get_bitcoin_signature_2(const struct LDKChannelAnnouncement *NONNULL_PTR this_ptr);
34315 * Proof of funding UTXO ownership by the second public node
34317 void ChannelAnnouncement_set_bitcoin_signature_2(struct LDKChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKECDSASignature val);
34320 * The actual announcement
34322 struct LDKUnsignedChannelAnnouncement ChannelAnnouncement_get_contents(const struct LDKChannelAnnouncement *NONNULL_PTR this_ptr);
34325 * The actual announcement
34327 void ChannelAnnouncement_set_contents(struct LDKChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKUnsignedChannelAnnouncement val);
34330 * Constructs a new ChannelAnnouncement given each field
34332 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);
34335 * Creates a copy of the ChannelAnnouncement
34337 struct LDKChannelAnnouncement ChannelAnnouncement_clone(const struct LDKChannelAnnouncement *NONNULL_PTR orig);
34340 * Checks if two ChannelAnnouncements contain equal inner contents.
34341 * This ignores pointers and is_owned flags and looks at the values in fields.
34342 * Two objects with NULL inner values will be considered "equal" here.
34344 bool ChannelAnnouncement_eq(const struct LDKChannelAnnouncement *NONNULL_PTR a, const struct LDKChannelAnnouncement *NONNULL_PTR b);
34347 * Frees any resources used by the UnsignedChannelUpdate, if is_owned is set and inner is non-NULL.
34349 void UnsignedChannelUpdate_free(struct LDKUnsignedChannelUpdate this_obj);
34352 * The genesis hash of the blockchain where the channel is to be opened
34354 const uint8_t (*UnsignedChannelUpdate_get_chain_hash(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr))[32];
34357 * The genesis hash of the blockchain where the channel is to be opened
34359 void UnsignedChannelUpdate_set_chain_hash(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
34362 * The short channel ID
34364 uint64_t UnsignedChannelUpdate_get_short_channel_id(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
34367 * The short channel ID
34369 void UnsignedChannelUpdate_set_short_channel_id(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint64_t val);
34372 * A strictly monotonic announcement counter, with gaps allowed, specific to this channel
34374 uint32_t UnsignedChannelUpdate_get_timestamp(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
34377 * A strictly monotonic announcement counter, with gaps allowed, specific to this channel
34379 void UnsignedChannelUpdate_set_timestamp(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint32_t val);
34384 uint8_t UnsignedChannelUpdate_get_flags(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
34389 void UnsignedChannelUpdate_set_flags(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint8_t val);
34392 * The number of blocks such that if:
34393 * `incoming_htlc.cltv_expiry < outgoing_htlc.cltv_expiry + cltv_expiry_delta`
34394 * then we need to fail the HTLC backwards. When forwarding an HTLC, `cltv_expiry_delta` determines
34395 * the outgoing HTLC's minimum `cltv_expiry` value -- so, if an incoming HTLC comes in with a
34396 * `cltv_expiry` of 100000, and the node we're forwarding to has a `cltv_expiry_delta` value of 10,
34397 * then we'll check that the outgoing HTLC's `cltv_expiry` value is at least 100010 before
34398 * forwarding. Note that the HTLC sender is the one who originally sets this value when
34399 * constructing the route.
34401 uint16_t UnsignedChannelUpdate_get_cltv_expiry_delta(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
34404 * The number of blocks such that if:
34405 * `incoming_htlc.cltv_expiry < outgoing_htlc.cltv_expiry + cltv_expiry_delta`
34406 * then we need to fail the HTLC backwards. When forwarding an HTLC, `cltv_expiry_delta` determines
34407 * the outgoing HTLC's minimum `cltv_expiry` value -- so, if an incoming HTLC comes in with a
34408 * `cltv_expiry` of 100000, and the node we're forwarding to has a `cltv_expiry_delta` value of 10,
34409 * then we'll check that the outgoing HTLC's `cltv_expiry` value is at least 100010 before
34410 * forwarding. Note that the HTLC sender is the one who originally sets this value when
34411 * constructing the route.
34413 void UnsignedChannelUpdate_set_cltv_expiry_delta(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint16_t val);
34416 * The minimum HTLC size incoming to sender, in milli-satoshi
34418 uint64_t UnsignedChannelUpdate_get_htlc_minimum_msat(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
34421 * The minimum HTLC size incoming to sender, in milli-satoshi
34423 void UnsignedChannelUpdate_set_htlc_minimum_msat(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint64_t val);
34426 * The maximum HTLC value incoming to sender, in milli-satoshi.
34428 * This used to be optional.
34430 uint64_t UnsignedChannelUpdate_get_htlc_maximum_msat(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
34433 * The maximum HTLC value incoming to sender, in milli-satoshi.
34435 * This used to be optional.
34437 void UnsignedChannelUpdate_set_htlc_maximum_msat(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint64_t val);
34440 * The base HTLC fee charged by sender, in milli-satoshi
34442 uint32_t UnsignedChannelUpdate_get_fee_base_msat(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
34445 * The base HTLC fee charged by sender, in milli-satoshi
34447 void UnsignedChannelUpdate_set_fee_base_msat(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint32_t val);
34450 * The amount to fee multiplier, in micro-satoshi
34452 uint32_t UnsignedChannelUpdate_get_fee_proportional_millionths(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
34455 * The amount to fee multiplier, in micro-satoshi
34457 void UnsignedChannelUpdate_set_fee_proportional_millionths(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint32_t val);
34460 * Excess data which was signed as a part of the message which we do not (yet) understand how
34463 * This is stored to ensure forward-compatibility as new fields are added to the lightning gossip protocol.
34465 * Returns a copy of the field.
34467 struct LDKCVec_u8Z UnsignedChannelUpdate_get_excess_data(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
34470 * Excess data which was signed as a part of the message which we do not (yet) understand how
34473 * This is stored to ensure forward-compatibility as new fields are added to the lightning gossip protocol.
34475 void UnsignedChannelUpdate_set_excess_data(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val);
34478 * Constructs a new UnsignedChannelUpdate given each field
34480 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);
34483 * Creates a copy of the UnsignedChannelUpdate
34485 struct LDKUnsignedChannelUpdate UnsignedChannelUpdate_clone(const struct LDKUnsignedChannelUpdate *NONNULL_PTR orig);
34488 * Checks if two UnsignedChannelUpdates contain equal inner contents.
34489 * This ignores pointers and is_owned flags and looks at the values in fields.
34490 * Two objects with NULL inner values will be considered "equal" here.
34492 bool UnsignedChannelUpdate_eq(const struct LDKUnsignedChannelUpdate *NONNULL_PTR a, const struct LDKUnsignedChannelUpdate *NONNULL_PTR b);
34495 * Frees any resources used by the ChannelUpdate, if is_owned is set and inner is non-NULL.
34497 void ChannelUpdate_free(struct LDKChannelUpdate this_obj);
34500 * A signature of the channel update
34502 struct LDKECDSASignature ChannelUpdate_get_signature(const struct LDKChannelUpdate *NONNULL_PTR this_ptr);
34505 * A signature of the channel update
34507 void ChannelUpdate_set_signature(struct LDKChannelUpdate *NONNULL_PTR this_ptr, struct LDKECDSASignature val);
34510 * The actual channel update
34512 struct LDKUnsignedChannelUpdate ChannelUpdate_get_contents(const struct LDKChannelUpdate *NONNULL_PTR this_ptr);
34515 * The actual channel update
34517 void ChannelUpdate_set_contents(struct LDKChannelUpdate *NONNULL_PTR this_ptr, struct LDKUnsignedChannelUpdate val);
34520 * Constructs a new ChannelUpdate given each field
34522 MUST_USE_RES struct LDKChannelUpdate ChannelUpdate_new(struct LDKECDSASignature signature_arg, struct LDKUnsignedChannelUpdate contents_arg);
34525 * Creates a copy of the ChannelUpdate
34527 struct LDKChannelUpdate ChannelUpdate_clone(const struct LDKChannelUpdate *NONNULL_PTR orig);
34530 * Checks if two ChannelUpdates contain equal inner contents.
34531 * This ignores pointers and is_owned flags and looks at the values in fields.
34532 * Two objects with NULL inner values will be considered "equal" here.
34534 bool ChannelUpdate_eq(const struct LDKChannelUpdate *NONNULL_PTR a, const struct LDKChannelUpdate *NONNULL_PTR b);
34537 * Frees any resources used by the QueryChannelRange, if is_owned is set and inner is non-NULL.
34539 void QueryChannelRange_free(struct LDKQueryChannelRange this_obj);
34542 * The genesis hash of the blockchain being queried
34544 const uint8_t (*QueryChannelRange_get_chain_hash(const struct LDKQueryChannelRange *NONNULL_PTR this_ptr))[32];
34547 * The genesis hash of the blockchain being queried
34549 void QueryChannelRange_set_chain_hash(struct LDKQueryChannelRange *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
34552 * The height of the first block for the channel UTXOs being queried
34554 uint32_t QueryChannelRange_get_first_blocknum(const struct LDKQueryChannelRange *NONNULL_PTR this_ptr);
34557 * The height of the first block for the channel UTXOs being queried
34559 void QueryChannelRange_set_first_blocknum(struct LDKQueryChannelRange *NONNULL_PTR this_ptr, uint32_t val);
34562 * The number of blocks to include in the query results
34564 uint32_t QueryChannelRange_get_number_of_blocks(const struct LDKQueryChannelRange *NONNULL_PTR this_ptr);
34567 * The number of blocks to include in the query results
34569 void QueryChannelRange_set_number_of_blocks(struct LDKQueryChannelRange *NONNULL_PTR this_ptr, uint32_t val);
34572 * Constructs a new QueryChannelRange given each field
34574 MUST_USE_RES struct LDKQueryChannelRange QueryChannelRange_new(struct LDKThirtyTwoBytes chain_hash_arg, uint32_t first_blocknum_arg, uint32_t number_of_blocks_arg);
34577 * Creates a copy of the QueryChannelRange
34579 struct LDKQueryChannelRange QueryChannelRange_clone(const struct LDKQueryChannelRange *NONNULL_PTR orig);
34582 * Checks if two QueryChannelRanges contain equal inner contents.
34583 * This ignores pointers and is_owned flags and looks at the values in fields.
34584 * Two objects with NULL inner values will be considered "equal" here.
34586 bool QueryChannelRange_eq(const struct LDKQueryChannelRange *NONNULL_PTR a, const struct LDKQueryChannelRange *NONNULL_PTR b);
34589 * Frees any resources used by the ReplyChannelRange, if is_owned is set and inner is non-NULL.
34591 void ReplyChannelRange_free(struct LDKReplyChannelRange this_obj);
34594 * The genesis hash of the blockchain being queried
34596 const uint8_t (*ReplyChannelRange_get_chain_hash(const struct LDKReplyChannelRange *NONNULL_PTR this_ptr))[32];
34599 * The genesis hash of the blockchain being queried
34601 void ReplyChannelRange_set_chain_hash(struct LDKReplyChannelRange *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
34604 * The height of the first block in the range of the reply
34606 uint32_t ReplyChannelRange_get_first_blocknum(const struct LDKReplyChannelRange *NONNULL_PTR this_ptr);
34609 * The height of the first block in the range of the reply
34611 void ReplyChannelRange_set_first_blocknum(struct LDKReplyChannelRange *NONNULL_PTR this_ptr, uint32_t val);
34614 * The number of blocks included in the range of the reply
34616 uint32_t ReplyChannelRange_get_number_of_blocks(const struct LDKReplyChannelRange *NONNULL_PTR this_ptr);
34619 * The number of blocks included in the range of the reply
34621 void ReplyChannelRange_set_number_of_blocks(struct LDKReplyChannelRange *NONNULL_PTR this_ptr, uint32_t val);
34624 * True when this is the final reply for a query
34626 bool ReplyChannelRange_get_sync_complete(const struct LDKReplyChannelRange *NONNULL_PTR this_ptr);
34629 * True when this is the final reply for a query
34631 void ReplyChannelRange_set_sync_complete(struct LDKReplyChannelRange *NONNULL_PTR this_ptr, bool val);
34634 * The `short_channel_id`s in the channel range
34636 * Returns a copy of the field.
34638 struct LDKCVec_u64Z ReplyChannelRange_get_short_channel_ids(const struct LDKReplyChannelRange *NONNULL_PTR this_ptr);
34641 * The `short_channel_id`s in the channel range
34643 void ReplyChannelRange_set_short_channel_ids(struct LDKReplyChannelRange *NONNULL_PTR this_ptr, struct LDKCVec_u64Z val);
34646 * Constructs a new ReplyChannelRange given each field
34648 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);
34651 * Creates a copy of the ReplyChannelRange
34653 struct LDKReplyChannelRange ReplyChannelRange_clone(const struct LDKReplyChannelRange *NONNULL_PTR orig);
34656 * Checks if two ReplyChannelRanges contain equal inner contents.
34657 * This ignores pointers and is_owned flags and looks at the values in fields.
34658 * Two objects with NULL inner values will be considered "equal" here.
34660 bool ReplyChannelRange_eq(const struct LDKReplyChannelRange *NONNULL_PTR a, const struct LDKReplyChannelRange *NONNULL_PTR b);
34663 * Frees any resources used by the QueryShortChannelIds, if is_owned is set and inner is non-NULL.
34665 void QueryShortChannelIds_free(struct LDKQueryShortChannelIds this_obj);
34668 * The genesis hash of the blockchain being queried
34670 const uint8_t (*QueryShortChannelIds_get_chain_hash(const struct LDKQueryShortChannelIds *NONNULL_PTR this_ptr))[32];
34673 * The genesis hash of the blockchain being queried
34675 void QueryShortChannelIds_set_chain_hash(struct LDKQueryShortChannelIds *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
34678 * The short_channel_ids that are being queried
34680 * Returns a copy of the field.
34682 struct LDKCVec_u64Z QueryShortChannelIds_get_short_channel_ids(const struct LDKQueryShortChannelIds *NONNULL_PTR this_ptr);
34685 * The short_channel_ids that are being queried
34687 void QueryShortChannelIds_set_short_channel_ids(struct LDKQueryShortChannelIds *NONNULL_PTR this_ptr, struct LDKCVec_u64Z val);
34690 * Constructs a new QueryShortChannelIds given each field
34692 MUST_USE_RES struct LDKQueryShortChannelIds QueryShortChannelIds_new(struct LDKThirtyTwoBytes chain_hash_arg, struct LDKCVec_u64Z short_channel_ids_arg);
34695 * Creates a copy of the QueryShortChannelIds
34697 struct LDKQueryShortChannelIds QueryShortChannelIds_clone(const struct LDKQueryShortChannelIds *NONNULL_PTR orig);
34700 * Checks if two QueryShortChannelIdss contain equal inner contents.
34701 * This ignores pointers and is_owned flags and looks at the values in fields.
34702 * Two objects with NULL inner values will be considered "equal" here.
34704 bool QueryShortChannelIds_eq(const struct LDKQueryShortChannelIds *NONNULL_PTR a, const struct LDKQueryShortChannelIds *NONNULL_PTR b);
34707 * Frees any resources used by the ReplyShortChannelIdsEnd, if is_owned is set and inner is non-NULL.
34709 void ReplyShortChannelIdsEnd_free(struct LDKReplyShortChannelIdsEnd this_obj);
34712 * The genesis hash of the blockchain that was queried
34714 const uint8_t (*ReplyShortChannelIdsEnd_get_chain_hash(const struct LDKReplyShortChannelIdsEnd *NONNULL_PTR this_ptr))[32];
34717 * The genesis hash of the blockchain that was queried
34719 void ReplyShortChannelIdsEnd_set_chain_hash(struct LDKReplyShortChannelIdsEnd *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
34722 * Indicates if the query recipient maintains up-to-date channel
34723 * information for the `chain_hash`
34725 bool ReplyShortChannelIdsEnd_get_full_information(const struct LDKReplyShortChannelIdsEnd *NONNULL_PTR this_ptr);
34728 * Indicates if the query recipient maintains up-to-date channel
34729 * information for the `chain_hash`
34731 void ReplyShortChannelIdsEnd_set_full_information(struct LDKReplyShortChannelIdsEnd *NONNULL_PTR this_ptr, bool val);
34734 * Constructs a new ReplyShortChannelIdsEnd given each field
34736 MUST_USE_RES struct LDKReplyShortChannelIdsEnd ReplyShortChannelIdsEnd_new(struct LDKThirtyTwoBytes chain_hash_arg, bool full_information_arg);
34739 * Creates a copy of the ReplyShortChannelIdsEnd
34741 struct LDKReplyShortChannelIdsEnd ReplyShortChannelIdsEnd_clone(const struct LDKReplyShortChannelIdsEnd *NONNULL_PTR orig);
34744 * Checks if two ReplyShortChannelIdsEnds contain equal inner contents.
34745 * This ignores pointers and is_owned flags and looks at the values in fields.
34746 * Two objects with NULL inner values will be considered "equal" here.
34748 bool ReplyShortChannelIdsEnd_eq(const struct LDKReplyShortChannelIdsEnd *NONNULL_PTR a, const struct LDKReplyShortChannelIdsEnd *NONNULL_PTR b);
34751 * Frees any resources used by the GossipTimestampFilter, if is_owned is set and inner is non-NULL.
34753 void GossipTimestampFilter_free(struct LDKGossipTimestampFilter this_obj);
34756 * The genesis hash of the blockchain for channel and node information
34758 const uint8_t (*GossipTimestampFilter_get_chain_hash(const struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr))[32];
34761 * The genesis hash of the blockchain for channel and node information
34763 void GossipTimestampFilter_set_chain_hash(struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
34766 * The starting unix timestamp
34768 uint32_t GossipTimestampFilter_get_first_timestamp(const struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr);
34771 * The starting unix timestamp
34773 void GossipTimestampFilter_set_first_timestamp(struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr, uint32_t val);
34776 * The range of information in seconds
34778 uint32_t GossipTimestampFilter_get_timestamp_range(const struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr);
34781 * The range of information in seconds
34783 void GossipTimestampFilter_set_timestamp_range(struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr, uint32_t val);
34786 * Constructs a new GossipTimestampFilter given each field
34788 MUST_USE_RES struct LDKGossipTimestampFilter GossipTimestampFilter_new(struct LDKThirtyTwoBytes chain_hash_arg, uint32_t first_timestamp_arg, uint32_t timestamp_range_arg);
34791 * Creates a copy of the GossipTimestampFilter
34793 struct LDKGossipTimestampFilter GossipTimestampFilter_clone(const struct LDKGossipTimestampFilter *NONNULL_PTR orig);
34796 * Checks if two GossipTimestampFilters contain equal inner contents.
34797 * This ignores pointers and is_owned flags and looks at the values in fields.
34798 * Two objects with NULL inner values will be considered "equal" here.
34800 bool GossipTimestampFilter_eq(const struct LDKGossipTimestampFilter *NONNULL_PTR a, const struct LDKGossipTimestampFilter *NONNULL_PTR b);
34803 * Frees any resources used by the ErrorAction
34805 void ErrorAction_free(struct LDKErrorAction this_ptr);
34808 * Creates a copy of the ErrorAction
34810 struct LDKErrorAction ErrorAction_clone(const struct LDKErrorAction *NONNULL_PTR orig);
34813 * Utility method to constructs a new DisconnectPeer-variant ErrorAction
34815 struct LDKErrorAction ErrorAction_disconnect_peer(struct LDKErrorMessage msg);
34818 * Utility method to constructs a new DisconnectPeerWithWarning-variant ErrorAction
34820 struct LDKErrorAction ErrorAction_disconnect_peer_with_warning(struct LDKWarningMessage msg);
34823 * Utility method to constructs a new IgnoreError-variant ErrorAction
34825 struct LDKErrorAction ErrorAction_ignore_error(void);
34828 * Utility method to constructs a new IgnoreAndLog-variant ErrorAction
34830 struct LDKErrorAction ErrorAction_ignore_and_log(enum LDKLevel a);
34833 * Utility method to constructs a new IgnoreDuplicateGossip-variant ErrorAction
34835 struct LDKErrorAction ErrorAction_ignore_duplicate_gossip(void);
34838 * Utility method to constructs a new SendErrorMessage-variant ErrorAction
34840 struct LDKErrorAction ErrorAction_send_error_message(struct LDKErrorMessage msg);
34843 * Utility method to constructs a new SendWarningMessage-variant ErrorAction
34845 struct LDKErrorAction ErrorAction_send_warning_message(struct LDKWarningMessage msg, enum LDKLevel log_level);
34848 * Frees any resources used by the LightningError, if is_owned is set and inner is non-NULL.
34850 void LightningError_free(struct LDKLightningError this_obj);
34853 * A human-readable message describing the error
34855 struct LDKStr LightningError_get_err(const struct LDKLightningError *NONNULL_PTR this_ptr);
34858 * A human-readable message describing the error
34860 void LightningError_set_err(struct LDKLightningError *NONNULL_PTR this_ptr, struct LDKStr val);
34863 * The action which should be taken against the offending peer.
34865 struct LDKErrorAction LightningError_get_action(const struct LDKLightningError *NONNULL_PTR this_ptr);
34868 * The action which should be taken against the offending peer.
34870 void LightningError_set_action(struct LDKLightningError *NONNULL_PTR this_ptr, struct LDKErrorAction val);
34873 * Constructs a new LightningError given each field
34875 MUST_USE_RES struct LDKLightningError LightningError_new(struct LDKStr err_arg, struct LDKErrorAction action_arg);
34878 * Creates a copy of the LightningError
34880 struct LDKLightningError LightningError_clone(const struct LDKLightningError *NONNULL_PTR orig);
34883 * Frees any resources used by the CommitmentUpdate, if is_owned is set and inner is non-NULL.
34885 void CommitmentUpdate_free(struct LDKCommitmentUpdate this_obj);
34888 * `update_add_htlc` messages which should be sent
34890 struct LDKCVec_UpdateAddHTLCZ CommitmentUpdate_get_update_add_htlcs(const struct LDKCommitmentUpdate *NONNULL_PTR this_ptr);
34893 * `update_add_htlc` messages which should be sent
34895 void CommitmentUpdate_set_update_add_htlcs(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKCVec_UpdateAddHTLCZ val);
34898 * `update_fulfill_htlc` messages which should be sent
34900 struct LDKCVec_UpdateFulfillHTLCZ CommitmentUpdate_get_update_fulfill_htlcs(const struct LDKCommitmentUpdate *NONNULL_PTR this_ptr);
34903 * `update_fulfill_htlc` messages which should be sent
34905 void CommitmentUpdate_set_update_fulfill_htlcs(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKCVec_UpdateFulfillHTLCZ val);
34908 * `update_fail_htlc` messages which should be sent
34910 struct LDKCVec_UpdateFailHTLCZ CommitmentUpdate_get_update_fail_htlcs(const struct LDKCommitmentUpdate *NONNULL_PTR this_ptr);
34913 * `update_fail_htlc` messages which should be sent
34915 void CommitmentUpdate_set_update_fail_htlcs(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKCVec_UpdateFailHTLCZ val);
34918 * `update_fail_malformed_htlc` messages which should be sent
34920 struct LDKCVec_UpdateFailMalformedHTLCZ CommitmentUpdate_get_update_fail_malformed_htlcs(const struct LDKCommitmentUpdate *NONNULL_PTR this_ptr);
34923 * `update_fail_malformed_htlc` messages which should be sent
34925 void CommitmentUpdate_set_update_fail_malformed_htlcs(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKCVec_UpdateFailMalformedHTLCZ val);
34928 * An `update_fee` message which should be sent
34930 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
34932 struct LDKUpdateFee CommitmentUpdate_get_update_fee(const struct LDKCommitmentUpdate *NONNULL_PTR this_ptr);
34935 * An `update_fee` message which should be sent
34937 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
34939 void CommitmentUpdate_set_update_fee(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKUpdateFee val);
34942 * A `commitment_signed` message which should be sent
34944 struct LDKCommitmentSigned CommitmentUpdate_get_commitment_signed(const struct LDKCommitmentUpdate *NONNULL_PTR this_ptr);
34947 * A `commitment_signed` message which should be sent
34949 void CommitmentUpdate_set_commitment_signed(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKCommitmentSigned val);
34952 * Constructs a new CommitmentUpdate given each field
34954 * Note that update_fee_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
34956 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);
34959 * Creates a copy of the CommitmentUpdate
34961 struct LDKCommitmentUpdate CommitmentUpdate_clone(const struct LDKCommitmentUpdate *NONNULL_PTR orig);
34964 * Checks if two CommitmentUpdates contain equal inner contents.
34965 * This ignores pointers and is_owned flags and looks at the values in fields.
34966 * Two objects with NULL inner values will be considered "equal" here.
34968 bool CommitmentUpdate_eq(const struct LDKCommitmentUpdate *NONNULL_PTR a, const struct LDKCommitmentUpdate *NONNULL_PTR b);
34971 * Calls the free function if one is set
34973 void ChannelMessageHandler_free(struct LDKChannelMessageHandler this_ptr);
34976 * Calls the free function if one is set
34978 void RoutingMessageHandler_free(struct LDKRoutingMessageHandler this_ptr);
34981 * Calls the free function if one is set
34983 void OnionMessageHandler_free(struct LDKOnionMessageHandler this_ptr);
34986 * Serialize the AcceptChannel object into a byte array which can be read by AcceptChannel_read
34988 struct LDKCVec_u8Z AcceptChannel_write(const struct LDKAcceptChannel *NONNULL_PTR obj);
34991 * Read a AcceptChannel from a byte array, created by AcceptChannel_write
34993 struct LDKCResult_AcceptChannelDecodeErrorZ AcceptChannel_read(struct LDKu8slice ser);
34996 * Serialize the AcceptChannelV2 object into a byte array which can be read by AcceptChannelV2_read
34998 struct LDKCVec_u8Z AcceptChannelV2_write(const struct LDKAcceptChannelV2 *NONNULL_PTR obj);
35001 * Read a AcceptChannelV2 from a byte array, created by AcceptChannelV2_write
35003 struct LDKCResult_AcceptChannelV2DecodeErrorZ AcceptChannelV2_read(struct LDKu8slice ser);
35006 * Serialize the TxAddInput object into a byte array which can be read by TxAddInput_read
35008 struct LDKCVec_u8Z TxAddInput_write(const struct LDKTxAddInput *NONNULL_PTR obj);
35011 * Read a TxAddInput from a byte array, created by TxAddInput_write
35013 struct LDKCResult_TxAddInputDecodeErrorZ TxAddInput_read(struct LDKu8slice ser);
35016 * Serialize the TxAddOutput object into a byte array which can be read by TxAddOutput_read
35018 struct LDKCVec_u8Z TxAddOutput_write(const struct LDKTxAddOutput *NONNULL_PTR obj);
35021 * Read a TxAddOutput from a byte array, created by TxAddOutput_write
35023 struct LDKCResult_TxAddOutputDecodeErrorZ TxAddOutput_read(struct LDKu8slice ser);
35026 * Serialize the TxRemoveInput object into a byte array which can be read by TxRemoveInput_read
35028 struct LDKCVec_u8Z TxRemoveInput_write(const struct LDKTxRemoveInput *NONNULL_PTR obj);
35031 * Read a TxRemoveInput from a byte array, created by TxRemoveInput_write
35033 struct LDKCResult_TxRemoveInputDecodeErrorZ TxRemoveInput_read(struct LDKu8slice ser);
35036 * Serialize the TxRemoveOutput object into a byte array which can be read by TxRemoveOutput_read
35038 struct LDKCVec_u8Z TxRemoveOutput_write(const struct LDKTxRemoveOutput *NONNULL_PTR obj);
35041 * Read a TxRemoveOutput from a byte array, created by TxRemoveOutput_write
35043 struct LDKCResult_TxRemoveOutputDecodeErrorZ TxRemoveOutput_read(struct LDKu8slice ser);
35046 * Serialize the TxComplete object into a byte array which can be read by TxComplete_read
35048 struct LDKCVec_u8Z TxComplete_write(const struct LDKTxComplete *NONNULL_PTR obj);
35051 * Read a TxComplete from a byte array, created by TxComplete_write
35053 struct LDKCResult_TxCompleteDecodeErrorZ TxComplete_read(struct LDKu8slice ser);
35056 * Serialize the TxSignatures object into a byte array which can be read by TxSignatures_read
35058 struct LDKCVec_u8Z TxSignatures_write(const struct LDKTxSignatures *NONNULL_PTR obj);
35061 * Read a TxSignatures from a byte array, created by TxSignatures_write
35063 struct LDKCResult_TxSignaturesDecodeErrorZ TxSignatures_read(struct LDKu8slice ser);
35066 * Serialize the TxInitRbf object into a byte array which can be read by TxInitRbf_read
35068 struct LDKCVec_u8Z TxInitRbf_write(const struct LDKTxInitRbf *NONNULL_PTR obj);
35071 * Read a TxInitRbf from a byte array, created by TxInitRbf_write
35073 struct LDKCResult_TxInitRbfDecodeErrorZ TxInitRbf_read(struct LDKu8slice ser);
35076 * Serialize the TxAckRbf object into a byte array which can be read by TxAckRbf_read
35078 struct LDKCVec_u8Z TxAckRbf_write(const struct LDKTxAckRbf *NONNULL_PTR obj);
35081 * Read a TxAckRbf from a byte array, created by TxAckRbf_write
35083 struct LDKCResult_TxAckRbfDecodeErrorZ TxAckRbf_read(struct LDKu8slice ser);
35086 * Serialize the TxAbort object into a byte array which can be read by TxAbort_read
35088 struct LDKCVec_u8Z TxAbort_write(const struct LDKTxAbort *NONNULL_PTR obj);
35091 * Read a TxAbort from a byte array, created by TxAbort_write
35093 struct LDKCResult_TxAbortDecodeErrorZ TxAbort_read(struct LDKu8slice ser);
35096 * Serialize the AnnouncementSignatures object into a byte array which can be read by AnnouncementSignatures_read
35098 struct LDKCVec_u8Z AnnouncementSignatures_write(const struct LDKAnnouncementSignatures *NONNULL_PTR obj);
35101 * Read a AnnouncementSignatures from a byte array, created by AnnouncementSignatures_write
35103 struct LDKCResult_AnnouncementSignaturesDecodeErrorZ AnnouncementSignatures_read(struct LDKu8slice ser);
35106 * Serialize the ChannelReestablish object into a byte array which can be read by ChannelReestablish_read
35108 struct LDKCVec_u8Z ChannelReestablish_write(const struct LDKChannelReestablish *NONNULL_PTR obj);
35111 * Read a ChannelReestablish from a byte array, created by ChannelReestablish_write
35113 struct LDKCResult_ChannelReestablishDecodeErrorZ ChannelReestablish_read(struct LDKu8slice ser);
35116 * Serialize the ClosingSigned object into a byte array which can be read by ClosingSigned_read
35118 struct LDKCVec_u8Z ClosingSigned_write(const struct LDKClosingSigned *NONNULL_PTR obj);
35121 * Read a ClosingSigned from a byte array, created by ClosingSigned_write
35123 struct LDKCResult_ClosingSignedDecodeErrorZ ClosingSigned_read(struct LDKu8slice ser);
35126 * Serialize the ClosingSignedFeeRange object into a byte array which can be read by ClosingSignedFeeRange_read
35128 struct LDKCVec_u8Z ClosingSignedFeeRange_write(const struct LDKClosingSignedFeeRange *NONNULL_PTR obj);
35131 * Read a ClosingSignedFeeRange from a byte array, created by ClosingSignedFeeRange_write
35133 struct LDKCResult_ClosingSignedFeeRangeDecodeErrorZ ClosingSignedFeeRange_read(struct LDKu8slice ser);
35136 * Serialize the CommitmentSigned object into a byte array which can be read by CommitmentSigned_read
35138 struct LDKCVec_u8Z CommitmentSigned_write(const struct LDKCommitmentSigned *NONNULL_PTR obj);
35141 * Read a CommitmentSigned from a byte array, created by CommitmentSigned_write
35143 struct LDKCResult_CommitmentSignedDecodeErrorZ CommitmentSigned_read(struct LDKu8slice ser);
35146 * Serialize the FundingCreated object into a byte array which can be read by FundingCreated_read
35148 struct LDKCVec_u8Z FundingCreated_write(const struct LDKFundingCreated *NONNULL_PTR obj);
35151 * Read a FundingCreated from a byte array, created by FundingCreated_write
35153 struct LDKCResult_FundingCreatedDecodeErrorZ FundingCreated_read(struct LDKu8slice ser);
35156 * Serialize the FundingSigned object into a byte array which can be read by FundingSigned_read
35158 struct LDKCVec_u8Z FundingSigned_write(const struct LDKFundingSigned *NONNULL_PTR obj);
35161 * Read a FundingSigned from a byte array, created by FundingSigned_write
35163 struct LDKCResult_FundingSignedDecodeErrorZ FundingSigned_read(struct LDKu8slice ser);
35166 * Serialize the ChannelReady object into a byte array which can be read by ChannelReady_read
35168 struct LDKCVec_u8Z ChannelReady_write(const struct LDKChannelReady *NONNULL_PTR obj);
35171 * Read a ChannelReady from a byte array, created by ChannelReady_write
35173 struct LDKCResult_ChannelReadyDecodeErrorZ ChannelReady_read(struct LDKu8slice ser);
35176 * Serialize the Init object into a byte array which can be read by Init_read
35178 struct LDKCVec_u8Z Init_write(const struct LDKInit *NONNULL_PTR obj);
35181 * Read a Init from a byte array, created by Init_write
35183 struct LDKCResult_InitDecodeErrorZ Init_read(struct LDKu8slice ser);
35186 * Serialize the OpenChannel object into a byte array which can be read by OpenChannel_read
35188 struct LDKCVec_u8Z OpenChannel_write(const struct LDKOpenChannel *NONNULL_PTR obj);
35191 * Read a OpenChannel from a byte array, created by OpenChannel_write
35193 struct LDKCResult_OpenChannelDecodeErrorZ OpenChannel_read(struct LDKu8slice ser);
35196 * Serialize the OpenChannelV2 object into a byte array which can be read by OpenChannelV2_read
35198 struct LDKCVec_u8Z OpenChannelV2_write(const struct LDKOpenChannelV2 *NONNULL_PTR obj);
35201 * Read a OpenChannelV2 from a byte array, created by OpenChannelV2_write
35203 struct LDKCResult_OpenChannelV2DecodeErrorZ OpenChannelV2_read(struct LDKu8slice ser);
35206 * Serialize the RevokeAndACK object into a byte array which can be read by RevokeAndACK_read
35208 struct LDKCVec_u8Z RevokeAndACK_write(const struct LDKRevokeAndACK *NONNULL_PTR obj);
35211 * Read a RevokeAndACK from a byte array, created by RevokeAndACK_write
35213 struct LDKCResult_RevokeAndACKDecodeErrorZ RevokeAndACK_read(struct LDKu8slice ser);
35216 * Serialize the Shutdown object into a byte array which can be read by Shutdown_read
35218 struct LDKCVec_u8Z Shutdown_write(const struct LDKShutdown *NONNULL_PTR obj);
35221 * Read a Shutdown from a byte array, created by Shutdown_write
35223 struct LDKCResult_ShutdownDecodeErrorZ Shutdown_read(struct LDKu8slice ser);
35226 * Serialize the UpdateFailHTLC object into a byte array which can be read by UpdateFailHTLC_read
35228 struct LDKCVec_u8Z UpdateFailHTLC_write(const struct LDKUpdateFailHTLC *NONNULL_PTR obj);
35231 * Read a UpdateFailHTLC from a byte array, created by UpdateFailHTLC_write
35233 struct LDKCResult_UpdateFailHTLCDecodeErrorZ UpdateFailHTLC_read(struct LDKu8slice ser);
35236 * Serialize the UpdateFailMalformedHTLC object into a byte array which can be read by UpdateFailMalformedHTLC_read
35238 struct LDKCVec_u8Z UpdateFailMalformedHTLC_write(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR obj);
35241 * Read a UpdateFailMalformedHTLC from a byte array, created by UpdateFailMalformedHTLC_write
35243 struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ UpdateFailMalformedHTLC_read(struct LDKu8slice ser);
35246 * Serialize the UpdateFee object into a byte array which can be read by UpdateFee_read
35248 struct LDKCVec_u8Z UpdateFee_write(const struct LDKUpdateFee *NONNULL_PTR obj);
35251 * Read a UpdateFee from a byte array, created by UpdateFee_write
35253 struct LDKCResult_UpdateFeeDecodeErrorZ UpdateFee_read(struct LDKu8slice ser);
35256 * Serialize the UpdateFulfillHTLC object into a byte array which can be read by UpdateFulfillHTLC_read
35258 struct LDKCVec_u8Z UpdateFulfillHTLC_write(const struct LDKUpdateFulfillHTLC *NONNULL_PTR obj);
35261 * Read a UpdateFulfillHTLC from a byte array, created by UpdateFulfillHTLC_write
35263 struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ UpdateFulfillHTLC_read(struct LDKu8slice ser);
35266 * Serialize the UpdateAddHTLC object into a byte array which can be read by UpdateAddHTLC_read
35268 struct LDKCVec_u8Z UpdateAddHTLC_write(const struct LDKUpdateAddHTLC *NONNULL_PTR obj);
35271 * Read a UpdateAddHTLC from a byte array, created by UpdateAddHTLC_write
35273 struct LDKCResult_UpdateAddHTLCDecodeErrorZ UpdateAddHTLC_read(struct LDKu8slice ser);
35276 * Read a OnionMessage from a byte array, created by OnionMessage_write
35278 struct LDKCResult_OnionMessageDecodeErrorZ OnionMessage_read(struct LDKu8slice ser);
35281 * Serialize the OnionMessage object into a byte array which can be read by OnionMessage_read
35283 struct LDKCVec_u8Z OnionMessage_write(const struct LDKOnionMessage *NONNULL_PTR obj);
35286 * Serialize the Ping object into a byte array which can be read by Ping_read
35288 struct LDKCVec_u8Z Ping_write(const struct LDKPing *NONNULL_PTR obj);
35291 * Read a Ping from a byte array, created by Ping_write
35293 struct LDKCResult_PingDecodeErrorZ Ping_read(struct LDKu8slice ser);
35296 * Serialize the Pong object into a byte array which can be read by Pong_read
35298 struct LDKCVec_u8Z Pong_write(const struct LDKPong *NONNULL_PTR obj);
35301 * Read a Pong from a byte array, created by Pong_write
35303 struct LDKCResult_PongDecodeErrorZ Pong_read(struct LDKu8slice ser);
35306 * Serialize the UnsignedChannelAnnouncement object into a byte array which can be read by UnsignedChannelAnnouncement_read
35308 struct LDKCVec_u8Z UnsignedChannelAnnouncement_write(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR obj);
35311 * Read a UnsignedChannelAnnouncement from a byte array, created by UnsignedChannelAnnouncement_write
35313 struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ UnsignedChannelAnnouncement_read(struct LDKu8slice ser);
35316 * Serialize the ChannelAnnouncement object into a byte array which can be read by ChannelAnnouncement_read
35318 struct LDKCVec_u8Z ChannelAnnouncement_write(const struct LDKChannelAnnouncement *NONNULL_PTR obj);
35321 * Read a ChannelAnnouncement from a byte array, created by ChannelAnnouncement_write
35323 struct LDKCResult_ChannelAnnouncementDecodeErrorZ ChannelAnnouncement_read(struct LDKu8slice ser);
35326 * Serialize the UnsignedChannelUpdate object into a byte array which can be read by UnsignedChannelUpdate_read
35328 struct LDKCVec_u8Z UnsignedChannelUpdate_write(const struct LDKUnsignedChannelUpdate *NONNULL_PTR obj);
35331 * Read a UnsignedChannelUpdate from a byte array, created by UnsignedChannelUpdate_write
35333 struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ UnsignedChannelUpdate_read(struct LDKu8slice ser);
35336 * Serialize the ChannelUpdate object into a byte array which can be read by ChannelUpdate_read
35338 struct LDKCVec_u8Z ChannelUpdate_write(const struct LDKChannelUpdate *NONNULL_PTR obj);
35341 * Read a ChannelUpdate from a byte array, created by ChannelUpdate_write
35343 struct LDKCResult_ChannelUpdateDecodeErrorZ ChannelUpdate_read(struct LDKu8slice ser);
35346 * Serialize the ErrorMessage object into a byte array which can be read by ErrorMessage_read
35348 struct LDKCVec_u8Z ErrorMessage_write(const struct LDKErrorMessage *NONNULL_PTR obj);
35351 * Read a ErrorMessage from a byte array, created by ErrorMessage_write
35353 struct LDKCResult_ErrorMessageDecodeErrorZ ErrorMessage_read(struct LDKu8slice ser);
35356 * Serialize the WarningMessage object into a byte array which can be read by WarningMessage_read
35358 struct LDKCVec_u8Z WarningMessage_write(const struct LDKWarningMessage *NONNULL_PTR obj);
35361 * Read a WarningMessage from a byte array, created by WarningMessage_write
35363 struct LDKCResult_WarningMessageDecodeErrorZ WarningMessage_read(struct LDKu8slice ser);
35366 * Serialize the UnsignedNodeAnnouncement object into a byte array which can be read by UnsignedNodeAnnouncement_read
35368 struct LDKCVec_u8Z UnsignedNodeAnnouncement_write(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR obj);
35371 * Read a UnsignedNodeAnnouncement from a byte array, created by UnsignedNodeAnnouncement_write
35373 struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ UnsignedNodeAnnouncement_read(struct LDKu8slice ser);
35376 * Serialize the NodeAnnouncement object into a byte array which can be read by NodeAnnouncement_read
35378 struct LDKCVec_u8Z NodeAnnouncement_write(const struct LDKNodeAnnouncement *NONNULL_PTR obj);
35381 * Read a NodeAnnouncement from a byte array, created by NodeAnnouncement_write
35383 struct LDKCResult_NodeAnnouncementDecodeErrorZ NodeAnnouncement_read(struct LDKu8slice ser);
35386 * Read a QueryShortChannelIds from a byte array, created by QueryShortChannelIds_write
35388 struct LDKCResult_QueryShortChannelIdsDecodeErrorZ QueryShortChannelIds_read(struct LDKu8slice ser);
35391 * Serialize the QueryShortChannelIds object into a byte array which can be read by QueryShortChannelIds_read
35393 struct LDKCVec_u8Z QueryShortChannelIds_write(const struct LDKQueryShortChannelIds *NONNULL_PTR obj);
35396 * Serialize the ReplyShortChannelIdsEnd object into a byte array which can be read by ReplyShortChannelIdsEnd_read
35398 struct LDKCVec_u8Z ReplyShortChannelIdsEnd_write(const struct LDKReplyShortChannelIdsEnd *NONNULL_PTR obj);
35401 * Read a ReplyShortChannelIdsEnd from a byte array, created by ReplyShortChannelIdsEnd_write
35403 struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ ReplyShortChannelIdsEnd_read(struct LDKu8slice ser);
35406 * Calculates the overflow safe ending block height for the query.
35408 * Overflow returns `0xffffffff`, otherwise returns `first_blocknum + number_of_blocks`.
35410 MUST_USE_RES uint32_t QueryChannelRange_end_blocknum(const struct LDKQueryChannelRange *NONNULL_PTR this_arg);
35413 * Serialize the QueryChannelRange object into a byte array which can be read by QueryChannelRange_read
35415 struct LDKCVec_u8Z QueryChannelRange_write(const struct LDKQueryChannelRange *NONNULL_PTR obj);
35418 * Read a QueryChannelRange from a byte array, created by QueryChannelRange_write
35420 struct LDKCResult_QueryChannelRangeDecodeErrorZ QueryChannelRange_read(struct LDKu8slice ser);
35423 * Read a ReplyChannelRange from a byte array, created by ReplyChannelRange_write
35425 struct LDKCResult_ReplyChannelRangeDecodeErrorZ ReplyChannelRange_read(struct LDKu8slice ser);
35428 * Serialize the ReplyChannelRange object into a byte array which can be read by ReplyChannelRange_read
35430 struct LDKCVec_u8Z ReplyChannelRange_write(const struct LDKReplyChannelRange *NONNULL_PTR obj);
35433 * Serialize the GossipTimestampFilter object into a byte array which can be read by GossipTimestampFilter_read
35435 struct LDKCVec_u8Z GossipTimestampFilter_write(const struct LDKGossipTimestampFilter *NONNULL_PTR obj);
35438 * Read a GossipTimestampFilter from a byte array, created by GossipTimestampFilter_write
35440 struct LDKCResult_GossipTimestampFilterDecodeErrorZ GossipTimestampFilter_read(struct LDKu8slice ser);
35443 * Calls the free function if one is set
35445 void CustomMessageHandler_free(struct LDKCustomMessageHandler this_ptr);
35448 * Frees any resources used by the IgnoringMessageHandler, if is_owned is set and inner is non-NULL.
35450 void IgnoringMessageHandler_free(struct LDKIgnoringMessageHandler this_obj);
35453 * Constructs a new IgnoringMessageHandler given each field
35455 MUST_USE_RES struct LDKIgnoringMessageHandler IgnoringMessageHandler_new(void);
35458 * Constructs a new MessageSendEventsProvider which calls the relevant methods on this_arg.
35459 * This copies the `inner` pointer in this_arg and thus the returned MessageSendEventsProvider must be freed before this_arg is
35461 struct LDKMessageSendEventsProvider IgnoringMessageHandler_as_MessageSendEventsProvider(const struct LDKIgnoringMessageHandler *NONNULL_PTR this_arg);
35464 * Constructs a new RoutingMessageHandler which calls the relevant methods on this_arg.
35465 * This copies the `inner` pointer in this_arg and thus the returned RoutingMessageHandler must be freed before this_arg is
35467 struct LDKRoutingMessageHandler IgnoringMessageHandler_as_RoutingMessageHandler(const struct LDKIgnoringMessageHandler *NONNULL_PTR this_arg);
35470 * Constructs a new OnionMessageProvider which calls the relevant methods on this_arg.
35471 * This copies the `inner` pointer in this_arg and thus the returned OnionMessageProvider must be freed before this_arg is
35473 struct LDKOnionMessageProvider IgnoringMessageHandler_as_OnionMessageProvider(const struct LDKIgnoringMessageHandler *NONNULL_PTR this_arg);
35476 * Constructs a new OnionMessageHandler which calls the relevant methods on this_arg.
35477 * This copies the `inner` pointer in this_arg and thus the returned OnionMessageHandler must be freed before this_arg is
35479 struct LDKOnionMessageHandler IgnoringMessageHandler_as_OnionMessageHandler(const struct LDKIgnoringMessageHandler *NONNULL_PTR this_arg);
35482 * Constructs a new OffersMessageHandler which calls the relevant methods on this_arg.
35483 * This copies the `inner` pointer in this_arg and thus the returned OffersMessageHandler must be freed before this_arg is
35485 struct LDKOffersMessageHandler IgnoringMessageHandler_as_OffersMessageHandler(const struct LDKIgnoringMessageHandler *NONNULL_PTR this_arg);
35488 * Constructs a new CustomOnionMessageHandler which calls the relevant methods on this_arg.
35489 * This copies the `inner` pointer in this_arg and thus the returned CustomOnionMessageHandler must be freed before this_arg is
35491 struct LDKCustomOnionMessageHandler IgnoringMessageHandler_as_CustomOnionMessageHandler(const struct LDKIgnoringMessageHandler *NONNULL_PTR this_arg);
35494 * Constructs a new CustomMessageReader which calls the relevant methods on this_arg.
35495 * This copies the `inner` pointer in this_arg and thus the returned CustomMessageReader must be freed before this_arg is
35497 struct LDKCustomMessageReader IgnoringMessageHandler_as_CustomMessageReader(const struct LDKIgnoringMessageHandler *NONNULL_PTR this_arg);
35500 * Constructs a new CustomMessageHandler which calls the relevant methods on this_arg.
35501 * This copies the `inner` pointer in this_arg and thus the returned CustomMessageHandler must be freed before this_arg is
35503 struct LDKCustomMessageHandler IgnoringMessageHandler_as_CustomMessageHandler(const struct LDKIgnoringMessageHandler *NONNULL_PTR this_arg);
35506 * Frees any resources used by the ErroringMessageHandler, if is_owned is set and inner is non-NULL.
35508 void ErroringMessageHandler_free(struct LDKErroringMessageHandler this_obj);
35511 * Constructs a new ErroringMessageHandler
35513 MUST_USE_RES struct LDKErroringMessageHandler ErroringMessageHandler_new(void);
35516 * Constructs a new MessageSendEventsProvider which calls the relevant methods on this_arg.
35517 * This copies the `inner` pointer in this_arg and thus the returned MessageSendEventsProvider must be freed before this_arg is
35519 struct LDKMessageSendEventsProvider ErroringMessageHandler_as_MessageSendEventsProvider(const struct LDKErroringMessageHandler *NONNULL_PTR this_arg);
35522 * Constructs a new ChannelMessageHandler which calls the relevant methods on this_arg.
35523 * This copies the `inner` pointer in this_arg and thus the returned ChannelMessageHandler must be freed before this_arg is
35525 struct LDKChannelMessageHandler ErroringMessageHandler_as_ChannelMessageHandler(const struct LDKErroringMessageHandler *NONNULL_PTR this_arg);
35528 * Frees any resources used by the MessageHandler, if is_owned is set and inner is non-NULL.
35530 void MessageHandler_free(struct LDKMessageHandler this_obj);
35533 * A message handler which handles messages specific to channels. Usually this is just a
35534 * [`ChannelManager`] object or an [`ErroringMessageHandler`].
35536 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
35538 const struct LDKChannelMessageHandler *MessageHandler_get_chan_handler(const struct LDKMessageHandler *NONNULL_PTR this_ptr);
35541 * A message handler which handles messages specific to channels. Usually this is just a
35542 * [`ChannelManager`] object or an [`ErroringMessageHandler`].
35544 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
35546 void MessageHandler_set_chan_handler(struct LDKMessageHandler *NONNULL_PTR this_ptr, struct LDKChannelMessageHandler val);
35549 * A message handler which handles messages updating our knowledge of the network channel
35550 * graph. Usually this is just a [`P2PGossipSync`] object or an [`IgnoringMessageHandler`].
35552 * [`P2PGossipSync`]: crate::routing::gossip::P2PGossipSync
35554 const struct LDKRoutingMessageHandler *MessageHandler_get_route_handler(const struct LDKMessageHandler *NONNULL_PTR this_ptr);
35557 * A message handler which handles messages updating our knowledge of the network channel
35558 * graph. Usually this is just a [`P2PGossipSync`] object or an [`IgnoringMessageHandler`].
35560 * [`P2PGossipSync`]: crate::routing::gossip::P2PGossipSync
35562 void MessageHandler_set_route_handler(struct LDKMessageHandler *NONNULL_PTR this_ptr, struct LDKRoutingMessageHandler val);
35565 * A message handler which handles onion messages. This should generally be an
35566 * [`OnionMessenger`], but can also be an [`IgnoringMessageHandler`].
35568 * [`OnionMessenger`]: crate::onion_message::OnionMessenger
35570 const struct LDKOnionMessageHandler *MessageHandler_get_onion_message_handler(const struct LDKMessageHandler *NONNULL_PTR this_ptr);
35573 * A message handler which handles onion messages. This should generally be an
35574 * [`OnionMessenger`], but can also be an [`IgnoringMessageHandler`].
35576 * [`OnionMessenger`]: crate::onion_message::OnionMessenger
35578 void MessageHandler_set_onion_message_handler(struct LDKMessageHandler *NONNULL_PTR this_ptr, struct LDKOnionMessageHandler val);
35581 * A message handler which handles custom messages. The only LDK-provided implementation is
35582 * [`IgnoringMessageHandler`].
35584 const struct LDKCustomMessageHandler *MessageHandler_get_custom_message_handler(const struct LDKMessageHandler *NONNULL_PTR this_ptr);
35587 * A message handler which handles custom messages. The only LDK-provided implementation is
35588 * [`IgnoringMessageHandler`].
35590 void MessageHandler_set_custom_message_handler(struct LDKMessageHandler *NONNULL_PTR this_ptr, struct LDKCustomMessageHandler val);
35593 * Constructs a new MessageHandler given each field
35595 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);
35598 * Creates a copy of a SocketDescriptor
35600 struct LDKSocketDescriptor SocketDescriptor_clone(const struct LDKSocketDescriptor *NONNULL_PTR orig);
35603 * Calls the free function if one is set
35605 void SocketDescriptor_free(struct LDKSocketDescriptor this_ptr);
35608 * Frees any resources used by the PeerHandleError, if is_owned is set and inner is non-NULL.
35610 void PeerHandleError_free(struct LDKPeerHandleError this_obj);
35613 * Constructs a new PeerHandleError given each field
35615 MUST_USE_RES struct LDKPeerHandleError PeerHandleError_new(void);
35618 * Creates a copy of the PeerHandleError
35620 struct LDKPeerHandleError PeerHandleError_clone(const struct LDKPeerHandleError *NONNULL_PTR orig);
35623 * Frees any resources used by the PeerManager, if is_owned is set and inner is non-NULL.
35625 void PeerManager_free(struct LDKPeerManager this_obj);
35628 * Constructs a new `PeerManager` with the given message handlers.
35630 * `ephemeral_random_data` is used to derive per-connection ephemeral keys and must be
35631 * cryptographically secure random bytes.
35633 * `current_time` is used as an always-increasing counter that survives across restarts and is
35634 * incremented irregularly internally. In general it is best to simply use the current UNIX
35635 * timestamp, however if it is not available a persistent counter that increases once per
35636 * minute should suffice.
35638 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);
35641 * Get a list of tuples mapping from node id to network addresses for peers which have
35642 * completed the initial handshake.
35644 * For outbound connections, the [`PublicKey`] will be the same as the `their_node_id` parameter
35645 * passed in to [`Self::new_outbound_connection`], however entries will only appear once the initial
35646 * handshake has completed and we are sure the remote peer has the private key for the given
35649 * The returned `Option`s will only be `Some` if an address had been previously given via
35650 * [`Self::new_outbound_connection`] or [`Self::new_inbound_connection`].
35652 MUST_USE_RES struct LDKCVec_C2Tuple_PublicKeyCOption_SocketAddressZZZ PeerManager_get_peer_node_ids(const struct LDKPeerManager *NONNULL_PTR this_arg);
35655 * Indicates a new outbound connection has been established to a node with the given `node_id`
35656 * and an optional remote network address.
35658 * The remote network address adds the option to report a remote IP address back to a connecting
35659 * peer using the init message.
35660 * The user should pass the remote network address of the host they are connected to.
35662 * If an `Err` is returned here you must disconnect the connection immediately.
35664 * Returns a small number of bytes to send to the remote node (currently always 50).
35666 * Panics if descriptor is duplicative with some other descriptor which has not yet been
35667 * [`socket_disconnected`].
35669 * [`socket_disconnected`]: PeerManager::socket_disconnected
35671 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);
35674 * Indicates a new inbound connection has been established to a node with an optional remote
35677 * The remote network address adds the option to report a remote IP address back to a connecting
35678 * peer using the init message.
35679 * The user should pass the remote network address of the host they are connected to.
35681 * May refuse the connection by returning an Err, but will never write bytes to the remote end
35682 * (outbound connector always speaks first). If an `Err` is returned here you must disconnect
35683 * the connection immediately.
35685 * Panics if descriptor is duplicative with some other descriptor which has not yet been
35686 * [`socket_disconnected`].
35688 * [`socket_disconnected`]: PeerManager::socket_disconnected
35690 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);
35693 * Indicates that there is room to write data to the given socket descriptor.
35695 * May return an Err to indicate that the connection should be closed.
35697 * May call [`send_data`] on the descriptor passed in (or an equal descriptor) before
35698 * returning. Thus, be very careful with reentrancy issues! The invariants around calling
35699 * [`write_buffer_space_avail`] in case a write did not fully complete must still hold - be
35700 * ready to call [`write_buffer_space_avail`] again if a write call generated here isn't
35703 * [`send_data`]: SocketDescriptor::send_data
35704 * [`write_buffer_space_avail`]: PeerManager::write_buffer_space_avail
35706 MUST_USE_RES struct LDKCResult_NonePeerHandleErrorZ PeerManager_write_buffer_space_avail(const struct LDKPeerManager *NONNULL_PTR this_arg, struct LDKSocketDescriptor *NONNULL_PTR descriptor);
35709 * Indicates that data was read from the given socket descriptor.
35711 * May return an Err to indicate that the connection should be closed.
35713 * Will *not* call back into [`send_data`] on any descriptors to avoid reentrancy complexity.
35714 * Thus, however, you should call [`process_events`] after any `read_event` to generate
35715 * [`send_data`] calls to handle responses.
35717 * If `Ok(true)` is returned, further read_events should not be triggered until a
35718 * [`send_data`] call on this descriptor has `resume_read` set (preventing DoS issues in the
35721 * In order to avoid processing too many messages at once per peer, `data` should be on the
35724 * [`send_data`]: SocketDescriptor::send_data
35725 * [`process_events`]: PeerManager::process_events
35727 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);
35730 * Checks for any events generated by our handlers and processes them. Includes sending most
35731 * response messages as well as messages generated by calls to handler functions directly (eg
35732 * functions like [`ChannelManager::process_pending_htlc_forwards`] or [`send_payment`]).
35734 * May call [`send_data`] on [`SocketDescriptor`]s. Thus, be very careful with reentrancy
35737 * You don't have to call this function explicitly if you are using [`lightning-net-tokio`]
35738 * or one of the other clients provided in our language bindings.
35740 * Note that if there are any other calls to this function waiting on lock(s) this may return
35741 * without doing any work. All available events that need handling will be handled before the
35742 * other calls return.
35744 * [`send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
35745 * [`ChannelManager::process_pending_htlc_forwards`]: crate::ln::channelmanager::ChannelManager::process_pending_htlc_forwards
35746 * [`send_data`]: SocketDescriptor::send_data
35748 void PeerManager_process_events(const struct LDKPeerManager *NONNULL_PTR this_arg);
35751 * Indicates that the given socket descriptor's connection is now closed.
35753 void PeerManager_socket_disconnected(const struct LDKPeerManager *NONNULL_PTR this_arg, const struct LDKSocketDescriptor *NONNULL_PTR descriptor);
35756 * Disconnect a peer given its node id.
35758 * If a peer is connected, this will call [`disconnect_socket`] on the descriptor for the
35759 * peer. Thus, be very careful about reentrancy issues.
35761 * [`disconnect_socket`]: SocketDescriptor::disconnect_socket
35763 void PeerManager_disconnect_by_node_id(const struct LDKPeerManager *NONNULL_PTR this_arg, struct LDKPublicKey node_id);
35766 * Disconnects all currently-connected peers. This is useful on platforms where there may be
35767 * an indication that TCP sockets have stalled even if we weren't around to time them out
35768 * using regular ping/pongs.
35770 void PeerManager_disconnect_all_peers(const struct LDKPeerManager *NONNULL_PTR this_arg);
35773 * Send pings to each peer and disconnect those which did not respond to the last round of
35776 * This may be called on any timescale you want, however, roughly once every ten seconds is
35777 * preferred. The call rate determines both how often we send a ping to our peers and how much
35778 * time they have to respond before we disconnect them.
35780 * May call [`send_data`] on all [`SocketDescriptor`]s. Thus, be very careful with reentrancy
35783 * [`send_data`]: SocketDescriptor::send_data
35785 void PeerManager_timer_tick_occurred(const struct LDKPeerManager *NONNULL_PTR this_arg);
35788 * Generates a signed node_announcement from the given arguments, sending it to all connected
35789 * peers. Note that peers will likely ignore this message unless we have at least one public
35790 * channel which has at least six confirmations on-chain.
35792 * `rgb` is a node \"color\" and `alias` is a printable human-readable string to describe this
35793 * node to humans. They carry no in-protocol meaning.
35795 * `addresses` represent the set (possibly empty) of socket addresses on which this node
35796 * accepts incoming connections. These will be included in the node_announcement, publicly
35797 * tying these addresses together and to this node. If you wish to preserve user privacy,
35798 * addresses should likely contain only Tor Onion addresses.
35800 * Panics if `addresses` is absurdly large (more than 100).
35802 * [`get_and_clear_pending_msg_events`]: MessageSendEventsProvider::get_and_clear_pending_msg_events
35804 void PeerManager_broadcast_node_announcement(const struct LDKPeerManager *NONNULL_PTR this_arg, struct LDKThreeBytes rgb, struct LDKThirtyTwoBytes alias, struct LDKCVec_SocketAddressZ addresses);
35807 * Gets the weight for an HTLC-Success transaction.
35809 uint64_t htlc_success_tx_weight(const struct LDKChannelTypeFeatures *NONNULL_PTR channel_type_features);
35812 * Gets the weight for an HTLC-Timeout transaction.
35814 uint64_t htlc_timeout_tx_weight(const struct LDKChannelTypeFeatures *NONNULL_PTR channel_type_features);
35817 * Creates a copy of the HTLCClaim
35819 enum LDKHTLCClaim HTLCClaim_clone(const enum LDKHTLCClaim *NONNULL_PTR orig);
35822 * Utility method to constructs a new OfferedTimeout-variant HTLCClaim
35824 enum LDKHTLCClaim HTLCClaim_offered_timeout(void);
35827 * Utility method to constructs a new OfferedPreimage-variant HTLCClaim
35829 enum LDKHTLCClaim HTLCClaim_offered_preimage(void);
35832 * Utility method to constructs a new AcceptedTimeout-variant HTLCClaim
35834 enum LDKHTLCClaim HTLCClaim_accepted_timeout(void);
35837 * Utility method to constructs a new AcceptedPreimage-variant HTLCClaim
35839 enum LDKHTLCClaim HTLCClaim_accepted_preimage(void);
35842 * Utility method to constructs a new Revocation-variant HTLCClaim
35844 enum LDKHTLCClaim HTLCClaim_revocation(void);
35847 * Checks if two HTLCClaims contain equal inner contents.
35848 * This ignores pointers and is_owned flags and looks at the values in fields.
35850 bool HTLCClaim_eq(const enum LDKHTLCClaim *NONNULL_PTR a, const enum LDKHTLCClaim *NONNULL_PTR b);
35853 * Check if a given input witness attempts to claim a HTLC.
35855 MUST_USE_RES struct LDKCOption_HTLCClaimZ HTLCClaim_from_witness(struct LDKWitness witness);
35858 * Build the commitment secret from the seed and the commitment number
35860 struct LDKThirtyTwoBytes build_commitment_secret(const uint8_t (*commitment_seed)[32], uint64_t idx);
35863 * Build a closing transaction
35865 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);
35868 * Frees any resources used by the CounterpartyCommitmentSecrets, if is_owned is set and inner is non-NULL.
35870 void CounterpartyCommitmentSecrets_free(struct LDKCounterpartyCommitmentSecrets this_obj);
35873 * Creates a copy of the CounterpartyCommitmentSecrets
35875 struct LDKCounterpartyCommitmentSecrets CounterpartyCommitmentSecrets_clone(const struct LDKCounterpartyCommitmentSecrets *NONNULL_PTR orig);
35878 * Creates a new empty `CounterpartyCommitmentSecrets` structure.
35880 MUST_USE_RES struct LDKCounterpartyCommitmentSecrets CounterpartyCommitmentSecrets_new(void);
35883 * Returns the minimum index of all stored secrets. Note that indexes start
35884 * at 1 << 48 and get decremented by one for each new secret.
35886 MUST_USE_RES uint64_t CounterpartyCommitmentSecrets_get_min_seen_secret(const struct LDKCounterpartyCommitmentSecrets *NONNULL_PTR this_arg);
35889 * Inserts the `secret` at `idx`. Returns `Ok(())` if the secret
35890 * was generated in accordance with BOLT 3 and is consistent with previous secrets.
35892 MUST_USE_RES struct LDKCResult_NoneNoneZ CounterpartyCommitmentSecrets_provide_secret(struct LDKCounterpartyCommitmentSecrets *NONNULL_PTR this_arg, uint64_t idx, struct LDKThirtyTwoBytes secret);
35895 * Returns the secret at `idx`.
35896 * Returns `None` if `idx` is < [`CounterpartyCommitmentSecrets::get_min_seen_secret`].
35898 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
35900 MUST_USE_RES struct LDKThirtyTwoBytes CounterpartyCommitmentSecrets_get_secret(const struct LDKCounterpartyCommitmentSecrets *NONNULL_PTR this_arg, uint64_t idx);
35903 * Serialize the CounterpartyCommitmentSecrets object into a byte array which can be read by CounterpartyCommitmentSecrets_read
35905 struct LDKCVec_u8Z CounterpartyCommitmentSecrets_write(const struct LDKCounterpartyCommitmentSecrets *NONNULL_PTR obj);
35908 * Read a CounterpartyCommitmentSecrets from a byte array, created by CounterpartyCommitmentSecrets_write
35910 struct LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ CounterpartyCommitmentSecrets_read(struct LDKu8slice ser);
35913 * Derives a per-commitment-transaction private key (eg an htlc key or delayed_payment key)
35914 * from the base secret and the per_commitment_point.
35916 struct LDKSecretKey derive_private_key(struct LDKPublicKey per_commitment_point, const uint8_t (*base_secret)[32]);
35919 * Derives a per-commitment-transaction public key (eg an htlc key or a delayed_payment key)
35920 * from the base point and the per_commitment_key. This is the public equivalent of
35921 * derive_private_key - using only public keys to derive a public key instead of private keys.
35923 struct LDKPublicKey derive_public_key(struct LDKPublicKey per_commitment_point, struct LDKPublicKey base_point);
35926 * Derives a per-commitment-transaction revocation key from its constituent parts.
35928 * Only the cheating participant owns a valid witness to propagate a revoked
35929 * commitment transaction, thus per_commitment_secret always come from cheater
35930 * and revocation_base_secret always come from punisher, which is the broadcaster
35931 * of the transaction spending with this key knowledge.
35933 struct LDKSecretKey derive_private_revocation_key(const uint8_t (*per_commitment_secret)[32], const uint8_t (*countersignatory_revocation_base_secret)[32]);
35936 * Derives a per-commitment-transaction revocation public key from its constituent parts. This is
35937 * the public equivalend of derive_private_revocation_key - using only public keys to derive a
35938 * public key instead of private keys.
35940 * Only the cheating participant owns a valid witness to propagate a revoked
35941 * commitment transaction, thus per_commitment_point always come from cheater
35942 * and revocation_base_point always come from punisher, which is the broadcaster
35943 * of the transaction spending with this key knowledge.
35945 * Note that this is infallible iff we trust that at least one of the two input keys are randomly
35946 * generated (ie our own).
35948 struct LDKPublicKey derive_public_revocation_key(struct LDKPublicKey per_commitment_point, struct LDKPublicKey countersignatory_revocation_base_point);
35951 * Frees any resources used by the TxCreationKeys, if is_owned is set and inner is non-NULL.
35953 void TxCreationKeys_free(struct LDKTxCreationKeys this_obj);
35956 * The broadcaster's per-commitment public key which was used to derive the other keys.
35958 struct LDKPublicKey TxCreationKeys_get_per_commitment_point(const struct LDKTxCreationKeys *NONNULL_PTR this_ptr);
35961 * The broadcaster's per-commitment public key which was used to derive the other keys.
35963 void TxCreationKeys_set_per_commitment_point(struct LDKTxCreationKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
35966 * The revocation key which is used to allow the broadcaster of the commitment
35967 * transaction to provide their counterparty the ability to punish them if they broadcast
35970 struct LDKPublicKey TxCreationKeys_get_revocation_key(const struct LDKTxCreationKeys *NONNULL_PTR this_ptr);
35973 * The revocation key which is used to allow the broadcaster of the commitment
35974 * transaction to provide their counterparty the ability to punish them if they broadcast
35977 void TxCreationKeys_set_revocation_key(struct LDKTxCreationKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
35980 * Broadcaster's HTLC Key
35982 struct LDKPublicKey TxCreationKeys_get_broadcaster_htlc_key(const struct LDKTxCreationKeys *NONNULL_PTR this_ptr);
35985 * Broadcaster's HTLC Key
35987 void TxCreationKeys_set_broadcaster_htlc_key(struct LDKTxCreationKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
35990 * Countersignatory's HTLC Key
35992 struct LDKPublicKey TxCreationKeys_get_countersignatory_htlc_key(const struct LDKTxCreationKeys *NONNULL_PTR this_ptr);
35995 * Countersignatory's HTLC Key
35997 void TxCreationKeys_set_countersignatory_htlc_key(struct LDKTxCreationKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
36000 * Broadcaster's Payment Key (which isn't allowed to be spent from for some delay)
36002 struct LDKPublicKey TxCreationKeys_get_broadcaster_delayed_payment_key(const struct LDKTxCreationKeys *NONNULL_PTR this_ptr);
36005 * Broadcaster's Payment Key (which isn't allowed to be spent from for some delay)
36007 void TxCreationKeys_set_broadcaster_delayed_payment_key(struct LDKTxCreationKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
36010 * Constructs a new TxCreationKeys given each field
36012 MUST_USE_RES struct LDKTxCreationKeys TxCreationKeys_new(struct LDKPublicKey per_commitment_point_arg, struct LDKPublicKey revocation_key_arg, struct LDKPublicKey broadcaster_htlc_key_arg, struct LDKPublicKey countersignatory_htlc_key_arg, struct LDKPublicKey broadcaster_delayed_payment_key_arg);
36015 * Checks if two TxCreationKeyss contain equal inner contents.
36016 * This ignores pointers and is_owned flags and looks at the values in fields.
36017 * Two objects with NULL inner values will be considered "equal" here.
36019 bool TxCreationKeys_eq(const struct LDKTxCreationKeys *NONNULL_PTR a, const struct LDKTxCreationKeys *NONNULL_PTR b);
36022 * Creates a copy of the TxCreationKeys
36024 struct LDKTxCreationKeys TxCreationKeys_clone(const struct LDKTxCreationKeys *NONNULL_PTR orig);
36027 * Serialize the TxCreationKeys object into a byte array which can be read by TxCreationKeys_read
36029 struct LDKCVec_u8Z TxCreationKeys_write(const struct LDKTxCreationKeys *NONNULL_PTR obj);
36032 * Read a TxCreationKeys from a byte array, created by TxCreationKeys_write
36034 struct LDKCResult_TxCreationKeysDecodeErrorZ TxCreationKeys_read(struct LDKu8slice ser);
36037 * Frees any resources used by the ChannelPublicKeys, if is_owned is set and inner is non-NULL.
36039 void ChannelPublicKeys_free(struct LDKChannelPublicKeys this_obj);
36042 * The public key which is used to sign all commitment transactions, as it appears in the
36043 * on-chain channel lock-in 2-of-2 multisig output.
36045 struct LDKPublicKey ChannelPublicKeys_get_funding_pubkey(const struct LDKChannelPublicKeys *NONNULL_PTR this_ptr);
36048 * The public key which is used to sign all commitment transactions, as it appears in the
36049 * on-chain channel lock-in 2-of-2 multisig output.
36051 void ChannelPublicKeys_set_funding_pubkey(struct LDKChannelPublicKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
36054 * The base point which is used (with derive_public_revocation_key) to derive per-commitment
36055 * revocation keys. This is combined with the per-commitment-secret generated by the
36056 * counterparty to create a secret which the counterparty can reveal to revoke previous
36059 struct LDKPublicKey ChannelPublicKeys_get_revocation_basepoint(const struct LDKChannelPublicKeys *NONNULL_PTR this_ptr);
36062 * The base point which is used (with derive_public_revocation_key) to derive per-commitment
36063 * revocation keys. This is combined with the per-commitment-secret generated by the
36064 * counterparty to create a secret which the counterparty can reveal to revoke previous
36067 void ChannelPublicKeys_set_revocation_basepoint(struct LDKChannelPublicKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
36070 * The public key on which the non-broadcaster (ie the countersignatory) receives an immediately
36071 * spendable primary channel balance on the broadcaster's commitment transaction. This key is
36072 * static across every commitment transaction.
36074 struct LDKPublicKey ChannelPublicKeys_get_payment_point(const struct LDKChannelPublicKeys *NONNULL_PTR this_ptr);
36077 * The public key on which the non-broadcaster (ie the countersignatory) receives an immediately
36078 * spendable primary channel balance on the broadcaster's commitment transaction. This key is
36079 * static across every commitment transaction.
36081 void ChannelPublicKeys_set_payment_point(struct LDKChannelPublicKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
36084 * The base point which is used (with derive_public_key) to derive a per-commitment payment
36085 * public key which receives non-HTLC-encumbered funds which are only available for spending
36086 * after some delay (or can be claimed via the revocation path).
36088 struct LDKPublicKey ChannelPublicKeys_get_delayed_payment_basepoint(const struct LDKChannelPublicKeys *NONNULL_PTR this_ptr);
36091 * The base point which is used (with derive_public_key) to derive a per-commitment payment
36092 * public key which receives non-HTLC-encumbered funds which are only available for spending
36093 * after some delay (or can be claimed via the revocation path).
36095 void ChannelPublicKeys_set_delayed_payment_basepoint(struct LDKChannelPublicKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
36098 * The base point which is used (with derive_public_key) to derive a per-commitment public key
36099 * which is used to encumber HTLC-in-flight outputs.
36101 struct LDKPublicKey ChannelPublicKeys_get_htlc_basepoint(const struct LDKChannelPublicKeys *NONNULL_PTR this_ptr);
36104 * The base point which is used (with derive_public_key) to derive a per-commitment public key
36105 * which is used to encumber HTLC-in-flight outputs.
36107 void ChannelPublicKeys_set_htlc_basepoint(struct LDKChannelPublicKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
36110 * Constructs a new ChannelPublicKeys given each field
36112 MUST_USE_RES struct LDKChannelPublicKeys ChannelPublicKeys_new(struct LDKPublicKey funding_pubkey_arg, struct LDKPublicKey revocation_basepoint_arg, struct LDKPublicKey payment_point_arg, struct LDKPublicKey delayed_payment_basepoint_arg, struct LDKPublicKey htlc_basepoint_arg);
36115 * Creates a copy of the ChannelPublicKeys
36117 struct LDKChannelPublicKeys ChannelPublicKeys_clone(const struct LDKChannelPublicKeys *NONNULL_PTR orig);
36120 * Generates a non-cryptographic 64-bit hash of the ChannelPublicKeys.
36122 uint64_t ChannelPublicKeys_hash(const struct LDKChannelPublicKeys *NONNULL_PTR o);
36125 * Checks if two ChannelPublicKeyss contain equal inner contents.
36126 * This ignores pointers and is_owned flags and looks at the values in fields.
36127 * Two objects with NULL inner values will be considered "equal" here.
36129 bool ChannelPublicKeys_eq(const struct LDKChannelPublicKeys *NONNULL_PTR a, const struct LDKChannelPublicKeys *NONNULL_PTR b);
36132 * Serialize the ChannelPublicKeys object into a byte array which can be read by ChannelPublicKeys_read
36134 struct LDKCVec_u8Z ChannelPublicKeys_write(const struct LDKChannelPublicKeys *NONNULL_PTR obj);
36137 * Read a ChannelPublicKeys from a byte array, created by ChannelPublicKeys_write
36139 struct LDKCResult_ChannelPublicKeysDecodeErrorZ ChannelPublicKeys_read(struct LDKu8slice ser);
36142 * Create per-state keys from channel base points and the per-commitment point.
36143 * Key set is asymmetric and can't be used as part of counter-signatory set of transactions.
36145 MUST_USE_RES struct LDKTxCreationKeys TxCreationKeys_derive_new(struct LDKPublicKey per_commitment_point, struct LDKPublicKey broadcaster_delayed_payment_base, struct LDKPublicKey broadcaster_htlc_base, struct LDKPublicKey countersignatory_revocation_base, struct LDKPublicKey countersignatory_htlc_base);
36148 * Generate per-state keys from channel static keys.
36149 * Key set is asymmetric and can't be used as part of counter-signatory set of transactions.
36151 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);
36154 * A script either spendable by the revocation
36155 * key or the broadcaster_delayed_payment_key and satisfying the relative-locktime OP_CSV constrain.
36156 * Encumbering a `to_holder` output on a commitment transaction or 2nd-stage HTLC transactions.
36158 struct LDKCVec_u8Z get_revokeable_redeemscript(struct LDKPublicKey revocation_key, uint16_t contest_delay, struct LDKPublicKey broadcaster_delayed_payment_key);
36161 * Returns the script for the counterparty's output on a holder's commitment transaction based on
36162 * the channel type.
36164 struct LDKCVec_u8Z get_counterparty_payment_script(const struct LDKChannelTypeFeatures *NONNULL_PTR channel_type_features, struct LDKPublicKey payment_key);
36167 * Frees any resources used by the HTLCOutputInCommitment, if is_owned is set and inner is non-NULL.
36169 void HTLCOutputInCommitment_free(struct LDKHTLCOutputInCommitment this_obj);
36172 * Whether the HTLC was \"offered\" (ie outbound in relation to this commitment transaction).
36173 * Note that this is not the same as whether it is ountbound *from us*. To determine that you
36174 * need to compare this value to whether the commitment transaction in question is that of
36175 * the counterparty or our own.
36177 bool HTLCOutputInCommitment_get_offered(const struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr);
36180 * Whether the HTLC was \"offered\" (ie outbound in relation to this commitment transaction).
36181 * Note that this is not the same as whether it is ountbound *from us*. To determine that you
36182 * need to compare this value to whether the commitment transaction in question is that of
36183 * the counterparty or our own.
36185 void HTLCOutputInCommitment_set_offered(struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr, bool val);
36188 * The value, in msat, of the HTLC. The value as it appears in the commitment transaction is
36189 * this divided by 1000.
36191 uint64_t HTLCOutputInCommitment_get_amount_msat(const struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr);
36194 * The value, in msat, of the HTLC. The value as it appears in the commitment transaction is
36195 * this divided by 1000.
36197 void HTLCOutputInCommitment_set_amount_msat(struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr, uint64_t val);
36200 * The CLTV lock-time at which this HTLC expires.
36202 uint32_t HTLCOutputInCommitment_get_cltv_expiry(const struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr);
36205 * The CLTV lock-time at which this HTLC expires.
36207 void HTLCOutputInCommitment_set_cltv_expiry(struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr, uint32_t val);
36210 * The hash of the preimage which unlocks this HTLC.
36212 const uint8_t (*HTLCOutputInCommitment_get_payment_hash(const struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr))[32];
36215 * The hash of the preimage which unlocks this HTLC.
36217 void HTLCOutputInCommitment_set_payment_hash(struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
36220 * The position within the commitment transactions' outputs. This may be None if the value is
36221 * below the dust limit (in which case no output appears in the commitment transaction and the
36222 * value is spent to additional transaction fees).
36224 struct LDKCOption_u32Z HTLCOutputInCommitment_get_transaction_output_index(const struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr);
36227 * The position within the commitment transactions' outputs. This may be None if the value is
36228 * below the dust limit (in which case no output appears in the commitment transaction and the
36229 * value is spent to additional transaction fees).
36231 void HTLCOutputInCommitment_set_transaction_output_index(struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr, struct LDKCOption_u32Z val);
36234 * Constructs a new HTLCOutputInCommitment given each field
36236 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);
36239 * Creates a copy of the HTLCOutputInCommitment
36241 struct LDKHTLCOutputInCommitment HTLCOutputInCommitment_clone(const struct LDKHTLCOutputInCommitment *NONNULL_PTR orig);
36244 * Checks if two HTLCOutputInCommitments contain equal inner contents.
36245 * This ignores pointers and is_owned flags and looks at the values in fields.
36246 * Two objects with NULL inner values will be considered "equal" here.
36248 bool HTLCOutputInCommitment_eq(const struct LDKHTLCOutputInCommitment *NONNULL_PTR a, const struct LDKHTLCOutputInCommitment *NONNULL_PTR b);
36251 * Serialize the HTLCOutputInCommitment object into a byte array which can be read by HTLCOutputInCommitment_read
36253 struct LDKCVec_u8Z HTLCOutputInCommitment_write(const struct LDKHTLCOutputInCommitment *NONNULL_PTR obj);
36256 * Read a HTLCOutputInCommitment from a byte array, created by HTLCOutputInCommitment_write
36258 struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ HTLCOutputInCommitment_read(struct LDKu8slice ser);
36261 * Gets the witness redeemscript for an HTLC output in a commitment transaction. Note that htlc
36262 * does not need to have its previous_output_index filled.
36264 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);
36267 * Gets the redeemscript for a funding output from the two funding public keys.
36268 * Note that the order of funding public keys does not matter.
36270 struct LDKCVec_u8Z make_funding_redeemscript(struct LDKPublicKey broadcaster, struct LDKPublicKey countersignatory);
36273 * Builds an unsigned HTLC-Success or HTLC-Timeout transaction from the given channel and HTLC
36274 * parameters. This is used by [`TrustedCommitmentTransaction::get_htlc_sigs`] to fetch the
36275 * transaction which needs signing, and can be used to construct an HTLC transaction which is
36276 * broadcastable given a counterparty HTLC signature.
36278 * Panics if htlc.transaction_output_index.is_none() (as such HTLCs do not appear in the
36279 * commitment transaction).
36281 struct LDKTransaction build_htlc_transaction(const uint8_t (*commitment_txid)[32], uint32_t feerate_per_kw, uint16_t contest_delay, const struct LDKHTLCOutputInCommitment *NONNULL_PTR htlc, const struct LDKChannelTypeFeatures *NONNULL_PTR channel_type_features, struct LDKPublicKey broadcaster_delayed_payment_key, struct LDKPublicKey revocation_key);
36284 * Returns the witness required to satisfy and spend a HTLC input.
36286 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);
36289 * Gets the witnessScript for the to_remote output when anchors are enabled.
36291 struct LDKCVec_u8Z get_to_countersignatory_with_anchors_redeemscript(struct LDKPublicKey payment_point);
36294 * Gets the witnessScript for an anchor output from the funding public key.
36295 * The witness in the spending input must be:
36296 * <BIP 143 funding_signature>
36297 * After 16 blocks of confirmation, an alternative satisfying witness could be:
36299 * (empty vector required to satisfy compliance with MINIMALIF-standard rule)
36301 struct LDKCVec_u8Z get_anchor_redeemscript(struct LDKPublicKey funding_pubkey);
36304 * Returns the witness required to satisfy and spend an anchor input.
36306 struct LDKWitness build_anchor_input_witness(struct LDKPublicKey funding_key, struct LDKECDSASignature funding_sig);
36309 * Frees any resources used by the ChannelTransactionParameters, if is_owned is set and inner is non-NULL.
36311 void ChannelTransactionParameters_free(struct LDKChannelTransactionParameters this_obj);
36314 * Holder public keys
36316 struct LDKChannelPublicKeys ChannelTransactionParameters_get_holder_pubkeys(const struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr);
36319 * Holder public keys
36321 void ChannelTransactionParameters_set_holder_pubkeys(struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr, struct LDKChannelPublicKeys val);
36324 * The contest delay selected by the holder, which applies to counterparty-broadcast transactions
36326 uint16_t ChannelTransactionParameters_get_holder_selected_contest_delay(const struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr);
36329 * The contest delay selected by the holder, which applies to counterparty-broadcast transactions
36331 void ChannelTransactionParameters_set_holder_selected_contest_delay(struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr, uint16_t val);
36334 * Whether the holder is the initiator of this channel.
36335 * This is an input to the commitment number obscure factor computation.
36337 bool ChannelTransactionParameters_get_is_outbound_from_holder(const struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr);
36340 * Whether the holder is the initiator of this channel.
36341 * This is an input to the commitment number obscure factor computation.
36343 void ChannelTransactionParameters_set_is_outbound_from_holder(struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr, bool val);
36346 * The late-bound counterparty channel transaction parameters.
36347 * These parameters are populated at the point in the protocol where the counterparty provides them.
36349 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
36351 struct LDKCounterpartyChannelTransactionParameters ChannelTransactionParameters_get_counterparty_parameters(const struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr);
36354 * The late-bound counterparty channel transaction parameters.
36355 * These parameters are populated at the point in the protocol where the counterparty provides them.
36357 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
36359 void ChannelTransactionParameters_set_counterparty_parameters(struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr, struct LDKCounterpartyChannelTransactionParameters val);
36362 * The late-bound funding outpoint
36364 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
36366 struct LDKOutPoint ChannelTransactionParameters_get_funding_outpoint(const struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr);
36369 * The late-bound funding outpoint
36371 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
36373 void ChannelTransactionParameters_set_funding_outpoint(struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr, struct LDKOutPoint val);
36376 * This channel's type, as negotiated during channel open. For old objects where this field
36377 * wasn't serialized, it will default to static_remote_key at deserialization.
36379 struct LDKChannelTypeFeatures ChannelTransactionParameters_get_channel_type_features(const struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr);
36382 * This channel's type, as negotiated during channel open. For old objects where this field
36383 * wasn't serialized, it will default to static_remote_key at deserialization.
36385 void ChannelTransactionParameters_set_channel_type_features(struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr, struct LDKChannelTypeFeatures val);
36388 * Constructs a new ChannelTransactionParameters given each field
36390 * Note that counterparty_parameters_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
36391 * Note that funding_outpoint_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
36393 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);
36396 * Creates a copy of the ChannelTransactionParameters
36398 struct LDKChannelTransactionParameters ChannelTransactionParameters_clone(const struct LDKChannelTransactionParameters *NONNULL_PTR orig);
36401 * Generates a non-cryptographic 64-bit hash of the ChannelTransactionParameters.
36403 uint64_t ChannelTransactionParameters_hash(const struct LDKChannelTransactionParameters *NONNULL_PTR o);
36406 * Checks if two ChannelTransactionParameterss contain equal inner contents.
36407 * This ignores pointers and is_owned flags and looks at the values in fields.
36408 * Two objects with NULL inner values will be considered "equal" here.
36410 bool ChannelTransactionParameters_eq(const struct LDKChannelTransactionParameters *NONNULL_PTR a, const struct LDKChannelTransactionParameters *NONNULL_PTR b);
36413 * Frees any resources used by the CounterpartyChannelTransactionParameters, if is_owned is set and inner is non-NULL.
36415 void CounterpartyChannelTransactionParameters_free(struct LDKCounterpartyChannelTransactionParameters this_obj);
36418 * Counter-party public keys
36420 struct LDKChannelPublicKeys CounterpartyChannelTransactionParameters_get_pubkeys(const struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR this_ptr);
36423 * Counter-party public keys
36425 void CounterpartyChannelTransactionParameters_set_pubkeys(struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR this_ptr, struct LDKChannelPublicKeys val);
36428 * The contest delay selected by the counterparty, which applies to holder-broadcast transactions
36430 uint16_t CounterpartyChannelTransactionParameters_get_selected_contest_delay(const struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR this_ptr);
36433 * The contest delay selected by the counterparty, which applies to holder-broadcast transactions
36435 void CounterpartyChannelTransactionParameters_set_selected_contest_delay(struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR this_ptr, uint16_t val);
36438 * Constructs a new CounterpartyChannelTransactionParameters given each field
36440 MUST_USE_RES struct LDKCounterpartyChannelTransactionParameters CounterpartyChannelTransactionParameters_new(struct LDKChannelPublicKeys pubkeys_arg, uint16_t selected_contest_delay_arg);
36443 * Creates a copy of the CounterpartyChannelTransactionParameters
36445 struct LDKCounterpartyChannelTransactionParameters CounterpartyChannelTransactionParameters_clone(const struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR orig);
36448 * Generates a non-cryptographic 64-bit hash of the CounterpartyChannelTransactionParameters.
36450 uint64_t CounterpartyChannelTransactionParameters_hash(const struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR o);
36453 * Checks if two CounterpartyChannelTransactionParameterss contain equal inner contents.
36454 * This ignores pointers and is_owned flags and looks at the values in fields.
36455 * Two objects with NULL inner values will be considered "equal" here.
36457 bool CounterpartyChannelTransactionParameters_eq(const struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR a, const struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR b);
36460 * Whether the late bound parameters are populated.
36462 MUST_USE_RES bool ChannelTransactionParameters_is_populated(const struct LDKChannelTransactionParameters *NONNULL_PTR this_arg);
36465 * Convert the holder/counterparty parameters to broadcaster/countersignatory-organized parameters,
36466 * given that the holder is the broadcaster.
36468 * self.is_populated() must be true before calling this function.
36470 MUST_USE_RES struct LDKDirectedChannelTransactionParameters ChannelTransactionParameters_as_holder_broadcastable(const struct LDKChannelTransactionParameters *NONNULL_PTR this_arg);
36473 * Convert the holder/counterparty parameters to broadcaster/countersignatory-organized parameters,
36474 * given that the counterparty is the broadcaster.
36476 * self.is_populated() must be true before calling this function.
36478 MUST_USE_RES struct LDKDirectedChannelTransactionParameters ChannelTransactionParameters_as_counterparty_broadcastable(const struct LDKChannelTransactionParameters *NONNULL_PTR this_arg);
36481 * Serialize the CounterpartyChannelTransactionParameters object into a byte array which can be read by CounterpartyChannelTransactionParameters_read
36483 struct LDKCVec_u8Z CounterpartyChannelTransactionParameters_write(const struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR obj);
36486 * Read a CounterpartyChannelTransactionParameters from a byte array, created by CounterpartyChannelTransactionParameters_write
36488 struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ CounterpartyChannelTransactionParameters_read(struct LDKu8slice ser);
36491 * Serialize the ChannelTransactionParameters object into a byte array which can be read by ChannelTransactionParameters_read
36493 struct LDKCVec_u8Z ChannelTransactionParameters_write(const struct LDKChannelTransactionParameters *NONNULL_PTR obj);
36496 * Read a ChannelTransactionParameters from a byte array, created by ChannelTransactionParameters_write
36498 struct LDKCResult_ChannelTransactionParametersDecodeErrorZ ChannelTransactionParameters_read(struct LDKu8slice ser);
36501 * Frees any resources used by the DirectedChannelTransactionParameters, if is_owned is set and inner is non-NULL.
36503 void DirectedChannelTransactionParameters_free(struct LDKDirectedChannelTransactionParameters this_obj);
36506 * Get the channel pubkeys for the broadcaster
36508 MUST_USE_RES struct LDKChannelPublicKeys DirectedChannelTransactionParameters_broadcaster_pubkeys(const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR this_arg);
36511 * Get the channel pubkeys for the countersignatory
36513 MUST_USE_RES struct LDKChannelPublicKeys DirectedChannelTransactionParameters_countersignatory_pubkeys(const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR this_arg);
36516 * Get the contest delay applicable to the transactions.
36517 * Note that the contest delay was selected by the countersignatory.
36519 MUST_USE_RES uint16_t DirectedChannelTransactionParameters_contest_delay(const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR this_arg);
36522 * Whether the channel is outbound from the broadcaster.
36524 * The boolean representing the side that initiated the channel is
36525 * an input to the commitment number obscure factor computation.
36527 MUST_USE_RES bool DirectedChannelTransactionParameters_is_outbound(const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR this_arg);
36530 * The funding outpoint
36532 MUST_USE_RES struct LDKOutPoint DirectedChannelTransactionParameters_funding_outpoint(const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR this_arg);
36535 * Whether to use anchors for this channel
36537 MUST_USE_RES struct LDKChannelTypeFeatures DirectedChannelTransactionParameters_channel_type_features(const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR this_arg);
36540 * Frees any resources used by the HolderCommitmentTransaction, if is_owned is set and inner is non-NULL.
36542 void HolderCommitmentTransaction_free(struct LDKHolderCommitmentTransaction this_obj);
36545 * Our counterparty's signature for the transaction
36547 struct LDKECDSASignature HolderCommitmentTransaction_get_counterparty_sig(const struct LDKHolderCommitmentTransaction *NONNULL_PTR this_ptr);
36550 * Our counterparty's signature for the transaction
36552 void HolderCommitmentTransaction_set_counterparty_sig(struct LDKHolderCommitmentTransaction *NONNULL_PTR this_ptr, struct LDKECDSASignature val);
36555 * All non-dust counterparty HTLC signatures, in the order they appear in the transaction
36557 * Returns a copy of the field.
36559 struct LDKCVec_ECDSASignatureZ HolderCommitmentTransaction_get_counterparty_htlc_sigs(const struct LDKHolderCommitmentTransaction *NONNULL_PTR this_ptr);
36562 * All non-dust counterparty HTLC signatures, in the order they appear in the transaction
36564 void HolderCommitmentTransaction_set_counterparty_htlc_sigs(struct LDKHolderCommitmentTransaction *NONNULL_PTR this_ptr, struct LDKCVec_ECDSASignatureZ val);
36567 * Creates a copy of the HolderCommitmentTransaction
36569 struct LDKHolderCommitmentTransaction HolderCommitmentTransaction_clone(const struct LDKHolderCommitmentTransaction *NONNULL_PTR orig);
36572 * Serialize the HolderCommitmentTransaction object into a byte array which can be read by HolderCommitmentTransaction_read
36574 struct LDKCVec_u8Z HolderCommitmentTransaction_write(const struct LDKHolderCommitmentTransaction *NONNULL_PTR obj);
36577 * Read a HolderCommitmentTransaction from a byte array, created by HolderCommitmentTransaction_write
36579 struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ HolderCommitmentTransaction_read(struct LDKu8slice ser);
36582 * Create a new holder transaction with the given counterparty signatures.
36583 * The funding keys are used to figure out which signature should go first when building the transaction for broadcast.
36585 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);
36588 * Frees any resources used by the BuiltCommitmentTransaction, if is_owned is set and inner is non-NULL.
36590 void BuiltCommitmentTransaction_free(struct LDKBuiltCommitmentTransaction this_obj);
36593 * The commitment transaction
36595 struct LDKTransaction BuiltCommitmentTransaction_get_transaction(const struct LDKBuiltCommitmentTransaction *NONNULL_PTR this_ptr);
36598 * The commitment transaction
36600 void BuiltCommitmentTransaction_set_transaction(struct LDKBuiltCommitmentTransaction *NONNULL_PTR this_ptr, struct LDKTransaction val);
36603 * The txid for the commitment transaction.
36605 * This is provided as a performance optimization, instead of calling transaction.txid()
36608 const uint8_t (*BuiltCommitmentTransaction_get_txid(const struct LDKBuiltCommitmentTransaction *NONNULL_PTR this_ptr))[32];
36611 * The txid for the commitment transaction.
36613 * This is provided as a performance optimization, instead of calling transaction.txid()
36616 void BuiltCommitmentTransaction_set_txid(struct LDKBuiltCommitmentTransaction *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
36619 * Constructs a new BuiltCommitmentTransaction given each field
36621 MUST_USE_RES struct LDKBuiltCommitmentTransaction BuiltCommitmentTransaction_new(struct LDKTransaction transaction_arg, struct LDKThirtyTwoBytes txid_arg);
36624 * Creates a copy of the BuiltCommitmentTransaction
36626 struct LDKBuiltCommitmentTransaction BuiltCommitmentTransaction_clone(const struct LDKBuiltCommitmentTransaction *NONNULL_PTR orig);
36629 * Serialize the BuiltCommitmentTransaction object into a byte array which can be read by BuiltCommitmentTransaction_read
36631 struct LDKCVec_u8Z BuiltCommitmentTransaction_write(const struct LDKBuiltCommitmentTransaction *NONNULL_PTR obj);
36634 * Read a BuiltCommitmentTransaction from a byte array, created by BuiltCommitmentTransaction_write
36636 struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ BuiltCommitmentTransaction_read(struct LDKu8slice ser);
36639 * Get the SIGHASH_ALL sighash value of the transaction.
36641 * This can be used to verify a signature.
36643 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);
36646 * Signs the counterparty's commitment transaction.
36648 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);
36651 * Signs the holder commitment transaction because we are about to broadcast it.
36653 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);
36656 * Frees any resources used by the ClosingTransaction, if is_owned is set and inner is non-NULL.
36658 void ClosingTransaction_free(struct LDKClosingTransaction this_obj);
36661 * Creates a copy of the ClosingTransaction
36663 struct LDKClosingTransaction ClosingTransaction_clone(const struct LDKClosingTransaction *NONNULL_PTR orig);
36666 * Generates a non-cryptographic 64-bit hash of the ClosingTransaction.
36668 uint64_t ClosingTransaction_hash(const struct LDKClosingTransaction *NONNULL_PTR o);
36671 * Checks if two ClosingTransactions contain equal inner contents.
36672 * This ignores pointers and is_owned flags and looks at the values in fields.
36673 * Two objects with NULL inner values will be considered "equal" here.
36675 bool ClosingTransaction_eq(const struct LDKClosingTransaction *NONNULL_PTR a, const struct LDKClosingTransaction *NONNULL_PTR b);
36678 * Construct an object of the class
36680 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);
36683 * Trust our pre-built transaction.
36685 * Applies a wrapper which allows access to the transaction.
36687 * This should only be used if you fully trust the builder of this object. It should not
36688 * be used by an external signer - instead use the verify function.
36690 MUST_USE_RES struct LDKTrustedClosingTransaction ClosingTransaction_trust(const struct LDKClosingTransaction *NONNULL_PTR this_arg);
36693 * Verify our pre-built transaction.
36695 * Applies a wrapper which allows access to the transaction.
36697 * An external validating signer must call this method before signing
36698 * or using the built transaction.
36700 MUST_USE_RES struct LDKCResult_TrustedClosingTransactionNoneZ ClosingTransaction_verify(const struct LDKClosingTransaction *NONNULL_PTR this_arg, struct LDKOutPoint funding_outpoint);
36703 * The value to be sent to the holder, or zero if the output will be omitted
36705 MUST_USE_RES uint64_t ClosingTransaction_to_holder_value_sat(const struct LDKClosingTransaction *NONNULL_PTR this_arg);
36708 * The value to be sent to the counterparty, or zero if the output will be omitted
36710 MUST_USE_RES uint64_t ClosingTransaction_to_counterparty_value_sat(const struct LDKClosingTransaction *NONNULL_PTR this_arg);
36713 * The destination of the holder's output
36715 MUST_USE_RES struct LDKu8slice ClosingTransaction_to_holder_script(const struct LDKClosingTransaction *NONNULL_PTR this_arg);
36718 * The destination of the counterparty's output
36720 MUST_USE_RES struct LDKu8slice ClosingTransaction_to_counterparty_script(const struct LDKClosingTransaction *NONNULL_PTR this_arg);
36723 * Frees any resources used by the TrustedClosingTransaction, if is_owned is set and inner is non-NULL.
36725 void TrustedClosingTransaction_free(struct LDKTrustedClosingTransaction this_obj);
36728 * The pre-built Bitcoin commitment transaction
36730 MUST_USE_RES struct LDKTransaction TrustedClosingTransaction_built_transaction(const struct LDKTrustedClosingTransaction *NONNULL_PTR this_arg);
36733 * Get the SIGHASH_ALL sighash value of the transaction.
36735 * This can be used to verify a signature.
36737 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);
36740 * Sign a transaction, either because we are counter-signing the counterparty's transaction or
36741 * because we are about to broadcast a holder transaction.
36743 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);
36746 * Frees any resources used by the CommitmentTransaction, if is_owned is set and inner is non-NULL.
36748 void CommitmentTransaction_free(struct LDKCommitmentTransaction this_obj);
36751 * Creates a copy of the CommitmentTransaction
36753 struct LDKCommitmentTransaction CommitmentTransaction_clone(const struct LDKCommitmentTransaction *NONNULL_PTR orig);
36756 * Serialize the CommitmentTransaction object into a byte array which can be read by CommitmentTransaction_read
36758 struct LDKCVec_u8Z CommitmentTransaction_write(const struct LDKCommitmentTransaction *NONNULL_PTR obj);
36761 * Read a CommitmentTransaction from a byte array, created by CommitmentTransaction_write
36763 struct LDKCResult_CommitmentTransactionDecodeErrorZ CommitmentTransaction_read(struct LDKu8slice ser);
36766 * The backwards-counting commitment number
36768 MUST_USE_RES uint64_t CommitmentTransaction_commitment_number(const struct LDKCommitmentTransaction *NONNULL_PTR this_arg);
36771 * The value to be sent to the broadcaster
36773 MUST_USE_RES uint64_t CommitmentTransaction_to_broadcaster_value_sat(const struct LDKCommitmentTransaction *NONNULL_PTR this_arg);
36776 * The value to be sent to the counterparty
36778 MUST_USE_RES uint64_t CommitmentTransaction_to_countersignatory_value_sat(const struct LDKCommitmentTransaction *NONNULL_PTR this_arg);
36781 * The feerate paid per 1000-weight-unit in this commitment transaction.
36783 MUST_USE_RES uint32_t CommitmentTransaction_feerate_per_kw(const struct LDKCommitmentTransaction *NONNULL_PTR this_arg);
36786 * Trust our pre-built transaction and derived transaction creation public keys.
36788 * Applies a wrapper which allows access to these fields.
36790 * This should only be used if you fully trust the builder of this object. It should not
36791 * be used by an external signer - instead use the verify function.
36793 MUST_USE_RES struct LDKTrustedCommitmentTransaction CommitmentTransaction_trust(const struct LDKCommitmentTransaction *NONNULL_PTR this_arg);
36796 * Verify our pre-built transaction and derived transaction creation public keys.
36798 * Applies a wrapper which allows access to these fields.
36800 * An external validating signer must call this method before signing
36801 * or using the built transaction.
36803 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);
36806 * Frees any resources used by the TrustedCommitmentTransaction, if is_owned is set and inner is non-NULL.
36808 void TrustedCommitmentTransaction_free(struct LDKTrustedCommitmentTransaction this_obj);
36811 * The transaction ID of the built Bitcoin transaction
36813 MUST_USE_RES struct LDKThirtyTwoBytes TrustedCommitmentTransaction_txid(const struct LDKTrustedCommitmentTransaction *NONNULL_PTR this_arg);
36816 * The pre-built Bitcoin commitment transaction
36818 MUST_USE_RES struct LDKBuiltCommitmentTransaction TrustedCommitmentTransaction_built_transaction(const struct LDKTrustedCommitmentTransaction *NONNULL_PTR this_arg);
36821 * The pre-calculated transaction creation public keys.
36823 MUST_USE_RES struct LDKTxCreationKeys TrustedCommitmentTransaction_keys(const struct LDKTrustedCommitmentTransaction *NONNULL_PTR this_arg);
36826 * Should anchors be used.
36828 MUST_USE_RES struct LDKChannelTypeFeatures TrustedCommitmentTransaction_channel_type_features(const struct LDKTrustedCommitmentTransaction *NONNULL_PTR this_arg);
36831 * Get a signature for each HTLC which was included in the commitment transaction (ie for
36832 * which HTLCOutputInCommitment::transaction_output_index.is_some()).
36834 * The returned Vec has one entry for each HTLC, and in the same order.
36836 * This function is only valid in the holder commitment context, it always uses EcdsaSighashType::All.
36838 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);
36841 * Returns the index of the revokeable output, i.e. the `to_local` output sending funds to
36842 * the broadcaster, in the built transaction, if any exists.
36844 * There are two cases where this may return `None`:
36845 * - The balance of the revokeable output is below the dust limit (only found on commitments
36846 * early in the channel's lifetime, i.e. before the channel reserve is met).
36847 * - This commitment was created before LDK 0.0.117. In this case, the
36848 * commitment transaction previously didn't contain enough information to locate the
36849 * revokeable output.
36851 MUST_USE_RES struct LDKCOption_usizeZ TrustedCommitmentTransaction_revokeable_output_index(const struct LDKTrustedCommitmentTransaction *NONNULL_PTR this_arg);
36854 * Helper method to build an unsigned justice transaction spending the revokeable
36855 * `to_local` output to a destination script. Fee estimation accounts for the expected
36856 * revocation witness data that will be added when signed.
36858 * This method will error if the given fee rate results in a fee greater than the value
36859 * of the output being spent, or if there exists no revokeable `to_local` output on this
36860 * commitment transaction. See [`Self::revokeable_output_index`] for more details.
36862 * The built transaction will allow fee bumping with RBF, and this method takes
36863 * `feerate_per_kw` as an input such that multiple copies of a justice transaction at different
36864 * fee rates may be built.
36866 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);
36869 * Commitment transaction numbers which appear in the transactions themselves are XOR'd with a
36870 * shared secret first. This prevents on-chain observers from discovering how many commitment
36871 * transactions occurred in a channel before it was closed.
36873 * This function gets the shared secret from relevant channel public keys and can be used to
36874 * \"decrypt\" the commitment transaction number given a commitment transaction on-chain.
36876 uint64_t get_commitment_transaction_number_obscure_factor(struct LDKPublicKey broadcaster_payment_basepoint, struct LDKPublicKey countersignatory_payment_basepoint, bool outbound_from_broadcaster);
36879 * Checks if two InitFeaturess contain equal inner contents.
36880 * This ignores pointers and is_owned flags and looks at the values in fields.
36881 * Two objects with NULL inner values will be considered "equal" here.
36883 bool InitFeatures_eq(const struct LDKInitFeatures *NONNULL_PTR a, const struct LDKInitFeatures *NONNULL_PTR b);
36886 * Checks if two NodeFeaturess contain equal inner contents.
36887 * This ignores pointers and is_owned flags and looks at the values in fields.
36888 * Two objects with NULL inner values will be considered "equal" here.
36890 bool NodeFeatures_eq(const struct LDKNodeFeatures *NONNULL_PTR a, const struct LDKNodeFeatures *NONNULL_PTR b);
36893 * Checks if two ChannelFeaturess contain equal inner contents.
36894 * This ignores pointers and is_owned flags and looks at the values in fields.
36895 * Two objects with NULL inner values will be considered "equal" here.
36897 bool ChannelFeatures_eq(const struct LDKChannelFeatures *NONNULL_PTR a, const struct LDKChannelFeatures *NONNULL_PTR b);
36900 * Checks if two Bolt11InvoiceFeaturess contain equal inner contents.
36901 * This ignores pointers and is_owned flags and looks at the values in fields.
36902 * Two objects with NULL inner values will be considered "equal" here.
36904 bool Bolt11InvoiceFeatures_eq(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR a, const struct LDKBolt11InvoiceFeatures *NONNULL_PTR b);
36907 * Checks if two OfferFeaturess contain equal inner contents.
36908 * This ignores pointers and is_owned flags and looks at the values in fields.
36909 * Two objects with NULL inner values will be considered "equal" here.
36911 bool OfferFeatures_eq(const struct LDKOfferFeatures *NONNULL_PTR a, const struct LDKOfferFeatures *NONNULL_PTR b);
36914 * Checks if two InvoiceRequestFeaturess contain equal inner contents.
36915 * This ignores pointers and is_owned flags and looks at the values in fields.
36916 * Two objects with NULL inner values will be considered "equal" here.
36918 bool InvoiceRequestFeatures_eq(const struct LDKInvoiceRequestFeatures *NONNULL_PTR a, const struct LDKInvoiceRequestFeatures *NONNULL_PTR b);
36921 * Checks if two Bolt12InvoiceFeaturess contain equal inner contents.
36922 * This ignores pointers and is_owned flags and looks at the values in fields.
36923 * Two objects with NULL inner values will be considered "equal" here.
36925 bool Bolt12InvoiceFeatures_eq(const struct LDKBolt12InvoiceFeatures *NONNULL_PTR a, const struct LDKBolt12InvoiceFeatures *NONNULL_PTR b);
36928 * Checks if two BlindedHopFeaturess contain equal inner contents.
36929 * This ignores pointers and is_owned flags and looks at the values in fields.
36930 * Two objects with NULL inner values will be considered "equal" here.
36932 bool BlindedHopFeatures_eq(const struct LDKBlindedHopFeatures *NONNULL_PTR a, const struct LDKBlindedHopFeatures *NONNULL_PTR b);
36935 * Checks if two ChannelTypeFeaturess contain equal inner contents.
36936 * This ignores pointers and is_owned flags and looks at the values in fields.
36937 * Two objects with NULL inner values will be considered "equal" here.
36939 bool ChannelTypeFeatures_eq(const struct LDKChannelTypeFeatures *NONNULL_PTR a, const struct LDKChannelTypeFeatures *NONNULL_PTR b);
36942 * Creates a copy of the InitFeatures
36944 struct LDKInitFeatures InitFeatures_clone(const struct LDKInitFeatures *NONNULL_PTR orig);
36947 * Creates a copy of the NodeFeatures
36949 struct LDKNodeFeatures NodeFeatures_clone(const struct LDKNodeFeatures *NONNULL_PTR orig);
36952 * Creates a copy of the ChannelFeatures
36954 struct LDKChannelFeatures ChannelFeatures_clone(const struct LDKChannelFeatures *NONNULL_PTR orig);
36957 * Creates a copy of the Bolt11InvoiceFeatures
36959 struct LDKBolt11InvoiceFeatures Bolt11InvoiceFeatures_clone(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR orig);
36962 * Creates a copy of the OfferFeatures
36964 struct LDKOfferFeatures OfferFeatures_clone(const struct LDKOfferFeatures *NONNULL_PTR orig);
36967 * Creates a copy of the InvoiceRequestFeatures
36969 struct LDKInvoiceRequestFeatures InvoiceRequestFeatures_clone(const struct LDKInvoiceRequestFeatures *NONNULL_PTR orig);
36972 * Creates a copy of the Bolt12InvoiceFeatures
36974 struct LDKBolt12InvoiceFeatures Bolt12InvoiceFeatures_clone(const struct LDKBolt12InvoiceFeatures *NONNULL_PTR orig);
36977 * Creates a copy of the BlindedHopFeatures
36979 struct LDKBlindedHopFeatures BlindedHopFeatures_clone(const struct LDKBlindedHopFeatures *NONNULL_PTR orig);
36982 * Creates a copy of the ChannelTypeFeatures
36984 struct LDKChannelTypeFeatures ChannelTypeFeatures_clone(const struct LDKChannelTypeFeatures *NONNULL_PTR orig);
36987 * Frees any resources used by the InitFeatures, if is_owned is set and inner is non-NULL.
36989 void InitFeatures_free(struct LDKInitFeatures this_obj);
36992 * Frees any resources used by the NodeFeatures, if is_owned is set and inner is non-NULL.
36994 void NodeFeatures_free(struct LDKNodeFeatures this_obj);
36997 * Frees any resources used by the ChannelFeatures, if is_owned is set and inner is non-NULL.
36999 void ChannelFeatures_free(struct LDKChannelFeatures this_obj);
37002 * Frees any resources used by the Bolt11InvoiceFeatures, if is_owned is set and inner is non-NULL.
37004 void Bolt11InvoiceFeatures_free(struct LDKBolt11InvoiceFeatures this_obj);
37007 * Frees any resources used by the OfferFeatures, if is_owned is set and inner is non-NULL.
37009 void OfferFeatures_free(struct LDKOfferFeatures this_obj);
37012 * Frees any resources used by the InvoiceRequestFeatures, if is_owned is set and inner is non-NULL.
37014 void InvoiceRequestFeatures_free(struct LDKInvoiceRequestFeatures this_obj);
37017 * Frees any resources used by the Bolt12InvoiceFeatures, if is_owned is set and inner is non-NULL.
37019 void Bolt12InvoiceFeatures_free(struct LDKBolt12InvoiceFeatures this_obj);
37022 * Frees any resources used by the BlindedHopFeatures, if is_owned is set and inner is non-NULL.
37024 void BlindedHopFeatures_free(struct LDKBlindedHopFeatures this_obj);
37027 * Frees any resources used by the ChannelTypeFeatures, if is_owned is set and inner is non-NULL.
37029 void ChannelTypeFeatures_free(struct LDKChannelTypeFeatures this_obj);
37032 * Create a blank Features with no features set
37034 MUST_USE_RES struct LDKInitFeatures InitFeatures_empty(void);
37037 * Returns true if this `Features` object contains required features unknown by `other`.
37039 MUST_USE_RES bool InitFeatures_requires_unknown_bits_from(const struct LDKInitFeatures *NONNULL_PTR this_arg, const struct LDKInitFeatures *NONNULL_PTR other);
37042 * Returns true if this `Features` object contains unknown feature flags which are set as
37045 MUST_USE_RES bool InitFeatures_requires_unknown_bits(const struct LDKInitFeatures *NONNULL_PTR this_arg);
37048 * Sets a required feature bit. Errors if `bit` is outside the feature range as defined
37051 * Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
37052 * be set instead (i.e., `bit - 1`).
37054 * [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
37056 MUST_USE_RES struct LDKCResult_NoneNoneZ InitFeatures_set_required_feature_bit(struct LDKInitFeatures *NONNULL_PTR this_arg, uintptr_t bit);
37059 * Sets an optional feature bit. Errors if `bit` is outside the feature range as defined
37062 * Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
37063 * set instead (i.e., `bit + 1`).
37065 * [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
37067 MUST_USE_RES struct LDKCResult_NoneNoneZ InitFeatures_set_optional_feature_bit(struct LDKInitFeatures *NONNULL_PTR this_arg, uintptr_t bit);
37070 * Sets a required custom feature bit. Errors if `bit` is outside the custom range as defined
37071 * by [bLIP 2] or if it is a known `T` feature.
37073 * Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
37074 * be set instead (i.e., `bit - 1`).
37076 * [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
37078 MUST_USE_RES struct LDKCResult_NoneNoneZ InitFeatures_set_required_custom_bit(struct LDKInitFeatures *NONNULL_PTR this_arg, uintptr_t bit);
37081 * Sets an optional custom feature bit. Errors if `bit` is outside the custom range as defined
37082 * by [bLIP 2] or if it is a known `T` feature.
37084 * Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
37085 * set instead (i.e., `bit + 1`).
37087 * [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
37089 MUST_USE_RES struct LDKCResult_NoneNoneZ InitFeatures_set_optional_custom_bit(struct LDKInitFeatures *NONNULL_PTR this_arg, uintptr_t bit);
37092 * Create a blank Features with no features set
37094 MUST_USE_RES struct LDKNodeFeatures NodeFeatures_empty(void);
37097 * Returns true if this `Features` object contains required features unknown by `other`.
37099 MUST_USE_RES bool NodeFeatures_requires_unknown_bits_from(const struct LDKNodeFeatures *NONNULL_PTR this_arg, const struct LDKNodeFeatures *NONNULL_PTR other);
37102 * Returns true if this `Features` object contains unknown feature flags which are set as
37105 MUST_USE_RES bool NodeFeatures_requires_unknown_bits(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
37108 * Sets a required feature bit. Errors if `bit` is outside the feature range as defined
37111 * Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
37112 * be set instead (i.e., `bit - 1`).
37114 * [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
37116 MUST_USE_RES struct LDKCResult_NoneNoneZ NodeFeatures_set_required_feature_bit(struct LDKNodeFeatures *NONNULL_PTR this_arg, uintptr_t bit);
37119 * Sets an optional feature bit. Errors if `bit` is outside the feature range as defined
37122 * Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
37123 * set instead (i.e., `bit + 1`).
37125 * [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
37127 MUST_USE_RES struct LDKCResult_NoneNoneZ NodeFeatures_set_optional_feature_bit(struct LDKNodeFeatures *NONNULL_PTR this_arg, uintptr_t bit);
37130 * Sets a required custom feature bit. Errors if `bit` is outside the custom range as defined
37131 * by [bLIP 2] or if it is a known `T` feature.
37133 * Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
37134 * be set instead (i.e., `bit - 1`).
37136 * [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
37138 MUST_USE_RES struct LDKCResult_NoneNoneZ NodeFeatures_set_required_custom_bit(struct LDKNodeFeatures *NONNULL_PTR this_arg, uintptr_t bit);
37141 * Sets an optional custom feature bit. Errors if `bit` is outside the custom range as defined
37142 * by [bLIP 2] or if it is a known `T` feature.
37144 * Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
37145 * set instead (i.e., `bit + 1`).
37147 * [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
37149 MUST_USE_RES struct LDKCResult_NoneNoneZ NodeFeatures_set_optional_custom_bit(struct LDKNodeFeatures *NONNULL_PTR this_arg, uintptr_t bit);
37152 * Create a blank Features with no features set
37154 MUST_USE_RES struct LDKChannelFeatures ChannelFeatures_empty(void);
37157 * Returns true if this `Features` object contains required features unknown by `other`.
37159 MUST_USE_RES bool ChannelFeatures_requires_unknown_bits_from(const struct LDKChannelFeatures *NONNULL_PTR this_arg, const struct LDKChannelFeatures *NONNULL_PTR other);
37162 * Returns true if this `Features` object contains unknown feature flags which are set as
37165 MUST_USE_RES bool ChannelFeatures_requires_unknown_bits(const struct LDKChannelFeatures *NONNULL_PTR this_arg);
37168 * Sets a required feature bit. Errors if `bit` is outside the feature range as defined
37171 * Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
37172 * be set instead (i.e., `bit - 1`).
37174 * [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
37176 MUST_USE_RES struct LDKCResult_NoneNoneZ ChannelFeatures_set_required_feature_bit(struct LDKChannelFeatures *NONNULL_PTR this_arg, uintptr_t bit);
37179 * Sets an optional feature bit. Errors if `bit` is outside the feature range as defined
37182 * Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
37183 * set instead (i.e., `bit + 1`).
37185 * [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
37187 MUST_USE_RES struct LDKCResult_NoneNoneZ ChannelFeatures_set_optional_feature_bit(struct LDKChannelFeatures *NONNULL_PTR this_arg, uintptr_t bit);
37190 * Sets a required custom feature bit. Errors if `bit` is outside the custom range as defined
37191 * by [bLIP 2] or if it is a known `T` feature.
37193 * Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
37194 * be set instead (i.e., `bit - 1`).
37196 * [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
37198 MUST_USE_RES struct LDKCResult_NoneNoneZ ChannelFeatures_set_required_custom_bit(struct LDKChannelFeatures *NONNULL_PTR this_arg, uintptr_t bit);
37201 * Sets an optional custom feature bit. Errors if `bit` is outside the custom range as defined
37202 * by [bLIP 2] or if it is a known `T` feature.
37204 * Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
37205 * set instead (i.e., `bit + 1`).
37207 * [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
37209 MUST_USE_RES struct LDKCResult_NoneNoneZ ChannelFeatures_set_optional_custom_bit(struct LDKChannelFeatures *NONNULL_PTR this_arg, uintptr_t bit);
37212 * Create a blank Features with no features set
37214 MUST_USE_RES struct LDKBolt11InvoiceFeatures Bolt11InvoiceFeatures_empty(void);
37217 * Returns true if this `Features` object contains required features unknown by `other`.
37219 MUST_USE_RES bool Bolt11InvoiceFeatures_requires_unknown_bits_from(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg, const struct LDKBolt11InvoiceFeatures *NONNULL_PTR other);
37222 * Returns true if this `Features` object contains unknown feature flags which are set as
37225 MUST_USE_RES bool Bolt11InvoiceFeatures_requires_unknown_bits(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg);
37228 * Sets a required feature bit. Errors if `bit` is outside the feature range as defined
37231 * Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
37232 * be set instead (i.e., `bit - 1`).
37234 * [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
37236 MUST_USE_RES struct LDKCResult_NoneNoneZ Bolt11InvoiceFeatures_set_required_feature_bit(struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg, uintptr_t bit);
37239 * Sets an optional feature bit. Errors if `bit` is outside the feature range as defined
37242 * Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
37243 * set instead (i.e., `bit + 1`).
37245 * [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
37247 MUST_USE_RES struct LDKCResult_NoneNoneZ Bolt11InvoiceFeatures_set_optional_feature_bit(struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg, uintptr_t bit);
37250 * Sets a required custom feature bit. Errors if `bit` is outside the custom range as defined
37251 * by [bLIP 2] or if it is a known `T` feature.
37253 * Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
37254 * be set instead (i.e., `bit - 1`).
37256 * [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
37258 MUST_USE_RES struct LDKCResult_NoneNoneZ Bolt11InvoiceFeatures_set_required_custom_bit(struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg, uintptr_t bit);
37261 * Sets an optional custom feature bit. Errors if `bit` is outside the custom range as defined
37262 * by [bLIP 2] or if it is a known `T` feature.
37264 * Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
37265 * set instead (i.e., `bit + 1`).
37267 * [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
37269 MUST_USE_RES struct LDKCResult_NoneNoneZ Bolt11InvoiceFeatures_set_optional_custom_bit(struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg, uintptr_t bit);
37272 * Create a blank Features with no features set
37274 MUST_USE_RES struct LDKOfferFeatures OfferFeatures_empty(void);
37277 * Returns true if this `Features` object contains required features unknown by `other`.
37279 MUST_USE_RES bool OfferFeatures_requires_unknown_bits_from(const struct LDKOfferFeatures *NONNULL_PTR this_arg, const struct LDKOfferFeatures *NONNULL_PTR other);
37282 * Returns true if this `Features` object contains unknown feature flags which are set as
37285 MUST_USE_RES bool OfferFeatures_requires_unknown_bits(const struct LDKOfferFeatures *NONNULL_PTR this_arg);
37288 * Sets a required feature bit. Errors if `bit` is outside the feature range as defined
37291 * Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
37292 * be set instead (i.e., `bit - 1`).
37294 * [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
37296 MUST_USE_RES struct LDKCResult_NoneNoneZ OfferFeatures_set_required_feature_bit(struct LDKOfferFeatures *NONNULL_PTR this_arg, uintptr_t bit);
37299 * Sets an optional feature bit. Errors if `bit` is outside the feature range as defined
37302 * Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
37303 * set instead (i.e., `bit + 1`).
37305 * [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
37307 MUST_USE_RES struct LDKCResult_NoneNoneZ OfferFeatures_set_optional_feature_bit(struct LDKOfferFeatures *NONNULL_PTR this_arg, uintptr_t bit);
37310 * Sets a required custom feature bit. Errors if `bit` is outside the custom range as defined
37311 * by [bLIP 2] or if it is a known `T` feature.
37313 * Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
37314 * be set instead (i.e., `bit - 1`).
37316 * [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
37318 MUST_USE_RES struct LDKCResult_NoneNoneZ OfferFeatures_set_required_custom_bit(struct LDKOfferFeatures *NONNULL_PTR this_arg, uintptr_t bit);
37321 * Sets an optional custom feature bit. Errors if `bit` is outside the custom range as defined
37322 * by [bLIP 2] or if it is a known `T` feature.
37324 * Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
37325 * set instead (i.e., `bit + 1`).
37327 * [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
37329 MUST_USE_RES struct LDKCResult_NoneNoneZ OfferFeatures_set_optional_custom_bit(struct LDKOfferFeatures *NONNULL_PTR this_arg, uintptr_t bit);
37332 * Create a blank Features with no features set
37334 MUST_USE_RES struct LDKInvoiceRequestFeatures InvoiceRequestFeatures_empty(void);
37337 * Returns true if this `Features` object contains required features unknown by `other`.
37339 MUST_USE_RES bool InvoiceRequestFeatures_requires_unknown_bits_from(const struct LDKInvoiceRequestFeatures *NONNULL_PTR this_arg, const struct LDKInvoiceRequestFeatures *NONNULL_PTR other);
37342 * Returns true if this `Features` object contains unknown feature flags which are set as
37345 MUST_USE_RES bool InvoiceRequestFeatures_requires_unknown_bits(const struct LDKInvoiceRequestFeatures *NONNULL_PTR this_arg);
37348 * Sets a required feature bit. Errors if `bit` is outside the feature range as defined
37351 * Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
37352 * be set instead (i.e., `bit - 1`).
37354 * [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
37356 MUST_USE_RES struct LDKCResult_NoneNoneZ InvoiceRequestFeatures_set_required_feature_bit(struct LDKInvoiceRequestFeatures *NONNULL_PTR this_arg, uintptr_t bit);
37359 * Sets an optional feature bit. Errors if `bit` is outside the feature range as defined
37362 * Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
37363 * set instead (i.e., `bit + 1`).
37365 * [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
37367 MUST_USE_RES struct LDKCResult_NoneNoneZ InvoiceRequestFeatures_set_optional_feature_bit(struct LDKInvoiceRequestFeatures *NONNULL_PTR this_arg, uintptr_t bit);
37370 * Sets a required custom feature bit. Errors if `bit` is outside the custom range as defined
37371 * by [bLIP 2] or if it is a known `T` feature.
37373 * Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
37374 * be set instead (i.e., `bit - 1`).
37376 * [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
37378 MUST_USE_RES struct LDKCResult_NoneNoneZ InvoiceRequestFeatures_set_required_custom_bit(struct LDKInvoiceRequestFeatures *NONNULL_PTR this_arg, uintptr_t bit);
37381 * Sets an optional custom feature bit. Errors if `bit` is outside the custom range as defined
37382 * by [bLIP 2] or if it is a known `T` feature.
37384 * Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
37385 * set instead (i.e., `bit + 1`).
37387 * [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
37389 MUST_USE_RES struct LDKCResult_NoneNoneZ InvoiceRequestFeatures_set_optional_custom_bit(struct LDKInvoiceRequestFeatures *NONNULL_PTR this_arg, uintptr_t bit);
37392 * Create a blank Features with no features set
37394 MUST_USE_RES struct LDKBolt12InvoiceFeatures Bolt12InvoiceFeatures_empty(void);
37397 * Returns true if this `Features` object contains required features unknown by `other`.
37399 MUST_USE_RES bool Bolt12InvoiceFeatures_requires_unknown_bits_from(const struct LDKBolt12InvoiceFeatures *NONNULL_PTR this_arg, const struct LDKBolt12InvoiceFeatures *NONNULL_PTR other);
37402 * Returns true if this `Features` object contains unknown feature flags which are set as
37405 MUST_USE_RES bool Bolt12InvoiceFeatures_requires_unknown_bits(const struct LDKBolt12InvoiceFeatures *NONNULL_PTR this_arg);
37408 * Sets a required feature bit. Errors if `bit` is outside the feature range as defined
37411 * Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
37412 * be set instead (i.e., `bit - 1`).
37414 * [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
37416 MUST_USE_RES struct LDKCResult_NoneNoneZ Bolt12InvoiceFeatures_set_required_feature_bit(struct LDKBolt12InvoiceFeatures *NONNULL_PTR this_arg, uintptr_t bit);
37419 * Sets an optional feature bit. Errors if `bit` is outside the feature range as defined
37422 * Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
37423 * set instead (i.e., `bit + 1`).
37425 * [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
37427 MUST_USE_RES struct LDKCResult_NoneNoneZ Bolt12InvoiceFeatures_set_optional_feature_bit(struct LDKBolt12InvoiceFeatures *NONNULL_PTR this_arg, uintptr_t bit);
37430 * Sets a required custom feature bit. Errors if `bit` is outside the custom range as defined
37431 * by [bLIP 2] or if it is a known `T` feature.
37433 * Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
37434 * be set instead (i.e., `bit - 1`).
37436 * [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
37438 MUST_USE_RES struct LDKCResult_NoneNoneZ Bolt12InvoiceFeatures_set_required_custom_bit(struct LDKBolt12InvoiceFeatures *NONNULL_PTR this_arg, uintptr_t bit);
37441 * Sets an optional custom feature bit. Errors if `bit` is outside the custom range as defined
37442 * by [bLIP 2] or if it is a known `T` feature.
37444 * Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
37445 * set instead (i.e., `bit + 1`).
37447 * [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
37449 MUST_USE_RES struct LDKCResult_NoneNoneZ Bolt12InvoiceFeatures_set_optional_custom_bit(struct LDKBolt12InvoiceFeatures *NONNULL_PTR this_arg, uintptr_t bit);
37452 * Create a blank Features with no features set
37454 MUST_USE_RES struct LDKBlindedHopFeatures BlindedHopFeatures_empty(void);
37457 * Returns true if this `Features` object contains required features unknown by `other`.
37459 MUST_USE_RES bool BlindedHopFeatures_requires_unknown_bits_from(const struct LDKBlindedHopFeatures *NONNULL_PTR this_arg, const struct LDKBlindedHopFeatures *NONNULL_PTR other);
37462 * Returns true if this `Features` object contains unknown feature flags which are set as
37465 MUST_USE_RES bool BlindedHopFeatures_requires_unknown_bits(const struct LDKBlindedHopFeatures *NONNULL_PTR this_arg);
37468 * Sets a required feature bit. Errors if `bit` is outside the feature range as defined
37471 * Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
37472 * be set instead (i.e., `bit - 1`).
37474 * [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
37476 MUST_USE_RES struct LDKCResult_NoneNoneZ BlindedHopFeatures_set_required_feature_bit(struct LDKBlindedHopFeatures *NONNULL_PTR this_arg, uintptr_t bit);
37479 * Sets an optional feature bit. Errors if `bit` is outside the feature range as defined
37482 * Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
37483 * set instead (i.e., `bit + 1`).
37485 * [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
37487 MUST_USE_RES struct LDKCResult_NoneNoneZ BlindedHopFeatures_set_optional_feature_bit(struct LDKBlindedHopFeatures *NONNULL_PTR this_arg, uintptr_t bit);
37490 * Sets a required custom feature bit. Errors if `bit` is outside the custom range as defined
37491 * by [bLIP 2] or if it is a known `T` feature.
37493 * Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
37494 * be set instead (i.e., `bit - 1`).
37496 * [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
37498 MUST_USE_RES struct LDKCResult_NoneNoneZ BlindedHopFeatures_set_required_custom_bit(struct LDKBlindedHopFeatures *NONNULL_PTR this_arg, uintptr_t bit);
37501 * Sets an optional custom feature bit. Errors if `bit` is outside the custom range as defined
37502 * by [bLIP 2] or if it is a known `T` feature.
37504 * Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
37505 * set instead (i.e., `bit + 1`).
37507 * [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
37509 MUST_USE_RES struct LDKCResult_NoneNoneZ BlindedHopFeatures_set_optional_custom_bit(struct LDKBlindedHopFeatures *NONNULL_PTR this_arg, uintptr_t bit);
37512 * Create a blank Features with no features set
37514 MUST_USE_RES struct LDKChannelTypeFeatures ChannelTypeFeatures_empty(void);
37517 * Returns true if this `Features` object contains required features unknown by `other`.
37519 MUST_USE_RES bool ChannelTypeFeatures_requires_unknown_bits_from(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg, const struct LDKChannelTypeFeatures *NONNULL_PTR other);
37522 * Returns true if this `Features` object contains unknown feature flags which are set as
37525 MUST_USE_RES bool ChannelTypeFeatures_requires_unknown_bits(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
37528 * Sets a required feature bit. Errors if `bit` is outside the feature range as defined
37531 * Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
37532 * be set instead (i.e., `bit - 1`).
37534 * [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
37536 MUST_USE_RES struct LDKCResult_NoneNoneZ ChannelTypeFeatures_set_required_feature_bit(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg, uintptr_t bit);
37539 * Sets an optional feature bit. Errors if `bit` is outside the feature range as defined
37542 * Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
37543 * set instead (i.e., `bit + 1`).
37545 * [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
37547 MUST_USE_RES struct LDKCResult_NoneNoneZ ChannelTypeFeatures_set_optional_feature_bit(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg, uintptr_t bit);
37550 * Sets a required custom feature bit. Errors if `bit` is outside the custom range as defined
37551 * by [bLIP 2] or if it is a known `T` feature.
37553 * Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
37554 * be set instead (i.e., `bit - 1`).
37556 * [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
37558 MUST_USE_RES struct LDKCResult_NoneNoneZ ChannelTypeFeatures_set_required_custom_bit(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg, uintptr_t bit);
37561 * Sets an optional custom feature bit. Errors if `bit` is outside the custom range as defined
37562 * by [bLIP 2] or if it is a known `T` feature.
37564 * Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
37565 * set instead (i.e., `bit + 1`).
37567 * [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
37569 MUST_USE_RES struct LDKCResult_NoneNoneZ ChannelTypeFeatures_set_optional_custom_bit(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg, uintptr_t bit);
37572 * Serialize the InitFeatures object into a byte array which can be read by InitFeatures_read
37574 struct LDKCVec_u8Z InitFeatures_write(const struct LDKInitFeatures *NONNULL_PTR obj);
37577 * Read a InitFeatures from a byte array, created by InitFeatures_write
37579 struct LDKCResult_InitFeaturesDecodeErrorZ InitFeatures_read(struct LDKu8slice ser);
37582 * Serialize the ChannelFeatures object into a byte array which can be read by ChannelFeatures_read
37584 struct LDKCVec_u8Z ChannelFeatures_write(const struct LDKChannelFeatures *NONNULL_PTR obj);
37587 * Read a ChannelFeatures from a byte array, created by ChannelFeatures_write
37589 struct LDKCResult_ChannelFeaturesDecodeErrorZ ChannelFeatures_read(struct LDKu8slice ser);
37592 * Serialize the NodeFeatures object into a byte array which can be read by NodeFeatures_read
37594 struct LDKCVec_u8Z NodeFeatures_write(const struct LDKNodeFeatures *NONNULL_PTR obj);
37597 * Read a NodeFeatures from a byte array, created by NodeFeatures_write
37599 struct LDKCResult_NodeFeaturesDecodeErrorZ NodeFeatures_read(struct LDKu8slice ser);
37602 * Serialize the Bolt11InvoiceFeatures object into a byte array which can be read by Bolt11InvoiceFeatures_read
37604 struct LDKCVec_u8Z Bolt11InvoiceFeatures_write(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR obj);
37607 * Read a Bolt11InvoiceFeatures from a byte array, created by Bolt11InvoiceFeatures_write
37609 struct LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZ Bolt11InvoiceFeatures_read(struct LDKu8slice ser);
37612 * Serialize the Bolt12InvoiceFeatures object into a byte array which can be read by Bolt12InvoiceFeatures_read
37614 struct LDKCVec_u8Z Bolt12InvoiceFeatures_write(const struct LDKBolt12InvoiceFeatures *NONNULL_PTR obj);
37617 * Read a Bolt12InvoiceFeatures from a byte array, created by Bolt12InvoiceFeatures_write
37619 struct LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZ Bolt12InvoiceFeatures_read(struct LDKu8slice ser);
37622 * Serialize the BlindedHopFeatures object into a byte array which can be read by BlindedHopFeatures_read
37624 struct LDKCVec_u8Z BlindedHopFeatures_write(const struct LDKBlindedHopFeatures *NONNULL_PTR obj);
37627 * Read a BlindedHopFeatures from a byte array, created by BlindedHopFeatures_write
37629 struct LDKCResult_BlindedHopFeaturesDecodeErrorZ BlindedHopFeatures_read(struct LDKu8slice ser);
37632 * Serialize the ChannelTypeFeatures object into a byte array which can be read by ChannelTypeFeatures_read
37634 struct LDKCVec_u8Z ChannelTypeFeatures_write(const struct LDKChannelTypeFeatures *NONNULL_PTR obj);
37637 * Read a ChannelTypeFeatures from a byte array, created by ChannelTypeFeatures_write
37639 struct LDKCResult_ChannelTypeFeaturesDecodeErrorZ ChannelTypeFeatures_read(struct LDKu8slice ser);
37642 * Set this feature as optional.
37644 void InitFeatures_set_data_loss_protect_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
37647 * Set this feature as required.
37649 void InitFeatures_set_data_loss_protect_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
37652 * Checks if this feature is supported.
37654 MUST_USE_RES bool InitFeatures_supports_data_loss_protect(const struct LDKInitFeatures *NONNULL_PTR this_arg);
37657 * Set this feature as optional.
37659 void NodeFeatures_set_data_loss_protect_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
37662 * Set this feature as required.
37664 void NodeFeatures_set_data_loss_protect_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
37667 * Checks if this feature is supported.
37669 MUST_USE_RES bool NodeFeatures_supports_data_loss_protect(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
37672 * Checks if this feature is required.
37674 MUST_USE_RES bool InitFeatures_requires_data_loss_protect(const struct LDKInitFeatures *NONNULL_PTR this_arg);
37677 * Checks if this feature is required.
37679 MUST_USE_RES bool NodeFeatures_requires_data_loss_protect(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
37682 * Set this feature as optional.
37684 void InitFeatures_set_initial_routing_sync_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
37687 * Set this feature as required.
37689 void InitFeatures_set_initial_routing_sync_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
37692 * Checks if this feature is supported.
37694 MUST_USE_RES bool InitFeatures_initial_routing_sync(const struct LDKInitFeatures *NONNULL_PTR this_arg);
37697 * Set this feature as optional.
37699 void InitFeatures_set_upfront_shutdown_script_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
37702 * Set this feature as required.
37704 void InitFeatures_set_upfront_shutdown_script_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
37707 * Checks if this feature is supported.
37709 MUST_USE_RES bool InitFeatures_supports_upfront_shutdown_script(const struct LDKInitFeatures *NONNULL_PTR this_arg);
37712 * Set this feature as optional.
37714 void NodeFeatures_set_upfront_shutdown_script_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
37717 * Set this feature as required.
37719 void NodeFeatures_set_upfront_shutdown_script_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
37722 * Checks if this feature is supported.
37724 MUST_USE_RES bool NodeFeatures_supports_upfront_shutdown_script(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
37727 * Checks if this feature is required.
37729 MUST_USE_RES bool InitFeatures_requires_upfront_shutdown_script(const struct LDKInitFeatures *NONNULL_PTR this_arg);
37732 * Checks if this feature is required.
37734 MUST_USE_RES bool NodeFeatures_requires_upfront_shutdown_script(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
37737 * Set this feature as optional.
37739 void InitFeatures_set_gossip_queries_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
37742 * Set this feature as required.
37744 void InitFeatures_set_gossip_queries_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
37747 * Checks if this feature is supported.
37749 MUST_USE_RES bool InitFeatures_supports_gossip_queries(const struct LDKInitFeatures *NONNULL_PTR this_arg);
37752 * Set this feature as optional.
37754 void NodeFeatures_set_gossip_queries_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
37757 * Set this feature as required.
37759 void NodeFeatures_set_gossip_queries_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
37762 * Checks if this feature is supported.
37764 MUST_USE_RES bool NodeFeatures_supports_gossip_queries(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
37767 * Checks if this feature is required.
37769 MUST_USE_RES bool InitFeatures_requires_gossip_queries(const struct LDKInitFeatures *NONNULL_PTR this_arg);
37772 * Checks if this feature is required.
37774 MUST_USE_RES bool NodeFeatures_requires_gossip_queries(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
37777 * Set this feature as optional.
37779 void InitFeatures_set_variable_length_onion_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
37782 * Set this feature as required.
37784 void InitFeatures_set_variable_length_onion_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
37787 * Checks if this feature is supported.
37789 MUST_USE_RES bool InitFeatures_supports_variable_length_onion(const struct LDKInitFeatures *NONNULL_PTR this_arg);
37792 * Set this feature as optional.
37794 void NodeFeatures_set_variable_length_onion_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
37797 * Set this feature as required.
37799 void NodeFeatures_set_variable_length_onion_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
37802 * Checks if this feature is supported.
37804 MUST_USE_RES bool NodeFeatures_supports_variable_length_onion(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
37807 * Set this feature as optional.
37809 void Bolt11InvoiceFeatures_set_variable_length_onion_optional(struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg);
37812 * Set this feature as required.
37814 void Bolt11InvoiceFeatures_set_variable_length_onion_required(struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg);
37817 * Checks if this feature is supported.
37819 MUST_USE_RES bool Bolt11InvoiceFeatures_supports_variable_length_onion(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg);
37822 * Checks if this feature is required.
37824 MUST_USE_RES bool InitFeatures_requires_variable_length_onion(const struct LDKInitFeatures *NONNULL_PTR this_arg);
37827 * Checks if this feature is required.
37829 MUST_USE_RES bool NodeFeatures_requires_variable_length_onion(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
37832 * Checks if this feature is required.
37834 MUST_USE_RES bool Bolt11InvoiceFeatures_requires_variable_length_onion(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg);
37837 * Set this feature as optional.
37839 void InitFeatures_set_static_remote_key_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
37842 * Set this feature as required.
37844 void InitFeatures_set_static_remote_key_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
37847 * Checks if this feature is supported.
37849 MUST_USE_RES bool InitFeatures_supports_static_remote_key(const struct LDKInitFeatures *NONNULL_PTR this_arg);
37852 * Set this feature as optional.
37854 void NodeFeatures_set_static_remote_key_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
37857 * Set this feature as required.
37859 void NodeFeatures_set_static_remote_key_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
37862 * Checks if this feature is supported.
37864 MUST_USE_RES bool NodeFeatures_supports_static_remote_key(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
37867 * Set this feature as optional.
37869 void ChannelTypeFeatures_set_static_remote_key_optional(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
37872 * Set this feature as required.
37874 void ChannelTypeFeatures_set_static_remote_key_required(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
37877 * Checks if this feature is supported.
37879 MUST_USE_RES bool ChannelTypeFeatures_supports_static_remote_key(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
37882 * Checks if this feature is required.
37884 MUST_USE_RES bool InitFeatures_requires_static_remote_key(const struct LDKInitFeatures *NONNULL_PTR this_arg);
37887 * Checks if this feature is required.
37889 MUST_USE_RES bool NodeFeatures_requires_static_remote_key(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
37892 * Checks if this feature is required.
37894 MUST_USE_RES bool ChannelTypeFeatures_requires_static_remote_key(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
37897 * Set this feature as optional.
37899 void InitFeatures_set_payment_secret_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
37902 * Set this feature as required.
37904 void InitFeatures_set_payment_secret_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
37907 * Checks if this feature is supported.
37909 MUST_USE_RES bool InitFeatures_supports_payment_secret(const struct LDKInitFeatures *NONNULL_PTR this_arg);
37912 * Set this feature as optional.
37914 void NodeFeatures_set_payment_secret_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
37917 * Set this feature as required.
37919 void NodeFeatures_set_payment_secret_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
37922 * Checks if this feature is supported.
37924 MUST_USE_RES bool NodeFeatures_supports_payment_secret(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
37927 * Set this feature as optional.
37929 void Bolt11InvoiceFeatures_set_payment_secret_optional(struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg);
37932 * Set this feature as required.
37934 void Bolt11InvoiceFeatures_set_payment_secret_required(struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg);
37937 * Checks if this feature is supported.
37939 MUST_USE_RES bool Bolt11InvoiceFeatures_supports_payment_secret(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg);
37942 * Checks if this feature is required.
37944 MUST_USE_RES bool InitFeatures_requires_payment_secret(const struct LDKInitFeatures *NONNULL_PTR this_arg);
37947 * Checks if this feature is required.
37949 MUST_USE_RES bool NodeFeatures_requires_payment_secret(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
37952 * Checks if this feature is required.
37954 MUST_USE_RES bool Bolt11InvoiceFeatures_requires_payment_secret(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg);
37957 * Set this feature as optional.
37959 void InitFeatures_set_basic_mpp_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
37962 * Set this feature as required.
37964 void InitFeatures_set_basic_mpp_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
37967 * Checks if this feature is supported.
37969 MUST_USE_RES bool InitFeatures_supports_basic_mpp(const struct LDKInitFeatures *NONNULL_PTR this_arg);
37972 * Set this feature as optional.
37974 void NodeFeatures_set_basic_mpp_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
37977 * Set this feature as required.
37979 void NodeFeatures_set_basic_mpp_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
37982 * Checks if this feature is supported.
37984 MUST_USE_RES bool NodeFeatures_supports_basic_mpp(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
37987 * Set this feature as optional.
37989 void Bolt11InvoiceFeatures_set_basic_mpp_optional(struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg);
37992 * Set this feature as required.
37994 void Bolt11InvoiceFeatures_set_basic_mpp_required(struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg);
37997 * Checks if this feature is supported.
37999 MUST_USE_RES bool Bolt11InvoiceFeatures_supports_basic_mpp(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg);
38002 * Set this feature as optional.
38004 void Bolt12InvoiceFeatures_set_basic_mpp_optional(struct LDKBolt12InvoiceFeatures *NONNULL_PTR this_arg);
38007 * Set this feature as required.
38009 void Bolt12InvoiceFeatures_set_basic_mpp_required(struct LDKBolt12InvoiceFeatures *NONNULL_PTR this_arg);
38012 * Checks if this feature is supported.
38014 MUST_USE_RES bool Bolt12InvoiceFeatures_supports_basic_mpp(const struct LDKBolt12InvoiceFeatures *NONNULL_PTR this_arg);
38017 * Checks if this feature is required.
38019 MUST_USE_RES bool InitFeatures_requires_basic_mpp(const struct LDKInitFeatures *NONNULL_PTR this_arg);
38022 * Checks if this feature is required.
38024 MUST_USE_RES bool NodeFeatures_requires_basic_mpp(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
38027 * Checks if this feature is required.
38029 MUST_USE_RES bool Bolt11InvoiceFeatures_requires_basic_mpp(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg);
38032 * Checks if this feature is required.
38034 MUST_USE_RES bool Bolt12InvoiceFeatures_requires_basic_mpp(const struct LDKBolt12InvoiceFeatures *NONNULL_PTR this_arg);
38037 * Set this feature as optional.
38039 void InitFeatures_set_wumbo_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
38042 * Set this feature as required.
38044 void InitFeatures_set_wumbo_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
38047 * Checks if this feature is supported.
38049 MUST_USE_RES bool InitFeatures_supports_wumbo(const struct LDKInitFeatures *NONNULL_PTR this_arg);
38052 * Set this feature as optional.
38054 void NodeFeatures_set_wumbo_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
38057 * Set this feature as required.
38059 void NodeFeatures_set_wumbo_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
38062 * Checks if this feature is supported.
38064 MUST_USE_RES bool NodeFeatures_supports_wumbo(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
38067 * Checks if this feature is required.
38069 MUST_USE_RES bool InitFeatures_requires_wumbo(const struct LDKInitFeatures *NONNULL_PTR this_arg);
38072 * Checks if this feature is required.
38074 MUST_USE_RES bool NodeFeatures_requires_wumbo(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
38077 * Set this feature as optional.
38079 void InitFeatures_set_anchors_nonzero_fee_htlc_tx_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
38082 * Set this feature as required.
38084 void InitFeatures_set_anchors_nonzero_fee_htlc_tx_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
38087 * Checks if this feature is supported.
38089 MUST_USE_RES bool InitFeatures_supports_anchors_nonzero_fee_htlc_tx(const struct LDKInitFeatures *NONNULL_PTR this_arg);
38092 * Set this feature as optional.
38094 void NodeFeatures_set_anchors_nonzero_fee_htlc_tx_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
38097 * Set this feature as required.
38099 void NodeFeatures_set_anchors_nonzero_fee_htlc_tx_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
38102 * Checks if this feature is supported.
38104 MUST_USE_RES bool NodeFeatures_supports_anchors_nonzero_fee_htlc_tx(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
38107 * Set this feature as optional.
38109 void ChannelTypeFeatures_set_anchors_nonzero_fee_htlc_tx_optional(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
38112 * Set this feature as required.
38114 void ChannelTypeFeatures_set_anchors_nonzero_fee_htlc_tx_required(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
38117 * Checks if this feature is supported.
38119 MUST_USE_RES bool ChannelTypeFeatures_supports_anchors_nonzero_fee_htlc_tx(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
38122 * Checks if this feature is required.
38124 MUST_USE_RES bool InitFeatures_requires_anchors_nonzero_fee_htlc_tx(const struct LDKInitFeatures *NONNULL_PTR this_arg);
38127 * Checks if this feature is required.
38129 MUST_USE_RES bool NodeFeatures_requires_anchors_nonzero_fee_htlc_tx(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
38132 * Checks if this feature is required.
38134 MUST_USE_RES bool ChannelTypeFeatures_requires_anchors_nonzero_fee_htlc_tx(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
38137 * Set this feature as optional.
38139 void InitFeatures_set_anchors_zero_fee_htlc_tx_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
38142 * Set this feature as required.
38144 void InitFeatures_set_anchors_zero_fee_htlc_tx_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
38147 * Checks if this feature is supported.
38149 MUST_USE_RES bool InitFeatures_supports_anchors_zero_fee_htlc_tx(const struct LDKInitFeatures *NONNULL_PTR this_arg);
38152 * Set this feature as optional.
38154 void NodeFeatures_set_anchors_zero_fee_htlc_tx_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
38157 * Set this feature as required.
38159 void NodeFeatures_set_anchors_zero_fee_htlc_tx_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
38162 * Checks if this feature is supported.
38164 MUST_USE_RES bool NodeFeatures_supports_anchors_zero_fee_htlc_tx(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
38167 * Set this feature as optional.
38169 void ChannelTypeFeatures_set_anchors_zero_fee_htlc_tx_optional(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
38172 * Set this feature as required.
38174 void ChannelTypeFeatures_set_anchors_zero_fee_htlc_tx_required(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
38177 * Checks if this feature is supported.
38179 MUST_USE_RES bool ChannelTypeFeatures_supports_anchors_zero_fee_htlc_tx(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
38182 * Checks if this feature is required.
38184 MUST_USE_RES bool InitFeatures_requires_anchors_zero_fee_htlc_tx(const struct LDKInitFeatures *NONNULL_PTR this_arg);
38187 * Checks if this feature is required.
38189 MUST_USE_RES bool NodeFeatures_requires_anchors_zero_fee_htlc_tx(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
38192 * Checks if this feature is required.
38194 MUST_USE_RES bool ChannelTypeFeatures_requires_anchors_zero_fee_htlc_tx(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
38197 * Set this feature as optional.
38199 void InitFeatures_set_shutdown_any_segwit_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
38202 * Set this feature as required.
38204 void InitFeatures_set_shutdown_any_segwit_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
38207 * Checks if this feature is supported.
38209 MUST_USE_RES bool InitFeatures_supports_shutdown_anysegwit(const struct LDKInitFeatures *NONNULL_PTR this_arg);
38212 * Set this feature as optional.
38214 void NodeFeatures_set_shutdown_any_segwit_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
38217 * Set this feature as required.
38219 void NodeFeatures_set_shutdown_any_segwit_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
38222 * Checks if this feature is supported.
38224 MUST_USE_RES bool NodeFeatures_supports_shutdown_anysegwit(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
38227 * Checks if this feature is required.
38229 MUST_USE_RES bool InitFeatures_requires_shutdown_anysegwit(const struct LDKInitFeatures *NONNULL_PTR this_arg);
38232 * Checks if this feature is required.
38234 MUST_USE_RES bool NodeFeatures_requires_shutdown_anysegwit(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
38237 * Set this feature as optional.
38239 void InitFeatures_set_taproot_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
38242 * Set this feature as required.
38244 void InitFeatures_set_taproot_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
38247 * Checks if this feature is supported.
38249 MUST_USE_RES bool InitFeatures_supports_taproot(const struct LDKInitFeatures *NONNULL_PTR this_arg);
38252 * Set this feature as optional.
38254 void NodeFeatures_set_taproot_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
38257 * Set this feature as required.
38259 void NodeFeatures_set_taproot_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
38262 * Checks if this feature is supported.
38264 MUST_USE_RES bool NodeFeatures_supports_taproot(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
38267 * Set this feature as optional.
38269 void ChannelTypeFeatures_set_taproot_optional(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
38272 * Set this feature as required.
38274 void ChannelTypeFeatures_set_taproot_required(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
38277 * Checks if this feature is supported.
38279 MUST_USE_RES bool ChannelTypeFeatures_supports_taproot(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
38282 * Checks if this feature is required.
38284 MUST_USE_RES bool InitFeatures_requires_taproot(const struct LDKInitFeatures *NONNULL_PTR this_arg);
38287 * Checks if this feature is required.
38289 MUST_USE_RES bool NodeFeatures_requires_taproot(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
38292 * Checks if this feature is required.
38294 MUST_USE_RES bool ChannelTypeFeatures_requires_taproot(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
38297 * Set this feature as optional.
38299 void InitFeatures_set_onion_messages_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
38302 * Set this feature as required.
38304 void InitFeatures_set_onion_messages_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
38307 * Checks if this feature is supported.
38309 MUST_USE_RES bool InitFeatures_supports_onion_messages(const struct LDKInitFeatures *NONNULL_PTR this_arg);
38312 * Set this feature as optional.
38314 void NodeFeatures_set_onion_messages_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
38317 * Set this feature as required.
38319 void NodeFeatures_set_onion_messages_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
38322 * Checks if this feature is supported.
38324 MUST_USE_RES bool NodeFeatures_supports_onion_messages(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
38327 * Checks if this feature is required.
38329 MUST_USE_RES bool InitFeatures_requires_onion_messages(const struct LDKInitFeatures *NONNULL_PTR this_arg);
38332 * Checks if this feature is required.
38334 MUST_USE_RES bool NodeFeatures_requires_onion_messages(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
38337 * Set this feature as optional.
38339 void InitFeatures_set_channel_type_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
38342 * Set this feature as required.
38344 void InitFeatures_set_channel_type_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
38347 * Checks if this feature is supported.
38349 MUST_USE_RES bool InitFeatures_supports_channel_type(const struct LDKInitFeatures *NONNULL_PTR this_arg);
38352 * Set this feature as optional.
38354 void NodeFeatures_set_channel_type_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
38357 * Set this feature as required.
38359 void NodeFeatures_set_channel_type_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
38362 * Checks if this feature is supported.
38364 MUST_USE_RES bool NodeFeatures_supports_channel_type(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
38367 * Checks if this feature is required.
38369 MUST_USE_RES bool InitFeatures_requires_channel_type(const struct LDKInitFeatures *NONNULL_PTR this_arg);
38372 * Checks if this feature is required.
38374 MUST_USE_RES bool NodeFeatures_requires_channel_type(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
38377 * Set this feature as optional.
38379 void InitFeatures_set_scid_privacy_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
38382 * Set this feature as required.
38384 void InitFeatures_set_scid_privacy_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
38387 * Checks if this feature is supported.
38389 MUST_USE_RES bool InitFeatures_supports_scid_privacy(const struct LDKInitFeatures *NONNULL_PTR this_arg);
38392 * Set this feature as optional.
38394 void NodeFeatures_set_scid_privacy_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
38397 * Set this feature as required.
38399 void NodeFeatures_set_scid_privacy_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
38402 * Checks if this feature is supported.
38404 MUST_USE_RES bool NodeFeatures_supports_scid_privacy(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
38407 * Set this feature as optional.
38409 void ChannelTypeFeatures_set_scid_privacy_optional(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
38412 * Set this feature as required.
38414 void ChannelTypeFeatures_set_scid_privacy_required(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
38417 * Checks if this feature is supported.
38419 MUST_USE_RES bool ChannelTypeFeatures_supports_scid_privacy(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
38422 * Checks if this feature is required.
38424 MUST_USE_RES bool InitFeatures_requires_scid_privacy(const struct LDKInitFeatures *NONNULL_PTR this_arg);
38427 * Checks if this feature is required.
38429 MUST_USE_RES bool NodeFeatures_requires_scid_privacy(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
38432 * Checks if this feature is required.
38434 MUST_USE_RES bool ChannelTypeFeatures_requires_scid_privacy(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
38437 * Set this feature as optional.
38439 void Bolt11InvoiceFeatures_set_payment_metadata_optional(struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg);
38442 * Set this feature as required.
38444 void Bolt11InvoiceFeatures_set_payment_metadata_required(struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg);
38447 * Checks if this feature is supported.
38449 MUST_USE_RES bool Bolt11InvoiceFeatures_supports_payment_metadata(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg);
38452 * Checks if this feature is required.
38454 MUST_USE_RES bool Bolt11InvoiceFeatures_requires_payment_metadata(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg);
38457 * Set this feature as optional.
38459 void InitFeatures_set_zero_conf_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
38462 * Set this feature as required.
38464 void InitFeatures_set_zero_conf_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
38467 * Checks if this feature is supported.
38469 MUST_USE_RES bool InitFeatures_supports_zero_conf(const struct LDKInitFeatures *NONNULL_PTR this_arg);
38472 * Set this feature as optional.
38474 void NodeFeatures_set_zero_conf_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
38477 * Set this feature as required.
38479 void NodeFeatures_set_zero_conf_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
38482 * Checks if this feature is supported.
38484 MUST_USE_RES bool NodeFeatures_supports_zero_conf(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
38487 * Set this feature as optional.
38489 void ChannelTypeFeatures_set_zero_conf_optional(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
38492 * Set this feature as required.
38494 void ChannelTypeFeatures_set_zero_conf_required(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
38497 * Checks if this feature is supported.
38499 MUST_USE_RES bool ChannelTypeFeatures_supports_zero_conf(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
38502 * Checks if this feature is required.
38504 MUST_USE_RES bool InitFeatures_requires_zero_conf(const struct LDKInitFeatures *NONNULL_PTR this_arg);
38507 * Checks if this feature is required.
38509 MUST_USE_RES bool NodeFeatures_requires_zero_conf(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
38512 * Checks if this feature is required.
38514 MUST_USE_RES bool ChannelTypeFeatures_requires_zero_conf(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
38517 * Set this feature as optional.
38519 void NodeFeatures_set_keysend_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
38522 * Set this feature as required.
38524 void NodeFeatures_set_keysend_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
38527 * Checks if this feature is supported.
38529 MUST_USE_RES bool NodeFeatures_supports_keysend(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
38532 * Checks if this feature is required.
38534 MUST_USE_RES bool NodeFeatures_requires_keysend(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
38537 * Frees any resources used by the ShutdownScript, if is_owned is set and inner is non-NULL.
38539 void ShutdownScript_free(struct LDKShutdownScript this_obj);
38542 * Creates a copy of the ShutdownScript
38544 struct LDKShutdownScript ShutdownScript_clone(const struct LDKShutdownScript *NONNULL_PTR orig);
38547 * Checks if two ShutdownScripts contain equal inner contents.
38548 * This ignores pointers and is_owned flags and looks at the values in fields.
38549 * Two objects with NULL inner values will be considered "equal" here.
38551 bool ShutdownScript_eq(const struct LDKShutdownScript *NONNULL_PTR a, const struct LDKShutdownScript *NONNULL_PTR b);
38554 * Frees any resources used by the InvalidShutdownScript, if is_owned is set and inner is non-NULL.
38556 void InvalidShutdownScript_free(struct LDKInvalidShutdownScript this_obj);
38559 * The script that did not meet the requirements from [BOLT #2].
38561 * [BOLT #2]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md
38563 struct LDKu8slice InvalidShutdownScript_get_script(const struct LDKInvalidShutdownScript *NONNULL_PTR this_ptr);
38566 * The script that did not meet the requirements from [BOLT #2].
38568 * [BOLT #2]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md
38570 void InvalidShutdownScript_set_script(struct LDKInvalidShutdownScript *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val);
38573 * Constructs a new InvalidShutdownScript given each field
38575 MUST_USE_RES struct LDKInvalidShutdownScript InvalidShutdownScript_new(struct LDKCVec_u8Z script_arg);
38578 * Creates a copy of the InvalidShutdownScript
38580 struct LDKInvalidShutdownScript InvalidShutdownScript_clone(const struct LDKInvalidShutdownScript *NONNULL_PTR orig);
38583 * Serialize the ShutdownScript object into a byte array which can be read by ShutdownScript_read
38585 struct LDKCVec_u8Z ShutdownScript_write(const struct LDKShutdownScript *NONNULL_PTR obj);
38588 * Read a ShutdownScript from a byte array, created by ShutdownScript_write
38590 struct LDKCResult_ShutdownScriptDecodeErrorZ ShutdownScript_read(struct LDKu8slice ser);
38593 * Generates a P2WPKH script pubkey from the given [`WPubkeyHash`].
38595 MUST_USE_RES struct LDKShutdownScript ShutdownScript_new_p2wpkh(const uint8_t (*pubkey_hash)[20]);
38598 * Generates a P2WSH script pubkey from the given [`WScriptHash`].
38600 MUST_USE_RES struct LDKShutdownScript ShutdownScript_new_p2wsh(const uint8_t (*script_hash)[32]);
38603 * Generates a witness script pubkey from the given segwit version and program.
38605 * Note for version-zero witness scripts you must use [`ShutdownScript::new_p2wpkh`] or
38606 * [`ShutdownScript::new_p2wsh`] instead.
38610 * This function may return an error if `program` is invalid for the segwit `version`.
38612 MUST_USE_RES struct LDKCResult_ShutdownScriptInvalidShutdownScriptZ ShutdownScript_new_witness_program(struct LDKWitnessVersion version, struct LDKu8slice program);
38615 * Converts the shutdown script into the underlying [`Script`].
38617 MUST_USE_RES struct LDKCVec_u8Z ShutdownScript_into_inner(struct LDKShutdownScript this_arg);
38620 * Returns the [`PublicKey`] used for a P2WPKH shutdown script if constructed directly from it.
38622 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
38624 MUST_USE_RES struct LDKPublicKey ShutdownScript_as_legacy_pubkey(const struct LDKShutdownScript *NONNULL_PTR this_arg);
38627 * Returns whether the shutdown script is compatible with the features as defined by BOLT #2.
38629 * Specifically, checks for compliance with feature `option_shutdown_anysegwit`.
38631 MUST_USE_RES bool ShutdownScript_is_compatible(const struct LDKShutdownScript *NONNULL_PTR this_arg, const struct LDKInitFeatures *NONNULL_PTR features);
38634 * Frees any resources used by the Retry
38636 void Retry_free(struct LDKRetry this_ptr);
38639 * Creates a copy of the Retry
38641 struct LDKRetry Retry_clone(const struct LDKRetry *NONNULL_PTR orig);
38644 * Utility method to constructs a new Attempts-variant Retry
38646 struct LDKRetry Retry_attempts(uint32_t a);
38649 * Utility method to constructs a new Timeout-variant Retry
38651 struct LDKRetry Retry_timeout(uint64_t a);
38654 * Checks if two Retrys contain equal inner contents.
38655 * This ignores pointers and is_owned flags and looks at the values in fields.
38657 bool Retry_eq(const struct LDKRetry *NONNULL_PTR a, const struct LDKRetry *NONNULL_PTR b);
38660 * Generates a non-cryptographic 64-bit hash of the Retry.
38662 uint64_t Retry_hash(const struct LDKRetry *NONNULL_PTR o);
38665 * Serialize the Retry object into a byte array which can be read by Retry_read
38667 struct LDKCVec_u8Z Retry_write(const struct LDKRetry *NONNULL_PTR obj);
38670 * Read a Retry from a byte array, created by Retry_write
38672 struct LDKCResult_RetryDecodeErrorZ Retry_read(struct LDKu8slice ser);
38675 * Creates a copy of the RetryableSendFailure
38677 enum LDKRetryableSendFailure RetryableSendFailure_clone(const enum LDKRetryableSendFailure *NONNULL_PTR orig);
38680 * Utility method to constructs a new PaymentExpired-variant RetryableSendFailure
38682 enum LDKRetryableSendFailure RetryableSendFailure_payment_expired(void);
38685 * Utility method to constructs a new RouteNotFound-variant RetryableSendFailure
38687 enum LDKRetryableSendFailure RetryableSendFailure_route_not_found(void);
38690 * Utility method to constructs a new DuplicatePayment-variant RetryableSendFailure
38692 enum LDKRetryableSendFailure RetryableSendFailure_duplicate_payment(void);
38695 * Checks if two RetryableSendFailures contain equal inner contents.
38696 * This ignores pointers and is_owned flags and looks at the values in fields.
38698 bool RetryableSendFailure_eq(const enum LDKRetryableSendFailure *NONNULL_PTR a, const enum LDKRetryableSendFailure *NONNULL_PTR b);
38701 * Frees any resources used by the PaymentSendFailure
38703 void PaymentSendFailure_free(struct LDKPaymentSendFailure this_ptr);
38706 * Creates a copy of the PaymentSendFailure
38708 struct LDKPaymentSendFailure PaymentSendFailure_clone(const struct LDKPaymentSendFailure *NONNULL_PTR orig);
38711 * Utility method to constructs a new ParameterError-variant PaymentSendFailure
38713 struct LDKPaymentSendFailure PaymentSendFailure_parameter_error(struct LDKAPIError a);
38716 * Utility method to constructs a new PathParameterError-variant PaymentSendFailure
38718 struct LDKPaymentSendFailure PaymentSendFailure_path_parameter_error(struct LDKCVec_CResult_NoneAPIErrorZZ a);
38721 * Utility method to constructs a new AllFailedResendSafe-variant PaymentSendFailure
38723 struct LDKPaymentSendFailure PaymentSendFailure_all_failed_resend_safe(struct LDKCVec_APIErrorZ a);
38726 * Utility method to constructs a new DuplicatePayment-variant PaymentSendFailure
38728 struct LDKPaymentSendFailure PaymentSendFailure_duplicate_payment(void);
38731 * Utility method to constructs a new PartialFailure-variant PaymentSendFailure
38733 struct LDKPaymentSendFailure PaymentSendFailure_partial_failure(struct LDKCVec_CResult_NoneAPIErrorZZ results, struct LDKRouteParameters failed_paths_retry, struct LDKThirtyTwoBytes payment_id);
38736 * Checks if two PaymentSendFailures contain equal inner contents.
38737 * This ignores pointers and is_owned flags and looks at the values in fields.
38739 bool PaymentSendFailure_eq(const struct LDKPaymentSendFailure *NONNULL_PTR a, const struct LDKPaymentSendFailure *NONNULL_PTR b);
38742 * Frees any resources used by the ProbeSendFailure
38744 void ProbeSendFailure_free(struct LDKProbeSendFailure this_ptr);
38747 * Creates a copy of the ProbeSendFailure
38749 struct LDKProbeSendFailure ProbeSendFailure_clone(const struct LDKProbeSendFailure *NONNULL_PTR orig);
38752 * Utility method to constructs a new RouteNotFound-variant ProbeSendFailure
38754 struct LDKProbeSendFailure ProbeSendFailure_route_not_found(void);
38757 * Utility method to constructs a new SendingFailed-variant ProbeSendFailure
38759 struct LDKProbeSendFailure ProbeSendFailure_sending_failed(struct LDKPaymentSendFailure a);
38762 * Checks if two ProbeSendFailures contain equal inner contents.
38763 * This ignores pointers and is_owned flags and looks at the values in fields.
38765 bool ProbeSendFailure_eq(const struct LDKProbeSendFailure *NONNULL_PTR a, const struct LDKProbeSendFailure *NONNULL_PTR b);
38768 * Frees any resources used by the RecipientOnionFields, if is_owned is set and inner is non-NULL.
38770 void RecipientOnionFields_free(struct LDKRecipientOnionFields this_obj);
38773 * The [`PaymentSecret`] is an arbitrary 32 bytes provided by the recipient for us to repeat
38774 * in the onion. It is unrelated to `payment_hash` (or [`PaymentPreimage`]) and exists to
38775 * authenticate the sender to the recipient and prevent payment-probing (deanonymization)
38778 * If you do not have one, the [`Route`] you pay over must not contain multiple paths as
38779 * multi-path payments require a recipient-provided secret.
38781 * Some implementations may reject spontaneous payments with payment secrets, so you may only
38782 * want to provide a secret for a spontaneous payment if MPP is needed and you know your
38783 * recipient will not reject it.
38785 struct LDKCOption_ThirtyTwoBytesZ RecipientOnionFields_get_payment_secret(const struct LDKRecipientOnionFields *NONNULL_PTR this_ptr);
38788 * The [`PaymentSecret`] is an arbitrary 32 bytes provided by the recipient for us to repeat
38789 * in the onion. It is unrelated to `payment_hash` (or [`PaymentPreimage`]) and exists to
38790 * authenticate the sender to the recipient and prevent payment-probing (deanonymization)
38793 * If you do not have one, the [`Route`] you pay over must not contain multiple paths as
38794 * multi-path payments require a recipient-provided secret.
38796 * Some implementations may reject spontaneous payments with payment secrets, so you may only
38797 * want to provide a secret for a spontaneous payment if MPP is needed and you know your
38798 * recipient will not reject it.
38800 void RecipientOnionFields_set_payment_secret(struct LDKRecipientOnionFields *NONNULL_PTR this_ptr, struct LDKCOption_ThirtyTwoBytesZ val);
38803 * The payment metadata serves a similar purpose as [`Self::payment_secret`] but is of
38804 * arbitrary length. This gives recipients substantially more flexibility to receive
38807 * In LDK, while the [`Self::payment_secret`] is fixed based on an internal authentication
38808 * scheme to authenticate received payments against expected payments and invoices, this field
38809 * is not used in LDK for received payments, and can be used to store arbitrary data in
38810 * invoices which will be received with the payment.
38812 * Note that this field was added to the lightning specification more recently than
38813 * [`Self::payment_secret`] and while nearly all lightning senders support secrets, metadata
38814 * may not be supported as universally.
38816 * Returns a copy of the field.
38818 struct LDKCOption_CVec_u8ZZ RecipientOnionFields_get_payment_metadata(const struct LDKRecipientOnionFields *NONNULL_PTR this_ptr);
38821 * The payment metadata serves a similar purpose as [`Self::payment_secret`] but is of
38822 * arbitrary length. This gives recipients substantially more flexibility to receive
38825 * In LDK, while the [`Self::payment_secret`] is fixed based on an internal authentication
38826 * scheme to authenticate received payments against expected payments and invoices, this field
38827 * is not used in LDK for received payments, and can be used to store arbitrary data in
38828 * invoices which will be received with the payment.
38830 * Note that this field was added to the lightning specification more recently than
38831 * [`Self::payment_secret`] and while nearly all lightning senders support secrets, metadata
38832 * may not be supported as universally.
38834 void RecipientOnionFields_set_payment_metadata(struct LDKRecipientOnionFields *NONNULL_PTR this_ptr, struct LDKCOption_CVec_u8ZZ val);
38837 * Creates a copy of the RecipientOnionFields
38839 struct LDKRecipientOnionFields RecipientOnionFields_clone(const struct LDKRecipientOnionFields *NONNULL_PTR orig);
38842 * Checks if two RecipientOnionFieldss contain equal inner contents.
38843 * This ignores pointers and is_owned flags and looks at the values in fields.
38844 * Two objects with NULL inner values will be considered "equal" here.
38846 bool RecipientOnionFields_eq(const struct LDKRecipientOnionFields *NONNULL_PTR a, const struct LDKRecipientOnionFields *NONNULL_PTR b);
38849 * Serialize the RecipientOnionFields object into a byte array which can be read by RecipientOnionFields_read
38851 struct LDKCVec_u8Z RecipientOnionFields_write(const struct LDKRecipientOnionFields *NONNULL_PTR obj);
38854 * Read a RecipientOnionFields from a byte array, created by RecipientOnionFields_write
38856 struct LDKCResult_RecipientOnionFieldsDecodeErrorZ RecipientOnionFields_read(struct LDKu8slice ser);
38859 * Creates a [`RecipientOnionFields`] from only a [`PaymentSecret`]. This is the most common
38860 * set of onion fields for today's BOLT11 invoices - most nodes require a [`PaymentSecret`]
38861 * but do not require or provide any further data.
38863 MUST_USE_RES struct LDKRecipientOnionFields RecipientOnionFields_secret_only(struct LDKThirtyTwoBytes payment_secret);
38866 * Creates a new [`RecipientOnionFields`] with no fields. This generally does not create
38867 * payable HTLCs except for single-path spontaneous payments, i.e. this should generally
38868 * only be used for calls to [`ChannelManager::send_spontaneous_payment`]. If you are sending
38869 * a spontaneous MPP this will not work as all MPP require payment secrets; you may
38870 * instead want to use [`RecipientOnionFields::secret_only`].
38872 * [`ChannelManager::send_spontaneous_payment`]: super::channelmanager::ChannelManager::send_spontaneous_payment
38873 * [`RecipientOnionFields::secret_only`]: RecipientOnionFields::secret_only
38875 MUST_USE_RES struct LDKRecipientOnionFields RecipientOnionFields_spontaneous_empty(void);
38878 * Creates a new [`RecipientOnionFields`] from an existing one, adding custom TLVs. Each
38879 * TLV is provided as a `(u64, Vec<u8>)` for the type number and serialized value
38880 * respectively. TLV type numbers must be unique and within the range
38881 * reserved for custom types, i.e. >= 2^16, otherwise this method will return `Err(())`.
38883 * This method will also error for types in the experimental range which have been
38884 * standardized within the protocol, which only includes 5482373484 (keysend) for now.
38886 * See [`Self::custom_tlvs`] for more info.
38888 MUST_USE_RES struct LDKCResult_RecipientOnionFieldsNoneZ RecipientOnionFields_with_custom_tlvs(struct LDKRecipientOnionFields this_arg, struct LDKCVec_C2Tuple_u64CVec_u8ZZZ custom_tlvs);
38891 * Gets the custom TLVs that will be sent or have been received.
38893 * Custom TLVs allow sending extra application-specific data with a payment. They provide
38894 * additional flexibility on top of payment metadata, as while other implementations may
38895 * require `payment_metadata` to reflect metadata provided in an invoice, custom TLVs
38896 * do not have this restriction.
38898 * Note that if this field is non-empty, it will contain strictly increasing TLVs, each
38899 * represented by a `(u64, Vec<u8>)` for its type number and serialized value respectively.
38900 * This is validated when setting this field using [`Self::with_custom_tlvs`].
38902 MUST_USE_RES struct LDKCVec_C2Tuple_u64CVec_u8ZZZ RecipientOnionFields_custom_tlvs(const struct LDKRecipientOnionFields *NONNULL_PTR this_arg);
38905 * Calls the free function if one is set
38907 void CustomMessageReader_free(struct LDKCustomMessageReader this_ptr);
38910 * Creates a copy of a Type
38912 struct LDKType Type_clone(const struct LDKType *NONNULL_PTR orig);
38915 * Calls the free function if one is set
38917 void Type_free(struct LDKType this_ptr);
38920 * Frees any resources used by the Offer, if is_owned is set and inner is non-NULL.
38922 void Offer_free(struct LDKOffer this_obj);
38925 * Creates a copy of the Offer
38927 struct LDKOffer Offer_clone(const struct LDKOffer *NONNULL_PTR orig);
38930 * The chains that may be used when paying a requested invoice (e.g., bitcoin mainnet).
38931 * Payments must be denominated in units of the minimal lightning-payable unit (e.g., msats)
38932 * for the selected chain.
38934 MUST_USE_RES struct LDKCVec_ThirtyTwoBytesZ Offer_chains(const struct LDKOffer *NONNULL_PTR this_arg);
38937 * Opaque bytes set by the originator. Useful for authentication and validating fields since it
38938 * is reflected in `invoice_request` messages along with all the other fields from the `offer`.
38940 MUST_USE_RES struct LDKCOption_CVec_u8ZZ Offer_metadata(const struct LDKOffer *NONNULL_PTR this_arg);
38943 * The minimum amount required for a successful payment of a single item.
38945 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
38947 MUST_USE_RES struct LDKAmount Offer_amount(const struct LDKOffer *NONNULL_PTR this_arg);
38950 * A complete description of the purpose of the payment. Intended to be displayed to the user
38951 * but with the caveat that it has not been verified in any way.
38953 MUST_USE_RES struct LDKPrintableString Offer_description(const struct LDKOffer *NONNULL_PTR this_arg);
38956 * Features pertaining to the offer.
38958 MUST_USE_RES struct LDKOfferFeatures Offer_offer_features(const struct LDKOffer *NONNULL_PTR this_arg);
38961 * Duration since the Unix epoch when an invoice should no longer be requested.
38963 * If `None`, the offer does not expire.
38965 MUST_USE_RES struct LDKCOption_u64Z Offer_absolute_expiry(const struct LDKOffer *NONNULL_PTR this_arg);
38968 * The issuer of the offer, possibly beginning with `user@domain` or `domain`. Intended to be
38969 * displayed to the user but with the caveat that it has not been verified in any way.
38971 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
38973 MUST_USE_RES struct LDKPrintableString Offer_issuer(const struct LDKOffer *NONNULL_PTR this_arg);
38976 * Paths to the recipient originating from publicly reachable nodes. Blinded paths provide
38977 * recipient privacy by obfuscating its node id.
38979 MUST_USE_RES struct LDKCVec_BlindedPathZ Offer_paths(const struct LDKOffer *NONNULL_PTR this_arg);
38982 * The quantity of items supported.
38984 MUST_USE_RES struct LDKQuantity Offer_supported_quantity(const struct LDKOffer *NONNULL_PTR this_arg);
38987 * The public key used by the recipient to sign invoices.
38989 MUST_USE_RES struct LDKPublicKey Offer_signing_pubkey(const struct LDKOffer *NONNULL_PTR this_arg);
38992 * Returns whether the given chain is supported by the offer.
38994 MUST_USE_RES bool Offer_supports_chain(const struct LDKOffer *NONNULL_PTR this_arg, struct LDKThirtyTwoBytes chain);
38997 * Whether the offer has expired.
38999 MUST_USE_RES bool Offer_is_expired(const struct LDKOffer *NONNULL_PTR this_arg);
39002 * Returns whether the given quantity is valid for the offer.
39004 MUST_USE_RES bool Offer_is_valid_quantity(const struct LDKOffer *NONNULL_PTR this_arg, uint64_t quantity);
39007 * Returns whether a quantity is expected in an [`InvoiceRequest`] for the offer.
39009 * [`InvoiceRequest`]: crate::offers::invoice_request::InvoiceRequest
39011 MUST_USE_RES bool Offer_expects_quantity(const struct LDKOffer *NONNULL_PTR this_arg);
39014 * Serialize the Offer object into a byte array which can be read by Offer_read
39016 struct LDKCVec_u8Z Offer_write(const struct LDKOffer *NONNULL_PTR obj);
39019 * Frees any resources used by the Amount, if is_owned is set and inner is non-NULL.
39021 void Amount_free(struct LDKAmount this_obj);
39024 * Creates a copy of the Amount
39026 struct LDKAmount Amount_clone(const struct LDKAmount *NONNULL_PTR orig);
39029 * Frees any resources used by the Quantity, if is_owned is set and inner is non-NULL.
39031 void Quantity_free(struct LDKQuantity this_obj);
39034 * Creates a copy of the Quantity
39036 struct LDKQuantity Quantity_clone(const struct LDKQuantity *NONNULL_PTR orig);
39039 * Read a Offer object from a string
39041 struct LDKCResult_OfferBolt12ParseErrorZ Offer_from_str(struct LDKStr s);
39044 * Frees any resources used by the UnsignedBolt12Invoice, if is_owned is set and inner is non-NULL.
39046 void UnsignedBolt12Invoice_free(struct LDKUnsignedBolt12Invoice this_obj);
39049 * Returns the [`TaggedHash`] of the invoice to sign.
39051 MUST_USE_RES struct LDKTaggedHash UnsignedBolt12Invoice_tagged_hash(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
39054 * Frees any resources used by the Bolt12Invoice, if is_owned is set and inner is non-NULL.
39056 void Bolt12Invoice_free(struct LDKBolt12Invoice this_obj);
39059 * Creates a copy of the Bolt12Invoice
39061 struct LDKBolt12Invoice Bolt12Invoice_clone(const struct LDKBolt12Invoice *NONNULL_PTR orig);
39064 * The chains that may be used when paying a requested invoice.
39066 * From [`Offer::chains`]; `None` if the invoice was created in response to a [`Refund`].
39068 * [`Offer::chains`]: crate::offers::offer::Offer::chains
39070 MUST_USE_RES struct LDKCOption_CVec_ThirtyTwoBytesZZ UnsignedBolt12Invoice_offer_chains(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
39073 * The chain that must be used when paying the invoice; selected from [`offer_chains`] if the
39074 * invoice originated from an offer.
39076 * From [`InvoiceRequest::chain`] or [`Refund::chain`].
39078 * [`offer_chains`]: Self::offer_chains
39079 * [`InvoiceRequest::chain`]: crate::offers::invoice_request::InvoiceRequest::chain
39081 MUST_USE_RES struct LDKThirtyTwoBytes UnsignedBolt12Invoice_chain(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
39084 * Opaque bytes set by the originating [`Offer`].
39086 * From [`Offer::metadata`]; `None` if the invoice was created in response to a [`Refund`] or
39087 * if the [`Offer`] did not set it.
39089 * [`Offer`]: crate::offers::offer::Offer
39090 * [`Offer::metadata`]: crate::offers::offer::Offer::metadata
39092 MUST_USE_RES struct LDKCOption_CVec_u8ZZ UnsignedBolt12Invoice_metadata(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
39095 * The minimum amount required for a successful payment of a single item.
39097 * From [`Offer::amount`]; `None` if the invoice was created in response to a [`Refund`] or if
39098 * the [`Offer`] did not set it.
39100 * [`Offer`]: crate::offers::offer::Offer
39101 * [`Offer::amount`]: crate::offers::offer::Offer::amount
39103 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
39105 MUST_USE_RES struct LDKAmount UnsignedBolt12Invoice_amount(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
39108 * Features pertaining to the originating [`Offer`].
39110 * From [`Offer::offer_features`]; `None` if the invoice was created in response to a
39113 * [`Offer`]: crate::offers::offer::Offer
39114 * [`Offer::offer_features`]: crate::offers::offer::Offer::offer_features
39116 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
39118 MUST_USE_RES struct LDKOfferFeatures UnsignedBolt12Invoice_offer_features(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
39121 * A complete description of the purpose of the originating offer or refund.
39123 * From [`Offer::description`] or [`Refund::description`].
39125 * [`Offer::description`]: crate::offers::offer::Offer::description
39127 MUST_USE_RES struct LDKPrintableString UnsignedBolt12Invoice_description(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
39130 * Duration since the Unix epoch when an invoice should no longer be requested.
39132 * From [`Offer::absolute_expiry`] or [`Refund::absolute_expiry`].
39134 * [`Offer::absolute_expiry`]: crate::offers::offer::Offer::absolute_expiry
39136 MUST_USE_RES struct LDKCOption_u64Z UnsignedBolt12Invoice_absolute_expiry(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
39139 * The issuer of the offer or refund.
39141 * From [`Offer::issuer`] or [`Refund::issuer`].
39143 * [`Offer::issuer`]: crate::offers::offer::Offer::issuer
39145 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
39147 MUST_USE_RES struct LDKPrintableString UnsignedBolt12Invoice_issuer(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
39150 * Paths to the recipient originating from publicly reachable nodes.
39152 * From [`Offer::paths`] or [`Refund::paths`].
39154 * [`Offer::paths`]: crate::offers::offer::Offer::paths
39156 MUST_USE_RES struct LDKCVec_BlindedPathZ UnsignedBolt12Invoice_message_paths(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
39159 * The quantity of items supported.
39161 * From [`Offer::supported_quantity`]; `None` if the invoice was created in response to a
39164 * [`Offer::supported_quantity`]: crate::offers::offer::Offer::supported_quantity
39166 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
39168 MUST_USE_RES struct LDKQuantity UnsignedBolt12Invoice_supported_quantity(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
39171 * An unpredictable series of bytes from the payer.
39173 * From [`InvoiceRequest::payer_metadata`] or [`Refund::payer_metadata`].
39175 MUST_USE_RES struct LDKu8slice UnsignedBolt12Invoice_payer_metadata(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
39178 * Features pertaining to requesting an invoice.
39180 * From [`InvoiceRequest::invoice_request_features`] or [`Refund::features`].
39182 MUST_USE_RES struct LDKInvoiceRequestFeatures UnsignedBolt12Invoice_invoice_request_features(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
39185 * The quantity of items requested or refunded for.
39187 * From [`InvoiceRequest::quantity`] or [`Refund::quantity`].
39189 MUST_USE_RES struct LDKCOption_u64Z UnsignedBolt12Invoice_quantity(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
39192 * A possibly transient pubkey used to sign the invoice request or to send an invoice for a
39193 * refund in case there are no [`message_paths`].
39195 * [`message_paths`]: Self::message_paths
39197 MUST_USE_RES struct LDKPublicKey UnsignedBolt12Invoice_payer_id(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
39200 * A payer-provided note reflected back in the invoice.
39202 * From [`InvoiceRequest::payer_note`] or [`Refund::payer_note`].
39204 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
39206 MUST_USE_RES struct LDKPrintableString UnsignedBolt12Invoice_payer_note(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
39209 * Duration since the Unix epoch when the invoice was created.
39211 MUST_USE_RES uint64_t UnsignedBolt12Invoice_created_at(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
39214 * Duration since [`Bolt12Invoice::created_at`] when the invoice has expired and therefore
39215 * should no longer be paid.
39217 MUST_USE_RES uint64_t UnsignedBolt12Invoice_relative_expiry(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
39220 * Whether the invoice has expired.
39222 MUST_USE_RES bool UnsignedBolt12Invoice_is_expired(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
39225 * SHA256 hash of the payment preimage that will be given in return for paying the invoice.
39227 MUST_USE_RES struct LDKThirtyTwoBytes UnsignedBolt12Invoice_payment_hash(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
39230 * The minimum amount required for a successful payment of the invoice.
39232 MUST_USE_RES uint64_t UnsignedBolt12Invoice_amount_msats(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
39235 * Features pertaining to paying an invoice.
39237 MUST_USE_RES struct LDKBolt12InvoiceFeatures UnsignedBolt12Invoice_invoice_features(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
39240 * The public key corresponding to the key used to sign the invoice.
39242 MUST_USE_RES struct LDKPublicKey UnsignedBolt12Invoice_signing_pubkey(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
39245 * The chains that may be used when paying a requested invoice.
39247 * From [`Offer::chains`]; `None` if the invoice was created in response to a [`Refund`].
39249 * [`Offer::chains`]: crate::offers::offer::Offer::chains
39251 MUST_USE_RES struct LDKCOption_CVec_ThirtyTwoBytesZZ Bolt12Invoice_offer_chains(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
39254 * The chain that must be used when paying the invoice; selected from [`offer_chains`] if the
39255 * invoice originated from an offer.
39257 * From [`InvoiceRequest::chain`] or [`Refund::chain`].
39259 * [`offer_chains`]: Self::offer_chains
39260 * [`InvoiceRequest::chain`]: crate::offers::invoice_request::InvoiceRequest::chain
39262 MUST_USE_RES struct LDKThirtyTwoBytes Bolt12Invoice_chain(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
39265 * Opaque bytes set by the originating [`Offer`].
39267 * From [`Offer::metadata`]; `None` if the invoice was created in response to a [`Refund`] or
39268 * if the [`Offer`] did not set it.
39270 * [`Offer`]: crate::offers::offer::Offer
39271 * [`Offer::metadata`]: crate::offers::offer::Offer::metadata
39273 MUST_USE_RES struct LDKCOption_CVec_u8ZZ Bolt12Invoice_metadata(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
39276 * The minimum amount required for a successful payment of a single item.
39278 * From [`Offer::amount`]; `None` if the invoice was created in response to a [`Refund`] or if
39279 * the [`Offer`] did not set it.
39281 * [`Offer`]: crate::offers::offer::Offer
39282 * [`Offer::amount`]: crate::offers::offer::Offer::amount
39284 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
39286 MUST_USE_RES struct LDKAmount Bolt12Invoice_amount(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
39289 * Features pertaining to the originating [`Offer`].
39291 * From [`Offer::offer_features`]; `None` if the invoice was created in response to a
39294 * [`Offer`]: crate::offers::offer::Offer
39295 * [`Offer::offer_features`]: crate::offers::offer::Offer::offer_features
39297 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
39299 MUST_USE_RES struct LDKOfferFeatures Bolt12Invoice_offer_features(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
39302 * A complete description of the purpose of the originating offer or refund.
39304 * From [`Offer::description`] or [`Refund::description`].
39306 * [`Offer::description`]: crate::offers::offer::Offer::description
39308 MUST_USE_RES struct LDKPrintableString Bolt12Invoice_description(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
39311 * Duration since the Unix epoch when an invoice should no longer be requested.
39313 * From [`Offer::absolute_expiry`] or [`Refund::absolute_expiry`].
39315 * [`Offer::absolute_expiry`]: crate::offers::offer::Offer::absolute_expiry
39317 MUST_USE_RES struct LDKCOption_u64Z Bolt12Invoice_absolute_expiry(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
39320 * The issuer of the offer or refund.
39322 * From [`Offer::issuer`] or [`Refund::issuer`].
39324 * [`Offer::issuer`]: crate::offers::offer::Offer::issuer
39326 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
39328 MUST_USE_RES struct LDKPrintableString Bolt12Invoice_issuer(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
39331 * Paths to the recipient originating from publicly reachable nodes.
39333 * From [`Offer::paths`] or [`Refund::paths`].
39335 * [`Offer::paths`]: crate::offers::offer::Offer::paths
39337 MUST_USE_RES struct LDKCVec_BlindedPathZ Bolt12Invoice_message_paths(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
39340 * The quantity of items supported.
39342 * From [`Offer::supported_quantity`]; `None` if the invoice was created in response to a
39345 * [`Offer::supported_quantity`]: crate::offers::offer::Offer::supported_quantity
39347 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
39349 MUST_USE_RES struct LDKQuantity Bolt12Invoice_supported_quantity(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
39352 * An unpredictable series of bytes from the payer.
39354 * From [`InvoiceRequest::payer_metadata`] or [`Refund::payer_metadata`].
39356 MUST_USE_RES struct LDKu8slice Bolt12Invoice_payer_metadata(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
39359 * Features pertaining to requesting an invoice.
39361 * From [`InvoiceRequest::invoice_request_features`] or [`Refund::features`].
39363 MUST_USE_RES struct LDKInvoiceRequestFeatures Bolt12Invoice_invoice_request_features(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
39366 * The quantity of items requested or refunded for.
39368 * From [`InvoiceRequest::quantity`] or [`Refund::quantity`].
39370 MUST_USE_RES struct LDKCOption_u64Z Bolt12Invoice_quantity(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
39373 * A possibly transient pubkey used to sign the invoice request or to send an invoice for a
39374 * refund in case there are no [`message_paths`].
39376 * [`message_paths`]: Self::message_paths
39378 MUST_USE_RES struct LDKPublicKey Bolt12Invoice_payer_id(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
39381 * A payer-provided note reflected back in the invoice.
39383 * From [`InvoiceRequest::payer_note`] or [`Refund::payer_note`].
39385 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
39387 MUST_USE_RES struct LDKPrintableString Bolt12Invoice_payer_note(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
39390 * Duration since the Unix epoch when the invoice was created.
39392 MUST_USE_RES uint64_t Bolt12Invoice_created_at(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
39395 * Duration since [`Bolt12Invoice::created_at`] when the invoice has expired and therefore
39396 * should no longer be paid.
39398 MUST_USE_RES uint64_t Bolt12Invoice_relative_expiry(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
39401 * Whether the invoice has expired.
39403 MUST_USE_RES bool Bolt12Invoice_is_expired(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
39406 * SHA256 hash of the payment preimage that will be given in return for paying the invoice.
39408 MUST_USE_RES struct LDKThirtyTwoBytes Bolt12Invoice_payment_hash(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
39411 * The minimum amount required for a successful payment of the invoice.
39413 MUST_USE_RES uint64_t Bolt12Invoice_amount_msats(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
39416 * Features pertaining to paying an invoice.
39418 MUST_USE_RES struct LDKBolt12InvoiceFeatures Bolt12Invoice_invoice_features(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
39421 * The public key corresponding to the key used to sign the invoice.
39423 MUST_USE_RES struct LDKPublicKey Bolt12Invoice_signing_pubkey(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
39426 * Signature of the invoice verified using [`Bolt12Invoice::signing_pubkey`].
39428 MUST_USE_RES struct LDKSchnorrSignature Bolt12Invoice_signature(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
39431 * Hash that was used for signing the invoice.
39433 MUST_USE_RES struct LDKThirtyTwoBytes Bolt12Invoice_signable_hash(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
39436 * Verifies that the invoice was for a request or refund created using the given key. Returns
39437 * the associated [`PaymentId`] to use when sending the payment.
39439 MUST_USE_RES struct LDKCResult_ThirtyTwoBytesNoneZ Bolt12Invoice_verify(const struct LDKBolt12Invoice *NONNULL_PTR this_arg, const struct LDKExpandedKey *NONNULL_PTR key);
39442 * Serialize the UnsignedBolt12Invoice object into a byte array which can be read by UnsignedBolt12Invoice_read
39444 struct LDKCVec_u8Z UnsignedBolt12Invoice_write(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR obj);
39447 * Serialize the Bolt12Invoice object into a byte array which can be read by Bolt12Invoice_read
39449 struct LDKCVec_u8Z Bolt12Invoice_write(const struct LDKBolt12Invoice *NONNULL_PTR obj);
39452 * Frees any resources used by the BlindedPayInfo, if is_owned is set and inner is non-NULL.
39454 void BlindedPayInfo_free(struct LDKBlindedPayInfo this_obj);
39457 * Base fee charged (in millisatoshi) for the entire blinded path.
39459 uint32_t BlindedPayInfo_get_fee_base_msat(const struct LDKBlindedPayInfo *NONNULL_PTR this_ptr);
39462 * Base fee charged (in millisatoshi) for the entire blinded path.
39464 void BlindedPayInfo_set_fee_base_msat(struct LDKBlindedPayInfo *NONNULL_PTR this_ptr, uint32_t val);
39467 * Liquidity fee charged (in millionths of the amount transferred) for the entire blinded path
39468 * (i.e., 10,000 is 1%).
39470 uint32_t BlindedPayInfo_get_fee_proportional_millionths(const struct LDKBlindedPayInfo *NONNULL_PTR this_ptr);
39473 * Liquidity fee charged (in millionths of the amount transferred) for the entire blinded path
39474 * (i.e., 10,000 is 1%).
39476 void BlindedPayInfo_set_fee_proportional_millionths(struct LDKBlindedPayInfo *NONNULL_PTR this_ptr, uint32_t val);
39479 * Number of blocks subtracted from an incoming HTLC's `cltv_expiry` for the entire blinded
39482 uint16_t BlindedPayInfo_get_cltv_expiry_delta(const struct LDKBlindedPayInfo *NONNULL_PTR this_ptr);
39485 * Number of blocks subtracted from an incoming HTLC's `cltv_expiry` for the entire blinded
39488 void BlindedPayInfo_set_cltv_expiry_delta(struct LDKBlindedPayInfo *NONNULL_PTR this_ptr, uint16_t val);
39491 * The minimum HTLC value (in millisatoshi) that is acceptable to all channel peers on the
39492 * blinded path from the introduction node to the recipient, accounting for any fees, i.e., as
39493 * seen by the recipient.
39495 uint64_t BlindedPayInfo_get_htlc_minimum_msat(const struct LDKBlindedPayInfo *NONNULL_PTR this_ptr);
39498 * The minimum HTLC value (in millisatoshi) that is acceptable to all channel peers on the
39499 * blinded path from the introduction node to the recipient, accounting for any fees, i.e., as
39500 * seen by the recipient.
39502 void BlindedPayInfo_set_htlc_minimum_msat(struct LDKBlindedPayInfo *NONNULL_PTR this_ptr, uint64_t val);
39505 * The maximum HTLC value (in millisatoshi) that is acceptable to all channel peers on the
39506 * blinded path from the introduction node to the recipient, accounting for any fees, i.e., as
39507 * seen by the recipient.
39509 uint64_t BlindedPayInfo_get_htlc_maximum_msat(const struct LDKBlindedPayInfo *NONNULL_PTR this_ptr);
39512 * The maximum HTLC value (in millisatoshi) that is acceptable to all channel peers on the
39513 * blinded path from the introduction node to the recipient, accounting for any fees, i.e., as
39514 * seen by the recipient.
39516 void BlindedPayInfo_set_htlc_maximum_msat(struct LDKBlindedPayInfo *NONNULL_PTR this_ptr, uint64_t val);
39519 * Features set in `encrypted_data_tlv` for the `encrypted_recipient_data` TLV record in an
39522 struct LDKBlindedHopFeatures BlindedPayInfo_get_features(const struct LDKBlindedPayInfo *NONNULL_PTR this_ptr);
39525 * Features set in `encrypted_data_tlv` for the `encrypted_recipient_data` TLV record in an
39528 void BlindedPayInfo_set_features(struct LDKBlindedPayInfo *NONNULL_PTR this_ptr, struct LDKBlindedHopFeatures val);
39531 * Constructs a new BlindedPayInfo given each field
39533 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);
39536 * Creates a copy of the BlindedPayInfo
39538 struct LDKBlindedPayInfo BlindedPayInfo_clone(const struct LDKBlindedPayInfo *NONNULL_PTR orig);
39541 * Generates a non-cryptographic 64-bit hash of the BlindedPayInfo.
39543 uint64_t BlindedPayInfo_hash(const struct LDKBlindedPayInfo *NONNULL_PTR o);
39546 * Checks if two BlindedPayInfos contain equal inner contents.
39547 * This ignores pointers and is_owned flags and looks at the values in fields.
39548 * Two objects with NULL inner values will be considered "equal" here.
39550 bool BlindedPayInfo_eq(const struct LDKBlindedPayInfo *NONNULL_PTR a, const struct LDKBlindedPayInfo *NONNULL_PTR b);
39553 * Serialize the BlindedPayInfo object into a byte array which can be read by BlindedPayInfo_read
39555 struct LDKCVec_u8Z BlindedPayInfo_write(const struct LDKBlindedPayInfo *NONNULL_PTR obj);
39558 * Read a BlindedPayInfo from a byte array, created by BlindedPayInfo_write
39560 struct LDKCResult_BlindedPayInfoDecodeErrorZ BlindedPayInfo_read(struct LDKu8slice ser);
39563 * Frees any resources used by the InvoiceError, if is_owned is set and inner is non-NULL.
39565 void InvoiceError_free(struct LDKInvoiceError this_obj);
39568 * The field in the [`InvoiceRequest`] or the [`Bolt12Invoice`] that contained an error.
39570 * [`InvoiceRequest`]: crate::offers::invoice_request::InvoiceRequest
39571 * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice
39573 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
39575 struct LDKErroneousField InvoiceError_get_erroneous_field(const struct LDKInvoiceError *NONNULL_PTR this_ptr);
39578 * The field in the [`InvoiceRequest`] or the [`Bolt12Invoice`] that contained an error.
39580 * [`InvoiceRequest`]: crate::offers::invoice_request::InvoiceRequest
39581 * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice
39583 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
39585 void InvoiceError_set_erroneous_field(struct LDKInvoiceError *NONNULL_PTR this_ptr, struct LDKErroneousField val);
39588 * An explanation of the error.
39590 struct LDKUntrustedString InvoiceError_get_message(const struct LDKInvoiceError *NONNULL_PTR this_ptr);
39593 * An explanation of the error.
39595 void InvoiceError_set_message(struct LDKInvoiceError *NONNULL_PTR this_ptr, struct LDKUntrustedString val);
39598 * Constructs a new InvoiceError given each field
39600 * Note that erroneous_field_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
39602 MUST_USE_RES struct LDKInvoiceError InvoiceError_new(struct LDKErroneousField erroneous_field_arg, struct LDKUntrustedString message_arg);
39605 * Creates a copy of the InvoiceError
39607 struct LDKInvoiceError InvoiceError_clone(const struct LDKInvoiceError *NONNULL_PTR orig);
39610 * Frees any resources used by the ErroneousField, if is_owned is set and inner is non-NULL.
39612 void ErroneousField_free(struct LDKErroneousField this_obj);
39615 * The type number of the TLV field containing the error.
39617 uint64_t ErroneousField_get_tlv_fieldnum(const struct LDKErroneousField *NONNULL_PTR this_ptr);
39620 * The type number of the TLV field containing the error.
39622 void ErroneousField_set_tlv_fieldnum(struct LDKErroneousField *NONNULL_PTR this_ptr, uint64_t val);
39625 * A value to use for the TLV field to avoid the error.
39627 * Returns a copy of the field.
39629 struct LDKCOption_CVec_u8ZZ ErroneousField_get_suggested_value(const struct LDKErroneousField *NONNULL_PTR this_ptr);
39632 * A value to use for the TLV field to avoid the error.
39634 void ErroneousField_set_suggested_value(struct LDKErroneousField *NONNULL_PTR this_ptr, struct LDKCOption_CVec_u8ZZ val);
39637 * Constructs a new ErroneousField given each field
39639 MUST_USE_RES struct LDKErroneousField ErroneousField_new(uint64_t tlv_fieldnum_arg, struct LDKCOption_CVec_u8ZZ suggested_value_arg);
39642 * Creates a copy of the ErroneousField
39644 struct LDKErroneousField ErroneousField_clone(const struct LDKErroneousField *NONNULL_PTR orig);
39647 * Serialize the InvoiceError object into a byte array which can be read by InvoiceError_read
39649 struct LDKCVec_u8Z InvoiceError_write(const struct LDKInvoiceError *NONNULL_PTR obj);
39652 * Read a InvoiceError from a byte array, created by InvoiceError_write
39654 struct LDKCResult_InvoiceErrorDecodeErrorZ InvoiceError_read(struct LDKu8slice ser);
39657 * Frees any resources used by the UnsignedInvoiceRequest, if is_owned is set and inner is non-NULL.
39659 void UnsignedInvoiceRequest_free(struct LDKUnsignedInvoiceRequest this_obj);
39662 * Returns the [`TaggedHash`] of the invoice to sign.
39664 MUST_USE_RES struct LDKTaggedHash UnsignedInvoiceRequest_tagged_hash(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR this_arg);
39667 * Frees any resources used by the InvoiceRequest, if is_owned is set and inner is non-NULL.
39669 void InvoiceRequest_free(struct LDKInvoiceRequest this_obj);
39672 * Creates a copy of the InvoiceRequest
39674 struct LDKInvoiceRequest InvoiceRequest_clone(const struct LDKInvoiceRequest *NONNULL_PTR orig);
39677 * Frees any resources used by the VerifiedInvoiceRequest, if is_owned is set and inner is non-NULL.
39679 void VerifiedInvoiceRequest_free(struct LDKVerifiedInvoiceRequest this_obj);
39682 * Keys used for signing a [`Bolt12Invoice`] if they can be derived.
39684 * If `Some`, must call [`respond_using_derived_keys`] when responding. Otherwise, call
39685 * [`respond_with`].
39687 * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice
39688 * [`respond_using_derived_keys`]: Self::respond_using_derived_keys
39689 * [`respond_with`]: Self::respond_with
39691 struct LDKCOption_SecretKeyZ VerifiedInvoiceRequest_get_keys(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_ptr);
39694 * Keys used for signing a [`Bolt12Invoice`] if they can be derived.
39696 * If `Some`, must call [`respond_using_derived_keys`] when responding. Otherwise, call
39697 * [`respond_with`].
39699 * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice
39700 * [`respond_using_derived_keys`]: Self::respond_using_derived_keys
39701 * [`respond_with`]: Self::respond_with
39703 void VerifiedInvoiceRequest_set_keys(struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_ptr, struct LDKCOption_SecretKeyZ val);
39706 * Creates a copy of the VerifiedInvoiceRequest
39708 struct LDKVerifiedInvoiceRequest VerifiedInvoiceRequest_clone(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR orig);
39711 * The chains that may be used when paying a requested invoice (e.g., bitcoin mainnet).
39712 * Payments must be denominated in units of the minimal lightning-payable unit (e.g., msats)
39713 * for the selected chain.
39715 MUST_USE_RES struct LDKCVec_ThirtyTwoBytesZ UnsignedInvoiceRequest_chains(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR this_arg);
39718 * Opaque bytes set by the originator. Useful for authentication and validating fields since it
39719 * is reflected in `invoice_request` messages along with all the other fields from the `offer`.
39721 MUST_USE_RES struct LDKCOption_CVec_u8ZZ UnsignedInvoiceRequest_metadata(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR this_arg);
39724 * The minimum amount required for a successful payment of a single item.
39726 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
39728 MUST_USE_RES struct LDKAmount UnsignedInvoiceRequest_amount(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR this_arg);
39731 * A complete description of the purpose of the payment. Intended to be displayed to the user
39732 * but with the caveat that it has not been verified in any way.
39734 MUST_USE_RES struct LDKPrintableString UnsignedInvoiceRequest_description(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR this_arg);
39737 * Features pertaining to the offer.
39739 MUST_USE_RES struct LDKOfferFeatures UnsignedInvoiceRequest_offer_features(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR this_arg);
39742 * Duration since the Unix epoch when an invoice should no longer be requested.
39744 * If `None`, the offer does not expire.
39746 MUST_USE_RES struct LDKCOption_u64Z UnsignedInvoiceRequest_absolute_expiry(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR this_arg);
39749 * The issuer of the offer, possibly beginning with `user@domain` or `domain`. Intended to be
39750 * displayed to the user but with the caveat that it has not been verified in any way.
39752 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
39754 MUST_USE_RES struct LDKPrintableString UnsignedInvoiceRequest_issuer(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR this_arg);
39757 * Paths to the recipient originating from publicly reachable nodes. Blinded paths provide
39758 * recipient privacy by obfuscating its node id.
39760 MUST_USE_RES struct LDKCVec_BlindedPathZ UnsignedInvoiceRequest_paths(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR this_arg);
39763 * The quantity of items supported.
39765 MUST_USE_RES struct LDKQuantity UnsignedInvoiceRequest_supported_quantity(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR this_arg);
39768 * The public key used by the recipient to sign invoices.
39770 MUST_USE_RES struct LDKPublicKey UnsignedInvoiceRequest_signing_pubkey(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR this_arg);
39773 * An unpredictable series of bytes, typically containing information about the derivation of
39776 * [`payer_id`]: Self::payer_id
39778 MUST_USE_RES struct LDKu8slice UnsignedInvoiceRequest_payer_metadata(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR this_arg);
39781 * A chain from [`Offer::chains`] that the offer is valid for.
39783 MUST_USE_RES struct LDKThirtyTwoBytes UnsignedInvoiceRequest_chain(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR this_arg);
39786 * The amount to pay in msats (i.e., the minimum lightning-payable unit for [`chain`]), which
39787 * must be greater than or equal to [`Offer::amount`], converted if necessary.
39789 * [`chain`]: Self::chain
39791 MUST_USE_RES struct LDKCOption_u64Z UnsignedInvoiceRequest_amount_msats(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR this_arg);
39794 * Features pertaining to requesting an invoice.
39796 MUST_USE_RES struct LDKInvoiceRequestFeatures UnsignedInvoiceRequest_invoice_request_features(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR this_arg);
39799 * The quantity of the offer's item conforming to [`Offer::is_valid_quantity`].
39801 MUST_USE_RES struct LDKCOption_u64Z UnsignedInvoiceRequest_quantity(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR this_arg);
39804 * A possibly transient pubkey used to sign the invoice request.
39806 MUST_USE_RES struct LDKPublicKey UnsignedInvoiceRequest_payer_id(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR this_arg);
39809 * A payer-provided note which will be seen by the recipient and reflected back in the invoice
39812 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
39814 MUST_USE_RES struct LDKPrintableString UnsignedInvoiceRequest_payer_note(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR this_arg);
39817 * The chains that may be used when paying a requested invoice (e.g., bitcoin mainnet).
39818 * Payments must be denominated in units of the minimal lightning-payable unit (e.g., msats)
39819 * for the selected chain.
39821 MUST_USE_RES struct LDKCVec_ThirtyTwoBytesZ InvoiceRequest_chains(const struct LDKInvoiceRequest *NONNULL_PTR this_arg);
39824 * Opaque bytes set by the originator. Useful for authentication and validating fields since it
39825 * is reflected in `invoice_request` messages along with all the other fields from the `offer`.
39827 MUST_USE_RES struct LDKCOption_CVec_u8ZZ InvoiceRequest_metadata(const struct LDKInvoiceRequest *NONNULL_PTR this_arg);
39830 * The minimum amount required for a successful payment of a single item.
39832 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
39834 MUST_USE_RES struct LDKAmount InvoiceRequest_amount(const struct LDKInvoiceRequest *NONNULL_PTR this_arg);
39837 * A complete description of the purpose of the payment. Intended to be displayed to the user
39838 * but with the caveat that it has not been verified in any way.
39840 MUST_USE_RES struct LDKPrintableString InvoiceRequest_description(const struct LDKInvoiceRequest *NONNULL_PTR this_arg);
39843 * Features pertaining to the offer.
39845 MUST_USE_RES struct LDKOfferFeatures InvoiceRequest_offer_features(const struct LDKInvoiceRequest *NONNULL_PTR this_arg);
39848 * Duration since the Unix epoch when an invoice should no longer be requested.
39850 * If `None`, the offer does not expire.
39852 MUST_USE_RES struct LDKCOption_u64Z InvoiceRequest_absolute_expiry(const struct LDKInvoiceRequest *NONNULL_PTR this_arg);
39855 * The issuer of the offer, possibly beginning with `user@domain` or `domain`. Intended to be
39856 * displayed to the user but with the caveat that it has not been verified in any way.
39858 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
39860 MUST_USE_RES struct LDKPrintableString InvoiceRequest_issuer(const struct LDKInvoiceRequest *NONNULL_PTR this_arg);
39863 * Paths to the recipient originating from publicly reachable nodes. Blinded paths provide
39864 * recipient privacy by obfuscating its node id.
39866 MUST_USE_RES struct LDKCVec_BlindedPathZ InvoiceRequest_paths(const struct LDKInvoiceRequest *NONNULL_PTR this_arg);
39869 * The quantity of items supported.
39871 MUST_USE_RES struct LDKQuantity InvoiceRequest_supported_quantity(const struct LDKInvoiceRequest *NONNULL_PTR this_arg);
39874 * The public key used by the recipient to sign invoices.
39876 MUST_USE_RES struct LDKPublicKey InvoiceRequest_signing_pubkey(const struct LDKInvoiceRequest *NONNULL_PTR this_arg);
39879 * An unpredictable series of bytes, typically containing information about the derivation of
39882 * [`payer_id`]: Self::payer_id
39884 MUST_USE_RES struct LDKu8slice InvoiceRequest_payer_metadata(const struct LDKInvoiceRequest *NONNULL_PTR this_arg);
39887 * A chain from [`Offer::chains`] that the offer is valid for.
39889 MUST_USE_RES struct LDKThirtyTwoBytes InvoiceRequest_chain(const struct LDKInvoiceRequest *NONNULL_PTR this_arg);
39892 * The amount to pay in msats (i.e., the minimum lightning-payable unit for [`chain`]), which
39893 * must be greater than or equal to [`Offer::amount`], converted if necessary.
39895 * [`chain`]: Self::chain
39897 MUST_USE_RES struct LDKCOption_u64Z InvoiceRequest_amount_msats(const struct LDKInvoiceRequest *NONNULL_PTR this_arg);
39900 * Features pertaining to requesting an invoice.
39902 MUST_USE_RES struct LDKInvoiceRequestFeatures InvoiceRequest_invoice_request_features(const struct LDKInvoiceRequest *NONNULL_PTR this_arg);
39905 * The quantity of the offer's item conforming to [`Offer::is_valid_quantity`].
39907 MUST_USE_RES struct LDKCOption_u64Z InvoiceRequest_quantity(const struct LDKInvoiceRequest *NONNULL_PTR this_arg);
39910 * A possibly transient pubkey used to sign the invoice request.
39912 MUST_USE_RES struct LDKPublicKey InvoiceRequest_payer_id(const struct LDKInvoiceRequest *NONNULL_PTR this_arg);
39915 * A payer-provided note which will be seen by the recipient and reflected back in the invoice
39918 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
39920 MUST_USE_RES struct LDKPrintableString InvoiceRequest_payer_note(const struct LDKInvoiceRequest *NONNULL_PTR this_arg);
39923 * Signature of the invoice request using [`payer_id`].
39925 * [`payer_id`]: Self::payer_id
39927 MUST_USE_RES struct LDKSchnorrSignature InvoiceRequest_signature(const struct LDKInvoiceRequest *NONNULL_PTR this_arg);
39930 * Verifies that the request was for an offer created using the given key. Returns the verified
39931 * request which contains the derived keys needed to sign a [`Bolt12Invoice`] for the request
39932 * if they could be extracted from the metadata.
39934 * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice
39936 MUST_USE_RES struct LDKCResult_VerifiedInvoiceRequestNoneZ InvoiceRequest_verify(struct LDKInvoiceRequest this_arg, const struct LDKExpandedKey *NONNULL_PTR key);
39939 * The chains that may be used when paying a requested invoice (e.g., bitcoin mainnet).
39940 * Payments must be denominated in units of the minimal lightning-payable unit (e.g., msats)
39941 * for the selected chain.
39943 MUST_USE_RES struct LDKCVec_ThirtyTwoBytesZ VerifiedInvoiceRequest_chains(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg);
39946 * Opaque bytes set by the originator. Useful for authentication and validating fields since it
39947 * is reflected in `invoice_request` messages along with all the other fields from the `offer`.
39949 MUST_USE_RES struct LDKCOption_CVec_u8ZZ VerifiedInvoiceRequest_metadata(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg);
39952 * The minimum amount required for a successful payment of a single item.
39954 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
39956 MUST_USE_RES struct LDKAmount VerifiedInvoiceRequest_amount(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg);
39959 * A complete description of the purpose of the payment. Intended to be displayed to the user
39960 * but with the caveat that it has not been verified in any way.
39962 MUST_USE_RES struct LDKPrintableString VerifiedInvoiceRequest_description(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg);
39965 * Features pertaining to the offer.
39967 MUST_USE_RES struct LDKOfferFeatures VerifiedInvoiceRequest_offer_features(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg);
39970 * Duration since the Unix epoch when an invoice should no longer be requested.
39972 * If `None`, the offer does not expire.
39974 MUST_USE_RES struct LDKCOption_u64Z VerifiedInvoiceRequest_absolute_expiry(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg);
39977 * The issuer of the offer, possibly beginning with `user@domain` or `domain`. Intended to be
39978 * displayed to the user but with the caveat that it has not been verified in any way.
39980 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
39982 MUST_USE_RES struct LDKPrintableString VerifiedInvoiceRequest_issuer(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg);
39985 * Paths to the recipient originating from publicly reachable nodes. Blinded paths provide
39986 * recipient privacy by obfuscating its node id.
39988 MUST_USE_RES struct LDKCVec_BlindedPathZ VerifiedInvoiceRequest_paths(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg);
39991 * The quantity of items supported.
39993 MUST_USE_RES struct LDKQuantity VerifiedInvoiceRequest_supported_quantity(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg);
39996 * The public key used by the recipient to sign invoices.
39998 MUST_USE_RES struct LDKPublicKey VerifiedInvoiceRequest_signing_pubkey(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg);
40001 * An unpredictable series of bytes, typically containing information about the derivation of
40004 * [`payer_id`]: Self::payer_id
40006 MUST_USE_RES struct LDKu8slice VerifiedInvoiceRequest_payer_metadata(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg);
40009 * A chain from [`Offer::chains`] that the offer is valid for.
40011 MUST_USE_RES struct LDKThirtyTwoBytes VerifiedInvoiceRequest_chain(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg);
40014 * The amount to pay in msats (i.e., the minimum lightning-payable unit for [`chain`]), which
40015 * must be greater than or equal to [`Offer::amount`], converted if necessary.
40017 * [`chain`]: Self::chain
40019 MUST_USE_RES struct LDKCOption_u64Z VerifiedInvoiceRequest_amount_msats(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg);
40022 * Features pertaining to requesting an invoice.
40024 MUST_USE_RES struct LDKInvoiceRequestFeatures VerifiedInvoiceRequest_invoice_request_features(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg);
40027 * The quantity of the offer's item conforming to [`Offer::is_valid_quantity`].
40029 MUST_USE_RES struct LDKCOption_u64Z VerifiedInvoiceRequest_quantity(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg);
40032 * A possibly transient pubkey used to sign the invoice request.
40034 MUST_USE_RES struct LDKPublicKey VerifiedInvoiceRequest_payer_id(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg);
40037 * A payer-provided note which will be seen by the recipient and reflected back in the invoice
40040 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
40042 MUST_USE_RES struct LDKPrintableString VerifiedInvoiceRequest_payer_note(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg);
40045 * Serialize the UnsignedInvoiceRequest object into a byte array which can be read by UnsignedInvoiceRequest_read
40047 struct LDKCVec_u8Z UnsignedInvoiceRequest_write(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR obj);
40050 * Serialize the InvoiceRequest object into a byte array which can be read by InvoiceRequest_read
40052 struct LDKCVec_u8Z InvoiceRequest_write(const struct LDKInvoiceRequest *NONNULL_PTR obj);
40055 * Frees any resources used by the TaggedHash, if is_owned is set and inner is non-NULL.
40057 void TaggedHash_free(struct LDKTaggedHash this_obj);
40060 * Frees any resources used by the Bolt12ParseError, if is_owned is set and inner is non-NULL.
40062 void Bolt12ParseError_free(struct LDKBolt12ParseError this_obj);
40065 * Creates a copy of the Bolt12ParseError
40067 struct LDKBolt12ParseError Bolt12ParseError_clone(const struct LDKBolt12ParseError *NONNULL_PTR orig);
40070 * Creates a copy of the Bolt12SemanticError
40072 enum LDKBolt12SemanticError Bolt12SemanticError_clone(const enum LDKBolt12SemanticError *NONNULL_PTR orig);
40075 * Utility method to constructs a new AlreadyExpired-variant Bolt12SemanticError
40077 enum LDKBolt12SemanticError Bolt12SemanticError_already_expired(void);
40080 * Utility method to constructs a new UnsupportedChain-variant Bolt12SemanticError
40082 enum LDKBolt12SemanticError Bolt12SemanticError_unsupported_chain(void);
40085 * Utility method to constructs a new UnexpectedChain-variant Bolt12SemanticError
40087 enum LDKBolt12SemanticError Bolt12SemanticError_unexpected_chain(void);
40090 * Utility method to constructs a new MissingAmount-variant Bolt12SemanticError
40092 enum LDKBolt12SemanticError Bolt12SemanticError_missing_amount(void);
40095 * Utility method to constructs a new InvalidAmount-variant Bolt12SemanticError
40097 enum LDKBolt12SemanticError Bolt12SemanticError_invalid_amount(void);
40100 * Utility method to constructs a new InsufficientAmount-variant Bolt12SemanticError
40102 enum LDKBolt12SemanticError Bolt12SemanticError_insufficient_amount(void);
40105 * Utility method to constructs a new UnexpectedAmount-variant Bolt12SemanticError
40107 enum LDKBolt12SemanticError Bolt12SemanticError_unexpected_amount(void);
40110 * Utility method to constructs a new UnsupportedCurrency-variant Bolt12SemanticError
40112 enum LDKBolt12SemanticError Bolt12SemanticError_unsupported_currency(void);
40115 * Utility method to constructs a new UnknownRequiredFeatures-variant Bolt12SemanticError
40117 enum LDKBolt12SemanticError Bolt12SemanticError_unknown_required_features(void);
40120 * Utility method to constructs a new UnexpectedFeatures-variant Bolt12SemanticError
40122 enum LDKBolt12SemanticError Bolt12SemanticError_unexpected_features(void);
40125 * Utility method to constructs a new MissingDescription-variant Bolt12SemanticError
40127 enum LDKBolt12SemanticError Bolt12SemanticError_missing_description(void);
40130 * Utility method to constructs a new MissingSigningPubkey-variant Bolt12SemanticError
40132 enum LDKBolt12SemanticError Bolt12SemanticError_missing_signing_pubkey(void);
40135 * Utility method to constructs a new InvalidSigningPubkey-variant Bolt12SemanticError
40137 enum LDKBolt12SemanticError Bolt12SemanticError_invalid_signing_pubkey(void);
40140 * Utility method to constructs a new UnexpectedSigningPubkey-variant Bolt12SemanticError
40142 enum LDKBolt12SemanticError Bolt12SemanticError_unexpected_signing_pubkey(void);
40145 * Utility method to constructs a new MissingQuantity-variant Bolt12SemanticError
40147 enum LDKBolt12SemanticError Bolt12SemanticError_missing_quantity(void);
40150 * Utility method to constructs a new InvalidQuantity-variant Bolt12SemanticError
40152 enum LDKBolt12SemanticError Bolt12SemanticError_invalid_quantity(void);
40155 * Utility method to constructs a new UnexpectedQuantity-variant Bolt12SemanticError
40157 enum LDKBolt12SemanticError Bolt12SemanticError_unexpected_quantity(void);
40160 * Utility method to constructs a new InvalidMetadata-variant Bolt12SemanticError
40162 enum LDKBolt12SemanticError Bolt12SemanticError_invalid_metadata(void);
40165 * Utility method to constructs a new UnexpectedMetadata-variant Bolt12SemanticError
40167 enum LDKBolt12SemanticError Bolt12SemanticError_unexpected_metadata(void);
40170 * Utility method to constructs a new MissingPayerMetadata-variant Bolt12SemanticError
40172 enum LDKBolt12SemanticError Bolt12SemanticError_missing_payer_metadata(void);
40175 * Utility method to constructs a new MissingPayerId-variant Bolt12SemanticError
40177 enum LDKBolt12SemanticError Bolt12SemanticError_missing_payer_id(void);
40180 * Utility method to constructs a new MissingPaths-variant Bolt12SemanticError
40182 enum LDKBolt12SemanticError Bolt12SemanticError_missing_paths(void);
40185 * Utility method to constructs a new InvalidPayInfo-variant Bolt12SemanticError
40187 enum LDKBolt12SemanticError Bolt12SemanticError_invalid_pay_info(void);
40190 * Utility method to constructs a new MissingCreationTime-variant Bolt12SemanticError
40192 enum LDKBolt12SemanticError Bolt12SemanticError_missing_creation_time(void);
40195 * Utility method to constructs a new MissingPaymentHash-variant Bolt12SemanticError
40197 enum LDKBolt12SemanticError Bolt12SemanticError_missing_payment_hash(void);
40200 * Utility method to constructs a new MissingSignature-variant Bolt12SemanticError
40202 enum LDKBolt12SemanticError Bolt12SemanticError_missing_signature(void);
40205 * Frees any resources used by the Refund, if is_owned is set and inner is non-NULL.
40207 void Refund_free(struct LDKRefund this_obj);
40210 * Creates a copy of the Refund
40212 struct LDKRefund Refund_clone(const struct LDKRefund *NONNULL_PTR orig);
40215 * A complete description of the purpose of the refund. Intended to be displayed to the user
40216 * but with the caveat that it has not been verified in any way.
40218 MUST_USE_RES struct LDKPrintableString Refund_description(const struct LDKRefund *NONNULL_PTR this_arg);
40221 * Duration since the Unix epoch when an invoice should no longer be sent.
40223 * If `None`, the refund does not expire.
40225 MUST_USE_RES struct LDKCOption_u64Z Refund_absolute_expiry(const struct LDKRefund *NONNULL_PTR this_arg);
40228 * Whether the refund has expired.
40230 MUST_USE_RES bool Refund_is_expired(const struct LDKRefund *NONNULL_PTR this_arg);
40233 * The issuer of the refund, possibly beginning with `user@domain` or `domain`. Intended to be
40234 * displayed to the user but with the caveat that it has not been verified in any way.
40236 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
40238 MUST_USE_RES struct LDKPrintableString Refund_issuer(const struct LDKRefund *NONNULL_PTR this_arg);
40241 * Paths to the sender originating from publicly reachable nodes. Blinded paths provide sender
40242 * privacy by obfuscating its node id.
40244 MUST_USE_RES struct LDKCVec_BlindedPathZ Refund_paths(const struct LDKRefund *NONNULL_PTR this_arg);
40247 * An unpredictable series of bytes, typically containing information about the derivation of
40250 * [`payer_id`]: Self::payer_id
40252 MUST_USE_RES struct LDKu8slice Refund_payer_metadata(const struct LDKRefund *NONNULL_PTR this_arg);
40255 * A chain that the refund is valid for.
40257 MUST_USE_RES struct LDKThirtyTwoBytes Refund_chain(const struct LDKRefund *NONNULL_PTR this_arg);
40260 * The amount to refund in msats (i.e., the minimum lightning-payable unit for [`chain`]).
40262 * [`chain`]: Self::chain
40264 MUST_USE_RES uint64_t Refund_amount_msats(const struct LDKRefund *NONNULL_PTR this_arg);
40267 * Features pertaining to requesting an invoice.
40269 MUST_USE_RES struct LDKInvoiceRequestFeatures Refund_features(const struct LDKRefund *NONNULL_PTR this_arg);
40272 * The quantity of an item that refund is for.
40274 MUST_USE_RES struct LDKCOption_u64Z Refund_quantity(const struct LDKRefund *NONNULL_PTR this_arg);
40277 * A public node id to send to in the case where there are no [`paths`]. Otherwise, a possibly
40278 * transient pubkey.
40280 * [`paths`]: Self::paths
40282 MUST_USE_RES struct LDKPublicKey Refund_payer_id(const struct LDKRefund *NONNULL_PTR this_arg);
40285 * Payer provided note to include in the invoice.
40287 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
40289 MUST_USE_RES struct LDKPrintableString Refund_payer_note(const struct LDKRefund *NONNULL_PTR this_arg);
40292 * Serialize the Refund object into a byte array which can be read by Refund_read
40294 struct LDKCVec_u8Z Refund_write(const struct LDKRefund *NONNULL_PTR obj);
40297 * Read a Refund object from a string
40299 struct LDKCResult_RefundBolt12ParseErrorZ Refund_from_str(struct LDKStr s);
40302 * Creates a copy of the UtxoLookupError
40304 enum LDKUtxoLookupError UtxoLookupError_clone(const enum LDKUtxoLookupError *NONNULL_PTR orig);
40307 * Utility method to constructs a new UnknownChain-variant UtxoLookupError
40309 enum LDKUtxoLookupError UtxoLookupError_unknown_chain(void);
40312 * Utility method to constructs a new UnknownTx-variant UtxoLookupError
40314 enum LDKUtxoLookupError UtxoLookupError_unknown_tx(void);
40317 * Frees any resources used by the UtxoResult
40319 void UtxoResult_free(struct LDKUtxoResult this_ptr);
40322 * Creates a copy of the UtxoResult
40324 struct LDKUtxoResult UtxoResult_clone(const struct LDKUtxoResult *NONNULL_PTR orig);
40327 * Utility method to constructs a new Sync-variant UtxoResult
40329 struct LDKUtxoResult UtxoResult_sync(struct LDKCResult_TxOutUtxoLookupErrorZ a);
40332 * Utility method to constructs a new Async-variant UtxoResult
40334 struct LDKUtxoResult UtxoResult_async(struct LDKUtxoFuture a);
40337 * Calls the free function if one is set
40339 void UtxoLookup_free(struct LDKUtxoLookup this_ptr);
40342 * Frees any resources used by the UtxoFuture, if is_owned is set and inner is non-NULL.
40344 void UtxoFuture_free(struct LDKUtxoFuture this_obj);
40347 * Creates a copy of the UtxoFuture
40349 struct LDKUtxoFuture UtxoFuture_clone(const struct LDKUtxoFuture *NONNULL_PTR orig);
40352 * Builds a new future for later resolution.
40354 MUST_USE_RES struct LDKUtxoFuture UtxoFuture_new(void);
40357 * Resolves this future against the given `graph` and with the given `result`.
40359 * This is identical to calling [`UtxoFuture::resolve`] with a dummy `gossip`, disabling
40360 * forwarding the validated gossip message onwards to peers.
40362 * Because this may cause the [`NetworkGraph`]'s [`processing_queue_high`] to flip, in order
40363 * to allow us to interact with peers again, you should call [`PeerManager::process_events`]
40366 * [`processing_queue_high`]: crate::ln::msgs::RoutingMessageHandler::processing_queue_high
40367 * [`PeerManager::process_events`]: crate::ln::peer_handler::PeerManager::process_events
40369 void UtxoFuture_resolve_without_forwarding(const struct LDKUtxoFuture *NONNULL_PTR this_arg, const struct LDKNetworkGraph *NONNULL_PTR graph, struct LDKCResult_TxOutUtxoLookupErrorZ result);
40372 * Resolves this future against the given `graph` and with the given `result`.
40374 * The given `gossip` is used to broadcast any validated messages onwards to all peers which
40375 * have available buffer space.
40377 * Because this may cause the [`NetworkGraph`]'s [`processing_queue_high`] to flip, in order
40378 * to allow us to interact with peers again, you should call [`PeerManager::process_events`]
40381 * [`processing_queue_high`]: crate::ln::msgs::RoutingMessageHandler::processing_queue_high
40382 * [`PeerManager::process_events`]: crate::ln::peer_handler::PeerManager::process_events
40384 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);
40387 * Frees any resources used by the NodeId, if is_owned is set and inner is non-NULL.
40389 void NodeId_free(struct LDKNodeId this_obj);
40392 * Creates a copy of the NodeId
40394 struct LDKNodeId NodeId_clone(const struct LDKNodeId *NONNULL_PTR orig);
40397 * Create a new NodeId from a public key
40399 MUST_USE_RES struct LDKNodeId NodeId_from_pubkey(struct LDKPublicKey pubkey);
40402 * Get the public key slice from this NodeId
40404 MUST_USE_RES struct LDKu8slice NodeId_as_slice(const struct LDKNodeId *NONNULL_PTR this_arg);
40407 * Get the public key from this NodeId
40409 MUST_USE_RES struct LDKCResult_PublicKeySecp256k1ErrorZ NodeId_as_pubkey(const struct LDKNodeId *NONNULL_PTR this_arg);
40412 * Generates a non-cryptographic 64-bit hash of the NodeId.
40414 uint64_t NodeId_hash(const struct LDKNodeId *NONNULL_PTR o);
40417 * Serialize the NodeId object into a byte array which can be read by NodeId_read
40419 struct LDKCVec_u8Z NodeId_write(const struct LDKNodeId *NONNULL_PTR obj);
40422 * Read a NodeId from a byte array, created by NodeId_write
40424 struct LDKCResult_NodeIdDecodeErrorZ NodeId_read(struct LDKu8slice ser);
40427 * Frees any resources used by the NetworkGraph, if is_owned is set and inner is non-NULL.
40429 void NetworkGraph_free(struct LDKNetworkGraph this_obj);
40432 * Frees any resources used by the ReadOnlyNetworkGraph, if is_owned is set and inner is non-NULL.
40434 void ReadOnlyNetworkGraph_free(struct LDKReadOnlyNetworkGraph this_obj);
40437 * Frees any resources used by the NetworkUpdate
40439 void NetworkUpdate_free(struct LDKNetworkUpdate this_ptr);
40442 * Creates a copy of the NetworkUpdate
40444 struct LDKNetworkUpdate NetworkUpdate_clone(const struct LDKNetworkUpdate *NONNULL_PTR orig);
40447 * Utility method to constructs a new ChannelUpdateMessage-variant NetworkUpdate
40449 struct LDKNetworkUpdate NetworkUpdate_channel_update_message(struct LDKChannelUpdate msg);
40452 * Utility method to constructs a new ChannelFailure-variant NetworkUpdate
40454 struct LDKNetworkUpdate NetworkUpdate_channel_failure(uint64_t short_channel_id, bool is_permanent);
40457 * Utility method to constructs a new NodeFailure-variant NetworkUpdate
40459 struct LDKNetworkUpdate NetworkUpdate_node_failure(struct LDKPublicKey node_id, bool is_permanent);
40462 * Checks if two NetworkUpdates contain equal inner contents.
40463 * This ignores pointers and is_owned flags and looks at the values in fields.
40465 bool NetworkUpdate_eq(const struct LDKNetworkUpdate *NONNULL_PTR a, const struct LDKNetworkUpdate *NONNULL_PTR b);
40468 * Serialize the NetworkUpdate object into a byte array which can be read by NetworkUpdate_read
40470 struct LDKCVec_u8Z NetworkUpdate_write(const struct LDKNetworkUpdate *NONNULL_PTR obj);
40473 * Read a NetworkUpdate from a byte array, created by NetworkUpdate_write
40475 struct LDKCResult_COption_NetworkUpdateZDecodeErrorZ NetworkUpdate_read(struct LDKu8slice ser);
40478 * Frees any resources used by the P2PGossipSync, if is_owned is set and inner is non-NULL.
40480 void P2PGossipSync_free(struct LDKP2PGossipSync this_obj);
40483 * Creates a new tracker of the actual state of the network of channels and nodes,
40484 * assuming an existing [`NetworkGraph`].
40485 * UTXO lookup is used to make sure announced channels exist on-chain, channel data is
40486 * correct, and the announcement is signed with channel owners' keys.
40488 MUST_USE_RES struct LDKP2PGossipSync P2PGossipSync_new(const struct LDKNetworkGraph *NONNULL_PTR network_graph, struct LDKCOption_UtxoLookupZ utxo_lookup, struct LDKLogger logger);
40491 * Adds a provider used to check new announcements. Does not affect
40492 * existing announcements unless they are updated.
40493 * Add, update or remove the provider would replace the current one.
40495 void P2PGossipSync_add_utxo_lookup(const struct LDKP2PGossipSync *NONNULL_PTR this_arg, struct LDKCOption_UtxoLookupZ utxo_lookup);
40498 * Handles any network updates originating from [`Event`]s.
40500 * [`Event`]: crate::events::Event
40502 void NetworkGraph_handle_network_update(const struct LDKNetworkGraph *NONNULL_PTR this_arg, const struct LDKNetworkUpdate *NONNULL_PTR network_update);
40505 * Gets the genesis hash for this network graph.
40507 MUST_USE_RES struct LDKThirtyTwoBytes NetworkGraph_get_genesis_hash(const struct LDKNetworkGraph *NONNULL_PTR this_arg);
40510 * Verifies the signature of a [`NodeAnnouncement`].
40512 * Returns an error if it is invalid.
40514 struct LDKCResult_NoneLightningErrorZ verify_node_announcement(const struct LDKNodeAnnouncement *NONNULL_PTR msg);
40517 * Verifies all signatures included in a [`ChannelAnnouncement`].
40519 * Returns an error if one of the signatures is invalid.
40521 struct LDKCResult_NoneLightningErrorZ verify_channel_announcement(const struct LDKChannelAnnouncement *NONNULL_PTR msg);
40524 * Constructs a new RoutingMessageHandler which calls the relevant methods on this_arg.
40525 * This copies the `inner` pointer in this_arg and thus the returned RoutingMessageHandler must be freed before this_arg is
40527 struct LDKRoutingMessageHandler P2PGossipSync_as_RoutingMessageHandler(const struct LDKP2PGossipSync *NONNULL_PTR this_arg);
40530 * Constructs a new MessageSendEventsProvider which calls the relevant methods on this_arg.
40531 * This copies the `inner` pointer in this_arg and thus the returned MessageSendEventsProvider must be freed before this_arg is
40533 struct LDKMessageSendEventsProvider P2PGossipSync_as_MessageSendEventsProvider(const struct LDKP2PGossipSync *NONNULL_PTR this_arg);
40536 * Frees any resources used by the ChannelUpdateInfo, if is_owned is set and inner is non-NULL.
40538 void ChannelUpdateInfo_free(struct LDKChannelUpdateInfo this_obj);
40541 * When the last update to the channel direction was issued.
40542 * Value is opaque, as set in the announcement.
40544 uint32_t ChannelUpdateInfo_get_last_update(const struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr);
40547 * When the last update to the channel direction was issued.
40548 * Value is opaque, as set in the announcement.
40550 void ChannelUpdateInfo_set_last_update(struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr, uint32_t val);
40553 * Whether the channel can be currently used for payments (in this one direction).
40555 bool ChannelUpdateInfo_get_enabled(const struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr);
40558 * Whether the channel can be currently used for payments (in this one direction).
40560 void ChannelUpdateInfo_set_enabled(struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr, bool val);
40563 * The difference in CLTV values that you must have when routing through this channel.
40565 uint16_t ChannelUpdateInfo_get_cltv_expiry_delta(const struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr);
40568 * The difference in CLTV values that you must have when routing through this channel.
40570 void ChannelUpdateInfo_set_cltv_expiry_delta(struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr, uint16_t val);
40573 * The minimum value, which must be relayed to the next hop via the channel
40575 uint64_t ChannelUpdateInfo_get_htlc_minimum_msat(const struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr);
40578 * The minimum value, which must be relayed to the next hop via the channel
40580 void ChannelUpdateInfo_set_htlc_minimum_msat(struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr, uint64_t val);
40583 * The maximum value which may be relayed to the next hop via the channel.
40585 uint64_t ChannelUpdateInfo_get_htlc_maximum_msat(const struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr);
40588 * The maximum value which may be relayed to the next hop via the channel.
40590 void ChannelUpdateInfo_set_htlc_maximum_msat(struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr, uint64_t val);
40593 * Fees charged when the channel is used for routing
40595 struct LDKRoutingFees ChannelUpdateInfo_get_fees(const struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr);
40598 * Fees charged when the channel is used for routing
40600 void ChannelUpdateInfo_set_fees(struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr, struct LDKRoutingFees val);
40603 * Most recent update for the channel received from the network
40604 * Mostly redundant with the data we store in fields explicitly.
40605 * Everything else is useful only for sending out for initial routing sync.
40606 * Not stored if contains excess data to prevent DoS.
40608 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
40610 struct LDKChannelUpdate ChannelUpdateInfo_get_last_update_message(const struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr);
40613 * Most recent update for the channel received from the network
40614 * Mostly redundant with the data we store in fields explicitly.
40615 * Everything else is useful only for sending out for initial routing sync.
40616 * Not stored if contains excess data to prevent DoS.
40618 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
40620 void ChannelUpdateInfo_set_last_update_message(struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr, struct LDKChannelUpdate val);
40623 * Constructs a new ChannelUpdateInfo given each field
40625 * Note that last_update_message_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
40627 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);
40630 * Creates a copy of the ChannelUpdateInfo
40632 struct LDKChannelUpdateInfo ChannelUpdateInfo_clone(const struct LDKChannelUpdateInfo *NONNULL_PTR orig);
40635 * Checks if two ChannelUpdateInfos contain equal inner contents.
40636 * This ignores pointers and is_owned flags and looks at the values in fields.
40637 * Two objects with NULL inner values will be considered "equal" here.
40639 bool ChannelUpdateInfo_eq(const struct LDKChannelUpdateInfo *NONNULL_PTR a, const struct LDKChannelUpdateInfo *NONNULL_PTR b);
40642 * Serialize the ChannelUpdateInfo object into a byte array which can be read by ChannelUpdateInfo_read
40644 struct LDKCVec_u8Z ChannelUpdateInfo_write(const struct LDKChannelUpdateInfo *NONNULL_PTR obj);
40647 * Read a ChannelUpdateInfo from a byte array, created by ChannelUpdateInfo_write
40649 struct LDKCResult_ChannelUpdateInfoDecodeErrorZ ChannelUpdateInfo_read(struct LDKu8slice ser);
40652 * Frees any resources used by the ChannelInfo, if is_owned is set and inner is non-NULL.
40654 void ChannelInfo_free(struct LDKChannelInfo this_obj);
40657 * Protocol features of a channel communicated during its announcement
40659 struct LDKChannelFeatures ChannelInfo_get_features(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
40662 * Protocol features of a channel communicated during its announcement
40664 void ChannelInfo_set_features(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKChannelFeatures val);
40667 * Source node of the first direction of a channel
40669 struct LDKNodeId ChannelInfo_get_node_one(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
40672 * Source node of the first direction of a channel
40674 void ChannelInfo_set_node_one(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKNodeId val);
40677 * Details about the first direction of a channel
40679 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
40681 struct LDKChannelUpdateInfo ChannelInfo_get_one_to_two(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
40684 * Details about the first direction of a channel
40686 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
40688 void ChannelInfo_set_one_to_two(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKChannelUpdateInfo val);
40691 * Source node of the second direction of a channel
40693 struct LDKNodeId ChannelInfo_get_node_two(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
40696 * Source node of the second direction of a channel
40698 void ChannelInfo_set_node_two(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKNodeId val);
40701 * Details about the second direction of a channel
40703 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
40705 struct LDKChannelUpdateInfo ChannelInfo_get_two_to_one(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
40708 * Details about the second direction of a channel
40710 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
40712 void ChannelInfo_set_two_to_one(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKChannelUpdateInfo val);
40715 * The channel capacity as seen on-chain, if chain lookup is available.
40717 struct LDKCOption_u64Z ChannelInfo_get_capacity_sats(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
40720 * The channel capacity as seen on-chain, if chain lookup is available.
40722 void ChannelInfo_set_capacity_sats(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
40725 * An initial announcement of the channel
40726 * Mostly redundant with the data we store in fields explicitly.
40727 * Everything else is useful only for sending out for initial routing sync.
40728 * Not stored if contains excess data to prevent DoS.
40730 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
40732 struct LDKChannelAnnouncement ChannelInfo_get_announcement_message(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
40735 * An initial announcement of the channel
40736 * Mostly redundant with the data we store in fields explicitly.
40737 * Everything else is useful only for sending out for initial routing sync.
40738 * Not stored if contains excess data to prevent DoS.
40740 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
40742 void ChannelInfo_set_announcement_message(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKChannelAnnouncement val);
40745 * Creates a copy of the ChannelInfo
40747 struct LDKChannelInfo ChannelInfo_clone(const struct LDKChannelInfo *NONNULL_PTR orig);
40750 * Checks if two ChannelInfos contain equal inner contents.
40751 * This ignores pointers and is_owned flags and looks at the values in fields.
40752 * Two objects with NULL inner values will be considered "equal" here.
40754 bool ChannelInfo_eq(const struct LDKChannelInfo *NONNULL_PTR a, const struct LDKChannelInfo *NONNULL_PTR b);
40757 * Returns a [`ChannelUpdateInfo`] based on the direction implied by the channel_flag.
40759 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
40761 MUST_USE_RES struct LDKChannelUpdateInfo ChannelInfo_get_directional_info(const struct LDKChannelInfo *NONNULL_PTR this_arg, uint8_t channel_flags);
40764 * Serialize the ChannelInfo object into a byte array which can be read by ChannelInfo_read
40766 struct LDKCVec_u8Z ChannelInfo_write(const struct LDKChannelInfo *NONNULL_PTR obj);
40769 * Read a ChannelInfo from a byte array, created by ChannelInfo_write
40771 struct LDKCResult_ChannelInfoDecodeErrorZ ChannelInfo_read(struct LDKu8slice ser);
40774 * Frees any resources used by the DirectedChannelInfo, if is_owned is set and inner is non-NULL.
40776 void DirectedChannelInfo_free(struct LDKDirectedChannelInfo this_obj);
40779 * Creates a copy of the DirectedChannelInfo
40781 struct LDKDirectedChannelInfo DirectedChannelInfo_clone(const struct LDKDirectedChannelInfo *NONNULL_PTR orig);
40784 * Returns information for the channel.
40786 MUST_USE_RES struct LDKChannelInfo DirectedChannelInfo_channel(const struct LDKDirectedChannelInfo *NONNULL_PTR this_arg);
40789 * Returns the maximum HTLC amount allowed over the channel in the direction.
40791 MUST_USE_RES uint64_t DirectedChannelInfo_htlc_maximum_msat(const struct LDKDirectedChannelInfo *NONNULL_PTR this_arg);
40794 * Returns the [`EffectiveCapacity`] of the channel in the direction.
40796 * This is either the total capacity from the funding transaction, if known, or the
40797 * `htlc_maximum_msat` for the direction as advertised by the gossip network, if known,
40800 MUST_USE_RES struct LDKEffectiveCapacity DirectedChannelInfo_effective_capacity(const struct LDKDirectedChannelInfo *NONNULL_PTR this_arg);
40803 * Frees any resources used by the EffectiveCapacity
40805 void EffectiveCapacity_free(struct LDKEffectiveCapacity this_ptr);
40808 * Creates a copy of the EffectiveCapacity
40810 struct LDKEffectiveCapacity EffectiveCapacity_clone(const struct LDKEffectiveCapacity *NONNULL_PTR orig);
40813 * Utility method to constructs a new ExactLiquidity-variant EffectiveCapacity
40815 struct LDKEffectiveCapacity EffectiveCapacity_exact_liquidity(uint64_t liquidity_msat);
40818 * Utility method to constructs a new AdvertisedMaxHTLC-variant EffectiveCapacity
40820 struct LDKEffectiveCapacity EffectiveCapacity_advertised_max_htlc(uint64_t amount_msat);
40823 * Utility method to constructs a new Total-variant EffectiveCapacity
40825 struct LDKEffectiveCapacity EffectiveCapacity_total(uint64_t capacity_msat, uint64_t htlc_maximum_msat);
40828 * Utility method to constructs a new Infinite-variant EffectiveCapacity
40830 struct LDKEffectiveCapacity EffectiveCapacity_infinite(void);
40833 * Utility method to constructs a new HintMaxHTLC-variant EffectiveCapacity
40835 struct LDKEffectiveCapacity EffectiveCapacity_hint_max_htlc(uint64_t amount_msat);
40838 * Utility method to constructs a new Unknown-variant EffectiveCapacity
40840 struct LDKEffectiveCapacity EffectiveCapacity_unknown(void);
40843 * Returns the effective capacity denominated in millisatoshi.
40845 MUST_USE_RES uint64_t EffectiveCapacity_as_msat(const struct LDKEffectiveCapacity *NONNULL_PTR this_arg);
40848 * Frees any resources used by the RoutingFees, if is_owned is set and inner is non-NULL.
40850 void RoutingFees_free(struct LDKRoutingFees this_obj);
40853 * Flat routing fee in millisatoshis.
40855 uint32_t RoutingFees_get_base_msat(const struct LDKRoutingFees *NONNULL_PTR this_ptr);
40858 * Flat routing fee in millisatoshis.
40860 void RoutingFees_set_base_msat(struct LDKRoutingFees *NONNULL_PTR this_ptr, uint32_t val);
40863 * Liquidity-based routing fee in millionths of a routed amount.
40864 * In other words, 10000 is 1%.
40866 uint32_t RoutingFees_get_proportional_millionths(const struct LDKRoutingFees *NONNULL_PTR this_ptr);
40869 * Liquidity-based routing fee in millionths of a routed amount.
40870 * In other words, 10000 is 1%.
40872 void RoutingFees_set_proportional_millionths(struct LDKRoutingFees *NONNULL_PTR this_ptr, uint32_t val);
40875 * Constructs a new RoutingFees given each field
40877 MUST_USE_RES struct LDKRoutingFees RoutingFees_new(uint32_t base_msat_arg, uint32_t proportional_millionths_arg);
40880 * Checks if two RoutingFeess contain equal inner contents.
40881 * This ignores pointers and is_owned flags and looks at the values in fields.
40882 * Two objects with NULL inner values will be considered "equal" here.
40884 bool RoutingFees_eq(const struct LDKRoutingFees *NONNULL_PTR a, const struct LDKRoutingFees *NONNULL_PTR b);
40887 * Creates a copy of the RoutingFees
40889 struct LDKRoutingFees RoutingFees_clone(const struct LDKRoutingFees *NONNULL_PTR orig);
40892 * Generates a non-cryptographic 64-bit hash of the RoutingFees.
40894 uint64_t RoutingFees_hash(const struct LDKRoutingFees *NONNULL_PTR o);
40897 * Serialize the RoutingFees object into a byte array which can be read by RoutingFees_read
40899 struct LDKCVec_u8Z RoutingFees_write(const struct LDKRoutingFees *NONNULL_PTR obj);
40902 * Read a RoutingFees from a byte array, created by RoutingFees_write
40904 struct LDKCResult_RoutingFeesDecodeErrorZ RoutingFees_read(struct LDKu8slice ser);
40907 * Frees any resources used by the NodeAnnouncementInfo, if is_owned is set and inner is non-NULL.
40909 void NodeAnnouncementInfo_free(struct LDKNodeAnnouncementInfo this_obj);
40912 * Protocol features the node announced support for
40914 struct LDKNodeFeatures NodeAnnouncementInfo_get_features(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr);
40917 * Protocol features the node announced support for
40919 void NodeAnnouncementInfo_set_features(struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr, struct LDKNodeFeatures val);
40922 * When the last known update to the node state was issued.
40923 * Value is opaque, as set in the announcement.
40925 uint32_t NodeAnnouncementInfo_get_last_update(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr);
40928 * When the last known update to the node state was issued.
40929 * Value is opaque, as set in the announcement.
40931 void NodeAnnouncementInfo_set_last_update(struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr, uint32_t val);
40934 * Color assigned to the node
40936 const uint8_t (*NodeAnnouncementInfo_get_rgb(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr))[3];
40939 * Color assigned to the node
40941 void NodeAnnouncementInfo_set_rgb(struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr, struct LDKThreeBytes val);
40944 * Moniker assigned to the node.
40945 * May be invalid or malicious (eg control chars),
40946 * should not be exposed to the user.
40948 struct LDKNodeAlias NodeAnnouncementInfo_get_alias(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr);
40951 * Moniker assigned to the node.
40952 * May be invalid or malicious (eg control chars),
40953 * should not be exposed to the user.
40955 void NodeAnnouncementInfo_set_alias(struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr, struct LDKNodeAlias val);
40958 * An initial announcement of the node
40959 * Mostly redundant with the data we store in fields explicitly.
40960 * Everything else is useful only for sending out for initial routing sync.
40961 * Not stored if contains excess data to prevent DoS.
40963 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
40965 struct LDKNodeAnnouncement NodeAnnouncementInfo_get_announcement_message(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr);
40968 * An initial announcement of the node
40969 * Mostly redundant with the data we store in fields explicitly.
40970 * Everything else is useful only for sending out for initial routing sync.
40971 * Not stored if contains excess data to prevent DoS.
40973 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
40975 void NodeAnnouncementInfo_set_announcement_message(struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr, struct LDKNodeAnnouncement val);
40978 * Constructs a new NodeAnnouncementInfo given each field
40980 * Note that announcement_message_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
40982 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);
40985 * Creates a copy of the NodeAnnouncementInfo
40987 struct LDKNodeAnnouncementInfo NodeAnnouncementInfo_clone(const struct LDKNodeAnnouncementInfo *NONNULL_PTR orig);
40990 * Checks if two NodeAnnouncementInfos contain equal inner contents.
40991 * This ignores pointers and is_owned flags and looks at the values in fields.
40992 * Two objects with NULL inner values will be considered "equal" here.
40994 bool NodeAnnouncementInfo_eq(const struct LDKNodeAnnouncementInfo *NONNULL_PTR a, const struct LDKNodeAnnouncementInfo *NONNULL_PTR b);
40997 * Internet-level addresses via which one can connect to the node
40999 MUST_USE_RES struct LDKCVec_SocketAddressZ NodeAnnouncementInfo_addresses(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_arg);
41002 * Serialize the NodeAnnouncementInfo object into a byte array which can be read by NodeAnnouncementInfo_read
41004 struct LDKCVec_u8Z NodeAnnouncementInfo_write(const struct LDKNodeAnnouncementInfo *NONNULL_PTR obj);
41007 * Read a NodeAnnouncementInfo from a byte array, created by NodeAnnouncementInfo_write
41009 struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ NodeAnnouncementInfo_read(struct LDKu8slice ser);
41012 * Frees any resources used by the NodeAlias, if is_owned is set and inner is non-NULL.
41014 void NodeAlias_free(struct LDKNodeAlias this_obj);
41016 const uint8_t (*NodeAlias_get_a(const struct LDKNodeAlias *NONNULL_PTR this_ptr))[32];
41018 void NodeAlias_set_a(struct LDKNodeAlias *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
41021 * Constructs a new NodeAlias given each field
41023 MUST_USE_RES struct LDKNodeAlias NodeAlias_new(struct LDKThirtyTwoBytes a_arg);
41026 * Creates a copy of the NodeAlias
41028 struct LDKNodeAlias NodeAlias_clone(const struct LDKNodeAlias *NONNULL_PTR orig);
41031 * Checks if two NodeAliass contain equal inner contents.
41032 * This ignores pointers and is_owned flags and looks at the values in fields.
41033 * Two objects with NULL inner values will be considered "equal" here.
41035 bool NodeAlias_eq(const struct LDKNodeAlias *NONNULL_PTR a, const struct LDKNodeAlias *NONNULL_PTR b);
41038 * Serialize the NodeAlias object into a byte array which can be read by NodeAlias_read
41040 struct LDKCVec_u8Z NodeAlias_write(const struct LDKNodeAlias *NONNULL_PTR obj);
41043 * Read a NodeAlias from a byte array, created by NodeAlias_write
41045 struct LDKCResult_NodeAliasDecodeErrorZ NodeAlias_read(struct LDKu8slice ser);
41048 * Frees any resources used by the NodeInfo, if is_owned is set and inner is non-NULL.
41050 void NodeInfo_free(struct LDKNodeInfo this_obj);
41053 * All valid channels a node has announced
41055 * Returns a copy of the field.
41057 struct LDKCVec_u64Z NodeInfo_get_channels(const struct LDKNodeInfo *NONNULL_PTR this_ptr);
41060 * All valid channels a node has announced
41062 void NodeInfo_set_channels(struct LDKNodeInfo *NONNULL_PTR this_ptr, struct LDKCVec_u64Z val);
41065 * More information about a node from node_announcement.
41066 * Optional because we store a Node entry after learning about it from
41067 * a channel announcement, but before receiving a node announcement.
41069 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
41071 struct LDKNodeAnnouncementInfo NodeInfo_get_announcement_info(const struct LDKNodeInfo *NONNULL_PTR this_ptr);
41074 * More information about a node from node_announcement.
41075 * Optional because we store a Node entry after learning about it from
41076 * a channel announcement, but before receiving a node announcement.
41078 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
41080 void NodeInfo_set_announcement_info(struct LDKNodeInfo *NONNULL_PTR this_ptr, struct LDKNodeAnnouncementInfo val);
41083 * Constructs a new NodeInfo given each field
41085 * Note that announcement_info_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
41087 MUST_USE_RES struct LDKNodeInfo NodeInfo_new(struct LDKCVec_u64Z channels_arg, struct LDKNodeAnnouncementInfo announcement_info_arg);
41090 * Creates a copy of the NodeInfo
41092 struct LDKNodeInfo NodeInfo_clone(const struct LDKNodeInfo *NONNULL_PTR orig);
41095 * Checks if two NodeInfos contain equal inner contents.
41096 * This ignores pointers and is_owned flags and looks at the values in fields.
41097 * Two objects with NULL inner values will be considered "equal" here.
41099 bool NodeInfo_eq(const struct LDKNodeInfo *NONNULL_PTR a, const struct LDKNodeInfo *NONNULL_PTR b);
41102 * Serialize the NodeInfo object into a byte array which can be read by NodeInfo_read
41104 struct LDKCVec_u8Z NodeInfo_write(const struct LDKNodeInfo *NONNULL_PTR obj);
41107 * Read a NodeInfo from a byte array, created by NodeInfo_write
41109 struct LDKCResult_NodeInfoDecodeErrorZ NodeInfo_read(struct LDKu8slice ser);
41112 * Serialize the NetworkGraph object into a byte array which can be read by NetworkGraph_read
41114 struct LDKCVec_u8Z NetworkGraph_write(const struct LDKNetworkGraph *NONNULL_PTR obj);
41117 * Read a NetworkGraph from a byte array, created by NetworkGraph_write
41119 struct LDKCResult_NetworkGraphDecodeErrorZ NetworkGraph_read(struct LDKu8slice ser, struct LDKLogger arg);
41122 * Creates a new, empty, network graph.
41124 MUST_USE_RES struct LDKNetworkGraph NetworkGraph_new(enum LDKNetwork network, struct LDKLogger logger);
41127 * Returns a read-only view of the network graph.
41129 MUST_USE_RES struct LDKReadOnlyNetworkGraph NetworkGraph_read_only(const struct LDKNetworkGraph *NONNULL_PTR this_arg);
41132 * The unix timestamp provided by the most recent rapid gossip sync.
41133 * It will be set by the rapid sync process after every sync completion.
41135 MUST_USE_RES struct LDKCOption_u32Z NetworkGraph_get_last_rapid_gossip_sync_timestamp(const struct LDKNetworkGraph *NONNULL_PTR this_arg);
41138 * Update the unix timestamp provided by the most recent rapid gossip sync.
41139 * This should be done automatically by the rapid sync process after every sync completion.
41141 void NetworkGraph_set_last_rapid_gossip_sync_timestamp(const struct LDKNetworkGraph *NONNULL_PTR this_arg, uint32_t last_rapid_gossip_sync_timestamp);
41144 * For an already known node (from channel announcements), update its stored properties from a
41145 * given node announcement.
41147 * You probably don't want to call this directly, instead relying on a P2PGossipSync's
41148 * RoutingMessageHandler implementation to call it indirectly. This may be useful to accept
41149 * routing messages from a source using a protocol other than the lightning P2P protocol.
41151 MUST_USE_RES struct LDKCResult_NoneLightningErrorZ NetworkGraph_update_node_from_announcement(const struct LDKNetworkGraph *NONNULL_PTR this_arg, const struct LDKNodeAnnouncement *NONNULL_PTR msg);
41154 * For an already known node (from channel announcements), update its stored properties from a
41155 * given node announcement without verifying the associated signatures. Because we aren't
41156 * given the associated signatures here we cannot relay the node announcement to any of our
41159 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);
41162 * Store or update channel info from a channel announcement.
41164 * You probably don't want to call this directly, instead relying on a [`P2PGossipSync`]'s
41165 * [`RoutingMessageHandler`] implementation to call it indirectly. This may be useful to accept
41166 * routing messages from a source using a protocol other than the lightning P2P protocol.
41168 * If a [`UtxoLookup`] object is provided via `utxo_lookup`, it will be called to verify
41169 * the corresponding UTXO exists on chain and is correctly-formatted.
41171 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);
41174 * Store or update channel info from a channel announcement.
41176 * You probably don't want to call this directly, instead relying on a [`P2PGossipSync`]'s
41177 * [`RoutingMessageHandler`] implementation to call it indirectly. This may be useful to accept
41178 * routing messages from a source using a protocol other than the lightning P2P protocol.
41180 * This will skip verification of if the channel is actually on-chain.
41182 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);
41185 * Store or update channel info from a channel announcement without verifying the associated
41186 * signatures. Because we aren't given the associated signatures here we cannot relay the
41187 * channel announcement to any of our peers.
41189 * If a [`UtxoLookup`] object is provided via `utxo_lookup`, it will be called to verify
41190 * the corresponding UTXO exists on chain and is correctly-formatted.
41192 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);
41195 * Update channel from partial announcement data received via rapid gossip sync
41197 * `timestamp: u64`: Timestamp emulating the backdated original announcement receipt (by the
41198 * rapid gossip sync server)
41200 * All other parameters as used in [`msgs::UnsignedChannelAnnouncement`] fields.
41202 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);
41205 * Marks a channel in the graph as failed permanently.
41207 * The channel and any node for which this was their last channel are removed from the graph.
41209 void NetworkGraph_channel_failed_permanent(const struct LDKNetworkGraph *NONNULL_PTR this_arg, uint64_t short_channel_id);
41212 * Marks a node in the graph as permanently failed, effectively removing it and its channels
41213 * from local storage.
41215 void NetworkGraph_node_failed_permanent(const struct LDKNetworkGraph *NONNULL_PTR this_arg, struct LDKPublicKey node_id);
41218 * Removes information about channels that we haven't heard any updates about in some time.
41219 * This can be used regularly to prune the network graph of channels that likely no longer
41222 * While there is no formal requirement that nodes regularly re-broadcast their channel
41223 * updates every two weeks, the non-normative section of BOLT 7 currently suggests that
41224 * pruning occur for updates which are at least two weeks old, which we implement here.
41226 * Note that for users of the `lightning-background-processor` crate this method may be
41227 * automatically called regularly for you.
41229 * This method will also cause us to stop tracking removed nodes and channels if they have been
41230 * in the map for a while so that these can be resynced from gossip in the future.
41232 * This method is only available with the `std` feature. See
41233 * [`NetworkGraph::remove_stale_channels_and_tracking_with_time`] for `no-std` use.
41235 void NetworkGraph_remove_stale_channels_and_tracking(const struct LDKNetworkGraph *NONNULL_PTR this_arg);
41238 * Removes information about channels that we haven't heard any updates about in some time.
41239 * This can be used regularly to prune the network graph of channels that likely no longer
41242 * While there is no formal requirement that nodes regularly re-broadcast their channel
41243 * updates every two weeks, the non-normative section of BOLT 7 currently suggests that
41244 * pruning occur for updates which are at least two weeks old, which we implement here.
41246 * This method will also cause us to stop tracking removed nodes and channels if they have been
41247 * in the map for a while so that these can be resynced from gossip in the future.
41249 * This function takes the current unix time as an argument. For users with the `std` feature
41250 * enabled, [`NetworkGraph::remove_stale_channels_and_tracking`] may be preferable.
41252 void NetworkGraph_remove_stale_channels_and_tracking_with_time(const struct LDKNetworkGraph *NONNULL_PTR this_arg, uint64_t current_time_unix);
41255 * For an already known (from announcement) channel, update info about one of the directions
41258 * You probably don't want to call this directly, instead relying on a P2PGossipSync's
41259 * RoutingMessageHandler implementation to call it indirectly. This may be useful to accept
41260 * routing messages from a source using a protocol other than the lightning P2P protocol.
41262 * If built with `no-std`, any updates with a timestamp more than two weeks in the past or
41263 * materially in the future will be rejected.
41265 MUST_USE_RES struct LDKCResult_NoneLightningErrorZ NetworkGraph_update_channel(const struct LDKNetworkGraph *NONNULL_PTR this_arg, const struct LDKChannelUpdate *NONNULL_PTR msg);
41268 * For an already known (from announcement) channel, update info about one of the directions
41269 * of the channel without verifying the associated signatures. Because we aren't given the
41270 * associated signatures here we cannot relay the channel update to any of our peers.
41272 * If built with `no-std`, any updates with a timestamp more than two weeks in the past or
41273 * materially in the future will be rejected.
41275 MUST_USE_RES struct LDKCResult_NoneLightningErrorZ NetworkGraph_update_channel_unsigned(const struct LDKNetworkGraph *NONNULL_PTR this_arg, const struct LDKUnsignedChannelUpdate *NONNULL_PTR msg);
41278 * Returns information on a channel with the given id.
41280 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
41282 MUST_USE_RES struct LDKChannelInfo ReadOnlyNetworkGraph_channel(const struct LDKReadOnlyNetworkGraph *NONNULL_PTR this_arg, uint64_t short_channel_id);
41285 * Returns the list of channels in the graph
41287 MUST_USE_RES struct LDKCVec_u64Z ReadOnlyNetworkGraph_list_channels(const struct LDKReadOnlyNetworkGraph *NONNULL_PTR this_arg);
41290 * Returns information on a node with the given id.
41292 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
41294 MUST_USE_RES struct LDKNodeInfo ReadOnlyNetworkGraph_node(const struct LDKReadOnlyNetworkGraph *NONNULL_PTR this_arg, const struct LDKNodeId *NONNULL_PTR node_id);
41297 * Returns the list of nodes in the graph
41299 MUST_USE_RES struct LDKCVec_NodeIdZ ReadOnlyNetworkGraph_list_nodes(const struct LDKReadOnlyNetworkGraph *NONNULL_PTR this_arg);
41302 * Get network addresses by node id.
41303 * Returns None if the requested node is completely unknown,
41304 * or if node announcement for the node was never received.
41306 MUST_USE_RES struct LDKCOption_CVec_SocketAddressZZ ReadOnlyNetworkGraph_get_addresses(const struct LDKReadOnlyNetworkGraph *NONNULL_PTR this_arg, struct LDKPublicKey pubkey);
41309 * Frees any resources used by the DefaultRouter, if is_owned is set and inner is non-NULL.
41311 void DefaultRouter_free(struct LDKDefaultRouter this_obj);
41314 * Creates a new router.
41316 MUST_USE_RES struct LDKDefaultRouter DefaultRouter_new(const struct LDKNetworkGraph *NONNULL_PTR network_graph, struct LDKLogger logger, struct LDKThirtyTwoBytes random_seed_bytes, struct LDKLockableScore scorer, struct LDKProbabilisticScoringFeeParameters score_params);
41319 * Constructs a new Router which calls the relevant methods on this_arg.
41320 * This copies the `inner` pointer in this_arg and thus the returned Router must be freed before this_arg is
41322 struct LDKRouter DefaultRouter_as_Router(const struct LDKDefaultRouter *NONNULL_PTR this_arg);
41325 * Calls the free function if one is set
41327 void Router_free(struct LDKRouter this_ptr);
41330 * Frees any resources used by the ScorerAccountingForInFlightHtlcs, if is_owned is set and inner is non-NULL.
41332 void ScorerAccountingForInFlightHtlcs_free(struct LDKScorerAccountingForInFlightHtlcs this_obj);
41335 * Initialize a new `ScorerAccountingForInFlightHtlcs`.
41337 MUST_USE_RES struct LDKScorerAccountingForInFlightHtlcs ScorerAccountingForInFlightHtlcs_new(struct LDKScoreLookUp scorer, const struct LDKInFlightHtlcs *NONNULL_PTR inflight_htlcs);
41340 * Constructs a new ScoreLookUp which calls the relevant methods on this_arg.
41341 * This copies the `inner` pointer in this_arg and thus the returned ScoreLookUp must be freed before this_arg is
41343 struct LDKScoreLookUp ScorerAccountingForInFlightHtlcs_as_ScoreLookUp(const struct LDKScorerAccountingForInFlightHtlcs *NONNULL_PTR this_arg);
41346 * Frees any resources used by the InFlightHtlcs, if is_owned is set and inner is non-NULL.
41348 void InFlightHtlcs_free(struct LDKInFlightHtlcs this_obj);
41351 * Creates a copy of the InFlightHtlcs
41353 struct LDKInFlightHtlcs InFlightHtlcs_clone(const struct LDKInFlightHtlcs *NONNULL_PTR orig);
41356 * Constructs an empty `InFlightHtlcs`.
41358 MUST_USE_RES struct LDKInFlightHtlcs InFlightHtlcs_new(void);
41361 * Takes in a path with payer's node id and adds the path's details to `InFlightHtlcs`.
41363 void InFlightHtlcs_process_path(struct LDKInFlightHtlcs *NONNULL_PTR this_arg, const struct LDKPath *NONNULL_PTR path, struct LDKPublicKey payer_node_id);
41366 * Adds a known HTLC given the public key of the HTLC source, target, and short channel
41369 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);
41372 * Returns liquidity in msat given the public key of the HTLC source, target, and short channel
41375 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);
41378 * Serialize the InFlightHtlcs object into a byte array which can be read by InFlightHtlcs_read
41380 struct LDKCVec_u8Z InFlightHtlcs_write(const struct LDKInFlightHtlcs *NONNULL_PTR obj);
41383 * Read a InFlightHtlcs from a byte array, created by InFlightHtlcs_write
41385 struct LDKCResult_InFlightHtlcsDecodeErrorZ InFlightHtlcs_read(struct LDKu8slice ser);
41388 * Frees any resources used by the RouteHop, if is_owned is set and inner is non-NULL.
41390 void RouteHop_free(struct LDKRouteHop this_obj);
41393 * The node_id of the node at this hop.
41395 struct LDKPublicKey RouteHop_get_pubkey(const struct LDKRouteHop *NONNULL_PTR this_ptr);
41398 * The node_id of the node at this hop.
41400 void RouteHop_set_pubkey(struct LDKRouteHop *NONNULL_PTR this_ptr, struct LDKPublicKey val);
41403 * The node_announcement features of the node at this hop. For the last hop, these may be
41404 * amended to match the features present in the invoice this node generated.
41406 struct LDKNodeFeatures RouteHop_get_node_features(const struct LDKRouteHop *NONNULL_PTR this_ptr);
41409 * The node_announcement features of the node at this hop. For the last hop, these may be
41410 * amended to match the features present in the invoice this node generated.
41412 void RouteHop_set_node_features(struct LDKRouteHop *NONNULL_PTR this_ptr, struct LDKNodeFeatures val);
41415 * The channel that should be used from the previous hop to reach this node.
41417 uint64_t RouteHop_get_short_channel_id(const struct LDKRouteHop *NONNULL_PTR this_ptr);
41420 * The channel that should be used from the previous hop to reach this node.
41422 void RouteHop_set_short_channel_id(struct LDKRouteHop *NONNULL_PTR this_ptr, uint64_t val);
41425 * The channel_announcement features of the channel that should be used from the previous hop
41426 * to reach this node.
41428 struct LDKChannelFeatures RouteHop_get_channel_features(const struct LDKRouteHop *NONNULL_PTR this_ptr);
41431 * The channel_announcement features of the channel that should be used from the previous hop
41432 * to reach this node.
41434 void RouteHop_set_channel_features(struct LDKRouteHop *NONNULL_PTR this_ptr, struct LDKChannelFeatures val);
41437 * The fee taken on this hop (for paying for the use of the *next* channel in the path).
41438 * If this is the last hop in [`Path::hops`]:
41439 * * if we're sending to a [`BlindedPath`], this is the fee paid for use of the entire blinded path
41440 * * otherwise, this is the full value of this [`Path`]'s part of the payment
41442 * [`BlindedPath`]: crate::blinded_path::BlindedPath
41444 uint64_t RouteHop_get_fee_msat(const struct LDKRouteHop *NONNULL_PTR this_ptr);
41447 * The fee taken on this hop (for paying for the use of the *next* channel in the path).
41448 * If this is the last hop in [`Path::hops`]:
41449 * * if we're sending to a [`BlindedPath`], this is the fee paid for use of the entire blinded path
41450 * * otherwise, this is the full value of this [`Path`]'s part of the payment
41452 * [`BlindedPath`]: crate::blinded_path::BlindedPath
41454 void RouteHop_set_fee_msat(struct LDKRouteHop *NONNULL_PTR this_ptr, uint64_t val);
41457 * The CLTV delta added for this hop.
41458 * If this is the last hop in [`Path::hops`]:
41459 * * if we're sending to a [`BlindedPath`], this is the CLTV delta for the entire blinded path
41460 * * otherwise, this is the CLTV delta expected at the destination
41462 * [`BlindedPath`]: crate::blinded_path::BlindedPath
41464 uint32_t RouteHop_get_cltv_expiry_delta(const struct LDKRouteHop *NONNULL_PTR this_ptr);
41467 * The CLTV delta added for this hop.
41468 * If this is the last hop in [`Path::hops`]:
41469 * * if we're sending to a [`BlindedPath`], this is the CLTV delta for the entire blinded path
41470 * * otherwise, this is the CLTV delta expected at the destination
41472 * [`BlindedPath`]: crate::blinded_path::BlindedPath
41474 void RouteHop_set_cltv_expiry_delta(struct LDKRouteHop *NONNULL_PTR this_ptr, uint32_t val);
41477 * Indicates whether this hop is possibly announced in the public network graph.
41479 * Will be `true` if there is a possibility that the channel is publicly known, i.e., if we
41480 * either know for sure it's announced in the public graph, or if any public channels exist
41481 * for which the given `short_channel_id` could be an alias for. Will be `false` if we believe
41482 * the channel to be unannounced.
41484 * Will be `true` for objects serialized with LDK version 0.0.116 and before.
41486 bool RouteHop_get_maybe_announced_channel(const struct LDKRouteHop *NONNULL_PTR this_ptr);
41489 * Indicates whether this hop is possibly announced in the public network graph.
41491 * Will be `true` if there is a possibility that the channel is publicly known, i.e., if we
41492 * either know for sure it's announced in the public graph, or if any public channels exist
41493 * for which the given `short_channel_id` could be an alias for. Will be `false` if we believe
41494 * the channel to be unannounced.
41496 * Will be `true` for objects serialized with LDK version 0.0.116 and before.
41498 void RouteHop_set_maybe_announced_channel(struct LDKRouteHop *NONNULL_PTR this_ptr, bool val);
41501 * Constructs a new RouteHop given each field
41503 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);
41506 * Creates a copy of the RouteHop
41508 struct LDKRouteHop RouteHop_clone(const struct LDKRouteHop *NONNULL_PTR orig);
41511 * Generates a non-cryptographic 64-bit hash of the RouteHop.
41513 uint64_t RouteHop_hash(const struct LDKRouteHop *NONNULL_PTR o);
41516 * Checks if two RouteHops contain equal inner contents.
41517 * This ignores pointers and is_owned flags and looks at the values in fields.
41518 * Two objects with NULL inner values will be considered "equal" here.
41520 bool RouteHop_eq(const struct LDKRouteHop *NONNULL_PTR a, const struct LDKRouteHop *NONNULL_PTR b);
41523 * Serialize the RouteHop object into a byte array which can be read by RouteHop_read
41525 struct LDKCVec_u8Z RouteHop_write(const struct LDKRouteHop *NONNULL_PTR obj);
41528 * Read a RouteHop from a byte array, created by RouteHop_write
41530 struct LDKCResult_RouteHopDecodeErrorZ RouteHop_read(struct LDKu8slice ser);
41533 * Frees any resources used by the BlindedTail, if is_owned is set and inner is non-NULL.
41535 void BlindedTail_free(struct LDKBlindedTail this_obj);
41538 * The hops of the [`BlindedPath`] provided by the recipient.
41540 * [`BlindedPath`]: crate::blinded_path::BlindedPath
41542 struct LDKCVec_BlindedHopZ BlindedTail_get_hops(const struct LDKBlindedTail *NONNULL_PTR this_ptr);
41545 * The hops of the [`BlindedPath`] provided by the recipient.
41547 * [`BlindedPath`]: crate::blinded_path::BlindedPath
41549 void BlindedTail_set_hops(struct LDKBlindedTail *NONNULL_PTR this_ptr, struct LDKCVec_BlindedHopZ val);
41552 * The blinding point of the [`BlindedPath`] provided by the recipient.
41554 * [`BlindedPath`]: crate::blinded_path::BlindedPath
41556 struct LDKPublicKey BlindedTail_get_blinding_point(const struct LDKBlindedTail *NONNULL_PTR this_ptr);
41559 * The blinding point of the [`BlindedPath`] provided by the recipient.
41561 * [`BlindedPath`]: crate::blinded_path::BlindedPath
41563 void BlindedTail_set_blinding_point(struct LDKBlindedTail *NONNULL_PTR this_ptr, struct LDKPublicKey val);
41566 * Excess CLTV delta added to the recipient's CLTV expiry to deter intermediate nodes from
41567 * inferring the destination. May be 0.
41569 uint32_t BlindedTail_get_excess_final_cltv_expiry_delta(const struct LDKBlindedTail *NONNULL_PTR this_ptr);
41572 * Excess CLTV delta added to the recipient's CLTV expiry to deter intermediate nodes from
41573 * inferring the destination. May be 0.
41575 void BlindedTail_set_excess_final_cltv_expiry_delta(struct LDKBlindedTail *NONNULL_PTR this_ptr, uint32_t val);
41578 * The total amount paid on this [`Path`], excluding the fees.
41580 uint64_t BlindedTail_get_final_value_msat(const struct LDKBlindedTail *NONNULL_PTR this_ptr);
41583 * The total amount paid on this [`Path`], excluding the fees.
41585 void BlindedTail_set_final_value_msat(struct LDKBlindedTail *NONNULL_PTR this_ptr, uint64_t val);
41588 * Constructs a new BlindedTail given each field
41590 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);
41593 * Creates a copy of the BlindedTail
41595 struct LDKBlindedTail BlindedTail_clone(const struct LDKBlindedTail *NONNULL_PTR orig);
41598 * Generates a non-cryptographic 64-bit hash of the BlindedTail.
41600 uint64_t BlindedTail_hash(const struct LDKBlindedTail *NONNULL_PTR o);
41603 * Checks if two BlindedTails contain equal inner contents.
41604 * This ignores pointers and is_owned flags and looks at the values in fields.
41605 * Two objects with NULL inner values will be considered "equal" here.
41607 bool BlindedTail_eq(const struct LDKBlindedTail *NONNULL_PTR a, const struct LDKBlindedTail *NONNULL_PTR b);
41610 * Serialize the BlindedTail object into a byte array which can be read by BlindedTail_read
41612 struct LDKCVec_u8Z BlindedTail_write(const struct LDKBlindedTail *NONNULL_PTR obj);
41615 * Read a BlindedTail from a byte array, created by BlindedTail_write
41617 struct LDKCResult_BlindedTailDecodeErrorZ BlindedTail_read(struct LDKu8slice ser);
41620 * Frees any resources used by the Path, if is_owned is set and inner is non-NULL.
41622 void Path_free(struct LDKPath this_obj);
41625 * The list of unblinded hops in this [`Path`]. Must be at least length one.
41627 struct LDKCVec_RouteHopZ Path_get_hops(const struct LDKPath *NONNULL_PTR this_ptr);
41630 * The list of unblinded hops in this [`Path`]. Must be at least length one.
41632 void Path_set_hops(struct LDKPath *NONNULL_PTR this_ptr, struct LDKCVec_RouteHopZ val);
41635 * The blinded path at which this path terminates, if we're sending to one, and its metadata.
41637 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
41639 struct LDKBlindedTail Path_get_blinded_tail(const struct LDKPath *NONNULL_PTR this_ptr);
41642 * The blinded path at which this path terminates, if we're sending to one, and its metadata.
41644 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
41646 void Path_set_blinded_tail(struct LDKPath *NONNULL_PTR this_ptr, struct LDKBlindedTail val);
41649 * Constructs a new Path given each field
41651 * Note that blinded_tail_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
41653 MUST_USE_RES struct LDKPath Path_new(struct LDKCVec_RouteHopZ hops_arg, struct LDKBlindedTail blinded_tail_arg);
41656 * Creates a copy of the Path
41658 struct LDKPath Path_clone(const struct LDKPath *NONNULL_PTR orig);
41661 * Generates a non-cryptographic 64-bit hash of the Path.
41663 uint64_t Path_hash(const struct LDKPath *NONNULL_PTR o);
41666 * Checks if two Paths contain equal inner contents.
41667 * This ignores pointers and is_owned flags and looks at the values in fields.
41668 * Two objects with NULL inner values will be considered "equal" here.
41670 bool Path_eq(const struct LDKPath *NONNULL_PTR a, const struct LDKPath *NONNULL_PTR b);
41673 * Gets the fees for a given path, excluding any excess paid to the recipient.
41675 MUST_USE_RES uint64_t Path_fee_msat(const struct LDKPath *NONNULL_PTR this_arg);
41678 * Gets the total amount paid on this [`Path`], excluding the fees.
41680 MUST_USE_RES uint64_t Path_final_value_msat(const struct LDKPath *NONNULL_PTR this_arg);
41683 * Gets the final hop's CLTV expiry delta.
41685 MUST_USE_RES struct LDKCOption_u32Z Path_final_cltv_expiry_delta(const struct LDKPath *NONNULL_PTR this_arg);
41688 * Frees any resources used by the Route, if is_owned is set and inner is non-NULL.
41690 void Route_free(struct LDKRoute this_obj);
41693 * The list of [`Path`]s taken for a single (potentially-)multi-part payment. If no
41694 * [`BlindedTail`]s are present, then the pubkey of the last [`RouteHop`] in each path must be
41697 struct LDKCVec_PathZ Route_get_paths(const struct LDKRoute *NONNULL_PTR this_ptr);
41700 * The list of [`Path`]s taken for a single (potentially-)multi-part payment. If no
41701 * [`BlindedTail`]s are present, then the pubkey of the last [`RouteHop`] in each path must be
41704 void Route_set_paths(struct LDKRoute *NONNULL_PTR this_ptr, struct LDKCVec_PathZ val);
41707 * The `route_params` parameter passed to [`find_route`].
41709 * This is used by `ChannelManager` to track information which may be required for retries.
41711 * Will be `None` for objects serialized with LDK versions prior to 0.0.117.
41713 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
41715 struct LDKRouteParameters Route_get_route_params(const struct LDKRoute *NONNULL_PTR this_ptr);
41718 * The `route_params` parameter passed to [`find_route`].
41720 * This is used by `ChannelManager` to track information which may be required for retries.
41722 * Will be `None` for objects serialized with LDK versions prior to 0.0.117.
41724 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
41726 void Route_set_route_params(struct LDKRoute *NONNULL_PTR this_ptr, struct LDKRouteParameters val);
41729 * Constructs a new Route given each field
41731 * Note that route_params_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
41733 MUST_USE_RES struct LDKRoute Route_new(struct LDKCVec_PathZ paths_arg, struct LDKRouteParameters route_params_arg);
41736 * Creates a copy of the Route
41738 struct LDKRoute Route_clone(const struct LDKRoute *NONNULL_PTR orig);
41741 * Generates a non-cryptographic 64-bit hash of the Route.
41743 uint64_t Route_hash(const struct LDKRoute *NONNULL_PTR o);
41746 * Checks if two Routes contain equal inner contents.
41747 * This ignores pointers and is_owned flags and looks at the values in fields.
41748 * Two objects with NULL inner values will be considered "equal" here.
41750 bool Route_eq(const struct LDKRoute *NONNULL_PTR a, const struct LDKRoute *NONNULL_PTR b);
41753 * Returns the total amount of fees paid on this [`Route`].
41755 * For objects serialized with LDK 0.0.117 and after, this includes any extra payment made to
41756 * the recipient, which can happen in excess of the amount passed to [`find_route`] via
41757 * [`RouteParameters::final_value_msat`], if we had to reach the [`htlc_minimum_msat`] limits.
41759 * [`htlc_minimum_msat`]: https://github.com/lightning/bolts/blob/master/07-routing-gossip.md#the-channel_update-message
41761 MUST_USE_RES uint64_t Route_get_total_fees(const struct LDKRoute *NONNULL_PTR this_arg);
41764 * Returns the total amount paid on this [`Route`], excluding the fees.
41766 * Might be more than requested as part of the given [`RouteParameters::final_value_msat`] if
41767 * we had to reach the [`htlc_minimum_msat`] limits.
41769 * [`htlc_minimum_msat`]: https://github.com/lightning/bolts/blob/master/07-routing-gossip.md#the-channel_update-message
41771 MUST_USE_RES uint64_t Route_get_total_amount(const struct LDKRoute *NONNULL_PTR this_arg);
41774 * Serialize the Route object into a byte array which can be read by Route_read
41776 struct LDKCVec_u8Z Route_write(const struct LDKRoute *NONNULL_PTR obj);
41779 * Read a Route from a byte array, created by Route_write
41781 struct LDKCResult_RouteDecodeErrorZ Route_read(struct LDKu8slice ser);
41784 * Frees any resources used by the RouteParameters, if is_owned is set and inner is non-NULL.
41786 void RouteParameters_free(struct LDKRouteParameters this_obj);
41789 * The parameters of the failed payment path.
41791 struct LDKPaymentParameters RouteParameters_get_payment_params(const struct LDKRouteParameters *NONNULL_PTR this_ptr);
41794 * The parameters of the failed payment path.
41796 void RouteParameters_set_payment_params(struct LDKRouteParameters *NONNULL_PTR this_ptr, struct LDKPaymentParameters val);
41799 * The amount in msats sent on the failed payment path.
41801 uint64_t RouteParameters_get_final_value_msat(const struct LDKRouteParameters *NONNULL_PTR this_ptr);
41804 * The amount in msats sent on the failed payment path.
41806 void RouteParameters_set_final_value_msat(struct LDKRouteParameters *NONNULL_PTR this_ptr, uint64_t val);
41809 * The maximum total fees, in millisatoshi, that may accrue during route finding.
41811 * This limit also applies to the total fees that may arise while retrying failed payment
41814 * Note that values below a few sats may result in some paths being spuriously ignored.
41816 struct LDKCOption_u64Z RouteParameters_get_max_total_routing_fee_msat(const struct LDKRouteParameters *NONNULL_PTR this_ptr);
41819 * The maximum total fees, in millisatoshi, that may accrue during route finding.
41821 * This limit also applies to the total fees that may arise while retrying failed payment
41824 * Note that values below a few sats may result in some paths being spuriously ignored.
41826 void RouteParameters_set_max_total_routing_fee_msat(struct LDKRouteParameters *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
41829 * Constructs a new RouteParameters given each field
41831 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);
41834 * Creates a copy of the RouteParameters
41836 struct LDKRouteParameters RouteParameters_clone(const struct LDKRouteParameters *NONNULL_PTR orig);
41839 * Generates a non-cryptographic 64-bit hash of the RouteParameters.
41841 uint64_t RouteParameters_hash(const struct LDKRouteParameters *NONNULL_PTR o);
41844 * Checks if two RouteParameterss contain equal inner contents.
41845 * This ignores pointers and is_owned flags and looks at the values in fields.
41846 * Two objects with NULL inner values will be considered "equal" here.
41848 bool RouteParameters_eq(const struct LDKRouteParameters *NONNULL_PTR a, const struct LDKRouteParameters *NONNULL_PTR b);
41851 * Constructs [`RouteParameters`] from the given [`PaymentParameters`] and a payment amount.
41853 * [`Self::max_total_routing_fee_msat`] defaults to 1% of the payment amount + 50 sats
41855 MUST_USE_RES struct LDKRouteParameters RouteParameters_from_payment_params_and_value(struct LDKPaymentParameters payment_params, uint64_t final_value_msat);
41858 * Serialize the RouteParameters object into a byte array which can be read by RouteParameters_read
41860 struct LDKCVec_u8Z RouteParameters_write(const struct LDKRouteParameters *NONNULL_PTR obj);
41863 * Read a RouteParameters from a byte array, created by RouteParameters_write
41865 struct LDKCResult_RouteParametersDecodeErrorZ RouteParameters_read(struct LDKu8slice ser);
41868 * Frees any resources used by the PaymentParameters, if is_owned is set and inner is non-NULL.
41870 void PaymentParameters_free(struct LDKPaymentParameters this_obj);
41873 * Information about the payee, such as their features and route hints for their channels.
41875 struct LDKPayee PaymentParameters_get_payee(const struct LDKPaymentParameters *NONNULL_PTR this_ptr);
41878 * Information about the payee, such as their features and route hints for their channels.
41880 void PaymentParameters_set_payee(struct LDKPaymentParameters *NONNULL_PTR this_ptr, struct LDKPayee val);
41883 * Expiration of a payment to the payee, in seconds relative to the UNIX epoch.
41885 struct LDKCOption_u64Z PaymentParameters_get_expiry_time(const struct LDKPaymentParameters *NONNULL_PTR this_ptr);
41888 * Expiration of a payment to the payee, in seconds relative to the UNIX epoch.
41890 void PaymentParameters_set_expiry_time(struct LDKPaymentParameters *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
41893 * The maximum total CLTV delta we accept for the route.
41894 * Defaults to [`DEFAULT_MAX_TOTAL_CLTV_EXPIRY_DELTA`].
41896 uint32_t PaymentParameters_get_max_total_cltv_expiry_delta(const struct LDKPaymentParameters *NONNULL_PTR this_ptr);
41899 * The maximum total CLTV delta we accept for the route.
41900 * Defaults to [`DEFAULT_MAX_TOTAL_CLTV_EXPIRY_DELTA`].
41902 void PaymentParameters_set_max_total_cltv_expiry_delta(struct LDKPaymentParameters *NONNULL_PTR this_ptr, uint32_t val);
41905 * The maximum number of paths that may be used by (MPP) payments.
41906 * Defaults to [`DEFAULT_MAX_PATH_COUNT`].
41908 uint8_t PaymentParameters_get_max_path_count(const struct LDKPaymentParameters *NONNULL_PTR this_ptr);
41911 * The maximum number of paths that may be used by (MPP) payments.
41912 * Defaults to [`DEFAULT_MAX_PATH_COUNT`].
41914 void PaymentParameters_set_max_path_count(struct LDKPaymentParameters *NONNULL_PTR this_ptr, uint8_t val);
41917 * Selects the maximum share of a channel's total capacity which will be sent over a channel,
41918 * as a power of 1/2. A higher value prefers to send the payment using more MPP parts whereas
41919 * a lower value prefers to send larger MPP parts, potentially saturating channels and
41920 * increasing failure probability for those paths.
41922 * Note that this restriction will be relaxed during pathfinding after paths which meet this
41923 * restriction have been found. While paths which meet this criteria will be searched for, it
41924 * is ultimately up to the scorer to select them over other paths.
41926 * A value of 0 will allow payments up to and including a channel's total announced usable
41927 * capacity, a value of one will only use up to half its capacity, two 1/4, etc.
41931 uint8_t PaymentParameters_get_max_channel_saturation_power_of_half(const struct LDKPaymentParameters *NONNULL_PTR this_ptr);
41934 * Selects the maximum share of a channel's total capacity which will be sent over a channel,
41935 * as a power of 1/2. A higher value prefers to send the payment using more MPP parts whereas
41936 * a lower value prefers to send larger MPP parts, potentially saturating channels and
41937 * increasing failure probability for those paths.
41939 * Note that this restriction will be relaxed during pathfinding after paths which meet this
41940 * restriction have been found. While paths which meet this criteria will be searched for, it
41941 * is ultimately up to the scorer to select them over other paths.
41943 * A value of 0 will allow payments up to and including a channel's total announced usable
41944 * capacity, a value of one will only use up to half its capacity, two 1/4, etc.
41948 void PaymentParameters_set_max_channel_saturation_power_of_half(struct LDKPaymentParameters *NONNULL_PTR this_ptr, uint8_t val);
41951 * A list of SCIDs which this payment was previously attempted over and which caused the
41952 * payment to fail. Future attempts for the same payment shouldn't be relayed through any of
41955 * Returns a copy of the field.
41957 struct LDKCVec_u64Z PaymentParameters_get_previously_failed_channels(const struct LDKPaymentParameters *NONNULL_PTR this_ptr);
41960 * A list of SCIDs which this payment was previously attempted over and which caused the
41961 * payment to fail. Future attempts for the same payment shouldn't be relayed through any of
41964 void PaymentParameters_set_previously_failed_channels(struct LDKPaymentParameters *NONNULL_PTR this_ptr, struct LDKCVec_u64Z val);
41967 * Constructs a new PaymentParameters given each field
41969 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);
41972 * Creates a copy of the PaymentParameters
41974 struct LDKPaymentParameters PaymentParameters_clone(const struct LDKPaymentParameters *NONNULL_PTR orig);
41977 * Generates a non-cryptographic 64-bit hash of the PaymentParameters.
41979 uint64_t PaymentParameters_hash(const struct LDKPaymentParameters *NONNULL_PTR o);
41982 * Checks if two PaymentParameterss contain equal inner contents.
41983 * This ignores pointers and is_owned flags and looks at the values in fields.
41984 * Two objects with NULL inner values will be considered "equal" here.
41986 bool PaymentParameters_eq(const struct LDKPaymentParameters *NONNULL_PTR a, const struct LDKPaymentParameters *NONNULL_PTR b);
41989 * Serialize the PaymentParameters object into a byte array which can be read by PaymentParameters_read
41991 struct LDKCVec_u8Z PaymentParameters_write(const struct LDKPaymentParameters *NONNULL_PTR obj);
41994 * Read a PaymentParameters from a byte array, created by PaymentParameters_write
41996 struct LDKCResult_PaymentParametersDecodeErrorZ PaymentParameters_read(struct LDKu8slice ser, uint32_t arg);
41999 * Creates a payee with the node id of the given `pubkey`.
42001 * The `final_cltv_expiry_delta` should match the expected final CLTV delta the recipient has
42004 MUST_USE_RES struct LDKPaymentParameters PaymentParameters_from_node_id(struct LDKPublicKey payee_pubkey, uint32_t final_cltv_expiry_delta);
42007 * Creates a payee with the node id of the given `pubkey` to use for keysend payments.
42009 * The `final_cltv_expiry_delta` should match the expected final CLTV delta the recipient has
42012 * Note that MPP keysend is not widely supported yet. The `allow_mpp` lets you choose
42013 * whether your router will be allowed to find a multi-part route for this payment. If you
42014 * set `allow_mpp` to true, you should ensure a payment secret is set on send, likely via
42015 * [`RecipientOnionFields::secret_only`].
42017 * [`RecipientOnionFields::secret_only`]: crate::ln::channelmanager::RecipientOnionFields::secret_only
42019 MUST_USE_RES struct LDKPaymentParameters PaymentParameters_for_keysend(struct LDKPublicKey payee_pubkey, uint32_t final_cltv_expiry_delta, bool allow_mpp);
42022 * Creates parameters for paying to a blinded payee from the provided invoice. Sets
42023 * [`Payee::Blinded::route_hints`], [`Payee::Blinded::features`], and
42024 * [`PaymentParameters::expiry_time`].
42026 MUST_USE_RES struct LDKPaymentParameters PaymentParameters_from_bolt12_invoice(const struct LDKBolt12Invoice *NONNULL_PTR invoice);
42029 * Creates parameters for paying to a blinded payee from the provided blinded route hints.
42031 MUST_USE_RES struct LDKPaymentParameters PaymentParameters_blinded(struct LDKCVec_C2Tuple_BlindedPayInfoBlindedPathZZ blinded_route_hints);
42034 * Frees any resources used by the Payee
42036 void Payee_free(struct LDKPayee this_ptr);
42039 * Creates a copy of the Payee
42041 struct LDKPayee Payee_clone(const struct LDKPayee *NONNULL_PTR orig);
42044 * Utility method to constructs a new Blinded-variant Payee
42046 struct LDKPayee Payee_blinded(struct LDKCVec_C2Tuple_BlindedPayInfoBlindedPathZZ route_hints, struct LDKBolt12InvoiceFeatures features);
42049 * Utility method to constructs a new Clear-variant Payee
42051 struct LDKPayee Payee_clear(struct LDKPublicKey node_id, struct LDKCVec_RouteHintZ route_hints, struct LDKBolt11InvoiceFeatures features, uint32_t final_cltv_expiry_delta);
42054 * Generates a non-cryptographic 64-bit hash of the Payee.
42056 uint64_t Payee_hash(const struct LDKPayee *NONNULL_PTR o);
42059 * Checks if two Payees contain equal inner contents.
42060 * This ignores pointers and is_owned flags and looks at the values in fields.
42062 bool Payee_eq(const struct LDKPayee *NONNULL_PTR a, const struct LDKPayee *NONNULL_PTR b);
42065 * Frees any resources used by the RouteHint, if is_owned is set and inner is non-NULL.
42067 void RouteHint_free(struct LDKRouteHint this_obj);
42069 struct LDKCVec_RouteHintHopZ RouteHint_get_a(const struct LDKRouteHint *NONNULL_PTR this_ptr);
42071 void RouteHint_set_a(struct LDKRouteHint *NONNULL_PTR this_ptr, struct LDKCVec_RouteHintHopZ val);
42074 * Constructs a new RouteHint given each field
42076 MUST_USE_RES struct LDKRouteHint RouteHint_new(struct LDKCVec_RouteHintHopZ a_arg);
42079 * Creates a copy of the RouteHint
42081 struct LDKRouteHint RouteHint_clone(const struct LDKRouteHint *NONNULL_PTR orig);
42084 * Generates a non-cryptographic 64-bit hash of the RouteHint.
42086 uint64_t RouteHint_hash(const struct LDKRouteHint *NONNULL_PTR o);
42089 * Checks if two RouteHints contain equal inner contents.
42090 * This ignores pointers and is_owned flags and looks at the values in fields.
42091 * Two objects with NULL inner values will be considered "equal" here.
42093 bool RouteHint_eq(const struct LDKRouteHint *NONNULL_PTR a, const struct LDKRouteHint *NONNULL_PTR b);
42096 * Serialize the RouteHint object into a byte array which can be read by RouteHint_read
42098 struct LDKCVec_u8Z RouteHint_write(const struct LDKRouteHint *NONNULL_PTR obj);
42101 * Read a RouteHint from a byte array, created by RouteHint_write
42103 struct LDKCResult_RouteHintDecodeErrorZ RouteHint_read(struct LDKu8slice ser);
42106 * Frees any resources used by the RouteHintHop, if is_owned is set and inner is non-NULL.
42108 void RouteHintHop_free(struct LDKRouteHintHop this_obj);
42111 * The node_id of the non-target end of the route
42113 struct LDKPublicKey RouteHintHop_get_src_node_id(const struct LDKRouteHintHop *NONNULL_PTR this_ptr);
42116 * The node_id of the non-target end of the route
42118 void RouteHintHop_set_src_node_id(struct LDKRouteHintHop *NONNULL_PTR this_ptr, struct LDKPublicKey val);
42121 * The short_channel_id of this channel
42123 uint64_t RouteHintHop_get_short_channel_id(const struct LDKRouteHintHop *NONNULL_PTR this_ptr);
42126 * The short_channel_id of this channel
42128 void RouteHintHop_set_short_channel_id(struct LDKRouteHintHop *NONNULL_PTR this_ptr, uint64_t val);
42131 * The fees which must be paid to use this channel
42133 struct LDKRoutingFees RouteHintHop_get_fees(const struct LDKRouteHintHop *NONNULL_PTR this_ptr);
42136 * The fees which must be paid to use this channel
42138 void RouteHintHop_set_fees(struct LDKRouteHintHop *NONNULL_PTR this_ptr, struct LDKRoutingFees val);
42141 * The difference in CLTV values between this node and the next node.
42143 uint16_t RouteHintHop_get_cltv_expiry_delta(const struct LDKRouteHintHop *NONNULL_PTR this_ptr);
42146 * The difference in CLTV values between this node and the next node.
42148 void RouteHintHop_set_cltv_expiry_delta(struct LDKRouteHintHop *NONNULL_PTR this_ptr, uint16_t val);
42151 * The minimum value, in msat, which must be relayed to the next hop.
42153 struct LDKCOption_u64Z RouteHintHop_get_htlc_minimum_msat(const struct LDKRouteHintHop *NONNULL_PTR this_ptr);
42156 * The minimum value, in msat, which must be relayed to the next hop.
42158 void RouteHintHop_set_htlc_minimum_msat(struct LDKRouteHintHop *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
42161 * The maximum value in msat available for routing with a single HTLC.
42163 struct LDKCOption_u64Z RouteHintHop_get_htlc_maximum_msat(const struct LDKRouteHintHop *NONNULL_PTR this_ptr);
42166 * The maximum value in msat available for routing with a single HTLC.
42168 void RouteHintHop_set_htlc_maximum_msat(struct LDKRouteHintHop *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
42171 * Constructs a new RouteHintHop given each field
42173 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);
42176 * Creates a copy of the RouteHintHop
42178 struct LDKRouteHintHop RouteHintHop_clone(const struct LDKRouteHintHop *NONNULL_PTR orig);
42181 * Generates a non-cryptographic 64-bit hash of the RouteHintHop.
42183 uint64_t RouteHintHop_hash(const struct LDKRouteHintHop *NONNULL_PTR o);
42186 * Checks if two RouteHintHops contain equal inner contents.
42187 * This ignores pointers and is_owned flags and looks at the values in fields.
42188 * Two objects with NULL inner values will be considered "equal" here.
42190 bool RouteHintHop_eq(const struct LDKRouteHintHop *NONNULL_PTR a, const struct LDKRouteHintHop *NONNULL_PTR b);
42193 * Serialize the RouteHintHop object into a byte array which can be read by RouteHintHop_read
42195 struct LDKCVec_u8Z RouteHintHop_write(const struct LDKRouteHintHop *NONNULL_PTR obj);
42198 * Read a RouteHintHop from a byte array, created by RouteHintHop_write
42200 struct LDKCResult_RouteHintHopDecodeErrorZ RouteHintHop_read(struct LDKu8slice ser);
42203 * Finds a route from us (payer) to the given target node (payee).
42205 * If the payee provided features in their invoice, they should be provided via the `payee` field
42206 * in the given [`RouteParameters::payment_params`].
42207 * Without this, MPP will only be used if the payee's features are available in the network graph.
42209 * Private routing paths between a public node and the target may be included in the `payee` field
42210 * of [`RouteParameters::payment_params`].
42212 * If some channels aren't announced, it may be useful to fill in `first_hops` with the results
42213 * from [`ChannelManager::list_usable_channels`]. If it is filled in, the view of these channels
42214 * from `network_graph` will be ignored, and only those in `first_hops` will be used.
42216 * The fees on channels from us to the next hop are ignored as they are assumed to all be equal.
42217 * However, the enabled/disabled bit on such channels as well as the `htlc_minimum_msat` /
42218 * `htlc_maximum_msat` *are* checked as they may change based on the receiving node.
42222 * Panics if first_hops contains channels without `short_channel_id`s;
42223 * [`ChannelManager::list_usable_channels`] will never include such channels.
42225 * [`ChannelManager::list_usable_channels`]: crate::ln::channelmanager::ChannelManager::list_usable_channels
42226 * [`Event::PaymentPathFailed`]: crate::events::Event::PaymentPathFailed
42227 * [`NetworkGraph`]: crate::routing::gossip::NetworkGraph
42229 * Note that first_hops (or a relevant inner pointer) may be NULL or all-0s to represent None
42231 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]);
42234 * Construct a route from us (payer) to the target node (payee) via the given hops (which should
42235 * exclude the payer, but include the payee). This may be useful, e.g., for probing the chosen path.
42237 * Re-uses logic from `find_route`, so the restrictions described there also apply here.
42239 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]);
42242 * Calls the free function if one is set
42244 void ScoreLookUp_free(struct LDKScoreLookUp this_ptr);
42247 * Calls the free function if one is set
42249 void ScoreUpdate_free(struct LDKScoreUpdate this_ptr);
42252 * Calls the free function if one is set
42254 void Score_free(struct LDKScore this_ptr);
42257 * Calls the free function if one is set
42259 void LockableScore_free(struct LDKLockableScore this_ptr);
42262 * Calls the free function if one is set
42264 void WriteableScore_free(struct LDKWriteableScore this_ptr);
42267 * Frees any resources used by the MultiThreadedLockableScore, if is_owned is set and inner is non-NULL.
42269 void MultiThreadedLockableScore_free(struct LDKMultiThreadedLockableScore this_obj);
42272 * Constructs a new LockableScore which calls the relevant methods on this_arg.
42273 * This copies the `inner` pointer in this_arg and thus the returned LockableScore must be freed before this_arg is
42275 struct LDKLockableScore MultiThreadedLockableScore_as_LockableScore(const struct LDKMultiThreadedLockableScore *NONNULL_PTR this_arg);
42278 * Serialize the MultiThreadedLockableScore object into a byte array which can be read by MultiThreadedLockableScore_read
42280 struct LDKCVec_u8Z MultiThreadedLockableScore_write(const struct LDKMultiThreadedLockableScore *NONNULL_PTR obj);
42283 * Constructs a new WriteableScore which calls the relevant methods on this_arg.
42284 * This copies the `inner` pointer in this_arg and thus the returned WriteableScore must be freed before this_arg is
42286 struct LDKWriteableScore MultiThreadedLockableScore_as_WriteableScore(const struct LDKMultiThreadedLockableScore *NONNULL_PTR this_arg);
42289 * Creates a new [`MultiThreadedLockableScore`] given an underlying [`Score`].
42291 MUST_USE_RES struct LDKMultiThreadedLockableScore MultiThreadedLockableScore_new(struct LDKScore score);
42294 * Frees any resources used by the MultiThreadedScoreLockRead, if is_owned is set and inner is non-NULL.
42296 void MultiThreadedScoreLockRead_free(struct LDKMultiThreadedScoreLockRead this_obj);
42299 * Frees any resources used by the MultiThreadedScoreLockWrite, if is_owned is set and inner is non-NULL.
42301 void MultiThreadedScoreLockWrite_free(struct LDKMultiThreadedScoreLockWrite this_obj);
42304 * Constructs a new ScoreLookUp which calls the relevant methods on this_arg.
42305 * This copies the `inner` pointer in this_arg and thus the returned ScoreLookUp must be freed before this_arg is
42307 struct LDKScoreLookUp MultiThreadedScoreLockRead_as_ScoreLookUp(const struct LDKMultiThreadedScoreLockRead *NONNULL_PTR this_arg);
42310 * Serialize the MultiThreadedScoreLockWrite object into a byte array which can be read by MultiThreadedScoreLockWrite_read
42312 struct LDKCVec_u8Z MultiThreadedScoreLockWrite_write(const struct LDKMultiThreadedScoreLockWrite *NONNULL_PTR obj);
42315 * Constructs a new ScoreUpdate which calls the relevant methods on this_arg.
42316 * This copies the `inner` pointer in this_arg and thus the returned ScoreUpdate must be freed before this_arg is
42318 struct LDKScoreUpdate MultiThreadedScoreLockWrite_as_ScoreUpdate(const struct LDKMultiThreadedScoreLockWrite *NONNULL_PTR this_arg);
42321 * Frees any resources used by the ChannelUsage, if is_owned is set and inner is non-NULL.
42323 void ChannelUsage_free(struct LDKChannelUsage this_obj);
42326 * The amount to send through the channel, denominated in millisatoshis.
42328 uint64_t ChannelUsage_get_amount_msat(const struct LDKChannelUsage *NONNULL_PTR this_ptr);
42331 * The amount to send through the channel, denominated in millisatoshis.
42333 void ChannelUsage_set_amount_msat(struct LDKChannelUsage *NONNULL_PTR this_ptr, uint64_t val);
42336 * Total amount, denominated in millisatoshis, already allocated to send through the channel
42337 * as part of a multi-path payment.
42339 uint64_t ChannelUsage_get_inflight_htlc_msat(const struct LDKChannelUsage *NONNULL_PTR this_ptr);
42342 * Total amount, denominated in millisatoshis, already allocated to send through the channel
42343 * as part of a multi-path payment.
42345 void ChannelUsage_set_inflight_htlc_msat(struct LDKChannelUsage *NONNULL_PTR this_ptr, uint64_t val);
42348 * The effective capacity of the channel.
42350 struct LDKEffectiveCapacity ChannelUsage_get_effective_capacity(const struct LDKChannelUsage *NONNULL_PTR this_ptr);
42353 * The effective capacity of the channel.
42355 void ChannelUsage_set_effective_capacity(struct LDKChannelUsage *NONNULL_PTR this_ptr, struct LDKEffectiveCapacity val);
42358 * Constructs a new ChannelUsage given each field
42360 MUST_USE_RES struct LDKChannelUsage ChannelUsage_new(uint64_t amount_msat_arg, uint64_t inflight_htlc_msat_arg, struct LDKEffectiveCapacity effective_capacity_arg);
42363 * Creates a copy of the ChannelUsage
42365 struct LDKChannelUsage ChannelUsage_clone(const struct LDKChannelUsage *NONNULL_PTR orig);
42368 * Frees any resources used by the FixedPenaltyScorer, if is_owned is set and inner is non-NULL.
42370 void FixedPenaltyScorer_free(struct LDKFixedPenaltyScorer this_obj);
42373 * Creates a copy of the FixedPenaltyScorer
42375 struct LDKFixedPenaltyScorer FixedPenaltyScorer_clone(const struct LDKFixedPenaltyScorer *NONNULL_PTR orig);
42378 * Creates a new scorer using `penalty_msat`.
42380 MUST_USE_RES struct LDKFixedPenaltyScorer FixedPenaltyScorer_with_penalty(uint64_t penalty_msat);
42383 * Constructs a new ScoreLookUp which calls the relevant methods on this_arg.
42384 * This copies the `inner` pointer in this_arg and thus the returned ScoreLookUp must be freed before this_arg is
42386 struct LDKScoreLookUp FixedPenaltyScorer_as_ScoreLookUp(const struct LDKFixedPenaltyScorer *NONNULL_PTR this_arg);
42389 * Constructs a new ScoreUpdate which calls the relevant methods on this_arg.
42390 * This copies the `inner` pointer in this_arg and thus the returned ScoreUpdate must be freed before this_arg is
42392 struct LDKScoreUpdate FixedPenaltyScorer_as_ScoreUpdate(const struct LDKFixedPenaltyScorer *NONNULL_PTR this_arg);
42395 * Serialize the FixedPenaltyScorer object into a byte array which can be read by FixedPenaltyScorer_read
42397 struct LDKCVec_u8Z FixedPenaltyScorer_write(const struct LDKFixedPenaltyScorer *NONNULL_PTR obj);
42400 * Read a FixedPenaltyScorer from a byte array, created by FixedPenaltyScorer_write
42402 struct LDKCResult_FixedPenaltyScorerDecodeErrorZ FixedPenaltyScorer_read(struct LDKu8slice ser, uint64_t arg);
42405 * Frees any resources used by the ProbabilisticScorer, if is_owned is set and inner is non-NULL.
42407 void ProbabilisticScorer_free(struct LDKProbabilisticScorer this_obj);
42410 * Frees any resources used by the ProbabilisticScoringFeeParameters, if is_owned is set and inner is non-NULL.
42412 void ProbabilisticScoringFeeParameters_free(struct LDKProbabilisticScoringFeeParameters this_obj);
42415 * A fixed penalty in msats to apply to each channel.
42417 * Default value: 500 msat
42419 uint64_t ProbabilisticScoringFeeParameters_get_base_penalty_msat(const struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_ptr);
42422 * A fixed penalty in msats to apply to each channel.
42424 * Default value: 500 msat
42426 void ProbabilisticScoringFeeParameters_set_base_penalty_msat(struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_ptr, uint64_t val);
42429 * A multiplier used with the total amount flowing over a channel to calculate a fixed penalty
42430 * applied to each channel, in excess of the [`base_penalty_msat`].
42432 * The purpose of the amount penalty is to avoid having fees dominate the channel cost (i.e.,
42433 * fees plus penalty) for large payments. The penalty is computed as the product of this
42434 * multiplier and `2^30`ths of the total amount flowing over a channel (i.e. the payment
42435 * amount plus the amount of any other HTLCs flowing we sent over the same channel).
42437 * ie `base_penalty_amount_multiplier_msat * amount_msat / 2^30`
42439 * Default value: 8,192 msat
42441 * [`base_penalty_msat`]: Self::base_penalty_msat
42443 uint64_t ProbabilisticScoringFeeParameters_get_base_penalty_amount_multiplier_msat(const struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_ptr);
42446 * A multiplier used with the total amount flowing over a channel to calculate a fixed penalty
42447 * applied to each channel, in excess of the [`base_penalty_msat`].
42449 * The purpose of the amount penalty is to avoid having fees dominate the channel cost (i.e.,
42450 * fees plus penalty) for large payments. The penalty is computed as the product of this
42451 * multiplier and `2^30`ths of the total amount flowing over a channel (i.e. the payment
42452 * amount plus the amount of any other HTLCs flowing we sent over the same channel).
42454 * ie `base_penalty_amount_multiplier_msat * amount_msat / 2^30`
42456 * Default value: 8,192 msat
42458 * [`base_penalty_msat`]: Self::base_penalty_msat
42460 void ProbabilisticScoringFeeParameters_set_base_penalty_amount_multiplier_msat(struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_ptr, uint64_t val);
42463 * A multiplier used in conjunction with the negative `log10` of the channel's success
42464 * probability for a payment, as determined by our latest estimates of the channel's
42465 * liquidity, to determine the liquidity penalty.
42467 * The penalty is based in part on the knowledge learned from prior successful and unsuccessful
42468 * payments. This knowledge is decayed over time based on [`liquidity_offset_half_life`]. The
42469 * penalty is effectively limited to `2 * liquidity_penalty_multiplier_msat` (corresponding to
42470 * lower bounding the success probability to `0.01`) when the amount falls within the
42471 * uncertainty bounds of the channel liquidity balance. Amounts above the upper bound will
42472 * result in a `u64::max_value` penalty, however.
42474 * `-log10(success_probability) * liquidity_penalty_multiplier_msat`
42476 * Default value: 30,000 msat
42478 * [`liquidity_offset_half_life`]: ProbabilisticScoringDecayParameters::liquidity_offset_half_life
42480 uint64_t ProbabilisticScoringFeeParameters_get_liquidity_penalty_multiplier_msat(const struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_ptr);
42483 * A multiplier used in conjunction with the negative `log10` of the channel's success
42484 * probability for a payment, as determined by our latest estimates of the channel's
42485 * liquidity, to determine the liquidity penalty.
42487 * The penalty is based in part on the knowledge learned from prior successful and unsuccessful
42488 * payments. This knowledge is decayed over time based on [`liquidity_offset_half_life`]. The
42489 * penalty is effectively limited to `2 * liquidity_penalty_multiplier_msat` (corresponding to
42490 * lower bounding the success probability to `0.01`) when the amount falls within the
42491 * uncertainty bounds of the channel liquidity balance. Amounts above the upper bound will
42492 * result in a `u64::max_value` penalty, however.
42494 * `-log10(success_probability) * liquidity_penalty_multiplier_msat`
42496 * Default value: 30,000 msat
42498 * [`liquidity_offset_half_life`]: ProbabilisticScoringDecayParameters::liquidity_offset_half_life
42500 void ProbabilisticScoringFeeParameters_set_liquidity_penalty_multiplier_msat(struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_ptr, uint64_t val);
42503 * A multiplier used in conjunction with the total amount flowing over a channel and the
42504 * negative `log10` of the channel's success probability for the payment, as determined by our
42505 * latest estimates of the channel's liquidity, to determine the amount penalty.
42507 * The purpose of the amount penalty is to avoid having fees dominate the channel cost (i.e.,
42508 * fees plus penalty) for large payments. The penalty is computed as the product of this
42509 * multiplier and `2^20`ths of the amount flowing over this channel, weighted by the negative
42510 * `log10` of the success probability.
42512 * `-log10(success_probability) * liquidity_penalty_amount_multiplier_msat * amount_msat / 2^20`
42514 * In practice, this means for 0.1 success probability (`-log10(0.1) == 1`) each `2^20`th of
42515 * the amount will result in a penalty of the multiplier. And, as the success probability
42516 * decreases, the negative `log10` weighting will increase dramatically. For higher success
42517 * probabilities, the multiplier will have a decreasing effect as the negative `log10` will
42520 * Default value: 192 msat
42522 uint64_t ProbabilisticScoringFeeParameters_get_liquidity_penalty_amount_multiplier_msat(const struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_ptr);
42525 * A multiplier used in conjunction with the total amount flowing over a channel and the
42526 * negative `log10` of the channel's success probability for the payment, as determined by our
42527 * latest estimates of the channel's liquidity, to determine the amount penalty.
42529 * The purpose of the amount penalty is to avoid having fees dominate the channel cost (i.e.,
42530 * fees plus penalty) for large payments. The penalty is computed as the product of this
42531 * multiplier and `2^20`ths of the amount flowing over this channel, weighted by the negative
42532 * `log10` of the success probability.
42534 * `-log10(success_probability) * liquidity_penalty_amount_multiplier_msat * amount_msat / 2^20`
42536 * In practice, this means for 0.1 success probability (`-log10(0.1) == 1`) each `2^20`th of
42537 * the amount will result in a penalty of the multiplier. And, as the success probability
42538 * decreases, the negative `log10` weighting will increase dramatically. For higher success
42539 * probabilities, the multiplier will have a decreasing effect as the negative `log10` will
42542 * Default value: 192 msat
42544 void ProbabilisticScoringFeeParameters_set_liquidity_penalty_amount_multiplier_msat(struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_ptr, uint64_t val);
42547 * A multiplier used in conjunction with the negative `log10` of the channel's success
42548 * probability for the payment, as determined based on the history of our estimates of the
42549 * channel's available liquidity, to determine a penalty.
42551 * This penalty is similar to [`liquidity_penalty_multiplier_msat`], however, instead of using
42552 * only our latest estimate for the current liquidity available in the channel, it estimates
42553 * success probability based on the estimated liquidity available in the channel through
42554 * history. Specifically, every time we update our liquidity bounds on a given channel, we
42555 * track which of several buckets those bounds fall into, exponentially decaying the
42556 * probability of each bucket as new samples are added.
42558 * Default value: 10,000 msat
42560 * [`liquidity_penalty_multiplier_msat`]: Self::liquidity_penalty_multiplier_msat
42562 uint64_t ProbabilisticScoringFeeParameters_get_historical_liquidity_penalty_multiplier_msat(const struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_ptr);
42565 * A multiplier used in conjunction with the negative `log10` of the channel's success
42566 * probability for the payment, as determined based on the history of our estimates of the
42567 * channel's available liquidity, to determine a penalty.
42569 * This penalty is similar to [`liquidity_penalty_multiplier_msat`], however, instead of using
42570 * only our latest estimate for the current liquidity available in the channel, it estimates
42571 * success probability based on the estimated liquidity available in the channel through
42572 * history. Specifically, every time we update our liquidity bounds on a given channel, we
42573 * track which of several buckets those bounds fall into, exponentially decaying the
42574 * probability of each bucket as new samples are added.
42576 * Default value: 10,000 msat
42578 * [`liquidity_penalty_multiplier_msat`]: Self::liquidity_penalty_multiplier_msat
42580 void ProbabilisticScoringFeeParameters_set_historical_liquidity_penalty_multiplier_msat(struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_ptr, uint64_t val);
42583 * A multiplier used in conjunction with the total amount flowing over a channel and the
42584 * negative `log10` of the channel's success probability for the payment, as determined based
42585 * on the history of our estimates of the channel's available liquidity, to determine a
42588 * The purpose of the amount penalty is to avoid having fees dominate the channel cost for
42589 * large payments. The penalty is computed as the product of this multiplier and `2^20`ths
42590 * of the amount flowing over this channel, weighted by the negative `log10` of the success
42593 * This penalty is similar to [`liquidity_penalty_amount_multiplier_msat`], however, instead
42594 * of using only our latest estimate for the current liquidity available in the channel, it
42595 * estimates success probability based on the estimated liquidity available in the channel
42596 * through history. Specifically, every time we update our liquidity bounds on a given
42597 * channel, we track which of several buckets those bounds fall into, exponentially decaying
42598 * the probability of each bucket as new samples are added.
42600 * Default value: 64 msat
42602 * [`liquidity_penalty_amount_multiplier_msat`]: Self::liquidity_penalty_amount_multiplier_msat
42604 uint64_t ProbabilisticScoringFeeParameters_get_historical_liquidity_penalty_amount_multiplier_msat(const struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_ptr);
42607 * A multiplier used in conjunction with the total amount flowing over a channel and the
42608 * negative `log10` of the channel's success probability for the payment, as determined based
42609 * on the history of our estimates of the channel's available liquidity, to determine a
42612 * The purpose of the amount penalty is to avoid having fees dominate the channel cost for
42613 * large payments. The penalty is computed as the product of this multiplier and `2^20`ths
42614 * of the amount flowing over this channel, weighted by the negative `log10` of the success
42617 * This penalty is similar to [`liquidity_penalty_amount_multiplier_msat`], however, instead
42618 * of using only our latest estimate for the current liquidity available in the channel, it
42619 * estimates success probability based on the estimated liquidity available in the channel
42620 * through history. Specifically, every time we update our liquidity bounds on a given
42621 * channel, we track which of several buckets those bounds fall into, exponentially decaying
42622 * the probability of each bucket as new samples are added.
42624 * Default value: 64 msat
42626 * [`liquidity_penalty_amount_multiplier_msat`]: Self::liquidity_penalty_amount_multiplier_msat
42628 void ProbabilisticScoringFeeParameters_set_historical_liquidity_penalty_amount_multiplier_msat(struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_ptr, uint64_t val);
42631 * This penalty is applied when `htlc_maximum_msat` is equal to or larger than half of the
42632 * channel's capacity, (ie. htlc_maximum_msat >= 0.5 * channel_capacity) which makes us
42633 * prefer nodes with a smaller `htlc_maximum_msat`. We treat such nodes preferentially
42634 * as this makes balance discovery attacks harder to execute, thereby creating an incentive
42635 * to restrict `htlc_maximum_msat` and improve privacy.
42637 * Default value: 250 msat
42639 uint64_t ProbabilisticScoringFeeParameters_get_anti_probing_penalty_msat(const struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_ptr);
42642 * This penalty is applied when `htlc_maximum_msat` is equal to or larger than half of the
42643 * channel's capacity, (ie. htlc_maximum_msat >= 0.5 * channel_capacity) which makes us
42644 * prefer nodes with a smaller `htlc_maximum_msat`. We treat such nodes preferentially
42645 * as this makes balance discovery attacks harder to execute, thereby creating an incentive
42646 * to restrict `htlc_maximum_msat` and improve privacy.
42648 * Default value: 250 msat
42650 void ProbabilisticScoringFeeParameters_set_anti_probing_penalty_msat(struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_ptr, uint64_t val);
42653 * This penalty is applied when the total amount flowing over a channel exceeds our current
42654 * estimate of the channel's available liquidity. The total amount is the amount of the
42655 * current HTLC plus any HTLCs which we've sent over the same channel.
42657 * Note that in this case all other penalties, including the
42658 * [`liquidity_penalty_multiplier_msat`] and [`liquidity_penalty_amount_multiplier_msat`]-based
42659 * penalties, as well as the [`base_penalty_msat`] and the [`anti_probing_penalty_msat`], if
42660 * applicable, are still included in the overall penalty.
42662 * If you wish to avoid creating paths with such channels entirely, setting this to a value of
42663 * `u64::max_value()` will guarantee that.
42665 * Default value: 1_0000_0000_000 msat (1 Bitcoin)
42667 * [`liquidity_penalty_multiplier_msat`]: Self::liquidity_penalty_multiplier_msat
42668 * [`liquidity_penalty_amount_multiplier_msat`]: Self::liquidity_penalty_amount_multiplier_msat
42669 * [`base_penalty_msat`]: Self::base_penalty_msat
42670 * [`anti_probing_penalty_msat`]: Self::anti_probing_penalty_msat
42672 uint64_t ProbabilisticScoringFeeParameters_get_considered_impossible_penalty_msat(const struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_ptr);
42675 * This penalty is applied when the total amount flowing over a channel exceeds our current
42676 * estimate of the channel's available liquidity. The total amount is the amount of the
42677 * current HTLC plus any HTLCs which we've sent over the same channel.
42679 * Note that in this case all other penalties, including the
42680 * [`liquidity_penalty_multiplier_msat`] and [`liquidity_penalty_amount_multiplier_msat`]-based
42681 * penalties, as well as the [`base_penalty_msat`] and the [`anti_probing_penalty_msat`], if
42682 * applicable, are still included in the overall penalty.
42684 * If you wish to avoid creating paths with such channels entirely, setting this to a value of
42685 * `u64::max_value()` will guarantee that.
42687 * Default value: 1_0000_0000_000 msat (1 Bitcoin)
42689 * [`liquidity_penalty_multiplier_msat`]: Self::liquidity_penalty_multiplier_msat
42690 * [`liquidity_penalty_amount_multiplier_msat`]: Self::liquidity_penalty_amount_multiplier_msat
42691 * [`base_penalty_msat`]: Self::base_penalty_msat
42692 * [`anti_probing_penalty_msat`]: Self::anti_probing_penalty_msat
42694 void ProbabilisticScoringFeeParameters_set_considered_impossible_penalty_msat(struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_ptr, uint64_t val);
42697 * In order to calculate most of the scores above, we must first convert a lower and upper
42698 * bound on the available liquidity in a channel into the probability that we think a payment
42699 * will succeed. That probability is derived from a Probability Density Function for where we
42700 * think the liquidity in a channel likely lies, given such bounds.
42702 * If this flag is set, that PDF is simply a constant - we assume that the actual available
42703 * liquidity in a channel is just as likely to be at any point between our lower and upper
42706 * If this flag is *not* set, that PDF is `(x - 0.5*capacity) ^ 2`. That is, we use an
42707 * exponential curve which expects the liquidity of a channel to lie \"at the edges\". This
42708 * matches experimental results - most routing nodes do not aggressively rebalance their
42709 * channels and flows in the network are often unbalanced, leaving liquidity usually
42712 * Thus, for the \"best\" routes, leave this flag `false`. However, the flag does imply a number
42713 * of floating-point multiplications in the hottest routing code, which may lead to routing
42714 * performance degradation on some machines.
42716 * Default value: false
42718 bool ProbabilisticScoringFeeParameters_get_linear_success_probability(const struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_ptr);
42721 * In order to calculate most of the scores above, we must first convert a lower and upper
42722 * bound on the available liquidity in a channel into the probability that we think a payment
42723 * will succeed. That probability is derived from a Probability Density Function for where we
42724 * think the liquidity in a channel likely lies, given such bounds.
42726 * If this flag is set, that PDF is simply a constant - we assume that the actual available
42727 * liquidity in a channel is just as likely to be at any point between our lower and upper
42730 * If this flag is *not* set, that PDF is `(x - 0.5*capacity) ^ 2`. That is, we use an
42731 * exponential curve which expects the liquidity of a channel to lie \"at the edges\". This
42732 * matches experimental results - most routing nodes do not aggressively rebalance their
42733 * channels and flows in the network are often unbalanced, leaving liquidity usually
42736 * Thus, for the \"best\" routes, leave this flag `false`. However, the flag does imply a number
42737 * of floating-point multiplications in the hottest routing code, which may lead to routing
42738 * performance degradation on some machines.
42740 * Default value: false
42742 void ProbabilisticScoringFeeParameters_set_linear_success_probability(struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_ptr, bool val);
42745 * Creates a copy of the ProbabilisticScoringFeeParameters
42747 struct LDKProbabilisticScoringFeeParameters ProbabilisticScoringFeeParameters_clone(const struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR orig);
42750 * Creates a "default" ProbabilisticScoringFeeParameters. See struct and individual field documentaiton for details on which values are used.
42752 MUST_USE_RES struct LDKProbabilisticScoringFeeParameters ProbabilisticScoringFeeParameters_default(void);
42755 * Marks the node with the given `node_id` as banned,
42756 * i.e it will be avoided during path finding.
42758 void ProbabilisticScoringFeeParameters_add_banned(struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_arg, const struct LDKNodeId *NONNULL_PTR node_id);
42761 * Marks all nodes in the given list as banned, i.e.,
42762 * they will be avoided during path finding.
42764 void ProbabilisticScoringFeeParameters_add_banned_from_list(struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_arg, struct LDKCVec_NodeIdZ node_ids);
42767 * Removes the node with the given `node_id` from the list of nodes to avoid.
42769 void ProbabilisticScoringFeeParameters_remove_banned(struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_arg, const struct LDKNodeId *NONNULL_PTR node_id);
42772 * Sets a manual penalty for the given node.
42774 void ProbabilisticScoringFeeParameters_set_manual_penalty(struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_arg, const struct LDKNodeId *NONNULL_PTR node_id, uint64_t penalty);
42777 * Removes the node with the given `node_id` from the list of manual penalties.
42779 void ProbabilisticScoringFeeParameters_remove_manual_penalty(struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_arg, const struct LDKNodeId *NONNULL_PTR node_id);
42782 * Clears the list of manual penalties that are applied during path finding.
42784 void ProbabilisticScoringFeeParameters_clear_manual_penalties(struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_arg);
42787 * Frees any resources used by the ProbabilisticScoringDecayParameters, if is_owned is set and inner is non-NULL.
42789 void ProbabilisticScoringDecayParameters_free(struct LDKProbabilisticScoringDecayParameters this_obj);
42792 * If we aren't learning any new datapoints for a channel, the historical liquidity bounds
42793 * tracking can simply live on with increasingly stale data. Instead, when a channel has not
42794 * seen a liquidity estimate update for this amount of time, the historical datapoints are
42796 * For an example of historical_no_updates_half_life being used see [`historical_estimated_channel_liquidity_probabilities`]
42798 * Note that after 16 or more half lives all historical data will be completely gone.
42800 * Default value: 14 days
42802 * [`historical_estimated_channel_liquidity_probabilities`]: ProbabilisticScorerUsingTime::historical_estimated_channel_liquidity_probabilities
42804 uint64_t ProbabilisticScoringDecayParameters_get_historical_no_updates_half_life(const struct LDKProbabilisticScoringDecayParameters *NONNULL_PTR this_ptr);
42807 * If we aren't learning any new datapoints for a channel, the historical liquidity bounds
42808 * tracking can simply live on with increasingly stale data. Instead, when a channel has not
42809 * seen a liquidity estimate update for this amount of time, the historical datapoints are
42811 * For an example of historical_no_updates_half_life being used see [`historical_estimated_channel_liquidity_probabilities`]
42813 * Note that after 16 or more half lives all historical data will be completely gone.
42815 * Default value: 14 days
42817 * [`historical_estimated_channel_liquidity_probabilities`]: ProbabilisticScorerUsingTime::historical_estimated_channel_liquidity_probabilities
42819 void ProbabilisticScoringDecayParameters_set_historical_no_updates_half_life(struct LDKProbabilisticScoringDecayParameters *NONNULL_PTR this_ptr, uint64_t val);
42822 * Whenever this amount of time elapses since the last update to a channel's liquidity bounds,
42823 * the distance from the bounds to \"zero\" is cut in half. In other words, the lower-bound on
42824 * the available liquidity is halved and the upper-bound moves half-way to the channel's total
42827 * Because halving the liquidity bounds grows the uncertainty on the channel's liquidity,
42828 * the penalty for an amount within the new bounds may change. See the [`ProbabilisticScorer`]
42829 * struct documentation for more info on the way the liquidity bounds are used.
42831 * For example, if the channel's capacity is 1 million sats, and the current upper and lower
42832 * liquidity bounds are 200,000 sats and 600,000 sats, after this amount of time the upper
42833 * and lower liquidity bounds will be decayed to 100,000 and 800,000 sats.
42835 * Default value: 6 hours
42839 * When built with the `no-std` feature, time will never elapse. Therefore, the channel
42840 * liquidity knowledge will never decay except when the bounds cross.
42842 uint64_t ProbabilisticScoringDecayParameters_get_liquidity_offset_half_life(const struct LDKProbabilisticScoringDecayParameters *NONNULL_PTR this_ptr);
42845 * Whenever this amount of time elapses since the last update to a channel's liquidity bounds,
42846 * the distance from the bounds to \"zero\" is cut in half. In other words, the lower-bound on
42847 * the available liquidity is halved and the upper-bound moves half-way to the channel's total
42850 * Because halving the liquidity bounds grows the uncertainty on the channel's liquidity,
42851 * the penalty for an amount within the new bounds may change. See the [`ProbabilisticScorer`]
42852 * struct documentation for more info on the way the liquidity bounds are used.
42854 * For example, if the channel's capacity is 1 million sats, and the current upper and lower
42855 * liquidity bounds are 200,000 sats and 600,000 sats, after this amount of time the upper
42856 * and lower liquidity bounds will be decayed to 100,000 and 800,000 sats.
42858 * Default value: 6 hours
42862 * When built with the `no-std` feature, time will never elapse. Therefore, the channel
42863 * liquidity knowledge will never decay except when the bounds cross.
42865 void ProbabilisticScoringDecayParameters_set_liquidity_offset_half_life(struct LDKProbabilisticScoringDecayParameters *NONNULL_PTR this_ptr, uint64_t val);
42868 * Constructs a new ProbabilisticScoringDecayParameters given each field
42870 MUST_USE_RES struct LDKProbabilisticScoringDecayParameters ProbabilisticScoringDecayParameters_new(uint64_t historical_no_updates_half_life_arg, uint64_t liquidity_offset_half_life_arg);
42873 * Creates a copy of the ProbabilisticScoringDecayParameters
42875 struct LDKProbabilisticScoringDecayParameters ProbabilisticScoringDecayParameters_clone(const struct LDKProbabilisticScoringDecayParameters *NONNULL_PTR orig);
42878 * Creates a "default" ProbabilisticScoringDecayParameters. See struct and individual field documentaiton for details on which values are used.
42880 MUST_USE_RES struct LDKProbabilisticScoringDecayParameters ProbabilisticScoringDecayParameters_default(void);
42883 * Creates a new scorer using the given scoring parameters for sending payments from a node
42884 * through a network graph.
42886 MUST_USE_RES struct LDKProbabilisticScorer ProbabilisticScorer_new(struct LDKProbabilisticScoringDecayParameters decay_params, const struct LDKNetworkGraph *NONNULL_PTR network_graph, struct LDKLogger logger);
42889 * Dump the contents of this scorer into the configured logger.
42891 * Note that this writes roughly one line per channel for which we have a liquidity estimate,
42892 * which may be a substantial amount of log output.
42894 void ProbabilisticScorer_debug_log_liquidity_stats(const struct LDKProbabilisticScorer *NONNULL_PTR this_arg);
42897 * Query the estimated minimum and maximum liquidity available for sending a payment over the
42898 * channel with `scid` towards the given `target` node.
42900 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);
42903 * Query the historical estimated minimum and maximum liquidity available for sending a
42904 * payment over the channel with `scid` towards the given `target` node.
42906 * Returns two sets of 32 buckets. The first set describes the lower-bound liquidity history,
42907 * the second set describes the upper-bound liquidity history. Each bucket describes the
42908 * relative frequency at which we've seen a liquidity bound in the bucket's range relative to
42909 * the channel's total capacity, on an arbitrary scale. Because the values are slowly decayed,
42910 * more recent data points are weighted more heavily than older datapoints.
42912 * Note that the range of each bucket varies by its location to provide more granular results
42913 * at the edges of a channel's capacity, where it is more likely to sit.
42915 * When scoring, the estimated probability that an upper-/lower-bound lies in a given bucket
42916 * is calculated by dividing that bucket's value with the total value of all buckets.
42918 * For example, using a lower bucket count for illustrative purposes, a value of
42919 * `[0, 0, 0, ..., 0, 32]` indicates that we believe the probability of a bound being very
42920 * close to the channel's capacity to be 100%, and have never (recently) seen it in any other
42921 * bucket. A value of `[31, 0, 0, ..., 0, 0, 32]` indicates we've seen the bound being both
42922 * in the top and bottom bucket, and roughly with similar (recent) frequency.
42924 * Because the datapoints are decayed slowly over time, values will eventually return to
42925 * `Some(([1; 32], [1; 32]))` and then to `None` once no datapoints remain.
42927 * In order to fetch a single success probability from the buckets provided here, as used in
42928 * the scoring model, see [`Self::historical_estimated_payment_success_probability`].
42930 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);
42933 * Query the probability of payment success sending the given `amount_msat` over the channel
42934 * with `scid` towards the given `target` node, based on the historical estimated liquidity
42937 * These are the same bounds as returned by
42938 * [`Self::historical_estimated_channel_liquidity_probabilities`] (but not those returned by
42939 * [`Self::estimated_channel_liquidity_range`]).
42941 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);
42944 * Constructs a new ScoreLookUp which calls the relevant methods on this_arg.
42945 * This copies the `inner` pointer in this_arg and thus the returned ScoreLookUp must be freed before this_arg is
42947 struct LDKScoreLookUp ProbabilisticScorer_as_ScoreLookUp(const struct LDKProbabilisticScorer *NONNULL_PTR this_arg);
42950 * Constructs a new ScoreUpdate which calls the relevant methods on this_arg.
42951 * This copies the `inner` pointer in this_arg and thus the returned ScoreUpdate must be freed before this_arg is
42953 struct LDKScoreUpdate ProbabilisticScorer_as_ScoreUpdate(const struct LDKProbabilisticScorer *NONNULL_PTR this_arg);
42956 * Constructs a new Score which calls the relevant methods on this_arg.
42957 * This copies the `inner` pointer in this_arg and thus the returned Score must be freed before this_arg is
42959 struct LDKScore ProbabilisticScorer_as_Score(const struct LDKProbabilisticScorer *NONNULL_PTR this_arg);
42962 * Serialize the ProbabilisticScorer object into a byte array which can be read by ProbabilisticScorer_read
42964 struct LDKCVec_u8Z ProbabilisticScorer_write(const struct LDKProbabilisticScorer *NONNULL_PTR obj);
42967 * Read a ProbabilisticScorer from a byte array, created by ProbabilisticScorer_write
42969 struct LDKCResult_ProbabilisticScorerDecodeErrorZ ProbabilisticScorer_read(struct LDKu8slice ser, struct LDKProbabilisticScoringDecayParameters arg_a, const struct LDKNetworkGraph *NONNULL_PTR arg_b, struct LDKLogger arg_c);
42972 * Frees any resources used by the DelayedPaymentOutputDescriptor, if is_owned is set and inner is non-NULL.
42974 void DelayedPaymentOutputDescriptor_free(struct LDKDelayedPaymentOutputDescriptor this_obj);
42977 * The outpoint which is spendable.
42979 struct LDKOutPoint DelayedPaymentOutputDescriptor_get_outpoint(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr);
42982 * The outpoint which is spendable.
42984 void DelayedPaymentOutputDescriptor_set_outpoint(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKOutPoint val);
42987 * Per commitment point to derive the delayed payment key by key holder.
42989 struct LDKPublicKey DelayedPaymentOutputDescriptor_get_per_commitment_point(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr);
42992 * Per commitment point to derive the delayed payment key by key holder.
42994 void DelayedPaymentOutputDescriptor_set_per_commitment_point(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKPublicKey val);
42997 * The `nSequence` value which must be set in the spending input to satisfy the `OP_CSV` in
42998 * the witness_script.
43000 uint16_t DelayedPaymentOutputDescriptor_get_to_self_delay(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr);
43003 * The `nSequence` value which must be set in the spending input to satisfy the `OP_CSV` in
43004 * the witness_script.
43006 void DelayedPaymentOutputDescriptor_set_to_self_delay(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, uint16_t val);
43009 * The output which is referenced by the given outpoint.
43011 struct LDKTxOut DelayedPaymentOutputDescriptor_get_output(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr);
43014 * The output which is referenced by the given outpoint.
43016 void DelayedPaymentOutputDescriptor_set_output(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKTxOut val);
43019 * The revocation point specific to the commitment transaction which was broadcast. Used to
43020 * derive the witnessScript for this output.
43022 struct LDKPublicKey DelayedPaymentOutputDescriptor_get_revocation_pubkey(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr);
43025 * The revocation point specific to the commitment transaction which was broadcast. Used to
43026 * derive the witnessScript for this output.
43028 void DelayedPaymentOutputDescriptor_set_revocation_pubkey(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKPublicKey val);
43031 * Arbitrary identification information returned by a call to [`ChannelSigner::channel_keys_id`].
43032 * This may be useful in re-deriving keys used in the channel to spend the output.
43034 const uint8_t (*DelayedPaymentOutputDescriptor_get_channel_keys_id(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr))[32];
43037 * Arbitrary identification information returned by a call to [`ChannelSigner::channel_keys_id`].
43038 * This may be useful in re-deriving keys used in the channel to spend the output.
43040 void DelayedPaymentOutputDescriptor_set_channel_keys_id(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
43043 * The value of the channel which this output originated from, possibly indirectly.
43045 uint64_t DelayedPaymentOutputDescriptor_get_channel_value_satoshis(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr);
43048 * The value of the channel which this output originated from, possibly indirectly.
43050 void DelayedPaymentOutputDescriptor_set_channel_value_satoshis(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, uint64_t val);
43053 * Constructs a new DelayedPaymentOutputDescriptor given each field
43055 MUST_USE_RES struct LDKDelayedPaymentOutputDescriptor DelayedPaymentOutputDescriptor_new(struct LDKOutPoint outpoint_arg, struct LDKPublicKey per_commitment_point_arg, uint16_t to_self_delay_arg, struct LDKTxOut output_arg, struct LDKPublicKey revocation_pubkey_arg, struct LDKThirtyTwoBytes channel_keys_id_arg, uint64_t channel_value_satoshis_arg);
43058 * Creates a copy of the DelayedPaymentOutputDescriptor
43060 struct LDKDelayedPaymentOutputDescriptor DelayedPaymentOutputDescriptor_clone(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR orig);
43063 * Generates a non-cryptographic 64-bit hash of the DelayedPaymentOutputDescriptor.
43065 uint64_t DelayedPaymentOutputDescriptor_hash(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR o);
43068 * Checks if two DelayedPaymentOutputDescriptors contain equal inner contents.
43069 * This ignores pointers and is_owned flags and looks at the values in fields.
43070 * Two objects with NULL inner values will be considered "equal" here.
43072 bool DelayedPaymentOutputDescriptor_eq(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR a, const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR b);
43075 * Serialize the DelayedPaymentOutputDescriptor object into a byte array which can be read by DelayedPaymentOutputDescriptor_read
43077 struct LDKCVec_u8Z DelayedPaymentOutputDescriptor_write(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR obj);
43080 * Read a DelayedPaymentOutputDescriptor from a byte array, created by DelayedPaymentOutputDescriptor_write
43082 struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ DelayedPaymentOutputDescriptor_read(struct LDKu8slice ser);
43085 * Frees any resources used by the StaticPaymentOutputDescriptor, if is_owned is set and inner is non-NULL.
43087 void StaticPaymentOutputDescriptor_free(struct LDKStaticPaymentOutputDescriptor this_obj);
43090 * The outpoint which is spendable.
43092 struct LDKOutPoint StaticPaymentOutputDescriptor_get_outpoint(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr);
43095 * The outpoint which is spendable.
43097 void StaticPaymentOutputDescriptor_set_outpoint(struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKOutPoint val);
43100 * The output which is referenced by the given outpoint.
43102 struct LDKTxOut StaticPaymentOutputDescriptor_get_output(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr);
43105 * The output which is referenced by the given outpoint.
43107 void StaticPaymentOutputDescriptor_set_output(struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKTxOut val);
43110 * Arbitrary identification information returned by a call to [`ChannelSigner::channel_keys_id`].
43111 * This may be useful in re-deriving keys used in the channel to spend the output.
43113 const uint8_t (*StaticPaymentOutputDescriptor_get_channel_keys_id(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr))[32];
43116 * Arbitrary identification information returned by a call to [`ChannelSigner::channel_keys_id`].
43117 * This may be useful in re-deriving keys used in the channel to spend the output.
43119 void StaticPaymentOutputDescriptor_set_channel_keys_id(struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
43122 * The value of the channel which this transactions spends.
43124 uint64_t StaticPaymentOutputDescriptor_get_channel_value_satoshis(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr);
43127 * The value of the channel which this transactions spends.
43129 void StaticPaymentOutputDescriptor_set_channel_value_satoshis(struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr, uint64_t val);
43132 * The necessary channel parameters that need to be provided to the re-derived signer through
43133 * [`ChannelSigner::provide_channel_parameters`].
43135 * Added as optional, but always `Some` if the descriptor was produced in v0.0.117 or later.
43137 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
43139 struct LDKChannelTransactionParameters StaticPaymentOutputDescriptor_get_channel_transaction_parameters(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr);
43142 * The necessary channel parameters that need to be provided to the re-derived signer through
43143 * [`ChannelSigner::provide_channel_parameters`].
43145 * Added as optional, but always `Some` if the descriptor was produced in v0.0.117 or later.
43147 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
43149 void StaticPaymentOutputDescriptor_set_channel_transaction_parameters(struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKChannelTransactionParameters val);
43152 * Constructs a new StaticPaymentOutputDescriptor given each field
43154 * Note that channel_transaction_parameters_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
43156 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);
43159 * Creates a copy of the StaticPaymentOutputDescriptor
43161 struct LDKStaticPaymentOutputDescriptor StaticPaymentOutputDescriptor_clone(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR orig);
43164 * Generates a non-cryptographic 64-bit hash of the StaticPaymentOutputDescriptor.
43166 uint64_t StaticPaymentOutputDescriptor_hash(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR o);
43169 * Checks if two StaticPaymentOutputDescriptors contain equal inner contents.
43170 * This ignores pointers and is_owned flags and looks at the values in fields.
43171 * Two objects with NULL inner values will be considered "equal" here.
43173 bool StaticPaymentOutputDescriptor_eq(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR a, const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR b);
43176 * Returns the `witness_script` of the spendable output.
43178 * Note that this will only return `Some` for [`StaticPaymentOutputDescriptor`]s that
43179 * originated from an anchor outputs channel, as they take the form of a P2WSH script.
43181 MUST_USE_RES struct LDKCOption_CVec_u8ZZ StaticPaymentOutputDescriptor_witness_script(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_arg);
43184 * The maximum length a well-formed witness spending one of these should have.
43185 * Note: If you have the grind_signatures feature enabled, this will be at least 1 byte
43188 MUST_USE_RES uintptr_t StaticPaymentOutputDescriptor_max_witness_length(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_arg);
43191 * Serialize the StaticPaymentOutputDescriptor object into a byte array which can be read by StaticPaymentOutputDescriptor_read
43193 struct LDKCVec_u8Z StaticPaymentOutputDescriptor_write(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR obj);
43196 * Read a StaticPaymentOutputDescriptor from a byte array, created by StaticPaymentOutputDescriptor_write
43198 struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ StaticPaymentOutputDescriptor_read(struct LDKu8slice ser);
43201 * Frees any resources used by the SpendableOutputDescriptor
43203 void SpendableOutputDescriptor_free(struct LDKSpendableOutputDescriptor this_ptr);
43206 * Creates a copy of the SpendableOutputDescriptor
43208 struct LDKSpendableOutputDescriptor SpendableOutputDescriptor_clone(const struct LDKSpendableOutputDescriptor *NONNULL_PTR orig);
43211 * Utility method to constructs a new StaticOutput-variant SpendableOutputDescriptor
43213 struct LDKSpendableOutputDescriptor SpendableOutputDescriptor_static_output(struct LDKOutPoint outpoint, struct LDKTxOut output);
43216 * Utility method to constructs a new DelayedPaymentOutput-variant SpendableOutputDescriptor
43218 struct LDKSpendableOutputDescriptor SpendableOutputDescriptor_delayed_payment_output(struct LDKDelayedPaymentOutputDescriptor a);
43221 * Utility method to constructs a new StaticPaymentOutput-variant SpendableOutputDescriptor
43223 struct LDKSpendableOutputDescriptor SpendableOutputDescriptor_static_payment_output(struct LDKStaticPaymentOutputDescriptor a);
43226 * Generates a non-cryptographic 64-bit hash of the SpendableOutputDescriptor.
43228 uint64_t SpendableOutputDescriptor_hash(const struct LDKSpendableOutputDescriptor *NONNULL_PTR o);
43231 * Checks if two SpendableOutputDescriptors contain equal inner contents.
43232 * This ignores pointers and is_owned flags and looks at the values in fields.
43234 bool SpendableOutputDescriptor_eq(const struct LDKSpendableOutputDescriptor *NONNULL_PTR a, const struct LDKSpendableOutputDescriptor *NONNULL_PTR b);
43237 * Serialize the SpendableOutputDescriptor object into a byte array which can be read by SpendableOutputDescriptor_read
43239 struct LDKCVec_u8Z SpendableOutputDescriptor_write(const struct LDKSpendableOutputDescriptor *NONNULL_PTR obj);
43242 * Read a SpendableOutputDescriptor from a byte array, created by SpendableOutputDescriptor_write
43244 struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ SpendableOutputDescriptor_read(struct LDKu8slice ser);
43247 * Creates an unsigned [`PartiallySignedTransaction`] which spends the given descriptors to
43248 * the given outputs, plus an output to the given change destination (if sufficient
43249 * change value remains). The PSBT will have a feerate, at least, of the given value.
43251 * The `locktime` argument is used to set the transaction's locktime. If `None`, the
43252 * transaction will have a locktime of 0. It it recommended to set this to the current block
43253 * height to avoid fee sniping, unless you have some specific reason to use a different
43256 * Returns the PSBT and expected max transaction weight.
43258 * Returns `Err(())` if the output value is greater than the input value minus required fee,
43259 * if a descriptor was duplicated, or if an output descriptor `script_pubkey`
43260 * does not match the one we can spend.
43262 * We do not enforce that outputs meet the dust limit or that any output scripts are standard.
43264 MUST_USE_RES struct LDKCResult_C2Tuple_CVec_u8ZusizeZNoneZ SpendableOutputDescriptor_create_spendable_outputs_psbt(struct LDKCVec_SpendableOutputDescriptorZ descriptors, struct LDKCVec_TxOutZ outputs, struct LDKCVec_u8Z change_destination_script, uint32_t feerate_sat_per_1000_weight, struct LDKCOption_u32Z locktime);
43267 * Calls the free function if one is set
43269 void ChannelSigner_free(struct LDKChannelSigner this_ptr);
43272 * Calls the free function if one is set
43274 void EcdsaChannelSigner_free(struct LDKEcdsaChannelSigner this_ptr);
43277 * Creates a copy of a WriteableEcdsaChannelSigner
43279 struct LDKWriteableEcdsaChannelSigner WriteableEcdsaChannelSigner_clone(const struct LDKWriteableEcdsaChannelSigner *NONNULL_PTR orig);
43282 * Calls the free function if one is set
43284 void WriteableEcdsaChannelSigner_free(struct LDKWriteableEcdsaChannelSigner this_ptr);
43287 * Creates a copy of the Recipient
43289 enum LDKRecipient Recipient_clone(const enum LDKRecipient *NONNULL_PTR orig);
43292 * Utility method to constructs a new Node-variant Recipient
43294 enum LDKRecipient Recipient_node(void);
43297 * Utility method to constructs a new PhantomNode-variant Recipient
43299 enum LDKRecipient Recipient_phantom_node(void);
43302 * Calls the free function if one is set
43304 void EntropySource_free(struct LDKEntropySource this_ptr);
43307 * Calls the free function if one is set
43309 void NodeSigner_free(struct LDKNodeSigner this_ptr);
43312 * Calls the free function if one is set
43314 void SignerProvider_free(struct LDKSignerProvider this_ptr);
43317 * Frees any resources used by the InMemorySigner, if is_owned is set and inner is non-NULL.
43319 void InMemorySigner_free(struct LDKInMemorySigner this_obj);
43322 * Holder secret key in the 2-of-2 multisig script of a channel. This key also backs the
43323 * holder's anchor output in a commitment transaction, if one is present.
43325 const uint8_t (*InMemorySigner_get_funding_key(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32];
43328 * Holder secret key in the 2-of-2 multisig script of a channel. This key also backs the
43329 * holder's anchor output in a commitment transaction, if one is present.
43331 void InMemorySigner_set_funding_key(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKSecretKey val);
43334 * Holder secret key for blinded revocation pubkey.
43336 const uint8_t (*InMemorySigner_get_revocation_base_key(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32];
43339 * Holder secret key for blinded revocation pubkey.
43341 void InMemorySigner_set_revocation_base_key(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKSecretKey val);
43344 * Holder secret key used for our balance in counterparty-broadcasted commitment transactions.
43346 const uint8_t (*InMemorySigner_get_payment_key(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32];
43349 * Holder secret key used for our balance in counterparty-broadcasted commitment transactions.
43351 void InMemorySigner_set_payment_key(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKSecretKey val);
43354 * Holder secret key used in an HTLC transaction.
43356 const uint8_t (*InMemorySigner_get_delayed_payment_base_key(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32];
43359 * Holder secret key used in an HTLC transaction.
43361 void InMemorySigner_set_delayed_payment_base_key(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKSecretKey val);
43364 * Holder HTLC secret key used in commitment transaction HTLC outputs.
43366 const uint8_t (*InMemorySigner_get_htlc_base_key(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32];
43369 * Holder HTLC secret key used in commitment transaction HTLC outputs.
43371 void InMemorySigner_set_htlc_base_key(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKSecretKey val);
43376 const uint8_t (*InMemorySigner_get_commitment_seed(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32];
43381 void InMemorySigner_set_commitment_seed(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
43384 * Creates a copy of the InMemorySigner
43386 struct LDKInMemorySigner InMemorySigner_clone(const struct LDKInMemorySigner *NONNULL_PTR orig);
43389 * Creates a new [`InMemorySigner`].
43391 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);
43394 * Returns the counterparty's pubkeys.
43396 * Will return `None` if [`ChannelSigner::provide_channel_parameters`] has not been called.
43397 * In general, this is safe to `unwrap` only in [`ChannelSigner`] implementation.
43399 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
43401 MUST_USE_RES struct LDKChannelPublicKeys InMemorySigner_counterparty_pubkeys(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
43404 * Returns the `contest_delay` value specified by our counterparty and applied on holder-broadcastable
43405 * transactions, i.e., the amount of time that we have to wait to recover our funds if we
43406 * broadcast a transaction.
43408 * Will return `None` if [`ChannelSigner::provide_channel_parameters`] has not been called.
43409 * In general, this is safe to `unwrap` only in [`ChannelSigner`] implementation.
43411 MUST_USE_RES struct LDKCOption_u16Z InMemorySigner_counterparty_selected_contest_delay(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
43414 * Returns the `contest_delay` value specified by us and applied on transactions broadcastable
43415 * by our counterparty, i.e., the amount of time that they have to wait to recover their funds
43416 * if they broadcast a transaction.
43418 * Will return `None` if [`ChannelSigner::provide_channel_parameters`] has not been called.
43419 * In general, this is safe to `unwrap` only in [`ChannelSigner`] implementation.
43421 MUST_USE_RES struct LDKCOption_u16Z InMemorySigner_holder_selected_contest_delay(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
43424 * Returns whether the holder is the initiator.
43426 * Will return `None` if [`ChannelSigner::provide_channel_parameters`] has not been called.
43427 * In general, this is safe to `unwrap` only in [`ChannelSigner`] implementation.
43429 MUST_USE_RES struct LDKCOption_boolZ InMemorySigner_is_outbound(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
43434 * Will return `None` if [`ChannelSigner::provide_channel_parameters`] has not been called.
43435 * In general, this is safe to `unwrap` only in [`ChannelSigner`] implementation.
43437 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
43439 MUST_USE_RES struct LDKOutPoint InMemorySigner_funding_outpoint(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
43442 * Returns a [`ChannelTransactionParameters`] for this channel, to be used when verifying or
43443 * building transactions.
43445 * Will return `None` if [`ChannelSigner::provide_channel_parameters`] has not been called.
43446 * In general, this is safe to `unwrap` only in [`ChannelSigner`] implementation.
43448 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
43450 MUST_USE_RES struct LDKChannelTransactionParameters InMemorySigner_get_channel_parameters(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
43453 * Returns the channel type features of the channel parameters. Should be helpful for
43454 * determining a channel's category, i. e. legacy/anchors/taproot/etc.
43456 * Will return `None` if [`ChannelSigner::provide_channel_parameters`] has not been called.
43457 * In general, this is safe to `unwrap` only in [`ChannelSigner`] implementation.
43459 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
43461 MUST_USE_RES struct LDKChannelTypeFeatures InMemorySigner_channel_type_features(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
43464 * Sign the single input of `spend_tx` at index `input_idx`, which spends the output described
43465 * by `descriptor`, returning the witness stack for the input.
43467 * Returns an error if the input at `input_idx` does not exist, has a non-empty `script_sig`,
43468 * is not spending the outpoint described by [`descriptor.outpoint`],
43469 * or if an output descriptor `script_pubkey` does not match the one we can spend.
43471 * [`descriptor.outpoint`]: StaticPaymentOutputDescriptor::outpoint
43473 MUST_USE_RES struct LDKCResult_CVec_CVec_u8ZZNoneZ InMemorySigner_sign_counterparty_payment_input(const struct LDKInMemorySigner *NONNULL_PTR this_arg, struct LDKTransaction spend_tx, uintptr_t input_idx, const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR descriptor);
43476 * Sign the single input of `spend_tx` at index `input_idx` which spends the output
43477 * described by `descriptor`, returning the witness stack for the input.
43479 * Returns an error if the input at `input_idx` does not exist, has a non-empty `script_sig`,
43480 * is not spending the outpoint described by [`descriptor.outpoint`], does not have a
43481 * sequence set to [`descriptor.to_self_delay`], or if an output descriptor
43482 * `script_pubkey` does not match the one we can spend.
43484 * [`descriptor.outpoint`]: DelayedPaymentOutputDescriptor::outpoint
43485 * [`descriptor.to_self_delay`]: DelayedPaymentOutputDescriptor::to_self_delay
43487 MUST_USE_RES struct LDKCResult_CVec_CVec_u8ZZNoneZ InMemorySigner_sign_dynamic_p2wsh_input(const struct LDKInMemorySigner *NONNULL_PTR this_arg, struct LDKTransaction spend_tx, uintptr_t input_idx, const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR descriptor);
43490 * Constructs a new EntropySource which calls the relevant methods on this_arg.
43491 * This copies the `inner` pointer in this_arg and thus the returned EntropySource must be freed before this_arg is
43493 struct LDKEntropySource InMemorySigner_as_EntropySource(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
43496 * Constructs a new ChannelSigner which calls the relevant methods on this_arg.
43497 * This copies the `inner` pointer in this_arg and thus the returned ChannelSigner must be freed before this_arg is
43499 struct LDKChannelSigner InMemorySigner_as_ChannelSigner(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
43502 * Constructs a new EcdsaChannelSigner which calls the relevant methods on this_arg.
43503 * This copies the `inner` pointer in this_arg and thus the returned EcdsaChannelSigner must be freed before this_arg is
43505 struct LDKEcdsaChannelSigner InMemorySigner_as_EcdsaChannelSigner(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
43508 * Constructs a new WriteableEcdsaChannelSigner which calls the relevant methods on this_arg.
43509 * This copies the `inner` pointer in this_arg and thus the returned WriteableEcdsaChannelSigner must be freed before this_arg is
43511 struct LDKWriteableEcdsaChannelSigner InMemorySigner_as_WriteableEcdsaChannelSigner(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
43514 * Serialize the InMemorySigner object into a byte array which can be read by InMemorySigner_read
43516 struct LDKCVec_u8Z InMemorySigner_write(const struct LDKInMemorySigner *NONNULL_PTR obj);
43519 * Read a InMemorySigner from a byte array, created by InMemorySigner_write
43521 struct LDKCResult_InMemorySignerDecodeErrorZ InMemorySigner_read(struct LDKu8slice ser, struct LDKEntropySource arg);
43524 * Frees any resources used by the KeysManager, if is_owned is set and inner is non-NULL.
43526 void KeysManager_free(struct LDKKeysManager this_obj);
43529 * Constructs a [`KeysManager`] from a 32-byte seed. If the seed is in some way biased (e.g.,
43530 * your CSRNG is busted) this may panic (but more importantly, you will possibly lose funds).
43531 * `starting_time` isn't strictly required to actually be a time, but it must absolutely,
43532 * without a doubt, be unique to this instance. ie if you start multiple times with the same
43533 * `seed`, `starting_time` must be unique to each run. Thus, the easiest way to achieve this
43534 * is to simply use the current time (with very high precision).
43536 * The `seed` MUST be backed up safely prior to use so that the keys can be re-created, however,
43537 * obviously, `starting_time` should be unique every time you reload the library - it is only
43538 * used to generate new ephemeral key data (which will be stored by the individual channel if
43541 * Note that the seed is required to recover certain on-chain funds independent of
43542 * [`ChannelMonitor`] data, though a current copy of [`ChannelMonitor`] data is also required
43543 * for any channel, and some on-chain during-closing funds.
43545 * [`ChannelMonitor`]: crate::chain::channelmonitor::ChannelMonitor
43547 MUST_USE_RES struct LDKKeysManager KeysManager_new(const uint8_t (*seed)[32], uint64_t starting_time_secs, uint32_t starting_time_nanos);
43550 * Gets the \"node_id\" secret key used to sign gossip announcements, decode onion data, etc.
43552 MUST_USE_RES struct LDKSecretKey KeysManager_get_node_secret_key(const struct LDKKeysManager *NONNULL_PTR this_arg);
43555 * Derive an old [`WriteableEcdsaChannelSigner`] containing per-channel secrets based on a key derivation parameters.
43557 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]);
43560 * Signs the given [`PartiallySignedTransaction`] which spends the given [`SpendableOutputDescriptor`]s.
43561 * The resulting inputs will be finalized and the PSBT will be ready for broadcast if there
43562 * are no other inputs that need signing.
43564 * Returns `Err(())` if the PSBT is missing a descriptor or if we fail to sign.
43566 * May panic if the [`SpendableOutputDescriptor`]s were not generated by channels which used
43567 * this [`KeysManager`] or one of the [`InMemorySigner`] created by this [`KeysManager`].
43569 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);
43572 * Creates a [`Transaction`] which spends the given descriptors to the given outputs, plus an
43573 * output to the given change destination (if sufficient change value remains). The
43574 * transaction will have a feerate, at least, of the given value.
43576 * The `locktime` argument is used to set the transaction's locktime. If `None`, the
43577 * transaction will have a locktime of 0. It it recommended to set this to the current block
43578 * height to avoid fee sniping, unless you have some specific reason to use a different
43581 * Returns `Err(())` if the output value is greater than the input value minus required fee,
43582 * if a descriptor was duplicated, or if an output descriptor `script_pubkey`
43583 * does not match the one we can spend.
43585 * We do not enforce that outputs meet the dust limit or that any output scripts are standard.
43587 * May panic if the [`SpendableOutputDescriptor`]s were not generated by channels which used
43588 * this [`KeysManager`] or one of the [`InMemorySigner`] created by this [`KeysManager`].
43590 MUST_USE_RES struct LDKCResult_TransactionNoneZ KeysManager_spend_spendable_outputs(const struct LDKKeysManager *NONNULL_PTR this_arg, struct LDKCVec_SpendableOutputDescriptorZ descriptors, struct LDKCVec_TxOutZ outputs, struct LDKCVec_u8Z change_destination_script, uint32_t feerate_sat_per_1000_weight, struct LDKCOption_u32Z locktime);
43593 * Constructs a new EntropySource which calls the relevant methods on this_arg.
43594 * This copies the `inner` pointer in this_arg and thus the returned EntropySource must be freed before this_arg is
43596 struct LDKEntropySource KeysManager_as_EntropySource(const struct LDKKeysManager *NONNULL_PTR this_arg);
43599 * Constructs a new NodeSigner which calls the relevant methods on this_arg.
43600 * This copies the `inner` pointer in this_arg and thus the returned NodeSigner must be freed before this_arg is
43602 struct LDKNodeSigner KeysManager_as_NodeSigner(const struct LDKKeysManager *NONNULL_PTR this_arg);
43605 * Constructs a new SignerProvider which calls the relevant methods on this_arg.
43606 * This copies the `inner` pointer in this_arg and thus the returned SignerProvider must be freed before this_arg is
43608 struct LDKSignerProvider KeysManager_as_SignerProvider(const struct LDKKeysManager *NONNULL_PTR this_arg);
43611 * Frees any resources used by the PhantomKeysManager, if is_owned is set and inner is non-NULL.
43613 void PhantomKeysManager_free(struct LDKPhantomKeysManager this_obj);
43616 * Constructs a new EntropySource which calls the relevant methods on this_arg.
43617 * This copies the `inner` pointer in this_arg and thus the returned EntropySource must be freed before this_arg is
43619 struct LDKEntropySource PhantomKeysManager_as_EntropySource(const struct LDKPhantomKeysManager *NONNULL_PTR this_arg);
43622 * Constructs a new NodeSigner which calls the relevant methods on this_arg.
43623 * This copies the `inner` pointer in this_arg and thus the returned NodeSigner must be freed before this_arg is
43625 struct LDKNodeSigner PhantomKeysManager_as_NodeSigner(const struct LDKPhantomKeysManager *NONNULL_PTR this_arg);
43628 * Constructs a new SignerProvider which calls the relevant methods on this_arg.
43629 * This copies the `inner` pointer in this_arg and thus the returned SignerProvider must be freed before this_arg is
43631 struct LDKSignerProvider PhantomKeysManager_as_SignerProvider(const struct LDKPhantomKeysManager *NONNULL_PTR this_arg);
43634 * Constructs a [`PhantomKeysManager`] given a 32-byte seed and an additional `cross_node_seed`
43635 * that is shared across all nodes that intend to participate in [phantom node payments]
43638 * See [`KeysManager::new`] for more information on `seed`, `starting_time_secs`, and
43639 * `starting_time_nanos`.
43641 * `cross_node_seed` must be the same across all phantom payment-receiving nodes and also the
43642 * same across restarts, or else inbound payments may fail.
43644 * [phantom node payments]: PhantomKeysManager
43646 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]);
43649 * See [`KeysManager::spend_spendable_outputs`] for documentation on this method.
43651 MUST_USE_RES struct LDKCResult_TransactionNoneZ PhantomKeysManager_spend_spendable_outputs(const struct LDKPhantomKeysManager *NONNULL_PTR this_arg, struct LDKCVec_SpendableOutputDescriptorZ descriptors, struct LDKCVec_TxOutZ outputs, struct LDKCVec_u8Z change_destination_script, uint32_t feerate_sat_per_1000_weight, struct LDKCOption_u32Z locktime);
43654 * See [`KeysManager::derive_channel_keys`] for documentation on this method.
43656 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]);
43659 * Gets the \"node_id\" secret key used to sign gossip announcements, decode onion data, etc.
43661 MUST_USE_RES struct LDKSecretKey PhantomKeysManager_get_node_secret_key(const struct LDKPhantomKeysManager *NONNULL_PTR this_arg);
43664 * Gets the \"node_id\" secret key of the phantom node used to sign invoices, decode the
43665 * last-hop onion data, etc.
43667 MUST_USE_RES struct LDKSecretKey PhantomKeysManager_get_phantom_node_secret_key(const struct LDKPhantomKeysManager *NONNULL_PTR this_arg);
43670 * Frees any resources used by the OnionMessenger, if is_owned is set and inner is non-NULL.
43672 void OnionMessenger_free(struct LDKOnionMessenger this_obj);
43675 * Calls the free function if one is set
43677 void MessageRouter_free(struct LDKMessageRouter this_ptr);
43680 * Frees any resources used by the DefaultMessageRouter, if is_owned is set and inner is non-NULL.
43682 void DefaultMessageRouter_free(struct LDKDefaultMessageRouter this_obj);
43685 * Constructs a new DefaultMessageRouter given each field
43687 MUST_USE_RES struct LDKDefaultMessageRouter DefaultMessageRouter_new(void);
43690 * Constructs a new MessageRouter which calls the relevant methods on this_arg.
43691 * This copies the `inner` pointer in this_arg and thus the returned MessageRouter must be freed before this_arg is
43693 struct LDKMessageRouter DefaultMessageRouter_as_MessageRouter(const struct LDKDefaultMessageRouter *NONNULL_PTR this_arg);
43696 * Frees any resources used by the OnionMessagePath, if is_owned is set and inner is non-NULL.
43698 void OnionMessagePath_free(struct LDKOnionMessagePath this_obj);
43701 * Nodes on the path between the sender and the destination.
43703 * Returns a copy of the field.
43705 struct LDKCVec_PublicKeyZ OnionMessagePath_get_intermediate_nodes(const struct LDKOnionMessagePath *NONNULL_PTR this_ptr);
43708 * Nodes on the path between the sender and the destination.
43710 void OnionMessagePath_set_intermediate_nodes(struct LDKOnionMessagePath *NONNULL_PTR this_ptr, struct LDKCVec_PublicKeyZ val);
43713 * The recipient of the message.
43715 struct LDKDestination OnionMessagePath_get_destination(const struct LDKOnionMessagePath *NONNULL_PTR this_ptr);
43718 * The recipient of the message.
43720 void OnionMessagePath_set_destination(struct LDKOnionMessagePath *NONNULL_PTR this_ptr, struct LDKDestination val);
43723 * Constructs a new OnionMessagePath given each field
43725 MUST_USE_RES struct LDKOnionMessagePath OnionMessagePath_new(struct LDKCVec_PublicKeyZ intermediate_nodes_arg, struct LDKDestination destination_arg);
43728 * Creates a copy of the OnionMessagePath
43730 struct LDKOnionMessagePath OnionMessagePath_clone(const struct LDKOnionMessagePath *NONNULL_PTR orig);
43733 * Frees any resources used by the Destination
43735 void Destination_free(struct LDKDestination this_ptr);
43738 * Creates a copy of the Destination
43740 struct LDKDestination Destination_clone(const struct LDKDestination *NONNULL_PTR orig);
43743 * Utility method to constructs a new Node-variant Destination
43745 struct LDKDestination Destination_node(struct LDKPublicKey a);
43748 * Utility method to constructs a new BlindedPath-variant Destination
43750 struct LDKDestination Destination_blinded_path(struct LDKBlindedPath a);
43753 * Frees any resources used by the SendError
43755 void SendError_free(struct LDKSendError this_ptr);
43758 * Creates a copy of the SendError
43760 struct LDKSendError SendError_clone(const struct LDKSendError *NONNULL_PTR orig);
43763 * Utility method to constructs a new Secp256k1-variant SendError
43765 struct LDKSendError SendError_secp256k1(enum LDKSecp256k1Error a);
43768 * Utility method to constructs a new TooBigPacket-variant SendError
43770 struct LDKSendError SendError_too_big_packet(void);
43773 * Utility method to constructs a new TooFewBlindedHops-variant SendError
43775 struct LDKSendError SendError_too_few_blinded_hops(void);
43778 * Utility method to constructs a new InvalidFirstHop-variant SendError
43780 struct LDKSendError SendError_invalid_first_hop(void);
43783 * Utility method to constructs a new InvalidMessage-variant SendError
43785 struct LDKSendError SendError_invalid_message(void);
43788 * Utility method to constructs a new BufferFull-variant SendError
43790 struct LDKSendError SendError_buffer_full(void);
43793 * Utility method to constructs a new GetNodeIdFailed-variant SendError
43795 struct LDKSendError SendError_get_node_id_failed(void);
43798 * Utility method to constructs a new BlindedPathAdvanceFailed-variant SendError
43800 struct LDKSendError SendError_blinded_path_advance_failed(void);
43803 * Checks if two SendErrors contain equal inner contents.
43804 * This ignores pointers and is_owned flags and looks at the values in fields.
43806 bool SendError_eq(const struct LDKSendError *NONNULL_PTR a, const struct LDKSendError *NONNULL_PTR b);
43809 * Calls the free function if one is set
43811 void CustomOnionMessageHandler_free(struct LDKCustomOnionMessageHandler this_ptr);
43814 * Create an onion message with contents `message` to the destination of `path`.
43815 * Returns (introduction_node_id, onion_msg)
43817 * Note that reply_path (or a relevant inner pointer) may be NULL or all-0s to represent None
43819 struct LDKCResult_C2Tuple_PublicKeyOnionMessageZSendErrorZ create_onion_message(const struct LDKEntropySource *NONNULL_PTR entropy_source, const struct LDKNodeSigner *NONNULL_PTR node_signer, struct LDKOnionMessagePath path, struct LDKOnionMessageContents message, struct LDKBlindedPath reply_path);
43822 * Constructs a new `OnionMessenger` to send, forward, and delegate received onion messages to
43823 * their respective handlers.
43825 MUST_USE_RES struct LDKOnionMessenger OnionMessenger_new(struct LDKEntropySource entropy_source, struct LDKNodeSigner node_signer, struct LDKLogger logger, struct LDKMessageRouter message_router, struct LDKOffersMessageHandler offers_handler, struct LDKCustomOnionMessageHandler custom_handler);
43828 * Send an onion message with contents `message` to the destination of `path`.
43830 * See [`OnionMessenger`] for example usage.
43832 * Note that reply_path (or a relevant inner pointer) may be NULL or all-0s to represent None
43834 MUST_USE_RES struct LDKCResult_NoneSendErrorZ OnionMessenger_send_onion_message(const struct LDKOnionMessenger *NONNULL_PTR this_arg, struct LDKOnionMessagePath path, struct LDKOnionMessageContents message, struct LDKBlindedPath reply_path);
43837 * Constructs a new OnionMessageHandler which calls the relevant methods on this_arg.
43838 * This copies the `inner` pointer in this_arg and thus the returned OnionMessageHandler must be freed before this_arg is
43840 struct LDKOnionMessageHandler OnionMessenger_as_OnionMessageHandler(const struct LDKOnionMessenger *NONNULL_PTR this_arg);
43843 * Constructs a new OnionMessageProvider which calls the relevant methods on this_arg.
43844 * This copies the `inner` pointer in this_arg and thus the returned OnionMessageProvider must be freed before this_arg is
43846 struct LDKOnionMessageProvider OnionMessenger_as_OnionMessageProvider(const struct LDKOnionMessenger *NONNULL_PTR this_arg);
43849 * Calls the free function if one is set
43851 void OffersMessageHandler_free(struct LDKOffersMessageHandler this_ptr);
43854 * Frees any resources used by the OffersMessage
43856 void OffersMessage_free(struct LDKOffersMessage this_ptr);
43859 * Creates a copy of the OffersMessage
43861 struct LDKOffersMessage OffersMessage_clone(const struct LDKOffersMessage *NONNULL_PTR orig);
43864 * Utility method to constructs a new InvoiceRequest-variant OffersMessage
43866 struct LDKOffersMessage OffersMessage_invoice_request(struct LDKInvoiceRequest a);
43869 * Utility method to constructs a new Invoice-variant OffersMessage
43871 struct LDKOffersMessage OffersMessage_invoice(struct LDKBolt12Invoice a);
43874 * Utility method to constructs a new InvoiceError-variant OffersMessage
43876 struct LDKOffersMessage OffersMessage_invoice_error(struct LDKInvoiceError a);
43879 * Returns whether `tlv_type` corresponds to a TLV record for Offers.
43881 MUST_USE_RES bool OffersMessage_is_known_type(uint64_t tlv_type);
43884 * The TLV record type for the message as used in an `onionmsg_tlv` TLV stream.
43886 MUST_USE_RES uint64_t OffersMessage_tlv_type(const struct LDKOffersMessage *NONNULL_PTR this_arg);
43889 * Serialize the OffersMessage object into a byte array which can be read by OffersMessage_read
43891 struct LDKCVec_u8Z OffersMessage_write(const struct LDKOffersMessage *NONNULL_PTR obj);
43894 * Read a OffersMessage from a byte array, created by OffersMessage_write
43896 struct LDKCResult_OffersMessageDecodeErrorZ OffersMessage_read(struct LDKu8slice ser, uint64_t arg_a, const struct LDKLogger *NONNULL_PTR arg_b);
43899 * Frees any resources used by the Packet, if is_owned is set and inner is non-NULL.
43901 void Packet_free(struct LDKPacket this_obj);
43904 * Bolt 04 version number
43906 uint8_t Packet_get_version(const struct LDKPacket *NONNULL_PTR this_ptr);
43909 * Bolt 04 version number
43911 void Packet_set_version(struct LDKPacket *NONNULL_PTR this_ptr, uint8_t val);
43914 * A random sepc256k1 point, used to build the ECDH shared secret to decrypt hop_data
43916 struct LDKPublicKey Packet_get_public_key(const struct LDKPacket *NONNULL_PTR this_ptr);
43919 * A random sepc256k1 point, used to build the ECDH shared secret to decrypt hop_data
43921 void Packet_set_public_key(struct LDKPacket *NONNULL_PTR this_ptr, struct LDKPublicKey val);
43924 * Encrypted payload for the next hop
43926 * Returns a copy of the field.
43928 struct LDKCVec_u8Z Packet_get_hop_data(const struct LDKPacket *NONNULL_PTR this_ptr);
43931 * Encrypted payload for the next hop
43933 void Packet_set_hop_data(struct LDKPacket *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val);
43936 * HMAC to verify the integrity of hop_data
43938 const uint8_t (*Packet_get_hmac(const struct LDKPacket *NONNULL_PTR this_ptr))[32];
43941 * HMAC to verify the integrity of hop_data
43943 void Packet_set_hmac(struct LDKPacket *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
43946 * Constructs a new Packet given each field
43948 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);
43951 * Creates a copy of the Packet
43953 struct LDKPacket Packet_clone(const struct LDKPacket *NONNULL_PTR orig);
43956 * Checks if two Packets contain equal inner contents.
43957 * This ignores pointers and is_owned flags and looks at the values in fields.
43958 * Two objects with NULL inner values will be considered "equal" here.
43960 bool Packet_eq(const struct LDKPacket *NONNULL_PTR a, const struct LDKPacket *NONNULL_PTR b);
43963 * Serialize the Packet object into a byte array which can be read by Packet_read
43965 struct LDKCVec_u8Z Packet_write(const struct LDKPacket *NONNULL_PTR obj);
43968 * Frees any resources used by the OnionMessageContents
43970 void OnionMessageContents_free(struct LDKOnionMessageContents this_ptr);
43973 * Creates a copy of the OnionMessageContents
43975 struct LDKOnionMessageContents OnionMessageContents_clone(const struct LDKOnionMessageContents *NONNULL_PTR orig);
43978 * Utility method to constructs a new Offers-variant OnionMessageContents
43980 struct LDKOnionMessageContents OnionMessageContents_offers(struct LDKOffersMessage a);
43983 * Utility method to constructs a new Custom-variant OnionMessageContents
43985 struct LDKOnionMessageContents OnionMessageContents_custom(struct LDKCustomOnionMessageContents a);
43988 * Creates a copy of a CustomOnionMessageContents
43990 struct LDKCustomOnionMessageContents CustomOnionMessageContents_clone(const struct LDKCustomOnionMessageContents *NONNULL_PTR orig);
43993 * Calls the free function if one is set
43995 void CustomOnionMessageContents_free(struct LDKCustomOnionMessageContents this_ptr);
43998 * Frees any resources used by the BlindedPath, if is_owned is set and inner is non-NULL.
44000 void BlindedPath_free(struct LDKBlindedPath this_obj);
44003 * To send to a blinded path, the sender first finds a route to the unblinded
44004 * `introduction_node_id`, which can unblind its [`encrypted_payload`] to find out the onion
44005 * message or payment's next hop and forward it along.
44007 * [`encrypted_payload`]: BlindedHop::encrypted_payload
44009 struct LDKPublicKey BlindedPath_get_introduction_node_id(const struct LDKBlindedPath *NONNULL_PTR this_ptr);
44012 * To send to a blinded path, the sender first finds a route to the unblinded
44013 * `introduction_node_id`, which can unblind its [`encrypted_payload`] to find out the onion
44014 * message or payment's next hop and forward it along.
44016 * [`encrypted_payload`]: BlindedHop::encrypted_payload
44018 void BlindedPath_set_introduction_node_id(struct LDKBlindedPath *NONNULL_PTR this_ptr, struct LDKPublicKey val);
44021 * Used by the introduction node to decrypt its [`encrypted_payload`] to forward the onion
44022 * message or payment.
44024 * [`encrypted_payload`]: BlindedHop::encrypted_payload
44026 struct LDKPublicKey BlindedPath_get_blinding_point(const struct LDKBlindedPath *NONNULL_PTR this_ptr);
44029 * Used by the introduction node to decrypt its [`encrypted_payload`] to forward the onion
44030 * message or payment.
44032 * [`encrypted_payload`]: BlindedHop::encrypted_payload
44034 void BlindedPath_set_blinding_point(struct LDKBlindedPath *NONNULL_PTR this_ptr, struct LDKPublicKey val);
44037 * The hops composing the blinded path.
44039 struct LDKCVec_BlindedHopZ BlindedPath_get_blinded_hops(const struct LDKBlindedPath *NONNULL_PTR this_ptr);
44042 * The hops composing the blinded path.
44044 void BlindedPath_set_blinded_hops(struct LDKBlindedPath *NONNULL_PTR this_ptr, struct LDKCVec_BlindedHopZ val);
44047 * Constructs a new BlindedPath given each field
44049 MUST_USE_RES struct LDKBlindedPath BlindedPath_new(struct LDKPublicKey introduction_node_id_arg, struct LDKPublicKey blinding_point_arg, struct LDKCVec_BlindedHopZ blinded_hops_arg);
44052 * Creates a copy of the BlindedPath
44054 struct LDKBlindedPath BlindedPath_clone(const struct LDKBlindedPath *NONNULL_PTR orig);
44057 * Generates a non-cryptographic 64-bit hash of the BlindedPath.
44059 uint64_t BlindedPath_hash(const struct LDKBlindedPath *NONNULL_PTR o);
44062 * Checks if two BlindedPaths contain equal inner contents.
44063 * This ignores pointers and is_owned flags and looks at the values in fields.
44064 * Two objects with NULL inner values will be considered "equal" here.
44066 bool BlindedPath_eq(const struct LDKBlindedPath *NONNULL_PTR a, const struct LDKBlindedPath *NONNULL_PTR b);
44069 * Frees any resources used by the BlindedHop, if is_owned is set and inner is non-NULL.
44071 void BlindedHop_free(struct LDKBlindedHop this_obj);
44074 * The blinded node id of this hop in a [`BlindedPath`].
44076 struct LDKPublicKey BlindedHop_get_blinded_node_id(const struct LDKBlindedHop *NONNULL_PTR this_ptr);
44079 * The blinded node id of this hop in a [`BlindedPath`].
44081 void BlindedHop_set_blinded_node_id(struct LDKBlindedHop *NONNULL_PTR this_ptr, struct LDKPublicKey val);
44084 * The encrypted payload intended for this hop in a [`BlindedPath`].
44086 * Returns a copy of the field.
44088 struct LDKCVec_u8Z BlindedHop_get_encrypted_payload(const struct LDKBlindedHop *NONNULL_PTR this_ptr);
44091 * The encrypted payload intended for this hop in a [`BlindedPath`].
44093 void BlindedHop_set_encrypted_payload(struct LDKBlindedHop *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val);
44096 * Constructs a new BlindedHop given each field
44098 MUST_USE_RES struct LDKBlindedHop BlindedHop_new(struct LDKPublicKey blinded_node_id_arg, struct LDKCVec_u8Z encrypted_payload_arg);
44101 * Creates a copy of the BlindedHop
44103 struct LDKBlindedHop BlindedHop_clone(const struct LDKBlindedHop *NONNULL_PTR orig);
44106 * Generates a non-cryptographic 64-bit hash of the BlindedHop.
44108 uint64_t BlindedHop_hash(const struct LDKBlindedHop *NONNULL_PTR o);
44111 * Checks if two BlindedHops contain equal inner contents.
44112 * This ignores pointers and is_owned flags and looks at the values in fields.
44113 * Two objects with NULL inner values will be considered "equal" here.
44115 bool BlindedHop_eq(const struct LDKBlindedHop *NONNULL_PTR a, const struct LDKBlindedHop *NONNULL_PTR b);
44118 * Create a blinded path for an onion message, to be forwarded along `node_pks`. The last node
44119 * pubkey in `node_pks` will be the destination node.
44121 * Errors if less than two hops are provided or if `node_pk`(s) are invalid.
44123 MUST_USE_RES struct LDKCResult_BlindedPathNoneZ BlindedPath_new_for_message(struct LDKCVec_PublicKeyZ node_pks, const struct LDKEntropySource *NONNULL_PTR entropy_source);
44126 * Create a one-hop blinded path for a payment.
44128 MUST_USE_RES struct LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ BlindedPath_one_hop_for_payment(struct LDKPublicKey payee_node_id, struct LDKReceiveTlvs payee_tlvs, const struct LDKEntropySource *NONNULL_PTR entropy_source);
44131 * Serialize the BlindedPath object into a byte array which can be read by BlindedPath_read
44133 struct LDKCVec_u8Z BlindedPath_write(const struct LDKBlindedPath *NONNULL_PTR obj);
44136 * Read a BlindedPath from a byte array, created by BlindedPath_write
44138 struct LDKCResult_BlindedPathDecodeErrorZ BlindedPath_read(struct LDKu8slice ser);
44141 * Serialize the BlindedHop object into a byte array which can be read by BlindedHop_read
44143 struct LDKCVec_u8Z BlindedHop_write(const struct LDKBlindedHop *NONNULL_PTR obj);
44146 * Read a BlindedHop from a byte array, created by BlindedHop_write
44148 struct LDKCResult_BlindedHopDecodeErrorZ BlindedHop_read(struct LDKu8slice ser);
44151 * Frees any resources used by the ForwardNode, if is_owned is set and inner is non-NULL.
44153 void ForwardNode_free(struct LDKForwardNode this_obj);
44156 * The TLVs for this node's [`BlindedHop`], where the fee parameters contained within are also
44157 * used for [`BlindedPayInfo`] construction.
44159 struct LDKForwardTlvs ForwardNode_get_tlvs(const struct LDKForwardNode *NONNULL_PTR this_ptr);
44162 * The TLVs for this node's [`BlindedHop`], where the fee parameters contained within are also
44163 * used for [`BlindedPayInfo`] construction.
44165 void ForwardNode_set_tlvs(struct LDKForwardNode *NONNULL_PTR this_ptr, struct LDKForwardTlvs val);
44168 * This node's pubkey.
44170 struct LDKPublicKey ForwardNode_get_node_id(const struct LDKForwardNode *NONNULL_PTR this_ptr);
44173 * This node's pubkey.
44175 void ForwardNode_set_node_id(struct LDKForwardNode *NONNULL_PTR this_ptr, struct LDKPublicKey val);
44178 * The maximum value, in msat, that may be accepted by this node.
44180 uint64_t ForwardNode_get_htlc_maximum_msat(const struct LDKForwardNode *NONNULL_PTR this_ptr);
44183 * The maximum value, in msat, that may be accepted by this node.
44185 void ForwardNode_set_htlc_maximum_msat(struct LDKForwardNode *NONNULL_PTR this_ptr, uint64_t val);
44188 * Constructs a new ForwardNode given each field
44190 MUST_USE_RES struct LDKForwardNode ForwardNode_new(struct LDKForwardTlvs tlvs_arg, struct LDKPublicKey node_id_arg, uint64_t htlc_maximum_msat_arg);
44193 * Creates a copy of the ForwardNode
44195 struct LDKForwardNode ForwardNode_clone(const struct LDKForwardNode *NONNULL_PTR orig);
44198 * Frees any resources used by the ForwardTlvs, if is_owned is set and inner is non-NULL.
44200 void ForwardTlvs_free(struct LDKForwardTlvs this_obj);
44203 * The short channel id this payment should be forwarded out over.
44205 uint64_t ForwardTlvs_get_short_channel_id(const struct LDKForwardTlvs *NONNULL_PTR this_ptr);
44208 * The short channel id this payment should be forwarded out over.
44210 void ForwardTlvs_set_short_channel_id(struct LDKForwardTlvs *NONNULL_PTR this_ptr, uint64_t val);
44213 * Payment parameters for relaying over [`Self::short_channel_id`].
44215 struct LDKPaymentRelay ForwardTlvs_get_payment_relay(const struct LDKForwardTlvs *NONNULL_PTR this_ptr);
44218 * Payment parameters for relaying over [`Self::short_channel_id`].
44220 void ForwardTlvs_set_payment_relay(struct LDKForwardTlvs *NONNULL_PTR this_ptr, struct LDKPaymentRelay val);
44223 * Payment constraints for relaying over [`Self::short_channel_id`].
44225 struct LDKPaymentConstraints ForwardTlvs_get_payment_constraints(const struct LDKForwardTlvs *NONNULL_PTR this_ptr);
44228 * Payment constraints for relaying over [`Self::short_channel_id`].
44230 void ForwardTlvs_set_payment_constraints(struct LDKForwardTlvs *NONNULL_PTR this_ptr, struct LDKPaymentConstraints val);
44233 * Supported and required features when relaying a payment onion containing this object's
44234 * corresponding [`BlindedHop::encrypted_payload`].
44236 * [`BlindedHop::encrypted_payload`]: crate::blinded_path::BlindedHop::encrypted_payload
44238 struct LDKBlindedHopFeatures ForwardTlvs_get_features(const struct LDKForwardTlvs *NONNULL_PTR this_ptr);
44241 * Supported and required features when relaying a payment onion containing this object's
44242 * corresponding [`BlindedHop::encrypted_payload`].
44244 * [`BlindedHop::encrypted_payload`]: crate::blinded_path::BlindedHop::encrypted_payload
44246 void ForwardTlvs_set_features(struct LDKForwardTlvs *NONNULL_PTR this_ptr, struct LDKBlindedHopFeatures val);
44249 * Constructs a new ForwardTlvs given each field
44251 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);
44254 * Creates a copy of the ForwardTlvs
44256 struct LDKForwardTlvs ForwardTlvs_clone(const struct LDKForwardTlvs *NONNULL_PTR orig);
44259 * Frees any resources used by the ReceiveTlvs, if is_owned is set and inner is non-NULL.
44261 void ReceiveTlvs_free(struct LDKReceiveTlvs this_obj);
44264 * Used to authenticate the sender of a payment to the receiver and tie MPP HTLCs together.
44266 const uint8_t (*ReceiveTlvs_get_payment_secret(const struct LDKReceiveTlvs *NONNULL_PTR this_ptr))[32];
44269 * Used to authenticate the sender of a payment to the receiver and tie MPP HTLCs together.
44271 void ReceiveTlvs_set_payment_secret(struct LDKReceiveTlvs *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
44274 * Constraints for the receiver of this payment.
44276 struct LDKPaymentConstraints ReceiveTlvs_get_payment_constraints(const struct LDKReceiveTlvs *NONNULL_PTR this_ptr);
44279 * Constraints for the receiver of this payment.
44281 void ReceiveTlvs_set_payment_constraints(struct LDKReceiveTlvs *NONNULL_PTR this_ptr, struct LDKPaymentConstraints val);
44284 * Constructs a new ReceiveTlvs given each field
44286 MUST_USE_RES struct LDKReceiveTlvs ReceiveTlvs_new(struct LDKThirtyTwoBytes payment_secret_arg, struct LDKPaymentConstraints payment_constraints_arg);
44289 * Creates a copy of the ReceiveTlvs
44291 struct LDKReceiveTlvs ReceiveTlvs_clone(const struct LDKReceiveTlvs *NONNULL_PTR orig);
44294 * Frees any resources used by the PaymentRelay, if is_owned is set and inner is non-NULL.
44296 void PaymentRelay_free(struct LDKPaymentRelay this_obj);
44299 * Number of blocks subtracted from an incoming HTLC's `cltv_expiry` for this [`BlindedHop`].
44301 uint16_t PaymentRelay_get_cltv_expiry_delta(const struct LDKPaymentRelay *NONNULL_PTR this_ptr);
44304 * Number of blocks subtracted from an incoming HTLC's `cltv_expiry` for this [`BlindedHop`].
44306 void PaymentRelay_set_cltv_expiry_delta(struct LDKPaymentRelay *NONNULL_PTR this_ptr, uint16_t val);
44309 * Liquidity fee charged (in millionths of the amount transferred) for relaying a payment over
44310 * this [`BlindedHop`], (i.e., 10,000 is 1%).
44312 uint32_t PaymentRelay_get_fee_proportional_millionths(const struct LDKPaymentRelay *NONNULL_PTR this_ptr);
44315 * Liquidity fee charged (in millionths of the amount transferred) for relaying a payment over
44316 * this [`BlindedHop`], (i.e., 10,000 is 1%).
44318 void PaymentRelay_set_fee_proportional_millionths(struct LDKPaymentRelay *NONNULL_PTR this_ptr, uint32_t val);
44321 * Base fee charged (in millisatoshi) for relaying a payment over this [`BlindedHop`].
44323 uint32_t PaymentRelay_get_fee_base_msat(const struct LDKPaymentRelay *NONNULL_PTR this_ptr);
44326 * Base fee charged (in millisatoshi) for relaying a payment over this [`BlindedHop`].
44328 void PaymentRelay_set_fee_base_msat(struct LDKPaymentRelay *NONNULL_PTR this_ptr, uint32_t val);
44331 * Constructs a new PaymentRelay given each field
44333 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);
44336 * Creates a copy of the PaymentRelay
44338 struct LDKPaymentRelay PaymentRelay_clone(const struct LDKPaymentRelay *NONNULL_PTR orig);
44341 * Frees any resources used by the PaymentConstraints, if is_owned is set and inner is non-NULL.
44343 void PaymentConstraints_free(struct LDKPaymentConstraints this_obj);
44346 * The maximum total CLTV delta that is acceptable when relaying a payment over this
44349 uint32_t PaymentConstraints_get_max_cltv_expiry(const struct LDKPaymentConstraints *NONNULL_PTR this_ptr);
44352 * The maximum total CLTV delta that is acceptable when relaying a payment over this
44355 void PaymentConstraints_set_max_cltv_expiry(struct LDKPaymentConstraints *NONNULL_PTR this_ptr, uint32_t val);
44358 * The minimum value, in msat, that may be accepted by the node corresponding to this
44361 uint64_t PaymentConstraints_get_htlc_minimum_msat(const struct LDKPaymentConstraints *NONNULL_PTR this_ptr);
44364 * The minimum value, in msat, that may be accepted by the node corresponding to this
44367 void PaymentConstraints_set_htlc_minimum_msat(struct LDKPaymentConstraints *NONNULL_PTR this_ptr, uint64_t val);
44370 * Constructs a new PaymentConstraints given each field
44372 MUST_USE_RES struct LDKPaymentConstraints PaymentConstraints_new(uint32_t max_cltv_expiry_arg, uint64_t htlc_minimum_msat_arg);
44375 * Creates a copy of the PaymentConstraints
44377 struct LDKPaymentConstraints PaymentConstraints_clone(const struct LDKPaymentConstraints *NONNULL_PTR orig);
44380 * Serialize the ForwardTlvs object into a byte array which can be read by ForwardTlvs_read
44382 struct LDKCVec_u8Z ForwardTlvs_write(const struct LDKForwardTlvs *NONNULL_PTR obj);
44385 * Serialize the ReceiveTlvs object into a byte array which can be read by ReceiveTlvs_read
44387 struct LDKCVec_u8Z ReceiveTlvs_write(const struct LDKReceiveTlvs *NONNULL_PTR obj);
44390 * Read a ReceiveTlvs from a byte array, created by ReceiveTlvs_write
44392 struct LDKCResult_ReceiveTlvsDecodeErrorZ ReceiveTlvs_read(struct LDKu8slice ser);
44395 * Serialize the PaymentRelay object into a byte array which can be read by PaymentRelay_read
44397 struct LDKCVec_u8Z PaymentRelay_write(const struct LDKPaymentRelay *NONNULL_PTR obj);
44400 * Read a PaymentRelay from a byte array, created by PaymentRelay_write
44402 struct LDKCResult_PaymentRelayDecodeErrorZ PaymentRelay_read(struct LDKu8slice ser);
44405 * Serialize the PaymentConstraints object into a byte array which can be read by PaymentConstraints_read
44407 struct LDKCVec_u8Z PaymentConstraints_write(const struct LDKPaymentConstraints *NONNULL_PTR obj);
44410 * Read a PaymentConstraints from a byte array, created by PaymentConstraints_write
44412 struct LDKCResult_PaymentConstraintsDecodeErrorZ PaymentConstraints_read(struct LDKu8slice ser);
44415 * Frees any resources used by the PaymentPurpose
44417 void PaymentPurpose_free(struct LDKPaymentPurpose this_ptr);
44420 * Creates a copy of the PaymentPurpose
44422 struct LDKPaymentPurpose PaymentPurpose_clone(const struct LDKPaymentPurpose *NONNULL_PTR orig);
44425 * Utility method to constructs a new InvoicePayment-variant PaymentPurpose
44427 struct LDKPaymentPurpose PaymentPurpose_invoice_payment(struct LDKCOption_ThirtyTwoBytesZ payment_preimage, struct LDKThirtyTwoBytes payment_secret);
44430 * Utility method to constructs a new SpontaneousPayment-variant PaymentPurpose
44432 struct LDKPaymentPurpose PaymentPurpose_spontaneous_payment(struct LDKThirtyTwoBytes a);
44435 * Checks if two PaymentPurposes contain equal inner contents.
44436 * This ignores pointers and is_owned flags and looks at the values in fields.
44438 bool PaymentPurpose_eq(const struct LDKPaymentPurpose *NONNULL_PTR a, const struct LDKPaymentPurpose *NONNULL_PTR b);
44441 * Serialize the PaymentPurpose object into a byte array which can be read by PaymentPurpose_read
44443 struct LDKCVec_u8Z PaymentPurpose_write(const struct LDKPaymentPurpose *NONNULL_PTR obj);
44446 * Read a PaymentPurpose from a byte array, created by PaymentPurpose_write
44448 struct LDKCResult_PaymentPurposeDecodeErrorZ PaymentPurpose_read(struct LDKu8slice ser);
44451 * Frees any resources used by the ClaimedHTLC, if is_owned is set and inner is non-NULL.
44453 void ClaimedHTLC_free(struct LDKClaimedHTLC this_obj);
44456 * The `channel_id` of the channel over which the HTLC was received.
44458 const uint8_t (*ClaimedHTLC_get_channel_id(const struct LDKClaimedHTLC *NONNULL_PTR this_ptr))[32];
44461 * The `channel_id` of the channel over which the HTLC was received.
44463 void ClaimedHTLC_set_channel_id(struct LDKClaimedHTLC *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
44466 * The `user_channel_id` of the channel over which the HTLC was received. This is the value
44467 * passed in to [`ChannelManager::create_channel`] for outbound channels, or to
44468 * [`ChannelManager::accept_inbound_channel`] for inbound channels if
44469 * [`UserConfig::manually_accept_inbound_channels`] config flag is set to true. Otherwise
44470 * `user_channel_id` will be randomized for an inbound channel.
44472 * This field will be zero for a payment that was serialized prior to LDK version 0.0.117. (This
44473 * should only happen in the case that a payment was claimable prior to LDK version 0.0.117, but
44474 * was not actually claimed until after upgrading.)
44476 * [`ChannelManager::create_channel`]: crate::ln::channelmanager::ChannelManager::create_channel
44477 * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
44478 * [`UserConfig::manually_accept_inbound_channels`]: crate::util::config::UserConfig::manually_accept_inbound_channels
44480 struct LDKU128 ClaimedHTLC_get_user_channel_id(const struct LDKClaimedHTLC *NONNULL_PTR this_ptr);
44483 * The `user_channel_id` of the channel over which the HTLC was received. This is the value
44484 * passed in to [`ChannelManager::create_channel`] for outbound channels, or to
44485 * [`ChannelManager::accept_inbound_channel`] for inbound channels if
44486 * [`UserConfig::manually_accept_inbound_channels`] config flag is set to true. Otherwise
44487 * `user_channel_id` will be randomized for an inbound channel.
44489 * This field will be zero for a payment that was serialized prior to LDK version 0.0.117. (This
44490 * should only happen in the case that a payment was claimable prior to LDK version 0.0.117, but
44491 * was not actually claimed until after upgrading.)
44493 * [`ChannelManager::create_channel`]: crate::ln::channelmanager::ChannelManager::create_channel
44494 * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
44495 * [`UserConfig::manually_accept_inbound_channels`]: crate::util::config::UserConfig::manually_accept_inbound_channels
44497 void ClaimedHTLC_set_user_channel_id(struct LDKClaimedHTLC *NONNULL_PTR this_ptr, struct LDKU128 val);
44500 * The block height at which this HTLC expires.
44502 uint32_t ClaimedHTLC_get_cltv_expiry(const struct LDKClaimedHTLC *NONNULL_PTR this_ptr);
44505 * The block height at which this HTLC expires.
44507 void ClaimedHTLC_set_cltv_expiry(struct LDKClaimedHTLC *NONNULL_PTR this_ptr, uint32_t val);
44510 * The amount (in msats) of this part of an MPP.
44512 uint64_t ClaimedHTLC_get_value_msat(const struct LDKClaimedHTLC *NONNULL_PTR this_ptr);
44515 * The amount (in msats) of this part of an MPP.
44517 void ClaimedHTLC_set_value_msat(struct LDKClaimedHTLC *NONNULL_PTR this_ptr, uint64_t val);
44520 * Constructs a new ClaimedHTLC given each field
44522 MUST_USE_RES struct LDKClaimedHTLC ClaimedHTLC_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKU128 user_channel_id_arg, uint32_t cltv_expiry_arg, uint64_t value_msat_arg);
44525 * Creates a copy of the ClaimedHTLC
44527 struct LDKClaimedHTLC ClaimedHTLC_clone(const struct LDKClaimedHTLC *NONNULL_PTR orig);
44530 * Checks if two ClaimedHTLCs contain equal inner contents.
44531 * This ignores pointers and is_owned flags and looks at the values in fields.
44532 * Two objects with NULL inner values will be considered "equal" here.
44534 bool ClaimedHTLC_eq(const struct LDKClaimedHTLC *NONNULL_PTR a, const struct LDKClaimedHTLC *NONNULL_PTR b);
44537 * Serialize the ClaimedHTLC object into a byte array which can be read by ClaimedHTLC_read
44539 struct LDKCVec_u8Z ClaimedHTLC_write(const struct LDKClaimedHTLC *NONNULL_PTR obj);
44542 * Read a ClaimedHTLC from a byte array, created by ClaimedHTLC_write
44544 struct LDKCResult_ClaimedHTLCDecodeErrorZ ClaimedHTLC_read(struct LDKu8slice ser);
44547 * Frees any resources used by the PathFailure
44549 void PathFailure_free(struct LDKPathFailure this_ptr);
44552 * Creates a copy of the PathFailure
44554 struct LDKPathFailure PathFailure_clone(const struct LDKPathFailure *NONNULL_PTR orig);
44557 * Utility method to constructs a new InitialSend-variant PathFailure
44559 struct LDKPathFailure PathFailure_initial_send(struct LDKAPIError err);
44562 * Utility method to constructs a new OnPath-variant PathFailure
44564 struct LDKPathFailure PathFailure_on_path(struct LDKCOption_NetworkUpdateZ network_update);
44567 * Checks if two PathFailures contain equal inner contents.
44568 * This ignores pointers and is_owned flags and looks at the values in fields.
44570 bool PathFailure_eq(const struct LDKPathFailure *NONNULL_PTR a, const struct LDKPathFailure *NONNULL_PTR b);
44573 * Serialize the PathFailure object into a byte array which can be read by PathFailure_read
44575 struct LDKCVec_u8Z PathFailure_write(const struct LDKPathFailure *NONNULL_PTR obj);
44578 * Read a PathFailure from a byte array, created by PathFailure_write
44580 struct LDKCResult_COption_PathFailureZDecodeErrorZ PathFailure_read(struct LDKu8slice ser);
44583 * Frees any resources used by the ClosureReason
44585 void ClosureReason_free(struct LDKClosureReason this_ptr);
44588 * Creates a copy of the ClosureReason
44590 struct LDKClosureReason ClosureReason_clone(const struct LDKClosureReason *NONNULL_PTR orig);
44593 * Utility method to constructs a new CounterpartyForceClosed-variant ClosureReason
44595 struct LDKClosureReason ClosureReason_counterparty_force_closed(struct LDKUntrustedString peer_msg);
44598 * Utility method to constructs a new HolderForceClosed-variant ClosureReason
44600 struct LDKClosureReason ClosureReason_holder_force_closed(void);
44603 * Utility method to constructs a new CooperativeClosure-variant ClosureReason
44605 struct LDKClosureReason ClosureReason_cooperative_closure(void);
44608 * Utility method to constructs a new CommitmentTxConfirmed-variant ClosureReason
44610 struct LDKClosureReason ClosureReason_commitment_tx_confirmed(void);
44613 * Utility method to constructs a new FundingTimedOut-variant ClosureReason
44615 struct LDKClosureReason ClosureReason_funding_timed_out(void);
44618 * Utility method to constructs a new ProcessingError-variant ClosureReason
44620 struct LDKClosureReason ClosureReason_processing_error(struct LDKStr err);
44623 * Utility method to constructs a new DisconnectedPeer-variant ClosureReason
44625 struct LDKClosureReason ClosureReason_disconnected_peer(void);
44628 * Utility method to constructs a new OutdatedChannelManager-variant ClosureReason
44630 struct LDKClosureReason ClosureReason_outdated_channel_manager(void);
44633 * Utility method to constructs a new CounterpartyCoopClosedUnfundedChannel-variant ClosureReason
44635 struct LDKClosureReason ClosureReason_counterparty_coop_closed_unfunded_channel(void);
44638 * Utility method to constructs a new FundingBatchClosure-variant ClosureReason
44640 struct LDKClosureReason ClosureReason_funding_batch_closure(void);
44643 * Checks if two ClosureReasons contain equal inner contents.
44644 * This ignores pointers and is_owned flags and looks at the values in fields.
44646 bool ClosureReason_eq(const struct LDKClosureReason *NONNULL_PTR a, const struct LDKClosureReason *NONNULL_PTR b);
44649 * Serialize the ClosureReason object into a byte array which can be read by ClosureReason_read
44651 struct LDKCVec_u8Z ClosureReason_write(const struct LDKClosureReason *NONNULL_PTR obj);
44654 * Read a ClosureReason from a byte array, created by ClosureReason_write
44656 struct LDKCResult_COption_ClosureReasonZDecodeErrorZ ClosureReason_read(struct LDKu8slice ser);
44659 * Frees any resources used by the HTLCDestination
44661 void HTLCDestination_free(struct LDKHTLCDestination this_ptr);
44664 * Creates a copy of the HTLCDestination
44666 struct LDKHTLCDestination HTLCDestination_clone(const struct LDKHTLCDestination *NONNULL_PTR orig);
44669 * Utility method to constructs a new NextHopChannel-variant HTLCDestination
44671 struct LDKHTLCDestination HTLCDestination_next_hop_channel(struct LDKPublicKey node_id, struct LDKThirtyTwoBytes channel_id);
44674 * Utility method to constructs a new UnknownNextHop-variant HTLCDestination
44676 struct LDKHTLCDestination HTLCDestination_unknown_next_hop(uint64_t requested_forward_scid);
44679 * Utility method to constructs a new InvalidForward-variant HTLCDestination
44681 struct LDKHTLCDestination HTLCDestination_invalid_forward(uint64_t requested_forward_scid);
44684 * Utility method to constructs a new FailedPayment-variant HTLCDestination
44686 struct LDKHTLCDestination HTLCDestination_failed_payment(struct LDKThirtyTwoBytes payment_hash);
44689 * Checks if two HTLCDestinations contain equal inner contents.
44690 * This ignores pointers and is_owned flags and looks at the values in fields.
44692 bool HTLCDestination_eq(const struct LDKHTLCDestination *NONNULL_PTR a, const struct LDKHTLCDestination *NONNULL_PTR b);
44695 * Serialize the HTLCDestination object into a byte array which can be read by HTLCDestination_read
44697 struct LDKCVec_u8Z HTLCDestination_write(const struct LDKHTLCDestination *NONNULL_PTR obj);
44700 * Read a HTLCDestination from a byte array, created by HTLCDestination_write
44702 struct LDKCResult_COption_HTLCDestinationZDecodeErrorZ HTLCDestination_read(struct LDKu8slice ser);
44705 * Creates a copy of the PaymentFailureReason
44707 enum LDKPaymentFailureReason PaymentFailureReason_clone(const enum LDKPaymentFailureReason *NONNULL_PTR orig);
44710 * Utility method to constructs a new RecipientRejected-variant PaymentFailureReason
44712 enum LDKPaymentFailureReason PaymentFailureReason_recipient_rejected(void);
44715 * Utility method to constructs a new UserAbandoned-variant PaymentFailureReason
44717 enum LDKPaymentFailureReason PaymentFailureReason_user_abandoned(void);
44720 * Utility method to constructs a new RetriesExhausted-variant PaymentFailureReason
44722 enum LDKPaymentFailureReason PaymentFailureReason_retries_exhausted(void);
44725 * Utility method to constructs a new PaymentExpired-variant PaymentFailureReason
44727 enum LDKPaymentFailureReason PaymentFailureReason_payment_expired(void);
44730 * Utility method to constructs a new RouteNotFound-variant PaymentFailureReason
44732 enum LDKPaymentFailureReason PaymentFailureReason_route_not_found(void);
44735 * Utility method to constructs a new UnexpectedError-variant PaymentFailureReason
44737 enum LDKPaymentFailureReason PaymentFailureReason_unexpected_error(void);
44740 * Checks if two PaymentFailureReasons contain equal inner contents.
44741 * This ignores pointers and is_owned flags and looks at the values in fields.
44743 bool PaymentFailureReason_eq(const enum LDKPaymentFailureReason *NONNULL_PTR a, const enum LDKPaymentFailureReason *NONNULL_PTR b);
44746 * Serialize the PaymentFailureReason object into a byte array which can be read by PaymentFailureReason_read
44748 struct LDKCVec_u8Z PaymentFailureReason_write(const enum LDKPaymentFailureReason *NONNULL_PTR obj);
44751 * Read a PaymentFailureReason from a byte array, created by PaymentFailureReason_write
44753 struct LDKCResult_PaymentFailureReasonDecodeErrorZ PaymentFailureReason_read(struct LDKu8slice ser);
44756 * Frees any resources used by the Event
44758 void Event_free(struct LDKEvent this_ptr);
44761 * Creates a copy of the Event
44763 struct LDKEvent Event_clone(const struct LDKEvent *NONNULL_PTR orig);
44766 * Utility method to constructs a new FundingGenerationReady-variant Event
44768 struct LDKEvent Event_funding_generation_ready(struct LDKThirtyTwoBytes temporary_channel_id, struct LDKPublicKey counterparty_node_id, uint64_t channel_value_satoshis, struct LDKCVec_u8Z output_script, struct LDKU128 user_channel_id);
44771 * Utility method to constructs a new PaymentClaimable-variant Event
44773 struct LDKEvent Event_payment_claimable(struct LDKPublicKey receiver_node_id, struct LDKThirtyTwoBytes payment_hash, struct LDKRecipientOnionFields onion_fields, uint64_t amount_msat, uint64_t counterparty_skimmed_fee_msat, struct LDKPaymentPurpose purpose, struct LDKCOption_ThirtyTwoBytesZ via_channel_id, struct LDKCOption_U128Z via_user_channel_id, struct LDKCOption_u32Z claim_deadline);
44776 * Utility method to constructs a new PaymentClaimed-variant Event
44778 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);
44781 * Utility method to constructs a new PaymentSent-variant Event
44783 struct LDKEvent Event_payment_sent(struct LDKCOption_ThirtyTwoBytesZ payment_id, struct LDKThirtyTwoBytes payment_preimage, struct LDKThirtyTwoBytes payment_hash, struct LDKCOption_u64Z fee_paid_msat);
44786 * Utility method to constructs a new PaymentFailed-variant Event
44788 struct LDKEvent Event_payment_failed(struct LDKThirtyTwoBytes payment_id, struct LDKThirtyTwoBytes payment_hash, struct LDKCOption_PaymentFailureReasonZ reason);
44791 * Utility method to constructs a new PaymentPathSuccessful-variant Event
44793 struct LDKEvent Event_payment_path_successful(struct LDKThirtyTwoBytes payment_id, struct LDKCOption_ThirtyTwoBytesZ payment_hash, struct LDKPath path);
44796 * Utility method to constructs a new PaymentPathFailed-variant Event
44798 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);
44801 * Utility method to constructs a new ProbeSuccessful-variant Event
44803 struct LDKEvent Event_probe_successful(struct LDKThirtyTwoBytes payment_id, struct LDKThirtyTwoBytes payment_hash, struct LDKPath path);
44806 * Utility method to constructs a new ProbeFailed-variant Event
44808 struct LDKEvent Event_probe_failed(struct LDKThirtyTwoBytes payment_id, struct LDKThirtyTwoBytes payment_hash, struct LDKPath path, struct LDKCOption_u64Z short_channel_id);
44811 * Utility method to constructs a new PendingHTLCsForwardable-variant Event
44813 struct LDKEvent Event_pending_htlcs_forwardable(uint64_t time_forwardable);
44816 * Utility method to constructs a new HTLCIntercepted-variant Event
44818 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);
44821 * Utility method to constructs a new SpendableOutputs-variant Event
44823 struct LDKEvent Event_spendable_outputs(struct LDKCVec_SpendableOutputDescriptorZ outputs, struct LDKCOption_ThirtyTwoBytesZ channel_id);
44826 * Utility method to constructs a new PaymentForwarded-variant Event
44828 struct LDKEvent Event_payment_forwarded(struct LDKCOption_ThirtyTwoBytesZ prev_channel_id, struct LDKCOption_ThirtyTwoBytesZ next_channel_id, struct LDKCOption_u64Z fee_earned_msat, bool claim_from_onchain_tx, struct LDKCOption_u64Z outbound_amount_forwarded_msat);
44831 * Utility method to constructs a new ChannelPending-variant Event
44833 struct LDKEvent Event_channel_pending(struct LDKThirtyTwoBytes channel_id, struct LDKU128 user_channel_id, struct LDKCOption_ThirtyTwoBytesZ former_temporary_channel_id, struct LDKPublicKey counterparty_node_id, struct LDKOutPoint funding_txo);
44836 * Utility method to constructs a new ChannelReady-variant Event
44838 struct LDKEvent Event_channel_ready(struct LDKThirtyTwoBytes channel_id, struct LDKU128 user_channel_id, struct LDKPublicKey counterparty_node_id, struct LDKChannelTypeFeatures channel_type);
44841 * Utility method to constructs a new ChannelClosed-variant Event
44843 struct LDKEvent Event_channel_closed(struct LDKThirtyTwoBytes channel_id, struct LDKU128 user_channel_id, struct LDKClosureReason reason, struct LDKPublicKey counterparty_node_id, struct LDKCOption_u64Z channel_capacity_sats);
44846 * Utility method to constructs a new DiscardFunding-variant Event
44848 struct LDKEvent Event_discard_funding(struct LDKThirtyTwoBytes channel_id, struct LDKTransaction transaction);
44851 * Utility method to constructs a new OpenChannelRequest-variant Event
44853 struct LDKEvent Event_open_channel_request(struct LDKThirtyTwoBytes temporary_channel_id, struct LDKPublicKey counterparty_node_id, uint64_t funding_satoshis, uint64_t push_msat, struct LDKChannelTypeFeatures channel_type);
44856 * Utility method to constructs a new HTLCHandlingFailed-variant Event
44858 struct LDKEvent Event_htlchandling_failed(struct LDKThirtyTwoBytes prev_channel_id, struct LDKHTLCDestination failed_next_destination);
44861 * Utility method to constructs a new BumpTransaction-variant Event
44863 struct LDKEvent Event_bump_transaction(struct LDKBumpTransactionEvent a);
44866 * Checks if two Events contain equal inner contents.
44867 * This ignores pointers and is_owned flags and looks at the values in fields.
44869 bool Event_eq(const struct LDKEvent *NONNULL_PTR a, const struct LDKEvent *NONNULL_PTR b);
44872 * Serialize the Event object into a byte array which can be read by Event_read
44874 struct LDKCVec_u8Z Event_write(const struct LDKEvent *NONNULL_PTR obj);
44877 * Read a Event from a byte array, created by Event_write
44879 struct LDKCResult_COption_EventZDecodeErrorZ Event_read(struct LDKu8slice ser);
44882 * Frees any resources used by the MessageSendEvent
44884 void MessageSendEvent_free(struct LDKMessageSendEvent this_ptr);
44887 * Creates a copy of the MessageSendEvent
44889 struct LDKMessageSendEvent MessageSendEvent_clone(const struct LDKMessageSendEvent *NONNULL_PTR orig);
44892 * Utility method to constructs a new SendAcceptChannel-variant MessageSendEvent
44894 struct LDKMessageSendEvent MessageSendEvent_send_accept_channel(struct LDKPublicKey node_id, struct LDKAcceptChannel msg);
44897 * Utility method to constructs a new SendAcceptChannelV2-variant MessageSendEvent
44899 struct LDKMessageSendEvent MessageSendEvent_send_accept_channel_v2(struct LDKPublicKey node_id, struct LDKAcceptChannelV2 msg);
44902 * Utility method to constructs a new SendOpenChannel-variant MessageSendEvent
44904 struct LDKMessageSendEvent MessageSendEvent_send_open_channel(struct LDKPublicKey node_id, struct LDKOpenChannel msg);
44907 * Utility method to constructs a new SendOpenChannelV2-variant MessageSendEvent
44909 struct LDKMessageSendEvent MessageSendEvent_send_open_channel_v2(struct LDKPublicKey node_id, struct LDKOpenChannelV2 msg);
44912 * Utility method to constructs a new SendFundingCreated-variant MessageSendEvent
44914 struct LDKMessageSendEvent MessageSendEvent_send_funding_created(struct LDKPublicKey node_id, struct LDKFundingCreated msg);
44917 * Utility method to constructs a new SendFundingSigned-variant MessageSendEvent
44919 struct LDKMessageSendEvent MessageSendEvent_send_funding_signed(struct LDKPublicKey node_id, struct LDKFundingSigned msg);
44922 * Utility method to constructs a new SendTxAddInput-variant MessageSendEvent
44924 struct LDKMessageSendEvent MessageSendEvent_send_tx_add_input(struct LDKPublicKey node_id, struct LDKTxAddInput msg);
44927 * Utility method to constructs a new SendTxAddOutput-variant MessageSendEvent
44929 struct LDKMessageSendEvent MessageSendEvent_send_tx_add_output(struct LDKPublicKey node_id, struct LDKTxAddOutput msg);
44932 * Utility method to constructs a new SendTxRemoveInput-variant MessageSendEvent
44934 struct LDKMessageSendEvent MessageSendEvent_send_tx_remove_input(struct LDKPublicKey node_id, struct LDKTxRemoveInput msg);
44937 * Utility method to constructs a new SendTxRemoveOutput-variant MessageSendEvent
44939 struct LDKMessageSendEvent MessageSendEvent_send_tx_remove_output(struct LDKPublicKey node_id, struct LDKTxRemoveOutput msg);
44942 * Utility method to constructs a new SendTxComplete-variant MessageSendEvent
44944 struct LDKMessageSendEvent MessageSendEvent_send_tx_complete(struct LDKPublicKey node_id, struct LDKTxComplete msg);
44947 * Utility method to constructs a new SendTxSignatures-variant MessageSendEvent
44949 struct LDKMessageSendEvent MessageSendEvent_send_tx_signatures(struct LDKPublicKey node_id, struct LDKTxSignatures msg);
44952 * Utility method to constructs a new SendTxInitRbf-variant MessageSendEvent
44954 struct LDKMessageSendEvent MessageSendEvent_send_tx_init_rbf(struct LDKPublicKey node_id, struct LDKTxInitRbf msg);
44957 * Utility method to constructs a new SendTxAckRbf-variant MessageSendEvent
44959 struct LDKMessageSendEvent MessageSendEvent_send_tx_ack_rbf(struct LDKPublicKey node_id, struct LDKTxAckRbf msg);
44962 * Utility method to constructs a new SendTxAbort-variant MessageSendEvent
44964 struct LDKMessageSendEvent MessageSendEvent_send_tx_abort(struct LDKPublicKey node_id, struct LDKTxAbort msg);
44967 * Utility method to constructs a new SendChannelReady-variant MessageSendEvent
44969 struct LDKMessageSendEvent MessageSendEvent_send_channel_ready(struct LDKPublicKey node_id, struct LDKChannelReady msg);
44972 * Utility method to constructs a new SendAnnouncementSignatures-variant MessageSendEvent
44974 struct LDKMessageSendEvent MessageSendEvent_send_announcement_signatures(struct LDKPublicKey node_id, struct LDKAnnouncementSignatures msg);
44977 * Utility method to constructs a new UpdateHTLCs-variant MessageSendEvent
44979 struct LDKMessageSendEvent MessageSendEvent_update_htlcs(struct LDKPublicKey node_id, struct LDKCommitmentUpdate updates);
44982 * Utility method to constructs a new SendRevokeAndACK-variant MessageSendEvent
44984 struct LDKMessageSendEvent MessageSendEvent_send_revoke_and_ack(struct LDKPublicKey node_id, struct LDKRevokeAndACK msg);
44987 * Utility method to constructs a new SendClosingSigned-variant MessageSendEvent
44989 struct LDKMessageSendEvent MessageSendEvent_send_closing_signed(struct LDKPublicKey node_id, struct LDKClosingSigned msg);
44992 * Utility method to constructs a new SendShutdown-variant MessageSendEvent
44994 struct LDKMessageSendEvent MessageSendEvent_send_shutdown(struct LDKPublicKey node_id, struct LDKShutdown msg);
44997 * Utility method to constructs a new SendChannelReestablish-variant MessageSendEvent
44999 struct LDKMessageSendEvent MessageSendEvent_send_channel_reestablish(struct LDKPublicKey node_id, struct LDKChannelReestablish msg);
45002 * Utility method to constructs a new SendChannelAnnouncement-variant MessageSendEvent
45004 struct LDKMessageSendEvent MessageSendEvent_send_channel_announcement(struct LDKPublicKey node_id, struct LDKChannelAnnouncement msg, struct LDKChannelUpdate update_msg);
45007 * Utility method to constructs a new BroadcastChannelAnnouncement-variant MessageSendEvent
45009 struct LDKMessageSendEvent MessageSendEvent_broadcast_channel_announcement(struct LDKChannelAnnouncement msg, struct LDKChannelUpdate update_msg);
45012 * Utility method to constructs a new BroadcastChannelUpdate-variant MessageSendEvent
45014 struct LDKMessageSendEvent MessageSendEvent_broadcast_channel_update(struct LDKChannelUpdate msg);
45017 * Utility method to constructs a new BroadcastNodeAnnouncement-variant MessageSendEvent
45019 struct LDKMessageSendEvent MessageSendEvent_broadcast_node_announcement(struct LDKNodeAnnouncement msg);
45022 * Utility method to constructs a new SendChannelUpdate-variant MessageSendEvent
45024 struct LDKMessageSendEvent MessageSendEvent_send_channel_update(struct LDKPublicKey node_id, struct LDKChannelUpdate msg);
45027 * Utility method to constructs a new HandleError-variant MessageSendEvent
45029 struct LDKMessageSendEvent MessageSendEvent_handle_error(struct LDKPublicKey node_id, struct LDKErrorAction action);
45032 * Utility method to constructs a new SendChannelRangeQuery-variant MessageSendEvent
45034 struct LDKMessageSendEvent MessageSendEvent_send_channel_range_query(struct LDKPublicKey node_id, struct LDKQueryChannelRange msg);
45037 * Utility method to constructs a new SendShortIdsQuery-variant MessageSendEvent
45039 struct LDKMessageSendEvent MessageSendEvent_send_short_ids_query(struct LDKPublicKey node_id, struct LDKQueryShortChannelIds msg);
45042 * Utility method to constructs a new SendReplyChannelRange-variant MessageSendEvent
45044 struct LDKMessageSendEvent MessageSendEvent_send_reply_channel_range(struct LDKPublicKey node_id, struct LDKReplyChannelRange msg);
45047 * Utility method to constructs a new SendGossipTimestampFilter-variant MessageSendEvent
45049 struct LDKMessageSendEvent MessageSendEvent_send_gossip_timestamp_filter(struct LDKPublicKey node_id, struct LDKGossipTimestampFilter msg);
45052 * Calls the free function if one is set
45054 void MessageSendEventsProvider_free(struct LDKMessageSendEventsProvider this_ptr);
45057 * Calls the free function if one is set
45059 void OnionMessageProvider_free(struct LDKOnionMessageProvider this_ptr);
45062 * Calls the free function if one is set
45064 void EventsProvider_free(struct LDKEventsProvider this_ptr);
45067 * Calls the free function if one is set
45069 void EventHandler_free(struct LDKEventHandler this_ptr);
45072 * Frees any resources used by the ChannelDerivationParameters, if is_owned is set and inner is non-NULL.
45074 void ChannelDerivationParameters_free(struct LDKChannelDerivationParameters this_obj);
45077 * The value in satoshis of the channel we're attempting to spend the anchor output of.
45079 uint64_t ChannelDerivationParameters_get_value_satoshis(const struct LDKChannelDerivationParameters *NONNULL_PTR this_ptr);
45082 * The value in satoshis of the channel we're attempting to spend the anchor output of.
45084 void ChannelDerivationParameters_set_value_satoshis(struct LDKChannelDerivationParameters *NONNULL_PTR this_ptr, uint64_t val);
45087 * The unique identifier to re-derive the signer for the associated channel.
45089 const uint8_t (*ChannelDerivationParameters_get_keys_id(const struct LDKChannelDerivationParameters *NONNULL_PTR this_ptr))[32];
45092 * The unique identifier to re-derive the signer for the associated channel.
45094 void ChannelDerivationParameters_set_keys_id(struct LDKChannelDerivationParameters *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
45097 * The necessary channel parameters that need to be provided to the re-derived signer through
45098 * [`ChannelSigner::provide_channel_parameters`].
45100 * [`ChannelSigner::provide_channel_parameters`]: crate::sign::ChannelSigner::provide_channel_parameters
45102 struct LDKChannelTransactionParameters ChannelDerivationParameters_get_transaction_parameters(const struct LDKChannelDerivationParameters *NONNULL_PTR this_ptr);
45105 * The necessary channel parameters that need to be provided to the re-derived signer through
45106 * [`ChannelSigner::provide_channel_parameters`].
45108 * [`ChannelSigner::provide_channel_parameters`]: crate::sign::ChannelSigner::provide_channel_parameters
45110 void ChannelDerivationParameters_set_transaction_parameters(struct LDKChannelDerivationParameters *NONNULL_PTR this_ptr, struct LDKChannelTransactionParameters val);
45113 * Constructs a new ChannelDerivationParameters given each field
45115 MUST_USE_RES struct LDKChannelDerivationParameters ChannelDerivationParameters_new(uint64_t value_satoshis_arg, struct LDKThirtyTwoBytes keys_id_arg, struct LDKChannelTransactionParameters transaction_parameters_arg);
45118 * Creates a copy of the ChannelDerivationParameters
45120 struct LDKChannelDerivationParameters ChannelDerivationParameters_clone(const struct LDKChannelDerivationParameters *NONNULL_PTR orig);
45123 * Checks if two ChannelDerivationParameterss contain equal inner contents.
45124 * This ignores pointers and is_owned flags and looks at the values in fields.
45125 * Two objects with NULL inner values will be considered "equal" here.
45127 bool ChannelDerivationParameters_eq(const struct LDKChannelDerivationParameters *NONNULL_PTR a, const struct LDKChannelDerivationParameters *NONNULL_PTR b);
45130 * Serialize the ChannelDerivationParameters object into a byte array which can be read by ChannelDerivationParameters_read
45132 struct LDKCVec_u8Z ChannelDerivationParameters_write(const struct LDKChannelDerivationParameters *NONNULL_PTR obj);
45135 * Read a ChannelDerivationParameters from a byte array, created by ChannelDerivationParameters_write
45137 struct LDKCResult_ChannelDerivationParametersDecodeErrorZ ChannelDerivationParameters_read(struct LDKu8slice ser);
45140 * Frees any resources used by the AnchorDescriptor, if is_owned is set and inner is non-NULL.
45142 void AnchorDescriptor_free(struct LDKAnchorDescriptor this_obj);
45145 * The parameters required to derive the signer for the anchor input.
45147 struct LDKChannelDerivationParameters AnchorDescriptor_get_channel_derivation_parameters(const struct LDKAnchorDescriptor *NONNULL_PTR this_ptr);
45150 * The parameters required to derive the signer for the anchor input.
45152 void AnchorDescriptor_set_channel_derivation_parameters(struct LDKAnchorDescriptor *NONNULL_PTR this_ptr, struct LDKChannelDerivationParameters val);
45155 * The transaction input's outpoint corresponding to the commitment transaction's anchor
45158 struct LDKOutPoint AnchorDescriptor_get_outpoint(const struct LDKAnchorDescriptor *NONNULL_PTR this_ptr);
45161 * The transaction input's outpoint corresponding to the commitment transaction's anchor
45164 void AnchorDescriptor_set_outpoint(struct LDKAnchorDescriptor *NONNULL_PTR this_ptr, struct LDKOutPoint val);
45167 * Constructs a new AnchorDescriptor given each field
45169 MUST_USE_RES struct LDKAnchorDescriptor AnchorDescriptor_new(struct LDKChannelDerivationParameters channel_derivation_parameters_arg, struct LDKOutPoint outpoint_arg);
45172 * Creates a copy of the AnchorDescriptor
45174 struct LDKAnchorDescriptor AnchorDescriptor_clone(const struct LDKAnchorDescriptor *NONNULL_PTR orig);
45177 * Checks if two AnchorDescriptors contain equal inner contents.
45178 * This ignores pointers and is_owned flags and looks at the values in fields.
45179 * Two objects with NULL inner values will be considered "equal" here.
45181 bool AnchorDescriptor_eq(const struct LDKAnchorDescriptor *NONNULL_PTR a, const struct LDKAnchorDescriptor *NONNULL_PTR b);
45184 * Returns the UTXO to be spent by the anchor input, which can be obtained via
45185 * [`Self::unsigned_tx_input`].
45187 MUST_USE_RES struct LDKTxOut AnchorDescriptor_previous_utxo(const struct LDKAnchorDescriptor *NONNULL_PTR this_arg);
45190 * Returns the unsigned transaction input spending the anchor output in the commitment
45193 MUST_USE_RES struct LDKTxIn AnchorDescriptor_unsigned_tx_input(const struct LDKAnchorDescriptor *NONNULL_PTR this_arg);
45196 * Returns the witness script of the anchor output in the commitment transaction.
45198 MUST_USE_RES struct LDKCVec_u8Z AnchorDescriptor_witness_script(const struct LDKAnchorDescriptor *NONNULL_PTR this_arg);
45201 * Returns the fully signed witness required to spend the anchor output in the commitment
45204 MUST_USE_RES struct LDKWitness AnchorDescriptor_tx_input_witness(const struct LDKAnchorDescriptor *NONNULL_PTR this_arg, struct LDKECDSASignature signature);
45207 * Derives the channel signer required to sign the anchor input.
45209 MUST_USE_RES struct LDKWriteableEcdsaChannelSigner AnchorDescriptor_derive_channel_signer(const struct LDKAnchorDescriptor *NONNULL_PTR this_arg, const struct LDKSignerProvider *NONNULL_PTR signer_provider);
45212 * Frees any resources used by the HTLCDescriptor, if is_owned is set and inner is non-NULL.
45214 void HTLCDescriptor_free(struct LDKHTLCDescriptor this_obj);
45217 * The parameters required to derive the signer for the HTLC input.
45219 struct LDKChannelDerivationParameters HTLCDescriptor_get_channel_derivation_parameters(const struct LDKHTLCDescriptor *NONNULL_PTR this_ptr);
45222 * The parameters required to derive the signer for the HTLC input.
45224 void HTLCDescriptor_set_channel_derivation_parameters(struct LDKHTLCDescriptor *NONNULL_PTR this_ptr, struct LDKChannelDerivationParameters val);
45227 * The number of the commitment transaction in which the HTLC output lives.
45229 uint64_t HTLCDescriptor_get_per_commitment_number(const struct LDKHTLCDescriptor *NONNULL_PTR this_ptr);
45232 * The number of the commitment transaction in which the HTLC output lives.
45234 void HTLCDescriptor_set_per_commitment_number(struct LDKHTLCDescriptor *NONNULL_PTR this_ptr, uint64_t val);
45237 * The key tweak corresponding to the number of the commitment transaction in which the HTLC
45238 * output lives. This tweak is applied to all the basepoints for both parties in the channel to
45239 * arrive at unique keys per commitment.
45241 * See <https://github.com/lightning/bolts/blob/master/03-transactions.md#keys> for more info.
45243 struct LDKPublicKey HTLCDescriptor_get_per_commitment_point(const struct LDKHTLCDescriptor *NONNULL_PTR this_ptr);
45246 * The key tweak corresponding to the number of the commitment transaction in which the HTLC
45247 * output lives. This tweak is applied to all the basepoints for both parties in the channel to
45248 * arrive at unique keys per commitment.
45250 * See <https://github.com/lightning/bolts/blob/master/03-transactions.md#keys> for more info.
45252 void HTLCDescriptor_set_per_commitment_point(struct LDKHTLCDescriptor *NONNULL_PTR this_ptr, struct LDKPublicKey val);
45255 * The details of the HTLC as it appears in the commitment transaction.
45257 struct LDKHTLCOutputInCommitment HTLCDescriptor_get_htlc(const struct LDKHTLCDescriptor *NONNULL_PTR this_ptr);
45260 * The details of the HTLC as it appears in the commitment transaction.
45262 void HTLCDescriptor_set_htlc(struct LDKHTLCDescriptor *NONNULL_PTR this_ptr, struct LDKHTLCOutputInCommitment val);
45265 * The preimage, if `Some`, to claim the HTLC output with. If `None`, the timeout path must be
45268 struct LDKCOption_ThirtyTwoBytesZ HTLCDescriptor_get_preimage(const struct LDKHTLCDescriptor *NONNULL_PTR this_ptr);
45271 * The preimage, if `Some`, to claim the HTLC output with. If `None`, the timeout path must be
45274 void HTLCDescriptor_set_preimage(struct LDKHTLCDescriptor *NONNULL_PTR this_ptr, struct LDKCOption_ThirtyTwoBytesZ val);
45277 * The counterparty's signature required to spend the HTLC output.
45279 struct LDKECDSASignature HTLCDescriptor_get_counterparty_sig(const struct LDKHTLCDescriptor *NONNULL_PTR this_ptr);
45282 * The counterparty's signature required to spend the HTLC output.
45284 void HTLCDescriptor_set_counterparty_sig(struct LDKHTLCDescriptor *NONNULL_PTR this_ptr, struct LDKECDSASignature val);
45287 * Creates a copy of the HTLCDescriptor
45289 struct LDKHTLCDescriptor HTLCDescriptor_clone(const struct LDKHTLCDescriptor *NONNULL_PTR orig);
45292 * Checks if two HTLCDescriptors contain equal inner contents.
45293 * This ignores pointers and is_owned flags and looks at the values in fields.
45294 * Two objects with NULL inner values will be considered "equal" here.
45296 bool HTLCDescriptor_eq(const struct LDKHTLCDescriptor *NONNULL_PTR a, const struct LDKHTLCDescriptor *NONNULL_PTR b);
45299 * Serialize the HTLCDescriptor object into a byte array which can be read by HTLCDescriptor_read
45301 struct LDKCVec_u8Z HTLCDescriptor_write(const struct LDKHTLCDescriptor *NONNULL_PTR obj);
45304 * Read a HTLCDescriptor from a byte array, created by HTLCDescriptor_write
45306 struct LDKCResult_HTLCDescriptorDecodeErrorZ HTLCDescriptor_read(struct LDKu8slice ser);
45309 * Returns the outpoint of the HTLC output in the commitment transaction. This is the outpoint
45310 * being spent by the HTLC input in the HTLC transaction.
45312 MUST_USE_RES struct LDKOutPoint HTLCDescriptor_outpoint(const struct LDKHTLCDescriptor *NONNULL_PTR this_arg);
45315 * Returns the UTXO to be spent by the HTLC input, which can be obtained via
45316 * [`Self::unsigned_tx_input`].
45318 MUST_USE_RES struct LDKTxOut HTLCDescriptor_previous_utxo(const struct LDKHTLCDescriptor *NONNULL_PTR this_arg);
45321 * Returns the unsigned transaction input spending the HTLC output in the commitment
45324 MUST_USE_RES struct LDKTxIn HTLCDescriptor_unsigned_tx_input(const struct LDKHTLCDescriptor *NONNULL_PTR this_arg);
45327 * Returns the delayed output created as a result of spending the HTLC output in the commitment
45330 MUST_USE_RES struct LDKTxOut HTLCDescriptor_tx_output(const struct LDKHTLCDescriptor *NONNULL_PTR this_arg);
45333 * Returns the witness script of the HTLC output in the commitment transaction.
45335 MUST_USE_RES struct LDKCVec_u8Z HTLCDescriptor_witness_script(const struct LDKHTLCDescriptor *NONNULL_PTR this_arg);
45338 * Returns the fully signed witness required to spend the HTLC output in the commitment
45341 MUST_USE_RES struct LDKWitness HTLCDescriptor_tx_input_witness(const struct LDKHTLCDescriptor *NONNULL_PTR this_arg, struct LDKECDSASignature signature, struct LDKu8slice witness_script);
45344 * Derives the channel signer required to sign the HTLC input.
45346 MUST_USE_RES struct LDKWriteableEcdsaChannelSigner HTLCDescriptor_derive_channel_signer(const struct LDKHTLCDescriptor *NONNULL_PTR this_arg, const struct LDKSignerProvider *NONNULL_PTR signer_provider);
45349 * Frees any resources used by the BumpTransactionEvent
45351 void BumpTransactionEvent_free(struct LDKBumpTransactionEvent this_ptr);
45354 * Creates a copy of the BumpTransactionEvent
45356 struct LDKBumpTransactionEvent BumpTransactionEvent_clone(const struct LDKBumpTransactionEvent *NONNULL_PTR orig);
45359 * Utility method to constructs a new ChannelClose-variant BumpTransactionEvent
45361 struct LDKBumpTransactionEvent BumpTransactionEvent_channel_close(struct LDKThirtyTwoBytes claim_id, uint32_t package_target_feerate_sat_per_1000_weight, struct LDKTransaction commitment_tx, uint64_t commitment_tx_fee_satoshis, struct LDKAnchorDescriptor anchor_descriptor, struct LDKCVec_HTLCOutputInCommitmentZ pending_htlcs);
45364 * Utility method to constructs a new HTLCResolution-variant BumpTransactionEvent
45366 struct LDKBumpTransactionEvent BumpTransactionEvent_htlcresolution(struct LDKThirtyTwoBytes claim_id, uint32_t target_feerate_sat_per_1000_weight, struct LDKCVec_HTLCDescriptorZ htlc_descriptors, uint32_t tx_lock_time);
45369 * Checks if two BumpTransactionEvents contain equal inner contents.
45370 * This ignores pointers and is_owned flags and looks at the values in fields.
45372 bool BumpTransactionEvent_eq(const struct LDKBumpTransactionEvent *NONNULL_PTR a, const struct LDKBumpTransactionEvent *NONNULL_PTR b);
45375 * Frees any resources used by the Input, if is_owned is set and inner is non-NULL.
45377 void Input_free(struct LDKInput this_obj);
45380 * The unique identifier of the input.
45382 struct LDKOutPoint Input_get_outpoint(const struct LDKInput *NONNULL_PTR this_ptr);
45385 * The unique identifier of the input.
45387 void Input_set_outpoint(struct LDKInput *NONNULL_PTR this_ptr, struct LDKOutPoint val);
45390 * The UTXO being spent by the input.
45392 struct LDKTxOut Input_get_previous_utxo(const struct LDKInput *NONNULL_PTR this_ptr);
45395 * The UTXO being spent by the input.
45397 void Input_set_previous_utxo(struct LDKInput *NONNULL_PTR this_ptr, struct LDKTxOut val);
45400 * The upper-bound weight consumed by the input's full [`TxIn::script_sig`] and
45401 * [`TxIn::witness`], each with their lengths included, required to satisfy the output's
45404 uint64_t Input_get_satisfaction_weight(const struct LDKInput *NONNULL_PTR this_ptr);
45407 * The upper-bound weight consumed by the input's full [`TxIn::script_sig`] and
45408 * [`TxIn::witness`], each with their lengths included, required to satisfy the output's
45411 void Input_set_satisfaction_weight(struct LDKInput *NONNULL_PTR this_ptr, uint64_t val);
45414 * Constructs a new Input given each field
45416 MUST_USE_RES struct LDKInput Input_new(struct LDKOutPoint outpoint_arg, struct LDKTxOut previous_utxo_arg, uint64_t satisfaction_weight_arg);
45419 * Creates a copy of the Input
45421 struct LDKInput Input_clone(const struct LDKInput *NONNULL_PTR orig);
45424 * Generates a non-cryptographic 64-bit hash of the Input.
45426 uint64_t Input_hash(const struct LDKInput *NONNULL_PTR o);
45429 * Checks if two Inputs contain equal inner contents.
45430 * This ignores pointers and is_owned flags and looks at the values in fields.
45431 * Two objects with NULL inner values will be considered "equal" here.
45433 bool Input_eq(const struct LDKInput *NONNULL_PTR a, const struct LDKInput *NONNULL_PTR b);
45436 * Frees any resources used by the Utxo, if is_owned is set and inner is non-NULL.
45438 void Utxo_free(struct LDKUtxo this_obj);
45441 * The unique identifier of the output.
45443 struct LDKOutPoint Utxo_get_outpoint(const struct LDKUtxo *NONNULL_PTR this_ptr);
45446 * The unique identifier of the output.
45448 void Utxo_set_outpoint(struct LDKUtxo *NONNULL_PTR this_ptr, struct LDKOutPoint val);
45451 * The output to spend.
45453 struct LDKTxOut Utxo_get_output(const struct LDKUtxo *NONNULL_PTR this_ptr);
45456 * The output to spend.
45458 void Utxo_set_output(struct LDKUtxo *NONNULL_PTR this_ptr, struct LDKTxOut val);
45461 * The upper-bound weight consumed by the input's full [`TxIn::script_sig`] and [`TxIn::witness`], each
45462 * with their lengths included, required to satisfy the output's script. The weight consumed by
45463 * the input's `script_sig` must account for [`WITNESS_SCALE_FACTOR`].
45465 uint64_t Utxo_get_satisfaction_weight(const struct LDKUtxo *NONNULL_PTR this_ptr);
45468 * The upper-bound weight consumed by the input's full [`TxIn::script_sig`] and [`TxIn::witness`], each
45469 * with their lengths included, required to satisfy the output's script. The weight consumed by
45470 * the input's `script_sig` must account for [`WITNESS_SCALE_FACTOR`].
45472 void Utxo_set_satisfaction_weight(struct LDKUtxo *NONNULL_PTR this_ptr, uint64_t val);
45475 * Constructs a new Utxo given each field
45477 MUST_USE_RES struct LDKUtxo Utxo_new(struct LDKOutPoint outpoint_arg, struct LDKTxOut output_arg, uint64_t satisfaction_weight_arg);
45480 * Creates a copy of the Utxo
45482 struct LDKUtxo Utxo_clone(const struct LDKUtxo *NONNULL_PTR orig);
45485 * Generates a non-cryptographic 64-bit hash of the Utxo.
45487 uint64_t Utxo_hash(const struct LDKUtxo *NONNULL_PTR o);
45490 * Checks if two Utxos contain equal inner contents.
45491 * This ignores pointers and is_owned flags and looks at the values in fields.
45492 * Two objects with NULL inner values will be considered "equal" here.
45494 bool Utxo_eq(const struct LDKUtxo *NONNULL_PTR a, const struct LDKUtxo *NONNULL_PTR b);
45497 * Returns a `Utxo` with the `satisfaction_weight` estimate for a legacy P2PKH output.
45499 MUST_USE_RES struct LDKUtxo Utxo_new_p2pkh(struct LDKOutPoint outpoint, uint64_t value, const uint8_t (*pubkey_hash)[20]);
45502 * Frees any resources used by the CoinSelection, if is_owned is set and inner is non-NULL.
45504 void CoinSelection_free(struct LDKCoinSelection this_obj);
45507 * The set of UTXOs (with at least 1 confirmation) to spend and use within a transaction
45508 * requiring additional fees.
45510 struct LDKCVec_UtxoZ CoinSelection_get_confirmed_utxos(const struct LDKCoinSelection *NONNULL_PTR this_ptr);
45513 * The set of UTXOs (with at least 1 confirmation) to spend and use within a transaction
45514 * requiring additional fees.
45516 void CoinSelection_set_confirmed_utxos(struct LDKCoinSelection *NONNULL_PTR this_ptr, struct LDKCVec_UtxoZ val);
45519 * An additional output tracking whether any change remained after coin selection. This output
45520 * should always have a value above dust for its given `script_pubkey`. It should not be
45521 * spent until the transaction it belongs to confirms to ensure mempool descendant limits are
45522 * not met. This implies no other party should be able to spend it except us.
45524 struct LDKCOption_TxOutZ CoinSelection_get_change_output(const struct LDKCoinSelection *NONNULL_PTR this_ptr);
45527 * An additional output tracking whether any change remained after coin selection. This output
45528 * should always have a value above dust for its given `script_pubkey`. It should not be
45529 * spent until the transaction it belongs to confirms to ensure mempool descendant limits are
45530 * not met. This implies no other party should be able to spend it except us.
45532 void CoinSelection_set_change_output(struct LDKCoinSelection *NONNULL_PTR this_ptr, struct LDKCOption_TxOutZ val);
45535 * Constructs a new CoinSelection given each field
45537 MUST_USE_RES struct LDKCoinSelection CoinSelection_new(struct LDKCVec_UtxoZ confirmed_utxos_arg, struct LDKCOption_TxOutZ change_output_arg);
45540 * Creates a copy of the CoinSelection
45542 struct LDKCoinSelection CoinSelection_clone(const struct LDKCoinSelection *NONNULL_PTR orig);
45545 * Calls the free function if one is set
45547 void CoinSelectionSource_free(struct LDKCoinSelectionSource this_ptr);
45550 * Calls the free function if one is set
45552 void WalletSource_free(struct LDKWalletSource this_ptr);
45555 * Frees any resources used by the Wallet, if is_owned is set and inner is non-NULL.
45557 void Wallet_free(struct LDKWallet this_obj);
45560 * Returns a new instance backed by the given [`WalletSource`] that serves as an implementation
45561 * of [`CoinSelectionSource`].
45563 MUST_USE_RES struct LDKWallet Wallet_new(struct LDKWalletSource source, struct LDKLogger logger);
45566 * Constructs a new CoinSelectionSource which calls the relevant methods on this_arg.
45567 * This copies the `inner` pointer in this_arg and thus the returned CoinSelectionSource must be freed before this_arg is
45569 struct LDKCoinSelectionSource Wallet_as_CoinSelectionSource(const struct LDKWallet *NONNULL_PTR this_arg);
45572 * Frees any resources used by the BumpTransactionEventHandler, if is_owned is set and inner is non-NULL.
45574 void BumpTransactionEventHandler_free(struct LDKBumpTransactionEventHandler this_obj);
45577 * Returns a new instance capable of handling [`Event::BumpTransaction`] events.
45579 * [`Event::BumpTransaction`]: crate::events::Event::BumpTransaction
45581 MUST_USE_RES struct LDKBumpTransactionEventHandler BumpTransactionEventHandler_new(struct LDKBroadcasterInterface broadcaster, struct LDKCoinSelectionSource utxo_source, struct LDKSignerProvider signer_provider, struct LDKLogger logger);
45584 * Handles all variants of [`BumpTransactionEvent`].
45586 void BumpTransactionEventHandler_handle_event(const struct LDKBumpTransactionEventHandler *NONNULL_PTR this_arg, const struct LDKBumpTransactionEvent *NONNULL_PTR event);
45589 * Frees any resources used by the FilesystemStore, if is_owned is set and inner is non-NULL.
45591 void FilesystemStore_free(struct LDKFilesystemStore this_obj);
45594 * Constructs a new [`FilesystemStore`].
45596 MUST_USE_RES struct LDKFilesystemStore FilesystemStore_new(struct LDKStr data_dir);
45599 * Returns the data directory.
45601 MUST_USE_RES struct LDKStr FilesystemStore_get_data_dir(const struct LDKFilesystemStore *NONNULL_PTR this_arg);
45604 * Constructs a new KVStore which calls the relevant methods on this_arg.
45605 * This copies the `inner` pointer in this_arg and thus the returned KVStore must be freed before this_arg is
45607 struct LDKKVStore FilesystemStore_as_KVStore(const struct LDKFilesystemStore *NONNULL_PTR this_arg);
45610 * Frees any resources used by the BackgroundProcessor, if is_owned is set and inner is non-NULL.
45612 void BackgroundProcessor_free(struct LDKBackgroundProcessor this_obj);
45615 * Frees any resources used by the GossipSync
45617 void GossipSync_free(struct LDKGossipSync this_ptr);
45620 * Utility method to constructs a new P2P-variant GossipSync
45622 struct LDKGossipSync GossipSync_p2_p(const struct LDKP2PGossipSync *NONNULL_PTR a);
45625 * Utility method to constructs a new Rapid-variant GossipSync
45627 struct LDKGossipSync GossipSync_rapid(const struct LDKRapidGossipSync *NONNULL_PTR a);
45630 * Utility method to constructs a new None-variant GossipSync
45632 struct LDKGossipSync GossipSync_none(void);
45635 * Start a background thread that takes care of responsibilities enumerated in the [top-level
45638 * The thread runs indefinitely unless the object is dropped, [`stop`] is called, or
45639 * [`Persister::persist_manager`] returns an error. In case of an error, the error is retrieved by calling
45640 * either [`join`] or [`stop`].
45642 * # Data Persistence
45644 * [`Persister::persist_manager`] is responsible for writing out the [`ChannelManager`] to disk, and/or
45645 * uploading to one or more backup services. See [`ChannelManager::write`] for writing out a
45646 * [`ChannelManager`]. See the `lightning-persister` crate for LDK's
45647 * provided implementation.
45649 * [`Persister::persist_graph`] is responsible for writing out the [`NetworkGraph`] to disk, if
45650 * [`GossipSync`] is supplied. See [`NetworkGraph::write`] for writing out a [`NetworkGraph`].
45651 * See the `lightning-persister` crate for LDK's provided implementation.
45653 * Typically, users should either implement [`Persister::persist_manager`] to never return an
45654 * error or call [`join`] and handle any error that may arise. For the latter case,
45655 * `BackgroundProcessor` must be restarted by calling `start` again after handling the error.
45659 * `event_handler` is responsible for handling events that users should be notified of (e.g.,
45660 * payment failed). [`BackgroundProcessor`] may decorate the given [`EventHandler`] with common
45661 * functionality implemented by other handlers.
45662 * * [`P2PGossipSync`] if given will update the [`NetworkGraph`] based on payment failures.
45664 * # Rapid Gossip Sync
45666 * If rapid gossip sync is meant to run at startup, pass [`RapidGossipSync`] via `gossip_sync`
45667 * to indicate that the [`BackgroundProcessor`] should not prune the [`NetworkGraph`] instance
45668 * until the [`RapidGossipSync`] instance completes its first sync.
45670 * [top-level documentation]: BackgroundProcessor
45671 * [`join`]: Self::join
45672 * [`stop`]: Self::stop
45673 * [`ChannelManager`]: lightning::ln::channelmanager::ChannelManager
45674 * [`ChannelManager::write`]: lightning::ln::channelmanager::ChannelManager#impl-Writeable
45675 * [`Persister::persist_manager`]: lightning::util::persist::Persister::persist_manager
45676 * [`Persister::persist_graph`]: lightning::util::persist::Persister::persist_graph
45677 * [`NetworkGraph`]: lightning::routing::gossip::NetworkGraph
45678 * [`NetworkGraph::write`]: lightning::routing::gossip::NetworkGraph#impl-Writeable
45680 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);
45683 * Join `BackgroundProcessor`'s thread, returning any error that occurred while persisting
45684 * [`ChannelManager`].
45688 * This function panics if the background thread has panicked such as while persisting or
45691 * [`ChannelManager`]: lightning::ln::channelmanager::ChannelManager
45693 MUST_USE_RES struct LDKCResult_NoneIOErrorZ BackgroundProcessor_join(struct LDKBackgroundProcessor this_arg);
45696 * Stop `BackgroundProcessor`'s thread, returning any error that occurred while persisting
45697 * [`ChannelManager`].
45701 * This function panics if the background thread has panicked such as while persisting or
45704 * [`ChannelManager`]: lightning::ln::channelmanager::ChannelManager
45706 MUST_USE_RES struct LDKCResult_NoneIOErrorZ BackgroundProcessor_stop(struct LDKBackgroundProcessor this_arg);
45709 * Frees any resources used by the Bolt11ParseError
45711 void Bolt11ParseError_free(struct LDKBolt11ParseError this_ptr);
45714 * Creates a copy of the Bolt11ParseError
45716 struct LDKBolt11ParseError Bolt11ParseError_clone(const struct LDKBolt11ParseError *NONNULL_PTR orig);
45719 * Utility method to constructs a new Bech32Error-variant Bolt11ParseError
45721 struct LDKBolt11ParseError Bolt11ParseError_bech32_error(struct LDKBech32Error a);
45724 * Utility method to constructs a new ParseAmountError-variant Bolt11ParseError
45726 struct LDKBolt11ParseError Bolt11ParseError_parse_amount_error(struct LDKError a);
45729 * Utility method to constructs a new MalformedSignature-variant Bolt11ParseError
45731 struct LDKBolt11ParseError Bolt11ParseError_malformed_signature(enum LDKSecp256k1Error a);
45734 * Utility method to constructs a new BadPrefix-variant Bolt11ParseError
45736 struct LDKBolt11ParseError Bolt11ParseError_bad_prefix(void);
45739 * Utility method to constructs a new UnknownCurrency-variant Bolt11ParseError
45741 struct LDKBolt11ParseError Bolt11ParseError_unknown_currency(void);
45744 * Utility method to constructs a new UnknownSiPrefix-variant Bolt11ParseError
45746 struct LDKBolt11ParseError Bolt11ParseError_unknown_si_prefix(void);
45749 * Utility method to constructs a new MalformedHRP-variant Bolt11ParseError
45751 struct LDKBolt11ParseError Bolt11ParseError_malformed_hrp(void);
45754 * Utility method to constructs a new TooShortDataPart-variant Bolt11ParseError
45756 struct LDKBolt11ParseError Bolt11ParseError_too_short_data_part(void);
45759 * Utility method to constructs a new UnexpectedEndOfTaggedFields-variant Bolt11ParseError
45761 struct LDKBolt11ParseError Bolt11ParseError_unexpected_end_of_tagged_fields(void);
45764 * Utility method to constructs a new DescriptionDecodeError-variant Bolt11ParseError
45766 struct LDKBolt11ParseError Bolt11ParseError_description_decode_error(struct LDKError a);
45769 * Utility method to constructs a new PaddingError-variant Bolt11ParseError
45771 struct LDKBolt11ParseError Bolt11ParseError_padding_error(void);
45774 * Utility method to constructs a new IntegerOverflowError-variant Bolt11ParseError
45776 struct LDKBolt11ParseError Bolt11ParseError_integer_overflow_error(void);
45779 * Utility method to constructs a new InvalidSegWitProgramLength-variant Bolt11ParseError
45781 struct LDKBolt11ParseError Bolt11ParseError_invalid_seg_wit_program_length(void);
45784 * Utility method to constructs a new InvalidPubKeyHashLength-variant Bolt11ParseError
45786 struct LDKBolt11ParseError Bolt11ParseError_invalid_pub_key_hash_length(void);
45789 * Utility method to constructs a new InvalidScriptHashLength-variant Bolt11ParseError
45791 struct LDKBolt11ParseError Bolt11ParseError_invalid_script_hash_length(void);
45794 * Utility method to constructs a new InvalidRecoveryId-variant Bolt11ParseError
45796 struct LDKBolt11ParseError Bolt11ParseError_invalid_recovery_id(void);
45799 * Utility method to constructs a new InvalidSliceLength-variant Bolt11ParseError
45801 struct LDKBolt11ParseError Bolt11ParseError_invalid_slice_length(struct LDKStr a);
45804 * Utility method to constructs a new Skip-variant Bolt11ParseError
45806 struct LDKBolt11ParseError Bolt11ParseError_skip(void);
45809 * Checks if two Bolt11ParseErrors contain equal inner contents.
45810 * This ignores pointers and is_owned flags and looks at the values in fields.
45812 bool Bolt11ParseError_eq(const struct LDKBolt11ParseError *NONNULL_PTR a, const struct LDKBolt11ParseError *NONNULL_PTR b);
45815 * Frees any resources used by the ParseOrSemanticError
45817 void ParseOrSemanticError_free(struct LDKParseOrSemanticError this_ptr);
45820 * Creates a copy of the ParseOrSemanticError
45822 struct LDKParseOrSemanticError ParseOrSemanticError_clone(const struct LDKParseOrSemanticError *NONNULL_PTR orig);
45825 * Utility method to constructs a new ParseError-variant ParseOrSemanticError
45827 struct LDKParseOrSemanticError ParseOrSemanticError_parse_error(struct LDKBolt11ParseError a);
45830 * Utility method to constructs a new SemanticError-variant ParseOrSemanticError
45832 struct LDKParseOrSemanticError ParseOrSemanticError_semantic_error(enum LDKBolt11SemanticError a);
45835 * Checks if two ParseOrSemanticErrors contain equal inner contents.
45836 * This ignores pointers and is_owned flags and looks at the values in fields.
45838 bool ParseOrSemanticError_eq(const struct LDKParseOrSemanticError *NONNULL_PTR a, const struct LDKParseOrSemanticError *NONNULL_PTR b);
45841 * Frees any resources used by the Bolt11Invoice, if is_owned is set and inner is non-NULL.
45843 void Bolt11Invoice_free(struct LDKBolt11Invoice this_obj);
45846 * Checks if two Bolt11Invoices 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 Bolt11Invoice_eq(const struct LDKBolt11Invoice *NONNULL_PTR a, const struct LDKBolt11Invoice *NONNULL_PTR b);
45853 * Creates a copy of the Bolt11Invoice
45855 struct LDKBolt11Invoice Bolt11Invoice_clone(const struct LDKBolt11Invoice *NONNULL_PTR orig);
45858 * Generates a non-cryptographic 64-bit hash of the Bolt11Invoice.
45860 uint64_t Bolt11Invoice_hash(const struct LDKBolt11Invoice *NONNULL_PTR o);
45863 * Frees any resources used by the SignedRawBolt11Invoice, if is_owned is set and inner is non-NULL.
45865 void SignedRawBolt11Invoice_free(struct LDKSignedRawBolt11Invoice this_obj);
45868 * Checks if two SignedRawBolt11Invoices contain equal inner contents.
45869 * This ignores pointers and is_owned flags and looks at the values in fields.
45870 * Two objects with NULL inner values will be considered "equal" here.
45872 bool SignedRawBolt11Invoice_eq(const struct LDKSignedRawBolt11Invoice *NONNULL_PTR a, const struct LDKSignedRawBolt11Invoice *NONNULL_PTR b);
45875 * Creates a copy of the SignedRawBolt11Invoice
45877 struct LDKSignedRawBolt11Invoice SignedRawBolt11Invoice_clone(const struct LDKSignedRawBolt11Invoice *NONNULL_PTR orig);
45880 * Generates a non-cryptographic 64-bit hash of the SignedRawBolt11Invoice.
45882 uint64_t SignedRawBolt11Invoice_hash(const struct LDKSignedRawBolt11Invoice *NONNULL_PTR o);
45885 * Frees any resources used by the RawBolt11Invoice, if is_owned is set and inner is non-NULL.
45887 void RawBolt11Invoice_free(struct LDKRawBolt11Invoice this_obj);
45892 struct LDKRawDataPart RawBolt11Invoice_get_data(const struct LDKRawBolt11Invoice *NONNULL_PTR this_ptr);
45897 void RawBolt11Invoice_set_data(struct LDKRawBolt11Invoice *NONNULL_PTR this_ptr, struct LDKRawDataPart val);
45900 * Checks if two RawBolt11Invoices contain equal inner contents.
45901 * This ignores pointers and is_owned flags and looks at the values in fields.
45902 * Two objects with NULL inner values will be considered "equal" here.
45904 bool RawBolt11Invoice_eq(const struct LDKRawBolt11Invoice *NONNULL_PTR a, const struct LDKRawBolt11Invoice *NONNULL_PTR b);
45907 * Creates a copy of the RawBolt11Invoice
45909 struct LDKRawBolt11Invoice RawBolt11Invoice_clone(const struct LDKRawBolt11Invoice *NONNULL_PTR orig);
45912 * Generates a non-cryptographic 64-bit hash of the RawBolt11Invoice.
45914 uint64_t RawBolt11Invoice_hash(const struct LDKRawBolt11Invoice *NONNULL_PTR o);
45917 * Frees any resources used by the RawDataPart, if is_owned is set and inner is non-NULL.
45919 void RawDataPart_free(struct LDKRawDataPart this_obj);
45922 * generation time of the invoice
45924 struct LDKPositiveTimestamp RawDataPart_get_timestamp(const struct LDKRawDataPart *NONNULL_PTR this_ptr);
45927 * generation time of the invoice
45929 void RawDataPart_set_timestamp(struct LDKRawDataPart *NONNULL_PTR this_ptr, struct LDKPositiveTimestamp val);
45932 * Checks if two RawDataParts contain equal inner contents.
45933 * This ignores pointers and is_owned flags and looks at the values in fields.
45934 * Two objects with NULL inner values will be considered "equal" here.
45936 bool RawDataPart_eq(const struct LDKRawDataPart *NONNULL_PTR a, const struct LDKRawDataPart *NONNULL_PTR b);
45939 * Creates a copy of the RawDataPart
45941 struct LDKRawDataPart RawDataPart_clone(const struct LDKRawDataPart *NONNULL_PTR orig);
45944 * Generates a non-cryptographic 64-bit hash of the RawDataPart.
45946 uint64_t RawDataPart_hash(const struct LDKRawDataPart *NONNULL_PTR o);
45949 * Frees any resources used by the PositiveTimestamp, if is_owned is set and inner is non-NULL.
45951 void PositiveTimestamp_free(struct LDKPositiveTimestamp this_obj);
45954 * Checks if two PositiveTimestamps contain equal inner contents.
45955 * This ignores pointers and is_owned flags and looks at the values in fields.
45956 * Two objects with NULL inner values will be considered "equal" here.
45958 bool PositiveTimestamp_eq(const struct LDKPositiveTimestamp *NONNULL_PTR a, const struct LDKPositiveTimestamp *NONNULL_PTR b);
45961 * Creates a copy of the PositiveTimestamp
45963 struct LDKPositiveTimestamp PositiveTimestamp_clone(const struct LDKPositiveTimestamp *NONNULL_PTR orig);
45966 * Generates a non-cryptographic 64-bit hash of the PositiveTimestamp.
45968 uint64_t PositiveTimestamp_hash(const struct LDKPositiveTimestamp *NONNULL_PTR o);
45971 * Creates a copy of the SiPrefix
45973 enum LDKSiPrefix SiPrefix_clone(const enum LDKSiPrefix *NONNULL_PTR orig);
45976 * Utility method to constructs a new Milli-variant SiPrefix
45978 enum LDKSiPrefix SiPrefix_milli(void);
45981 * Utility method to constructs a new Micro-variant SiPrefix
45983 enum LDKSiPrefix SiPrefix_micro(void);
45986 * Utility method to constructs a new Nano-variant SiPrefix
45988 enum LDKSiPrefix SiPrefix_nano(void);
45991 * Utility method to constructs a new Pico-variant SiPrefix
45993 enum LDKSiPrefix SiPrefix_pico(void);
45996 * Checks if two SiPrefixs contain equal inner contents.
45997 * This ignores pointers and is_owned flags and looks at the values in fields.
45999 bool SiPrefix_eq(const enum LDKSiPrefix *NONNULL_PTR a, const enum LDKSiPrefix *NONNULL_PTR b);
46002 * Generates a non-cryptographic 64-bit hash of the SiPrefix.
46004 uint64_t SiPrefix_hash(const enum LDKSiPrefix *NONNULL_PTR o);
46007 * Returns the multiplier to go from a BTC value to picoBTC implied by this SiPrefix.
46008 * This is effectively 10^12 * the prefix multiplier
46010 MUST_USE_RES uint64_t SiPrefix_multiplier(const enum LDKSiPrefix *NONNULL_PTR this_arg);
46013 * Creates a copy of the Currency
46015 enum LDKCurrency Currency_clone(const enum LDKCurrency *NONNULL_PTR orig);
46018 * Utility method to constructs a new Bitcoin-variant Currency
46020 enum LDKCurrency Currency_bitcoin(void);
46023 * Utility method to constructs a new BitcoinTestnet-variant Currency
46025 enum LDKCurrency Currency_bitcoin_testnet(void);
46028 * Utility method to constructs a new Regtest-variant Currency
46030 enum LDKCurrency Currency_regtest(void);
46033 * Utility method to constructs a new Simnet-variant Currency
46035 enum LDKCurrency Currency_simnet(void);
46038 * Utility method to constructs a new Signet-variant Currency
46040 enum LDKCurrency Currency_signet(void);
46043 * Generates a non-cryptographic 64-bit hash of the Currency.
46045 uint64_t Currency_hash(const enum LDKCurrency *NONNULL_PTR o);
46048 * Checks if two Currencys contain equal inner contents.
46049 * This ignores pointers and is_owned flags and looks at the values in fields.
46051 bool Currency_eq(const enum LDKCurrency *NONNULL_PTR a, const enum LDKCurrency *NONNULL_PTR b);
46054 * Frees any resources used by the Sha256, if is_owned is set and inner is non-NULL.
46056 void Sha256_free(struct LDKSha256 this_obj);
46059 * Creates a copy of the Sha256
46061 struct LDKSha256 Sha256_clone(const struct LDKSha256 *NONNULL_PTR orig);
46064 * Generates a non-cryptographic 64-bit hash of the Sha256.
46066 uint64_t Sha256_hash(const struct LDKSha256 *NONNULL_PTR o);
46069 * Checks if two Sha256s contain equal inner contents.
46070 * This ignores pointers and is_owned flags and looks at the values in fields.
46071 * Two objects with NULL inner values will be considered "equal" here.
46073 bool Sha256_eq(const struct LDKSha256 *NONNULL_PTR a, const struct LDKSha256 *NONNULL_PTR b);
46076 * Constructs a new [`Sha256`] from the given bytes, which are assumed to be the output of a
46077 * single sha256 hash.
46079 MUST_USE_RES struct LDKSha256 Sha256_from_bytes(const uint8_t (*bytes)[32]);
46082 * Frees any resources used by the Description, if is_owned is set and inner is non-NULL.
46084 void Description_free(struct LDKDescription this_obj);
46087 * Creates a copy of the Description
46089 struct LDKDescription Description_clone(const struct LDKDescription *NONNULL_PTR orig);
46092 * Generates a non-cryptographic 64-bit hash of the Description.
46094 uint64_t Description_hash(const struct LDKDescription *NONNULL_PTR o);
46097 * Checks if two Descriptions contain equal inner contents.
46098 * This ignores pointers and is_owned flags and looks at the values in fields.
46099 * Two objects with NULL inner values will be considered "equal" here.
46101 bool Description_eq(const struct LDKDescription *NONNULL_PTR a, const struct LDKDescription *NONNULL_PTR b);
46104 * Frees any resources used by the PayeePubKey, if is_owned is set and inner is non-NULL.
46106 void PayeePubKey_free(struct LDKPayeePubKey this_obj);
46108 struct LDKPublicKey PayeePubKey_get_a(const struct LDKPayeePubKey *NONNULL_PTR this_ptr);
46110 void PayeePubKey_set_a(struct LDKPayeePubKey *NONNULL_PTR this_ptr, struct LDKPublicKey val);
46113 * Constructs a new PayeePubKey given each field
46115 MUST_USE_RES struct LDKPayeePubKey PayeePubKey_new(struct LDKPublicKey a_arg);
46118 * Creates a copy of the PayeePubKey
46120 struct LDKPayeePubKey PayeePubKey_clone(const struct LDKPayeePubKey *NONNULL_PTR orig);
46123 * Generates a non-cryptographic 64-bit hash of the PayeePubKey.
46125 uint64_t PayeePubKey_hash(const struct LDKPayeePubKey *NONNULL_PTR o);
46128 * Checks if two PayeePubKeys contain equal inner contents.
46129 * This ignores pointers and is_owned flags and looks at the values in fields.
46130 * Two objects with NULL inner values will be considered "equal" here.
46132 bool PayeePubKey_eq(const struct LDKPayeePubKey *NONNULL_PTR a, const struct LDKPayeePubKey *NONNULL_PTR b);
46135 * Frees any resources used by the ExpiryTime, if is_owned is set and inner is non-NULL.
46137 void ExpiryTime_free(struct LDKExpiryTime this_obj);
46140 * Creates a copy of the ExpiryTime
46142 struct LDKExpiryTime ExpiryTime_clone(const struct LDKExpiryTime *NONNULL_PTR orig);
46145 * Generates a non-cryptographic 64-bit hash of the ExpiryTime.
46147 uint64_t ExpiryTime_hash(const struct LDKExpiryTime *NONNULL_PTR o);
46150 * Checks if two ExpiryTimes contain equal inner contents.
46151 * This ignores pointers and is_owned flags and looks at the values in fields.
46152 * Two objects with NULL inner values will be considered "equal" here.
46154 bool ExpiryTime_eq(const struct LDKExpiryTime *NONNULL_PTR a, const struct LDKExpiryTime *NONNULL_PTR b);
46157 * Frees any resources used by the MinFinalCltvExpiryDelta, if is_owned is set and inner is non-NULL.
46159 void MinFinalCltvExpiryDelta_free(struct LDKMinFinalCltvExpiryDelta this_obj);
46161 uint64_t MinFinalCltvExpiryDelta_get_a(const struct LDKMinFinalCltvExpiryDelta *NONNULL_PTR this_ptr);
46163 void MinFinalCltvExpiryDelta_set_a(struct LDKMinFinalCltvExpiryDelta *NONNULL_PTR this_ptr, uint64_t val);
46166 * Constructs a new MinFinalCltvExpiryDelta given each field
46168 MUST_USE_RES struct LDKMinFinalCltvExpiryDelta MinFinalCltvExpiryDelta_new(uint64_t a_arg);
46171 * Creates a copy of the MinFinalCltvExpiryDelta
46173 struct LDKMinFinalCltvExpiryDelta MinFinalCltvExpiryDelta_clone(const struct LDKMinFinalCltvExpiryDelta *NONNULL_PTR orig);
46176 * Generates a non-cryptographic 64-bit hash of the MinFinalCltvExpiryDelta.
46178 uint64_t MinFinalCltvExpiryDelta_hash(const struct LDKMinFinalCltvExpiryDelta *NONNULL_PTR o);
46181 * Checks if two MinFinalCltvExpiryDeltas contain equal inner contents.
46182 * This ignores pointers and is_owned flags and looks at the values in fields.
46183 * Two objects with NULL inner values will be considered "equal" here.
46185 bool MinFinalCltvExpiryDelta_eq(const struct LDKMinFinalCltvExpiryDelta *NONNULL_PTR a, const struct LDKMinFinalCltvExpiryDelta *NONNULL_PTR b);
46188 * Frees any resources used by the Fallback
46190 void Fallback_free(struct LDKFallback this_ptr);
46193 * Creates a copy of the Fallback
46195 struct LDKFallback Fallback_clone(const struct LDKFallback *NONNULL_PTR orig);
46198 * Utility method to constructs a new SegWitProgram-variant Fallback
46200 struct LDKFallback Fallback_seg_wit_program(struct LDKWitnessVersion version, struct LDKCVec_u8Z program);
46203 * Utility method to constructs a new PubKeyHash-variant Fallback
46205 struct LDKFallback Fallback_pub_key_hash(struct LDKTwentyBytes a);
46208 * Utility method to constructs a new ScriptHash-variant Fallback
46210 struct LDKFallback Fallback_script_hash(struct LDKTwentyBytes a);
46213 * Generates a non-cryptographic 64-bit hash of the Fallback.
46215 uint64_t Fallback_hash(const struct LDKFallback *NONNULL_PTR o);
46218 * Checks if two Fallbacks contain equal inner contents.
46219 * This ignores pointers and is_owned flags and looks at the values in fields.
46221 bool Fallback_eq(const struct LDKFallback *NONNULL_PTR a, const struct LDKFallback *NONNULL_PTR b);
46224 * Frees any resources used by the Bolt11InvoiceSignature, if is_owned is set and inner is non-NULL.
46226 void Bolt11InvoiceSignature_free(struct LDKBolt11InvoiceSignature this_obj);
46229 * Creates a copy of the Bolt11InvoiceSignature
46231 struct LDKBolt11InvoiceSignature Bolt11InvoiceSignature_clone(const struct LDKBolt11InvoiceSignature *NONNULL_PTR orig);
46234 * Generates a non-cryptographic 64-bit hash of the Bolt11InvoiceSignature.
46236 uint64_t Bolt11InvoiceSignature_hash(const struct LDKBolt11InvoiceSignature *NONNULL_PTR o);
46239 * Checks if two Bolt11InvoiceSignatures contain equal inner contents.
46240 * This ignores pointers and is_owned flags and looks at the values in fields.
46241 * Two objects with NULL inner values will be considered "equal" here.
46243 bool Bolt11InvoiceSignature_eq(const struct LDKBolt11InvoiceSignature *NONNULL_PTR a, const struct LDKBolt11InvoiceSignature *NONNULL_PTR b);
46246 * Frees any resources used by the PrivateRoute, if is_owned is set and inner is non-NULL.
46248 void PrivateRoute_free(struct LDKPrivateRoute this_obj);
46251 * Creates a copy of the PrivateRoute
46253 struct LDKPrivateRoute PrivateRoute_clone(const struct LDKPrivateRoute *NONNULL_PTR orig);
46256 * Generates a non-cryptographic 64-bit hash of the PrivateRoute.
46258 uint64_t PrivateRoute_hash(const struct LDKPrivateRoute *NONNULL_PTR o);
46261 * Checks if two PrivateRoutes contain equal inner contents.
46262 * This ignores pointers and is_owned flags and looks at the values in fields.
46263 * Two objects with NULL inner values will be considered "equal" here.
46265 bool PrivateRoute_eq(const struct LDKPrivateRoute *NONNULL_PTR a, const struct LDKPrivateRoute *NONNULL_PTR b);
46268 * Disassembles the `SignedRawBolt11Invoice` into its three parts:
46270 * 2. hash of the raw invoice
46273 MUST_USE_RES struct LDKC3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ SignedRawBolt11Invoice_into_parts(struct LDKSignedRawBolt11Invoice this_arg);
46276 * The [`RawBolt11Invoice`] which was signed.
46278 MUST_USE_RES struct LDKRawBolt11Invoice SignedRawBolt11Invoice_raw_invoice(const struct LDKSignedRawBolt11Invoice *NONNULL_PTR this_arg);
46281 * The hash of the [`RawBolt11Invoice`] that was signed.
46283 MUST_USE_RES const uint8_t (*SignedRawBolt11Invoice_signable_hash(const struct LDKSignedRawBolt11Invoice *NONNULL_PTR this_arg))[32];
46286 * Signature for the invoice.
46288 MUST_USE_RES struct LDKBolt11InvoiceSignature SignedRawBolt11Invoice_signature(const struct LDKSignedRawBolt11Invoice *NONNULL_PTR this_arg);
46291 * Recovers the public key used for signing the invoice from the recoverable signature.
46293 MUST_USE_RES struct LDKCResult_PayeePubKeySecp256k1ErrorZ SignedRawBolt11Invoice_recover_payee_pub_key(const struct LDKSignedRawBolt11Invoice *NONNULL_PTR this_arg);
46296 * Checks if the signature is valid for the included payee public key or if none exists if it's
46297 * valid for the recovered signature (which should always be true?).
46299 MUST_USE_RES bool SignedRawBolt11Invoice_check_signature(const struct LDKSignedRawBolt11Invoice *NONNULL_PTR this_arg);
46302 * Calculate the hash of the encoded `RawBolt11Invoice` which should be signed.
46304 MUST_USE_RES struct LDKThirtyTwoBytes RawBolt11Invoice_signable_hash(const struct LDKRawBolt11Invoice *NONNULL_PTR this_arg);
46308 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
46310 MUST_USE_RES struct LDKSha256 RawBolt11Invoice_payment_hash(const struct LDKRawBolt11Invoice *NONNULL_PTR this_arg);
46314 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
46316 MUST_USE_RES struct LDKDescription RawBolt11Invoice_description(const struct LDKRawBolt11Invoice *NONNULL_PTR this_arg);
46320 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
46322 MUST_USE_RES struct LDKPayeePubKey RawBolt11Invoice_payee_pub_key(const struct LDKRawBolt11Invoice *NONNULL_PTR this_arg);
46326 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
46328 MUST_USE_RES struct LDKSha256 RawBolt11Invoice_description_hash(const struct LDKRawBolt11Invoice *NONNULL_PTR this_arg);
46332 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
46334 MUST_USE_RES struct LDKExpiryTime RawBolt11Invoice_expiry_time(const struct LDKRawBolt11Invoice *NONNULL_PTR this_arg);
46338 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
46340 MUST_USE_RES struct LDKMinFinalCltvExpiryDelta RawBolt11Invoice_min_final_cltv_expiry_delta(const struct LDKRawBolt11Invoice *NONNULL_PTR this_arg);
46342 MUST_USE_RES struct LDKCOption_ThirtyTwoBytesZ RawBolt11Invoice_payment_secret(const struct LDKRawBolt11Invoice *NONNULL_PTR this_arg);
46344 MUST_USE_RES struct LDKCOption_CVec_u8ZZ RawBolt11Invoice_payment_metadata(const struct LDKRawBolt11Invoice *NONNULL_PTR this_arg);
46348 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
46350 MUST_USE_RES struct LDKBolt11InvoiceFeatures RawBolt11Invoice_features(const struct LDKRawBolt11Invoice *NONNULL_PTR this_arg);
46352 MUST_USE_RES struct LDKCVec_PrivateRouteZ RawBolt11Invoice_private_routes(const struct LDKRawBolt11Invoice *NONNULL_PTR this_arg);
46354 MUST_USE_RES struct LDKCOption_u64Z RawBolt11Invoice_amount_pico_btc(const struct LDKRawBolt11Invoice *NONNULL_PTR this_arg);
46356 MUST_USE_RES enum LDKCurrency RawBolt11Invoice_currency(const struct LDKRawBolt11Invoice *NONNULL_PTR this_arg);
46359 * Creates a `PositiveTimestamp` from a Unix timestamp in the range `0..=MAX_TIMESTAMP`.
46361 * Otherwise, returns a [`CreationError::TimestampOutOfBounds`].
46363 MUST_USE_RES struct LDKCResult_PositiveTimestampCreationErrorZ PositiveTimestamp_from_unix_timestamp(uint64_t unix_seconds);
46366 * Creates a `PositiveTimestamp` from a [`SystemTime`] with a corresponding Unix timestamp in
46367 * the range `0..=MAX_TIMESTAMP`.
46369 * Note that the subsecond part is dropped as it is not representable in BOLT 11 invoices.
46371 * Otherwise, returns a [`CreationError::TimestampOutOfBounds`].
46373 MUST_USE_RES struct LDKCResult_PositiveTimestampCreationErrorZ PositiveTimestamp_from_system_time(uint64_t time);
46376 * Creates a `PositiveTimestamp` from a [`Duration`] since the Unix epoch in the range
46377 * `0..=MAX_TIMESTAMP`.
46379 * Note that the subsecond part is dropped as it is not representable in BOLT 11 invoices.
46381 * Otherwise, returns a [`CreationError::TimestampOutOfBounds`].
46383 MUST_USE_RES struct LDKCResult_PositiveTimestampCreationErrorZ PositiveTimestamp_from_duration_since_epoch(uint64_t duration);
46386 * Returns the Unix timestamp representing the stored time
46388 MUST_USE_RES uint64_t PositiveTimestamp_as_unix_timestamp(const struct LDKPositiveTimestamp *NONNULL_PTR this_arg);
46391 * Returns the duration of the stored time since the Unix epoch
46393 MUST_USE_RES uint64_t PositiveTimestamp_as_duration_since_epoch(const struct LDKPositiveTimestamp *NONNULL_PTR this_arg);
46396 * Returns the [`SystemTime`] representing the stored time
46398 MUST_USE_RES uint64_t PositiveTimestamp_as_time(const struct LDKPositiveTimestamp *NONNULL_PTR this_arg);
46401 * The hash of the [`RawBolt11Invoice`] that was signed.
46403 MUST_USE_RES struct LDKThirtyTwoBytes Bolt11Invoice_signable_hash(const struct LDKBolt11Invoice *NONNULL_PTR this_arg);
46406 * Transform the `Bolt11Invoice` into its unchecked version.
46408 MUST_USE_RES struct LDKSignedRawBolt11Invoice Bolt11Invoice_into_signed_raw(struct LDKBolt11Invoice this_arg);
46411 * Check that the invoice is signed correctly and that key recovery works
46413 MUST_USE_RES struct LDKCResult_NoneBolt11SemanticErrorZ Bolt11Invoice_check_signature(const struct LDKBolt11Invoice *NONNULL_PTR this_arg);
46416 * Constructs a `Bolt11Invoice` from a [`SignedRawBolt11Invoice`] by checking all its invariants.
46418 * use lightning_invoice::*;
46420 * let invoice = \"lnbc100p1psj9jhxdqud3jxktt5w46x7unfv9kz6mn0v3jsnp4q0d3p2sfluzdx45tqcs\\
46421 * h2pu5qc7lgq0xs578ngs6s0s68ua4h7cvspp5q6rmq35js88zp5dvwrv9m459tnk2zunwj5jalqtyxqulh0l\\
46422 * 5gflssp5nf55ny5gcrfl30xuhzj3nphgj27rstekmr9fw3ny5989s300gyus9qyysgqcqpcrzjqw2sxwe993\\
46423 * h5pcm4dxzpvttgza8zhkqxpgffcrf5v25nwpr3cmfg7z54kuqq8rgqqqqqqqq2qqqqq9qq9qrzjqd0ylaqcl\\
46424 * j9424x9m8h2vcukcgnm6s56xfgu3j78zyqzhgs4hlpzvznlugqq9vsqqqqqqqlgqqqqqeqq9qrzjqwldmj9d\\
46425 * ha74df76zhx6l9we0vjdquygcdt3kssupehe64g6yyp5yz5rhuqqwccqqyqqqqlgqqqqjcqq9qrzjqf9e58a\\
46426 * guqr0rcun0ajlvmzq3ek63cw2w282gv3z5uupmuwvgjtq2z55qsqqg6qqqyqqqrtnqqqzq3cqygrzjqvphms\\
46427 * ywntrrhqjcraumvc4y6r8v4z5v593trte429v4hredj7ms5z52usqq9ngqqqqqqqlgqqqqqqgq9qrzjq2v0v\\
46428 * p62g49p7569ev48cmulecsxe59lvaw3wlxm7r982zxa9zzj7z5l0cqqxusqqyqqqqlgqqqqqzsqygarl9fh3\\
46429 * 8s0gyuxjjgux34w75dnc6xp2l35j7es3jd4ugt3lu0xzre26yg5m7ke54n2d5sym4xcmxtl8238xxvw5h5h5\\
46430 * j5r6drg6k6zcqj0fcwg\";
46432 * let signed = invoice.parse::<SignedRawBolt11Invoice>().unwrap();
46434 * assert!(Bolt11Invoice::from_signed(signed).is_ok());
46437 MUST_USE_RES struct LDKCResult_Bolt11InvoiceBolt11SemanticErrorZ Bolt11Invoice_from_signed(struct LDKSignedRawBolt11Invoice signed_invoice);
46440 * Returns the `Bolt11Invoice`'s timestamp (should equal its creation time)
46442 MUST_USE_RES uint64_t Bolt11Invoice_timestamp(const struct LDKBolt11Invoice *NONNULL_PTR this_arg);
46445 * Returns the `Bolt11Invoice`'s timestamp as a duration since the Unix epoch
46447 MUST_USE_RES uint64_t Bolt11Invoice_duration_since_epoch(const struct LDKBolt11Invoice *NONNULL_PTR this_arg);
46450 * Returns the hash to which we will receive the preimage on completion of the payment
46452 MUST_USE_RES const uint8_t (*Bolt11Invoice_payment_hash(const struct LDKBolt11Invoice *NONNULL_PTR this_arg))[32];
46455 * Get the payee's public key if one was included in the invoice
46457 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
46459 MUST_USE_RES struct LDKPublicKey Bolt11Invoice_payee_pub_key(const struct LDKBolt11Invoice *NONNULL_PTR this_arg);
46462 * Get the payment secret if one was included in the invoice
46464 MUST_USE_RES const uint8_t (*Bolt11Invoice_payment_secret(const struct LDKBolt11Invoice *NONNULL_PTR this_arg))[32];
46467 * Get the payment metadata blob if one was included in the invoice
46469 MUST_USE_RES struct LDKCOption_CVec_u8ZZ Bolt11Invoice_payment_metadata(const struct LDKBolt11Invoice *NONNULL_PTR this_arg);
46472 * Get the invoice features if they were included in the invoice
46474 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
46476 MUST_USE_RES struct LDKBolt11InvoiceFeatures Bolt11Invoice_features(const struct LDKBolt11Invoice *NONNULL_PTR this_arg);
46479 * Recover the payee's public key (only to be used if none was included in the invoice)
46481 MUST_USE_RES struct LDKPublicKey Bolt11Invoice_recover_payee_pub_key(const struct LDKBolt11Invoice *NONNULL_PTR this_arg);
46484 * Returns the Duration since the Unix epoch at which the invoice expires.
46485 * Returning None if overflow occurred.
46487 MUST_USE_RES struct LDKCOption_u64Z Bolt11Invoice_expires_at(const struct LDKBolt11Invoice *NONNULL_PTR this_arg);
46490 * Returns the invoice's expiry time, if present, otherwise [`DEFAULT_EXPIRY_TIME`].
46492 MUST_USE_RES uint64_t Bolt11Invoice_expiry_time(const struct LDKBolt11Invoice *NONNULL_PTR this_arg);
46495 * Returns whether the invoice has expired.
46497 MUST_USE_RES bool Bolt11Invoice_is_expired(const struct LDKBolt11Invoice *NONNULL_PTR this_arg);
46500 * Returns the Duration remaining until the invoice expires.
46502 MUST_USE_RES uint64_t Bolt11Invoice_duration_until_expiry(const struct LDKBolt11Invoice *NONNULL_PTR this_arg);
46505 * Returns the Duration remaining until the invoice expires given the current time.
46506 * `time` is the timestamp as a duration since the Unix epoch.
46508 MUST_USE_RES uint64_t Bolt11Invoice_expiration_remaining_from_epoch(const struct LDKBolt11Invoice *NONNULL_PTR this_arg, uint64_t time);
46511 * Returns whether the expiry time would pass at the given point in time.
46512 * `at_time` is the timestamp as a duration since the Unix epoch.
46514 MUST_USE_RES bool Bolt11Invoice_would_expire(const struct LDKBolt11Invoice *NONNULL_PTR this_arg, uint64_t at_time);
46517 * Returns the invoice's `min_final_cltv_expiry_delta` time, if present, otherwise
46518 * [`DEFAULT_MIN_FINAL_CLTV_EXPIRY_DELTA`].
46520 MUST_USE_RES uint64_t Bolt11Invoice_min_final_cltv_expiry_delta(const struct LDKBolt11Invoice *NONNULL_PTR this_arg);
46523 * Returns a list of all fallback addresses as [`Address`]es
46525 MUST_USE_RES struct LDKCVec_StrZ Bolt11Invoice_fallback_addresses(const struct LDKBolt11Invoice *NONNULL_PTR this_arg);
46528 * Returns a list of all routes included in the invoice
46530 MUST_USE_RES struct LDKCVec_PrivateRouteZ Bolt11Invoice_private_routes(const struct LDKBolt11Invoice *NONNULL_PTR this_arg);
46533 * Returns a list of all routes included in the invoice as the underlying hints
46535 MUST_USE_RES struct LDKCVec_RouteHintZ Bolt11Invoice_route_hints(const struct LDKBolt11Invoice *NONNULL_PTR this_arg);
46538 * Returns the currency for which the invoice was issued
46540 MUST_USE_RES enum LDKCurrency Bolt11Invoice_currency(const struct LDKBolt11Invoice *NONNULL_PTR this_arg);
46543 * Returns the amount if specified in the invoice as millisatoshis.
46545 MUST_USE_RES struct LDKCOption_u64Z Bolt11Invoice_amount_milli_satoshis(const struct LDKBolt11Invoice *NONNULL_PTR this_arg);
46548 * Creates a new `Description` if `description` is at most 1023 __bytes__ long,
46549 * returns [`CreationError::DescriptionTooLong`] otherwise
46551 * Please note that single characters may use more than one byte due to UTF8 encoding.
46553 MUST_USE_RES struct LDKCResult_DescriptionCreationErrorZ Description_new(struct LDKStr description);
46556 * Returns the underlying description [`String`]
46558 MUST_USE_RES struct LDKStr Description_into_inner(struct LDKDescription this_arg);
46561 * Construct an `ExpiryTime` from seconds.
46563 MUST_USE_RES struct LDKExpiryTime ExpiryTime_from_seconds(uint64_t seconds);
46566 * Construct an `ExpiryTime` from a [`Duration`], dropping the sub-second part.
46568 MUST_USE_RES struct LDKExpiryTime ExpiryTime_from_duration(uint64_t duration);
46571 * Returns the expiry time in seconds
46573 MUST_USE_RES uint64_t ExpiryTime_as_seconds(const struct LDKExpiryTime *NONNULL_PTR this_arg);
46576 * Returns a reference to the underlying [`Duration`] (=expiry time)
46578 MUST_USE_RES uint64_t ExpiryTime_as_duration(const struct LDKExpiryTime *NONNULL_PTR this_arg);
46581 * Creates a new (partial) route from a list of hops
46583 MUST_USE_RES struct LDKCResult_PrivateRouteCreationErrorZ PrivateRoute_new(struct LDKRouteHint hops);
46586 * Returns the underlying list of hops
46588 MUST_USE_RES struct LDKRouteHint PrivateRoute_into_inner(struct LDKPrivateRoute this_arg);
46591 * Creates a copy of the CreationError
46593 enum LDKCreationError CreationError_clone(const enum LDKCreationError *NONNULL_PTR orig);
46596 * Utility method to constructs a new DescriptionTooLong-variant CreationError
46598 enum LDKCreationError CreationError_description_too_long(void);
46601 * Utility method to constructs a new RouteTooLong-variant CreationError
46603 enum LDKCreationError CreationError_route_too_long(void);
46606 * Utility method to constructs a new TimestampOutOfBounds-variant CreationError
46608 enum LDKCreationError CreationError_timestamp_out_of_bounds(void);
46611 * Utility method to constructs a new InvalidAmount-variant CreationError
46613 enum LDKCreationError CreationError_invalid_amount(void);
46616 * Utility method to constructs a new MissingRouteHints-variant CreationError
46618 enum LDKCreationError CreationError_missing_route_hints(void);
46621 * Utility method to constructs a new MinFinalCltvExpiryDeltaTooShort-variant CreationError
46623 enum LDKCreationError CreationError_min_final_cltv_expiry_delta_too_short(void);
46626 * Checks if two CreationErrors contain equal inner contents.
46627 * This ignores pointers and is_owned flags and looks at the values in fields.
46629 bool CreationError_eq(const enum LDKCreationError *NONNULL_PTR a, const enum LDKCreationError *NONNULL_PTR b);
46632 * Get the string representation of a CreationError object
46634 struct LDKStr CreationError_to_str(const enum LDKCreationError *NONNULL_PTR o);
46637 * Creates a copy of the Bolt11SemanticError
46639 enum LDKBolt11SemanticError Bolt11SemanticError_clone(const enum LDKBolt11SemanticError *NONNULL_PTR orig);
46642 * Utility method to constructs a new NoPaymentHash-variant Bolt11SemanticError
46644 enum LDKBolt11SemanticError Bolt11SemanticError_no_payment_hash(void);
46647 * Utility method to constructs a new MultiplePaymentHashes-variant Bolt11SemanticError
46649 enum LDKBolt11SemanticError Bolt11SemanticError_multiple_payment_hashes(void);
46652 * Utility method to constructs a new NoDescription-variant Bolt11SemanticError
46654 enum LDKBolt11SemanticError Bolt11SemanticError_no_description(void);
46657 * Utility method to constructs a new MultipleDescriptions-variant Bolt11SemanticError
46659 enum LDKBolt11SemanticError Bolt11SemanticError_multiple_descriptions(void);
46662 * Utility method to constructs a new NoPaymentSecret-variant Bolt11SemanticError
46664 enum LDKBolt11SemanticError Bolt11SemanticError_no_payment_secret(void);
46667 * Utility method to constructs a new MultiplePaymentSecrets-variant Bolt11SemanticError
46669 enum LDKBolt11SemanticError Bolt11SemanticError_multiple_payment_secrets(void);
46672 * Utility method to constructs a new InvalidFeatures-variant Bolt11SemanticError
46674 enum LDKBolt11SemanticError Bolt11SemanticError_invalid_features(void);
46677 * Utility method to constructs a new InvalidRecoveryId-variant Bolt11SemanticError
46679 enum LDKBolt11SemanticError Bolt11SemanticError_invalid_recovery_id(void);
46682 * Utility method to constructs a new InvalidSignature-variant Bolt11SemanticError
46684 enum LDKBolt11SemanticError Bolt11SemanticError_invalid_signature(void);
46687 * Utility method to constructs a new ImpreciseAmount-variant Bolt11SemanticError
46689 enum LDKBolt11SemanticError Bolt11SemanticError_imprecise_amount(void);
46692 * Checks if two Bolt11SemanticErrors contain equal inner contents.
46693 * This ignores pointers and is_owned flags and looks at the values in fields.
46695 bool Bolt11SemanticError_eq(const enum LDKBolt11SemanticError *NONNULL_PTR a, const enum LDKBolt11SemanticError *NONNULL_PTR b);
46698 * Get the string representation of a Bolt11SemanticError object
46700 struct LDKStr Bolt11SemanticError_to_str(const enum LDKBolt11SemanticError *NONNULL_PTR o);
46703 * Frees any resources used by the SignOrCreationError
46705 void SignOrCreationError_free(struct LDKSignOrCreationError this_ptr);
46708 * Creates a copy of the SignOrCreationError
46710 struct LDKSignOrCreationError SignOrCreationError_clone(const struct LDKSignOrCreationError *NONNULL_PTR orig);
46713 * Utility method to constructs a new SignError-variant SignOrCreationError
46715 struct LDKSignOrCreationError SignOrCreationError_sign_error(void);
46718 * Utility method to constructs a new CreationError-variant SignOrCreationError
46720 struct LDKSignOrCreationError SignOrCreationError_creation_error(enum LDKCreationError a);
46723 * Checks if two SignOrCreationErrors contain equal inner contents.
46724 * This ignores pointers and is_owned flags and looks at the values in fields.
46726 bool SignOrCreationError_eq(const struct LDKSignOrCreationError *NONNULL_PTR a, const struct LDKSignOrCreationError *NONNULL_PTR b);
46729 * Get the string representation of a SignOrCreationError object
46731 struct LDKStr SignOrCreationError_to_str(const struct LDKSignOrCreationError *NONNULL_PTR o);
46734 * Pays the given [`Bolt11Invoice`], retrying if needed based on [`Retry`].
46736 * [`Bolt11Invoice::payment_hash`] is used as the [`PaymentId`], which ensures idempotency as long
46737 * as the payment is still pending. If the payment succeeds, you must ensure that a second payment
46738 * with the same [`PaymentHash`] is never sent.
46740 * If you wish to use a different payment idempotency token, see [`pay_invoice_with_id`].
46742 struct LDKCResult_ThirtyTwoBytesPaymentErrorZ pay_invoice(const struct LDKBolt11Invoice *NONNULL_PTR invoice, struct LDKRetry retry_strategy, const struct LDKChannelManager *NONNULL_PTR channelmanager);
46745 * Pays the given [`Bolt11Invoice`] with a custom idempotency key, retrying if needed based on
46748 * Note that idempotency is only guaranteed as long as the payment is still pending. Once the
46749 * payment completes or fails, no idempotency guarantees are made.
46751 * You should ensure that the [`Bolt11Invoice::payment_hash`] is unique and the same
46752 * [`PaymentHash`] has never been paid before.
46754 * See [`pay_invoice`] for a variant which uses the [`PaymentHash`] for the idempotency token.
46756 struct LDKCResult_NonePaymentErrorZ pay_invoice_with_id(const struct LDKBolt11Invoice *NONNULL_PTR invoice, struct LDKThirtyTwoBytes payment_id, struct LDKRetry retry_strategy, const struct LDKChannelManager *NONNULL_PTR channelmanager);
46759 * Pays the given zero-value [`Bolt11Invoice`] using the given amount, retrying if needed based on
46762 * [`Bolt11Invoice::payment_hash`] is used as the [`PaymentId`], which ensures idempotency as long
46763 * as the payment is still pending. If the payment succeeds, you must ensure that a second payment
46764 * with the same [`PaymentHash`] is never sent.
46766 * If you wish to use a different payment idempotency token, see
46767 * [`pay_zero_value_invoice_with_id`].
46769 struct LDKCResult_ThirtyTwoBytesPaymentErrorZ pay_zero_value_invoice(const struct LDKBolt11Invoice *NONNULL_PTR invoice, uint64_t amount_msats, struct LDKRetry retry_strategy, const struct LDKChannelManager *NONNULL_PTR channelmanager);
46772 * Pays the given zero-value [`Bolt11Invoice`] using the given amount and custom idempotency key,
46773 * retrying if needed based on [`Retry`].
46775 * Note that idempotency is only guaranteed as long as the payment is still pending. Once the
46776 * payment completes or fails, no idempotency guarantees are made.
46778 * You should ensure that the [`Bolt11Invoice::payment_hash`] is unique and the same
46779 * [`PaymentHash`] has never been paid before.
46781 * See [`pay_zero_value_invoice`] for a variant which uses the [`PaymentHash`] for the
46782 * idempotency token.
46784 struct LDKCResult_NonePaymentErrorZ pay_zero_value_invoice_with_id(const struct LDKBolt11Invoice *NONNULL_PTR invoice, uint64_t amount_msats, struct LDKThirtyTwoBytes payment_id, struct LDKRetry retry_strategy, const struct LDKChannelManager *NONNULL_PTR channelmanager);
46787 * Sends payment probes over all paths of a route that would be used to pay the given invoice.
46789 * See [`ChannelManager::send_preflight_probes`] for more information.
46791 struct LDKCResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbingErrorZ preflight_probe_invoice(const struct LDKBolt11Invoice *NONNULL_PTR invoice, const struct LDKChannelManager *NONNULL_PTR channelmanager, struct LDKCOption_u64Z liquidity_limit_multiplier);
46794 * Sends payment probes over all paths of a route that would be used to pay the given zero-value
46795 * invoice using the given amount.
46797 * See [`ChannelManager::send_preflight_probes`] for more information.
46799 struct LDKCResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbingErrorZ preflight_probe_zero_value_invoice(const struct LDKBolt11Invoice *NONNULL_PTR invoice, uint64_t amount_msat, const struct LDKChannelManager *NONNULL_PTR channelmanager, struct LDKCOption_u64Z liquidity_limit_multiplier);
46802 * Frees any resources used by the PaymentError
46804 void PaymentError_free(struct LDKPaymentError this_ptr);
46807 * Creates a copy of the PaymentError
46809 struct LDKPaymentError PaymentError_clone(const struct LDKPaymentError *NONNULL_PTR orig);
46812 * Utility method to constructs a new Invoice-variant PaymentError
46814 struct LDKPaymentError PaymentError_invoice(struct LDKStr a);
46817 * Utility method to constructs a new Sending-variant PaymentError
46819 struct LDKPaymentError PaymentError_sending(enum LDKRetryableSendFailure a);
46822 * Checks if two PaymentErrors contain equal inner contents.
46823 * This ignores pointers and is_owned flags and looks at the values in fields.
46825 bool PaymentError_eq(const struct LDKPaymentError *NONNULL_PTR a, const struct LDKPaymentError *NONNULL_PTR b);
46828 * Frees any resources used by the ProbingError
46830 void ProbingError_free(struct LDKProbingError this_ptr);
46833 * Creates a copy of the ProbingError
46835 struct LDKProbingError ProbingError_clone(const struct LDKProbingError *NONNULL_PTR orig);
46838 * Utility method to constructs a new Invoice-variant ProbingError
46840 struct LDKProbingError ProbingError_invoice(struct LDKStr a);
46843 * Utility method to constructs a new Sending-variant ProbingError
46845 struct LDKProbingError ProbingError_sending(struct LDKProbeSendFailure a);
46848 * Checks if two ProbingErrors contain equal inner contents.
46849 * This ignores pointers and is_owned flags and looks at the values in fields.
46851 bool ProbingError_eq(const struct LDKProbingError *NONNULL_PTR a, const struct LDKProbingError *NONNULL_PTR b);
46854 * Utility to create an invoice that can be paid to one of multiple nodes, or a \"phantom invoice.\"
46855 * See [`PhantomKeysManager`] for more information on phantom node payments.
46857 * `phantom_route_hints` parameter:
46858 * * Contains channel info for all nodes participating in the phantom invoice
46859 * * Entries are retrieved from a call to [`ChannelManager::get_phantom_route_hints`] on each
46860 * participating node
46861 * * It is fine to cache `phantom_route_hints` and reuse it across invoices, as long as the data is
46862 * updated when a channel becomes disabled or closes
46863 * * Note that if too many channels are included in [`PhantomRouteHints::channels`], the invoice
46864 * may be too long for QR code scanning. To fix this, `PhantomRouteHints::channels` may be pared
46867 * `payment_hash` can be specified if you have a specific need for a custom payment hash (see the difference
46868 * between [`ChannelManager::create_inbound_payment`] and [`ChannelManager::create_inbound_payment_for_hash`]).
46869 * If `None` is provided for `payment_hash`, then one will be created.
46871 * `invoice_expiry_delta_secs` describes the number of seconds that the invoice is valid for
46872 * in excess of the current time.
46874 * `duration_since_epoch` is the current time since epoch in seconds.
46876 * You can specify a custom `min_final_cltv_expiry_delta`, or let LDK default it to
46877 * [`MIN_FINAL_CLTV_EXPIRY_DELTA`]. The provided expiry must be at least [`MIN_FINAL_CLTV_EXPIRY_DELTA`] - 3.
46878 * Note that LDK will add a buffer of 3 blocks to the delta to allow for up to a few new block
46879 * confirmations during routing.
46881 * Note that the provided `keys_manager`'s `NodeSigner` implementation must support phantom
46882 * invoices in its `sign_invoice` implementation ([`PhantomKeysManager`] satisfies this
46885 * [`PhantomKeysManager`]: lightning::sign::PhantomKeysManager
46886 * [`ChannelManager::get_phantom_route_hints`]: lightning::ln::channelmanager::ChannelManager::get_phantom_route_hints
46887 * [`ChannelManager::create_inbound_payment`]: lightning::ln::channelmanager::ChannelManager::create_inbound_payment
46888 * [`ChannelManager::create_inbound_payment_for_hash`]: lightning::ln::channelmanager::ChannelManager::create_inbound_payment_for_hash
46889 * [`PhantomRouteHints::channels`]: lightning::ln::channelmanager::PhantomRouteHints::channels
46890 * [`MIN_FINAL_CLTV_EXPIRY_DETLA`]: lightning::ln::channelmanager::MIN_FINAL_CLTV_EXPIRY_DELTA
46892 * This can be used in a `no_std` environment, where [`std::time::SystemTime`] is not
46893 * available and the current time is supplied by the caller.
46895 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);
46898 * Utility to create an invoice that can be paid to one of multiple nodes, or a \"phantom invoice.\"
46899 * See [`PhantomKeysManager`] for more information on phantom node payments.
46901 * `phantom_route_hints` parameter:
46902 * * Contains channel info for all nodes participating in the phantom invoice
46903 * * Entries are retrieved from a call to [`ChannelManager::get_phantom_route_hints`] on each
46904 * participating node
46905 * * It is fine to cache `phantom_route_hints` and reuse it across invoices, as long as the data is
46906 * updated when a channel becomes disabled or closes
46907 * * Note that the route hints generated from `phantom_route_hints` will be limited to a maximum
46908 * of 3 hints to ensure that the invoice can be scanned in a QR code. These hints are selected
46909 * in the order that the nodes in `PhantomRouteHints` are specified, selecting one hint per node
46910 * until the maximum is hit. Callers may provide as many `PhantomRouteHints::channels` as
46911 * desired, but note that some nodes will be trimmed if more than 3 nodes are provided.
46913 * `description_hash` is a SHA-256 hash of the description text
46915 * `payment_hash` can be specified if you have a specific need for a custom payment hash (see the difference
46916 * between [`ChannelManager::create_inbound_payment`] and [`ChannelManager::create_inbound_payment_for_hash`]).
46917 * If `None` is provided for `payment_hash`, then one will be created.
46919 * `invoice_expiry_delta_secs` describes the number of seconds that the invoice is valid for
46920 * in excess of the current time.
46922 * `duration_since_epoch` is the current time since epoch in seconds.
46924 * Note that the provided `keys_manager`'s `NodeSigner` implementation must support phantom
46925 * invoices in its `sign_invoice` implementation ([`PhantomKeysManager`] satisfies this
46928 * [`PhantomKeysManager`]: lightning::sign::PhantomKeysManager
46929 * [`ChannelManager::get_phantom_route_hints`]: lightning::ln::channelmanager::ChannelManager::get_phantom_route_hints
46930 * [`ChannelManager::create_inbound_payment`]: lightning::ln::channelmanager::ChannelManager::create_inbound_payment
46931 * [`ChannelManager::create_inbound_payment_for_hash`]: lightning::ln::channelmanager::ChannelManager::create_inbound_payment_for_hash
46932 * [`PhantomRouteHints::channels`]: lightning::ln::channelmanager::PhantomRouteHints::channels
46934 * This can be used in a `no_std` environment, where [`std::time::SystemTime`] is not
46935 * available and the current time is supplied by the caller.
46937 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);
46940 * Utility to construct an invoice. Generally, unless you want to do something like a custom
46941 * cltv_expiry, this is what you should be using to create an invoice. The reason being, this
46942 * method stores the invoice's payment secret and preimage in `ChannelManager`, so (a) the user
46943 * doesn't have to store preimage/payment secret information and (b) `ChannelManager` can verify
46944 * that the payment secret is valid when the invoice is paid.
46946 * `invoice_expiry_delta_secs` describes the number of seconds that the invoice is valid for
46947 * in excess of the current time.
46949 * You can specify a custom `min_final_cltv_expiry_delta`, or let LDK default it to
46950 * [`MIN_FINAL_CLTV_EXPIRY_DELTA`]. The provided expiry must be at least [`MIN_FINAL_CLTV_EXPIRY_DELTA`].
46951 * Note that LDK will add a buffer of 3 blocks to the delta to allow for up to a few new block
46952 * confirmations during routing.
46954 * [`MIN_FINAL_CLTV_EXPIRY_DETLA`]: lightning::ln::channelmanager::MIN_FINAL_CLTV_EXPIRY_DELTA
46956 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);
46959 * Utility to construct an invoice. Generally, unless you want to do something like a custom
46960 * cltv_expiry, this is what you should be using to create an invoice. The reason being, this
46961 * method stores the invoice's payment secret and preimage in `ChannelManager`, so (a) the user
46962 * doesn't have to store preimage/payment secret information and (b) `ChannelManager` can verify
46963 * that the payment secret is valid when the invoice is paid.
46964 * Use this variant if you want to pass the `description_hash` to the invoice.
46966 * `invoice_expiry_delta_secs` describes the number of seconds that the invoice is valid for
46967 * in excess of the current time.
46969 * You can specify a custom `min_final_cltv_expiry_delta`, or let LDK default it to
46970 * [`MIN_FINAL_CLTV_EXPIRY_DELTA`]. The provided expiry must be at least [`MIN_FINAL_CLTV_EXPIRY_DELTA`].
46971 * Note that LDK will add a buffer of 3 blocks to the delta to allow for up to a few new block
46972 * confirmations during routing.
46974 * [`MIN_FINAL_CLTV_EXPIRY_DETLA`]: lightning::ln::channelmanager::MIN_FINAL_CLTV_EXPIRY_DELTA
46976 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);
46979 * See [`create_invoice_from_channelmanager_with_description_hash`]
46980 * This version can be used in a `no_std` environment, where [`std::time::SystemTime`] is not
46981 * available and the current time is supplied by the caller.
46983 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);
46986 * See [`create_invoice_from_channelmanager`]
46987 * This version can be used in a `no_std` environment, where [`std::time::SystemTime`] is not
46988 * available and the current time is supplied by the caller.
46990 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);
46993 * See [`create_invoice_from_channelmanager_and_duration_since_epoch`]
46994 * This version allows for providing a custom [`PaymentHash`] for the invoice.
46995 * This may be useful if you're building an on-chain swap or involving another protocol where
46996 * the payment hash is also involved outside the scope of lightning.
46998 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);
47001 * Read a SiPrefix object from a string
47003 struct LDKCResult_SiPrefixBolt11ParseErrorZ SiPrefix_from_str(struct LDKStr s);
47006 * Read a Bolt11Invoice object from a string
47008 struct LDKCResult_Bolt11InvoiceParseOrSemanticErrorZ Bolt11Invoice_from_str(struct LDKStr s);
47011 * Read a SignedRawBolt11Invoice object from a string
47013 struct LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZ SignedRawBolt11Invoice_from_str(struct LDKStr s);
47016 * Get the string representation of a Bolt11ParseError object
47018 struct LDKStr Bolt11ParseError_to_str(const struct LDKBolt11ParseError *NONNULL_PTR o);
47021 * Get the string representation of a ParseOrSemanticError object
47023 struct LDKStr ParseOrSemanticError_to_str(const struct LDKParseOrSemanticError *NONNULL_PTR o);
47026 * Get the string representation of a Bolt11Invoice object
47028 struct LDKStr Bolt11Invoice_to_str(const struct LDKBolt11Invoice *NONNULL_PTR o);
47031 * Get the string representation of a SignedRawBolt11Invoice object
47033 struct LDKStr SignedRawBolt11Invoice_to_str(const struct LDKSignedRawBolt11Invoice *NONNULL_PTR o);
47036 * Get the string representation of a Currency object
47038 struct LDKStr Currency_to_str(const enum LDKCurrency *NONNULL_PTR o);
47041 * Get the string representation of a SiPrefix object
47043 struct LDKStr SiPrefix_to_str(const enum LDKSiPrefix *NONNULL_PTR o);
47046 * Frees any resources used by the RapidGossipSync, if is_owned is set and inner is non-NULL.
47048 void RapidGossipSync_free(struct LDKRapidGossipSync this_obj);
47051 * Instantiate a new [`RapidGossipSync`] instance.
47053 MUST_USE_RES struct LDKRapidGossipSync RapidGossipSync_new(const struct LDKNetworkGraph *NONNULL_PTR network_graph, struct LDKLogger logger);
47056 * Sync gossip data from a file.
47057 * Returns the last sync timestamp to be used the next time rapid sync data is queried.
47059 * `network_graph`: The network graph to apply the updates to
47061 * `sync_path`: Path to the file where the gossip update data is located
47064 MUST_USE_RES struct LDKCResult_u32GraphSyncErrorZ RapidGossipSync_sync_network_graph_with_file_path(const struct LDKRapidGossipSync *NONNULL_PTR this_arg, struct LDKStr sync_path);
47067 * Update network graph from binary data.
47068 * Returns the last sync timestamp to be used the next time rapid sync data is queried.
47070 * `update_data`: `&[u8]` binary stream that comprises the update data
47072 MUST_USE_RES struct LDKCResult_u32GraphSyncErrorZ RapidGossipSync_update_network_graph(const struct LDKRapidGossipSync *NONNULL_PTR this_arg, struct LDKu8slice update_data);
47075 * Update network graph from binary data.
47076 * Returns the last sync timestamp to be used the next time rapid sync data is queried.
47078 * `update_data`: `&[u8]` binary stream that comprises the update data
47079 * `current_time_unix`: `Option<u64>` optional current timestamp to verify data age
47081 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);
47084 * Returns whether a rapid gossip sync has completed at least once.
47086 MUST_USE_RES bool RapidGossipSync_is_initial_sync_complete(const struct LDKRapidGossipSync *NONNULL_PTR this_arg);
47089 * Frees any resources used by the GraphSyncError
47091 void GraphSyncError_free(struct LDKGraphSyncError this_ptr);
47094 * Creates a copy of the GraphSyncError
47096 struct LDKGraphSyncError GraphSyncError_clone(const struct LDKGraphSyncError *NONNULL_PTR orig);
47099 * Utility method to constructs a new DecodeError-variant GraphSyncError
47101 struct LDKGraphSyncError GraphSyncError_decode_error(struct LDKDecodeError a);
47104 * Utility method to constructs a new LightningError-variant GraphSyncError
47106 struct LDKGraphSyncError GraphSyncError_lightning_error(struct LDKLightningError a);
47108 #endif /* LDK_C_BINDINGS_H */
47110 #include "ldk_ver.h"