1 #ifndef LDK_C_BINDINGS_H
2 #define LDK_C_BINDINGS_H
4 /* Generated with cbindgen:0.24.3 */
6 /* Warning, this file is autogenerated by cbindgen. Don't modify this manually. */
11 #include "ldk_rust_types.h"
14 * An error when accessing the chain via [`Access`].
16 typedef enum LDKAccessError {
18 * The requested chain is unknown.
20 LDKAccessError_UnknownChain,
22 * The requested transaction doesn't exist or hasn't confirmed.
24 LDKAccessError_UnknownTx,
26 * Must be last for serialization purposes
28 LDKAccessError_Sentinel,
32 * An enum which can either contain a or not
34 typedef enum LDKCOption_NoneZ {
36 * When we're in this state, this COption_NoneZ contains a
38 LDKCOption_NoneZ_Some,
40 * When we're in this state, this COption_NoneZ contains nothing
42 LDKCOption_NoneZ_None,
44 * Must be last for serialization purposes
46 LDKCOption_NoneZ_Sentinel,
50 * An enum representing the status of a channel monitor update persistence.
52 typedef enum LDKChannelMonitorUpdateStatus {
54 * The update has been durably persisted and all copies of the relevant [`ChannelMonitor`]
57 * This includes performing any `fsync()` calls required to ensure the update is guaranteed to
58 * be available on restart even if the application crashes.
60 LDKChannelMonitorUpdateStatus_Completed,
62 * Used to indicate a temporary failure (eg connection to a watchtower or remote backup of
63 * our state failed, but is expected to succeed at some point in the future).
65 * Such a failure will \"freeze\" a channel, preventing us from revoking old states or
66 * submitting new commitment transactions to the counterparty. Once the update(s) which failed
67 * have been successfully applied, a [`MonitorEvent::Completed`] can be used to restore the
68 * channel to an operational state.
70 * Note that a given [`ChannelManager`] will *never* re-generate a [`ChannelMonitorUpdate`].
71 * If you return this error you must ensure that it is written to disk safely before writing
72 * the latest [`ChannelManager`] state, or you should return [`PermanentFailure`] instead.
74 * Even when a channel has been \"frozen\", updates to the [`ChannelMonitor`] can continue to
75 * occur (e.g. if an inbound HTLC which we forwarded was claimed upstream, resulting in us
76 * attempting to claim it on this channel) and those updates must still be persisted.
78 * No updates to the channel will be made which could invalidate other [`ChannelMonitor`]s
79 * until a [`MonitorEvent::Completed`] is provided, even if you return no error on a later
80 * monitor update for the same channel.
82 * For deployments where a copy of ChannelMonitors and other local state are backed up in a
83 * remote location (with local copies persisted immediately), it is anticipated that all
84 * updates will return [`InProgress`] until the remote copies could be updated.
86 * [`PermanentFailure`]: ChannelMonitorUpdateStatus::PermanentFailure
87 * [`InProgress`]: ChannelMonitorUpdateStatus::InProgress
88 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
90 LDKChannelMonitorUpdateStatus_InProgress,
92 * Used to indicate no further channel monitor updates will be allowed (likely a disk failure
93 * or a remote copy of this [`ChannelMonitor`] is no longer reachable and thus not updatable).
95 * When this is returned, [`ChannelManager`] will force-close the channel but *not* broadcast
96 * our current commitment transaction. This avoids a dangerous case where a local disk failure
97 * (e.g. the Linux-default remounting of the disk as read-only) causes [`PermanentFailure`]s
98 * for all monitor updates. If we were to broadcast our latest commitment transaction and then
99 * restart, we could end up reading a previous [`ChannelMonitor`] and [`ChannelManager`],
100 * revoking our now-broadcasted state before seeing it confirm and losing all our funds.
102 * Note that this is somewhat of a tradeoff - if the disk is really gone and we may have lost
103 * the data permanently, we really should broadcast immediately. If the data can be recovered
104 * with manual intervention, we'd rather close the channel, rejecting future updates to it,
105 * and broadcast the latest state only if we have HTLCs to claim which are timing out (which
106 * we do as long as blocks are connected).
108 * In order to broadcast the latest local commitment transaction, you'll need to call
109 * [`ChannelMonitor::get_latest_holder_commitment_txn`] and broadcast the resulting
110 * transactions once you've safely ensured no further channel updates can be generated by your
111 * [`ChannelManager`].
113 * Note that at least one final [`ChannelMonitorUpdate`] may still be provided, which must
114 * still be processed by a running [`ChannelMonitor`]. This final update will mark the
115 * [`ChannelMonitor`] as finalized, ensuring no further updates (e.g. revocation of the latest
116 * commitment transaction) are allowed.
118 * Note that even if you return a [`PermanentFailure`] due to unavailability of secondary
119 * [`ChannelMonitor`] copies, you should still make an attempt to store the update where
120 * possible to ensure you can claim HTLC outputs on the latest commitment transaction
123 * In case of distributed watchtowers deployment, the new version must be written to disk, as
124 * state may have been stored but rejected due to a block forcing a commitment broadcast. This
125 * storage is used to claim outputs of rejected state confirmed onchain by another watchtower,
126 * lagging behind on block processing.
128 * [`PermanentFailure`]: ChannelMonitorUpdateStatus::PermanentFailure
129 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
131 LDKChannelMonitorUpdateStatus_PermanentFailure,
133 * Must be last for serialization purposes
135 LDKChannelMonitorUpdateStatus_Sentinel,
136 } LDKChannelMonitorUpdateStatus;
139 * An enum that represents the speed at which we want a transaction to confirm used for feerate
142 typedef enum LDKConfirmationTarget {
144 * We are happy with this transaction confirming slowly when feerate drops some.
146 LDKConfirmationTarget_Background,
148 * We'd like this transaction to confirm without major delay, but 12-18 blocks is fine.
150 LDKConfirmationTarget_Normal,
152 * We'd like this transaction to confirm in the next few blocks.
154 LDKConfirmationTarget_HighPriority,
156 * Must be last for serialization purposes
158 LDKConfirmationTarget_Sentinel,
159 } LDKConfirmationTarget;
162 * Errors that may occur when constructing a new `RawInvoice` or `Invoice`
164 typedef enum LDKCreationError {
166 * The supplied description string was longer than 639 __bytes__ (see [`Description::new(…)`](./struct.Description.html#method.new))
168 LDKCreationError_DescriptionTooLong,
170 * The specified route has too many hops and can't be encoded
172 LDKCreationError_RouteTooLong,
174 * The Unix timestamp of the supplied date is less than zero or greater than 35-bits
176 LDKCreationError_TimestampOutOfBounds,
178 * The supplied millisatoshi amount was greater than the total bitcoin supply.
180 LDKCreationError_InvalidAmount,
182 * Route hints were required for this invoice and were missing. Applies to
183 * [phantom invoices].
185 * [phantom invoices]: crate::utils::create_phantom_invoice
187 LDKCreationError_MissingRouteHints,
189 * Must be last for serialization purposes
191 LDKCreationError_Sentinel,
195 * Enum representing the crypto currencies (or networks) supported by this library
197 typedef enum LDKCurrency {
205 LDKCurrency_BitcoinTestnet,
219 * Must be last for serialization purposes
221 LDKCurrency_Sentinel,
225 * Describes the type of HTLC claim as determined by analyzing the witness.
227 typedef enum LDKHTLCClaim {
229 * Claims an offered output on a commitment transaction through the timeout path.
231 LDKHTLCClaim_OfferedTimeout,
233 * Claims an offered output on a commitment transaction through the success path.
235 LDKHTLCClaim_OfferedPreimage,
237 * Claims an accepted output on a commitment transaction through the timeout path.
239 LDKHTLCClaim_AcceptedTimeout,
241 * Claims an accepted output on a commitment transaction through the success path.
243 LDKHTLCClaim_AcceptedPreimage,
245 * Claims an offered/accepted output on a commitment transaction through the revocation path.
247 LDKHTLCClaim_Revocation,
249 * Must be last for serialization purposes
251 LDKHTLCClaim_Sentinel,
255 * Represents an IO Error. Note that some information is lost in the conversion from Rust.
257 typedef enum LDKIOError {
259 LDKIOError_PermissionDenied,
260 LDKIOError_ConnectionRefused,
261 LDKIOError_ConnectionReset,
262 LDKIOError_ConnectionAborted,
263 LDKIOError_NotConnected,
264 LDKIOError_AddrInUse,
265 LDKIOError_AddrNotAvailable,
266 LDKIOError_BrokenPipe,
267 LDKIOError_AlreadyExists,
268 LDKIOError_WouldBlock,
269 LDKIOError_InvalidInput,
270 LDKIOError_InvalidData,
272 LDKIOError_WriteZero,
273 LDKIOError_Interrupted,
275 LDKIOError_UnexpectedEof,
277 * Must be last for serialization purposes
283 * An enum representing the available verbosity levels of the logger.
285 typedef enum LDKLevel {
287 * Designates extremely verbose information, including gossip-induced messages
291 * Designates very low priority, often extremely verbose, information
295 * Designates lower priority information
299 * Designates useful information
303 * Designates hazardous situations
307 * Designates very serious errors
311 * Must be last for serialization purposes
317 * An enum representing the possible Bitcoin or test networks which we can run on
319 typedef enum LDKNetwork {
321 * The main Bitcoin blockchain.
325 * The testnet3 blockchain.
329 * A local test blockchain.
333 * A blockchain on which blocks are signed instead of mined.
337 * Must be last for serialization purposes
343 * Specifies the recipient of an invoice.
345 * This indicates to [`KeysInterface::sign_invoice`] what node secret key should be used to sign
348 typedef enum LDKRecipient {
350 * The invoice should be signed with the local node secret key.
354 * The invoice should be signed with the phantom node secret key. This secret key must be the
355 * same for all nodes participating in the [phantom node payment].
357 * [phantom node payment]: PhantomKeysManager
359 LDKRecipient_PhantomNode,
361 * Must be last for serialization purposes
363 LDKRecipient_Sentinel,
367 * Represents an error returned from libsecp256k1 during validation of some secp256k1 data
369 typedef enum LDKSecp256k1Error {
371 * Signature failed verification
373 LDKSecp256k1Error_IncorrectSignature,
375 * Badly sized message ("messages" are actually fixed-sized digests; see the MESSAGE_SIZE constant)
377 LDKSecp256k1Error_InvalidMessage,
381 LDKSecp256k1Error_InvalidPublicKey,
385 LDKSecp256k1Error_InvalidSignature,
389 LDKSecp256k1Error_InvalidSecretKey,
393 LDKSecp256k1Error_InvalidSharedSecret,
397 LDKSecp256k1Error_InvalidRecoveryId,
399 * Invalid tweak for add_assign or mul_assign
401 LDKSecp256k1Error_InvalidTweak,
403 * Didn't pass enough memory to context creation with preallocated memory
405 LDKSecp256k1Error_NotEnoughMemory,
407 * Bad set of public keys.
409 LDKSecp256k1Error_InvalidPublicKeySum,
411 * The only valid parity values are 0 or 1.
413 LDKSecp256k1Error_InvalidParityValue,
415 * Must be last for serialization purposes
417 LDKSecp256k1Error_Sentinel,
421 * Errors that may occur when converting a `RawInvoice` to an `Invoice`. They relate to the
422 * requirements sections in BOLT #11
424 typedef enum LDKSemanticError {
426 * The invoice is missing the mandatory payment hash
428 LDKSemanticError_NoPaymentHash,
430 * The invoice has multiple payment hashes which isn't allowed
432 LDKSemanticError_MultiplePaymentHashes,
434 * No description or description hash are part of the invoice
436 LDKSemanticError_NoDescription,
438 * The invoice contains multiple descriptions and/or description hashes which isn't allowed
440 LDKSemanticError_MultipleDescriptions,
442 * The invoice is missing the mandatory payment secret, which all modern lightning nodes
445 LDKSemanticError_NoPaymentSecret,
447 * The invoice contains multiple payment secrets
449 LDKSemanticError_MultiplePaymentSecrets,
451 * The invoice's features are invalid
453 LDKSemanticError_InvalidFeatures,
455 * The recovery id doesn't fit the signature/pub key
457 LDKSemanticError_InvalidRecoveryId,
459 * The invoice's signature is invalid
461 LDKSemanticError_InvalidSignature,
463 * The invoice's amount was not a whole number of millisatoshis
465 LDKSemanticError_ImpreciseAmount,
467 * Must be last for serialization purposes
469 LDKSemanticError_Sentinel,
473 * SI prefixes for the human readable part
475 typedef enum LDKSiPrefix {
493 * Must be last for serialization purposes
495 LDKSiPrefix_Sentinel,
499 * A Rust str object, ie a reference to a UTF8-valid string.
500 * This is *not* null-terminated so cannot be used directly as a C string!
502 typedef struct LDKStr {
504 * A pointer to the string's bytes, in UTF8 encoding
506 const uint8_t *chars;
508 * The number of bytes (not characters!) pointed to by `chars`
512 * Whether the data pointed to by `chars` should be freed or not.
518 * A 16-byte byte array.
520 typedef struct LDKSixteenBytes {
528 * Unsigned, 128-bit integer.
530 * Because LLVM implements an incorrect ABI for 128-bit integers, a wrapper type is defined here.
531 * See https://github.com/rust-lang/rust/issues/54341 for more details.
533 typedef struct LDKU128 {
535 * The 128-bit integer, as 16 little-endian bytes
537 uint8_t le_bytes[16];
541 * Represents a scalar value between zero and the secp256k1 curve order, in big endian.
543 typedef struct LDKBigEndianScalar {
545 * The bytes of the scalar value.
547 uint8_t big_endian_bytes[32];
548 } LDKBigEndianScalar;
551 * Arbitrary 32 bytes, which could represent one of a few different things. You probably want to
552 * look up the corresponding function in rust-lightning's docs.
554 typedef struct LDKThirtyTwoBytes {
556 * The thirty-two bytes
562 * Represents an error returned from the bech32 library during validation of some bech32 data
564 typedef enum LDKBech32Error_Tag {
566 * String does not contain the separator character
568 LDKBech32Error_MissingSeparator,
570 * The checksum does not match the rest of the data
572 LDKBech32Error_InvalidChecksum,
574 * The data or human-readable part is too long or too short
576 LDKBech32Error_InvalidLength,
578 * Some part of the string contains an invalid character
580 LDKBech32Error_InvalidChar,
582 * Some part of the data has an invalid value
584 LDKBech32Error_InvalidData,
586 * The bit conversion failed due to a padding issue
588 LDKBech32Error_InvalidPadding,
590 * The whole string must be of one case
592 LDKBech32Error_MixedCase,
594 * Must be last for serialization purposes
596 LDKBech32Error_Sentinel,
597 } LDKBech32Error_Tag;
599 typedef struct LDKBech32Error {
600 LDKBech32Error_Tag tag;
603 uint32_t invalid_char;
606 uint8_t invalid_data;
612 * A serialized transaction, in (pointer, length) form.
614 * This type optionally owns its own memory, and thus the semantics around access change based on
615 * the `data_is_owned` flag. If `data_is_owned` is set, you must call `Transaction_free` to free
616 * the underlying buffer before the object goes out of scope. If `data_is_owned` is not set, any
617 * access to the buffer after the scope in which the object was provided to you is invalid. eg,
618 * access after you return from the call in which a `!data_is_owned` `Transaction` is provided to
619 * you would be invalid.
621 * Note that, while it may change in the future, because transactions on the Rust side are stored
622 * in a deserialized form, all `Transaction`s generated on the Rust side will have `data_is_owned`
623 * set. Similarly, while it may change in the future, all `Transaction`s you pass to Rust may have
624 * `data_is_owned` either set or unset at your discretion.
626 typedef struct LDKTransaction {
628 * The serialized transaction data.
630 * This is non-const for your convenience, an object passed to Rust is never written to.
634 * The length of the serialized transaction
638 * Whether the data pointed to by `data` should be freed or not.
644 * A serialized witness.
646 typedef struct LDKWitness {
648 * The serialized transaction data.
650 * This is non-const for your convenience, an object passed to Rust is never written to.
654 * The length of the serialized transaction
658 * Whether the data pointed to by `data` should be freed or not.
664 * A dynamically-allocated array of u8s of arbitrary size.
665 * This corresponds to std::vector in C++
667 typedef struct LDKCVec_u8Z {
669 * The elements in the array.
670 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
674 * The number of elements pointed to by `data`.
680 * A transaction output including a scriptPubKey and value.
681 * This type *does* own its own memory, so must be free'd appropriately.
683 typedef struct LDKTxOut {
685 * The script_pubkey in this output
687 struct LDKCVec_u8Z script_pubkey;
689 * The value, in satoshis, of this output
695 * An enum which can either contain a crate::lightning::ln::chan_utils::HTLCClaim or not
697 typedef enum LDKCOption_HTLCClaimZ_Tag {
699 * When we're in this state, this COption_HTLCClaimZ contains a crate::lightning::ln::chan_utils::HTLCClaim
701 LDKCOption_HTLCClaimZ_Some,
703 * When we're in this state, this COption_HTLCClaimZ contains nothing
705 LDKCOption_HTLCClaimZ_None,
707 * Must be last for serialization purposes
709 LDKCOption_HTLCClaimZ_Sentinel,
710 } LDKCOption_HTLCClaimZ_Tag;
712 typedef struct LDKCOption_HTLCClaimZ {
713 LDKCOption_HTLCClaimZ_Tag tag;
716 enum LDKHTLCClaim some;
719 } LDKCOption_HTLCClaimZ;
722 * The contents of CResult_NoneNoneZ
724 typedef union LDKCResult_NoneNoneZPtr {
726 * Note that this value is always NULL, as there are no contents in the OK variant
730 * Note that this value is always NULL, as there are no contents in the Err variant
733 } LDKCResult_NoneNoneZPtr;
736 * A CResult_NoneNoneZ represents the result of a fallible operation,
737 * containing a () on success and a () on failure.
738 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
740 typedef struct LDKCResult_NoneNoneZ {
742 * The contents of this CResult_NoneNoneZ, accessible via either
743 * `err` or `result` depending on the state of `result_ok`.
745 union LDKCResult_NoneNoneZPtr contents;
747 * Whether this CResult_NoneNoneZ represents a success state.
750 } LDKCResult_NoneNoneZ;
755 * Implements the per-commitment secret storage scheme from
756 * [BOLT 3](https://github.com/lightning/bolts/blob/dcbf8583976df087c79c3ce0b535311212e6812d/03-transactions.md#efficient-per-commitment-secret-storage).
758 * Allows us to keep track of all of the revocation secrets of our counterparty in just 50*32 bytes
761 typedef struct MUST_USE_STRUCT LDKCounterpartyCommitmentSecrets {
763 * A pointer to the opaque Rust object.
764 * Nearly everywhere, inner must be non-null, however in places where
765 * the Rust equivalent takes an Option, it may be set to null to indicate None.
767 LDKnativeCounterpartyCommitmentSecrets *inner;
769 * Indicates that this is the only struct which contains the same pointer.
770 * Rust functions which take ownership of an object provided via an argument require
771 * this to be true and invalidate the object pointed to by inner.
774 } LDKCounterpartyCommitmentSecrets;
777 * An error in decoding a message or struct.
779 typedef enum LDKDecodeError_Tag {
781 * A version byte specified something we don't know how to handle.
782 * Includes unknown realm byte in an OnionHopData packet
784 LDKDecodeError_UnknownVersion,
786 * Unknown feature mandating we fail to parse message (eg TLV with an even, unknown type)
788 LDKDecodeError_UnknownRequiredFeature,
790 * Value was invalid, eg a byte which was supposed to be a bool was something other than a 0
791 * or 1, a public key/private key/signature was invalid, text wasn't UTF-8, TLV was
792 * syntactically incorrect, etc
794 LDKDecodeError_InvalidValue,
798 LDKDecodeError_ShortRead,
800 * A length descriptor in the packet didn't describe the later data correctly
802 LDKDecodeError_BadLengthDescriptor,
808 * The message included zlib-compressed values, which we don't support.
810 LDKDecodeError_UnsupportedCompression,
812 * Must be last for serialization purposes
814 LDKDecodeError_Sentinel,
815 } LDKDecodeError_Tag;
817 typedef struct MUST_USE_STRUCT LDKDecodeError {
818 LDKDecodeError_Tag tag;
827 * The contents of CResult_CounterpartyCommitmentSecretsDecodeErrorZ
829 typedef union LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZPtr {
831 * A pointer to the contents in the success state.
832 * Reading from this pointer when `result_ok` is not set is undefined.
834 struct LDKCounterpartyCommitmentSecrets *result;
836 * A pointer to the contents in the error state.
837 * Reading from this pointer when `result_ok` is set is undefined.
839 struct LDKDecodeError *err;
840 } LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZPtr;
843 * A CResult_CounterpartyCommitmentSecretsDecodeErrorZ represents the result of a fallible operation,
844 * containing a crate::lightning::ln::chan_utils::CounterpartyCommitmentSecrets on success and a crate::lightning::ln::msgs::DecodeError on failure.
845 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
847 typedef struct LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ {
849 * The contents of this CResult_CounterpartyCommitmentSecretsDecodeErrorZ, accessible via either
850 * `err` or `result` depending on the state of `result_ok`.
852 union LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZPtr contents;
854 * Whether this CResult_CounterpartyCommitmentSecretsDecodeErrorZ represents a success state.
857 } LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ;
862 * The set of public keys which are used in the creation of one commitment transaction.
863 * These are derived from the channel base keys and per-commitment data.
865 * A broadcaster key is provided from potential broadcaster of the computed transaction.
866 * A countersignatory key is coming from a protocol participant unable to broadcast the
869 * These keys are assumed to be good, either because the code derived them from
870 * channel basepoints via the new function, or they were obtained via
871 * CommitmentTransaction.trust().keys() because we trusted the source of the
872 * pre-calculated keys.
874 typedef struct MUST_USE_STRUCT LDKTxCreationKeys {
876 * A pointer to the opaque Rust object.
877 * Nearly everywhere, inner must be non-null, however in places where
878 * the Rust equivalent takes an Option, it may be set to null to indicate None.
880 LDKnativeTxCreationKeys *inner;
882 * Indicates that this is the only struct which contains the same pointer.
883 * Rust functions which take ownership of an object provided via an argument require
884 * this to be true and invalidate the object pointed to by inner.
890 * The contents of CResult_TxCreationKeysDecodeErrorZ
892 typedef union LDKCResult_TxCreationKeysDecodeErrorZPtr {
894 * A pointer to the contents in the success state.
895 * Reading from this pointer when `result_ok` is not set is undefined.
897 struct LDKTxCreationKeys *result;
899 * A pointer to the contents in the error state.
900 * Reading from this pointer when `result_ok` is set is undefined.
902 struct LDKDecodeError *err;
903 } LDKCResult_TxCreationKeysDecodeErrorZPtr;
906 * A CResult_TxCreationKeysDecodeErrorZ represents the result of a fallible operation,
907 * containing a crate::lightning::ln::chan_utils::TxCreationKeys on success and a crate::lightning::ln::msgs::DecodeError on failure.
908 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
910 typedef struct LDKCResult_TxCreationKeysDecodeErrorZ {
912 * The contents of this CResult_TxCreationKeysDecodeErrorZ, accessible via either
913 * `err` or `result` depending on the state of `result_ok`.
915 union LDKCResult_TxCreationKeysDecodeErrorZPtr contents;
917 * Whether this CResult_TxCreationKeysDecodeErrorZ represents a success state.
920 } LDKCResult_TxCreationKeysDecodeErrorZ;
925 * One counterparty's public keys which do not change over the life of a channel.
927 typedef struct MUST_USE_STRUCT LDKChannelPublicKeys {
929 * A pointer to the opaque Rust object.
930 * Nearly everywhere, inner must be non-null, however in places where
931 * the Rust equivalent takes an Option, it may be set to null to indicate None.
933 LDKnativeChannelPublicKeys *inner;
935 * Indicates that this is the only struct which contains the same pointer.
936 * Rust functions which take ownership of an object provided via an argument require
937 * this to be true and invalidate the object pointed to by inner.
940 } LDKChannelPublicKeys;
943 * The contents of CResult_ChannelPublicKeysDecodeErrorZ
945 typedef union LDKCResult_ChannelPublicKeysDecodeErrorZPtr {
947 * A pointer to the contents in the success state.
948 * Reading from this pointer when `result_ok` is not set is undefined.
950 struct LDKChannelPublicKeys *result;
952 * A pointer to the contents in the error state.
953 * Reading from this pointer when `result_ok` is set is undefined.
955 struct LDKDecodeError *err;
956 } LDKCResult_ChannelPublicKeysDecodeErrorZPtr;
959 * A CResult_ChannelPublicKeysDecodeErrorZ represents the result of a fallible operation,
960 * containing a crate::lightning::ln::chan_utils::ChannelPublicKeys on success and a crate::lightning::ln::msgs::DecodeError on failure.
961 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
963 typedef struct LDKCResult_ChannelPublicKeysDecodeErrorZ {
965 * The contents of this CResult_ChannelPublicKeysDecodeErrorZ, accessible via either
966 * `err` or `result` depending on the state of `result_ok`.
968 union LDKCResult_ChannelPublicKeysDecodeErrorZPtr contents;
970 * Whether this CResult_ChannelPublicKeysDecodeErrorZ represents a success state.
973 } LDKCResult_ChannelPublicKeysDecodeErrorZ;
976 * An enum which can either contain a u32 or not
978 typedef enum LDKCOption_u32Z_Tag {
980 * When we're in this state, this COption_u32Z contains a u32
982 LDKCOption_u32Z_Some,
984 * When we're in this state, this COption_u32Z contains nothing
986 LDKCOption_u32Z_None,
988 * Must be last for serialization purposes
990 LDKCOption_u32Z_Sentinel,
991 } LDKCOption_u32Z_Tag;
993 typedef struct LDKCOption_u32Z {
994 LDKCOption_u32Z_Tag tag;
1005 * Information about an HTLC as it appears in a commitment transaction
1007 typedef struct MUST_USE_STRUCT LDKHTLCOutputInCommitment {
1009 * A pointer to the opaque Rust object.
1010 * Nearly everywhere, inner must be non-null, however in places where
1011 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1013 LDKnativeHTLCOutputInCommitment *inner;
1015 * Indicates that this is the only struct which contains the same pointer.
1016 * Rust functions which take ownership of an object provided via an argument require
1017 * this to be true and invalidate the object pointed to by inner.
1020 } LDKHTLCOutputInCommitment;
1023 * The contents of CResult_HTLCOutputInCommitmentDecodeErrorZ
1025 typedef union LDKCResult_HTLCOutputInCommitmentDecodeErrorZPtr {
1027 * A pointer to the contents in the success state.
1028 * Reading from this pointer when `result_ok` is not set is undefined.
1030 struct LDKHTLCOutputInCommitment *result;
1032 * A pointer to the contents in the error state.
1033 * Reading from this pointer when `result_ok` is set is undefined.
1035 struct LDKDecodeError *err;
1036 } LDKCResult_HTLCOutputInCommitmentDecodeErrorZPtr;
1039 * A CResult_HTLCOutputInCommitmentDecodeErrorZ represents the result of a fallible operation,
1040 * containing a crate::lightning::ln::chan_utils::HTLCOutputInCommitment on success and a crate::lightning::ln::msgs::DecodeError on failure.
1041 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1043 typedef struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ {
1045 * The contents of this CResult_HTLCOutputInCommitmentDecodeErrorZ, accessible via either
1046 * `err` or `result` depending on the state of `result_ok`.
1048 union LDKCResult_HTLCOutputInCommitmentDecodeErrorZPtr contents;
1050 * Whether this CResult_HTLCOutputInCommitmentDecodeErrorZ represents a success state.
1053 } LDKCResult_HTLCOutputInCommitmentDecodeErrorZ;
1058 * Late-bound per-channel counterparty data used to build transactions.
1060 typedef struct MUST_USE_STRUCT LDKCounterpartyChannelTransactionParameters {
1062 * A pointer to the opaque Rust object.
1063 * Nearly everywhere, inner must be non-null, however in places where
1064 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1066 LDKnativeCounterpartyChannelTransactionParameters *inner;
1068 * Indicates that this is the only struct which contains the same pointer.
1069 * Rust functions which take ownership of an object provided via an argument require
1070 * this to be true and invalidate the object pointed to by inner.
1073 } LDKCounterpartyChannelTransactionParameters;
1076 * The contents of CResult_CounterpartyChannelTransactionParametersDecodeErrorZ
1078 typedef union LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZPtr {
1080 * A pointer to the contents in the success state.
1081 * Reading from this pointer when `result_ok` is not set is undefined.
1083 struct LDKCounterpartyChannelTransactionParameters *result;
1085 * A pointer to the contents in the error state.
1086 * Reading from this pointer when `result_ok` is set is undefined.
1088 struct LDKDecodeError *err;
1089 } LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZPtr;
1092 * A CResult_CounterpartyChannelTransactionParametersDecodeErrorZ represents the result of a fallible operation,
1093 * containing a crate::lightning::ln::chan_utils::CounterpartyChannelTransactionParameters on success and a crate::lightning::ln::msgs::DecodeError on failure.
1094 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1096 typedef struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ {
1098 * The contents of this CResult_CounterpartyChannelTransactionParametersDecodeErrorZ, accessible via either
1099 * `err` or `result` depending on the state of `result_ok`.
1101 union LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZPtr contents;
1103 * Whether this CResult_CounterpartyChannelTransactionParametersDecodeErrorZ represents a success state.
1106 } LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ;
1111 * Per-channel data used to build transactions in conjunction with the per-commitment data (CommitmentTransaction).
1112 * The fields are organized by holder/counterparty.
1114 * Normally, this is converted to the broadcaster/countersignatory-organized DirectedChannelTransactionParameters
1115 * before use, via the as_holder_broadcastable and as_counterparty_broadcastable functions.
1117 typedef struct MUST_USE_STRUCT LDKChannelTransactionParameters {
1119 * A pointer to the opaque Rust object.
1120 * Nearly everywhere, inner must be non-null, however in places where
1121 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1123 LDKnativeChannelTransactionParameters *inner;
1125 * Indicates that this is the only struct which contains the same pointer.
1126 * Rust functions which take ownership of an object provided via an argument require
1127 * this to be true and invalidate the object pointed to by inner.
1130 } LDKChannelTransactionParameters;
1133 * The contents of CResult_ChannelTransactionParametersDecodeErrorZ
1135 typedef union LDKCResult_ChannelTransactionParametersDecodeErrorZPtr {
1137 * A pointer to the contents in the success state.
1138 * Reading from this pointer when `result_ok` is not set is undefined.
1140 struct LDKChannelTransactionParameters *result;
1142 * A pointer to the contents in the error state.
1143 * Reading from this pointer when `result_ok` is set is undefined.
1145 struct LDKDecodeError *err;
1146 } LDKCResult_ChannelTransactionParametersDecodeErrorZPtr;
1149 * A CResult_ChannelTransactionParametersDecodeErrorZ represents the result of a fallible operation,
1150 * containing a crate::lightning::ln::chan_utils::ChannelTransactionParameters on success and a crate::lightning::ln::msgs::DecodeError on failure.
1151 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1153 typedef struct LDKCResult_ChannelTransactionParametersDecodeErrorZ {
1155 * The contents of this CResult_ChannelTransactionParametersDecodeErrorZ, accessible via either
1156 * `err` or `result` depending on the state of `result_ok`.
1158 union LDKCResult_ChannelTransactionParametersDecodeErrorZPtr contents;
1160 * Whether this CResult_ChannelTransactionParametersDecodeErrorZ represents a success state.
1163 } LDKCResult_ChannelTransactionParametersDecodeErrorZ;
1166 * Represents a secp256k1 signature serialized as two 32-byte numbers
1168 typedef struct LDKSignature {
1170 * The bytes of the signature in "compact" form
1172 uint8_t compact_form[64];
1176 * A dynamically-allocated array of crate::c_types::Signatures of arbitrary size.
1177 * This corresponds to std::vector in C++
1179 typedef struct LDKCVec_SignatureZ {
1181 * The elements in the array.
1182 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
1184 struct LDKSignature *data;
1186 * The number of elements pointed to by `data`.
1189 } LDKCVec_SignatureZ;
1194 * Information needed to build and sign a holder's commitment transaction.
1196 * The transaction is only signed once we are ready to broadcast.
1198 typedef struct MUST_USE_STRUCT LDKHolderCommitmentTransaction {
1200 * A pointer to the opaque Rust object.
1201 * Nearly everywhere, inner must be non-null, however in places where
1202 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1204 LDKnativeHolderCommitmentTransaction *inner;
1206 * Indicates that this is the only struct which contains the same pointer.
1207 * Rust functions which take ownership of an object provided via an argument require
1208 * this to be true and invalidate the object pointed to by inner.
1211 } LDKHolderCommitmentTransaction;
1214 * The contents of CResult_HolderCommitmentTransactionDecodeErrorZ
1216 typedef union LDKCResult_HolderCommitmentTransactionDecodeErrorZPtr {
1218 * A pointer to the contents in the success state.
1219 * Reading from this pointer when `result_ok` is not set is undefined.
1221 struct LDKHolderCommitmentTransaction *result;
1223 * A pointer to the contents in the error state.
1224 * Reading from this pointer when `result_ok` is set is undefined.
1226 struct LDKDecodeError *err;
1227 } LDKCResult_HolderCommitmentTransactionDecodeErrorZPtr;
1230 * A CResult_HolderCommitmentTransactionDecodeErrorZ represents the result of a fallible operation,
1231 * containing a crate::lightning::ln::chan_utils::HolderCommitmentTransaction on success and a crate::lightning::ln::msgs::DecodeError on failure.
1232 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1234 typedef struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ {
1236 * The contents of this CResult_HolderCommitmentTransactionDecodeErrorZ, accessible via either
1237 * `err` or `result` depending on the state of `result_ok`.
1239 union LDKCResult_HolderCommitmentTransactionDecodeErrorZPtr contents;
1241 * Whether this CResult_HolderCommitmentTransactionDecodeErrorZ represents a success state.
1244 } LDKCResult_HolderCommitmentTransactionDecodeErrorZ;
1249 * A pre-built Bitcoin commitment transaction and its txid.
1251 typedef struct MUST_USE_STRUCT LDKBuiltCommitmentTransaction {
1253 * A pointer to the opaque Rust object.
1254 * Nearly everywhere, inner must be non-null, however in places where
1255 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1257 LDKnativeBuiltCommitmentTransaction *inner;
1259 * Indicates that this is the only struct which contains the same pointer.
1260 * Rust functions which take ownership of an object provided via an argument require
1261 * this to be true and invalidate the object pointed to by inner.
1264 } LDKBuiltCommitmentTransaction;
1267 * The contents of CResult_BuiltCommitmentTransactionDecodeErrorZ
1269 typedef union LDKCResult_BuiltCommitmentTransactionDecodeErrorZPtr {
1271 * A pointer to the contents in the success state.
1272 * Reading from this pointer when `result_ok` is not set is undefined.
1274 struct LDKBuiltCommitmentTransaction *result;
1276 * A pointer to the contents in the error state.
1277 * Reading from this pointer when `result_ok` is set is undefined.
1279 struct LDKDecodeError *err;
1280 } LDKCResult_BuiltCommitmentTransactionDecodeErrorZPtr;
1283 * A CResult_BuiltCommitmentTransactionDecodeErrorZ represents the result of a fallible operation,
1284 * containing a crate::lightning::ln::chan_utils::BuiltCommitmentTransaction on success and a crate::lightning::ln::msgs::DecodeError on failure.
1285 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1287 typedef struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ {
1289 * The contents of this CResult_BuiltCommitmentTransactionDecodeErrorZ, accessible via either
1290 * `err` or `result` depending on the state of `result_ok`.
1292 union LDKCResult_BuiltCommitmentTransactionDecodeErrorZPtr contents;
1294 * Whether this CResult_BuiltCommitmentTransactionDecodeErrorZ represents a success state.
1297 } LDKCResult_BuiltCommitmentTransactionDecodeErrorZ;
1302 * A wrapper on ClosingTransaction indicating that the built bitcoin
1303 * transaction is trusted.
1305 * See trust() and verify() functions on CommitmentTransaction.
1307 * This structure implements Deref.
1309 typedef struct MUST_USE_STRUCT LDKTrustedClosingTransaction {
1311 * A pointer to the opaque Rust object.
1312 * Nearly everywhere, inner must be non-null, however in places where
1313 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1315 LDKnativeTrustedClosingTransaction *inner;
1317 * Indicates that this is the only struct which contains the same pointer.
1318 * Rust functions which take ownership of an object provided via an argument require
1319 * this to be true and invalidate the object pointed to by inner.
1322 } LDKTrustedClosingTransaction;
1325 * The contents of CResult_TrustedClosingTransactionNoneZ
1327 typedef union LDKCResult_TrustedClosingTransactionNoneZPtr {
1329 * A pointer to the contents in the success state.
1330 * Reading from this pointer when `result_ok` is not set is undefined.
1332 struct LDKTrustedClosingTransaction *result;
1334 * Note that this value is always NULL, as there are no contents in the Err variant
1337 } LDKCResult_TrustedClosingTransactionNoneZPtr;
1340 * A CResult_TrustedClosingTransactionNoneZ represents the result of a fallible operation,
1341 * containing a crate::lightning::ln::chan_utils::TrustedClosingTransaction on success and a () on failure.
1342 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1344 typedef struct LDKCResult_TrustedClosingTransactionNoneZ {
1346 * The contents of this CResult_TrustedClosingTransactionNoneZ, accessible via either
1347 * `err` or `result` depending on the state of `result_ok`.
1349 union LDKCResult_TrustedClosingTransactionNoneZPtr contents;
1351 * Whether this CResult_TrustedClosingTransactionNoneZ represents a success state.
1354 } LDKCResult_TrustedClosingTransactionNoneZ;
1359 * This class tracks the per-transaction information needed to build a commitment transaction and will
1360 * actually build it and sign. It is used for holder transactions that we sign only when needed
1361 * and for transactions we sign for the counterparty.
1363 * This class can be used inside a signer implementation to generate a signature given the relevant
1366 typedef struct MUST_USE_STRUCT LDKCommitmentTransaction {
1368 * A pointer to the opaque Rust object.
1369 * Nearly everywhere, inner must be non-null, however in places where
1370 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1372 LDKnativeCommitmentTransaction *inner;
1374 * Indicates that this is the only struct which contains the same pointer.
1375 * Rust functions which take ownership of an object provided via an argument require
1376 * this to be true and invalidate the object pointed to by inner.
1379 } LDKCommitmentTransaction;
1382 * The contents of CResult_CommitmentTransactionDecodeErrorZ
1384 typedef union LDKCResult_CommitmentTransactionDecodeErrorZPtr {
1386 * A pointer to the contents in the success state.
1387 * Reading from this pointer when `result_ok` is not set is undefined.
1389 struct LDKCommitmentTransaction *result;
1391 * A pointer to the contents in the error state.
1392 * Reading from this pointer when `result_ok` is set is undefined.
1394 struct LDKDecodeError *err;
1395 } LDKCResult_CommitmentTransactionDecodeErrorZPtr;
1398 * A CResult_CommitmentTransactionDecodeErrorZ represents the result of a fallible operation,
1399 * containing a crate::lightning::ln::chan_utils::CommitmentTransaction on success and a crate::lightning::ln::msgs::DecodeError on failure.
1400 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1402 typedef struct LDKCResult_CommitmentTransactionDecodeErrorZ {
1404 * The contents of this CResult_CommitmentTransactionDecodeErrorZ, accessible via either
1405 * `err` or `result` depending on the state of `result_ok`.
1407 union LDKCResult_CommitmentTransactionDecodeErrorZPtr contents;
1409 * Whether this CResult_CommitmentTransactionDecodeErrorZ represents a success state.
1412 } LDKCResult_CommitmentTransactionDecodeErrorZ;
1417 * A wrapper on CommitmentTransaction indicating that the derived fields (the built bitcoin
1418 * transaction and the transaction creation keys) are trusted.
1420 * See trust() and verify() functions on CommitmentTransaction.
1422 * This structure implements Deref.
1424 typedef struct MUST_USE_STRUCT LDKTrustedCommitmentTransaction {
1426 * A pointer to the opaque Rust object.
1427 * Nearly everywhere, inner must be non-null, however in places where
1428 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1430 LDKnativeTrustedCommitmentTransaction *inner;
1432 * Indicates that this is the only struct which contains the same pointer.
1433 * Rust functions which take ownership of an object provided via an argument require
1434 * this to be true and invalidate the object pointed to by inner.
1437 } LDKTrustedCommitmentTransaction;
1440 * The contents of CResult_TrustedCommitmentTransactionNoneZ
1442 typedef union LDKCResult_TrustedCommitmentTransactionNoneZPtr {
1444 * A pointer to the contents in the success state.
1445 * Reading from this pointer when `result_ok` is not set is undefined.
1447 struct LDKTrustedCommitmentTransaction *result;
1449 * Note that this value is always NULL, as there are no contents in the Err variant
1452 } LDKCResult_TrustedCommitmentTransactionNoneZPtr;
1455 * A CResult_TrustedCommitmentTransactionNoneZ represents the result of a fallible operation,
1456 * containing a crate::lightning::ln::chan_utils::TrustedCommitmentTransaction on success and a () on failure.
1457 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1459 typedef struct LDKCResult_TrustedCommitmentTransactionNoneZ {
1461 * The contents of this CResult_TrustedCommitmentTransactionNoneZ, accessible via either
1462 * `err` or `result` depending on the state of `result_ok`.
1464 union LDKCResult_TrustedCommitmentTransactionNoneZPtr contents;
1466 * Whether this CResult_TrustedCommitmentTransactionNoneZ represents a success state.
1469 } LDKCResult_TrustedCommitmentTransactionNoneZ;
1472 * The contents of CResult_CVec_SignatureZNoneZ
1474 typedef union LDKCResult_CVec_SignatureZNoneZPtr {
1476 * A pointer to the contents in the success state.
1477 * Reading from this pointer when `result_ok` is not set is undefined.
1479 struct LDKCVec_SignatureZ *result;
1481 * Note that this value is always NULL, as there are no contents in the Err variant
1484 } LDKCResult_CVec_SignatureZNoneZPtr;
1487 * A CResult_CVec_SignatureZNoneZ represents the result of a fallible operation,
1488 * containing a crate::c_types::derived::CVec_SignatureZ on success and a () on failure.
1489 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1491 typedef struct LDKCResult_CVec_SignatureZNoneZ {
1493 * The contents of this CResult_CVec_SignatureZNoneZ, accessible via either
1494 * `err` or `result` depending on the state of `result_ok`.
1496 union LDKCResult_CVec_SignatureZNoneZPtr contents;
1498 * Whether this CResult_CVec_SignatureZNoneZ represents a success state.
1501 } LDKCResult_CVec_SignatureZNoneZ;
1506 * A script pubkey for shutting down a channel as defined by [BOLT #2].
1508 * [BOLT #2]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md
1510 typedef struct MUST_USE_STRUCT LDKShutdownScript {
1512 * A pointer to the opaque Rust object.
1513 * Nearly everywhere, inner must be non-null, however in places where
1514 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1516 LDKnativeShutdownScript *inner;
1518 * Indicates that this is the only struct which contains the same pointer.
1519 * Rust functions which take ownership of an object provided via an argument require
1520 * this to be true and invalidate the object pointed to by inner.
1523 } LDKShutdownScript;
1526 * The contents of CResult_ShutdownScriptDecodeErrorZ
1528 typedef union LDKCResult_ShutdownScriptDecodeErrorZPtr {
1530 * A pointer to the contents in the success state.
1531 * Reading from this pointer when `result_ok` is not set is undefined.
1533 struct LDKShutdownScript *result;
1535 * A pointer to the contents in the error state.
1536 * Reading from this pointer when `result_ok` is set is undefined.
1538 struct LDKDecodeError *err;
1539 } LDKCResult_ShutdownScriptDecodeErrorZPtr;
1542 * A CResult_ShutdownScriptDecodeErrorZ represents the result of a fallible operation,
1543 * containing a crate::lightning::ln::script::ShutdownScript on success and a crate::lightning::ln::msgs::DecodeError on failure.
1544 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1546 typedef struct LDKCResult_ShutdownScriptDecodeErrorZ {
1548 * The contents of this CResult_ShutdownScriptDecodeErrorZ, accessible via either
1549 * `err` or `result` depending on the state of `result_ok`.
1551 union LDKCResult_ShutdownScriptDecodeErrorZPtr contents;
1553 * Whether this CResult_ShutdownScriptDecodeErrorZ represents a success state.
1556 } LDKCResult_ShutdownScriptDecodeErrorZ;
1561 * An error occurring when converting from [`Script`] to [`ShutdownScript`].
1563 typedef struct MUST_USE_STRUCT LDKInvalidShutdownScript {
1565 * A pointer to the opaque Rust object.
1566 * Nearly everywhere, inner must be non-null, however in places where
1567 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1569 LDKnativeInvalidShutdownScript *inner;
1571 * Indicates that this is the only struct which contains the same pointer.
1572 * Rust functions which take ownership of an object provided via an argument require
1573 * this to be true and invalidate the object pointed to by inner.
1576 } LDKInvalidShutdownScript;
1579 * The contents of CResult_ShutdownScriptInvalidShutdownScriptZ
1581 typedef union LDKCResult_ShutdownScriptInvalidShutdownScriptZPtr {
1583 * A pointer to the contents in the success state.
1584 * Reading from this pointer when `result_ok` is not set is undefined.
1586 struct LDKShutdownScript *result;
1588 * A pointer to the contents in the error state.
1589 * Reading from this pointer when `result_ok` is set is undefined.
1591 struct LDKInvalidShutdownScript *err;
1592 } LDKCResult_ShutdownScriptInvalidShutdownScriptZPtr;
1595 * A CResult_ShutdownScriptInvalidShutdownScriptZ represents the result of a fallible operation,
1596 * containing a crate::lightning::ln::script::ShutdownScript on success and a crate::lightning::ln::script::InvalidShutdownScript on failure.
1597 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1599 typedef struct LDKCResult_ShutdownScriptInvalidShutdownScriptZ {
1601 * The contents of this CResult_ShutdownScriptInvalidShutdownScriptZ, accessible via either
1602 * `err` or `result` depending on the state of `result_ok`.
1604 union LDKCResult_ShutdownScriptInvalidShutdownScriptZPtr contents;
1606 * Whether this CResult_ShutdownScriptInvalidShutdownScriptZ represents a success state.
1609 } LDKCResult_ShutdownScriptInvalidShutdownScriptZ;
1612 * Represents a valid secp256k1 public key serialized in "compressed form" as a 33 byte array.
1614 typedef struct LDKPublicKey {
1616 * The bytes of the public key
1618 uint8_t compressed_form[33];
1622 * A dynamically-allocated array of crate::c_types::PublicKeys of arbitrary size.
1623 * This corresponds to std::vector in C++
1625 typedef struct LDKCVec_PublicKeyZ {
1627 * The elements in the array.
1628 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
1630 struct LDKPublicKey *data;
1632 * The number of elements pointed to by `data`.
1635 } LDKCVec_PublicKeyZ;
1640 * Onion messages can be sent and received to blinded paths, which serve to hide the identity of
1643 typedef struct MUST_USE_STRUCT LDKBlindedPath {
1645 * A pointer to the opaque Rust object.
1646 * Nearly everywhere, inner must be non-null, however in places where
1647 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1649 LDKnativeBlindedPath *inner;
1651 * Indicates that this is the only struct which contains the same pointer.
1652 * Rust functions which take ownership of an object provided via an argument require
1653 * this to be true and invalidate the object pointed to by inner.
1659 * The contents of CResult_BlindedPathNoneZ
1661 typedef union LDKCResult_BlindedPathNoneZPtr {
1663 * A pointer to the contents in the success state.
1664 * Reading from this pointer when `result_ok` is not set is undefined.
1666 struct LDKBlindedPath *result;
1668 * Note that this value is always NULL, as there are no contents in the Err variant
1671 } LDKCResult_BlindedPathNoneZPtr;
1674 * A CResult_BlindedPathNoneZ represents the result of a fallible operation,
1675 * containing a crate::lightning::onion_message::blinded_path::BlindedPath on success and a () on failure.
1676 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1678 typedef struct LDKCResult_BlindedPathNoneZ {
1680 * The contents of this CResult_BlindedPathNoneZ, accessible via either
1681 * `err` or `result` depending on the state of `result_ok`.
1683 union LDKCResult_BlindedPathNoneZPtr contents;
1685 * Whether this CResult_BlindedPathNoneZ represents a success state.
1688 } LDKCResult_BlindedPathNoneZ;
1691 * The contents of CResult_BlindedPathDecodeErrorZ
1693 typedef union LDKCResult_BlindedPathDecodeErrorZPtr {
1695 * A pointer to the contents in the success state.
1696 * Reading from this pointer when `result_ok` is not set is undefined.
1698 struct LDKBlindedPath *result;
1700 * A pointer to the contents in the error state.
1701 * Reading from this pointer when `result_ok` is set is undefined.
1703 struct LDKDecodeError *err;
1704 } LDKCResult_BlindedPathDecodeErrorZPtr;
1707 * A CResult_BlindedPathDecodeErrorZ represents the result of a fallible operation,
1708 * containing a crate::lightning::onion_message::blinded_path::BlindedPath on success and a crate::lightning::ln::msgs::DecodeError on failure.
1709 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1711 typedef struct LDKCResult_BlindedPathDecodeErrorZ {
1713 * The contents of this CResult_BlindedPathDecodeErrorZ, accessible via either
1714 * `err` or `result` depending on the state of `result_ok`.
1716 union LDKCResult_BlindedPathDecodeErrorZPtr contents;
1718 * Whether this CResult_BlindedPathDecodeErrorZ represents a success state.
1721 } LDKCResult_BlindedPathDecodeErrorZ;
1726 * Used to construct the blinded hops portion of a blinded path. These hops cannot be identified
1727 * by outside observers and thus can be used to hide the identity of the recipient.
1729 typedef struct MUST_USE_STRUCT LDKBlindedHop {
1731 * A pointer to the opaque Rust object.
1732 * Nearly everywhere, inner must be non-null, however in places where
1733 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1735 LDKnativeBlindedHop *inner;
1737 * Indicates that this is the only struct which contains the same pointer.
1738 * Rust functions which take ownership of an object provided via an argument require
1739 * this to be true and invalidate the object pointed to by inner.
1745 * The contents of CResult_BlindedHopDecodeErrorZ
1747 typedef union LDKCResult_BlindedHopDecodeErrorZPtr {
1749 * A pointer to the contents in the success state.
1750 * Reading from this pointer when `result_ok` is not set is undefined.
1752 struct LDKBlindedHop *result;
1754 * A pointer to the contents in the error state.
1755 * Reading from this pointer when `result_ok` is set is undefined.
1757 struct LDKDecodeError *err;
1758 } LDKCResult_BlindedHopDecodeErrorZPtr;
1761 * A CResult_BlindedHopDecodeErrorZ represents the result of a fallible operation,
1762 * containing a crate::lightning::onion_message::blinded_path::BlindedHop on success and a crate::lightning::ln::msgs::DecodeError on failure.
1763 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1765 typedef struct LDKCResult_BlindedHopDecodeErrorZ {
1767 * The contents of this CResult_BlindedHopDecodeErrorZ, accessible via either
1768 * `err` or `result` depending on the state of `result_ok`.
1770 union LDKCResult_BlindedHopDecodeErrorZPtr contents;
1772 * Whether this CResult_BlindedHopDecodeErrorZ represents a success state.
1775 } LDKCResult_BlindedHopDecodeErrorZ;
1780 * Represents the compressed public key of a node
1782 typedef struct MUST_USE_STRUCT LDKNodeId {
1784 * A pointer to the opaque Rust object.
1785 * Nearly everywhere, inner must be non-null, however in places where
1786 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1788 LDKnativeNodeId *inner;
1790 * Indicates that this is the only struct which contains the same pointer.
1791 * Rust functions which take ownership of an object provided via an argument require
1792 * this to be true and invalidate the object pointed to by inner.
1800 * Proposed use of a channel passed as a parameter to [`Score::channel_penalty_msat`].
1802 typedef struct MUST_USE_STRUCT LDKChannelUsage {
1804 * A pointer to the opaque Rust object.
1805 * Nearly everywhere, inner must be non-null, however in places where
1806 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1808 LDKnativeChannelUsage *inner;
1810 * Indicates that this is the only struct which contains the same pointer.
1811 * Rust functions which take ownership of an object provided via an argument require
1812 * this to be true and invalidate the object pointed to by inner.
1822 typedef struct MUST_USE_STRUCT LDKRouteHop {
1824 * A pointer to the opaque Rust object.
1825 * Nearly everywhere, inner must be non-null, however in places where
1826 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1828 LDKnativeRouteHop *inner;
1830 * Indicates that this is the only struct which contains the same pointer.
1831 * Rust functions which take ownership of an object provided via an argument require
1832 * this to be true and invalidate the object pointed to by inner.
1838 * A dynamically-allocated array of crate::lightning::routing::router::RouteHops of arbitrary size.
1839 * This corresponds to std::vector in C++
1841 typedef struct LDKCVec_RouteHopZ {
1843 * The elements in the array.
1844 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
1846 struct LDKRouteHop *data;
1848 * The number of elements pointed to by `data`.
1851 } LDKCVec_RouteHopZ;
1854 * An interface used to score payment channels for path finding.
1856 *\tScoring is in terms of fees willing to be paid in order to avoid routing through a channel.
1858 typedef struct LDKScore {
1860 * An opaque pointer which is passed to your function implementations as an argument.
1861 * This has no meaning in the LDK, and can be NULL or any other value.
1865 * Returns the fee in msats willing to be paid to avoid routing `send_amt_msat` through the
1866 * given channel in the direction from `source` to `target`.
1868 * The channel's capacity (less any other MPP parts that are also being considered for use in
1869 * the same payment) is given by `capacity_msat`. It may be determined from various sources
1870 * such as a chain data, network gossip, or invoice hints. For invoice hints, a capacity near
1871 * [`u64::max_value`] is given to indicate sufficient capacity for the invoice's full amount.
1872 * Thus, implementations should be overflow-safe.
1874 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);
1876 * Handles updating channel penalties after failing to route through a channel.
1878 void (*payment_path_failed)(void *this_arg, struct LDKCVec_RouteHopZ path, uint64_t short_channel_id);
1880 * Handles updating channel penalties after successfully routing along a path.
1882 void (*payment_path_successful)(void *this_arg, struct LDKCVec_RouteHopZ path);
1884 * Handles updating channel penalties after a probe over the given path failed.
1886 void (*probe_failed)(void *this_arg, struct LDKCVec_RouteHopZ path, uint64_t short_channel_id);
1888 * Handles updating channel penalties after a probe over the given path succeeded.
1890 void (*probe_successful)(void *this_arg, struct LDKCVec_RouteHopZ path);
1892 * Serialize the object into a byte array
1894 struct LDKCVec_u8Z (*write)(const void *this_arg);
1896 * Frees any resources associated with this object given its this_arg pointer.
1897 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
1899 void (*free)(void *this_arg);
1903 * A scorer that is accessed under a lock.
1905 * Needed so that calls to [`Score::channel_penalty_msat`] in [`find_route`] can be made while
1906 * having shared ownership of a scorer but without requiring internal locking in [`Score`]
1907 * implementations. Internal locking would be detrimental to route finding performance and could
1908 * result in [`Score::channel_penalty_msat`] returning a different value for the same channel.
1910 * [`find_route`]: crate::routing::router::find_route
1912 typedef struct LDKLockableScore {
1914 * An opaque pointer which is passed to your function implementations as an argument.
1915 * This has no meaning in the LDK, and can be NULL or any other value.
1919 * Returns the locked scorer.
1921 struct LDKScore (*lock)(const void *this_arg);
1923 * Frees any resources associated with this object given its this_arg pointer.
1924 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
1926 void (*free)(void *this_arg);
1930 * Refers to a scorer that is accessible under lock and also writeable to disk
1932 * We need this trait to be able to pass in a scorer to `lightning-background-processor` that will enable us to
1933 * use the Persister to persist it.
1935 typedef struct LDKWriteableScore {
1937 * An opaque pointer which is passed to your function implementations as an argument.
1938 * This has no meaning in the LDK, and can be NULL or any other value.
1942 * Implementation of LockableScore for this object.
1944 struct LDKLockableScore LockableScore;
1946 * Serialize the object into a byte array
1948 struct LDKCVec_u8Z (*write)(const void *this_arg);
1950 * Frees any resources associated with this object given its this_arg pointer.
1951 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
1953 void (*free)(void *this_arg);
1954 } LDKWriteableScore;
1957 * An enum which can either contain a crate::lightning::routing::scoring::WriteableScore or not
1959 typedef enum LDKCOption_WriteableScoreZ_Tag {
1961 * When we're in this state, this COption_WriteableScoreZ contains a crate::lightning::routing::scoring::WriteableScore
1963 LDKCOption_WriteableScoreZ_Some,
1965 * When we're in this state, this COption_WriteableScoreZ contains nothing
1967 LDKCOption_WriteableScoreZ_None,
1969 * Must be last for serialization purposes
1971 LDKCOption_WriteableScoreZ_Sentinel,
1972 } LDKCOption_WriteableScoreZ_Tag;
1974 typedef struct LDKCOption_WriteableScoreZ {
1975 LDKCOption_WriteableScoreZ_Tag tag;
1978 struct LDKWriteableScore some;
1981 } LDKCOption_WriteableScoreZ;
1984 * The contents of CResult_NoneErrorZ
1986 typedef union LDKCResult_NoneErrorZPtr {
1988 * Note that this value is always NULL, as there are no contents in the OK variant
1992 * A pointer to the contents in the error state.
1993 * Reading from this pointer when `result_ok` is set is undefined.
1995 enum LDKIOError *err;
1996 } LDKCResult_NoneErrorZPtr;
1999 * A CResult_NoneErrorZ represents the result of a fallible operation,
2000 * containing a () on success and a crate::c_types::IOError on failure.
2001 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
2003 typedef struct LDKCResult_NoneErrorZ {
2005 * The contents of this CResult_NoneErrorZ, accessible via either
2006 * `err` or `result` depending on the state of `result_ok`.
2008 union LDKCResult_NoneErrorZPtr contents;
2010 * Whether this CResult_NoneErrorZ represents a success state.
2013 } LDKCResult_NoneErrorZ;
2018 * Details of a channel, as returned by ChannelManager::list_channels and ChannelManager::list_usable_channels
2020 typedef struct MUST_USE_STRUCT LDKChannelDetails {
2022 * A pointer to the opaque Rust object.
2023 * Nearly everywhere, inner must be non-null, however in places where
2024 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2026 LDKnativeChannelDetails *inner;
2028 * Indicates that this is the only struct which contains the same pointer.
2029 * Rust functions which take ownership of an object provided via an argument require
2030 * this to be true and invalidate the object pointed to by inner.
2033 } LDKChannelDetails;
2036 * A dynamically-allocated array of crate::lightning::ln::channelmanager::ChannelDetailss of arbitrary size.
2037 * This corresponds to std::vector in C++
2039 typedef struct LDKCVec_ChannelDetailsZ {
2041 * The elements in the array.
2042 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
2044 struct LDKChannelDetails *data;
2046 * The number of elements pointed to by `data`.
2049 } LDKCVec_ChannelDetailsZ;
2054 * A route directs a payment from the sender (us) to the recipient. If the recipient supports MPP,
2055 * it can take multiple paths. Each path is composed of one or more hops through the network.
2057 typedef struct MUST_USE_STRUCT LDKRoute {
2059 * A pointer to the opaque Rust object.
2060 * Nearly everywhere, inner must be non-null, however in places where
2061 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2063 LDKnativeRoute *inner;
2065 * Indicates that this is the only struct which contains the same pointer.
2066 * Rust functions which take ownership of an object provided via an argument require
2067 * this to be true and invalidate the object pointed to by inner.
2075 * An Err type for failure to process messages.
2077 typedef struct MUST_USE_STRUCT LDKLightningError {
2079 * A pointer to the opaque Rust object.
2080 * Nearly everywhere, inner must be non-null, however in places where
2081 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2083 LDKnativeLightningError *inner;
2085 * Indicates that this is the only struct which contains the same pointer.
2086 * Rust functions which take ownership of an object provided via an argument require
2087 * this to be true and invalidate the object pointed to by inner.
2090 } LDKLightningError;
2093 * The contents of CResult_RouteLightningErrorZ
2095 typedef union LDKCResult_RouteLightningErrorZPtr {
2097 * A pointer to the contents in the success state.
2098 * Reading from this pointer when `result_ok` is not set is undefined.
2100 struct LDKRoute *result;
2102 * A pointer to the contents in the error state.
2103 * Reading from this pointer when `result_ok` is set is undefined.
2105 struct LDKLightningError *err;
2106 } LDKCResult_RouteLightningErrorZPtr;
2109 * A CResult_RouteLightningErrorZ represents the result of a fallible operation,
2110 * containing a crate::lightning::routing::router::Route on success and a crate::lightning::ln::msgs::LightningError on failure.
2111 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
2113 typedef struct LDKCResult_RouteLightningErrorZ {
2115 * The contents of this CResult_RouteLightningErrorZ, accessible via either
2116 * `err` or `result` depending on the state of `result_ok`.
2118 union LDKCResult_RouteLightningErrorZPtr contents;
2120 * Whether this CResult_RouteLightningErrorZ represents a success state.
2123 } LDKCResult_RouteLightningErrorZ;
2126 * An enum which can either contain a u64 or not
2128 typedef enum LDKCOption_u64Z_Tag {
2130 * When we're in this state, this COption_u64Z contains a u64
2132 LDKCOption_u64Z_Some,
2134 * When we're in this state, this COption_u64Z contains nothing
2136 LDKCOption_u64Z_None,
2138 * Must be last for serialization purposes
2140 LDKCOption_u64Z_Sentinel,
2141 } LDKCOption_u64Z_Tag;
2143 typedef struct LDKCOption_u64Z {
2144 LDKCOption_u64Z_Tag tag;
2155 * A data structure for tracking in-flight HTLCs. May be used during pathfinding to account for
2156 * in-use channel liquidity.
2158 typedef struct MUST_USE_STRUCT LDKInFlightHtlcs {
2160 * A pointer to the opaque Rust object.
2161 * Nearly everywhere, inner must be non-null, however in places where
2162 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2164 LDKnativeInFlightHtlcs *inner;
2166 * Indicates that this is the only struct which contains the same pointer.
2167 * Rust functions which take ownership of an object provided via an argument require
2168 * this to be true and invalidate the object pointed to by inner.
2174 * The contents of CResult_InFlightHtlcsDecodeErrorZ
2176 typedef union LDKCResult_InFlightHtlcsDecodeErrorZPtr {
2178 * A pointer to the contents in the success state.
2179 * Reading from this pointer when `result_ok` is not set is undefined.
2181 struct LDKInFlightHtlcs *result;
2183 * A pointer to the contents in the error state.
2184 * Reading from this pointer when `result_ok` is set is undefined.
2186 struct LDKDecodeError *err;
2187 } LDKCResult_InFlightHtlcsDecodeErrorZPtr;
2190 * A CResult_InFlightHtlcsDecodeErrorZ represents the result of a fallible operation,
2191 * containing a crate::lightning::routing::router::InFlightHtlcs on success and a crate::lightning::ln::msgs::DecodeError on failure.
2192 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
2194 typedef struct LDKCResult_InFlightHtlcsDecodeErrorZ {
2196 * The contents of this CResult_InFlightHtlcsDecodeErrorZ, accessible via either
2197 * `err` or `result` depending on the state of `result_ok`.
2199 union LDKCResult_InFlightHtlcsDecodeErrorZPtr contents;
2201 * Whether this CResult_InFlightHtlcsDecodeErrorZ represents a success state.
2204 } LDKCResult_InFlightHtlcsDecodeErrorZ;
2207 * The contents of CResult_RouteHopDecodeErrorZ
2209 typedef union LDKCResult_RouteHopDecodeErrorZPtr {
2211 * A pointer to the contents in the success state.
2212 * Reading from this pointer when `result_ok` is not set is undefined.
2214 struct LDKRouteHop *result;
2216 * A pointer to the contents in the error state.
2217 * Reading from this pointer when `result_ok` is set is undefined.
2219 struct LDKDecodeError *err;
2220 } LDKCResult_RouteHopDecodeErrorZPtr;
2223 * A CResult_RouteHopDecodeErrorZ represents the result of a fallible operation,
2224 * containing a crate::lightning::routing::router::RouteHop on success and a crate::lightning::ln::msgs::DecodeError on failure.
2225 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
2227 typedef struct LDKCResult_RouteHopDecodeErrorZ {
2229 * The contents of this CResult_RouteHopDecodeErrorZ, accessible via either
2230 * `err` or `result` depending on the state of `result_ok`.
2232 union LDKCResult_RouteHopDecodeErrorZPtr contents;
2234 * Whether this CResult_RouteHopDecodeErrorZ represents a success state.
2237 } LDKCResult_RouteHopDecodeErrorZ;
2240 * A dynamically-allocated array of crate::c_types::derived::CVec_RouteHopZs of arbitrary size.
2241 * This corresponds to std::vector in C++
2243 typedef struct LDKCVec_CVec_RouteHopZZ {
2245 * The elements in the array.
2246 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
2248 struct LDKCVec_RouteHopZ *data;
2250 * The number of elements pointed to by `data`.
2253 } LDKCVec_CVec_RouteHopZZ;
2256 * The contents of CResult_RouteDecodeErrorZ
2258 typedef union LDKCResult_RouteDecodeErrorZPtr {
2260 * A pointer to the contents in the success state.
2261 * Reading from this pointer when `result_ok` is not set is undefined.
2263 struct LDKRoute *result;
2265 * A pointer to the contents in the error state.
2266 * Reading from this pointer when `result_ok` is set is undefined.
2268 struct LDKDecodeError *err;
2269 } LDKCResult_RouteDecodeErrorZPtr;
2272 * A CResult_RouteDecodeErrorZ represents the result of a fallible operation,
2273 * containing a crate::lightning::routing::router::Route on success and a crate::lightning::ln::msgs::DecodeError on failure.
2274 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
2276 typedef struct LDKCResult_RouteDecodeErrorZ {
2278 * The contents of this CResult_RouteDecodeErrorZ, accessible via either
2279 * `err` or `result` depending on the state of `result_ok`.
2281 union LDKCResult_RouteDecodeErrorZPtr contents;
2283 * Whether this CResult_RouteDecodeErrorZ represents a success state.
2286 } LDKCResult_RouteDecodeErrorZ;
2291 * Parameters needed to find a [`Route`].
2293 * Passed to [`find_route`] and [`build_route_from_hops`], but also provided in
2294 * [`Event::PaymentPathFailed`] for retrying a failed payment path.
2296 * [`Event::PaymentPathFailed`]: crate::util::events::Event::PaymentPathFailed
2298 typedef struct MUST_USE_STRUCT LDKRouteParameters {
2300 * A pointer to the opaque Rust object.
2301 * Nearly everywhere, inner must be non-null, however in places where
2302 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2304 LDKnativeRouteParameters *inner;
2306 * Indicates that this is the only struct which contains the same pointer.
2307 * Rust functions which take ownership of an object provided via an argument require
2308 * this to be true and invalidate the object pointed to by inner.
2311 } LDKRouteParameters;
2314 * The contents of CResult_RouteParametersDecodeErrorZ
2316 typedef union LDKCResult_RouteParametersDecodeErrorZPtr {
2318 * A pointer to the contents in the success state.
2319 * Reading from this pointer when `result_ok` is not set is undefined.
2321 struct LDKRouteParameters *result;
2323 * A pointer to the contents in the error state.
2324 * Reading from this pointer when `result_ok` is set is undefined.
2326 struct LDKDecodeError *err;
2327 } LDKCResult_RouteParametersDecodeErrorZPtr;
2330 * A CResult_RouteParametersDecodeErrorZ represents the result of a fallible operation,
2331 * containing a crate::lightning::routing::router::RouteParameters on success and a crate::lightning::ln::msgs::DecodeError on failure.
2332 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
2334 typedef struct LDKCResult_RouteParametersDecodeErrorZ {
2336 * The contents of this CResult_RouteParametersDecodeErrorZ, accessible via either
2337 * `err` or `result` depending on the state of `result_ok`.
2339 union LDKCResult_RouteParametersDecodeErrorZPtr contents;
2341 * Whether this CResult_RouteParametersDecodeErrorZ represents a success state.
2344 } LDKCResult_RouteParametersDecodeErrorZ;
2349 * A list of hops along a payment path terminating with a channel to the recipient.
2351 typedef struct MUST_USE_STRUCT LDKRouteHint {
2353 * A pointer to the opaque Rust object.
2354 * Nearly everywhere, inner must be non-null, however in places where
2355 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2357 LDKnativeRouteHint *inner;
2359 * Indicates that this is the only struct which contains the same pointer.
2360 * Rust functions which take ownership of an object provided via an argument require
2361 * this to be true and invalidate the object pointed to by inner.
2367 * A dynamically-allocated array of crate::lightning::routing::router::RouteHints of arbitrary size.
2368 * This corresponds to std::vector in C++
2370 typedef struct LDKCVec_RouteHintZ {
2372 * The elements in the array.
2373 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
2375 struct LDKRouteHint *data;
2377 * The number of elements pointed to by `data`.
2380 } LDKCVec_RouteHintZ;
2383 * A dynamically-allocated array of u64s of arbitrary size.
2384 * This corresponds to std::vector in C++
2386 typedef struct LDKCVec_u64Z {
2388 * The elements in the array.
2389 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
2393 * The number of elements pointed to by `data`.
2401 * The recipient of a payment.
2403 typedef struct MUST_USE_STRUCT LDKPaymentParameters {
2405 * A pointer to the opaque Rust object.
2406 * Nearly everywhere, inner must be non-null, however in places where
2407 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2409 LDKnativePaymentParameters *inner;
2411 * Indicates that this is the only struct which contains the same pointer.
2412 * Rust functions which take ownership of an object provided via an argument require
2413 * this to be true and invalidate the object pointed to by inner.
2416 } LDKPaymentParameters;
2419 * The contents of CResult_PaymentParametersDecodeErrorZ
2421 typedef union LDKCResult_PaymentParametersDecodeErrorZPtr {
2423 * A pointer to the contents in the success state.
2424 * Reading from this pointer when `result_ok` is not set is undefined.
2426 struct LDKPaymentParameters *result;
2428 * A pointer to the contents in the error state.
2429 * Reading from this pointer when `result_ok` is set is undefined.
2431 struct LDKDecodeError *err;
2432 } LDKCResult_PaymentParametersDecodeErrorZPtr;
2435 * A CResult_PaymentParametersDecodeErrorZ represents the result of a fallible operation,
2436 * containing a crate::lightning::routing::router::PaymentParameters on success and a crate::lightning::ln::msgs::DecodeError on failure.
2437 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
2439 typedef struct LDKCResult_PaymentParametersDecodeErrorZ {
2441 * The contents of this CResult_PaymentParametersDecodeErrorZ, accessible via either
2442 * `err` or `result` depending on the state of `result_ok`.
2444 union LDKCResult_PaymentParametersDecodeErrorZPtr contents;
2446 * Whether this CResult_PaymentParametersDecodeErrorZ represents a success state.
2449 } LDKCResult_PaymentParametersDecodeErrorZ;
2454 * A channel descriptor for a hop along a payment path.
2456 typedef struct MUST_USE_STRUCT LDKRouteHintHop {
2458 * A pointer to the opaque Rust object.
2459 * Nearly everywhere, inner must be non-null, however in places where
2460 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2462 LDKnativeRouteHintHop *inner;
2464 * Indicates that this is the only struct which contains the same pointer.
2465 * Rust functions which take ownership of an object provided via an argument require
2466 * this to be true and invalidate the object pointed to by inner.
2472 * A dynamically-allocated array of crate::lightning::routing::router::RouteHintHops of arbitrary size.
2473 * This corresponds to std::vector in C++
2475 typedef struct LDKCVec_RouteHintHopZ {
2477 * The elements in the array.
2478 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
2480 struct LDKRouteHintHop *data;
2482 * The number of elements pointed to by `data`.
2485 } LDKCVec_RouteHintHopZ;
2488 * The contents of CResult_RouteHintDecodeErrorZ
2490 typedef union LDKCResult_RouteHintDecodeErrorZPtr {
2492 * A pointer to the contents in the success state.
2493 * Reading from this pointer when `result_ok` is not set is undefined.
2495 struct LDKRouteHint *result;
2497 * A pointer to the contents in the error state.
2498 * Reading from this pointer when `result_ok` is set is undefined.
2500 struct LDKDecodeError *err;
2501 } LDKCResult_RouteHintDecodeErrorZPtr;
2504 * A CResult_RouteHintDecodeErrorZ represents the result of a fallible operation,
2505 * containing a crate::lightning::routing::router::RouteHint on success and a crate::lightning::ln::msgs::DecodeError on failure.
2506 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
2508 typedef struct LDKCResult_RouteHintDecodeErrorZ {
2510 * The contents of this CResult_RouteHintDecodeErrorZ, accessible via either
2511 * `err` or `result` depending on the state of `result_ok`.
2513 union LDKCResult_RouteHintDecodeErrorZPtr contents;
2515 * Whether this CResult_RouteHintDecodeErrorZ represents a success state.
2518 } LDKCResult_RouteHintDecodeErrorZ;
2521 * The contents of CResult_RouteHintHopDecodeErrorZ
2523 typedef union LDKCResult_RouteHintHopDecodeErrorZPtr {
2525 * A pointer to the contents in the success state.
2526 * Reading from this pointer when `result_ok` is not set is undefined.
2528 struct LDKRouteHintHop *result;
2530 * A pointer to the contents in the error state.
2531 * Reading from this pointer when `result_ok` is set is undefined.
2533 struct LDKDecodeError *err;
2534 } LDKCResult_RouteHintHopDecodeErrorZPtr;
2537 * A CResult_RouteHintHopDecodeErrorZ represents the result of a fallible operation,
2538 * containing a crate::lightning::routing::router::RouteHintHop on success and a crate::lightning::ln::msgs::DecodeError on failure.
2539 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
2541 typedef struct LDKCResult_RouteHintHopDecodeErrorZ {
2543 * The contents of this CResult_RouteHintHopDecodeErrorZ, accessible via either
2544 * `err` or `result` depending on the state of `result_ok`.
2546 union LDKCResult_RouteHintHopDecodeErrorZPtr contents;
2548 * Whether this CResult_RouteHintHopDecodeErrorZ represents a success state.
2551 } LDKCResult_RouteHintHopDecodeErrorZ;
2554 * Some information provided on receipt of payment depends on whether the payment received is a
2555 * spontaneous payment or a \"conventional\" lightning payment that's paying an invoice.
2557 typedef enum LDKPaymentPurpose_Tag {
2559 * Information for receiving a payment that we generated an invoice for.
2561 LDKPaymentPurpose_InvoicePayment,
2563 * Because this is a spontaneous payment, the payer generated their own preimage rather than us
2564 * (the payee) providing a preimage.
2566 LDKPaymentPurpose_SpontaneousPayment,
2568 * Must be last for serialization purposes
2570 LDKPaymentPurpose_Sentinel,
2571 } LDKPaymentPurpose_Tag;
2573 typedef struct LDKPaymentPurpose_LDKInvoicePayment_Body {
2575 * The preimage to the payment_hash, if the payment hash (and secret) were fetched via
2576 * [`ChannelManager::create_inbound_payment`]. If provided, this can be handed directly to
2577 * [`ChannelManager::claim_funds`].
2579 * [`ChannelManager::create_inbound_payment`]: crate::ln::channelmanager::ChannelManager::create_inbound_payment
2580 * [`ChannelManager::claim_funds`]: crate::ln::channelmanager::ChannelManager::claim_funds
2582 * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
2584 struct LDKThirtyTwoBytes payment_preimage;
2586 * The \"payment secret\". This authenticates the sender to the recipient, preventing a
2587 * number of deanonymization attacks during the routing process.
2588 * It is provided here for your reference, however its accuracy is enforced directly by
2589 * [`ChannelManager`] using the values you previously provided to
2590 * [`ChannelManager::create_inbound_payment`] or
2591 * [`ChannelManager::create_inbound_payment_for_hash`].
2593 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
2594 * [`ChannelManager::create_inbound_payment`]: crate::ln::channelmanager::ChannelManager::create_inbound_payment
2595 * [`ChannelManager::create_inbound_payment_for_hash`]: crate::ln::channelmanager::ChannelManager::create_inbound_payment_for_hash
2597 struct LDKThirtyTwoBytes payment_secret;
2598 } LDKPaymentPurpose_LDKInvoicePayment_Body;
2600 typedef struct MUST_USE_STRUCT LDKPaymentPurpose {
2601 LDKPaymentPurpose_Tag tag;
2603 LDKPaymentPurpose_LDKInvoicePayment_Body invoice_payment;
2605 struct LDKThirtyTwoBytes spontaneous_payment;
2608 } LDKPaymentPurpose;
2611 * The contents of CResult_PaymentPurposeDecodeErrorZ
2613 typedef union LDKCResult_PaymentPurposeDecodeErrorZPtr {
2615 * A pointer to the contents in the success state.
2616 * Reading from this pointer when `result_ok` is not set is undefined.
2618 struct LDKPaymentPurpose *result;
2620 * A pointer to the contents in the error state.
2621 * Reading from this pointer when `result_ok` is set is undefined.
2623 struct LDKDecodeError *err;
2624 } LDKCResult_PaymentPurposeDecodeErrorZPtr;
2627 * A CResult_PaymentPurposeDecodeErrorZ represents the result of a fallible operation,
2628 * containing a crate::lightning::util::events::PaymentPurpose on success and a crate::lightning::ln::msgs::DecodeError on failure.
2629 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
2631 typedef struct LDKCResult_PaymentPurposeDecodeErrorZ {
2633 * The contents of this CResult_PaymentPurposeDecodeErrorZ, accessible via either
2634 * `err` or `result` depending on the state of `result_ok`.
2636 union LDKCResult_PaymentPurposeDecodeErrorZPtr contents;
2638 * Whether this CResult_PaymentPurposeDecodeErrorZ represents a success state.
2641 } LDKCResult_PaymentPurposeDecodeErrorZ;
2644 * The reason the channel was closed. See individual variants more details.
2646 typedef enum LDKClosureReason_Tag {
2648 * Closure generated from receiving a peer error message.
2650 * Our counterparty may have broadcasted their latest commitment state, and we have
2653 LDKClosureReason_CounterpartyForceClosed,
2655 * Closure generated from [`ChannelManager::force_close_channel`], called by the user.
2657 * [`ChannelManager::force_close_channel`]: crate::ln::channelmanager::ChannelManager::force_close_channel.
2659 LDKClosureReason_HolderForceClosed,
2661 * The channel was closed after negotiating a cooperative close and we've now broadcasted
2662 * the cooperative close transaction. Note the shutdown may have been initiated by us.
2664 LDKClosureReason_CooperativeClosure,
2666 * A commitment transaction was confirmed on chain, closing the channel. Most likely this
2667 * commitment transaction came from our counterparty, but it may also have come from
2668 * a copy of our own `ChannelMonitor`.
2670 LDKClosureReason_CommitmentTxConfirmed,
2672 * The funding transaction failed to confirm in a timely manner on an inbound channel.
2674 LDKClosureReason_FundingTimedOut,
2676 * Closure generated from processing an event, likely a HTLC forward/relay/reception.
2678 LDKClosureReason_ProcessingError,
2680 * The peer disconnected prior to funding completing. In this case the spec mandates that we
2681 * forget the channel entirely - we can attempt again if the peer reconnects.
2683 * This includes cases where we restarted prior to funding completion, including prior to the
2684 * initial [`ChannelMonitor`] persistence completing.
2686 * In LDK versions prior to 0.0.107 this could also occur if we were unable to connect to the
2687 * peer because of mutual incompatibility between us and our channel counterparty.
2689 * [`ChannelMonitor`]: crate::chain::channelmonitor::ChannelMonitor
2691 LDKClosureReason_DisconnectedPeer,
2693 * Closure generated from `ChannelManager::read` if the [`ChannelMonitor`] is newer than
2694 * the [`ChannelManager`] deserialized.
2696 * [`ChannelMonitor`]: crate::chain::channelmonitor::ChannelMonitor
2697 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
2699 LDKClosureReason_OutdatedChannelManager,
2701 * Must be last for serialization purposes
2703 LDKClosureReason_Sentinel,
2704 } LDKClosureReason_Tag;
2706 typedef struct LDKClosureReason_LDKCounterpartyForceClosed_Body {
2708 * The error which the peer sent us.
2710 * The string should be sanitized before it is used (e.g emitted to logs
2711 * or printed to stdout). Otherwise, a well crafted error message may exploit
2712 * a security vulnerability in the terminal emulator or the logging subsystem.
2714 struct LDKStr peer_msg;
2715 } LDKClosureReason_LDKCounterpartyForceClosed_Body;
2717 typedef struct LDKClosureReason_LDKProcessingError_Body {
2719 * A developer-readable error message which we generated.
2722 } LDKClosureReason_LDKProcessingError_Body;
2724 typedef struct MUST_USE_STRUCT LDKClosureReason {
2725 LDKClosureReason_Tag tag;
2727 LDKClosureReason_LDKCounterpartyForceClosed_Body counterparty_force_closed;
2728 LDKClosureReason_LDKProcessingError_Body processing_error;
2733 * An enum which can either contain a crate::lightning::util::events::ClosureReason or not
2735 typedef enum LDKCOption_ClosureReasonZ_Tag {
2737 * When we're in this state, this COption_ClosureReasonZ contains a crate::lightning::util::events::ClosureReason
2739 LDKCOption_ClosureReasonZ_Some,
2741 * When we're in this state, this COption_ClosureReasonZ contains nothing
2743 LDKCOption_ClosureReasonZ_None,
2745 * Must be last for serialization purposes
2747 LDKCOption_ClosureReasonZ_Sentinel,
2748 } LDKCOption_ClosureReasonZ_Tag;
2750 typedef struct LDKCOption_ClosureReasonZ {
2751 LDKCOption_ClosureReasonZ_Tag tag;
2754 struct LDKClosureReason some;
2757 } LDKCOption_ClosureReasonZ;
2760 * The contents of CResult_COption_ClosureReasonZDecodeErrorZ
2762 typedef union LDKCResult_COption_ClosureReasonZDecodeErrorZPtr {
2764 * A pointer to the contents in the success state.
2765 * Reading from this pointer when `result_ok` is not set is undefined.
2767 struct LDKCOption_ClosureReasonZ *result;
2769 * A pointer to the contents in the error state.
2770 * Reading from this pointer when `result_ok` is set is undefined.
2772 struct LDKDecodeError *err;
2773 } LDKCResult_COption_ClosureReasonZDecodeErrorZPtr;
2776 * A CResult_COption_ClosureReasonZDecodeErrorZ represents the result of a fallible operation,
2777 * containing a crate::c_types::derived::COption_ClosureReasonZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
2778 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
2780 typedef struct LDKCResult_COption_ClosureReasonZDecodeErrorZ {
2782 * The contents of this CResult_COption_ClosureReasonZDecodeErrorZ, accessible via either
2783 * `err` or `result` depending on the state of `result_ok`.
2785 union LDKCResult_COption_ClosureReasonZDecodeErrorZPtr contents;
2787 * Whether this CResult_COption_ClosureReasonZDecodeErrorZ represents a success state.
2790 } LDKCResult_COption_ClosureReasonZDecodeErrorZ;
2793 * Intended destination of a failed HTLC as indicated in [`Event::HTLCHandlingFailed`].
2795 typedef enum LDKHTLCDestination_Tag {
2797 * We tried forwarding to a channel but failed to do so. An example of such an instance is when
2798 * there is insufficient capacity in our outbound channel.
2800 LDKHTLCDestination_NextHopChannel,
2802 * Scenario where we are unsure of the next node to forward the HTLC to.
2804 LDKHTLCDestination_UnknownNextHop,
2806 * We couldn't forward to the outgoing scid. An example would be attempting to send a duplicate
2809 LDKHTLCDestination_InvalidForward,
2811 * Failure scenario where an HTLC may have been forwarded to be intended for us,
2812 * but is invalid for some reason, so we reject it.
2814 * Some of the reasons may include:
2816 * * Expected MPP amount to claim does not equal HTLC total
2817 * * Claimable amount does not match expected amount
2819 LDKHTLCDestination_FailedPayment,
2821 * Must be last for serialization purposes
2823 LDKHTLCDestination_Sentinel,
2824 } LDKHTLCDestination_Tag;
2826 typedef struct LDKHTLCDestination_LDKNextHopChannel_Body {
2828 * The `node_id` of the next node. For backwards compatibility, this field is
2829 * marked as optional, versions prior to 0.0.110 may not always be able to provide
2830 * counterparty node information.
2832 * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
2834 struct LDKPublicKey node_id;
2836 * The outgoing `channel_id` between us and the next node.
2838 struct LDKThirtyTwoBytes channel_id;
2839 } LDKHTLCDestination_LDKNextHopChannel_Body;
2841 typedef struct LDKHTLCDestination_LDKUnknownNextHop_Body {
2843 * Short channel id we are requesting to forward an HTLC to.
2845 uint64_t requested_forward_scid;
2846 } LDKHTLCDestination_LDKUnknownNextHop_Body;
2848 typedef struct LDKHTLCDestination_LDKInvalidForward_Body {
2850 * Short channel id we are requesting to forward an HTLC to.
2852 uint64_t requested_forward_scid;
2853 } LDKHTLCDestination_LDKInvalidForward_Body;
2855 typedef struct LDKHTLCDestination_LDKFailedPayment_Body {
2857 * The payment hash of the payment we attempted to process.
2859 struct LDKThirtyTwoBytes payment_hash;
2860 } LDKHTLCDestination_LDKFailedPayment_Body;
2862 typedef struct MUST_USE_STRUCT LDKHTLCDestination {
2863 LDKHTLCDestination_Tag tag;
2865 LDKHTLCDestination_LDKNextHopChannel_Body next_hop_channel;
2866 LDKHTLCDestination_LDKUnknownNextHop_Body unknown_next_hop;
2867 LDKHTLCDestination_LDKInvalidForward_Body invalid_forward;
2868 LDKHTLCDestination_LDKFailedPayment_Body failed_payment;
2870 } LDKHTLCDestination;
2873 * An enum which can either contain a crate::lightning::util::events::HTLCDestination or not
2875 typedef enum LDKCOption_HTLCDestinationZ_Tag {
2877 * When we're in this state, this COption_HTLCDestinationZ contains a crate::lightning::util::events::HTLCDestination
2879 LDKCOption_HTLCDestinationZ_Some,
2881 * When we're in this state, this COption_HTLCDestinationZ contains nothing
2883 LDKCOption_HTLCDestinationZ_None,
2885 * Must be last for serialization purposes
2887 LDKCOption_HTLCDestinationZ_Sentinel,
2888 } LDKCOption_HTLCDestinationZ_Tag;
2890 typedef struct LDKCOption_HTLCDestinationZ {
2891 LDKCOption_HTLCDestinationZ_Tag tag;
2894 struct LDKHTLCDestination some;
2897 } LDKCOption_HTLCDestinationZ;
2900 * The contents of CResult_COption_HTLCDestinationZDecodeErrorZ
2902 typedef union LDKCResult_COption_HTLCDestinationZDecodeErrorZPtr {
2904 * A pointer to the contents in the success state.
2905 * Reading from this pointer when `result_ok` is not set is undefined.
2907 struct LDKCOption_HTLCDestinationZ *result;
2909 * A pointer to the contents in the error state.
2910 * Reading from this pointer when `result_ok` is set is undefined.
2912 struct LDKDecodeError *err;
2913 } LDKCResult_COption_HTLCDestinationZDecodeErrorZPtr;
2916 * A CResult_COption_HTLCDestinationZDecodeErrorZ represents the result of a fallible operation,
2917 * containing a crate::c_types::derived::COption_HTLCDestinationZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
2918 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
2920 typedef struct LDKCResult_COption_HTLCDestinationZDecodeErrorZ {
2922 * The contents of this CResult_COption_HTLCDestinationZDecodeErrorZ, accessible via either
2923 * `err` or `result` depending on the state of `result_ok`.
2925 union LDKCResult_COption_HTLCDestinationZDecodeErrorZPtr contents;
2927 * Whether this CResult_COption_HTLCDestinationZDecodeErrorZ represents a success state.
2930 } LDKCResult_COption_HTLCDestinationZDecodeErrorZ;
2933 * An enum which can either contain a crate::c_types::U128 or not
2935 typedef enum LDKCOption_u128Z_Tag {
2937 * When we're in this state, this COption_u128Z contains a crate::c_types::U128
2939 LDKCOption_u128Z_Some,
2941 * When we're in this state, this COption_u128Z contains nothing
2943 LDKCOption_u128Z_None,
2945 * Must be last for serialization purposes
2947 LDKCOption_u128Z_Sentinel,
2948 } LDKCOption_u128Z_Tag;
2950 typedef struct LDKCOption_u128Z {
2951 LDKCOption_u128Z_Tag tag;
2954 struct LDKU128 some;
2962 * A channel_update message to be sent or received from a peer
2964 typedef struct MUST_USE_STRUCT LDKChannelUpdate {
2966 * A pointer to the opaque Rust object.
2967 * Nearly everywhere, inner must be non-null, however in places where
2968 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2970 LDKnativeChannelUpdate *inner;
2972 * Indicates that this is the only struct which contains the same pointer.
2973 * Rust functions which take ownership of an object provided via an argument require
2974 * this to be true and invalidate the object pointed to by inner.
2980 * Update to the [`NetworkGraph`] based on payment failure information conveyed via the Onion
2981 * return packet by a node along the route. See [BOLT #4] for details.
2983 * [BOLT #4]: https://github.com/lightning/bolts/blob/master/04-onion-routing.md
2985 typedef enum LDKNetworkUpdate_Tag {
2987 * An error indicating a `channel_update` messages should be applied via
2988 * [`NetworkGraph::update_channel`].
2990 LDKNetworkUpdate_ChannelUpdateMessage,
2992 * An error indicating that a channel failed to route a payment, which should be applied via
2993 * [`NetworkGraph::channel_failed`].
2995 LDKNetworkUpdate_ChannelFailure,
2997 * An error indicating that a node failed to route a payment, which should be applied via
2998 * [`NetworkGraph::node_failed_permanent`] if permanent.
3000 LDKNetworkUpdate_NodeFailure,
3002 * Must be last for serialization purposes
3004 LDKNetworkUpdate_Sentinel,
3005 } LDKNetworkUpdate_Tag;
3007 typedef struct LDKNetworkUpdate_LDKChannelUpdateMessage_Body {
3009 * The update to apply via [`NetworkGraph::update_channel`].
3011 struct LDKChannelUpdate msg;
3012 } LDKNetworkUpdate_LDKChannelUpdateMessage_Body;
3014 typedef struct LDKNetworkUpdate_LDKChannelFailure_Body {
3016 * The short channel id of the closed channel.
3018 uint64_t short_channel_id;
3020 * Whether the channel should be permanently removed or temporarily disabled until a new
3021 * `channel_update` message is received.
3024 } LDKNetworkUpdate_LDKChannelFailure_Body;
3026 typedef struct LDKNetworkUpdate_LDKNodeFailure_Body {
3028 * The node id of the failed node.
3030 struct LDKPublicKey node_id;
3032 * Whether the node should be permanently removed from consideration or can be restored
3033 * when a new `channel_update` message is received.
3036 } LDKNetworkUpdate_LDKNodeFailure_Body;
3038 typedef struct MUST_USE_STRUCT LDKNetworkUpdate {
3039 LDKNetworkUpdate_Tag tag;
3041 LDKNetworkUpdate_LDKChannelUpdateMessage_Body channel_update_message;
3042 LDKNetworkUpdate_LDKChannelFailure_Body channel_failure;
3043 LDKNetworkUpdate_LDKNodeFailure_Body node_failure;
3048 * An enum which can either contain a crate::lightning::routing::gossip::NetworkUpdate or not
3050 typedef enum LDKCOption_NetworkUpdateZ_Tag {
3052 * When we're in this state, this COption_NetworkUpdateZ contains a crate::lightning::routing::gossip::NetworkUpdate
3054 LDKCOption_NetworkUpdateZ_Some,
3056 * When we're in this state, this COption_NetworkUpdateZ contains nothing
3058 LDKCOption_NetworkUpdateZ_None,
3060 * Must be last for serialization purposes
3062 LDKCOption_NetworkUpdateZ_Sentinel,
3063 } LDKCOption_NetworkUpdateZ_Tag;
3065 typedef struct LDKCOption_NetworkUpdateZ {
3066 LDKCOption_NetworkUpdateZ_Tag tag;
3069 struct LDKNetworkUpdate some;
3072 } LDKCOption_NetworkUpdateZ;
3077 * A reference to a transaction output.
3079 * Differs from bitcoin::blockdata::transaction::OutPoint as the index is a u16 instead of u32
3080 * due to LN's restrictions on index values. Should reduce (possibly) unsafe conversions this way.
3082 typedef struct MUST_USE_STRUCT LDKOutPoint {
3084 * A pointer to the opaque Rust object.
3085 * Nearly everywhere, inner must be non-null, however in places where
3086 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3088 LDKnativeOutPoint *inner;
3090 * Indicates that this is the only struct which contains the same pointer.
3091 * Rust functions which take ownership of an object provided via an argument require
3092 * this to be true and invalidate the object pointed to by inner.
3100 * Information about a spendable output to a P2WSH script.
3102 * See [`SpendableOutputDescriptor::DelayedPaymentOutput`] for more details on how to spend this.
3104 typedef struct MUST_USE_STRUCT LDKDelayedPaymentOutputDescriptor {
3106 * A pointer to the opaque Rust object.
3107 * Nearly everywhere, inner must be non-null, however in places where
3108 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3110 LDKnativeDelayedPaymentOutputDescriptor *inner;
3112 * Indicates that this is the only struct which contains the same pointer.
3113 * Rust functions which take ownership of an object provided via an argument require
3114 * this to be true and invalidate the object pointed to by inner.
3117 } LDKDelayedPaymentOutputDescriptor;
3122 * Information about a spendable output to our \"payment key\".
3124 * See [`SpendableOutputDescriptor::StaticPaymentOutput`] for more details on how to spend this.
3126 typedef struct MUST_USE_STRUCT LDKStaticPaymentOutputDescriptor {
3128 * A pointer to the opaque Rust object.
3129 * Nearly everywhere, inner must be non-null, however in places where
3130 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3132 LDKnativeStaticPaymentOutputDescriptor *inner;
3134 * Indicates that this is the only struct which contains the same pointer.
3135 * Rust functions which take ownership of an object provided via an argument require
3136 * this to be true and invalidate the object pointed to by inner.
3139 } LDKStaticPaymentOutputDescriptor;
3142 * Describes the necessary information to spend a spendable output.
3144 * When on-chain outputs are created by LDK (which our counterparty is not able to claim at any
3145 * point in the future) a [`SpendableOutputs`] event is generated which you must track and be able
3146 * to spend on-chain. The information needed to do this is provided in this enum, including the
3147 * outpoint describing which `txid` and output `index` is available, the full output which exists
3148 * at that `txid`/`index`, and any keys or other information required to sign.
3150 * [`SpendableOutputs`]: crate::util::events::Event::SpendableOutputs
3152 typedef enum LDKSpendableOutputDescriptor_Tag {
3154 * An output to a script which was provided via [`KeysInterface`] directly, either from
3155 * [`get_destination_script`] or [`get_shutdown_scriptpubkey`], thus you should already
3156 * know how to spend it. No secret keys are provided as LDK was never given any key.
3157 * These may include outputs from a transaction punishing our counterparty or claiming an HTLC
3158 * on-chain using the payment preimage or after it has timed out.
3160 * [`get_shutdown_scriptpubkey`]: KeysInterface::get_shutdown_scriptpubkey
3161 * [`get_destination_script`]: KeysInterface::get_shutdown_scriptpubkey
3163 LDKSpendableOutputDescriptor_StaticOutput,
3165 * An output to a P2WSH script which can be spent with a single signature after an `OP_CSV`
3168 * The witness in the spending input should be:
3170 * <BIP 143 signature> <empty vector> (MINIMALIF standard rule) <provided witnessScript>
3173 * Note that the `nSequence` field in the spending input must be set to
3174 * [`DelayedPaymentOutputDescriptor::to_self_delay`] (which means the transaction is not
3175 * broadcastable until at least [`DelayedPaymentOutputDescriptor::to_self_delay`] blocks after
3176 * the outpoint confirms, see [BIP
3177 * 68](https://github.com/bitcoin/bips/blob/master/bip-0068.mediawiki)). Also note that LDK
3178 * won't generate a [`SpendableOutputDescriptor`] until the corresponding block height
3181 * These are generally the result of a \"revocable\" output to us, spendable only by us unless
3182 * it is an output from an old state which we broadcast (which should never happen).
3184 * To derive the delayed payment key which is used to sign this input, you must pass the
3185 * holder [`InMemorySigner::delayed_payment_base_key`] (i.e., the private key which corresponds to the
3186 * [`ChannelPublicKeys::delayed_payment_basepoint`] in [`BaseSign::pubkeys`]) and the provided
3187 * [`DelayedPaymentOutputDescriptor::per_commitment_point`] to [`chan_utils::derive_private_key`]. The public key can be
3188 * generated without the secret key using [`chan_utils::derive_public_key`] and only the
3189 * [`ChannelPublicKeys::delayed_payment_basepoint`] which appears in [`BaseSign::pubkeys`].
3191 * To derive the [`DelayedPaymentOutputDescriptor::revocation_pubkey`] provided here (which is
3192 * used in the witness script generation), you must pass the counterparty
3193 * [`ChannelPublicKeys::revocation_basepoint`] (which appears in the call to
3194 * [`BaseSign::provide_channel_parameters`]) and the provided
3195 * [`DelayedPaymentOutputDescriptor::per_commitment_point`] to
3196 * [`chan_utils::derive_public_revocation_key`].
3198 * The witness script which is hashed and included in the output `script_pubkey` may be
3199 * regenerated by passing the [`DelayedPaymentOutputDescriptor::revocation_pubkey`] (derived
3200 * as explained above), our delayed payment pubkey (derived as explained above), and the
3201 * [`DelayedPaymentOutputDescriptor::to_self_delay`] contained here to
3202 * [`chan_utils::get_revokeable_redeemscript`].
3204 LDKSpendableOutputDescriptor_DelayedPaymentOutput,
3206 * An output to a P2WPKH, spendable exclusively by our payment key (i.e., the private key
3207 * which corresponds to the `payment_point` in [`BaseSign::pubkeys`]). The witness
3208 * in the spending input is, thus, simply:
3210 * <BIP 143 signature> <payment key>
3213 * These are generally the result of our counterparty having broadcast the current state,
3214 * allowing us to claim the non-HTLC-encumbered outputs immediately.
3216 LDKSpendableOutputDescriptor_StaticPaymentOutput,
3218 * Must be last for serialization purposes
3220 LDKSpendableOutputDescriptor_Sentinel,
3221 } LDKSpendableOutputDescriptor_Tag;
3223 typedef struct LDKSpendableOutputDescriptor_LDKStaticOutput_Body {
3225 * The outpoint which is spendable.
3227 struct LDKOutPoint outpoint;
3229 * The output which is referenced by the given outpoint.
3231 struct LDKTxOut output;
3232 } LDKSpendableOutputDescriptor_LDKStaticOutput_Body;
3234 typedef struct MUST_USE_STRUCT LDKSpendableOutputDescriptor {
3235 LDKSpendableOutputDescriptor_Tag tag;
3237 LDKSpendableOutputDescriptor_LDKStaticOutput_Body static_output;
3239 struct LDKDelayedPaymentOutputDescriptor delayed_payment_output;
3242 struct LDKStaticPaymentOutputDescriptor static_payment_output;
3245 } LDKSpendableOutputDescriptor;
3248 * A dynamically-allocated array of crate::lightning::chain::keysinterface::SpendableOutputDescriptors of arbitrary size.
3249 * This corresponds to std::vector in C++
3251 typedef struct LDKCVec_SpendableOutputDescriptorZ {
3253 * The elements in the array.
3254 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
3256 struct LDKSpendableOutputDescriptor *data;
3258 * The number of elements pointed to by `data`.
3261 } LDKCVec_SpendableOutputDescriptorZ;
3266 * Features used within the channel_type field in an OpenChannel message.
3268 * A channel is always of some known \"type\", describing the transaction formats used and the exact
3269 * semantics of our interaction with our peer.
3271 * Note that because a channel is a specific type which is proposed by the opener and accepted by
3272 * the counterparty, only required features are allowed here.
3274 * This is serialized differently from other feature types - it is not prefixed by a length, and
3275 * thus must only appear inside a TLV where its length is known in advance.
3277 typedef struct MUST_USE_STRUCT LDKChannelTypeFeatures {
3279 * A pointer to the opaque Rust object.
3280 * Nearly everywhere, inner must be non-null, however in places where
3281 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3283 LDKnativeChannelTypeFeatures *inner;
3285 * Indicates that this is the only struct which contains the same pointer.
3286 * Rust functions which take ownership of an object provided via an argument require
3287 * this to be true and invalidate the object pointed to by inner.
3290 } LDKChannelTypeFeatures;
3293 * An Event which you should probably take some action in response to.
3295 * Note that while Writeable and Readable are implemented for Event, you probably shouldn't use
3296 * them directly as they don't round-trip exactly (for example FundingGenerationReady is never
3297 * written as it makes no sense to respond to it after reconnecting to peers).
3299 typedef enum LDKEvent_Tag {
3301 * Used to indicate that the client should generate a funding transaction with the given
3302 * parameters and then call [`ChannelManager::funding_transaction_generated`].
3303 * Generated in [`ChannelManager`] message handling.
3304 * Note that *all inputs* in the funding transaction must spend SegWit outputs or your
3305 * counterparty can steal your funds!
3307 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
3308 * [`ChannelManager::funding_transaction_generated`]: crate::ln::channelmanager::ChannelManager::funding_transaction_generated
3310 LDKEvent_FundingGenerationReady,
3312 * Indicates that we've been offered a payment and it needs to be claimed via calling
3313 * [`ChannelManager::claim_funds`] with the preimage given in [`PaymentPurpose`].
3315 * Note that if the preimage is not known, you should call
3316 * [`ChannelManager::fail_htlc_backwards`] to free up resources for this HTLC and avoid
3317 * network congestion.
3318 * If you fail to call either [`ChannelManager::claim_funds`] or
3319 * [`ChannelManager::fail_htlc_backwards`] within the HTLC's timeout, the HTLC will be
3320 * automatically failed.
3323 * LDK will not stop an inbound payment from being paid multiple times, so multiple
3324 * `PaymentClaimable` events may be generated for the same payment.
3327 * This event used to be called `PaymentReceived` in LDK versions 0.0.112 and earlier.
3329 * [`ChannelManager::claim_funds`]: crate::ln::channelmanager::ChannelManager::claim_funds
3330 * [`ChannelManager::fail_htlc_backwards`]: crate::ln::channelmanager::ChannelManager::fail_htlc_backwards
3332 LDKEvent_PaymentClaimable,
3334 * Indicates a payment has been claimed and we've received money!
3336 * This most likely occurs when [`ChannelManager::claim_funds`] has been called in response
3337 * to an [`Event::PaymentClaimable`]. However, if we previously crashed during a
3338 * [`ChannelManager::claim_funds`] call you may see this event without a corresponding
3339 * [`Event::PaymentClaimable`] event.
3342 * LDK will not stop an inbound payment from being paid multiple times, so multiple
3343 * `PaymentClaimable` events may be generated for the same payment. If you then call
3344 * [`ChannelManager::claim_funds`] twice for the same [`Event::PaymentClaimable`] you may get
3345 * multiple `PaymentClaimed` events.
3347 * [`ChannelManager::claim_funds`]: crate::ln::channelmanager::ChannelManager::claim_funds
3349 LDKEvent_PaymentClaimed,
3351 * Indicates an outbound payment we made succeeded (i.e. it made it all the way to its target
3352 * and we got back the payment preimage for it).
3354 * Note for MPP payments: in rare cases, this event may be preceded by a `PaymentPathFailed`
3355 * event. In this situation, you SHOULD treat this payment as having succeeded.
3357 LDKEvent_PaymentSent,
3359 * Indicates an outbound payment failed. Individual [`Event::PaymentPathFailed`] events
3360 * provide failure information for each MPP part in the payment.
3362 * This event is provided once there are no further pending HTLCs for the payment and the
3363 * payment is no longer retryable due to [`ChannelManager::abandon_payment`] having been
3364 * called for the corresponding payment.
3366 * [`ChannelManager::abandon_payment`]: crate::ln::channelmanager::ChannelManager::abandon_payment
3368 LDKEvent_PaymentFailed,
3370 * Indicates that a path for an outbound payment was successful.
3372 * Always generated after [`Event::PaymentSent`] and thus useful for scoring channels. See
3373 * [`Event::PaymentSent`] for obtaining the payment preimage.
3375 LDKEvent_PaymentPathSuccessful,
3377 * Indicates an outbound HTLC we sent failed. Probably some intermediary node dropped
3378 * something. You may wish to retry with a different route.
3380 * If you have given up retrying this payment and wish to fail it, you MUST call
3381 * [`ChannelManager::abandon_payment`] at least once for a given [`PaymentId`] or memory
3382 * related to payment tracking will leak.
3384 * Note that this does *not* indicate that all paths for an MPP payment have failed, see
3385 * [`Event::PaymentFailed`] and [`all_paths_failed`].
3387 * [`ChannelManager::abandon_payment`]: crate::ln::channelmanager::ChannelManager::abandon_payment
3388 * [`all_paths_failed`]: Self::PaymentPathFailed::all_paths_failed
3390 LDKEvent_PaymentPathFailed,
3392 * Indicates that a probe payment we sent returned successful, i.e., only failed at the destination.
3394 LDKEvent_ProbeSuccessful,
3396 * Indicates that a probe payment we sent failed at an intermediary node on the path.
3398 LDKEvent_ProbeFailed,
3400 * Used to indicate that [`ChannelManager::process_pending_htlc_forwards`] should be called at
3401 * a time in the future.
3403 * [`ChannelManager::process_pending_htlc_forwards`]: crate::ln::channelmanager::ChannelManager::process_pending_htlc_forwards
3405 LDKEvent_PendingHTLCsForwardable,
3407 * Used to indicate that we've intercepted an HTLC forward. This event will only be generated if
3408 * you've encoded an intercept scid in the receiver's invoice route hints using
3409 * [`ChannelManager::get_intercept_scid`] and have set [`UserConfig::accept_intercept_htlcs`].
3411 * [`ChannelManager::forward_intercepted_htlc`] or
3412 * [`ChannelManager::fail_intercepted_htlc`] MUST be called in response to this event. See
3413 * their docs for more information.
3415 * [`ChannelManager::get_intercept_scid`]: crate::ln::channelmanager::ChannelManager::get_intercept_scid
3416 * [`UserConfig::accept_intercept_htlcs`]: crate::util::config::UserConfig::accept_intercept_htlcs
3417 * [`ChannelManager::forward_intercepted_htlc`]: crate::ln::channelmanager::ChannelManager::forward_intercepted_htlc
3418 * [`ChannelManager::fail_intercepted_htlc`]: crate::ln::channelmanager::ChannelManager::fail_intercepted_htlc
3420 LDKEvent_HTLCIntercepted,
3422 * Used to indicate that an output which you should know how to spend was confirmed on chain
3423 * and is now spendable.
3424 * Such an output will *not* ever be spent by rust-lightning, and are not at risk of your
3425 * counterparty spending them due to some kind of timeout. Thus, you need to store them
3426 * somewhere and spend them when you create on-chain transactions.
3428 LDKEvent_SpendableOutputs,
3430 * This event is generated when a payment has been successfully forwarded through us and a
3431 * forwarding fee earned.
3433 LDKEvent_PaymentForwarded,
3435 * Used to indicate that a channel with the given `channel_id` is ready to
3436 * be used. This event is emitted either when the funding transaction has been confirmed
3437 * on-chain, or, in case of a 0conf channel, when both parties have confirmed the channel
3440 LDKEvent_ChannelReady,
3442 * Used to indicate that a previously opened channel with the given `channel_id` is in the
3443 * process of closure.
3445 LDKEvent_ChannelClosed,
3447 * Used to indicate to the user that they can abandon the funding transaction and recycle the
3448 * inputs for another purpose.
3450 LDKEvent_DiscardFunding,
3452 * Indicates a request to open a new channel by a peer.
3454 * To accept the request, call [`ChannelManager::accept_inbound_channel`]. To reject the
3455 * request, call [`ChannelManager::force_close_without_broadcasting_txn`].
3457 * The event is only triggered when a new open channel request is received and the
3458 * [`UserConfig::manually_accept_inbound_channels`] config flag is set to true.
3460 * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
3461 * [`ChannelManager::force_close_without_broadcasting_txn`]: crate::ln::channelmanager::ChannelManager::force_close_without_broadcasting_txn
3462 * [`UserConfig::manually_accept_inbound_channels`]: crate::util::config::UserConfig::manually_accept_inbound_channels
3464 LDKEvent_OpenChannelRequest,
3466 * Indicates that the HTLC was accepted, but could not be processed when or after attempting to
3469 * Some scenarios where this event may be sent include:
3470 * * Insufficient capacity in the outbound channel
3471 * * While waiting to forward the HTLC, the channel it is meant to be forwarded through closes
3472 * * When an unknown SCID is requested for forwarding a payment.
3473 * * Claiming an amount for an MPP payment that exceeds the HTLC total
3474 * * The HTLC has timed out
3476 * This event, however, does not get generated if an HTLC fails to meet the forwarding
3477 * requirements (i.e. insufficient fees paid, or a CLTV that is too soon).
3479 LDKEvent_HTLCHandlingFailed,
3481 * Must be last for serialization purposes
3486 typedef struct LDKEvent_LDKFundingGenerationReady_Body {
3488 * The random channel_id we picked which you'll need to pass into
3489 * [`ChannelManager::funding_transaction_generated`].
3491 * [`ChannelManager::funding_transaction_generated`]: crate::ln::channelmanager::ChannelManager::funding_transaction_generated
3493 struct LDKThirtyTwoBytes temporary_channel_id;
3495 * The counterparty's node_id, which you'll need to pass back into
3496 * [`ChannelManager::funding_transaction_generated`].
3498 * [`ChannelManager::funding_transaction_generated`]: crate::ln::channelmanager::ChannelManager::funding_transaction_generated
3500 struct LDKPublicKey counterparty_node_id;
3502 * The value, in satoshis, that the output should have.
3504 uint64_t channel_value_satoshis;
3506 * The script which should be used in the transaction output.
3508 struct LDKCVec_u8Z output_script;
3510 * The `user_channel_id` value passed in to [`ChannelManager::create_channel`], or a
3511 * random value for an inbound channel. This may be zero for objects serialized with LDK
3512 * versions prior to 0.0.113.
3514 * [`ChannelManager::create_channel`]: crate::ln::channelmanager::ChannelManager::create_channel
3516 struct LDKU128 user_channel_id;
3517 } LDKEvent_LDKFundingGenerationReady_Body;
3519 typedef struct LDKEvent_LDKPaymentClaimable_Body {
3521 * The node that will receive the payment after it has been claimed.
3522 * This is useful to identify payments received via [phantom nodes].
3523 * This field will always be filled in when the event was generated by LDK versions
3524 * 0.0.113 and above.
3526 * [phantom nodes]: crate::chain::keysinterface::PhantomKeysManager
3528 * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
3530 struct LDKPublicKey receiver_node_id;
3532 * The hash for which the preimage should be handed to the ChannelManager. Note that LDK will
3533 * not stop you from registering duplicate payment hashes for inbound payments.
3535 struct LDKThirtyTwoBytes payment_hash;
3537 * The value, in thousandths of a satoshi, that this payment is for.
3539 uint64_t amount_msat;
3541 * Information for claiming this received payment, based on whether the purpose of the
3542 * payment is to pay an invoice or to send a spontaneous payment.
3544 struct LDKPaymentPurpose purpose;
3546 * The `channel_id` indicating over which channel we received the payment.
3548 * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
3550 struct LDKThirtyTwoBytes via_channel_id;
3552 * The `user_channel_id` indicating over which channel we received the payment.
3554 struct LDKCOption_u128Z via_user_channel_id;
3555 } LDKEvent_LDKPaymentClaimable_Body;
3557 typedef struct LDKEvent_LDKPaymentClaimed_Body {
3559 * The node that received the payment.
3560 * This is useful to identify payments which were received via [phantom nodes].
3561 * This field will always be filled in when the event was generated by LDK versions
3562 * 0.0.113 and above.
3564 * [phantom nodes]: crate::chain::keysinterface::PhantomKeysManager
3566 * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
3568 struct LDKPublicKey receiver_node_id;
3570 * The payment hash of the claimed payment. Note that LDK will not stop you from
3571 * registering duplicate payment hashes for inbound payments.
3573 struct LDKThirtyTwoBytes payment_hash;
3575 * The value, in thousandths of a satoshi, that this payment is for.
3577 uint64_t amount_msat;
3579 * The purpose of the claimed payment, i.e. whether the payment was for an invoice or a
3580 * spontaneous payment.
3582 struct LDKPaymentPurpose purpose;
3583 } LDKEvent_LDKPaymentClaimed_Body;
3585 typedef struct LDKEvent_LDKPaymentSent_Body {
3587 * The id returned by [`ChannelManager::send_payment`] and used with
3588 * [`ChannelManager::retry_payment`].
3590 * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
3591 * [`ChannelManager::retry_payment`]: crate::ln::channelmanager::ChannelManager::retry_payment
3593 * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
3595 struct LDKThirtyTwoBytes payment_id;
3597 * The preimage to the hash given to ChannelManager::send_payment.
3598 * Note that this serves as a payment receipt, if you wish to have such a thing, you must
3601 struct LDKThirtyTwoBytes payment_preimage;
3603 * The hash that was given to [`ChannelManager::send_payment`].
3605 * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
3607 struct LDKThirtyTwoBytes payment_hash;
3609 * The total fee which was spent at intermediate hops in this payment, across all paths.
3611 * Note that, like [`Route::get_total_fees`] this does *not* include any potential
3612 * overpayment to the recipient node.
3614 * If the recipient or an intermediate node misbehaves and gives us free money, this may
3615 * overstate the amount paid, though this is unlikely.
3617 * [`Route::get_total_fees`]: crate::routing::router::Route::get_total_fees
3619 struct LDKCOption_u64Z fee_paid_msat;
3620 } LDKEvent_LDKPaymentSent_Body;
3622 typedef struct LDKEvent_LDKPaymentFailed_Body {
3624 * The id returned by [`ChannelManager::send_payment`] and used with
3625 * [`ChannelManager::retry_payment`] and [`ChannelManager::abandon_payment`].
3627 * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
3628 * [`ChannelManager::retry_payment`]: crate::ln::channelmanager::ChannelManager::retry_payment
3629 * [`ChannelManager::abandon_payment`]: crate::ln::channelmanager::ChannelManager::abandon_payment
3631 struct LDKThirtyTwoBytes payment_id;
3633 * The hash that was given to [`ChannelManager::send_payment`].
3635 * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
3637 struct LDKThirtyTwoBytes payment_hash;
3638 } LDKEvent_LDKPaymentFailed_Body;
3640 typedef struct LDKEvent_LDKPaymentPathSuccessful_Body {
3642 * The id returned by [`ChannelManager::send_payment`] and used with
3643 * [`ChannelManager::retry_payment`].
3645 * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
3646 * [`ChannelManager::retry_payment`]: crate::ln::channelmanager::ChannelManager::retry_payment
3648 struct LDKThirtyTwoBytes payment_id;
3650 * The hash that was given to [`ChannelManager::send_payment`].
3652 * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
3654 * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
3656 struct LDKThirtyTwoBytes payment_hash;
3658 * The payment path that was successful.
3660 * May contain a closed channel if the HTLC sent along the path was fulfilled on chain.
3662 struct LDKCVec_RouteHopZ path;
3663 } LDKEvent_LDKPaymentPathSuccessful_Body;
3665 typedef struct LDKEvent_LDKPaymentPathFailed_Body {
3667 * The id returned by [`ChannelManager::send_payment`] and used with
3668 * [`ChannelManager::retry_payment`] and [`ChannelManager::abandon_payment`].
3670 * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
3671 * [`ChannelManager::retry_payment`]: crate::ln::channelmanager::ChannelManager::retry_payment
3672 * [`ChannelManager::abandon_payment`]: crate::ln::channelmanager::ChannelManager::abandon_payment
3674 * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
3676 struct LDKThirtyTwoBytes payment_id;
3678 * The hash that was given to [`ChannelManager::send_payment`].
3680 * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
3682 struct LDKThirtyTwoBytes payment_hash;
3684 * Indicates the payment was rejected for some reason by the recipient. This implies that
3685 * the payment has failed, not just the route in question. If this is not set, you may
3686 * retry the payment via a different route.
3688 bool payment_failed_permanently;
3690 * Any failure information conveyed via the Onion return packet by a node along the failed
3693 * Should be applied to the [`NetworkGraph`] so that routing decisions can take into
3694 * account the update.
3696 * [`NetworkGraph`]: crate::routing::gossip::NetworkGraph
3698 struct LDKCOption_NetworkUpdateZ network_update;
3700 * For both single-path and multi-path payments, this is set if all paths of the payment have
3701 * failed. This will be set to false if (1) this is an MPP payment and (2) other parts of the
3702 * larger MPP payment were still in flight when this event was generated.
3704 * Note that if you are retrying individual MPP parts, using this value to determine if a
3705 * payment has fully failed is race-y. Because multiple failures can happen prior to events
3706 * being processed, you may retry in response to a first failure, with a second failure
3707 * (with `all_paths_failed` set) still pending. Then, when the second failure is processed
3708 * you will see `all_paths_failed` set even though the retry of the first failure still
3709 * has an associated in-flight HTLC. See (1) for an example of such a failure.
3711 * If you wish to retry individual MPP parts and learn when a payment has failed, you must
3712 * call [`ChannelManager::abandon_payment`] and wait for a [`Event::PaymentFailed`] event.
3714 * (1) <https://github.com/lightningdevkit/rust-lightning/issues/1164>
3716 * [`ChannelManager::abandon_payment`]: crate::ln::channelmanager::ChannelManager::abandon_payment
3718 bool all_paths_failed;
3720 * The payment path that failed.
3722 struct LDKCVec_RouteHopZ path;
3724 * The channel responsible for the failed payment path.
3726 * Note that for route hints or for the first hop in a path this may be an SCID alias and
3727 * may not refer to a channel in the public network graph. These aliases may also collide
3728 * with channels in the public network graph.
3730 * If this is `Some`, then the corresponding channel should be avoided when the payment is
3731 * retried. May be `None` for older [`Event`] serializations.
3733 struct LDKCOption_u64Z short_channel_id;
3735 * Parameters needed to compute a new [`Route`] when retrying the failed payment path.
3737 * See [`find_route`] for details.
3739 * [`Route`]: crate::routing::router::Route
3740 * [`find_route`]: crate::routing::router::find_route
3742 * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
3744 struct LDKRouteParameters retry;
3745 } LDKEvent_LDKPaymentPathFailed_Body;
3747 typedef struct LDKEvent_LDKProbeSuccessful_Body {
3749 * The id returned by [`ChannelManager::send_probe`].
3751 * [`ChannelManager::send_probe`]: crate::ln::channelmanager::ChannelManager::send_probe
3753 struct LDKThirtyTwoBytes payment_id;
3755 * The hash generated by [`ChannelManager::send_probe`].
3757 * [`ChannelManager::send_probe`]: crate::ln::channelmanager::ChannelManager::send_probe
3759 struct LDKThirtyTwoBytes payment_hash;
3761 * The payment path that was successful.
3763 struct LDKCVec_RouteHopZ path;
3764 } LDKEvent_LDKProbeSuccessful_Body;
3766 typedef struct LDKEvent_LDKProbeFailed_Body {
3768 * The id returned by [`ChannelManager::send_probe`].
3770 * [`ChannelManager::send_probe`]: crate::ln::channelmanager::ChannelManager::send_probe
3772 struct LDKThirtyTwoBytes payment_id;
3774 * The hash generated by [`ChannelManager::send_probe`].
3776 * [`ChannelManager::send_probe`]: crate::ln::channelmanager::ChannelManager::send_probe
3778 struct LDKThirtyTwoBytes payment_hash;
3780 * The payment path that failed.
3782 struct LDKCVec_RouteHopZ path;
3784 * The channel responsible for the failed probe.
3786 * Note that for route hints or for the first hop in a path this may be an SCID alias and
3787 * may not refer to a channel in the public network graph. These aliases may also collide
3788 * with channels in the public network graph.
3790 struct LDKCOption_u64Z short_channel_id;
3791 } LDKEvent_LDKProbeFailed_Body;
3793 typedef struct LDKEvent_LDKPendingHTLCsForwardable_Body {
3795 * The minimum amount of time that should be waited prior to calling
3796 * process_pending_htlc_forwards. To increase the effort required to correlate payments,
3797 * you should wait a random amount of time in roughly the range (now + time_forwardable,
3798 * now + 5*time_forwardable).
3800 uint64_t time_forwardable;
3801 } LDKEvent_LDKPendingHTLCsForwardable_Body;
3803 typedef struct LDKEvent_LDKHTLCIntercepted_Body {
3805 * An id to help LDK identify which HTLC is being forwarded or failed.
3807 struct LDKThirtyTwoBytes intercept_id;
3809 * The fake scid that was programmed as the next hop's scid, generated using
3810 * [`ChannelManager::get_intercept_scid`].
3812 * [`ChannelManager::get_intercept_scid`]: crate::ln::channelmanager::ChannelManager::get_intercept_scid
3814 uint64_t requested_next_hop_scid;
3816 * The payment hash used for this HTLC.
3818 struct LDKThirtyTwoBytes payment_hash;
3820 * How many msats were received on the inbound edge of this HTLC.
3822 uint64_t inbound_amount_msat;
3824 * How many msats the payer intended to route to the next node. Depending on the reason you are
3825 * intercepting this payment, you might take a fee by forwarding less than this amount.
3827 * Note that LDK will NOT check that expected fees were factored into this value. You MUST
3828 * check that whatever fee you want has been included here or subtract it as required. Further,
3829 * LDK will not stop you from forwarding more than you received.
3831 uint64_t expected_outbound_amount_msat;
3832 } LDKEvent_LDKHTLCIntercepted_Body;
3834 typedef struct LDKEvent_LDKSpendableOutputs_Body {
3836 * The outputs which you should store as spendable by you.
3838 struct LDKCVec_SpendableOutputDescriptorZ outputs;
3839 } LDKEvent_LDKSpendableOutputs_Body;
3841 typedef struct LDKEvent_LDKPaymentForwarded_Body {
3843 * The incoming channel between the previous node and us. This is only `None` for events
3844 * generated or serialized by versions prior to 0.0.107.
3846 * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
3848 struct LDKThirtyTwoBytes prev_channel_id;
3850 * The outgoing channel between the next node and us. This is only `None` for events
3851 * generated or serialized by versions prior to 0.0.107.
3853 * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
3855 struct LDKThirtyTwoBytes next_channel_id;
3857 * The fee, in milli-satoshis, which was earned as a result of the payment.
3859 * Note that if we force-closed the channel over which we forwarded an HTLC while the HTLC
3860 * was pending, the amount the next hop claimed will have been rounded down to the nearest
3861 * whole satoshi. Thus, the fee calculated here may be higher than expected as we still
3862 * claimed the full value in millisatoshis from the source. In this case,
3863 * `claim_from_onchain_tx` will be set.
3865 * If the channel which sent us the payment has been force-closed, we will claim the funds
3866 * via an on-chain transaction. In that case we do not yet know the on-chain transaction
3867 * fees which we will spend and will instead set this to `None`. It is possible duplicate
3868 * `PaymentForwarded` events are generated for the same payment iff `fee_earned_msat` is
3871 struct LDKCOption_u64Z fee_earned_msat;
3873 * If this is `true`, the forwarded HTLC was claimed by our counterparty via an on-chain
3876 bool claim_from_onchain_tx;
3877 } LDKEvent_LDKPaymentForwarded_Body;
3879 typedef struct LDKEvent_LDKChannelReady_Body {
3881 * The channel_id of the channel that is ready.
3883 struct LDKThirtyTwoBytes channel_id;
3885 * The `user_channel_id` value passed in to [`ChannelManager::create_channel`] for outbound
3886 * channels, or to [`ChannelManager::accept_inbound_channel`] for inbound channels if
3887 * [`UserConfig::manually_accept_inbound_channels`] config flag is set to true. Otherwise
3888 * `user_channel_id` will be randomized for an inbound channel.
3890 * [`ChannelManager::create_channel`]: crate::ln::channelmanager::ChannelManager::create_channel
3891 * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
3892 * [`UserConfig::manually_accept_inbound_channels`]: crate::util::config::UserConfig::manually_accept_inbound_channels
3894 struct LDKU128 user_channel_id;
3896 * The node_id of the channel counterparty.
3898 struct LDKPublicKey counterparty_node_id;
3900 * The features that this channel will operate with.
3902 struct LDKChannelTypeFeatures channel_type;
3903 } LDKEvent_LDKChannelReady_Body;
3905 typedef struct LDKEvent_LDKChannelClosed_Body {
3907 * The channel_id of the channel which has been closed. Note that on-chain transactions
3908 * resolving the channel are likely still awaiting confirmation.
3910 struct LDKThirtyTwoBytes channel_id;
3912 * The `user_channel_id` value passed in to [`ChannelManager::create_channel`] for outbound
3913 * channels, or to [`ChannelManager::accept_inbound_channel`] for inbound channels if
3914 * [`UserConfig::manually_accept_inbound_channels`] config flag is set to true. Otherwise
3915 * `user_channel_id` will be randomized for inbound channels.
3916 * This may be zero for inbound channels serialized prior to 0.0.113 and will always be
3917 * zero for objects serialized with LDK versions prior to 0.0.102.
3919 * [`ChannelManager::create_channel`]: crate::ln::channelmanager::ChannelManager::create_channel
3920 * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
3921 * [`UserConfig::manually_accept_inbound_channels`]: crate::util::config::UserConfig::manually_accept_inbound_channels
3923 struct LDKU128 user_channel_id;
3925 * The reason the channel was closed.
3927 struct LDKClosureReason reason;
3928 } LDKEvent_LDKChannelClosed_Body;
3930 typedef struct LDKEvent_LDKDiscardFunding_Body {
3932 * The channel_id of the channel which has been closed.
3934 struct LDKThirtyTwoBytes channel_id;
3936 * The full transaction received from the user
3938 struct LDKTransaction transaction;
3939 } LDKEvent_LDKDiscardFunding_Body;
3941 typedef struct LDKEvent_LDKOpenChannelRequest_Body {
3943 * The temporary channel ID of the channel requested to be opened.
3945 * When responding to the request, the `temporary_channel_id` should be passed
3946 * back to the ChannelManager through [`ChannelManager::accept_inbound_channel`] to accept,
3947 * or through [`ChannelManager::force_close_without_broadcasting_txn`] to reject.
3949 * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
3950 * [`ChannelManager::force_close_without_broadcasting_txn`]: crate::ln::channelmanager::ChannelManager::force_close_without_broadcasting_txn
3952 struct LDKThirtyTwoBytes temporary_channel_id;
3954 * The node_id of the counterparty requesting to open the channel.
3956 * When responding to the request, the `counterparty_node_id` should be passed
3957 * back to the `ChannelManager` through [`ChannelManager::accept_inbound_channel`] to
3958 * accept the request, or through [`ChannelManager::force_close_without_broadcasting_txn`] to reject the
3961 * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
3962 * [`ChannelManager::force_close_without_broadcasting_txn`]: crate::ln::channelmanager::ChannelManager::force_close_without_broadcasting_txn
3964 struct LDKPublicKey counterparty_node_id;
3966 * The channel value of the requested channel.
3968 uint64_t funding_satoshis;
3970 * Our starting balance in the channel if the request is accepted, in milli-satoshi.
3974 * The features that this channel will operate with. If you reject the channel, a
3975 * well-behaved counterparty may automatically re-attempt the channel with a new set of
3978 * Note that if [`ChannelTypeFeatures::supports_scid_privacy`] returns true on this type,
3979 * the resulting [`ChannelManager`] will not be readable by versions of LDK prior to
3982 * Furthermore, note that if [`ChannelTypeFeatures::supports_zero_conf`] returns true on this type,
3983 * the resulting [`ChannelManager`] will not be readable by versions of LDK prior to
3984 * 0.0.107. Channels setting this type also need to get manually accepted via
3985 * [`crate::ln::channelmanager::ChannelManager::accept_inbound_channel_from_trusted_peer_0conf`],
3986 * or will be rejected otherwise.
3988 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
3990 struct LDKChannelTypeFeatures channel_type;
3991 } LDKEvent_LDKOpenChannelRequest_Body;
3993 typedef struct LDKEvent_LDKHTLCHandlingFailed_Body {
3995 * The channel over which the HTLC was received.
3997 struct LDKThirtyTwoBytes prev_channel_id;
3999 * Destination of the HTLC that failed to be processed.
4001 struct LDKHTLCDestination failed_next_destination;
4002 } LDKEvent_LDKHTLCHandlingFailed_Body;
4004 typedef struct MUST_USE_STRUCT LDKEvent {
4007 LDKEvent_LDKFundingGenerationReady_Body funding_generation_ready;
4008 LDKEvent_LDKPaymentClaimable_Body payment_claimable;
4009 LDKEvent_LDKPaymentClaimed_Body payment_claimed;
4010 LDKEvent_LDKPaymentSent_Body payment_sent;
4011 LDKEvent_LDKPaymentFailed_Body payment_failed;
4012 LDKEvent_LDKPaymentPathSuccessful_Body payment_path_successful;
4013 LDKEvent_LDKPaymentPathFailed_Body payment_path_failed;
4014 LDKEvent_LDKProbeSuccessful_Body probe_successful;
4015 LDKEvent_LDKProbeFailed_Body probe_failed;
4016 LDKEvent_LDKPendingHTLCsForwardable_Body pending_htl_cs_forwardable;
4017 LDKEvent_LDKHTLCIntercepted_Body htlc_intercepted;
4018 LDKEvent_LDKSpendableOutputs_Body spendable_outputs;
4019 LDKEvent_LDKPaymentForwarded_Body payment_forwarded;
4020 LDKEvent_LDKChannelReady_Body channel_ready;
4021 LDKEvent_LDKChannelClosed_Body channel_closed;
4022 LDKEvent_LDKDiscardFunding_Body discard_funding;
4023 LDKEvent_LDKOpenChannelRequest_Body open_channel_request;
4024 LDKEvent_LDKHTLCHandlingFailed_Body htlc_handling_failed;
4029 * An enum which can either contain a crate::lightning::util::events::Event or not
4031 typedef enum LDKCOption_EventZ_Tag {
4033 * When we're in this state, this COption_EventZ contains a crate::lightning::util::events::Event
4035 LDKCOption_EventZ_Some,
4037 * When we're in this state, this COption_EventZ contains nothing
4039 LDKCOption_EventZ_None,
4041 * Must be last for serialization purposes
4043 LDKCOption_EventZ_Sentinel,
4044 } LDKCOption_EventZ_Tag;
4046 typedef struct LDKCOption_EventZ {
4047 LDKCOption_EventZ_Tag tag;
4050 struct LDKEvent some;
4053 } LDKCOption_EventZ;
4056 * The contents of CResult_COption_EventZDecodeErrorZ
4058 typedef union LDKCResult_COption_EventZDecodeErrorZPtr {
4060 * A pointer to the contents in the success state.
4061 * Reading from this pointer when `result_ok` is not set is undefined.
4063 struct LDKCOption_EventZ *result;
4065 * A pointer to the contents in the error state.
4066 * Reading from this pointer when `result_ok` is set is undefined.
4068 struct LDKDecodeError *err;
4069 } LDKCResult_COption_EventZDecodeErrorZPtr;
4072 * A CResult_COption_EventZDecodeErrorZ represents the result of a fallible operation,
4073 * containing a crate::c_types::derived::COption_EventZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
4074 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4076 typedef struct LDKCResult_COption_EventZDecodeErrorZ {
4078 * The contents of this CResult_COption_EventZDecodeErrorZ, accessible via either
4079 * `err` or `result` depending on the state of `result_ok`.
4081 union LDKCResult_COption_EventZDecodeErrorZPtr contents;
4083 * Whether this CResult_COption_EventZDecodeErrorZ represents a success state.
4086 } LDKCResult_COption_EventZDecodeErrorZ;
4091 * An accept_channel message to be sent or received from a peer
4093 typedef struct MUST_USE_STRUCT LDKAcceptChannel {
4095 * A pointer to the opaque Rust object.
4096 * Nearly everywhere, inner must be non-null, however in places where
4097 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4099 LDKnativeAcceptChannel *inner;
4101 * Indicates that this is the only struct which contains the same pointer.
4102 * Rust functions which take ownership of an object provided via an argument require
4103 * this to be true and invalidate the object pointed to by inner.
4111 * An open_channel message to be sent or received from a peer
4113 typedef struct MUST_USE_STRUCT LDKOpenChannel {
4115 * A pointer to the opaque Rust object.
4116 * Nearly everywhere, inner must be non-null, however in places where
4117 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4119 LDKnativeOpenChannel *inner;
4121 * Indicates that this is the only struct which contains the same pointer.
4122 * Rust functions which take ownership of an object provided via an argument require
4123 * this to be true and invalidate the object pointed to by inner.
4131 * A funding_created message to be sent or received from a peer
4133 typedef struct MUST_USE_STRUCT LDKFundingCreated {
4135 * A pointer to the opaque Rust object.
4136 * Nearly everywhere, inner must be non-null, however in places where
4137 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4139 LDKnativeFundingCreated *inner;
4141 * Indicates that this is the only struct which contains the same pointer.
4142 * Rust functions which take ownership of an object provided via an argument require
4143 * this to be true and invalidate the object pointed to by inner.
4146 } LDKFundingCreated;
4151 * A funding_signed message to be sent or received from a peer
4153 typedef struct MUST_USE_STRUCT LDKFundingSigned {
4155 * A pointer to the opaque Rust object.
4156 * Nearly everywhere, inner must be non-null, however in places where
4157 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4159 LDKnativeFundingSigned *inner;
4161 * Indicates that this is the only struct which contains the same pointer.
4162 * Rust functions which take ownership of an object provided via an argument require
4163 * this to be true and invalidate the object pointed to by inner.
4171 * A channel_ready message to be sent or received from a peer
4173 typedef struct MUST_USE_STRUCT LDKChannelReady {
4175 * A pointer to the opaque Rust object.
4176 * Nearly everywhere, inner must be non-null, however in places where
4177 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4179 LDKnativeChannelReady *inner;
4181 * Indicates that this is the only struct which contains the same pointer.
4182 * Rust functions which take ownership of an object provided via an argument require
4183 * this to be true and invalidate the object pointed to by inner.
4191 * An announcement_signatures message to be sent or received from a peer
4193 typedef struct MUST_USE_STRUCT LDKAnnouncementSignatures {
4195 * A pointer to the opaque Rust object.
4196 * Nearly everywhere, inner must be non-null, however in places where
4197 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4199 LDKnativeAnnouncementSignatures *inner;
4201 * Indicates that this is the only struct which contains the same pointer.
4202 * Rust functions which take ownership of an object provided via an argument require
4203 * this to be true and invalidate the object pointed to by inner.
4206 } LDKAnnouncementSignatures;
4211 * Struct used to return values from revoke_and_ack messages, containing a bunch of commitment
4212 * transaction updates if they were pending.
4214 typedef struct MUST_USE_STRUCT LDKCommitmentUpdate {
4216 * A pointer to the opaque Rust object.
4217 * Nearly everywhere, inner must be non-null, however in places where
4218 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4220 LDKnativeCommitmentUpdate *inner;
4222 * Indicates that this is the only struct which contains the same pointer.
4223 * Rust functions which take ownership of an object provided via an argument require
4224 * this to be true and invalidate the object pointed to by inner.
4227 } LDKCommitmentUpdate;
4232 * A revoke_and_ack message to be sent or received from a peer
4234 typedef struct MUST_USE_STRUCT LDKRevokeAndACK {
4236 * A pointer to the opaque Rust object.
4237 * Nearly everywhere, inner must be non-null, however in places where
4238 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4240 LDKnativeRevokeAndACK *inner;
4242 * Indicates that this is the only struct which contains the same pointer.
4243 * Rust functions which take ownership of an object provided via an argument require
4244 * this to be true and invalidate the object pointed to by inner.
4252 * A closing_signed message to be sent or received from a peer
4254 typedef struct MUST_USE_STRUCT LDKClosingSigned {
4256 * A pointer to the opaque Rust object.
4257 * Nearly everywhere, inner must be non-null, however in places where
4258 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4260 LDKnativeClosingSigned *inner;
4262 * Indicates that this is the only struct which contains the same pointer.
4263 * Rust functions which take ownership of an object provided via an argument require
4264 * this to be true and invalidate the object pointed to by inner.
4272 * A shutdown message to be sent or received from a peer
4274 typedef struct MUST_USE_STRUCT LDKShutdown {
4276 * A pointer to the opaque Rust object.
4277 * Nearly everywhere, inner must be non-null, however in places where
4278 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4280 LDKnativeShutdown *inner;
4282 * Indicates that this is the only struct which contains the same pointer.
4283 * Rust functions which take ownership of an object provided via an argument require
4284 * this to be true and invalidate the object pointed to by inner.
4292 * A channel_reestablish message to be sent or received from a peer
4294 typedef struct MUST_USE_STRUCT LDKChannelReestablish {
4296 * A pointer to the opaque Rust object.
4297 * Nearly everywhere, inner must be non-null, however in places where
4298 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4300 LDKnativeChannelReestablish *inner;
4302 * Indicates that this is the only struct which contains the same pointer.
4303 * Rust functions which take ownership of an object provided via an argument require
4304 * this to be true and invalidate the object pointed to by inner.
4307 } LDKChannelReestablish;
4312 * A channel_announcement message to be sent or received from a peer
4314 typedef struct MUST_USE_STRUCT LDKChannelAnnouncement {
4316 * A pointer to the opaque Rust object.
4317 * Nearly everywhere, inner must be non-null, however in places where
4318 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4320 LDKnativeChannelAnnouncement *inner;
4322 * Indicates that this is the only struct which contains the same pointer.
4323 * Rust functions which take ownership of an object provided via an argument require
4324 * this to be true and invalidate the object pointed to by inner.
4327 } LDKChannelAnnouncement;
4332 * An error message to be sent or received from a peer
4334 typedef struct MUST_USE_STRUCT LDKErrorMessage {
4336 * A pointer to the opaque Rust object.
4337 * Nearly everywhere, inner must be non-null, however in places where
4338 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4340 LDKnativeErrorMessage *inner;
4342 * Indicates that this is the only struct which contains the same pointer.
4343 * Rust functions which take ownership of an object provided via an argument require
4344 * this to be true and invalidate the object pointed to by inner.
4352 * A warning message to be sent or received from a peer
4354 typedef struct MUST_USE_STRUCT LDKWarningMessage {
4356 * A pointer to the opaque Rust object.
4357 * Nearly everywhere, inner must be non-null, however in places where
4358 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4360 LDKnativeWarningMessage *inner;
4362 * Indicates that this is the only struct which contains the same pointer.
4363 * Rust functions which take ownership of an object provided via an argument require
4364 * this to be true and invalidate the object pointed to by inner.
4367 } LDKWarningMessage;
4370 * Used to put an error message in a LightningError
4372 typedef enum LDKErrorAction_Tag {
4374 * The peer took some action which made us think they were useless. Disconnect them.
4376 LDKErrorAction_DisconnectPeer,
4378 * The peer did something harmless that we weren't able to process, just log and ignore
4380 LDKErrorAction_IgnoreError,
4382 * The peer did something harmless that we weren't able to meaningfully process.
4383 * If the error is logged, log it at the given level.
4385 LDKErrorAction_IgnoreAndLog,
4387 * The peer provided us with a gossip message which we'd already seen. In most cases this
4388 * should be ignored, but it may result in the message being forwarded if it is a duplicate of
4389 * our own channel announcements.
4391 LDKErrorAction_IgnoreDuplicateGossip,
4393 * The peer did something incorrect. Tell them.
4395 LDKErrorAction_SendErrorMessage,
4397 * The peer did something incorrect. Tell them without closing any channels.
4399 LDKErrorAction_SendWarningMessage,
4401 * Must be last for serialization purposes
4403 LDKErrorAction_Sentinel,
4404 } LDKErrorAction_Tag;
4406 typedef struct LDKErrorAction_LDKDisconnectPeer_Body {
4408 * An error message which we should make an effort to send before we disconnect.
4410 * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
4412 struct LDKErrorMessage msg;
4413 } LDKErrorAction_LDKDisconnectPeer_Body;
4415 typedef struct LDKErrorAction_LDKSendErrorMessage_Body {
4417 * The message to send.
4419 struct LDKErrorMessage msg;
4420 } LDKErrorAction_LDKSendErrorMessage_Body;
4422 typedef struct LDKErrorAction_LDKSendWarningMessage_Body {
4424 * The message to send.
4426 struct LDKWarningMessage msg;
4428 * The peer may have done something harmless that we weren't able to meaningfully process,
4429 * though we should still tell them about it.
4430 * If this event is logged, log it at the given level.
4432 enum LDKLevel log_level;
4433 } LDKErrorAction_LDKSendWarningMessage_Body;
4435 typedef struct MUST_USE_STRUCT LDKErrorAction {
4436 LDKErrorAction_Tag tag;
4438 LDKErrorAction_LDKDisconnectPeer_Body disconnect_peer;
4440 enum LDKLevel ignore_and_log;
4442 LDKErrorAction_LDKSendErrorMessage_Body send_error_message;
4443 LDKErrorAction_LDKSendWarningMessage_Body send_warning_message;
4450 * A query_channel_range message is used to query a peer for channel
4451 * UTXOs in a range of blocks. The recipient of a query makes a best
4452 * effort to reply to the query using one or more reply_channel_range
4455 typedef struct MUST_USE_STRUCT LDKQueryChannelRange {
4457 * A pointer to the opaque Rust object.
4458 * Nearly everywhere, inner must be non-null, however in places where
4459 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4461 LDKnativeQueryChannelRange *inner;
4463 * Indicates that this is the only struct which contains the same pointer.
4464 * Rust functions which take ownership of an object provided via an argument require
4465 * this to be true and invalidate the object pointed to by inner.
4468 } LDKQueryChannelRange;
4473 * A query_short_channel_ids message is used to query a peer for
4474 * routing gossip messages related to one or more short_channel_ids.
4475 * The query recipient will reply with the latest, if available,
4476 * channel_announcement, channel_update and node_announcement messages
4477 * it maintains for the requested short_channel_ids followed by a
4478 * reply_short_channel_ids_end message. The short_channel_ids sent in
4479 * this query are encoded. We only support encoding_type=0 uncompressed
4480 * serialization and do not support encoding_type=1 zlib serialization.
4482 typedef struct MUST_USE_STRUCT LDKQueryShortChannelIds {
4484 * A pointer to the opaque Rust object.
4485 * Nearly everywhere, inner must be non-null, however in places where
4486 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4488 LDKnativeQueryShortChannelIds *inner;
4490 * Indicates that this is the only struct which contains the same pointer.
4491 * Rust functions which take ownership of an object provided via an argument require
4492 * this to be true and invalidate the object pointed to by inner.
4495 } LDKQueryShortChannelIds;
4500 * A reply_channel_range message is a reply to a query_channel_range
4501 * message. Multiple reply_channel_range messages can be sent in reply
4502 * to a single query_channel_range message. The query recipient makes a
4503 * best effort to respond based on their local network view which may
4504 * not be a perfect view of the network. The short_channel_ids in the
4505 * reply are encoded. We only support encoding_type=0 uncompressed
4506 * serialization and do not support encoding_type=1 zlib serialization.
4508 typedef struct MUST_USE_STRUCT LDKReplyChannelRange {
4510 * A pointer to the opaque Rust object.
4511 * Nearly everywhere, inner must be non-null, however in places where
4512 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4514 LDKnativeReplyChannelRange *inner;
4516 * Indicates that this is the only struct which contains the same pointer.
4517 * Rust functions which take ownership of an object provided via an argument require
4518 * this to be true and invalidate the object pointed to by inner.
4521 } LDKReplyChannelRange;
4526 * A gossip_timestamp_filter message is used by a node to request
4527 * gossip relay for messages in the requested time range when the
4528 * gossip_queries feature has been negotiated.
4530 typedef struct MUST_USE_STRUCT LDKGossipTimestampFilter {
4532 * A pointer to the opaque Rust object.
4533 * Nearly everywhere, inner must be non-null, however in places where
4534 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4536 LDKnativeGossipTimestampFilter *inner;
4538 * Indicates that this is the only struct which contains the same pointer.
4539 * Rust functions which take ownership of an object provided via an argument require
4540 * this to be true and invalidate the object pointed to by inner.
4543 } LDKGossipTimestampFilter;
4546 * An event generated by ChannelManager which indicates a message should be sent to a peer (or
4547 * broadcast to most peers).
4548 * These events are handled by PeerManager::process_events if you are using a PeerManager.
4550 typedef enum LDKMessageSendEvent_Tag {
4552 * Used to indicate that we've accepted a channel open and should send the accept_channel
4553 * message provided to the given peer.
4555 LDKMessageSendEvent_SendAcceptChannel,
4557 * Used to indicate that we've initiated a channel open and should send the open_channel
4558 * message provided to the given peer.
4560 LDKMessageSendEvent_SendOpenChannel,
4562 * Used to indicate that a funding_created message should be sent to the peer with the given node_id.
4564 LDKMessageSendEvent_SendFundingCreated,
4566 * Used to indicate that a funding_signed message should be sent to the peer with the given node_id.
4568 LDKMessageSendEvent_SendFundingSigned,
4570 * Used to indicate that a channel_ready message should be sent to the peer with the given node_id.
4572 LDKMessageSendEvent_SendChannelReady,
4574 * Used to indicate that an announcement_signatures message should be sent to the peer with the given node_id.
4576 LDKMessageSendEvent_SendAnnouncementSignatures,
4578 * Used to indicate that a series of HTLC update messages, as well as a commitment_signed
4579 * message should be sent to the peer with the given node_id.
4581 LDKMessageSendEvent_UpdateHTLCs,
4583 * Used to indicate that a revoke_and_ack message should be sent to the peer with the given node_id.
4585 LDKMessageSendEvent_SendRevokeAndACK,
4587 * Used to indicate that a closing_signed message should be sent to the peer with the given node_id.
4589 LDKMessageSendEvent_SendClosingSigned,
4591 * Used to indicate that a shutdown message should be sent to the peer with the given node_id.
4593 LDKMessageSendEvent_SendShutdown,
4595 * Used to indicate that a channel_reestablish message should be sent to the peer with the given node_id.
4597 LDKMessageSendEvent_SendChannelReestablish,
4599 * Used to send a channel_announcement and channel_update to a specific peer, likely on
4600 * initial connection to ensure our peers know about our channels.
4602 LDKMessageSendEvent_SendChannelAnnouncement,
4604 * Used to indicate that a channel_announcement and channel_update should be broadcast to all
4605 * peers (except the peer with node_id either msg.contents.node_id_1 or msg.contents.node_id_2).
4607 * Note that after doing so, you very likely (unless you did so very recently) want to
4608 * broadcast a node_announcement (e.g. via [`PeerManager::broadcast_node_announcement`]). This
4609 * ensures that any nodes which see our channel_announcement also have a relevant
4610 * node_announcement, including relevant feature flags which may be important for routing
4613 * [`PeerManager::broadcast_node_announcement`]: crate::ln::peer_handler::PeerManager::broadcast_node_announcement
4615 LDKMessageSendEvent_BroadcastChannelAnnouncement,
4617 * Used to indicate that a channel_update should be broadcast to all peers.
4619 LDKMessageSendEvent_BroadcastChannelUpdate,
4621 * Used to indicate that a channel_update should be sent to a single peer.
4622 * In contrast to [`Self::BroadcastChannelUpdate`], this is used when the channel is a
4623 * private channel and we shouldn't be informing all of our peers of channel parameters.
4625 LDKMessageSendEvent_SendChannelUpdate,
4627 * Broadcast an error downstream to be handled
4629 LDKMessageSendEvent_HandleError,
4631 * Query a peer for channels with funding transaction UTXOs in a block range.
4633 LDKMessageSendEvent_SendChannelRangeQuery,
4635 * Request routing gossip messages from a peer for a list of channels identified by
4636 * their short_channel_ids.
4638 LDKMessageSendEvent_SendShortIdsQuery,
4640 * Sends a reply to a channel range query. This may be one of several SendReplyChannelRange events
4641 * emitted during processing of the query.
4643 LDKMessageSendEvent_SendReplyChannelRange,
4645 * Sends a timestamp filter for inbound gossip. This should be sent on each new connection to
4646 * enable receiving gossip messages from the peer.
4648 LDKMessageSendEvent_SendGossipTimestampFilter,
4650 * Must be last for serialization purposes
4652 LDKMessageSendEvent_Sentinel,
4653 } LDKMessageSendEvent_Tag;
4655 typedef struct LDKMessageSendEvent_LDKSendAcceptChannel_Body {
4657 * The node_id of the node which should receive this message
4659 struct LDKPublicKey node_id;
4661 * The message which should be sent.
4663 struct LDKAcceptChannel msg;
4664 } LDKMessageSendEvent_LDKSendAcceptChannel_Body;
4666 typedef struct LDKMessageSendEvent_LDKSendOpenChannel_Body {
4668 * The node_id of the node which should receive this message
4670 struct LDKPublicKey node_id;
4672 * The message which should be sent.
4674 struct LDKOpenChannel msg;
4675 } LDKMessageSendEvent_LDKSendOpenChannel_Body;
4677 typedef struct LDKMessageSendEvent_LDKSendFundingCreated_Body {
4679 * The node_id of the node which should receive this message
4681 struct LDKPublicKey node_id;
4683 * The message which should be sent.
4685 struct LDKFundingCreated msg;
4686 } LDKMessageSendEvent_LDKSendFundingCreated_Body;
4688 typedef struct LDKMessageSendEvent_LDKSendFundingSigned_Body {
4690 * The node_id of the node which should receive this message
4692 struct LDKPublicKey node_id;
4694 * The message which should be sent.
4696 struct LDKFundingSigned msg;
4697 } LDKMessageSendEvent_LDKSendFundingSigned_Body;
4699 typedef struct LDKMessageSendEvent_LDKSendChannelReady_Body {
4701 * The node_id of the node which should receive these message(s)
4703 struct LDKPublicKey node_id;
4705 * The channel_ready message which should be sent.
4707 struct LDKChannelReady msg;
4708 } LDKMessageSendEvent_LDKSendChannelReady_Body;
4710 typedef struct LDKMessageSendEvent_LDKSendAnnouncementSignatures_Body {
4712 * The node_id of the node which should receive these message(s)
4714 struct LDKPublicKey node_id;
4716 * The announcement_signatures message which should be sent.
4718 struct LDKAnnouncementSignatures msg;
4719 } LDKMessageSendEvent_LDKSendAnnouncementSignatures_Body;
4721 typedef struct LDKMessageSendEvent_LDKUpdateHTLCs_Body {
4723 * The node_id of the node which should receive these message(s)
4725 struct LDKPublicKey node_id;
4727 * The update messages which should be sent. ALL messages in the struct should be sent!
4729 struct LDKCommitmentUpdate updates;
4730 } LDKMessageSendEvent_LDKUpdateHTLCs_Body;
4732 typedef struct LDKMessageSendEvent_LDKSendRevokeAndACK_Body {
4734 * The node_id of the node which should receive this message
4736 struct LDKPublicKey node_id;
4738 * The message which should be sent.
4740 struct LDKRevokeAndACK msg;
4741 } LDKMessageSendEvent_LDKSendRevokeAndACK_Body;
4743 typedef struct LDKMessageSendEvent_LDKSendClosingSigned_Body {
4745 * The node_id of the node which should receive this message
4747 struct LDKPublicKey node_id;
4749 * The message which should be sent.
4751 struct LDKClosingSigned msg;
4752 } LDKMessageSendEvent_LDKSendClosingSigned_Body;
4754 typedef struct LDKMessageSendEvent_LDKSendShutdown_Body {
4756 * The node_id of the node which should receive this message
4758 struct LDKPublicKey node_id;
4760 * The message which should be sent.
4762 struct LDKShutdown msg;
4763 } LDKMessageSendEvent_LDKSendShutdown_Body;
4765 typedef struct LDKMessageSendEvent_LDKSendChannelReestablish_Body {
4767 * The node_id of the node which should receive this message
4769 struct LDKPublicKey node_id;
4771 * The message which should be sent.
4773 struct LDKChannelReestablish msg;
4774 } LDKMessageSendEvent_LDKSendChannelReestablish_Body;
4776 typedef struct LDKMessageSendEvent_LDKSendChannelAnnouncement_Body {
4778 * The node_id of the node which should receive this message
4780 struct LDKPublicKey node_id;
4782 * The channel_announcement which should be sent.
4784 struct LDKChannelAnnouncement msg;
4786 * The followup channel_update which should be sent.
4788 struct LDKChannelUpdate update_msg;
4789 } LDKMessageSendEvent_LDKSendChannelAnnouncement_Body;
4791 typedef struct LDKMessageSendEvent_LDKBroadcastChannelAnnouncement_Body {
4793 * The channel_announcement which should be sent.
4795 struct LDKChannelAnnouncement msg;
4797 * The followup channel_update which should be sent.
4799 struct LDKChannelUpdate update_msg;
4800 } LDKMessageSendEvent_LDKBroadcastChannelAnnouncement_Body;
4802 typedef struct LDKMessageSendEvent_LDKBroadcastChannelUpdate_Body {
4804 * The channel_update which should be sent.
4806 struct LDKChannelUpdate msg;
4807 } LDKMessageSendEvent_LDKBroadcastChannelUpdate_Body;
4809 typedef struct LDKMessageSendEvent_LDKSendChannelUpdate_Body {
4811 * The node_id of the node which should receive this message
4813 struct LDKPublicKey node_id;
4815 * The channel_update which should be sent.
4817 struct LDKChannelUpdate msg;
4818 } LDKMessageSendEvent_LDKSendChannelUpdate_Body;
4820 typedef struct LDKMessageSendEvent_LDKHandleError_Body {
4822 * The node_id of the node which should receive this message
4824 struct LDKPublicKey node_id;
4826 * The action which should be taken.
4828 struct LDKErrorAction action;
4829 } LDKMessageSendEvent_LDKHandleError_Body;
4831 typedef struct LDKMessageSendEvent_LDKSendChannelRangeQuery_Body {
4833 * The node_id of this message recipient
4835 struct LDKPublicKey node_id;
4837 * The query_channel_range which should be sent.
4839 struct LDKQueryChannelRange msg;
4840 } LDKMessageSendEvent_LDKSendChannelRangeQuery_Body;
4842 typedef struct LDKMessageSendEvent_LDKSendShortIdsQuery_Body {
4844 * The node_id of this message recipient
4846 struct LDKPublicKey node_id;
4848 * The query_short_channel_ids which should be sent.
4850 struct LDKQueryShortChannelIds msg;
4851 } LDKMessageSendEvent_LDKSendShortIdsQuery_Body;
4853 typedef struct LDKMessageSendEvent_LDKSendReplyChannelRange_Body {
4855 * The node_id of this message recipient
4857 struct LDKPublicKey node_id;
4859 * The reply_channel_range which should be sent.
4861 struct LDKReplyChannelRange msg;
4862 } LDKMessageSendEvent_LDKSendReplyChannelRange_Body;
4864 typedef struct LDKMessageSendEvent_LDKSendGossipTimestampFilter_Body {
4866 * The node_id of this message recipient
4868 struct LDKPublicKey node_id;
4870 * The gossip_timestamp_filter which should be sent.
4872 struct LDKGossipTimestampFilter msg;
4873 } LDKMessageSendEvent_LDKSendGossipTimestampFilter_Body;
4875 typedef struct MUST_USE_STRUCT LDKMessageSendEvent {
4876 LDKMessageSendEvent_Tag tag;
4878 LDKMessageSendEvent_LDKSendAcceptChannel_Body send_accept_channel;
4879 LDKMessageSendEvent_LDKSendOpenChannel_Body send_open_channel;
4880 LDKMessageSendEvent_LDKSendFundingCreated_Body send_funding_created;
4881 LDKMessageSendEvent_LDKSendFundingSigned_Body send_funding_signed;
4882 LDKMessageSendEvent_LDKSendChannelReady_Body send_channel_ready;
4883 LDKMessageSendEvent_LDKSendAnnouncementSignatures_Body send_announcement_signatures;
4884 LDKMessageSendEvent_LDKUpdateHTLCs_Body update_htl_cs;
4885 LDKMessageSendEvent_LDKSendRevokeAndACK_Body send_revoke_and_ack;
4886 LDKMessageSendEvent_LDKSendClosingSigned_Body send_closing_signed;
4887 LDKMessageSendEvent_LDKSendShutdown_Body send_shutdown;
4888 LDKMessageSendEvent_LDKSendChannelReestablish_Body send_channel_reestablish;
4889 LDKMessageSendEvent_LDKSendChannelAnnouncement_Body send_channel_announcement;
4890 LDKMessageSendEvent_LDKBroadcastChannelAnnouncement_Body broadcast_channel_announcement;
4891 LDKMessageSendEvent_LDKBroadcastChannelUpdate_Body broadcast_channel_update;
4892 LDKMessageSendEvent_LDKSendChannelUpdate_Body send_channel_update;
4893 LDKMessageSendEvent_LDKHandleError_Body handle_error;
4894 LDKMessageSendEvent_LDKSendChannelRangeQuery_Body send_channel_range_query;
4895 LDKMessageSendEvent_LDKSendShortIdsQuery_Body send_short_ids_query;
4896 LDKMessageSendEvent_LDKSendReplyChannelRange_Body send_reply_channel_range;
4897 LDKMessageSendEvent_LDKSendGossipTimestampFilter_Body send_gossip_timestamp_filter;
4899 } LDKMessageSendEvent;
4902 * A dynamically-allocated array of crate::lightning::util::events::MessageSendEvents of arbitrary size.
4903 * This corresponds to std::vector in C++
4905 typedef struct LDKCVec_MessageSendEventZ {
4907 * The elements in the array.
4908 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
4910 struct LDKMessageSendEvent *data;
4912 * The number of elements pointed to by `data`.
4915 } LDKCVec_MessageSendEventZ;
4918 * The contents of CResult_TxOutAccessErrorZ
4920 typedef union LDKCResult_TxOutAccessErrorZPtr {
4922 * A pointer to the contents in the success state.
4923 * Reading from this pointer when `result_ok` is not set is undefined.
4925 struct LDKTxOut *result;
4927 * A pointer to the contents in the error state.
4928 * Reading from this pointer when `result_ok` is set is undefined.
4930 enum LDKAccessError *err;
4931 } LDKCResult_TxOutAccessErrorZPtr;
4934 * A CResult_TxOutAccessErrorZ represents the result of a fallible operation,
4935 * containing a crate::c_types::TxOut on success and a crate::lightning::chain::AccessError on failure.
4936 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4938 typedef struct LDKCResult_TxOutAccessErrorZ {
4940 * The contents of this CResult_TxOutAccessErrorZ, accessible via either
4941 * `err` or `result` depending on the state of `result_ok`.
4943 union LDKCResult_TxOutAccessErrorZPtr contents;
4945 * Whether this CResult_TxOutAccessErrorZ represents a success state.
4948 } LDKCResult_TxOutAccessErrorZ;
4951 * A tuple of 2 elements. See the individual fields for the types contained.
4953 typedef struct LDKC2Tuple_usizeTransactionZ {
4955 * The element at position 0
4959 * The element at position 1
4961 struct LDKTransaction b;
4962 } LDKC2Tuple_usizeTransactionZ;
4965 * A dynamically-allocated array of crate::c_types::derived::C2Tuple_usizeTransactionZs of arbitrary size.
4966 * This corresponds to std::vector in C++
4968 typedef struct LDKCVec_C2Tuple_usizeTransactionZZ {
4970 * The elements in the array.
4971 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
4973 struct LDKC2Tuple_usizeTransactionZ *data;
4975 * The number of elements pointed to by `data`.
4978 } LDKCVec_C2Tuple_usizeTransactionZZ;
4981 * A tuple of 2 elements. See the individual fields for the types contained.
4983 typedef struct LDKC2Tuple_TxidBlockHashZ {
4985 * The element at position 0
4987 struct LDKThirtyTwoBytes a;
4989 * The element at position 1
4991 struct LDKThirtyTwoBytes b;
4992 } LDKC2Tuple_TxidBlockHashZ;
4995 * A dynamically-allocated array of crate::c_types::derived::C2Tuple_TxidBlockHashZs of arbitrary size.
4996 * This corresponds to std::vector in C++
4998 typedef struct LDKCVec_C2Tuple_TxidBlockHashZZ {
5000 * The elements in the array.
5001 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
5003 struct LDKC2Tuple_TxidBlockHashZ *data;
5005 * The number of elements pointed to by `data`.
5008 } LDKCVec_C2Tuple_TxidBlockHashZZ;
5013 * Simple structure sent back by `chain::Watch` when an HTLC from a forward channel is detected on
5014 * chain. Used to update the corresponding HTLC in the backward channel. Failing to pass the
5015 * preimage claim backward will lead to loss of funds.
5017 typedef struct MUST_USE_STRUCT LDKHTLCUpdate {
5019 * A pointer to the opaque Rust object.
5020 * Nearly everywhere, inner must be non-null, however in places where
5021 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5023 LDKnativeHTLCUpdate *inner;
5025 * Indicates that this is the only struct which contains the same pointer.
5026 * Rust functions which take ownership of an object provided via an argument require
5027 * this to be true and invalidate the object pointed to by inner.
5033 * An event to be processed by the ChannelManager.
5035 typedef enum LDKMonitorEvent_Tag {
5037 * A monitor event containing an HTLCUpdate.
5039 LDKMonitorEvent_HTLCEvent,
5041 * A monitor event that the Channel's commitment transaction was confirmed.
5043 LDKMonitorEvent_CommitmentTxConfirmed,
5045 * Indicates a [`ChannelMonitor`] update has completed. See
5046 * [`ChannelMonitorUpdateStatus::InProgress`] for more information on how this is used.
5048 * [`ChannelMonitorUpdateStatus::InProgress`]: super::ChannelMonitorUpdateStatus::InProgress
5050 LDKMonitorEvent_Completed,
5052 * Indicates a [`ChannelMonitor`] update has failed. See
5053 * [`ChannelMonitorUpdateStatus::PermanentFailure`] for more information on how this is used.
5055 * [`ChannelMonitorUpdateStatus::PermanentFailure`]: super::ChannelMonitorUpdateStatus::PermanentFailure
5057 LDKMonitorEvent_UpdateFailed,
5059 * Must be last for serialization purposes
5061 LDKMonitorEvent_Sentinel,
5062 } LDKMonitorEvent_Tag;
5064 typedef struct LDKMonitorEvent_LDKCompleted_Body {
5066 * The funding outpoint of the [`ChannelMonitor`] that was updated
5068 struct LDKOutPoint funding_txo;
5070 * The Update ID from [`ChannelMonitorUpdate::update_id`] which was applied or
5071 * [`ChannelMonitor::get_latest_update_id`].
5073 * Note that this should only be set to a given update's ID if all previous updates for the
5074 * same [`ChannelMonitor`] have been applied and persisted.
5076 uint64_t monitor_update_id;
5077 } LDKMonitorEvent_LDKCompleted_Body;
5079 typedef struct MUST_USE_STRUCT LDKMonitorEvent {
5080 LDKMonitorEvent_Tag tag;
5083 struct LDKHTLCUpdate htlc_event;
5086 struct LDKOutPoint commitment_tx_confirmed;
5088 LDKMonitorEvent_LDKCompleted_Body completed;
5090 struct LDKOutPoint update_failed;
5096 * A dynamically-allocated array of crate::lightning::chain::channelmonitor::MonitorEvents of arbitrary size.
5097 * This corresponds to std::vector in C++
5099 typedef struct LDKCVec_MonitorEventZ {
5101 * The elements in the array.
5102 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
5104 struct LDKMonitorEvent *data;
5106 * The number of elements pointed to by `data`.
5109 } LDKCVec_MonitorEventZ;
5112 * A tuple of 3 elements. See the individual fields for the types contained.
5114 typedef struct LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ {
5116 * The element at position 0
5118 struct LDKOutPoint a;
5120 * The element at position 1
5122 struct LDKCVec_MonitorEventZ b;
5124 * The element at position 2
5126 struct LDKPublicKey c;
5127 } LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ;
5130 * A dynamically-allocated array of crate::c_types::derived::C3Tuple_OutPointCVec_MonitorEventZPublicKeyZs of arbitrary size.
5131 * This corresponds to std::vector in C++
5133 typedef struct LDKCVec_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZZ {
5135 * The elements in the array.
5136 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
5138 struct LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ *data;
5140 * The number of elements pointed to by `data`.
5143 } LDKCVec_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZZ;
5148 * [`Score`] implementation that uses a fixed penalty.
5150 typedef struct MUST_USE_STRUCT LDKFixedPenaltyScorer {
5152 * A pointer to the opaque Rust object.
5153 * Nearly everywhere, inner must be non-null, however in places where
5154 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5156 LDKnativeFixedPenaltyScorer *inner;
5158 * Indicates that this is the only struct which contains the same pointer.
5159 * Rust functions which take ownership of an object provided via an argument require
5160 * this to be true and invalidate the object pointed to by inner.
5163 } LDKFixedPenaltyScorer;
5166 * The contents of CResult_FixedPenaltyScorerDecodeErrorZ
5168 typedef union LDKCResult_FixedPenaltyScorerDecodeErrorZPtr {
5170 * A pointer to the contents in the success state.
5171 * Reading from this pointer when `result_ok` is not set is undefined.
5173 struct LDKFixedPenaltyScorer *result;
5175 * A pointer to the contents in the error state.
5176 * Reading from this pointer when `result_ok` is set is undefined.
5178 struct LDKDecodeError *err;
5179 } LDKCResult_FixedPenaltyScorerDecodeErrorZPtr;
5182 * A CResult_FixedPenaltyScorerDecodeErrorZ represents the result of a fallible operation,
5183 * containing a crate::lightning::routing::scoring::FixedPenaltyScorer on success and a crate::lightning::ln::msgs::DecodeError on failure.
5184 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5186 typedef struct LDKCResult_FixedPenaltyScorerDecodeErrorZ {
5188 * The contents of this CResult_FixedPenaltyScorerDecodeErrorZ, accessible via either
5189 * `err` or `result` depending on the state of `result_ok`.
5191 union LDKCResult_FixedPenaltyScorerDecodeErrorZPtr contents;
5193 * Whether this CResult_FixedPenaltyScorerDecodeErrorZ represents a success state.
5196 } LDKCResult_FixedPenaltyScorerDecodeErrorZ;
5199 * A tuple of 2 elements. See the individual fields for the types contained.
5201 typedef struct LDKC2Tuple_u64u64Z {
5203 * The element at position 0
5207 * The element at position 1
5210 } LDKC2Tuple_u64u64Z;
5213 * An enum which can either contain a crate::c_types::derived::C2Tuple_u64u64Z or not
5215 typedef enum LDKCOption_C2Tuple_u64u64ZZ_Tag {
5217 * When we're in this state, this COption_C2Tuple_u64u64ZZ contains a crate::c_types::derived::C2Tuple_u64u64Z
5219 LDKCOption_C2Tuple_u64u64ZZ_Some,
5221 * When we're in this state, this COption_C2Tuple_u64u64ZZ contains nothing
5223 LDKCOption_C2Tuple_u64u64ZZ_None,
5225 * Must be last for serialization purposes
5227 LDKCOption_C2Tuple_u64u64ZZ_Sentinel,
5228 } LDKCOption_C2Tuple_u64u64ZZ_Tag;
5230 typedef struct LDKCOption_C2Tuple_u64u64ZZ {
5231 LDKCOption_C2Tuple_u64u64ZZ_Tag tag;
5234 struct LDKC2Tuple_u64u64Z some;
5237 } LDKCOption_C2Tuple_u64u64ZZ;
5240 * A dynamically-allocated array of crate::lightning::routing::gossip::NodeIds of arbitrary size.
5241 * This corresponds to std::vector in C++
5243 typedef struct LDKCVec_NodeIdZ {
5245 * The elements in the array.
5246 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
5248 struct LDKNodeId *data;
5250 * The number of elements pointed to by `data`.
5258 * A Record, unit of logging output with Metadata to enable filtering
5259 * Module_path, file, line to inform on log's source
5261 typedef struct MUST_USE_STRUCT LDKRecord {
5263 * A pointer to the opaque Rust object.
5264 * Nearly everywhere, inner must be non-null, however in places where
5265 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5267 LDKnativeRecord *inner;
5269 * Indicates that this is the only struct which contains the same pointer.
5270 * Rust functions which take ownership of an object provided via an argument require
5271 * this to be true and invalidate the object pointed to by inner.
5277 * A trait encapsulating the operations required of a logger
5279 typedef struct LDKLogger {
5281 * An opaque pointer which is passed to your function implementations as an argument.
5282 * This has no meaning in the LDK, and can be NULL or any other value.
5288 void (*log)(const void *this_arg, const struct LDKRecord *NONNULL_PTR record);
5290 * Frees any resources associated with this object given its this_arg pointer.
5291 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
5293 void (*free)(void *this_arg);
5299 * Represents the network as nodes and channels between them
5301 typedef struct MUST_USE_STRUCT LDKNetworkGraph {
5303 * A pointer to the opaque Rust object.
5304 * Nearly everywhere, inner must be non-null, however in places where
5305 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5307 LDKnativeNetworkGraph *inner;
5309 * Indicates that this is the only struct which contains the same pointer.
5310 * Rust functions which take ownership of an object provided via an argument require
5311 * this to be true and invalidate the object pointed to by inner.
5319 * [`Score`] implementation using channel success probability distributions.
5321 * Channels are tracked with upper and lower liquidity bounds - when an HTLC fails at a channel,
5322 * we learn that the upper-bound on the available liquidity is lower than the amount of the HTLC.
5323 * When a payment is forwarded through a channel (but fails later in the route), we learn the
5324 * lower-bound on the channel's available liquidity must be at least the value of the HTLC.
5326 * These bounds are then used to determine a success probability using the formula from
5327 * *Optimally Reliable & Cheap Payment Flows on the Lightning Network* by Rene Pickhardt
5328 * and Stefan Richter [[1]] (i.e. `(upper_bound - payment_amount) / (upper_bound - lower_bound)`).
5330 * This probability is combined with the [`liquidity_penalty_multiplier_msat`] and
5331 * [`liquidity_penalty_amount_multiplier_msat`] parameters to calculate a concrete penalty in
5332 * milli-satoshis. The penalties, when added across all hops, have the property of being linear in
5333 * terms of the entire path's success probability. This allows the router to directly compare
5334 * penalties for different paths. See the documentation of those parameters for the exact formulas.
5336 * The liquidity bounds are decayed by halving them every [`liquidity_offset_half_life`].
5338 * Further, we track the history of our upper and lower liquidity bounds for each channel,
5339 * allowing us to assign a second penalty (using [`historical_liquidity_penalty_multiplier_msat`]
5340 * and [`historical_liquidity_penalty_amount_multiplier_msat`]) based on the same probability
5341 * formula, but using the history of a channel rather than our latest estimates for the liquidity
5346 * Mixing the `no-std` feature between serialization and deserialization results in undefined
5349 * [1]: https://arxiv.org/abs/2107.05322
5350 * [`liquidity_penalty_multiplier_msat`]: ProbabilisticScoringParameters::liquidity_penalty_multiplier_msat
5351 * [`liquidity_penalty_amount_multiplier_msat`]: ProbabilisticScoringParameters::liquidity_penalty_amount_multiplier_msat
5352 * [`liquidity_offset_half_life`]: ProbabilisticScoringParameters::liquidity_offset_half_life
5353 * [`historical_liquidity_penalty_multiplier_msat`]: ProbabilisticScoringParameters::historical_liquidity_penalty_multiplier_msat
5354 * [`historical_liquidity_penalty_amount_multiplier_msat`]: ProbabilisticScoringParameters::historical_liquidity_penalty_amount_multiplier_msat
5356 typedef struct MUST_USE_STRUCT LDKProbabilisticScorer {
5358 * A pointer to the opaque Rust object.
5359 * Nearly everywhere, inner must be non-null, however in places where
5360 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5362 LDKnativeProbabilisticScorer *inner;
5364 * Indicates that this is the only struct which contains the same pointer.
5365 * Rust functions which take ownership of an object provided via an argument require
5366 * this to be true and invalidate the object pointed to by inner.
5369 } LDKProbabilisticScorer;
5372 * The contents of CResult_ProbabilisticScorerDecodeErrorZ
5374 typedef union LDKCResult_ProbabilisticScorerDecodeErrorZPtr {
5376 * A pointer to the contents in the success state.
5377 * Reading from this pointer when `result_ok` is not set is undefined.
5379 struct LDKProbabilisticScorer *result;
5381 * A pointer to the contents in the error state.
5382 * Reading from this pointer when `result_ok` is set is undefined.
5384 struct LDKDecodeError *err;
5385 } LDKCResult_ProbabilisticScorerDecodeErrorZPtr;
5388 * A CResult_ProbabilisticScorerDecodeErrorZ represents the result of a fallible operation,
5389 * containing a crate::lightning::routing::scoring::ProbabilisticScorer on success and a crate::lightning::ln::msgs::DecodeError on failure.
5390 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5392 typedef struct LDKCResult_ProbabilisticScorerDecodeErrorZ {
5394 * The contents of this CResult_ProbabilisticScorerDecodeErrorZ, accessible via either
5395 * `err` or `result` depending on the state of `result_ok`.
5397 union LDKCResult_ProbabilisticScorerDecodeErrorZPtr contents;
5399 * Whether this CResult_ProbabilisticScorerDecodeErrorZ represents a success state.
5402 } LDKCResult_ProbabilisticScorerDecodeErrorZ;
5407 * Features used within an `init` message.
5409 typedef struct MUST_USE_STRUCT LDKInitFeatures {
5411 * A pointer to the opaque Rust object.
5412 * Nearly everywhere, inner must be non-null, however in places where
5413 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5415 LDKnativeInitFeatures *inner;
5417 * Indicates that this is the only struct which contains the same pointer.
5418 * Rust functions which take ownership of an object provided via an argument require
5419 * this to be true and invalidate the object pointed to by inner.
5425 * The contents of CResult_InitFeaturesDecodeErrorZ
5427 typedef union LDKCResult_InitFeaturesDecodeErrorZPtr {
5429 * A pointer to the contents in the success state.
5430 * Reading from this pointer when `result_ok` is not set is undefined.
5432 struct LDKInitFeatures *result;
5434 * A pointer to the contents in the error state.
5435 * Reading from this pointer when `result_ok` is set is undefined.
5437 struct LDKDecodeError *err;
5438 } LDKCResult_InitFeaturesDecodeErrorZPtr;
5441 * A CResult_InitFeaturesDecodeErrorZ represents the result of a fallible operation,
5442 * containing a crate::lightning::ln::features::InitFeatures on success and a crate::lightning::ln::msgs::DecodeError on failure.
5443 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5445 typedef struct LDKCResult_InitFeaturesDecodeErrorZ {
5447 * The contents of this CResult_InitFeaturesDecodeErrorZ, accessible via either
5448 * `err` or `result` depending on the state of `result_ok`.
5450 union LDKCResult_InitFeaturesDecodeErrorZPtr contents;
5452 * Whether this CResult_InitFeaturesDecodeErrorZ represents a success state.
5455 } LDKCResult_InitFeaturesDecodeErrorZ;
5460 * Features used within a `channel_announcement` message.
5462 typedef struct MUST_USE_STRUCT LDKChannelFeatures {
5464 * A pointer to the opaque Rust object.
5465 * Nearly everywhere, inner must be non-null, however in places where
5466 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5468 LDKnativeChannelFeatures *inner;
5470 * Indicates that this is the only struct which contains the same pointer.
5471 * Rust functions which take ownership of an object provided via an argument require
5472 * this to be true and invalidate the object pointed to by inner.
5475 } LDKChannelFeatures;
5478 * The contents of CResult_ChannelFeaturesDecodeErrorZ
5480 typedef union LDKCResult_ChannelFeaturesDecodeErrorZPtr {
5482 * A pointer to the contents in the success state.
5483 * Reading from this pointer when `result_ok` is not set is undefined.
5485 struct LDKChannelFeatures *result;
5487 * A pointer to the contents in the error state.
5488 * Reading from this pointer when `result_ok` is set is undefined.
5490 struct LDKDecodeError *err;
5491 } LDKCResult_ChannelFeaturesDecodeErrorZPtr;
5494 * A CResult_ChannelFeaturesDecodeErrorZ represents the result of a fallible operation,
5495 * containing a crate::lightning::ln::features::ChannelFeatures on success and a crate::lightning::ln::msgs::DecodeError on failure.
5496 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5498 typedef struct LDKCResult_ChannelFeaturesDecodeErrorZ {
5500 * The contents of this CResult_ChannelFeaturesDecodeErrorZ, accessible via either
5501 * `err` or `result` depending on the state of `result_ok`.
5503 union LDKCResult_ChannelFeaturesDecodeErrorZPtr contents;
5505 * Whether this CResult_ChannelFeaturesDecodeErrorZ represents a success state.
5508 } LDKCResult_ChannelFeaturesDecodeErrorZ;
5513 * Features used within a `node_announcement` message.
5515 typedef struct MUST_USE_STRUCT LDKNodeFeatures {
5517 * A pointer to the opaque Rust object.
5518 * Nearly everywhere, inner must be non-null, however in places where
5519 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5521 LDKnativeNodeFeatures *inner;
5523 * Indicates that this is the only struct which contains the same pointer.
5524 * Rust functions which take ownership of an object provided via an argument require
5525 * this to be true and invalidate the object pointed to by inner.
5531 * The contents of CResult_NodeFeaturesDecodeErrorZ
5533 typedef union LDKCResult_NodeFeaturesDecodeErrorZPtr {
5535 * A pointer to the contents in the success state.
5536 * Reading from this pointer when `result_ok` is not set is undefined.
5538 struct LDKNodeFeatures *result;
5540 * A pointer to the contents in the error state.
5541 * Reading from this pointer when `result_ok` is set is undefined.
5543 struct LDKDecodeError *err;
5544 } LDKCResult_NodeFeaturesDecodeErrorZPtr;
5547 * A CResult_NodeFeaturesDecodeErrorZ represents the result of a fallible operation,
5548 * containing a crate::lightning::ln::features::NodeFeatures on success and a crate::lightning::ln::msgs::DecodeError on failure.
5549 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5551 typedef struct LDKCResult_NodeFeaturesDecodeErrorZ {
5553 * The contents of this CResult_NodeFeaturesDecodeErrorZ, accessible via either
5554 * `err` or `result` depending on the state of `result_ok`.
5556 union LDKCResult_NodeFeaturesDecodeErrorZPtr contents;
5558 * Whether this CResult_NodeFeaturesDecodeErrorZ represents a success state.
5561 } LDKCResult_NodeFeaturesDecodeErrorZ;
5566 * Features used within an invoice.
5568 typedef struct MUST_USE_STRUCT LDKInvoiceFeatures {
5570 * A pointer to the opaque Rust object.
5571 * Nearly everywhere, inner must be non-null, however in places where
5572 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5574 LDKnativeInvoiceFeatures *inner;
5576 * Indicates that this is the only struct which contains the same pointer.
5577 * Rust functions which take ownership of an object provided via an argument require
5578 * this to be true and invalidate the object pointed to by inner.
5581 } LDKInvoiceFeatures;
5584 * The contents of CResult_InvoiceFeaturesDecodeErrorZ
5586 typedef union LDKCResult_InvoiceFeaturesDecodeErrorZPtr {
5588 * A pointer to the contents in the success state.
5589 * Reading from this pointer when `result_ok` is not set is undefined.
5591 struct LDKInvoiceFeatures *result;
5593 * A pointer to the contents in the error state.
5594 * Reading from this pointer when `result_ok` is set is undefined.
5596 struct LDKDecodeError *err;
5597 } LDKCResult_InvoiceFeaturesDecodeErrorZPtr;
5600 * A CResult_InvoiceFeaturesDecodeErrorZ represents the result of a fallible operation,
5601 * containing a crate::lightning::ln::features::InvoiceFeatures on success and a crate::lightning::ln::msgs::DecodeError on failure.
5602 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5604 typedef struct LDKCResult_InvoiceFeaturesDecodeErrorZ {
5606 * The contents of this CResult_InvoiceFeaturesDecodeErrorZ, accessible via either
5607 * `err` or `result` depending on the state of `result_ok`.
5609 union LDKCResult_InvoiceFeaturesDecodeErrorZPtr contents;
5611 * Whether this CResult_InvoiceFeaturesDecodeErrorZ represents a success state.
5614 } LDKCResult_InvoiceFeaturesDecodeErrorZ;
5617 * The contents of CResult_ChannelTypeFeaturesDecodeErrorZ
5619 typedef union LDKCResult_ChannelTypeFeaturesDecodeErrorZPtr {
5621 * A pointer to the contents in the success state.
5622 * Reading from this pointer when `result_ok` is not set is undefined.
5624 struct LDKChannelTypeFeatures *result;
5626 * A pointer to the contents in the error state.
5627 * Reading from this pointer when `result_ok` is set is undefined.
5629 struct LDKDecodeError *err;
5630 } LDKCResult_ChannelTypeFeaturesDecodeErrorZPtr;
5633 * A CResult_ChannelTypeFeaturesDecodeErrorZ represents the result of a fallible operation,
5634 * containing a crate::lightning::ln::features::ChannelTypeFeatures on success and a crate::lightning::ln::msgs::DecodeError on failure.
5635 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5637 typedef struct LDKCResult_ChannelTypeFeaturesDecodeErrorZ {
5639 * The contents of this CResult_ChannelTypeFeaturesDecodeErrorZ, accessible via either
5640 * `err` or `result` depending on the state of `result_ok`.
5642 union LDKCResult_ChannelTypeFeaturesDecodeErrorZPtr contents;
5644 * Whether this CResult_ChannelTypeFeaturesDecodeErrorZ represents a success state.
5647 } LDKCResult_ChannelTypeFeaturesDecodeErrorZ;
5652 * Features used within an `offer`.
5654 typedef struct MUST_USE_STRUCT LDKOfferFeatures {
5656 * A pointer to the opaque Rust object.
5657 * Nearly everywhere, inner must be non-null, however in places where
5658 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5660 LDKnativeOfferFeatures *inner;
5662 * Indicates that this is the only struct which contains the same pointer.
5663 * Rust functions which take ownership of an object provided via an argument require
5664 * this to be true and invalidate the object pointed to by inner.
5670 * The contents of CResult_OfferFeaturesDecodeErrorZ
5672 typedef union LDKCResult_OfferFeaturesDecodeErrorZPtr {
5674 * A pointer to the contents in the success state.
5675 * Reading from this pointer when `result_ok` is not set is undefined.
5677 struct LDKOfferFeatures *result;
5679 * A pointer to the contents in the error state.
5680 * Reading from this pointer when `result_ok` is set is undefined.
5682 struct LDKDecodeError *err;
5683 } LDKCResult_OfferFeaturesDecodeErrorZPtr;
5686 * A CResult_OfferFeaturesDecodeErrorZ represents the result of a fallible operation,
5687 * containing a crate::lightning::ln::features::OfferFeatures on success and a crate::lightning::ln::msgs::DecodeError on failure.
5688 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5690 typedef struct LDKCResult_OfferFeaturesDecodeErrorZ {
5692 * The contents of this CResult_OfferFeaturesDecodeErrorZ, accessible via either
5693 * `err` or `result` depending on the state of `result_ok`.
5695 union LDKCResult_OfferFeaturesDecodeErrorZPtr contents;
5697 * Whether this CResult_OfferFeaturesDecodeErrorZ represents a success state.
5700 } LDKCResult_OfferFeaturesDecodeErrorZ;
5705 * Features used within an `invoice_request`.
5707 typedef struct MUST_USE_STRUCT LDKInvoiceRequestFeatures {
5709 * A pointer to the opaque Rust object.
5710 * Nearly everywhere, inner must be non-null, however in places where
5711 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5713 LDKnativeInvoiceRequestFeatures *inner;
5715 * Indicates that this is the only struct which contains the same pointer.
5716 * Rust functions which take ownership of an object provided via an argument require
5717 * this to be true and invalidate the object pointed to by inner.
5720 } LDKInvoiceRequestFeatures;
5723 * The contents of CResult_InvoiceRequestFeaturesDecodeErrorZ
5725 typedef union LDKCResult_InvoiceRequestFeaturesDecodeErrorZPtr {
5727 * A pointer to the contents in the success state.
5728 * Reading from this pointer when `result_ok` is not set is undefined.
5730 struct LDKInvoiceRequestFeatures *result;
5732 * A pointer to the contents in the error state.
5733 * Reading from this pointer when `result_ok` is set is undefined.
5735 struct LDKDecodeError *err;
5736 } LDKCResult_InvoiceRequestFeaturesDecodeErrorZPtr;
5739 * A CResult_InvoiceRequestFeaturesDecodeErrorZ represents the result of a fallible operation,
5740 * containing a crate::lightning::ln::features::InvoiceRequestFeatures on success and a crate::lightning::ln::msgs::DecodeError on failure.
5741 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5743 typedef struct LDKCResult_InvoiceRequestFeaturesDecodeErrorZ {
5745 * The contents of this CResult_InvoiceRequestFeaturesDecodeErrorZ, accessible via either
5746 * `err` or `result` depending on the state of `result_ok`.
5748 union LDKCResult_InvoiceRequestFeaturesDecodeErrorZPtr contents;
5750 * Whether this CResult_InvoiceRequestFeaturesDecodeErrorZ represents a success state.
5753 } LDKCResult_InvoiceRequestFeaturesDecodeErrorZ;
5756 * The contents of CResult_NodeIdDecodeErrorZ
5758 typedef union LDKCResult_NodeIdDecodeErrorZPtr {
5760 * A pointer to the contents in the success state.
5761 * Reading from this pointer when `result_ok` is not set is undefined.
5763 struct LDKNodeId *result;
5765 * A pointer to the contents in the error state.
5766 * Reading from this pointer when `result_ok` is set is undefined.
5768 struct LDKDecodeError *err;
5769 } LDKCResult_NodeIdDecodeErrorZPtr;
5772 * A CResult_NodeIdDecodeErrorZ represents the result of a fallible operation,
5773 * containing a crate::lightning::routing::gossip::NodeId on success and a crate::lightning::ln::msgs::DecodeError on failure.
5774 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5776 typedef struct LDKCResult_NodeIdDecodeErrorZ {
5778 * The contents of this CResult_NodeIdDecodeErrorZ, accessible via either
5779 * `err` or `result` depending on the state of `result_ok`.
5781 union LDKCResult_NodeIdDecodeErrorZPtr contents;
5783 * Whether this CResult_NodeIdDecodeErrorZ represents a success state.
5786 } LDKCResult_NodeIdDecodeErrorZ;
5789 * The contents of CResult_COption_NetworkUpdateZDecodeErrorZ
5791 typedef union LDKCResult_COption_NetworkUpdateZDecodeErrorZPtr {
5793 * A pointer to the contents in the success state.
5794 * Reading from this pointer when `result_ok` is not set is undefined.
5796 struct LDKCOption_NetworkUpdateZ *result;
5798 * A pointer to the contents in the error state.
5799 * Reading from this pointer when `result_ok` is set is undefined.
5801 struct LDKDecodeError *err;
5802 } LDKCResult_COption_NetworkUpdateZDecodeErrorZPtr;
5805 * A CResult_COption_NetworkUpdateZDecodeErrorZ represents the result of a fallible operation,
5806 * containing a crate::c_types::derived::COption_NetworkUpdateZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
5807 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5809 typedef struct LDKCResult_COption_NetworkUpdateZDecodeErrorZ {
5811 * The contents of this CResult_COption_NetworkUpdateZDecodeErrorZ, accessible via either
5812 * `err` or `result` depending on the state of `result_ok`.
5814 union LDKCResult_COption_NetworkUpdateZDecodeErrorZPtr contents;
5816 * Whether this CResult_COption_NetworkUpdateZDecodeErrorZ represents a success state.
5819 } LDKCResult_COption_NetworkUpdateZDecodeErrorZ;
5822 * The `Access` trait defines behavior for accessing chain data and state, such as blocks and
5825 typedef struct LDKAccess {
5827 * An opaque pointer which is passed to your function implementations as an argument.
5828 * This has no meaning in the LDK, and can be NULL or any other value.
5832 * Returns the transaction output of a funding transaction encoded by [`short_channel_id`].
5833 * Returns an error if `genesis_hash` is for a different chain or if such a transaction output
5836 * [`short_channel_id`]: https://github.com/lightning/bolts/blob/master/07-routing-gossip.md#definition-of-short_channel_id
5838 struct LDKCResult_TxOutAccessErrorZ (*get_utxo)(const void *this_arg, const uint8_t (*genesis_hash)[32], uint64_t short_channel_id);
5840 * Frees any resources associated with this object given its this_arg pointer.
5841 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
5843 void (*free)(void *this_arg);
5847 * An enum which can either contain a crate::lightning::chain::Access or not
5849 typedef enum LDKCOption_AccessZ_Tag {
5851 * When we're in this state, this COption_AccessZ contains a crate::lightning::chain::Access
5853 LDKCOption_AccessZ_Some,
5855 * When we're in this state, this COption_AccessZ contains nothing
5857 LDKCOption_AccessZ_None,
5859 * Must be last for serialization purposes
5861 LDKCOption_AccessZ_Sentinel,
5862 } LDKCOption_AccessZ_Tag;
5864 typedef struct LDKCOption_AccessZ {
5865 LDKCOption_AccessZ_Tag tag;
5868 struct LDKAccess some;
5871 } LDKCOption_AccessZ;
5874 * The contents of CResult_boolLightningErrorZ
5876 typedef union LDKCResult_boolLightningErrorZPtr {
5878 * A pointer to the contents in the success state.
5879 * Reading from this pointer when `result_ok` is not set is undefined.
5883 * A pointer to the contents in the error state.
5884 * Reading from this pointer when `result_ok` is set is undefined.
5886 struct LDKLightningError *err;
5887 } LDKCResult_boolLightningErrorZPtr;
5890 * A CResult_boolLightningErrorZ represents the result of a fallible operation,
5891 * containing a bool on success and a crate::lightning::ln::msgs::LightningError on failure.
5892 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5894 typedef struct LDKCResult_boolLightningErrorZ {
5896 * The contents of this CResult_boolLightningErrorZ, accessible via either
5897 * `err` or `result` depending on the state of `result_ok`.
5899 union LDKCResult_boolLightningErrorZPtr contents;
5901 * Whether this CResult_boolLightningErrorZ represents a success state.
5904 } LDKCResult_boolLightningErrorZ;
5907 * A tuple of 3 elements. See the individual fields for the types contained.
5909 typedef struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ {
5911 * The element at position 0
5913 struct LDKChannelAnnouncement a;
5915 * The element at position 1
5917 struct LDKChannelUpdate b;
5919 * The element at position 2
5921 struct LDKChannelUpdate c;
5922 } LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ;
5925 * An enum which can either contain a crate::c_types::derived::C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ or not
5927 typedef enum LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_Tag {
5929 * When we're in this state, this COption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ contains a crate::c_types::derived::C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ
5931 LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_Some,
5933 * When we're in this state, this COption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ contains nothing
5935 LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_None,
5937 * Must be last for serialization purposes
5939 LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_Sentinel,
5940 } LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_Tag;
5942 typedef struct LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ {
5943 LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_Tag tag;
5946 struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ some;
5949 } LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ;
5952 * The contents of CResult_NoneLightningErrorZ
5954 typedef union LDKCResult_NoneLightningErrorZPtr {
5956 * Note that this value is always NULL, as there are no contents in the OK variant
5960 * A pointer to the contents in the error state.
5961 * Reading from this pointer when `result_ok` is set is undefined.
5963 struct LDKLightningError *err;
5964 } LDKCResult_NoneLightningErrorZPtr;
5967 * A CResult_NoneLightningErrorZ represents the result of a fallible operation,
5968 * containing a () on success and a crate::lightning::ln::msgs::LightningError on failure.
5969 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5971 typedef struct LDKCResult_NoneLightningErrorZ {
5973 * The contents of this CResult_NoneLightningErrorZ, accessible via either
5974 * `err` or `result` depending on the state of `result_ok`.
5976 union LDKCResult_NoneLightningErrorZPtr contents;
5978 * Whether this CResult_NoneLightningErrorZ represents a success state.
5981 } LDKCResult_NoneLightningErrorZ;
5986 * Details about one direction of a channel as received within a [`ChannelUpdate`].
5988 typedef struct MUST_USE_STRUCT LDKChannelUpdateInfo {
5990 * A pointer to the opaque Rust object.
5991 * Nearly everywhere, inner must be non-null, however in places where
5992 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5994 LDKnativeChannelUpdateInfo *inner;
5996 * Indicates that this is the only struct which contains the same pointer.
5997 * Rust functions which take ownership of an object provided via an argument require
5998 * this to be true and invalidate the object pointed to by inner.
6001 } LDKChannelUpdateInfo;
6004 * The contents of CResult_ChannelUpdateInfoDecodeErrorZ
6006 typedef union LDKCResult_ChannelUpdateInfoDecodeErrorZPtr {
6008 * A pointer to the contents in the success state.
6009 * Reading from this pointer when `result_ok` is not set is undefined.
6011 struct LDKChannelUpdateInfo *result;
6013 * A pointer to the contents in the error state.
6014 * Reading from this pointer when `result_ok` is set is undefined.
6016 struct LDKDecodeError *err;
6017 } LDKCResult_ChannelUpdateInfoDecodeErrorZPtr;
6020 * A CResult_ChannelUpdateInfoDecodeErrorZ represents the result of a fallible operation,
6021 * containing a crate::lightning::routing::gossip::ChannelUpdateInfo on success and a crate::lightning::ln::msgs::DecodeError on failure.
6022 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6024 typedef struct LDKCResult_ChannelUpdateInfoDecodeErrorZ {
6026 * The contents of this CResult_ChannelUpdateInfoDecodeErrorZ, accessible via either
6027 * `err` or `result` depending on the state of `result_ok`.
6029 union LDKCResult_ChannelUpdateInfoDecodeErrorZPtr contents;
6031 * Whether this CResult_ChannelUpdateInfoDecodeErrorZ represents a success state.
6034 } LDKCResult_ChannelUpdateInfoDecodeErrorZ;
6039 * Details about a channel (both directions).
6040 * Received within a channel announcement.
6042 typedef struct MUST_USE_STRUCT LDKChannelInfo {
6044 * A pointer to the opaque Rust object.
6045 * Nearly everywhere, inner must be non-null, however in places where
6046 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6048 LDKnativeChannelInfo *inner;
6050 * Indicates that this is the only struct which contains the same pointer.
6051 * Rust functions which take ownership of an object provided via an argument require
6052 * this to be true and invalidate the object pointed to by inner.
6058 * The contents of CResult_ChannelInfoDecodeErrorZ
6060 typedef union LDKCResult_ChannelInfoDecodeErrorZPtr {
6062 * A pointer to the contents in the success state.
6063 * Reading from this pointer when `result_ok` is not set is undefined.
6065 struct LDKChannelInfo *result;
6067 * A pointer to the contents in the error state.
6068 * Reading from this pointer when `result_ok` is set is undefined.
6070 struct LDKDecodeError *err;
6071 } LDKCResult_ChannelInfoDecodeErrorZPtr;
6074 * A CResult_ChannelInfoDecodeErrorZ represents the result of a fallible operation,
6075 * containing a crate::lightning::routing::gossip::ChannelInfo on success and a crate::lightning::ln::msgs::DecodeError on failure.
6076 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6078 typedef struct LDKCResult_ChannelInfoDecodeErrorZ {
6080 * The contents of this CResult_ChannelInfoDecodeErrorZ, accessible via either
6081 * `err` or `result` depending on the state of `result_ok`.
6083 union LDKCResult_ChannelInfoDecodeErrorZPtr contents;
6085 * Whether this CResult_ChannelInfoDecodeErrorZ represents a success state.
6088 } LDKCResult_ChannelInfoDecodeErrorZ;
6093 * Fees for routing via a given channel or a node
6095 typedef struct MUST_USE_STRUCT LDKRoutingFees {
6097 * A pointer to the opaque Rust object.
6098 * Nearly everywhere, inner must be non-null, however in places where
6099 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6101 LDKnativeRoutingFees *inner;
6103 * Indicates that this is the only struct which contains the same pointer.
6104 * Rust functions which take ownership of an object provided via an argument require
6105 * this to be true and invalidate the object pointed to by inner.
6111 * The contents of CResult_RoutingFeesDecodeErrorZ
6113 typedef union LDKCResult_RoutingFeesDecodeErrorZPtr {
6115 * A pointer to the contents in the success state.
6116 * Reading from this pointer when `result_ok` is not set is undefined.
6118 struct LDKRoutingFees *result;
6120 * A pointer to the contents in the error state.
6121 * Reading from this pointer when `result_ok` is set is undefined.
6123 struct LDKDecodeError *err;
6124 } LDKCResult_RoutingFeesDecodeErrorZPtr;
6127 * A CResult_RoutingFeesDecodeErrorZ represents the result of a fallible operation,
6128 * containing a crate::lightning::routing::gossip::RoutingFees on success and a crate::lightning::ln::msgs::DecodeError on failure.
6129 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6131 typedef struct LDKCResult_RoutingFeesDecodeErrorZ {
6133 * The contents of this CResult_RoutingFeesDecodeErrorZ, accessible via either
6134 * `err` or `result` depending on the state of `result_ok`.
6136 union LDKCResult_RoutingFeesDecodeErrorZPtr contents;
6138 * Whether this CResult_RoutingFeesDecodeErrorZ represents a success state.
6141 } LDKCResult_RoutingFeesDecodeErrorZ;
6144 * A 4-byte byte array.
6146 typedef struct LDKFourBytes {
6154 * A 12-byte byte array.
6156 typedef struct LDKTwelveBytes {
6166 * Represents a hostname for serialization purposes.
6167 * Only the character set and length will be validated.
6168 * The character set consists of ASCII alphanumeric characters, hyphens, and periods.
6169 * Its length is guaranteed to be representable by a single byte.
6170 * This serialization is used by BOLT 7 hostnames.
6172 typedef struct MUST_USE_STRUCT LDKHostname {
6174 * A pointer to the opaque Rust object.
6175 * Nearly everywhere, inner must be non-null, however in places where
6176 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6178 LDKnativeHostname *inner;
6180 * Indicates that this is the only struct which contains the same pointer.
6181 * Rust functions which take ownership of an object provided via an argument require
6182 * this to be true and invalidate the object pointed to by inner.
6188 * An address which can be used to connect to a remote peer
6190 typedef enum LDKNetAddress_Tag {
6192 * An IPv4 address/port on which the peer is listening.
6196 * An IPv6 address/port on which the peer is listening.
6200 * An old-style Tor onion address/port on which the peer is listening.
6202 * This field is deprecated and the Tor network generally no longer supports V2 Onion
6203 * addresses. Thus, the details are not parsed here.
6205 LDKNetAddress_OnionV2,
6207 * A new-style Tor onion address/port on which the peer is listening.
6208 * To create the human-readable \"hostname\", concatenate ed25519_pubkey, checksum, and version,
6209 * wrap as base32 and append \".onion\".
6211 LDKNetAddress_OnionV3,
6213 * A hostname/port on which the peer is listening.
6215 LDKNetAddress_Hostname,
6217 * Must be last for serialization purposes
6219 LDKNetAddress_Sentinel,
6220 } LDKNetAddress_Tag;
6222 typedef struct LDKNetAddress_LDKIPv4_Body {
6224 * The 4-byte IPv4 address
6226 struct LDKFourBytes addr;
6228 * The port on which the node is listening
6231 } LDKNetAddress_LDKIPv4_Body;
6233 typedef struct LDKNetAddress_LDKIPv6_Body {
6235 * The 16-byte IPv6 address
6237 struct LDKSixteenBytes addr;
6239 * The port on which the node is listening
6242 } LDKNetAddress_LDKIPv6_Body;
6244 typedef struct LDKNetAddress_LDKOnionV3_Body {
6246 * The ed25519 long-term public key of the peer
6248 struct LDKThirtyTwoBytes ed25519_pubkey;
6250 * The checksum of the pubkey and version, as included in the onion address
6254 * The version byte, as defined by the Tor Onion v3 spec.
6258 * The port on which the node is listening
6261 } LDKNetAddress_LDKOnionV3_Body;
6263 typedef struct LDKNetAddress_LDKHostname_Body {
6265 * The hostname on which the node is listening.
6267 struct LDKHostname hostname;
6269 * The port on which the node is listening.
6272 } LDKNetAddress_LDKHostname_Body;
6274 typedef struct MUST_USE_STRUCT LDKNetAddress {
6275 LDKNetAddress_Tag tag;
6277 LDKNetAddress_LDKIPv4_Body i_pv4;
6278 LDKNetAddress_LDKIPv6_Body i_pv6;
6280 struct LDKTwelveBytes onion_v2;
6282 LDKNetAddress_LDKOnionV3_Body onion_v3;
6283 LDKNetAddress_LDKHostname_Body hostname;
6288 * A dynamically-allocated array of crate::lightning::ln::msgs::NetAddresss of arbitrary size.
6289 * This corresponds to std::vector in C++
6291 typedef struct LDKCVec_NetAddressZ {
6293 * The elements in the array.
6294 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
6296 struct LDKNetAddress *data;
6298 * The number of elements pointed to by `data`.
6301 } LDKCVec_NetAddressZ;
6306 * Information received in the latest node_announcement from this node.
6308 typedef struct MUST_USE_STRUCT LDKNodeAnnouncementInfo {
6310 * A pointer to the opaque Rust object.
6311 * Nearly everywhere, inner must be non-null, however in places where
6312 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6314 LDKnativeNodeAnnouncementInfo *inner;
6316 * Indicates that this is the only struct which contains the same pointer.
6317 * Rust functions which take ownership of an object provided via an argument require
6318 * this to be true and invalidate the object pointed to by inner.
6321 } LDKNodeAnnouncementInfo;
6324 * The contents of CResult_NodeAnnouncementInfoDecodeErrorZ
6326 typedef union LDKCResult_NodeAnnouncementInfoDecodeErrorZPtr {
6328 * A pointer to the contents in the success state.
6329 * Reading from this pointer when `result_ok` is not set is undefined.
6331 struct LDKNodeAnnouncementInfo *result;
6333 * A pointer to the contents in the error state.
6334 * Reading from this pointer when `result_ok` is set is undefined.
6336 struct LDKDecodeError *err;
6337 } LDKCResult_NodeAnnouncementInfoDecodeErrorZPtr;
6340 * A CResult_NodeAnnouncementInfoDecodeErrorZ represents the result of a fallible operation,
6341 * containing a crate::lightning::routing::gossip::NodeAnnouncementInfo on success and a crate::lightning::ln::msgs::DecodeError on failure.
6342 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6344 typedef struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ {
6346 * The contents of this CResult_NodeAnnouncementInfoDecodeErrorZ, accessible via either
6347 * `err` or `result` depending on the state of `result_ok`.
6349 union LDKCResult_NodeAnnouncementInfoDecodeErrorZPtr contents;
6351 * Whether this CResult_NodeAnnouncementInfoDecodeErrorZ represents a success state.
6354 } LDKCResult_NodeAnnouncementInfoDecodeErrorZ;
6359 * A user-defined name for a node, which may be used when displaying the node in a graph.
6361 * Since node aliases are provided by third parties, they are a potential avenue for injection
6362 * attacks. Care must be taken when processing.
6364 typedef struct MUST_USE_STRUCT LDKNodeAlias {
6366 * A pointer to the opaque Rust object.
6367 * Nearly everywhere, inner must be non-null, however in places where
6368 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6370 LDKnativeNodeAlias *inner;
6372 * Indicates that this is the only struct which contains the same pointer.
6373 * Rust functions which take ownership of an object provided via an argument require
6374 * this to be true and invalidate the object pointed to by inner.
6380 * The contents of CResult_NodeAliasDecodeErrorZ
6382 typedef union LDKCResult_NodeAliasDecodeErrorZPtr {
6384 * A pointer to the contents in the success state.
6385 * Reading from this pointer when `result_ok` is not set is undefined.
6387 struct LDKNodeAlias *result;
6389 * A pointer to the contents in the error state.
6390 * Reading from this pointer when `result_ok` is set is undefined.
6392 struct LDKDecodeError *err;
6393 } LDKCResult_NodeAliasDecodeErrorZPtr;
6396 * A CResult_NodeAliasDecodeErrorZ represents the result of a fallible operation,
6397 * containing a crate::lightning::routing::gossip::NodeAlias on success and a crate::lightning::ln::msgs::DecodeError on failure.
6398 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6400 typedef struct LDKCResult_NodeAliasDecodeErrorZ {
6402 * The contents of this CResult_NodeAliasDecodeErrorZ, accessible via either
6403 * `err` or `result` depending on the state of `result_ok`.
6405 union LDKCResult_NodeAliasDecodeErrorZPtr contents;
6407 * Whether this CResult_NodeAliasDecodeErrorZ represents a success state.
6410 } LDKCResult_NodeAliasDecodeErrorZ;
6415 * Details about a node in the network, known from the network announcement.
6417 typedef struct MUST_USE_STRUCT LDKNodeInfo {
6419 * A pointer to the opaque Rust object.
6420 * Nearly everywhere, inner must be non-null, however in places where
6421 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6423 LDKnativeNodeInfo *inner;
6425 * Indicates that this is the only struct which contains the same pointer.
6426 * Rust functions which take ownership of an object provided via an argument require
6427 * this to be true and invalidate the object pointed to by inner.
6433 * The contents of CResult_NodeInfoDecodeErrorZ
6435 typedef union LDKCResult_NodeInfoDecodeErrorZPtr {
6437 * A pointer to the contents in the success state.
6438 * Reading from this pointer when `result_ok` is not set is undefined.
6440 struct LDKNodeInfo *result;
6442 * A pointer to the contents in the error state.
6443 * Reading from this pointer when `result_ok` is set is undefined.
6445 struct LDKDecodeError *err;
6446 } LDKCResult_NodeInfoDecodeErrorZPtr;
6449 * A CResult_NodeInfoDecodeErrorZ represents the result of a fallible operation,
6450 * containing a crate::lightning::routing::gossip::NodeInfo on success and a crate::lightning::ln::msgs::DecodeError on failure.
6451 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6453 typedef struct LDKCResult_NodeInfoDecodeErrorZ {
6455 * The contents of this CResult_NodeInfoDecodeErrorZ, accessible via either
6456 * `err` or `result` depending on the state of `result_ok`.
6458 union LDKCResult_NodeInfoDecodeErrorZPtr contents;
6460 * Whether this CResult_NodeInfoDecodeErrorZ represents a success state.
6463 } LDKCResult_NodeInfoDecodeErrorZ;
6466 * The contents of CResult_NetworkGraphDecodeErrorZ
6468 typedef union LDKCResult_NetworkGraphDecodeErrorZPtr {
6470 * A pointer to the contents in the success state.
6471 * Reading from this pointer when `result_ok` is not set is undefined.
6473 struct LDKNetworkGraph *result;
6475 * A pointer to the contents in the error state.
6476 * Reading from this pointer when `result_ok` is set is undefined.
6478 struct LDKDecodeError *err;
6479 } LDKCResult_NetworkGraphDecodeErrorZPtr;
6482 * A CResult_NetworkGraphDecodeErrorZ represents the result of a fallible operation,
6483 * containing a crate::lightning::routing::gossip::NetworkGraph on success and a crate::lightning::ln::msgs::DecodeError on failure.
6484 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6486 typedef struct LDKCResult_NetworkGraphDecodeErrorZ {
6488 * The contents of this CResult_NetworkGraphDecodeErrorZ, accessible via either
6489 * `err` or `result` depending on the state of `result_ok`.
6491 union LDKCResult_NetworkGraphDecodeErrorZPtr contents;
6493 * Whether this CResult_NetworkGraphDecodeErrorZ represents a success state.
6496 } LDKCResult_NetworkGraphDecodeErrorZ;
6499 * An enum which can either contain a crate::c_types::derived::CVec_NetAddressZ or not
6501 typedef enum LDKCOption_CVec_NetAddressZZ_Tag {
6503 * When we're in this state, this COption_CVec_NetAddressZZ contains a crate::c_types::derived::CVec_NetAddressZ
6505 LDKCOption_CVec_NetAddressZZ_Some,
6507 * When we're in this state, this COption_CVec_NetAddressZZ contains nothing
6509 LDKCOption_CVec_NetAddressZZ_None,
6511 * Must be last for serialization purposes
6513 LDKCOption_CVec_NetAddressZZ_Sentinel,
6514 } LDKCOption_CVec_NetAddressZZ_Tag;
6516 typedef struct LDKCOption_CVec_NetAddressZZ {
6517 LDKCOption_CVec_NetAddressZZ_Tag tag;
6520 struct LDKCVec_NetAddressZ some;
6523 } LDKCOption_CVec_NetAddressZZ;
6526 * The contents of CResult_DelayedPaymentOutputDescriptorDecodeErrorZ
6528 typedef union LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZPtr {
6530 * A pointer to the contents in the success state.
6531 * Reading from this pointer when `result_ok` is not set is undefined.
6533 struct LDKDelayedPaymentOutputDescriptor *result;
6535 * A pointer to the contents in the error state.
6536 * Reading from this pointer when `result_ok` is set is undefined.
6538 struct LDKDecodeError *err;
6539 } LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZPtr;
6542 * A CResult_DelayedPaymentOutputDescriptorDecodeErrorZ represents the result of a fallible operation,
6543 * containing a crate::lightning::chain::keysinterface::DelayedPaymentOutputDescriptor on success and a crate::lightning::ln::msgs::DecodeError on failure.
6544 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6546 typedef struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ {
6548 * The contents of this CResult_DelayedPaymentOutputDescriptorDecodeErrorZ, accessible via either
6549 * `err` or `result` depending on the state of `result_ok`.
6551 union LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZPtr contents;
6553 * Whether this CResult_DelayedPaymentOutputDescriptorDecodeErrorZ represents a success state.
6556 } LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ;
6559 * The contents of CResult_StaticPaymentOutputDescriptorDecodeErrorZ
6561 typedef union LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZPtr {
6563 * A pointer to the contents in the success state.
6564 * Reading from this pointer when `result_ok` is not set is undefined.
6566 struct LDKStaticPaymentOutputDescriptor *result;
6568 * A pointer to the contents in the error state.
6569 * Reading from this pointer when `result_ok` is set is undefined.
6571 struct LDKDecodeError *err;
6572 } LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZPtr;
6575 * A CResult_StaticPaymentOutputDescriptorDecodeErrorZ represents the result of a fallible operation,
6576 * containing a crate::lightning::chain::keysinterface::StaticPaymentOutputDescriptor on success and a crate::lightning::ln::msgs::DecodeError on failure.
6577 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6579 typedef struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ {
6581 * The contents of this CResult_StaticPaymentOutputDescriptorDecodeErrorZ, accessible via either
6582 * `err` or `result` depending on the state of `result_ok`.
6584 union LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZPtr contents;
6586 * Whether this CResult_StaticPaymentOutputDescriptorDecodeErrorZ represents a success state.
6589 } LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ;
6592 * The contents of CResult_SpendableOutputDescriptorDecodeErrorZ
6594 typedef union LDKCResult_SpendableOutputDescriptorDecodeErrorZPtr {
6596 * A pointer to the contents in the success state.
6597 * Reading from this pointer when `result_ok` is not set is undefined.
6599 struct LDKSpendableOutputDescriptor *result;
6601 * A pointer to the contents in the error state.
6602 * Reading from this pointer when `result_ok` is set is undefined.
6604 struct LDKDecodeError *err;
6605 } LDKCResult_SpendableOutputDescriptorDecodeErrorZPtr;
6608 * A CResult_SpendableOutputDescriptorDecodeErrorZ represents the result of a fallible operation,
6609 * containing a crate::lightning::chain::keysinterface::SpendableOutputDescriptor on success and a crate::lightning::ln::msgs::DecodeError on failure.
6610 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6612 typedef struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ {
6614 * The contents of this CResult_SpendableOutputDescriptorDecodeErrorZ, accessible via either
6615 * `err` or `result` depending on the state of `result_ok`.
6617 union LDKCResult_SpendableOutputDescriptorDecodeErrorZPtr contents;
6619 * Whether this CResult_SpendableOutputDescriptorDecodeErrorZ represents a success state.
6622 } LDKCResult_SpendableOutputDescriptorDecodeErrorZ;
6625 * A dynamically-allocated array of crate::c_types::ThirtyTwoBytess of arbitrary size.
6626 * This corresponds to std::vector in C++
6628 typedef struct LDKCVec_PaymentPreimageZ {
6630 * The elements in the array.
6631 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
6633 struct LDKThirtyTwoBytes *data;
6635 * The number of elements pointed to by `data`.
6638 } LDKCVec_PaymentPreimageZ;
6641 * A tuple of 2 elements. See the individual fields for the types contained.
6643 typedef struct LDKC2Tuple_SignatureCVec_SignatureZZ {
6645 * The element at position 0
6647 struct LDKSignature a;
6649 * The element at position 1
6651 struct LDKCVec_SignatureZ b;
6652 } LDKC2Tuple_SignatureCVec_SignatureZZ;
6655 * The contents of CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ
6657 typedef union LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZPtr {
6659 * A pointer to the contents in the success state.
6660 * Reading from this pointer when `result_ok` is not set is undefined.
6662 struct LDKC2Tuple_SignatureCVec_SignatureZZ *result;
6664 * Note that this value is always NULL, as there are no contents in the Err variant
6667 } LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZPtr;
6670 * A CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ represents the result of a fallible operation,
6671 * containing a crate::c_types::derived::C2Tuple_SignatureCVec_SignatureZZ on success and a () on failure.
6672 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6674 typedef struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ {
6676 * The contents of this CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ, accessible via either
6677 * `err` or `result` depending on the state of `result_ok`.
6679 union LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZPtr contents;
6681 * Whether this CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ represents a success state.
6684 } LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ;
6687 * The contents of CResult_SignatureNoneZ
6689 typedef union LDKCResult_SignatureNoneZPtr {
6691 * A pointer to the contents in the success state.
6692 * Reading from this pointer when `result_ok` is not set is undefined.
6694 struct LDKSignature *result;
6696 * Note that this value is always NULL, as there are no contents in the Err variant
6699 } LDKCResult_SignatureNoneZPtr;
6702 * A CResult_SignatureNoneZ represents the result of a fallible operation,
6703 * containing a crate::c_types::Signature on success and a () on failure.
6704 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6706 typedef struct LDKCResult_SignatureNoneZ {
6708 * The contents of this CResult_SignatureNoneZ, accessible via either
6709 * `err` or `result` depending on the state of `result_ok`.
6711 union LDKCResult_SignatureNoneZPtr contents;
6713 * Whether this CResult_SignatureNoneZ represents a success state.
6716 } LDKCResult_SignatureNoneZ;
6719 * A tuple of 2 elements. See the individual fields for the types contained.
6721 typedef struct LDKC2Tuple_SignatureSignatureZ {
6723 * The element at position 0
6725 struct LDKSignature a;
6727 * The element at position 1
6729 struct LDKSignature b;
6730 } LDKC2Tuple_SignatureSignatureZ;
6733 * The contents of CResult_C2Tuple_SignatureSignatureZNoneZ
6735 typedef union LDKCResult_C2Tuple_SignatureSignatureZNoneZPtr {
6737 * A pointer to the contents in the success state.
6738 * Reading from this pointer when `result_ok` is not set is undefined.
6740 struct LDKC2Tuple_SignatureSignatureZ *result;
6742 * Note that this value is always NULL, as there are no contents in the Err variant
6745 } LDKCResult_C2Tuple_SignatureSignatureZNoneZPtr;
6748 * A CResult_C2Tuple_SignatureSignatureZNoneZ represents the result of a fallible operation,
6749 * containing a crate::c_types::derived::C2Tuple_SignatureSignatureZ on success and a () on failure.
6750 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6752 typedef struct LDKCResult_C2Tuple_SignatureSignatureZNoneZ {
6754 * The contents of this CResult_C2Tuple_SignatureSignatureZNoneZ, accessible via either
6755 * `err` or `result` depending on the state of `result_ok`.
6757 union LDKCResult_C2Tuple_SignatureSignatureZNoneZPtr contents;
6759 * Whether this CResult_C2Tuple_SignatureSignatureZNoneZ represents a success state.
6762 } LDKCResult_C2Tuple_SignatureSignatureZNoneZ;
6765 * Represents a valid secp256k1 secret key serialized as a 32 byte array.
6767 typedef struct LDKSecretKey {
6769 * The bytes of the secret key
6775 * The contents of CResult_SecretKeyNoneZ
6777 typedef union LDKCResult_SecretKeyNoneZPtr {
6779 * A pointer to the contents in the success state.
6780 * Reading from this pointer when `result_ok` is not set is undefined.
6782 struct LDKSecretKey *result;
6784 * Note that this value is always NULL, as there are no contents in the Err variant
6787 } LDKCResult_SecretKeyNoneZPtr;
6790 * A CResult_SecretKeyNoneZ represents the result of a fallible operation,
6791 * containing a crate::c_types::SecretKey on success and a () on failure.
6792 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6794 typedef struct LDKCResult_SecretKeyNoneZ {
6796 * The contents of this CResult_SecretKeyNoneZ, accessible via either
6797 * `err` or `result` depending on the state of `result_ok`.
6799 union LDKCResult_SecretKeyNoneZPtr contents;
6801 * Whether this CResult_SecretKeyNoneZ represents a success state.
6804 } LDKCResult_SecretKeyNoneZ;
6807 * The contents of CResult_PublicKeyNoneZ
6809 typedef union LDKCResult_PublicKeyNoneZPtr {
6811 * A pointer to the contents in the success state.
6812 * Reading from this pointer when `result_ok` is not set is undefined.
6814 struct LDKPublicKey *result;
6816 * Note that this value is always NULL, as there are no contents in the Err variant
6819 } LDKCResult_PublicKeyNoneZPtr;
6822 * A CResult_PublicKeyNoneZ represents the result of a fallible operation,
6823 * containing a crate::c_types::PublicKey on success and a () on failure.
6824 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6826 typedef struct LDKCResult_PublicKeyNoneZ {
6828 * The contents of this CResult_PublicKeyNoneZ, accessible via either
6829 * `err` or `result` depending on the state of `result_ok`.
6831 union LDKCResult_PublicKeyNoneZPtr contents;
6833 * Whether this CResult_PublicKeyNoneZ represents a success state.
6836 } LDKCResult_PublicKeyNoneZ;
6839 * An enum which can either contain a crate::c_types::BigEndianScalar or not
6841 typedef enum LDKCOption_ScalarZ_Tag {
6843 * When we're in this state, this COption_ScalarZ contains a crate::c_types::BigEndianScalar
6845 LDKCOption_ScalarZ_Some,
6847 * When we're in this state, this COption_ScalarZ contains nothing
6849 LDKCOption_ScalarZ_None,
6851 * Must be last for serialization purposes
6853 LDKCOption_ScalarZ_Sentinel,
6854 } LDKCOption_ScalarZ_Tag;
6856 typedef struct LDKCOption_ScalarZ {
6857 LDKCOption_ScalarZ_Tag tag;
6860 struct LDKBigEndianScalar some;
6863 } LDKCOption_ScalarZ;
6866 * The contents of CResult_SharedSecretNoneZ
6868 typedef union LDKCResult_SharedSecretNoneZPtr {
6870 * A pointer to the contents in the success state.
6871 * Reading from this pointer when `result_ok` is not set is undefined.
6873 struct LDKThirtyTwoBytes *result;
6875 * Note that this value is always NULL, as there are no contents in the Err variant
6878 } LDKCResult_SharedSecretNoneZPtr;
6881 * A CResult_SharedSecretNoneZ represents the result of a fallible operation,
6882 * containing a crate::c_types::ThirtyTwoBytes on success and a () on failure.
6883 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6885 typedef struct LDKCResult_SharedSecretNoneZ {
6887 * The contents of this CResult_SharedSecretNoneZ, accessible via either
6888 * `err` or `result` depending on the state of `result_ok`.
6890 union LDKCResult_SharedSecretNoneZPtr contents;
6892 * Whether this CResult_SharedSecretNoneZ represents a success state.
6895 } LDKCResult_SharedSecretNoneZ;
6900 * This class tracks the per-transaction information needed to build a closing transaction and will
6901 * actually build it and sign.
6903 * This class can be used inside a signer implementation to generate a signature given the relevant
6906 typedef struct MUST_USE_STRUCT LDKClosingTransaction {
6908 * A pointer to the opaque Rust object.
6909 * Nearly everywhere, inner must be non-null, however in places where
6910 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6912 LDKnativeClosingTransaction *inner;
6914 * Indicates that this is the only struct which contains the same pointer.
6915 * Rust functions which take ownership of an object provided via an argument require
6916 * this to be true and invalidate the object pointed to by inner.
6919 } LDKClosingTransaction;
6924 * The unsigned part of a channel_announcement
6926 typedef struct MUST_USE_STRUCT LDKUnsignedChannelAnnouncement {
6928 * A pointer to the opaque Rust object.
6929 * Nearly everywhere, inner must be non-null, however in places where
6930 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6932 LDKnativeUnsignedChannelAnnouncement *inner;
6934 * Indicates that this is the only struct which contains the same pointer.
6935 * Rust functions which take ownership of an object provided via an argument require
6936 * this to be true and invalidate the object pointed to by inner.
6939 } LDKUnsignedChannelAnnouncement;
6942 * A trait to sign Lightning channel transactions as described in
6943 * [BOLT 3](https://github.com/lightning/bolts/blob/master/03-transactions.md).
6945 * Signing services could be implemented on a hardware wallet and should implement signing
6946 * policies in order to be secure. Please refer to the [VLS Policy
6947 * Controls](https://gitlab.com/lightning-signer/validating-lightning-signer/-/blob/main/docs/policy-controls.md)
6948 * for an example of such policies.
6950 typedef struct LDKBaseSign {
6952 * An opaque pointer which is passed to your function implementations as an argument.
6953 * This has no meaning in the LDK, and can be NULL or any other value.
6957 * Gets the per-commitment point for a specific commitment number
6959 * Note that the commitment number starts at `(1 << 48) - 1` and counts backwards.
6961 struct LDKPublicKey (*get_per_commitment_point)(const void *this_arg, uint64_t idx);
6963 * Gets the commitment secret for a specific commitment number as part of the revocation process
6965 * An external signer implementation should error here if the commitment was already signed
6966 * and should refuse to sign it in the future.
6968 * May be called more than once for the same index.
6970 * Note that the commitment number starts at `(1 << 48) - 1` and counts backwards.
6972 struct LDKThirtyTwoBytes (*release_commitment_secret)(const void *this_arg, uint64_t idx);
6974 * Validate the counterparty's signatures on the holder commitment transaction and HTLCs.
6976 * This is required in order for the signer to make sure that releasing a commitment
6977 * secret won't leave us without a broadcastable holder transaction.
6978 * Policy checks should be implemented in this function, including checking the amount
6979 * sent to us and checking the HTLCs.
6981 * The preimages of outgoing HTLCs that were fulfilled since the last commitment are provided.
6982 * A validating signer should ensure that an HTLC output is removed only when the matching
6983 * preimage is provided, or when the value to holder is restored.
6985 * Note that all the relevant preimages will be provided, but there may also be additional
6986 * irrelevant or duplicate preimages.
6988 struct LDKCResult_NoneNoneZ (*validate_holder_commitment)(const void *this_arg, const struct LDKHolderCommitmentTransaction *NONNULL_PTR holder_tx, struct LDKCVec_PaymentPreimageZ preimages);
6990 * Returns the holder's channel public keys and basepoints.
6992 struct LDKChannelPublicKeys pubkeys;
6994 * Fill in the pubkeys field as a reference to it will be given to Rust after this returns
6995 * Note that this takes a pointer to this object, not the this_ptr like other methods do
6996 * This function pointer may be NULL if pubkeys is filled in when this object is created and never needs updating.
6998 void (*set_pubkeys)(const struct LDKBaseSign*NONNULL_PTR );
7000 * Returns an arbitrary identifier describing the set of keys which are provided back to you in
7001 * some [`SpendableOutputDescriptor`] types. This should be sufficient to identify this
7002 * [`BaseSign`] object uniquely and lookup or re-derive its keys.
7004 struct LDKThirtyTwoBytes (*channel_keys_id)(const void *this_arg);
7006 * Create a signature for a counterparty's commitment transaction and associated HTLC transactions.
7008 * Note that if signing fails or is rejected, the channel will be force-closed.
7010 * Policy checks should be implemented in this function, including checking the amount
7011 * sent to us and checking the HTLCs.
7013 * The preimages of outgoing HTLCs that were fulfilled since the last commitment are provided.
7014 * A validating signer should ensure that an HTLC output is removed only when the matching
7015 * preimage is provided, or when the value to holder is restored.
7017 * Note that all the relevant preimages will be provided, but there may also be additional
7018 * irrelevant or duplicate preimages.
7020 struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ (*sign_counterparty_commitment)(const void *this_arg, const struct LDKCommitmentTransaction *NONNULL_PTR commitment_tx, struct LDKCVec_PaymentPreimageZ preimages);
7022 * Validate the counterparty's revocation.
7024 * This is required in order for the signer to make sure that the state has moved
7025 * forward and it is safe to sign the next counterparty commitment.
7027 struct LDKCResult_NoneNoneZ (*validate_counterparty_revocation)(const void *this_arg, uint64_t idx, const uint8_t (*secret)[32]);
7029 * Creates a signature for a holder's commitment transaction and its claiming HTLC transactions.
7031 * This will be called
7032 * - with a non-revoked `commitment_tx`.
7033 * - with the latest `commitment_tx` when we initiate a force-close.
7034 * - with the previous `commitment_tx`, just to get claiming HTLC
7035 * signatures, if we are reacting to a [`ChannelMonitor`]
7036 * [replica](https://github.com/lightningdevkit/rust-lightning/blob/main/GLOSSARY.md#monitor-replicas)
7037 * that decided to broadcast before it had been updated to the latest `commitment_tx`.
7039 * This may be called multiple times for the same transaction.
7041 * An external signer implementation should check that the commitment has not been revoked.
7043 * [`ChannelMonitor`]: crate::chain::channelmonitor::ChannelMonitor
7045 struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ (*sign_holder_commitment_and_htlcs)(const void *this_arg, const struct LDKHolderCommitmentTransaction *NONNULL_PTR commitment_tx);
7047 * Create a signature for the given input in a transaction spending an HTLC transaction output
7048 * or a commitment transaction `to_local` output when our counterparty broadcasts an old state.
7050 * A justice transaction may claim multiple outputs at the same time if timelocks are
7051 * similar, but only a signature for the input at index `input` should be signed for here.
7052 * It may be called multiple times for same output(s) if a fee-bump is needed with regards
7053 * to an upcoming timelock expiration.
7055 * Amount is value of the output spent by this input, committed to in the BIP 143 signature.
7057 * `per_commitment_key` is revocation secret which was provided by our counterparty when they
7058 * revoked the state which they eventually broadcast. It's not a _holder_ secret key and does
7059 * not allow the spending of any funds by itself (you need our holder `revocation_secret` to do
7062 struct LDKCResult_SignatureNoneZ (*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]);
7064 * Create a signature for the given input in a transaction spending a commitment transaction
7065 * HTLC output when our counterparty broadcasts an old state.
7067 * A justice transaction may claim multiple outputs at the same time if timelocks are
7068 * similar, but only a signature for the input at index `input` should be signed for here.
7069 * It may be called multiple times for same output(s) if a fee-bump is needed with regards
7070 * to an upcoming timelock expiration.
7072 * `amount` is the value of the output spent by this input, committed to in the BIP 143
7075 * `per_commitment_key` is revocation secret which was provided by our counterparty when they
7076 * revoked the state which they eventually broadcast. It's not a _holder_ secret key and does
7077 * not allow the spending of any funds by itself (you need our holder revocation_secret to do
7080 * `htlc` holds HTLC elements (hash, timelock), thus changing the format of the witness script
7081 * (which is committed to in the BIP 143 signatures).
7083 struct LDKCResult_SignatureNoneZ (*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);
7085 * Create a signature for a claiming transaction for a HTLC output on a counterparty's commitment
7086 * transaction, either offered or received.
7088 * Such a transaction may claim multiples offered outputs at same time if we know the
7089 * preimage for each when we create it, but only the input at index `input` should be
7090 * signed for here. It may be called multiple times for same output(s) if a fee-bump is
7091 * needed with regards to an upcoming timelock expiration.
7093 * `witness_script` is either an offered or received script as defined in BOLT3 for HTLC
7096 * `amount` is value of the output spent by this input, committed to in the BIP 143 signature.
7098 * `per_commitment_point` is the dynamic point corresponding to the channel state
7099 * detected onchain. It has been generated by our counterparty and is used to derive
7100 * channel state keys, which are then included in the witness script and committed to in the
7101 * BIP 143 signature.
7103 struct LDKCResult_SignatureNoneZ (*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);
7105 * Create a signature for a (proposed) closing transaction.
7107 * Note that, due to rounding, there may be one \"missing\" satoshi, and either party may have
7108 * chosen to forgo their output as dust.
7110 struct LDKCResult_SignatureNoneZ (*sign_closing_transaction)(const void *this_arg, const struct LDKClosingTransaction *NONNULL_PTR closing_tx);
7112 * Computes the signature for a commitment transaction's anchor output used as an
7113 * input within `anchor_tx`, which spends the commitment transaction, at index `input`.
7115 struct LDKCResult_SignatureNoneZ (*sign_holder_anchor_input)(const void *this_arg, struct LDKTransaction anchor_tx, uintptr_t input);
7117 * Signs a channel announcement message with our funding key and our node secret key (aka
7118 * node_id or network_key), proving it comes from one of the channel participants.
7120 * The first returned signature should be from our node secret key, the second from our
7123 * Note that if this fails or is rejected, the channel will not be publicly announced and
7124 * our counterparty may (though likely will not) close the channel on us for violating the
7127 struct LDKCResult_C2Tuple_SignatureSignatureZNoneZ (*sign_channel_announcement)(const void *this_arg, const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR msg);
7129 * Set the counterparty static channel data, including basepoints,
7130 * `counterparty_selected`/`holder_selected_contest_delay` and funding outpoint. Since these
7131 * are static channel data, they MUST NOT be allowed to change to different values once set,
7132 * as LDK may call this method more than once.
7134 * channel_parameters.is_populated() MUST be true.
7136 void (*provide_channel_parameters)(void *this_arg, const struct LDKChannelTransactionParameters *NONNULL_PTR channel_parameters);
7138 * Frees any resources associated with this object given its this_arg pointer.
7139 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
7141 void (*free)(void *this_arg);
7145 * A writeable signer.
7147 * There will always be two instances of a signer per channel, one occupied by the
7148 * [`ChannelManager`] and another by the channel's [`ChannelMonitor`].
7150 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
7151 * [`ChannelMonitor`]: crate::chain::channelmonitor::ChannelMonitor
7153 typedef struct LDKSign {
7155 * An opaque pointer which is passed to your function implementations as an argument.
7156 * This has no meaning in the LDK, and can be NULL or any other value.
7160 * Implementation of BaseSign for this object.
7162 struct LDKBaseSign BaseSign;
7164 * Serialize the object into a byte array
7166 struct LDKCVec_u8Z (*write)(const void *this_arg);
7168 * Frees any resources associated with this object given its this_arg pointer.
7169 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
7171 void (*free)(void *this_arg);
7175 * The contents of CResult_SignDecodeErrorZ
7177 typedef union LDKCResult_SignDecodeErrorZPtr {
7179 * A pointer to the contents in the success state.
7180 * Reading from this pointer when `result_ok` is not set is undefined.
7182 struct LDKSign *result;
7184 * A pointer to the contents in the error state.
7185 * Reading from this pointer when `result_ok` is set is undefined.
7187 struct LDKDecodeError *err;
7188 } LDKCResult_SignDecodeErrorZPtr;
7191 * A CResult_SignDecodeErrorZ represents the result of a fallible operation,
7192 * containing a crate::lightning::chain::keysinterface::Sign on success and a crate::lightning::ln::msgs::DecodeError on failure.
7193 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7195 typedef struct LDKCResult_SignDecodeErrorZ {
7197 * The contents of this CResult_SignDecodeErrorZ, accessible via either
7198 * `err` or `result` depending on the state of `result_ok`.
7200 union LDKCResult_SignDecodeErrorZPtr contents;
7202 * Whether this CResult_SignDecodeErrorZ represents a success state.
7205 } LDKCResult_SignDecodeErrorZ;
7208 * Integer in the range `0..32`
7210 typedef struct LDKU5 {
7215 * A dynamically-allocated array of crate::c_types::U5s of arbitrary size.
7216 * This corresponds to std::vector in C++
7218 typedef struct LDKCVec_U5Z {
7220 * The elements in the array.
7221 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
7225 * The number of elements pointed to by `data`.
7231 * Represents a secp256k1 signature serialized as two 32-byte numbers as well as a tag which
7232 * allows recovering the exact public key which created the signature given the message.
7234 typedef struct LDKRecoverableSignature {
7236 * The bytes of the signature in "compact" form plus a "Recovery ID" which allows for
7239 uint8_t serialized_form[68];
7240 } LDKRecoverableSignature;
7243 * The contents of CResult_RecoverableSignatureNoneZ
7245 typedef union LDKCResult_RecoverableSignatureNoneZPtr {
7247 * A pointer to the contents in the success state.
7248 * Reading from this pointer when `result_ok` is not set is undefined.
7250 struct LDKRecoverableSignature *result;
7252 * Note that this value is always NULL, as there are no contents in the Err variant
7255 } LDKCResult_RecoverableSignatureNoneZPtr;
7258 * A CResult_RecoverableSignatureNoneZ represents the result of a fallible operation,
7259 * containing a crate::c_types::RecoverableSignature on success and a () on failure.
7260 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7262 typedef struct LDKCResult_RecoverableSignatureNoneZ {
7264 * The contents of this CResult_RecoverableSignatureNoneZ, accessible via either
7265 * `err` or `result` depending on the state of `result_ok`.
7267 union LDKCResult_RecoverableSignatureNoneZPtr contents;
7269 * Whether this CResult_RecoverableSignatureNoneZ represents a success state.
7272 } LDKCResult_RecoverableSignatureNoneZ;
7275 * A dynamically-allocated array of crate::c_types::derived::CVec_u8Zs of arbitrary size.
7276 * This corresponds to std::vector in C++
7278 typedef struct LDKCVec_CVec_u8ZZ {
7280 * The elements in the array.
7281 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
7283 struct LDKCVec_u8Z *data;
7285 * The number of elements pointed to by `data`.
7288 } LDKCVec_CVec_u8ZZ;
7291 * The contents of CResult_CVec_CVec_u8ZZNoneZ
7293 typedef union LDKCResult_CVec_CVec_u8ZZNoneZPtr {
7295 * A pointer to the contents in the success state.
7296 * Reading from this pointer when `result_ok` is not set is undefined.
7298 struct LDKCVec_CVec_u8ZZ *result;
7300 * Note that this value is always NULL, as there are no contents in the Err variant
7303 } LDKCResult_CVec_CVec_u8ZZNoneZPtr;
7306 * A CResult_CVec_CVec_u8ZZNoneZ represents the result of a fallible operation,
7307 * containing a crate::c_types::derived::CVec_CVec_u8ZZ on success and a () on failure.
7308 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7310 typedef struct LDKCResult_CVec_CVec_u8ZZNoneZ {
7312 * The contents of this CResult_CVec_CVec_u8ZZNoneZ, accessible via either
7313 * `err` or `result` depending on the state of `result_ok`.
7315 union LDKCResult_CVec_CVec_u8ZZNoneZPtr contents;
7317 * Whether this CResult_CVec_CVec_u8ZZNoneZ represents a success state.
7320 } LDKCResult_CVec_CVec_u8ZZNoneZ;
7325 * A simple implementation of [`Sign`] that just keeps the private keys in memory.
7327 * This implementation performs no policy checks and is insufficient by itself as
7328 * a secure external signer.
7330 typedef struct MUST_USE_STRUCT LDKInMemorySigner {
7332 * A pointer to the opaque Rust object.
7333 * Nearly everywhere, inner must be non-null, however in places where
7334 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7336 LDKnativeInMemorySigner *inner;
7338 * Indicates that this is the only struct which contains the same pointer.
7339 * Rust functions which take ownership of an object provided via an argument require
7340 * this to be true and invalidate the object pointed to by inner.
7343 } LDKInMemorySigner;
7346 * The contents of CResult_InMemorySignerDecodeErrorZ
7348 typedef union LDKCResult_InMemorySignerDecodeErrorZPtr {
7350 * A pointer to the contents in the success state.
7351 * Reading from this pointer when `result_ok` is not set is undefined.
7353 struct LDKInMemorySigner *result;
7355 * A pointer to the contents in the error state.
7356 * Reading from this pointer when `result_ok` is set is undefined.
7358 struct LDKDecodeError *err;
7359 } LDKCResult_InMemorySignerDecodeErrorZPtr;
7362 * A CResult_InMemorySignerDecodeErrorZ represents the result of a fallible operation,
7363 * containing a crate::lightning::chain::keysinterface::InMemorySigner on success and a crate::lightning::ln::msgs::DecodeError on failure.
7364 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7366 typedef struct LDKCResult_InMemorySignerDecodeErrorZ {
7368 * The contents of this CResult_InMemorySignerDecodeErrorZ, accessible via either
7369 * `err` or `result` depending on the state of `result_ok`.
7371 union LDKCResult_InMemorySignerDecodeErrorZPtr contents;
7373 * Whether this CResult_InMemorySignerDecodeErrorZ represents a success state.
7376 } LDKCResult_InMemorySignerDecodeErrorZ;
7379 * A dynamically-allocated array of crate::c_types::TxOuts of arbitrary size.
7380 * This corresponds to std::vector in C++
7382 typedef struct LDKCVec_TxOutZ {
7384 * The elements in the array.
7385 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
7387 struct LDKTxOut *data;
7389 * The number of elements pointed to by `data`.
7395 * The contents of CResult_TransactionNoneZ
7397 typedef union LDKCResult_TransactionNoneZPtr {
7399 * A pointer to the contents in the success state.
7400 * Reading from this pointer when `result_ok` is not set is undefined.
7402 struct LDKTransaction *result;
7404 * Note that this value is always NULL, as there are no contents in the Err variant
7407 } LDKCResult_TransactionNoneZPtr;
7410 * A CResult_TransactionNoneZ represents the result of a fallible operation,
7411 * containing a crate::c_types::Transaction on success and a () on failure.
7412 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7414 typedef struct LDKCResult_TransactionNoneZ {
7416 * The contents of this CResult_TransactionNoneZ, accessible via either
7417 * `err` or `result` depending on the state of `result_ok`.
7419 union LDKCResult_TransactionNoneZPtr contents;
7421 * Whether this CResult_TransactionNoneZ represents a success state.
7424 } LDKCResult_TransactionNoneZ;
7429 * A ChannelMonitor handles chain events (blocks connected and disconnected) and generates
7430 * on-chain transactions to ensure no loss of funds occurs.
7432 * You MUST ensure that no ChannelMonitors for a given channel anywhere contain out-of-date
7433 * information and are actively monitoring the chain.
7435 * Pending Events or updated HTLCs which have not yet been read out by
7436 * get_and_clear_pending_monitor_events or get_and_clear_pending_events are serialized to disk and
7437 * reloaded at deserialize-time. Thus, you must ensure that, when handling events, all events
7438 * gotten are fully handled before re-serializing the new state.
7440 * Note that the deserializer is only implemented for (BlockHash, ChannelMonitor), which
7441 * tells you the last block hash which was block_connect()ed. You MUST rescan any blocks along
7442 * the \"reorg path\" (ie disconnecting blocks until you find a common ancestor from both the
7443 * returned block hash and the the current chain and then reconnecting blocks to get to the
7444 * best chain) upon deserializing the object!
7446 typedef struct MUST_USE_STRUCT LDKChannelMonitor {
7448 * A pointer to the opaque Rust object.
7449 * Nearly everywhere, inner must be non-null, however in places where
7450 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7452 LDKnativeChannelMonitor *inner;
7454 * Indicates that this is the only struct which contains the same pointer.
7455 * Rust functions which take ownership of an object provided via an argument require
7456 * this to be true and invalidate the object pointed to by inner.
7459 } LDKChannelMonitor;
7462 * A tuple of 2 elements. See the individual fields for the types contained.
7464 typedef struct LDKC2Tuple_BlockHashChannelMonitorZ {
7466 * The element at position 0
7468 struct LDKThirtyTwoBytes a;
7470 * The element at position 1
7472 struct LDKChannelMonitor b;
7473 } LDKC2Tuple_BlockHashChannelMonitorZ;
7476 * A dynamically-allocated array of crate::c_types::derived::C2Tuple_BlockHashChannelMonitorZs of arbitrary size.
7477 * This corresponds to std::vector in C++
7479 typedef struct LDKCVec_C2Tuple_BlockHashChannelMonitorZZ {
7481 * The elements in the array.
7482 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
7484 struct LDKC2Tuple_BlockHashChannelMonitorZ *data;
7486 * The number of elements pointed to by `data`.
7489 } LDKCVec_C2Tuple_BlockHashChannelMonitorZZ;
7492 * The contents of CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ
7494 typedef union LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZPtr {
7496 * A pointer to the contents in the success state.
7497 * Reading from this pointer when `result_ok` is not set is undefined.
7499 struct LDKCVec_C2Tuple_BlockHashChannelMonitorZZ *result;
7501 * A pointer to the contents in the error state.
7502 * Reading from this pointer when `result_ok` is set is undefined.
7504 enum LDKIOError *err;
7505 } LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZPtr;
7508 * A CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ represents the result of a fallible operation,
7509 * containing a crate::c_types::derived::CVec_C2Tuple_BlockHashChannelMonitorZZ on success and a crate::c_types::IOError on failure.
7510 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7512 typedef struct LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ {
7514 * The contents of this CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ, accessible via either
7515 * `err` or `result` depending on the state of `result_ok`.
7517 union LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZPtr contents;
7519 * Whether this CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ represents a success state.
7522 } LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ;
7525 * An enum which can either contain a u16 or not
7527 typedef enum LDKCOption_u16Z_Tag {
7529 * When we're in this state, this COption_u16Z contains a u16
7531 LDKCOption_u16Z_Some,
7533 * When we're in this state, this COption_u16Z contains nothing
7535 LDKCOption_u16Z_None,
7537 * Must be last for serialization purposes
7539 LDKCOption_u16Z_Sentinel,
7540 } LDKCOption_u16Z_Tag;
7542 typedef struct LDKCOption_u16Z {
7543 LDKCOption_u16Z_Tag tag;
7552 * Indicates an error on the client's part (usually some variant of attempting to use too-low or
7555 typedef enum LDKAPIError_Tag {
7557 * Indicates the API was wholly misused (see err for more). Cases where these can be returned
7558 * are documented, but generally indicates some precondition of a function was violated.
7560 LDKAPIError_APIMisuseError,
7562 * Due to a high feerate, we were unable to complete the request.
7563 * For example, this may be returned if the feerate implies we cannot open a channel at the
7564 * requested value, but opening a larger channel would succeed.
7566 LDKAPIError_FeeRateTooHigh,
7568 * A malformed Route was provided (eg overflowed value, node id mismatch, overly-looped route,
7569 * too-many-hops, etc).
7571 LDKAPIError_InvalidRoute,
7573 * We were unable to complete the request as the Channel required to do so is unable to
7574 * complete the request (or was not found). This can take many forms, including disconnected
7575 * peer, channel at capacity, channel shutting down, etc.
7577 LDKAPIError_ChannelUnavailable,
7579 * An attempt to call [`chain::Watch::watch_channel`]/[`chain::Watch::update_channel`]
7580 * returned a [`ChannelMonitorUpdateStatus::InProgress`] indicating the persistence of a
7581 * monitor update is awaiting async resolution. Once it resolves the attempted action should
7582 * complete automatically.
7584 * [`chain::Watch::watch_channel`]: crate::chain::Watch::watch_channel
7585 * [`chain::Watch::update_channel`]: crate::chain::Watch::update_channel
7586 * [`ChannelMonitorUpdateStatus::InProgress`]: crate::chain::ChannelMonitorUpdateStatus::InProgress
7588 LDKAPIError_MonitorUpdateInProgress,
7590 * [`KeysInterface::get_shutdown_scriptpubkey`] returned a shutdown scriptpubkey incompatible
7591 * with the channel counterparty as negotiated in [`InitFeatures`].
7593 * Using a SegWit v0 script should resolve this issue. If you cannot, you won't be able to open
7594 * a channel or cooperatively close one with this peer (and will have to force-close instead).
7596 * [`KeysInterface::get_shutdown_scriptpubkey`]: crate::chain::keysinterface::KeysInterface::get_shutdown_scriptpubkey
7597 * [`InitFeatures`]: crate::ln::features::InitFeatures
7599 LDKAPIError_IncompatibleShutdownScript,
7601 * Must be last for serialization purposes
7603 LDKAPIError_Sentinel,
7606 typedef struct LDKAPIError_LDKAPIMisuseError_Body {
7608 * A human-readable error message
7611 } LDKAPIError_LDKAPIMisuseError_Body;
7613 typedef struct LDKAPIError_LDKFeeRateTooHigh_Body {
7615 * A human-readable error message
7619 * The feerate which was too high.
7622 } LDKAPIError_LDKFeeRateTooHigh_Body;
7624 typedef struct LDKAPIError_LDKInvalidRoute_Body {
7626 * A human-readable error message
7629 } LDKAPIError_LDKInvalidRoute_Body;
7631 typedef struct LDKAPIError_LDKChannelUnavailable_Body {
7633 * A human-readable error message
7636 } LDKAPIError_LDKChannelUnavailable_Body;
7638 typedef struct LDKAPIError_LDKIncompatibleShutdownScript_Body {
7640 * The incompatible shutdown script.
7642 struct LDKShutdownScript script;
7643 } LDKAPIError_LDKIncompatibleShutdownScript_Body;
7645 typedef struct MUST_USE_STRUCT LDKAPIError {
7646 LDKAPIError_Tag tag;
7648 LDKAPIError_LDKAPIMisuseError_Body api_misuse_error;
7649 LDKAPIError_LDKFeeRateTooHigh_Body fee_rate_too_high;
7650 LDKAPIError_LDKInvalidRoute_Body invalid_route;
7651 LDKAPIError_LDKChannelUnavailable_Body channel_unavailable;
7652 LDKAPIError_LDKIncompatibleShutdownScript_Body incompatible_shutdown_script;
7657 * The contents of CResult_NoneAPIErrorZ
7659 typedef union LDKCResult_NoneAPIErrorZPtr {
7661 * Note that this value is always NULL, as there are no contents in the OK variant
7665 * A pointer to the contents in the error state.
7666 * Reading from this pointer when `result_ok` is set is undefined.
7668 struct LDKAPIError *err;
7669 } LDKCResult_NoneAPIErrorZPtr;
7672 * A CResult_NoneAPIErrorZ represents the result of a fallible operation,
7673 * containing a () on success and a crate::lightning::util::errors::APIError on failure.
7674 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7676 typedef struct LDKCResult_NoneAPIErrorZ {
7678 * The contents of this CResult_NoneAPIErrorZ, accessible via either
7679 * `err` or `result` depending on the state of `result_ok`.
7681 union LDKCResult_NoneAPIErrorZPtr contents;
7683 * Whether this CResult_NoneAPIErrorZ represents a success state.
7686 } LDKCResult_NoneAPIErrorZ;
7689 * A dynamically-allocated array of crate::c_types::derived::CResult_NoneAPIErrorZs of arbitrary size.
7690 * This corresponds to std::vector in C++
7692 typedef struct LDKCVec_CResult_NoneAPIErrorZZ {
7694 * The elements in the array.
7695 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
7697 struct LDKCResult_NoneAPIErrorZ *data;
7699 * The number of elements pointed to by `data`.
7702 } LDKCVec_CResult_NoneAPIErrorZZ;
7705 * A dynamically-allocated array of crate::lightning::util::errors::APIErrors of arbitrary size.
7706 * This corresponds to std::vector in C++
7708 typedef struct LDKCVec_APIErrorZ {
7710 * The elements in the array.
7711 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
7713 struct LDKAPIError *data;
7715 * The number of elements pointed to by `data`.
7718 } LDKCVec_APIErrorZ;
7721 * The contents of CResult__u832APIErrorZ
7723 typedef union LDKCResult__u832APIErrorZPtr {
7725 * A pointer to the contents in the success state.
7726 * Reading from this pointer when `result_ok` is not set is undefined.
7728 struct LDKThirtyTwoBytes *result;
7730 * A pointer to the contents in the error state.
7731 * Reading from this pointer when `result_ok` is set is undefined.
7733 struct LDKAPIError *err;
7734 } LDKCResult__u832APIErrorZPtr;
7737 * A CResult__u832APIErrorZ represents the result of a fallible operation,
7738 * containing a crate::c_types::ThirtyTwoBytes on success and a crate::lightning::util::errors::APIError on failure.
7739 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7741 typedef struct LDKCResult__u832APIErrorZ {
7743 * The contents of this CResult__u832APIErrorZ, accessible via either
7744 * `err` or `result` depending on the state of `result_ok`.
7746 union LDKCResult__u832APIErrorZPtr contents;
7748 * Whether this CResult__u832APIErrorZ represents a success state.
7751 } LDKCResult__u832APIErrorZ;
7754 * If a payment fails to send, it can be in one of several states. This enum is returned as the
7755 * Err() type describing which state the payment is in, see the description of individual enum
7758 typedef enum LDKPaymentSendFailure_Tag {
7760 * A parameter which was passed to send_payment was invalid, preventing us from attempting to
7761 * send the payment at all.
7763 * You can freely resend the payment in full (with the parameter error fixed).
7765 * Because the payment failed outright, no payment tracking is done, you do not need to call
7766 * [`ChannelManager::abandon_payment`] and [`ChannelManager::retry_payment`] will *not* work
7769 LDKPaymentSendFailure_ParameterError,
7771 * A parameter in a single path which was passed to send_payment was invalid, preventing us
7772 * from attempting to send the payment at all.
7774 * You can freely resend the payment in full (with the parameter error fixed).
7776 * The results here are ordered the same as the paths in the route object which was passed to
7779 * Because the payment failed outright, no payment tracking is done, you do not need to call
7780 * [`ChannelManager::abandon_payment`] and [`ChannelManager::retry_payment`] will *not* work
7783 LDKPaymentSendFailure_PathParameterError,
7785 * All paths which were attempted failed to send, with no channel state change taking place.
7786 * You can freely resend the payment in full (though you probably want to do so over different
7787 * paths than the ones selected).
7789 * Because the payment failed outright, no payment tracking is done, you do not need to call
7790 * [`ChannelManager::abandon_payment`] and [`ChannelManager::retry_payment`] will *not* work
7793 LDKPaymentSendFailure_AllFailedResendSafe,
7795 * Indicates that a payment for the provided [`PaymentId`] is already in-flight and has not
7796 * yet completed (i.e. generated an [`Event::PaymentSent`]) or been abandoned (via
7797 * [`ChannelManager::abandon_payment`]).
7799 * [`Event::PaymentSent`]: events::Event::PaymentSent
7801 LDKPaymentSendFailure_DuplicatePayment,
7803 * Some paths which were attempted failed to send, though possibly not all. At least some
7804 * paths have irrevocably committed to the HTLC and retrying the payment in full would result
7805 * in over-/re-payment.
7807 * The results here are ordered the same as the paths in the route object which was passed to
7808 * send_payment, and any `Err`s which are not [`APIError::MonitorUpdateInProgress`] can be
7809 * safely retried via [`ChannelManager::retry_payment`].
7811 * Any entries which contain `Err(APIError::MonitorUpdateInprogress)` or `Ok(())` MUST NOT be
7812 * retried as they will result in over-/re-payment. These HTLCs all either successfully sent
7813 * (in the case of `Ok(())`) or will send once a [`MonitorEvent::Completed`] is provided for
7814 * the next-hop channel with the latest update_id.
7816 LDKPaymentSendFailure_PartialFailure,
7818 * Must be last for serialization purposes
7820 LDKPaymentSendFailure_Sentinel,
7821 } LDKPaymentSendFailure_Tag;
7823 typedef struct LDKPaymentSendFailure_LDKPartialFailure_Body {
7825 * The errors themselves, in the same order as the route hops.
7827 struct LDKCVec_CResult_NoneAPIErrorZZ results;
7829 * If some paths failed without irrevocably committing to the new HTLC(s), this will
7830 * contain a [`RouteParameters`] object which can be used to calculate a new route that
7831 * will pay all remaining unpaid balance.
7833 * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
7835 struct LDKRouteParameters failed_paths_retry;
7837 * The payment id for the payment, which is now at least partially pending.
7839 struct LDKThirtyTwoBytes payment_id;
7840 } LDKPaymentSendFailure_LDKPartialFailure_Body;
7842 typedef struct MUST_USE_STRUCT LDKPaymentSendFailure {
7843 LDKPaymentSendFailure_Tag tag;
7846 struct LDKAPIError parameter_error;
7849 struct LDKCVec_CResult_NoneAPIErrorZZ path_parameter_error;
7852 struct LDKCVec_APIErrorZ all_failed_resend_safe;
7854 LDKPaymentSendFailure_LDKPartialFailure_Body partial_failure;
7856 } LDKPaymentSendFailure;
7859 * The contents of CResult_NonePaymentSendFailureZ
7861 typedef union LDKCResult_NonePaymentSendFailureZPtr {
7863 * Note that this value is always NULL, as there are no contents in the OK variant
7867 * A pointer to the contents in the error state.
7868 * Reading from this pointer when `result_ok` is set is undefined.
7870 struct LDKPaymentSendFailure *err;
7871 } LDKCResult_NonePaymentSendFailureZPtr;
7874 * A CResult_NonePaymentSendFailureZ represents the result of a fallible operation,
7875 * containing a () on success and a crate::lightning::ln::channelmanager::PaymentSendFailure on failure.
7876 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7878 typedef struct LDKCResult_NonePaymentSendFailureZ {
7880 * The contents of this CResult_NonePaymentSendFailureZ, accessible via either
7881 * `err` or `result` depending on the state of `result_ok`.
7883 union LDKCResult_NonePaymentSendFailureZPtr contents;
7885 * Whether this CResult_NonePaymentSendFailureZ represents a success state.
7888 } LDKCResult_NonePaymentSendFailureZ;
7891 * The contents of CResult_PaymentHashPaymentSendFailureZ
7893 typedef union LDKCResult_PaymentHashPaymentSendFailureZPtr {
7895 * A pointer to the contents in the success state.
7896 * Reading from this pointer when `result_ok` is not set is undefined.
7898 struct LDKThirtyTwoBytes *result;
7900 * A pointer to the contents in the error state.
7901 * Reading from this pointer when `result_ok` is set is undefined.
7903 struct LDKPaymentSendFailure *err;
7904 } LDKCResult_PaymentHashPaymentSendFailureZPtr;
7907 * A CResult_PaymentHashPaymentSendFailureZ represents the result of a fallible operation,
7908 * containing a crate::c_types::ThirtyTwoBytes on success and a crate::lightning::ln::channelmanager::PaymentSendFailure on failure.
7909 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7911 typedef struct LDKCResult_PaymentHashPaymentSendFailureZ {
7913 * The contents of this CResult_PaymentHashPaymentSendFailureZ, accessible via either
7914 * `err` or `result` depending on the state of `result_ok`.
7916 union LDKCResult_PaymentHashPaymentSendFailureZPtr contents;
7918 * Whether this CResult_PaymentHashPaymentSendFailureZ represents a success state.
7921 } LDKCResult_PaymentHashPaymentSendFailureZ;
7924 * A tuple of 2 elements. See the individual fields for the types contained.
7926 typedef struct LDKC2Tuple_PaymentHashPaymentIdZ {
7928 * The element at position 0
7930 struct LDKThirtyTwoBytes a;
7932 * The element at position 1
7934 struct LDKThirtyTwoBytes b;
7935 } LDKC2Tuple_PaymentHashPaymentIdZ;
7938 * The contents of CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ
7940 typedef union LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZPtr {
7942 * A pointer to the contents in the success state.
7943 * Reading from this pointer when `result_ok` is not set is undefined.
7945 struct LDKC2Tuple_PaymentHashPaymentIdZ *result;
7947 * A pointer to the contents in the error state.
7948 * Reading from this pointer when `result_ok` is set is undefined.
7950 struct LDKPaymentSendFailure *err;
7951 } LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZPtr;
7954 * A CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ represents the result of a fallible operation,
7955 * containing a crate::c_types::derived::C2Tuple_PaymentHashPaymentIdZ on success and a crate::lightning::ln::channelmanager::PaymentSendFailure on failure.
7956 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7958 typedef struct LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ {
7960 * The contents of this CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ, accessible via either
7961 * `err` or `result` depending on the state of `result_ok`.
7963 union LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZPtr contents;
7965 * Whether this CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ represents a success state.
7968 } LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ;
7971 * A dynamically-allocated array of crate::c_types::ThirtyTwoBytess of arbitrary size.
7972 * This corresponds to std::vector in C++
7974 typedef struct LDKCVec_ThirtyTwoBytesZ {
7976 * The elements in the array.
7977 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
7979 struct LDKThirtyTwoBytes *data;
7981 * The number of elements pointed to by `data`.
7984 } LDKCVec_ThirtyTwoBytesZ;
7987 * A tuple of 2 elements. See the individual fields for the types contained.
7989 typedef struct LDKC2Tuple_PaymentHashPaymentSecretZ {
7991 * The element at position 0
7993 struct LDKThirtyTwoBytes a;
7995 * The element at position 1
7997 struct LDKThirtyTwoBytes b;
7998 } LDKC2Tuple_PaymentHashPaymentSecretZ;
8001 * The contents of CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ
8003 typedef union LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZPtr {
8005 * A pointer to the contents in the success state.
8006 * Reading from this pointer when `result_ok` is not set is undefined.
8008 struct LDKC2Tuple_PaymentHashPaymentSecretZ *result;
8010 * Note that this value is always NULL, as there are no contents in the Err variant
8013 } LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZPtr;
8016 * A CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ represents the result of a fallible operation,
8017 * containing a crate::c_types::derived::C2Tuple_PaymentHashPaymentSecretZ on success and a () on failure.
8018 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8020 typedef struct LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ {
8022 * The contents of this CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ, accessible via either
8023 * `err` or `result` depending on the state of `result_ok`.
8025 union LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZPtr contents;
8027 * Whether this CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ represents a success state.
8030 } LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ;
8033 * The contents of CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ
8035 typedef union LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZPtr {
8037 * A pointer to the contents in the success state.
8038 * Reading from this pointer when `result_ok` is not set is undefined.
8040 struct LDKC2Tuple_PaymentHashPaymentSecretZ *result;
8042 * A pointer to the contents in the error state.
8043 * Reading from this pointer when `result_ok` is set is undefined.
8045 struct LDKAPIError *err;
8046 } LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZPtr;
8049 * A CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ represents the result of a fallible operation,
8050 * containing a crate::c_types::derived::C2Tuple_PaymentHashPaymentSecretZ on success and a crate::lightning::util::errors::APIError on failure.
8051 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8053 typedef struct LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ {
8055 * The contents of this CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ, accessible via either
8056 * `err` or `result` depending on the state of `result_ok`.
8058 union LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZPtr contents;
8060 * Whether this CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ represents a success state.
8063 } LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ;
8066 * The contents of CResult_PaymentSecretNoneZ
8068 typedef union LDKCResult_PaymentSecretNoneZPtr {
8070 * A pointer to the contents in the success state.
8071 * Reading from this pointer when `result_ok` is not set is undefined.
8073 struct LDKThirtyTwoBytes *result;
8075 * Note that this value is always NULL, as there are no contents in the Err variant
8078 } LDKCResult_PaymentSecretNoneZPtr;
8081 * A CResult_PaymentSecretNoneZ represents the result of a fallible operation,
8082 * containing a crate::c_types::ThirtyTwoBytes on success and a () on failure.
8083 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8085 typedef struct LDKCResult_PaymentSecretNoneZ {
8087 * The contents of this CResult_PaymentSecretNoneZ, accessible via either
8088 * `err` or `result` depending on the state of `result_ok`.
8090 union LDKCResult_PaymentSecretNoneZPtr contents;
8092 * Whether this CResult_PaymentSecretNoneZ represents a success state.
8095 } LDKCResult_PaymentSecretNoneZ;
8098 * The contents of CResult_PaymentSecretAPIErrorZ
8100 typedef union LDKCResult_PaymentSecretAPIErrorZPtr {
8102 * A pointer to the contents in the success state.
8103 * Reading from this pointer when `result_ok` is not set is undefined.
8105 struct LDKThirtyTwoBytes *result;
8107 * A pointer to the contents in the error state.
8108 * Reading from this pointer when `result_ok` is set is undefined.
8110 struct LDKAPIError *err;
8111 } LDKCResult_PaymentSecretAPIErrorZPtr;
8114 * A CResult_PaymentSecretAPIErrorZ represents the result of a fallible operation,
8115 * containing a crate::c_types::ThirtyTwoBytes on success and a crate::lightning::util::errors::APIError on failure.
8116 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8118 typedef struct LDKCResult_PaymentSecretAPIErrorZ {
8120 * The contents of this CResult_PaymentSecretAPIErrorZ, accessible via either
8121 * `err` or `result` depending on the state of `result_ok`.
8123 union LDKCResult_PaymentSecretAPIErrorZPtr contents;
8125 * Whether this CResult_PaymentSecretAPIErrorZ represents a success state.
8128 } LDKCResult_PaymentSecretAPIErrorZ;
8131 * The contents of CResult_PaymentPreimageAPIErrorZ
8133 typedef union LDKCResult_PaymentPreimageAPIErrorZPtr {
8135 * A pointer to the contents in the success state.
8136 * Reading from this pointer when `result_ok` is not set is undefined.
8138 struct LDKThirtyTwoBytes *result;
8140 * A pointer to the contents in the error state.
8141 * Reading from this pointer when `result_ok` is set is undefined.
8143 struct LDKAPIError *err;
8144 } LDKCResult_PaymentPreimageAPIErrorZPtr;
8147 * A CResult_PaymentPreimageAPIErrorZ represents the result of a fallible operation,
8148 * containing a crate::c_types::ThirtyTwoBytes on success and a crate::lightning::util::errors::APIError on failure.
8149 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8151 typedef struct LDKCResult_PaymentPreimageAPIErrorZ {
8153 * The contents of this CResult_PaymentPreimageAPIErrorZ, accessible via either
8154 * `err` or `result` depending on the state of `result_ok`.
8156 union LDKCResult_PaymentPreimageAPIErrorZPtr contents;
8158 * Whether this CResult_PaymentPreimageAPIErrorZ represents a success state.
8161 } LDKCResult_PaymentPreimageAPIErrorZ;
8166 * Information needed for constructing an invoice route hint for this channel.
8168 typedef struct MUST_USE_STRUCT LDKCounterpartyForwardingInfo {
8170 * A pointer to the opaque Rust object.
8171 * Nearly everywhere, inner must be non-null, however in places where
8172 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8174 LDKnativeCounterpartyForwardingInfo *inner;
8176 * Indicates that this is the only struct which contains the same pointer.
8177 * Rust functions which take ownership of an object provided via an argument require
8178 * this to be true and invalidate the object pointed to by inner.
8181 } LDKCounterpartyForwardingInfo;
8184 * The contents of CResult_CounterpartyForwardingInfoDecodeErrorZ
8186 typedef union LDKCResult_CounterpartyForwardingInfoDecodeErrorZPtr {
8188 * A pointer to the contents in the success state.
8189 * Reading from this pointer when `result_ok` is not set is undefined.
8191 struct LDKCounterpartyForwardingInfo *result;
8193 * A pointer to the contents in the error state.
8194 * Reading from this pointer when `result_ok` is set is undefined.
8196 struct LDKDecodeError *err;
8197 } LDKCResult_CounterpartyForwardingInfoDecodeErrorZPtr;
8200 * A CResult_CounterpartyForwardingInfoDecodeErrorZ represents the result of a fallible operation,
8201 * containing a crate::lightning::ln::channelmanager::CounterpartyForwardingInfo on success and a crate::lightning::ln::msgs::DecodeError on failure.
8202 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8204 typedef struct LDKCResult_CounterpartyForwardingInfoDecodeErrorZ {
8206 * The contents of this CResult_CounterpartyForwardingInfoDecodeErrorZ, accessible via either
8207 * `err` or `result` depending on the state of `result_ok`.
8209 union LDKCResult_CounterpartyForwardingInfoDecodeErrorZPtr contents;
8211 * Whether this CResult_CounterpartyForwardingInfoDecodeErrorZ represents a success state.
8214 } LDKCResult_CounterpartyForwardingInfoDecodeErrorZ;
8219 * Channel parameters which apply to our counterparty. These are split out from [`ChannelDetails`]
8220 * to better separate parameters.
8222 typedef struct MUST_USE_STRUCT LDKChannelCounterparty {
8224 * A pointer to the opaque Rust object.
8225 * Nearly everywhere, inner must be non-null, however in places where
8226 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8228 LDKnativeChannelCounterparty *inner;
8230 * Indicates that this is the only struct which contains the same pointer.
8231 * Rust functions which take ownership of an object provided via an argument require
8232 * this to be true and invalidate the object pointed to by inner.
8235 } LDKChannelCounterparty;
8238 * The contents of CResult_ChannelCounterpartyDecodeErrorZ
8240 typedef union LDKCResult_ChannelCounterpartyDecodeErrorZPtr {
8242 * A pointer to the contents in the success state.
8243 * Reading from this pointer when `result_ok` is not set is undefined.
8245 struct LDKChannelCounterparty *result;
8247 * A pointer to the contents in the error state.
8248 * Reading from this pointer when `result_ok` is set is undefined.
8250 struct LDKDecodeError *err;
8251 } LDKCResult_ChannelCounterpartyDecodeErrorZPtr;
8254 * A CResult_ChannelCounterpartyDecodeErrorZ represents the result of a fallible operation,
8255 * containing a crate::lightning::ln::channelmanager::ChannelCounterparty on success and a crate::lightning::ln::msgs::DecodeError on failure.
8256 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8258 typedef struct LDKCResult_ChannelCounterpartyDecodeErrorZ {
8260 * The contents of this CResult_ChannelCounterpartyDecodeErrorZ, accessible via either
8261 * `err` or `result` depending on the state of `result_ok`.
8263 union LDKCResult_ChannelCounterpartyDecodeErrorZPtr contents;
8265 * Whether this CResult_ChannelCounterpartyDecodeErrorZ represents a success state.
8268 } LDKCResult_ChannelCounterpartyDecodeErrorZ;
8271 * The contents of CResult_ChannelDetailsDecodeErrorZ
8273 typedef union LDKCResult_ChannelDetailsDecodeErrorZPtr {
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 LDKChannelDetails *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 LDKDecodeError *err;
8284 } LDKCResult_ChannelDetailsDecodeErrorZPtr;
8287 * A CResult_ChannelDetailsDecodeErrorZ represents the result of a fallible operation,
8288 * containing a crate::lightning::ln::channelmanager::ChannelDetails on success and a crate::lightning::ln::msgs::DecodeError on failure.
8289 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8291 typedef struct LDKCResult_ChannelDetailsDecodeErrorZ {
8293 * The contents of this CResult_ChannelDetailsDecodeErrorZ, accessible via either
8294 * `err` or `result` depending on the state of `result_ok`.
8296 union LDKCResult_ChannelDetailsDecodeErrorZPtr contents;
8298 * Whether this CResult_ChannelDetailsDecodeErrorZ represents a success state.
8301 } LDKCResult_ChannelDetailsDecodeErrorZ;
8306 * Route hints used in constructing invoices for [phantom node payents].
8308 * [phantom node payments]: crate::chain::keysinterface::PhantomKeysManager
8310 typedef struct MUST_USE_STRUCT LDKPhantomRouteHints {
8312 * A pointer to the opaque Rust object.
8313 * Nearly everywhere, inner must be non-null, however in places where
8314 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8316 LDKnativePhantomRouteHints *inner;
8318 * Indicates that this is the only struct which contains the same pointer.
8319 * Rust functions which take ownership of an object provided via an argument require
8320 * this to be true and invalidate the object pointed to by inner.
8323 } LDKPhantomRouteHints;
8326 * The contents of CResult_PhantomRouteHintsDecodeErrorZ
8328 typedef union LDKCResult_PhantomRouteHintsDecodeErrorZPtr {
8330 * A pointer to the contents in the success state.
8331 * Reading from this pointer when `result_ok` is not set is undefined.
8333 struct LDKPhantomRouteHints *result;
8335 * A pointer to the contents in the error state.
8336 * Reading from this pointer when `result_ok` is set is undefined.
8338 struct LDKDecodeError *err;
8339 } LDKCResult_PhantomRouteHintsDecodeErrorZPtr;
8342 * A CResult_PhantomRouteHintsDecodeErrorZ represents the result of a fallible operation,
8343 * containing a crate::lightning::ln::channelmanager::PhantomRouteHints on success and a crate::lightning::ln::msgs::DecodeError on failure.
8344 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8346 typedef struct LDKCResult_PhantomRouteHintsDecodeErrorZ {
8348 * The contents of this CResult_PhantomRouteHintsDecodeErrorZ, accessible via either
8349 * `err` or `result` depending on the state of `result_ok`.
8351 union LDKCResult_PhantomRouteHintsDecodeErrorZPtr contents;
8353 * Whether this CResult_PhantomRouteHintsDecodeErrorZ represents a success state.
8356 } LDKCResult_PhantomRouteHintsDecodeErrorZ;
8359 * A dynamically-allocated array of crate::lightning::chain::channelmonitor::ChannelMonitors of arbitrary size.
8360 * This corresponds to std::vector in C++
8362 typedef struct LDKCVec_ChannelMonitorZ {
8364 * The elements in the array.
8365 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
8367 struct LDKChannelMonitor *data;
8369 * The number of elements pointed to by `data`.
8372 } LDKCVec_ChannelMonitorZ;
8377 * An update generated by the underlying channel itself which contains some new information the
8378 * [`ChannelMonitor`] should be made aware of.
8380 * Because this represents only a small number of updates to the underlying state, it is generally
8381 * much smaller than a full [`ChannelMonitor`]. However, for large single commitment transaction
8382 * updates (e.g. ones during which there are hundreds of HTLCs pending on the commitment
8383 * transaction), a single update may reach upwards of 1 MiB in serialized size.
8385 typedef struct MUST_USE_STRUCT LDKChannelMonitorUpdate {
8387 * A pointer to the opaque Rust object.
8388 * Nearly everywhere, inner must be non-null, however in places where
8389 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8391 LDKnativeChannelMonitorUpdate *inner;
8393 * Indicates that this is the only struct which contains the same pointer.
8394 * Rust functions which take ownership of an object provided via an argument require
8395 * this to be true and invalidate the object pointed to by inner.
8398 } LDKChannelMonitorUpdate;
8401 * The `Watch` trait defines behavior for watching on-chain activity pertaining to channels as
8402 * blocks are connected and disconnected.
8404 * Each channel is associated with a [`ChannelMonitor`]. Implementations of this trait are
8405 * responsible for maintaining a set of monitors such that they can be updated accordingly as
8406 * channel state changes and HTLCs are resolved. See method documentation for specific
8409 * Implementations **must** ensure that updates are successfully applied and persisted upon method
8410 * completion. If an update fails with a [`PermanentFailure`], then it must immediately shut down
8411 * without taking any further action such as persisting the current state.
8413 * If an implementation maintains multiple instances of a channel's monitor (e.g., by storing
8414 * backup copies), then it must ensure that updates are applied across all instances. Otherwise, it
8415 * could result in a revoked transaction being broadcast, allowing the counterparty to claim all
8416 * funds in the channel. See [`ChannelMonitorUpdateStatus`] for more details about how to handle
8417 * multiple instances.
8419 * [`PermanentFailure`]: ChannelMonitorUpdateStatus::PermanentFailure
8421 typedef struct LDKWatch {
8423 * An opaque pointer which is passed to your function implementations as an argument.
8424 * This has no meaning in the LDK, and can be NULL or any other value.
8428 * Watches a channel identified by `funding_txo` using `monitor`.
8430 * Implementations are responsible for watching the chain for the funding transaction along
8431 * with any spends of outputs returned by [`get_outputs_to_watch`]. In practice, this means
8432 * calling [`block_connected`] and [`block_disconnected`] on the monitor.
8434 * Note: this interface MUST error with [`ChannelMonitorUpdateStatus::PermanentFailure`] if
8435 * the given `funding_txo` has previously been registered via `watch_channel`.
8437 * [`get_outputs_to_watch`]: channelmonitor::ChannelMonitor::get_outputs_to_watch
8438 * [`block_connected`]: channelmonitor::ChannelMonitor::block_connected
8439 * [`block_disconnected`]: channelmonitor::ChannelMonitor::block_disconnected
8441 enum LDKChannelMonitorUpdateStatus (*watch_channel)(const void *this_arg, struct LDKOutPoint funding_txo, struct LDKChannelMonitor monitor);
8443 * Updates a channel identified by `funding_txo` by applying `update` to its monitor.
8445 * Implementations must call [`update_monitor`] with the given update. See
8446 * [`ChannelMonitorUpdateStatus`] for invariants around returning an error.
8448 * [`update_monitor`]: channelmonitor::ChannelMonitor::update_monitor
8450 enum LDKChannelMonitorUpdateStatus (*update_channel)(const void *this_arg, struct LDKOutPoint funding_txo, struct LDKChannelMonitorUpdate update);
8452 * Returns any monitor events since the last call. Subsequent calls must only return new
8455 * Note that after any block- or transaction-connection calls to a [`ChannelMonitor`], no
8456 * further events may be returned here until the [`ChannelMonitor`] has been fully persisted
8459 * For details on asynchronous [`ChannelMonitor`] updating and returning
8460 * [`MonitorEvent::Completed`] here, see [`ChannelMonitorUpdateStatus::InProgress`].
8462 struct LDKCVec_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZZ (*release_pending_monitor_events)(const void *this_arg);
8464 * Frees any resources associated with this object given its this_arg pointer.
8465 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
8467 void (*free)(void *this_arg);
8471 * An interface to send a transaction to the Bitcoin network.
8473 typedef struct LDKBroadcasterInterface {
8475 * An opaque pointer which is passed to your function implementations as an argument.
8476 * This has no meaning in the LDK, and can be NULL or any other value.
8480 * Sends a transaction out to (hopefully) be mined.
8482 void (*broadcast_transaction)(const void *this_arg, struct LDKTransaction tx);
8484 * Frees any resources associated with this object given its this_arg pointer.
8485 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
8487 void (*free)(void *this_arg);
8488 } LDKBroadcasterInterface;
8491 * A "slice" referencing some byte array. This is simply a length-tagged pointer which does not
8492 * own the memory pointed to by data.
8494 typedef struct LDKu8slice {
8496 * A pointer to the byte buffer
8498 const uint8_t *data;
8500 * The number of bytes pointed to by `data`.
8506 * A trait to describe an object which can get user secrets and key material.
8508 typedef struct LDKKeysInterface {
8510 * An opaque pointer which is passed to your function implementations as an argument.
8511 * This has no meaning in the LDK, and can be NULL or any other value.
8515 * Get node secret key based on the provided [`Recipient`].
8517 * The `node_id`/`network_key` is the public key that corresponds to this secret key.
8519 * This method must return the same value each time it is called with a given [`Recipient`]
8522 * Errors if the [`Recipient`] variant is not supported by the implementation.
8524 struct LDKCResult_SecretKeyNoneZ (*get_node_secret)(const void *this_arg, enum LDKRecipient recipient);
8526 * Get node id based on the provided [`Recipient`]. This public key corresponds to the secret in
8527 * [`get_node_secret`].
8529 * This method must return the same value each time it is called with a given [`Recipient`]
8532 * Errors if the [`Recipient`] variant is not supported by the implementation.
8534 * [`get_node_secret`]: Self::get_node_secret
8536 struct LDKCResult_PublicKeyNoneZ (*get_node_id)(const void *this_arg, enum LDKRecipient recipient);
8538 * Gets the ECDH shared secret of our [`node secret`] and `other_key`, multiplying by `tweak` if
8539 * one is provided. Note that this tweak can be applied to `other_key` instead of our node
8540 * secret, though this is less efficient.
8542 * Errors if the [`Recipient`] variant is not supported by the implementation.
8544 * [`node secret`]: Self::get_node_secret
8546 struct LDKCResult_SharedSecretNoneZ (*ecdh)(const void *this_arg, enum LDKRecipient recipient, struct LDKPublicKey other_key, struct LDKCOption_ScalarZ tweak);
8548 * Get a script pubkey which we send funds to when claiming on-chain contestable outputs.
8550 * This method should return a different value each time it is called, to avoid linking
8551 * on-chain funds across channels as controlled to the same user.
8553 struct LDKCVec_u8Z (*get_destination_script)(const void *this_arg);
8555 * Get a script pubkey which we will send funds to when closing a channel.
8557 * This method should return a different value each time it is called, to avoid linking
8558 * on-chain funds across channels as controlled to the same user.
8560 struct LDKShutdownScript (*get_shutdown_scriptpubkey)(const void *this_arg);
8562 * Get a new set of [`Sign`] for per-channel secrets. These MUST be unique even if you
8563 * restarted with some stale data!
8565 * This method must return a different value each time it is called.
8567 struct LDKThirtyTwoBytes (*generate_channel_keys_id)(const void *this_arg, bool inbound, uint64_t channel_value_satoshis, struct LDKU128 user_channel_id);
8569 * Derives the private key material backing a `Signer`.
8571 * To derive a new `Signer`, a fresh `channel_keys_id` should be obtained through
8572 * [`KeysInterface::generate_channel_keys_id`]. Otherwise, an existing `Signer` can be
8573 * re-derived from its `channel_keys_id`, which can be obtained through its trait method
8574 * [`BaseSign::channel_keys_id`].
8576 struct LDKSign (*derive_channel_signer)(const void *this_arg, uint64_t channel_value_satoshis, struct LDKThirtyTwoBytes channel_keys_id);
8578 * Gets a unique, cryptographically-secure, random 32 byte value. This is used for encrypting
8579 * onion packets and for temporary channel IDs. There is no requirement that these be
8580 * persisted anywhere, though they must be unique across restarts.
8582 * This method must return a different value each time it is called.
8584 struct LDKThirtyTwoBytes (*get_secure_random_bytes)(const void *this_arg);
8586 * Reads a [`Signer`] for this [`KeysInterface`] from the given input stream.
8587 * This is only called during deserialization of other objects which contain
8588 * [`Sign`]-implementing objects (i.e., [`ChannelMonitor`]s and [`ChannelManager`]s).
8589 * The bytes are exactly those which `<Self::Signer as Writeable>::write()` writes, and
8590 * contain no versioning scheme. You may wish to include your own version prefix and ensure
8591 * you've read all of the provided bytes to ensure no corruption occurred.
8593 * This method is slowly being phased out -- it will only be called when reading objects
8594 * written by LDK versions prior to 0.0.113.
8596 * [`Signer`]: Self::Signer
8597 * [`ChannelMonitor`]: crate::chain::channelmonitor::ChannelMonitor
8598 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
8600 struct LDKCResult_SignDecodeErrorZ (*read_chan_signer)(const void *this_arg, struct LDKu8slice reader);
8603 * By parameterizing by the raw invoice bytes instead of the hash, we allow implementors of
8604 * this trait to parse the invoice and make sure they're signing what they expect, rather than
8605 * blindly signing the hash.
8606 * The `hrp` is ASCII bytes, while the invoice data is base32-encoded.
8608 * The secret key used to sign the invoice is dependent on the [`Recipient`].
8610 * Errors if the [`Recipient`] variant is not supported by the implementation.
8612 struct LDKCResult_RecoverableSignatureNoneZ (*sign_invoice)(const void *this_arg, struct LDKu8slice hrp_bytes, struct LDKCVec_U5Z invoice_data, enum LDKRecipient receipient);
8614 * Get secret key material as bytes for use in encrypting and decrypting inbound payment data.
8616 * If the implementor of this trait supports [phantom node payments], then every node that is
8617 * intended to be included in the phantom invoice route hints must return the same value from
8620 * This method must return the same value each time it is called.
8622 * [phantom node payments]: PhantomKeysManager
8624 struct LDKThirtyTwoBytes (*get_inbound_payment_key_material)(const void *this_arg);
8626 * Frees any resources associated with this object given its this_arg pointer.
8627 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
8629 void (*free)(void *this_arg);
8633 * A trait which should be implemented to provide feerate information on a number of time
8636 * Note that all of the functions implemented here *must* be reentrant-safe (obviously - they're
8637 * called from inside the library in response to chain events, P2P events, or timer events).
8639 typedef struct LDKFeeEstimator {
8641 * An opaque pointer which is passed to your function implementations as an argument.
8642 * This has no meaning in the LDK, and can be NULL or any other value.
8646 * Gets estimated satoshis of fee required per 1000 Weight-Units.
8648 * LDK will wrap this method and ensure that the value returned is no smaller than 253
8649 * (ie 1 satoshi-per-byte rounded up to ensure later round-downs don't put us below 1 satoshi-per-byte).
8651 * The following unit conversions can be used to convert to sats/KW:
8652 * * satoshis-per-byte * 250
8653 * * satoshis-per-kbyte / 4
8655 uint32_t (*get_est_sat_per_1000_weight)(const void *this_arg, enum LDKConfirmationTarget confirmation_target);
8657 * Frees any resources associated with this object given its this_arg pointer.
8658 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
8660 void (*free)(void *this_arg);
8666 * Manager which keeps track of a number of channels and sends messages to the appropriate
8667 * channel, also tracking HTLC preimages and forwarding onion packets appropriately.
8669 * Implements ChannelMessageHandler, handling the multi-channel parts and passing things through
8670 * to individual Channels.
8672 * Implements Writeable to write out all channel state to disk. Implies peer_disconnected() for
8673 * all peers during write/read (though does not modify this instance, only the instance being
8674 * serialized). This will result in any channels which have not yet exchanged funding_created (ie
8675 * called funding_transaction_generated for outbound channels).
8677 * Note that you can be a bit lazier about writing out ChannelManager than you can be with
8678 * ChannelMonitors. With ChannelMonitors you MUST write each monitor update out to disk before
8679 * returning from chain::Watch::watch_/update_channel, with ChannelManagers, writing updates
8680 * happens out-of-band (and will prevent any other ChannelManager operations from occurring during
8681 * the serialization process). If the deserialized version is out-of-date compared to the
8682 * ChannelMonitors passed by reference to read(), those channels will be force-closed based on the
8683 * ChannelMonitor state and no funds will be lost (mod on-chain transaction fees).
8685 * Note that the deserializer is only implemented for (BlockHash, ChannelManager), which
8686 * tells you the last block hash which was block_connect()ed. You MUST rescan any blocks along
8687 * the \"reorg path\" (ie call block_disconnected() until you get to a common block and then call
8688 * block_connected() to step towards your best block) upon deserialization before using the
8691 * Note that ChannelManager is responsible for tracking liveness of its channels and generating
8692 * ChannelUpdate messages informing peers that the channel is temporarily disabled. To avoid
8693 * spam due to quick disconnection/reconnection, updates are not sent until the channel has been
8694 * offline for a full minute. In order to track this, you must call
8695 * timer_tick_occurred roughly once per minute, though it doesn't have to be perfect.
8697 * Rather than using a plain ChannelManager, it is preferable to use either a SimpleArcChannelManager
8698 * a SimpleRefChannelManager, for conciseness. See their documentation for more details, but
8699 * essentially you should default to using a SimpleRefChannelManager, and use a
8700 * SimpleArcChannelManager when you require a ChannelManager with a static lifetime, such as when
8701 * you're using lightning-net-tokio.
8703 typedef struct MUST_USE_STRUCT LDKChannelManager {
8705 * A pointer to the opaque Rust object.
8706 * Nearly everywhere, inner must be non-null, however in places where
8707 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8709 LDKnativeChannelManager *inner;
8711 * Indicates that this is the only struct which contains the same pointer.
8712 * Rust functions which take ownership of an object provided via an argument require
8713 * this to be true and invalidate the object pointed to by inner.
8716 } LDKChannelManager;
8719 * A tuple of 2 elements. See the individual fields for the types contained.
8721 typedef struct LDKC2Tuple_BlockHashChannelManagerZ {
8723 * The element at position 0
8725 struct LDKThirtyTwoBytes a;
8727 * The element at position 1
8729 struct LDKChannelManager b;
8730 } LDKC2Tuple_BlockHashChannelManagerZ;
8733 * The contents of CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ
8735 typedef union LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZPtr {
8737 * A pointer to the contents in the success state.
8738 * Reading from this pointer when `result_ok` is not set is undefined.
8740 struct LDKC2Tuple_BlockHashChannelManagerZ *result;
8742 * A pointer to the contents in the error state.
8743 * Reading from this pointer when `result_ok` is set is undefined.
8745 struct LDKDecodeError *err;
8746 } LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZPtr;
8749 * A CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ represents the result of a fallible operation,
8750 * containing a crate::c_types::derived::C2Tuple_BlockHashChannelManagerZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
8751 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8753 typedef struct LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ {
8755 * The contents of this CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ, accessible via either
8756 * `err` or `result` depending on the state of `result_ok`.
8758 union LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZPtr contents;
8760 * Whether this CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ represents a success state.
8763 } LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ;
8768 * Options which apply on a per-channel basis and may change at runtime or based on negotiation
8769 * with our counterparty.
8771 typedef struct MUST_USE_STRUCT LDKChannelConfig {
8773 * A pointer to the opaque Rust object.
8774 * Nearly everywhere, inner must be non-null, however in places where
8775 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8777 LDKnativeChannelConfig *inner;
8779 * Indicates that this is the only struct which contains the same pointer.
8780 * Rust functions which take ownership of an object provided via an argument require
8781 * this to be true and invalidate the object pointed to by inner.
8787 * The contents of CResult_ChannelConfigDecodeErrorZ
8789 typedef union LDKCResult_ChannelConfigDecodeErrorZPtr {
8791 * A pointer to the contents in the success state.
8792 * Reading from this pointer when `result_ok` is not set is undefined.
8794 struct LDKChannelConfig *result;
8796 * A pointer to the contents in the error state.
8797 * Reading from this pointer when `result_ok` is set is undefined.
8799 struct LDKDecodeError *err;
8800 } LDKCResult_ChannelConfigDecodeErrorZPtr;
8803 * A CResult_ChannelConfigDecodeErrorZ represents the result of a fallible operation,
8804 * containing a crate::lightning::util::config::ChannelConfig on success and a crate::lightning::ln::msgs::DecodeError on failure.
8805 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8807 typedef struct LDKCResult_ChannelConfigDecodeErrorZ {
8809 * The contents of this CResult_ChannelConfigDecodeErrorZ, accessible via either
8810 * `err` or `result` depending on the state of `result_ok`.
8812 union LDKCResult_ChannelConfigDecodeErrorZPtr contents;
8814 * Whether this CResult_ChannelConfigDecodeErrorZ represents a success state.
8817 } LDKCResult_ChannelConfigDecodeErrorZ;
8820 * The contents of CResult_OutPointDecodeErrorZ
8822 typedef union LDKCResult_OutPointDecodeErrorZPtr {
8824 * A pointer to the contents in the success state.
8825 * Reading from this pointer when `result_ok` is not set is undefined.
8827 struct LDKOutPoint *result;
8829 * A pointer to the contents in the error state.
8830 * Reading from this pointer when `result_ok` is set is undefined.
8832 struct LDKDecodeError *err;
8833 } LDKCResult_OutPointDecodeErrorZPtr;
8836 * A CResult_OutPointDecodeErrorZ represents the result of a fallible operation,
8837 * containing a crate::lightning::chain::transaction::OutPoint on success and a crate::lightning::ln::msgs::DecodeError on failure.
8838 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8840 typedef struct LDKCResult_OutPointDecodeErrorZ {
8842 * The contents of this CResult_OutPointDecodeErrorZ, accessible via either
8843 * `err` or `result` depending on the state of `result_ok`.
8845 union LDKCResult_OutPointDecodeErrorZPtr contents;
8847 * Whether this CResult_OutPointDecodeErrorZ represents a success state.
8850 } LDKCResult_OutPointDecodeErrorZ;
8853 * Defines a type identifier for sending messages over the wire.
8855 * Messages implementing this trait specify a type and must be [`Writeable`].
8857 typedef struct LDKType {
8859 * An opaque pointer which is passed to your function implementations as an argument.
8860 * This has no meaning in the LDK, and can be NULL or any other value.
8864 * Returns the type identifying the message payload.
8866 uint16_t (*type_id)(const void *this_arg);
8868 * Return a human-readable "debug" string describing this object
8870 struct LDKStr (*debug_str)(const void *this_arg);
8872 * Serialize the object into a byte array
8874 struct LDKCVec_u8Z (*write)(const void *this_arg);
8876 * Frees any resources associated with this object given its this_arg pointer.
8877 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
8879 void (*free)(void *this_arg);
8883 * An enum which can either contain a crate::lightning::ln::wire::Type or not
8885 typedef enum LDKCOption_TypeZ_Tag {
8887 * When we're in this state, this COption_TypeZ contains a crate::lightning::ln::wire::Type
8889 LDKCOption_TypeZ_Some,
8891 * When we're in this state, this COption_TypeZ contains nothing
8893 LDKCOption_TypeZ_None,
8895 * Must be last for serialization purposes
8897 LDKCOption_TypeZ_Sentinel,
8898 } LDKCOption_TypeZ_Tag;
8900 typedef struct LDKCOption_TypeZ {
8901 LDKCOption_TypeZ_Tag tag;
8904 struct LDKType some;
8910 * The contents of CResult_COption_TypeZDecodeErrorZ
8912 typedef union LDKCResult_COption_TypeZDecodeErrorZPtr {
8914 * A pointer to the contents in the success state.
8915 * Reading from this pointer when `result_ok` is not set is undefined.
8917 struct LDKCOption_TypeZ *result;
8919 * A pointer to the contents in the error state.
8920 * Reading from this pointer when `result_ok` is set is undefined.
8922 struct LDKDecodeError *err;
8923 } LDKCResult_COption_TypeZDecodeErrorZPtr;
8926 * A CResult_COption_TypeZDecodeErrorZ represents the result of a fallible operation,
8927 * containing a crate::c_types::derived::COption_TypeZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
8928 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8930 typedef struct LDKCResult_COption_TypeZDecodeErrorZ {
8932 * The contents of this CResult_COption_TypeZDecodeErrorZ, accessible via either
8933 * `err` or `result` depending on the state of `result_ok`.
8935 union LDKCResult_COption_TypeZDecodeErrorZPtr contents;
8937 * Whether this CResult_COption_TypeZDecodeErrorZ represents a success state.
8940 } LDKCResult_COption_TypeZDecodeErrorZ;
8943 * An error that may occur when making a payment.
8945 typedef enum LDKPaymentError_Tag {
8947 * An error resulting from the provided [`Invoice`] or payment hash.
8949 LDKPaymentError_Invoice,
8951 * An error occurring when finding a route.
8953 LDKPaymentError_Routing,
8955 * An error occurring when sending a payment.
8957 LDKPaymentError_Sending,
8959 * Must be last for serialization purposes
8961 LDKPaymentError_Sentinel,
8962 } LDKPaymentError_Tag;
8964 typedef struct MUST_USE_STRUCT LDKPaymentError {
8965 LDKPaymentError_Tag tag;
8968 struct LDKStr invoice;
8971 struct LDKLightningError routing;
8974 struct LDKPaymentSendFailure sending;
8980 * The contents of CResult_PaymentIdPaymentErrorZ
8982 typedef union LDKCResult_PaymentIdPaymentErrorZPtr {
8984 * A pointer to the contents in the success state.
8985 * Reading from this pointer when `result_ok` is not set is undefined.
8987 struct LDKThirtyTwoBytes *result;
8989 * A pointer to the contents in the error state.
8990 * Reading from this pointer when `result_ok` is set is undefined.
8992 struct LDKPaymentError *err;
8993 } LDKCResult_PaymentIdPaymentErrorZPtr;
8996 * A CResult_PaymentIdPaymentErrorZ represents the result of a fallible operation,
8997 * containing a crate::c_types::ThirtyTwoBytes on success and a crate::lightning_invoice::payment::PaymentError on failure.
8998 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9000 typedef struct LDKCResult_PaymentIdPaymentErrorZ {
9002 * The contents of this CResult_PaymentIdPaymentErrorZ, accessible via either
9003 * `err` or `result` depending on the state of `result_ok`.
9005 union LDKCResult_PaymentIdPaymentErrorZPtr contents;
9007 * Whether this CResult_PaymentIdPaymentErrorZ represents a success state.
9010 } LDKCResult_PaymentIdPaymentErrorZ;
9013 * The contents of CResult_NonePaymentErrorZ
9015 typedef union LDKCResult_NonePaymentErrorZPtr {
9017 * Note that this value is always NULL, as there are no contents in the OK variant
9021 * A pointer to the contents in the error state.
9022 * Reading from this pointer when `result_ok` is set is undefined.
9024 struct LDKPaymentError *err;
9025 } LDKCResult_NonePaymentErrorZPtr;
9028 * A CResult_NonePaymentErrorZ represents the result of a fallible operation,
9029 * containing a () on success and a crate::lightning_invoice::payment::PaymentError on failure.
9030 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9032 typedef struct LDKCResult_NonePaymentErrorZ {
9034 * The contents of this CResult_NonePaymentErrorZ, accessible via either
9035 * `err` or `result` depending on the state of `result_ok`.
9037 union LDKCResult_NonePaymentErrorZPtr contents;
9039 * Whether this CResult_NonePaymentErrorZ represents a success state.
9042 } LDKCResult_NonePaymentErrorZ;
9045 * The contents of CResult_StringErrorZ
9047 typedef union LDKCResult_StringErrorZPtr {
9049 * A pointer to the contents in the success state.
9050 * Reading from this pointer when `result_ok` is not set is undefined.
9052 struct LDKStr *result;
9054 * A pointer to the contents in the error state.
9055 * Reading from this pointer when `result_ok` is set is undefined.
9057 enum LDKSecp256k1Error *err;
9058 } LDKCResult_StringErrorZPtr;
9061 * A CResult_StringErrorZ represents the result of a fallible operation,
9062 * containing a crate::c_types::Str on success and a crate::c_types::Secp256k1Error on failure.
9063 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9065 typedef struct LDKCResult_StringErrorZ {
9067 * The contents of this CResult_StringErrorZ, accessible via either
9068 * `err` or `result` depending on the state of `result_ok`.
9070 union LDKCResult_StringErrorZPtr contents;
9072 * Whether this CResult_StringErrorZ represents a success state.
9075 } LDKCResult_StringErrorZ;
9078 * The contents of CResult_PublicKeyErrorZ
9080 typedef union LDKCResult_PublicKeyErrorZPtr {
9082 * A pointer to the contents in the success state.
9083 * Reading from this pointer when `result_ok` is not set is undefined.
9085 struct LDKPublicKey *result;
9087 * A pointer to the contents in the error state.
9088 * Reading from this pointer when `result_ok` is set is undefined.
9090 enum LDKSecp256k1Error *err;
9091 } LDKCResult_PublicKeyErrorZPtr;
9094 * A CResult_PublicKeyErrorZ represents the result of a fallible operation,
9095 * containing a crate::c_types::PublicKey on success and a crate::c_types::Secp256k1Error on failure.
9096 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9098 typedef struct LDKCResult_PublicKeyErrorZ {
9100 * The contents of this CResult_PublicKeyErrorZ, accessible via either
9101 * `err` or `result` depending on the state of `result_ok`.
9103 union LDKCResult_PublicKeyErrorZPtr contents;
9105 * Whether this CResult_PublicKeyErrorZ represents a success state.
9108 } LDKCResult_PublicKeyErrorZ;
9111 * The contents of CResult_ChannelMonitorUpdateDecodeErrorZ
9113 typedef union LDKCResult_ChannelMonitorUpdateDecodeErrorZPtr {
9115 * A pointer to the contents in the success state.
9116 * Reading from this pointer when `result_ok` is not set is undefined.
9118 struct LDKChannelMonitorUpdate *result;
9120 * A pointer to the contents in the error state.
9121 * Reading from this pointer when `result_ok` is set is undefined.
9123 struct LDKDecodeError *err;
9124 } LDKCResult_ChannelMonitorUpdateDecodeErrorZPtr;
9127 * A CResult_ChannelMonitorUpdateDecodeErrorZ represents the result of a fallible operation,
9128 * containing a crate::lightning::chain::channelmonitor::ChannelMonitorUpdate on success and a crate::lightning::ln::msgs::DecodeError on failure.
9129 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9131 typedef struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ {
9133 * The contents of this CResult_ChannelMonitorUpdateDecodeErrorZ, accessible via either
9134 * `err` or `result` depending on the state of `result_ok`.
9136 union LDKCResult_ChannelMonitorUpdateDecodeErrorZPtr contents;
9138 * Whether this CResult_ChannelMonitorUpdateDecodeErrorZ represents a success state.
9141 } LDKCResult_ChannelMonitorUpdateDecodeErrorZ;
9144 * An enum which can either contain a crate::lightning::chain::channelmonitor::MonitorEvent or not
9146 typedef enum LDKCOption_MonitorEventZ_Tag {
9148 * When we're in this state, this COption_MonitorEventZ contains a crate::lightning::chain::channelmonitor::MonitorEvent
9150 LDKCOption_MonitorEventZ_Some,
9152 * When we're in this state, this COption_MonitorEventZ contains nothing
9154 LDKCOption_MonitorEventZ_None,
9156 * Must be last for serialization purposes
9158 LDKCOption_MonitorEventZ_Sentinel,
9159 } LDKCOption_MonitorEventZ_Tag;
9161 typedef struct LDKCOption_MonitorEventZ {
9162 LDKCOption_MonitorEventZ_Tag tag;
9165 struct LDKMonitorEvent some;
9168 } LDKCOption_MonitorEventZ;
9171 * The contents of CResult_COption_MonitorEventZDecodeErrorZ
9173 typedef union LDKCResult_COption_MonitorEventZDecodeErrorZPtr {
9175 * A pointer to the contents in the success state.
9176 * Reading from this pointer when `result_ok` is not set is undefined.
9178 struct LDKCOption_MonitorEventZ *result;
9180 * A pointer to the contents in the error state.
9181 * Reading from this pointer when `result_ok` is set is undefined.
9183 struct LDKDecodeError *err;
9184 } LDKCResult_COption_MonitorEventZDecodeErrorZPtr;
9187 * A CResult_COption_MonitorEventZDecodeErrorZ represents the result of a fallible operation,
9188 * containing a crate::c_types::derived::COption_MonitorEventZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
9189 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9191 typedef struct LDKCResult_COption_MonitorEventZDecodeErrorZ {
9193 * The contents of this CResult_COption_MonitorEventZDecodeErrorZ, accessible via either
9194 * `err` or `result` depending on the state of `result_ok`.
9196 union LDKCResult_COption_MonitorEventZDecodeErrorZPtr contents;
9198 * Whether this CResult_COption_MonitorEventZDecodeErrorZ represents a success state.
9201 } LDKCResult_COption_MonitorEventZDecodeErrorZ;
9204 * The contents of CResult_HTLCUpdateDecodeErrorZ
9206 typedef union LDKCResult_HTLCUpdateDecodeErrorZPtr {
9208 * A pointer to the contents in the success state.
9209 * Reading from this pointer when `result_ok` is not set is undefined.
9211 struct LDKHTLCUpdate *result;
9213 * A pointer to the contents in the error state.
9214 * Reading from this pointer when `result_ok` is set is undefined.
9216 struct LDKDecodeError *err;
9217 } LDKCResult_HTLCUpdateDecodeErrorZPtr;
9220 * A CResult_HTLCUpdateDecodeErrorZ represents the result of a fallible operation,
9221 * containing a crate::lightning::chain::channelmonitor::HTLCUpdate on success and a crate::lightning::ln::msgs::DecodeError on failure.
9222 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9224 typedef struct LDKCResult_HTLCUpdateDecodeErrorZ {
9226 * The contents of this CResult_HTLCUpdateDecodeErrorZ, accessible via either
9227 * `err` or `result` depending on the state of `result_ok`.
9229 union LDKCResult_HTLCUpdateDecodeErrorZPtr contents;
9231 * Whether this CResult_HTLCUpdateDecodeErrorZ represents a success state.
9234 } LDKCResult_HTLCUpdateDecodeErrorZ;
9237 * A tuple of 2 elements. See the individual fields for the types contained.
9239 typedef struct LDKC2Tuple_OutPointScriptZ {
9241 * The element at position 0
9243 struct LDKOutPoint a;
9245 * The element at position 1
9247 struct LDKCVec_u8Z b;
9248 } LDKC2Tuple_OutPointScriptZ;
9251 * A tuple of 2 elements. See the individual fields for the types contained.
9253 typedef struct LDKC2Tuple_u32ScriptZ {
9255 * The element at position 0
9259 * The element at position 1
9261 struct LDKCVec_u8Z b;
9262 } LDKC2Tuple_u32ScriptZ;
9265 * A dynamically-allocated array of crate::c_types::derived::C2Tuple_u32ScriptZs of arbitrary size.
9266 * This corresponds to std::vector in C++
9268 typedef struct LDKCVec_C2Tuple_u32ScriptZZ {
9270 * The elements in the array.
9271 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
9273 struct LDKC2Tuple_u32ScriptZ *data;
9275 * The number of elements pointed to by `data`.
9278 } LDKCVec_C2Tuple_u32ScriptZZ;
9281 * A tuple of 2 elements. See the individual fields for the types contained.
9283 typedef struct LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ {
9285 * The element at position 0
9287 struct LDKThirtyTwoBytes a;
9289 * The element at position 1
9291 struct LDKCVec_C2Tuple_u32ScriptZZ b;
9292 } LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ;
9295 * A dynamically-allocated array of crate::c_types::derived::C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZs of arbitrary size.
9296 * This corresponds to std::vector in C++
9298 typedef struct LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ {
9300 * The elements in the array.
9301 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
9303 struct LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ *data;
9305 * The number of elements pointed to by `data`.
9308 } LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ;
9311 * A dynamically-allocated array of crate::lightning::util::events::Events of arbitrary size.
9312 * This corresponds to std::vector in C++
9314 typedef struct LDKCVec_EventZ {
9316 * The elements in the array.
9317 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
9319 struct LDKEvent *data;
9321 * The number of elements pointed to by `data`.
9327 * A dynamically-allocated array of crate::c_types::Transactions of arbitrary size.
9328 * This corresponds to std::vector in C++
9330 typedef struct LDKCVec_TransactionZ {
9332 * The elements in the array.
9333 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
9335 struct LDKTransaction *data;
9337 * The number of elements pointed to by `data`.
9340 } LDKCVec_TransactionZ;
9343 * A tuple of 2 elements. See the individual fields for the types contained.
9345 typedef struct LDKC2Tuple_u32TxOutZ {
9347 * The element at position 0
9351 * The element at position 1
9354 } LDKC2Tuple_u32TxOutZ;
9357 * A dynamically-allocated array of crate::c_types::derived::C2Tuple_u32TxOutZs of arbitrary size.
9358 * This corresponds to std::vector in C++
9360 typedef struct LDKCVec_C2Tuple_u32TxOutZZ {
9362 * The elements in the array.
9363 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
9365 struct LDKC2Tuple_u32TxOutZ *data;
9367 * The number of elements pointed to by `data`.
9370 } LDKCVec_C2Tuple_u32TxOutZZ;
9373 * A tuple of 2 elements. See the individual fields for the types contained.
9375 typedef struct LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ {
9377 * The element at position 0
9379 struct LDKThirtyTwoBytes a;
9381 * The element at position 1
9383 struct LDKCVec_C2Tuple_u32TxOutZZ b;
9384 } LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ;
9387 * A dynamically-allocated array of crate::c_types::derived::C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZs of arbitrary size.
9388 * This corresponds to std::vector in C++
9390 typedef struct LDKCVec_TransactionOutputsZ {
9392 * The elements in the array.
9393 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
9395 struct LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ *data;
9397 * The number of elements pointed to by `data`.
9400 } LDKCVec_TransactionOutputsZ;
9403 * Details about the balance(s) available for spending once the channel appears on chain.
9405 * See [`ChannelMonitor::get_claimable_balances`] for more details on when these will or will not
9408 typedef enum LDKBalance_Tag {
9410 * The channel is not yet closed (or the commitment or closing transaction has not yet
9411 * appeared in a block). The given balance is claimable (less on-chain fees) if the channel is
9414 LDKBalance_ClaimableOnChannelClose,
9416 * The channel has been closed, and the given balance is ours but awaiting confirmations until
9417 * we consider it spendable.
9419 LDKBalance_ClaimableAwaitingConfirmations,
9421 * The channel has been closed, and the given balance should be ours but awaiting spending
9422 * transaction confirmation. If the spending transaction does not confirm in time, it is
9423 * possible our counterparty can take the funds by broadcasting an HTLC timeout on-chain.
9425 * Once the spending transaction confirms, before it has reached enough confirmations to be
9426 * considered safe from chain reorganizations, the balance will instead be provided via
9427 * [`Balance::ClaimableAwaitingConfirmations`].
9429 LDKBalance_ContentiousClaimable,
9431 * HTLCs which we sent to our counterparty which are claimable after a timeout (less on-chain
9432 * fees) if the counterparty does not know the preimage for the HTLCs. These are somewhat
9433 * likely to be claimed by our counterparty before we do.
9435 LDKBalance_MaybeTimeoutClaimableHTLC,
9437 * HTLCs which we received from our counterparty which are claimable with a preimage which we
9438 * do not currently have. This will only be claimable if we receive the preimage from the node
9439 * to which we forwarded this HTLC before the timeout.
9441 LDKBalance_MaybePreimageClaimableHTLC,
9443 * The channel has been closed, and our counterparty broadcasted a revoked commitment
9446 * Thus, we're able to claim all outputs in the commitment transaction, one of which has the
9449 LDKBalance_CounterpartyRevokedOutputClaimable,
9451 * Must be last for serialization purposes
9453 LDKBalance_Sentinel,
9456 typedef struct LDKBalance_LDKClaimableOnChannelClose_Body {
9458 * The amount available to claim, in satoshis, excluding the on-chain fees which will be
9459 * required to do so.
9461 uint64_t claimable_amount_satoshis;
9462 } LDKBalance_LDKClaimableOnChannelClose_Body;
9464 typedef struct LDKBalance_LDKClaimableAwaitingConfirmations_Body {
9466 * The amount available to claim, in satoshis, possibly excluding the on-chain fees which
9467 * were spent in broadcasting the transaction.
9469 uint64_t claimable_amount_satoshis;
9471 * The height at which an [`Event::SpendableOutputs`] event will be generated for this
9474 uint32_t confirmation_height;
9475 } LDKBalance_LDKClaimableAwaitingConfirmations_Body;
9477 typedef struct LDKBalance_LDKContentiousClaimable_Body {
9479 * The amount available to claim, in satoshis, excluding the on-chain fees which will be
9480 * required to do so.
9482 uint64_t claimable_amount_satoshis;
9484 * The height at which the counterparty may be able to claim the balance if we have not
9487 uint32_t timeout_height;
9488 } LDKBalance_LDKContentiousClaimable_Body;
9490 typedef struct LDKBalance_LDKMaybeTimeoutClaimableHTLC_Body {
9492 * The amount potentially available to claim, in satoshis, excluding the on-chain fees
9493 * which will be required to do so.
9495 uint64_t claimable_amount_satoshis;
9497 * The height at which we will be able to claim the balance if our counterparty has not
9500 uint32_t claimable_height;
9501 } LDKBalance_LDKMaybeTimeoutClaimableHTLC_Body;
9503 typedef struct LDKBalance_LDKMaybePreimageClaimableHTLC_Body {
9505 * The amount potentially available to claim, in satoshis, excluding the on-chain fees
9506 * which will be required to do so.
9508 uint64_t claimable_amount_satoshis;
9510 * The height at which our counterparty will be able to claim the balance if we have not
9511 * yet received the preimage and claimed it ourselves.
9513 uint32_t expiry_height;
9514 } LDKBalance_LDKMaybePreimageClaimableHTLC_Body;
9516 typedef struct LDKBalance_LDKCounterpartyRevokedOutputClaimable_Body {
9518 * The amount, in satoshis, of the output which we can claim.
9520 * Note that for outputs from HTLC balances this may be excluding some on-chain fees that
9521 * were already spent.
9523 uint64_t claimable_amount_satoshis;
9524 } LDKBalance_LDKCounterpartyRevokedOutputClaimable_Body;
9526 typedef struct MUST_USE_STRUCT LDKBalance {
9529 LDKBalance_LDKClaimableOnChannelClose_Body claimable_on_channel_close;
9530 LDKBalance_LDKClaimableAwaitingConfirmations_Body claimable_awaiting_confirmations;
9531 LDKBalance_LDKContentiousClaimable_Body contentious_claimable;
9532 LDKBalance_LDKMaybeTimeoutClaimableHTLC_Body maybe_timeout_claimable_htlc;
9533 LDKBalance_LDKMaybePreimageClaimableHTLC_Body maybe_preimage_claimable_htlc;
9534 LDKBalance_LDKCounterpartyRevokedOutputClaimable_Body counterparty_revoked_output_claimable;
9539 * A dynamically-allocated array of crate::lightning::chain::channelmonitor::Balances of arbitrary size.
9540 * This corresponds to std::vector in C++
9542 typedef struct LDKCVec_BalanceZ {
9544 * The elements in the array.
9545 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
9547 struct LDKBalance *data;
9549 * The number of elements pointed to by `data`.
9555 * The contents of CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ
9557 typedef union LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZPtr {
9559 * A pointer to the contents in the success state.
9560 * Reading from this pointer when `result_ok` is not set is undefined.
9562 struct LDKC2Tuple_BlockHashChannelMonitorZ *result;
9564 * A pointer to the contents in the error state.
9565 * Reading from this pointer when `result_ok` is set is undefined.
9567 struct LDKDecodeError *err;
9568 } LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZPtr;
9571 * A CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ represents the result of a fallible operation,
9572 * containing a crate::c_types::derived::C2Tuple_BlockHashChannelMonitorZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
9573 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9575 typedef struct LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ {
9577 * The contents of this CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ, accessible via either
9578 * `err` or `result` depending on the state of `result_ok`.
9580 union LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZPtr contents;
9582 * Whether this CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ represents a success state.
9585 } LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ;
9588 * A tuple of 2 elements. See the individual fields for the types contained.
9590 typedef struct LDKC2Tuple_PublicKeyTypeZ {
9592 * The element at position 0
9594 struct LDKPublicKey a;
9596 * The element at position 1
9599 } LDKC2Tuple_PublicKeyTypeZ;
9602 * A dynamically-allocated array of crate::c_types::derived::C2Tuple_PublicKeyTypeZs of arbitrary size.
9603 * This corresponds to std::vector in C++
9605 typedef struct LDKCVec_C2Tuple_PublicKeyTypeZZ {
9607 * The elements in the array.
9608 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
9610 struct LDKC2Tuple_PublicKeyTypeZ *data;
9612 * The number of elements pointed to by `data`.
9615 } LDKCVec_C2Tuple_PublicKeyTypeZZ;
9618 * The contents of a custom onion message.
9620 typedef struct LDKCustomOnionMessageContents {
9622 * An opaque pointer which is passed to your function implementations as an argument.
9623 * This has no meaning in the LDK, and can be NULL or any other value.
9627 * Returns the TLV type identifying the message contents. MUST be >= 64.
9629 uint64_t (*tlv_type)(const void *this_arg);
9631 * Serialize the object into a byte array
9633 struct LDKCVec_u8Z (*write)(const void *this_arg);
9635 * Frees any resources associated with this object given its this_arg pointer.
9636 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
9638 void (*free)(void *this_arg);
9639 } LDKCustomOnionMessageContents;
9642 * An enum which can either contain a crate::lightning::onion_message::packet::CustomOnionMessageContents or not
9644 typedef enum LDKCOption_CustomOnionMessageContentsZ_Tag {
9646 * When we're in this state, this COption_CustomOnionMessageContentsZ contains a crate::lightning::onion_message::packet::CustomOnionMessageContents
9648 LDKCOption_CustomOnionMessageContentsZ_Some,
9650 * When we're in this state, this COption_CustomOnionMessageContentsZ contains nothing
9652 LDKCOption_CustomOnionMessageContentsZ_None,
9654 * Must be last for serialization purposes
9656 LDKCOption_CustomOnionMessageContentsZ_Sentinel,
9657 } LDKCOption_CustomOnionMessageContentsZ_Tag;
9659 typedef struct LDKCOption_CustomOnionMessageContentsZ {
9660 LDKCOption_CustomOnionMessageContentsZ_Tag tag;
9663 struct LDKCustomOnionMessageContents some;
9666 } LDKCOption_CustomOnionMessageContentsZ;
9669 * The contents of CResult_COption_CustomOnionMessageContentsZDecodeErrorZ
9671 typedef union LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZPtr {
9673 * A pointer to the contents in the success state.
9674 * Reading from this pointer when `result_ok` is not set is undefined.
9676 struct LDKCOption_CustomOnionMessageContentsZ *result;
9678 * A pointer to the contents in the error state.
9679 * Reading from this pointer when `result_ok` is set is undefined.
9681 struct LDKDecodeError *err;
9682 } LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZPtr;
9685 * A CResult_COption_CustomOnionMessageContentsZDecodeErrorZ represents the result of a fallible operation,
9686 * containing a crate::c_types::derived::COption_CustomOnionMessageContentsZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
9687 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9689 typedef struct LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ {
9691 * The contents of this CResult_COption_CustomOnionMessageContentsZDecodeErrorZ, accessible via either
9692 * `err` or `result` depending on the state of `result_ok`.
9694 union LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZPtr contents;
9696 * Whether this CResult_COption_CustomOnionMessageContentsZDecodeErrorZ represents a success state.
9699 } LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ;
9702 * An enum which can either contain a crate::lightning::ln::msgs::NetAddress or not
9704 typedef enum LDKCOption_NetAddressZ_Tag {
9706 * When we're in this state, this COption_NetAddressZ contains a crate::lightning::ln::msgs::NetAddress
9708 LDKCOption_NetAddressZ_Some,
9710 * When we're in this state, this COption_NetAddressZ contains nothing
9712 LDKCOption_NetAddressZ_None,
9714 * Must be last for serialization purposes
9716 LDKCOption_NetAddressZ_Sentinel,
9717 } LDKCOption_NetAddressZ_Tag;
9719 typedef struct LDKCOption_NetAddressZ {
9720 LDKCOption_NetAddressZ_Tag tag;
9723 struct LDKNetAddress some;
9726 } LDKCOption_NetAddressZ;
9731 * Error for PeerManager errors. If you get one of these, you must disconnect the socket and
9732 * generate no further read_event/write_buffer_space_avail/socket_disconnected calls for the
9735 typedef struct MUST_USE_STRUCT LDKPeerHandleError {
9737 * A pointer to the opaque Rust object.
9738 * Nearly everywhere, inner must be non-null, however in places where
9739 * the Rust equivalent takes an Option, it may be set to null to indicate None.
9741 LDKnativePeerHandleError *inner;
9743 * Indicates that this is the only struct which contains the same pointer.
9744 * Rust functions which take ownership of an object provided via an argument require
9745 * this to be true and invalidate the object pointed to by inner.
9748 } LDKPeerHandleError;
9751 * The contents of CResult_CVec_u8ZPeerHandleErrorZ
9753 typedef union LDKCResult_CVec_u8ZPeerHandleErrorZPtr {
9755 * A pointer to the contents in the success state.
9756 * Reading from this pointer when `result_ok` is not set is undefined.
9758 struct LDKCVec_u8Z *result;
9760 * A pointer to the contents in the error state.
9761 * Reading from this pointer when `result_ok` is set is undefined.
9763 struct LDKPeerHandleError *err;
9764 } LDKCResult_CVec_u8ZPeerHandleErrorZPtr;
9767 * A CResult_CVec_u8ZPeerHandleErrorZ represents the result of a fallible operation,
9768 * containing a crate::c_types::derived::CVec_u8Z on success and a crate::lightning::ln::peer_handler::PeerHandleError on failure.
9769 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9771 typedef struct LDKCResult_CVec_u8ZPeerHandleErrorZ {
9773 * The contents of this CResult_CVec_u8ZPeerHandleErrorZ, accessible via either
9774 * `err` or `result` depending on the state of `result_ok`.
9776 union LDKCResult_CVec_u8ZPeerHandleErrorZPtr contents;
9778 * Whether this CResult_CVec_u8ZPeerHandleErrorZ represents a success state.
9781 } LDKCResult_CVec_u8ZPeerHandleErrorZ;
9784 * The contents of CResult_NonePeerHandleErrorZ
9786 typedef union LDKCResult_NonePeerHandleErrorZPtr {
9788 * Note that this value is always NULL, as there are no contents in the OK variant
9792 * A pointer to the contents in the error state.
9793 * Reading from this pointer when `result_ok` is set is undefined.
9795 struct LDKPeerHandleError *err;
9796 } LDKCResult_NonePeerHandleErrorZPtr;
9799 * A CResult_NonePeerHandleErrorZ represents the result of a fallible operation,
9800 * containing a () on success and a crate::lightning::ln::peer_handler::PeerHandleError on failure.
9801 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9803 typedef struct LDKCResult_NonePeerHandleErrorZ {
9805 * The contents of this CResult_NonePeerHandleErrorZ, accessible via either
9806 * `err` or `result` depending on the state of `result_ok`.
9808 union LDKCResult_NonePeerHandleErrorZPtr contents;
9810 * Whether this CResult_NonePeerHandleErrorZ represents a success state.
9813 } LDKCResult_NonePeerHandleErrorZ;
9816 * The contents of CResult_boolPeerHandleErrorZ
9818 typedef union LDKCResult_boolPeerHandleErrorZPtr {
9820 * A pointer to the contents in the success state.
9821 * Reading from this pointer when `result_ok` is not set is undefined.
9825 * A pointer to the contents in the error state.
9826 * Reading from this pointer when `result_ok` is set is undefined.
9828 struct LDKPeerHandleError *err;
9829 } LDKCResult_boolPeerHandleErrorZPtr;
9832 * A CResult_boolPeerHandleErrorZ represents the result of a fallible operation,
9833 * containing a bool on success and a crate::lightning::ln::peer_handler::PeerHandleError on failure.
9834 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9836 typedef struct LDKCResult_boolPeerHandleErrorZ {
9838 * The contents of this CResult_boolPeerHandleErrorZ, accessible via either
9839 * `err` or `result` depending on the state of `result_ok`.
9841 union LDKCResult_boolPeerHandleErrorZPtr contents;
9843 * Whether this CResult_boolPeerHandleErrorZ represents a success state.
9846 } LDKCResult_boolPeerHandleErrorZ;
9849 * Errors that may occur when [sending an onion message].
9851 * [sending an onion message]: OnionMessenger::send_onion_message
9853 typedef enum LDKSendError_Tag {
9855 * Errored computing onion message packet keys.
9857 LDKSendError_Secp256k1,
9859 * Because implementations such as Eclair will drop onion messages where the message packet
9860 * exceeds 32834 bytes, we refuse to send messages where the packet exceeds this size.
9862 LDKSendError_TooBigPacket,
9864 * The provided [`Destination`] was an invalid [`BlindedPath`], due to having fewer than two
9867 LDKSendError_TooFewBlindedHops,
9869 * Our next-hop peer was offline or does not support onion message forwarding.
9871 LDKSendError_InvalidFirstHop,
9873 * Onion message contents must have a TLV type >= 64.
9875 LDKSendError_InvalidMessage,
9877 * Our next-hop peer's buffer was full or our total outbound buffer was full.
9879 LDKSendError_BufferFull,
9881 * Failed to retrieve our node id from the provided [`KeysInterface`].
9883 * [`KeysInterface`]: crate::chain::keysinterface::KeysInterface
9885 LDKSendError_GetNodeIdFailed,
9887 * We attempted to send to a blinded path where we are the introduction node, and failed to
9888 * advance the blinded path to make the second hop the new introduction node. Either
9889 * [`KeysInterface::ecdh`] failed, we failed to tweak the current blinding point to get the
9890 * new blinding point, or we were attempting to send to ourselves.
9892 LDKSendError_BlindedPathAdvanceFailed,
9894 * Must be last for serialization purposes
9896 LDKSendError_Sentinel,
9899 typedef struct MUST_USE_STRUCT LDKSendError {
9900 LDKSendError_Tag tag;
9903 enum LDKSecp256k1Error secp256k1;
9909 * The contents of CResult_NoneSendErrorZ
9911 typedef union LDKCResult_NoneSendErrorZPtr {
9913 * Note that this value is always NULL, as there are no contents in the OK variant
9917 * A pointer to the contents in the error state.
9918 * Reading from this pointer when `result_ok` is set is undefined.
9920 struct LDKSendError *err;
9921 } LDKCResult_NoneSendErrorZPtr;
9924 * A CResult_NoneSendErrorZ represents the result of a fallible operation,
9925 * containing a () on success and a crate::lightning::onion_message::messenger::SendError on failure.
9926 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9928 typedef struct LDKCResult_NoneSendErrorZ {
9930 * The contents of this CResult_NoneSendErrorZ, accessible via either
9931 * `err` or `result` depending on the state of `result_ok`.
9933 union LDKCResult_NoneSendErrorZPtr contents;
9935 * Whether this CResult_NoneSendErrorZ represents a success state.
9938 } LDKCResult_NoneSendErrorZ;
9941 * Sub-errors which don't have specific information in them use this type.
9943 typedef struct LDKError {
9945 * Zero-Sized_types aren't consistent across Rust/C/C++, so we add some size here
9951 * Errors that indicate what is wrong with the invoice. They have some granularity for debug
9952 * reasons, but should generally result in an \"invalid BOLT11 invoice\" message for the user.
9954 typedef enum LDKParseError_Tag {
9955 LDKParseError_Bech32Error,
9956 LDKParseError_ParseAmountError,
9957 LDKParseError_MalformedSignature,
9958 LDKParseError_BadPrefix,
9959 LDKParseError_UnknownCurrency,
9960 LDKParseError_UnknownSiPrefix,
9961 LDKParseError_MalformedHRP,
9962 LDKParseError_TooShortDataPart,
9963 LDKParseError_UnexpectedEndOfTaggedFields,
9964 LDKParseError_DescriptionDecodeError,
9965 LDKParseError_PaddingError,
9966 LDKParseError_IntegerOverflowError,
9967 LDKParseError_InvalidSegWitProgramLength,
9968 LDKParseError_InvalidPubKeyHashLength,
9969 LDKParseError_InvalidScriptHashLength,
9970 LDKParseError_InvalidRecoveryId,
9971 LDKParseError_InvalidSliceLength,
9973 * Not an error, but used internally to signal that a part of the invoice should be ignored
9974 * according to BOLT11
9978 * Must be last for serialization purposes
9980 LDKParseError_Sentinel,
9981 } LDKParseError_Tag;
9983 typedef struct MUST_USE_STRUCT LDKParseError {
9984 LDKParseError_Tag tag;
9987 struct LDKBech32Error bech32_error;
9990 struct LDKError parse_amount_error;
9993 enum LDKSecp256k1Error malformed_signature;
9996 struct LDKError description_decode_error;
9999 struct LDKStr invalid_slice_length;
10005 * The contents of CResult_SiPrefixParseErrorZ
10007 typedef union LDKCResult_SiPrefixParseErrorZPtr {
10009 * A pointer to the contents in the success state.
10010 * Reading from this pointer when `result_ok` is not set is undefined.
10012 enum LDKSiPrefix *result;
10014 * A pointer to the contents in the error state.
10015 * Reading from this pointer when `result_ok` is set is undefined.
10017 struct LDKParseError *err;
10018 } LDKCResult_SiPrefixParseErrorZPtr;
10021 * A CResult_SiPrefixParseErrorZ represents the result of a fallible operation,
10022 * containing a crate::lightning_invoice::SiPrefix on success and a crate::lightning_invoice::ParseError on failure.
10023 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10025 typedef struct LDKCResult_SiPrefixParseErrorZ {
10027 * The contents of this CResult_SiPrefixParseErrorZ, accessible via either
10028 * `err` or `result` depending on the state of `result_ok`.
10030 union LDKCResult_SiPrefixParseErrorZPtr contents;
10032 * Whether this CResult_SiPrefixParseErrorZ represents a success state.
10035 } LDKCResult_SiPrefixParseErrorZ;
10040 * Represents a syntactically and semantically correct lightning BOLT11 invoice.
10042 * There are three ways to construct an `Invoice`:
10043 * 1. using `InvoiceBuilder`
10044 * 2. using `Invoice::from_signed(SignedRawInvoice)`
10045 * 3. using `str::parse::<Invoice>(&str)`
10047 typedef struct MUST_USE_STRUCT LDKInvoice {
10049 * A pointer to the opaque Rust object.
10050 * Nearly everywhere, inner must be non-null, however in places where
10051 * the Rust equivalent takes an Option, it may be set to null to indicate None.
10053 LDKnativeInvoice *inner;
10055 * Indicates that this is the only struct which contains the same pointer.
10056 * Rust functions which take ownership of an object provided via an argument require
10057 * this to be true and invalidate the object pointed to by inner.
10063 * Indicates that something went wrong while parsing or validating the invoice. Parsing errors
10064 * should be mostly seen as opaque and are only there for debugging reasons. Semantic errors
10065 * like wrong signatures, missing fields etc. could mean that someone tampered with the invoice.
10067 typedef enum LDKParseOrSemanticError_Tag {
10069 * The invoice couldn't be decoded
10071 LDKParseOrSemanticError_ParseError,
10073 * The invoice could be decoded but violates the BOLT11 standard
10075 LDKParseOrSemanticError_SemanticError,
10077 * Must be last for serialization purposes
10079 LDKParseOrSemanticError_Sentinel,
10080 } LDKParseOrSemanticError_Tag;
10082 typedef struct MUST_USE_STRUCT LDKParseOrSemanticError {
10083 LDKParseOrSemanticError_Tag tag;
10086 struct LDKParseError parse_error;
10089 enum LDKSemanticError semantic_error;
10092 } LDKParseOrSemanticError;
10095 * The contents of CResult_InvoiceParseOrSemanticErrorZ
10097 typedef union LDKCResult_InvoiceParseOrSemanticErrorZPtr {
10099 * A pointer to the contents in the success state.
10100 * Reading from this pointer when `result_ok` is not set is undefined.
10102 struct LDKInvoice *result;
10104 * A pointer to the contents in the error state.
10105 * Reading from this pointer when `result_ok` is set is undefined.
10107 struct LDKParseOrSemanticError *err;
10108 } LDKCResult_InvoiceParseOrSemanticErrorZPtr;
10111 * A CResult_InvoiceParseOrSemanticErrorZ represents the result of a fallible operation,
10112 * containing a crate::lightning_invoice::Invoice on success and a crate::lightning_invoice::ParseOrSemanticError on failure.
10113 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10115 typedef struct LDKCResult_InvoiceParseOrSemanticErrorZ {
10117 * The contents of this CResult_InvoiceParseOrSemanticErrorZ, accessible via either
10118 * `err` or `result` depending on the state of `result_ok`.
10120 union LDKCResult_InvoiceParseOrSemanticErrorZPtr contents;
10122 * Whether this CResult_InvoiceParseOrSemanticErrorZ represents a success state.
10125 } LDKCResult_InvoiceParseOrSemanticErrorZ;
10130 * Represents a signed `RawInvoice` with cached hash. The signature is not checked and may be
10134 * The hash has to be either from the deserialized invoice or from the serialized `raw_invoice`.
10136 typedef struct MUST_USE_STRUCT LDKSignedRawInvoice {
10138 * A pointer to the opaque Rust object.
10139 * Nearly everywhere, inner must be non-null, however in places where
10140 * the Rust equivalent takes an Option, it may be set to null to indicate None.
10142 LDKnativeSignedRawInvoice *inner;
10144 * Indicates that this is the only struct which contains the same pointer.
10145 * Rust functions which take ownership of an object provided via an argument require
10146 * this to be true and invalidate the object pointed to by inner.
10149 } LDKSignedRawInvoice;
10152 * The contents of CResult_SignedRawInvoiceParseErrorZ
10154 typedef union LDKCResult_SignedRawInvoiceParseErrorZPtr {
10156 * A pointer to the contents in the success state.
10157 * Reading from this pointer when `result_ok` is not set is undefined.
10159 struct LDKSignedRawInvoice *result;
10161 * A pointer to the contents in the error state.
10162 * Reading from this pointer when `result_ok` is set is undefined.
10164 struct LDKParseError *err;
10165 } LDKCResult_SignedRawInvoiceParseErrorZPtr;
10168 * A CResult_SignedRawInvoiceParseErrorZ represents the result of a fallible operation,
10169 * containing a crate::lightning_invoice::SignedRawInvoice on success and a crate::lightning_invoice::ParseError on failure.
10170 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10172 typedef struct LDKCResult_SignedRawInvoiceParseErrorZ {
10174 * The contents of this CResult_SignedRawInvoiceParseErrorZ, accessible via either
10175 * `err` or `result` depending on the state of `result_ok`.
10177 union LDKCResult_SignedRawInvoiceParseErrorZPtr contents;
10179 * Whether this CResult_SignedRawInvoiceParseErrorZ represents a success state.
10182 } LDKCResult_SignedRawInvoiceParseErrorZ;
10187 * Represents an syntactically correct Invoice for a payment on the lightning network,
10188 * but without the signature information.
10189 * De- and encoding should not lead to information loss but may lead to different hashes.
10191 * For methods without docs see the corresponding methods in `Invoice`.
10193 typedef struct MUST_USE_STRUCT LDKRawInvoice {
10195 * A pointer to the opaque Rust object.
10196 * Nearly everywhere, inner must be non-null, however in places where
10197 * the Rust equivalent takes an Option, it may be set to null to indicate None.
10199 LDKnativeRawInvoice *inner;
10201 * Indicates that this is the only struct which contains the same pointer.
10202 * Rust functions which take ownership of an object provided via an argument require
10203 * this to be true and invalidate the object pointed to by inner.
10211 * Recoverable signature
10213 typedef struct MUST_USE_STRUCT LDKInvoiceSignature {
10215 * A pointer to the opaque Rust object.
10216 * Nearly everywhere, inner must be non-null, however in places where
10217 * the Rust equivalent takes an Option, it may be set to null to indicate None.
10219 LDKnativeInvoiceSignature *inner;
10221 * Indicates that this is the only struct which contains the same pointer.
10222 * Rust functions which take ownership of an object provided via an argument require
10223 * this to be true and invalidate the object pointed to by inner.
10226 } LDKInvoiceSignature;
10229 * A tuple of 3 elements. See the individual fields for the types contained.
10231 typedef struct LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ {
10233 * The element at position 0
10235 struct LDKRawInvoice a;
10237 * The element at position 1
10239 struct LDKThirtyTwoBytes b;
10241 * The element at position 2
10243 struct LDKInvoiceSignature c;
10244 } LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ;
10251 typedef struct MUST_USE_STRUCT LDKPayeePubKey {
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 LDKnativePayeePubKey *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 * The contents of CResult_PayeePubKeyErrorZ
10269 typedef union LDKCResult_PayeePubKeyErrorZPtr {
10271 * A pointer to the contents in the success state.
10272 * Reading from this pointer when `result_ok` is not set is undefined.
10274 struct LDKPayeePubKey *result;
10276 * A pointer to the contents in the error state.
10277 * Reading from this pointer when `result_ok` is set is undefined.
10279 enum LDKSecp256k1Error *err;
10280 } LDKCResult_PayeePubKeyErrorZPtr;
10283 * A CResult_PayeePubKeyErrorZ represents the result of a fallible operation,
10284 * containing a crate::lightning_invoice::PayeePubKey on success and a crate::c_types::Secp256k1Error on failure.
10285 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10287 typedef struct LDKCResult_PayeePubKeyErrorZ {
10289 * The contents of this CResult_PayeePubKeyErrorZ, accessible via either
10290 * `err` or `result` depending on the state of `result_ok`.
10292 union LDKCResult_PayeePubKeyErrorZPtr contents;
10294 * Whether this CResult_PayeePubKeyErrorZ represents a success state.
10297 } LDKCResult_PayeePubKeyErrorZ;
10302 * Private routing information
10305 * The encoded route has to be <1024 5bit characters long (<=639 bytes or <=12 hops)
10308 typedef struct MUST_USE_STRUCT LDKPrivateRoute {
10310 * A pointer to the opaque Rust object.
10311 * Nearly everywhere, inner must be non-null, however in places where
10312 * the Rust equivalent takes an Option, it may be set to null to indicate None.
10314 LDKnativePrivateRoute *inner;
10316 * Indicates that this is the only struct which contains the same pointer.
10317 * Rust functions which take ownership of an object provided via an argument require
10318 * this to be true and invalidate the object pointed to by inner.
10324 * A dynamically-allocated array of crate::lightning_invoice::PrivateRoutes of arbitrary size.
10325 * This corresponds to std::vector in C++
10327 typedef struct LDKCVec_PrivateRouteZ {
10329 * The elements in the array.
10330 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
10332 struct LDKPrivateRoute *data;
10334 * The number of elements pointed to by `data`.
10337 } LDKCVec_PrivateRouteZ;
10342 * A timestamp that refers to a date after 1 January 1970.
10346 * The Unix timestamp representing the stored time has to be positive and no greater than
10347 * [`MAX_TIMESTAMP`].
10349 typedef struct MUST_USE_STRUCT LDKPositiveTimestamp {
10351 * A pointer to the opaque Rust object.
10352 * Nearly everywhere, inner must be non-null, however in places where
10353 * the Rust equivalent takes an Option, it may be set to null to indicate None.
10355 LDKnativePositiveTimestamp *inner;
10357 * Indicates that this is the only struct which contains the same pointer.
10358 * Rust functions which take ownership of an object provided via an argument require
10359 * this to be true and invalidate the object pointed to by inner.
10362 } LDKPositiveTimestamp;
10365 * The contents of CResult_PositiveTimestampCreationErrorZ
10367 typedef union LDKCResult_PositiveTimestampCreationErrorZPtr {
10369 * A pointer to the contents in the success state.
10370 * Reading from this pointer when `result_ok` is not set is undefined.
10372 struct LDKPositiveTimestamp *result;
10374 * A pointer to the contents in the error state.
10375 * Reading from this pointer when `result_ok` is set is undefined.
10377 enum LDKCreationError *err;
10378 } LDKCResult_PositiveTimestampCreationErrorZPtr;
10381 * A CResult_PositiveTimestampCreationErrorZ represents the result of a fallible operation,
10382 * containing a crate::lightning_invoice::PositiveTimestamp on success and a crate::lightning_invoice::CreationError on failure.
10383 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10385 typedef struct LDKCResult_PositiveTimestampCreationErrorZ {
10387 * The contents of this CResult_PositiveTimestampCreationErrorZ, accessible via either
10388 * `err` or `result` depending on the state of `result_ok`.
10390 union LDKCResult_PositiveTimestampCreationErrorZPtr contents;
10392 * Whether this CResult_PositiveTimestampCreationErrorZ represents a success state.
10395 } LDKCResult_PositiveTimestampCreationErrorZ;
10398 * The contents of CResult_NoneSemanticErrorZ
10400 typedef union LDKCResult_NoneSemanticErrorZPtr {
10402 * Note that this value is always NULL, as there are no contents in the OK variant
10406 * A pointer to the contents in the error state.
10407 * Reading from this pointer when `result_ok` is set is undefined.
10409 enum LDKSemanticError *err;
10410 } LDKCResult_NoneSemanticErrorZPtr;
10413 * A CResult_NoneSemanticErrorZ represents the result of a fallible operation,
10414 * containing a () on success and a crate::lightning_invoice::SemanticError on failure.
10415 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10417 typedef struct LDKCResult_NoneSemanticErrorZ {
10419 * The contents of this CResult_NoneSemanticErrorZ, accessible via either
10420 * `err` or `result` depending on the state of `result_ok`.
10422 union LDKCResult_NoneSemanticErrorZPtr contents;
10424 * Whether this CResult_NoneSemanticErrorZ represents a success state.
10427 } LDKCResult_NoneSemanticErrorZ;
10430 * The contents of CResult_InvoiceSemanticErrorZ
10432 typedef union LDKCResult_InvoiceSemanticErrorZPtr {
10434 * A pointer to the contents in the success state.
10435 * Reading from this pointer when `result_ok` is not set is undefined.
10437 struct LDKInvoice *result;
10439 * A pointer to the contents in the error state.
10440 * Reading from this pointer when `result_ok` is set is undefined.
10442 enum LDKSemanticError *err;
10443 } LDKCResult_InvoiceSemanticErrorZPtr;
10446 * A CResult_InvoiceSemanticErrorZ represents the result of a fallible operation,
10447 * containing a crate::lightning_invoice::Invoice on success and a crate::lightning_invoice::SemanticError on failure.
10448 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10450 typedef struct LDKCResult_InvoiceSemanticErrorZ {
10452 * The contents of this CResult_InvoiceSemanticErrorZ, accessible via either
10453 * `err` or `result` depending on the state of `result_ok`.
10455 union LDKCResult_InvoiceSemanticErrorZPtr contents;
10457 * Whether this CResult_InvoiceSemanticErrorZ represents a success state.
10460 } LDKCResult_InvoiceSemanticErrorZ;
10465 * Description string
10468 * The description can be at most 639 __bytes__ long
10470 typedef struct MUST_USE_STRUCT LDKDescription {
10472 * A pointer to the opaque Rust object.
10473 * Nearly everywhere, inner must be non-null, however in places where
10474 * the Rust equivalent takes an Option, it may be set to null to indicate None.
10476 LDKnativeDescription *inner;
10478 * Indicates that this is the only struct which contains the same pointer.
10479 * Rust functions which take ownership of an object provided via an argument require
10480 * this to be true and invalidate the object pointed to by inner.
10486 * The contents of CResult_DescriptionCreationErrorZ
10488 typedef union LDKCResult_DescriptionCreationErrorZPtr {
10490 * A pointer to the contents in the success state.
10491 * Reading from this pointer when `result_ok` is not set is undefined.
10493 struct LDKDescription *result;
10495 * A pointer to the contents in the error state.
10496 * Reading from this pointer when `result_ok` is set is undefined.
10498 enum LDKCreationError *err;
10499 } LDKCResult_DescriptionCreationErrorZPtr;
10502 * A CResult_DescriptionCreationErrorZ represents the result of a fallible operation,
10503 * containing a crate::lightning_invoice::Description on success and a crate::lightning_invoice::CreationError on failure.
10504 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10506 typedef struct LDKCResult_DescriptionCreationErrorZ {
10508 * The contents of this CResult_DescriptionCreationErrorZ, accessible via either
10509 * `err` or `result` depending on the state of `result_ok`.
10511 union LDKCResult_DescriptionCreationErrorZPtr contents;
10513 * Whether this CResult_DescriptionCreationErrorZ represents a success state.
10516 } LDKCResult_DescriptionCreationErrorZ;
10519 * The contents of CResult_PrivateRouteCreationErrorZ
10521 typedef union LDKCResult_PrivateRouteCreationErrorZPtr {
10523 * A pointer to the contents in the success state.
10524 * Reading from this pointer when `result_ok` is not set is undefined.
10526 struct LDKPrivateRoute *result;
10528 * A pointer to the contents in the error state.
10529 * Reading from this pointer when `result_ok` is set is undefined.
10531 enum LDKCreationError *err;
10532 } LDKCResult_PrivateRouteCreationErrorZPtr;
10535 * A CResult_PrivateRouteCreationErrorZ represents the result of a fallible operation,
10536 * containing a crate::lightning_invoice::PrivateRoute on success and a crate::lightning_invoice::CreationError on failure.
10537 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10539 typedef struct LDKCResult_PrivateRouteCreationErrorZ {
10541 * The contents of this CResult_PrivateRouteCreationErrorZ, accessible via either
10542 * `err` or `result` depending on the state of `result_ok`.
10544 union LDKCResult_PrivateRouteCreationErrorZPtr contents;
10546 * Whether this CResult_PrivateRouteCreationErrorZ represents a success state.
10549 } LDKCResult_PrivateRouteCreationErrorZ;
10552 * All-encompassing standard error type that processing can return
10554 typedef enum LDKGraphSyncError_Tag {
10556 * Error trying to read the update data, typically due to an erroneous data length indication
10557 * that is greater than the actual amount of data provided
10559 LDKGraphSyncError_DecodeError,
10561 * Error applying the patch to the network graph, usually the result of updates that are too
10562 * old or missing prerequisite data to the application of updates out of order
10564 LDKGraphSyncError_LightningError,
10566 * Must be last for serialization purposes
10568 LDKGraphSyncError_Sentinel,
10569 } LDKGraphSyncError_Tag;
10571 typedef struct MUST_USE_STRUCT LDKGraphSyncError {
10572 LDKGraphSyncError_Tag tag;
10575 struct LDKDecodeError decode_error;
10578 struct LDKLightningError lightning_error;
10581 } LDKGraphSyncError;
10584 * The contents of CResult_u32GraphSyncErrorZ
10586 typedef union LDKCResult_u32GraphSyncErrorZPtr {
10588 * A pointer to the contents in the success state.
10589 * Reading from this pointer when `result_ok` is not set is undefined.
10593 * A pointer to the contents in the error state.
10594 * Reading from this pointer when `result_ok` is set is undefined.
10596 struct LDKGraphSyncError *err;
10597 } LDKCResult_u32GraphSyncErrorZPtr;
10600 * A CResult_u32GraphSyncErrorZ represents the result of a fallible operation,
10601 * containing a u32 on success and a crate::lightning_rapid_gossip_sync::error::GraphSyncError on failure.
10602 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10604 typedef struct LDKCResult_u32GraphSyncErrorZ {
10606 * The contents of this CResult_u32GraphSyncErrorZ, accessible via either
10607 * `err` or `result` depending on the state of `result_ok`.
10609 union LDKCResult_u32GraphSyncErrorZPtr contents;
10611 * Whether this CResult_u32GraphSyncErrorZ represents a success state.
10614 } LDKCResult_u32GraphSyncErrorZ;
10617 * The contents of CResult_NetAddressDecodeErrorZ
10619 typedef union LDKCResult_NetAddressDecodeErrorZPtr {
10621 * A pointer to the contents in the success state.
10622 * Reading from this pointer when `result_ok` is not set is undefined.
10624 struct LDKNetAddress *result;
10626 * A pointer to the contents in the error state.
10627 * Reading from this pointer when `result_ok` is set is undefined.
10629 struct LDKDecodeError *err;
10630 } LDKCResult_NetAddressDecodeErrorZPtr;
10633 * A CResult_NetAddressDecodeErrorZ represents the result of a fallible operation,
10634 * containing a crate::lightning::ln::msgs::NetAddress on success and a crate::lightning::ln::msgs::DecodeError on failure.
10635 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10637 typedef struct LDKCResult_NetAddressDecodeErrorZ {
10639 * The contents of this CResult_NetAddressDecodeErrorZ, accessible via either
10640 * `err` or `result` depending on the state of `result_ok`.
10642 union LDKCResult_NetAddressDecodeErrorZPtr contents;
10644 * Whether this CResult_NetAddressDecodeErrorZ represents a success state.
10647 } LDKCResult_NetAddressDecodeErrorZ;
10652 * An update_add_htlc message to be sent or received from a peer
10654 typedef struct MUST_USE_STRUCT LDKUpdateAddHTLC {
10656 * A pointer to the opaque Rust object.
10657 * Nearly everywhere, inner must be non-null, however in places where
10658 * the Rust equivalent takes an Option, it may be set to null to indicate None.
10660 LDKnativeUpdateAddHTLC *inner;
10662 * Indicates that this is the only struct which contains the same pointer.
10663 * Rust functions which take ownership of an object provided via an argument require
10664 * this to be true and invalidate the object pointed to by inner.
10667 } LDKUpdateAddHTLC;
10670 * A dynamically-allocated array of crate::lightning::ln::msgs::UpdateAddHTLCs of arbitrary size.
10671 * This corresponds to std::vector in C++
10673 typedef struct LDKCVec_UpdateAddHTLCZ {
10675 * The elements in the array.
10676 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
10678 struct LDKUpdateAddHTLC *data;
10680 * The number of elements pointed to by `data`.
10683 } LDKCVec_UpdateAddHTLCZ;
10688 * An update_fulfill_htlc message to be sent or received from a peer
10690 typedef struct MUST_USE_STRUCT LDKUpdateFulfillHTLC {
10692 * A pointer to the opaque Rust object.
10693 * Nearly everywhere, inner must be non-null, however in places where
10694 * the Rust equivalent takes an Option, it may be set to null to indicate None.
10696 LDKnativeUpdateFulfillHTLC *inner;
10698 * Indicates that this is the only struct which contains the same pointer.
10699 * Rust functions which take ownership of an object provided via an argument require
10700 * this to be true and invalidate the object pointed to by inner.
10703 } LDKUpdateFulfillHTLC;
10706 * A dynamically-allocated array of crate::lightning::ln::msgs::UpdateFulfillHTLCs of arbitrary size.
10707 * This corresponds to std::vector in C++
10709 typedef struct LDKCVec_UpdateFulfillHTLCZ {
10711 * The elements in the array.
10712 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
10714 struct LDKUpdateFulfillHTLC *data;
10716 * The number of elements pointed to by `data`.
10719 } LDKCVec_UpdateFulfillHTLCZ;
10724 * An update_fail_htlc message to be sent or received from a peer
10726 typedef struct MUST_USE_STRUCT LDKUpdateFailHTLC {
10728 * A pointer to the opaque Rust object.
10729 * Nearly everywhere, inner must be non-null, however in places where
10730 * the Rust equivalent takes an Option, it may be set to null to indicate None.
10732 LDKnativeUpdateFailHTLC *inner;
10734 * Indicates that this is the only struct which contains the same pointer.
10735 * Rust functions which take ownership of an object provided via an argument require
10736 * this to be true and invalidate the object pointed to by inner.
10739 } LDKUpdateFailHTLC;
10742 * A dynamically-allocated array of crate::lightning::ln::msgs::UpdateFailHTLCs of arbitrary size.
10743 * This corresponds to std::vector in C++
10745 typedef struct LDKCVec_UpdateFailHTLCZ {
10747 * The elements in the array.
10748 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
10750 struct LDKUpdateFailHTLC *data;
10752 * The number of elements pointed to by `data`.
10755 } LDKCVec_UpdateFailHTLCZ;
10760 * An update_fail_malformed_htlc message to be sent or received from a peer
10762 typedef struct MUST_USE_STRUCT LDKUpdateFailMalformedHTLC {
10764 * A pointer to the opaque Rust object.
10765 * Nearly everywhere, inner must be non-null, however in places where
10766 * the Rust equivalent takes an Option, it may be set to null to indicate None.
10768 LDKnativeUpdateFailMalformedHTLC *inner;
10770 * Indicates that this is the only struct which contains the same pointer.
10771 * Rust functions which take ownership of an object provided via an argument require
10772 * this to be true and invalidate the object pointed to by inner.
10775 } LDKUpdateFailMalformedHTLC;
10778 * A dynamically-allocated array of crate::lightning::ln::msgs::UpdateFailMalformedHTLCs of arbitrary size.
10779 * This corresponds to std::vector in C++
10781 typedef struct LDKCVec_UpdateFailMalformedHTLCZ {
10783 * The elements in the array.
10784 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
10786 struct LDKUpdateFailMalformedHTLC *data;
10788 * The number of elements pointed to by `data`.
10791 } LDKCVec_UpdateFailMalformedHTLCZ;
10794 * The contents of CResult_AcceptChannelDecodeErrorZ
10796 typedef union LDKCResult_AcceptChannelDecodeErrorZPtr {
10798 * A pointer to the contents in the success state.
10799 * Reading from this pointer when `result_ok` is not set is undefined.
10801 struct LDKAcceptChannel *result;
10803 * A pointer to the contents in the error state.
10804 * Reading from this pointer when `result_ok` is set is undefined.
10806 struct LDKDecodeError *err;
10807 } LDKCResult_AcceptChannelDecodeErrorZPtr;
10810 * A CResult_AcceptChannelDecodeErrorZ represents the result of a fallible operation,
10811 * containing a crate::lightning::ln::msgs::AcceptChannel on success and a crate::lightning::ln::msgs::DecodeError on failure.
10812 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10814 typedef struct LDKCResult_AcceptChannelDecodeErrorZ {
10816 * The contents of this CResult_AcceptChannelDecodeErrorZ, accessible via either
10817 * `err` or `result` depending on the state of `result_ok`.
10819 union LDKCResult_AcceptChannelDecodeErrorZPtr contents;
10821 * Whether this CResult_AcceptChannelDecodeErrorZ represents a success state.
10824 } LDKCResult_AcceptChannelDecodeErrorZ;
10827 * The contents of CResult_AnnouncementSignaturesDecodeErrorZ
10829 typedef union LDKCResult_AnnouncementSignaturesDecodeErrorZPtr {
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 LDKAnnouncementSignatures *result;
10836 * A pointer to the contents in the error state.
10837 * Reading from this pointer when `result_ok` is set is undefined.
10839 struct LDKDecodeError *err;
10840 } LDKCResult_AnnouncementSignaturesDecodeErrorZPtr;
10843 * A CResult_AnnouncementSignaturesDecodeErrorZ represents the result of a fallible operation,
10844 * containing a crate::lightning::ln::msgs::AnnouncementSignatures on success and a crate::lightning::ln::msgs::DecodeError on failure.
10845 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10847 typedef struct LDKCResult_AnnouncementSignaturesDecodeErrorZ {
10849 * The contents of this CResult_AnnouncementSignaturesDecodeErrorZ, accessible via either
10850 * `err` or `result` depending on the state of `result_ok`.
10852 union LDKCResult_AnnouncementSignaturesDecodeErrorZPtr contents;
10854 * Whether this CResult_AnnouncementSignaturesDecodeErrorZ represents a success state.
10857 } LDKCResult_AnnouncementSignaturesDecodeErrorZ;
10860 * The contents of CResult_ChannelReestablishDecodeErrorZ
10862 typedef union LDKCResult_ChannelReestablishDecodeErrorZPtr {
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 LDKChannelReestablish *result;
10869 * A pointer to the contents in the error state.
10870 * Reading from this pointer when `result_ok` is set is undefined.
10872 struct LDKDecodeError *err;
10873 } LDKCResult_ChannelReestablishDecodeErrorZPtr;
10876 * A CResult_ChannelReestablishDecodeErrorZ represents the result of a fallible operation,
10877 * containing a crate::lightning::ln::msgs::ChannelReestablish on success and a crate::lightning::ln::msgs::DecodeError on failure.
10878 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10880 typedef struct LDKCResult_ChannelReestablishDecodeErrorZ {
10882 * The contents of this CResult_ChannelReestablishDecodeErrorZ, accessible via either
10883 * `err` or `result` depending on the state of `result_ok`.
10885 union LDKCResult_ChannelReestablishDecodeErrorZPtr contents;
10887 * Whether this CResult_ChannelReestablishDecodeErrorZ represents a success state.
10890 } LDKCResult_ChannelReestablishDecodeErrorZ;
10893 * The contents of CResult_ClosingSignedDecodeErrorZ
10895 typedef union LDKCResult_ClosingSignedDecodeErrorZPtr {
10897 * A pointer to the contents in the success state.
10898 * Reading from this pointer when `result_ok` is not set is undefined.
10900 struct LDKClosingSigned *result;
10902 * A pointer to the contents in the error state.
10903 * Reading from this pointer when `result_ok` is set is undefined.
10905 struct LDKDecodeError *err;
10906 } LDKCResult_ClosingSignedDecodeErrorZPtr;
10909 * A CResult_ClosingSignedDecodeErrorZ represents the result of a fallible operation,
10910 * containing a crate::lightning::ln::msgs::ClosingSigned on success and a crate::lightning::ln::msgs::DecodeError on failure.
10911 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10913 typedef struct LDKCResult_ClosingSignedDecodeErrorZ {
10915 * The contents of this CResult_ClosingSignedDecodeErrorZ, accessible via either
10916 * `err` or `result` depending on the state of `result_ok`.
10918 union LDKCResult_ClosingSignedDecodeErrorZPtr contents;
10920 * Whether this CResult_ClosingSignedDecodeErrorZ represents a success state.
10923 } LDKCResult_ClosingSignedDecodeErrorZ;
10928 * The minimum and maximum fees which the sender is willing to place on the closing transaction.
10929 * This is provided in [`ClosingSigned`] by both sides to indicate the fee range they are willing
10932 typedef struct MUST_USE_STRUCT LDKClosingSignedFeeRange {
10934 * A pointer to the opaque Rust object.
10935 * Nearly everywhere, inner must be non-null, however in places where
10936 * the Rust equivalent takes an Option, it may be set to null to indicate None.
10938 LDKnativeClosingSignedFeeRange *inner;
10940 * Indicates that this is the only struct which contains the same pointer.
10941 * Rust functions which take ownership of an object provided via an argument require
10942 * this to be true and invalidate the object pointed to by inner.
10945 } LDKClosingSignedFeeRange;
10948 * The contents of CResult_ClosingSignedFeeRangeDecodeErrorZ
10950 typedef union LDKCResult_ClosingSignedFeeRangeDecodeErrorZPtr {
10952 * A pointer to the contents in the success state.
10953 * Reading from this pointer when `result_ok` is not set is undefined.
10955 struct LDKClosingSignedFeeRange *result;
10957 * A pointer to the contents in the error state.
10958 * Reading from this pointer when `result_ok` is set is undefined.
10960 struct LDKDecodeError *err;
10961 } LDKCResult_ClosingSignedFeeRangeDecodeErrorZPtr;
10964 * A CResult_ClosingSignedFeeRangeDecodeErrorZ represents the result of a fallible operation,
10965 * containing a crate::lightning::ln::msgs::ClosingSignedFeeRange on success and a crate::lightning::ln::msgs::DecodeError on failure.
10966 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10968 typedef struct LDKCResult_ClosingSignedFeeRangeDecodeErrorZ {
10970 * The contents of this CResult_ClosingSignedFeeRangeDecodeErrorZ, accessible via either
10971 * `err` or `result` depending on the state of `result_ok`.
10973 union LDKCResult_ClosingSignedFeeRangeDecodeErrorZPtr contents;
10975 * Whether this CResult_ClosingSignedFeeRangeDecodeErrorZ represents a success state.
10978 } LDKCResult_ClosingSignedFeeRangeDecodeErrorZ;
10983 * A commitment_signed message to be sent or received from a peer
10985 typedef struct MUST_USE_STRUCT LDKCommitmentSigned {
10987 * A pointer to the opaque Rust object.
10988 * Nearly everywhere, inner must be non-null, however in places where
10989 * the Rust equivalent takes an Option, it may be set to null to indicate None.
10991 LDKnativeCommitmentSigned *inner;
10993 * Indicates that this is the only struct which contains the same pointer.
10994 * Rust functions which take ownership of an object provided via an argument require
10995 * this to be true and invalidate the object pointed to by inner.
10998 } LDKCommitmentSigned;
11001 * The contents of CResult_CommitmentSignedDecodeErrorZ
11003 typedef union LDKCResult_CommitmentSignedDecodeErrorZPtr {
11005 * A pointer to the contents in the success state.
11006 * Reading from this pointer when `result_ok` is not set is undefined.
11008 struct LDKCommitmentSigned *result;
11010 * A pointer to the contents in the error state.
11011 * Reading from this pointer when `result_ok` is set is undefined.
11013 struct LDKDecodeError *err;
11014 } LDKCResult_CommitmentSignedDecodeErrorZPtr;
11017 * A CResult_CommitmentSignedDecodeErrorZ represents the result of a fallible operation,
11018 * containing a crate::lightning::ln::msgs::CommitmentSigned on success and a crate::lightning::ln::msgs::DecodeError on failure.
11019 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
11021 typedef struct LDKCResult_CommitmentSignedDecodeErrorZ {
11023 * The contents of this CResult_CommitmentSignedDecodeErrorZ, accessible via either
11024 * `err` or `result` depending on the state of `result_ok`.
11026 union LDKCResult_CommitmentSignedDecodeErrorZPtr contents;
11028 * Whether this CResult_CommitmentSignedDecodeErrorZ represents a success state.
11031 } LDKCResult_CommitmentSignedDecodeErrorZ;
11034 * The contents of CResult_FundingCreatedDecodeErrorZ
11036 typedef union LDKCResult_FundingCreatedDecodeErrorZPtr {
11038 * A pointer to the contents in the success state.
11039 * Reading from this pointer when `result_ok` is not set is undefined.
11041 struct LDKFundingCreated *result;
11043 * A pointer to the contents in the error state.
11044 * Reading from this pointer when `result_ok` is set is undefined.
11046 struct LDKDecodeError *err;
11047 } LDKCResult_FundingCreatedDecodeErrorZPtr;
11050 * A CResult_FundingCreatedDecodeErrorZ represents the result of a fallible operation,
11051 * containing a crate::lightning::ln::msgs::FundingCreated on success and a crate::lightning::ln::msgs::DecodeError on failure.
11052 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
11054 typedef struct LDKCResult_FundingCreatedDecodeErrorZ {
11056 * The contents of this CResult_FundingCreatedDecodeErrorZ, accessible via either
11057 * `err` or `result` depending on the state of `result_ok`.
11059 union LDKCResult_FundingCreatedDecodeErrorZPtr contents;
11061 * Whether this CResult_FundingCreatedDecodeErrorZ represents a success state.
11064 } LDKCResult_FundingCreatedDecodeErrorZ;
11067 * The contents of CResult_FundingSignedDecodeErrorZ
11069 typedef union LDKCResult_FundingSignedDecodeErrorZPtr {
11071 * A pointer to the contents in the success state.
11072 * Reading from this pointer when `result_ok` is not set is undefined.
11074 struct LDKFundingSigned *result;
11076 * A pointer to the contents in the error state.
11077 * Reading from this pointer when `result_ok` is set is undefined.
11079 struct LDKDecodeError *err;
11080 } LDKCResult_FundingSignedDecodeErrorZPtr;
11083 * A CResult_FundingSignedDecodeErrorZ represents the result of a fallible operation,
11084 * containing a crate::lightning::ln::msgs::FundingSigned on success and a crate::lightning::ln::msgs::DecodeError on failure.
11085 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
11087 typedef struct LDKCResult_FundingSignedDecodeErrorZ {
11089 * The contents of this CResult_FundingSignedDecodeErrorZ, accessible via either
11090 * `err` or `result` depending on the state of `result_ok`.
11092 union LDKCResult_FundingSignedDecodeErrorZPtr contents;
11094 * Whether this CResult_FundingSignedDecodeErrorZ represents a success state.
11097 } LDKCResult_FundingSignedDecodeErrorZ;
11100 * The contents of CResult_ChannelReadyDecodeErrorZ
11102 typedef union LDKCResult_ChannelReadyDecodeErrorZPtr {
11104 * A pointer to the contents in the success state.
11105 * Reading from this pointer when `result_ok` is not set is undefined.
11107 struct LDKChannelReady *result;
11109 * A pointer to the contents in the error state.
11110 * Reading from this pointer when `result_ok` is set is undefined.
11112 struct LDKDecodeError *err;
11113 } LDKCResult_ChannelReadyDecodeErrorZPtr;
11116 * A CResult_ChannelReadyDecodeErrorZ represents the result of a fallible operation,
11117 * containing a crate::lightning::ln::msgs::ChannelReady on success and a crate::lightning::ln::msgs::DecodeError on failure.
11118 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
11120 typedef struct LDKCResult_ChannelReadyDecodeErrorZ {
11122 * The contents of this CResult_ChannelReadyDecodeErrorZ, accessible via either
11123 * `err` or `result` depending on the state of `result_ok`.
11125 union LDKCResult_ChannelReadyDecodeErrorZPtr contents;
11127 * Whether this CResult_ChannelReadyDecodeErrorZ represents a success state.
11130 } LDKCResult_ChannelReadyDecodeErrorZ;
11135 * An init message to be sent or received from a peer
11137 typedef struct MUST_USE_STRUCT LDKInit {
11139 * A pointer to the opaque Rust object.
11140 * Nearly everywhere, inner must be non-null, however in places where
11141 * the Rust equivalent takes an Option, it may be set to null to indicate None.
11143 LDKnativeInit *inner;
11145 * Indicates that this is the only struct which contains the same pointer.
11146 * Rust functions which take ownership of an object provided via an argument require
11147 * this to be true and invalidate the object pointed to by inner.
11153 * The contents of CResult_InitDecodeErrorZ
11155 typedef union LDKCResult_InitDecodeErrorZPtr {
11157 * A pointer to the contents in the success state.
11158 * Reading from this pointer when `result_ok` is not set is undefined.
11160 struct LDKInit *result;
11162 * A pointer to the contents in the error state.
11163 * Reading from this pointer when `result_ok` is set is undefined.
11165 struct LDKDecodeError *err;
11166 } LDKCResult_InitDecodeErrorZPtr;
11169 * A CResult_InitDecodeErrorZ represents the result of a fallible operation,
11170 * containing a crate::lightning::ln::msgs::Init on success and a crate::lightning::ln::msgs::DecodeError on failure.
11171 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
11173 typedef struct LDKCResult_InitDecodeErrorZ {
11175 * The contents of this CResult_InitDecodeErrorZ, accessible via either
11176 * `err` or `result` depending on the state of `result_ok`.
11178 union LDKCResult_InitDecodeErrorZPtr contents;
11180 * Whether this CResult_InitDecodeErrorZ represents a success state.
11183 } LDKCResult_InitDecodeErrorZ;
11186 * The contents of CResult_OpenChannelDecodeErrorZ
11188 typedef union LDKCResult_OpenChannelDecodeErrorZPtr {
11190 * A pointer to the contents in the success state.
11191 * Reading from this pointer when `result_ok` is not set is undefined.
11193 struct LDKOpenChannel *result;
11195 * A pointer to the contents in the error state.
11196 * Reading from this pointer when `result_ok` is set is undefined.
11198 struct LDKDecodeError *err;
11199 } LDKCResult_OpenChannelDecodeErrorZPtr;
11202 * A CResult_OpenChannelDecodeErrorZ represents the result of a fallible operation,
11203 * containing a crate::lightning::ln::msgs::OpenChannel on success and a crate::lightning::ln::msgs::DecodeError on failure.
11204 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
11206 typedef struct LDKCResult_OpenChannelDecodeErrorZ {
11208 * The contents of this CResult_OpenChannelDecodeErrorZ, accessible via either
11209 * `err` or `result` depending on the state of `result_ok`.
11211 union LDKCResult_OpenChannelDecodeErrorZPtr contents;
11213 * Whether this CResult_OpenChannelDecodeErrorZ represents a success state.
11216 } LDKCResult_OpenChannelDecodeErrorZ;
11219 * The contents of CResult_RevokeAndACKDecodeErrorZ
11221 typedef union LDKCResult_RevokeAndACKDecodeErrorZPtr {
11223 * A pointer to the contents in the success state.
11224 * Reading from this pointer when `result_ok` is not set is undefined.
11226 struct LDKRevokeAndACK *result;
11228 * A pointer to the contents in the error state.
11229 * Reading from this pointer when `result_ok` is set is undefined.
11231 struct LDKDecodeError *err;
11232 } LDKCResult_RevokeAndACKDecodeErrorZPtr;
11235 * A CResult_RevokeAndACKDecodeErrorZ represents the result of a fallible operation,
11236 * containing a crate::lightning::ln::msgs::RevokeAndACK on success and a crate::lightning::ln::msgs::DecodeError on failure.
11237 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
11239 typedef struct LDKCResult_RevokeAndACKDecodeErrorZ {
11241 * The contents of this CResult_RevokeAndACKDecodeErrorZ, accessible via either
11242 * `err` or `result` depending on the state of `result_ok`.
11244 union LDKCResult_RevokeAndACKDecodeErrorZPtr contents;
11246 * Whether this CResult_RevokeAndACKDecodeErrorZ represents a success state.
11249 } LDKCResult_RevokeAndACKDecodeErrorZ;
11252 * The contents of CResult_ShutdownDecodeErrorZ
11254 typedef union LDKCResult_ShutdownDecodeErrorZPtr {
11256 * A pointer to the contents in the success state.
11257 * Reading from this pointer when `result_ok` is not set is undefined.
11259 struct LDKShutdown *result;
11261 * A pointer to the contents in the error state.
11262 * Reading from this pointer when `result_ok` is set is undefined.
11264 struct LDKDecodeError *err;
11265 } LDKCResult_ShutdownDecodeErrorZPtr;
11268 * A CResult_ShutdownDecodeErrorZ represents the result of a fallible operation,
11269 * containing a crate::lightning::ln::msgs::Shutdown on success and a crate::lightning::ln::msgs::DecodeError on failure.
11270 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
11272 typedef struct LDKCResult_ShutdownDecodeErrorZ {
11274 * The contents of this CResult_ShutdownDecodeErrorZ, accessible via either
11275 * `err` or `result` depending on the state of `result_ok`.
11277 union LDKCResult_ShutdownDecodeErrorZPtr contents;
11279 * Whether this CResult_ShutdownDecodeErrorZ represents a success state.
11282 } LDKCResult_ShutdownDecodeErrorZ;
11285 * The contents of CResult_UpdateFailHTLCDecodeErrorZ
11287 typedef union LDKCResult_UpdateFailHTLCDecodeErrorZPtr {
11289 * A pointer to the contents in the success state.
11290 * Reading from this pointer when `result_ok` is not set is undefined.
11292 struct LDKUpdateFailHTLC *result;
11294 * A pointer to the contents in the error state.
11295 * Reading from this pointer when `result_ok` is set is undefined.
11297 struct LDKDecodeError *err;
11298 } LDKCResult_UpdateFailHTLCDecodeErrorZPtr;
11301 * A CResult_UpdateFailHTLCDecodeErrorZ represents the result of a fallible operation,
11302 * containing a crate::lightning::ln::msgs::UpdateFailHTLC on success and a crate::lightning::ln::msgs::DecodeError on failure.
11303 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
11305 typedef struct LDKCResult_UpdateFailHTLCDecodeErrorZ {
11307 * The contents of this CResult_UpdateFailHTLCDecodeErrorZ, accessible via either
11308 * `err` or `result` depending on the state of `result_ok`.
11310 union LDKCResult_UpdateFailHTLCDecodeErrorZPtr contents;
11312 * Whether this CResult_UpdateFailHTLCDecodeErrorZ represents a success state.
11315 } LDKCResult_UpdateFailHTLCDecodeErrorZ;
11318 * The contents of CResult_UpdateFailMalformedHTLCDecodeErrorZ
11320 typedef union LDKCResult_UpdateFailMalformedHTLCDecodeErrorZPtr {
11322 * A pointer to the contents in the success state.
11323 * Reading from this pointer when `result_ok` is not set is undefined.
11325 struct LDKUpdateFailMalformedHTLC *result;
11327 * A pointer to the contents in the error state.
11328 * Reading from this pointer when `result_ok` is set is undefined.
11330 struct LDKDecodeError *err;
11331 } LDKCResult_UpdateFailMalformedHTLCDecodeErrorZPtr;
11334 * A CResult_UpdateFailMalformedHTLCDecodeErrorZ represents the result of a fallible operation,
11335 * containing a crate::lightning::ln::msgs::UpdateFailMalformedHTLC on success and a crate::lightning::ln::msgs::DecodeError on failure.
11336 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
11338 typedef struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ {
11340 * The contents of this CResult_UpdateFailMalformedHTLCDecodeErrorZ, accessible via either
11341 * `err` or `result` depending on the state of `result_ok`.
11343 union LDKCResult_UpdateFailMalformedHTLCDecodeErrorZPtr contents;
11345 * Whether this CResult_UpdateFailMalformedHTLCDecodeErrorZ represents a success state.
11348 } LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ;
11353 * An update_fee message to be sent or received from a peer
11355 typedef struct MUST_USE_STRUCT LDKUpdateFee {
11357 * A pointer to the opaque Rust object.
11358 * Nearly everywhere, inner must be non-null, however in places where
11359 * the Rust equivalent takes an Option, it may be set to null to indicate None.
11361 LDKnativeUpdateFee *inner;
11363 * Indicates that this is the only struct which contains the same pointer.
11364 * Rust functions which take ownership of an object provided via an argument require
11365 * this to be true and invalidate the object pointed to by inner.
11371 * The contents of CResult_UpdateFeeDecodeErrorZ
11373 typedef union LDKCResult_UpdateFeeDecodeErrorZPtr {
11375 * A pointer to the contents in the success state.
11376 * Reading from this pointer when `result_ok` is not set is undefined.
11378 struct LDKUpdateFee *result;
11380 * A pointer to the contents in the error state.
11381 * Reading from this pointer when `result_ok` is set is undefined.
11383 struct LDKDecodeError *err;
11384 } LDKCResult_UpdateFeeDecodeErrorZPtr;
11387 * A CResult_UpdateFeeDecodeErrorZ represents the result of a fallible operation,
11388 * containing a crate::lightning::ln::msgs::UpdateFee on success and a crate::lightning::ln::msgs::DecodeError on failure.
11389 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
11391 typedef struct LDKCResult_UpdateFeeDecodeErrorZ {
11393 * The contents of this CResult_UpdateFeeDecodeErrorZ, accessible via either
11394 * `err` or `result` depending on the state of `result_ok`.
11396 union LDKCResult_UpdateFeeDecodeErrorZPtr contents;
11398 * Whether this CResult_UpdateFeeDecodeErrorZ represents a success state.
11401 } LDKCResult_UpdateFeeDecodeErrorZ;
11404 * The contents of CResult_UpdateFulfillHTLCDecodeErrorZ
11406 typedef union LDKCResult_UpdateFulfillHTLCDecodeErrorZPtr {
11408 * A pointer to the contents in the success state.
11409 * Reading from this pointer when `result_ok` is not set is undefined.
11411 struct LDKUpdateFulfillHTLC *result;
11413 * A pointer to the contents in the error state.
11414 * Reading from this pointer when `result_ok` is set is undefined.
11416 struct LDKDecodeError *err;
11417 } LDKCResult_UpdateFulfillHTLCDecodeErrorZPtr;
11420 * A CResult_UpdateFulfillHTLCDecodeErrorZ represents the result of a fallible operation,
11421 * containing a crate::lightning::ln::msgs::UpdateFulfillHTLC on success and a crate::lightning::ln::msgs::DecodeError on failure.
11422 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
11424 typedef struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ {
11426 * The contents of this CResult_UpdateFulfillHTLCDecodeErrorZ, accessible via either
11427 * `err` or `result` depending on the state of `result_ok`.
11429 union LDKCResult_UpdateFulfillHTLCDecodeErrorZPtr contents;
11431 * Whether this CResult_UpdateFulfillHTLCDecodeErrorZ represents a success state.
11434 } LDKCResult_UpdateFulfillHTLCDecodeErrorZ;
11437 * The contents of CResult_UpdateAddHTLCDecodeErrorZ
11439 typedef union LDKCResult_UpdateAddHTLCDecodeErrorZPtr {
11441 * A pointer to the contents in the success state.
11442 * Reading from this pointer when `result_ok` is not set is undefined.
11444 struct LDKUpdateAddHTLC *result;
11446 * A pointer to the contents in the error state.
11447 * Reading from this pointer when `result_ok` is set is undefined.
11449 struct LDKDecodeError *err;
11450 } LDKCResult_UpdateAddHTLCDecodeErrorZPtr;
11453 * A CResult_UpdateAddHTLCDecodeErrorZ represents the result of a fallible operation,
11454 * containing a crate::lightning::ln::msgs::UpdateAddHTLC on success and a crate::lightning::ln::msgs::DecodeError on failure.
11455 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
11457 typedef struct LDKCResult_UpdateAddHTLCDecodeErrorZ {
11459 * The contents of this CResult_UpdateAddHTLCDecodeErrorZ, accessible via either
11460 * `err` or `result` depending on the state of `result_ok`.
11462 union LDKCResult_UpdateAddHTLCDecodeErrorZPtr contents;
11464 * Whether this CResult_UpdateAddHTLCDecodeErrorZ represents a success state.
11467 } LDKCResult_UpdateAddHTLCDecodeErrorZ;
11472 * An onion message to be sent or received from a peer
11474 typedef struct MUST_USE_STRUCT LDKOnionMessage {
11476 * A pointer to the opaque Rust object.
11477 * Nearly everywhere, inner must be non-null, however in places where
11478 * the Rust equivalent takes an Option, it may be set to null to indicate None.
11480 LDKnativeOnionMessage *inner;
11482 * Indicates that this is the only struct which contains the same pointer.
11483 * Rust functions which take ownership of an object provided via an argument require
11484 * this to be true and invalidate the object pointed to by inner.
11490 * The contents of CResult_OnionMessageDecodeErrorZ
11492 typedef union LDKCResult_OnionMessageDecodeErrorZPtr {
11494 * A pointer to the contents in the success state.
11495 * Reading from this pointer when `result_ok` is not set is undefined.
11497 struct LDKOnionMessage *result;
11499 * A pointer to the contents in the error state.
11500 * Reading from this pointer when `result_ok` is set is undefined.
11502 struct LDKDecodeError *err;
11503 } LDKCResult_OnionMessageDecodeErrorZPtr;
11506 * A CResult_OnionMessageDecodeErrorZ represents the result of a fallible operation,
11507 * containing a crate::lightning::ln::msgs::OnionMessage on success and a crate::lightning::ln::msgs::DecodeError on failure.
11508 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
11510 typedef struct LDKCResult_OnionMessageDecodeErrorZ {
11512 * The contents of this CResult_OnionMessageDecodeErrorZ, accessible via either
11513 * `err` or `result` depending on the state of `result_ok`.
11515 union LDKCResult_OnionMessageDecodeErrorZPtr contents;
11517 * Whether this CResult_OnionMessageDecodeErrorZ represents a success state.
11520 } LDKCResult_OnionMessageDecodeErrorZ;
11525 * A ping message to be sent or received from a peer
11527 typedef struct MUST_USE_STRUCT LDKPing {
11529 * A pointer to the opaque Rust object.
11530 * Nearly everywhere, inner must be non-null, however in places where
11531 * the Rust equivalent takes an Option, it may be set to null to indicate None.
11533 LDKnativePing *inner;
11535 * Indicates that this is the only struct which contains the same pointer.
11536 * Rust functions which take ownership of an object provided via an argument require
11537 * this to be true and invalidate the object pointed to by inner.
11543 * The contents of CResult_PingDecodeErrorZ
11545 typedef union LDKCResult_PingDecodeErrorZPtr {
11547 * A pointer to the contents in the success state.
11548 * Reading from this pointer when `result_ok` is not set is undefined.
11550 struct LDKPing *result;
11552 * A pointer to the contents in the error state.
11553 * Reading from this pointer when `result_ok` is set is undefined.
11555 struct LDKDecodeError *err;
11556 } LDKCResult_PingDecodeErrorZPtr;
11559 * A CResult_PingDecodeErrorZ represents the result of a fallible operation,
11560 * containing a crate::lightning::ln::msgs::Ping on success and a crate::lightning::ln::msgs::DecodeError on failure.
11561 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
11563 typedef struct LDKCResult_PingDecodeErrorZ {
11565 * The contents of this CResult_PingDecodeErrorZ, accessible via either
11566 * `err` or `result` depending on the state of `result_ok`.
11568 union LDKCResult_PingDecodeErrorZPtr contents;
11570 * Whether this CResult_PingDecodeErrorZ represents a success state.
11573 } LDKCResult_PingDecodeErrorZ;
11578 * A pong message to be sent or received from a peer
11580 typedef struct MUST_USE_STRUCT LDKPong {
11582 * A pointer to the opaque Rust object.
11583 * Nearly everywhere, inner must be non-null, however in places where
11584 * the Rust equivalent takes an Option, it may be set to null to indicate None.
11586 LDKnativePong *inner;
11588 * Indicates that this is the only struct which contains the same pointer.
11589 * Rust functions which take ownership of an object provided via an argument require
11590 * this to be true and invalidate the object pointed to by inner.
11596 * The contents of CResult_PongDecodeErrorZ
11598 typedef union LDKCResult_PongDecodeErrorZPtr {
11600 * A pointer to the contents in the success state.
11601 * Reading from this pointer when `result_ok` is not set is undefined.
11603 struct LDKPong *result;
11605 * A pointer to the contents in the error state.
11606 * Reading from this pointer when `result_ok` is set is undefined.
11608 struct LDKDecodeError *err;
11609 } LDKCResult_PongDecodeErrorZPtr;
11612 * A CResult_PongDecodeErrorZ represents the result of a fallible operation,
11613 * containing a crate::lightning::ln::msgs::Pong on success and a crate::lightning::ln::msgs::DecodeError on failure.
11614 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
11616 typedef struct LDKCResult_PongDecodeErrorZ {
11618 * The contents of this CResult_PongDecodeErrorZ, accessible via either
11619 * `err` or `result` depending on the state of `result_ok`.
11621 union LDKCResult_PongDecodeErrorZPtr contents;
11623 * Whether this CResult_PongDecodeErrorZ represents a success state.
11626 } LDKCResult_PongDecodeErrorZ;
11629 * The contents of CResult_UnsignedChannelAnnouncementDecodeErrorZ
11631 typedef union LDKCResult_UnsignedChannelAnnouncementDecodeErrorZPtr {
11633 * A pointer to the contents in the success state.
11634 * Reading from this pointer when `result_ok` is not set is undefined.
11636 struct LDKUnsignedChannelAnnouncement *result;
11638 * A pointer to the contents in the error state.
11639 * Reading from this pointer when `result_ok` is set is undefined.
11641 struct LDKDecodeError *err;
11642 } LDKCResult_UnsignedChannelAnnouncementDecodeErrorZPtr;
11645 * A CResult_UnsignedChannelAnnouncementDecodeErrorZ represents the result of a fallible operation,
11646 * containing a crate::lightning::ln::msgs::UnsignedChannelAnnouncement on success and a crate::lightning::ln::msgs::DecodeError on failure.
11647 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
11649 typedef struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ {
11651 * The contents of this CResult_UnsignedChannelAnnouncementDecodeErrorZ, accessible via either
11652 * `err` or `result` depending on the state of `result_ok`.
11654 union LDKCResult_UnsignedChannelAnnouncementDecodeErrorZPtr contents;
11656 * Whether this CResult_UnsignedChannelAnnouncementDecodeErrorZ represents a success state.
11659 } LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ;
11662 * The contents of CResult_ChannelAnnouncementDecodeErrorZ
11664 typedef union LDKCResult_ChannelAnnouncementDecodeErrorZPtr {
11666 * A pointer to the contents in the success state.
11667 * Reading from this pointer when `result_ok` is not set is undefined.
11669 struct LDKChannelAnnouncement *result;
11671 * A pointer to the contents in the error state.
11672 * Reading from this pointer when `result_ok` is set is undefined.
11674 struct LDKDecodeError *err;
11675 } LDKCResult_ChannelAnnouncementDecodeErrorZPtr;
11678 * A CResult_ChannelAnnouncementDecodeErrorZ represents the result of a fallible operation,
11679 * containing a crate::lightning::ln::msgs::ChannelAnnouncement on success and a crate::lightning::ln::msgs::DecodeError on failure.
11680 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
11682 typedef struct LDKCResult_ChannelAnnouncementDecodeErrorZ {
11684 * The contents of this CResult_ChannelAnnouncementDecodeErrorZ, accessible via either
11685 * `err` or `result` depending on the state of `result_ok`.
11687 union LDKCResult_ChannelAnnouncementDecodeErrorZPtr contents;
11689 * Whether this CResult_ChannelAnnouncementDecodeErrorZ represents a success state.
11692 } LDKCResult_ChannelAnnouncementDecodeErrorZ;
11697 * The unsigned part of a channel_update
11699 typedef struct MUST_USE_STRUCT LDKUnsignedChannelUpdate {
11701 * A pointer to the opaque Rust object.
11702 * Nearly everywhere, inner must be non-null, however in places where
11703 * the Rust equivalent takes an Option, it may be set to null to indicate None.
11705 LDKnativeUnsignedChannelUpdate *inner;
11707 * Indicates that this is the only struct which contains the same pointer.
11708 * Rust functions which take ownership of an object provided via an argument require
11709 * this to be true and invalidate the object pointed to by inner.
11712 } LDKUnsignedChannelUpdate;
11715 * The contents of CResult_UnsignedChannelUpdateDecodeErrorZ
11717 typedef union LDKCResult_UnsignedChannelUpdateDecodeErrorZPtr {
11719 * A pointer to the contents in the success state.
11720 * Reading from this pointer when `result_ok` is not set is undefined.
11722 struct LDKUnsignedChannelUpdate *result;
11724 * A pointer to the contents in the error state.
11725 * Reading from this pointer when `result_ok` is set is undefined.
11727 struct LDKDecodeError *err;
11728 } LDKCResult_UnsignedChannelUpdateDecodeErrorZPtr;
11731 * A CResult_UnsignedChannelUpdateDecodeErrorZ represents the result of a fallible operation,
11732 * containing a crate::lightning::ln::msgs::UnsignedChannelUpdate on success and a crate::lightning::ln::msgs::DecodeError on failure.
11733 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
11735 typedef struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ {
11737 * The contents of this CResult_UnsignedChannelUpdateDecodeErrorZ, accessible via either
11738 * `err` or `result` depending on the state of `result_ok`.
11740 union LDKCResult_UnsignedChannelUpdateDecodeErrorZPtr contents;
11742 * Whether this CResult_UnsignedChannelUpdateDecodeErrorZ represents a success state.
11745 } LDKCResult_UnsignedChannelUpdateDecodeErrorZ;
11748 * The contents of CResult_ChannelUpdateDecodeErrorZ
11750 typedef union LDKCResult_ChannelUpdateDecodeErrorZPtr {
11752 * A pointer to the contents in the success state.
11753 * Reading from this pointer when `result_ok` is not set is undefined.
11755 struct LDKChannelUpdate *result;
11757 * A pointer to the contents in the error state.
11758 * Reading from this pointer when `result_ok` is set is undefined.
11760 struct LDKDecodeError *err;
11761 } LDKCResult_ChannelUpdateDecodeErrorZPtr;
11764 * A CResult_ChannelUpdateDecodeErrorZ represents the result of a fallible operation,
11765 * containing a crate::lightning::ln::msgs::ChannelUpdate on success and a crate::lightning::ln::msgs::DecodeError on failure.
11766 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
11768 typedef struct LDKCResult_ChannelUpdateDecodeErrorZ {
11770 * The contents of this CResult_ChannelUpdateDecodeErrorZ, accessible via either
11771 * `err` or `result` depending on the state of `result_ok`.
11773 union LDKCResult_ChannelUpdateDecodeErrorZPtr contents;
11775 * Whether this CResult_ChannelUpdateDecodeErrorZ represents a success state.
11778 } LDKCResult_ChannelUpdateDecodeErrorZ;
11781 * The contents of CResult_ErrorMessageDecodeErrorZ
11783 typedef union LDKCResult_ErrorMessageDecodeErrorZPtr {
11785 * A pointer to the contents in the success state.
11786 * Reading from this pointer when `result_ok` is not set is undefined.
11788 struct LDKErrorMessage *result;
11790 * A pointer to the contents in the error state.
11791 * Reading from this pointer when `result_ok` is set is undefined.
11793 struct LDKDecodeError *err;
11794 } LDKCResult_ErrorMessageDecodeErrorZPtr;
11797 * A CResult_ErrorMessageDecodeErrorZ represents the result of a fallible operation,
11798 * containing a crate::lightning::ln::msgs::ErrorMessage on success and a crate::lightning::ln::msgs::DecodeError on failure.
11799 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
11801 typedef struct LDKCResult_ErrorMessageDecodeErrorZ {
11803 * The contents of this CResult_ErrorMessageDecodeErrorZ, accessible via either
11804 * `err` or `result` depending on the state of `result_ok`.
11806 union LDKCResult_ErrorMessageDecodeErrorZPtr contents;
11808 * Whether this CResult_ErrorMessageDecodeErrorZ represents a success state.
11811 } LDKCResult_ErrorMessageDecodeErrorZ;
11814 * The contents of CResult_WarningMessageDecodeErrorZ
11816 typedef union LDKCResult_WarningMessageDecodeErrorZPtr {
11818 * A pointer to the contents in the success state.
11819 * Reading from this pointer when `result_ok` is not set is undefined.
11821 struct LDKWarningMessage *result;
11823 * A pointer to the contents in the error state.
11824 * Reading from this pointer when `result_ok` is set is undefined.
11826 struct LDKDecodeError *err;
11827 } LDKCResult_WarningMessageDecodeErrorZPtr;
11830 * A CResult_WarningMessageDecodeErrorZ represents the result of a fallible operation,
11831 * containing a crate::lightning::ln::msgs::WarningMessage on success and a crate::lightning::ln::msgs::DecodeError on failure.
11832 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
11834 typedef struct LDKCResult_WarningMessageDecodeErrorZ {
11836 * The contents of this CResult_WarningMessageDecodeErrorZ, accessible via either
11837 * `err` or `result` depending on the state of `result_ok`.
11839 union LDKCResult_WarningMessageDecodeErrorZPtr contents;
11841 * Whether this CResult_WarningMessageDecodeErrorZ represents a success state.
11844 } LDKCResult_WarningMessageDecodeErrorZ;
11849 * The unsigned part of a node_announcement
11851 typedef struct MUST_USE_STRUCT LDKUnsignedNodeAnnouncement {
11853 * A pointer to the opaque Rust object.
11854 * Nearly everywhere, inner must be non-null, however in places where
11855 * the Rust equivalent takes an Option, it may be set to null to indicate None.
11857 LDKnativeUnsignedNodeAnnouncement *inner;
11859 * Indicates that this is the only struct which contains the same pointer.
11860 * Rust functions which take ownership of an object provided via an argument require
11861 * this to be true and invalidate the object pointed to by inner.
11864 } LDKUnsignedNodeAnnouncement;
11867 * The contents of CResult_UnsignedNodeAnnouncementDecodeErrorZ
11869 typedef union LDKCResult_UnsignedNodeAnnouncementDecodeErrorZPtr {
11871 * A pointer to the contents in the success state.
11872 * Reading from this pointer when `result_ok` is not set is undefined.
11874 struct LDKUnsignedNodeAnnouncement *result;
11876 * A pointer to the contents in the error state.
11877 * Reading from this pointer when `result_ok` is set is undefined.
11879 struct LDKDecodeError *err;
11880 } LDKCResult_UnsignedNodeAnnouncementDecodeErrorZPtr;
11883 * A CResult_UnsignedNodeAnnouncementDecodeErrorZ represents the result of a fallible operation,
11884 * containing a crate::lightning::ln::msgs::UnsignedNodeAnnouncement on success and a crate::lightning::ln::msgs::DecodeError on failure.
11885 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
11887 typedef struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ {
11889 * The contents of this CResult_UnsignedNodeAnnouncementDecodeErrorZ, accessible via either
11890 * `err` or `result` depending on the state of `result_ok`.
11892 union LDKCResult_UnsignedNodeAnnouncementDecodeErrorZPtr contents;
11894 * Whether this CResult_UnsignedNodeAnnouncementDecodeErrorZ represents a success state.
11897 } LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ;
11902 * A node_announcement message to be sent or received from a peer
11904 typedef struct MUST_USE_STRUCT LDKNodeAnnouncement {
11906 * A pointer to the opaque Rust object.
11907 * Nearly everywhere, inner must be non-null, however in places where
11908 * the Rust equivalent takes an Option, it may be set to null to indicate None.
11910 LDKnativeNodeAnnouncement *inner;
11912 * Indicates that this is the only struct which contains the same pointer.
11913 * Rust functions which take ownership of an object provided via an argument require
11914 * this to be true and invalidate the object pointed to by inner.
11917 } LDKNodeAnnouncement;
11920 * The contents of CResult_NodeAnnouncementDecodeErrorZ
11922 typedef union LDKCResult_NodeAnnouncementDecodeErrorZPtr {
11924 * A pointer to the contents in the success state.
11925 * Reading from this pointer when `result_ok` is not set is undefined.
11927 struct LDKNodeAnnouncement *result;
11929 * A pointer to the contents in the error state.
11930 * Reading from this pointer when `result_ok` is set is undefined.
11932 struct LDKDecodeError *err;
11933 } LDKCResult_NodeAnnouncementDecodeErrorZPtr;
11936 * A CResult_NodeAnnouncementDecodeErrorZ represents the result of a fallible operation,
11937 * containing a crate::lightning::ln::msgs::NodeAnnouncement on success and a crate::lightning::ln::msgs::DecodeError on failure.
11938 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
11940 typedef struct LDKCResult_NodeAnnouncementDecodeErrorZ {
11942 * The contents of this CResult_NodeAnnouncementDecodeErrorZ, accessible via either
11943 * `err` or `result` depending on the state of `result_ok`.
11945 union LDKCResult_NodeAnnouncementDecodeErrorZPtr contents;
11947 * Whether this CResult_NodeAnnouncementDecodeErrorZ represents a success state.
11950 } LDKCResult_NodeAnnouncementDecodeErrorZ;
11953 * The contents of CResult_QueryShortChannelIdsDecodeErrorZ
11955 typedef union LDKCResult_QueryShortChannelIdsDecodeErrorZPtr {
11957 * A pointer to the contents in the success state.
11958 * Reading from this pointer when `result_ok` is not set is undefined.
11960 struct LDKQueryShortChannelIds *result;
11962 * A pointer to the contents in the error state.
11963 * Reading from this pointer when `result_ok` is set is undefined.
11965 struct LDKDecodeError *err;
11966 } LDKCResult_QueryShortChannelIdsDecodeErrorZPtr;
11969 * A CResult_QueryShortChannelIdsDecodeErrorZ represents the result of a fallible operation,
11970 * containing a crate::lightning::ln::msgs::QueryShortChannelIds on success and a crate::lightning::ln::msgs::DecodeError on failure.
11971 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
11973 typedef struct LDKCResult_QueryShortChannelIdsDecodeErrorZ {
11975 * The contents of this CResult_QueryShortChannelIdsDecodeErrorZ, accessible via either
11976 * `err` or `result` depending on the state of `result_ok`.
11978 union LDKCResult_QueryShortChannelIdsDecodeErrorZPtr contents;
11980 * Whether this CResult_QueryShortChannelIdsDecodeErrorZ represents a success state.
11983 } LDKCResult_QueryShortChannelIdsDecodeErrorZ;
11988 * A reply_short_channel_ids_end message is sent as a reply to a
11989 * query_short_channel_ids message. The query recipient makes a best
11990 * effort to respond based on their local network view which may not be
11991 * a perfect view of the network.
11993 typedef struct MUST_USE_STRUCT LDKReplyShortChannelIdsEnd {
11995 * A pointer to the opaque Rust object.
11996 * Nearly everywhere, inner must be non-null, however in places where
11997 * the Rust equivalent takes an Option, it may be set to null to indicate None.
11999 LDKnativeReplyShortChannelIdsEnd *inner;
12001 * Indicates that this is the only struct which contains the same pointer.
12002 * Rust functions which take ownership of an object provided via an argument require
12003 * this to be true and invalidate the object pointed to by inner.
12006 } LDKReplyShortChannelIdsEnd;
12009 * The contents of CResult_ReplyShortChannelIdsEndDecodeErrorZ
12011 typedef union LDKCResult_ReplyShortChannelIdsEndDecodeErrorZPtr {
12013 * A pointer to the contents in the success state.
12014 * Reading from this pointer when `result_ok` is not set is undefined.
12016 struct LDKReplyShortChannelIdsEnd *result;
12018 * A pointer to the contents in the error state.
12019 * Reading from this pointer when `result_ok` is set is undefined.
12021 struct LDKDecodeError *err;
12022 } LDKCResult_ReplyShortChannelIdsEndDecodeErrorZPtr;
12025 * A CResult_ReplyShortChannelIdsEndDecodeErrorZ represents the result of a fallible operation,
12026 * containing a crate::lightning::ln::msgs::ReplyShortChannelIdsEnd on success and a crate::lightning::ln::msgs::DecodeError on failure.
12027 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
12029 typedef struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ {
12031 * The contents of this CResult_ReplyShortChannelIdsEndDecodeErrorZ, accessible via either
12032 * `err` or `result` depending on the state of `result_ok`.
12034 union LDKCResult_ReplyShortChannelIdsEndDecodeErrorZPtr contents;
12036 * Whether this CResult_ReplyShortChannelIdsEndDecodeErrorZ represents a success state.
12039 } LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ;
12042 * The contents of CResult_QueryChannelRangeDecodeErrorZ
12044 typedef union LDKCResult_QueryChannelRangeDecodeErrorZPtr {
12046 * A pointer to the contents in the success state.
12047 * Reading from this pointer when `result_ok` is not set is undefined.
12049 struct LDKQueryChannelRange *result;
12051 * A pointer to the contents in the error state.
12052 * Reading from this pointer when `result_ok` is set is undefined.
12054 struct LDKDecodeError *err;
12055 } LDKCResult_QueryChannelRangeDecodeErrorZPtr;
12058 * A CResult_QueryChannelRangeDecodeErrorZ represents the result of a fallible operation,
12059 * containing a crate::lightning::ln::msgs::QueryChannelRange on success and a crate::lightning::ln::msgs::DecodeError on failure.
12060 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
12062 typedef struct LDKCResult_QueryChannelRangeDecodeErrorZ {
12064 * The contents of this CResult_QueryChannelRangeDecodeErrorZ, accessible via either
12065 * `err` or `result` depending on the state of `result_ok`.
12067 union LDKCResult_QueryChannelRangeDecodeErrorZPtr contents;
12069 * Whether this CResult_QueryChannelRangeDecodeErrorZ represents a success state.
12072 } LDKCResult_QueryChannelRangeDecodeErrorZ;
12075 * The contents of CResult_ReplyChannelRangeDecodeErrorZ
12077 typedef union LDKCResult_ReplyChannelRangeDecodeErrorZPtr {
12079 * A pointer to the contents in the success state.
12080 * Reading from this pointer when `result_ok` is not set is undefined.
12082 struct LDKReplyChannelRange *result;
12084 * A pointer to the contents in the error state.
12085 * Reading from this pointer when `result_ok` is set is undefined.
12087 struct LDKDecodeError *err;
12088 } LDKCResult_ReplyChannelRangeDecodeErrorZPtr;
12091 * A CResult_ReplyChannelRangeDecodeErrorZ represents the result of a fallible operation,
12092 * containing a crate::lightning::ln::msgs::ReplyChannelRange on success and a crate::lightning::ln::msgs::DecodeError on failure.
12093 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
12095 typedef struct LDKCResult_ReplyChannelRangeDecodeErrorZ {
12097 * The contents of this CResult_ReplyChannelRangeDecodeErrorZ, accessible via either
12098 * `err` or `result` depending on the state of `result_ok`.
12100 union LDKCResult_ReplyChannelRangeDecodeErrorZPtr contents;
12102 * Whether this CResult_ReplyChannelRangeDecodeErrorZ represents a success state.
12105 } LDKCResult_ReplyChannelRangeDecodeErrorZ;
12108 * The contents of CResult_GossipTimestampFilterDecodeErrorZ
12110 typedef union LDKCResult_GossipTimestampFilterDecodeErrorZPtr {
12112 * A pointer to the contents in the success state.
12113 * Reading from this pointer when `result_ok` is not set is undefined.
12115 struct LDKGossipTimestampFilter *result;
12117 * A pointer to the contents in the error state.
12118 * Reading from this pointer when `result_ok` is set is undefined.
12120 struct LDKDecodeError *err;
12121 } LDKCResult_GossipTimestampFilterDecodeErrorZPtr;
12124 * A CResult_GossipTimestampFilterDecodeErrorZ represents the result of a fallible operation,
12125 * containing a crate::lightning::ln::msgs::GossipTimestampFilter on success and a crate::lightning::ln::msgs::DecodeError on failure.
12126 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
12128 typedef struct LDKCResult_GossipTimestampFilterDecodeErrorZ {
12130 * The contents of this CResult_GossipTimestampFilterDecodeErrorZ, accessible via either
12131 * `err` or `result` depending on the state of `result_ok`.
12133 union LDKCResult_GossipTimestampFilterDecodeErrorZPtr contents;
12135 * Whether this CResult_GossipTimestampFilterDecodeErrorZ represents a success state.
12138 } LDKCResult_GossipTimestampFilterDecodeErrorZ;
12141 * A dynamically-allocated array of crate::lightning::ln::channelmanager::PhantomRouteHintss of arbitrary size.
12142 * This corresponds to std::vector in C++
12144 typedef struct LDKCVec_PhantomRouteHintsZ {
12146 * The elements in the array.
12147 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
12149 struct LDKPhantomRouteHints *data;
12151 * The number of elements pointed to by `data`.
12154 } LDKCVec_PhantomRouteHintsZ;
12157 * When signing using a fallible method either an user-supplied `SignError` or a `CreationError`
12160 typedef enum LDKSignOrCreationError_Tag {
12162 * An error occurred during signing
12164 LDKSignOrCreationError_SignError,
12166 * An error occurred while building the transaction
12168 LDKSignOrCreationError_CreationError,
12170 * Must be last for serialization purposes
12172 LDKSignOrCreationError_Sentinel,
12173 } LDKSignOrCreationError_Tag;
12175 typedef struct MUST_USE_STRUCT LDKSignOrCreationError {
12176 LDKSignOrCreationError_Tag tag;
12179 enum LDKCreationError creation_error;
12182 } LDKSignOrCreationError;
12185 * The contents of CResult_InvoiceSignOrCreationErrorZ
12187 typedef union LDKCResult_InvoiceSignOrCreationErrorZPtr {
12189 * A pointer to the contents in the success state.
12190 * Reading from this pointer when `result_ok` is not set is undefined.
12192 struct LDKInvoice *result;
12194 * A pointer to the contents in the error state.
12195 * Reading from this pointer when `result_ok` is set is undefined.
12197 struct LDKSignOrCreationError *err;
12198 } LDKCResult_InvoiceSignOrCreationErrorZPtr;
12201 * A CResult_InvoiceSignOrCreationErrorZ represents the result of a fallible operation,
12202 * containing a crate::lightning_invoice::Invoice on success and a crate::lightning_invoice::SignOrCreationError on failure.
12203 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
12205 typedef struct LDKCResult_InvoiceSignOrCreationErrorZ {
12207 * The contents of this CResult_InvoiceSignOrCreationErrorZ, accessible via either
12208 * `err` or `result` depending on the state of `result_ok`.
12210 union LDKCResult_InvoiceSignOrCreationErrorZPtr contents;
12212 * Whether this CResult_InvoiceSignOrCreationErrorZ represents a success state.
12215 } LDKCResult_InvoiceSignOrCreationErrorZ;
12220 * A transaction output watched by a [`ChannelMonitor`] for spends on-chain.
12222 * Used to convey to a [`Filter`] such an output with a given spending condition. Any transaction
12223 * spending the output must be given to [`ChannelMonitor::block_connected`] either directly or via
12224 * [`Confirm::transactions_confirmed`].
12226 * If `block_hash` is `Some`, this indicates the output was created in the corresponding block and
12227 * may have been spent there. See [`Filter::register_output`] for details.
12229 * [`ChannelMonitor`]: channelmonitor::ChannelMonitor
12230 * [`ChannelMonitor::block_connected`]: channelmonitor::ChannelMonitor::block_connected
12232 typedef struct MUST_USE_STRUCT LDKWatchedOutput {
12234 * A pointer to the opaque Rust object.
12235 * Nearly everywhere, inner must be non-null, however in places where
12236 * the Rust equivalent takes an Option, it may be set to null to indicate None.
12238 LDKnativeWatchedOutput *inner;
12240 * Indicates that this is the only struct which contains the same pointer.
12241 * Rust functions which take ownership of an object provided via an argument require
12242 * this to be true and invalidate the object pointed to by inner.
12245 } LDKWatchedOutput;
12248 * The `Filter` trait defines behavior for indicating chain activity of interest pertaining to
12251 * This is useful in order to have a [`Watch`] implementation convey to a chain source which
12252 * transactions to be notified of. Notification may take the form of pre-filtering blocks or, in
12253 * the case of [BIP 157]/[BIP 158], only fetching a block if the compact filter matches. If
12254 * receiving full blocks from a chain source, any further filtering is unnecessary.
12256 * After an output has been registered, subsequent block retrievals from the chain source must not
12257 * exclude any transactions matching the new criteria nor any in-block descendants of such
12260 * Note that use as part of a [`Watch`] implementation involves reentrancy. Therefore, the `Filter`
12261 * should not block on I/O. Implementations should instead queue the newly monitored data to be
12262 * processed later. Then, in order to block until the data has been processed, any [`Watch`]
12263 * invocation that has called the `Filter` must return [`InProgress`].
12265 * [`InProgress`]: ChannelMonitorUpdateStatus::InProgress
12266 * [BIP 157]: https://github.com/bitcoin/bips/blob/master/bip-0157.mediawiki
12267 * [BIP 158]: https://github.com/bitcoin/bips/blob/master/bip-0158.mediawiki
12269 typedef struct LDKFilter {
12271 * An opaque pointer which is passed to your function implementations as an argument.
12272 * This has no meaning in the LDK, and can be NULL or any other value.
12276 * Registers interest in a transaction with `txid` and having an output with `script_pubkey` as
12277 * a spending condition.
12279 void (*register_tx)(const void *this_arg, const uint8_t (*txid)[32], struct LDKu8slice script_pubkey);
12281 * Registers interest in spends of a transaction output.
12283 * Note that this method might be called during processing of a new block. You therefore need
12284 * to ensure that also dependent output spents within an already connected block are correctly
12285 * handled, e.g., by re-scanning the block in question whenever new outputs have been
12286 * registered mid-processing.
12288 void (*register_output)(const void *this_arg, struct LDKWatchedOutput output);
12290 * Frees any resources associated with this object given its this_arg pointer.
12291 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
12293 void (*free)(void *this_arg);
12297 * An enum which can either contain a crate::lightning::chain::Filter or not
12299 typedef enum LDKCOption_FilterZ_Tag {
12301 * When we're in this state, this COption_FilterZ contains a crate::lightning::chain::Filter
12303 LDKCOption_FilterZ_Some,
12305 * When we're in this state, this COption_FilterZ contains nothing
12307 LDKCOption_FilterZ_None,
12309 * Must be last for serialization purposes
12311 LDKCOption_FilterZ_Sentinel,
12312 } LDKCOption_FilterZ_Tag;
12314 typedef struct LDKCOption_FilterZ {
12315 LDKCOption_FilterZ_Tag tag;
12318 struct LDKFilter some;
12321 } LDKCOption_FilterZ;
12326 * A read-only reference to a current ChannelMonitor.
12328 * Note that this holds a mutex in [`ChainMonitor`] and may block other events until it is
12331 typedef struct MUST_USE_STRUCT LDKLockedChannelMonitor {
12333 * A pointer to the opaque Rust object.
12334 * Nearly everywhere, inner must be non-null, however in places where
12335 * the Rust equivalent takes an Option, it may be set to null to indicate None.
12337 LDKnativeLockedChannelMonitor *inner;
12339 * Indicates that this is the only struct which contains the same pointer.
12340 * Rust functions which take ownership of an object provided via an argument require
12341 * this to be true and invalidate the object pointed to by inner.
12344 } LDKLockedChannelMonitor;
12347 * The contents of CResult_LockedChannelMonitorNoneZ
12349 typedef union LDKCResult_LockedChannelMonitorNoneZPtr {
12351 * A pointer to the contents in the success state.
12352 * Reading from this pointer when `result_ok` is not set is undefined.
12354 struct LDKLockedChannelMonitor *result;
12356 * Note that this value is always NULL, as there are no contents in the Err variant
12359 } LDKCResult_LockedChannelMonitorNoneZPtr;
12362 * A CResult_LockedChannelMonitorNoneZ represents the result of a fallible operation,
12363 * containing a crate::lightning::chain::chainmonitor::LockedChannelMonitor on success and a () on failure.
12364 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
12366 typedef struct LDKCResult_LockedChannelMonitorNoneZ {
12368 * The contents of this CResult_LockedChannelMonitorNoneZ, accessible via either
12369 * `err` or `result` depending on the state of `result_ok`.
12371 union LDKCResult_LockedChannelMonitorNoneZPtr contents;
12373 * Whether this CResult_LockedChannelMonitorNoneZ represents a success state.
12376 } LDKCResult_LockedChannelMonitorNoneZ;
12379 * A dynamically-allocated array of crate::lightning::chain::transaction::OutPoints of arbitrary size.
12380 * This corresponds to std::vector in C++
12382 typedef struct LDKCVec_OutPointZ {
12384 * The elements in the array.
12385 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
12387 struct LDKOutPoint *data;
12389 * The number of elements pointed to by `data`.
12392 } LDKCVec_OutPointZ;
12397 * An opaque identifier describing a specific [`Persist`] method call.
12399 typedef struct MUST_USE_STRUCT LDKMonitorUpdateId {
12401 * A pointer to the opaque Rust object.
12402 * Nearly everywhere, inner must be non-null, however in places where
12403 * the Rust equivalent takes an Option, it may be set to null to indicate None.
12405 LDKnativeMonitorUpdateId *inner;
12407 * Indicates that this is the only struct which contains the same pointer.
12408 * Rust functions which take ownership of an object provided via an argument require
12409 * this to be true and invalidate the object pointed to by inner.
12412 } LDKMonitorUpdateId;
12415 * A dynamically-allocated array of crate::lightning::chain::chainmonitor::MonitorUpdateIds of arbitrary size.
12416 * This corresponds to std::vector in C++
12418 typedef struct LDKCVec_MonitorUpdateIdZ {
12420 * The elements in the array.
12421 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
12423 struct LDKMonitorUpdateId *data;
12425 * The number of elements pointed to by `data`.
12428 } LDKCVec_MonitorUpdateIdZ;
12431 * A tuple of 2 elements. See the individual fields for the types contained.
12433 typedef struct LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ {
12435 * The element at position 0
12437 struct LDKOutPoint a;
12439 * The element at position 1
12441 struct LDKCVec_MonitorUpdateIdZ b;
12442 } LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ;
12445 * A dynamically-allocated array of crate::c_types::derived::C2Tuple_OutPointCVec_MonitorUpdateIdZZs of arbitrary size.
12446 * This corresponds to std::vector in C++
12448 typedef struct LDKCVec_C2Tuple_OutPointCVec_MonitorUpdateIdZZZ {
12450 * The elements in the array.
12451 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
12453 struct LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ *data;
12455 * The number of elements pointed to by `data`.
12458 } LDKCVec_C2Tuple_OutPointCVec_MonitorUpdateIdZZZ;
12461 * A trait indicating an object may generate message send events
12463 typedef struct LDKMessageSendEventsProvider {
12465 * An opaque pointer which is passed to your function implementations as an argument.
12466 * This has no meaning in the LDK, and can be NULL or any other value.
12470 * Gets the list of pending events which were generated by previous actions, clearing the list
12473 struct LDKCVec_MessageSendEventZ (*get_and_clear_pending_msg_events)(const void *this_arg);
12475 * Frees any resources associated with this object given its this_arg pointer.
12476 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
12478 void (*free)(void *this_arg);
12479 } LDKMessageSendEventsProvider;
12482 * A trait indicating an object may generate onion messages to send
12484 typedef struct LDKOnionMessageProvider {
12486 * An opaque pointer which is passed to your function implementations as an argument.
12487 * This has no meaning in the LDK, and can be NULL or any other value.
12491 * Gets the next pending onion message for the peer with the given node id.
12493 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
12495 struct LDKOnionMessage (*next_onion_message_for_peer)(const void *this_arg, struct LDKPublicKey peer_node_id);
12497 * Frees any resources associated with this object given its this_arg pointer.
12498 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
12500 void (*free)(void *this_arg);
12501 } LDKOnionMessageProvider;
12504 * A trait implemented for objects handling events from [`EventsProvider`].
12506 * An async variation also exists for implementations of [`EventsProvider`] that support async
12507 * event handling. The async event handler should satisfy the generic bounds: `F:
12508 * core::future::Future, H: Fn(Event) -> F`.
12510 typedef struct LDKEventHandler {
12512 * An opaque pointer which is passed to your function implementations as an argument.
12513 * This has no meaning in the LDK, and can be NULL or any other value.
12517 * Handles the given [`Event`].
12519 * See [`EventsProvider`] for details that must be considered when implementing this method.
12521 void (*handle_event)(const void *this_arg, struct LDKEvent event);
12523 * Frees any resources associated with this object given its this_arg pointer.
12524 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
12526 void (*free)(void *this_arg);
12530 * A trait indicating an object may generate events.
12532 * Events are processed by passing an [`EventHandler`] to [`process_pending_events`].
12534 * Implementations of this trait may also feature an async version of event handling, as shown with
12535 * [`ChannelManager::process_pending_events_async`] and
12536 * [`ChainMonitor::process_pending_events_async`].
12540 * When using this trait, [`process_pending_events`] will call [`handle_event`] for each pending
12541 * event since the last invocation.
12543 * In order to ensure no [`Event`]s are lost, implementors of this trait will persist [`Event`]s
12544 * and replay any unhandled events on startup. An [`Event`] is considered handled when
12545 * [`process_pending_events`] returns, thus handlers MUST fully handle [`Event`]s and persist any
12546 * relevant changes to disk *before* returning.
12548 * Further, because an application may crash between an [`Event`] being handled and the
12549 * implementor of this trait being re-serialized, [`Event`] handling must be idempotent - in
12550 * effect, [`Event`]s may be replayed.
12552 * Note, handlers may call back into the provider and thus deadlocking must be avoided. Be sure to
12553 * consult the provider's documentation on the implication of processing events and how a handler
12554 * may safely use the provider (e.g., see [`ChannelManager::process_pending_events`] and
12555 * [`ChainMonitor::process_pending_events`]).
12557 * (C-not implementable) As there is likely no reason for a user to implement this trait on their
12560 * [`process_pending_events`]: Self::process_pending_events
12561 * [`handle_event`]: EventHandler::handle_event
12562 * [`ChannelManager::process_pending_events`]: crate::ln::channelmanager::ChannelManager#method.process_pending_events
12563 * [`ChainMonitor::process_pending_events`]: crate::chain::chainmonitor::ChainMonitor#method.process_pending_events
12564 * [`ChannelManager::process_pending_events_async`]: crate::ln::channelmanager::ChannelManager::process_pending_events_async
12565 * [`ChainMonitor::process_pending_events_async`]: crate::chain::chainmonitor::ChainMonitor::process_pending_events_async
12567 typedef struct LDKEventsProvider {
12569 * An opaque pointer which is passed to your function implementations as an argument.
12570 * This has no meaning in the LDK, and can be NULL or any other value.
12574 * Processes any events generated since the last call using the given event handler.
12576 * See the trait-level documentation for requirements.
12578 void (*process_pending_events)(const void *this_arg, struct LDKEventHandler handler);
12580 * Frees any resources associated with this object given its this_arg pointer.
12581 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
12583 void (*free)(void *this_arg);
12584 } LDKEventsProvider;
12589 * Lightning TLV uses a custom variable-length integer called BigSize. It is similar to Bitcoin's
12590 * variable-length integers except that it is serialized in big-endian instead of little-endian.
12592 * Like Bitcoin's variable-length integer, it exhibits ambiguity in that certain values can be
12593 * encoded in several different ways, which we must check for at deserialization-time. Thus, if
12594 * you're looking for an example of a variable-length integer to use for your own project, move
12595 * along, this is a rather poor design.
12597 typedef struct MUST_USE_STRUCT LDKBigSize {
12599 * A pointer to the opaque Rust object.
12600 * Nearly everywhere, inner must be non-null, however in places where
12601 * the Rust equivalent takes an Option, it may be set to null to indicate None.
12603 LDKnativeBigSize *inner;
12605 * Indicates that this is the only struct which contains the same pointer.
12606 * Rust functions which take ownership of an object provided via an argument require
12607 * this to be true and invalidate the object pointed to by inner.
12613 * Trait that handles persisting a [`ChannelManager`], [`NetworkGraph`], and [`WriteableScore`] to disk.
12615 typedef struct LDKPersister {
12617 * An opaque pointer which is passed to your function implementations as an argument.
12618 * This has no meaning in the LDK, and can be NULL or any other value.
12622 * Persist the given ['ChannelManager'] to disk, returning an error if persistence failed.
12624 struct LDKCResult_NoneErrorZ (*persist_manager)(const void *this_arg, const struct LDKChannelManager *NONNULL_PTR channel_manager);
12626 * Persist the given [`NetworkGraph`] to disk, returning an error if persistence failed.
12628 struct LDKCResult_NoneErrorZ (*persist_graph)(const void *this_arg, const struct LDKNetworkGraph *NONNULL_PTR network_graph);
12630 * Persist the given [`WriteableScore`] to disk, returning an error if persistence failed.
12632 struct LDKCResult_NoneErrorZ (*persist_scorer)(const void *this_arg, const struct LDKWriteableScore *NONNULL_PTR scorer);
12634 * Frees any resources associated with this object given its this_arg pointer.
12635 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
12637 void (*free)(void *this_arg);
12643 * A string that displays only printable characters, replacing control characters with
12644 * [`core::char::REPLACEMENT_CHARACTER`].
12646 typedef struct MUST_USE_STRUCT LDKPrintableString {
12648 * A pointer to the opaque Rust object.
12649 * Nearly everywhere, inner must be non-null, however in places where
12650 * the Rust equivalent takes an Option, it may be set to null to indicate None.
12652 LDKnativePrintableString *inner;
12654 * Indicates that this is the only struct which contains the same pointer.
12655 * Rust functions which take ownership of an object provided via an argument require
12656 * this to be true and invalidate the object pointed to by inner.
12659 } LDKPrintableString;
12662 * A callback which is called when a [`Future`] completes.
12664 * Note that this MUST NOT call back into LDK directly, it must instead schedule actions to be
12665 * taken later. Rust users should use the [`std::future::Future`] implementation for [`Future`]
12668 * Note that the [`std::future::Future`] implementation may only work for runtimes which schedule
12669 * futures when they receive a wake, rather than immediately executing them.
12671 typedef struct LDKFutureCallback {
12673 * An opaque pointer which is passed to your function implementations as an argument.
12674 * This has no meaning in the LDK, and can be NULL or any other value.
12678 * The method which is called.
12680 void (*call)(const void *this_arg);
12682 * Frees any resources associated with this object given its this_arg pointer.
12683 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
12685 void (*free)(void *this_arg);
12686 } LDKFutureCallback;
12691 * A simple future which can complete once, and calls some callback(s) when it does so.
12693 typedef struct MUST_USE_STRUCT LDKFuture {
12695 * A pointer to the opaque Rust object.
12696 * Nearly everywhere, inner must be non-null, however in places where
12697 * the Rust equivalent takes an Option, it may be set to null to indicate None.
12699 LDKnativeFuture *inner;
12701 * Indicates that this is the only struct which contains the same pointer.
12702 * Rust functions which take ownership of an object provided via an argument require
12703 * this to be true and invalidate the object pointed to by inner.
12711 * Configuration we set when applicable.
12713 * Default::default() provides sane defaults.
12715 typedef struct MUST_USE_STRUCT LDKChannelHandshakeConfig {
12717 * A pointer to the opaque Rust object.
12718 * Nearly everywhere, inner must be non-null, however in places where
12719 * the Rust equivalent takes an Option, it may be set to null to indicate None.
12721 LDKnativeChannelHandshakeConfig *inner;
12723 * Indicates that this is the only struct which contains the same pointer.
12724 * Rust functions which take ownership of an object provided via an argument require
12725 * this to be true and invalidate the object pointed to by inner.
12728 } LDKChannelHandshakeConfig;
12733 * Optional channel limits which are applied during channel creation.
12735 * These limits are only applied to our counterparty's limits, not our own.
12737 * Use 0/<type>::max_value() as appropriate to skip checking.
12739 * Provides sane defaults for most configurations.
12741 * Most additional limits are disabled except those with which specify a default in individual
12742 * field documentation. Note that this may result in barely-usable channels, but since they
12743 * are applied mostly only to incoming channels that's not much of a problem.
12745 typedef struct MUST_USE_STRUCT LDKChannelHandshakeLimits {
12747 * A pointer to the opaque Rust object.
12748 * Nearly everywhere, inner must be non-null, however in places where
12749 * the Rust equivalent takes an Option, it may be set to null to indicate None.
12751 LDKnativeChannelHandshakeLimits *inner;
12753 * Indicates that this is the only struct which contains the same pointer.
12754 * Rust functions which take ownership of an object provided via an argument require
12755 * this to be true and invalidate the object pointed to by inner.
12758 } LDKChannelHandshakeLimits;
12763 * Top-level config which holds ChannelHandshakeLimits and ChannelConfig.
12765 * Default::default() provides sane defaults for most configurations
12766 * (but currently with 0 relay fees!)
12768 typedef struct MUST_USE_STRUCT LDKUserConfig {
12770 * A pointer to the opaque Rust object.
12771 * Nearly everywhere, inner must be non-null, however in places where
12772 * the Rust equivalent takes an Option, it may be set to null to indicate None.
12774 LDKnativeUserConfig *inner;
12776 * Indicates that this is the only struct which contains the same pointer.
12777 * Rust functions which take ownership of an object provided via an argument require
12778 * this to be true and invalidate the object pointed to by inner.
12786 * The best known block as identified by its hash and height.
12788 typedef struct MUST_USE_STRUCT LDKBestBlock {
12790 * A pointer to the opaque Rust object.
12791 * Nearly everywhere, inner must be non-null, however in places where
12792 * the Rust equivalent takes an Option, it may be set to null to indicate None.
12794 LDKnativeBestBlock *inner;
12796 * Indicates that this is the only struct which contains the same pointer.
12797 * Rust functions which take ownership of an object provided via an argument require
12798 * this to be true and invalidate the object pointed to by inner.
12804 * The `Listen` trait is used to notify when blocks have been connected or disconnected from the
12807 * Useful when needing to replay chain data upon startup or as new chain events occur. Clients
12808 * sourcing chain data using a block-oriented API should prefer this interface over [`Confirm`].
12809 * Such clients fetch the entire header chain whereas clients using [`Confirm`] only fetch headers
12812 * By using [`Listen::filtered_block_connected`] this interface supports clients fetching the
12813 * entire header chain and only blocks with matching transaction data using BIP 157 filters or
12814 * other similar filtering.
12816 typedef struct LDKListen {
12818 * An opaque pointer which is passed to your function implementations as an argument.
12819 * This has no meaning in the LDK, and can be NULL or any other value.
12823 * Notifies the listener that a block was added at the given height, with the transaction data
12824 * possibly filtered.
12826 void (*filtered_block_connected)(const void *this_arg, const uint8_t (*header)[80], struct LDKCVec_C2Tuple_usizeTransactionZZ txdata, uint32_t height);
12828 * Notifies the listener that a block was added at the given height.
12830 void (*block_connected)(const void *this_arg, struct LDKu8slice block, uint32_t height);
12832 * Notifies the listener that a block was removed at the given height.
12834 void (*block_disconnected)(const void *this_arg, const uint8_t (*header)[80], uint32_t height);
12836 * Frees any resources associated with this object given its this_arg pointer.
12837 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
12839 void (*free)(void *this_arg);
12843 * The `Confirm` trait is used to notify LDK when relevant transactions have been confirmed on
12844 * chain or unconfirmed during a chain reorganization.
12846 * Clients sourcing chain data using a transaction-oriented API should prefer this interface over
12847 * [`Listen`]. For instance, an Electrum-based transaction sync implementation may implement
12848 * [`Filter`] to subscribe to relevant transactions and unspent outputs it should monitor for
12849 * on-chain activity. Then, it needs to notify LDK via this interface upon observing any changes
12850 * with reference to the confirmation status of the monitored objects.
12853 * The intended use is as follows:
12854 * - Call [`transactions_confirmed`] to notify LDK whenever any of the registered transactions or
12855 * outputs are, respectively, confirmed or spent on chain.
12856 * - Call [`transaction_unconfirmed`] to notify LDK whenever any transaction returned by
12857 * [`get_relevant_txids`] is no longer confirmed in the block with the given block hash.
12858 * - Call [`best_block_updated`] to notify LDK whenever a new chain tip becomes available.
12862 * Clients must call these methods in chain order. Specifically:
12863 * - Transactions which are confirmed in a particular block must be given before transactions
12864 * confirmed in a later block.
12865 * - Dependent transactions within the same block must be given in topological order, possibly in
12867 * - All unconfirmed transactions must be given after the original confirmations and before *any*
12868 * reconfirmations, i.e., [`transactions_confirmed`] and [`transaction_unconfirmed`] calls should
12869 * never be interleaved, but always conduced *en bloc*.
12870 * - Any reconfirmed transactions need to be explicitly unconfirmed before they are reconfirmed
12871 * in regard to the new block.
12873 * See individual method documentation for further details.
12875 * [`transactions_confirmed`]: Self::transactions_confirmed
12876 * [`transaction_unconfirmed`]: Self::transaction_unconfirmed
12877 * [`best_block_updated`]: Self::best_block_updated
12878 * [`get_relevant_txids`]: Self::get_relevant_txids
12880 typedef struct LDKConfirm {
12882 * An opaque pointer which is passed to your function implementations as an argument.
12883 * This has no meaning in the LDK, and can be NULL or any other value.
12887 * Notifies LDK of transactions confirmed in a block with a given header and height.
12889 * Must be called for any transactions registered by [`Filter::register_tx`] or any
12890 * transactions spending an output registered by [`Filter::register_output`]. Such transactions
12891 * appearing in the same block do not need to be included in the same call; instead, multiple
12892 * calls with additional transactions may be made so long as they are made in [chain order].
12894 * May be called before or after [`best_block_updated`] for the corresponding block. However,
12895 * in the event of a chain reorganization, it must not be called with a `header` that is no
12896 * longer in the chain as of the last call to [`best_block_updated`].
12898 * [chain order]: Confirm#order
12899 * [`best_block_updated`]: Self::best_block_updated
12901 void (*transactions_confirmed)(const void *this_arg, const uint8_t (*header)[80], struct LDKCVec_C2Tuple_usizeTransactionZZ txdata, uint32_t height);
12903 * Notifies LDK of a transaction that is no longer confirmed as result of a chain reorganization.
12905 * Must be called for any transaction returned by [`get_relevant_txids`] if it has been
12906 * reorganized out of the best chain or if it is no longer confirmed in the block with the
12907 * given block hash. Once called, the given transaction will not be returned
12908 * by [`get_relevant_txids`], unless it has been reconfirmed via [`transactions_confirmed`].
12910 * [`get_relevant_txids`]: Self::get_relevant_txids
12911 * [`transactions_confirmed`]: Self::transactions_confirmed
12913 void (*transaction_unconfirmed)(const void *this_arg, const uint8_t (*txid)[32]);
12915 * Notifies LDK of an update to the best header connected at the given height.
12917 * Must be called whenever a new chain tip becomes available. May be skipped for intermediary
12920 void (*best_block_updated)(const void *this_arg, const uint8_t (*header)[80], uint32_t height);
12922 * Returns transactions that must be monitored for reorganization out of the chain along
12923 * with the hash of the block as part of which it had been previously confirmed.
12925 * Will include any transactions passed to [`transactions_confirmed`] that have insufficient
12926 * confirmations to be safe from a chain reorganization. Will not include any transactions
12927 * passed to [`transaction_unconfirmed`], unless later reconfirmed.
12929 * Must be called to determine the subset of transactions that must be monitored for
12930 * reorganization. Will be idempotent between calls but may change as a result of calls to the
12931 * other interface methods. Thus, this is useful to determine which transactions must be
12932 * given to [`transaction_unconfirmed`].
12934 * If any of the returned transactions are confirmed in a block other than the one with the
12935 * given hash, they need to be unconfirmed and reconfirmed via [`transaction_unconfirmed`] and
12936 * [`transactions_confirmed`], respectively.
12938 * [`transactions_confirmed`]: Self::transactions_confirmed
12939 * [`transaction_unconfirmed`]: Self::transaction_unconfirmed
12941 struct LDKCVec_C2Tuple_TxidBlockHashZZ (*get_relevant_txids)(const void *this_arg);
12943 * Frees any resources associated with this object given its this_arg pointer.
12944 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
12946 void (*free)(void *this_arg);
12950 * `Persist` defines behavior for persisting channel monitors: this could mean
12951 * writing once to disk, and/or uploading to one or more backup services.
12953 * Each method can return three possible values:
12954 * * If persistence (including any relevant `fsync()` calls) happens immediately, the
12955 * implementation should return [`ChannelMonitorUpdateStatus::Completed`], indicating normal
12956 * channel operation should continue.
12957 * * If persistence happens asynchronously, implementations should first ensure the
12958 * [`ChannelMonitor`] or [`ChannelMonitorUpdate`] are written durably to disk, and then return
12959 * [`ChannelMonitorUpdateStatus::InProgress`] while the update continues in the background.
12960 * Once the update completes, [`ChainMonitor::channel_monitor_updated`] should be called with
12961 * the corresponding [`MonitorUpdateId`].
12963 * Note that unlike the direct [`chain::Watch`] interface,
12964 * [`ChainMonitor::channel_monitor_updated`] must be called once for *each* update which occurs.
12966 * * If persistence fails for some reason, implementations should return
12967 * [`ChannelMonitorUpdateStatus::PermanentFailure`], in which case the channel will likely be
12968 * closed without broadcasting the latest state. See
12969 * [`ChannelMonitorUpdateStatus::PermanentFailure`] for more details.
12971 typedef struct LDKPersist {
12973 * An opaque pointer which is passed to your function implementations as an argument.
12974 * This has no meaning in the LDK, and can be NULL or any other value.
12978 * Persist a new channel's data in response to a [`chain::Watch::watch_channel`] call. This is
12979 * called by [`ChannelManager`] for new channels, or may be called directly, e.g. on startup.
12981 * The data can be stored any way you want, but the identifier provided by LDK is the
12982 * channel's outpoint (and it is up to you to maintain a correct mapping between the outpoint
12983 * and the stored channel data). Note that you **must** persist every new monitor to disk.
12985 * The `update_id` is used to identify this call to [`ChainMonitor::channel_monitor_updated`],
12986 * if you return [`ChannelMonitorUpdateStatus::InProgress`].
12988 * See [`Writeable::write`] on [`ChannelMonitor`] for writing out a `ChannelMonitor`
12989 * and [`ChannelMonitorUpdateStatus`] for requirements when returning errors.
12991 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
12992 * [`Writeable::write`]: crate::util::ser::Writeable::write
12994 enum LDKChannelMonitorUpdateStatus (*persist_new_channel)(const void *this_arg, struct LDKOutPoint channel_id, const struct LDKChannelMonitor *NONNULL_PTR data, struct LDKMonitorUpdateId update_id);
12996 * Update one channel's data. The provided [`ChannelMonitor`] has already applied the given
12999 * Note that on every update, you **must** persist either the [`ChannelMonitorUpdate`] or the
13000 * updated monitor itself to disk/backups. See the [`Persist`] trait documentation for more
13003 * During blockchain synchronization operations, this may be called with no
13004 * [`ChannelMonitorUpdate`], in which case the full [`ChannelMonitor`] needs to be persisted.
13005 * Note that after the full [`ChannelMonitor`] is persisted any previous
13006 * [`ChannelMonitorUpdate`]s which were persisted should be discarded - they can no longer be
13007 * applied to the persisted [`ChannelMonitor`] as they were already applied.
13009 * If an implementer chooses to persist the updates only, they need to make
13010 * sure that all the updates are applied to the `ChannelMonitors` *before*
13011 * the set of channel monitors is given to the `ChannelManager`
13012 * deserialization routine. See [`ChannelMonitor::update_monitor`] for
13013 * applying a monitor update to a monitor. If full `ChannelMonitors` are
13014 * persisted, then there is no need to persist individual updates.
13016 * Note that there could be a performance tradeoff between persisting complete
13017 * channel monitors on every update vs. persisting only updates and applying
13018 * them in batches. The size of each monitor grows `O(number of state updates)`
13019 * whereas updates are small and `O(1)`.
13021 * The `update_id` is used to identify this call to [`ChainMonitor::channel_monitor_updated`],
13022 * if you return [`ChannelMonitorUpdateStatus::InProgress`].
13024 * See [`Writeable::write`] on [`ChannelMonitor`] for writing out a `ChannelMonitor`,
13025 * [`Writeable::write`] on [`ChannelMonitorUpdate`] for writing out an update, and
13026 * [`ChannelMonitorUpdateStatus`] for requirements when returning errors.
13028 * [`Writeable::write`]: crate::util::ser::Writeable::write
13030 * Note that update (or a relevant inner pointer) may be NULL or all-0s to represent None
13032 enum LDKChannelMonitorUpdateStatus (*update_persisted_channel)(const void *this_arg, struct LDKOutPoint channel_id, const struct LDKChannelMonitorUpdate *NONNULL_PTR update, const struct LDKChannelMonitor *NONNULL_PTR data, struct LDKMonitorUpdateId update_id);
13034 * Frees any resources associated with this object given its this_arg pointer.
13035 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
13037 void (*free)(void *this_arg);
13043 * An implementation of [`chain::Watch`] for monitoring channels.
13045 * Connected and disconnected blocks must be provided to `ChainMonitor` as documented by
13046 * [`chain::Watch`]. May be used in conjunction with [`ChannelManager`] to monitor channels locally
13047 * or used independently to monitor channels remotely. See the [module-level documentation] for
13050 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
13051 * [module-level documentation]: crate::chain::chainmonitor
13053 typedef struct MUST_USE_STRUCT LDKChainMonitor {
13055 * A pointer to the opaque Rust object.
13056 * Nearly everywhere, inner must be non-null, however in places where
13057 * the Rust equivalent takes an Option, it may be set to null to indicate None.
13059 LDKnativeChainMonitor *inner;
13061 * Indicates that this is the only struct which contains the same pointer.
13062 * Rust functions which take ownership of an object provided via an argument require
13063 * this to be true and invalidate the object pointed to by inner.
13071 * Simple [`KeysInterface`] implementation that takes a 32-byte seed for use as a BIP 32 extended
13072 * key and derives keys from that.
13074 * Your `node_id` is seed/0'.
13075 * Unilateral closes may use seed/1'.
13076 * Cooperative closes may use seed/2'.
13077 * The two close keys may be needed to claim on-chain funds!
13079 * This struct cannot be used for nodes that wish to support receiving phantom payments;
13080 * [`PhantomKeysManager`] must be used instead.
13082 * Note that switching between this struct and [`PhantomKeysManager`] will invalidate any
13083 * previously issued invoices and attempts to pay previous invoices will fail.
13085 typedef struct MUST_USE_STRUCT LDKKeysManager {
13087 * A pointer to the opaque Rust object.
13088 * Nearly everywhere, inner must be non-null, however in places where
13089 * the Rust equivalent takes an Option, it may be set to null to indicate None.
13091 LDKnativeKeysManager *inner;
13093 * Indicates that this is the only struct which contains the same pointer.
13094 * Rust functions which take ownership of an object provided via an argument require
13095 * this to be true and invalidate the object pointed to by inner.
13103 * Similar to [`KeysManager`], but allows the node using this struct to receive phantom node
13106 * A phantom node payment is a payment made to a phantom invoice, which is an invoice that can be
13107 * paid to one of multiple nodes. This works because we encode the invoice route hints such that
13108 * LDK will recognize an incoming payment as destined for a phantom node, and collect the payment
13109 * itself without ever needing to forward to this fake node.
13111 * Phantom node payments are useful for load balancing between multiple LDK nodes. They also
13112 * provide some fault tolerance, because payers will automatically retry paying other provided
13113 * nodes in the case that one node goes down.
13115 * Note that multi-path payments are not supported in phantom invoices for security reasons.
13116 * Switching between this struct and [`KeysManager`] will invalidate any previously issued
13117 * invoices and attempts to pay previous invoices will fail.
13119 typedef struct MUST_USE_STRUCT LDKPhantomKeysManager {
13121 * A pointer to the opaque Rust object.
13122 * Nearly everywhere, inner must be non-null, however in places where
13123 * the Rust equivalent takes an Option, it may be set to null to indicate None.
13125 LDKnativePhantomKeysManager *inner;
13127 * Indicates that this is the only struct which contains the same pointer.
13128 * Rust functions which take ownership of an object provided via an argument require
13129 * this to be true and invalidate the object pointed to by inner.
13132 } LDKPhantomKeysManager;
13137 * Chain-related parameters used to construct a new `ChannelManager`.
13139 * Typically, the block-specific parameters are derived from the best block hash for the network,
13140 * as a newly constructed `ChannelManager` will not have created any channels yet. These parameters
13141 * are not needed when deserializing a previously constructed `ChannelManager`.
13143 typedef struct MUST_USE_STRUCT LDKChainParameters {
13145 * A pointer to the opaque Rust object.
13146 * Nearly everywhere, inner must be non-null, however in places where
13147 * the Rust equivalent takes an Option, it may be set to null to indicate None.
13149 LDKnativeChainParameters *inner;
13151 * Indicates that this is the only struct which contains the same pointer.
13152 * Rust functions which take ownership of an object provided via an argument require
13153 * this to be true and invalidate the object pointed to by inner.
13156 } LDKChainParameters;
13159 * A trait to describe an object which can receive channel messages.
13161 * Messages MAY be called in parallel when they originate from different their_node_ids, however
13162 * they MUST NOT be called in parallel when the two calls have the same their_node_id.
13164 typedef struct LDKChannelMessageHandler {
13166 * An opaque pointer which is passed to your function implementations as an argument.
13167 * This has no meaning in the LDK, and can be NULL or any other value.
13171 * Handle an incoming open_channel message from the given peer.
13173 void (*handle_open_channel)(const void *this_arg, struct LDKPublicKey their_node_id, struct LDKInitFeatures their_features, const struct LDKOpenChannel *NONNULL_PTR msg);
13175 * Handle an incoming accept_channel message from the given peer.
13177 void (*handle_accept_channel)(const void *this_arg, struct LDKPublicKey their_node_id, struct LDKInitFeatures their_features, const struct LDKAcceptChannel *NONNULL_PTR msg);
13179 * Handle an incoming funding_created message from the given peer.
13181 void (*handle_funding_created)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKFundingCreated *NONNULL_PTR msg);
13183 * Handle an incoming funding_signed message from the given peer.
13185 void (*handle_funding_signed)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKFundingSigned *NONNULL_PTR msg);
13187 * Handle an incoming channel_ready message from the given peer.
13189 void (*handle_channel_ready)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKChannelReady *NONNULL_PTR msg);
13191 * Handle an incoming shutdown message from the given peer.
13193 void (*handle_shutdown)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKInitFeatures *NONNULL_PTR their_features, const struct LDKShutdown *NONNULL_PTR msg);
13195 * Handle an incoming closing_signed message from the given peer.
13197 void (*handle_closing_signed)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKClosingSigned *NONNULL_PTR msg);
13199 * Handle an incoming update_add_htlc message from the given peer.
13201 void (*handle_update_add_htlc)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKUpdateAddHTLC *NONNULL_PTR msg);
13203 * Handle an incoming update_fulfill_htlc message from the given peer.
13205 void (*handle_update_fulfill_htlc)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKUpdateFulfillHTLC *NONNULL_PTR msg);
13207 * Handle an incoming update_fail_htlc message from the given peer.
13209 void (*handle_update_fail_htlc)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKUpdateFailHTLC *NONNULL_PTR msg);
13211 * Handle an incoming update_fail_malformed_htlc message from the given peer.
13213 void (*handle_update_fail_malformed_htlc)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR msg);
13215 * Handle an incoming commitment_signed message from the given peer.
13217 void (*handle_commitment_signed)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKCommitmentSigned *NONNULL_PTR msg);
13219 * Handle an incoming revoke_and_ack message from the given peer.
13221 void (*handle_revoke_and_ack)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKRevokeAndACK *NONNULL_PTR msg);
13223 * Handle an incoming update_fee message from the given peer.
13225 void (*handle_update_fee)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKUpdateFee *NONNULL_PTR msg);
13227 * Handle an incoming announcement_signatures message from the given peer.
13229 void (*handle_announcement_signatures)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKAnnouncementSignatures *NONNULL_PTR msg);
13231 * Indicates a connection to the peer failed/an existing connection was lost. If no connection
13232 * is believed to be possible in the future (eg they're sending us messages we don't
13233 * understand or indicate they require unknown feature bits), no_connection_possible is set
13234 * and any outstanding channels should be failed.
13236 * Note that in some rare cases this may be called without a corresponding
13237 * [`Self::peer_connected`].
13239 void (*peer_disconnected)(const void *this_arg, struct LDKPublicKey their_node_id, bool no_connection_possible);
13241 * Handle a peer reconnecting, possibly generating channel_reestablish message(s).
13243 * May return an `Err(())` if the features the peer supports are not sufficient to communicate
13244 * with us. Implementors should be somewhat conservative about doing so, however, as other
13245 * message handlers may still wish to communicate with this peer.
13247 struct LDKCResult_NoneNoneZ (*peer_connected)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKInit *NONNULL_PTR msg);
13249 * Handle an incoming channel_reestablish message from the given peer.
13251 void (*handle_channel_reestablish)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKChannelReestablish *NONNULL_PTR msg);
13253 * Handle an incoming channel update from the given peer.
13255 void (*handle_channel_update)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKChannelUpdate *NONNULL_PTR msg);
13257 * Handle an incoming error message from the given peer.
13259 void (*handle_error)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKErrorMessage *NONNULL_PTR msg);
13261 * Gets the node feature flags which this handler itself supports. All available handlers are
13262 * queried similarly and their feature flags are OR'd together to form the [`NodeFeatures`]
13263 * which are broadcasted in our [`NodeAnnouncement`] message.
13265 struct LDKNodeFeatures (*provided_node_features)(const void *this_arg);
13267 * Gets the init feature flags which should be sent to the given peer. All available handlers
13268 * are queried similarly and their feature flags are OR'd together to form the [`InitFeatures`]
13269 * which are sent in our [`Init`] message.
13271 * Note that this method is called before [`Self::peer_connected`].
13273 struct LDKInitFeatures (*provided_init_features)(const void *this_arg, struct LDKPublicKey their_node_id);
13275 * Implementation of MessageSendEventsProvider for this object.
13277 struct LDKMessageSendEventsProvider MessageSendEventsProvider;
13279 * Frees any resources associated with this object given its this_arg pointer.
13280 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
13282 void (*free)(void *this_arg);
13283 } LDKChannelMessageHandler;
13288 * Arguments for the creation of a ChannelManager that are not deserialized.
13290 * At a high-level, the process for deserializing a ChannelManager and resuming normal operation
13292 * 1) Deserialize all stored [`ChannelMonitor`]s.
13293 * 2) Deserialize the [`ChannelManager`] by filling in this struct and calling:
13294 * `<(BlockHash, ChannelManager)>::read(reader, args)`
13295 * This may result in closing some channels if the [`ChannelMonitor`] is newer than the stored
13296 * [`ChannelManager`] state to ensure no loss of funds. Thus, transactions may be broadcasted.
13297 * 3) If you are not fetching full blocks, register all relevant [`ChannelMonitor`] outpoints the
13298 * same way you would handle a [`chain::Filter`] call using
13299 * [`ChannelMonitor::get_outputs_to_watch`] and [`ChannelMonitor::get_funding_txo`].
13300 * 4) Reconnect blocks on your [`ChannelMonitor`]s.
13301 * 5) Disconnect/connect blocks on the [`ChannelManager`].
13302 * 6) Re-persist the [`ChannelMonitor`]s to ensure the latest state is on disk.
13303 * Note that if you're using a [`ChainMonitor`] for your [`chain::Watch`] implementation, you
13304 * will likely accomplish this as a side-effect of calling [`chain::Watch::watch_channel`] in
13306 * 7) Move the [`ChannelMonitor`]s into your local [`chain::Watch`]. If you're using a
13307 * [`ChainMonitor`], this is done by calling [`chain::Watch::watch_channel`].
13309 * Note that the ordering of #4-7 is not of importance, however all four must occur before you
13310 * call any other methods on the newly-deserialized [`ChannelManager`].
13312 * Note that because some channels may be closed during deserialization, it is critical that you
13313 * always deserialize only the latest version of a ChannelManager and ChannelMonitors available to
13314 * you. If you deserialize an old ChannelManager (during which force-closure transactions may be
13315 * broadcast), and then later deserialize a newer version of the same ChannelManager (which will
13316 * not force-close the same channels but consider them live), you may end up revoking a state for
13317 * which you've already broadcasted the transaction.
13319 * [`ChainMonitor`]: crate::chain::chainmonitor::ChainMonitor
13321 typedef struct MUST_USE_STRUCT LDKChannelManagerReadArgs {
13323 * A pointer to the opaque Rust object.
13324 * Nearly everywhere, inner must be non-null, however in places where
13325 * the Rust equivalent takes an Option, it may be set to null to indicate None.
13327 LDKnativeChannelManagerReadArgs *inner;
13329 * Indicates that this is the only struct which contains the same pointer.
13330 * Rust functions which take ownership of an object provided via an argument require
13331 * this to be true and invalidate the object pointed to by inner.
13334 } LDKChannelManagerReadArgs;
13339 * A set of keys that were HKDF-expanded from an initial call to
13340 * [`KeysInterface::get_inbound_payment_key_material`].
13342 * [`KeysInterface::get_inbound_payment_key_material`]: crate::chain::keysinterface::KeysInterface::get_inbound_payment_key_material
13344 typedef struct MUST_USE_STRUCT LDKExpandedKey {
13346 * A pointer to the opaque Rust object.
13347 * Nearly everywhere, inner must be non-null, however in places where
13348 * the Rust equivalent takes an Option, it may be set to null to indicate None.
13350 LDKnativeExpandedKey *inner;
13352 * Indicates that this is the only struct which contains the same pointer.
13353 * Rust functions which take ownership of an object provided via an argument require
13354 * this to be true and invalidate the object pointed to by inner.
13362 * Proof that the sender knows the per-commitment secret of the previous commitment transaction.
13363 * This is used to convince the recipient that the channel is at a certain commitment
13364 * number even if they lost that data due to a local failure. Of course, the peer may lie
13365 * and even later commitments may have been revoked.
13367 typedef struct MUST_USE_STRUCT LDKDataLossProtect {
13369 * A pointer to the opaque Rust object.
13370 * Nearly everywhere, inner must be non-null, however in places where
13371 * the Rust equivalent takes an Option, it may be set to null to indicate None.
13373 LDKnativeDataLossProtect *inner;
13375 * Indicates that this is the only struct which contains the same pointer.
13376 * Rust functions which take ownership of an object provided via an argument require
13377 * this to be true and invalidate the object pointed to by inner.
13380 } LDKDataLossProtect;
13383 * A 3-byte byte array.
13385 typedef struct LDKThreeBytes {
13393 * A trait to describe an object which can receive routing messages.
13395 * # Implementor DoS Warnings
13397 * For `gossip_queries` messages there are potential DoS vectors when handling
13398 * inbound queries. Implementors using an on-disk network graph should be aware of
13399 * repeated disk I/O for queries accessing different parts of the network graph.
13401 typedef struct LDKRoutingMessageHandler {
13403 * An opaque pointer which is passed to your function implementations as an argument.
13404 * This has no meaning in the LDK, and can be NULL or any other value.
13408 * Handle an incoming node_announcement message, returning true if it should be forwarded on,
13409 * false or returning an Err otherwise.
13411 struct LDKCResult_boolLightningErrorZ (*handle_node_announcement)(const void *this_arg, const struct LDKNodeAnnouncement *NONNULL_PTR msg);
13413 * Handle a channel_announcement message, returning true if it should be forwarded on, false
13414 * or returning an Err otherwise.
13416 struct LDKCResult_boolLightningErrorZ (*handle_channel_announcement)(const void *this_arg, const struct LDKChannelAnnouncement *NONNULL_PTR msg);
13418 * Handle an incoming channel_update message, returning true if it should be forwarded on,
13419 * false or returning an Err otherwise.
13421 struct LDKCResult_boolLightningErrorZ (*handle_channel_update)(const void *this_arg, const struct LDKChannelUpdate *NONNULL_PTR msg);
13423 * Gets channel announcements and updates required to dump our routing table to a remote node,
13424 * starting at the short_channel_id indicated by starting_point and including announcements
13425 * for a single channel.
13427 struct LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ (*get_next_channel_announcement)(const void *this_arg, uint64_t starting_point);
13429 * Gets a node announcement required to dump our routing table to a remote node, starting at
13430 * the node *after* the provided pubkey and including up to one announcement immediately
13431 * higher (as defined by <PublicKey as Ord>::cmp) than starting_point.
13432 * If None is provided for starting_point, we start at the first node.
13434 * Note that starting_point (or a relevant inner pointer) may be NULL or all-0s to represent None
13435 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
13437 struct LDKNodeAnnouncement (*get_next_node_announcement)(const void *this_arg, struct LDKPublicKey starting_point);
13439 * Called when a connection is established with a peer. This can be used to
13440 * perform routing table synchronization using a strategy defined by the
13443 * May return an `Err(())` if the features the peer supports are not sufficient to communicate
13444 * with us. Implementors should be somewhat conservative about doing so, however, as other
13445 * message handlers may still wish to communicate with this peer.
13447 struct LDKCResult_NoneNoneZ (*peer_connected)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKInit *NONNULL_PTR init);
13449 * Handles the reply of a query we initiated to learn about channels
13450 * for a given range of blocks. We can expect to receive one or more
13451 * replies to a single query.
13453 struct LDKCResult_NoneLightningErrorZ (*handle_reply_channel_range)(const void *this_arg, struct LDKPublicKey their_node_id, struct LDKReplyChannelRange msg);
13455 * Handles the reply of a query we initiated asking for routing gossip
13456 * messages for a list of channels. We should receive this message when
13457 * a node has completed its best effort to send us the pertaining routing
13460 struct LDKCResult_NoneLightningErrorZ (*handle_reply_short_channel_ids_end)(const void *this_arg, struct LDKPublicKey their_node_id, struct LDKReplyShortChannelIdsEnd msg);
13462 * Handles when a peer asks us to send a list of short_channel_ids
13463 * for the requested range of blocks.
13465 struct LDKCResult_NoneLightningErrorZ (*handle_query_channel_range)(const void *this_arg, struct LDKPublicKey their_node_id, struct LDKQueryChannelRange msg);
13467 * Handles when a peer asks us to send routing gossip messages for a
13468 * list of short_channel_ids.
13470 struct LDKCResult_NoneLightningErrorZ (*handle_query_short_channel_ids)(const void *this_arg, struct LDKPublicKey their_node_id, struct LDKQueryShortChannelIds msg);
13472 * Gets the node feature flags which this handler itself supports. All available handlers are
13473 * queried similarly and their feature flags are OR'd together to form the [`NodeFeatures`]
13474 * which are broadcasted in our [`NodeAnnouncement`] message.
13476 struct LDKNodeFeatures (*provided_node_features)(const void *this_arg);
13478 * Gets the init feature flags which should be sent to the given peer. All available handlers
13479 * are queried similarly and their feature flags are OR'd together to form the [`InitFeatures`]
13480 * which are sent in our [`Init`] message.
13482 * Note that this method is called before [`Self::peer_connected`].
13484 struct LDKInitFeatures (*provided_init_features)(const void *this_arg, struct LDKPublicKey their_node_id);
13486 * Implementation of MessageSendEventsProvider for this object.
13488 struct LDKMessageSendEventsProvider MessageSendEventsProvider;
13490 * Frees any resources associated with this object given its this_arg pointer.
13491 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
13493 void (*free)(void *this_arg);
13494 } LDKRoutingMessageHandler;
13497 * A trait to describe an object that can receive onion messages.
13499 typedef struct LDKOnionMessageHandler {
13501 * An opaque pointer which is passed to your function implementations as an argument.
13502 * This has no meaning in the LDK, and can be NULL or any other value.
13506 * Handle an incoming onion_message message from the given peer.
13508 void (*handle_onion_message)(const void *this_arg, struct LDKPublicKey peer_node_id, const struct LDKOnionMessage *NONNULL_PTR msg);
13510 * Called when a connection is established with a peer. Can be used to track which peers
13511 * advertise onion message support and are online.
13513 * May return an `Err(())` if the features the peer supports are not sufficient to communicate
13514 * with us. Implementors should be somewhat conservative about doing so, however, as other
13515 * message handlers may still wish to communicate with this peer.
13517 struct LDKCResult_NoneNoneZ (*peer_connected)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKInit *NONNULL_PTR init);
13519 * Indicates a connection to the peer failed/an existing connection was lost. Allows handlers to
13520 * drop and refuse to forward onion messages to this peer.
13522 * Note that in some rare cases this may be called without a corresponding
13523 * [`Self::peer_connected`].
13525 void (*peer_disconnected)(const void *this_arg, struct LDKPublicKey their_node_id, bool no_connection_possible);
13527 * Gets the node feature flags which this handler itself supports. All available handlers are
13528 * queried similarly and their feature flags are OR'd together to form the [`NodeFeatures`]
13529 * which are broadcasted in our [`NodeAnnouncement`] message.
13531 struct LDKNodeFeatures (*provided_node_features)(const void *this_arg);
13533 * Gets the init feature flags which should be sent to the given peer. All available handlers
13534 * are queried similarly and their feature flags are OR'd together to form the [`InitFeatures`]
13535 * which are sent in our [`Init`] message.
13537 * Note that this method is called before [`Self::peer_connected`].
13539 struct LDKInitFeatures (*provided_init_features)(const void *this_arg, struct LDKPublicKey their_node_id);
13541 * Implementation of OnionMessageProvider for this object.
13543 struct LDKOnionMessageProvider OnionMessageProvider;
13545 * Frees any resources associated with this object given its this_arg pointer.
13546 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
13548 void (*free)(void *this_arg);
13549 } LDKOnionMessageHandler;
13552 * Trait to be implemented by custom message (unrelated to the channel/gossip LN layers)
13555 typedef struct LDKCustomMessageReader {
13557 * An opaque pointer which is passed to your function implementations as an argument.
13558 * This has no meaning in the LDK, and can be NULL or any other value.
13562 * Decodes a custom message to `CustomMessageType`. If the given message type is known to the
13563 * implementation and the message could be decoded, must return `Ok(Some(message))`. If the
13564 * message type is unknown to the implementation, must return `Ok(None)`. If a decoding error
13565 * occur, must return `Err(DecodeError::X)` where `X` details the encountered error.
13567 struct LDKCResult_COption_TypeZDecodeErrorZ (*read)(const void *this_arg, uint16_t message_type, struct LDKu8slice buffer);
13569 * Frees any resources associated with this object given its this_arg pointer.
13570 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
13572 void (*free)(void *this_arg);
13573 } LDKCustomMessageReader;
13576 * Handler for BOLT1-compliant messages.
13578 typedef struct LDKCustomMessageHandler {
13580 * An opaque pointer which is passed to your function implementations as an argument.
13581 * This has no meaning in the LDK, and can be NULL or any other value.
13585 * Called with the message type that was received and the buffer to be read.
13586 * Can return a `MessageHandlingError` if the message could not be handled.
13588 struct LDKCResult_NoneLightningErrorZ (*handle_custom_message)(const void *this_arg, struct LDKType msg, struct LDKPublicKey sender_node_id);
13590 * Gets the list of pending messages which were generated by the custom message
13591 * handler, clearing the list in the process. The first tuple element must
13592 * correspond to the intended recipients node ids. If no connection to one of the
13593 * specified node does not exist, the message is simply not sent to it.
13595 struct LDKCVec_C2Tuple_PublicKeyTypeZZ (*get_and_clear_pending_msg)(const void *this_arg);
13597 * Implementation of CustomMessageReader for this object.
13599 struct LDKCustomMessageReader CustomMessageReader;
13601 * Frees any resources associated with this object given its this_arg pointer.
13602 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
13604 void (*free)(void *this_arg);
13605 } LDKCustomMessageHandler;
13610 * A dummy struct which implements `RoutingMessageHandler` without storing any routing information
13611 * or doing any processing. You can provide one of these as the route_handler in a MessageHandler.
13613 typedef struct MUST_USE_STRUCT LDKIgnoringMessageHandler {
13615 * A pointer to the opaque Rust object.
13616 * Nearly everywhere, inner must be non-null, however in places where
13617 * the Rust equivalent takes an Option, it may be set to null to indicate None.
13619 LDKnativeIgnoringMessageHandler *inner;
13621 * Indicates that this is the only struct which contains the same pointer.
13622 * Rust functions which take ownership of an object provided via an argument require
13623 * this to be true and invalidate the object pointed to by inner.
13626 } LDKIgnoringMessageHandler;
13629 * Handler for custom onion messages. If you are using [`SimpleArcOnionMessenger`],
13630 * [`SimpleRefOnionMessenger`], or prefer to ignore inbound custom onion messages,
13631 * [`IgnoringMessageHandler`] must be provided to [`OnionMessenger::new`]. Otherwise, a custom
13632 * implementation of this trait must be provided, with [`CustomMessage`] specifying the supported
13635 * See [`OnionMessenger`] for example usage.
13637 * [`IgnoringMessageHandler`]: crate::ln::peer_handler::IgnoringMessageHandler
13638 * [`CustomMessage`]: Self::CustomMessage
13640 typedef struct LDKCustomOnionMessageHandler {
13642 * An opaque pointer which is passed to your function implementations as an argument.
13643 * This has no meaning in the LDK, and can be NULL or any other value.
13647 * Called with the custom message that was received.
13649 void (*handle_custom_message)(const void *this_arg, struct LDKCustomOnionMessageContents msg);
13651 * Read a custom message of type `message_type` from `buffer`, returning `Ok(None)` if the
13652 * message type is unknown.
13654 struct LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ (*read_custom_message)(const void *this_arg, uint64_t message_type, struct LDKu8slice buffer);
13656 * Frees any resources associated with this object given its this_arg pointer.
13657 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
13659 void (*free)(void *this_arg);
13660 } LDKCustomOnionMessageHandler;
13665 * A dummy struct which implements `ChannelMessageHandler` without having any channels.
13666 * You can provide one of these as the route_handler in a MessageHandler.
13668 typedef struct MUST_USE_STRUCT LDKErroringMessageHandler {
13670 * A pointer to the opaque Rust object.
13671 * Nearly everywhere, inner must be non-null, however in places where
13672 * the Rust equivalent takes an Option, it may be set to null to indicate None.
13674 LDKnativeErroringMessageHandler *inner;
13676 * Indicates that this is the only struct which contains the same pointer.
13677 * Rust functions which take ownership of an object provided via an argument require
13678 * this to be true and invalidate the object pointed to by inner.
13681 } LDKErroringMessageHandler;
13686 * Provides references to trait impls which handle different types of messages.
13688 typedef struct MUST_USE_STRUCT LDKMessageHandler {
13690 * A pointer to the opaque Rust object.
13691 * Nearly everywhere, inner must be non-null, however in places where
13692 * the Rust equivalent takes an Option, it may be set to null to indicate None.
13694 LDKnativeMessageHandler *inner;
13696 * Indicates that this is the only struct which contains the same pointer.
13697 * Rust functions which take ownership of an object provided via an argument require
13698 * this to be true and invalidate the object pointed to by inner.
13701 } LDKMessageHandler;
13704 * Provides an object which can be used to send data to and which uniquely identifies a connection
13705 * to a remote host. You will need to be able to generate multiple of these which meet Eq and
13706 * implement Hash to meet the PeerManager API.
13708 * For efficiency, Clone should be relatively cheap for this type.
13710 * Two descriptors may compare equal (by [`cmp::Eq`] and [`hash::Hash`]) as long as the original
13711 * has been disconnected, the [`PeerManager`] has been informed of the disconnection (either by it
13712 * having triggered the disconnection or a call to [`PeerManager::socket_disconnected`]), and no
13713 * further calls to the [`PeerManager`] related to the original socket occur. This allows you to
13714 * use a file descriptor for your SocketDescriptor directly, however for simplicity you may wish
13715 * to simply use another value which is guaranteed to be globally unique instead.
13717 typedef struct LDKSocketDescriptor {
13719 * An opaque pointer which is passed to your function implementations as an argument.
13720 * This has no meaning in the LDK, and can be NULL or any other value.
13724 * Attempts to send some data from the given slice to the peer.
13726 * Returns the amount of data which was sent, possibly 0 if the socket has since disconnected.
13727 * Note that in the disconnected case, [`PeerManager::socket_disconnected`] must still be
13728 * called and further write attempts may occur until that time.
13730 * If the returned size is smaller than `data.len()`, a
13731 * [`PeerManager::write_buffer_space_avail`] call must be made the next time more data can be
13732 * written. Additionally, until a `send_data` event completes fully, no further
13733 * [`PeerManager::read_event`] calls should be made for the same peer! Because this is to
13734 * prevent denial-of-service issues, you should not read or buffer any data from the socket
13737 * If a [`PeerManager::read_event`] call on this descriptor had previously returned true
13738 * (indicating that read events should be paused to prevent DoS in the send buffer),
13739 * `resume_read` may be set indicating that read events on this descriptor should resume. A
13740 * `resume_read` of false carries no meaning, and should not cause any action.
13742 uintptr_t (*send_data)(void *this_arg, struct LDKu8slice data, bool resume_read);
13744 * Disconnect the socket pointed to by this SocketDescriptor.
13746 * You do *not* need to call [`PeerManager::socket_disconnected`] with this socket after this
13747 * call (doing so is a noop).
13749 void (*disconnect_socket)(void *this_arg);
13751 * Checks if two objects are equal given this object's this_arg pointer and another object.
13753 bool (*eq)(const void *this_arg, const struct LDKSocketDescriptor *NONNULL_PTR other_arg);
13755 * Calculate a succinct non-cryptographic hash for an object given its this_arg pointer.
13756 * This is used, for example, for inclusion of this object in a hash map.
13758 uint64_t (*hash)(const void *this_arg);
13760 * Called, if set, after this SocketDescriptor has been cloned into a duplicate object.
13761 * The new SocketDescriptor is provided, and should be mutated as needed to perform a
13762 * deep copy of the object pointed to by this_arg or avoid any double-freeing.
13764 void (*cloned)(struct LDKSocketDescriptor *NONNULL_PTR new_SocketDescriptor);
13766 * Frees any resources associated with this object given its this_arg pointer.
13767 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
13769 void (*free)(void *this_arg);
13770 } LDKSocketDescriptor;
13775 * A PeerManager manages a set of peers, described by their [`SocketDescriptor`] and marshalls
13776 * socket events into messages which it passes on to its [`MessageHandler`].
13778 * Locks are taken internally, so you must never assume that reentrancy from a
13779 * [`SocketDescriptor`] call back into [`PeerManager`] methods will not deadlock.
13781 * Calls to [`read_event`] will decode relevant messages and pass them to the
13782 * [`ChannelMessageHandler`], likely doing message processing in-line. Thus, the primary form of
13783 * parallelism in Rust-Lightning is in calls to [`read_event`]. Note, however, that calls to any
13784 * [`PeerManager`] functions related to the same connection must occur only in serial, making new
13785 * calls only after previous ones have returned.
13787 * Rather than using a plain PeerManager, it is preferable to use either a SimpleArcPeerManager
13788 * a SimpleRefPeerManager, for conciseness. See their documentation for more details, but
13789 * essentially you should default to using a SimpleRefPeerManager, and use a
13790 * SimpleArcPeerManager when you require a PeerManager with a static lifetime, such as when
13791 * you're using lightning-net-tokio.
13793 * [`read_event`]: PeerManager::read_event
13795 typedef struct MUST_USE_STRUCT LDKPeerManager {
13797 * A pointer to the opaque Rust object.
13798 * Nearly everywhere, inner must be non-null, however in places where
13799 * the Rust equivalent takes an Option, it may be set to null to indicate None.
13801 LDKnativePeerManager *inner;
13803 * Indicates that this is the only struct which contains the same pointer.
13804 * Rust functions which take ownership of an object provided via an argument require
13805 * this to be true and invalidate the object pointed to by inner.
13813 * Static channel fields used to build transactions given per-commitment fields, organized by
13814 * broadcaster/countersignatory.
13816 * This is derived from the holder/counterparty-organized ChannelTransactionParameters via the
13817 * as_holder_broadcastable and as_counterparty_broadcastable functions.
13819 typedef struct MUST_USE_STRUCT LDKDirectedChannelTransactionParameters {
13821 * A pointer to the opaque Rust object.
13822 * Nearly everywhere, inner must be non-null, however in places where
13823 * the Rust equivalent takes an Option, it may be set to null to indicate None.
13825 LDKnativeDirectedChannelTransactionParameters *inner;
13827 * Indicates that this is the only struct which contains the same pointer.
13828 * Rust functions which take ownership of an object provided via an argument require
13829 * this to be true and invalidate the object pointed to by inner.
13832 } LDKDirectedChannelTransactionParameters;
13835 * Integer in the range `0..=16`
13837 typedef struct LDKWitnessVersion {
13839 } LDKWitnessVersion;
13844 * A read-only view of [`NetworkGraph`].
13846 typedef struct MUST_USE_STRUCT LDKReadOnlyNetworkGraph {
13848 * A pointer to the opaque Rust object.
13849 * Nearly everywhere, inner must be non-null, however in places where
13850 * the Rust equivalent takes an Option, it may be set to null to indicate None.
13852 LDKnativeReadOnlyNetworkGraph *inner;
13854 * Indicates that this is the only struct which contains the same pointer.
13855 * Rust functions which take ownership of an object provided via an argument require
13856 * this to be true and invalidate the object pointed to by inner.
13859 } LDKReadOnlyNetworkGraph;
13864 * Receives and validates network updates from peers,
13865 * stores authentic and relevant data as a network graph.
13866 * This network graph is then used for routing payments.
13867 * Provides interface to help with initial routing sync by
13868 * serving historical announcements.
13870 typedef struct MUST_USE_STRUCT LDKP2PGossipSync {
13872 * A pointer to the opaque Rust object.
13873 * Nearly everywhere, inner must be non-null, however in places where
13874 * the Rust equivalent takes an Option, it may be set to null to indicate None.
13876 LDKnativeP2PGossipSync *inner;
13878 * Indicates that this is the only struct which contains the same pointer.
13879 * Rust functions which take ownership of an object provided via an argument require
13880 * this to be true and invalidate the object pointed to by inner.
13883 } LDKP2PGossipSync;
13888 * A wrapper around [`ChannelInfo`] representing information about the channel as directed from a
13889 * source node to a target node.
13891 typedef struct MUST_USE_STRUCT LDKDirectedChannelInfo {
13893 * A pointer to the opaque Rust object.
13894 * Nearly everywhere, inner must be non-null, however in places where
13895 * the Rust equivalent takes an Option, it may be set to null to indicate None.
13897 LDKnativeDirectedChannelInfo *inner;
13899 * Indicates that this is the only struct which contains the same pointer.
13900 * Rust functions which take ownership of an object provided via an argument require
13901 * this to be true and invalidate the object pointed to by inner.
13904 } LDKDirectedChannelInfo;
13907 * The effective capacity of a channel for routing purposes.
13909 * While this may be smaller than the actual channel capacity, amounts greater than
13910 * [`Self::as_msat`] should not be routed through the channel.
13912 typedef enum LDKEffectiveCapacity_Tag {
13914 * The available liquidity in the channel known from being a channel counterparty, and thus a
13917 LDKEffectiveCapacity_ExactLiquidity,
13919 * The maximum HTLC amount in one direction as advertised on the gossip network.
13921 LDKEffectiveCapacity_MaximumHTLC,
13923 * The total capacity of the channel as determined by the funding transaction.
13925 LDKEffectiveCapacity_Total,
13927 * A capacity sufficient to route any payment, typically used for private channels provided by
13930 LDKEffectiveCapacity_Infinite,
13932 * A capacity that is unknown possibly because either the chain state is unavailable to know
13933 * the total capacity or the `htlc_maximum_msat` was not advertised on the gossip network.
13935 LDKEffectiveCapacity_Unknown,
13937 * Must be last for serialization purposes
13939 LDKEffectiveCapacity_Sentinel,
13940 } LDKEffectiveCapacity_Tag;
13942 typedef struct LDKEffectiveCapacity_LDKExactLiquidity_Body {
13944 * Either the inbound or outbound liquidity depending on the direction, denominated in
13947 uint64_t liquidity_msat;
13948 } LDKEffectiveCapacity_LDKExactLiquidity_Body;
13950 typedef struct LDKEffectiveCapacity_LDKMaximumHTLC_Body {
13952 * The maximum HTLC amount denominated in millisatoshi.
13954 uint64_t amount_msat;
13955 } LDKEffectiveCapacity_LDKMaximumHTLC_Body;
13957 typedef struct LDKEffectiveCapacity_LDKTotal_Body {
13959 * The funding amount denominated in millisatoshi.
13961 uint64_t capacity_msat;
13963 * The maximum HTLC amount denominated in millisatoshi.
13965 uint64_t htlc_maximum_msat;
13966 } LDKEffectiveCapacity_LDKTotal_Body;
13968 typedef struct MUST_USE_STRUCT LDKEffectiveCapacity {
13969 LDKEffectiveCapacity_Tag tag;
13971 LDKEffectiveCapacity_LDKExactLiquidity_Body exact_liquidity;
13972 LDKEffectiveCapacity_LDKMaximumHTLC_Body maximum_htlc;
13973 LDKEffectiveCapacity_LDKTotal_Body total;
13975 } LDKEffectiveCapacity;
13980 * A [`Router`] implemented using [`find_route`].
13982 typedef struct MUST_USE_STRUCT LDKDefaultRouter {
13984 * A pointer to the opaque Rust object.
13985 * Nearly everywhere, inner must be non-null, however in places where
13986 * the Rust equivalent takes an Option, it may be set to null to indicate None.
13988 LDKnativeDefaultRouter *inner;
13990 * Indicates that this is the only struct which contains the same pointer.
13991 * Rust functions which take ownership of an object provided via an argument require
13992 * this to be true and invalidate the object pointed to by inner.
13995 } LDKDefaultRouter;
13998 * A trait defining behavior for routing a payment.
14000 typedef struct LDKRouter {
14002 * An opaque pointer which is passed to your function implementations as an argument.
14003 * This has no meaning in the LDK, and can be NULL or any other value.
14007 * Finds a [`Route`] between `payer` and `payee` for a payment with the given values.
14009 * Note that first_hops (or a relevant inner pointer) may be NULL or all-0s to represent None
14011 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);
14013 * Finds a [`Route`] between `payer` and `payee` for a payment with the given values. Includes
14014 * `PaymentHash` and `PaymentId` to be able to correlate the request with a specific payment.
14016 * Note that first_hops (or a relevant inner pointer) may be NULL or all-0s to represent None
14018 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);
14020 * Lets the router know that payment through a specific path has failed.
14022 void (*notify_payment_path_failed)(const void *this_arg, struct LDKCVec_RouteHopZ path, uint64_t short_channel_id);
14024 * Lets the router know that payment through a specific path was successful.
14026 void (*notify_payment_path_successful)(const void *this_arg, struct LDKCVec_RouteHopZ path);
14028 * Lets the router know that a payment probe was successful.
14030 void (*notify_payment_probe_successful)(const void *this_arg, struct LDKCVec_RouteHopZ path);
14032 * Lets the router know that a payment probe failed.
14034 void (*notify_payment_probe_failed)(const void *this_arg, struct LDKCVec_RouteHopZ path, uint64_t short_channel_id);
14036 * Frees any resources associated with this object given its this_arg pointer.
14037 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
14039 void (*free)(void *this_arg);
14045 * [`Score`] implementation that factors in in-flight HTLC liquidity.
14047 * Useful for custom [`Router`] implementations to wrap their [`Score`] on-the-fly when calling
14050 * [`Score`]: crate::routing::scoring::Score
14052 typedef struct MUST_USE_STRUCT LDKScorerAccountingForInFlightHtlcs {
14054 * A pointer to the opaque Rust object.
14055 * Nearly everywhere, inner must be non-null, however in places where
14056 * the Rust equivalent takes an Option, it may be set to null to indicate None.
14058 LDKnativeScorerAccountingForInFlightHtlcs *inner;
14060 * Indicates that this is the only struct which contains the same pointer.
14061 * Rust functions which take ownership of an object provided via an argument require
14062 * this to be true and invalidate the object pointed to by inner.
14065 } LDKScorerAccountingForInFlightHtlcs;
14070 * A concrete implementation of [`LockableScore`] which supports multi-threading.
14072 typedef struct MUST_USE_STRUCT LDKMultiThreadedLockableScore {
14074 * A pointer to the opaque Rust object.
14075 * Nearly everywhere, inner must be non-null, however in places where
14076 * the Rust equivalent takes an Option, it may be set to null to indicate None.
14078 LDKnativeMultiThreadedLockableScore *inner;
14080 * Indicates that this is the only struct which contains the same pointer.
14081 * Rust functions which take ownership of an object provided via an argument require
14082 * this to be true and invalidate the object pointed to by inner.
14085 } LDKMultiThreadedLockableScore;
14090 * A locked `MultiThreadedLockableScore`.
14092 typedef struct MUST_USE_STRUCT LDKMultiThreadedScoreLock {
14094 * A pointer to the opaque Rust object.
14095 * Nearly everywhere, inner must be non-null, however in places where
14096 * the Rust equivalent takes an Option, it may be set to null to indicate None.
14098 LDKnativeMultiThreadedScoreLock *inner;
14100 * Indicates that this is the only struct which contains the same pointer.
14101 * Rust functions which take ownership of an object provided via an argument require
14102 * this to be true and invalidate the object pointed to by inner.
14105 } LDKMultiThreadedScoreLock;
14110 * Parameters for configuring [`ProbabilisticScorer`].
14112 * Used to configure base, liquidity, and amount penalties, the sum of which comprises the channel
14113 * penalty (i.e., the amount in msats willing to be paid to avoid routing through the channel).
14115 * The penalty applied to any channel by the [`ProbabilisticScorer`] is the sum of each of the
14118 typedef struct MUST_USE_STRUCT LDKProbabilisticScoringParameters {
14120 * A pointer to the opaque Rust object.
14121 * Nearly everywhere, inner must be non-null, however in places where
14122 * the Rust equivalent takes an Option, it may be set to null to indicate None.
14124 LDKnativeProbabilisticScoringParameters *inner;
14126 * Indicates that this is the only struct which contains the same pointer.
14127 * Rust functions which take ownership of an object provided via an argument require
14128 * this to be true and invalidate the object pointed to by inner.
14131 } LDKProbabilisticScoringParameters;
14136 * A sender, receiver and forwarder of onion messages. In upcoming releases, this object will be
14137 * used to retrieve invoices and fulfill invoice requests from [offers]. Currently, only sending
14138 * and receiving custom onion messages is supported.
14143 * # extern crate bitcoin;
14144 * # use bitcoin::hashes::_export::_core::time::Duration;
14145 * # use bitcoin::secp256k1::{PublicKey, Secp256k1, SecretKey};
14146 * # use lightning::chain::keysinterface::{InMemorySigner, KeysManager, KeysInterface};
14147 * # use lightning::ln::msgs::DecodeError;
14148 * # use lightning::ln::peer_handler::IgnoringMessageHandler;
14149 * # use lightning::onion_message::blinded_path::BlindedPath;
14150 * # use lightning::onion_message::messenger::{CustomOnionMessageContents, Destination, OnionMessageContents, OnionMessenger};
14151 * # use lightning::util::logger::{Logger, Record};
14152 * # use lightning::util::ser::{Writeable, Writer};
14153 * # use lightning::io;
14154 * # use std::sync::Arc;
14155 * # struct FakeLogger {};
14156 * # impl Logger for FakeLogger {
14157 * # fn log(&self, record: &Record) { unimplemented!() }
14159 * # let seed = [42u8; 32];
14160 * # let time = Duration::from_secs(123456);
14161 * # let keys_manager = KeysManager::new(&seed, time.as_secs(), time.subsec_nanos());
14162 * # let logger = Arc::new(FakeLogger {});
14163 * # let node_secret = SecretKey::from_slice(&hex::decode(\"0101010101010101010101010101010101010101010101010101010101010101\").unwrap()[..]).unwrap();
14164 * # let secp_ctx = Secp256k1::new();
14165 * # let hop_node_id1 = PublicKey::from_secret_key(&secp_ctx, &node_secret);
14166 * # let (hop_node_id2, hop_node_id3, hop_node_id4) = (hop_node_id1, hop_node_id1, hop_node_id1);
14167 * # let destination_node_id = hop_node_id1;
14168 * # let your_custom_message_handler = IgnoringMessageHandler {};
14169 * // Create the onion messenger. This must use the same `keys_manager` as is passed to your
14170 * // ChannelManager.
14171 * let onion_messenger = OnionMessenger::new(&keys_manager, logger, your_custom_message_handler);
14173 * # struct YourCustomMessage {}
14174 * impl Writeable for YourCustomMessage {
14175 * \tfn write<W: Writer>(&self, w: &mut W) -> Result<(), io::Error> {
14177 * \t\t// Write your custom onion message to `w`
14180 * impl CustomOnionMessageContents for YourCustomMessage {
14181 * \tfn tlv_type(&self) -> u64 {
14182 * \t\t# let your_custom_message_type = 42;
14183 * \t\tyour_custom_message_type
14186 * // Send a custom onion message to a node id.
14187 * let intermediate_hops = [hop_node_id1, hop_node_id2];
14188 * let reply_path = None;
14189 * # let your_custom_message = YourCustomMessage {};
14190 * let message = OnionMessageContents::Custom(your_custom_message);
14191 * onion_messenger.send_onion_message(&intermediate_hops, Destination::Node(destination_node_id), message, reply_path);
14193 * // Create a blinded path to yourself, for someone to send an onion message to.
14194 * # let your_node_id = hop_node_id1;
14195 * let hops = [hop_node_id3, hop_node_id4, your_node_id];
14196 * let blinded_path = BlindedPath::new(&hops, &keys_manager, &secp_ctx).unwrap();
14198 * // Send a custom onion message to a blinded path.
14199 * # let intermediate_hops = [hop_node_id1, hop_node_id2];
14200 * let reply_path = None;
14201 * # let your_custom_message = YourCustomMessage {};
14202 * let message = OnionMessageContents::Custom(your_custom_message);
14203 * onion_messenger.send_onion_message(&intermediate_hops, Destination::BlindedPath(blinded_path), message, reply_path);
14206 * [offers]: <https://github.com/lightning/bolts/pull/798>
14207 * [`OnionMessenger`]: crate::onion_message::OnionMessenger
14209 typedef struct MUST_USE_STRUCT LDKOnionMessenger {
14211 * A pointer to the opaque Rust object.
14212 * Nearly everywhere, inner must be non-null, however in places where
14213 * the Rust equivalent takes an Option, it may be set to null to indicate None.
14215 LDKnativeOnionMessenger *inner;
14217 * Indicates that this is the only struct which contains the same pointer.
14218 * Rust functions which take ownership of an object provided via an argument require
14219 * this to be true and invalidate the object pointed to by inner.
14222 } LDKOnionMessenger;
14225 * The destination of an onion message.
14227 typedef enum LDKDestination_Tag {
14229 * We're sending this onion message to a node.
14231 LDKDestination_Node,
14233 * We're sending this onion message to a blinded path.
14235 LDKDestination_BlindedPath,
14237 * Must be last for serialization purposes
14239 LDKDestination_Sentinel,
14240 } LDKDestination_Tag;
14242 typedef struct MUST_USE_STRUCT LDKDestination {
14243 LDKDestination_Tag tag;
14246 struct LDKPublicKey node;
14249 struct LDKBlindedPath blinded_path;
14255 * The contents of an onion message. In the context of offers, this would be the invoice, invoice
14256 * request, or invoice error.
14258 typedef enum LDKOnionMessageContents_Tag {
14260 * A custom onion message specified by the user.
14262 LDKOnionMessageContents_Custom,
14264 * Must be last for serialization purposes
14266 LDKOnionMessageContents_Sentinel,
14267 } LDKOnionMessageContents_Tag;
14269 typedef struct MUST_USE_STRUCT LDKOnionMessageContents {
14270 LDKOnionMessageContents_Tag tag;
14273 struct LDKCustomOnionMessageContents custom;
14276 } LDKOnionMessageContents;
14281 * FilesystemPersister persists channel data on disk, where each channel's
14282 * data is stored in a file named after its funding outpoint.
14284 * Warning: this module does the best it can with calls to persist data, but it
14285 * can only guarantee that the data is passed to the drive. It is up to the
14286 * drive manufacturers to do the actual persistence properly, which they often
14287 * don't (especially on consumer-grade hardware). Therefore, it is up to the
14288 * user to validate their entire storage stack, to ensure the writes are
14290 * Corollary: especially when dealing with larger amounts of money, it is best
14291 * practice to have multiple channel data backups and not rely only on one
14292 * FilesystemPersister.
14294 typedef struct MUST_USE_STRUCT LDKFilesystemPersister {
14296 * A pointer to the opaque Rust object.
14297 * Nearly everywhere, inner must be non-null, however in places where
14298 * the Rust equivalent takes an Option, it may be set to null to indicate None.
14300 LDKnativeFilesystemPersister *inner;
14302 * Indicates that this is the only struct which contains the same pointer.
14303 * Rust functions which take ownership of an object provided via an argument require
14304 * this to be true and invalidate the object pointed to by inner.
14307 } LDKFilesystemPersister;
14312 * `BackgroundProcessor` takes care of tasks that (1) need to happen periodically to keep
14313 * Rust-Lightning running properly, and (2) either can or should be run in the background. Its
14314 * responsibilities are:
14315 * * Processing [`Event`]s with a user-provided [`EventHandler`].
14316 * * Monitoring whether the [`ChannelManager`] needs to be re-persisted to disk, and if so,
14317 * writing it to disk/backups by invoking the callback given to it at startup.
14318 * [`ChannelManager`] persistence should be done in the background.
14319 * * Calling [`ChannelManager::timer_tick_occurred`] and [`PeerManager::timer_tick_occurred`]
14320 * at the appropriate intervals.
14321 * * Calling [`NetworkGraph::remove_stale_channels_and_tracking`] (if a [`GossipSync`] with a
14322 * [`NetworkGraph`] is provided to [`BackgroundProcessor::start`]).
14324 * It will also call [`PeerManager::process_events`] periodically though this shouldn't be relied
14325 * upon as doing so may result in high latency.
14329 * If [`ChannelManager`] persistence fails and the persisted manager becomes out-of-date, then
14330 * there is a risk of channels force-closing on startup when the manager realizes it's outdated.
14331 * However, as long as [`ChannelMonitor`] backups are sound, no funds besides those used for
14332 * unilateral chain closure fees are at risk.
14334 * [`ChannelMonitor`]: lightning::chain::channelmonitor::ChannelMonitor
14335 * [`Event`]: lightning::util::events::Event
14336 *BackgroundProcessor will immediately stop on drop. It should be stored until shutdown.
14338 typedef struct MUST_USE_STRUCT LDKBackgroundProcessor {
14340 * A pointer to the opaque Rust object.
14341 * Nearly everywhere, inner must be non-null, however in places where
14342 * the Rust equivalent takes an Option, it may be set to null to indicate None.
14344 LDKnativeBackgroundProcessor *inner;
14346 * Indicates that this is the only struct which contains the same pointer.
14347 * Rust functions which take ownership of an object provided via an argument require
14348 * this to be true and invalidate the object pointed to by inner.
14351 } LDKBackgroundProcessor;
14356 * The main Rapid Gossip Sync object.
14358 * See [crate-level documentation] for usage.
14360 * [crate-level documentation]: crate
14362 typedef struct MUST_USE_STRUCT LDKRapidGossipSync {
14364 * A pointer to the opaque Rust object.
14365 * Nearly everywhere, inner must be non-null, however in places where
14366 * the Rust equivalent takes an Option, it may be set to null to indicate None.
14368 LDKnativeRapidGossipSync *inner;
14370 * Indicates that this is the only struct which contains the same pointer.
14371 * Rust functions which take ownership of an object provided via an argument require
14372 * this to be true and invalidate the object pointed to by inner.
14375 } LDKRapidGossipSync;
14378 * Either [`P2PGossipSync`] or [`RapidGossipSync`].
14380 typedef enum LDKGossipSync_Tag {
14382 * Gossip sync via the lightning peer-to-peer network as defined by BOLT 7.
14386 * Rapid gossip sync from a trusted server.
14388 LDKGossipSync_Rapid,
14392 LDKGossipSync_None,
14394 * Must be last for serialization purposes
14396 LDKGossipSync_Sentinel,
14397 } LDKGossipSync_Tag;
14399 typedef struct MUST_USE_STRUCT LDKGossipSync {
14400 LDKGossipSync_Tag tag;
14404 * Note that this field is expected to be a reference.
14406 struct LDKP2PGossipSync p2p;
14410 * Note that this field is expected to be a reference.
14412 struct LDKRapidGossipSync rapid;
14420 * Data of the `RawInvoice` that is encoded in the data part
14422 typedef struct MUST_USE_STRUCT LDKRawDataPart {
14424 * A pointer to the opaque Rust object.
14425 * Nearly everywhere, inner must be non-null, however in places where
14426 * the Rust equivalent takes an Option, it may be set to null to indicate None.
14428 LDKnativeRawDataPart *inner;
14430 * Indicates that this is the only struct which contains the same pointer.
14431 * Rust functions which take ownership of an object provided via an argument require
14432 * this to be true and invalidate the object pointed to by inner.
14442 typedef struct MUST_USE_STRUCT LDKSha256 {
14444 * A pointer to the opaque Rust object.
14445 * Nearly everywhere, inner must be non-null, however in places where
14446 * the Rust equivalent takes an Option, it may be set to null to indicate None.
14448 LDKnativeSha256 *inner;
14450 * Indicates that this is the only struct which contains the same pointer.
14451 * Rust functions which take ownership of an object provided via an argument require
14452 * this to be true and invalidate the object pointed to by inner.
14460 * Positive duration that defines when (relatively to the timestamp) in the future the invoice
14463 typedef struct MUST_USE_STRUCT LDKExpiryTime {
14465 * A pointer to the opaque Rust object.
14466 * Nearly everywhere, inner must be non-null, however in places where
14467 * the Rust equivalent takes an Option, it may be set to null to indicate None.
14469 LDKnativeExpiryTime *inner;
14471 * Indicates that this is the only struct which contains the same pointer.
14472 * Rust functions which take ownership of an object provided via an argument require
14473 * this to be true and invalidate the object pointed to by inner.
14481 * `min_final_cltv_expiry` to use for the last HTLC in the route
14483 typedef struct MUST_USE_STRUCT LDKMinFinalCltvExpiry {
14485 * A pointer to the opaque Rust object.
14486 * Nearly everywhere, inner must be non-null, however in places where
14487 * the Rust equivalent takes an Option, it may be set to null to indicate None.
14489 LDKnativeMinFinalCltvExpiry *inner;
14491 * Indicates that this is the only struct which contains the same pointer.
14492 * Rust functions which take ownership of an object provided via an argument require
14493 * this to be true and invalidate the object pointed to by inner.
14496 } LDKMinFinalCltvExpiry;
14499 * A 20-byte byte array.
14501 typedef struct LDKTwentyBytes {
14509 * Fallback address in case no LN payment is possible
14511 typedef enum LDKFallback_Tag {
14512 LDKFallback_SegWitProgram,
14513 LDKFallback_PubKeyHash,
14514 LDKFallback_ScriptHash,
14516 * Must be last for serialization purposes
14518 LDKFallback_Sentinel,
14521 typedef struct LDKFallback_LDKSegWitProgram_Body {
14522 struct LDKU5 version;
14523 struct LDKCVec_u8Z program;
14524 } LDKFallback_LDKSegWitProgram_Body;
14526 typedef struct MUST_USE_STRUCT LDKFallback {
14527 LDKFallback_Tag tag;
14529 LDKFallback_LDKSegWitProgram_Body seg_wit_program;
14531 struct LDKTwentyBytes pub_key_hash;
14534 struct LDKTwentyBytes script_hash;
14540 * A trait defining behavior of an [`Invoice`] payer.
14542 * While the behavior of [`InvoicePayer`] provides idempotency of duplicate `send_*payment` calls
14543 * with the same [`PaymentHash`], it is up to the `Payer` to provide idempotency across restarts.
14545 * [`ChannelManager`] provides idempotency for duplicate payments with the same [`PaymentId`].
14547 * In order to trivially ensure idempotency for payments, the default `Payer` implementation
14548 * reuses the [`PaymentHash`] bytes as the [`PaymentId`]. Custom implementations wishing to
14549 * provide payment idempotency with a different idempotency key (i.e. [`PaymentId`]) should map
14550 * the [`Invoice`] or spontaneous payment target pubkey to their own idempotency key.
14552 * [`ChannelManager`]: lightning::ln::channelmanager::ChannelManager
14554 typedef struct LDKPayer {
14556 * An opaque pointer which is passed to your function implementations as an argument.
14557 * This has no meaning in the LDK, and can be NULL or any other value.
14561 * Returns the payer's node id.
14563 struct LDKPublicKey (*node_id)(const void *this_arg);
14565 * Returns the payer's channels.
14567 struct LDKCVec_ChannelDetailsZ (*first_hops)(const void *this_arg);
14569 * Sends a payment over the Lightning Network using the given [`Route`].
14571 * Note that payment_secret (or a relevant inner pointer) may be NULL or all-0s to represent None
14573 struct LDKCResult_NonePaymentSendFailureZ (*send_payment)(const void *this_arg, const struct LDKRoute *NONNULL_PTR route, struct LDKThirtyTwoBytes payment_hash, struct LDKThirtyTwoBytes payment_secret, struct LDKThirtyTwoBytes payment_id);
14575 * Sends a spontaneous payment over the Lightning Network using the given [`Route`].
14577 struct LDKCResult_NonePaymentSendFailureZ (*send_spontaneous_payment)(const void *this_arg, const struct LDKRoute *NONNULL_PTR route, struct LDKThirtyTwoBytes payment_preimage, struct LDKThirtyTwoBytes payment_id);
14579 * Retries a failed payment path for the [`PaymentId`] using the given [`Route`].
14581 struct LDKCResult_NonePaymentSendFailureZ (*retry_payment)(const void *this_arg, const struct LDKRoute *NONNULL_PTR route, struct LDKThirtyTwoBytes payment_id);
14583 * Signals that no further retries for the given payment will occur.
14585 void (*abandon_payment)(const void *this_arg, struct LDKThirtyTwoBytes payment_id);
14587 * Construct an [`InFlightHtlcs`] containing information about currently used up liquidity
14590 struct LDKInFlightHtlcs (*inflight_htlcs)(const void *this_arg);
14592 * Frees any resources associated with this object given its this_arg pointer.
14593 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
14595 void (*free)(void *this_arg);
14601 * A utility for paying [`Invoice`]s and sending spontaneous payments.
14603 * See [module-level documentation] for details.
14605 * [module-level documentation]: crate::payment
14607 typedef struct MUST_USE_STRUCT LDKInvoicePayer {
14609 * A pointer to the opaque Rust object.
14610 * Nearly everywhere, inner must be non-null, however in places where
14611 * the Rust equivalent takes an Option, it may be set to null to indicate None.
14613 LDKnativeInvoicePayer *inner;
14615 * Indicates that this is the only struct which contains the same pointer.
14616 * Rust functions which take ownership of an object provided via an argument require
14617 * this to be true and invalidate the object pointed to by inner.
14623 * Strategies available to retry payment path failures for an [`Invoice`].
14626 typedef enum LDKRetry_Tag {
14628 * Max number of attempts to retry payment.
14630 * Note that this is the number of *path* failures, not full payment retries. For multi-path
14631 * payments, if this is less than the total number of paths, we will never even retry all of the
14636 * Time elapsed before abandoning retries for a payment.
14640 * Must be last for serialization purposes
14645 typedef struct MUST_USE_STRUCT LDKRetry {
14649 uintptr_t attempts;
14657 extern const uintptr_t MAX_BUF_SIZE;
14659 extern const uint64_t MIN_RELAY_FEE_SAT_PER_1000_WEIGHT;
14661 extern const uint32_t FEERATE_FLOOR_SATS_PER_KW;
14663 extern const uint64_t CLOSED_CHANNEL_UPDATE_ID;
14665 extern const uint32_t ANTI_REORG_DELAY;
14667 extern const uint16_t BREAKDOWN_TIMEOUT;
14669 extern const uint16_t MIN_CLTV_EXPIRY_DELTA;
14671 extern const uint32_t MIN_FINAL_CLTV_EXPIRY;
14673 extern const uint16_t MAX_HTLCS;
14675 extern const uintptr_t OFFERED_HTLC_SCRIPT_WEIGHT;
14677 extern const uintptr_t OFFERED_HTLC_SCRIPT_WEIGHT_ANCHORS;
14679 extern const uintptr_t MAX_ACCEPTED_HTLC_SCRIPT_WEIGHT;
14681 extern const uintptr_t REVOKEABLE_REDEEMSCRIPT_MAX_LENGTH;
14683 extern const uint64_t UNKNOWN_CHANNEL_CAPACITY_MSAT;
14685 extern const uint32_t DEFAULT_MAX_TOTAL_CLTV_EXPIRY_DELTA;
14687 extern const uint8_t DEFAULT_MAX_PATH_COUNT;
14689 extern const uint64_t MAX_TIMESTAMP;
14691 extern const uint64_t DEFAULT_EXPIRY_TIME;
14693 extern const uint64_t DEFAULT_MIN_FINAL_CLTV_EXPIRY;
14695 extern const uint8_t TAG_PAYMENT_HASH;
14697 extern const uint8_t TAG_DESCRIPTION;
14699 extern const uint8_t TAG_PAYEE_PUB_KEY;
14701 extern const uint8_t TAG_DESCRIPTION_HASH;
14703 extern const uint8_t TAG_EXPIRY_TIME;
14705 extern const uint8_t TAG_MIN_FINAL_CLTV_EXPIRY;
14707 extern const uint8_t TAG_FALLBACK;
14709 extern const uint8_t TAG_PRIVATE_ROUTE;
14711 extern const uint8_t TAG_PAYMENT_SECRET;
14713 extern const uint8_t TAG_FEATURES;
14715 struct LDKStr _ldk_get_compiled_version(void);
14717 struct LDKStr _ldk_c_bindings_get_compiled_version(void);
14720 * Gets the 128-bit integer, as 16 little-endian bytes
14722 struct LDKSixteenBytes U128_le_bytes(struct LDKU128 val);
14725 * Constructs a new U128 from 16 little-endian bytes
14727 struct LDKU128 U128_new(struct LDKSixteenBytes le_bytes);
14730 * Convenience function for constructing a new BigEndianScalar
14732 struct LDKBigEndianScalar BigEndianScalar_new(struct LDKThirtyTwoBytes big_endian_bytes);
14735 * Creates a new Bech32Error which has the same data as `orig`
14737 struct LDKBech32Error Bech32Error_clone(const struct LDKBech32Error *NONNULL_PTR orig);
14740 * Releases any memory held by the given `Bech32Error` (which is currently none)
14742 void Bech32Error_free(struct LDKBech32Error o);
14745 * Frees the data buffer, if data_is_owned is set and datalen > 0.
14747 void Transaction_free(struct LDKTransaction _res);
14750 * Frees the data pointed to by data
14752 void Witness_free(struct LDKWitness _res);
14755 * Convenience function for constructing a new TxOut
14757 struct LDKTxOut TxOut_new(struct LDKCVec_u8Z script_pubkey, uint64_t value);
14760 * Frees the data pointed to by script_pubkey.
14762 void TxOut_free(struct LDKTxOut _res);
14765 * Creates a new TxOut which has the same data as `orig` but with a new script buffer.
14767 struct LDKTxOut TxOut_clone(const struct LDKTxOut *NONNULL_PTR orig);
14770 * Frees the data buffer, if chars_is_owned is set and len > 0.
14772 void Str_free(struct LDKStr _res);
14774 #if defined(LDK_DEBUG_BUILD)
14776 * This function exists for memory safety testing purposes. It should never be used in production
14779 const void *__unmangle_inner_ptr(const void *ptr);
14783 * Constructs a new COption_HTLCClaimZ containing a crate::lightning::ln::chan_utils::HTLCClaim
14785 struct LDKCOption_HTLCClaimZ COption_HTLCClaimZ_some(enum LDKHTLCClaim o);
14788 * Constructs a new COption_HTLCClaimZ containing nothing
14790 struct LDKCOption_HTLCClaimZ COption_HTLCClaimZ_none(void);
14793 * Frees any resources associated with the crate::lightning::ln::chan_utils::HTLCClaim, if we are in the Some state
14795 void COption_HTLCClaimZ_free(struct LDKCOption_HTLCClaimZ _res);
14798 * Creates a new CResult_NoneNoneZ in the success state.
14800 struct LDKCResult_NoneNoneZ CResult_NoneNoneZ_ok(void);
14803 * Creates a new CResult_NoneNoneZ in the error state.
14805 struct LDKCResult_NoneNoneZ CResult_NoneNoneZ_err(void);
14808 * Checks if the given object is currently in the success state
14810 bool CResult_NoneNoneZ_is_ok(const struct LDKCResult_NoneNoneZ *NONNULL_PTR o);
14813 * Frees any resources used by the CResult_NoneNoneZ.
14815 void CResult_NoneNoneZ_free(struct LDKCResult_NoneNoneZ _res);
14818 * Creates a new CResult_NoneNoneZ which has the same data as `orig`
14819 * but with all dynamically-allocated buffers duplicated in new buffers.
14821 struct LDKCResult_NoneNoneZ CResult_NoneNoneZ_clone(const struct LDKCResult_NoneNoneZ *NONNULL_PTR orig);
14824 * Creates a new CResult_CounterpartyCommitmentSecretsDecodeErrorZ in the success state.
14826 struct LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ CResult_CounterpartyCommitmentSecretsDecodeErrorZ_ok(struct LDKCounterpartyCommitmentSecrets o);
14829 * Creates a new CResult_CounterpartyCommitmentSecretsDecodeErrorZ in the error state.
14831 struct LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ CResult_CounterpartyCommitmentSecretsDecodeErrorZ_err(struct LDKDecodeError e);
14834 * Checks if the given object is currently in the success state
14836 bool CResult_CounterpartyCommitmentSecretsDecodeErrorZ_is_ok(const struct LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ *NONNULL_PTR o);
14839 * Frees any resources used by the CResult_CounterpartyCommitmentSecretsDecodeErrorZ.
14841 void CResult_CounterpartyCommitmentSecretsDecodeErrorZ_free(struct LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ _res);
14844 * Creates a new CResult_CounterpartyCommitmentSecretsDecodeErrorZ which has the same data as `orig`
14845 * but with all dynamically-allocated buffers duplicated in new buffers.
14847 struct LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ CResult_CounterpartyCommitmentSecretsDecodeErrorZ_clone(const struct LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ *NONNULL_PTR orig);
14850 * Creates a new CResult_TxCreationKeysDecodeErrorZ in the success state.
14852 struct LDKCResult_TxCreationKeysDecodeErrorZ CResult_TxCreationKeysDecodeErrorZ_ok(struct LDKTxCreationKeys o);
14855 * Creates a new CResult_TxCreationKeysDecodeErrorZ in the error state.
14857 struct LDKCResult_TxCreationKeysDecodeErrorZ CResult_TxCreationKeysDecodeErrorZ_err(struct LDKDecodeError e);
14860 * Checks if the given object is currently in the success state
14862 bool CResult_TxCreationKeysDecodeErrorZ_is_ok(const struct LDKCResult_TxCreationKeysDecodeErrorZ *NONNULL_PTR o);
14865 * Frees any resources used by the CResult_TxCreationKeysDecodeErrorZ.
14867 void CResult_TxCreationKeysDecodeErrorZ_free(struct LDKCResult_TxCreationKeysDecodeErrorZ _res);
14870 * Creates a new CResult_TxCreationKeysDecodeErrorZ which has the same data as `orig`
14871 * but with all dynamically-allocated buffers duplicated in new buffers.
14873 struct LDKCResult_TxCreationKeysDecodeErrorZ CResult_TxCreationKeysDecodeErrorZ_clone(const struct LDKCResult_TxCreationKeysDecodeErrorZ *NONNULL_PTR orig);
14876 * Creates a new CResult_ChannelPublicKeysDecodeErrorZ in the success state.
14878 struct LDKCResult_ChannelPublicKeysDecodeErrorZ CResult_ChannelPublicKeysDecodeErrorZ_ok(struct LDKChannelPublicKeys o);
14881 * Creates a new CResult_ChannelPublicKeysDecodeErrorZ in the error state.
14883 struct LDKCResult_ChannelPublicKeysDecodeErrorZ CResult_ChannelPublicKeysDecodeErrorZ_err(struct LDKDecodeError e);
14886 * Checks if the given object is currently in the success state
14888 bool CResult_ChannelPublicKeysDecodeErrorZ_is_ok(const struct LDKCResult_ChannelPublicKeysDecodeErrorZ *NONNULL_PTR o);
14891 * Frees any resources used by the CResult_ChannelPublicKeysDecodeErrorZ.
14893 void CResult_ChannelPublicKeysDecodeErrorZ_free(struct LDKCResult_ChannelPublicKeysDecodeErrorZ _res);
14896 * Creates a new CResult_ChannelPublicKeysDecodeErrorZ which has the same data as `orig`
14897 * but with all dynamically-allocated buffers duplicated in new buffers.
14899 struct LDKCResult_ChannelPublicKeysDecodeErrorZ CResult_ChannelPublicKeysDecodeErrorZ_clone(const struct LDKCResult_ChannelPublicKeysDecodeErrorZ *NONNULL_PTR orig);
14902 * Constructs a new COption_u32Z containing a u32
14904 struct LDKCOption_u32Z COption_u32Z_some(uint32_t o);
14907 * Constructs a new COption_u32Z containing nothing
14909 struct LDKCOption_u32Z COption_u32Z_none(void);
14912 * Frees any resources associated with the u32, if we are in the Some state
14914 void COption_u32Z_free(struct LDKCOption_u32Z _res);
14917 * Creates a new COption_u32Z which has the same data as `orig`
14918 * but with all dynamically-allocated buffers duplicated in new buffers.
14920 struct LDKCOption_u32Z COption_u32Z_clone(const struct LDKCOption_u32Z *NONNULL_PTR orig);
14923 * Creates a new CResult_HTLCOutputInCommitmentDecodeErrorZ in the success state.
14925 struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ CResult_HTLCOutputInCommitmentDecodeErrorZ_ok(struct LDKHTLCOutputInCommitment o);
14928 * Creates a new CResult_HTLCOutputInCommitmentDecodeErrorZ in the error state.
14930 struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ CResult_HTLCOutputInCommitmentDecodeErrorZ_err(struct LDKDecodeError e);
14933 * Checks if the given object is currently in the success state
14935 bool CResult_HTLCOutputInCommitmentDecodeErrorZ_is_ok(const struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ *NONNULL_PTR o);
14938 * Frees any resources used by the CResult_HTLCOutputInCommitmentDecodeErrorZ.
14940 void CResult_HTLCOutputInCommitmentDecodeErrorZ_free(struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ _res);
14943 * Creates a new CResult_HTLCOutputInCommitmentDecodeErrorZ which has the same data as `orig`
14944 * but with all dynamically-allocated buffers duplicated in new buffers.
14946 struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ CResult_HTLCOutputInCommitmentDecodeErrorZ_clone(const struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ *NONNULL_PTR orig);
14949 * Constructs a new COption_NoneZ containing a
14951 enum LDKCOption_NoneZ COption_NoneZ_some(void);
14954 * Constructs a new COption_NoneZ containing nothing
14956 enum LDKCOption_NoneZ COption_NoneZ_none(void);
14959 * Frees any resources associated with the , if we are in the Some state
14961 void COption_NoneZ_free(enum LDKCOption_NoneZ _res);
14964 * Creates a new CResult_CounterpartyChannelTransactionParametersDecodeErrorZ in the success state.
14966 struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_ok(struct LDKCounterpartyChannelTransactionParameters o);
14969 * Creates a new CResult_CounterpartyChannelTransactionParametersDecodeErrorZ in the error state.
14971 struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_err(struct LDKDecodeError e);
14974 * Checks if the given object is currently in the success state
14976 bool CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_is_ok(const struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ *NONNULL_PTR o);
14979 * Frees any resources used by the CResult_CounterpartyChannelTransactionParametersDecodeErrorZ.
14981 void CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_free(struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ _res);
14984 * Creates a new CResult_CounterpartyChannelTransactionParametersDecodeErrorZ which has the same data as `orig`
14985 * but with all dynamically-allocated buffers duplicated in new buffers.
14987 struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_clone(const struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ *NONNULL_PTR orig);
14990 * Creates a new CResult_ChannelTransactionParametersDecodeErrorZ in the success state.
14992 struct LDKCResult_ChannelTransactionParametersDecodeErrorZ CResult_ChannelTransactionParametersDecodeErrorZ_ok(struct LDKChannelTransactionParameters o);
14995 * Creates a new CResult_ChannelTransactionParametersDecodeErrorZ in the error state.
14997 struct LDKCResult_ChannelTransactionParametersDecodeErrorZ CResult_ChannelTransactionParametersDecodeErrorZ_err(struct LDKDecodeError e);
15000 * Checks if the given object is currently in the success state
15002 bool CResult_ChannelTransactionParametersDecodeErrorZ_is_ok(const struct LDKCResult_ChannelTransactionParametersDecodeErrorZ *NONNULL_PTR o);
15005 * Frees any resources used by the CResult_ChannelTransactionParametersDecodeErrorZ.
15007 void CResult_ChannelTransactionParametersDecodeErrorZ_free(struct LDKCResult_ChannelTransactionParametersDecodeErrorZ _res);
15010 * Creates a new CResult_ChannelTransactionParametersDecodeErrorZ which has the same data as `orig`
15011 * but with all dynamically-allocated buffers duplicated in new buffers.
15013 struct LDKCResult_ChannelTransactionParametersDecodeErrorZ CResult_ChannelTransactionParametersDecodeErrorZ_clone(const struct LDKCResult_ChannelTransactionParametersDecodeErrorZ *NONNULL_PTR orig);
15016 * Frees the buffer pointed to by `data` if `datalen` is non-0.
15018 void CVec_SignatureZ_free(struct LDKCVec_SignatureZ _res);
15021 * Creates a new CResult_HolderCommitmentTransactionDecodeErrorZ in the success state.
15023 struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ CResult_HolderCommitmentTransactionDecodeErrorZ_ok(struct LDKHolderCommitmentTransaction o);
15026 * Creates a new CResult_HolderCommitmentTransactionDecodeErrorZ in the error state.
15028 struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ CResult_HolderCommitmentTransactionDecodeErrorZ_err(struct LDKDecodeError e);
15031 * Checks if the given object is currently in the success state
15033 bool CResult_HolderCommitmentTransactionDecodeErrorZ_is_ok(const struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ *NONNULL_PTR o);
15036 * Frees any resources used by the CResult_HolderCommitmentTransactionDecodeErrorZ.
15038 void CResult_HolderCommitmentTransactionDecodeErrorZ_free(struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ _res);
15041 * Creates a new CResult_HolderCommitmentTransactionDecodeErrorZ which has the same data as `orig`
15042 * but with all dynamically-allocated buffers duplicated in new buffers.
15044 struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ CResult_HolderCommitmentTransactionDecodeErrorZ_clone(const struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ *NONNULL_PTR orig);
15047 * Creates a new CResult_BuiltCommitmentTransactionDecodeErrorZ in the success state.
15049 struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ CResult_BuiltCommitmentTransactionDecodeErrorZ_ok(struct LDKBuiltCommitmentTransaction o);
15052 * Creates a new CResult_BuiltCommitmentTransactionDecodeErrorZ in the error state.
15054 struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ CResult_BuiltCommitmentTransactionDecodeErrorZ_err(struct LDKDecodeError e);
15057 * Checks if the given object is currently in the success state
15059 bool CResult_BuiltCommitmentTransactionDecodeErrorZ_is_ok(const struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ *NONNULL_PTR o);
15062 * Frees any resources used by the CResult_BuiltCommitmentTransactionDecodeErrorZ.
15064 void CResult_BuiltCommitmentTransactionDecodeErrorZ_free(struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ _res);
15067 * Creates a new CResult_BuiltCommitmentTransactionDecodeErrorZ which has the same data as `orig`
15068 * but with all dynamically-allocated buffers duplicated in new buffers.
15070 struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ CResult_BuiltCommitmentTransactionDecodeErrorZ_clone(const struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ *NONNULL_PTR orig);
15073 * Creates a new CResult_TrustedClosingTransactionNoneZ in the success state.
15075 struct LDKCResult_TrustedClosingTransactionNoneZ CResult_TrustedClosingTransactionNoneZ_ok(struct LDKTrustedClosingTransaction o);
15078 * Creates a new CResult_TrustedClosingTransactionNoneZ in the error state.
15080 struct LDKCResult_TrustedClosingTransactionNoneZ CResult_TrustedClosingTransactionNoneZ_err(void);
15083 * Checks if the given object is currently in the success state
15085 bool CResult_TrustedClosingTransactionNoneZ_is_ok(const struct LDKCResult_TrustedClosingTransactionNoneZ *NONNULL_PTR o);
15088 * Frees any resources used by the CResult_TrustedClosingTransactionNoneZ.
15090 void CResult_TrustedClosingTransactionNoneZ_free(struct LDKCResult_TrustedClosingTransactionNoneZ _res);
15093 * Creates a new CResult_CommitmentTransactionDecodeErrorZ in the success state.
15095 struct LDKCResult_CommitmentTransactionDecodeErrorZ CResult_CommitmentTransactionDecodeErrorZ_ok(struct LDKCommitmentTransaction o);
15098 * Creates a new CResult_CommitmentTransactionDecodeErrorZ in the error state.
15100 struct LDKCResult_CommitmentTransactionDecodeErrorZ CResult_CommitmentTransactionDecodeErrorZ_err(struct LDKDecodeError e);
15103 * Checks if the given object is currently in the success state
15105 bool CResult_CommitmentTransactionDecodeErrorZ_is_ok(const struct LDKCResult_CommitmentTransactionDecodeErrorZ *NONNULL_PTR o);
15108 * Frees any resources used by the CResult_CommitmentTransactionDecodeErrorZ.
15110 void CResult_CommitmentTransactionDecodeErrorZ_free(struct LDKCResult_CommitmentTransactionDecodeErrorZ _res);
15113 * Creates a new CResult_CommitmentTransactionDecodeErrorZ which has the same data as `orig`
15114 * but with all dynamically-allocated buffers duplicated in new buffers.
15116 struct LDKCResult_CommitmentTransactionDecodeErrorZ CResult_CommitmentTransactionDecodeErrorZ_clone(const struct LDKCResult_CommitmentTransactionDecodeErrorZ *NONNULL_PTR orig);
15119 * Creates a new CResult_TrustedCommitmentTransactionNoneZ in the success state.
15121 struct LDKCResult_TrustedCommitmentTransactionNoneZ CResult_TrustedCommitmentTransactionNoneZ_ok(struct LDKTrustedCommitmentTransaction o);
15124 * Creates a new CResult_TrustedCommitmentTransactionNoneZ in the error state.
15126 struct LDKCResult_TrustedCommitmentTransactionNoneZ CResult_TrustedCommitmentTransactionNoneZ_err(void);
15129 * Checks if the given object is currently in the success state
15131 bool CResult_TrustedCommitmentTransactionNoneZ_is_ok(const struct LDKCResult_TrustedCommitmentTransactionNoneZ *NONNULL_PTR o);
15134 * Frees any resources used by the CResult_TrustedCommitmentTransactionNoneZ.
15136 void CResult_TrustedCommitmentTransactionNoneZ_free(struct LDKCResult_TrustedCommitmentTransactionNoneZ _res);
15139 * Creates a new CResult_CVec_SignatureZNoneZ in the success state.
15141 struct LDKCResult_CVec_SignatureZNoneZ CResult_CVec_SignatureZNoneZ_ok(struct LDKCVec_SignatureZ o);
15144 * Creates a new CResult_CVec_SignatureZNoneZ in the error state.
15146 struct LDKCResult_CVec_SignatureZNoneZ CResult_CVec_SignatureZNoneZ_err(void);
15149 * Checks if the given object is currently in the success state
15151 bool CResult_CVec_SignatureZNoneZ_is_ok(const struct LDKCResult_CVec_SignatureZNoneZ *NONNULL_PTR o);
15154 * Frees any resources used by the CResult_CVec_SignatureZNoneZ.
15156 void CResult_CVec_SignatureZNoneZ_free(struct LDKCResult_CVec_SignatureZNoneZ _res);
15159 * Creates a new CResult_CVec_SignatureZNoneZ which has the same data as `orig`
15160 * but with all dynamically-allocated buffers duplicated in new buffers.
15162 struct LDKCResult_CVec_SignatureZNoneZ CResult_CVec_SignatureZNoneZ_clone(const struct LDKCResult_CVec_SignatureZNoneZ *NONNULL_PTR orig);
15165 * Creates a new CResult_ShutdownScriptDecodeErrorZ in the success state.
15167 struct LDKCResult_ShutdownScriptDecodeErrorZ CResult_ShutdownScriptDecodeErrorZ_ok(struct LDKShutdownScript o);
15170 * Creates a new CResult_ShutdownScriptDecodeErrorZ in the error state.
15172 struct LDKCResult_ShutdownScriptDecodeErrorZ CResult_ShutdownScriptDecodeErrorZ_err(struct LDKDecodeError e);
15175 * Checks if the given object is currently in the success state
15177 bool CResult_ShutdownScriptDecodeErrorZ_is_ok(const struct LDKCResult_ShutdownScriptDecodeErrorZ *NONNULL_PTR o);
15180 * Frees any resources used by the CResult_ShutdownScriptDecodeErrorZ.
15182 void CResult_ShutdownScriptDecodeErrorZ_free(struct LDKCResult_ShutdownScriptDecodeErrorZ _res);
15185 * Creates a new CResult_ShutdownScriptDecodeErrorZ which has the same data as `orig`
15186 * but with all dynamically-allocated buffers duplicated in new buffers.
15188 struct LDKCResult_ShutdownScriptDecodeErrorZ CResult_ShutdownScriptDecodeErrorZ_clone(const struct LDKCResult_ShutdownScriptDecodeErrorZ *NONNULL_PTR orig);
15191 * Creates a new CResult_ShutdownScriptInvalidShutdownScriptZ in the success state.
15193 struct LDKCResult_ShutdownScriptInvalidShutdownScriptZ CResult_ShutdownScriptInvalidShutdownScriptZ_ok(struct LDKShutdownScript o);
15196 * Creates a new CResult_ShutdownScriptInvalidShutdownScriptZ in the error state.
15198 struct LDKCResult_ShutdownScriptInvalidShutdownScriptZ CResult_ShutdownScriptInvalidShutdownScriptZ_err(struct LDKInvalidShutdownScript e);
15201 * Checks if the given object is currently in the success state
15203 bool CResult_ShutdownScriptInvalidShutdownScriptZ_is_ok(const struct LDKCResult_ShutdownScriptInvalidShutdownScriptZ *NONNULL_PTR o);
15206 * Frees any resources used by the CResult_ShutdownScriptInvalidShutdownScriptZ.
15208 void CResult_ShutdownScriptInvalidShutdownScriptZ_free(struct LDKCResult_ShutdownScriptInvalidShutdownScriptZ _res);
15211 * Creates a new CResult_ShutdownScriptInvalidShutdownScriptZ which has the same data as `orig`
15212 * but with all dynamically-allocated buffers duplicated in new buffers.
15214 struct LDKCResult_ShutdownScriptInvalidShutdownScriptZ CResult_ShutdownScriptInvalidShutdownScriptZ_clone(const struct LDKCResult_ShutdownScriptInvalidShutdownScriptZ *NONNULL_PTR orig);
15217 * Frees the buffer pointed to by `data` if `datalen` is non-0.
15219 void CVec_PublicKeyZ_free(struct LDKCVec_PublicKeyZ _res);
15222 * Creates a new CResult_BlindedPathNoneZ in the success state.
15224 struct LDKCResult_BlindedPathNoneZ CResult_BlindedPathNoneZ_ok(struct LDKBlindedPath o);
15227 * Creates a new CResult_BlindedPathNoneZ in the error state.
15229 struct LDKCResult_BlindedPathNoneZ CResult_BlindedPathNoneZ_err(void);
15232 * Checks if the given object is currently in the success state
15234 bool CResult_BlindedPathNoneZ_is_ok(const struct LDKCResult_BlindedPathNoneZ *NONNULL_PTR o);
15237 * Frees any resources used by the CResult_BlindedPathNoneZ.
15239 void CResult_BlindedPathNoneZ_free(struct LDKCResult_BlindedPathNoneZ _res);
15242 * Creates a new CResult_BlindedPathNoneZ which has the same data as `orig`
15243 * but with all dynamically-allocated buffers duplicated in new buffers.
15245 struct LDKCResult_BlindedPathNoneZ CResult_BlindedPathNoneZ_clone(const struct LDKCResult_BlindedPathNoneZ *NONNULL_PTR orig);
15248 * Creates a new CResult_BlindedPathDecodeErrorZ in the success state.
15250 struct LDKCResult_BlindedPathDecodeErrorZ CResult_BlindedPathDecodeErrorZ_ok(struct LDKBlindedPath o);
15253 * Creates a new CResult_BlindedPathDecodeErrorZ in the error state.
15255 struct LDKCResult_BlindedPathDecodeErrorZ CResult_BlindedPathDecodeErrorZ_err(struct LDKDecodeError e);
15258 * Checks if the given object is currently in the success state
15260 bool CResult_BlindedPathDecodeErrorZ_is_ok(const struct LDKCResult_BlindedPathDecodeErrorZ *NONNULL_PTR o);
15263 * Frees any resources used by the CResult_BlindedPathDecodeErrorZ.
15265 void CResult_BlindedPathDecodeErrorZ_free(struct LDKCResult_BlindedPathDecodeErrorZ _res);
15268 * Creates a new CResult_BlindedPathDecodeErrorZ which has the same data as `orig`
15269 * but with all dynamically-allocated buffers duplicated in new buffers.
15271 struct LDKCResult_BlindedPathDecodeErrorZ CResult_BlindedPathDecodeErrorZ_clone(const struct LDKCResult_BlindedPathDecodeErrorZ *NONNULL_PTR orig);
15274 * Creates a new CResult_BlindedHopDecodeErrorZ in the success state.
15276 struct LDKCResult_BlindedHopDecodeErrorZ CResult_BlindedHopDecodeErrorZ_ok(struct LDKBlindedHop o);
15279 * Creates a new CResult_BlindedHopDecodeErrorZ in the error state.
15281 struct LDKCResult_BlindedHopDecodeErrorZ CResult_BlindedHopDecodeErrorZ_err(struct LDKDecodeError e);
15284 * Checks if the given object is currently in the success state
15286 bool CResult_BlindedHopDecodeErrorZ_is_ok(const struct LDKCResult_BlindedHopDecodeErrorZ *NONNULL_PTR o);
15289 * Frees any resources used by the CResult_BlindedHopDecodeErrorZ.
15291 void CResult_BlindedHopDecodeErrorZ_free(struct LDKCResult_BlindedHopDecodeErrorZ _res);
15294 * Creates a new CResult_BlindedHopDecodeErrorZ which has the same data as `orig`
15295 * but with all dynamically-allocated buffers duplicated in new buffers.
15297 struct LDKCResult_BlindedHopDecodeErrorZ CResult_BlindedHopDecodeErrorZ_clone(const struct LDKCResult_BlindedHopDecodeErrorZ *NONNULL_PTR orig);
15300 * Constructs a new COption_WriteableScoreZ containing a crate::lightning::routing::scoring::WriteableScore
15302 struct LDKCOption_WriteableScoreZ COption_WriteableScoreZ_some(struct LDKWriteableScore o);
15305 * Constructs a new COption_WriteableScoreZ containing nothing
15307 struct LDKCOption_WriteableScoreZ COption_WriteableScoreZ_none(void);
15310 * Frees any resources associated with the crate::lightning::routing::scoring::WriteableScore, if we are in the Some state
15312 void COption_WriteableScoreZ_free(struct LDKCOption_WriteableScoreZ _res);
15315 * Creates a new CResult_NoneErrorZ in the success state.
15317 struct LDKCResult_NoneErrorZ CResult_NoneErrorZ_ok(void);
15320 * Creates a new CResult_NoneErrorZ in the error state.
15322 struct LDKCResult_NoneErrorZ CResult_NoneErrorZ_err(enum LDKIOError e);
15325 * Checks if the given object is currently in the success state
15327 bool CResult_NoneErrorZ_is_ok(const struct LDKCResult_NoneErrorZ *NONNULL_PTR o);
15330 * Frees any resources used by the CResult_NoneErrorZ.
15332 void CResult_NoneErrorZ_free(struct LDKCResult_NoneErrorZ _res);
15335 * Creates a new CResult_NoneErrorZ which has the same data as `orig`
15336 * but with all dynamically-allocated buffers duplicated in new buffers.
15338 struct LDKCResult_NoneErrorZ CResult_NoneErrorZ_clone(const struct LDKCResult_NoneErrorZ *NONNULL_PTR orig);
15341 * Frees the buffer pointed to by `data` if `datalen` is non-0.
15343 void CVec_ChannelDetailsZ_free(struct LDKCVec_ChannelDetailsZ _res);
15346 * Creates a new CResult_RouteLightningErrorZ in the success state.
15348 struct LDKCResult_RouteLightningErrorZ CResult_RouteLightningErrorZ_ok(struct LDKRoute o);
15351 * Creates a new CResult_RouteLightningErrorZ in the error state.
15353 struct LDKCResult_RouteLightningErrorZ CResult_RouteLightningErrorZ_err(struct LDKLightningError e);
15356 * Checks if the given object is currently in the success state
15358 bool CResult_RouteLightningErrorZ_is_ok(const struct LDKCResult_RouteLightningErrorZ *NONNULL_PTR o);
15361 * Frees any resources used by the CResult_RouteLightningErrorZ.
15363 void CResult_RouteLightningErrorZ_free(struct LDKCResult_RouteLightningErrorZ _res);
15366 * Creates a new CResult_RouteLightningErrorZ which has the same data as `orig`
15367 * but with all dynamically-allocated buffers duplicated in new buffers.
15369 struct LDKCResult_RouteLightningErrorZ CResult_RouteLightningErrorZ_clone(const struct LDKCResult_RouteLightningErrorZ *NONNULL_PTR orig);
15372 * Frees the buffer pointed to by `data` if `datalen` is non-0.
15374 void CVec_RouteHopZ_free(struct LDKCVec_RouteHopZ _res);
15377 * Constructs a new COption_u64Z containing a u64
15379 struct LDKCOption_u64Z COption_u64Z_some(uint64_t o);
15382 * Constructs a new COption_u64Z containing nothing
15384 struct LDKCOption_u64Z COption_u64Z_none(void);
15387 * Frees any resources associated with the u64, if we are in the Some state
15389 void COption_u64Z_free(struct LDKCOption_u64Z _res);
15392 * Creates a new COption_u64Z which has the same data as `orig`
15393 * but with all dynamically-allocated buffers duplicated in new buffers.
15395 struct LDKCOption_u64Z COption_u64Z_clone(const struct LDKCOption_u64Z *NONNULL_PTR orig);
15398 * Creates a new CResult_InFlightHtlcsDecodeErrorZ in the success state.
15400 struct LDKCResult_InFlightHtlcsDecodeErrorZ CResult_InFlightHtlcsDecodeErrorZ_ok(struct LDKInFlightHtlcs o);
15403 * Creates a new CResult_InFlightHtlcsDecodeErrorZ in the error state.
15405 struct LDKCResult_InFlightHtlcsDecodeErrorZ CResult_InFlightHtlcsDecodeErrorZ_err(struct LDKDecodeError e);
15408 * Checks if the given object is currently in the success state
15410 bool CResult_InFlightHtlcsDecodeErrorZ_is_ok(const struct LDKCResult_InFlightHtlcsDecodeErrorZ *NONNULL_PTR o);
15413 * Frees any resources used by the CResult_InFlightHtlcsDecodeErrorZ.
15415 void CResult_InFlightHtlcsDecodeErrorZ_free(struct LDKCResult_InFlightHtlcsDecodeErrorZ _res);
15418 * Creates a new CResult_InFlightHtlcsDecodeErrorZ which has the same data as `orig`
15419 * but with all dynamically-allocated buffers duplicated in new buffers.
15421 struct LDKCResult_InFlightHtlcsDecodeErrorZ CResult_InFlightHtlcsDecodeErrorZ_clone(const struct LDKCResult_InFlightHtlcsDecodeErrorZ *NONNULL_PTR orig);
15424 * Creates a new CResult_RouteHopDecodeErrorZ in the success state.
15426 struct LDKCResult_RouteHopDecodeErrorZ CResult_RouteHopDecodeErrorZ_ok(struct LDKRouteHop o);
15429 * Creates a new CResult_RouteHopDecodeErrorZ in the error state.
15431 struct LDKCResult_RouteHopDecodeErrorZ CResult_RouteHopDecodeErrorZ_err(struct LDKDecodeError e);
15434 * Checks if the given object is currently in the success state
15436 bool CResult_RouteHopDecodeErrorZ_is_ok(const struct LDKCResult_RouteHopDecodeErrorZ *NONNULL_PTR o);
15439 * Frees any resources used by the CResult_RouteHopDecodeErrorZ.
15441 void CResult_RouteHopDecodeErrorZ_free(struct LDKCResult_RouteHopDecodeErrorZ _res);
15444 * Creates a new CResult_RouteHopDecodeErrorZ which has the same data as `orig`
15445 * but with all dynamically-allocated buffers duplicated in new buffers.
15447 struct LDKCResult_RouteHopDecodeErrorZ CResult_RouteHopDecodeErrorZ_clone(const struct LDKCResult_RouteHopDecodeErrorZ *NONNULL_PTR orig);
15450 * Frees the buffer pointed to by `data` if `datalen` is non-0.
15452 void CVec_CVec_RouteHopZZ_free(struct LDKCVec_CVec_RouteHopZZ _res);
15455 * Creates a new CResult_RouteDecodeErrorZ in the success state.
15457 struct LDKCResult_RouteDecodeErrorZ CResult_RouteDecodeErrorZ_ok(struct LDKRoute o);
15460 * Creates a new CResult_RouteDecodeErrorZ in the error state.
15462 struct LDKCResult_RouteDecodeErrorZ CResult_RouteDecodeErrorZ_err(struct LDKDecodeError e);
15465 * Checks if the given object is currently in the success state
15467 bool CResult_RouteDecodeErrorZ_is_ok(const struct LDKCResult_RouteDecodeErrorZ *NONNULL_PTR o);
15470 * Frees any resources used by the CResult_RouteDecodeErrorZ.
15472 void CResult_RouteDecodeErrorZ_free(struct LDKCResult_RouteDecodeErrorZ _res);
15475 * Creates a new CResult_RouteDecodeErrorZ which has the same data as `orig`
15476 * but with all dynamically-allocated buffers duplicated in new buffers.
15478 struct LDKCResult_RouteDecodeErrorZ CResult_RouteDecodeErrorZ_clone(const struct LDKCResult_RouteDecodeErrorZ *NONNULL_PTR orig);
15481 * Creates a new CResult_RouteParametersDecodeErrorZ in the success state.
15483 struct LDKCResult_RouteParametersDecodeErrorZ CResult_RouteParametersDecodeErrorZ_ok(struct LDKRouteParameters o);
15486 * Creates a new CResult_RouteParametersDecodeErrorZ in the error state.
15488 struct LDKCResult_RouteParametersDecodeErrorZ CResult_RouteParametersDecodeErrorZ_err(struct LDKDecodeError e);
15491 * Checks if the given object is currently in the success state
15493 bool CResult_RouteParametersDecodeErrorZ_is_ok(const struct LDKCResult_RouteParametersDecodeErrorZ *NONNULL_PTR o);
15496 * Frees any resources used by the CResult_RouteParametersDecodeErrorZ.
15498 void CResult_RouteParametersDecodeErrorZ_free(struct LDKCResult_RouteParametersDecodeErrorZ _res);
15501 * Creates a new CResult_RouteParametersDecodeErrorZ which has the same data as `orig`
15502 * but with all dynamically-allocated buffers duplicated in new buffers.
15504 struct LDKCResult_RouteParametersDecodeErrorZ CResult_RouteParametersDecodeErrorZ_clone(const struct LDKCResult_RouteParametersDecodeErrorZ *NONNULL_PTR orig);
15507 * Frees the buffer pointed to by `data` if `datalen` is non-0.
15509 void CVec_RouteHintZ_free(struct LDKCVec_RouteHintZ _res);
15512 * Frees the buffer pointed to by `data` if `datalen` is non-0.
15514 void CVec_u64Z_free(struct LDKCVec_u64Z _res);
15517 * Creates a new CResult_PaymentParametersDecodeErrorZ in the success state.
15519 struct LDKCResult_PaymentParametersDecodeErrorZ CResult_PaymentParametersDecodeErrorZ_ok(struct LDKPaymentParameters o);
15522 * Creates a new CResult_PaymentParametersDecodeErrorZ in the error state.
15524 struct LDKCResult_PaymentParametersDecodeErrorZ CResult_PaymentParametersDecodeErrorZ_err(struct LDKDecodeError e);
15527 * Checks if the given object is currently in the success state
15529 bool CResult_PaymentParametersDecodeErrorZ_is_ok(const struct LDKCResult_PaymentParametersDecodeErrorZ *NONNULL_PTR o);
15532 * Frees any resources used by the CResult_PaymentParametersDecodeErrorZ.
15534 void CResult_PaymentParametersDecodeErrorZ_free(struct LDKCResult_PaymentParametersDecodeErrorZ _res);
15537 * Creates a new CResult_PaymentParametersDecodeErrorZ which has the same data as `orig`
15538 * but with all dynamically-allocated buffers duplicated in new buffers.
15540 struct LDKCResult_PaymentParametersDecodeErrorZ CResult_PaymentParametersDecodeErrorZ_clone(const struct LDKCResult_PaymentParametersDecodeErrorZ *NONNULL_PTR orig);
15543 * Frees the buffer pointed to by `data` if `datalen` is non-0.
15545 void CVec_RouteHintHopZ_free(struct LDKCVec_RouteHintHopZ _res);
15548 * Creates a new CResult_RouteHintDecodeErrorZ in the success state.
15550 struct LDKCResult_RouteHintDecodeErrorZ CResult_RouteHintDecodeErrorZ_ok(struct LDKRouteHint o);
15553 * Creates a new CResult_RouteHintDecodeErrorZ in the error state.
15555 struct LDKCResult_RouteHintDecodeErrorZ CResult_RouteHintDecodeErrorZ_err(struct LDKDecodeError e);
15558 * Checks if the given object is currently in the success state
15560 bool CResult_RouteHintDecodeErrorZ_is_ok(const struct LDKCResult_RouteHintDecodeErrorZ *NONNULL_PTR o);
15563 * Frees any resources used by the CResult_RouteHintDecodeErrorZ.
15565 void CResult_RouteHintDecodeErrorZ_free(struct LDKCResult_RouteHintDecodeErrorZ _res);
15568 * Creates a new CResult_RouteHintDecodeErrorZ which has the same data as `orig`
15569 * but with all dynamically-allocated buffers duplicated in new buffers.
15571 struct LDKCResult_RouteHintDecodeErrorZ CResult_RouteHintDecodeErrorZ_clone(const struct LDKCResult_RouteHintDecodeErrorZ *NONNULL_PTR orig);
15574 * Creates a new CResult_RouteHintHopDecodeErrorZ in the success state.
15576 struct LDKCResult_RouteHintHopDecodeErrorZ CResult_RouteHintHopDecodeErrorZ_ok(struct LDKRouteHintHop o);
15579 * Creates a new CResult_RouteHintHopDecodeErrorZ in the error state.
15581 struct LDKCResult_RouteHintHopDecodeErrorZ CResult_RouteHintHopDecodeErrorZ_err(struct LDKDecodeError e);
15584 * Checks if the given object is currently in the success state
15586 bool CResult_RouteHintHopDecodeErrorZ_is_ok(const struct LDKCResult_RouteHintHopDecodeErrorZ *NONNULL_PTR o);
15589 * Frees any resources used by the CResult_RouteHintHopDecodeErrorZ.
15591 void CResult_RouteHintHopDecodeErrorZ_free(struct LDKCResult_RouteHintHopDecodeErrorZ _res);
15594 * Creates a new CResult_RouteHintHopDecodeErrorZ which has the same data as `orig`
15595 * but with all dynamically-allocated buffers duplicated in new buffers.
15597 struct LDKCResult_RouteHintHopDecodeErrorZ CResult_RouteHintHopDecodeErrorZ_clone(const struct LDKCResult_RouteHintHopDecodeErrorZ *NONNULL_PTR orig);
15600 * Creates a new CResult_PaymentPurposeDecodeErrorZ in the success state.
15602 struct LDKCResult_PaymentPurposeDecodeErrorZ CResult_PaymentPurposeDecodeErrorZ_ok(struct LDKPaymentPurpose o);
15605 * Creates a new CResult_PaymentPurposeDecodeErrorZ in the error state.
15607 struct LDKCResult_PaymentPurposeDecodeErrorZ CResult_PaymentPurposeDecodeErrorZ_err(struct LDKDecodeError e);
15610 * Checks if the given object is currently in the success state
15612 bool CResult_PaymentPurposeDecodeErrorZ_is_ok(const struct LDKCResult_PaymentPurposeDecodeErrorZ *NONNULL_PTR o);
15615 * Frees any resources used by the CResult_PaymentPurposeDecodeErrorZ.
15617 void CResult_PaymentPurposeDecodeErrorZ_free(struct LDKCResult_PaymentPurposeDecodeErrorZ _res);
15620 * Creates a new CResult_PaymentPurposeDecodeErrorZ which has the same data as `orig`
15621 * but with all dynamically-allocated buffers duplicated in new buffers.
15623 struct LDKCResult_PaymentPurposeDecodeErrorZ CResult_PaymentPurposeDecodeErrorZ_clone(const struct LDKCResult_PaymentPurposeDecodeErrorZ *NONNULL_PTR orig);
15626 * Constructs a new COption_ClosureReasonZ containing a crate::lightning::util::events::ClosureReason
15628 struct LDKCOption_ClosureReasonZ COption_ClosureReasonZ_some(struct LDKClosureReason o);
15631 * Constructs a new COption_ClosureReasonZ containing nothing
15633 struct LDKCOption_ClosureReasonZ COption_ClosureReasonZ_none(void);
15636 * Frees any resources associated with the crate::lightning::util::events::ClosureReason, if we are in the Some state
15638 void COption_ClosureReasonZ_free(struct LDKCOption_ClosureReasonZ _res);
15641 * Creates a new COption_ClosureReasonZ which has the same data as `orig`
15642 * but with all dynamically-allocated buffers duplicated in new buffers.
15644 struct LDKCOption_ClosureReasonZ COption_ClosureReasonZ_clone(const struct LDKCOption_ClosureReasonZ *NONNULL_PTR orig);
15647 * Creates a new CResult_COption_ClosureReasonZDecodeErrorZ in the success state.
15649 struct LDKCResult_COption_ClosureReasonZDecodeErrorZ CResult_COption_ClosureReasonZDecodeErrorZ_ok(struct LDKCOption_ClosureReasonZ o);
15652 * Creates a new CResult_COption_ClosureReasonZDecodeErrorZ in the error state.
15654 struct LDKCResult_COption_ClosureReasonZDecodeErrorZ CResult_COption_ClosureReasonZDecodeErrorZ_err(struct LDKDecodeError e);
15657 * Checks if the given object is currently in the success state
15659 bool CResult_COption_ClosureReasonZDecodeErrorZ_is_ok(const struct LDKCResult_COption_ClosureReasonZDecodeErrorZ *NONNULL_PTR o);
15662 * Frees any resources used by the CResult_COption_ClosureReasonZDecodeErrorZ.
15664 void CResult_COption_ClosureReasonZDecodeErrorZ_free(struct LDKCResult_COption_ClosureReasonZDecodeErrorZ _res);
15667 * Creates a new CResult_COption_ClosureReasonZDecodeErrorZ which has the same data as `orig`
15668 * but with all dynamically-allocated buffers duplicated in new buffers.
15670 struct LDKCResult_COption_ClosureReasonZDecodeErrorZ CResult_COption_ClosureReasonZDecodeErrorZ_clone(const struct LDKCResult_COption_ClosureReasonZDecodeErrorZ *NONNULL_PTR orig);
15673 * Constructs a new COption_HTLCDestinationZ containing a crate::lightning::util::events::HTLCDestination
15675 struct LDKCOption_HTLCDestinationZ COption_HTLCDestinationZ_some(struct LDKHTLCDestination o);
15678 * Constructs a new COption_HTLCDestinationZ containing nothing
15680 struct LDKCOption_HTLCDestinationZ COption_HTLCDestinationZ_none(void);
15683 * Frees any resources associated with the crate::lightning::util::events::HTLCDestination, if we are in the Some state
15685 void COption_HTLCDestinationZ_free(struct LDKCOption_HTLCDestinationZ _res);
15688 * Creates a new COption_HTLCDestinationZ which has the same data as `orig`
15689 * but with all dynamically-allocated buffers duplicated in new buffers.
15691 struct LDKCOption_HTLCDestinationZ COption_HTLCDestinationZ_clone(const struct LDKCOption_HTLCDestinationZ *NONNULL_PTR orig);
15694 * Creates a new CResult_COption_HTLCDestinationZDecodeErrorZ in the success state.
15696 struct LDKCResult_COption_HTLCDestinationZDecodeErrorZ CResult_COption_HTLCDestinationZDecodeErrorZ_ok(struct LDKCOption_HTLCDestinationZ o);
15699 * Creates a new CResult_COption_HTLCDestinationZDecodeErrorZ in the error state.
15701 struct LDKCResult_COption_HTLCDestinationZDecodeErrorZ CResult_COption_HTLCDestinationZDecodeErrorZ_err(struct LDKDecodeError e);
15704 * Checks if the given object is currently in the success state
15706 bool CResult_COption_HTLCDestinationZDecodeErrorZ_is_ok(const struct LDKCResult_COption_HTLCDestinationZDecodeErrorZ *NONNULL_PTR o);
15709 * Frees any resources used by the CResult_COption_HTLCDestinationZDecodeErrorZ.
15711 void CResult_COption_HTLCDestinationZDecodeErrorZ_free(struct LDKCResult_COption_HTLCDestinationZDecodeErrorZ _res);
15714 * Creates a new CResult_COption_HTLCDestinationZDecodeErrorZ which has the same data as `orig`
15715 * but with all dynamically-allocated buffers duplicated in new buffers.
15717 struct LDKCResult_COption_HTLCDestinationZDecodeErrorZ CResult_COption_HTLCDestinationZDecodeErrorZ_clone(const struct LDKCResult_COption_HTLCDestinationZDecodeErrorZ *NONNULL_PTR orig);
15720 * Constructs a new COption_u128Z containing a crate::c_types::U128
15722 struct LDKCOption_u128Z COption_u128Z_some(struct LDKU128 o);
15725 * Constructs a new COption_u128Z containing nothing
15727 struct LDKCOption_u128Z COption_u128Z_none(void);
15730 * Frees any resources associated with the crate::c_types::U128, if we are in the Some state
15732 void COption_u128Z_free(struct LDKCOption_u128Z _res);
15735 * Creates a new COption_u128Z which has the same data as `orig`
15736 * but with all dynamically-allocated buffers duplicated in new buffers.
15738 struct LDKCOption_u128Z COption_u128Z_clone(const struct LDKCOption_u128Z *NONNULL_PTR orig);
15741 * Constructs a new COption_NetworkUpdateZ containing a crate::lightning::routing::gossip::NetworkUpdate
15743 struct LDKCOption_NetworkUpdateZ COption_NetworkUpdateZ_some(struct LDKNetworkUpdate o);
15746 * Constructs a new COption_NetworkUpdateZ containing nothing
15748 struct LDKCOption_NetworkUpdateZ COption_NetworkUpdateZ_none(void);
15751 * Frees any resources associated with the crate::lightning::routing::gossip::NetworkUpdate, if we are in the Some state
15753 void COption_NetworkUpdateZ_free(struct LDKCOption_NetworkUpdateZ _res);
15756 * Creates a new COption_NetworkUpdateZ which has the same data as `orig`
15757 * but with all dynamically-allocated buffers duplicated in new buffers.
15759 struct LDKCOption_NetworkUpdateZ COption_NetworkUpdateZ_clone(const struct LDKCOption_NetworkUpdateZ *NONNULL_PTR orig);
15762 * Frees the buffer pointed to by `data` if `datalen` is non-0.
15764 void CVec_SpendableOutputDescriptorZ_free(struct LDKCVec_SpendableOutputDescriptorZ _res);
15767 * Constructs a new COption_EventZ containing a crate::lightning::util::events::Event
15769 struct LDKCOption_EventZ COption_EventZ_some(struct LDKEvent o);
15772 * Constructs a new COption_EventZ containing nothing
15774 struct LDKCOption_EventZ COption_EventZ_none(void);
15777 * Frees any resources associated with the crate::lightning::util::events::Event, if we are in the Some state
15779 void COption_EventZ_free(struct LDKCOption_EventZ _res);
15782 * Creates a new COption_EventZ which has the same data as `orig`
15783 * but with all dynamically-allocated buffers duplicated in new buffers.
15785 struct LDKCOption_EventZ COption_EventZ_clone(const struct LDKCOption_EventZ *NONNULL_PTR orig);
15788 * Creates a new CResult_COption_EventZDecodeErrorZ in the success state.
15790 struct LDKCResult_COption_EventZDecodeErrorZ CResult_COption_EventZDecodeErrorZ_ok(struct LDKCOption_EventZ o);
15793 * Creates a new CResult_COption_EventZDecodeErrorZ in the error state.
15795 struct LDKCResult_COption_EventZDecodeErrorZ CResult_COption_EventZDecodeErrorZ_err(struct LDKDecodeError e);
15798 * Checks if the given object is currently in the success state
15800 bool CResult_COption_EventZDecodeErrorZ_is_ok(const struct LDKCResult_COption_EventZDecodeErrorZ *NONNULL_PTR o);
15803 * Frees any resources used by the CResult_COption_EventZDecodeErrorZ.
15805 void CResult_COption_EventZDecodeErrorZ_free(struct LDKCResult_COption_EventZDecodeErrorZ _res);
15808 * Creates a new CResult_COption_EventZDecodeErrorZ which has the same data as `orig`
15809 * but with all dynamically-allocated buffers duplicated in new buffers.
15811 struct LDKCResult_COption_EventZDecodeErrorZ CResult_COption_EventZDecodeErrorZ_clone(const struct LDKCResult_COption_EventZDecodeErrorZ *NONNULL_PTR orig);
15814 * Frees the buffer pointed to by `data` if `datalen` is non-0.
15816 void CVec_MessageSendEventZ_free(struct LDKCVec_MessageSendEventZ _res);
15819 * Creates a new CResult_TxOutAccessErrorZ in the success state.
15821 struct LDKCResult_TxOutAccessErrorZ CResult_TxOutAccessErrorZ_ok(struct LDKTxOut o);
15824 * Creates a new CResult_TxOutAccessErrorZ in the error state.
15826 struct LDKCResult_TxOutAccessErrorZ CResult_TxOutAccessErrorZ_err(enum LDKAccessError e);
15829 * Checks if the given object is currently in the success state
15831 bool CResult_TxOutAccessErrorZ_is_ok(const struct LDKCResult_TxOutAccessErrorZ *NONNULL_PTR o);
15834 * Frees any resources used by the CResult_TxOutAccessErrorZ.
15836 void CResult_TxOutAccessErrorZ_free(struct LDKCResult_TxOutAccessErrorZ _res);
15839 * Creates a new CResult_TxOutAccessErrorZ which has the same data as `orig`
15840 * but with all dynamically-allocated buffers duplicated in new buffers.
15842 struct LDKCResult_TxOutAccessErrorZ CResult_TxOutAccessErrorZ_clone(const struct LDKCResult_TxOutAccessErrorZ *NONNULL_PTR orig);
15845 * Creates a new tuple which has the same data as `orig`
15846 * but with all dynamically-allocated buffers duplicated in new buffers.
15848 struct LDKC2Tuple_usizeTransactionZ C2Tuple_usizeTransactionZ_clone(const struct LDKC2Tuple_usizeTransactionZ *NONNULL_PTR orig);
15851 * Creates a new C2Tuple_usizeTransactionZ from the contained elements.
15853 struct LDKC2Tuple_usizeTransactionZ C2Tuple_usizeTransactionZ_new(uintptr_t a, struct LDKTransaction b);
15856 * Frees any resources used by the C2Tuple_usizeTransactionZ.
15858 void C2Tuple_usizeTransactionZ_free(struct LDKC2Tuple_usizeTransactionZ _res);
15861 * Frees the buffer pointed to by `data` if `datalen` is non-0.
15863 void CVec_C2Tuple_usizeTransactionZZ_free(struct LDKCVec_C2Tuple_usizeTransactionZZ _res);
15866 * Creates a new tuple which has the same data as `orig`
15867 * but with all dynamically-allocated buffers duplicated in new buffers.
15869 struct LDKC2Tuple_TxidBlockHashZ C2Tuple_TxidBlockHashZ_clone(const struct LDKC2Tuple_TxidBlockHashZ *NONNULL_PTR orig);
15872 * Creates a new C2Tuple_TxidBlockHashZ from the contained elements.
15874 struct LDKC2Tuple_TxidBlockHashZ C2Tuple_TxidBlockHashZ_new(struct LDKThirtyTwoBytes a, struct LDKThirtyTwoBytes b);
15877 * Frees any resources used by the C2Tuple_TxidBlockHashZ.
15879 void C2Tuple_TxidBlockHashZ_free(struct LDKC2Tuple_TxidBlockHashZ _res);
15882 * Frees the buffer pointed to by `data` if `datalen` is non-0.
15884 void CVec_C2Tuple_TxidBlockHashZZ_free(struct LDKCVec_C2Tuple_TxidBlockHashZZ _res);
15887 * Frees the buffer pointed to by `data` if `datalen` is non-0.
15889 void CVec_MonitorEventZ_free(struct LDKCVec_MonitorEventZ _res);
15892 * Creates a new tuple which has the same data as `orig`
15893 * but with all dynamically-allocated buffers duplicated in new buffers.
15895 struct LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_clone(const struct LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ *NONNULL_PTR orig);
15898 * Creates a new C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ from the contained elements.
15900 struct LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_new(struct LDKOutPoint a, struct LDKCVec_MonitorEventZ b, struct LDKPublicKey c);
15903 * Frees any resources used by the C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ.
15905 void C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_free(struct LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ _res);
15908 * Frees the buffer pointed to by `data` if `datalen` is non-0.
15910 void CVec_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZZ_free(struct LDKCVec_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZZ _res);
15913 * Creates a new CResult_FixedPenaltyScorerDecodeErrorZ in the success state.
15915 struct LDKCResult_FixedPenaltyScorerDecodeErrorZ CResult_FixedPenaltyScorerDecodeErrorZ_ok(struct LDKFixedPenaltyScorer o);
15918 * Creates a new CResult_FixedPenaltyScorerDecodeErrorZ in the error state.
15920 struct LDKCResult_FixedPenaltyScorerDecodeErrorZ CResult_FixedPenaltyScorerDecodeErrorZ_err(struct LDKDecodeError e);
15923 * Checks if the given object is currently in the success state
15925 bool CResult_FixedPenaltyScorerDecodeErrorZ_is_ok(const struct LDKCResult_FixedPenaltyScorerDecodeErrorZ *NONNULL_PTR o);
15928 * Frees any resources used by the CResult_FixedPenaltyScorerDecodeErrorZ.
15930 void CResult_FixedPenaltyScorerDecodeErrorZ_free(struct LDKCResult_FixedPenaltyScorerDecodeErrorZ _res);
15933 * Creates a new CResult_FixedPenaltyScorerDecodeErrorZ which has the same data as `orig`
15934 * but with all dynamically-allocated buffers duplicated in new buffers.
15936 struct LDKCResult_FixedPenaltyScorerDecodeErrorZ CResult_FixedPenaltyScorerDecodeErrorZ_clone(const struct LDKCResult_FixedPenaltyScorerDecodeErrorZ *NONNULL_PTR orig);
15939 * Creates a new tuple which has the same data as `orig`
15940 * but with all dynamically-allocated buffers duplicated in new buffers.
15942 struct LDKC2Tuple_u64u64Z C2Tuple_u64u64Z_clone(const struct LDKC2Tuple_u64u64Z *NONNULL_PTR orig);
15945 * Creates a new C2Tuple_u64u64Z from the contained elements.
15947 struct LDKC2Tuple_u64u64Z C2Tuple_u64u64Z_new(uint64_t a, uint64_t b);
15950 * Frees any resources used by the C2Tuple_u64u64Z.
15952 void C2Tuple_u64u64Z_free(struct LDKC2Tuple_u64u64Z _res);
15955 * Constructs a new COption_C2Tuple_u64u64ZZ containing a crate::c_types::derived::C2Tuple_u64u64Z
15957 struct LDKCOption_C2Tuple_u64u64ZZ COption_C2Tuple_u64u64ZZ_some(struct LDKC2Tuple_u64u64Z o);
15960 * Constructs a new COption_C2Tuple_u64u64ZZ containing nothing
15962 struct LDKCOption_C2Tuple_u64u64ZZ COption_C2Tuple_u64u64ZZ_none(void);
15965 * Frees any resources associated with the crate::c_types::derived::C2Tuple_u64u64Z, if we are in the Some state
15967 void COption_C2Tuple_u64u64ZZ_free(struct LDKCOption_C2Tuple_u64u64ZZ _res);
15970 * Creates a new COption_C2Tuple_u64u64ZZ which has the same data as `orig`
15971 * but with all dynamically-allocated buffers duplicated in new buffers.
15973 struct LDKCOption_C2Tuple_u64u64ZZ COption_C2Tuple_u64u64ZZ_clone(const struct LDKCOption_C2Tuple_u64u64ZZ *NONNULL_PTR orig);
15976 * Frees the buffer pointed to by `data` if `datalen` is non-0.
15978 void CVec_NodeIdZ_free(struct LDKCVec_NodeIdZ _res);
15981 * Creates a new CResult_ProbabilisticScorerDecodeErrorZ in the success state.
15983 struct LDKCResult_ProbabilisticScorerDecodeErrorZ CResult_ProbabilisticScorerDecodeErrorZ_ok(struct LDKProbabilisticScorer o);
15986 * Creates a new CResult_ProbabilisticScorerDecodeErrorZ in the error state.
15988 struct LDKCResult_ProbabilisticScorerDecodeErrorZ CResult_ProbabilisticScorerDecodeErrorZ_err(struct LDKDecodeError e);
15991 * Checks if the given object is currently in the success state
15993 bool CResult_ProbabilisticScorerDecodeErrorZ_is_ok(const struct LDKCResult_ProbabilisticScorerDecodeErrorZ *NONNULL_PTR o);
15996 * Frees any resources used by the CResult_ProbabilisticScorerDecodeErrorZ.
15998 void CResult_ProbabilisticScorerDecodeErrorZ_free(struct LDKCResult_ProbabilisticScorerDecodeErrorZ _res);
16001 * Creates a new CResult_InitFeaturesDecodeErrorZ in the success state.
16003 struct LDKCResult_InitFeaturesDecodeErrorZ CResult_InitFeaturesDecodeErrorZ_ok(struct LDKInitFeatures o);
16006 * Creates a new CResult_InitFeaturesDecodeErrorZ in the error state.
16008 struct LDKCResult_InitFeaturesDecodeErrorZ CResult_InitFeaturesDecodeErrorZ_err(struct LDKDecodeError e);
16011 * Checks if the given object is currently in the success state
16013 bool CResult_InitFeaturesDecodeErrorZ_is_ok(const struct LDKCResult_InitFeaturesDecodeErrorZ *NONNULL_PTR o);
16016 * Frees any resources used by the CResult_InitFeaturesDecodeErrorZ.
16018 void CResult_InitFeaturesDecodeErrorZ_free(struct LDKCResult_InitFeaturesDecodeErrorZ _res);
16021 * Creates a new CResult_InitFeaturesDecodeErrorZ which has the same data as `orig`
16022 * but with all dynamically-allocated buffers duplicated in new buffers.
16024 struct LDKCResult_InitFeaturesDecodeErrorZ CResult_InitFeaturesDecodeErrorZ_clone(const struct LDKCResult_InitFeaturesDecodeErrorZ *NONNULL_PTR orig);
16027 * Creates a new CResult_ChannelFeaturesDecodeErrorZ in the success state.
16029 struct LDKCResult_ChannelFeaturesDecodeErrorZ CResult_ChannelFeaturesDecodeErrorZ_ok(struct LDKChannelFeatures o);
16032 * Creates a new CResult_ChannelFeaturesDecodeErrorZ in the error state.
16034 struct LDKCResult_ChannelFeaturesDecodeErrorZ CResult_ChannelFeaturesDecodeErrorZ_err(struct LDKDecodeError e);
16037 * Checks if the given object is currently in the success state
16039 bool CResult_ChannelFeaturesDecodeErrorZ_is_ok(const struct LDKCResult_ChannelFeaturesDecodeErrorZ *NONNULL_PTR o);
16042 * Frees any resources used by the CResult_ChannelFeaturesDecodeErrorZ.
16044 void CResult_ChannelFeaturesDecodeErrorZ_free(struct LDKCResult_ChannelFeaturesDecodeErrorZ _res);
16047 * Creates a new CResult_ChannelFeaturesDecodeErrorZ which has the same data as `orig`
16048 * but with all dynamically-allocated buffers duplicated in new buffers.
16050 struct LDKCResult_ChannelFeaturesDecodeErrorZ CResult_ChannelFeaturesDecodeErrorZ_clone(const struct LDKCResult_ChannelFeaturesDecodeErrorZ *NONNULL_PTR orig);
16053 * Creates a new CResult_NodeFeaturesDecodeErrorZ in the success state.
16055 struct LDKCResult_NodeFeaturesDecodeErrorZ CResult_NodeFeaturesDecodeErrorZ_ok(struct LDKNodeFeatures o);
16058 * Creates a new CResult_NodeFeaturesDecodeErrorZ in the error state.
16060 struct LDKCResult_NodeFeaturesDecodeErrorZ CResult_NodeFeaturesDecodeErrorZ_err(struct LDKDecodeError e);
16063 * Checks if the given object is currently in the success state
16065 bool CResult_NodeFeaturesDecodeErrorZ_is_ok(const struct LDKCResult_NodeFeaturesDecodeErrorZ *NONNULL_PTR o);
16068 * Frees any resources used by the CResult_NodeFeaturesDecodeErrorZ.
16070 void CResult_NodeFeaturesDecodeErrorZ_free(struct LDKCResult_NodeFeaturesDecodeErrorZ _res);
16073 * Creates a new CResult_NodeFeaturesDecodeErrorZ which has the same data as `orig`
16074 * but with all dynamically-allocated buffers duplicated in new buffers.
16076 struct LDKCResult_NodeFeaturesDecodeErrorZ CResult_NodeFeaturesDecodeErrorZ_clone(const struct LDKCResult_NodeFeaturesDecodeErrorZ *NONNULL_PTR orig);
16079 * Creates a new CResult_InvoiceFeaturesDecodeErrorZ in the success state.
16081 struct LDKCResult_InvoiceFeaturesDecodeErrorZ CResult_InvoiceFeaturesDecodeErrorZ_ok(struct LDKInvoiceFeatures o);
16084 * Creates a new CResult_InvoiceFeaturesDecodeErrorZ in the error state.
16086 struct LDKCResult_InvoiceFeaturesDecodeErrorZ CResult_InvoiceFeaturesDecodeErrorZ_err(struct LDKDecodeError e);
16089 * Checks if the given object is currently in the success state
16091 bool CResult_InvoiceFeaturesDecodeErrorZ_is_ok(const struct LDKCResult_InvoiceFeaturesDecodeErrorZ *NONNULL_PTR o);
16094 * Frees any resources used by the CResult_InvoiceFeaturesDecodeErrorZ.
16096 void CResult_InvoiceFeaturesDecodeErrorZ_free(struct LDKCResult_InvoiceFeaturesDecodeErrorZ _res);
16099 * Creates a new CResult_InvoiceFeaturesDecodeErrorZ which has the same data as `orig`
16100 * but with all dynamically-allocated buffers duplicated in new buffers.
16102 struct LDKCResult_InvoiceFeaturesDecodeErrorZ CResult_InvoiceFeaturesDecodeErrorZ_clone(const struct LDKCResult_InvoiceFeaturesDecodeErrorZ *NONNULL_PTR orig);
16105 * Creates a new CResult_ChannelTypeFeaturesDecodeErrorZ in the success state.
16107 struct LDKCResult_ChannelTypeFeaturesDecodeErrorZ CResult_ChannelTypeFeaturesDecodeErrorZ_ok(struct LDKChannelTypeFeatures o);
16110 * Creates a new CResult_ChannelTypeFeaturesDecodeErrorZ in the error state.
16112 struct LDKCResult_ChannelTypeFeaturesDecodeErrorZ CResult_ChannelTypeFeaturesDecodeErrorZ_err(struct LDKDecodeError e);
16115 * Checks if the given object is currently in the success state
16117 bool CResult_ChannelTypeFeaturesDecodeErrorZ_is_ok(const struct LDKCResult_ChannelTypeFeaturesDecodeErrorZ *NONNULL_PTR o);
16120 * Frees any resources used by the CResult_ChannelTypeFeaturesDecodeErrorZ.
16122 void CResult_ChannelTypeFeaturesDecodeErrorZ_free(struct LDKCResult_ChannelTypeFeaturesDecodeErrorZ _res);
16125 * Creates a new CResult_ChannelTypeFeaturesDecodeErrorZ which has the same data as `orig`
16126 * but with all dynamically-allocated buffers duplicated in new buffers.
16128 struct LDKCResult_ChannelTypeFeaturesDecodeErrorZ CResult_ChannelTypeFeaturesDecodeErrorZ_clone(const struct LDKCResult_ChannelTypeFeaturesDecodeErrorZ *NONNULL_PTR orig);
16131 * Creates a new CResult_OfferFeaturesDecodeErrorZ in the success state.
16133 struct LDKCResult_OfferFeaturesDecodeErrorZ CResult_OfferFeaturesDecodeErrorZ_ok(struct LDKOfferFeatures o);
16136 * Creates a new CResult_OfferFeaturesDecodeErrorZ in the error state.
16138 struct LDKCResult_OfferFeaturesDecodeErrorZ CResult_OfferFeaturesDecodeErrorZ_err(struct LDKDecodeError e);
16141 * Checks if the given object is currently in the success state
16143 bool CResult_OfferFeaturesDecodeErrorZ_is_ok(const struct LDKCResult_OfferFeaturesDecodeErrorZ *NONNULL_PTR o);
16146 * Frees any resources used by the CResult_OfferFeaturesDecodeErrorZ.
16148 void CResult_OfferFeaturesDecodeErrorZ_free(struct LDKCResult_OfferFeaturesDecodeErrorZ _res);
16151 * Creates a new CResult_OfferFeaturesDecodeErrorZ which has the same data as `orig`
16152 * but with all dynamically-allocated buffers duplicated in new buffers.
16154 struct LDKCResult_OfferFeaturesDecodeErrorZ CResult_OfferFeaturesDecodeErrorZ_clone(const struct LDKCResult_OfferFeaturesDecodeErrorZ *NONNULL_PTR orig);
16157 * Creates a new CResult_InvoiceRequestFeaturesDecodeErrorZ in the success state.
16159 struct LDKCResult_InvoiceRequestFeaturesDecodeErrorZ CResult_InvoiceRequestFeaturesDecodeErrorZ_ok(struct LDKInvoiceRequestFeatures o);
16162 * Creates a new CResult_InvoiceRequestFeaturesDecodeErrorZ in the error state.
16164 struct LDKCResult_InvoiceRequestFeaturesDecodeErrorZ CResult_InvoiceRequestFeaturesDecodeErrorZ_err(struct LDKDecodeError e);
16167 * Checks if the given object is currently in the success state
16169 bool CResult_InvoiceRequestFeaturesDecodeErrorZ_is_ok(const struct LDKCResult_InvoiceRequestFeaturesDecodeErrorZ *NONNULL_PTR o);
16172 * Frees any resources used by the CResult_InvoiceRequestFeaturesDecodeErrorZ.
16174 void CResult_InvoiceRequestFeaturesDecodeErrorZ_free(struct LDKCResult_InvoiceRequestFeaturesDecodeErrorZ _res);
16177 * Creates a new CResult_InvoiceRequestFeaturesDecodeErrorZ which has the same data as `orig`
16178 * but with all dynamically-allocated buffers duplicated in new buffers.
16180 struct LDKCResult_InvoiceRequestFeaturesDecodeErrorZ CResult_InvoiceRequestFeaturesDecodeErrorZ_clone(const struct LDKCResult_InvoiceRequestFeaturesDecodeErrorZ *NONNULL_PTR orig);
16183 * Creates a new CResult_NodeIdDecodeErrorZ in the success state.
16185 struct LDKCResult_NodeIdDecodeErrorZ CResult_NodeIdDecodeErrorZ_ok(struct LDKNodeId o);
16188 * Creates a new CResult_NodeIdDecodeErrorZ in the error state.
16190 struct LDKCResult_NodeIdDecodeErrorZ CResult_NodeIdDecodeErrorZ_err(struct LDKDecodeError e);
16193 * Checks if the given object is currently in the success state
16195 bool CResult_NodeIdDecodeErrorZ_is_ok(const struct LDKCResult_NodeIdDecodeErrorZ *NONNULL_PTR o);
16198 * Frees any resources used by the CResult_NodeIdDecodeErrorZ.
16200 void CResult_NodeIdDecodeErrorZ_free(struct LDKCResult_NodeIdDecodeErrorZ _res);
16203 * Creates a new CResult_NodeIdDecodeErrorZ which has the same data as `orig`
16204 * but with all dynamically-allocated buffers duplicated in new buffers.
16206 struct LDKCResult_NodeIdDecodeErrorZ CResult_NodeIdDecodeErrorZ_clone(const struct LDKCResult_NodeIdDecodeErrorZ *NONNULL_PTR orig);
16209 * Creates a new CResult_COption_NetworkUpdateZDecodeErrorZ in the success state.
16211 struct LDKCResult_COption_NetworkUpdateZDecodeErrorZ CResult_COption_NetworkUpdateZDecodeErrorZ_ok(struct LDKCOption_NetworkUpdateZ o);
16214 * Creates a new CResult_COption_NetworkUpdateZDecodeErrorZ in the error state.
16216 struct LDKCResult_COption_NetworkUpdateZDecodeErrorZ CResult_COption_NetworkUpdateZDecodeErrorZ_err(struct LDKDecodeError e);
16219 * Checks if the given object is currently in the success state
16221 bool CResult_COption_NetworkUpdateZDecodeErrorZ_is_ok(const struct LDKCResult_COption_NetworkUpdateZDecodeErrorZ *NONNULL_PTR o);
16224 * Frees any resources used by the CResult_COption_NetworkUpdateZDecodeErrorZ.
16226 void CResult_COption_NetworkUpdateZDecodeErrorZ_free(struct LDKCResult_COption_NetworkUpdateZDecodeErrorZ _res);
16229 * Creates a new CResult_COption_NetworkUpdateZDecodeErrorZ which has the same data as `orig`
16230 * but with all dynamically-allocated buffers duplicated in new buffers.
16232 struct LDKCResult_COption_NetworkUpdateZDecodeErrorZ CResult_COption_NetworkUpdateZDecodeErrorZ_clone(const struct LDKCResult_COption_NetworkUpdateZDecodeErrorZ *NONNULL_PTR orig);
16235 * Constructs a new COption_AccessZ containing a crate::lightning::chain::Access
16237 struct LDKCOption_AccessZ COption_AccessZ_some(struct LDKAccess o);
16240 * Constructs a new COption_AccessZ containing nothing
16242 struct LDKCOption_AccessZ COption_AccessZ_none(void);
16245 * Frees any resources associated with the crate::lightning::chain::Access, if we are in the Some state
16247 void COption_AccessZ_free(struct LDKCOption_AccessZ _res);
16250 * Creates a new CResult_boolLightningErrorZ in the success state.
16252 struct LDKCResult_boolLightningErrorZ CResult_boolLightningErrorZ_ok(bool o);
16255 * Creates a new CResult_boolLightningErrorZ in the error state.
16257 struct LDKCResult_boolLightningErrorZ CResult_boolLightningErrorZ_err(struct LDKLightningError e);
16260 * Checks if the given object is currently in the success state
16262 bool CResult_boolLightningErrorZ_is_ok(const struct LDKCResult_boolLightningErrorZ *NONNULL_PTR o);
16265 * Frees any resources used by the CResult_boolLightningErrorZ.
16267 void CResult_boolLightningErrorZ_free(struct LDKCResult_boolLightningErrorZ _res);
16270 * Creates a new CResult_boolLightningErrorZ which has the same data as `orig`
16271 * but with all dynamically-allocated buffers duplicated in new buffers.
16273 struct LDKCResult_boolLightningErrorZ CResult_boolLightningErrorZ_clone(const struct LDKCResult_boolLightningErrorZ *NONNULL_PTR orig);
16276 * Creates a new tuple which has the same data as `orig`
16277 * but with all dynamically-allocated buffers duplicated in new buffers.
16279 struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_clone(const struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ *NONNULL_PTR orig);
16282 * Creates a new C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ from the contained elements.
16284 struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_new(struct LDKChannelAnnouncement a, struct LDKChannelUpdate b, struct LDKChannelUpdate c);
16287 * Frees any resources used by the C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ.
16289 void C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_free(struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ _res);
16292 * Constructs a new COption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ containing a crate::c_types::derived::C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ
16294 struct LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ COption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_some(struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ o);
16297 * Constructs a new COption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ containing nothing
16299 struct LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ COption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_none(void);
16302 * Frees any resources associated with the crate::c_types::derived::C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ, if we are in the Some state
16304 void COption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_free(struct LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ _res);
16307 * Creates a new COption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ which has the same data as `orig`
16308 * but with all dynamically-allocated buffers duplicated in new buffers.
16310 struct LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ COption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_clone(const struct LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ *NONNULL_PTR orig);
16313 * Creates a new CResult_NoneLightningErrorZ in the success state.
16315 struct LDKCResult_NoneLightningErrorZ CResult_NoneLightningErrorZ_ok(void);
16318 * Creates a new CResult_NoneLightningErrorZ in the error state.
16320 struct LDKCResult_NoneLightningErrorZ CResult_NoneLightningErrorZ_err(struct LDKLightningError e);
16323 * Checks if the given object is currently in the success state
16325 bool CResult_NoneLightningErrorZ_is_ok(const struct LDKCResult_NoneLightningErrorZ *NONNULL_PTR o);
16328 * Frees any resources used by the CResult_NoneLightningErrorZ.
16330 void CResult_NoneLightningErrorZ_free(struct LDKCResult_NoneLightningErrorZ _res);
16333 * Creates a new CResult_NoneLightningErrorZ which has the same data as `orig`
16334 * but with all dynamically-allocated buffers duplicated in new buffers.
16336 struct LDKCResult_NoneLightningErrorZ CResult_NoneLightningErrorZ_clone(const struct LDKCResult_NoneLightningErrorZ *NONNULL_PTR orig);
16339 * Creates a new CResult_ChannelUpdateInfoDecodeErrorZ in the success state.
16341 struct LDKCResult_ChannelUpdateInfoDecodeErrorZ CResult_ChannelUpdateInfoDecodeErrorZ_ok(struct LDKChannelUpdateInfo o);
16344 * Creates a new CResult_ChannelUpdateInfoDecodeErrorZ in the error state.
16346 struct LDKCResult_ChannelUpdateInfoDecodeErrorZ CResult_ChannelUpdateInfoDecodeErrorZ_err(struct LDKDecodeError e);
16349 * Checks if the given object is currently in the success state
16351 bool CResult_ChannelUpdateInfoDecodeErrorZ_is_ok(const struct LDKCResult_ChannelUpdateInfoDecodeErrorZ *NONNULL_PTR o);
16354 * Frees any resources used by the CResult_ChannelUpdateInfoDecodeErrorZ.
16356 void CResult_ChannelUpdateInfoDecodeErrorZ_free(struct LDKCResult_ChannelUpdateInfoDecodeErrorZ _res);
16359 * Creates a new CResult_ChannelUpdateInfoDecodeErrorZ which has the same data as `orig`
16360 * but with all dynamically-allocated buffers duplicated in new buffers.
16362 struct LDKCResult_ChannelUpdateInfoDecodeErrorZ CResult_ChannelUpdateInfoDecodeErrorZ_clone(const struct LDKCResult_ChannelUpdateInfoDecodeErrorZ *NONNULL_PTR orig);
16365 * Creates a new CResult_ChannelInfoDecodeErrorZ in the success state.
16367 struct LDKCResult_ChannelInfoDecodeErrorZ CResult_ChannelInfoDecodeErrorZ_ok(struct LDKChannelInfo o);
16370 * Creates a new CResult_ChannelInfoDecodeErrorZ in the error state.
16372 struct LDKCResult_ChannelInfoDecodeErrorZ CResult_ChannelInfoDecodeErrorZ_err(struct LDKDecodeError e);
16375 * Checks if the given object is currently in the success state
16377 bool CResult_ChannelInfoDecodeErrorZ_is_ok(const struct LDKCResult_ChannelInfoDecodeErrorZ *NONNULL_PTR o);
16380 * Frees any resources used by the CResult_ChannelInfoDecodeErrorZ.
16382 void CResult_ChannelInfoDecodeErrorZ_free(struct LDKCResult_ChannelInfoDecodeErrorZ _res);
16385 * Creates a new CResult_ChannelInfoDecodeErrorZ which has the same data as `orig`
16386 * but with all dynamically-allocated buffers duplicated in new buffers.
16388 struct LDKCResult_ChannelInfoDecodeErrorZ CResult_ChannelInfoDecodeErrorZ_clone(const struct LDKCResult_ChannelInfoDecodeErrorZ *NONNULL_PTR orig);
16391 * Creates a new CResult_RoutingFeesDecodeErrorZ in the success state.
16393 struct LDKCResult_RoutingFeesDecodeErrorZ CResult_RoutingFeesDecodeErrorZ_ok(struct LDKRoutingFees o);
16396 * Creates a new CResult_RoutingFeesDecodeErrorZ in the error state.
16398 struct LDKCResult_RoutingFeesDecodeErrorZ CResult_RoutingFeesDecodeErrorZ_err(struct LDKDecodeError e);
16401 * Checks if the given object is currently in the success state
16403 bool CResult_RoutingFeesDecodeErrorZ_is_ok(const struct LDKCResult_RoutingFeesDecodeErrorZ *NONNULL_PTR o);
16406 * Frees any resources used by the CResult_RoutingFeesDecodeErrorZ.
16408 void CResult_RoutingFeesDecodeErrorZ_free(struct LDKCResult_RoutingFeesDecodeErrorZ _res);
16411 * Creates a new CResult_RoutingFeesDecodeErrorZ which has the same data as `orig`
16412 * but with all dynamically-allocated buffers duplicated in new buffers.
16414 struct LDKCResult_RoutingFeesDecodeErrorZ CResult_RoutingFeesDecodeErrorZ_clone(const struct LDKCResult_RoutingFeesDecodeErrorZ *NONNULL_PTR orig);
16417 * Frees the buffer pointed to by `data` if `datalen` is non-0.
16419 void CVec_NetAddressZ_free(struct LDKCVec_NetAddressZ _res);
16422 * Creates a new CResult_NodeAnnouncementInfoDecodeErrorZ in the success state.
16424 struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ CResult_NodeAnnouncementInfoDecodeErrorZ_ok(struct LDKNodeAnnouncementInfo o);
16427 * Creates a new CResult_NodeAnnouncementInfoDecodeErrorZ in the error state.
16429 struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ CResult_NodeAnnouncementInfoDecodeErrorZ_err(struct LDKDecodeError e);
16432 * Checks if the given object is currently in the success state
16434 bool CResult_NodeAnnouncementInfoDecodeErrorZ_is_ok(const struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ *NONNULL_PTR o);
16437 * Frees any resources used by the CResult_NodeAnnouncementInfoDecodeErrorZ.
16439 void CResult_NodeAnnouncementInfoDecodeErrorZ_free(struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ _res);
16442 * Creates a new CResult_NodeAnnouncementInfoDecodeErrorZ which has the same data as `orig`
16443 * but with all dynamically-allocated buffers duplicated in new buffers.
16445 struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ CResult_NodeAnnouncementInfoDecodeErrorZ_clone(const struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ *NONNULL_PTR orig);
16448 * Creates a new CResult_NodeAliasDecodeErrorZ in the success state.
16450 struct LDKCResult_NodeAliasDecodeErrorZ CResult_NodeAliasDecodeErrorZ_ok(struct LDKNodeAlias o);
16453 * Creates a new CResult_NodeAliasDecodeErrorZ in the error state.
16455 struct LDKCResult_NodeAliasDecodeErrorZ CResult_NodeAliasDecodeErrorZ_err(struct LDKDecodeError e);
16458 * Checks if the given object is currently in the success state
16460 bool CResult_NodeAliasDecodeErrorZ_is_ok(const struct LDKCResult_NodeAliasDecodeErrorZ *NONNULL_PTR o);
16463 * Frees any resources used by the CResult_NodeAliasDecodeErrorZ.
16465 void CResult_NodeAliasDecodeErrorZ_free(struct LDKCResult_NodeAliasDecodeErrorZ _res);
16468 * Creates a new CResult_NodeAliasDecodeErrorZ which has the same data as `orig`
16469 * but with all dynamically-allocated buffers duplicated in new buffers.
16471 struct LDKCResult_NodeAliasDecodeErrorZ CResult_NodeAliasDecodeErrorZ_clone(const struct LDKCResult_NodeAliasDecodeErrorZ *NONNULL_PTR orig);
16474 * Creates a new CResult_NodeInfoDecodeErrorZ in the success state.
16476 struct LDKCResult_NodeInfoDecodeErrorZ CResult_NodeInfoDecodeErrorZ_ok(struct LDKNodeInfo o);
16479 * Creates a new CResult_NodeInfoDecodeErrorZ in the error state.
16481 struct LDKCResult_NodeInfoDecodeErrorZ CResult_NodeInfoDecodeErrorZ_err(struct LDKDecodeError e);
16484 * Checks if the given object is currently in the success state
16486 bool CResult_NodeInfoDecodeErrorZ_is_ok(const struct LDKCResult_NodeInfoDecodeErrorZ *NONNULL_PTR o);
16489 * Frees any resources used by the CResult_NodeInfoDecodeErrorZ.
16491 void CResult_NodeInfoDecodeErrorZ_free(struct LDKCResult_NodeInfoDecodeErrorZ _res);
16494 * Creates a new CResult_NodeInfoDecodeErrorZ which has the same data as `orig`
16495 * but with all dynamically-allocated buffers duplicated in new buffers.
16497 struct LDKCResult_NodeInfoDecodeErrorZ CResult_NodeInfoDecodeErrorZ_clone(const struct LDKCResult_NodeInfoDecodeErrorZ *NONNULL_PTR orig);
16500 * Creates a new CResult_NetworkGraphDecodeErrorZ in the success state.
16502 struct LDKCResult_NetworkGraphDecodeErrorZ CResult_NetworkGraphDecodeErrorZ_ok(struct LDKNetworkGraph o);
16505 * Creates a new CResult_NetworkGraphDecodeErrorZ in the error state.
16507 struct LDKCResult_NetworkGraphDecodeErrorZ CResult_NetworkGraphDecodeErrorZ_err(struct LDKDecodeError e);
16510 * Checks if the given object is currently in the success state
16512 bool CResult_NetworkGraphDecodeErrorZ_is_ok(const struct LDKCResult_NetworkGraphDecodeErrorZ *NONNULL_PTR o);
16515 * Frees any resources used by the CResult_NetworkGraphDecodeErrorZ.
16517 void CResult_NetworkGraphDecodeErrorZ_free(struct LDKCResult_NetworkGraphDecodeErrorZ _res);
16520 * Constructs a new COption_CVec_NetAddressZZ containing a crate::c_types::derived::CVec_NetAddressZ
16522 struct LDKCOption_CVec_NetAddressZZ COption_CVec_NetAddressZZ_some(struct LDKCVec_NetAddressZ o);
16525 * Constructs a new COption_CVec_NetAddressZZ containing nothing
16527 struct LDKCOption_CVec_NetAddressZZ COption_CVec_NetAddressZZ_none(void);
16530 * Frees any resources associated with the crate::c_types::derived::CVec_NetAddressZ, if we are in the Some state
16532 void COption_CVec_NetAddressZZ_free(struct LDKCOption_CVec_NetAddressZZ _res);
16535 * Creates a new COption_CVec_NetAddressZZ which has the same data as `orig`
16536 * but with all dynamically-allocated buffers duplicated in new buffers.
16538 struct LDKCOption_CVec_NetAddressZZ COption_CVec_NetAddressZZ_clone(const struct LDKCOption_CVec_NetAddressZZ *NONNULL_PTR orig);
16541 * Creates a new CResult_DelayedPaymentOutputDescriptorDecodeErrorZ in the success state.
16543 struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_ok(struct LDKDelayedPaymentOutputDescriptor o);
16546 * Creates a new CResult_DelayedPaymentOutputDescriptorDecodeErrorZ in the error state.
16548 struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_err(struct LDKDecodeError e);
16551 * Checks if the given object is currently in the success state
16553 bool CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_is_ok(const struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ *NONNULL_PTR o);
16556 * Frees any resources used by the CResult_DelayedPaymentOutputDescriptorDecodeErrorZ.
16558 void CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_free(struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ _res);
16561 * Creates a new CResult_DelayedPaymentOutputDescriptorDecodeErrorZ which has the same data as `orig`
16562 * but with all dynamically-allocated buffers duplicated in new buffers.
16564 struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_clone(const struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ *NONNULL_PTR orig);
16567 * Creates a new CResult_StaticPaymentOutputDescriptorDecodeErrorZ in the success state.
16569 struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ CResult_StaticPaymentOutputDescriptorDecodeErrorZ_ok(struct LDKStaticPaymentOutputDescriptor o);
16572 * Creates a new CResult_StaticPaymentOutputDescriptorDecodeErrorZ in the error state.
16574 struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ CResult_StaticPaymentOutputDescriptorDecodeErrorZ_err(struct LDKDecodeError e);
16577 * Checks if the given object is currently in the success state
16579 bool CResult_StaticPaymentOutputDescriptorDecodeErrorZ_is_ok(const struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ *NONNULL_PTR o);
16582 * Frees any resources used by the CResult_StaticPaymentOutputDescriptorDecodeErrorZ.
16584 void CResult_StaticPaymentOutputDescriptorDecodeErrorZ_free(struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ _res);
16587 * Creates a new CResult_StaticPaymentOutputDescriptorDecodeErrorZ which has the same data as `orig`
16588 * but with all dynamically-allocated buffers duplicated in new buffers.
16590 struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ CResult_StaticPaymentOutputDescriptorDecodeErrorZ_clone(const struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ *NONNULL_PTR orig);
16593 * Creates a new CResult_SpendableOutputDescriptorDecodeErrorZ in the success state.
16595 struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ CResult_SpendableOutputDescriptorDecodeErrorZ_ok(struct LDKSpendableOutputDescriptor o);
16598 * Creates a new CResult_SpendableOutputDescriptorDecodeErrorZ in the error state.
16600 struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ CResult_SpendableOutputDescriptorDecodeErrorZ_err(struct LDKDecodeError e);
16603 * Checks if the given object is currently in the success state
16605 bool CResult_SpendableOutputDescriptorDecodeErrorZ_is_ok(const struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ *NONNULL_PTR o);
16608 * Frees any resources used by the CResult_SpendableOutputDescriptorDecodeErrorZ.
16610 void CResult_SpendableOutputDescriptorDecodeErrorZ_free(struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ _res);
16613 * Creates a new CResult_SpendableOutputDescriptorDecodeErrorZ which has the same data as `orig`
16614 * but with all dynamically-allocated buffers duplicated in new buffers.
16616 struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ CResult_SpendableOutputDescriptorDecodeErrorZ_clone(const struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ *NONNULL_PTR orig);
16619 * Frees the buffer pointed to by `data` if `datalen` is non-0.
16621 void CVec_PaymentPreimageZ_free(struct LDKCVec_PaymentPreimageZ _res);
16624 * Creates a new tuple which has the same data as `orig`
16625 * but with all dynamically-allocated buffers duplicated in new buffers.
16627 struct LDKC2Tuple_SignatureCVec_SignatureZZ C2Tuple_SignatureCVec_SignatureZZ_clone(const struct LDKC2Tuple_SignatureCVec_SignatureZZ *NONNULL_PTR orig);
16630 * Creates a new C2Tuple_SignatureCVec_SignatureZZ from the contained elements.
16632 struct LDKC2Tuple_SignatureCVec_SignatureZZ C2Tuple_SignatureCVec_SignatureZZ_new(struct LDKSignature a, struct LDKCVec_SignatureZ b);
16635 * Frees any resources used by the C2Tuple_SignatureCVec_SignatureZZ.
16637 void C2Tuple_SignatureCVec_SignatureZZ_free(struct LDKC2Tuple_SignatureCVec_SignatureZZ _res);
16640 * Creates a new CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ in the success state.
16642 struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_ok(struct LDKC2Tuple_SignatureCVec_SignatureZZ o);
16645 * Creates a new CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ in the error state.
16647 struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_err(void);
16650 * Checks if the given object is currently in the success state
16652 bool CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_is_ok(const struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ *NONNULL_PTR o);
16655 * Frees any resources used by the CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ.
16657 void CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_free(struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ _res);
16660 * Creates a new CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ which has the same data as `orig`
16661 * but with all dynamically-allocated buffers duplicated in new buffers.
16663 struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_clone(const struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ *NONNULL_PTR orig);
16666 * Creates a new CResult_SignatureNoneZ in the success state.
16668 struct LDKCResult_SignatureNoneZ CResult_SignatureNoneZ_ok(struct LDKSignature o);
16671 * Creates a new CResult_SignatureNoneZ in the error state.
16673 struct LDKCResult_SignatureNoneZ CResult_SignatureNoneZ_err(void);
16676 * Checks if the given object is currently in the success state
16678 bool CResult_SignatureNoneZ_is_ok(const struct LDKCResult_SignatureNoneZ *NONNULL_PTR o);
16681 * Frees any resources used by the CResult_SignatureNoneZ.
16683 void CResult_SignatureNoneZ_free(struct LDKCResult_SignatureNoneZ _res);
16686 * Creates a new CResult_SignatureNoneZ which has the same data as `orig`
16687 * but with all dynamically-allocated buffers duplicated in new buffers.
16689 struct LDKCResult_SignatureNoneZ CResult_SignatureNoneZ_clone(const struct LDKCResult_SignatureNoneZ *NONNULL_PTR orig);
16692 * Creates a new tuple which has the same data as `orig`
16693 * but with all dynamically-allocated buffers duplicated in new buffers.
16695 struct LDKC2Tuple_SignatureSignatureZ C2Tuple_SignatureSignatureZ_clone(const struct LDKC2Tuple_SignatureSignatureZ *NONNULL_PTR orig);
16698 * Creates a new C2Tuple_SignatureSignatureZ from the contained elements.
16700 struct LDKC2Tuple_SignatureSignatureZ C2Tuple_SignatureSignatureZ_new(struct LDKSignature a, struct LDKSignature b);
16703 * Frees any resources used by the C2Tuple_SignatureSignatureZ.
16705 void C2Tuple_SignatureSignatureZ_free(struct LDKC2Tuple_SignatureSignatureZ _res);
16708 * Creates a new CResult_C2Tuple_SignatureSignatureZNoneZ in the success state.
16710 struct LDKCResult_C2Tuple_SignatureSignatureZNoneZ CResult_C2Tuple_SignatureSignatureZNoneZ_ok(struct LDKC2Tuple_SignatureSignatureZ o);
16713 * Creates a new CResult_C2Tuple_SignatureSignatureZNoneZ in the error state.
16715 struct LDKCResult_C2Tuple_SignatureSignatureZNoneZ CResult_C2Tuple_SignatureSignatureZNoneZ_err(void);
16718 * Checks if the given object is currently in the success state
16720 bool CResult_C2Tuple_SignatureSignatureZNoneZ_is_ok(const struct LDKCResult_C2Tuple_SignatureSignatureZNoneZ *NONNULL_PTR o);
16723 * Frees any resources used by the CResult_C2Tuple_SignatureSignatureZNoneZ.
16725 void CResult_C2Tuple_SignatureSignatureZNoneZ_free(struct LDKCResult_C2Tuple_SignatureSignatureZNoneZ _res);
16728 * Creates a new CResult_C2Tuple_SignatureSignatureZNoneZ which has the same data as `orig`
16729 * but with all dynamically-allocated buffers duplicated in new buffers.
16731 struct LDKCResult_C2Tuple_SignatureSignatureZNoneZ CResult_C2Tuple_SignatureSignatureZNoneZ_clone(const struct LDKCResult_C2Tuple_SignatureSignatureZNoneZ *NONNULL_PTR orig);
16734 * Creates a new CResult_SecretKeyNoneZ in the success state.
16736 struct LDKCResult_SecretKeyNoneZ CResult_SecretKeyNoneZ_ok(struct LDKSecretKey o);
16739 * Creates a new CResult_SecretKeyNoneZ in the error state.
16741 struct LDKCResult_SecretKeyNoneZ CResult_SecretKeyNoneZ_err(void);
16744 * Checks if the given object is currently in the success state
16746 bool CResult_SecretKeyNoneZ_is_ok(const struct LDKCResult_SecretKeyNoneZ *NONNULL_PTR o);
16749 * Frees any resources used by the CResult_SecretKeyNoneZ.
16751 void CResult_SecretKeyNoneZ_free(struct LDKCResult_SecretKeyNoneZ _res);
16754 * Creates a new CResult_SecretKeyNoneZ which has the same data as `orig`
16755 * but with all dynamically-allocated buffers duplicated in new buffers.
16757 struct LDKCResult_SecretKeyNoneZ CResult_SecretKeyNoneZ_clone(const struct LDKCResult_SecretKeyNoneZ *NONNULL_PTR orig);
16760 * Creates a new CResult_PublicKeyNoneZ in the success state.
16762 struct LDKCResult_PublicKeyNoneZ CResult_PublicKeyNoneZ_ok(struct LDKPublicKey o);
16765 * Creates a new CResult_PublicKeyNoneZ in the error state.
16767 struct LDKCResult_PublicKeyNoneZ CResult_PublicKeyNoneZ_err(void);
16770 * Checks if the given object is currently in the success state
16772 bool CResult_PublicKeyNoneZ_is_ok(const struct LDKCResult_PublicKeyNoneZ *NONNULL_PTR o);
16775 * Frees any resources used by the CResult_PublicKeyNoneZ.
16777 void CResult_PublicKeyNoneZ_free(struct LDKCResult_PublicKeyNoneZ _res);
16780 * Creates a new CResult_PublicKeyNoneZ which has the same data as `orig`
16781 * but with all dynamically-allocated buffers duplicated in new buffers.
16783 struct LDKCResult_PublicKeyNoneZ CResult_PublicKeyNoneZ_clone(const struct LDKCResult_PublicKeyNoneZ *NONNULL_PTR orig);
16786 * Constructs a new COption_ScalarZ containing a crate::c_types::BigEndianScalar
16788 struct LDKCOption_ScalarZ COption_ScalarZ_some(struct LDKBigEndianScalar o);
16791 * Constructs a new COption_ScalarZ containing nothing
16793 struct LDKCOption_ScalarZ COption_ScalarZ_none(void);
16796 * Frees any resources associated with the crate::c_types::BigEndianScalar, if we are in the Some state
16798 void COption_ScalarZ_free(struct LDKCOption_ScalarZ _res);
16801 * Creates a new CResult_SharedSecretNoneZ in the success state.
16803 struct LDKCResult_SharedSecretNoneZ CResult_SharedSecretNoneZ_ok(struct LDKThirtyTwoBytes o);
16806 * Creates a new CResult_SharedSecretNoneZ in the error state.
16808 struct LDKCResult_SharedSecretNoneZ CResult_SharedSecretNoneZ_err(void);
16811 * Checks if the given object is currently in the success state
16813 bool CResult_SharedSecretNoneZ_is_ok(const struct LDKCResult_SharedSecretNoneZ *NONNULL_PTR o);
16816 * Frees any resources used by the CResult_SharedSecretNoneZ.
16818 void CResult_SharedSecretNoneZ_free(struct LDKCResult_SharedSecretNoneZ _res);
16821 * Creates a new CResult_SharedSecretNoneZ which has the same data as `orig`
16822 * but with all dynamically-allocated buffers duplicated in new buffers.
16824 struct LDKCResult_SharedSecretNoneZ CResult_SharedSecretNoneZ_clone(const struct LDKCResult_SharedSecretNoneZ *NONNULL_PTR orig);
16827 * Creates a new CResult_SignDecodeErrorZ in the success state.
16829 struct LDKCResult_SignDecodeErrorZ CResult_SignDecodeErrorZ_ok(struct LDKSign o);
16832 * Creates a new CResult_SignDecodeErrorZ in the error state.
16834 struct LDKCResult_SignDecodeErrorZ CResult_SignDecodeErrorZ_err(struct LDKDecodeError e);
16837 * Checks if the given object is currently in the success state
16839 bool CResult_SignDecodeErrorZ_is_ok(const struct LDKCResult_SignDecodeErrorZ *NONNULL_PTR o);
16842 * Frees any resources used by the CResult_SignDecodeErrorZ.
16844 void CResult_SignDecodeErrorZ_free(struct LDKCResult_SignDecodeErrorZ _res);
16847 * Frees the buffer pointed to by `data` if `datalen` is non-0.
16849 void CVec_U5Z_free(struct LDKCVec_U5Z _res);
16852 * Creates a new CResult_RecoverableSignatureNoneZ in the success state.
16854 struct LDKCResult_RecoverableSignatureNoneZ CResult_RecoverableSignatureNoneZ_ok(struct LDKRecoverableSignature o);
16857 * Creates a new CResult_RecoverableSignatureNoneZ in the error state.
16859 struct LDKCResult_RecoverableSignatureNoneZ CResult_RecoverableSignatureNoneZ_err(void);
16862 * Checks if the given object is currently in the success state
16864 bool CResult_RecoverableSignatureNoneZ_is_ok(const struct LDKCResult_RecoverableSignatureNoneZ *NONNULL_PTR o);
16867 * Frees any resources used by the CResult_RecoverableSignatureNoneZ.
16869 void CResult_RecoverableSignatureNoneZ_free(struct LDKCResult_RecoverableSignatureNoneZ _res);
16872 * Creates a new CResult_RecoverableSignatureNoneZ which has the same data as `orig`
16873 * but with all dynamically-allocated buffers duplicated in new buffers.
16875 struct LDKCResult_RecoverableSignatureNoneZ CResult_RecoverableSignatureNoneZ_clone(const struct LDKCResult_RecoverableSignatureNoneZ *NONNULL_PTR orig);
16878 * Frees the buffer pointed to by `data` if `datalen` is non-0.
16880 void CVec_u8Z_free(struct LDKCVec_u8Z _res);
16883 * Frees the buffer pointed to by `data` if `datalen` is non-0.
16885 void CVec_CVec_u8ZZ_free(struct LDKCVec_CVec_u8ZZ _res);
16888 * Creates a new CResult_CVec_CVec_u8ZZNoneZ in the success state.
16890 struct LDKCResult_CVec_CVec_u8ZZNoneZ CResult_CVec_CVec_u8ZZNoneZ_ok(struct LDKCVec_CVec_u8ZZ o);
16893 * Creates a new CResult_CVec_CVec_u8ZZNoneZ in the error state.
16895 struct LDKCResult_CVec_CVec_u8ZZNoneZ CResult_CVec_CVec_u8ZZNoneZ_err(void);
16898 * Checks if the given object is currently in the success state
16900 bool CResult_CVec_CVec_u8ZZNoneZ_is_ok(const struct LDKCResult_CVec_CVec_u8ZZNoneZ *NONNULL_PTR o);
16903 * Frees any resources used by the CResult_CVec_CVec_u8ZZNoneZ.
16905 void CResult_CVec_CVec_u8ZZNoneZ_free(struct LDKCResult_CVec_CVec_u8ZZNoneZ _res);
16908 * Creates a new CResult_CVec_CVec_u8ZZNoneZ which has the same data as `orig`
16909 * but with all dynamically-allocated buffers duplicated in new buffers.
16911 struct LDKCResult_CVec_CVec_u8ZZNoneZ CResult_CVec_CVec_u8ZZNoneZ_clone(const struct LDKCResult_CVec_CVec_u8ZZNoneZ *NONNULL_PTR orig);
16914 * Creates a new CResult_InMemorySignerDecodeErrorZ in the success state.
16916 struct LDKCResult_InMemorySignerDecodeErrorZ CResult_InMemorySignerDecodeErrorZ_ok(struct LDKInMemorySigner o);
16919 * Creates a new CResult_InMemorySignerDecodeErrorZ in the error state.
16921 struct LDKCResult_InMemorySignerDecodeErrorZ CResult_InMemorySignerDecodeErrorZ_err(struct LDKDecodeError e);
16924 * Checks if the given object is currently in the success state
16926 bool CResult_InMemorySignerDecodeErrorZ_is_ok(const struct LDKCResult_InMemorySignerDecodeErrorZ *NONNULL_PTR o);
16929 * Frees any resources used by the CResult_InMemorySignerDecodeErrorZ.
16931 void CResult_InMemorySignerDecodeErrorZ_free(struct LDKCResult_InMemorySignerDecodeErrorZ _res);
16934 * Creates a new CResult_InMemorySignerDecodeErrorZ which has the same data as `orig`
16935 * but with all dynamically-allocated buffers duplicated in new buffers.
16937 struct LDKCResult_InMemorySignerDecodeErrorZ CResult_InMemorySignerDecodeErrorZ_clone(const struct LDKCResult_InMemorySignerDecodeErrorZ *NONNULL_PTR orig);
16940 * Frees the buffer pointed to by `data` if `datalen` is non-0.
16942 void CVec_TxOutZ_free(struct LDKCVec_TxOutZ _res);
16945 * Creates a new CResult_TransactionNoneZ in the success state.
16947 struct LDKCResult_TransactionNoneZ CResult_TransactionNoneZ_ok(struct LDKTransaction o);
16950 * Creates a new CResult_TransactionNoneZ in the error state.
16952 struct LDKCResult_TransactionNoneZ CResult_TransactionNoneZ_err(void);
16955 * Checks if the given object is currently in the success state
16957 bool CResult_TransactionNoneZ_is_ok(const struct LDKCResult_TransactionNoneZ *NONNULL_PTR o);
16960 * Frees any resources used by the CResult_TransactionNoneZ.
16962 void CResult_TransactionNoneZ_free(struct LDKCResult_TransactionNoneZ _res);
16965 * Creates a new CResult_TransactionNoneZ which has the same data as `orig`
16966 * but with all dynamically-allocated buffers duplicated in new buffers.
16968 struct LDKCResult_TransactionNoneZ CResult_TransactionNoneZ_clone(const struct LDKCResult_TransactionNoneZ *NONNULL_PTR orig);
16971 * Creates a new C2Tuple_BlockHashChannelMonitorZ from the contained elements.
16973 struct LDKC2Tuple_BlockHashChannelMonitorZ C2Tuple_BlockHashChannelMonitorZ_new(struct LDKThirtyTwoBytes a, struct LDKChannelMonitor b);
16976 * Frees any resources used by the C2Tuple_BlockHashChannelMonitorZ.
16978 void C2Tuple_BlockHashChannelMonitorZ_free(struct LDKC2Tuple_BlockHashChannelMonitorZ _res);
16981 * Frees the buffer pointed to by `data` if `datalen` is non-0.
16983 void CVec_C2Tuple_BlockHashChannelMonitorZZ_free(struct LDKCVec_C2Tuple_BlockHashChannelMonitorZZ _res);
16986 * Creates a new CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ in the success state.
16988 struct LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_ok(struct LDKCVec_C2Tuple_BlockHashChannelMonitorZZ o);
16991 * Creates a new CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ in the error state.
16993 struct LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_err(enum LDKIOError e);
16996 * Checks if the given object is currently in the success state
16998 bool CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_is_ok(const struct LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ *NONNULL_PTR o);
17001 * Frees any resources used by the CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ.
17003 void CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_free(struct LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ _res);
17006 * Constructs a new COption_u16Z containing a u16
17008 struct LDKCOption_u16Z COption_u16Z_some(uint16_t o);
17011 * Constructs a new COption_u16Z containing nothing
17013 struct LDKCOption_u16Z COption_u16Z_none(void);
17016 * Frees any resources associated with the u16, if we are in the Some state
17018 void COption_u16Z_free(struct LDKCOption_u16Z _res);
17021 * Creates a new COption_u16Z which has the same data as `orig`
17022 * but with all dynamically-allocated buffers duplicated in new buffers.
17024 struct LDKCOption_u16Z COption_u16Z_clone(const struct LDKCOption_u16Z *NONNULL_PTR orig);
17027 * Creates a new CResult_NoneAPIErrorZ in the success state.
17029 struct LDKCResult_NoneAPIErrorZ CResult_NoneAPIErrorZ_ok(void);
17032 * Creates a new CResult_NoneAPIErrorZ in the error state.
17034 struct LDKCResult_NoneAPIErrorZ CResult_NoneAPIErrorZ_err(struct LDKAPIError e);
17037 * Checks if the given object is currently in the success state
17039 bool CResult_NoneAPIErrorZ_is_ok(const struct LDKCResult_NoneAPIErrorZ *NONNULL_PTR o);
17042 * Frees any resources used by the CResult_NoneAPIErrorZ.
17044 void CResult_NoneAPIErrorZ_free(struct LDKCResult_NoneAPIErrorZ _res);
17047 * Creates a new CResult_NoneAPIErrorZ which has the same data as `orig`
17048 * but with all dynamically-allocated buffers duplicated in new buffers.
17050 struct LDKCResult_NoneAPIErrorZ CResult_NoneAPIErrorZ_clone(const struct LDKCResult_NoneAPIErrorZ *NONNULL_PTR orig);
17053 * Frees the buffer pointed to by `data` if `datalen` is non-0.
17055 void CVec_CResult_NoneAPIErrorZZ_free(struct LDKCVec_CResult_NoneAPIErrorZZ _res);
17058 * Frees the buffer pointed to by `data` if `datalen` is non-0.
17060 void CVec_APIErrorZ_free(struct LDKCVec_APIErrorZ _res);
17063 * Creates a new CResult__u832APIErrorZ in the success state.
17065 struct LDKCResult__u832APIErrorZ CResult__u832APIErrorZ_ok(struct LDKThirtyTwoBytes o);
17068 * Creates a new CResult__u832APIErrorZ in the error state.
17070 struct LDKCResult__u832APIErrorZ CResult__u832APIErrorZ_err(struct LDKAPIError e);
17073 * Checks if the given object is currently in the success state
17075 bool CResult__u832APIErrorZ_is_ok(const struct LDKCResult__u832APIErrorZ *NONNULL_PTR o);
17078 * Frees any resources used by the CResult__u832APIErrorZ.
17080 void CResult__u832APIErrorZ_free(struct LDKCResult__u832APIErrorZ _res);
17083 * Creates a new CResult__u832APIErrorZ which has the same data as `orig`
17084 * but with all dynamically-allocated buffers duplicated in new buffers.
17086 struct LDKCResult__u832APIErrorZ CResult__u832APIErrorZ_clone(const struct LDKCResult__u832APIErrorZ *NONNULL_PTR orig);
17089 * Creates a new CResult_NonePaymentSendFailureZ in the success state.
17091 struct LDKCResult_NonePaymentSendFailureZ CResult_NonePaymentSendFailureZ_ok(void);
17094 * Creates a new CResult_NonePaymentSendFailureZ in the error state.
17096 struct LDKCResult_NonePaymentSendFailureZ CResult_NonePaymentSendFailureZ_err(struct LDKPaymentSendFailure e);
17099 * Checks if the given object is currently in the success state
17101 bool CResult_NonePaymentSendFailureZ_is_ok(const struct LDKCResult_NonePaymentSendFailureZ *NONNULL_PTR o);
17104 * Frees any resources used by the CResult_NonePaymentSendFailureZ.
17106 void CResult_NonePaymentSendFailureZ_free(struct LDKCResult_NonePaymentSendFailureZ _res);
17109 * Creates a new CResult_NonePaymentSendFailureZ which has the same data as `orig`
17110 * but with all dynamically-allocated buffers duplicated in new buffers.
17112 struct LDKCResult_NonePaymentSendFailureZ CResult_NonePaymentSendFailureZ_clone(const struct LDKCResult_NonePaymentSendFailureZ *NONNULL_PTR orig);
17115 * Creates a new CResult_PaymentHashPaymentSendFailureZ in the success state.
17117 struct LDKCResult_PaymentHashPaymentSendFailureZ CResult_PaymentHashPaymentSendFailureZ_ok(struct LDKThirtyTwoBytes o);
17120 * Creates a new CResult_PaymentHashPaymentSendFailureZ in the error state.
17122 struct LDKCResult_PaymentHashPaymentSendFailureZ CResult_PaymentHashPaymentSendFailureZ_err(struct LDKPaymentSendFailure e);
17125 * Checks if the given object is currently in the success state
17127 bool CResult_PaymentHashPaymentSendFailureZ_is_ok(const struct LDKCResult_PaymentHashPaymentSendFailureZ *NONNULL_PTR o);
17130 * Frees any resources used by the CResult_PaymentHashPaymentSendFailureZ.
17132 void CResult_PaymentHashPaymentSendFailureZ_free(struct LDKCResult_PaymentHashPaymentSendFailureZ _res);
17135 * Creates a new CResult_PaymentHashPaymentSendFailureZ which has the same data as `orig`
17136 * but with all dynamically-allocated buffers duplicated in new buffers.
17138 struct LDKCResult_PaymentHashPaymentSendFailureZ CResult_PaymentHashPaymentSendFailureZ_clone(const struct LDKCResult_PaymentHashPaymentSendFailureZ *NONNULL_PTR orig);
17141 * Creates a new tuple which has the same data as `orig`
17142 * but with all dynamically-allocated buffers duplicated in new buffers.
17144 struct LDKC2Tuple_PaymentHashPaymentIdZ C2Tuple_PaymentHashPaymentIdZ_clone(const struct LDKC2Tuple_PaymentHashPaymentIdZ *NONNULL_PTR orig);
17147 * Creates a new C2Tuple_PaymentHashPaymentIdZ from the contained elements.
17149 struct LDKC2Tuple_PaymentHashPaymentIdZ C2Tuple_PaymentHashPaymentIdZ_new(struct LDKThirtyTwoBytes a, struct LDKThirtyTwoBytes b);
17152 * Frees any resources used by the C2Tuple_PaymentHashPaymentIdZ.
17154 void C2Tuple_PaymentHashPaymentIdZ_free(struct LDKC2Tuple_PaymentHashPaymentIdZ _res);
17157 * Creates a new CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ in the success state.
17159 struct LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_ok(struct LDKC2Tuple_PaymentHashPaymentIdZ o);
17162 * Creates a new CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ in the error state.
17164 struct LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_err(struct LDKPaymentSendFailure e);
17167 * Checks if the given object is currently in the success state
17169 bool CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_is_ok(const struct LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ *NONNULL_PTR o);
17172 * Frees any resources used by the CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ.
17174 void CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_free(struct LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ _res);
17177 * Creates a new CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ which has the same data as `orig`
17178 * but with all dynamically-allocated buffers duplicated in new buffers.
17180 struct LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_clone(const struct LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ *NONNULL_PTR orig);
17183 * Frees the buffer pointed to by `data` if `datalen` is non-0.
17185 void CVec_ThirtyTwoBytesZ_free(struct LDKCVec_ThirtyTwoBytesZ _res);
17188 * Creates a new tuple which has the same data as `orig`
17189 * but with all dynamically-allocated buffers duplicated in new buffers.
17191 struct LDKC2Tuple_PaymentHashPaymentSecretZ C2Tuple_PaymentHashPaymentSecretZ_clone(const struct LDKC2Tuple_PaymentHashPaymentSecretZ *NONNULL_PTR orig);
17194 * Creates a new C2Tuple_PaymentHashPaymentSecretZ from the contained elements.
17196 struct LDKC2Tuple_PaymentHashPaymentSecretZ C2Tuple_PaymentHashPaymentSecretZ_new(struct LDKThirtyTwoBytes a, struct LDKThirtyTwoBytes b);
17199 * Frees any resources used by the C2Tuple_PaymentHashPaymentSecretZ.
17201 void C2Tuple_PaymentHashPaymentSecretZ_free(struct LDKC2Tuple_PaymentHashPaymentSecretZ _res);
17204 * Creates a new CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ in the success state.
17206 struct LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_ok(struct LDKC2Tuple_PaymentHashPaymentSecretZ o);
17209 * Creates a new CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ in the error state.
17211 struct LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_err(void);
17214 * Checks if the given object is currently in the success state
17216 bool CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_is_ok(const struct LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ *NONNULL_PTR o);
17219 * Frees any resources used by the CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ.
17221 void CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_free(struct LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ _res);
17224 * Creates a new CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ which has the same data as `orig`
17225 * but with all dynamically-allocated buffers duplicated in new buffers.
17227 struct LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_clone(const struct LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ *NONNULL_PTR orig);
17230 * Creates a new CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ in the success state.
17232 struct LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_ok(struct LDKC2Tuple_PaymentHashPaymentSecretZ o);
17235 * Creates a new CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ in the error state.
17237 struct LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_err(struct LDKAPIError e);
17240 * Checks if the given object is currently in the success state
17242 bool CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_is_ok(const struct LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ *NONNULL_PTR o);
17245 * Frees any resources used by the CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ.
17247 void CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_free(struct LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ _res);
17250 * Creates a new CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ which has the same data as `orig`
17251 * but with all dynamically-allocated buffers duplicated in new buffers.
17253 struct LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_clone(const struct LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ *NONNULL_PTR orig);
17256 * Creates a new CResult_PaymentSecretNoneZ in the success state.
17258 struct LDKCResult_PaymentSecretNoneZ CResult_PaymentSecretNoneZ_ok(struct LDKThirtyTwoBytes o);
17261 * Creates a new CResult_PaymentSecretNoneZ in the error state.
17263 struct LDKCResult_PaymentSecretNoneZ CResult_PaymentSecretNoneZ_err(void);
17266 * Checks if the given object is currently in the success state
17268 bool CResult_PaymentSecretNoneZ_is_ok(const struct LDKCResult_PaymentSecretNoneZ *NONNULL_PTR o);
17271 * Frees any resources used by the CResult_PaymentSecretNoneZ.
17273 void CResult_PaymentSecretNoneZ_free(struct LDKCResult_PaymentSecretNoneZ _res);
17276 * Creates a new CResult_PaymentSecretNoneZ which has the same data as `orig`
17277 * but with all dynamically-allocated buffers duplicated in new buffers.
17279 struct LDKCResult_PaymentSecretNoneZ CResult_PaymentSecretNoneZ_clone(const struct LDKCResult_PaymentSecretNoneZ *NONNULL_PTR orig);
17282 * Creates a new CResult_PaymentSecretAPIErrorZ in the success state.
17284 struct LDKCResult_PaymentSecretAPIErrorZ CResult_PaymentSecretAPIErrorZ_ok(struct LDKThirtyTwoBytes o);
17287 * Creates a new CResult_PaymentSecretAPIErrorZ in the error state.
17289 struct LDKCResult_PaymentSecretAPIErrorZ CResult_PaymentSecretAPIErrorZ_err(struct LDKAPIError e);
17292 * Checks if the given object is currently in the success state
17294 bool CResult_PaymentSecretAPIErrorZ_is_ok(const struct LDKCResult_PaymentSecretAPIErrorZ *NONNULL_PTR o);
17297 * Frees any resources used by the CResult_PaymentSecretAPIErrorZ.
17299 void CResult_PaymentSecretAPIErrorZ_free(struct LDKCResult_PaymentSecretAPIErrorZ _res);
17302 * Creates a new CResult_PaymentSecretAPIErrorZ which has the same data as `orig`
17303 * but with all dynamically-allocated buffers duplicated in new buffers.
17305 struct LDKCResult_PaymentSecretAPIErrorZ CResult_PaymentSecretAPIErrorZ_clone(const struct LDKCResult_PaymentSecretAPIErrorZ *NONNULL_PTR orig);
17308 * Creates a new CResult_PaymentPreimageAPIErrorZ in the success state.
17310 struct LDKCResult_PaymentPreimageAPIErrorZ CResult_PaymentPreimageAPIErrorZ_ok(struct LDKThirtyTwoBytes o);
17313 * Creates a new CResult_PaymentPreimageAPIErrorZ in the error state.
17315 struct LDKCResult_PaymentPreimageAPIErrorZ CResult_PaymentPreimageAPIErrorZ_err(struct LDKAPIError e);
17318 * Checks if the given object is currently in the success state
17320 bool CResult_PaymentPreimageAPIErrorZ_is_ok(const struct LDKCResult_PaymentPreimageAPIErrorZ *NONNULL_PTR o);
17323 * Frees any resources used by the CResult_PaymentPreimageAPIErrorZ.
17325 void CResult_PaymentPreimageAPIErrorZ_free(struct LDKCResult_PaymentPreimageAPIErrorZ _res);
17328 * Creates a new CResult_PaymentPreimageAPIErrorZ which has the same data as `orig`
17329 * but with all dynamically-allocated buffers duplicated in new buffers.
17331 struct LDKCResult_PaymentPreimageAPIErrorZ CResult_PaymentPreimageAPIErrorZ_clone(const struct LDKCResult_PaymentPreimageAPIErrorZ *NONNULL_PTR orig);
17334 * Creates a new CResult_CounterpartyForwardingInfoDecodeErrorZ in the success state.
17336 struct LDKCResult_CounterpartyForwardingInfoDecodeErrorZ CResult_CounterpartyForwardingInfoDecodeErrorZ_ok(struct LDKCounterpartyForwardingInfo o);
17339 * Creates a new CResult_CounterpartyForwardingInfoDecodeErrorZ in the error state.
17341 struct LDKCResult_CounterpartyForwardingInfoDecodeErrorZ CResult_CounterpartyForwardingInfoDecodeErrorZ_err(struct LDKDecodeError e);
17344 * Checks if the given object is currently in the success state
17346 bool CResult_CounterpartyForwardingInfoDecodeErrorZ_is_ok(const struct LDKCResult_CounterpartyForwardingInfoDecodeErrorZ *NONNULL_PTR o);
17349 * Frees any resources used by the CResult_CounterpartyForwardingInfoDecodeErrorZ.
17351 void CResult_CounterpartyForwardingInfoDecodeErrorZ_free(struct LDKCResult_CounterpartyForwardingInfoDecodeErrorZ _res);
17354 * Creates a new CResult_CounterpartyForwardingInfoDecodeErrorZ which has the same data as `orig`
17355 * but with all dynamically-allocated buffers duplicated in new buffers.
17357 struct LDKCResult_CounterpartyForwardingInfoDecodeErrorZ CResult_CounterpartyForwardingInfoDecodeErrorZ_clone(const struct LDKCResult_CounterpartyForwardingInfoDecodeErrorZ *NONNULL_PTR orig);
17360 * Creates a new CResult_ChannelCounterpartyDecodeErrorZ in the success state.
17362 struct LDKCResult_ChannelCounterpartyDecodeErrorZ CResult_ChannelCounterpartyDecodeErrorZ_ok(struct LDKChannelCounterparty o);
17365 * Creates a new CResult_ChannelCounterpartyDecodeErrorZ in the error state.
17367 struct LDKCResult_ChannelCounterpartyDecodeErrorZ CResult_ChannelCounterpartyDecodeErrorZ_err(struct LDKDecodeError e);
17370 * Checks if the given object is currently in the success state
17372 bool CResult_ChannelCounterpartyDecodeErrorZ_is_ok(const struct LDKCResult_ChannelCounterpartyDecodeErrorZ *NONNULL_PTR o);
17375 * Frees any resources used by the CResult_ChannelCounterpartyDecodeErrorZ.
17377 void CResult_ChannelCounterpartyDecodeErrorZ_free(struct LDKCResult_ChannelCounterpartyDecodeErrorZ _res);
17380 * Creates a new CResult_ChannelCounterpartyDecodeErrorZ which has the same data as `orig`
17381 * but with all dynamically-allocated buffers duplicated in new buffers.
17383 struct LDKCResult_ChannelCounterpartyDecodeErrorZ CResult_ChannelCounterpartyDecodeErrorZ_clone(const struct LDKCResult_ChannelCounterpartyDecodeErrorZ *NONNULL_PTR orig);
17386 * Creates a new CResult_ChannelDetailsDecodeErrorZ in the success state.
17388 struct LDKCResult_ChannelDetailsDecodeErrorZ CResult_ChannelDetailsDecodeErrorZ_ok(struct LDKChannelDetails o);
17391 * Creates a new CResult_ChannelDetailsDecodeErrorZ in the error state.
17393 struct LDKCResult_ChannelDetailsDecodeErrorZ CResult_ChannelDetailsDecodeErrorZ_err(struct LDKDecodeError e);
17396 * Checks if the given object is currently in the success state
17398 bool CResult_ChannelDetailsDecodeErrorZ_is_ok(const struct LDKCResult_ChannelDetailsDecodeErrorZ *NONNULL_PTR o);
17401 * Frees any resources used by the CResult_ChannelDetailsDecodeErrorZ.
17403 void CResult_ChannelDetailsDecodeErrorZ_free(struct LDKCResult_ChannelDetailsDecodeErrorZ _res);
17406 * Creates a new CResult_ChannelDetailsDecodeErrorZ which has the same data as `orig`
17407 * but with all dynamically-allocated buffers duplicated in new buffers.
17409 struct LDKCResult_ChannelDetailsDecodeErrorZ CResult_ChannelDetailsDecodeErrorZ_clone(const struct LDKCResult_ChannelDetailsDecodeErrorZ *NONNULL_PTR orig);
17412 * Creates a new CResult_PhantomRouteHintsDecodeErrorZ in the success state.
17414 struct LDKCResult_PhantomRouteHintsDecodeErrorZ CResult_PhantomRouteHintsDecodeErrorZ_ok(struct LDKPhantomRouteHints o);
17417 * Creates a new CResult_PhantomRouteHintsDecodeErrorZ in the error state.
17419 struct LDKCResult_PhantomRouteHintsDecodeErrorZ CResult_PhantomRouteHintsDecodeErrorZ_err(struct LDKDecodeError e);
17422 * Checks if the given object is currently in the success state
17424 bool CResult_PhantomRouteHintsDecodeErrorZ_is_ok(const struct LDKCResult_PhantomRouteHintsDecodeErrorZ *NONNULL_PTR o);
17427 * Frees any resources used by the CResult_PhantomRouteHintsDecodeErrorZ.
17429 void CResult_PhantomRouteHintsDecodeErrorZ_free(struct LDKCResult_PhantomRouteHintsDecodeErrorZ _res);
17432 * Creates a new CResult_PhantomRouteHintsDecodeErrorZ which has the same data as `orig`
17433 * but with all dynamically-allocated buffers duplicated in new buffers.
17435 struct LDKCResult_PhantomRouteHintsDecodeErrorZ CResult_PhantomRouteHintsDecodeErrorZ_clone(const struct LDKCResult_PhantomRouteHintsDecodeErrorZ *NONNULL_PTR orig);
17438 * Frees the buffer pointed to by `data` if `datalen` is non-0.
17440 void CVec_ChannelMonitorZ_free(struct LDKCVec_ChannelMonitorZ _res);
17443 * Creates a new C2Tuple_BlockHashChannelManagerZ from the contained elements.
17445 struct LDKC2Tuple_BlockHashChannelManagerZ C2Tuple_BlockHashChannelManagerZ_new(struct LDKThirtyTwoBytes a, struct LDKChannelManager b);
17448 * Frees any resources used by the C2Tuple_BlockHashChannelManagerZ.
17450 void C2Tuple_BlockHashChannelManagerZ_free(struct LDKC2Tuple_BlockHashChannelManagerZ _res);
17453 * Creates a new CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ in the success state.
17455 struct LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_ok(struct LDKC2Tuple_BlockHashChannelManagerZ o);
17458 * Creates a new CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ in the error state.
17460 struct LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_err(struct LDKDecodeError e);
17463 * Checks if the given object is currently in the success state
17465 bool CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_is_ok(const struct LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ *NONNULL_PTR o);
17468 * Frees any resources used by the CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ.
17470 void CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_free(struct LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ _res);
17473 * Creates a new CResult_ChannelConfigDecodeErrorZ in the success state.
17475 struct LDKCResult_ChannelConfigDecodeErrorZ CResult_ChannelConfigDecodeErrorZ_ok(struct LDKChannelConfig o);
17478 * Creates a new CResult_ChannelConfigDecodeErrorZ in the error state.
17480 struct LDKCResult_ChannelConfigDecodeErrorZ CResult_ChannelConfigDecodeErrorZ_err(struct LDKDecodeError e);
17483 * Checks if the given object is currently in the success state
17485 bool CResult_ChannelConfigDecodeErrorZ_is_ok(const struct LDKCResult_ChannelConfigDecodeErrorZ *NONNULL_PTR o);
17488 * Frees any resources used by the CResult_ChannelConfigDecodeErrorZ.
17490 void CResult_ChannelConfigDecodeErrorZ_free(struct LDKCResult_ChannelConfigDecodeErrorZ _res);
17493 * Creates a new CResult_ChannelConfigDecodeErrorZ which has the same data as `orig`
17494 * but with all dynamically-allocated buffers duplicated in new buffers.
17496 struct LDKCResult_ChannelConfigDecodeErrorZ CResult_ChannelConfigDecodeErrorZ_clone(const struct LDKCResult_ChannelConfigDecodeErrorZ *NONNULL_PTR orig);
17499 * Creates a new CResult_OutPointDecodeErrorZ in the success state.
17501 struct LDKCResult_OutPointDecodeErrorZ CResult_OutPointDecodeErrorZ_ok(struct LDKOutPoint o);
17504 * Creates a new CResult_OutPointDecodeErrorZ in the error state.
17506 struct LDKCResult_OutPointDecodeErrorZ CResult_OutPointDecodeErrorZ_err(struct LDKDecodeError e);
17509 * Checks if the given object is currently in the success state
17511 bool CResult_OutPointDecodeErrorZ_is_ok(const struct LDKCResult_OutPointDecodeErrorZ *NONNULL_PTR o);
17514 * Frees any resources used by the CResult_OutPointDecodeErrorZ.
17516 void CResult_OutPointDecodeErrorZ_free(struct LDKCResult_OutPointDecodeErrorZ _res);
17519 * Creates a new CResult_OutPointDecodeErrorZ which has the same data as `orig`
17520 * but with all dynamically-allocated buffers duplicated in new buffers.
17522 struct LDKCResult_OutPointDecodeErrorZ CResult_OutPointDecodeErrorZ_clone(const struct LDKCResult_OutPointDecodeErrorZ *NONNULL_PTR orig);
17525 * Constructs a new COption_TypeZ containing a crate::lightning::ln::wire::Type
17527 struct LDKCOption_TypeZ COption_TypeZ_some(struct LDKType o);
17530 * Constructs a new COption_TypeZ containing nothing
17532 struct LDKCOption_TypeZ COption_TypeZ_none(void);
17535 * Frees any resources associated with the crate::lightning::ln::wire::Type, if we are in the Some state
17537 void COption_TypeZ_free(struct LDKCOption_TypeZ _res);
17540 * Creates a new CResult_COption_TypeZDecodeErrorZ in the success state.
17542 struct LDKCResult_COption_TypeZDecodeErrorZ CResult_COption_TypeZDecodeErrorZ_ok(struct LDKCOption_TypeZ o);
17545 * Creates a new CResult_COption_TypeZDecodeErrorZ in the error state.
17547 struct LDKCResult_COption_TypeZDecodeErrorZ CResult_COption_TypeZDecodeErrorZ_err(struct LDKDecodeError e);
17550 * Checks if the given object is currently in the success state
17552 bool CResult_COption_TypeZDecodeErrorZ_is_ok(const struct LDKCResult_COption_TypeZDecodeErrorZ *NONNULL_PTR o);
17555 * Frees any resources used by the CResult_COption_TypeZDecodeErrorZ.
17557 void CResult_COption_TypeZDecodeErrorZ_free(struct LDKCResult_COption_TypeZDecodeErrorZ _res);
17560 * Creates a new CResult_PaymentIdPaymentErrorZ in the success state.
17562 struct LDKCResult_PaymentIdPaymentErrorZ CResult_PaymentIdPaymentErrorZ_ok(struct LDKThirtyTwoBytes o);
17565 * Creates a new CResult_PaymentIdPaymentErrorZ in the error state.
17567 struct LDKCResult_PaymentIdPaymentErrorZ CResult_PaymentIdPaymentErrorZ_err(struct LDKPaymentError e);
17570 * Checks if the given object is currently in the success state
17572 bool CResult_PaymentIdPaymentErrorZ_is_ok(const struct LDKCResult_PaymentIdPaymentErrorZ *NONNULL_PTR o);
17575 * Frees any resources used by the CResult_PaymentIdPaymentErrorZ.
17577 void CResult_PaymentIdPaymentErrorZ_free(struct LDKCResult_PaymentIdPaymentErrorZ _res);
17580 * Creates a new CResult_PaymentIdPaymentErrorZ which has the same data as `orig`
17581 * but with all dynamically-allocated buffers duplicated in new buffers.
17583 struct LDKCResult_PaymentIdPaymentErrorZ CResult_PaymentIdPaymentErrorZ_clone(const struct LDKCResult_PaymentIdPaymentErrorZ *NONNULL_PTR orig);
17586 * Creates a new CResult_NonePaymentErrorZ in the success state.
17588 struct LDKCResult_NonePaymentErrorZ CResult_NonePaymentErrorZ_ok(void);
17591 * Creates a new CResult_NonePaymentErrorZ in the error state.
17593 struct LDKCResult_NonePaymentErrorZ CResult_NonePaymentErrorZ_err(struct LDKPaymentError e);
17596 * Checks if the given object is currently in the success state
17598 bool CResult_NonePaymentErrorZ_is_ok(const struct LDKCResult_NonePaymentErrorZ *NONNULL_PTR o);
17601 * Frees any resources used by the CResult_NonePaymentErrorZ.
17603 void CResult_NonePaymentErrorZ_free(struct LDKCResult_NonePaymentErrorZ _res);
17606 * Creates a new CResult_NonePaymentErrorZ which has the same data as `orig`
17607 * but with all dynamically-allocated buffers duplicated in new buffers.
17609 struct LDKCResult_NonePaymentErrorZ CResult_NonePaymentErrorZ_clone(const struct LDKCResult_NonePaymentErrorZ *NONNULL_PTR orig);
17612 * Creates a new CResult_StringErrorZ in the success state.
17614 struct LDKCResult_StringErrorZ CResult_StringErrorZ_ok(struct LDKStr o);
17617 * Creates a new CResult_StringErrorZ in the error state.
17619 struct LDKCResult_StringErrorZ CResult_StringErrorZ_err(enum LDKSecp256k1Error e);
17622 * Checks if the given object is currently in the success state
17624 bool CResult_StringErrorZ_is_ok(const struct LDKCResult_StringErrorZ *NONNULL_PTR o);
17627 * Frees any resources used by the CResult_StringErrorZ.
17629 void CResult_StringErrorZ_free(struct LDKCResult_StringErrorZ _res);
17632 * Creates a new CResult_StringErrorZ which has the same data as `orig`
17633 * but with all dynamically-allocated buffers duplicated in new buffers.
17635 struct LDKCResult_StringErrorZ CResult_StringErrorZ_clone(const struct LDKCResult_StringErrorZ *NONNULL_PTR orig);
17638 * Creates a new CResult_PublicKeyErrorZ in the success state.
17640 struct LDKCResult_PublicKeyErrorZ CResult_PublicKeyErrorZ_ok(struct LDKPublicKey o);
17643 * Creates a new CResult_PublicKeyErrorZ in the error state.
17645 struct LDKCResult_PublicKeyErrorZ CResult_PublicKeyErrorZ_err(enum LDKSecp256k1Error e);
17648 * Checks if the given object is currently in the success state
17650 bool CResult_PublicKeyErrorZ_is_ok(const struct LDKCResult_PublicKeyErrorZ *NONNULL_PTR o);
17653 * Frees any resources used by the CResult_PublicKeyErrorZ.
17655 void CResult_PublicKeyErrorZ_free(struct LDKCResult_PublicKeyErrorZ _res);
17658 * Creates a new CResult_PublicKeyErrorZ which has the same data as `orig`
17659 * but with all dynamically-allocated buffers duplicated in new buffers.
17661 struct LDKCResult_PublicKeyErrorZ CResult_PublicKeyErrorZ_clone(const struct LDKCResult_PublicKeyErrorZ *NONNULL_PTR orig);
17664 * Creates a new CResult_ChannelMonitorUpdateDecodeErrorZ in the success state.
17666 struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ CResult_ChannelMonitorUpdateDecodeErrorZ_ok(struct LDKChannelMonitorUpdate o);
17669 * Creates a new CResult_ChannelMonitorUpdateDecodeErrorZ in the error state.
17671 struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ CResult_ChannelMonitorUpdateDecodeErrorZ_err(struct LDKDecodeError e);
17674 * Checks if the given object is currently in the success state
17676 bool CResult_ChannelMonitorUpdateDecodeErrorZ_is_ok(const struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ *NONNULL_PTR o);
17679 * Frees any resources used by the CResult_ChannelMonitorUpdateDecodeErrorZ.
17681 void CResult_ChannelMonitorUpdateDecodeErrorZ_free(struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ _res);
17684 * Creates a new CResult_ChannelMonitorUpdateDecodeErrorZ which has the same data as `orig`
17685 * but with all dynamically-allocated buffers duplicated in new buffers.
17687 struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ CResult_ChannelMonitorUpdateDecodeErrorZ_clone(const struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ *NONNULL_PTR orig);
17690 * Constructs a new COption_MonitorEventZ containing a crate::lightning::chain::channelmonitor::MonitorEvent
17692 struct LDKCOption_MonitorEventZ COption_MonitorEventZ_some(struct LDKMonitorEvent o);
17695 * Constructs a new COption_MonitorEventZ containing nothing
17697 struct LDKCOption_MonitorEventZ COption_MonitorEventZ_none(void);
17700 * Frees any resources associated with the crate::lightning::chain::channelmonitor::MonitorEvent, if we are in the Some state
17702 void COption_MonitorEventZ_free(struct LDKCOption_MonitorEventZ _res);
17705 * Creates a new COption_MonitorEventZ which has the same data as `orig`
17706 * but with all dynamically-allocated buffers duplicated in new buffers.
17708 struct LDKCOption_MonitorEventZ COption_MonitorEventZ_clone(const struct LDKCOption_MonitorEventZ *NONNULL_PTR orig);
17711 * Creates a new CResult_COption_MonitorEventZDecodeErrorZ in the success state.
17713 struct LDKCResult_COption_MonitorEventZDecodeErrorZ CResult_COption_MonitorEventZDecodeErrorZ_ok(struct LDKCOption_MonitorEventZ o);
17716 * Creates a new CResult_COption_MonitorEventZDecodeErrorZ in the error state.
17718 struct LDKCResult_COption_MonitorEventZDecodeErrorZ CResult_COption_MonitorEventZDecodeErrorZ_err(struct LDKDecodeError e);
17721 * Checks if the given object is currently in the success state
17723 bool CResult_COption_MonitorEventZDecodeErrorZ_is_ok(const struct LDKCResult_COption_MonitorEventZDecodeErrorZ *NONNULL_PTR o);
17726 * Frees any resources used by the CResult_COption_MonitorEventZDecodeErrorZ.
17728 void CResult_COption_MonitorEventZDecodeErrorZ_free(struct LDKCResult_COption_MonitorEventZDecodeErrorZ _res);
17731 * Creates a new CResult_COption_MonitorEventZDecodeErrorZ which has the same data as `orig`
17732 * but with all dynamically-allocated buffers duplicated in new buffers.
17734 struct LDKCResult_COption_MonitorEventZDecodeErrorZ CResult_COption_MonitorEventZDecodeErrorZ_clone(const struct LDKCResult_COption_MonitorEventZDecodeErrorZ *NONNULL_PTR orig);
17737 * Creates a new CResult_HTLCUpdateDecodeErrorZ in the success state.
17739 struct LDKCResult_HTLCUpdateDecodeErrorZ CResult_HTLCUpdateDecodeErrorZ_ok(struct LDKHTLCUpdate o);
17742 * Creates a new CResult_HTLCUpdateDecodeErrorZ in the error state.
17744 struct LDKCResult_HTLCUpdateDecodeErrorZ CResult_HTLCUpdateDecodeErrorZ_err(struct LDKDecodeError e);
17747 * Checks if the given object is currently in the success state
17749 bool CResult_HTLCUpdateDecodeErrorZ_is_ok(const struct LDKCResult_HTLCUpdateDecodeErrorZ *NONNULL_PTR o);
17752 * Frees any resources used by the CResult_HTLCUpdateDecodeErrorZ.
17754 void CResult_HTLCUpdateDecodeErrorZ_free(struct LDKCResult_HTLCUpdateDecodeErrorZ _res);
17757 * Creates a new CResult_HTLCUpdateDecodeErrorZ which has the same data as `orig`
17758 * but with all dynamically-allocated buffers duplicated in new buffers.
17760 struct LDKCResult_HTLCUpdateDecodeErrorZ CResult_HTLCUpdateDecodeErrorZ_clone(const struct LDKCResult_HTLCUpdateDecodeErrorZ *NONNULL_PTR orig);
17763 * Creates a new tuple which has the same data as `orig`
17764 * but with all dynamically-allocated buffers duplicated in new buffers.
17766 struct LDKC2Tuple_OutPointScriptZ C2Tuple_OutPointScriptZ_clone(const struct LDKC2Tuple_OutPointScriptZ *NONNULL_PTR orig);
17769 * Creates a new C2Tuple_OutPointScriptZ from the contained elements.
17771 struct LDKC2Tuple_OutPointScriptZ C2Tuple_OutPointScriptZ_new(struct LDKOutPoint a, struct LDKCVec_u8Z b);
17774 * Frees any resources used by the C2Tuple_OutPointScriptZ.
17776 void C2Tuple_OutPointScriptZ_free(struct LDKC2Tuple_OutPointScriptZ _res);
17779 * Creates a new tuple which has the same data as `orig`
17780 * but with all dynamically-allocated buffers duplicated in new buffers.
17782 struct LDKC2Tuple_u32ScriptZ C2Tuple_u32ScriptZ_clone(const struct LDKC2Tuple_u32ScriptZ *NONNULL_PTR orig);
17785 * Creates a new C2Tuple_u32ScriptZ from the contained elements.
17787 struct LDKC2Tuple_u32ScriptZ C2Tuple_u32ScriptZ_new(uint32_t a, struct LDKCVec_u8Z b);
17790 * Frees any resources used by the C2Tuple_u32ScriptZ.
17792 void C2Tuple_u32ScriptZ_free(struct LDKC2Tuple_u32ScriptZ _res);
17795 * Frees the buffer pointed to by `data` if `datalen` is non-0.
17797 void CVec_C2Tuple_u32ScriptZZ_free(struct LDKCVec_C2Tuple_u32ScriptZZ _res);
17800 * Creates a new tuple which has the same data as `orig`
17801 * but with all dynamically-allocated buffers duplicated in new buffers.
17803 struct LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_clone(const struct LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ *NONNULL_PTR orig);
17806 * Creates a new C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ from the contained elements.
17808 struct LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_new(struct LDKThirtyTwoBytes a, struct LDKCVec_C2Tuple_u32ScriptZZ b);
17811 * Frees any resources used by the C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ.
17813 void C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_free(struct LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ _res);
17816 * Frees the buffer pointed to by `data` if `datalen` is non-0.
17818 void CVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ_free(struct LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ _res);
17821 * Frees the buffer pointed to by `data` if `datalen` is non-0.
17823 void CVec_EventZ_free(struct LDKCVec_EventZ _res);
17826 * Frees the buffer pointed to by `data` if `datalen` is non-0.
17828 void CVec_TransactionZ_free(struct LDKCVec_TransactionZ _res);
17831 * Creates a new tuple which has the same data as `orig`
17832 * but with all dynamically-allocated buffers duplicated in new buffers.
17834 struct LDKC2Tuple_u32TxOutZ C2Tuple_u32TxOutZ_clone(const struct LDKC2Tuple_u32TxOutZ *NONNULL_PTR orig);
17837 * Creates a new C2Tuple_u32TxOutZ from the contained elements.
17839 struct LDKC2Tuple_u32TxOutZ C2Tuple_u32TxOutZ_new(uint32_t a, struct LDKTxOut b);
17842 * Frees any resources used by the C2Tuple_u32TxOutZ.
17844 void C2Tuple_u32TxOutZ_free(struct LDKC2Tuple_u32TxOutZ _res);
17847 * Frees the buffer pointed to by `data` if `datalen` is non-0.
17849 void CVec_C2Tuple_u32TxOutZZ_free(struct LDKCVec_C2Tuple_u32TxOutZZ _res);
17852 * Creates a new tuple which has the same data as `orig`
17853 * but with all dynamically-allocated buffers duplicated in new buffers.
17855 struct LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_clone(const struct LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ *NONNULL_PTR orig);
17858 * Creates a new C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ from the contained elements.
17860 struct LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_new(struct LDKThirtyTwoBytes a, struct LDKCVec_C2Tuple_u32TxOutZZ b);
17863 * Frees any resources used by the C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ.
17865 void C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_free(struct LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ _res);
17868 * Frees the buffer pointed to by `data` if `datalen` is non-0.
17870 void CVec_TransactionOutputsZ_free(struct LDKCVec_TransactionOutputsZ _res);
17873 * Frees the buffer pointed to by `data` if `datalen` is non-0.
17875 void CVec_BalanceZ_free(struct LDKCVec_BalanceZ _res);
17878 * Creates a new CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ in the success state.
17880 struct LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_ok(struct LDKC2Tuple_BlockHashChannelMonitorZ o);
17883 * Creates a new CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ in the error state.
17885 struct LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_err(struct LDKDecodeError e);
17888 * Checks if the given object is currently in the success state
17890 bool CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_is_ok(const struct LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ *NONNULL_PTR o);
17893 * Frees any resources used by the CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ.
17895 void CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_free(struct LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ _res);
17898 * Creates a new C2Tuple_PublicKeyTypeZ from the contained elements.
17900 struct LDKC2Tuple_PublicKeyTypeZ C2Tuple_PublicKeyTypeZ_new(struct LDKPublicKey a, struct LDKType b);
17903 * Frees any resources used by the C2Tuple_PublicKeyTypeZ.
17905 void C2Tuple_PublicKeyTypeZ_free(struct LDKC2Tuple_PublicKeyTypeZ _res);
17908 * Frees the buffer pointed to by `data` if `datalen` is non-0.
17910 void CVec_C2Tuple_PublicKeyTypeZZ_free(struct LDKCVec_C2Tuple_PublicKeyTypeZZ _res);
17913 * Constructs a new COption_CustomOnionMessageContentsZ containing a crate::lightning::onion_message::packet::CustomOnionMessageContents
17915 struct LDKCOption_CustomOnionMessageContentsZ COption_CustomOnionMessageContentsZ_some(struct LDKCustomOnionMessageContents o);
17918 * Constructs a new COption_CustomOnionMessageContentsZ containing nothing
17920 struct LDKCOption_CustomOnionMessageContentsZ COption_CustomOnionMessageContentsZ_none(void);
17923 * Frees any resources associated with the crate::lightning::onion_message::packet::CustomOnionMessageContents, if we are in the Some state
17925 void COption_CustomOnionMessageContentsZ_free(struct LDKCOption_CustomOnionMessageContentsZ _res);
17928 * Creates a new CResult_COption_CustomOnionMessageContentsZDecodeErrorZ in the success state.
17930 struct LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ CResult_COption_CustomOnionMessageContentsZDecodeErrorZ_ok(struct LDKCOption_CustomOnionMessageContentsZ o);
17933 * Creates a new CResult_COption_CustomOnionMessageContentsZDecodeErrorZ in the error state.
17935 struct LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ CResult_COption_CustomOnionMessageContentsZDecodeErrorZ_err(struct LDKDecodeError e);
17938 * Checks if the given object is currently in the success state
17940 bool CResult_COption_CustomOnionMessageContentsZDecodeErrorZ_is_ok(const struct LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ *NONNULL_PTR o);
17943 * Frees any resources used by the CResult_COption_CustomOnionMessageContentsZDecodeErrorZ.
17945 void CResult_COption_CustomOnionMessageContentsZDecodeErrorZ_free(struct LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ _res);
17948 * Constructs a new COption_NetAddressZ containing a crate::lightning::ln::msgs::NetAddress
17950 struct LDKCOption_NetAddressZ COption_NetAddressZ_some(struct LDKNetAddress o);
17953 * Constructs a new COption_NetAddressZ containing nothing
17955 struct LDKCOption_NetAddressZ COption_NetAddressZ_none(void);
17958 * Frees any resources associated with the crate::lightning::ln::msgs::NetAddress, if we are in the Some state
17960 void COption_NetAddressZ_free(struct LDKCOption_NetAddressZ _res);
17963 * Creates a new COption_NetAddressZ which has the same data as `orig`
17964 * but with all dynamically-allocated buffers duplicated in new buffers.
17966 struct LDKCOption_NetAddressZ COption_NetAddressZ_clone(const struct LDKCOption_NetAddressZ *NONNULL_PTR orig);
17969 * Creates a new CResult_CVec_u8ZPeerHandleErrorZ in the success state.
17971 struct LDKCResult_CVec_u8ZPeerHandleErrorZ CResult_CVec_u8ZPeerHandleErrorZ_ok(struct LDKCVec_u8Z o);
17974 * Creates a new CResult_CVec_u8ZPeerHandleErrorZ in the error state.
17976 struct LDKCResult_CVec_u8ZPeerHandleErrorZ CResult_CVec_u8ZPeerHandleErrorZ_err(struct LDKPeerHandleError e);
17979 * Checks if the given object is currently in the success state
17981 bool CResult_CVec_u8ZPeerHandleErrorZ_is_ok(const struct LDKCResult_CVec_u8ZPeerHandleErrorZ *NONNULL_PTR o);
17984 * Frees any resources used by the CResult_CVec_u8ZPeerHandleErrorZ.
17986 void CResult_CVec_u8ZPeerHandleErrorZ_free(struct LDKCResult_CVec_u8ZPeerHandleErrorZ _res);
17989 * Creates a new CResult_CVec_u8ZPeerHandleErrorZ which has the same data as `orig`
17990 * but with all dynamically-allocated buffers duplicated in new buffers.
17992 struct LDKCResult_CVec_u8ZPeerHandleErrorZ CResult_CVec_u8ZPeerHandleErrorZ_clone(const struct LDKCResult_CVec_u8ZPeerHandleErrorZ *NONNULL_PTR orig);
17995 * Creates a new CResult_NonePeerHandleErrorZ in the success state.
17997 struct LDKCResult_NonePeerHandleErrorZ CResult_NonePeerHandleErrorZ_ok(void);
18000 * Creates a new CResult_NonePeerHandleErrorZ in the error state.
18002 struct LDKCResult_NonePeerHandleErrorZ CResult_NonePeerHandleErrorZ_err(struct LDKPeerHandleError e);
18005 * Checks if the given object is currently in the success state
18007 bool CResult_NonePeerHandleErrorZ_is_ok(const struct LDKCResult_NonePeerHandleErrorZ *NONNULL_PTR o);
18010 * Frees any resources used by the CResult_NonePeerHandleErrorZ.
18012 void CResult_NonePeerHandleErrorZ_free(struct LDKCResult_NonePeerHandleErrorZ _res);
18015 * Creates a new CResult_NonePeerHandleErrorZ which has the same data as `orig`
18016 * but with all dynamically-allocated buffers duplicated in new buffers.
18018 struct LDKCResult_NonePeerHandleErrorZ CResult_NonePeerHandleErrorZ_clone(const struct LDKCResult_NonePeerHandleErrorZ *NONNULL_PTR orig);
18021 * Creates a new CResult_boolPeerHandleErrorZ in the success state.
18023 struct LDKCResult_boolPeerHandleErrorZ CResult_boolPeerHandleErrorZ_ok(bool o);
18026 * Creates a new CResult_boolPeerHandleErrorZ in the error state.
18028 struct LDKCResult_boolPeerHandleErrorZ CResult_boolPeerHandleErrorZ_err(struct LDKPeerHandleError e);
18031 * Checks if the given object is currently in the success state
18033 bool CResult_boolPeerHandleErrorZ_is_ok(const struct LDKCResult_boolPeerHandleErrorZ *NONNULL_PTR o);
18036 * Frees any resources used by the CResult_boolPeerHandleErrorZ.
18038 void CResult_boolPeerHandleErrorZ_free(struct LDKCResult_boolPeerHandleErrorZ _res);
18041 * Creates a new CResult_boolPeerHandleErrorZ which has the same data as `orig`
18042 * but with all dynamically-allocated buffers duplicated in new buffers.
18044 struct LDKCResult_boolPeerHandleErrorZ CResult_boolPeerHandleErrorZ_clone(const struct LDKCResult_boolPeerHandleErrorZ *NONNULL_PTR orig);
18047 * Creates a new CResult_NoneSendErrorZ in the success state.
18049 struct LDKCResult_NoneSendErrorZ CResult_NoneSendErrorZ_ok(void);
18052 * Creates a new CResult_NoneSendErrorZ in the error state.
18054 struct LDKCResult_NoneSendErrorZ CResult_NoneSendErrorZ_err(struct LDKSendError e);
18057 * Checks if the given object is currently in the success state
18059 bool CResult_NoneSendErrorZ_is_ok(const struct LDKCResult_NoneSendErrorZ *NONNULL_PTR o);
18062 * Frees any resources used by the CResult_NoneSendErrorZ.
18064 void CResult_NoneSendErrorZ_free(struct LDKCResult_NoneSendErrorZ _res);
18067 * Creates a new CResult_SiPrefixParseErrorZ in the success state.
18069 struct LDKCResult_SiPrefixParseErrorZ CResult_SiPrefixParseErrorZ_ok(enum LDKSiPrefix o);
18072 * Creates a new CResult_SiPrefixParseErrorZ in the error state.
18074 struct LDKCResult_SiPrefixParseErrorZ CResult_SiPrefixParseErrorZ_err(struct LDKParseError e);
18077 * Checks if the given object is currently in the success state
18079 bool CResult_SiPrefixParseErrorZ_is_ok(const struct LDKCResult_SiPrefixParseErrorZ *NONNULL_PTR o);
18082 * Frees any resources used by the CResult_SiPrefixParseErrorZ.
18084 void CResult_SiPrefixParseErrorZ_free(struct LDKCResult_SiPrefixParseErrorZ _res);
18087 * Creates a new CResult_SiPrefixParseErrorZ which has the same data as `orig`
18088 * but with all dynamically-allocated buffers duplicated in new buffers.
18090 struct LDKCResult_SiPrefixParseErrorZ CResult_SiPrefixParseErrorZ_clone(const struct LDKCResult_SiPrefixParseErrorZ *NONNULL_PTR orig);
18093 * Creates a new CResult_InvoiceParseOrSemanticErrorZ in the success state.
18095 struct LDKCResult_InvoiceParseOrSemanticErrorZ CResult_InvoiceParseOrSemanticErrorZ_ok(struct LDKInvoice o);
18098 * Creates a new CResult_InvoiceParseOrSemanticErrorZ in the error state.
18100 struct LDKCResult_InvoiceParseOrSemanticErrorZ CResult_InvoiceParseOrSemanticErrorZ_err(struct LDKParseOrSemanticError e);
18103 * Checks if the given object is currently in the success state
18105 bool CResult_InvoiceParseOrSemanticErrorZ_is_ok(const struct LDKCResult_InvoiceParseOrSemanticErrorZ *NONNULL_PTR o);
18108 * Frees any resources used by the CResult_InvoiceParseOrSemanticErrorZ.
18110 void CResult_InvoiceParseOrSemanticErrorZ_free(struct LDKCResult_InvoiceParseOrSemanticErrorZ _res);
18113 * Creates a new CResult_InvoiceParseOrSemanticErrorZ which has the same data as `orig`
18114 * but with all dynamically-allocated buffers duplicated in new buffers.
18116 struct LDKCResult_InvoiceParseOrSemanticErrorZ CResult_InvoiceParseOrSemanticErrorZ_clone(const struct LDKCResult_InvoiceParseOrSemanticErrorZ *NONNULL_PTR orig);
18119 * Creates a new CResult_SignedRawInvoiceParseErrorZ in the success state.
18121 struct LDKCResult_SignedRawInvoiceParseErrorZ CResult_SignedRawInvoiceParseErrorZ_ok(struct LDKSignedRawInvoice o);
18124 * Creates a new CResult_SignedRawInvoiceParseErrorZ in the error state.
18126 struct LDKCResult_SignedRawInvoiceParseErrorZ CResult_SignedRawInvoiceParseErrorZ_err(struct LDKParseError e);
18129 * Checks if the given object is currently in the success state
18131 bool CResult_SignedRawInvoiceParseErrorZ_is_ok(const struct LDKCResult_SignedRawInvoiceParseErrorZ *NONNULL_PTR o);
18134 * Frees any resources used by the CResult_SignedRawInvoiceParseErrorZ.
18136 void CResult_SignedRawInvoiceParseErrorZ_free(struct LDKCResult_SignedRawInvoiceParseErrorZ _res);
18139 * Creates a new CResult_SignedRawInvoiceParseErrorZ which has the same data as `orig`
18140 * but with all dynamically-allocated buffers duplicated in new buffers.
18142 struct LDKCResult_SignedRawInvoiceParseErrorZ CResult_SignedRawInvoiceParseErrorZ_clone(const struct LDKCResult_SignedRawInvoiceParseErrorZ *NONNULL_PTR orig);
18145 * Creates a new tuple which has the same data as `orig`
18146 * but with all dynamically-allocated buffers duplicated in new buffers.
18148 struct LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ C3Tuple_RawInvoice_u832InvoiceSignatureZ_clone(const struct LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ *NONNULL_PTR orig);
18151 * Creates a new C3Tuple_RawInvoice_u832InvoiceSignatureZ from the contained elements.
18153 struct LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ C3Tuple_RawInvoice_u832InvoiceSignatureZ_new(struct LDKRawInvoice a, struct LDKThirtyTwoBytes b, struct LDKInvoiceSignature c);
18156 * Frees any resources used by the C3Tuple_RawInvoice_u832InvoiceSignatureZ.
18158 void C3Tuple_RawInvoice_u832InvoiceSignatureZ_free(struct LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ _res);
18161 * Creates a new CResult_PayeePubKeyErrorZ in the success state.
18163 struct LDKCResult_PayeePubKeyErrorZ CResult_PayeePubKeyErrorZ_ok(struct LDKPayeePubKey o);
18166 * Creates a new CResult_PayeePubKeyErrorZ in the error state.
18168 struct LDKCResult_PayeePubKeyErrorZ CResult_PayeePubKeyErrorZ_err(enum LDKSecp256k1Error e);
18171 * Checks if the given object is currently in the success state
18173 bool CResult_PayeePubKeyErrorZ_is_ok(const struct LDKCResult_PayeePubKeyErrorZ *NONNULL_PTR o);
18176 * Frees any resources used by the CResult_PayeePubKeyErrorZ.
18178 void CResult_PayeePubKeyErrorZ_free(struct LDKCResult_PayeePubKeyErrorZ _res);
18181 * Creates a new CResult_PayeePubKeyErrorZ which has the same data as `orig`
18182 * but with all dynamically-allocated buffers duplicated in new buffers.
18184 struct LDKCResult_PayeePubKeyErrorZ CResult_PayeePubKeyErrorZ_clone(const struct LDKCResult_PayeePubKeyErrorZ *NONNULL_PTR orig);
18187 * Frees the buffer pointed to by `data` if `datalen` is non-0.
18189 void CVec_PrivateRouteZ_free(struct LDKCVec_PrivateRouteZ _res);
18192 * Creates a new CResult_PositiveTimestampCreationErrorZ in the success state.
18194 struct LDKCResult_PositiveTimestampCreationErrorZ CResult_PositiveTimestampCreationErrorZ_ok(struct LDKPositiveTimestamp o);
18197 * Creates a new CResult_PositiveTimestampCreationErrorZ in the error state.
18199 struct LDKCResult_PositiveTimestampCreationErrorZ CResult_PositiveTimestampCreationErrorZ_err(enum LDKCreationError e);
18202 * Checks if the given object is currently in the success state
18204 bool CResult_PositiveTimestampCreationErrorZ_is_ok(const struct LDKCResult_PositiveTimestampCreationErrorZ *NONNULL_PTR o);
18207 * Frees any resources used by the CResult_PositiveTimestampCreationErrorZ.
18209 void CResult_PositiveTimestampCreationErrorZ_free(struct LDKCResult_PositiveTimestampCreationErrorZ _res);
18212 * Creates a new CResult_PositiveTimestampCreationErrorZ which has the same data as `orig`
18213 * but with all dynamically-allocated buffers duplicated in new buffers.
18215 struct LDKCResult_PositiveTimestampCreationErrorZ CResult_PositiveTimestampCreationErrorZ_clone(const struct LDKCResult_PositiveTimestampCreationErrorZ *NONNULL_PTR orig);
18218 * Creates a new CResult_NoneSemanticErrorZ in the success state.
18220 struct LDKCResult_NoneSemanticErrorZ CResult_NoneSemanticErrorZ_ok(void);
18223 * Creates a new CResult_NoneSemanticErrorZ in the error state.
18225 struct LDKCResult_NoneSemanticErrorZ CResult_NoneSemanticErrorZ_err(enum LDKSemanticError e);
18228 * Checks if the given object is currently in the success state
18230 bool CResult_NoneSemanticErrorZ_is_ok(const struct LDKCResult_NoneSemanticErrorZ *NONNULL_PTR o);
18233 * Frees any resources used by the CResult_NoneSemanticErrorZ.
18235 void CResult_NoneSemanticErrorZ_free(struct LDKCResult_NoneSemanticErrorZ _res);
18238 * Creates a new CResult_NoneSemanticErrorZ which has the same data as `orig`
18239 * but with all dynamically-allocated buffers duplicated in new buffers.
18241 struct LDKCResult_NoneSemanticErrorZ CResult_NoneSemanticErrorZ_clone(const struct LDKCResult_NoneSemanticErrorZ *NONNULL_PTR orig);
18244 * Creates a new CResult_InvoiceSemanticErrorZ in the success state.
18246 struct LDKCResult_InvoiceSemanticErrorZ CResult_InvoiceSemanticErrorZ_ok(struct LDKInvoice o);
18249 * Creates a new CResult_InvoiceSemanticErrorZ in the error state.
18251 struct LDKCResult_InvoiceSemanticErrorZ CResult_InvoiceSemanticErrorZ_err(enum LDKSemanticError e);
18254 * Checks if the given object is currently in the success state
18256 bool CResult_InvoiceSemanticErrorZ_is_ok(const struct LDKCResult_InvoiceSemanticErrorZ *NONNULL_PTR o);
18259 * Frees any resources used by the CResult_InvoiceSemanticErrorZ.
18261 void CResult_InvoiceSemanticErrorZ_free(struct LDKCResult_InvoiceSemanticErrorZ _res);
18264 * Creates a new CResult_InvoiceSemanticErrorZ which has the same data as `orig`
18265 * but with all dynamically-allocated buffers duplicated in new buffers.
18267 struct LDKCResult_InvoiceSemanticErrorZ CResult_InvoiceSemanticErrorZ_clone(const struct LDKCResult_InvoiceSemanticErrorZ *NONNULL_PTR orig);
18270 * Creates a new CResult_DescriptionCreationErrorZ in the success state.
18272 struct LDKCResult_DescriptionCreationErrorZ CResult_DescriptionCreationErrorZ_ok(struct LDKDescription o);
18275 * Creates a new CResult_DescriptionCreationErrorZ in the error state.
18277 struct LDKCResult_DescriptionCreationErrorZ CResult_DescriptionCreationErrorZ_err(enum LDKCreationError e);
18280 * Checks if the given object is currently in the success state
18282 bool CResult_DescriptionCreationErrorZ_is_ok(const struct LDKCResult_DescriptionCreationErrorZ *NONNULL_PTR o);
18285 * Frees any resources used by the CResult_DescriptionCreationErrorZ.
18287 void CResult_DescriptionCreationErrorZ_free(struct LDKCResult_DescriptionCreationErrorZ _res);
18290 * Creates a new CResult_DescriptionCreationErrorZ which has the same data as `orig`
18291 * but with all dynamically-allocated buffers duplicated in new buffers.
18293 struct LDKCResult_DescriptionCreationErrorZ CResult_DescriptionCreationErrorZ_clone(const struct LDKCResult_DescriptionCreationErrorZ *NONNULL_PTR orig);
18296 * Creates a new CResult_PrivateRouteCreationErrorZ in the success state.
18298 struct LDKCResult_PrivateRouteCreationErrorZ CResult_PrivateRouteCreationErrorZ_ok(struct LDKPrivateRoute o);
18301 * Creates a new CResult_PrivateRouteCreationErrorZ in the error state.
18303 struct LDKCResult_PrivateRouteCreationErrorZ CResult_PrivateRouteCreationErrorZ_err(enum LDKCreationError e);
18306 * Checks if the given object is currently in the success state
18308 bool CResult_PrivateRouteCreationErrorZ_is_ok(const struct LDKCResult_PrivateRouteCreationErrorZ *NONNULL_PTR o);
18311 * Frees any resources used by the CResult_PrivateRouteCreationErrorZ.
18313 void CResult_PrivateRouteCreationErrorZ_free(struct LDKCResult_PrivateRouteCreationErrorZ _res);
18316 * Creates a new CResult_PrivateRouteCreationErrorZ which has the same data as `orig`
18317 * but with all dynamically-allocated buffers duplicated in new buffers.
18319 struct LDKCResult_PrivateRouteCreationErrorZ CResult_PrivateRouteCreationErrorZ_clone(const struct LDKCResult_PrivateRouteCreationErrorZ *NONNULL_PTR orig);
18322 * Creates a new CResult_u32GraphSyncErrorZ in the success state.
18324 struct LDKCResult_u32GraphSyncErrorZ CResult_u32GraphSyncErrorZ_ok(uint32_t o);
18327 * Creates a new CResult_u32GraphSyncErrorZ in the error state.
18329 struct LDKCResult_u32GraphSyncErrorZ CResult_u32GraphSyncErrorZ_err(struct LDKGraphSyncError e);
18332 * Checks if the given object is currently in the success state
18334 bool CResult_u32GraphSyncErrorZ_is_ok(const struct LDKCResult_u32GraphSyncErrorZ *NONNULL_PTR o);
18337 * Frees any resources used by the CResult_u32GraphSyncErrorZ.
18339 void CResult_u32GraphSyncErrorZ_free(struct LDKCResult_u32GraphSyncErrorZ _res);
18342 * Creates a new CResult_NetAddressDecodeErrorZ in the success state.
18344 struct LDKCResult_NetAddressDecodeErrorZ CResult_NetAddressDecodeErrorZ_ok(struct LDKNetAddress o);
18347 * Creates a new CResult_NetAddressDecodeErrorZ in the error state.
18349 struct LDKCResult_NetAddressDecodeErrorZ CResult_NetAddressDecodeErrorZ_err(struct LDKDecodeError e);
18352 * Checks if the given object is currently in the success state
18354 bool CResult_NetAddressDecodeErrorZ_is_ok(const struct LDKCResult_NetAddressDecodeErrorZ *NONNULL_PTR o);
18357 * Frees any resources used by the CResult_NetAddressDecodeErrorZ.
18359 void CResult_NetAddressDecodeErrorZ_free(struct LDKCResult_NetAddressDecodeErrorZ _res);
18362 * Creates a new CResult_NetAddressDecodeErrorZ which has the same data as `orig`
18363 * but with all dynamically-allocated buffers duplicated in new buffers.
18365 struct LDKCResult_NetAddressDecodeErrorZ CResult_NetAddressDecodeErrorZ_clone(const struct LDKCResult_NetAddressDecodeErrorZ *NONNULL_PTR orig);
18368 * Frees the buffer pointed to by `data` if `datalen` is non-0.
18370 void CVec_UpdateAddHTLCZ_free(struct LDKCVec_UpdateAddHTLCZ _res);
18373 * Frees the buffer pointed to by `data` if `datalen` is non-0.
18375 void CVec_UpdateFulfillHTLCZ_free(struct LDKCVec_UpdateFulfillHTLCZ _res);
18378 * Frees the buffer pointed to by `data` if `datalen` is non-0.
18380 void CVec_UpdateFailHTLCZ_free(struct LDKCVec_UpdateFailHTLCZ _res);
18383 * Frees the buffer pointed to by `data` if `datalen` is non-0.
18385 void CVec_UpdateFailMalformedHTLCZ_free(struct LDKCVec_UpdateFailMalformedHTLCZ _res);
18388 * Creates a new CResult_AcceptChannelDecodeErrorZ in the success state.
18390 struct LDKCResult_AcceptChannelDecodeErrorZ CResult_AcceptChannelDecodeErrorZ_ok(struct LDKAcceptChannel o);
18393 * Creates a new CResult_AcceptChannelDecodeErrorZ in the error state.
18395 struct LDKCResult_AcceptChannelDecodeErrorZ CResult_AcceptChannelDecodeErrorZ_err(struct LDKDecodeError e);
18398 * Checks if the given object is currently in the success state
18400 bool CResult_AcceptChannelDecodeErrorZ_is_ok(const struct LDKCResult_AcceptChannelDecodeErrorZ *NONNULL_PTR o);
18403 * Frees any resources used by the CResult_AcceptChannelDecodeErrorZ.
18405 void CResult_AcceptChannelDecodeErrorZ_free(struct LDKCResult_AcceptChannelDecodeErrorZ _res);
18408 * Creates a new CResult_AcceptChannelDecodeErrorZ which has the same data as `orig`
18409 * but with all dynamically-allocated buffers duplicated in new buffers.
18411 struct LDKCResult_AcceptChannelDecodeErrorZ CResult_AcceptChannelDecodeErrorZ_clone(const struct LDKCResult_AcceptChannelDecodeErrorZ *NONNULL_PTR orig);
18414 * Creates a new CResult_AnnouncementSignaturesDecodeErrorZ in the success state.
18416 struct LDKCResult_AnnouncementSignaturesDecodeErrorZ CResult_AnnouncementSignaturesDecodeErrorZ_ok(struct LDKAnnouncementSignatures o);
18419 * Creates a new CResult_AnnouncementSignaturesDecodeErrorZ in the error state.
18421 struct LDKCResult_AnnouncementSignaturesDecodeErrorZ CResult_AnnouncementSignaturesDecodeErrorZ_err(struct LDKDecodeError e);
18424 * Checks if the given object is currently in the success state
18426 bool CResult_AnnouncementSignaturesDecodeErrorZ_is_ok(const struct LDKCResult_AnnouncementSignaturesDecodeErrorZ *NONNULL_PTR o);
18429 * Frees any resources used by the CResult_AnnouncementSignaturesDecodeErrorZ.
18431 void CResult_AnnouncementSignaturesDecodeErrorZ_free(struct LDKCResult_AnnouncementSignaturesDecodeErrorZ _res);
18434 * Creates a new CResult_AnnouncementSignaturesDecodeErrorZ which has the same data as `orig`
18435 * but with all dynamically-allocated buffers duplicated in new buffers.
18437 struct LDKCResult_AnnouncementSignaturesDecodeErrorZ CResult_AnnouncementSignaturesDecodeErrorZ_clone(const struct LDKCResult_AnnouncementSignaturesDecodeErrorZ *NONNULL_PTR orig);
18440 * Creates a new CResult_ChannelReestablishDecodeErrorZ in the success state.
18442 struct LDKCResult_ChannelReestablishDecodeErrorZ CResult_ChannelReestablishDecodeErrorZ_ok(struct LDKChannelReestablish o);
18445 * Creates a new CResult_ChannelReestablishDecodeErrorZ in the error state.
18447 struct LDKCResult_ChannelReestablishDecodeErrorZ CResult_ChannelReestablishDecodeErrorZ_err(struct LDKDecodeError e);
18450 * Checks if the given object is currently in the success state
18452 bool CResult_ChannelReestablishDecodeErrorZ_is_ok(const struct LDKCResult_ChannelReestablishDecodeErrorZ *NONNULL_PTR o);
18455 * Frees any resources used by the CResult_ChannelReestablishDecodeErrorZ.
18457 void CResult_ChannelReestablishDecodeErrorZ_free(struct LDKCResult_ChannelReestablishDecodeErrorZ _res);
18460 * Creates a new CResult_ChannelReestablishDecodeErrorZ which has the same data as `orig`
18461 * but with all dynamically-allocated buffers duplicated in new buffers.
18463 struct LDKCResult_ChannelReestablishDecodeErrorZ CResult_ChannelReestablishDecodeErrorZ_clone(const struct LDKCResult_ChannelReestablishDecodeErrorZ *NONNULL_PTR orig);
18466 * Creates a new CResult_ClosingSignedDecodeErrorZ in the success state.
18468 struct LDKCResult_ClosingSignedDecodeErrorZ CResult_ClosingSignedDecodeErrorZ_ok(struct LDKClosingSigned o);
18471 * Creates a new CResult_ClosingSignedDecodeErrorZ in the error state.
18473 struct LDKCResult_ClosingSignedDecodeErrorZ CResult_ClosingSignedDecodeErrorZ_err(struct LDKDecodeError e);
18476 * Checks if the given object is currently in the success state
18478 bool CResult_ClosingSignedDecodeErrorZ_is_ok(const struct LDKCResult_ClosingSignedDecodeErrorZ *NONNULL_PTR o);
18481 * Frees any resources used by the CResult_ClosingSignedDecodeErrorZ.
18483 void CResult_ClosingSignedDecodeErrorZ_free(struct LDKCResult_ClosingSignedDecodeErrorZ _res);
18486 * Creates a new CResult_ClosingSignedDecodeErrorZ which has the same data as `orig`
18487 * but with all dynamically-allocated buffers duplicated in new buffers.
18489 struct LDKCResult_ClosingSignedDecodeErrorZ CResult_ClosingSignedDecodeErrorZ_clone(const struct LDKCResult_ClosingSignedDecodeErrorZ *NONNULL_PTR orig);
18492 * Creates a new CResult_ClosingSignedFeeRangeDecodeErrorZ in the success state.
18494 struct LDKCResult_ClosingSignedFeeRangeDecodeErrorZ CResult_ClosingSignedFeeRangeDecodeErrorZ_ok(struct LDKClosingSignedFeeRange o);
18497 * Creates a new CResult_ClosingSignedFeeRangeDecodeErrorZ in the error state.
18499 struct LDKCResult_ClosingSignedFeeRangeDecodeErrorZ CResult_ClosingSignedFeeRangeDecodeErrorZ_err(struct LDKDecodeError e);
18502 * Checks if the given object is currently in the success state
18504 bool CResult_ClosingSignedFeeRangeDecodeErrorZ_is_ok(const struct LDKCResult_ClosingSignedFeeRangeDecodeErrorZ *NONNULL_PTR o);
18507 * Frees any resources used by the CResult_ClosingSignedFeeRangeDecodeErrorZ.
18509 void CResult_ClosingSignedFeeRangeDecodeErrorZ_free(struct LDKCResult_ClosingSignedFeeRangeDecodeErrorZ _res);
18512 * Creates a new CResult_ClosingSignedFeeRangeDecodeErrorZ which has the same data as `orig`
18513 * but with all dynamically-allocated buffers duplicated in new buffers.
18515 struct LDKCResult_ClosingSignedFeeRangeDecodeErrorZ CResult_ClosingSignedFeeRangeDecodeErrorZ_clone(const struct LDKCResult_ClosingSignedFeeRangeDecodeErrorZ *NONNULL_PTR orig);
18518 * Creates a new CResult_CommitmentSignedDecodeErrorZ in the success state.
18520 struct LDKCResult_CommitmentSignedDecodeErrorZ CResult_CommitmentSignedDecodeErrorZ_ok(struct LDKCommitmentSigned o);
18523 * Creates a new CResult_CommitmentSignedDecodeErrorZ in the error state.
18525 struct LDKCResult_CommitmentSignedDecodeErrorZ CResult_CommitmentSignedDecodeErrorZ_err(struct LDKDecodeError e);
18528 * Checks if the given object is currently in the success state
18530 bool CResult_CommitmentSignedDecodeErrorZ_is_ok(const struct LDKCResult_CommitmentSignedDecodeErrorZ *NONNULL_PTR o);
18533 * Frees any resources used by the CResult_CommitmentSignedDecodeErrorZ.
18535 void CResult_CommitmentSignedDecodeErrorZ_free(struct LDKCResult_CommitmentSignedDecodeErrorZ _res);
18538 * Creates a new CResult_CommitmentSignedDecodeErrorZ which has the same data as `orig`
18539 * but with all dynamically-allocated buffers duplicated in new buffers.
18541 struct LDKCResult_CommitmentSignedDecodeErrorZ CResult_CommitmentSignedDecodeErrorZ_clone(const struct LDKCResult_CommitmentSignedDecodeErrorZ *NONNULL_PTR orig);
18544 * Creates a new CResult_FundingCreatedDecodeErrorZ in the success state.
18546 struct LDKCResult_FundingCreatedDecodeErrorZ CResult_FundingCreatedDecodeErrorZ_ok(struct LDKFundingCreated o);
18549 * Creates a new CResult_FundingCreatedDecodeErrorZ in the error state.
18551 struct LDKCResult_FundingCreatedDecodeErrorZ CResult_FundingCreatedDecodeErrorZ_err(struct LDKDecodeError e);
18554 * Checks if the given object is currently in the success state
18556 bool CResult_FundingCreatedDecodeErrorZ_is_ok(const struct LDKCResult_FundingCreatedDecodeErrorZ *NONNULL_PTR o);
18559 * Frees any resources used by the CResult_FundingCreatedDecodeErrorZ.
18561 void CResult_FundingCreatedDecodeErrorZ_free(struct LDKCResult_FundingCreatedDecodeErrorZ _res);
18564 * Creates a new CResult_FundingCreatedDecodeErrorZ which has the same data as `orig`
18565 * but with all dynamically-allocated buffers duplicated in new buffers.
18567 struct LDKCResult_FundingCreatedDecodeErrorZ CResult_FundingCreatedDecodeErrorZ_clone(const struct LDKCResult_FundingCreatedDecodeErrorZ *NONNULL_PTR orig);
18570 * Creates a new CResult_FundingSignedDecodeErrorZ in the success state.
18572 struct LDKCResult_FundingSignedDecodeErrorZ CResult_FundingSignedDecodeErrorZ_ok(struct LDKFundingSigned o);
18575 * Creates a new CResult_FundingSignedDecodeErrorZ in the error state.
18577 struct LDKCResult_FundingSignedDecodeErrorZ CResult_FundingSignedDecodeErrorZ_err(struct LDKDecodeError e);
18580 * Checks if the given object is currently in the success state
18582 bool CResult_FundingSignedDecodeErrorZ_is_ok(const struct LDKCResult_FundingSignedDecodeErrorZ *NONNULL_PTR o);
18585 * Frees any resources used by the CResult_FundingSignedDecodeErrorZ.
18587 void CResult_FundingSignedDecodeErrorZ_free(struct LDKCResult_FundingSignedDecodeErrorZ _res);
18590 * Creates a new CResult_FundingSignedDecodeErrorZ which has the same data as `orig`
18591 * but with all dynamically-allocated buffers duplicated in new buffers.
18593 struct LDKCResult_FundingSignedDecodeErrorZ CResult_FundingSignedDecodeErrorZ_clone(const struct LDKCResult_FundingSignedDecodeErrorZ *NONNULL_PTR orig);
18596 * Creates a new CResult_ChannelReadyDecodeErrorZ in the success state.
18598 struct LDKCResult_ChannelReadyDecodeErrorZ CResult_ChannelReadyDecodeErrorZ_ok(struct LDKChannelReady o);
18601 * Creates a new CResult_ChannelReadyDecodeErrorZ in the error state.
18603 struct LDKCResult_ChannelReadyDecodeErrorZ CResult_ChannelReadyDecodeErrorZ_err(struct LDKDecodeError e);
18606 * Checks if the given object is currently in the success state
18608 bool CResult_ChannelReadyDecodeErrorZ_is_ok(const struct LDKCResult_ChannelReadyDecodeErrorZ *NONNULL_PTR o);
18611 * Frees any resources used by the CResult_ChannelReadyDecodeErrorZ.
18613 void CResult_ChannelReadyDecodeErrorZ_free(struct LDKCResult_ChannelReadyDecodeErrorZ _res);
18616 * Creates a new CResult_ChannelReadyDecodeErrorZ which has the same data as `orig`
18617 * but with all dynamically-allocated buffers duplicated in new buffers.
18619 struct LDKCResult_ChannelReadyDecodeErrorZ CResult_ChannelReadyDecodeErrorZ_clone(const struct LDKCResult_ChannelReadyDecodeErrorZ *NONNULL_PTR orig);
18622 * Creates a new CResult_InitDecodeErrorZ in the success state.
18624 struct LDKCResult_InitDecodeErrorZ CResult_InitDecodeErrorZ_ok(struct LDKInit o);
18627 * Creates a new CResult_InitDecodeErrorZ in the error state.
18629 struct LDKCResult_InitDecodeErrorZ CResult_InitDecodeErrorZ_err(struct LDKDecodeError e);
18632 * Checks if the given object is currently in the success state
18634 bool CResult_InitDecodeErrorZ_is_ok(const struct LDKCResult_InitDecodeErrorZ *NONNULL_PTR o);
18637 * Frees any resources used by the CResult_InitDecodeErrorZ.
18639 void CResult_InitDecodeErrorZ_free(struct LDKCResult_InitDecodeErrorZ _res);
18642 * Creates a new CResult_InitDecodeErrorZ which has the same data as `orig`
18643 * but with all dynamically-allocated buffers duplicated in new buffers.
18645 struct LDKCResult_InitDecodeErrorZ CResult_InitDecodeErrorZ_clone(const struct LDKCResult_InitDecodeErrorZ *NONNULL_PTR orig);
18648 * Creates a new CResult_OpenChannelDecodeErrorZ in the success state.
18650 struct LDKCResult_OpenChannelDecodeErrorZ CResult_OpenChannelDecodeErrorZ_ok(struct LDKOpenChannel o);
18653 * Creates a new CResult_OpenChannelDecodeErrorZ in the error state.
18655 struct LDKCResult_OpenChannelDecodeErrorZ CResult_OpenChannelDecodeErrorZ_err(struct LDKDecodeError e);
18658 * Checks if the given object is currently in the success state
18660 bool CResult_OpenChannelDecodeErrorZ_is_ok(const struct LDKCResult_OpenChannelDecodeErrorZ *NONNULL_PTR o);
18663 * Frees any resources used by the CResult_OpenChannelDecodeErrorZ.
18665 void CResult_OpenChannelDecodeErrorZ_free(struct LDKCResult_OpenChannelDecodeErrorZ _res);
18668 * Creates a new CResult_OpenChannelDecodeErrorZ which has the same data as `orig`
18669 * but with all dynamically-allocated buffers duplicated in new buffers.
18671 struct LDKCResult_OpenChannelDecodeErrorZ CResult_OpenChannelDecodeErrorZ_clone(const struct LDKCResult_OpenChannelDecodeErrorZ *NONNULL_PTR orig);
18674 * Creates a new CResult_RevokeAndACKDecodeErrorZ in the success state.
18676 struct LDKCResult_RevokeAndACKDecodeErrorZ CResult_RevokeAndACKDecodeErrorZ_ok(struct LDKRevokeAndACK o);
18679 * Creates a new CResult_RevokeAndACKDecodeErrorZ in the error state.
18681 struct LDKCResult_RevokeAndACKDecodeErrorZ CResult_RevokeAndACKDecodeErrorZ_err(struct LDKDecodeError e);
18684 * Checks if the given object is currently in the success state
18686 bool CResult_RevokeAndACKDecodeErrorZ_is_ok(const struct LDKCResult_RevokeAndACKDecodeErrorZ *NONNULL_PTR o);
18689 * Frees any resources used by the CResult_RevokeAndACKDecodeErrorZ.
18691 void CResult_RevokeAndACKDecodeErrorZ_free(struct LDKCResult_RevokeAndACKDecodeErrorZ _res);
18694 * Creates a new CResult_RevokeAndACKDecodeErrorZ which has the same data as `orig`
18695 * but with all dynamically-allocated buffers duplicated in new buffers.
18697 struct LDKCResult_RevokeAndACKDecodeErrorZ CResult_RevokeAndACKDecodeErrorZ_clone(const struct LDKCResult_RevokeAndACKDecodeErrorZ *NONNULL_PTR orig);
18700 * Creates a new CResult_ShutdownDecodeErrorZ in the success state.
18702 struct LDKCResult_ShutdownDecodeErrorZ CResult_ShutdownDecodeErrorZ_ok(struct LDKShutdown o);
18705 * Creates a new CResult_ShutdownDecodeErrorZ in the error state.
18707 struct LDKCResult_ShutdownDecodeErrorZ CResult_ShutdownDecodeErrorZ_err(struct LDKDecodeError e);
18710 * Checks if the given object is currently in the success state
18712 bool CResult_ShutdownDecodeErrorZ_is_ok(const struct LDKCResult_ShutdownDecodeErrorZ *NONNULL_PTR o);
18715 * Frees any resources used by the CResult_ShutdownDecodeErrorZ.
18717 void CResult_ShutdownDecodeErrorZ_free(struct LDKCResult_ShutdownDecodeErrorZ _res);
18720 * Creates a new CResult_ShutdownDecodeErrorZ which has the same data as `orig`
18721 * but with all dynamically-allocated buffers duplicated in new buffers.
18723 struct LDKCResult_ShutdownDecodeErrorZ CResult_ShutdownDecodeErrorZ_clone(const struct LDKCResult_ShutdownDecodeErrorZ *NONNULL_PTR orig);
18726 * Creates a new CResult_UpdateFailHTLCDecodeErrorZ in the success state.
18728 struct LDKCResult_UpdateFailHTLCDecodeErrorZ CResult_UpdateFailHTLCDecodeErrorZ_ok(struct LDKUpdateFailHTLC o);
18731 * Creates a new CResult_UpdateFailHTLCDecodeErrorZ in the error state.
18733 struct LDKCResult_UpdateFailHTLCDecodeErrorZ CResult_UpdateFailHTLCDecodeErrorZ_err(struct LDKDecodeError e);
18736 * Checks if the given object is currently in the success state
18738 bool CResult_UpdateFailHTLCDecodeErrorZ_is_ok(const struct LDKCResult_UpdateFailHTLCDecodeErrorZ *NONNULL_PTR o);
18741 * Frees any resources used by the CResult_UpdateFailHTLCDecodeErrorZ.
18743 void CResult_UpdateFailHTLCDecodeErrorZ_free(struct LDKCResult_UpdateFailHTLCDecodeErrorZ _res);
18746 * Creates a new CResult_UpdateFailHTLCDecodeErrorZ which has the same data as `orig`
18747 * but with all dynamically-allocated buffers duplicated in new buffers.
18749 struct LDKCResult_UpdateFailHTLCDecodeErrorZ CResult_UpdateFailHTLCDecodeErrorZ_clone(const struct LDKCResult_UpdateFailHTLCDecodeErrorZ *NONNULL_PTR orig);
18752 * Creates a new CResult_UpdateFailMalformedHTLCDecodeErrorZ in the success state.
18754 struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ CResult_UpdateFailMalformedHTLCDecodeErrorZ_ok(struct LDKUpdateFailMalformedHTLC o);
18757 * Creates a new CResult_UpdateFailMalformedHTLCDecodeErrorZ in the error state.
18759 struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ CResult_UpdateFailMalformedHTLCDecodeErrorZ_err(struct LDKDecodeError e);
18762 * Checks if the given object is currently in the success state
18764 bool CResult_UpdateFailMalformedHTLCDecodeErrorZ_is_ok(const struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ *NONNULL_PTR o);
18767 * Frees any resources used by the CResult_UpdateFailMalformedHTLCDecodeErrorZ.
18769 void CResult_UpdateFailMalformedHTLCDecodeErrorZ_free(struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ _res);
18772 * Creates a new CResult_UpdateFailMalformedHTLCDecodeErrorZ which has the same data as `orig`
18773 * but with all dynamically-allocated buffers duplicated in new buffers.
18775 struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ CResult_UpdateFailMalformedHTLCDecodeErrorZ_clone(const struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ *NONNULL_PTR orig);
18778 * Creates a new CResult_UpdateFeeDecodeErrorZ in the success state.
18780 struct LDKCResult_UpdateFeeDecodeErrorZ CResult_UpdateFeeDecodeErrorZ_ok(struct LDKUpdateFee o);
18783 * Creates a new CResult_UpdateFeeDecodeErrorZ in the error state.
18785 struct LDKCResult_UpdateFeeDecodeErrorZ CResult_UpdateFeeDecodeErrorZ_err(struct LDKDecodeError e);
18788 * Checks if the given object is currently in the success state
18790 bool CResult_UpdateFeeDecodeErrorZ_is_ok(const struct LDKCResult_UpdateFeeDecodeErrorZ *NONNULL_PTR o);
18793 * Frees any resources used by the CResult_UpdateFeeDecodeErrorZ.
18795 void CResult_UpdateFeeDecodeErrorZ_free(struct LDKCResult_UpdateFeeDecodeErrorZ _res);
18798 * Creates a new CResult_UpdateFeeDecodeErrorZ which has the same data as `orig`
18799 * but with all dynamically-allocated buffers duplicated in new buffers.
18801 struct LDKCResult_UpdateFeeDecodeErrorZ CResult_UpdateFeeDecodeErrorZ_clone(const struct LDKCResult_UpdateFeeDecodeErrorZ *NONNULL_PTR orig);
18804 * Creates a new CResult_UpdateFulfillHTLCDecodeErrorZ in the success state.
18806 struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ CResult_UpdateFulfillHTLCDecodeErrorZ_ok(struct LDKUpdateFulfillHTLC o);
18809 * Creates a new CResult_UpdateFulfillHTLCDecodeErrorZ in the error state.
18811 struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ CResult_UpdateFulfillHTLCDecodeErrorZ_err(struct LDKDecodeError e);
18814 * Checks if the given object is currently in the success state
18816 bool CResult_UpdateFulfillHTLCDecodeErrorZ_is_ok(const struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ *NONNULL_PTR o);
18819 * Frees any resources used by the CResult_UpdateFulfillHTLCDecodeErrorZ.
18821 void CResult_UpdateFulfillHTLCDecodeErrorZ_free(struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ _res);
18824 * Creates a new CResult_UpdateFulfillHTLCDecodeErrorZ which has the same data as `orig`
18825 * but with all dynamically-allocated buffers duplicated in new buffers.
18827 struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ CResult_UpdateFulfillHTLCDecodeErrorZ_clone(const struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ *NONNULL_PTR orig);
18830 * Creates a new CResult_UpdateAddHTLCDecodeErrorZ in the success state.
18832 struct LDKCResult_UpdateAddHTLCDecodeErrorZ CResult_UpdateAddHTLCDecodeErrorZ_ok(struct LDKUpdateAddHTLC o);
18835 * Creates a new CResult_UpdateAddHTLCDecodeErrorZ in the error state.
18837 struct LDKCResult_UpdateAddHTLCDecodeErrorZ CResult_UpdateAddHTLCDecodeErrorZ_err(struct LDKDecodeError e);
18840 * Checks if the given object is currently in the success state
18842 bool CResult_UpdateAddHTLCDecodeErrorZ_is_ok(const struct LDKCResult_UpdateAddHTLCDecodeErrorZ *NONNULL_PTR o);
18845 * Frees any resources used by the CResult_UpdateAddHTLCDecodeErrorZ.
18847 void CResult_UpdateAddHTLCDecodeErrorZ_free(struct LDKCResult_UpdateAddHTLCDecodeErrorZ _res);
18850 * Creates a new CResult_UpdateAddHTLCDecodeErrorZ which has the same data as `orig`
18851 * but with all dynamically-allocated buffers duplicated in new buffers.
18853 struct LDKCResult_UpdateAddHTLCDecodeErrorZ CResult_UpdateAddHTLCDecodeErrorZ_clone(const struct LDKCResult_UpdateAddHTLCDecodeErrorZ *NONNULL_PTR orig);
18856 * Creates a new CResult_OnionMessageDecodeErrorZ in the success state.
18858 struct LDKCResult_OnionMessageDecodeErrorZ CResult_OnionMessageDecodeErrorZ_ok(struct LDKOnionMessage o);
18861 * Creates a new CResult_OnionMessageDecodeErrorZ in the error state.
18863 struct LDKCResult_OnionMessageDecodeErrorZ CResult_OnionMessageDecodeErrorZ_err(struct LDKDecodeError e);
18866 * Checks if the given object is currently in the success state
18868 bool CResult_OnionMessageDecodeErrorZ_is_ok(const struct LDKCResult_OnionMessageDecodeErrorZ *NONNULL_PTR o);
18871 * Frees any resources used by the CResult_OnionMessageDecodeErrorZ.
18873 void CResult_OnionMessageDecodeErrorZ_free(struct LDKCResult_OnionMessageDecodeErrorZ _res);
18876 * Creates a new CResult_OnionMessageDecodeErrorZ which has the same data as `orig`
18877 * but with all dynamically-allocated buffers duplicated in new buffers.
18879 struct LDKCResult_OnionMessageDecodeErrorZ CResult_OnionMessageDecodeErrorZ_clone(const struct LDKCResult_OnionMessageDecodeErrorZ *NONNULL_PTR orig);
18882 * Creates a new CResult_PingDecodeErrorZ in the success state.
18884 struct LDKCResult_PingDecodeErrorZ CResult_PingDecodeErrorZ_ok(struct LDKPing o);
18887 * Creates a new CResult_PingDecodeErrorZ in the error state.
18889 struct LDKCResult_PingDecodeErrorZ CResult_PingDecodeErrorZ_err(struct LDKDecodeError e);
18892 * Checks if the given object is currently in the success state
18894 bool CResult_PingDecodeErrorZ_is_ok(const struct LDKCResult_PingDecodeErrorZ *NONNULL_PTR o);
18897 * Frees any resources used by the CResult_PingDecodeErrorZ.
18899 void CResult_PingDecodeErrorZ_free(struct LDKCResult_PingDecodeErrorZ _res);
18902 * Creates a new CResult_PingDecodeErrorZ which has the same data as `orig`
18903 * but with all dynamically-allocated buffers duplicated in new buffers.
18905 struct LDKCResult_PingDecodeErrorZ CResult_PingDecodeErrorZ_clone(const struct LDKCResult_PingDecodeErrorZ *NONNULL_PTR orig);
18908 * Creates a new CResult_PongDecodeErrorZ in the success state.
18910 struct LDKCResult_PongDecodeErrorZ CResult_PongDecodeErrorZ_ok(struct LDKPong o);
18913 * Creates a new CResult_PongDecodeErrorZ in the error state.
18915 struct LDKCResult_PongDecodeErrorZ CResult_PongDecodeErrorZ_err(struct LDKDecodeError e);
18918 * Checks if the given object is currently in the success state
18920 bool CResult_PongDecodeErrorZ_is_ok(const struct LDKCResult_PongDecodeErrorZ *NONNULL_PTR o);
18923 * Frees any resources used by the CResult_PongDecodeErrorZ.
18925 void CResult_PongDecodeErrorZ_free(struct LDKCResult_PongDecodeErrorZ _res);
18928 * Creates a new CResult_PongDecodeErrorZ which has the same data as `orig`
18929 * but with all dynamically-allocated buffers duplicated in new buffers.
18931 struct LDKCResult_PongDecodeErrorZ CResult_PongDecodeErrorZ_clone(const struct LDKCResult_PongDecodeErrorZ *NONNULL_PTR orig);
18934 * Creates a new CResult_UnsignedChannelAnnouncementDecodeErrorZ in the success state.
18936 struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ CResult_UnsignedChannelAnnouncementDecodeErrorZ_ok(struct LDKUnsignedChannelAnnouncement o);
18939 * Creates a new CResult_UnsignedChannelAnnouncementDecodeErrorZ in the error state.
18941 struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ CResult_UnsignedChannelAnnouncementDecodeErrorZ_err(struct LDKDecodeError e);
18944 * Checks if the given object is currently in the success state
18946 bool CResult_UnsignedChannelAnnouncementDecodeErrorZ_is_ok(const struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ *NONNULL_PTR o);
18949 * Frees any resources used by the CResult_UnsignedChannelAnnouncementDecodeErrorZ.
18951 void CResult_UnsignedChannelAnnouncementDecodeErrorZ_free(struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ _res);
18954 * Creates a new CResult_UnsignedChannelAnnouncementDecodeErrorZ which has the same data as `orig`
18955 * but with all dynamically-allocated buffers duplicated in new buffers.
18957 struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ CResult_UnsignedChannelAnnouncementDecodeErrorZ_clone(const struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ *NONNULL_PTR orig);
18960 * Creates a new CResult_ChannelAnnouncementDecodeErrorZ in the success state.
18962 struct LDKCResult_ChannelAnnouncementDecodeErrorZ CResult_ChannelAnnouncementDecodeErrorZ_ok(struct LDKChannelAnnouncement o);
18965 * Creates a new CResult_ChannelAnnouncementDecodeErrorZ in the error state.
18967 struct LDKCResult_ChannelAnnouncementDecodeErrorZ CResult_ChannelAnnouncementDecodeErrorZ_err(struct LDKDecodeError e);
18970 * Checks if the given object is currently in the success state
18972 bool CResult_ChannelAnnouncementDecodeErrorZ_is_ok(const struct LDKCResult_ChannelAnnouncementDecodeErrorZ *NONNULL_PTR o);
18975 * Frees any resources used by the CResult_ChannelAnnouncementDecodeErrorZ.
18977 void CResult_ChannelAnnouncementDecodeErrorZ_free(struct LDKCResult_ChannelAnnouncementDecodeErrorZ _res);
18980 * Creates a new CResult_ChannelAnnouncementDecodeErrorZ which has the same data as `orig`
18981 * but with all dynamically-allocated buffers duplicated in new buffers.
18983 struct LDKCResult_ChannelAnnouncementDecodeErrorZ CResult_ChannelAnnouncementDecodeErrorZ_clone(const struct LDKCResult_ChannelAnnouncementDecodeErrorZ *NONNULL_PTR orig);
18986 * Creates a new CResult_UnsignedChannelUpdateDecodeErrorZ in the success state.
18988 struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ CResult_UnsignedChannelUpdateDecodeErrorZ_ok(struct LDKUnsignedChannelUpdate o);
18991 * Creates a new CResult_UnsignedChannelUpdateDecodeErrorZ in the error state.
18993 struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ CResult_UnsignedChannelUpdateDecodeErrorZ_err(struct LDKDecodeError e);
18996 * Checks if the given object is currently in the success state
18998 bool CResult_UnsignedChannelUpdateDecodeErrorZ_is_ok(const struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ *NONNULL_PTR o);
19001 * Frees any resources used by the CResult_UnsignedChannelUpdateDecodeErrorZ.
19003 void CResult_UnsignedChannelUpdateDecodeErrorZ_free(struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ _res);
19006 * Creates a new CResult_UnsignedChannelUpdateDecodeErrorZ which has the same data as `orig`
19007 * but with all dynamically-allocated buffers duplicated in new buffers.
19009 struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ CResult_UnsignedChannelUpdateDecodeErrorZ_clone(const struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ *NONNULL_PTR orig);
19012 * Creates a new CResult_ChannelUpdateDecodeErrorZ in the success state.
19014 struct LDKCResult_ChannelUpdateDecodeErrorZ CResult_ChannelUpdateDecodeErrorZ_ok(struct LDKChannelUpdate o);
19017 * Creates a new CResult_ChannelUpdateDecodeErrorZ in the error state.
19019 struct LDKCResult_ChannelUpdateDecodeErrorZ CResult_ChannelUpdateDecodeErrorZ_err(struct LDKDecodeError e);
19022 * Checks if the given object is currently in the success state
19024 bool CResult_ChannelUpdateDecodeErrorZ_is_ok(const struct LDKCResult_ChannelUpdateDecodeErrorZ *NONNULL_PTR o);
19027 * Frees any resources used by the CResult_ChannelUpdateDecodeErrorZ.
19029 void CResult_ChannelUpdateDecodeErrorZ_free(struct LDKCResult_ChannelUpdateDecodeErrorZ _res);
19032 * Creates a new CResult_ChannelUpdateDecodeErrorZ which has the same data as `orig`
19033 * but with all dynamically-allocated buffers duplicated in new buffers.
19035 struct LDKCResult_ChannelUpdateDecodeErrorZ CResult_ChannelUpdateDecodeErrorZ_clone(const struct LDKCResult_ChannelUpdateDecodeErrorZ *NONNULL_PTR orig);
19038 * Creates a new CResult_ErrorMessageDecodeErrorZ in the success state.
19040 struct LDKCResult_ErrorMessageDecodeErrorZ CResult_ErrorMessageDecodeErrorZ_ok(struct LDKErrorMessage o);
19043 * Creates a new CResult_ErrorMessageDecodeErrorZ in the error state.
19045 struct LDKCResult_ErrorMessageDecodeErrorZ CResult_ErrorMessageDecodeErrorZ_err(struct LDKDecodeError e);
19048 * Checks if the given object is currently in the success state
19050 bool CResult_ErrorMessageDecodeErrorZ_is_ok(const struct LDKCResult_ErrorMessageDecodeErrorZ *NONNULL_PTR o);
19053 * Frees any resources used by the CResult_ErrorMessageDecodeErrorZ.
19055 void CResult_ErrorMessageDecodeErrorZ_free(struct LDKCResult_ErrorMessageDecodeErrorZ _res);
19058 * Creates a new CResult_ErrorMessageDecodeErrorZ which has the same data as `orig`
19059 * but with all dynamically-allocated buffers duplicated in new buffers.
19061 struct LDKCResult_ErrorMessageDecodeErrorZ CResult_ErrorMessageDecodeErrorZ_clone(const struct LDKCResult_ErrorMessageDecodeErrorZ *NONNULL_PTR orig);
19064 * Creates a new CResult_WarningMessageDecodeErrorZ in the success state.
19066 struct LDKCResult_WarningMessageDecodeErrorZ CResult_WarningMessageDecodeErrorZ_ok(struct LDKWarningMessage o);
19069 * Creates a new CResult_WarningMessageDecodeErrorZ in the error state.
19071 struct LDKCResult_WarningMessageDecodeErrorZ CResult_WarningMessageDecodeErrorZ_err(struct LDKDecodeError e);
19074 * Checks if the given object is currently in the success state
19076 bool CResult_WarningMessageDecodeErrorZ_is_ok(const struct LDKCResult_WarningMessageDecodeErrorZ *NONNULL_PTR o);
19079 * Frees any resources used by the CResult_WarningMessageDecodeErrorZ.
19081 void CResult_WarningMessageDecodeErrorZ_free(struct LDKCResult_WarningMessageDecodeErrorZ _res);
19084 * Creates a new CResult_WarningMessageDecodeErrorZ which has the same data as `orig`
19085 * but with all dynamically-allocated buffers duplicated in new buffers.
19087 struct LDKCResult_WarningMessageDecodeErrorZ CResult_WarningMessageDecodeErrorZ_clone(const struct LDKCResult_WarningMessageDecodeErrorZ *NONNULL_PTR orig);
19090 * Creates a new CResult_UnsignedNodeAnnouncementDecodeErrorZ in the success state.
19092 struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ CResult_UnsignedNodeAnnouncementDecodeErrorZ_ok(struct LDKUnsignedNodeAnnouncement o);
19095 * Creates a new CResult_UnsignedNodeAnnouncementDecodeErrorZ in the error state.
19097 struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ CResult_UnsignedNodeAnnouncementDecodeErrorZ_err(struct LDKDecodeError e);
19100 * Checks if the given object is currently in the success state
19102 bool CResult_UnsignedNodeAnnouncementDecodeErrorZ_is_ok(const struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ *NONNULL_PTR o);
19105 * Frees any resources used by the CResult_UnsignedNodeAnnouncementDecodeErrorZ.
19107 void CResult_UnsignedNodeAnnouncementDecodeErrorZ_free(struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ _res);
19110 * Creates a new CResult_UnsignedNodeAnnouncementDecodeErrorZ which has the same data as `orig`
19111 * but with all dynamically-allocated buffers duplicated in new buffers.
19113 struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ CResult_UnsignedNodeAnnouncementDecodeErrorZ_clone(const struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ *NONNULL_PTR orig);
19116 * Creates a new CResult_NodeAnnouncementDecodeErrorZ in the success state.
19118 struct LDKCResult_NodeAnnouncementDecodeErrorZ CResult_NodeAnnouncementDecodeErrorZ_ok(struct LDKNodeAnnouncement o);
19121 * Creates a new CResult_NodeAnnouncementDecodeErrorZ in the error state.
19123 struct LDKCResult_NodeAnnouncementDecodeErrorZ CResult_NodeAnnouncementDecodeErrorZ_err(struct LDKDecodeError e);
19126 * Checks if the given object is currently in the success state
19128 bool CResult_NodeAnnouncementDecodeErrorZ_is_ok(const struct LDKCResult_NodeAnnouncementDecodeErrorZ *NONNULL_PTR o);
19131 * Frees any resources used by the CResult_NodeAnnouncementDecodeErrorZ.
19133 void CResult_NodeAnnouncementDecodeErrorZ_free(struct LDKCResult_NodeAnnouncementDecodeErrorZ _res);
19136 * Creates a new CResult_NodeAnnouncementDecodeErrorZ which has the same data as `orig`
19137 * but with all dynamically-allocated buffers duplicated in new buffers.
19139 struct LDKCResult_NodeAnnouncementDecodeErrorZ CResult_NodeAnnouncementDecodeErrorZ_clone(const struct LDKCResult_NodeAnnouncementDecodeErrorZ *NONNULL_PTR orig);
19142 * Creates a new CResult_QueryShortChannelIdsDecodeErrorZ in the success state.
19144 struct LDKCResult_QueryShortChannelIdsDecodeErrorZ CResult_QueryShortChannelIdsDecodeErrorZ_ok(struct LDKQueryShortChannelIds o);
19147 * Creates a new CResult_QueryShortChannelIdsDecodeErrorZ in the error state.
19149 struct LDKCResult_QueryShortChannelIdsDecodeErrorZ CResult_QueryShortChannelIdsDecodeErrorZ_err(struct LDKDecodeError e);
19152 * Checks if the given object is currently in the success state
19154 bool CResult_QueryShortChannelIdsDecodeErrorZ_is_ok(const struct LDKCResult_QueryShortChannelIdsDecodeErrorZ *NONNULL_PTR o);
19157 * Frees any resources used by the CResult_QueryShortChannelIdsDecodeErrorZ.
19159 void CResult_QueryShortChannelIdsDecodeErrorZ_free(struct LDKCResult_QueryShortChannelIdsDecodeErrorZ _res);
19162 * Creates a new CResult_QueryShortChannelIdsDecodeErrorZ which has the same data as `orig`
19163 * but with all dynamically-allocated buffers duplicated in new buffers.
19165 struct LDKCResult_QueryShortChannelIdsDecodeErrorZ CResult_QueryShortChannelIdsDecodeErrorZ_clone(const struct LDKCResult_QueryShortChannelIdsDecodeErrorZ *NONNULL_PTR orig);
19168 * Creates a new CResult_ReplyShortChannelIdsEndDecodeErrorZ in the success state.
19170 struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ CResult_ReplyShortChannelIdsEndDecodeErrorZ_ok(struct LDKReplyShortChannelIdsEnd o);
19173 * Creates a new CResult_ReplyShortChannelIdsEndDecodeErrorZ in the error state.
19175 struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ CResult_ReplyShortChannelIdsEndDecodeErrorZ_err(struct LDKDecodeError e);
19178 * Checks if the given object is currently in the success state
19180 bool CResult_ReplyShortChannelIdsEndDecodeErrorZ_is_ok(const struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ *NONNULL_PTR o);
19183 * Frees any resources used by the CResult_ReplyShortChannelIdsEndDecodeErrorZ.
19185 void CResult_ReplyShortChannelIdsEndDecodeErrorZ_free(struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ _res);
19188 * Creates a new CResult_ReplyShortChannelIdsEndDecodeErrorZ which has the same data as `orig`
19189 * but with all dynamically-allocated buffers duplicated in new buffers.
19191 struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ CResult_ReplyShortChannelIdsEndDecodeErrorZ_clone(const struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ *NONNULL_PTR orig);
19194 * Creates a new CResult_QueryChannelRangeDecodeErrorZ in the success state.
19196 struct LDKCResult_QueryChannelRangeDecodeErrorZ CResult_QueryChannelRangeDecodeErrorZ_ok(struct LDKQueryChannelRange o);
19199 * Creates a new CResult_QueryChannelRangeDecodeErrorZ in the error state.
19201 struct LDKCResult_QueryChannelRangeDecodeErrorZ CResult_QueryChannelRangeDecodeErrorZ_err(struct LDKDecodeError e);
19204 * Checks if the given object is currently in the success state
19206 bool CResult_QueryChannelRangeDecodeErrorZ_is_ok(const struct LDKCResult_QueryChannelRangeDecodeErrorZ *NONNULL_PTR o);
19209 * Frees any resources used by the CResult_QueryChannelRangeDecodeErrorZ.
19211 void CResult_QueryChannelRangeDecodeErrorZ_free(struct LDKCResult_QueryChannelRangeDecodeErrorZ _res);
19214 * Creates a new CResult_QueryChannelRangeDecodeErrorZ which has the same data as `orig`
19215 * but with all dynamically-allocated buffers duplicated in new buffers.
19217 struct LDKCResult_QueryChannelRangeDecodeErrorZ CResult_QueryChannelRangeDecodeErrorZ_clone(const struct LDKCResult_QueryChannelRangeDecodeErrorZ *NONNULL_PTR orig);
19220 * Creates a new CResult_ReplyChannelRangeDecodeErrorZ in the success state.
19222 struct LDKCResult_ReplyChannelRangeDecodeErrorZ CResult_ReplyChannelRangeDecodeErrorZ_ok(struct LDKReplyChannelRange o);
19225 * Creates a new CResult_ReplyChannelRangeDecodeErrorZ in the error state.
19227 struct LDKCResult_ReplyChannelRangeDecodeErrorZ CResult_ReplyChannelRangeDecodeErrorZ_err(struct LDKDecodeError e);
19230 * Checks if the given object is currently in the success state
19232 bool CResult_ReplyChannelRangeDecodeErrorZ_is_ok(const struct LDKCResult_ReplyChannelRangeDecodeErrorZ *NONNULL_PTR o);
19235 * Frees any resources used by the CResult_ReplyChannelRangeDecodeErrorZ.
19237 void CResult_ReplyChannelRangeDecodeErrorZ_free(struct LDKCResult_ReplyChannelRangeDecodeErrorZ _res);
19240 * Creates a new CResult_ReplyChannelRangeDecodeErrorZ which has the same data as `orig`
19241 * but with all dynamically-allocated buffers duplicated in new buffers.
19243 struct LDKCResult_ReplyChannelRangeDecodeErrorZ CResult_ReplyChannelRangeDecodeErrorZ_clone(const struct LDKCResult_ReplyChannelRangeDecodeErrorZ *NONNULL_PTR orig);
19246 * Creates a new CResult_GossipTimestampFilterDecodeErrorZ in the success state.
19248 struct LDKCResult_GossipTimestampFilterDecodeErrorZ CResult_GossipTimestampFilterDecodeErrorZ_ok(struct LDKGossipTimestampFilter o);
19251 * Creates a new CResult_GossipTimestampFilterDecodeErrorZ in the error state.
19253 struct LDKCResult_GossipTimestampFilterDecodeErrorZ CResult_GossipTimestampFilterDecodeErrorZ_err(struct LDKDecodeError e);
19256 * Checks if the given object is currently in the success state
19258 bool CResult_GossipTimestampFilterDecodeErrorZ_is_ok(const struct LDKCResult_GossipTimestampFilterDecodeErrorZ *NONNULL_PTR o);
19261 * Frees any resources used by the CResult_GossipTimestampFilterDecodeErrorZ.
19263 void CResult_GossipTimestampFilterDecodeErrorZ_free(struct LDKCResult_GossipTimestampFilterDecodeErrorZ _res);
19266 * Creates a new CResult_GossipTimestampFilterDecodeErrorZ which has the same data as `orig`
19267 * but with all dynamically-allocated buffers duplicated in new buffers.
19269 struct LDKCResult_GossipTimestampFilterDecodeErrorZ CResult_GossipTimestampFilterDecodeErrorZ_clone(const struct LDKCResult_GossipTimestampFilterDecodeErrorZ *NONNULL_PTR orig);
19272 * Frees the buffer pointed to by `data` if `datalen` is non-0.
19274 void CVec_PhantomRouteHintsZ_free(struct LDKCVec_PhantomRouteHintsZ _res);
19277 * Creates a new CResult_InvoiceSignOrCreationErrorZ in the success state.
19279 struct LDKCResult_InvoiceSignOrCreationErrorZ CResult_InvoiceSignOrCreationErrorZ_ok(struct LDKInvoice o);
19282 * Creates a new CResult_InvoiceSignOrCreationErrorZ in the error state.
19284 struct LDKCResult_InvoiceSignOrCreationErrorZ CResult_InvoiceSignOrCreationErrorZ_err(struct LDKSignOrCreationError e);
19287 * Checks if the given object is currently in the success state
19289 bool CResult_InvoiceSignOrCreationErrorZ_is_ok(const struct LDKCResult_InvoiceSignOrCreationErrorZ *NONNULL_PTR o);
19292 * Frees any resources used by the CResult_InvoiceSignOrCreationErrorZ.
19294 void CResult_InvoiceSignOrCreationErrorZ_free(struct LDKCResult_InvoiceSignOrCreationErrorZ _res);
19297 * Creates a new CResult_InvoiceSignOrCreationErrorZ which has the same data as `orig`
19298 * but with all dynamically-allocated buffers duplicated in new buffers.
19300 struct LDKCResult_InvoiceSignOrCreationErrorZ CResult_InvoiceSignOrCreationErrorZ_clone(const struct LDKCResult_InvoiceSignOrCreationErrorZ *NONNULL_PTR orig);
19303 * Constructs a new COption_FilterZ containing a crate::lightning::chain::Filter
19305 struct LDKCOption_FilterZ COption_FilterZ_some(struct LDKFilter o);
19308 * Constructs a new COption_FilterZ containing nothing
19310 struct LDKCOption_FilterZ COption_FilterZ_none(void);
19313 * Frees any resources associated with the crate::lightning::chain::Filter, if we are in the Some state
19315 void COption_FilterZ_free(struct LDKCOption_FilterZ _res);
19318 * Creates a new CResult_LockedChannelMonitorNoneZ in the success state.
19320 struct LDKCResult_LockedChannelMonitorNoneZ CResult_LockedChannelMonitorNoneZ_ok(struct LDKLockedChannelMonitor o);
19323 * Creates a new CResult_LockedChannelMonitorNoneZ in the error state.
19325 struct LDKCResult_LockedChannelMonitorNoneZ CResult_LockedChannelMonitorNoneZ_err(void);
19328 * Checks if the given object is currently in the success state
19330 bool CResult_LockedChannelMonitorNoneZ_is_ok(const struct LDKCResult_LockedChannelMonitorNoneZ *NONNULL_PTR o);
19333 * Frees any resources used by the CResult_LockedChannelMonitorNoneZ.
19335 void CResult_LockedChannelMonitorNoneZ_free(struct LDKCResult_LockedChannelMonitorNoneZ _res);
19338 * Frees the buffer pointed to by `data` if `datalen` is non-0.
19340 void CVec_OutPointZ_free(struct LDKCVec_OutPointZ _res);
19343 * Frees the buffer pointed to by `data` if `datalen` is non-0.
19345 void CVec_MonitorUpdateIdZ_free(struct LDKCVec_MonitorUpdateIdZ _res);
19348 * Creates a new tuple which has the same data as `orig`
19349 * but with all dynamically-allocated buffers duplicated in new buffers.
19351 struct LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ C2Tuple_OutPointCVec_MonitorUpdateIdZZ_clone(const struct LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ *NONNULL_PTR orig);
19354 * Creates a new C2Tuple_OutPointCVec_MonitorUpdateIdZZ from the contained elements.
19356 struct LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ C2Tuple_OutPointCVec_MonitorUpdateIdZZ_new(struct LDKOutPoint a, struct LDKCVec_MonitorUpdateIdZ b);
19359 * Frees any resources used by the C2Tuple_OutPointCVec_MonitorUpdateIdZZ.
19361 void C2Tuple_OutPointCVec_MonitorUpdateIdZZ_free(struct LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ _res);
19364 * Frees the buffer pointed to by `data` if `datalen` is non-0.
19366 void CVec_C2Tuple_OutPointCVec_MonitorUpdateIdZZZ_free(struct LDKCVec_C2Tuple_OutPointCVec_MonitorUpdateIdZZZ _res);
19369 * Frees any resources used by the PaymentPurpose
19371 void PaymentPurpose_free(struct LDKPaymentPurpose this_ptr);
19374 * Creates a copy of the PaymentPurpose
19376 struct LDKPaymentPurpose PaymentPurpose_clone(const struct LDKPaymentPurpose *NONNULL_PTR orig);
19379 * Utility method to constructs a new InvoicePayment-variant PaymentPurpose
19381 struct LDKPaymentPurpose PaymentPurpose_invoice_payment(struct LDKThirtyTwoBytes payment_preimage, struct LDKThirtyTwoBytes payment_secret);
19384 * Utility method to constructs a new SpontaneousPayment-variant PaymentPurpose
19386 struct LDKPaymentPurpose PaymentPurpose_spontaneous_payment(struct LDKThirtyTwoBytes a);
19389 * Serialize the PaymentPurpose object into a byte array which can be read by PaymentPurpose_read
19391 struct LDKCVec_u8Z PaymentPurpose_write(const struct LDKPaymentPurpose *NONNULL_PTR obj);
19394 * Read a PaymentPurpose from a byte array, created by PaymentPurpose_write
19396 struct LDKCResult_PaymentPurposeDecodeErrorZ PaymentPurpose_read(struct LDKu8slice ser);
19399 * Frees any resources used by the ClosureReason
19401 void ClosureReason_free(struct LDKClosureReason this_ptr);
19404 * Creates a copy of the ClosureReason
19406 struct LDKClosureReason ClosureReason_clone(const struct LDKClosureReason *NONNULL_PTR orig);
19409 * Utility method to constructs a new CounterpartyForceClosed-variant ClosureReason
19411 struct LDKClosureReason ClosureReason_counterparty_force_closed(struct LDKStr peer_msg);
19414 * Utility method to constructs a new HolderForceClosed-variant ClosureReason
19416 struct LDKClosureReason ClosureReason_holder_force_closed(void);
19419 * Utility method to constructs a new CooperativeClosure-variant ClosureReason
19421 struct LDKClosureReason ClosureReason_cooperative_closure(void);
19424 * Utility method to constructs a new CommitmentTxConfirmed-variant ClosureReason
19426 struct LDKClosureReason ClosureReason_commitment_tx_confirmed(void);
19429 * Utility method to constructs a new FundingTimedOut-variant ClosureReason
19431 struct LDKClosureReason ClosureReason_funding_timed_out(void);
19434 * Utility method to constructs a new ProcessingError-variant ClosureReason
19436 struct LDKClosureReason ClosureReason_processing_error(struct LDKStr err);
19439 * Utility method to constructs a new DisconnectedPeer-variant ClosureReason
19441 struct LDKClosureReason ClosureReason_disconnected_peer(void);
19444 * Utility method to constructs a new OutdatedChannelManager-variant ClosureReason
19446 struct LDKClosureReason ClosureReason_outdated_channel_manager(void);
19449 * Checks if two ClosureReasons contain equal inner contents.
19450 * This ignores pointers and is_owned flags and looks at the values in fields.
19452 bool ClosureReason_eq(const struct LDKClosureReason *NONNULL_PTR a, const struct LDKClosureReason *NONNULL_PTR b);
19455 * Serialize the ClosureReason object into a byte array which can be read by ClosureReason_read
19457 struct LDKCVec_u8Z ClosureReason_write(const struct LDKClosureReason *NONNULL_PTR obj);
19460 * Read a ClosureReason from a byte array, created by ClosureReason_write
19462 struct LDKCResult_COption_ClosureReasonZDecodeErrorZ ClosureReason_read(struct LDKu8slice ser);
19465 * Frees any resources used by the HTLCDestination
19467 void HTLCDestination_free(struct LDKHTLCDestination this_ptr);
19470 * Creates a copy of the HTLCDestination
19472 struct LDKHTLCDestination HTLCDestination_clone(const struct LDKHTLCDestination *NONNULL_PTR orig);
19475 * Utility method to constructs a new NextHopChannel-variant HTLCDestination
19477 struct LDKHTLCDestination HTLCDestination_next_hop_channel(struct LDKPublicKey node_id, struct LDKThirtyTwoBytes channel_id);
19480 * Utility method to constructs a new UnknownNextHop-variant HTLCDestination
19482 struct LDKHTLCDestination HTLCDestination_unknown_next_hop(uint64_t requested_forward_scid);
19485 * Utility method to constructs a new InvalidForward-variant HTLCDestination
19487 struct LDKHTLCDestination HTLCDestination_invalid_forward(uint64_t requested_forward_scid);
19490 * Utility method to constructs a new FailedPayment-variant HTLCDestination
19492 struct LDKHTLCDestination HTLCDestination_failed_payment(struct LDKThirtyTwoBytes payment_hash);
19495 * Checks if two HTLCDestinations contain equal inner contents.
19496 * This ignores pointers and is_owned flags and looks at the values in fields.
19498 bool HTLCDestination_eq(const struct LDKHTLCDestination *NONNULL_PTR a, const struct LDKHTLCDestination *NONNULL_PTR b);
19501 * Serialize the HTLCDestination object into a byte array which can be read by HTLCDestination_read
19503 struct LDKCVec_u8Z HTLCDestination_write(const struct LDKHTLCDestination *NONNULL_PTR obj);
19506 * Read a HTLCDestination from a byte array, created by HTLCDestination_write
19508 struct LDKCResult_COption_HTLCDestinationZDecodeErrorZ HTLCDestination_read(struct LDKu8slice ser);
19511 * Frees any resources used by the Event
19513 void Event_free(struct LDKEvent this_ptr);
19516 * Creates a copy of the Event
19518 struct LDKEvent Event_clone(const struct LDKEvent *NONNULL_PTR orig);
19521 * Utility method to constructs a new FundingGenerationReady-variant Event
19523 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);
19526 * Utility method to constructs a new PaymentClaimable-variant Event
19528 struct LDKEvent Event_payment_claimable(struct LDKPublicKey receiver_node_id, struct LDKThirtyTwoBytes payment_hash, uint64_t amount_msat, struct LDKPaymentPurpose purpose, struct LDKThirtyTwoBytes via_channel_id, struct LDKCOption_u128Z via_user_channel_id);
19531 * Utility method to constructs a new PaymentClaimed-variant Event
19533 struct LDKEvent Event_payment_claimed(struct LDKPublicKey receiver_node_id, struct LDKThirtyTwoBytes payment_hash, uint64_t amount_msat, struct LDKPaymentPurpose purpose);
19536 * Utility method to constructs a new PaymentSent-variant Event
19538 struct LDKEvent Event_payment_sent(struct LDKThirtyTwoBytes payment_id, struct LDKThirtyTwoBytes payment_preimage, struct LDKThirtyTwoBytes payment_hash, struct LDKCOption_u64Z fee_paid_msat);
19541 * Utility method to constructs a new PaymentFailed-variant Event
19543 struct LDKEvent Event_payment_failed(struct LDKThirtyTwoBytes payment_id, struct LDKThirtyTwoBytes payment_hash);
19546 * Utility method to constructs a new PaymentPathSuccessful-variant Event
19548 struct LDKEvent Event_payment_path_successful(struct LDKThirtyTwoBytes payment_id, struct LDKThirtyTwoBytes payment_hash, struct LDKCVec_RouteHopZ path);
19551 * Utility method to constructs a new PaymentPathFailed-variant Event
19553 struct LDKEvent Event_payment_path_failed(struct LDKThirtyTwoBytes payment_id, struct LDKThirtyTwoBytes payment_hash, bool payment_failed_permanently, struct LDKCOption_NetworkUpdateZ network_update, bool all_paths_failed, struct LDKCVec_RouteHopZ path, struct LDKCOption_u64Z short_channel_id, struct LDKRouteParameters retry);
19556 * Utility method to constructs a new ProbeSuccessful-variant Event
19558 struct LDKEvent Event_probe_successful(struct LDKThirtyTwoBytes payment_id, struct LDKThirtyTwoBytes payment_hash, struct LDKCVec_RouteHopZ path);
19561 * Utility method to constructs a new ProbeFailed-variant Event
19563 struct LDKEvent Event_probe_failed(struct LDKThirtyTwoBytes payment_id, struct LDKThirtyTwoBytes payment_hash, struct LDKCVec_RouteHopZ path, struct LDKCOption_u64Z short_channel_id);
19566 * Utility method to constructs a new PendingHTLCsForwardable-variant Event
19568 struct LDKEvent Event_pending_htlcs_forwardable(uint64_t time_forwardable);
19571 * Utility method to constructs a new HTLCIntercepted-variant Event
19573 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);
19576 * Utility method to constructs a new SpendableOutputs-variant Event
19578 struct LDKEvent Event_spendable_outputs(struct LDKCVec_SpendableOutputDescriptorZ outputs);
19581 * Utility method to constructs a new PaymentForwarded-variant Event
19583 struct LDKEvent Event_payment_forwarded(struct LDKThirtyTwoBytes prev_channel_id, struct LDKThirtyTwoBytes next_channel_id, struct LDKCOption_u64Z fee_earned_msat, bool claim_from_onchain_tx);
19586 * Utility method to constructs a new ChannelReady-variant Event
19588 struct LDKEvent Event_channel_ready(struct LDKThirtyTwoBytes channel_id, struct LDKU128 user_channel_id, struct LDKPublicKey counterparty_node_id, struct LDKChannelTypeFeatures channel_type);
19591 * Utility method to constructs a new ChannelClosed-variant Event
19593 struct LDKEvent Event_channel_closed(struct LDKThirtyTwoBytes channel_id, struct LDKU128 user_channel_id, struct LDKClosureReason reason);
19596 * Utility method to constructs a new DiscardFunding-variant Event
19598 struct LDKEvent Event_discard_funding(struct LDKThirtyTwoBytes channel_id, struct LDKTransaction transaction);
19601 * Utility method to constructs a new OpenChannelRequest-variant Event
19603 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);
19606 * Utility method to constructs a new HTLCHandlingFailed-variant Event
19608 struct LDKEvent Event_htlchandling_failed(struct LDKThirtyTwoBytes prev_channel_id, struct LDKHTLCDestination failed_next_destination);
19611 * Serialize the Event object into a byte array which can be read by Event_read
19613 struct LDKCVec_u8Z Event_write(const struct LDKEvent *NONNULL_PTR obj);
19616 * Read a Event from a byte array, created by Event_write
19618 struct LDKCResult_COption_EventZDecodeErrorZ Event_read(struct LDKu8slice ser);
19621 * Frees any resources used by the MessageSendEvent
19623 void MessageSendEvent_free(struct LDKMessageSendEvent this_ptr);
19626 * Creates a copy of the MessageSendEvent
19628 struct LDKMessageSendEvent MessageSendEvent_clone(const struct LDKMessageSendEvent *NONNULL_PTR orig);
19631 * Utility method to constructs a new SendAcceptChannel-variant MessageSendEvent
19633 struct LDKMessageSendEvent MessageSendEvent_send_accept_channel(struct LDKPublicKey node_id, struct LDKAcceptChannel msg);
19636 * Utility method to constructs a new SendOpenChannel-variant MessageSendEvent
19638 struct LDKMessageSendEvent MessageSendEvent_send_open_channel(struct LDKPublicKey node_id, struct LDKOpenChannel msg);
19641 * Utility method to constructs a new SendFundingCreated-variant MessageSendEvent
19643 struct LDKMessageSendEvent MessageSendEvent_send_funding_created(struct LDKPublicKey node_id, struct LDKFundingCreated msg);
19646 * Utility method to constructs a new SendFundingSigned-variant MessageSendEvent
19648 struct LDKMessageSendEvent MessageSendEvent_send_funding_signed(struct LDKPublicKey node_id, struct LDKFundingSigned msg);
19651 * Utility method to constructs a new SendChannelReady-variant MessageSendEvent
19653 struct LDKMessageSendEvent MessageSendEvent_send_channel_ready(struct LDKPublicKey node_id, struct LDKChannelReady msg);
19656 * Utility method to constructs a new SendAnnouncementSignatures-variant MessageSendEvent
19658 struct LDKMessageSendEvent MessageSendEvent_send_announcement_signatures(struct LDKPublicKey node_id, struct LDKAnnouncementSignatures msg);
19661 * Utility method to constructs a new UpdateHTLCs-variant MessageSendEvent
19663 struct LDKMessageSendEvent MessageSendEvent_update_htlcs(struct LDKPublicKey node_id, struct LDKCommitmentUpdate updates);
19666 * Utility method to constructs a new SendRevokeAndACK-variant MessageSendEvent
19668 struct LDKMessageSendEvent MessageSendEvent_send_revoke_and_ack(struct LDKPublicKey node_id, struct LDKRevokeAndACK msg);
19671 * Utility method to constructs a new SendClosingSigned-variant MessageSendEvent
19673 struct LDKMessageSendEvent MessageSendEvent_send_closing_signed(struct LDKPublicKey node_id, struct LDKClosingSigned msg);
19676 * Utility method to constructs a new SendShutdown-variant MessageSendEvent
19678 struct LDKMessageSendEvent MessageSendEvent_send_shutdown(struct LDKPublicKey node_id, struct LDKShutdown msg);
19681 * Utility method to constructs a new SendChannelReestablish-variant MessageSendEvent
19683 struct LDKMessageSendEvent MessageSendEvent_send_channel_reestablish(struct LDKPublicKey node_id, struct LDKChannelReestablish msg);
19686 * Utility method to constructs a new SendChannelAnnouncement-variant MessageSendEvent
19688 struct LDKMessageSendEvent MessageSendEvent_send_channel_announcement(struct LDKPublicKey node_id, struct LDKChannelAnnouncement msg, struct LDKChannelUpdate update_msg);
19691 * Utility method to constructs a new BroadcastChannelAnnouncement-variant MessageSendEvent
19693 struct LDKMessageSendEvent MessageSendEvent_broadcast_channel_announcement(struct LDKChannelAnnouncement msg, struct LDKChannelUpdate update_msg);
19696 * Utility method to constructs a new BroadcastChannelUpdate-variant MessageSendEvent
19698 struct LDKMessageSendEvent MessageSendEvent_broadcast_channel_update(struct LDKChannelUpdate msg);
19701 * Utility method to constructs a new SendChannelUpdate-variant MessageSendEvent
19703 struct LDKMessageSendEvent MessageSendEvent_send_channel_update(struct LDKPublicKey node_id, struct LDKChannelUpdate msg);
19706 * Utility method to constructs a new HandleError-variant MessageSendEvent
19708 struct LDKMessageSendEvent MessageSendEvent_handle_error(struct LDKPublicKey node_id, struct LDKErrorAction action);
19711 * Utility method to constructs a new SendChannelRangeQuery-variant MessageSendEvent
19713 struct LDKMessageSendEvent MessageSendEvent_send_channel_range_query(struct LDKPublicKey node_id, struct LDKQueryChannelRange msg);
19716 * Utility method to constructs a new SendShortIdsQuery-variant MessageSendEvent
19718 struct LDKMessageSendEvent MessageSendEvent_send_short_ids_query(struct LDKPublicKey node_id, struct LDKQueryShortChannelIds msg);
19721 * Utility method to constructs a new SendReplyChannelRange-variant MessageSendEvent
19723 struct LDKMessageSendEvent MessageSendEvent_send_reply_channel_range(struct LDKPublicKey node_id, struct LDKReplyChannelRange msg);
19726 * Utility method to constructs a new SendGossipTimestampFilter-variant MessageSendEvent
19728 struct LDKMessageSendEvent MessageSendEvent_send_gossip_timestamp_filter(struct LDKPublicKey node_id, struct LDKGossipTimestampFilter msg);
19731 * Calls the free function if one is set
19733 void MessageSendEventsProvider_free(struct LDKMessageSendEventsProvider this_ptr);
19736 * Calls the free function if one is set
19738 void OnionMessageProvider_free(struct LDKOnionMessageProvider this_ptr);
19741 * Calls the free function if one is set
19743 void EventsProvider_free(struct LDKEventsProvider this_ptr);
19746 * Calls the free function if one is set
19748 void EventHandler_free(struct LDKEventHandler this_ptr);
19751 * Frees any resources used by the APIError
19753 void APIError_free(struct LDKAPIError this_ptr);
19756 * Creates a copy of the APIError
19758 struct LDKAPIError APIError_clone(const struct LDKAPIError *NONNULL_PTR orig);
19761 * Utility method to constructs a new APIMisuseError-variant APIError
19763 struct LDKAPIError APIError_apimisuse_error(struct LDKStr err);
19766 * Utility method to constructs a new FeeRateTooHigh-variant APIError
19768 struct LDKAPIError APIError_fee_rate_too_high(struct LDKStr err, uint32_t feerate);
19771 * Utility method to constructs a new InvalidRoute-variant APIError
19773 struct LDKAPIError APIError_invalid_route(struct LDKStr err);
19776 * Utility method to constructs a new ChannelUnavailable-variant APIError
19778 struct LDKAPIError APIError_channel_unavailable(struct LDKStr err);
19781 * Utility method to constructs a new MonitorUpdateInProgress-variant APIError
19783 struct LDKAPIError APIError_monitor_update_in_progress(void);
19786 * Utility method to constructs a new IncompatibleShutdownScript-variant APIError
19788 struct LDKAPIError APIError_incompatible_shutdown_script(struct LDKShutdownScript script);
19791 * Checks if two APIErrors contain equal inner contents.
19792 * This ignores pointers and is_owned flags and looks at the values in fields.
19794 bool APIError_eq(const struct LDKAPIError *NONNULL_PTR a, const struct LDKAPIError *NONNULL_PTR b);
19797 * Frees any resources used by the BigSize, if is_owned is set and inner is non-NULL.
19799 void BigSize_free(struct LDKBigSize this_obj);
19801 uint64_t BigSize_get_a(const struct LDKBigSize *NONNULL_PTR this_ptr);
19803 void BigSize_set_a(struct LDKBigSize *NONNULL_PTR this_ptr, uint64_t val);
19806 * Constructs a new BigSize given each field
19808 MUST_USE_RES struct LDKBigSize BigSize_new(uint64_t a_arg);
19811 * Frees any resources used by the Hostname, if is_owned is set and inner is non-NULL.
19813 void Hostname_free(struct LDKHostname this_obj);
19816 * Creates a copy of the Hostname
19818 struct LDKHostname Hostname_clone(const struct LDKHostname *NONNULL_PTR orig);
19821 * Checks if two Hostnames contain equal inner contents.
19822 * This ignores pointers and is_owned flags and looks at the values in fields.
19823 * Two objects with NULL inner values will be considered "equal" here.
19825 bool Hostname_eq(const struct LDKHostname *NONNULL_PTR a, const struct LDKHostname *NONNULL_PTR b);
19828 * Returns the length of the hostname.
19830 MUST_USE_RES uint8_t Hostname_len(const struct LDKHostname *NONNULL_PTR this_arg);
19833 * Creates a digital signature of a message given a SecretKey, like the node's secret.
19834 * 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.
19835 * Signatures are EC recoverable, meaning that given the message and the signature the PublicKey of the signer can be extracted.
19837 struct LDKCResult_StringErrorZ sign(struct LDKu8slice msg, const uint8_t (*sk)[32]);
19840 * Recovers the PublicKey of the signer of the message given the message and the signature.
19842 struct LDKCResult_PublicKeyErrorZ recover_pk(struct LDKu8slice msg, struct LDKStr sig);
19845 * Verifies a message was signed by a PrivateKey that derives to a given PublicKey, given a message, a signature,
19846 * and the PublicKey.
19848 bool verify(struct LDKu8slice msg, struct LDKStr sig, struct LDKPublicKey pk);
19851 * Construct the invoice's HRP and signatureless data into a preimage to be hashed.
19853 struct LDKCVec_u8Z construct_invoice_preimage(struct LDKu8slice hrp_bytes, struct LDKCVec_U5Z data_without_signature);
19856 * Calls the free function if one is set
19858 void Persister_free(struct LDKPersister this_ptr);
19861 * Frees any resources used by the PrintableString, if is_owned is set and inner is non-NULL.
19863 void PrintableString_free(struct LDKPrintableString this_obj);
19865 struct LDKStr PrintableString_get_a(const struct LDKPrintableString *NONNULL_PTR this_ptr);
19867 void PrintableString_set_a(struct LDKPrintableString *NONNULL_PTR this_ptr, struct LDKStr val);
19870 * Constructs a new PrintableString given each field
19872 MUST_USE_RES struct LDKPrintableString PrintableString_new(struct LDKStr a_arg);
19875 * Calls the free function if one is set
19877 void FutureCallback_free(struct LDKFutureCallback this_ptr);
19880 * Frees any resources used by the Future, if is_owned is set and inner is non-NULL.
19882 void Future_free(struct LDKFuture this_obj);
19885 * Registers a callback to be called upon completion of this future. If the future has already
19886 * completed, the callback will be called immediately.
19888 void Future_register_callback_fn(const struct LDKFuture *NONNULL_PTR this_arg, struct LDKFutureCallback callback);
19891 * Creates a copy of the Level
19893 enum LDKLevel Level_clone(const enum LDKLevel *NONNULL_PTR orig);
19896 * Utility method to constructs a new Gossip-variant Level
19898 enum LDKLevel Level_gossip(void);
19901 * Utility method to constructs a new Trace-variant Level
19903 enum LDKLevel Level_trace(void);
19906 * Utility method to constructs a new Debug-variant Level
19908 enum LDKLevel Level_debug(void);
19911 * Utility method to constructs a new Info-variant Level
19913 enum LDKLevel Level_info(void);
19916 * Utility method to constructs a new Warn-variant Level
19918 enum LDKLevel Level_warn(void);
19921 * Utility method to constructs a new Error-variant Level
19923 enum LDKLevel Level_error(void);
19926 * Checks if two Levels contain equal inner contents.
19927 * This ignores pointers and is_owned flags and looks at the values in fields.
19929 bool Level_eq(const enum LDKLevel *NONNULL_PTR a, const enum LDKLevel *NONNULL_PTR b);
19932 * Checks if two Levels contain equal inner contents.
19934 uint64_t Level_hash(const enum LDKLevel *NONNULL_PTR o);
19937 * Returns the most verbose logging level.
19939 MUST_USE_RES enum LDKLevel Level_max(void);
19942 * Frees any resources used by the Record, if is_owned is set and inner is non-NULL.
19944 void Record_free(struct LDKRecord this_obj);
19947 * The verbosity level of the message.
19949 enum LDKLevel Record_get_level(const struct LDKRecord *NONNULL_PTR this_ptr);
19952 * The verbosity level of the message.
19954 void Record_set_level(struct LDKRecord *NONNULL_PTR this_ptr, enum LDKLevel val);
19957 * The message body.
19959 struct LDKStr Record_get_args(const struct LDKRecord *NONNULL_PTR this_ptr);
19962 * The message body.
19964 void Record_set_args(struct LDKRecord *NONNULL_PTR this_ptr, struct LDKStr val);
19967 * The module path of the message.
19969 struct LDKStr Record_get_module_path(const struct LDKRecord *NONNULL_PTR this_ptr);
19972 * The module path of the message.
19974 void Record_set_module_path(struct LDKRecord *NONNULL_PTR this_ptr, struct LDKStr val);
19977 * The source file containing the message.
19979 struct LDKStr Record_get_file(const struct LDKRecord *NONNULL_PTR this_ptr);
19982 * The source file containing the message.
19984 void Record_set_file(struct LDKRecord *NONNULL_PTR this_ptr, struct LDKStr val);
19987 * The line containing the message.
19989 uint32_t Record_get_line(const struct LDKRecord *NONNULL_PTR this_ptr);
19992 * The line containing the message.
19994 void Record_set_line(struct LDKRecord *NONNULL_PTR this_ptr, uint32_t val);
19997 * Creates a copy of the Record
19999 struct LDKRecord Record_clone(const struct LDKRecord *NONNULL_PTR orig);
20002 * Calls the free function if one is set
20004 void Logger_free(struct LDKLogger this_ptr);
20007 * Frees any resources used by the ChannelHandshakeConfig, if is_owned is set and inner is non-NULL.
20009 void ChannelHandshakeConfig_free(struct LDKChannelHandshakeConfig this_obj);
20012 * Confirmations we will wait for before considering the channel locked in.
20013 * Applied only for inbound channels (see ChannelHandshakeLimits::max_minimum_depth for the
20014 * equivalent limit applied to outbound channels).
20016 * A lower-bound of 1 is applied, requiring all channels to have a confirmed commitment
20017 * transaction before operation. If you wish to accept channels with zero confirmations, see
20018 * [`UserConfig::manually_accept_inbound_channels`] and
20019 * [`ChannelManager::accept_inbound_channel_from_trusted_peer_0conf`].
20021 * Default value: 6.
20023 * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
20024 * [`ChannelManager::accept_inbound_channel_from_trusted_peer_0conf`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel_from_trusted_peer_0conf
20026 uint32_t ChannelHandshakeConfig_get_minimum_depth(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr);
20029 * Confirmations we will wait for before considering the channel locked in.
20030 * Applied only for inbound channels (see ChannelHandshakeLimits::max_minimum_depth for the
20031 * equivalent limit applied to outbound channels).
20033 * A lower-bound of 1 is applied, requiring all channels to have a confirmed commitment
20034 * transaction before operation. If you wish to accept channels with zero confirmations, see
20035 * [`UserConfig::manually_accept_inbound_channels`] and
20036 * [`ChannelManager::accept_inbound_channel_from_trusted_peer_0conf`].
20038 * Default value: 6.
20040 * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
20041 * [`ChannelManager::accept_inbound_channel_from_trusted_peer_0conf`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel_from_trusted_peer_0conf
20043 void ChannelHandshakeConfig_set_minimum_depth(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, uint32_t val);
20046 * Set to the number of blocks we require our counterparty to wait to claim their money (ie
20047 * the number of blocks we have to punish our counterparty if they broadcast a revoked
20050 * This is one of the main parameters of our security model. We (or one of our watchtowers) MUST
20051 * be online to check for revoked transactions on-chain at least once every our_to_self_delay
20052 * blocks (minus some margin to allow us enough time to broadcast and confirm a transaction,
20053 * possibly with time in between to RBF the spending transaction).
20055 * Meanwhile, asking for a too high delay, we bother peer to freeze funds for nothing in
20056 * case of an honest unilateral channel close, which implicitly decrease the economic value of
20059 * Default value: [`BREAKDOWN_TIMEOUT`], we enforce it as a minimum at channel opening so you
20060 * can tweak config to ask for more security, not less.
20062 uint16_t ChannelHandshakeConfig_get_our_to_self_delay(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr);
20065 * Set to the number of blocks we require our counterparty to wait to claim their money (ie
20066 * the number of blocks we have to punish our counterparty if they broadcast a revoked
20069 * This is one of the main parameters of our security model. We (or one of our watchtowers) MUST
20070 * be online to check for revoked transactions on-chain at least once every our_to_self_delay
20071 * blocks (minus some margin to allow us enough time to broadcast and confirm a transaction,
20072 * possibly with time in between to RBF the spending transaction).
20074 * Meanwhile, asking for a too high delay, we bother peer to freeze funds for nothing in
20075 * case of an honest unilateral channel close, which implicitly decrease the economic value of
20078 * Default value: [`BREAKDOWN_TIMEOUT`], we enforce it as a minimum at channel opening so you
20079 * can tweak config to ask for more security, not less.
20081 void ChannelHandshakeConfig_set_our_to_self_delay(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, uint16_t val);
20084 * Set to the smallest value HTLC we will accept to process.
20086 * This value is sent to our counterparty on channel-open and we close the channel any time
20087 * our counterparty misbehaves by sending us an HTLC with a value smaller than this.
20089 * Default value: 1. If the value is less than 1, it is ignored and set to 1, as is required
20092 uint64_t ChannelHandshakeConfig_get_our_htlc_minimum_msat(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr);
20095 * Set to the smallest value HTLC we will accept to process.
20097 * This value is sent to our counterparty on channel-open and we close the channel any time
20098 * our counterparty misbehaves by sending us an HTLC with a value smaller than this.
20100 * Default value: 1. If the value is less than 1, it is ignored and set to 1, as is required
20103 void ChannelHandshakeConfig_set_our_htlc_minimum_msat(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, uint64_t val);
20106 * Sets the percentage of the channel value we will cap the total value of outstanding inbound
20109 * This can be set to a value between 1-100, where the value corresponds to the percent of the
20110 * channel value in whole percentages.
20113 * * If configured to another value than the default value 10, any new channels created with
20114 * the non default value will cause versions of LDK prior to 0.0.104 to refuse to read the
20115 * `ChannelManager`.
20117 * * This caps the total value for inbound HTLCs in-flight only, and there's currently
20118 * no way to configure the cap for the total value of outbound HTLCs in-flight.
20120 * * The requirements for your node being online to ensure the safety of HTLC-encumbered funds
20121 * are different from the non-HTLC-encumbered funds. This makes this an important knob to
20122 * restrict exposure to loss due to being offline for too long.
20123 * See [`ChannelHandshakeConfig::our_to_self_delay`] and [`ChannelConfig::cltv_expiry_delta`]
20124 * for more information.
20126 * Default value: 10.
20127 * Minimum value: 1, any values less than 1 will be treated as 1 instead.
20128 * Maximum value: 100, any values larger than 100 will be treated as 100 instead.
20130 uint8_t ChannelHandshakeConfig_get_max_inbound_htlc_value_in_flight_percent_of_channel(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr);
20133 * Sets the percentage of the channel value we will cap the total value of outstanding inbound
20136 * This can be set to a value between 1-100, where the value corresponds to the percent of the
20137 * channel value in whole percentages.
20140 * * If configured to another value than the default value 10, any new channels created with
20141 * the non default value will cause versions of LDK prior to 0.0.104 to refuse to read the
20142 * `ChannelManager`.
20144 * * This caps the total value for inbound HTLCs in-flight only, and there's currently
20145 * no way to configure the cap for the total value of outbound HTLCs in-flight.
20147 * * The requirements for your node being online to ensure the safety of HTLC-encumbered funds
20148 * are different from the non-HTLC-encumbered funds. This makes this an important knob to
20149 * restrict exposure to loss due to being offline for too long.
20150 * See [`ChannelHandshakeConfig::our_to_self_delay`] and [`ChannelConfig::cltv_expiry_delta`]
20151 * for more information.
20153 * Default value: 10.
20154 * Minimum value: 1, any values less than 1 will be treated as 1 instead.
20155 * Maximum value: 100, any values larger than 100 will be treated as 100 instead.
20157 void ChannelHandshakeConfig_set_max_inbound_htlc_value_in_flight_percent_of_channel(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, uint8_t val);
20160 * If set, we attempt to negotiate the `scid_privacy` (referred to as `scid_alias` in the
20161 * BOLTs) option for outbound private channels. This provides better privacy by not including
20162 * our real on-chain channel UTXO in each invoice and requiring that our counterparty only
20163 * relay HTLCs to us using the channel's SCID alias.
20165 * If this option is set, channels may be created that will not be readable by LDK versions
20166 * prior to 0.0.106, causing [`ChannelManager`]'s read method to return a
20167 * [`DecodeError::InvalidValue`].
20169 * Note that setting this to true does *not* prevent us from opening channels with
20170 * counterparties that do not support the `scid_alias` option; we will simply fall back to a
20171 * private channel without that option.
20173 * Ignored if the channel is negotiated to be announced, see
20174 * [`ChannelHandshakeConfig::announced_channel`] and
20175 * [`ChannelHandshakeLimits::force_announced_channel_preference`] for more.
20177 * Default value: false. This value is likely to change to true in the future.
20179 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
20180 * [`DecodeError::InvalidValue`]: crate::ln::msgs::DecodeError::InvalidValue
20182 bool ChannelHandshakeConfig_get_negotiate_scid_privacy(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr);
20185 * If set, we attempt to negotiate the `scid_privacy` (referred to as `scid_alias` in the
20186 * BOLTs) option for outbound private channels. This provides better privacy by not including
20187 * our real on-chain channel UTXO in each invoice and requiring that our counterparty only
20188 * relay HTLCs to us using the channel's SCID alias.
20190 * If this option is set, channels may be created that will not be readable by LDK versions
20191 * prior to 0.0.106, causing [`ChannelManager`]'s read method to return a
20192 * [`DecodeError::InvalidValue`].
20194 * Note that setting this to true does *not* prevent us from opening channels with
20195 * counterparties that do not support the `scid_alias` option; we will simply fall back to a
20196 * private channel without that option.
20198 * Ignored if the channel is negotiated to be announced, see
20199 * [`ChannelHandshakeConfig::announced_channel`] and
20200 * [`ChannelHandshakeLimits::force_announced_channel_preference`] for more.
20202 * Default value: false. This value is likely to change to true in the future.
20204 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
20205 * [`DecodeError::InvalidValue`]: crate::ln::msgs::DecodeError::InvalidValue
20207 void ChannelHandshakeConfig_set_negotiate_scid_privacy(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, bool val);
20210 * Set to announce the channel publicly and notify all nodes that they can route via this
20213 * This should only be set to true for nodes which expect to be online reliably.
20215 * As the node which funds a channel picks this value this will only apply for new outbound
20216 * channels unless [`ChannelHandshakeLimits::force_announced_channel_preference`] is set.
20218 * Default value: false.
20220 bool ChannelHandshakeConfig_get_announced_channel(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr);
20223 * Set to announce the channel publicly and notify all nodes that they can route via this
20226 * This should only be set to true for nodes which expect to be online reliably.
20228 * As the node which funds a channel picks this value this will only apply for new outbound
20229 * channels unless [`ChannelHandshakeLimits::force_announced_channel_preference`] is set.
20231 * Default value: false.
20233 void ChannelHandshakeConfig_set_announced_channel(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, bool val);
20236 * When set, we commit to an upfront shutdown_pubkey at channel open. If our counterparty
20237 * supports it, they will then enforce the mutual-close output to us matches what we provided
20238 * at intialization, preventing us from closing to an alternate pubkey.
20240 * This is set to true by default to provide a slight increase in security, though ultimately
20241 * any attacker who is able to take control of a channel can just as easily send the funds via
20242 * lightning payments, so we never require that our counterparties support this option.
20244 * The upfront key committed is provided from [`KeysInterface::get_shutdown_scriptpubkey`].
20246 * Default value: true.
20248 * [`KeysInterface::get_shutdown_scriptpubkey`]: crate::chain::keysinterface::KeysInterface::get_shutdown_scriptpubkey
20250 bool ChannelHandshakeConfig_get_commit_upfront_shutdown_pubkey(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr);
20253 * When set, we commit to an upfront shutdown_pubkey at channel open. If our counterparty
20254 * supports it, they will then enforce the mutual-close output to us matches what we provided
20255 * at intialization, preventing us from closing to an alternate pubkey.
20257 * This is set to true by default to provide a slight increase in security, though ultimately
20258 * any attacker who is able to take control of a channel can just as easily send the funds via
20259 * lightning payments, so we never require that our counterparties support this option.
20261 * The upfront key committed is provided from [`KeysInterface::get_shutdown_scriptpubkey`].
20263 * Default value: true.
20265 * [`KeysInterface::get_shutdown_scriptpubkey`]: crate::chain::keysinterface::KeysInterface::get_shutdown_scriptpubkey
20267 void ChannelHandshakeConfig_set_commit_upfront_shutdown_pubkey(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, bool val);
20270 * The Proportion of the channel value to configure as counterparty's channel reserve,
20271 * i.e., `their_channel_reserve_satoshis` for both outbound and inbound channels.
20273 * `their_channel_reserve_satoshis` is the minimum balance that the other node has to maintain
20274 * on their side, at all times.
20275 * This ensures that if our counterparty broadcasts a revoked state, we can punish them by
20276 * claiming at least this value on chain.
20278 * Channel reserve values greater than 30% could be considered highly unreasonable, since that
20279 * amount can never be used for payments.
20280 * Also, if our selected channel reserve for counterparty and counterparty's selected
20281 * channel reserve for us sum up to equal or greater than channel value, channel negotiations
20284 * Note: Versions of LDK earlier than v0.0.104 will fail to read channels with any channel reserve
20285 * other than the default value.
20287 * Default value: 1% of channel value, i.e., configured as 10,000 millionths.
20288 * Minimum value: If the calculated proportional value is less than 1000 sats, it will be treated
20289 * as 1000 sats instead, which is a safe implementation-specific lower bound.
20290 * Maximum value: 1,000,000, any values larger than 1 Million will be treated as 1 Million (or 100%)
20291 * instead, although channel negotiations will fail in that case.
20293 uint32_t ChannelHandshakeConfig_get_their_channel_reserve_proportional_millionths(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr);
20296 * The Proportion of the channel value to configure as counterparty's channel reserve,
20297 * i.e., `their_channel_reserve_satoshis` for both outbound and inbound channels.
20299 * `their_channel_reserve_satoshis` is the minimum balance that the other node has to maintain
20300 * on their side, at all times.
20301 * This ensures that if our counterparty broadcasts a revoked state, we can punish them by
20302 * claiming at least this value on chain.
20304 * Channel reserve values greater than 30% could be considered highly unreasonable, since that
20305 * amount can never be used for payments.
20306 * Also, if our selected channel reserve for counterparty and counterparty's selected
20307 * channel reserve for us sum up to equal or greater than channel value, channel negotiations
20310 * Note: Versions of LDK earlier than v0.0.104 will fail to read channels with any channel reserve
20311 * other than the default value.
20313 * Default value: 1% of channel value, i.e., configured as 10,000 millionths.
20314 * Minimum value: If the calculated proportional value is less than 1000 sats, it will be treated
20315 * as 1000 sats instead, which is a safe implementation-specific lower bound.
20316 * Maximum value: 1,000,000, any values larger than 1 Million will be treated as 1 Million (or 100%)
20317 * instead, although channel negotiations will fail in that case.
20319 void ChannelHandshakeConfig_set_their_channel_reserve_proportional_millionths(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, uint32_t val);
20322 * Constructs a new ChannelHandshakeConfig given each field
20324 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);
20327 * Creates a copy of the ChannelHandshakeConfig
20329 struct LDKChannelHandshakeConfig ChannelHandshakeConfig_clone(const struct LDKChannelHandshakeConfig *NONNULL_PTR orig);
20332 * Creates a "default" ChannelHandshakeConfig. See struct and individual field documentaiton for details on which values are used.
20334 MUST_USE_RES struct LDKChannelHandshakeConfig ChannelHandshakeConfig_default(void);
20337 * Frees any resources used by the ChannelHandshakeLimits, if is_owned is set and inner is non-NULL.
20339 void ChannelHandshakeLimits_free(struct LDKChannelHandshakeLimits this_obj);
20342 * Minimum allowed satoshis when a channel is funded. This is supplied by the sender and so
20343 * only applies to inbound channels.
20345 * Default value: 0.
20347 uint64_t ChannelHandshakeLimits_get_min_funding_satoshis(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
20350 * Minimum allowed satoshis when a channel is funded. This is supplied by the sender and so
20351 * only applies to inbound channels.
20353 * Default value: 0.
20355 void ChannelHandshakeLimits_set_min_funding_satoshis(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint64_t val);
20358 * Maximum allowed satoshis when a channel is funded. This is supplied by the sender and so
20359 * only applies to inbound channels.
20361 * Default value: 2^24 - 1.
20363 uint64_t ChannelHandshakeLimits_get_max_funding_satoshis(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
20366 * Maximum allowed satoshis when a channel is funded. This is supplied by the sender and so
20367 * only applies to inbound channels.
20369 * Default value: 2^24 - 1.
20371 void ChannelHandshakeLimits_set_max_funding_satoshis(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint64_t val);
20374 * The remote node sets a limit on the minimum size of HTLCs we can send to them. This allows
20375 * you to limit the maximum minimum-size they can require.
20377 * Default value: u64::max_value.
20379 uint64_t ChannelHandshakeLimits_get_max_htlc_minimum_msat(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
20382 * The remote node sets a limit on the minimum size of HTLCs we can send to them. This allows
20383 * you to limit the maximum minimum-size they can require.
20385 * Default value: u64::max_value.
20387 void ChannelHandshakeLimits_set_max_htlc_minimum_msat(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint64_t val);
20390 * The remote node sets a limit on the maximum value of pending HTLCs to them at any given
20391 * time to limit their funds exposure to HTLCs. This allows you to set a minimum such value.
20393 * Default value: 0.
20395 uint64_t ChannelHandshakeLimits_get_min_max_htlc_value_in_flight_msat(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
20398 * The remote node sets a limit on the maximum value of pending HTLCs to them at any given
20399 * time to limit their funds exposure to HTLCs. This allows you to set a minimum such value.
20401 * Default value: 0.
20403 void ChannelHandshakeLimits_set_min_max_htlc_value_in_flight_msat(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint64_t val);
20406 * The remote node will require we keep a certain amount in direct payment to ourselves at all
20407 * time, ensuring that we are able to be punished if we broadcast an old state. This allows to
20408 * you limit the amount which we will have to keep to ourselves (and cannot use for HTLCs).
20410 * Default value: u64::max_value.
20412 uint64_t ChannelHandshakeLimits_get_max_channel_reserve_satoshis(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
20415 * The remote node will require we keep a certain amount in direct payment to ourselves at all
20416 * time, ensuring that we are able to be punished if we broadcast an old state. This allows to
20417 * you limit the amount which we will have to keep to ourselves (and cannot use for HTLCs).
20419 * Default value: u64::max_value.
20421 void ChannelHandshakeLimits_set_max_channel_reserve_satoshis(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint64_t val);
20424 * The remote node sets a limit on the maximum number of pending HTLCs to them at any given
20425 * time. This allows you to set a minimum such value.
20427 * Default value: 0.
20429 uint16_t ChannelHandshakeLimits_get_min_max_accepted_htlcs(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
20432 * The remote node sets a limit on the maximum number of pending HTLCs to them at any given
20433 * time. This allows you to set a minimum such value.
20435 * Default value: 0.
20437 void ChannelHandshakeLimits_set_min_max_accepted_htlcs(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint16_t val);
20440 * Before a channel is usable the funding transaction will need to be confirmed by at least a
20441 * certain number of blocks, specified by the node which is not the funder (as the funder can
20442 * assume they aren't going to double-spend themselves).
20443 * This config allows you to set a limit on the maximum amount of time to wait.
20445 * Default value: 144, or roughly one day and only applies to outbound channels.
20447 uint32_t ChannelHandshakeLimits_get_max_minimum_depth(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
20450 * Before a channel is usable the funding transaction will need to be confirmed by at least a
20451 * certain number of blocks, specified by the node which is not the funder (as the funder can
20452 * assume they aren't going to double-spend themselves).
20453 * This config allows you to set a limit on the maximum amount of time to wait.
20455 * Default value: 144, or roughly one day and only applies to outbound channels.
20457 void ChannelHandshakeLimits_set_max_minimum_depth(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint32_t val);
20460 * Whether we implicitly trust funding transactions generated by us for our own outbound
20461 * channels to not be double-spent.
20463 * If this is set, we assume that our own funding transactions are *never* double-spent, and
20464 * thus we can trust them without any confirmations. This is generally a reasonable
20465 * assumption, given we're the only ones who could ever double-spend it (assuming we have sole
20466 * control of the signing keys).
20468 * You may wish to un-set this if you allow the user to (or do in an automated fashion)
20469 * double-spend the funding transaction to RBF with an alternative channel open.
20471 * This only applies if our counterparty set their confirmations-required value to 0, and we
20472 * always trust our own funding transaction at 1 confirmation irrespective of this value.
20473 * Thus, this effectively acts as a `min_minimum_depth`, with the only possible values being
20474 * `true` (0) and `false` (1).
20476 * Default value: true
20478 bool ChannelHandshakeLimits_get_trust_own_funding_0conf(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
20481 * Whether we implicitly trust funding transactions generated by us for our own outbound
20482 * channels to not be double-spent.
20484 * If this is set, we assume that our own funding transactions are *never* double-spent, and
20485 * thus we can trust them without any confirmations. This is generally a reasonable
20486 * assumption, given we're the only ones who could ever double-spend it (assuming we have sole
20487 * control of the signing keys).
20489 * You may wish to un-set this if you allow the user to (or do in an automated fashion)
20490 * double-spend the funding transaction to RBF with an alternative channel open.
20492 * This only applies if our counterparty set their confirmations-required value to 0, and we
20493 * always trust our own funding transaction at 1 confirmation irrespective of this value.
20494 * Thus, this effectively acts as a `min_minimum_depth`, with the only possible values being
20495 * `true` (0) and `false` (1).
20497 * Default value: true
20499 void ChannelHandshakeLimits_set_trust_own_funding_0conf(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, bool val);
20502 * Set to force an incoming channel to match our announced channel preference in
20503 * [`ChannelHandshakeConfig::announced_channel`].
20505 * For a node which is not online reliably, this should be set to true and
20506 * [`ChannelHandshakeConfig::announced_channel`] set to false, ensuring that no announced (aka public)
20507 * channels will ever be opened.
20509 * Default value: true.
20511 bool ChannelHandshakeLimits_get_force_announced_channel_preference(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
20514 * Set to force an incoming channel to match our announced channel preference in
20515 * [`ChannelHandshakeConfig::announced_channel`].
20517 * For a node which is not online reliably, this should be set to true and
20518 * [`ChannelHandshakeConfig::announced_channel`] set to false, ensuring that no announced (aka public)
20519 * channels will ever be opened.
20521 * Default value: true.
20523 void ChannelHandshakeLimits_set_force_announced_channel_preference(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, bool val);
20526 * Set to the amount of time we're willing to wait to claim money back to us.
20528 * Not checking this value would be a security issue, as our peer would be able to set it to
20529 * max relative lock-time (a year) and we would \"lose\" money as it would be locked for a long time.
20531 * Default value: 2016, which we also enforce as a maximum value so you can tweak config to
20532 * reduce the loss of having useless locked funds (if your peer accepts)
20534 uint16_t ChannelHandshakeLimits_get_their_to_self_delay(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
20537 * Set to the amount of time we're willing to wait to claim money back to us.
20539 * Not checking this value would be a security issue, as our peer would be able to set it to
20540 * max relative lock-time (a year) and we would \"lose\" money as it would be locked for a long time.
20542 * Default value: 2016, which we also enforce as a maximum value so you can tweak config to
20543 * reduce the loss of having useless locked funds (if your peer accepts)
20545 void ChannelHandshakeLimits_set_their_to_self_delay(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint16_t val);
20548 * Constructs a new ChannelHandshakeLimits given each field
20550 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);
20553 * Creates a copy of the ChannelHandshakeLimits
20555 struct LDKChannelHandshakeLimits ChannelHandshakeLimits_clone(const struct LDKChannelHandshakeLimits *NONNULL_PTR orig);
20558 * Creates a "default" ChannelHandshakeLimits. See struct and individual field documentaiton for details on which values are used.
20560 MUST_USE_RES struct LDKChannelHandshakeLimits ChannelHandshakeLimits_default(void);
20563 * Frees any resources used by the ChannelConfig, if is_owned is set and inner is non-NULL.
20565 void ChannelConfig_free(struct LDKChannelConfig this_obj);
20568 * Amount (in millionths of a satoshi) charged per satoshi for payments forwarded outbound
20569 * over the channel.
20570 * This may be allowed to change at runtime in a later update, however doing so must result in
20571 * update messages sent to notify all nodes of our updated relay fee.
20573 * Default value: 0.
20575 uint32_t ChannelConfig_get_forwarding_fee_proportional_millionths(const struct LDKChannelConfig *NONNULL_PTR this_ptr);
20578 * Amount (in millionths of a satoshi) charged per satoshi for payments forwarded outbound
20579 * over the channel.
20580 * This may be allowed to change at runtime in a later update, however doing so must result in
20581 * update messages sent to notify all nodes of our updated relay fee.
20583 * Default value: 0.
20585 void ChannelConfig_set_forwarding_fee_proportional_millionths(struct LDKChannelConfig *NONNULL_PTR this_ptr, uint32_t val);
20588 * Amount (in milli-satoshi) charged for payments forwarded outbound over the channel, in
20589 * excess of [`forwarding_fee_proportional_millionths`].
20590 * This may be allowed to change at runtime in a later update, however doing so must result in
20591 * update messages sent to notify all nodes of our updated relay fee.
20593 * The default value of a single satoshi roughly matches the market rate on many routing nodes
20594 * as of July 2021. Adjusting it upwards or downwards may change whether nodes route through
20597 * Default value: 1000.
20599 * [`forwarding_fee_proportional_millionths`]: ChannelConfig::forwarding_fee_proportional_millionths
20601 uint32_t ChannelConfig_get_forwarding_fee_base_msat(const struct LDKChannelConfig *NONNULL_PTR this_ptr);
20604 * Amount (in milli-satoshi) charged for payments forwarded outbound over the channel, in
20605 * excess of [`forwarding_fee_proportional_millionths`].
20606 * This may be allowed to change at runtime in a later update, however doing so must result in
20607 * update messages sent to notify all nodes of our updated relay fee.
20609 * The default value of a single satoshi roughly matches the market rate on many routing nodes
20610 * as of July 2021. Adjusting it upwards or downwards may change whether nodes route through
20613 * Default value: 1000.
20615 * [`forwarding_fee_proportional_millionths`]: ChannelConfig::forwarding_fee_proportional_millionths
20617 void ChannelConfig_set_forwarding_fee_base_msat(struct LDKChannelConfig *NONNULL_PTR this_ptr, uint32_t val);
20620 * The difference in the CLTV value between incoming HTLCs and an outbound HTLC forwarded over
20621 * the channel this config applies to.
20623 * This is analogous to [`ChannelHandshakeConfig::our_to_self_delay`] but applies to in-flight
20624 * HTLC balance when a channel appears on-chain whereas
20625 * [`ChannelHandshakeConfig::our_to_self_delay`] applies to the remaining
20626 * (non-HTLC-encumbered) balance.
20628 * Thus, for HTLC-encumbered balances to be enforced on-chain when a channel is force-closed,
20629 * we (or one of our watchtowers) MUST be online to check for broadcast of the current
20630 * commitment transaction at least once per this many blocks (minus some margin to allow us
20631 * enough time to broadcast and confirm a transaction, possibly with time in between to RBF
20632 * the spending transaction).
20634 * Default value: 72 (12 hours at an average of 6 blocks/hour).
20635 * Minimum value: [`MIN_CLTV_EXPIRY_DELTA`], any values less than this will be treated as
20636 * [`MIN_CLTV_EXPIRY_DELTA`] instead.
20638 * [`MIN_CLTV_EXPIRY_DELTA`]: crate::ln::channelmanager::MIN_CLTV_EXPIRY_DELTA
20640 uint16_t ChannelConfig_get_cltv_expiry_delta(const struct LDKChannelConfig *NONNULL_PTR this_ptr);
20643 * The difference in the CLTV value between incoming HTLCs and an outbound HTLC forwarded over
20644 * the channel this config applies to.
20646 * This is analogous to [`ChannelHandshakeConfig::our_to_self_delay`] but applies to in-flight
20647 * HTLC balance when a channel appears on-chain whereas
20648 * [`ChannelHandshakeConfig::our_to_self_delay`] applies to the remaining
20649 * (non-HTLC-encumbered) balance.
20651 * Thus, for HTLC-encumbered balances to be enforced on-chain when a channel is force-closed,
20652 * we (or one of our watchtowers) MUST be online to check for broadcast of the current
20653 * commitment transaction at least once per this many blocks (minus some margin to allow us
20654 * enough time to broadcast and confirm a transaction, possibly with time in between to RBF
20655 * the spending transaction).
20657 * Default value: 72 (12 hours at an average of 6 blocks/hour).
20658 * Minimum value: [`MIN_CLTV_EXPIRY_DELTA`], any values less than this will be treated as
20659 * [`MIN_CLTV_EXPIRY_DELTA`] instead.
20661 * [`MIN_CLTV_EXPIRY_DELTA`]: crate::ln::channelmanager::MIN_CLTV_EXPIRY_DELTA
20663 void ChannelConfig_set_cltv_expiry_delta(struct LDKChannelConfig *NONNULL_PTR this_ptr, uint16_t val);
20666 * Limit our total exposure to in-flight HTLCs which are burned to fees as they are too
20667 * small to claim on-chain.
20669 * When an HTLC present in one of our channels is below a \"dust\" threshold, the HTLC will
20670 * not be claimable on-chain, instead being turned into additional miner fees if either
20671 * party force-closes the channel. Because the threshold is per-HTLC, our total exposure
20672 * to such payments may be sustantial if there are many dust HTLCs present when the
20673 * channel is force-closed.
20675 * The dust threshold for each HTLC is based on the `dust_limit_satoshis` for each party in a
20676 * channel negotiated throughout the channel open process, along with the fees required to have
20677 * a broadcastable HTLC spending transaction. When a channel supports anchor outputs
20678 * (specifically the zero fee HTLC transaction variant), this threshold no longer takes into
20679 * account the HTLC transaction fee as it is zero.
20681 * This limit is applied for sent, forwarded, and received HTLCs and limits the total
20682 * exposure across all three types per-channel. Setting this too low may prevent the
20683 * sending or receipt of low-value HTLCs on high-traffic nodes, and this limit is very
20684 * important to prevent stealing of dust HTLCs by miners.
20686 * Default value: 5_000_000 msat.
20688 uint64_t ChannelConfig_get_max_dust_htlc_exposure_msat(const struct LDKChannelConfig *NONNULL_PTR this_ptr);
20691 * Limit our total exposure to in-flight HTLCs which are burned to fees as they are too
20692 * small to claim on-chain.
20694 * When an HTLC present in one of our channels is below a \"dust\" threshold, the HTLC will
20695 * not be claimable on-chain, instead being turned into additional miner fees if either
20696 * party force-closes the channel. Because the threshold is per-HTLC, our total exposure
20697 * to such payments may be sustantial if there are many dust HTLCs present when the
20698 * channel is force-closed.
20700 * The dust threshold for each HTLC is based on the `dust_limit_satoshis` for each party in a
20701 * channel negotiated throughout the channel open process, along with the fees required to have
20702 * a broadcastable HTLC spending transaction. When a channel supports anchor outputs
20703 * (specifically the zero fee HTLC transaction variant), this threshold no longer takes into
20704 * account the HTLC transaction fee as it is zero.
20706 * This limit is applied for sent, forwarded, and received HTLCs and limits the total
20707 * exposure across all three types per-channel. Setting this too low may prevent the
20708 * sending or receipt of low-value HTLCs on high-traffic nodes, and this limit is very
20709 * important to prevent stealing of dust HTLCs by miners.
20711 * Default value: 5_000_000 msat.
20713 void ChannelConfig_set_max_dust_htlc_exposure_msat(struct LDKChannelConfig *NONNULL_PTR this_ptr, uint64_t val);
20716 * The additional fee we're willing to pay to avoid waiting for the counterparty's
20717 * `to_self_delay` to reclaim funds.
20719 * When we close a channel cooperatively with our counterparty, we negotiate a fee for the
20720 * closing transaction which both sides find acceptable, ultimately paid by the channel
20721 * funder/initiator.
20723 * When we are the funder, because we have to pay the channel closing fee, we bound the
20724 * acceptable fee by our [`Background`] and [`Normal`] fees, with the upper bound increased by
20725 * this value. Because the on-chain fee we'd pay to force-close the channel is kept near our
20726 * [`Normal`] feerate during normal operation, this value represents the additional fee we're
20727 * willing to pay in order to avoid waiting for our counterparty's to_self_delay to reclaim our
20730 * When we are not the funder, we require the closing transaction fee pay at least our
20731 * [`Background`] fee estimate, but allow our counterparty to pay as much fee as they like.
20732 * Thus, this value is ignored when we are not the funder.
20734 * Default value: 1000 satoshis.
20736 * [`Normal`]: crate::chain::chaininterface::ConfirmationTarget::Normal
20737 * [`Background`]: crate::chain::chaininterface::ConfirmationTarget::Background
20739 uint64_t ChannelConfig_get_force_close_avoidance_max_fee_satoshis(const struct LDKChannelConfig *NONNULL_PTR this_ptr);
20742 * The additional fee we're willing to pay to avoid waiting for the counterparty's
20743 * `to_self_delay` to reclaim funds.
20745 * When we close a channel cooperatively with our counterparty, we negotiate a fee for the
20746 * closing transaction which both sides find acceptable, ultimately paid by the channel
20747 * funder/initiator.
20749 * When we are the funder, because we have to pay the channel closing fee, we bound the
20750 * acceptable fee by our [`Background`] and [`Normal`] fees, with the upper bound increased by
20751 * this value. Because the on-chain fee we'd pay to force-close the channel is kept near our
20752 * [`Normal`] feerate during normal operation, this value represents the additional fee we're
20753 * willing to pay in order to avoid waiting for our counterparty's to_self_delay to reclaim our
20756 * When we are not the funder, we require the closing transaction fee pay at least our
20757 * [`Background`] fee estimate, but allow our counterparty to pay as much fee as they like.
20758 * Thus, this value is ignored when we are not the funder.
20760 * Default value: 1000 satoshis.
20762 * [`Normal`]: crate::chain::chaininterface::ConfirmationTarget::Normal
20763 * [`Background`]: crate::chain::chaininterface::ConfirmationTarget::Background
20765 void ChannelConfig_set_force_close_avoidance_max_fee_satoshis(struct LDKChannelConfig *NONNULL_PTR this_ptr, uint64_t val);
20768 * Constructs a new ChannelConfig given each field
20770 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, uint64_t max_dust_htlc_exposure_msat_arg, uint64_t force_close_avoidance_max_fee_satoshis_arg);
20773 * Creates a copy of the ChannelConfig
20775 struct LDKChannelConfig ChannelConfig_clone(const struct LDKChannelConfig *NONNULL_PTR orig);
20778 * Checks if two ChannelConfigs contain equal inner contents.
20779 * This ignores pointers and is_owned flags and looks at the values in fields.
20780 * Two objects with NULL inner values will be considered "equal" here.
20782 bool ChannelConfig_eq(const struct LDKChannelConfig *NONNULL_PTR a, const struct LDKChannelConfig *NONNULL_PTR b);
20785 * Creates a "default" ChannelConfig. See struct and individual field documentaiton for details on which values are used.
20787 MUST_USE_RES struct LDKChannelConfig ChannelConfig_default(void);
20790 * Serialize the ChannelConfig object into a byte array which can be read by ChannelConfig_read
20792 struct LDKCVec_u8Z ChannelConfig_write(const struct LDKChannelConfig *NONNULL_PTR obj);
20795 * Read a ChannelConfig from a byte array, created by ChannelConfig_write
20797 struct LDKCResult_ChannelConfigDecodeErrorZ ChannelConfig_read(struct LDKu8slice ser);
20800 * Frees any resources used by the UserConfig, if is_owned is set and inner is non-NULL.
20802 void UserConfig_free(struct LDKUserConfig this_obj);
20805 * Channel handshake config that we propose to our counterparty.
20807 struct LDKChannelHandshakeConfig UserConfig_get_channel_handshake_config(const struct LDKUserConfig *NONNULL_PTR this_ptr);
20810 * Channel handshake config that we propose to our counterparty.
20812 void UserConfig_set_channel_handshake_config(struct LDKUserConfig *NONNULL_PTR this_ptr, struct LDKChannelHandshakeConfig val);
20815 * Limits applied to our counterparty's proposed channel handshake config settings.
20817 struct LDKChannelHandshakeLimits UserConfig_get_channel_handshake_limits(const struct LDKUserConfig *NONNULL_PTR this_ptr);
20820 * Limits applied to our counterparty's proposed channel handshake config settings.
20822 void UserConfig_set_channel_handshake_limits(struct LDKUserConfig *NONNULL_PTR this_ptr, struct LDKChannelHandshakeLimits val);
20825 * Channel config which affects behavior during channel lifetime.
20827 struct LDKChannelConfig UserConfig_get_channel_config(const struct LDKUserConfig *NONNULL_PTR this_ptr);
20830 * Channel config which affects behavior during channel lifetime.
20832 void UserConfig_set_channel_config(struct LDKUserConfig *NONNULL_PTR this_ptr, struct LDKChannelConfig val);
20835 * If this is set to false, we will reject any HTLCs which were to be forwarded over private
20836 * channels. This prevents us from taking on HTLC-forwarding risk when we intend to run as a
20837 * node which is not online reliably.
20839 * For nodes which are not online reliably, you should set all channels to *not* be announced
20840 * (using [`ChannelHandshakeConfig::announced_channel`] and
20841 * [`ChannelHandshakeLimits::force_announced_channel_preference`]) and set this to false to
20842 * ensure you are not exposed to any forwarding risk.
20844 * Note that because you cannot change a channel's announced state after creation, there is no
20845 * way to disable forwarding on public channels retroactively. Thus, in order to change a node
20846 * from a publicly-announced forwarding node to a private non-forwarding node you must close
20847 * all your channels and open new ones. For privacy, you should also change your node_id
20848 * (swapping all private and public key material for new ones) at that time.
20850 * Default value: false.
20852 bool UserConfig_get_accept_forwards_to_priv_channels(const struct LDKUserConfig *NONNULL_PTR this_ptr);
20855 * If this is set to false, we will reject any HTLCs which were to be forwarded over private
20856 * channels. This prevents us from taking on HTLC-forwarding risk when we intend to run as a
20857 * node which is not online reliably.
20859 * For nodes which are not online reliably, you should set all channels to *not* be announced
20860 * (using [`ChannelHandshakeConfig::announced_channel`] and
20861 * [`ChannelHandshakeLimits::force_announced_channel_preference`]) and set this to false to
20862 * ensure you are not exposed to any forwarding risk.
20864 * Note that because you cannot change a channel's announced state after creation, there is no
20865 * way to disable forwarding on public channels retroactively. Thus, in order to change a node
20866 * from a publicly-announced forwarding node to a private non-forwarding node you must close
20867 * all your channels and open new ones. For privacy, you should also change your node_id
20868 * (swapping all private and public key material for new ones) at that time.
20870 * Default value: false.
20872 void UserConfig_set_accept_forwards_to_priv_channels(struct LDKUserConfig *NONNULL_PTR this_ptr, bool val);
20875 * If this is set to false, we do not accept inbound requests to open a new channel.
20876 * Default value: true.
20878 bool UserConfig_get_accept_inbound_channels(const struct LDKUserConfig *NONNULL_PTR this_ptr);
20881 * If this is set to false, we do not accept inbound requests to open a new channel.
20882 * Default value: true.
20884 void UserConfig_set_accept_inbound_channels(struct LDKUserConfig *NONNULL_PTR this_ptr, bool val);
20887 * If this is set to true, the user needs to manually accept inbound requests to open a new
20890 * When set to true, [`Event::OpenChannelRequest`] will be triggered once a request to open a
20891 * new inbound channel is received through a [`msgs::OpenChannel`] message. In that case, a
20892 * [`msgs::AcceptChannel`] message will not be sent back to the counterparty node unless the
20893 * user explicitly chooses to accept the request.
20895 * Default value: false.
20897 * [`Event::OpenChannelRequest`]: crate::util::events::Event::OpenChannelRequest
20898 * [`msgs::OpenChannel`]: crate::ln::msgs::OpenChannel
20899 * [`msgs::AcceptChannel`]: crate::ln::msgs::AcceptChannel
20901 bool UserConfig_get_manually_accept_inbound_channels(const struct LDKUserConfig *NONNULL_PTR this_ptr);
20904 * If this is set to true, the user needs to manually accept inbound requests to open a new
20907 * When set to true, [`Event::OpenChannelRequest`] will be triggered once a request to open a
20908 * new inbound channel is received through a [`msgs::OpenChannel`] message. In that case, a
20909 * [`msgs::AcceptChannel`] message will not be sent back to the counterparty node unless the
20910 * user explicitly chooses to accept the request.
20912 * Default value: false.
20914 * [`Event::OpenChannelRequest`]: crate::util::events::Event::OpenChannelRequest
20915 * [`msgs::OpenChannel`]: crate::ln::msgs::OpenChannel
20916 * [`msgs::AcceptChannel`]: crate::ln::msgs::AcceptChannel
20918 void UserConfig_set_manually_accept_inbound_channels(struct LDKUserConfig *NONNULL_PTR this_ptr, bool val);
20921 * If this is set to true, LDK will intercept HTLCs that are attempting to be forwarded over
20922 * fake short channel ids generated via [`ChannelManager::get_intercept_scid`]. Upon HTLC
20923 * intercept, LDK will generate an [`Event::HTLCIntercepted`] which MUST be handled by the user.
20925 * Setting this to true may break backwards compatibility with LDK versions < 0.0.113.
20927 * Default value: false.
20929 * [`ChannelManager::get_intercept_scid`]: crate::ln::channelmanager::ChannelManager::get_intercept_scid
20930 * [`Event::HTLCIntercepted`]: crate::util::events::Event::HTLCIntercepted
20932 bool UserConfig_get_accept_intercept_htlcs(const struct LDKUserConfig *NONNULL_PTR this_ptr);
20935 * If this is set to true, LDK will intercept HTLCs that are attempting to be forwarded over
20936 * fake short channel ids generated via [`ChannelManager::get_intercept_scid`]. Upon HTLC
20937 * intercept, LDK will generate an [`Event::HTLCIntercepted`] which MUST be handled by the user.
20939 * Setting this to true may break backwards compatibility with LDK versions < 0.0.113.
20941 * Default value: false.
20943 * [`ChannelManager::get_intercept_scid`]: crate::ln::channelmanager::ChannelManager::get_intercept_scid
20944 * [`Event::HTLCIntercepted`]: crate::util::events::Event::HTLCIntercepted
20946 void UserConfig_set_accept_intercept_htlcs(struct LDKUserConfig *NONNULL_PTR this_ptr, bool val);
20949 * Constructs a new UserConfig given each field
20951 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);
20954 * Creates a copy of the UserConfig
20956 struct LDKUserConfig UserConfig_clone(const struct LDKUserConfig *NONNULL_PTR orig);
20959 * Creates a "default" UserConfig. See struct and individual field documentaiton for details on which values are used.
20961 MUST_USE_RES struct LDKUserConfig UserConfig_default(void);
20964 * Frees any resources used by the BestBlock, if is_owned is set and inner is non-NULL.
20966 void BestBlock_free(struct LDKBestBlock this_obj);
20969 * Creates a copy of the BestBlock
20971 struct LDKBestBlock BestBlock_clone(const struct LDKBestBlock *NONNULL_PTR orig);
20974 * Checks if two BestBlocks contain equal inner contents.
20975 * This ignores pointers and is_owned flags and looks at the values in fields.
20976 * Two objects with NULL inner values will be considered "equal" here.
20978 bool BestBlock_eq(const struct LDKBestBlock *NONNULL_PTR a, const struct LDKBestBlock *NONNULL_PTR b);
20981 * Constructs a `BestBlock` that represents the genesis block at height 0 of the given
20984 MUST_USE_RES struct LDKBestBlock BestBlock_from_genesis(enum LDKNetwork network);
20987 * Returns a `BestBlock` as identified by the given block hash and height.
20989 MUST_USE_RES struct LDKBestBlock BestBlock_new(struct LDKThirtyTwoBytes block_hash, uint32_t height);
20992 * Returns the best block hash.
20994 MUST_USE_RES struct LDKThirtyTwoBytes BestBlock_block_hash(const struct LDKBestBlock *NONNULL_PTR this_arg);
20997 * Returns the best block height.
20999 MUST_USE_RES uint32_t BestBlock_height(const struct LDKBestBlock *NONNULL_PTR this_arg);
21002 * Creates a copy of the AccessError
21004 enum LDKAccessError AccessError_clone(const enum LDKAccessError *NONNULL_PTR orig);
21007 * Utility method to constructs a new UnknownChain-variant AccessError
21009 enum LDKAccessError AccessError_unknown_chain(void);
21012 * Utility method to constructs a new UnknownTx-variant AccessError
21014 enum LDKAccessError AccessError_unknown_tx(void);
21017 * Calls the free function if one is set
21019 void Access_free(struct LDKAccess this_ptr);
21022 * Calls the free function if one is set
21024 void Listen_free(struct LDKListen this_ptr);
21027 * Calls the free function if one is set
21029 void Confirm_free(struct LDKConfirm this_ptr);
21032 * Creates a copy of the ChannelMonitorUpdateStatus
21034 enum LDKChannelMonitorUpdateStatus ChannelMonitorUpdateStatus_clone(const enum LDKChannelMonitorUpdateStatus *NONNULL_PTR orig);
21037 * Utility method to constructs a new Completed-variant ChannelMonitorUpdateStatus
21039 enum LDKChannelMonitorUpdateStatus ChannelMonitorUpdateStatus_completed(void);
21042 * Utility method to constructs a new InProgress-variant ChannelMonitorUpdateStatus
21044 enum LDKChannelMonitorUpdateStatus ChannelMonitorUpdateStatus_in_progress(void);
21047 * Utility method to constructs a new PermanentFailure-variant ChannelMonitorUpdateStatus
21049 enum LDKChannelMonitorUpdateStatus ChannelMonitorUpdateStatus_permanent_failure(void);
21052 * Checks if two ChannelMonitorUpdateStatuss contain equal inner contents.
21053 * This ignores pointers and is_owned flags and looks at the values in fields.
21055 bool ChannelMonitorUpdateStatus_eq(const enum LDKChannelMonitorUpdateStatus *NONNULL_PTR a, const enum LDKChannelMonitorUpdateStatus *NONNULL_PTR b);
21058 * Calls the free function if one is set
21060 void Watch_free(struct LDKWatch this_ptr);
21063 * Calls the free function if one is set
21065 void Filter_free(struct LDKFilter this_ptr);
21068 * Frees any resources used by the WatchedOutput, if is_owned is set and inner is non-NULL.
21070 void WatchedOutput_free(struct LDKWatchedOutput this_obj);
21073 * First block where the transaction output may have been spent.
21075 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
21077 struct LDKThirtyTwoBytes WatchedOutput_get_block_hash(const struct LDKWatchedOutput *NONNULL_PTR this_ptr);
21080 * First block where the transaction output may have been spent.
21082 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
21084 void WatchedOutput_set_block_hash(struct LDKWatchedOutput *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
21087 * Outpoint identifying the transaction output.
21089 struct LDKOutPoint WatchedOutput_get_outpoint(const struct LDKWatchedOutput *NONNULL_PTR this_ptr);
21092 * Outpoint identifying the transaction output.
21094 void WatchedOutput_set_outpoint(struct LDKWatchedOutput *NONNULL_PTR this_ptr, struct LDKOutPoint val);
21097 * Spending condition of the transaction output.
21099 struct LDKu8slice WatchedOutput_get_script_pubkey(const struct LDKWatchedOutput *NONNULL_PTR this_ptr);
21102 * Spending condition of the transaction output.
21104 void WatchedOutput_set_script_pubkey(struct LDKWatchedOutput *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val);
21107 * Constructs a new WatchedOutput given each field
21109 MUST_USE_RES struct LDKWatchedOutput WatchedOutput_new(struct LDKThirtyTwoBytes block_hash_arg, struct LDKOutPoint outpoint_arg, struct LDKCVec_u8Z script_pubkey_arg);
21112 * Creates a copy of the WatchedOutput
21114 struct LDKWatchedOutput WatchedOutput_clone(const struct LDKWatchedOutput *NONNULL_PTR orig);
21117 * Checks if two WatchedOutputs contain equal inner contents.
21118 * This ignores pointers and is_owned flags and looks at the values in fields.
21119 * Two objects with NULL inner values will be considered "equal" here.
21121 bool WatchedOutput_eq(const struct LDKWatchedOutput *NONNULL_PTR a, const struct LDKWatchedOutput *NONNULL_PTR b);
21124 * Checks if two WatchedOutputs contain equal inner contents.
21126 uint64_t WatchedOutput_hash(const struct LDKWatchedOutput *NONNULL_PTR o);
21129 * Calls the free function if one is set
21131 void BroadcasterInterface_free(struct LDKBroadcasterInterface this_ptr);
21134 * Creates a copy of the ConfirmationTarget
21136 enum LDKConfirmationTarget ConfirmationTarget_clone(const enum LDKConfirmationTarget *NONNULL_PTR orig);
21139 * Utility method to constructs a new Background-variant ConfirmationTarget
21141 enum LDKConfirmationTarget ConfirmationTarget_background(void);
21144 * Utility method to constructs a new Normal-variant ConfirmationTarget
21146 enum LDKConfirmationTarget ConfirmationTarget_normal(void);
21149 * Utility method to constructs a new HighPriority-variant ConfirmationTarget
21151 enum LDKConfirmationTarget ConfirmationTarget_high_priority(void);
21154 * Checks if two ConfirmationTargets contain equal inner contents.
21156 uint64_t ConfirmationTarget_hash(const enum LDKConfirmationTarget *NONNULL_PTR o);
21159 * Checks if two ConfirmationTargets contain equal inner contents.
21160 * This ignores pointers and is_owned flags and looks at the values in fields.
21162 bool ConfirmationTarget_eq(const enum LDKConfirmationTarget *NONNULL_PTR a, const enum LDKConfirmationTarget *NONNULL_PTR b);
21165 * Calls the free function if one is set
21167 void FeeEstimator_free(struct LDKFeeEstimator this_ptr);
21170 * Frees any resources used by the MonitorUpdateId, if is_owned is set and inner is non-NULL.
21172 void MonitorUpdateId_free(struct LDKMonitorUpdateId this_obj);
21175 * Creates a copy of the MonitorUpdateId
21177 struct LDKMonitorUpdateId MonitorUpdateId_clone(const struct LDKMonitorUpdateId *NONNULL_PTR orig);
21180 * Checks if two MonitorUpdateIds contain equal inner contents.
21182 uint64_t MonitorUpdateId_hash(const struct LDKMonitorUpdateId *NONNULL_PTR o);
21185 * Checks if two MonitorUpdateIds contain equal inner contents.
21186 * This ignores pointers and is_owned flags and looks at the values in fields.
21187 * Two objects with NULL inner values will be considered "equal" here.
21189 bool MonitorUpdateId_eq(const struct LDKMonitorUpdateId *NONNULL_PTR a, const struct LDKMonitorUpdateId *NONNULL_PTR b);
21192 * Calls the free function if one is set
21194 void Persist_free(struct LDKPersist this_ptr);
21197 * Frees any resources used by the LockedChannelMonitor, if is_owned is set and inner is non-NULL.
21199 void LockedChannelMonitor_free(struct LDKLockedChannelMonitor this_obj);
21202 * Frees any resources used by the ChainMonitor, if is_owned is set and inner is non-NULL.
21204 void ChainMonitor_free(struct LDKChainMonitor this_obj);
21207 * Creates a new `ChainMonitor` used to watch on-chain activity pertaining to channels.
21209 * When an optional chain source implementing [`chain::Filter`] is provided, the chain monitor
21210 * will call back to it indicating transactions and outputs of interest. This allows clients to
21211 * pre-filter blocks or only fetch blocks matching a compact filter. Otherwise, clients may
21212 * always need to fetch full blocks absent another means for determining which blocks contain
21213 * transactions relevant to the watched channels.
21215 MUST_USE_RES struct LDKChainMonitor ChainMonitor_new(struct LDKCOption_FilterZ chain_source, struct LDKBroadcasterInterface broadcaster, struct LDKLogger logger, struct LDKFeeEstimator feeest, struct LDKPersist persister);
21218 * Gets the balances in the contained [`ChannelMonitor`]s which are claimable on-chain or
21219 * claims which are awaiting confirmation.
21221 * Includes the balances from each [`ChannelMonitor`] *except* those included in
21222 * `ignored_channels`, allowing you to filter out balances from channels which are still open
21223 * (and whose balance should likely be pulled from the [`ChannelDetails`]).
21225 * See [`ChannelMonitor::get_claimable_balances`] for more details on the exact criteria for
21226 * inclusion in the return value.
21228 MUST_USE_RES struct LDKCVec_BalanceZ ChainMonitor_get_claimable_balances(const struct LDKChainMonitor *NONNULL_PTR this_arg, struct LDKCVec_ChannelDetailsZ ignored_channels);
21231 * Gets the [`LockedChannelMonitor`] for a given funding outpoint, returning an `Err` if no
21232 * such [`ChannelMonitor`] is currently being monitored for.
21234 * Note that the result holds a mutex over our monitor set, and should not be held
21237 MUST_USE_RES struct LDKCResult_LockedChannelMonitorNoneZ ChainMonitor_get_monitor(const struct LDKChainMonitor *NONNULL_PTR this_arg, struct LDKOutPoint funding_txo);
21240 * Lists the funding outpoint of each [`ChannelMonitor`] being monitored.
21242 * Note that [`ChannelMonitor`]s are not removed when a channel is closed as they are always
21243 * monitoring for on-chain state resolutions.
21245 MUST_USE_RES struct LDKCVec_OutPointZ ChainMonitor_list_monitors(const struct LDKChainMonitor *NONNULL_PTR this_arg);
21248 * Lists the pending updates for each [`ChannelMonitor`] (by `OutPoint` being monitored).
21250 MUST_USE_RES struct LDKCVec_C2Tuple_OutPointCVec_MonitorUpdateIdZZZ ChainMonitor_list_pending_monitor_updates(const struct LDKChainMonitor *NONNULL_PTR this_arg);
21253 * Indicates the persistence of a [`ChannelMonitor`] has completed after
21254 * [`ChannelMonitorUpdateStatus::InProgress`] was returned from an update operation.
21256 * Thus, the anticipated use is, at a high level:
21257 * 1) This [`ChainMonitor`] calls [`Persist::update_persisted_channel`] which stores the
21258 * update to disk and begins updating any remote (e.g. watchtower/backup) copies,
21259 * returning [`ChannelMonitorUpdateStatus::InProgress`],
21260 * 2) once all remote copies are updated, you call this function with the
21261 * `completed_update_id` that completed, and once all pending updates have completed the
21262 * channel will be re-enabled.
21264 * Returns an [`APIError::APIMisuseError`] if `funding_txo` does not match any currently
21265 * registered [`ChannelMonitor`]s.
21267 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);
21270 * Constructs a new Listen which calls the relevant methods on this_arg.
21271 * This copies the `inner` pointer in this_arg and thus the returned Listen must be freed before this_arg is
21273 struct LDKListen ChainMonitor_as_Listen(const struct LDKChainMonitor *NONNULL_PTR this_arg);
21276 * Constructs a new Confirm which calls the relevant methods on this_arg.
21277 * This copies the `inner` pointer in this_arg and thus the returned Confirm must be freed before this_arg is
21279 struct LDKConfirm ChainMonitor_as_Confirm(const struct LDKChainMonitor *NONNULL_PTR this_arg);
21282 * Constructs a new Watch which calls the relevant methods on this_arg.
21283 * This copies the `inner` pointer in this_arg and thus the returned Watch must be freed before this_arg is
21285 struct LDKWatch ChainMonitor_as_Watch(const struct LDKChainMonitor *NONNULL_PTR this_arg);
21288 * Constructs a new EventsProvider which calls the relevant methods on this_arg.
21289 * This copies the `inner` pointer in this_arg and thus the returned EventsProvider must be freed before this_arg is
21291 struct LDKEventsProvider ChainMonitor_as_EventsProvider(const struct LDKChainMonitor *NONNULL_PTR this_arg);
21294 * Frees any resources used by the ChannelMonitorUpdate, if is_owned is set and inner is non-NULL.
21296 void ChannelMonitorUpdate_free(struct LDKChannelMonitorUpdate this_obj);
21299 * The sequence number of this update. Updates *must* be replayed in-order according to this
21300 * sequence number (and updates may panic if they are not). The update_id values are strictly
21301 * increasing and increase by one for each new update, with one exception specified below.
21303 * This sequence number is also used to track up to which points updates which returned
21304 * [`ChannelMonitorUpdateStatus::InProgress`] have been applied to all copies of a given
21305 * ChannelMonitor when ChannelManager::channel_monitor_updated is called.
21307 * The only instance where update_id values are not strictly increasing is the case where we
21308 * allow post-force-close updates with a special update ID of [`CLOSED_CHANNEL_UPDATE_ID`]. See
21309 * its docs for more details.
21311 * [`ChannelMonitorUpdateStatus::InProgress`]: super::ChannelMonitorUpdateStatus::InProgress
21313 uint64_t ChannelMonitorUpdate_get_update_id(const struct LDKChannelMonitorUpdate *NONNULL_PTR this_ptr);
21316 * The sequence number of this update. Updates *must* be replayed in-order according to this
21317 * sequence number (and updates may panic if they are not). The update_id values are strictly
21318 * increasing and increase by one for each new update, with one exception specified below.
21320 * This sequence number is also used to track up to which points updates which returned
21321 * [`ChannelMonitorUpdateStatus::InProgress`] have been applied to all copies of a given
21322 * ChannelMonitor when ChannelManager::channel_monitor_updated is called.
21324 * The only instance where update_id values are not strictly increasing is the case where we
21325 * allow post-force-close updates with a special update ID of [`CLOSED_CHANNEL_UPDATE_ID`]. See
21326 * its docs for more details.
21328 * [`ChannelMonitorUpdateStatus::InProgress`]: super::ChannelMonitorUpdateStatus::InProgress
21330 void ChannelMonitorUpdate_set_update_id(struct LDKChannelMonitorUpdate *NONNULL_PTR this_ptr, uint64_t val);
21333 * Creates a copy of the ChannelMonitorUpdate
21335 struct LDKChannelMonitorUpdate ChannelMonitorUpdate_clone(const struct LDKChannelMonitorUpdate *NONNULL_PTR orig);
21338 * Serialize the ChannelMonitorUpdate object into a byte array which can be read by ChannelMonitorUpdate_read
21340 struct LDKCVec_u8Z ChannelMonitorUpdate_write(const struct LDKChannelMonitorUpdate *NONNULL_PTR obj);
21343 * Read a ChannelMonitorUpdate from a byte array, created by ChannelMonitorUpdate_write
21345 struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ ChannelMonitorUpdate_read(struct LDKu8slice ser);
21348 * Frees any resources used by the MonitorEvent
21350 void MonitorEvent_free(struct LDKMonitorEvent this_ptr);
21353 * Creates a copy of the MonitorEvent
21355 struct LDKMonitorEvent MonitorEvent_clone(const struct LDKMonitorEvent *NONNULL_PTR orig);
21358 * Utility method to constructs a new HTLCEvent-variant MonitorEvent
21360 struct LDKMonitorEvent MonitorEvent_htlcevent(struct LDKHTLCUpdate a);
21363 * Utility method to constructs a new CommitmentTxConfirmed-variant MonitorEvent
21365 struct LDKMonitorEvent MonitorEvent_commitment_tx_confirmed(struct LDKOutPoint a);
21368 * Utility method to constructs a new Completed-variant MonitorEvent
21370 struct LDKMonitorEvent MonitorEvent_completed(struct LDKOutPoint funding_txo, uint64_t monitor_update_id);
21373 * Utility method to constructs a new UpdateFailed-variant MonitorEvent
21375 struct LDKMonitorEvent MonitorEvent_update_failed(struct LDKOutPoint a);
21378 * Checks if two MonitorEvents contain equal inner contents.
21379 * This ignores pointers and is_owned flags and looks at the values in fields.
21381 bool MonitorEvent_eq(const struct LDKMonitorEvent *NONNULL_PTR a, const struct LDKMonitorEvent *NONNULL_PTR b);
21384 * Serialize the MonitorEvent object into a byte array which can be read by MonitorEvent_read
21386 struct LDKCVec_u8Z MonitorEvent_write(const struct LDKMonitorEvent *NONNULL_PTR obj);
21389 * Read a MonitorEvent from a byte array, created by MonitorEvent_write
21391 struct LDKCResult_COption_MonitorEventZDecodeErrorZ MonitorEvent_read(struct LDKu8slice ser);
21394 * Frees any resources used by the HTLCUpdate, if is_owned is set and inner is non-NULL.
21396 void HTLCUpdate_free(struct LDKHTLCUpdate this_obj);
21399 * Creates a copy of the HTLCUpdate
21401 struct LDKHTLCUpdate HTLCUpdate_clone(const struct LDKHTLCUpdate *NONNULL_PTR orig);
21404 * Checks if two HTLCUpdates contain equal inner contents.
21405 * This ignores pointers and is_owned flags and looks at the values in fields.
21406 * Two objects with NULL inner values will be considered "equal" here.
21408 bool HTLCUpdate_eq(const struct LDKHTLCUpdate *NONNULL_PTR a, const struct LDKHTLCUpdate *NONNULL_PTR b);
21411 * Serialize the HTLCUpdate object into a byte array which can be read by HTLCUpdate_read
21413 struct LDKCVec_u8Z HTLCUpdate_write(const struct LDKHTLCUpdate *NONNULL_PTR obj);
21416 * Read a HTLCUpdate from a byte array, created by HTLCUpdate_write
21418 struct LDKCResult_HTLCUpdateDecodeErrorZ HTLCUpdate_read(struct LDKu8slice ser);
21421 * Frees any resources used by the Balance
21423 void Balance_free(struct LDKBalance this_ptr);
21426 * Creates a copy of the Balance
21428 struct LDKBalance Balance_clone(const struct LDKBalance *NONNULL_PTR orig);
21431 * Utility method to constructs a new ClaimableOnChannelClose-variant Balance
21433 struct LDKBalance Balance_claimable_on_channel_close(uint64_t claimable_amount_satoshis);
21436 * Utility method to constructs a new ClaimableAwaitingConfirmations-variant Balance
21438 struct LDKBalance Balance_claimable_awaiting_confirmations(uint64_t claimable_amount_satoshis, uint32_t confirmation_height);
21441 * Utility method to constructs a new ContentiousClaimable-variant Balance
21443 struct LDKBalance Balance_contentious_claimable(uint64_t claimable_amount_satoshis, uint32_t timeout_height);
21446 * Utility method to constructs a new MaybeTimeoutClaimableHTLC-variant Balance
21448 struct LDKBalance Balance_maybe_timeout_claimable_htlc(uint64_t claimable_amount_satoshis, uint32_t claimable_height);
21451 * Utility method to constructs a new MaybePreimageClaimableHTLC-variant Balance
21453 struct LDKBalance Balance_maybe_preimage_claimable_htlc(uint64_t claimable_amount_satoshis, uint32_t expiry_height);
21456 * Utility method to constructs a new CounterpartyRevokedOutputClaimable-variant Balance
21458 struct LDKBalance Balance_counterparty_revoked_output_claimable(uint64_t claimable_amount_satoshis);
21461 * Checks if two Balances contain equal inner contents.
21462 * This ignores pointers and is_owned flags and looks at the values in fields.
21464 bool Balance_eq(const struct LDKBalance *NONNULL_PTR a, const struct LDKBalance *NONNULL_PTR b);
21467 * Frees any resources used by the ChannelMonitor, if is_owned is set and inner is non-NULL.
21469 void ChannelMonitor_free(struct LDKChannelMonitor this_obj);
21472 * Serialize the ChannelMonitor object into a byte array which can be read by ChannelMonitor_read
21474 struct LDKCVec_u8Z ChannelMonitor_write(const struct LDKChannelMonitor *NONNULL_PTR obj);
21477 * Updates a ChannelMonitor on the basis of some new information provided by the Channel
21480 * panics if the given update is not the next update by update_id.
21482 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, struct LDKFeeEstimator fee_estimator, const struct LDKLogger *NONNULL_PTR logger);
21485 * Gets the update_id from the latest ChannelMonitorUpdate which was applied to this
21488 MUST_USE_RES uint64_t ChannelMonitor_get_latest_update_id(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
21491 * Gets the funding transaction outpoint of the channel this ChannelMonitor is monitoring for.
21493 MUST_USE_RES struct LDKC2Tuple_OutPointScriptZ ChannelMonitor_get_funding_txo(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
21496 * Gets a list of txids, with their output scripts (in the order they appear in the
21497 * transaction), which we must learn about spends of via block_connected().
21499 MUST_USE_RES struct LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ ChannelMonitor_get_outputs_to_watch(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
21502 * Loads the funding txo and outputs to watch into the given `chain::Filter` by repeatedly
21503 * calling `chain::Filter::register_output` and `chain::Filter::register_tx` until all outputs
21504 * have been registered.
21506 void ChannelMonitor_load_outputs_to_watch(const struct LDKChannelMonitor *NONNULL_PTR this_arg, const struct LDKFilter *NONNULL_PTR filter);
21509 * Get the list of HTLCs who's status has been updated on chain. This should be called by
21510 * ChannelManager via [`chain::Watch::release_pending_monitor_events`].
21512 MUST_USE_RES struct LDKCVec_MonitorEventZ ChannelMonitor_get_and_clear_pending_monitor_events(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
21515 * Gets the list of pending events which were generated by previous actions, clearing the list
21518 * This is called by the [`EventsProvider::process_pending_events`] implementation for
21519 * [`ChainMonitor`].
21521 * [`EventsProvider::process_pending_events`]: crate::util::events::EventsProvider::process_pending_events
21522 * [`ChainMonitor`]: crate::chain::chainmonitor::ChainMonitor
21524 MUST_USE_RES struct LDKCVec_EventZ ChannelMonitor_get_and_clear_pending_events(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
21527 * Gets the `node_id` of the counterparty for this channel.
21529 * Will be `None` for channels constructed on LDK versions prior to 0.0.110 and always `Some`
21532 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
21534 MUST_USE_RES struct LDKPublicKey ChannelMonitor_get_counterparty_node_id(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
21537 * Used by ChannelManager deserialization to broadcast the latest holder state if its copy of
21538 * the Channel was out-of-date.
21540 * You may also use this to broadcast the latest local commitment transaction, either because
21541 * a monitor update failed with [`ChannelMonitorUpdateStatus::PermanentFailure`] or because we've
21542 * fallen behind (i.e. we've received proof that our counterparty side knows a revocation
21543 * secret we gave them that they shouldn't know).
21545 * Broadcasting these transactions in the second case is UNSAFE, as they allow counterparty
21546 * side to punish you. Nevertheless you may want to broadcast them if counterparty doesn't
21547 * close channel with their commitment transaction after a substantial amount of time. Best
21548 * may be to contact the other node operator out-of-band to coordinate other options available
21549 * to you. In any-case, the choice is up to you.
21551 * [`ChannelMonitorUpdateStatus::PermanentFailure`]: super::ChannelMonitorUpdateStatus::PermanentFailure
21553 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);
21556 * Processes transactions in a newly connected block, which may result in any of the following:
21557 * - update the monitor's state against resolved HTLCs
21558 * - punish the counterparty in the case of seeing a revoked commitment transaction
21559 * - force close the channel and claim/timeout incoming/outgoing HTLCs if near expiration
21560 * - detect settled outputs for later spending
21561 * - schedule and bump any in-flight claims
21563 * Returns any new outputs to watch from `txdata`; after called, these are also included in
21564 * [`get_outputs_to_watch`].
21566 * [`get_outputs_to_watch`]: #method.get_outputs_to_watch
21568 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);
21571 * Determines if the disconnected block contained any transactions of interest and updates
21574 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);
21577 * Processes transactions confirmed in a block with the given header and height, returning new
21578 * outputs to watch. See [`block_connected`] for details.
21580 * Used instead of [`block_connected`] by clients that are notified of transactions rather than
21581 * blocks. See [`chain::Confirm`] for calling expectations.
21583 * [`block_connected`]: Self::block_connected
21585 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);
21588 * Processes a transaction that was reorganized out of the chain.
21590 * Used instead of [`block_disconnected`] by clients that are notified of transactions rather
21591 * than blocks. See [`chain::Confirm`] for calling expectations.
21593 * [`block_disconnected`]: Self::block_disconnected
21595 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);
21598 * Updates the monitor with the current best chain tip, returning new outputs to watch. See
21599 * [`block_connected`] for details.
21601 * Used instead of [`block_connected`] by clients that are notified of transactions rather than
21602 * blocks. See [`chain::Confirm`] for calling expectations.
21604 * [`block_connected`]: Self::block_connected
21606 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);
21609 * Returns the set of txids that should be monitored for re-organization out of the chain.
21611 MUST_USE_RES struct LDKCVec_C2Tuple_TxidBlockHashZZ ChannelMonitor_get_relevant_txids(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
21614 * Gets the latest best block which was connected either via the [`chain::Listen`] or
21615 * [`chain::Confirm`] interfaces.
21617 MUST_USE_RES struct LDKBestBlock ChannelMonitor_current_best_block(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
21620 * Gets the balances in this channel which are either claimable by us if we were to
21621 * force-close the channel now or which are claimable on-chain (possibly awaiting
21624 * Any balances in the channel which are available on-chain (excluding on-chain fees) are
21625 * included here until an [`Event::SpendableOutputs`] event has been generated for the
21626 * balance, or until our counterparty has claimed the balance and accrued several
21627 * confirmations on the claim transaction.
21629 * Note that for `ChannelMonitors` which track a channel which went on-chain with versions of
21630 * LDK prior to 0.0.111, balances may not be fully captured if our counterparty broadcasted
21633 * See [`Balance`] for additional details on the types of claimable balances which
21634 * may be returned here and their meanings.
21636 MUST_USE_RES struct LDKCVec_BalanceZ ChannelMonitor_get_claimable_balances(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
21639 * Read a C2Tuple_BlockHashChannelMonitorZ from a byte array, created by C2Tuple_BlockHashChannelMonitorZ_write
21641 struct LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ C2Tuple_BlockHashChannelMonitorZ_read(struct LDKu8slice ser, const struct LDKKeysInterface *NONNULL_PTR arg);
21644 * Frees any resources used by the OutPoint, if is_owned is set and inner is non-NULL.
21646 void OutPoint_free(struct LDKOutPoint this_obj);
21649 * The referenced transaction's txid.
21651 const uint8_t (*OutPoint_get_txid(const struct LDKOutPoint *NONNULL_PTR this_ptr))[32];
21654 * The referenced transaction's txid.
21656 void OutPoint_set_txid(struct LDKOutPoint *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
21659 * The index of the referenced output in its transaction's vout.
21661 uint16_t OutPoint_get_index(const struct LDKOutPoint *NONNULL_PTR this_ptr);
21664 * The index of the referenced output in its transaction's vout.
21666 void OutPoint_set_index(struct LDKOutPoint *NONNULL_PTR this_ptr, uint16_t val);
21669 * Constructs a new OutPoint given each field
21671 MUST_USE_RES struct LDKOutPoint OutPoint_new(struct LDKThirtyTwoBytes txid_arg, uint16_t index_arg);
21674 * Creates a copy of the OutPoint
21676 struct LDKOutPoint OutPoint_clone(const struct LDKOutPoint *NONNULL_PTR orig);
21679 * Checks if two OutPoints contain equal inner contents.
21680 * This ignores pointers and is_owned flags and looks at the values in fields.
21681 * Two objects with NULL inner values will be considered "equal" here.
21683 bool OutPoint_eq(const struct LDKOutPoint *NONNULL_PTR a, const struct LDKOutPoint *NONNULL_PTR b);
21686 * Checks if two OutPoints contain equal inner contents.
21688 uint64_t OutPoint_hash(const struct LDKOutPoint *NONNULL_PTR o);
21691 * Convert an `OutPoint` to a lightning channel id.
21693 MUST_USE_RES struct LDKThirtyTwoBytes OutPoint_to_channel_id(const struct LDKOutPoint *NONNULL_PTR this_arg);
21696 * Serialize the OutPoint object into a byte array which can be read by OutPoint_read
21698 struct LDKCVec_u8Z OutPoint_write(const struct LDKOutPoint *NONNULL_PTR obj);
21701 * Read a OutPoint from a byte array, created by OutPoint_write
21703 struct LDKCResult_OutPointDecodeErrorZ OutPoint_read(struct LDKu8slice ser);
21706 * Frees any resources used by the DelayedPaymentOutputDescriptor, if is_owned is set and inner is non-NULL.
21708 void DelayedPaymentOutputDescriptor_free(struct LDKDelayedPaymentOutputDescriptor this_obj);
21711 * The outpoint which is spendable.
21713 struct LDKOutPoint DelayedPaymentOutputDescriptor_get_outpoint(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr);
21716 * The outpoint which is spendable.
21718 void DelayedPaymentOutputDescriptor_set_outpoint(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKOutPoint val);
21721 * Per commitment point to derive the delayed payment key by key holder.
21723 struct LDKPublicKey DelayedPaymentOutputDescriptor_get_per_commitment_point(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr);
21726 * Per commitment point to derive the delayed payment key by key holder.
21728 void DelayedPaymentOutputDescriptor_set_per_commitment_point(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKPublicKey val);
21731 * The `nSequence` value which must be set in the spending input to satisfy the `OP_CSV` in
21732 * the witness_script.
21734 uint16_t DelayedPaymentOutputDescriptor_get_to_self_delay(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr);
21737 * The `nSequence` value which must be set in the spending input to satisfy the `OP_CSV` in
21738 * the witness_script.
21740 void DelayedPaymentOutputDescriptor_set_to_self_delay(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, uint16_t val);
21743 * The output which is referenced by the given outpoint.
21745 * Returns a copy of the field.
21747 struct LDKTxOut DelayedPaymentOutputDescriptor_get_output(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr);
21750 * The output which is referenced by the given outpoint.
21752 void DelayedPaymentOutputDescriptor_set_output(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKTxOut val);
21755 * The revocation point specific to the commitment transaction which was broadcast. Used to
21756 * derive the witnessScript for this output.
21758 struct LDKPublicKey DelayedPaymentOutputDescriptor_get_revocation_pubkey(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr);
21761 * The revocation point specific to the commitment transaction which was broadcast. Used to
21762 * derive the witnessScript for this output.
21764 void DelayedPaymentOutputDescriptor_set_revocation_pubkey(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKPublicKey val);
21767 * Arbitrary identification information returned by a call to [`BaseSign::channel_keys_id`].
21768 * This may be useful in re-deriving keys used in the channel to spend the output.
21770 const uint8_t (*DelayedPaymentOutputDescriptor_get_channel_keys_id(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr))[32];
21773 * Arbitrary identification information returned by a call to [`BaseSign::channel_keys_id`].
21774 * This may be useful in re-deriving keys used in the channel to spend the output.
21776 void DelayedPaymentOutputDescriptor_set_channel_keys_id(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
21779 * The value of the channel which this output originated from, possibly indirectly.
21781 uint64_t DelayedPaymentOutputDescriptor_get_channel_value_satoshis(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr);
21784 * The value of the channel which this output originated from, possibly indirectly.
21786 void DelayedPaymentOutputDescriptor_set_channel_value_satoshis(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, uint64_t val);
21789 * Constructs a new DelayedPaymentOutputDescriptor given each field
21791 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);
21794 * Creates a copy of the DelayedPaymentOutputDescriptor
21796 struct LDKDelayedPaymentOutputDescriptor DelayedPaymentOutputDescriptor_clone(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR orig);
21799 * Checks if two DelayedPaymentOutputDescriptors contain equal inner contents.
21800 * This ignores pointers and is_owned flags and looks at the values in fields.
21801 * Two objects with NULL inner values will be considered "equal" here.
21803 bool DelayedPaymentOutputDescriptor_eq(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR a, const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR b);
21806 * Serialize the DelayedPaymentOutputDescriptor object into a byte array which can be read by DelayedPaymentOutputDescriptor_read
21808 struct LDKCVec_u8Z DelayedPaymentOutputDescriptor_write(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR obj);
21811 * Read a DelayedPaymentOutputDescriptor from a byte array, created by DelayedPaymentOutputDescriptor_write
21813 struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ DelayedPaymentOutputDescriptor_read(struct LDKu8slice ser);
21816 * Frees any resources used by the StaticPaymentOutputDescriptor, if is_owned is set and inner is non-NULL.
21818 void StaticPaymentOutputDescriptor_free(struct LDKStaticPaymentOutputDescriptor this_obj);
21821 * The outpoint which is spendable.
21823 struct LDKOutPoint StaticPaymentOutputDescriptor_get_outpoint(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr);
21826 * The outpoint which is spendable.
21828 void StaticPaymentOutputDescriptor_set_outpoint(struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKOutPoint val);
21831 * The output which is referenced by the given outpoint.
21833 * Returns a copy of the field.
21835 struct LDKTxOut StaticPaymentOutputDescriptor_get_output(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr);
21838 * The output which is referenced by the given outpoint.
21840 void StaticPaymentOutputDescriptor_set_output(struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKTxOut val);
21843 * Arbitrary identification information returned by a call to [`BaseSign::channel_keys_id`].
21844 * This may be useful in re-deriving keys used in the channel to spend the output.
21846 const uint8_t (*StaticPaymentOutputDescriptor_get_channel_keys_id(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr))[32];
21849 * Arbitrary identification information returned by a call to [`BaseSign::channel_keys_id`].
21850 * This may be useful in re-deriving keys used in the channel to spend the output.
21852 void StaticPaymentOutputDescriptor_set_channel_keys_id(struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
21855 * The value of the channel which this transactions spends.
21857 uint64_t StaticPaymentOutputDescriptor_get_channel_value_satoshis(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr);
21860 * The value of the channel which this transactions spends.
21862 void StaticPaymentOutputDescriptor_set_channel_value_satoshis(struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr, uint64_t val);
21865 * Constructs a new StaticPaymentOutputDescriptor given each field
21867 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);
21870 * Creates a copy of the StaticPaymentOutputDescriptor
21872 struct LDKStaticPaymentOutputDescriptor StaticPaymentOutputDescriptor_clone(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR orig);
21875 * Checks if two StaticPaymentOutputDescriptors contain equal inner contents.
21876 * This ignores pointers and is_owned flags and looks at the values in fields.
21877 * Two objects with NULL inner values will be considered "equal" here.
21879 bool StaticPaymentOutputDescriptor_eq(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR a, const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR b);
21882 * Serialize the StaticPaymentOutputDescriptor object into a byte array which can be read by StaticPaymentOutputDescriptor_read
21884 struct LDKCVec_u8Z StaticPaymentOutputDescriptor_write(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR obj);
21887 * Read a StaticPaymentOutputDescriptor from a byte array, created by StaticPaymentOutputDescriptor_write
21889 struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ StaticPaymentOutputDescriptor_read(struct LDKu8slice ser);
21892 * Frees any resources used by the SpendableOutputDescriptor
21894 void SpendableOutputDescriptor_free(struct LDKSpendableOutputDescriptor this_ptr);
21897 * Creates a copy of the SpendableOutputDescriptor
21899 struct LDKSpendableOutputDescriptor SpendableOutputDescriptor_clone(const struct LDKSpendableOutputDescriptor *NONNULL_PTR orig);
21902 * Utility method to constructs a new StaticOutput-variant SpendableOutputDescriptor
21904 struct LDKSpendableOutputDescriptor SpendableOutputDescriptor_static_output(struct LDKOutPoint outpoint, struct LDKTxOut output);
21907 * Utility method to constructs a new DelayedPaymentOutput-variant SpendableOutputDescriptor
21909 struct LDKSpendableOutputDescriptor SpendableOutputDescriptor_delayed_payment_output(struct LDKDelayedPaymentOutputDescriptor a);
21912 * Utility method to constructs a new StaticPaymentOutput-variant SpendableOutputDescriptor
21914 struct LDKSpendableOutputDescriptor SpendableOutputDescriptor_static_payment_output(struct LDKStaticPaymentOutputDescriptor a);
21917 * Checks if two SpendableOutputDescriptors contain equal inner contents.
21918 * This ignores pointers and is_owned flags and looks at the values in fields.
21920 bool SpendableOutputDescriptor_eq(const struct LDKSpendableOutputDescriptor *NONNULL_PTR a, const struct LDKSpendableOutputDescriptor *NONNULL_PTR b);
21923 * Serialize the SpendableOutputDescriptor object into a byte array which can be read by SpendableOutputDescriptor_read
21925 struct LDKCVec_u8Z SpendableOutputDescriptor_write(const struct LDKSpendableOutputDescriptor *NONNULL_PTR obj);
21928 * Read a SpendableOutputDescriptor from a byte array, created by SpendableOutputDescriptor_write
21930 struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ SpendableOutputDescriptor_read(struct LDKu8slice ser);
21933 * Calls the free function if one is set
21935 void BaseSign_free(struct LDKBaseSign this_ptr);
21938 * Calls the free function if one is set
21940 void Sign_free(struct LDKSign this_ptr);
21943 * Creates a copy of the Recipient
21945 enum LDKRecipient Recipient_clone(const enum LDKRecipient *NONNULL_PTR orig);
21948 * Utility method to constructs a new Node-variant Recipient
21950 enum LDKRecipient Recipient_node(void);
21953 * Utility method to constructs a new PhantomNode-variant Recipient
21955 enum LDKRecipient Recipient_phantom_node(void);
21958 * Calls the free function if one is set
21960 void KeysInterface_free(struct LDKKeysInterface this_ptr);
21963 * Frees any resources used by the InMemorySigner, if is_owned is set and inner is non-NULL.
21965 void InMemorySigner_free(struct LDKInMemorySigner this_obj);
21968 * Holder secret key in the 2-of-2 multisig script of a channel. This key also backs the
21969 * holder's anchor output in a commitment transaction, if one is present.
21971 const uint8_t (*InMemorySigner_get_funding_key(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32];
21974 * Holder secret key in the 2-of-2 multisig script of a channel. This key also backs the
21975 * holder's anchor output in a commitment transaction, if one is present.
21977 void InMemorySigner_set_funding_key(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKSecretKey val);
21980 * Holder secret key for blinded revocation pubkey.
21982 const uint8_t (*InMemorySigner_get_revocation_base_key(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32];
21985 * Holder secret key for blinded revocation pubkey.
21987 void InMemorySigner_set_revocation_base_key(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKSecretKey val);
21990 * Holder secret key used for our balance in counterparty-broadcasted commitment transactions.
21992 const uint8_t (*InMemorySigner_get_payment_key(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32];
21995 * Holder secret key used for our balance in counterparty-broadcasted commitment transactions.
21997 void InMemorySigner_set_payment_key(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKSecretKey val);
22000 * Holder secret key used in an HTLC transaction.
22002 const uint8_t (*InMemorySigner_get_delayed_payment_base_key(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32];
22005 * Holder secret key used in an HTLC transaction.
22007 void InMemorySigner_set_delayed_payment_base_key(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKSecretKey val);
22010 * Holder HTLC secret key used in commitment transaction HTLC outputs.
22012 const uint8_t (*InMemorySigner_get_htlc_base_key(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32];
22015 * Holder HTLC secret key used in commitment transaction HTLC outputs.
22017 void InMemorySigner_set_htlc_base_key(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKSecretKey val);
22022 const uint8_t (*InMemorySigner_get_commitment_seed(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32];
22027 void InMemorySigner_set_commitment_seed(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
22030 * Creates a copy of the InMemorySigner
22032 struct LDKInMemorySigner InMemorySigner_clone(const struct LDKInMemorySigner *NONNULL_PTR orig);
22035 * Creates a new [`InMemorySigner`].
22037 MUST_USE_RES struct LDKInMemorySigner InMemorySigner_new(struct LDKSecretKey node_secret, 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);
22040 * Returns the counterparty's pubkeys.
22042 * Will panic if [`BaseSign::provide_channel_parameters`] has not been called before.
22044 MUST_USE_RES struct LDKChannelPublicKeys InMemorySigner_counterparty_pubkeys(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
22047 * Returns the `contest_delay` value specified by our counterparty and applied on holder-broadcastable
22048 * transactions, i.e., the amount of time that we have to wait to recover our funds if we
22049 * broadcast a transaction.
22051 * Will panic if [`BaseSign::provide_channel_parameters`] has not been called before.
22053 MUST_USE_RES uint16_t InMemorySigner_counterparty_selected_contest_delay(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
22056 * Returns the `contest_delay` value specified by us and applied on transactions broadcastable
22057 * by our counterparty, i.e., the amount of time that they have to wait to recover their funds
22058 * if they broadcast a transaction.
22060 * Will panic if [`BaseSign::provide_channel_parameters`] has not been called before.
22062 MUST_USE_RES uint16_t InMemorySigner_holder_selected_contest_delay(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
22065 * Returns whether the holder is the initiator.
22067 * Will panic if [`BaseSign::provide_channel_parameters`] has not been called before.
22069 MUST_USE_RES bool InMemorySigner_is_outbound(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
22074 * Will panic if [`BaseSign::provide_channel_parameters`] has not been called before.
22076 MUST_USE_RES struct LDKOutPoint InMemorySigner_funding_outpoint(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
22079 * Returns a [`ChannelTransactionParameters`] for this channel, to be used when verifying or
22080 * building transactions.
22082 * Will panic if [`BaseSign::provide_channel_parameters`] has not been called before.
22084 MUST_USE_RES struct LDKChannelTransactionParameters InMemorySigner_get_channel_parameters(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
22087 * Returns whether anchors should be used.
22089 * Will panic if [`BaseSign::provide_channel_parameters`] has not been called before.
22091 MUST_USE_RES bool InMemorySigner_opt_anchors(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
22094 * Sign the single input of `spend_tx` at index `input_idx`, which spends the output described
22095 * by `descriptor`, returning the witness stack for the input.
22097 * Returns an error if the input at `input_idx` does not exist, has a non-empty `script_sig`,
22098 * is not spending the outpoint described by [`descriptor.outpoint`],
22099 * or if an output descriptor `script_pubkey` does not match the one we can spend.
22101 * [`descriptor.outpoint`]: StaticPaymentOutputDescriptor::outpoint
22103 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);
22106 * Sign the single input of `spend_tx` at index `input_idx` which spends the output
22107 * described by `descriptor`, returning the witness stack for the input.
22109 * Returns an error if the input at `input_idx` does not exist, has a non-empty `script_sig`,
22110 * is not spending the outpoint described by [`descriptor.outpoint`], does not have a
22111 * sequence set to [`descriptor.to_self_delay`], or if an output descriptor
22112 * `script_pubkey` does not match the one we can spend.
22114 * [`descriptor.outpoint`]: DelayedPaymentOutputDescriptor::outpoint
22115 * [`descriptor.to_self_delay`]: DelayedPaymentOutputDescriptor::to_self_delay
22117 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);
22120 * Constructs a new BaseSign which calls the relevant methods on this_arg.
22121 * This copies the `inner` pointer in this_arg and thus the returned BaseSign must be freed before this_arg is
22123 struct LDKBaseSign InMemorySigner_as_BaseSign(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
22126 * Constructs a new Sign which calls the relevant methods on this_arg.
22127 * This copies the `inner` pointer in this_arg and thus the returned Sign must be freed before this_arg is
22129 struct LDKSign InMemorySigner_as_Sign(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
22132 * Serialize the InMemorySigner object into a byte array which can be read by InMemorySigner_read
22134 struct LDKCVec_u8Z InMemorySigner_write(const struct LDKInMemorySigner *NONNULL_PTR obj);
22137 * Read a InMemorySigner from a byte array, created by InMemorySigner_write
22139 struct LDKCResult_InMemorySignerDecodeErrorZ InMemorySigner_read(struct LDKu8slice ser, struct LDKSecretKey arg);
22142 * Frees any resources used by the KeysManager, if is_owned is set and inner is non-NULL.
22144 void KeysManager_free(struct LDKKeysManager this_obj);
22147 * Constructs a [`KeysManager`] from a 32-byte seed. If the seed is in some way biased (e.g.,
22148 * your CSRNG is busted) this may panic (but more importantly, you will possibly lose funds).
22149 * `starting_time` isn't strictly required to actually be a time, but it must absolutely,
22150 * without a doubt, be unique to this instance. ie if you start multiple times with the same
22151 * `seed`, `starting_time` must be unique to each run. Thus, the easiest way to achieve this
22152 * is to simply use the current time (with very high precision).
22154 * The `seed` MUST be backed up safely prior to use so that the keys can be re-created, however,
22155 * obviously, `starting_time` should be unique every time you reload the library - it is only
22156 * used to generate new ephemeral key data (which will be stored by the individual channel if
22159 * Note that the seed is required to recover certain on-chain funds independent of
22160 * [`ChannelMonitor`] data, though a current copy of [`ChannelMonitor`] data is also required
22161 * for any channel, and some on-chain during-closing funds.
22163 * [`ChannelMonitor`]: crate::chain::channelmonitor::ChannelMonitor
22165 MUST_USE_RES struct LDKKeysManager KeysManager_new(const uint8_t (*seed)[32], uint64_t starting_time_secs, uint32_t starting_time_nanos);
22168 * Derive an old [`Sign`] containing per-channel secrets based on a key derivation parameters.
22170 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]);
22173 * Creates a [`Transaction`] which spends the given descriptors to the given outputs, plus an
22174 * output to the given change destination (if sufficient change value remains). The
22175 * transaction will have a feerate, at least, of the given value.
22177 * Returns `Err(())` if the output value is greater than the input value minus required fee,
22178 * if a descriptor was duplicated, or if an output descriptor `script_pubkey`
22179 * does not match the one we can spend.
22181 * We do not enforce that outputs meet the dust limit or that any output scripts are standard.
22183 * May panic if the [`SpendableOutputDescriptor`]s were not generated by channels which used
22184 * this [`KeysManager`] or one of the [`InMemorySigner`] created by this [`KeysManager`].
22186 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);
22189 * Constructs a new KeysInterface which calls the relevant methods on this_arg.
22190 * This copies the `inner` pointer in this_arg and thus the returned KeysInterface must be freed before this_arg is
22192 struct LDKKeysInterface KeysManager_as_KeysInterface(const struct LDKKeysManager *NONNULL_PTR this_arg);
22195 * Frees any resources used by the PhantomKeysManager, if is_owned is set and inner is non-NULL.
22197 void PhantomKeysManager_free(struct LDKPhantomKeysManager this_obj);
22200 * Constructs a new KeysInterface which calls the relevant methods on this_arg.
22201 * This copies the `inner` pointer in this_arg and thus the returned KeysInterface must be freed before this_arg is
22203 struct LDKKeysInterface PhantomKeysManager_as_KeysInterface(const struct LDKPhantomKeysManager *NONNULL_PTR this_arg);
22206 * Constructs a [`PhantomKeysManager`] given a 32-byte seed and an additional `cross_node_seed`
22207 * that is shared across all nodes that intend to participate in [phantom node payments]
22210 * See [`KeysManager::new`] for more information on `seed`, `starting_time_secs`, and
22211 * `starting_time_nanos`.
22213 * `cross_node_seed` must be the same across all phantom payment-receiving nodes and also the
22214 * same across restarts, or else inbound payments may fail.
22216 * [phantom node payments]: PhantomKeysManager
22218 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]);
22221 * See [`KeysManager::spend_spendable_outputs`] for documentation on this method.
22223 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);
22226 * See [`KeysManager::derive_channel_keys`] for documentation on this method.
22228 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]);
22231 * Frees any resources used by the ChannelManager, if is_owned is set and inner is non-NULL.
22233 void ChannelManager_free(struct LDKChannelManager this_obj);
22236 * Frees any resources used by the ChainParameters, if is_owned is set and inner is non-NULL.
22238 void ChainParameters_free(struct LDKChainParameters this_obj);
22241 * The network for determining the `chain_hash` in Lightning messages.
22243 enum LDKNetwork ChainParameters_get_network(const struct LDKChainParameters *NONNULL_PTR this_ptr);
22246 * The network for determining the `chain_hash` in Lightning messages.
22248 void ChainParameters_set_network(struct LDKChainParameters *NONNULL_PTR this_ptr, enum LDKNetwork val);
22251 * The hash and height of the latest block successfully connected.
22253 * Used to track on-chain channel funding outputs and send payments with reliable timelocks.
22255 struct LDKBestBlock ChainParameters_get_best_block(const struct LDKChainParameters *NONNULL_PTR this_ptr);
22258 * The hash and height of the latest block successfully connected.
22260 * Used to track on-chain channel funding outputs and send payments with reliable timelocks.
22262 void ChainParameters_set_best_block(struct LDKChainParameters *NONNULL_PTR this_ptr, struct LDKBestBlock val);
22265 * Constructs a new ChainParameters given each field
22267 MUST_USE_RES struct LDKChainParameters ChainParameters_new(enum LDKNetwork network_arg, struct LDKBestBlock best_block_arg);
22270 * Creates a copy of the ChainParameters
22272 struct LDKChainParameters ChainParameters_clone(const struct LDKChainParameters *NONNULL_PTR orig);
22275 * Frees any resources used by the CounterpartyForwardingInfo, if is_owned is set and inner is non-NULL.
22277 void CounterpartyForwardingInfo_free(struct LDKCounterpartyForwardingInfo this_obj);
22280 * Base routing fee in millisatoshis.
22282 uint32_t CounterpartyForwardingInfo_get_fee_base_msat(const struct LDKCounterpartyForwardingInfo *NONNULL_PTR this_ptr);
22285 * Base routing fee in millisatoshis.
22287 void CounterpartyForwardingInfo_set_fee_base_msat(struct LDKCounterpartyForwardingInfo *NONNULL_PTR this_ptr, uint32_t val);
22290 * Amount in millionths of a satoshi the channel will charge per transferred satoshi.
22292 uint32_t CounterpartyForwardingInfo_get_fee_proportional_millionths(const struct LDKCounterpartyForwardingInfo *NONNULL_PTR this_ptr);
22295 * Amount in millionths of a satoshi the channel will charge per transferred satoshi.
22297 void CounterpartyForwardingInfo_set_fee_proportional_millionths(struct LDKCounterpartyForwardingInfo *NONNULL_PTR this_ptr, uint32_t val);
22300 * The minimum difference in cltv_expiry between an ingoing HTLC and its outgoing counterpart,
22301 * such that the outgoing HTLC is forwardable to this counterparty. See `msgs::ChannelUpdate`'s
22302 * `cltv_expiry_delta` for more details.
22304 uint16_t CounterpartyForwardingInfo_get_cltv_expiry_delta(const struct LDKCounterpartyForwardingInfo *NONNULL_PTR this_ptr);
22307 * The minimum difference in cltv_expiry between an ingoing HTLC and its outgoing counterpart,
22308 * such that the outgoing HTLC is forwardable to this counterparty. See `msgs::ChannelUpdate`'s
22309 * `cltv_expiry_delta` for more details.
22311 void CounterpartyForwardingInfo_set_cltv_expiry_delta(struct LDKCounterpartyForwardingInfo *NONNULL_PTR this_ptr, uint16_t val);
22314 * Constructs a new CounterpartyForwardingInfo given each field
22316 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);
22319 * Creates a copy of the CounterpartyForwardingInfo
22321 struct LDKCounterpartyForwardingInfo CounterpartyForwardingInfo_clone(const struct LDKCounterpartyForwardingInfo *NONNULL_PTR orig);
22324 * Frees any resources used by the ChannelCounterparty, if is_owned is set and inner is non-NULL.
22326 void ChannelCounterparty_free(struct LDKChannelCounterparty this_obj);
22329 * The node_id of our counterparty
22331 struct LDKPublicKey ChannelCounterparty_get_node_id(const struct LDKChannelCounterparty *NONNULL_PTR this_ptr);
22334 * The node_id of our counterparty
22336 void ChannelCounterparty_set_node_id(struct LDKChannelCounterparty *NONNULL_PTR this_ptr, struct LDKPublicKey val);
22339 * The Features the channel counterparty provided upon last connection.
22340 * Useful for routing as it is the most up-to-date copy of the counterparty's features and
22341 * many routing-relevant features are present in the init context.
22343 struct LDKInitFeatures ChannelCounterparty_get_features(const struct LDKChannelCounterparty *NONNULL_PTR this_ptr);
22346 * The Features the channel counterparty provided upon last connection.
22347 * Useful for routing as it is the most up-to-date copy of the counterparty's features and
22348 * many routing-relevant features are present in the init context.
22350 void ChannelCounterparty_set_features(struct LDKChannelCounterparty *NONNULL_PTR this_ptr, struct LDKInitFeatures val);
22353 * The value, in satoshis, that must always be held in the channel for our counterparty. This
22354 * value ensures that if our counterparty broadcasts a revoked state, we can punish them by
22355 * claiming at least this value on chain.
22357 * This value is not included in [`inbound_capacity_msat`] as it can never be spent.
22359 * [`inbound_capacity_msat`]: ChannelDetails::inbound_capacity_msat
22361 uint64_t ChannelCounterparty_get_unspendable_punishment_reserve(const struct LDKChannelCounterparty *NONNULL_PTR this_ptr);
22364 * The value, in satoshis, that must always be held in the channel for our counterparty. This
22365 * value ensures that if our counterparty broadcasts a revoked state, we can punish them by
22366 * claiming at least this value on chain.
22368 * This value is not included in [`inbound_capacity_msat`] as it can never be spent.
22370 * [`inbound_capacity_msat`]: ChannelDetails::inbound_capacity_msat
22372 void ChannelCounterparty_set_unspendable_punishment_reserve(struct LDKChannelCounterparty *NONNULL_PTR this_ptr, uint64_t val);
22375 * Information on the fees and requirements that the counterparty requires when forwarding
22376 * payments to us through this channel.
22378 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
22380 struct LDKCounterpartyForwardingInfo ChannelCounterparty_get_forwarding_info(const struct LDKChannelCounterparty *NONNULL_PTR this_ptr);
22383 * Information on the fees and requirements that the counterparty requires when forwarding
22384 * payments to us through this channel.
22386 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
22388 void ChannelCounterparty_set_forwarding_info(struct LDKChannelCounterparty *NONNULL_PTR this_ptr, struct LDKCounterpartyForwardingInfo val);
22391 * The smallest value HTLC (in msat) the remote peer will accept, for this channel. This field
22392 * is only `None` before we have received either the `OpenChannel` or `AcceptChannel` message
22393 * from the remote peer, or for `ChannelCounterparty` objects serialized prior to LDK 0.0.107.
22395 struct LDKCOption_u64Z ChannelCounterparty_get_outbound_htlc_minimum_msat(const struct LDKChannelCounterparty *NONNULL_PTR this_ptr);
22398 * The smallest value HTLC (in msat) the remote peer will accept, for this channel. This field
22399 * is only `None` before we have received either the `OpenChannel` or `AcceptChannel` message
22400 * from the remote peer, or for `ChannelCounterparty` objects serialized prior to LDK 0.0.107.
22402 void ChannelCounterparty_set_outbound_htlc_minimum_msat(struct LDKChannelCounterparty *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
22405 * The largest value HTLC (in msat) the remote peer currently will accept, for this channel.
22407 struct LDKCOption_u64Z ChannelCounterparty_get_outbound_htlc_maximum_msat(const struct LDKChannelCounterparty *NONNULL_PTR this_ptr);
22410 * The largest value HTLC (in msat) the remote peer currently will accept, for this channel.
22412 void ChannelCounterparty_set_outbound_htlc_maximum_msat(struct LDKChannelCounterparty *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
22415 * Constructs a new ChannelCounterparty given each field
22417 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);
22420 * Creates a copy of the ChannelCounterparty
22422 struct LDKChannelCounterparty ChannelCounterparty_clone(const struct LDKChannelCounterparty *NONNULL_PTR orig);
22425 * Frees any resources used by the ChannelDetails, if is_owned is set and inner is non-NULL.
22427 void ChannelDetails_free(struct LDKChannelDetails this_obj);
22430 * The channel's ID (prior to funding transaction generation, this is a random 32 bytes,
22431 * thereafter this is the txid of the funding transaction xor the funding transaction output).
22432 * Note that this means this value is *not* persistent - it can change once during the
22433 * lifetime of the channel.
22435 const uint8_t (*ChannelDetails_get_channel_id(const struct LDKChannelDetails *NONNULL_PTR this_ptr))[32];
22438 * The channel's ID (prior to funding transaction generation, this is a random 32 bytes,
22439 * thereafter this is the txid of the funding transaction xor the funding transaction output).
22440 * Note that this means this value is *not* persistent - it can change once during the
22441 * lifetime of the channel.
22443 void ChannelDetails_set_channel_id(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
22446 * Parameters which apply to our counterparty. See individual fields for more information.
22448 struct LDKChannelCounterparty ChannelDetails_get_counterparty(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
22451 * Parameters which apply to our counterparty. See individual fields for more information.
22453 void ChannelDetails_set_counterparty(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKChannelCounterparty val);
22456 * The Channel's funding transaction output, if we've negotiated the funding transaction with
22457 * our counterparty already.
22459 * Note that, if this has been set, `channel_id` will be equivalent to
22460 * `funding_txo.unwrap().to_channel_id()`.
22462 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
22464 struct LDKOutPoint ChannelDetails_get_funding_txo(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
22467 * The Channel's funding transaction output, if we've negotiated the funding transaction with
22468 * our counterparty already.
22470 * Note that, if this has been set, `channel_id` will be equivalent to
22471 * `funding_txo.unwrap().to_channel_id()`.
22473 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
22475 void ChannelDetails_set_funding_txo(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKOutPoint val);
22478 * The features which this channel operates with. See individual features for more info.
22480 * `None` until negotiation completes and the channel type is finalized.
22482 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
22484 struct LDKChannelTypeFeatures ChannelDetails_get_channel_type(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
22487 * The features which this channel operates with. See individual features for more info.
22489 * `None` until negotiation completes and the channel type is finalized.
22491 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
22493 void ChannelDetails_set_channel_type(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKChannelTypeFeatures val);
22496 * The position of the funding transaction in the chain. None if the funding transaction has
22497 * not yet been confirmed and the channel fully opened.
22499 * Note that if [`inbound_scid_alias`] is set, it must be used for invoices and inbound
22500 * payments instead of this. See [`get_inbound_payment_scid`].
22502 * For channels with [`confirmations_required`] set to `Some(0)`, [`outbound_scid_alias`] may
22503 * be used in place of this in outbound routes. See [`get_outbound_payment_scid`].
22505 * [`inbound_scid_alias`]: Self::inbound_scid_alias
22506 * [`outbound_scid_alias`]: Self::outbound_scid_alias
22507 * [`get_inbound_payment_scid`]: Self::get_inbound_payment_scid
22508 * [`get_outbound_payment_scid`]: Self::get_outbound_payment_scid
22509 * [`confirmations_required`]: Self::confirmations_required
22511 struct LDKCOption_u64Z ChannelDetails_get_short_channel_id(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
22514 * The position of the funding transaction in the chain. None if the funding transaction has
22515 * not yet been confirmed and the channel fully opened.
22517 * Note that if [`inbound_scid_alias`] is set, it must be used for invoices and inbound
22518 * payments instead of this. See [`get_inbound_payment_scid`].
22520 * For channels with [`confirmations_required`] set to `Some(0)`, [`outbound_scid_alias`] may
22521 * be used in place of this in outbound routes. See [`get_outbound_payment_scid`].
22523 * [`inbound_scid_alias`]: Self::inbound_scid_alias
22524 * [`outbound_scid_alias`]: Self::outbound_scid_alias
22525 * [`get_inbound_payment_scid`]: Self::get_inbound_payment_scid
22526 * [`get_outbound_payment_scid`]: Self::get_outbound_payment_scid
22527 * [`confirmations_required`]: Self::confirmations_required
22529 void ChannelDetails_set_short_channel_id(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
22532 * An optional [`short_channel_id`] alias for this channel, randomly generated by us and
22533 * usable in place of [`short_channel_id`] to reference the channel in outbound routes when
22534 * the channel has not yet been confirmed (as long as [`confirmations_required`] is
22537 * This will be `None` as long as the channel is not available for routing outbound payments.
22539 * [`short_channel_id`]: Self::short_channel_id
22540 * [`confirmations_required`]: Self::confirmations_required
22542 struct LDKCOption_u64Z ChannelDetails_get_outbound_scid_alias(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
22545 * An optional [`short_channel_id`] alias for this channel, randomly generated by us and
22546 * usable in place of [`short_channel_id`] to reference the channel in outbound routes when
22547 * the channel has not yet been confirmed (as long as [`confirmations_required`] is
22550 * This will be `None` as long as the channel is not available for routing outbound payments.
22552 * [`short_channel_id`]: Self::short_channel_id
22553 * [`confirmations_required`]: Self::confirmations_required
22555 void ChannelDetails_set_outbound_scid_alias(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
22558 * An optional [`short_channel_id`] alias for this channel, randomly generated by our
22559 * counterparty and usable in place of [`short_channel_id`] in invoice route hints. Our
22560 * counterparty will recognize the alias provided here in place of the [`short_channel_id`]
22561 * when they see a payment to be routed to us.
22563 * Our counterparty may choose to rotate this value at any time, though will always recognize
22564 * previous values for inbound payment forwarding.
22566 * [`short_channel_id`]: Self::short_channel_id
22568 struct LDKCOption_u64Z ChannelDetails_get_inbound_scid_alias(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
22571 * An optional [`short_channel_id`] alias for this channel, randomly generated by our
22572 * counterparty and usable in place of [`short_channel_id`] in invoice route hints. Our
22573 * counterparty will recognize the alias provided here in place of the [`short_channel_id`]
22574 * when they see a payment to be routed to us.
22576 * Our counterparty may choose to rotate this value at any time, though will always recognize
22577 * previous values for inbound payment forwarding.
22579 * [`short_channel_id`]: Self::short_channel_id
22581 void ChannelDetails_set_inbound_scid_alias(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
22584 * The value, in satoshis, of this channel as appears in the funding output
22586 uint64_t ChannelDetails_get_channel_value_satoshis(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
22589 * The value, in satoshis, of this channel as appears in the funding output
22591 void ChannelDetails_set_channel_value_satoshis(struct LDKChannelDetails *NONNULL_PTR this_ptr, uint64_t val);
22594 * The value, in satoshis, that must always be held in the channel for us. This value ensures
22595 * that if we broadcast a revoked state, our counterparty can punish us by claiming at least
22596 * this value on chain.
22598 * This value is not included in [`outbound_capacity_msat`] as it can never be spent.
22600 * This value will be `None` for outbound channels until the counterparty accepts the channel.
22602 * [`outbound_capacity_msat`]: ChannelDetails::outbound_capacity_msat
22604 struct LDKCOption_u64Z ChannelDetails_get_unspendable_punishment_reserve(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
22607 * The value, in satoshis, that must always be held in the channel for us. This value ensures
22608 * that if we broadcast a revoked state, our counterparty can punish us by claiming at least
22609 * this value on chain.
22611 * This value is not included in [`outbound_capacity_msat`] as it can never be spent.
22613 * This value will be `None` for outbound channels until the counterparty accepts the channel.
22615 * [`outbound_capacity_msat`]: ChannelDetails::outbound_capacity_msat
22617 void ChannelDetails_set_unspendable_punishment_reserve(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
22620 * The `user_channel_id` passed in to create_channel, or a random value if the channel was
22621 * inbound. This may be zero for inbound channels serialized with LDK versions prior to
22624 struct LDKU128 ChannelDetails_get_user_channel_id(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
22627 * The `user_channel_id` passed in to create_channel, or a random value if the channel was
22628 * inbound. This may be zero for inbound channels serialized with LDK versions prior to
22631 void ChannelDetails_set_user_channel_id(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKU128 val);
22634 * Our total balance. This is the amount we would get if we close the channel.
22635 * This value is not exact. Due to various in-flight changes and feerate changes, exactly this
22636 * amount is not likely to be recoverable on close.
22638 * This does not include any pending HTLCs which are not yet fully resolved (and, thus, whose
22639 * balance is not available for inclusion in new outbound HTLCs). This further does not include
22640 * any pending outgoing HTLCs which are awaiting some other resolution to be sent.
22641 * This does not consider any on-chain fees.
22643 * See also [`ChannelDetails::outbound_capacity_msat`]
22645 uint64_t ChannelDetails_get_balance_msat(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
22648 * Our total balance. This is the amount we would get if we close the channel.
22649 * This value is not exact. Due to various in-flight changes and feerate changes, exactly this
22650 * amount is not likely to be recoverable on close.
22652 * This does not include any pending HTLCs which are not yet fully resolved (and, thus, whose
22653 * balance is not available for inclusion in new outbound HTLCs). This further does not include
22654 * any pending outgoing HTLCs which are awaiting some other resolution to be sent.
22655 * This does not consider any on-chain fees.
22657 * See also [`ChannelDetails::outbound_capacity_msat`]
22659 void ChannelDetails_set_balance_msat(struct LDKChannelDetails *NONNULL_PTR this_ptr, uint64_t val);
22662 * The available outbound capacity for sending HTLCs to the remote peer. This does not include
22663 * any pending HTLCs which are not yet fully resolved (and, thus, whose balance is not
22664 * available for inclusion in new outbound HTLCs). This further does not include any pending
22665 * outgoing HTLCs which are awaiting some other resolution to be sent.
22667 * See also [`ChannelDetails::balance_msat`]
22669 * This value is not exact. Due to various in-flight changes, feerate changes, and our
22670 * conflict-avoidance policy, exactly this amount is not likely to be spendable. However, we
22671 * should be able to spend nearly this amount.
22673 uint64_t ChannelDetails_get_outbound_capacity_msat(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
22676 * The available outbound capacity for sending HTLCs to the remote peer. This does not include
22677 * any pending HTLCs which are not yet fully resolved (and, thus, whose balance is not
22678 * available for inclusion in new outbound HTLCs). This further does not include any pending
22679 * outgoing HTLCs which are awaiting some other resolution to be sent.
22681 * See also [`ChannelDetails::balance_msat`]
22683 * This value is not exact. Due to various in-flight changes, feerate changes, and our
22684 * conflict-avoidance policy, exactly this amount is not likely to be spendable. However, we
22685 * should be able to spend nearly this amount.
22687 void ChannelDetails_set_outbound_capacity_msat(struct LDKChannelDetails *NONNULL_PTR this_ptr, uint64_t val);
22690 * The available outbound capacity for sending a single HTLC to the remote peer. This is
22691 * similar to [`ChannelDetails::outbound_capacity_msat`] but it may be further restricted by
22692 * the current state and per-HTLC limit(s). This is intended for use when routing, allowing us
22693 * to use a limit as close as possible to the HTLC limit we can currently send.
22695 * See also [`ChannelDetails::balance_msat`] and [`ChannelDetails::outbound_capacity_msat`].
22697 uint64_t ChannelDetails_get_next_outbound_htlc_limit_msat(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
22700 * The available outbound capacity for sending a single HTLC to the remote peer. This is
22701 * similar to [`ChannelDetails::outbound_capacity_msat`] but it may be further restricted by
22702 * the current state and per-HTLC limit(s). This is intended for use when routing, allowing us
22703 * to use a limit as close as possible to the HTLC limit we can currently send.
22705 * See also [`ChannelDetails::balance_msat`] and [`ChannelDetails::outbound_capacity_msat`].
22707 void ChannelDetails_set_next_outbound_htlc_limit_msat(struct LDKChannelDetails *NONNULL_PTR this_ptr, uint64_t val);
22710 * The available inbound capacity for the remote peer to send HTLCs to us. This does not
22711 * include any pending HTLCs which are not yet fully resolved (and, thus, whose balance is not
22712 * available for inclusion in new inbound HTLCs).
22713 * Note that there are some corner cases not fully handled here, so the actual available
22714 * inbound capacity may be slightly higher than this.
22716 * This value is not exact. Due to various in-flight changes, feerate changes, and our
22717 * counterparty's conflict-avoidance policy, exactly this amount is not likely to be spendable.
22718 * However, our counterparty should be able to spend nearly this amount.
22720 uint64_t ChannelDetails_get_inbound_capacity_msat(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
22723 * The available inbound capacity for the remote peer to send HTLCs to us. This does not
22724 * include any pending HTLCs which are not yet fully resolved (and, thus, whose balance is not
22725 * available for inclusion in new inbound HTLCs).
22726 * Note that there are some corner cases not fully handled here, so the actual available
22727 * inbound capacity may be slightly higher than this.
22729 * This value is not exact. Due to various in-flight changes, feerate changes, and our
22730 * counterparty's conflict-avoidance policy, exactly this amount is not likely to be spendable.
22731 * However, our counterparty should be able to spend nearly this amount.
22733 void ChannelDetails_set_inbound_capacity_msat(struct LDKChannelDetails *NONNULL_PTR this_ptr, uint64_t val);
22736 * The number of required confirmations on the funding transaction before the funding will be
22737 * considered \"locked\". This number is selected by the channel fundee (i.e. us if
22738 * [`is_outbound`] is *not* set), and can be selected for inbound channels with
22739 * [`ChannelHandshakeConfig::minimum_depth`] or limited for outbound channels with
22740 * [`ChannelHandshakeLimits::max_minimum_depth`].
22742 * This value will be `None` for outbound channels until the counterparty accepts the channel.
22744 * [`is_outbound`]: ChannelDetails::is_outbound
22745 * [`ChannelHandshakeConfig::minimum_depth`]: crate::util::config::ChannelHandshakeConfig::minimum_depth
22746 * [`ChannelHandshakeLimits::max_minimum_depth`]: crate::util::config::ChannelHandshakeLimits::max_minimum_depth
22748 struct LDKCOption_u32Z ChannelDetails_get_confirmations_required(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
22751 * The number of required confirmations on the funding transaction before the funding will be
22752 * considered \"locked\". This number is selected by the channel fundee (i.e. us if
22753 * [`is_outbound`] is *not* set), and can be selected for inbound channels with
22754 * [`ChannelHandshakeConfig::minimum_depth`] or limited for outbound channels with
22755 * [`ChannelHandshakeLimits::max_minimum_depth`].
22757 * This value will be `None` for outbound channels until the counterparty accepts the channel.
22759 * [`is_outbound`]: ChannelDetails::is_outbound
22760 * [`ChannelHandshakeConfig::minimum_depth`]: crate::util::config::ChannelHandshakeConfig::minimum_depth
22761 * [`ChannelHandshakeLimits::max_minimum_depth`]: crate::util::config::ChannelHandshakeLimits::max_minimum_depth
22763 void ChannelDetails_set_confirmations_required(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u32Z val);
22766 * The current number of confirmations on the funding transaction.
22768 * This value will be `None` for objects serialized with LDK versions prior to 0.0.113.
22770 struct LDKCOption_u32Z ChannelDetails_get_confirmations(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
22773 * The current number of confirmations on the funding transaction.
22775 * This value will be `None` for objects serialized with LDK versions prior to 0.0.113.
22777 void ChannelDetails_set_confirmations(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u32Z val);
22780 * The number of blocks (after our commitment transaction confirms) that we will need to wait
22781 * until we can claim our funds after we force-close the channel. During this time our
22782 * counterparty is allowed to punish us if we broadcasted a stale state. If our counterparty
22783 * force-closes the channel and broadcasts a commitment transaction we do not have to wait any
22784 * time to claim our non-HTLC-encumbered funds.
22786 * This value will be `None` for outbound channels until the counterparty accepts the channel.
22788 struct LDKCOption_u16Z ChannelDetails_get_force_close_spend_delay(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
22791 * The number of blocks (after our commitment transaction confirms) that we will need to wait
22792 * until we can claim our funds after we force-close the channel. During this time our
22793 * counterparty is allowed to punish us if we broadcasted a stale state. If our counterparty
22794 * force-closes the channel and broadcasts a commitment transaction we do not have to wait any
22795 * time to claim our non-HTLC-encumbered funds.
22797 * This value will be `None` for outbound channels until the counterparty accepts the channel.
22799 void ChannelDetails_set_force_close_spend_delay(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u16Z val);
22802 * True if the channel was initiated (and thus funded) by us.
22804 bool ChannelDetails_get_is_outbound(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
22807 * True if the channel was initiated (and thus funded) by us.
22809 void ChannelDetails_set_is_outbound(struct LDKChannelDetails *NONNULL_PTR this_ptr, bool val);
22812 * True if the channel is confirmed, channel_ready messages have been exchanged, and the
22813 * channel is not currently being shut down. `channel_ready` message exchange implies the
22814 * required confirmation count has been reached (and we were connected to the peer at some
22815 * point after the funding transaction received enough confirmations). The required
22816 * confirmation count is provided in [`confirmations_required`].
22818 * [`confirmations_required`]: ChannelDetails::confirmations_required
22820 bool ChannelDetails_get_is_channel_ready(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
22823 * True if the channel is confirmed, channel_ready messages have been exchanged, and the
22824 * channel is not currently being shut down. `channel_ready` message exchange implies the
22825 * required confirmation count has been reached (and we were connected to the peer at some
22826 * point after the funding transaction received enough confirmations). The required
22827 * confirmation count is provided in [`confirmations_required`].
22829 * [`confirmations_required`]: ChannelDetails::confirmations_required
22831 void ChannelDetails_set_is_channel_ready(struct LDKChannelDetails *NONNULL_PTR this_ptr, bool val);
22834 * True if the channel is (a) confirmed and channel_ready messages have been exchanged, (b)
22835 * the peer is connected, and (c) the channel is not currently negotiating a shutdown.
22837 * This is a strict superset of `is_channel_ready`.
22839 bool ChannelDetails_get_is_usable(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
22842 * True if the channel is (a) confirmed and channel_ready messages have been exchanged, (b)
22843 * the peer is connected, and (c) the channel is not currently negotiating a shutdown.
22845 * This is a strict superset of `is_channel_ready`.
22847 void ChannelDetails_set_is_usable(struct LDKChannelDetails *NONNULL_PTR this_ptr, bool val);
22850 * True if this channel is (or will be) publicly-announced.
22852 bool ChannelDetails_get_is_public(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
22855 * True if this channel is (or will be) publicly-announced.
22857 void ChannelDetails_set_is_public(struct LDKChannelDetails *NONNULL_PTR this_ptr, bool val);
22860 * The smallest value HTLC (in msat) we will accept, for this channel. This field
22861 * is only `None` for `ChannelDetails` objects serialized prior to LDK 0.0.107
22863 struct LDKCOption_u64Z ChannelDetails_get_inbound_htlc_minimum_msat(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
22866 * The smallest value HTLC (in msat) we will accept, for this channel. This field
22867 * is only `None` for `ChannelDetails` objects serialized prior to LDK 0.0.107
22869 void ChannelDetails_set_inbound_htlc_minimum_msat(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
22872 * The largest value HTLC (in msat) we currently will accept, for this channel.
22874 struct LDKCOption_u64Z ChannelDetails_get_inbound_htlc_maximum_msat(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
22877 * The largest value HTLC (in msat) we currently will accept, for this channel.
22879 void ChannelDetails_set_inbound_htlc_maximum_msat(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
22882 * Set of configurable parameters that affect channel operation.
22884 * This field is only `None` for `ChannelDetails` objects serialized prior to LDK 0.0.109.
22886 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
22888 struct LDKChannelConfig ChannelDetails_get_config(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
22891 * Set of configurable parameters that affect channel operation.
22893 * This field is only `None` for `ChannelDetails` objects serialized prior to LDK 0.0.109.
22895 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
22897 void ChannelDetails_set_config(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKChannelConfig val);
22900 * Constructs a new ChannelDetails given each field
22902 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, uint64_t balance_msat_arg, uint64_t outbound_capacity_msat_arg, uint64_t next_outbound_htlc_limit_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, 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);
22905 * Creates a copy of the ChannelDetails
22907 struct LDKChannelDetails ChannelDetails_clone(const struct LDKChannelDetails *NONNULL_PTR orig);
22910 * Gets the current SCID which should be used to identify this channel for inbound payments.
22911 * This should be used for providing invoice hints or in any other context where our
22912 * counterparty will forward a payment to us.
22914 * This is either the [`ChannelDetails::inbound_scid_alias`], if set, or the
22915 * [`ChannelDetails::short_channel_id`]. See those for more information.
22917 MUST_USE_RES struct LDKCOption_u64Z ChannelDetails_get_inbound_payment_scid(const struct LDKChannelDetails *NONNULL_PTR this_arg);
22920 * Gets the current SCID which should be used to identify this channel for outbound payments.
22921 * This should be used in [`Route`]s to describe the first hop or in other contexts where
22922 * we're sending or forwarding a payment outbound over this channel.
22924 * This is either the [`ChannelDetails::short_channel_id`], if set, or the
22925 * [`ChannelDetails::outbound_scid_alias`]. See those for more information.
22927 MUST_USE_RES struct LDKCOption_u64Z ChannelDetails_get_outbound_payment_scid(const struct LDKChannelDetails *NONNULL_PTR this_arg);
22930 * Frees any resources used by the PaymentSendFailure
22932 void PaymentSendFailure_free(struct LDKPaymentSendFailure this_ptr);
22935 * Creates a copy of the PaymentSendFailure
22937 struct LDKPaymentSendFailure PaymentSendFailure_clone(const struct LDKPaymentSendFailure *NONNULL_PTR orig);
22940 * Utility method to constructs a new ParameterError-variant PaymentSendFailure
22942 struct LDKPaymentSendFailure PaymentSendFailure_parameter_error(struct LDKAPIError a);
22945 * Utility method to constructs a new PathParameterError-variant PaymentSendFailure
22947 struct LDKPaymentSendFailure PaymentSendFailure_path_parameter_error(struct LDKCVec_CResult_NoneAPIErrorZZ a);
22950 * Utility method to constructs a new AllFailedResendSafe-variant PaymentSendFailure
22952 struct LDKPaymentSendFailure PaymentSendFailure_all_failed_resend_safe(struct LDKCVec_APIErrorZ a);
22955 * Utility method to constructs a new DuplicatePayment-variant PaymentSendFailure
22957 struct LDKPaymentSendFailure PaymentSendFailure_duplicate_payment(void);
22960 * Utility method to constructs a new PartialFailure-variant PaymentSendFailure
22962 struct LDKPaymentSendFailure PaymentSendFailure_partial_failure(struct LDKCVec_CResult_NoneAPIErrorZZ results, struct LDKRouteParameters failed_paths_retry, struct LDKThirtyTwoBytes payment_id);
22965 * Frees any resources used by the PhantomRouteHints, if is_owned is set and inner is non-NULL.
22967 void PhantomRouteHints_free(struct LDKPhantomRouteHints this_obj);
22970 * The list of channels to be included in the invoice route hints.
22972 struct LDKCVec_ChannelDetailsZ PhantomRouteHints_get_channels(const struct LDKPhantomRouteHints *NONNULL_PTR this_ptr);
22975 * The list of channels to be included in the invoice route hints.
22977 void PhantomRouteHints_set_channels(struct LDKPhantomRouteHints *NONNULL_PTR this_ptr, struct LDKCVec_ChannelDetailsZ val);
22980 * A fake scid used for representing the phantom node's fake channel in generating the invoice
22983 uint64_t PhantomRouteHints_get_phantom_scid(const struct LDKPhantomRouteHints *NONNULL_PTR this_ptr);
22986 * A fake scid used for representing the phantom node's fake channel in generating the invoice
22989 void PhantomRouteHints_set_phantom_scid(struct LDKPhantomRouteHints *NONNULL_PTR this_ptr, uint64_t val);
22992 * The pubkey of the real backing node that would ultimately receive the payment.
22994 struct LDKPublicKey PhantomRouteHints_get_real_node_pubkey(const struct LDKPhantomRouteHints *NONNULL_PTR this_ptr);
22997 * The pubkey of the real backing node that would ultimately receive the payment.
22999 void PhantomRouteHints_set_real_node_pubkey(struct LDKPhantomRouteHints *NONNULL_PTR this_ptr, struct LDKPublicKey val);
23002 * Constructs a new PhantomRouteHints given each field
23004 MUST_USE_RES struct LDKPhantomRouteHints PhantomRouteHints_new(struct LDKCVec_ChannelDetailsZ channels_arg, uint64_t phantom_scid_arg, struct LDKPublicKey real_node_pubkey_arg);
23007 * Creates a copy of the PhantomRouteHints
23009 struct LDKPhantomRouteHints PhantomRouteHints_clone(const struct LDKPhantomRouteHints *NONNULL_PTR orig);
23012 * Constructs a new ChannelManager to hold several channels and route between them.
23014 * This is the main \"logic hub\" for all channel-related actions, and implements
23015 * ChannelMessageHandler.
23017 * Non-proportional fees are fixed according to our risk using the provided fee estimator.
23019 * Users need to notify the new ChannelManager when a new block is connected or
23020 * disconnected using its `block_connected` and `block_disconnected` methods, starting
23021 * from after `params.latest_hash`.
23023 MUST_USE_RES struct LDKChannelManager ChannelManager_new(struct LDKFeeEstimator fee_est, struct LDKWatch chain_monitor, struct LDKBroadcasterInterface tx_broadcaster, struct LDKLogger logger, struct LDKKeysInterface keys_manager, struct LDKUserConfig config, struct LDKChainParameters params);
23026 * Gets the current configuration applied to all new channels.
23028 MUST_USE_RES struct LDKUserConfig ChannelManager_get_current_default_configuration(const struct LDKChannelManager *NONNULL_PTR this_arg);
23031 * Creates a new outbound channel to the given remote node and with the given value.
23033 * `user_channel_id` will be provided back as in
23034 * [`Event::FundingGenerationReady::user_channel_id`] to allow tracking of which events
23035 * correspond with which `create_channel` call. Note that the `user_channel_id` defaults to a
23036 * randomized value for inbound channels. `user_channel_id` has no meaning inside of LDK, it
23037 * is simply copied to events and otherwise ignored.
23039 * Raises [`APIError::APIMisuseError`] when `channel_value_satoshis` > 2**24 or `push_msat` is
23040 * greater than `channel_value_satoshis * 1k` or `channel_value_satoshis < 1000`.
23042 * Note that we do not check if you are currently connected to the given peer. If no
23043 * connection is available, the outbound `open_channel` message may fail to send, resulting in
23044 * the channel eventually being silently forgotten (dropped on reload).
23046 * Returns the new Channel's temporary `channel_id`. This ID will appear as
23047 * [`Event::FundingGenerationReady::temporary_channel_id`] and in
23048 * [`ChannelDetails::channel_id`] until after
23049 * [`ChannelManager::funding_transaction_generated`] is called, swapping the Channel's ID for
23050 * one derived from the funding transaction's TXID. If the counterparty rejects the channel
23051 * immediately, this temporary ID will appear in [`Event::ChannelClosed::channel_id`].
23053 * [`Event::FundingGenerationReady::user_channel_id`]: events::Event::FundingGenerationReady::user_channel_id
23054 * [`Event::FundingGenerationReady::temporary_channel_id`]: events::Event::FundingGenerationReady::temporary_channel_id
23055 * [`Event::ChannelClosed::channel_id`]: events::Event::ChannelClosed::channel_id
23057 * Note that override_config (or a relevant inner pointer) may be NULL or all-0s to represent None
23059 MUST_USE_RES struct LDKCResult__u832APIErrorZ 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);
23062 * Gets the list of open channels, in random order. See ChannelDetail field documentation for
23063 * more information.
23065 MUST_USE_RES struct LDKCVec_ChannelDetailsZ ChannelManager_list_channels(const struct LDKChannelManager *NONNULL_PTR this_arg);
23068 * Gets the list of usable channels, in random order. Useful as an argument to [`find_route`]
23069 * to ensure non-announced channels are used.
23071 * These are guaranteed to have their [`ChannelDetails::is_usable`] value set to true, see the
23072 * documentation for [`ChannelDetails::is_usable`] for more info on exactly what the criteria
23075 * [`find_route`]: crate::routing::router::find_route
23077 MUST_USE_RES struct LDKCVec_ChannelDetailsZ ChannelManager_list_usable_channels(const struct LDKChannelManager *NONNULL_PTR this_arg);
23080 * Begins the process of closing a channel. After this call (plus some timeout), no new HTLCs
23081 * will be accepted on the given channel, and after additional timeout/the closing of all
23082 * pending HTLCs, the channel will be closed on chain.
23084 * * If we are the channel initiator, we will pay between our [`Background`] and
23085 * [`ChannelConfig::force_close_avoidance_max_fee_satoshis`] plus our [`Normal`] fee
23087 * * If our counterparty is the channel initiator, we will require a channel closing
23088 * transaction feerate of at least our [`Background`] feerate or the feerate which
23089 * would appear on a force-closure transaction, whichever is lower. We will allow our
23090 * counterparty to pay as much fee as they'd like, however.
23092 * May generate a SendShutdown message event on success, which should be relayed.
23094 * [`ChannelConfig::force_close_avoidance_max_fee_satoshis`]: crate::util::config::ChannelConfig::force_close_avoidance_max_fee_satoshis
23095 * [`Background`]: crate::chain::chaininterface::ConfirmationTarget::Background
23096 * [`Normal`]: crate::chain::chaininterface::ConfirmationTarget::Normal
23098 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);
23101 * Begins the process of closing a channel. After this call (plus some timeout), no new HTLCs
23102 * will be accepted on the given channel, and after additional timeout/the closing of all
23103 * pending HTLCs, the channel will be closed on chain.
23105 * `target_feerate_sat_per_1000_weight` has different meanings depending on if we initiated
23106 * the channel being closed or not:
23107 * * If we are the channel initiator, we will pay at least this feerate on the closing
23108 * transaction. The upper-bound is set by
23109 * [`ChannelConfig::force_close_avoidance_max_fee_satoshis`] plus our [`Normal`] fee
23110 * estimate (or `target_feerate_sat_per_1000_weight`, if it is greater).
23111 * * If our counterparty is the channel initiator, we will refuse to accept a channel closure
23112 * transaction feerate below `target_feerate_sat_per_1000_weight` (or the feerate which
23113 * will appear on a force-closure transaction, whichever is lower).
23115 * May generate a SendShutdown message event on success, which should be relayed.
23117 * [`ChannelConfig::force_close_avoidance_max_fee_satoshis`]: crate::util::config::ChannelConfig::force_close_avoidance_max_fee_satoshis
23118 * [`Background`]: crate::chain::chaininterface::ConfirmationTarget::Background
23119 * [`Normal`]: crate::chain::chaininterface::ConfirmationTarget::Normal
23121 MUST_USE_RES struct LDKCResult_NoneAPIErrorZ ChannelManager_close_channel_with_target_feerate(const struct LDKChannelManager *NONNULL_PTR this_arg, const uint8_t (*channel_id)[32], struct LDKPublicKey counterparty_node_id, uint32_t target_feerate_sats_per_1000_weight);
23124 * Force closes a channel, immediately broadcasting the latest local transaction(s) and
23125 * rejecting new HTLCs on the given channel. Fails if `channel_id` is unknown to
23126 * the manager, or if the `counterparty_node_id` isn't the counterparty of the corresponding
23129 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);
23132 * Force closes a channel, rejecting new HTLCs on the given channel but skips broadcasting
23133 * the latest local transaction(s). Fails if `channel_id` is unknown to the manager, or if the
23134 * `counterparty_node_id` isn't the counterparty of the corresponding channel.
23136 * You can always get the latest local transaction(s) to broadcast from
23137 * [`ChannelMonitor::get_latest_holder_commitment_txn`].
23139 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);
23142 * Force close all channels, immediately broadcasting the latest local commitment transaction
23143 * for each to the chain and rejecting new HTLCs on each.
23145 void ChannelManager_force_close_all_channels_broadcasting_latest_txn(const struct LDKChannelManager *NONNULL_PTR this_arg);
23148 * Force close all channels rejecting new HTLCs on each but without broadcasting the latest
23149 * local transaction(s).
23151 void ChannelManager_force_close_all_channels_without_broadcasting_txn(const struct LDKChannelManager *NONNULL_PTR this_arg);
23154 * Sends a payment along a given route.
23156 * Value parameters are provided via the last hop in route, see documentation for RouteHop
23157 * fields for more info.
23159 * If a pending payment is currently in-flight with the same [`PaymentId`] provided, this
23160 * method will error with an [`APIError::InvalidRoute`]. Note, however, that once a payment
23161 * is no longer pending (either via [`ChannelManager::abandon_payment`], or handling of an
23162 * [`Event::PaymentSent`]) LDK will not stop you from sending a second payment with the same
23165 * Thus, in order to ensure duplicate payments are not sent, you should implement your own
23166 * tracking of payments, including state to indicate once a payment has completed. Because you
23167 * should also ensure that [`PaymentHash`]es are not re-used, for simplicity, you should
23168 * consider using the [`PaymentHash`] as the key for tracking payments. In that case, the
23169 * [`PaymentId`] should be a copy of the [`PaymentHash`] bytes.
23171 * May generate SendHTLCs message(s) event on success, which should be relayed (e.g. via
23172 * [`PeerManager::process_events`]).
23174 * Each path may have a different return value, and PaymentSendValue may return a Vec with
23175 * each entry matching the corresponding-index entry in the route paths, see
23176 * PaymentSendFailure for more info.
23178 * In general, a path may raise:
23179 * * [`APIError::InvalidRoute`] when an invalid route or forwarding parameter (cltv_delta, fee,
23180 * node public key) is specified.
23181 * * [`APIError::ChannelUnavailable`] if the next-hop channel is not available for updates
23182 * (including due to previous monitor update failure or new permanent monitor update
23184 * * [`APIError::MonitorUpdateInProgress`] if a new monitor update failure prevented sending the
23185 * relevant updates.
23187 * Note that depending on the type of the PaymentSendFailure the HTLC may have been
23188 * irrevocably committed to on our end. In such a case, do NOT retry the payment with a
23189 * different route unless you intend to pay twice!
23191 * payment_secret is unrelated to payment_hash (or PaymentPreimage) and exists to authenticate
23192 * the sender to the recipient and prevent payment-probing (deanonymization) attacks. For
23193 * newer nodes, it will be provided to you in the invoice. If you do not have one, the Route
23194 * must not contain multiple paths as multi-path payments require a recipient-provided
23197 * If a payment_secret *is* provided, we assume that the invoice had the payment_secret feature
23198 * bit set (either as required or as available). If multiple paths are present in the Route,
23199 * we assume the invoice had the basic_mpp feature set.
23201 * [`Event::PaymentSent`]: events::Event::PaymentSent
23202 * [`PeerManager::process_events`]: crate::ln::peer_handler::PeerManager::process_events
23204 * Note that payment_secret (or a relevant inner pointer) may be NULL or all-0s to represent None
23206 MUST_USE_RES struct LDKCResult_NonePaymentSendFailureZ ChannelManager_send_payment(const struct LDKChannelManager *NONNULL_PTR this_arg, const struct LDKRoute *NONNULL_PTR route, struct LDKThirtyTwoBytes payment_hash, struct LDKThirtyTwoBytes payment_secret, struct LDKThirtyTwoBytes payment_id);
23209 * Retries a payment along the given [`Route`].
23211 * Errors returned are a superset of those returned from [`send_payment`], so see
23212 * [`send_payment`] documentation for more details on errors. This method will also error if the
23213 * retry amount puts the payment more than 10% over the payment's total amount, if the payment
23214 * for the given `payment_id` cannot be found (likely due to timeout or success), or if
23215 * further retries have been disabled with [`abandon_payment`].
23217 * [`send_payment`]: [`ChannelManager::send_payment`]
23218 * [`abandon_payment`]: [`ChannelManager::abandon_payment`]
23220 MUST_USE_RES struct LDKCResult_NonePaymentSendFailureZ ChannelManager_retry_payment(const struct LDKChannelManager *NONNULL_PTR this_arg, const struct LDKRoute *NONNULL_PTR route, struct LDKThirtyTwoBytes payment_id);
23223 * Signals that no further retries for the given payment will occur.
23225 * After this method returns, no future calls to [`retry_payment`] for the given `payment_id`
23226 * are allowed. If no [`Event::PaymentFailed`] event had been generated before, one will be
23227 * generated as soon as there are no remaining pending HTLCs for this payment.
23229 * Note that calling this method does *not* prevent a payment from succeeding. You must still
23230 * wait until you receive either a [`Event::PaymentFailed`] or [`Event::PaymentSent`] event to
23231 * determine the ultimate status of a payment.
23233 * If an [`Event::PaymentFailed`] event is generated and we restart without this
23234 * [`ChannelManager`] having been persisted, the payment may still be in the pending state
23235 * upon restart. This allows further calls to [`retry_payment`] (and requiring a second call
23236 * to [`abandon_payment`] to mark the payment as failed again). Otherwise, future calls to
23237 * [`retry_payment`] will fail with [`PaymentSendFailure::ParameterError`].
23239 * [`abandon_payment`]: Self::abandon_payment
23240 * [`retry_payment`]: Self::retry_payment
23241 * [`Event::PaymentFailed`]: events::Event::PaymentFailed
23242 * [`Event::PaymentSent`]: events::Event::PaymentSent
23244 void ChannelManager_abandon_payment(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKThirtyTwoBytes payment_id);
23247 * Send a spontaneous payment, which is a payment that does not require the recipient to have
23248 * generated an invoice. Optionally, you may specify the preimage. If you do choose to specify
23249 * the preimage, it must be a cryptographically secure random value that no intermediate node
23250 * would be able to guess -- otherwise, an intermediate node may claim the payment and it will
23251 * never reach the recipient.
23253 * See [`send_payment`] documentation for more details on the return value of this function
23254 * and idempotency guarantees provided by the [`PaymentId`] key.
23256 * Similar to regular payments, you MUST NOT reuse a `payment_preimage` value. See
23257 * [`send_payment`] for more information about the risks of duplicate preimage usage.
23259 * Note that `route` must have exactly one path.
23261 * [`send_payment`]: Self::send_payment
23263 * Note that payment_preimage (or a relevant inner pointer) may be NULL or all-0s to represent None
23265 MUST_USE_RES struct LDKCResult_PaymentHashPaymentSendFailureZ ChannelManager_send_spontaneous_payment(const struct LDKChannelManager *NONNULL_PTR this_arg, const struct LDKRoute *NONNULL_PTR route, struct LDKThirtyTwoBytes payment_preimage, struct LDKThirtyTwoBytes payment_id);
23268 * Send a payment that is probing the given route for liquidity. We calculate the
23269 * [`PaymentHash`] of probes based on a static secret and a random [`PaymentId`], which allows
23270 * us to easily discern them from real payments.
23272 MUST_USE_RES struct LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ ChannelManager_send_probe(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKCVec_RouteHopZ hops);
23275 * Call this upon creation of a funding transaction for the given channel.
23277 * Returns an [`APIError::APIMisuseError`] if the funding_transaction spent non-SegWit outputs
23278 * or if no output was found which matches the parameters in [`Event::FundingGenerationReady`].
23280 * Returns [`APIError::APIMisuseError`] if the funding transaction is not final for propagation
23281 * across the p2p network.
23283 * Returns [`APIError::ChannelUnavailable`] if a funding transaction has already been provided
23284 * for the channel or if the channel has been closed as indicated by [`Event::ChannelClosed`].
23286 * May panic if the output found in the funding transaction is duplicative with some other
23287 * channel (note that this should be trivially prevented by using unique funding transaction
23288 * keys per-channel).
23290 * Do NOT broadcast the funding transaction yourself. When we have safely received our
23291 * counterparty's signature the funding transaction will automatically be broadcast via the
23292 * [`BroadcasterInterface`] provided when this `ChannelManager` was constructed.
23294 * Note that this includes RBF or similar transaction replacement strategies - lightning does
23295 * not currently support replacing a funding transaction on an existing channel. Instead,
23296 * create a new channel with a conflicting funding transaction.
23298 * Note to keep the miner incentives aligned in moving the blockchain forward, we recommend
23299 * the wallet software generating the funding transaction to apply anti-fee sniping as
23300 * implemented by Bitcoin Core wallet. See <https://bitcoinops.org/en/topics/fee-sniping/>
23301 * for more details.
23303 * [`Event::FundingGenerationReady`]: crate::util::events::Event::FundingGenerationReady
23304 * [`Event::ChannelClosed`]: crate::util::events::Event::ChannelClosed
23306 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);
23309 * Atomically updates the [`ChannelConfig`] for the given channels.
23311 * Once the updates are applied, each eligible channel (advertised with a known short channel
23312 * ID and a change in [`forwarding_fee_proportional_millionths`], [`forwarding_fee_base_msat`],
23313 * or [`cltv_expiry_delta`]) has a [`BroadcastChannelUpdate`] event message generated
23314 * containing the new [`ChannelUpdate`] message which should be broadcast to the network.
23316 * Returns [`ChannelUnavailable`] when a channel is not found or an incorrect
23317 * `counterparty_node_id` is provided.
23319 * Returns [`APIMisuseError`] when a [`cltv_expiry_delta`] update is to be applied with a value
23320 * below [`MIN_CLTV_EXPIRY_DELTA`].
23322 * If an error is returned, none of the updates should be considered applied.
23324 * [`forwarding_fee_proportional_millionths`]: ChannelConfig::forwarding_fee_proportional_millionths
23325 * [`forwarding_fee_base_msat`]: ChannelConfig::forwarding_fee_base_msat
23326 * [`cltv_expiry_delta`]: ChannelConfig::cltv_expiry_delta
23327 * [`BroadcastChannelUpdate`]: events::MessageSendEvent::BroadcastChannelUpdate
23328 * [`ChannelUpdate`]: msgs::ChannelUpdate
23329 * [`ChannelUnavailable`]: APIError::ChannelUnavailable
23330 * [`APIMisuseError`]: APIError::APIMisuseError
23332 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);
23335 * Attempts to forward an intercepted HTLC over the provided channel id and with the provided
23336 * amount to forward. Should only be called in response to an [`HTLCIntercepted`] event.
23338 * Intercepted HTLCs can be useful for Lightning Service Providers (LSPs) to open a just-in-time
23339 * channel to a receiving node if the node lacks sufficient inbound liquidity.
23341 * To make use of intercepted HTLCs, set [`UserConfig::accept_intercept_htlcs`] and use
23342 * [`ChannelManager::get_intercept_scid`] to generate short channel id(s) to put in the
23343 * receiver's invoice route hints. These route hints will signal to LDK to generate an
23344 * [`HTLCIntercepted`] event when it receives the forwarded HTLC, and this method or
23345 * [`ChannelManager::fail_intercepted_htlc`] MUST be called in response to the event.
23347 * Note that LDK does not enforce fee requirements in `amt_to_forward_msat`, and will not stop
23348 * you from forwarding more than you received.
23350 * Errors if the event was not handled in time, in which case the HTLC was automatically failed
23353 * [`UserConfig::accept_intercept_htlcs`]: crate::util::config::UserConfig::accept_intercept_htlcs
23354 * [`HTLCIntercepted`]: events::Event::HTLCIntercepted
23356 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);
23359 * Fails the intercepted HTLC indicated by intercept_id. Should only be called in response to
23360 * an [`HTLCIntercepted`] event. See [`ChannelManager::forward_intercepted_htlc`].
23362 * Errors if the event was not handled in time, in which case the HTLC was automatically failed
23365 * [`HTLCIntercepted`]: events::Event::HTLCIntercepted
23367 MUST_USE_RES struct LDKCResult_NoneAPIErrorZ ChannelManager_fail_intercepted_htlc(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKThirtyTwoBytes intercept_id);
23370 * Processes HTLCs which are pending waiting on random forward delay.
23372 * Should only really ever be called in response to a PendingHTLCsForwardable event.
23373 * Will likely generate further events.
23375 void ChannelManager_process_pending_htlc_forwards(const struct LDKChannelManager *NONNULL_PTR this_arg);
23378 * Performs actions which should happen on startup and roughly once per minute thereafter.
23380 * This currently includes:
23381 * * Increasing or decreasing the on-chain feerate estimates for our outbound channels,
23382 * * Broadcasting `ChannelUpdate` messages if we've been disconnected from our peer for more
23383 * than a minute, informing the network that they should no longer attempt to route over
23385 * * Expiring a channel's previous `ChannelConfig` if necessary to only allow forwarding HTLCs
23386 * with the current `ChannelConfig`.
23388 * Note that this may cause reentrancy through `chain::Watch::update_channel` calls or feerate
23389 * estimate fetches.
23391 void ChannelManager_timer_tick_occurred(const struct LDKChannelManager *NONNULL_PTR this_arg);
23394 * Indicates that the preimage for payment_hash is unknown or the received amount is incorrect
23395 * after a PaymentClaimable event, failing the HTLC back to its origin and freeing resources
23396 * along the path (including in our own channel on which we received it).
23398 * Note that in some cases around unclean shutdown, it is possible the payment may have
23399 * already been claimed by you via [`ChannelManager::claim_funds`] prior to you seeing (a
23400 * second copy of) the [`events::Event::PaymentClaimable`] event. Alternatively, the payment
23401 * may have already been failed automatically by LDK if it was nearing its expiration time.
23403 * While LDK will never claim a payment automatically on your behalf (i.e. without you calling
23404 * [`ChannelManager::claim_funds`]), you should still monitor for
23405 * [`events::Event::PaymentClaimed`] events even for payments you intend to fail, especially on
23406 * startup during which time claims that were in-progress at shutdown may be replayed.
23408 void ChannelManager_fail_htlc_backwards(const struct LDKChannelManager *NONNULL_PTR this_arg, const uint8_t (*payment_hash)[32]);
23411 * Provides a payment preimage in response to [`Event::PaymentClaimable`], generating any
23412 * [`MessageSendEvent`]s needed to claim the payment.
23414 * Note that calling this method does *not* guarantee that the payment has been claimed. You
23415 * *must* wait for an [`Event::PaymentClaimed`] event which upon a successful claim will be
23416 * provided to your [`EventHandler`] when [`process_pending_events`] is next called.
23418 * Note that if you did not set an `amount_msat` when calling [`create_inbound_payment`] or
23419 * [`create_inbound_payment_for_hash`] you must check that the amount in the `PaymentClaimable`
23420 * event matches your expectation. If you fail to do so and call this method, you may provide
23421 * the sender \"proof-of-payment\" when they did not fulfill the full expected payment.
23423 * [`Event::PaymentClaimable`]: crate::util::events::Event::PaymentClaimable
23424 * [`Event::PaymentClaimed`]: crate::util::events::Event::PaymentClaimed
23425 * [`process_pending_events`]: EventsProvider::process_pending_events
23426 * [`create_inbound_payment`]: Self::create_inbound_payment
23427 * [`create_inbound_payment_for_hash`]: Self::create_inbound_payment_for_hash
23429 void ChannelManager_claim_funds(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKThirtyTwoBytes payment_preimage);
23432 * Gets the node_id held by this ChannelManager
23434 MUST_USE_RES struct LDKPublicKey ChannelManager_get_our_node_id(const struct LDKChannelManager *NONNULL_PTR this_arg);
23437 * Accepts a request to open a channel after a [`Event::OpenChannelRequest`].
23439 * The `temporary_channel_id` parameter indicates which inbound channel should be accepted,
23440 * and the `counterparty_node_id` parameter is the id of the peer which has requested to open
23443 * The `user_channel_id` parameter will be provided back in
23444 * [`Event::ChannelClosed::user_channel_id`] to allow tracking of which events correspond
23445 * with which `accept_inbound_channel`/`accept_inbound_channel_from_trusted_peer_0conf` call.
23447 * Note that this method will return an error and reject the channel, if it requires support
23448 * for zero confirmations. Instead, `accept_inbound_channel_from_trusted_peer_0conf` must be
23449 * used to accept such channels.
23451 * [`Event::OpenChannelRequest`]: events::Event::OpenChannelRequest
23452 * [`Event::ChannelClosed::user_channel_id`]: events::Event::ChannelClosed::user_channel_id
23454 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);
23457 * Accepts a request to open a channel after a [`events::Event::OpenChannelRequest`], treating
23458 * it as confirmed immediately.
23460 * The `user_channel_id` parameter will be provided back in
23461 * [`Event::ChannelClosed::user_channel_id`] to allow tracking of which events correspond
23462 * with which `accept_inbound_channel`/`accept_inbound_channel_from_trusted_peer_0conf` call.
23464 * Unlike [`ChannelManager::accept_inbound_channel`], this method accepts the incoming channel
23465 * and (if the counterparty agrees), enables forwarding of payments immediately.
23467 * This fully trusts that the counterparty has honestly and correctly constructed the funding
23468 * transaction and blindly assumes that it will eventually confirm.
23470 * If it does not confirm before we decide to close the channel, or if the funding transaction
23471 * does not pay to the correct script the correct amount, *you will lose funds*.
23473 * [`Event::OpenChannelRequest`]: events::Event::OpenChannelRequest
23474 * [`Event::ChannelClosed::user_channel_id`]: events::Event::ChannelClosed::user_channel_id
23476 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);
23479 * Gets a payment secret and payment hash for use in an invoice given to a third party wishing
23482 * This differs from [`create_inbound_payment_for_hash`] only in that it generates the
23483 * [`PaymentHash`] and [`PaymentPreimage`] for you.
23485 * The [`PaymentPreimage`] will ultimately be returned to you in the [`PaymentClaimable`], which
23486 * will have the [`PaymentClaimable::payment_preimage`] field filled in. That should then be
23487 * passed directly to [`claim_funds`].
23489 * See [`create_inbound_payment_for_hash`] for detailed documentation on behavior and requirements.
23491 * Note that a malicious eavesdropper can intuit whether an inbound payment was created by
23492 * `create_inbound_payment` or `create_inbound_payment_for_hash` based on runtime.
23496 * If you register an inbound payment with this method, then serialize the `ChannelManager`, then
23497 * deserialize it with a node running 0.0.103 and earlier, the payment will fail to be received.
23499 * Errors if `min_value_msat` is greater than total bitcoin supply.
23501 * [`claim_funds`]: Self::claim_funds
23502 * [`PaymentClaimable`]: events::Event::PaymentClaimable
23503 * [`PaymentClaimable::payment_preimage`]: events::Event::PaymentClaimable::payment_preimage
23504 * [`create_inbound_payment_for_hash`]: Self::create_inbound_payment_for_hash
23506 MUST_USE_RES struct LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ ChannelManager_create_inbound_payment(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKCOption_u64Z min_value_msat, uint32_t invoice_expiry_delta_secs);
23509 * Legacy version of [`create_inbound_payment`]. Use this method if you wish to share
23510 * serialized state with LDK node(s) running 0.0.103 and earlier.
23512 * May panic if `invoice_expiry_delta_secs` is greater than one year.
23515 * This method is deprecated and will be removed soon.
23517 * [`create_inbound_payment`]: Self::create_inbound_payment
23519 MUST_USE_RES struct LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ ChannelManager_create_inbound_payment_legacy(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKCOption_u64Z min_value_msat, uint32_t invoice_expiry_delta_secs);
23522 * Gets a [`PaymentSecret`] for a given [`PaymentHash`], for which the payment preimage is
23523 * stored external to LDK.
23525 * A [`PaymentClaimable`] event will only be generated if the [`PaymentSecret`] matches a
23526 * payment secret fetched via this method or [`create_inbound_payment`], and which is at least
23527 * the `min_value_msat` provided here, if one is provided.
23529 * The [`PaymentHash`] (and corresponding [`PaymentPreimage`]) should be globally unique, though
23530 * note that LDK will not stop you from registering duplicate payment hashes for inbound
23533 * `min_value_msat` should be set if the invoice being generated contains a value. Any payment
23534 * received for the returned [`PaymentHash`] will be required to be at least `min_value_msat`
23535 * before a [`PaymentClaimable`] event will be generated, ensuring that we do not provide the
23536 * sender \"proof-of-payment\" unless they have paid the required amount.
23538 * `invoice_expiry_delta_secs` describes the number of seconds that the invoice is valid for
23539 * in excess of the current time. This should roughly match the expiry time set in the invoice.
23540 * After this many seconds, we will remove the inbound payment, resulting in any attempts to
23541 * pay the invoice failing. The BOLT spec suggests 3,600 secs as a default validity time for
23542 * invoices when no timeout is set.
23544 * Note that we use block header time to time-out pending inbound payments (with some margin
23545 * to compensate for the inaccuracy of block header timestamps). Thus, in practice we will
23546 * accept a payment and generate a [`PaymentClaimable`] event for some time after the expiry.
23547 * If you need exact expiry semantics, you should enforce them upon receipt of
23548 * [`PaymentClaimable`].
23550 * Note that invoices generated for inbound payments should have their `min_final_cltv_expiry`
23551 * set to at least [`MIN_FINAL_CLTV_EXPIRY`].
23553 * Note that a malicious eavesdropper can intuit whether an inbound payment was created by
23554 * `create_inbound_payment` or `create_inbound_payment_for_hash` based on runtime.
23558 * If you register an inbound payment with this method, then serialize the `ChannelManager`, then
23559 * deserialize it with a node running 0.0.103 and earlier, the payment will fail to be received.
23561 * Errors if `min_value_msat` is greater than total bitcoin supply.
23563 * [`create_inbound_payment`]: Self::create_inbound_payment
23564 * [`PaymentClaimable`]: events::Event::PaymentClaimable
23566 MUST_USE_RES struct LDKCResult_PaymentSecretNoneZ 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);
23569 * Legacy version of [`create_inbound_payment_for_hash`]. Use this method if you wish to share
23570 * serialized state with LDK node(s) running 0.0.103 and earlier.
23572 * May panic if `invoice_expiry_delta_secs` is greater than one year.
23575 * This method is deprecated and will be removed soon.
23577 * [`create_inbound_payment_for_hash`]: Self::create_inbound_payment_for_hash
23579 MUST_USE_RES struct LDKCResult_PaymentSecretAPIErrorZ ChannelManager_create_inbound_payment_for_hash_legacy(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKThirtyTwoBytes payment_hash, struct LDKCOption_u64Z min_value_msat, uint32_t invoice_expiry_delta_secs);
23582 * Gets an LDK-generated payment preimage from a payment hash and payment secret that were
23583 * previously returned from [`create_inbound_payment`].
23585 * [`create_inbound_payment`]: Self::create_inbound_payment
23587 MUST_USE_RES struct LDKCResult_PaymentPreimageAPIErrorZ ChannelManager_get_payment_preimage(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKThirtyTwoBytes payment_hash, struct LDKThirtyTwoBytes payment_secret);
23590 * Gets a fake short channel id for use in receiving [phantom node payments]. These fake scids
23591 * are used when constructing the phantom invoice's route hints.
23593 * [phantom node payments]: crate::chain::keysinterface::PhantomKeysManager
23595 MUST_USE_RES uint64_t ChannelManager_get_phantom_scid(const struct LDKChannelManager *NONNULL_PTR this_arg);
23598 * Gets route hints for use in receiving [phantom node payments].
23600 * [phantom node payments]: crate::chain::keysinterface::PhantomKeysManager
23602 MUST_USE_RES struct LDKPhantomRouteHints ChannelManager_get_phantom_route_hints(const struct LDKChannelManager *NONNULL_PTR this_arg);
23605 * Gets a fake short channel id for use in receiving intercepted payments. These fake scids are
23606 * used when constructing the route hints for HTLCs intended to be intercepted. See
23607 * [`ChannelManager::forward_intercepted_htlc`].
23609 * Note that this method is not guaranteed to return unique values, you may need to call it a few
23610 * times to get a unique scid.
23612 MUST_USE_RES uint64_t ChannelManager_get_intercept_scid(const struct LDKChannelManager *NONNULL_PTR this_arg);
23615 * Gets inflight HTLC information by processing pending outbound payments that are in
23616 * our channels. May be used during pathfinding to account for in-use channel liquidity.
23618 MUST_USE_RES struct LDKInFlightHtlcs ChannelManager_compute_inflight_htlcs(const struct LDKChannelManager *NONNULL_PTR this_arg);
23621 * Constructs a new MessageSendEventsProvider which calls the relevant methods on this_arg.
23622 * This copies the `inner` pointer in this_arg and thus the returned MessageSendEventsProvider must be freed before this_arg is
23624 struct LDKMessageSendEventsProvider ChannelManager_as_MessageSendEventsProvider(const struct LDKChannelManager *NONNULL_PTR this_arg);
23627 * Constructs a new EventsProvider which calls the relevant methods on this_arg.
23628 * This copies the `inner` pointer in this_arg and thus the returned EventsProvider must be freed before this_arg is
23630 struct LDKEventsProvider ChannelManager_as_EventsProvider(const struct LDKChannelManager *NONNULL_PTR this_arg);
23633 * Constructs a new Listen which calls the relevant methods on this_arg.
23634 * This copies the `inner` pointer in this_arg and thus the returned Listen must be freed before this_arg is
23636 struct LDKListen ChannelManager_as_Listen(const struct LDKChannelManager *NONNULL_PTR this_arg);
23639 * Constructs a new Confirm which calls the relevant methods on this_arg.
23640 * This copies the `inner` pointer in this_arg and thus the returned Confirm must be freed before this_arg is
23642 struct LDKConfirm ChannelManager_as_Confirm(const struct LDKChannelManager *NONNULL_PTR this_arg);
23645 * Blocks until ChannelManager needs to be persisted or a timeout is reached. It returns a bool
23646 * indicating whether persistence is necessary. Only one listener on
23647 * [`await_persistable_update`], [`await_persistable_update_timeout`], or a future returned by
23648 * [`get_persistable_update_future`] is guaranteed to be woken up.
23650 * Note that this method is not available with the `no-std` feature.
23652 * [`await_persistable_update`]: Self::await_persistable_update
23653 * [`await_persistable_update_timeout`]: Self::await_persistable_update_timeout
23654 * [`get_persistable_update_future`]: Self::get_persistable_update_future
23656 MUST_USE_RES bool ChannelManager_await_persistable_update_timeout(const struct LDKChannelManager *NONNULL_PTR this_arg, uint64_t max_wait);
23659 * Blocks until ChannelManager needs to be persisted. Only one listener on
23660 * [`await_persistable_update`], `await_persistable_update_timeout`, or a future returned by
23661 * [`get_persistable_update_future`] is guaranteed to be woken up.
23663 * [`await_persistable_update`]: Self::await_persistable_update
23664 * [`get_persistable_update_future`]: Self::get_persistable_update_future
23666 void ChannelManager_await_persistable_update(const struct LDKChannelManager *NONNULL_PTR this_arg);
23669 * Gets a [`Future`] that completes when a persistable update is available. Note that
23670 * callbacks registered on the [`Future`] MUST NOT call back into this [`ChannelManager`] and
23671 * should instead register actions to be taken later.
23673 MUST_USE_RES struct LDKFuture ChannelManager_get_persistable_update_future(const struct LDKChannelManager *NONNULL_PTR this_arg);
23676 * Gets the latest best block which was connected either via the [`chain::Listen`] or
23677 * [`chain::Confirm`] interfaces.
23679 MUST_USE_RES struct LDKBestBlock ChannelManager_current_best_block(const struct LDKChannelManager *NONNULL_PTR this_arg);
23682 * Constructs a new ChannelMessageHandler which calls the relevant methods on this_arg.
23683 * This copies the `inner` pointer in this_arg and thus the returned ChannelMessageHandler must be freed before this_arg is
23685 struct LDKChannelMessageHandler ChannelManager_as_ChannelMessageHandler(const struct LDKChannelManager *NONNULL_PTR this_arg);
23688 * Fetches the set of [`NodeFeatures`] flags which are provided by or required by
23689 * [`ChannelManager`].
23691 struct LDKNodeFeatures provided_node_features(void);
23694 * Fetches the set of [`ChannelFeatures`] flags which are provided by or required by
23695 * [`ChannelManager`].
23697 struct LDKChannelFeatures provided_channel_features(void);
23700 * Fetches the set of [`InitFeatures`] flags which are provided by or required by
23701 * [`ChannelManager`].
23703 struct LDKInitFeatures provided_init_features(void);
23706 * Serialize the CounterpartyForwardingInfo object into a byte array which can be read by CounterpartyForwardingInfo_read
23708 struct LDKCVec_u8Z CounterpartyForwardingInfo_write(const struct LDKCounterpartyForwardingInfo *NONNULL_PTR obj);
23711 * Read a CounterpartyForwardingInfo from a byte array, created by CounterpartyForwardingInfo_write
23713 struct LDKCResult_CounterpartyForwardingInfoDecodeErrorZ CounterpartyForwardingInfo_read(struct LDKu8slice ser);
23716 * Serialize the ChannelCounterparty object into a byte array which can be read by ChannelCounterparty_read
23718 struct LDKCVec_u8Z ChannelCounterparty_write(const struct LDKChannelCounterparty *NONNULL_PTR obj);
23721 * Read a ChannelCounterparty from a byte array, created by ChannelCounterparty_write
23723 struct LDKCResult_ChannelCounterpartyDecodeErrorZ ChannelCounterparty_read(struct LDKu8slice ser);
23726 * Serialize the ChannelDetails object into a byte array which can be read by ChannelDetails_read
23728 struct LDKCVec_u8Z ChannelDetails_write(const struct LDKChannelDetails *NONNULL_PTR obj);
23731 * Read a ChannelDetails from a byte array, created by ChannelDetails_write
23733 struct LDKCResult_ChannelDetailsDecodeErrorZ ChannelDetails_read(struct LDKu8slice ser);
23736 * Serialize the PhantomRouteHints object into a byte array which can be read by PhantomRouteHints_read
23738 struct LDKCVec_u8Z PhantomRouteHints_write(const struct LDKPhantomRouteHints *NONNULL_PTR obj);
23741 * Read a PhantomRouteHints from a byte array, created by PhantomRouteHints_write
23743 struct LDKCResult_PhantomRouteHintsDecodeErrorZ PhantomRouteHints_read(struct LDKu8slice ser);
23746 * Serialize the ChannelManager object into a byte array which can be read by ChannelManager_read
23748 struct LDKCVec_u8Z ChannelManager_write(const struct LDKChannelManager *NONNULL_PTR obj);
23751 * Frees any resources used by the ChannelManagerReadArgs, if is_owned is set and inner is non-NULL.
23753 void ChannelManagerReadArgs_free(struct LDKChannelManagerReadArgs this_obj);
23756 * The keys provider which will give us relevant keys. Some keys will be loaded during
23757 * deserialization and KeysInterface::read_chan_signer will be used to read per-Channel
23760 const struct LDKKeysInterface *ChannelManagerReadArgs_get_keys_manager(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
23763 * The keys provider which will give us relevant keys. Some keys will be loaded during
23764 * deserialization and KeysInterface::read_chan_signer will be used to read per-Channel
23767 void ChannelManagerReadArgs_set_keys_manager(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKKeysInterface val);
23770 * The fee_estimator for use in the ChannelManager in the future.
23772 * No calls to the FeeEstimator will be made during deserialization.
23774 const struct LDKFeeEstimator *ChannelManagerReadArgs_get_fee_estimator(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
23777 * The fee_estimator for use in the ChannelManager in the future.
23779 * No calls to the FeeEstimator will be made during deserialization.
23781 void ChannelManagerReadArgs_set_fee_estimator(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKFeeEstimator val);
23784 * The chain::Watch for use in the ChannelManager in the future.
23786 * No calls to the chain::Watch will be made during deserialization. It is assumed that
23787 * you have deserialized ChannelMonitors separately and will add them to your
23788 * chain::Watch after deserializing this ChannelManager.
23790 const struct LDKWatch *ChannelManagerReadArgs_get_chain_monitor(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
23793 * The chain::Watch for use in the ChannelManager in the future.
23795 * No calls to the chain::Watch will be made during deserialization. It is assumed that
23796 * you have deserialized ChannelMonitors separately and will add them to your
23797 * chain::Watch after deserializing this ChannelManager.
23799 void ChannelManagerReadArgs_set_chain_monitor(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKWatch val);
23802 * The BroadcasterInterface which will be used in the ChannelManager in the future and may be
23803 * used to broadcast the latest local commitment transactions of channels which must be
23804 * force-closed during deserialization.
23806 const struct LDKBroadcasterInterface *ChannelManagerReadArgs_get_tx_broadcaster(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
23809 * The BroadcasterInterface which will be used in the ChannelManager in the future and may be
23810 * used to broadcast the latest local commitment transactions of channels which must be
23811 * force-closed during deserialization.
23813 void ChannelManagerReadArgs_set_tx_broadcaster(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKBroadcasterInterface val);
23816 * The Logger for use in the ChannelManager and which may be used to log information during
23819 const struct LDKLogger *ChannelManagerReadArgs_get_logger(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
23822 * The Logger for use in the ChannelManager and which may be used to log information during
23825 void ChannelManagerReadArgs_set_logger(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKLogger val);
23828 * Default settings used for new channels. Any existing channels will continue to use the
23829 * runtime settings which were stored when the ChannelManager was serialized.
23831 struct LDKUserConfig ChannelManagerReadArgs_get_default_config(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
23834 * Default settings used for new channels. Any existing channels will continue to use the
23835 * runtime settings which were stored when the ChannelManager was serialized.
23837 void ChannelManagerReadArgs_set_default_config(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKUserConfig val);
23840 * Simple utility function to create a ChannelManagerReadArgs which creates the monitor
23841 * HashMap for you. This is primarily useful for C bindings where it is not practical to
23842 * populate a HashMap directly from C.
23844 MUST_USE_RES struct LDKChannelManagerReadArgs ChannelManagerReadArgs_new(struct LDKKeysInterface keys_manager, struct LDKFeeEstimator fee_estimator, struct LDKWatch chain_monitor, struct LDKBroadcasterInterface tx_broadcaster, struct LDKLogger logger, struct LDKUserConfig default_config, struct LDKCVec_ChannelMonitorZ channel_monitors);
23847 * Read a C2Tuple_BlockHashChannelManagerZ from a byte array, created by C2Tuple_BlockHashChannelManagerZ_write
23849 struct LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ C2Tuple_BlockHashChannelManagerZ_read(struct LDKu8slice ser, struct LDKChannelManagerReadArgs arg);
23852 * Frees any resources used by the ExpandedKey, if is_owned is set and inner is non-NULL.
23854 void ExpandedKey_free(struct LDKExpandedKey this_obj);
23857 * Create a new [`ExpandedKey`] for generating an inbound payment hash and secret.
23859 * It is recommended to cache this value and not regenerate it for each new inbound payment.
23861 MUST_USE_RES struct LDKExpandedKey ExpandedKey_new(const uint8_t (*key_material)[32]);
23864 * Equivalent to [`crate::ln::channelmanager::ChannelManager::create_inbound_payment`], but no
23865 * `ChannelManager` is required. Useful for generating invoices for [phantom node payments] without
23866 * a `ChannelManager`.
23868 * `keys` is generated by calling [`KeysInterface::get_inbound_payment_key_material`] and then
23869 * calling [`ExpandedKey::new`] with its result. It is recommended to cache this value and not
23870 * regenerate it for each new inbound payment.
23872 * `current_time` is a Unix timestamp representing the current time.
23874 * [phantom node payments]: crate::chain::keysinterface::PhantomKeysManager
23876 struct LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ create(const struct LDKExpandedKey *NONNULL_PTR keys, struct LDKCOption_u64Z min_value_msat, uint32_t invoice_expiry_delta_secs, const struct LDKKeysInterface *NONNULL_PTR keys_manager, uint64_t current_time);
23879 * Equivalent to [`crate::ln::channelmanager::ChannelManager::create_inbound_payment_for_hash`],
23880 * but no `ChannelManager` is required. Useful for generating invoices for [phantom node payments]
23881 * without a `ChannelManager`.
23883 * See [`create`] for information on the `keys` and `current_time` parameters.
23885 * [phantom node payments]: crate::chain::keysinterface::PhantomKeysManager
23887 struct LDKCResult_PaymentSecretNoneZ 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);
23890 * Frees any resources used by the DecodeError
23892 void DecodeError_free(struct LDKDecodeError this_ptr);
23895 * Creates a copy of the DecodeError
23897 struct LDKDecodeError DecodeError_clone(const struct LDKDecodeError *NONNULL_PTR orig);
23900 * Utility method to constructs a new UnknownVersion-variant DecodeError
23902 struct LDKDecodeError DecodeError_unknown_version(void);
23905 * Utility method to constructs a new UnknownRequiredFeature-variant DecodeError
23907 struct LDKDecodeError DecodeError_unknown_required_feature(void);
23910 * Utility method to constructs a new InvalidValue-variant DecodeError
23912 struct LDKDecodeError DecodeError_invalid_value(void);
23915 * Utility method to constructs a new ShortRead-variant DecodeError
23917 struct LDKDecodeError DecodeError_short_read(void);
23920 * Utility method to constructs a new BadLengthDescriptor-variant DecodeError
23922 struct LDKDecodeError DecodeError_bad_length_descriptor(void);
23925 * Utility method to constructs a new Io-variant DecodeError
23927 struct LDKDecodeError DecodeError_io(enum LDKIOError a);
23930 * Utility method to constructs a new UnsupportedCompression-variant DecodeError
23932 struct LDKDecodeError DecodeError_unsupported_compression(void);
23935 * Checks if two DecodeErrors contain equal inner contents.
23936 * This ignores pointers and is_owned flags and looks at the values in fields.
23938 bool DecodeError_eq(const struct LDKDecodeError *NONNULL_PTR a, const struct LDKDecodeError *NONNULL_PTR b);
23941 * Frees any resources used by the Init, if is_owned is set and inner is non-NULL.
23943 void Init_free(struct LDKInit this_obj);
23946 * The relevant features which the sender supports
23948 struct LDKInitFeatures Init_get_features(const struct LDKInit *NONNULL_PTR this_ptr);
23951 * The relevant features which the sender supports
23953 void Init_set_features(struct LDKInit *NONNULL_PTR this_ptr, struct LDKInitFeatures val);
23956 * The receipient's network address. This adds the option to report a remote IP address
23957 * back to a connecting peer using the init message. A node can decide to use that information
23958 * to discover a potential update to its public IPv4 address (NAT) and use
23959 * that for a node_announcement update message containing the new address.
23961 struct LDKCOption_NetAddressZ Init_get_remote_network_address(const struct LDKInit *NONNULL_PTR this_ptr);
23964 * The receipient's network address. This adds the option to report a remote IP address
23965 * back to a connecting peer using the init message. A node can decide to use that information
23966 * to discover a potential update to its public IPv4 address (NAT) and use
23967 * that for a node_announcement update message containing the new address.
23969 void Init_set_remote_network_address(struct LDKInit *NONNULL_PTR this_ptr, struct LDKCOption_NetAddressZ val);
23972 * Constructs a new Init given each field
23974 MUST_USE_RES struct LDKInit Init_new(struct LDKInitFeatures features_arg, struct LDKCOption_NetAddressZ remote_network_address_arg);
23977 * Creates a copy of the Init
23979 struct LDKInit Init_clone(const struct LDKInit *NONNULL_PTR orig);
23982 * Checks if two Inits contain equal inner contents.
23983 * This ignores pointers and is_owned flags and looks at the values in fields.
23984 * Two objects with NULL inner values will be considered "equal" here.
23986 bool Init_eq(const struct LDKInit *NONNULL_PTR a, const struct LDKInit *NONNULL_PTR b);
23989 * Frees any resources used by the ErrorMessage, if is_owned is set and inner is non-NULL.
23991 void ErrorMessage_free(struct LDKErrorMessage this_obj);
23994 * The channel ID involved in the error.
23996 * All-0s indicates a general error unrelated to a specific channel, after which all channels
23997 * with the sending peer should be closed.
23999 const uint8_t (*ErrorMessage_get_channel_id(const struct LDKErrorMessage *NONNULL_PTR this_ptr))[32];
24002 * The channel ID involved in the error.
24004 * All-0s indicates a general error unrelated to a specific channel, after which all channels
24005 * with the sending peer should be closed.
24007 void ErrorMessage_set_channel_id(struct LDKErrorMessage *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
24010 * A possibly human-readable error description.
24011 * The string should be sanitized before it is used (e.g. emitted to logs or printed to
24012 * stdout). Otherwise, a well crafted error message may trigger a security vulnerability in
24013 * the terminal emulator or the logging subsystem.
24015 struct LDKStr ErrorMessage_get_data(const struct LDKErrorMessage *NONNULL_PTR this_ptr);
24018 * A possibly human-readable error description.
24019 * The string should be sanitized before it is used (e.g. emitted to logs or printed to
24020 * stdout). Otherwise, a well crafted error message may trigger a security vulnerability in
24021 * the terminal emulator or the logging subsystem.
24023 void ErrorMessage_set_data(struct LDKErrorMessage *NONNULL_PTR this_ptr, struct LDKStr val);
24026 * Constructs a new ErrorMessage given each field
24028 MUST_USE_RES struct LDKErrorMessage ErrorMessage_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKStr data_arg);
24031 * Creates a copy of the ErrorMessage
24033 struct LDKErrorMessage ErrorMessage_clone(const struct LDKErrorMessage *NONNULL_PTR orig);
24036 * Checks if two ErrorMessages contain equal inner contents.
24037 * This ignores pointers and is_owned flags and looks at the values in fields.
24038 * Two objects with NULL inner values will be considered "equal" here.
24040 bool ErrorMessage_eq(const struct LDKErrorMessage *NONNULL_PTR a, const struct LDKErrorMessage *NONNULL_PTR b);
24043 * Frees any resources used by the WarningMessage, if is_owned is set and inner is non-NULL.
24045 void WarningMessage_free(struct LDKWarningMessage this_obj);
24048 * The channel ID involved in the warning.
24050 * All-0s indicates a warning unrelated to a specific channel.
24052 const uint8_t (*WarningMessage_get_channel_id(const struct LDKWarningMessage *NONNULL_PTR this_ptr))[32];
24055 * The channel ID involved in the warning.
24057 * All-0s indicates a warning unrelated to a specific channel.
24059 void WarningMessage_set_channel_id(struct LDKWarningMessage *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
24062 * A possibly human-readable warning description.
24063 * The string should be sanitized before it is used (e.g. emitted to logs or printed to
24064 * stdout). Otherwise, a well crafted error message may trigger a security vulnerability in
24065 * the terminal emulator or the logging subsystem.
24067 struct LDKStr WarningMessage_get_data(const struct LDKWarningMessage *NONNULL_PTR this_ptr);
24070 * A possibly human-readable warning description.
24071 * The string should be sanitized before it is used (e.g. emitted to logs or printed to
24072 * stdout). Otherwise, a well crafted error message may trigger a security vulnerability in
24073 * the terminal emulator or the logging subsystem.
24075 void WarningMessage_set_data(struct LDKWarningMessage *NONNULL_PTR this_ptr, struct LDKStr val);
24078 * Constructs a new WarningMessage given each field
24080 MUST_USE_RES struct LDKWarningMessage WarningMessage_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKStr data_arg);
24083 * Creates a copy of the WarningMessage
24085 struct LDKWarningMessage WarningMessage_clone(const struct LDKWarningMessage *NONNULL_PTR orig);
24088 * Checks if two WarningMessages contain equal inner contents.
24089 * This ignores pointers and is_owned flags and looks at the values in fields.
24090 * Two objects with NULL inner values will be considered "equal" here.
24092 bool WarningMessage_eq(const struct LDKWarningMessage *NONNULL_PTR a, const struct LDKWarningMessage *NONNULL_PTR b);
24095 * Frees any resources used by the Ping, if is_owned is set and inner is non-NULL.
24097 void Ping_free(struct LDKPing this_obj);
24100 * The desired response length
24102 uint16_t Ping_get_ponglen(const struct LDKPing *NONNULL_PTR this_ptr);
24105 * The desired response length
24107 void Ping_set_ponglen(struct LDKPing *NONNULL_PTR this_ptr, uint16_t val);
24110 * The ping packet size.
24111 * This field is not sent on the wire. byteslen zeros are sent.
24113 uint16_t Ping_get_byteslen(const struct LDKPing *NONNULL_PTR this_ptr);
24116 * The ping packet size.
24117 * This field is not sent on the wire. byteslen zeros are sent.
24119 void Ping_set_byteslen(struct LDKPing *NONNULL_PTR this_ptr, uint16_t val);
24122 * Constructs a new Ping given each field
24124 MUST_USE_RES struct LDKPing Ping_new(uint16_t ponglen_arg, uint16_t byteslen_arg);
24127 * Creates a copy of the Ping
24129 struct LDKPing Ping_clone(const struct LDKPing *NONNULL_PTR orig);
24132 * Checks if two Pings contain equal inner contents.
24133 * This ignores pointers and is_owned flags and looks at the values in fields.
24134 * Two objects with NULL inner values will be considered "equal" here.
24136 bool Ping_eq(const struct LDKPing *NONNULL_PTR a, const struct LDKPing *NONNULL_PTR b);
24139 * Frees any resources used by the Pong, if is_owned is set and inner is non-NULL.
24141 void Pong_free(struct LDKPong this_obj);
24144 * The pong packet size.
24145 * This field is not sent on the wire. byteslen zeros are sent.
24147 uint16_t Pong_get_byteslen(const struct LDKPong *NONNULL_PTR this_ptr);
24150 * The pong packet size.
24151 * This field is not sent on the wire. byteslen zeros are sent.
24153 void Pong_set_byteslen(struct LDKPong *NONNULL_PTR this_ptr, uint16_t val);
24156 * Constructs a new Pong given each field
24158 MUST_USE_RES struct LDKPong Pong_new(uint16_t byteslen_arg);
24161 * Creates a copy of the Pong
24163 struct LDKPong Pong_clone(const struct LDKPong *NONNULL_PTR orig);
24166 * Checks if two Pongs contain equal inner contents.
24167 * This ignores pointers and is_owned flags and looks at the values in fields.
24168 * Two objects with NULL inner values will be considered "equal" here.
24170 bool Pong_eq(const struct LDKPong *NONNULL_PTR a, const struct LDKPong *NONNULL_PTR b);
24173 * Frees any resources used by the OpenChannel, if is_owned is set and inner is non-NULL.
24175 void OpenChannel_free(struct LDKOpenChannel this_obj);
24178 * The genesis hash of the blockchain where the channel is to be opened
24180 const uint8_t (*OpenChannel_get_chain_hash(const struct LDKOpenChannel *NONNULL_PTR this_ptr))[32];
24183 * The genesis hash of the blockchain where the channel is to be opened
24185 void OpenChannel_set_chain_hash(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
24188 * A temporary channel ID, until the funding outpoint is announced
24190 const uint8_t (*OpenChannel_get_temporary_channel_id(const struct LDKOpenChannel *NONNULL_PTR this_ptr))[32];
24193 * A temporary channel ID, until the funding outpoint is announced
24195 void OpenChannel_set_temporary_channel_id(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
24198 * The channel value
24200 uint64_t OpenChannel_get_funding_satoshis(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
24203 * The channel value
24205 void OpenChannel_set_funding_satoshis(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint64_t val);
24208 * The amount to push to the counterparty as part of the open, in milli-satoshi
24210 uint64_t OpenChannel_get_push_msat(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
24213 * The amount to push to the counterparty as part of the open, in milli-satoshi
24215 void OpenChannel_set_push_msat(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint64_t val);
24218 * The threshold below which outputs on transactions broadcast by sender will be omitted
24220 uint64_t OpenChannel_get_dust_limit_satoshis(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
24223 * The threshold below which outputs on transactions broadcast by sender will be omitted
24225 void OpenChannel_set_dust_limit_satoshis(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint64_t val);
24228 * The maximum inbound HTLC value in flight towards sender, in milli-satoshi
24230 uint64_t OpenChannel_get_max_htlc_value_in_flight_msat(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
24233 * The maximum inbound HTLC value in flight towards sender, in milli-satoshi
24235 void OpenChannel_set_max_htlc_value_in_flight_msat(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint64_t val);
24238 * The minimum value unencumbered by HTLCs for the counterparty to keep in the channel
24240 uint64_t OpenChannel_get_channel_reserve_satoshis(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
24243 * The minimum value unencumbered by HTLCs for the counterparty to keep in the channel
24245 void OpenChannel_set_channel_reserve_satoshis(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint64_t val);
24248 * The minimum HTLC size incoming to sender, in milli-satoshi
24250 uint64_t OpenChannel_get_htlc_minimum_msat(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
24253 * The minimum HTLC size incoming to sender, in milli-satoshi
24255 void OpenChannel_set_htlc_minimum_msat(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint64_t val);
24258 * The feerate per 1000-weight of sender generated transactions, until updated by update_fee
24260 uint32_t OpenChannel_get_feerate_per_kw(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
24263 * The feerate per 1000-weight of sender generated transactions, until updated by update_fee
24265 void OpenChannel_set_feerate_per_kw(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint32_t val);
24268 * The number of blocks which the counterparty will have to wait to claim on-chain funds if they broadcast a commitment transaction
24270 uint16_t OpenChannel_get_to_self_delay(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
24273 * The number of blocks which the counterparty will have to wait to claim on-chain funds if they broadcast a commitment transaction
24275 void OpenChannel_set_to_self_delay(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint16_t val);
24278 * The maximum number of inbound HTLCs towards sender
24280 uint16_t OpenChannel_get_max_accepted_htlcs(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
24283 * The maximum number of inbound HTLCs towards sender
24285 void OpenChannel_set_max_accepted_htlcs(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint16_t val);
24288 * The sender's key controlling the funding transaction
24290 struct LDKPublicKey OpenChannel_get_funding_pubkey(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
24293 * The sender's key controlling the funding transaction
24295 void OpenChannel_set_funding_pubkey(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
24298 * Used to derive a revocation key for transactions broadcast by counterparty
24300 struct LDKPublicKey OpenChannel_get_revocation_basepoint(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
24303 * Used to derive a revocation key for transactions broadcast by counterparty
24305 void OpenChannel_set_revocation_basepoint(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
24308 * A payment key to sender for transactions broadcast by counterparty
24310 struct LDKPublicKey OpenChannel_get_payment_point(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
24313 * A payment key to sender for transactions broadcast by counterparty
24315 void OpenChannel_set_payment_point(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
24318 * Used to derive a payment key to sender for transactions broadcast by sender
24320 struct LDKPublicKey OpenChannel_get_delayed_payment_basepoint(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
24323 * Used to derive a payment key to sender for transactions broadcast by sender
24325 void OpenChannel_set_delayed_payment_basepoint(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
24328 * Used to derive an HTLC payment key to sender
24330 struct LDKPublicKey OpenChannel_get_htlc_basepoint(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
24333 * Used to derive an HTLC payment key to sender
24335 void OpenChannel_set_htlc_basepoint(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
24338 * The first to-be-broadcast-by-sender transaction's per commitment point
24340 struct LDKPublicKey OpenChannel_get_first_per_commitment_point(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
24343 * The first to-be-broadcast-by-sender transaction's per commitment point
24345 void OpenChannel_set_first_per_commitment_point(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
24350 uint8_t OpenChannel_get_channel_flags(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
24355 void OpenChannel_set_channel_flags(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint8_t val);
24358 * The channel type that this channel will represent. If none is set, we derive the channel
24359 * type from the intersection of our feature bits with our counterparty's feature bits from
24360 * the Init message.
24362 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
24364 struct LDKChannelTypeFeatures OpenChannel_get_channel_type(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
24367 * The channel type that this channel will represent. If none is set, we derive the channel
24368 * type from the intersection of our feature bits with our counterparty's feature bits from
24369 * the Init message.
24371 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
24373 void OpenChannel_set_channel_type(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKChannelTypeFeatures val);
24376 * Creates a copy of the OpenChannel
24378 struct LDKOpenChannel OpenChannel_clone(const struct LDKOpenChannel *NONNULL_PTR orig);
24381 * Checks if two OpenChannels contain equal inner contents.
24382 * This ignores pointers and is_owned flags and looks at the values in fields.
24383 * Two objects with NULL inner values will be considered "equal" here.
24385 bool OpenChannel_eq(const struct LDKOpenChannel *NONNULL_PTR a, const struct LDKOpenChannel *NONNULL_PTR b);
24388 * Frees any resources used by the AcceptChannel, if is_owned is set and inner is non-NULL.
24390 void AcceptChannel_free(struct LDKAcceptChannel this_obj);
24393 * A temporary channel ID, until the funding outpoint is announced
24395 const uint8_t (*AcceptChannel_get_temporary_channel_id(const struct LDKAcceptChannel *NONNULL_PTR this_ptr))[32];
24398 * A temporary channel ID, until the funding outpoint is announced
24400 void AcceptChannel_set_temporary_channel_id(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
24403 * The threshold below which outputs on transactions broadcast by sender will be omitted
24405 uint64_t AcceptChannel_get_dust_limit_satoshis(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
24408 * The threshold below which outputs on transactions broadcast by sender will be omitted
24410 void AcceptChannel_set_dust_limit_satoshis(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint64_t val);
24413 * The maximum inbound HTLC value in flight towards sender, in milli-satoshi
24415 uint64_t AcceptChannel_get_max_htlc_value_in_flight_msat(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
24418 * The maximum inbound HTLC value in flight towards sender, in milli-satoshi
24420 void AcceptChannel_set_max_htlc_value_in_flight_msat(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint64_t val);
24423 * The minimum value unencumbered by HTLCs for the counterparty to keep in the channel
24425 uint64_t AcceptChannel_get_channel_reserve_satoshis(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
24428 * The minimum value unencumbered by HTLCs for the counterparty to keep in the channel
24430 void AcceptChannel_set_channel_reserve_satoshis(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint64_t val);
24433 * The minimum HTLC size incoming to sender, in milli-satoshi
24435 uint64_t AcceptChannel_get_htlc_minimum_msat(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
24438 * The minimum HTLC size incoming to sender, in milli-satoshi
24440 void AcceptChannel_set_htlc_minimum_msat(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint64_t val);
24443 * Minimum depth of the funding transaction before the channel is considered open
24445 uint32_t AcceptChannel_get_minimum_depth(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
24448 * Minimum depth of the funding transaction before the channel is considered open
24450 void AcceptChannel_set_minimum_depth(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint32_t val);
24453 * The number of blocks which the counterparty will have to wait to claim on-chain funds if they broadcast a commitment transaction
24455 uint16_t AcceptChannel_get_to_self_delay(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
24458 * The number of blocks which the counterparty will have to wait to claim on-chain funds if they broadcast a commitment transaction
24460 void AcceptChannel_set_to_self_delay(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint16_t val);
24463 * The maximum number of inbound HTLCs towards sender
24465 uint16_t AcceptChannel_get_max_accepted_htlcs(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
24468 * The maximum number of inbound HTLCs towards sender
24470 void AcceptChannel_set_max_accepted_htlcs(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint16_t val);
24473 * The sender's key controlling the funding transaction
24475 struct LDKPublicKey AcceptChannel_get_funding_pubkey(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
24478 * The sender's key controlling the funding transaction
24480 void AcceptChannel_set_funding_pubkey(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
24483 * Used to derive a revocation key for transactions broadcast by counterparty
24485 struct LDKPublicKey AcceptChannel_get_revocation_basepoint(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
24488 * Used to derive a revocation key for transactions broadcast by counterparty
24490 void AcceptChannel_set_revocation_basepoint(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
24493 * A payment key to sender for transactions broadcast by counterparty
24495 struct LDKPublicKey AcceptChannel_get_payment_point(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
24498 * A payment key to sender for transactions broadcast by counterparty
24500 void AcceptChannel_set_payment_point(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
24503 * Used to derive a payment key to sender for transactions broadcast by sender
24505 struct LDKPublicKey AcceptChannel_get_delayed_payment_basepoint(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
24508 * Used to derive a payment key to sender for transactions broadcast by sender
24510 void AcceptChannel_set_delayed_payment_basepoint(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
24513 * Used to derive an HTLC payment key to sender for transactions broadcast by counterparty
24515 struct LDKPublicKey AcceptChannel_get_htlc_basepoint(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
24518 * Used to derive an HTLC payment key to sender for transactions broadcast by counterparty
24520 void AcceptChannel_set_htlc_basepoint(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
24523 * The first to-be-broadcast-by-sender transaction's per commitment point
24525 struct LDKPublicKey AcceptChannel_get_first_per_commitment_point(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
24528 * The first to-be-broadcast-by-sender transaction's per commitment point
24530 void AcceptChannel_set_first_per_commitment_point(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
24533 * The channel type that this channel will represent. If none is set, we derive the channel
24534 * type from the intersection of our feature bits with our counterparty's feature bits from
24535 * the Init message.
24537 * This is required to match the equivalent field in [`OpenChannel::channel_type`].
24539 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
24541 struct LDKChannelTypeFeatures AcceptChannel_get_channel_type(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
24544 * The channel type that this channel will represent. If none is set, we derive the channel
24545 * type from the intersection of our feature bits with our counterparty's feature bits from
24546 * the Init message.
24548 * This is required to match the equivalent field in [`OpenChannel::channel_type`].
24550 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
24552 void AcceptChannel_set_channel_type(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKChannelTypeFeatures val);
24555 * Creates a copy of the AcceptChannel
24557 struct LDKAcceptChannel AcceptChannel_clone(const struct LDKAcceptChannel *NONNULL_PTR orig);
24560 * Checks if two AcceptChannels contain equal inner contents.
24561 * This ignores pointers and is_owned flags and looks at the values in fields.
24562 * Two objects with NULL inner values will be considered "equal" here.
24564 bool AcceptChannel_eq(const struct LDKAcceptChannel *NONNULL_PTR a, const struct LDKAcceptChannel *NONNULL_PTR b);
24567 * Frees any resources used by the FundingCreated, if is_owned is set and inner is non-NULL.
24569 void FundingCreated_free(struct LDKFundingCreated this_obj);
24572 * A temporary channel ID, until the funding is established
24574 const uint8_t (*FundingCreated_get_temporary_channel_id(const struct LDKFundingCreated *NONNULL_PTR this_ptr))[32];
24577 * A temporary channel ID, until the funding is established
24579 void FundingCreated_set_temporary_channel_id(struct LDKFundingCreated *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
24582 * The funding transaction ID
24584 const uint8_t (*FundingCreated_get_funding_txid(const struct LDKFundingCreated *NONNULL_PTR this_ptr))[32];
24587 * The funding transaction ID
24589 void FundingCreated_set_funding_txid(struct LDKFundingCreated *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
24592 * The specific output index funding this channel
24594 uint16_t FundingCreated_get_funding_output_index(const struct LDKFundingCreated *NONNULL_PTR this_ptr);
24597 * The specific output index funding this channel
24599 void FundingCreated_set_funding_output_index(struct LDKFundingCreated *NONNULL_PTR this_ptr, uint16_t val);
24602 * The signature of the channel initiator (funder) on the initial commitment transaction
24604 struct LDKSignature FundingCreated_get_signature(const struct LDKFundingCreated *NONNULL_PTR this_ptr);
24607 * The signature of the channel initiator (funder) on the initial commitment transaction
24609 void FundingCreated_set_signature(struct LDKFundingCreated *NONNULL_PTR this_ptr, struct LDKSignature val);
24612 * Constructs a new FundingCreated given each field
24614 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 LDKSignature signature_arg);
24617 * Creates a copy of the FundingCreated
24619 struct LDKFundingCreated FundingCreated_clone(const struct LDKFundingCreated *NONNULL_PTR orig);
24622 * Checks if two FundingCreateds contain equal inner contents.
24623 * This ignores pointers and is_owned flags and looks at the values in fields.
24624 * Two objects with NULL inner values will be considered "equal" here.
24626 bool FundingCreated_eq(const struct LDKFundingCreated *NONNULL_PTR a, const struct LDKFundingCreated *NONNULL_PTR b);
24629 * Frees any resources used by the FundingSigned, if is_owned is set and inner is non-NULL.
24631 void FundingSigned_free(struct LDKFundingSigned this_obj);
24636 const uint8_t (*FundingSigned_get_channel_id(const struct LDKFundingSigned *NONNULL_PTR this_ptr))[32];
24641 void FundingSigned_set_channel_id(struct LDKFundingSigned *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
24644 * The signature of the channel acceptor (fundee) on the initial commitment transaction
24646 struct LDKSignature FundingSigned_get_signature(const struct LDKFundingSigned *NONNULL_PTR this_ptr);
24649 * The signature of the channel acceptor (fundee) on the initial commitment transaction
24651 void FundingSigned_set_signature(struct LDKFundingSigned *NONNULL_PTR this_ptr, struct LDKSignature val);
24654 * Constructs a new FundingSigned given each field
24656 MUST_USE_RES struct LDKFundingSigned FundingSigned_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKSignature signature_arg);
24659 * Creates a copy of the FundingSigned
24661 struct LDKFundingSigned FundingSigned_clone(const struct LDKFundingSigned *NONNULL_PTR orig);
24664 * Checks if two FundingSigneds contain equal inner contents.
24665 * This ignores pointers and is_owned flags and looks at the values in fields.
24666 * Two objects with NULL inner values will be considered "equal" here.
24668 bool FundingSigned_eq(const struct LDKFundingSigned *NONNULL_PTR a, const struct LDKFundingSigned *NONNULL_PTR b);
24671 * Frees any resources used by the ChannelReady, if is_owned is set and inner is non-NULL.
24673 void ChannelReady_free(struct LDKChannelReady this_obj);
24678 const uint8_t (*ChannelReady_get_channel_id(const struct LDKChannelReady *NONNULL_PTR this_ptr))[32];
24683 void ChannelReady_set_channel_id(struct LDKChannelReady *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
24686 * The per-commitment point of the second commitment transaction
24688 struct LDKPublicKey ChannelReady_get_next_per_commitment_point(const struct LDKChannelReady *NONNULL_PTR this_ptr);
24691 * The per-commitment point of the second commitment transaction
24693 void ChannelReady_set_next_per_commitment_point(struct LDKChannelReady *NONNULL_PTR this_ptr, struct LDKPublicKey val);
24696 * If set, provides a short_channel_id alias for this channel. The sender will accept payments
24697 * to be forwarded over this SCID and forward them to this messages' recipient.
24699 struct LDKCOption_u64Z ChannelReady_get_short_channel_id_alias(const struct LDKChannelReady *NONNULL_PTR this_ptr);
24702 * If set, provides a short_channel_id alias for this channel. The sender will accept payments
24703 * to be forwarded over this SCID and forward them to this messages' recipient.
24705 void ChannelReady_set_short_channel_id_alias(struct LDKChannelReady *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
24708 * Constructs a new ChannelReady given each field
24710 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);
24713 * Creates a copy of the ChannelReady
24715 struct LDKChannelReady ChannelReady_clone(const struct LDKChannelReady *NONNULL_PTR orig);
24718 * Checks if two ChannelReadys contain equal inner contents.
24719 * This ignores pointers and is_owned flags and looks at the values in fields.
24720 * Two objects with NULL inner values will be considered "equal" here.
24722 bool ChannelReady_eq(const struct LDKChannelReady *NONNULL_PTR a, const struct LDKChannelReady *NONNULL_PTR b);
24725 * Frees any resources used by the Shutdown, if is_owned is set and inner is non-NULL.
24727 void Shutdown_free(struct LDKShutdown this_obj);
24732 const uint8_t (*Shutdown_get_channel_id(const struct LDKShutdown *NONNULL_PTR this_ptr))[32];
24737 void Shutdown_set_channel_id(struct LDKShutdown *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
24740 * The destination of this peer's funds on closing.
24741 * Must be in one of these forms: p2pkh, p2sh, p2wpkh, p2wsh.
24743 struct LDKu8slice Shutdown_get_scriptpubkey(const struct LDKShutdown *NONNULL_PTR this_ptr);
24746 * The destination of this peer's funds on closing.
24747 * Must be in one of these forms: p2pkh, p2sh, p2wpkh, p2wsh.
24749 void Shutdown_set_scriptpubkey(struct LDKShutdown *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val);
24752 * Constructs a new Shutdown given each field
24754 MUST_USE_RES struct LDKShutdown Shutdown_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKCVec_u8Z scriptpubkey_arg);
24757 * Creates a copy of the Shutdown
24759 struct LDKShutdown Shutdown_clone(const struct LDKShutdown *NONNULL_PTR orig);
24762 * Checks if two Shutdowns contain equal inner contents.
24763 * This ignores pointers and is_owned flags and looks at the values in fields.
24764 * Two objects with NULL inner values will be considered "equal" here.
24766 bool Shutdown_eq(const struct LDKShutdown *NONNULL_PTR a, const struct LDKShutdown *NONNULL_PTR b);
24769 * Frees any resources used by the ClosingSignedFeeRange, if is_owned is set and inner is non-NULL.
24771 void ClosingSignedFeeRange_free(struct LDKClosingSignedFeeRange this_obj);
24774 * The minimum absolute fee, in satoshis, which the sender is willing to place on the closing
24777 uint64_t ClosingSignedFeeRange_get_min_fee_satoshis(const struct LDKClosingSignedFeeRange *NONNULL_PTR this_ptr);
24780 * The minimum absolute fee, in satoshis, which the sender is willing to place on the closing
24783 void ClosingSignedFeeRange_set_min_fee_satoshis(struct LDKClosingSignedFeeRange *NONNULL_PTR this_ptr, uint64_t val);
24786 * The maximum absolute fee, in satoshis, which the sender is willing to place on the closing
24789 uint64_t ClosingSignedFeeRange_get_max_fee_satoshis(const struct LDKClosingSignedFeeRange *NONNULL_PTR this_ptr);
24792 * The maximum absolute fee, in satoshis, which the sender is willing to place on the closing
24795 void ClosingSignedFeeRange_set_max_fee_satoshis(struct LDKClosingSignedFeeRange *NONNULL_PTR this_ptr, uint64_t val);
24798 * Constructs a new ClosingSignedFeeRange given each field
24800 MUST_USE_RES struct LDKClosingSignedFeeRange ClosingSignedFeeRange_new(uint64_t min_fee_satoshis_arg, uint64_t max_fee_satoshis_arg);
24803 * Creates a copy of the ClosingSignedFeeRange
24805 struct LDKClosingSignedFeeRange ClosingSignedFeeRange_clone(const struct LDKClosingSignedFeeRange *NONNULL_PTR orig);
24808 * Checks if two ClosingSignedFeeRanges contain equal inner contents.
24809 * This ignores pointers and is_owned flags and looks at the values in fields.
24810 * Two objects with NULL inner values will be considered "equal" here.
24812 bool ClosingSignedFeeRange_eq(const struct LDKClosingSignedFeeRange *NONNULL_PTR a, const struct LDKClosingSignedFeeRange *NONNULL_PTR b);
24815 * Frees any resources used by the ClosingSigned, if is_owned is set and inner is non-NULL.
24817 void ClosingSigned_free(struct LDKClosingSigned this_obj);
24822 const uint8_t (*ClosingSigned_get_channel_id(const struct LDKClosingSigned *NONNULL_PTR this_ptr))[32];
24827 void ClosingSigned_set_channel_id(struct LDKClosingSigned *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
24830 * The proposed total fee for the closing transaction
24832 uint64_t ClosingSigned_get_fee_satoshis(const struct LDKClosingSigned *NONNULL_PTR this_ptr);
24835 * The proposed total fee for the closing transaction
24837 void ClosingSigned_set_fee_satoshis(struct LDKClosingSigned *NONNULL_PTR this_ptr, uint64_t val);
24840 * A signature on the closing transaction
24842 struct LDKSignature ClosingSigned_get_signature(const struct LDKClosingSigned *NONNULL_PTR this_ptr);
24845 * A signature on the closing transaction
24847 void ClosingSigned_set_signature(struct LDKClosingSigned *NONNULL_PTR this_ptr, struct LDKSignature val);
24850 * The minimum and maximum fees which the sender is willing to accept, provided only by new
24853 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
24855 struct LDKClosingSignedFeeRange ClosingSigned_get_fee_range(const struct LDKClosingSigned *NONNULL_PTR this_ptr);
24858 * The minimum and maximum fees which the sender is willing to accept, provided only by new
24861 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
24863 void ClosingSigned_set_fee_range(struct LDKClosingSigned *NONNULL_PTR this_ptr, struct LDKClosingSignedFeeRange val);
24866 * Constructs a new ClosingSigned given each field
24868 MUST_USE_RES struct LDKClosingSigned ClosingSigned_new(struct LDKThirtyTwoBytes channel_id_arg, uint64_t fee_satoshis_arg, struct LDKSignature signature_arg, struct LDKClosingSignedFeeRange fee_range_arg);
24871 * Creates a copy of the ClosingSigned
24873 struct LDKClosingSigned ClosingSigned_clone(const struct LDKClosingSigned *NONNULL_PTR orig);
24876 * Checks if two ClosingSigneds contain equal inner contents.
24877 * This ignores pointers and is_owned flags and looks at the values in fields.
24878 * Two objects with NULL inner values will be considered "equal" here.
24880 bool ClosingSigned_eq(const struct LDKClosingSigned *NONNULL_PTR a, const struct LDKClosingSigned *NONNULL_PTR b);
24883 * Frees any resources used by the UpdateAddHTLC, if is_owned is set and inner is non-NULL.
24885 void UpdateAddHTLC_free(struct LDKUpdateAddHTLC this_obj);
24890 const uint8_t (*UpdateAddHTLC_get_channel_id(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr))[32];
24895 void UpdateAddHTLC_set_channel_id(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
24900 uint64_t UpdateAddHTLC_get_htlc_id(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr);
24905 void UpdateAddHTLC_set_htlc_id(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, uint64_t val);
24908 * The HTLC value in milli-satoshi
24910 uint64_t UpdateAddHTLC_get_amount_msat(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr);
24913 * The HTLC value in milli-satoshi
24915 void UpdateAddHTLC_set_amount_msat(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, uint64_t val);
24918 * The payment hash, the pre-image of which controls HTLC redemption
24920 const uint8_t (*UpdateAddHTLC_get_payment_hash(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr))[32];
24923 * The payment hash, the pre-image of which controls HTLC redemption
24925 void UpdateAddHTLC_set_payment_hash(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
24928 * The expiry height of the HTLC
24930 uint32_t UpdateAddHTLC_get_cltv_expiry(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr);
24933 * The expiry height of the HTLC
24935 void UpdateAddHTLC_set_cltv_expiry(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, uint32_t val);
24938 * Creates a copy of the UpdateAddHTLC
24940 struct LDKUpdateAddHTLC UpdateAddHTLC_clone(const struct LDKUpdateAddHTLC *NONNULL_PTR orig);
24943 * Checks if two UpdateAddHTLCs contain equal inner contents.
24944 * This ignores pointers and is_owned flags and looks at the values in fields.
24945 * Two objects with NULL inner values will be considered "equal" here.
24947 bool UpdateAddHTLC_eq(const struct LDKUpdateAddHTLC *NONNULL_PTR a, const struct LDKUpdateAddHTLC *NONNULL_PTR b);
24950 * Frees any resources used by the OnionMessage, if is_owned is set and inner is non-NULL.
24952 void OnionMessage_free(struct LDKOnionMessage this_obj);
24955 * Used in decrypting the onion packet's payload.
24957 struct LDKPublicKey OnionMessage_get_blinding_point(const struct LDKOnionMessage *NONNULL_PTR this_ptr);
24960 * Used in decrypting the onion packet's payload.
24962 void OnionMessage_set_blinding_point(struct LDKOnionMessage *NONNULL_PTR this_ptr, struct LDKPublicKey val);
24965 * Creates a copy of the OnionMessage
24967 struct LDKOnionMessage OnionMessage_clone(const struct LDKOnionMessage *NONNULL_PTR orig);
24970 * Checks if two OnionMessages contain equal inner contents.
24971 * This ignores pointers and is_owned flags and looks at the values in fields.
24972 * Two objects with NULL inner values will be considered "equal" here.
24974 bool OnionMessage_eq(const struct LDKOnionMessage *NONNULL_PTR a, const struct LDKOnionMessage *NONNULL_PTR b);
24977 * Frees any resources used by the UpdateFulfillHTLC, if is_owned is set and inner is non-NULL.
24979 void UpdateFulfillHTLC_free(struct LDKUpdateFulfillHTLC this_obj);
24984 const uint8_t (*UpdateFulfillHTLC_get_channel_id(const struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr))[32];
24989 void UpdateFulfillHTLC_set_channel_id(struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
24994 uint64_t UpdateFulfillHTLC_get_htlc_id(const struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr);
24999 void UpdateFulfillHTLC_set_htlc_id(struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr, uint64_t val);
25002 * The pre-image of the payment hash, allowing HTLC redemption
25004 const uint8_t (*UpdateFulfillHTLC_get_payment_preimage(const struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr))[32];
25007 * The pre-image of the payment hash, allowing HTLC redemption
25009 void UpdateFulfillHTLC_set_payment_preimage(struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
25012 * Constructs a new UpdateFulfillHTLC given each field
25014 MUST_USE_RES struct LDKUpdateFulfillHTLC UpdateFulfillHTLC_new(struct LDKThirtyTwoBytes channel_id_arg, uint64_t htlc_id_arg, struct LDKThirtyTwoBytes payment_preimage_arg);
25017 * Creates a copy of the UpdateFulfillHTLC
25019 struct LDKUpdateFulfillHTLC UpdateFulfillHTLC_clone(const struct LDKUpdateFulfillHTLC *NONNULL_PTR orig);
25022 * Checks if two UpdateFulfillHTLCs contain equal inner contents.
25023 * This ignores pointers and is_owned flags and looks at the values in fields.
25024 * Two objects with NULL inner values will be considered "equal" here.
25026 bool UpdateFulfillHTLC_eq(const struct LDKUpdateFulfillHTLC *NONNULL_PTR a, const struct LDKUpdateFulfillHTLC *NONNULL_PTR b);
25029 * Frees any resources used by the UpdateFailHTLC, if is_owned is set and inner is non-NULL.
25031 void UpdateFailHTLC_free(struct LDKUpdateFailHTLC this_obj);
25036 const uint8_t (*UpdateFailHTLC_get_channel_id(const struct LDKUpdateFailHTLC *NONNULL_PTR this_ptr))[32];
25041 void UpdateFailHTLC_set_channel_id(struct LDKUpdateFailHTLC *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
25046 uint64_t UpdateFailHTLC_get_htlc_id(const struct LDKUpdateFailHTLC *NONNULL_PTR this_ptr);
25051 void UpdateFailHTLC_set_htlc_id(struct LDKUpdateFailHTLC *NONNULL_PTR this_ptr, uint64_t val);
25054 * Creates a copy of the UpdateFailHTLC
25056 struct LDKUpdateFailHTLC UpdateFailHTLC_clone(const struct LDKUpdateFailHTLC *NONNULL_PTR orig);
25059 * Checks if two UpdateFailHTLCs contain equal inner contents.
25060 * This ignores pointers and is_owned flags and looks at the values in fields.
25061 * Two objects with NULL inner values will be considered "equal" here.
25063 bool UpdateFailHTLC_eq(const struct LDKUpdateFailHTLC *NONNULL_PTR a, const struct LDKUpdateFailHTLC *NONNULL_PTR b);
25066 * Frees any resources used by the UpdateFailMalformedHTLC, if is_owned is set and inner is non-NULL.
25068 void UpdateFailMalformedHTLC_free(struct LDKUpdateFailMalformedHTLC this_obj);
25073 const uint8_t (*UpdateFailMalformedHTLC_get_channel_id(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr))[32];
25078 void UpdateFailMalformedHTLC_set_channel_id(struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
25083 uint64_t UpdateFailMalformedHTLC_get_htlc_id(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr);
25088 void UpdateFailMalformedHTLC_set_htlc_id(struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr, uint64_t val);
25093 uint16_t UpdateFailMalformedHTLC_get_failure_code(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr);
25098 void UpdateFailMalformedHTLC_set_failure_code(struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr, uint16_t val);
25101 * Creates a copy of the UpdateFailMalformedHTLC
25103 struct LDKUpdateFailMalformedHTLC UpdateFailMalformedHTLC_clone(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR orig);
25106 * Checks if two UpdateFailMalformedHTLCs contain equal inner contents.
25107 * This ignores pointers and is_owned flags and looks at the values in fields.
25108 * Two objects with NULL inner values will be considered "equal" here.
25110 bool UpdateFailMalformedHTLC_eq(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR a, const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR b);
25113 * Frees any resources used by the CommitmentSigned, if is_owned is set and inner is non-NULL.
25115 void CommitmentSigned_free(struct LDKCommitmentSigned this_obj);
25120 const uint8_t (*CommitmentSigned_get_channel_id(const struct LDKCommitmentSigned *NONNULL_PTR this_ptr))[32];
25125 void CommitmentSigned_set_channel_id(struct LDKCommitmentSigned *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
25128 * A signature on the commitment transaction
25130 struct LDKSignature CommitmentSigned_get_signature(const struct LDKCommitmentSigned *NONNULL_PTR this_ptr);
25133 * A signature on the commitment transaction
25135 void CommitmentSigned_set_signature(struct LDKCommitmentSigned *NONNULL_PTR this_ptr, struct LDKSignature val);
25138 * Signatures on the HTLC transactions
25140 * Returns a copy of the field.
25142 struct LDKCVec_SignatureZ CommitmentSigned_get_htlc_signatures(const struct LDKCommitmentSigned *NONNULL_PTR this_ptr);
25145 * Signatures on the HTLC transactions
25147 void CommitmentSigned_set_htlc_signatures(struct LDKCommitmentSigned *NONNULL_PTR this_ptr, struct LDKCVec_SignatureZ val);
25150 * Constructs a new CommitmentSigned given each field
25152 MUST_USE_RES struct LDKCommitmentSigned CommitmentSigned_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKSignature signature_arg, struct LDKCVec_SignatureZ htlc_signatures_arg);
25155 * Creates a copy of the CommitmentSigned
25157 struct LDKCommitmentSigned CommitmentSigned_clone(const struct LDKCommitmentSigned *NONNULL_PTR orig);
25160 * Checks if two CommitmentSigneds contain equal inner contents.
25161 * This ignores pointers and is_owned flags and looks at the values in fields.
25162 * Two objects with NULL inner values will be considered "equal" here.
25164 bool CommitmentSigned_eq(const struct LDKCommitmentSigned *NONNULL_PTR a, const struct LDKCommitmentSigned *NONNULL_PTR b);
25167 * Frees any resources used by the RevokeAndACK, if is_owned is set and inner is non-NULL.
25169 void RevokeAndACK_free(struct LDKRevokeAndACK this_obj);
25174 const uint8_t (*RevokeAndACK_get_channel_id(const struct LDKRevokeAndACK *NONNULL_PTR this_ptr))[32];
25179 void RevokeAndACK_set_channel_id(struct LDKRevokeAndACK *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
25182 * The secret corresponding to the per-commitment point
25184 const uint8_t (*RevokeAndACK_get_per_commitment_secret(const struct LDKRevokeAndACK *NONNULL_PTR this_ptr))[32];
25187 * The secret corresponding to the per-commitment point
25189 void RevokeAndACK_set_per_commitment_secret(struct LDKRevokeAndACK *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
25192 * The next sender-broadcast commitment transaction's per-commitment point
25194 struct LDKPublicKey RevokeAndACK_get_next_per_commitment_point(const struct LDKRevokeAndACK *NONNULL_PTR this_ptr);
25197 * The next sender-broadcast commitment transaction's per-commitment point
25199 void RevokeAndACK_set_next_per_commitment_point(struct LDKRevokeAndACK *NONNULL_PTR this_ptr, struct LDKPublicKey val);
25202 * Constructs a new RevokeAndACK given each field
25204 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);
25207 * Creates a copy of the RevokeAndACK
25209 struct LDKRevokeAndACK RevokeAndACK_clone(const struct LDKRevokeAndACK *NONNULL_PTR orig);
25212 * Checks if two RevokeAndACKs contain equal inner contents.
25213 * This ignores pointers and is_owned flags and looks at the values in fields.
25214 * Two objects with NULL inner values will be considered "equal" here.
25216 bool RevokeAndACK_eq(const struct LDKRevokeAndACK *NONNULL_PTR a, const struct LDKRevokeAndACK *NONNULL_PTR b);
25219 * Frees any resources used by the UpdateFee, if is_owned is set and inner is non-NULL.
25221 void UpdateFee_free(struct LDKUpdateFee this_obj);
25226 const uint8_t (*UpdateFee_get_channel_id(const struct LDKUpdateFee *NONNULL_PTR this_ptr))[32];
25231 void UpdateFee_set_channel_id(struct LDKUpdateFee *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
25234 * Fee rate per 1000-weight of the transaction
25236 uint32_t UpdateFee_get_feerate_per_kw(const struct LDKUpdateFee *NONNULL_PTR this_ptr);
25239 * Fee rate per 1000-weight of the transaction
25241 void UpdateFee_set_feerate_per_kw(struct LDKUpdateFee *NONNULL_PTR this_ptr, uint32_t val);
25244 * Constructs a new UpdateFee given each field
25246 MUST_USE_RES struct LDKUpdateFee UpdateFee_new(struct LDKThirtyTwoBytes channel_id_arg, uint32_t feerate_per_kw_arg);
25249 * Creates a copy of the UpdateFee
25251 struct LDKUpdateFee UpdateFee_clone(const struct LDKUpdateFee *NONNULL_PTR orig);
25254 * Checks if two UpdateFees contain equal inner contents.
25255 * This ignores pointers and is_owned flags and looks at the values in fields.
25256 * Two objects with NULL inner values will be considered "equal" here.
25258 bool UpdateFee_eq(const struct LDKUpdateFee *NONNULL_PTR a, const struct LDKUpdateFee *NONNULL_PTR b);
25261 * Frees any resources used by the DataLossProtect, if is_owned is set and inner is non-NULL.
25263 void DataLossProtect_free(struct LDKDataLossProtect this_obj);
25266 * Proof that the sender knows the per-commitment secret of a specific commitment transaction
25267 * belonging to the recipient
25269 const uint8_t (*DataLossProtect_get_your_last_per_commitment_secret(const struct LDKDataLossProtect *NONNULL_PTR this_ptr))[32];
25272 * Proof that the sender knows the per-commitment secret of a specific commitment transaction
25273 * belonging to the recipient
25275 void DataLossProtect_set_your_last_per_commitment_secret(struct LDKDataLossProtect *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
25278 * The sender's per-commitment point for their current commitment transaction
25280 struct LDKPublicKey DataLossProtect_get_my_current_per_commitment_point(const struct LDKDataLossProtect *NONNULL_PTR this_ptr);
25283 * The sender's per-commitment point for their current commitment transaction
25285 void DataLossProtect_set_my_current_per_commitment_point(struct LDKDataLossProtect *NONNULL_PTR this_ptr, struct LDKPublicKey val);
25288 * Constructs a new DataLossProtect given each field
25290 MUST_USE_RES struct LDKDataLossProtect DataLossProtect_new(struct LDKThirtyTwoBytes your_last_per_commitment_secret_arg, struct LDKPublicKey my_current_per_commitment_point_arg);
25293 * Creates a copy of the DataLossProtect
25295 struct LDKDataLossProtect DataLossProtect_clone(const struct LDKDataLossProtect *NONNULL_PTR orig);
25298 * Checks if two DataLossProtects contain equal inner contents.
25299 * This ignores pointers and is_owned flags and looks at the values in fields.
25300 * Two objects with NULL inner values will be considered "equal" here.
25302 bool DataLossProtect_eq(const struct LDKDataLossProtect *NONNULL_PTR a, const struct LDKDataLossProtect *NONNULL_PTR b);
25305 * Frees any resources used by the ChannelReestablish, if is_owned is set and inner is non-NULL.
25307 void ChannelReestablish_free(struct LDKChannelReestablish this_obj);
25312 const uint8_t (*ChannelReestablish_get_channel_id(const struct LDKChannelReestablish *NONNULL_PTR this_ptr))[32];
25317 void ChannelReestablish_set_channel_id(struct LDKChannelReestablish *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
25320 * The next commitment number for the sender
25322 uint64_t ChannelReestablish_get_next_local_commitment_number(const struct LDKChannelReestablish *NONNULL_PTR this_ptr);
25325 * The next commitment number for the sender
25327 void ChannelReestablish_set_next_local_commitment_number(struct LDKChannelReestablish *NONNULL_PTR this_ptr, uint64_t val);
25330 * The next commitment number for the recipient
25332 uint64_t ChannelReestablish_get_next_remote_commitment_number(const struct LDKChannelReestablish *NONNULL_PTR this_ptr);
25335 * The next commitment number for the recipient
25337 void ChannelReestablish_set_next_remote_commitment_number(struct LDKChannelReestablish *NONNULL_PTR this_ptr, uint64_t val);
25340 * Creates a copy of the ChannelReestablish
25342 struct LDKChannelReestablish ChannelReestablish_clone(const struct LDKChannelReestablish *NONNULL_PTR orig);
25345 * Checks if two ChannelReestablishs contain equal inner contents.
25346 * This ignores pointers and is_owned flags and looks at the values in fields.
25347 * Two objects with NULL inner values will be considered "equal" here.
25349 bool ChannelReestablish_eq(const struct LDKChannelReestablish *NONNULL_PTR a, const struct LDKChannelReestablish *NONNULL_PTR b);
25352 * Frees any resources used by the AnnouncementSignatures, if is_owned is set and inner is non-NULL.
25354 void AnnouncementSignatures_free(struct LDKAnnouncementSignatures this_obj);
25359 const uint8_t (*AnnouncementSignatures_get_channel_id(const struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr))[32];
25364 void AnnouncementSignatures_set_channel_id(struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
25367 * The short channel ID
25369 uint64_t AnnouncementSignatures_get_short_channel_id(const struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr);
25372 * The short channel ID
25374 void AnnouncementSignatures_set_short_channel_id(struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr, uint64_t val);
25377 * A signature by the node key
25379 struct LDKSignature AnnouncementSignatures_get_node_signature(const struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr);
25382 * A signature by the node key
25384 void AnnouncementSignatures_set_node_signature(struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr, struct LDKSignature val);
25387 * A signature by the funding key
25389 struct LDKSignature AnnouncementSignatures_get_bitcoin_signature(const struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr);
25392 * A signature by the funding key
25394 void AnnouncementSignatures_set_bitcoin_signature(struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr, struct LDKSignature val);
25397 * Constructs a new AnnouncementSignatures given each field
25399 MUST_USE_RES struct LDKAnnouncementSignatures AnnouncementSignatures_new(struct LDKThirtyTwoBytes channel_id_arg, uint64_t short_channel_id_arg, struct LDKSignature node_signature_arg, struct LDKSignature bitcoin_signature_arg);
25402 * Creates a copy of the AnnouncementSignatures
25404 struct LDKAnnouncementSignatures AnnouncementSignatures_clone(const struct LDKAnnouncementSignatures *NONNULL_PTR orig);
25407 * Checks if two AnnouncementSignaturess contain equal inner contents.
25408 * This ignores pointers and is_owned flags and looks at the values in fields.
25409 * Two objects with NULL inner values will be considered "equal" here.
25411 bool AnnouncementSignatures_eq(const struct LDKAnnouncementSignatures *NONNULL_PTR a, const struct LDKAnnouncementSignatures *NONNULL_PTR b);
25414 * Frees any resources used by the NetAddress
25416 void NetAddress_free(struct LDKNetAddress this_ptr);
25419 * Creates a copy of the NetAddress
25421 struct LDKNetAddress NetAddress_clone(const struct LDKNetAddress *NONNULL_PTR orig);
25424 * Utility method to constructs a new IPv4-variant NetAddress
25426 struct LDKNetAddress NetAddress_ipv4(struct LDKFourBytes addr, uint16_t port);
25429 * Utility method to constructs a new IPv6-variant NetAddress
25431 struct LDKNetAddress NetAddress_ipv6(struct LDKSixteenBytes addr, uint16_t port);
25434 * Utility method to constructs a new OnionV2-variant NetAddress
25436 struct LDKNetAddress NetAddress_onion_v2(struct LDKTwelveBytes a);
25439 * Utility method to constructs a new OnionV3-variant NetAddress
25441 struct LDKNetAddress NetAddress_onion_v3(struct LDKThirtyTwoBytes ed25519_pubkey, uint16_t checksum, uint8_t version, uint16_t port);
25444 * Utility method to constructs a new Hostname-variant NetAddress
25446 struct LDKNetAddress NetAddress_hostname(struct LDKHostname hostname, uint16_t port);
25449 * Checks if two NetAddresss contain equal inner contents.
25450 * This ignores pointers and is_owned flags and looks at the values in fields.
25452 bool NetAddress_eq(const struct LDKNetAddress *NONNULL_PTR a, const struct LDKNetAddress *NONNULL_PTR b);
25455 * Serialize the NetAddress object into a byte array which can be read by NetAddress_read
25457 struct LDKCVec_u8Z NetAddress_write(const struct LDKNetAddress *NONNULL_PTR obj);
25460 * Read a NetAddress from a byte array, created by NetAddress_write
25462 struct LDKCResult_NetAddressDecodeErrorZ NetAddress_read(struct LDKu8slice ser);
25465 * Frees any resources used by the UnsignedNodeAnnouncement, if is_owned is set and inner is non-NULL.
25467 void UnsignedNodeAnnouncement_free(struct LDKUnsignedNodeAnnouncement this_obj);
25470 * The advertised features
25472 struct LDKNodeFeatures UnsignedNodeAnnouncement_get_features(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr);
25475 * The advertised features
25477 void UnsignedNodeAnnouncement_set_features(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKNodeFeatures val);
25480 * A strictly monotonic announcement counter, with gaps allowed
25482 uint32_t UnsignedNodeAnnouncement_get_timestamp(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr);
25485 * A strictly monotonic announcement counter, with gaps allowed
25487 void UnsignedNodeAnnouncement_set_timestamp(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, uint32_t val);
25490 * The node_id this announcement originated from (don't rebroadcast the node_announcement back
25493 struct LDKPublicKey UnsignedNodeAnnouncement_get_node_id(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr);
25496 * The node_id this announcement originated from (don't rebroadcast the node_announcement back
25499 void UnsignedNodeAnnouncement_set_node_id(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKPublicKey val);
25502 * An RGB color for UI purposes
25504 const uint8_t (*UnsignedNodeAnnouncement_get_rgb(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr))[3];
25507 * An RGB color for UI purposes
25509 void UnsignedNodeAnnouncement_set_rgb(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKThreeBytes val);
25512 * An alias, for UI purposes. This should be sanitized before use. There is no guarantee
25515 const uint8_t (*UnsignedNodeAnnouncement_get_alias(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr))[32];
25518 * An alias, for UI purposes. This should be sanitized before use. There is no guarantee
25521 void UnsignedNodeAnnouncement_set_alias(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
25524 * List of addresses on which this node is reachable
25526 * Returns a copy of the field.
25528 struct LDKCVec_NetAddressZ UnsignedNodeAnnouncement_get_addresses(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr);
25531 * List of addresses on which this node is reachable
25533 void UnsignedNodeAnnouncement_set_addresses(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKCVec_NetAddressZ val);
25536 * Creates a copy of the UnsignedNodeAnnouncement
25538 struct LDKUnsignedNodeAnnouncement UnsignedNodeAnnouncement_clone(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR orig);
25541 * Checks if two UnsignedNodeAnnouncements contain equal inner contents.
25542 * This ignores pointers and is_owned flags and looks at the values in fields.
25543 * Two objects with NULL inner values will be considered "equal" here.
25545 bool UnsignedNodeAnnouncement_eq(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR a, const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR b);
25548 * Frees any resources used by the NodeAnnouncement, if is_owned is set and inner is non-NULL.
25550 void NodeAnnouncement_free(struct LDKNodeAnnouncement this_obj);
25553 * The signature by the node key
25555 struct LDKSignature NodeAnnouncement_get_signature(const struct LDKNodeAnnouncement *NONNULL_PTR this_ptr);
25558 * The signature by the node key
25560 void NodeAnnouncement_set_signature(struct LDKNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKSignature val);
25563 * The actual content of the announcement
25565 struct LDKUnsignedNodeAnnouncement NodeAnnouncement_get_contents(const struct LDKNodeAnnouncement *NONNULL_PTR this_ptr);
25568 * The actual content of the announcement
25570 void NodeAnnouncement_set_contents(struct LDKNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKUnsignedNodeAnnouncement val);
25573 * Constructs a new NodeAnnouncement given each field
25575 MUST_USE_RES struct LDKNodeAnnouncement NodeAnnouncement_new(struct LDKSignature signature_arg, struct LDKUnsignedNodeAnnouncement contents_arg);
25578 * Creates a copy of the NodeAnnouncement
25580 struct LDKNodeAnnouncement NodeAnnouncement_clone(const struct LDKNodeAnnouncement *NONNULL_PTR orig);
25583 * Checks if two NodeAnnouncements contain equal inner contents.
25584 * This ignores pointers and is_owned flags and looks at the values in fields.
25585 * Two objects with NULL inner values will be considered "equal" here.
25587 bool NodeAnnouncement_eq(const struct LDKNodeAnnouncement *NONNULL_PTR a, const struct LDKNodeAnnouncement *NONNULL_PTR b);
25590 * Frees any resources used by the UnsignedChannelAnnouncement, if is_owned is set and inner is non-NULL.
25592 void UnsignedChannelAnnouncement_free(struct LDKUnsignedChannelAnnouncement this_obj);
25595 * The advertised channel features
25597 struct LDKChannelFeatures UnsignedChannelAnnouncement_get_features(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
25600 * The advertised channel features
25602 void UnsignedChannelAnnouncement_set_features(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKChannelFeatures val);
25605 * The genesis hash of the blockchain where the channel is to be opened
25607 const uint8_t (*UnsignedChannelAnnouncement_get_chain_hash(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr))[32];
25610 * The genesis hash of the blockchain where the channel is to be opened
25612 void UnsignedChannelAnnouncement_set_chain_hash(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
25615 * The short channel ID
25617 uint64_t UnsignedChannelAnnouncement_get_short_channel_id(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
25620 * The short channel ID
25622 void UnsignedChannelAnnouncement_set_short_channel_id(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, uint64_t val);
25625 * One of the two node_ids which are endpoints of this channel
25627 struct LDKPublicKey UnsignedChannelAnnouncement_get_node_id_1(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
25630 * One of the two node_ids which are endpoints of this channel
25632 void UnsignedChannelAnnouncement_set_node_id_1(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKPublicKey val);
25635 * The other of the two node_ids which are endpoints of this channel
25637 struct LDKPublicKey UnsignedChannelAnnouncement_get_node_id_2(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
25640 * The other of the two node_ids which are endpoints of this channel
25642 void UnsignedChannelAnnouncement_set_node_id_2(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKPublicKey val);
25645 * The funding key for the first node
25647 struct LDKPublicKey UnsignedChannelAnnouncement_get_bitcoin_key_1(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
25650 * The funding key for the first node
25652 void UnsignedChannelAnnouncement_set_bitcoin_key_1(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKPublicKey val);
25655 * The funding key for the second node
25657 struct LDKPublicKey UnsignedChannelAnnouncement_get_bitcoin_key_2(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
25660 * The funding key for the second node
25662 void UnsignedChannelAnnouncement_set_bitcoin_key_2(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKPublicKey val);
25665 * Creates a copy of the UnsignedChannelAnnouncement
25667 struct LDKUnsignedChannelAnnouncement UnsignedChannelAnnouncement_clone(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR orig);
25670 * Checks if two UnsignedChannelAnnouncements contain equal inner contents.
25671 * This ignores pointers and is_owned flags and looks at the values in fields.
25672 * Two objects with NULL inner values will be considered "equal" here.
25674 bool UnsignedChannelAnnouncement_eq(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR a, const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR b);
25677 * Frees any resources used by the ChannelAnnouncement, if is_owned is set and inner is non-NULL.
25679 void ChannelAnnouncement_free(struct LDKChannelAnnouncement this_obj);
25682 * Authentication of the announcement by the first public node
25684 struct LDKSignature ChannelAnnouncement_get_node_signature_1(const struct LDKChannelAnnouncement *NONNULL_PTR this_ptr);
25687 * Authentication of the announcement by the first public node
25689 void ChannelAnnouncement_set_node_signature_1(struct LDKChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKSignature val);
25692 * Authentication of the announcement by the second public node
25694 struct LDKSignature ChannelAnnouncement_get_node_signature_2(const struct LDKChannelAnnouncement *NONNULL_PTR this_ptr);
25697 * Authentication of the announcement by the second public node
25699 void ChannelAnnouncement_set_node_signature_2(struct LDKChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKSignature val);
25702 * Proof of funding UTXO ownership by the first public node
25704 struct LDKSignature ChannelAnnouncement_get_bitcoin_signature_1(const struct LDKChannelAnnouncement *NONNULL_PTR this_ptr);
25707 * Proof of funding UTXO ownership by the first public node
25709 void ChannelAnnouncement_set_bitcoin_signature_1(struct LDKChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKSignature val);
25712 * Proof of funding UTXO ownership by the second public node
25714 struct LDKSignature ChannelAnnouncement_get_bitcoin_signature_2(const struct LDKChannelAnnouncement *NONNULL_PTR this_ptr);
25717 * Proof of funding UTXO ownership by the second public node
25719 void ChannelAnnouncement_set_bitcoin_signature_2(struct LDKChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKSignature val);
25722 * The actual announcement
25724 struct LDKUnsignedChannelAnnouncement ChannelAnnouncement_get_contents(const struct LDKChannelAnnouncement *NONNULL_PTR this_ptr);
25727 * The actual announcement
25729 void ChannelAnnouncement_set_contents(struct LDKChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKUnsignedChannelAnnouncement val);
25732 * Constructs a new ChannelAnnouncement given each field
25734 MUST_USE_RES struct LDKChannelAnnouncement ChannelAnnouncement_new(struct LDKSignature node_signature_1_arg, struct LDKSignature node_signature_2_arg, struct LDKSignature bitcoin_signature_1_arg, struct LDKSignature bitcoin_signature_2_arg, struct LDKUnsignedChannelAnnouncement contents_arg);
25737 * Creates a copy of the ChannelAnnouncement
25739 struct LDKChannelAnnouncement ChannelAnnouncement_clone(const struct LDKChannelAnnouncement *NONNULL_PTR orig);
25742 * Checks if two ChannelAnnouncements contain equal inner contents.
25743 * This ignores pointers and is_owned flags and looks at the values in fields.
25744 * Two objects with NULL inner values will be considered "equal" here.
25746 bool ChannelAnnouncement_eq(const struct LDKChannelAnnouncement *NONNULL_PTR a, const struct LDKChannelAnnouncement *NONNULL_PTR b);
25749 * Frees any resources used by the UnsignedChannelUpdate, if is_owned is set and inner is non-NULL.
25751 void UnsignedChannelUpdate_free(struct LDKUnsignedChannelUpdate this_obj);
25754 * The genesis hash of the blockchain where the channel is to be opened
25756 const uint8_t (*UnsignedChannelUpdate_get_chain_hash(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr))[32];
25759 * The genesis hash of the blockchain where the channel is to be opened
25761 void UnsignedChannelUpdate_set_chain_hash(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
25764 * The short channel ID
25766 uint64_t UnsignedChannelUpdate_get_short_channel_id(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
25769 * The short channel ID
25771 void UnsignedChannelUpdate_set_short_channel_id(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint64_t val);
25774 * A strictly monotonic announcement counter, with gaps allowed, specific to this channel
25776 uint32_t UnsignedChannelUpdate_get_timestamp(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
25779 * A strictly monotonic announcement counter, with gaps allowed, specific to this channel
25781 void UnsignedChannelUpdate_set_timestamp(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint32_t val);
25786 uint8_t UnsignedChannelUpdate_get_flags(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
25791 void UnsignedChannelUpdate_set_flags(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint8_t val);
25794 * The number of blocks such that if:
25795 * `incoming_htlc.cltv_expiry < outgoing_htlc.cltv_expiry + cltv_expiry_delta`
25796 * then we need to fail the HTLC backwards. When forwarding an HTLC, cltv_expiry_delta determines
25797 * the outgoing HTLC's minimum cltv_expiry value -- so, if an incoming HTLC comes in with a
25798 * cltv_expiry of 100000, and the node we're forwarding to has a cltv_expiry_delta value of 10,
25799 * then we'll check that the outgoing HTLC's cltv_expiry value is at least 100010 before
25800 * forwarding. Note that the HTLC sender is the one who originally sets this value when
25801 * constructing the route.
25803 uint16_t UnsignedChannelUpdate_get_cltv_expiry_delta(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
25806 * The number of blocks such that if:
25807 * `incoming_htlc.cltv_expiry < outgoing_htlc.cltv_expiry + cltv_expiry_delta`
25808 * then we need to fail the HTLC backwards. When forwarding an HTLC, cltv_expiry_delta determines
25809 * the outgoing HTLC's minimum cltv_expiry value -- so, if an incoming HTLC comes in with a
25810 * cltv_expiry of 100000, and the node we're forwarding to has a cltv_expiry_delta value of 10,
25811 * then we'll check that the outgoing HTLC's cltv_expiry value is at least 100010 before
25812 * forwarding. Note that the HTLC sender is the one who originally sets this value when
25813 * constructing the route.
25815 void UnsignedChannelUpdate_set_cltv_expiry_delta(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint16_t val);
25818 * The minimum HTLC size incoming to sender, in milli-satoshi
25820 uint64_t UnsignedChannelUpdate_get_htlc_minimum_msat(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
25823 * The minimum HTLC size incoming to sender, in milli-satoshi
25825 void UnsignedChannelUpdate_set_htlc_minimum_msat(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint64_t val);
25828 * The maximum HTLC value incoming to sender, in milli-satoshi. Used to be optional.
25830 uint64_t UnsignedChannelUpdate_get_htlc_maximum_msat(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
25833 * The maximum HTLC value incoming to sender, in milli-satoshi. Used to be optional.
25835 void UnsignedChannelUpdate_set_htlc_maximum_msat(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint64_t val);
25838 * The base HTLC fee charged by sender, in milli-satoshi
25840 uint32_t UnsignedChannelUpdate_get_fee_base_msat(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
25843 * The base HTLC fee charged by sender, in milli-satoshi
25845 void UnsignedChannelUpdate_set_fee_base_msat(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint32_t val);
25848 * The amount to fee multiplier, in micro-satoshi
25850 uint32_t UnsignedChannelUpdate_get_fee_proportional_millionths(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
25853 * The amount to fee multiplier, in micro-satoshi
25855 void UnsignedChannelUpdate_set_fee_proportional_millionths(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint32_t val);
25858 * Excess data which was signed as a part of the message which we do not (yet) understand how
25859 * to decode. This is stored to ensure forward-compatibility as new fields are added to the
25862 * Returns a copy of the field.
25864 struct LDKCVec_u8Z UnsignedChannelUpdate_get_excess_data(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
25867 * Excess data which was signed as a part of the message which we do not (yet) understand how
25868 * to decode. This is stored to ensure forward-compatibility as new fields are added to the
25871 void UnsignedChannelUpdate_set_excess_data(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val);
25874 * Constructs a new UnsignedChannelUpdate given each field
25876 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);
25879 * Creates a copy of the UnsignedChannelUpdate
25881 struct LDKUnsignedChannelUpdate UnsignedChannelUpdate_clone(const struct LDKUnsignedChannelUpdate *NONNULL_PTR orig);
25884 * Checks if two UnsignedChannelUpdates contain equal inner contents.
25885 * This ignores pointers and is_owned flags and looks at the values in fields.
25886 * Two objects with NULL inner values will be considered "equal" here.
25888 bool UnsignedChannelUpdate_eq(const struct LDKUnsignedChannelUpdate *NONNULL_PTR a, const struct LDKUnsignedChannelUpdate *NONNULL_PTR b);
25891 * Frees any resources used by the ChannelUpdate, if is_owned is set and inner is non-NULL.
25893 void ChannelUpdate_free(struct LDKChannelUpdate this_obj);
25896 * A signature of the channel update
25898 struct LDKSignature ChannelUpdate_get_signature(const struct LDKChannelUpdate *NONNULL_PTR this_ptr);
25901 * A signature of the channel update
25903 void ChannelUpdate_set_signature(struct LDKChannelUpdate *NONNULL_PTR this_ptr, struct LDKSignature val);
25906 * The actual channel update
25908 struct LDKUnsignedChannelUpdate ChannelUpdate_get_contents(const struct LDKChannelUpdate *NONNULL_PTR this_ptr);
25911 * The actual channel update
25913 void ChannelUpdate_set_contents(struct LDKChannelUpdate *NONNULL_PTR this_ptr, struct LDKUnsignedChannelUpdate val);
25916 * Constructs a new ChannelUpdate given each field
25918 MUST_USE_RES struct LDKChannelUpdate ChannelUpdate_new(struct LDKSignature signature_arg, struct LDKUnsignedChannelUpdate contents_arg);
25921 * Creates a copy of the ChannelUpdate
25923 struct LDKChannelUpdate ChannelUpdate_clone(const struct LDKChannelUpdate *NONNULL_PTR orig);
25926 * Checks if two ChannelUpdates contain equal inner contents.
25927 * This ignores pointers and is_owned flags and looks at the values in fields.
25928 * Two objects with NULL inner values will be considered "equal" here.
25930 bool ChannelUpdate_eq(const struct LDKChannelUpdate *NONNULL_PTR a, const struct LDKChannelUpdate *NONNULL_PTR b);
25933 * Frees any resources used by the QueryChannelRange, if is_owned is set and inner is non-NULL.
25935 void QueryChannelRange_free(struct LDKQueryChannelRange this_obj);
25938 * The genesis hash of the blockchain being queried
25940 const uint8_t (*QueryChannelRange_get_chain_hash(const struct LDKQueryChannelRange *NONNULL_PTR this_ptr))[32];
25943 * The genesis hash of the blockchain being queried
25945 void QueryChannelRange_set_chain_hash(struct LDKQueryChannelRange *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
25948 * The height of the first block for the channel UTXOs being queried
25950 uint32_t QueryChannelRange_get_first_blocknum(const struct LDKQueryChannelRange *NONNULL_PTR this_ptr);
25953 * The height of the first block for the channel UTXOs being queried
25955 void QueryChannelRange_set_first_blocknum(struct LDKQueryChannelRange *NONNULL_PTR this_ptr, uint32_t val);
25958 * The number of blocks to include in the query results
25960 uint32_t QueryChannelRange_get_number_of_blocks(const struct LDKQueryChannelRange *NONNULL_PTR this_ptr);
25963 * The number of blocks to include in the query results
25965 void QueryChannelRange_set_number_of_blocks(struct LDKQueryChannelRange *NONNULL_PTR this_ptr, uint32_t val);
25968 * Constructs a new QueryChannelRange given each field
25970 MUST_USE_RES struct LDKQueryChannelRange QueryChannelRange_new(struct LDKThirtyTwoBytes chain_hash_arg, uint32_t first_blocknum_arg, uint32_t number_of_blocks_arg);
25973 * Creates a copy of the QueryChannelRange
25975 struct LDKQueryChannelRange QueryChannelRange_clone(const struct LDKQueryChannelRange *NONNULL_PTR orig);
25978 * Checks if two QueryChannelRanges contain equal inner contents.
25979 * This ignores pointers and is_owned flags and looks at the values in fields.
25980 * Two objects with NULL inner values will be considered "equal" here.
25982 bool QueryChannelRange_eq(const struct LDKQueryChannelRange *NONNULL_PTR a, const struct LDKQueryChannelRange *NONNULL_PTR b);
25985 * Frees any resources used by the ReplyChannelRange, if is_owned is set and inner is non-NULL.
25987 void ReplyChannelRange_free(struct LDKReplyChannelRange this_obj);
25990 * The genesis hash of the blockchain being queried
25992 const uint8_t (*ReplyChannelRange_get_chain_hash(const struct LDKReplyChannelRange *NONNULL_PTR this_ptr))[32];
25995 * The genesis hash of the blockchain being queried
25997 void ReplyChannelRange_set_chain_hash(struct LDKReplyChannelRange *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
26000 * The height of the first block in the range of the reply
26002 uint32_t ReplyChannelRange_get_first_blocknum(const struct LDKReplyChannelRange *NONNULL_PTR this_ptr);
26005 * The height of the first block in the range of the reply
26007 void ReplyChannelRange_set_first_blocknum(struct LDKReplyChannelRange *NONNULL_PTR this_ptr, uint32_t val);
26010 * The number of blocks included in the range of the reply
26012 uint32_t ReplyChannelRange_get_number_of_blocks(const struct LDKReplyChannelRange *NONNULL_PTR this_ptr);
26015 * The number of blocks included in the range of the reply
26017 void ReplyChannelRange_set_number_of_blocks(struct LDKReplyChannelRange *NONNULL_PTR this_ptr, uint32_t val);
26020 * True when this is the final reply for a query
26022 bool ReplyChannelRange_get_sync_complete(const struct LDKReplyChannelRange *NONNULL_PTR this_ptr);
26025 * True when this is the final reply for a query
26027 void ReplyChannelRange_set_sync_complete(struct LDKReplyChannelRange *NONNULL_PTR this_ptr, bool val);
26030 * The short_channel_ids in the channel range
26032 * Returns a copy of the field.
26034 struct LDKCVec_u64Z ReplyChannelRange_get_short_channel_ids(const struct LDKReplyChannelRange *NONNULL_PTR this_ptr);
26037 * The short_channel_ids in the channel range
26039 void ReplyChannelRange_set_short_channel_ids(struct LDKReplyChannelRange *NONNULL_PTR this_ptr, struct LDKCVec_u64Z val);
26042 * Constructs a new ReplyChannelRange given each field
26044 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);
26047 * Creates a copy of the ReplyChannelRange
26049 struct LDKReplyChannelRange ReplyChannelRange_clone(const struct LDKReplyChannelRange *NONNULL_PTR orig);
26052 * Checks if two ReplyChannelRanges contain equal inner contents.
26053 * This ignores pointers and is_owned flags and looks at the values in fields.
26054 * Two objects with NULL inner values will be considered "equal" here.
26056 bool ReplyChannelRange_eq(const struct LDKReplyChannelRange *NONNULL_PTR a, const struct LDKReplyChannelRange *NONNULL_PTR b);
26059 * Frees any resources used by the QueryShortChannelIds, if is_owned is set and inner is non-NULL.
26061 void QueryShortChannelIds_free(struct LDKQueryShortChannelIds this_obj);
26064 * The genesis hash of the blockchain being queried
26066 const uint8_t (*QueryShortChannelIds_get_chain_hash(const struct LDKQueryShortChannelIds *NONNULL_PTR this_ptr))[32];
26069 * The genesis hash of the blockchain being queried
26071 void QueryShortChannelIds_set_chain_hash(struct LDKQueryShortChannelIds *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
26074 * The short_channel_ids that are being queried
26076 * Returns a copy of the field.
26078 struct LDKCVec_u64Z QueryShortChannelIds_get_short_channel_ids(const struct LDKQueryShortChannelIds *NONNULL_PTR this_ptr);
26081 * The short_channel_ids that are being queried
26083 void QueryShortChannelIds_set_short_channel_ids(struct LDKQueryShortChannelIds *NONNULL_PTR this_ptr, struct LDKCVec_u64Z val);
26086 * Constructs a new QueryShortChannelIds given each field
26088 MUST_USE_RES struct LDKQueryShortChannelIds QueryShortChannelIds_new(struct LDKThirtyTwoBytes chain_hash_arg, struct LDKCVec_u64Z short_channel_ids_arg);
26091 * Creates a copy of the QueryShortChannelIds
26093 struct LDKQueryShortChannelIds QueryShortChannelIds_clone(const struct LDKQueryShortChannelIds *NONNULL_PTR orig);
26096 * Checks if two QueryShortChannelIdss contain equal inner contents.
26097 * This ignores pointers and is_owned flags and looks at the values in fields.
26098 * Two objects with NULL inner values will be considered "equal" here.
26100 bool QueryShortChannelIds_eq(const struct LDKQueryShortChannelIds *NONNULL_PTR a, const struct LDKQueryShortChannelIds *NONNULL_PTR b);
26103 * Frees any resources used by the ReplyShortChannelIdsEnd, if is_owned is set and inner is non-NULL.
26105 void ReplyShortChannelIdsEnd_free(struct LDKReplyShortChannelIdsEnd this_obj);
26108 * The genesis hash of the blockchain that was queried
26110 const uint8_t (*ReplyShortChannelIdsEnd_get_chain_hash(const struct LDKReplyShortChannelIdsEnd *NONNULL_PTR this_ptr))[32];
26113 * The genesis hash of the blockchain that was queried
26115 void ReplyShortChannelIdsEnd_set_chain_hash(struct LDKReplyShortChannelIdsEnd *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
26118 * Indicates if the query recipient maintains up-to-date channel
26119 * information for the chain_hash
26121 bool ReplyShortChannelIdsEnd_get_full_information(const struct LDKReplyShortChannelIdsEnd *NONNULL_PTR this_ptr);
26124 * Indicates if the query recipient maintains up-to-date channel
26125 * information for the chain_hash
26127 void ReplyShortChannelIdsEnd_set_full_information(struct LDKReplyShortChannelIdsEnd *NONNULL_PTR this_ptr, bool val);
26130 * Constructs a new ReplyShortChannelIdsEnd given each field
26132 MUST_USE_RES struct LDKReplyShortChannelIdsEnd ReplyShortChannelIdsEnd_new(struct LDKThirtyTwoBytes chain_hash_arg, bool full_information_arg);
26135 * Creates a copy of the ReplyShortChannelIdsEnd
26137 struct LDKReplyShortChannelIdsEnd ReplyShortChannelIdsEnd_clone(const struct LDKReplyShortChannelIdsEnd *NONNULL_PTR orig);
26140 * Checks if two ReplyShortChannelIdsEnds contain equal inner contents.
26141 * This ignores pointers and is_owned flags and looks at the values in fields.
26142 * Two objects with NULL inner values will be considered "equal" here.
26144 bool ReplyShortChannelIdsEnd_eq(const struct LDKReplyShortChannelIdsEnd *NONNULL_PTR a, const struct LDKReplyShortChannelIdsEnd *NONNULL_PTR b);
26147 * Frees any resources used by the GossipTimestampFilter, if is_owned is set and inner is non-NULL.
26149 void GossipTimestampFilter_free(struct LDKGossipTimestampFilter this_obj);
26152 * The genesis hash of the blockchain for channel and node information
26154 const uint8_t (*GossipTimestampFilter_get_chain_hash(const struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr))[32];
26157 * The genesis hash of the blockchain for channel and node information
26159 void GossipTimestampFilter_set_chain_hash(struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
26162 * The starting unix timestamp
26164 uint32_t GossipTimestampFilter_get_first_timestamp(const struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr);
26167 * The starting unix timestamp
26169 void GossipTimestampFilter_set_first_timestamp(struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr, uint32_t val);
26172 * The range of information in seconds
26174 uint32_t GossipTimestampFilter_get_timestamp_range(const struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr);
26177 * The range of information in seconds
26179 void GossipTimestampFilter_set_timestamp_range(struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr, uint32_t val);
26182 * Constructs a new GossipTimestampFilter given each field
26184 MUST_USE_RES struct LDKGossipTimestampFilter GossipTimestampFilter_new(struct LDKThirtyTwoBytes chain_hash_arg, uint32_t first_timestamp_arg, uint32_t timestamp_range_arg);
26187 * Creates a copy of the GossipTimestampFilter
26189 struct LDKGossipTimestampFilter GossipTimestampFilter_clone(const struct LDKGossipTimestampFilter *NONNULL_PTR orig);
26192 * Checks if two GossipTimestampFilters contain equal inner contents.
26193 * This ignores pointers and is_owned flags and looks at the values in fields.
26194 * Two objects with NULL inner values will be considered "equal" here.
26196 bool GossipTimestampFilter_eq(const struct LDKGossipTimestampFilter *NONNULL_PTR a, const struct LDKGossipTimestampFilter *NONNULL_PTR b);
26199 * Frees any resources used by the ErrorAction
26201 void ErrorAction_free(struct LDKErrorAction this_ptr);
26204 * Creates a copy of the ErrorAction
26206 struct LDKErrorAction ErrorAction_clone(const struct LDKErrorAction *NONNULL_PTR orig);
26209 * Utility method to constructs a new DisconnectPeer-variant ErrorAction
26211 struct LDKErrorAction ErrorAction_disconnect_peer(struct LDKErrorMessage msg);
26214 * Utility method to constructs a new IgnoreError-variant ErrorAction
26216 struct LDKErrorAction ErrorAction_ignore_error(void);
26219 * Utility method to constructs a new IgnoreAndLog-variant ErrorAction
26221 struct LDKErrorAction ErrorAction_ignore_and_log(enum LDKLevel a);
26224 * Utility method to constructs a new IgnoreDuplicateGossip-variant ErrorAction
26226 struct LDKErrorAction ErrorAction_ignore_duplicate_gossip(void);
26229 * Utility method to constructs a new SendErrorMessage-variant ErrorAction
26231 struct LDKErrorAction ErrorAction_send_error_message(struct LDKErrorMessage msg);
26234 * Utility method to constructs a new SendWarningMessage-variant ErrorAction
26236 struct LDKErrorAction ErrorAction_send_warning_message(struct LDKWarningMessage msg, enum LDKLevel log_level);
26239 * Frees any resources used by the LightningError, if is_owned is set and inner is non-NULL.
26241 void LightningError_free(struct LDKLightningError this_obj);
26244 * A human-readable message describing the error
26246 struct LDKStr LightningError_get_err(const struct LDKLightningError *NONNULL_PTR this_ptr);
26249 * A human-readable message describing the error
26251 void LightningError_set_err(struct LDKLightningError *NONNULL_PTR this_ptr, struct LDKStr val);
26254 * The action which should be taken against the offending peer.
26256 struct LDKErrorAction LightningError_get_action(const struct LDKLightningError *NONNULL_PTR this_ptr);
26259 * The action which should be taken against the offending peer.
26261 void LightningError_set_action(struct LDKLightningError *NONNULL_PTR this_ptr, struct LDKErrorAction val);
26264 * Constructs a new LightningError given each field
26266 MUST_USE_RES struct LDKLightningError LightningError_new(struct LDKStr err_arg, struct LDKErrorAction action_arg);
26269 * Creates a copy of the LightningError
26271 struct LDKLightningError LightningError_clone(const struct LDKLightningError *NONNULL_PTR orig);
26274 * Frees any resources used by the CommitmentUpdate, if is_owned is set and inner is non-NULL.
26276 void CommitmentUpdate_free(struct LDKCommitmentUpdate this_obj);
26279 * update_add_htlc messages which should be sent
26281 struct LDKCVec_UpdateAddHTLCZ CommitmentUpdate_get_update_add_htlcs(const struct LDKCommitmentUpdate *NONNULL_PTR this_ptr);
26284 * update_add_htlc messages which should be sent
26286 void CommitmentUpdate_set_update_add_htlcs(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKCVec_UpdateAddHTLCZ val);
26289 * update_fulfill_htlc messages which should be sent
26291 struct LDKCVec_UpdateFulfillHTLCZ CommitmentUpdate_get_update_fulfill_htlcs(const struct LDKCommitmentUpdate *NONNULL_PTR this_ptr);
26294 * update_fulfill_htlc messages which should be sent
26296 void CommitmentUpdate_set_update_fulfill_htlcs(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKCVec_UpdateFulfillHTLCZ val);
26299 * update_fail_htlc messages which should be sent
26301 struct LDKCVec_UpdateFailHTLCZ CommitmentUpdate_get_update_fail_htlcs(const struct LDKCommitmentUpdate *NONNULL_PTR this_ptr);
26304 * update_fail_htlc messages which should be sent
26306 void CommitmentUpdate_set_update_fail_htlcs(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKCVec_UpdateFailHTLCZ val);
26309 * update_fail_malformed_htlc messages which should be sent
26311 struct LDKCVec_UpdateFailMalformedHTLCZ CommitmentUpdate_get_update_fail_malformed_htlcs(const struct LDKCommitmentUpdate *NONNULL_PTR this_ptr);
26314 * update_fail_malformed_htlc messages which should be sent
26316 void CommitmentUpdate_set_update_fail_malformed_htlcs(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKCVec_UpdateFailMalformedHTLCZ val);
26319 * An update_fee message which should be sent
26321 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
26323 struct LDKUpdateFee CommitmentUpdate_get_update_fee(const struct LDKCommitmentUpdate *NONNULL_PTR this_ptr);
26326 * An update_fee message which should be sent
26328 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
26330 void CommitmentUpdate_set_update_fee(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKUpdateFee val);
26333 * Finally, the commitment_signed message which should be sent
26335 struct LDKCommitmentSigned CommitmentUpdate_get_commitment_signed(const struct LDKCommitmentUpdate *NONNULL_PTR this_ptr);
26338 * Finally, the commitment_signed message which should be sent
26340 void CommitmentUpdate_set_commitment_signed(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKCommitmentSigned val);
26343 * Constructs a new CommitmentUpdate given each field
26345 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);
26348 * Creates a copy of the CommitmentUpdate
26350 struct LDKCommitmentUpdate CommitmentUpdate_clone(const struct LDKCommitmentUpdate *NONNULL_PTR orig);
26353 * Checks if two CommitmentUpdates contain equal inner contents.
26354 * This ignores pointers and is_owned flags and looks at the values in fields.
26355 * Two objects with NULL inner values will be considered "equal" here.
26357 bool CommitmentUpdate_eq(const struct LDKCommitmentUpdate *NONNULL_PTR a, const struct LDKCommitmentUpdate *NONNULL_PTR b);
26360 * Calls the free function if one is set
26362 void ChannelMessageHandler_free(struct LDKChannelMessageHandler this_ptr);
26365 * Calls the free function if one is set
26367 void RoutingMessageHandler_free(struct LDKRoutingMessageHandler this_ptr);
26370 * Calls the free function if one is set
26372 void OnionMessageHandler_free(struct LDKOnionMessageHandler this_ptr);
26375 * Serialize the AcceptChannel object into a byte array which can be read by AcceptChannel_read
26377 struct LDKCVec_u8Z AcceptChannel_write(const struct LDKAcceptChannel *NONNULL_PTR obj);
26380 * Read a AcceptChannel from a byte array, created by AcceptChannel_write
26382 struct LDKCResult_AcceptChannelDecodeErrorZ AcceptChannel_read(struct LDKu8slice ser);
26385 * Serialize the AnnouncementSignatures object into a byte array which can be read by AnnouncementSignatures_read
26387 struct LDKCVec_u8Z AnnouncementSignatures_write(const struct LDKAnnouncementSignatures *NONNULL_PTR obj);
26390 * Read a AnnouncementSignatures from a byte array, created by AnnouncementSignatures_write
26392 struct LDKCResult_AnnouncementSignaturesDecodeErrorZ AnnouncementSignatures_read(struct LDKu8slice ser);
26395 * Serialize the ChannelReestablish object into a byte array which can be read by ChannelReestablish_read
26397 struct LDKCVec_u8Z ChannelReestablish_write(const struct LDKChannelReestablish *NONNULL_PTR obj);
26400 * Read a ChannelReestablish from a byte array, created by ChannelReestablish_write
26402 struct LDKCResult_ChannelReestablishDecodeErrorZ ChannelReestablish_read(struct LDKu8slice ser);
26405 * Serialize the ClosingSigned object into a byte array which can be read by ClosingSigned_read
26407 struct LDKCVec_u8Z ClosingSigned_write(const struct LDKClosingSigned *NONNULL_PTR obj);
26410 * Read a ClosingSigned from a byte array, created by ClosingSigned_write
26412 struct LDKCResult_ClosingSignedDecodeErrorZ ClosingSigned_read(struct LDKu8slice ser);
26415 * Serialize the ClosingSignedFeeRange object into a byte array which can be read by ClosingSignedFeeRange_read
26417 struct LDKCVec_u8Z ClosingSignedFeeRange_write(const struct LDKClosingSignedFeeRange *NONNULL_PTR obj);
26420 * Read a ClosingSignedFeeRange from a byte array, created by ClosingSignedFeeRange_write
26422 struct LDKCResult_ClosingSignedFeeRangeDecodeErrorZ ClosingSignedFeeRange_read(struct LDKu8slice ser);
26425 * Serialize the CommitmentSigned object into a byte array which can be read by CommitmentSigned_read
26427 struct LDKCVec_u8Z CommitmentSigned_write(const struct LDKCommitmentSigned *NONNULL_PTR obj);
26430 * Read a CommitmentSigned from a byte array, created by CommitmentSigned_write
26432 struct LDKCResult_CommitmentSignedDecodeErrorZ CommitmentSigned_read(struct LDKu8slice ser);
26435 * Serialize the FundingCreated object into a byte array which can be read by FundingCreated_read
26437 struct LDKCVec_u8Z FundingCreated_write(const struct LDKFundingCreated *NONNULL_PTR obj);
26440 * Read a FundingCreated from a byte array, created by FundingCreated_write
26442 struct LDKCResult_FundingCreatedDecodeErrorZ FundingCreated_read(struct LDKu8slice ser);
26445 * Serialize the FundingSigned object into a byte array which can be read by FundingSigned_read
26447 struct LDKCVec_u8Z FundingSigned_write(const struct LDKFundingSigned *NONNULL_PTR obj);
26450 * Read a FundingSigned from a byte array, created by FundingSigned_write
26452 struct LDKCResult_FundingSignedDecodeErrorZ FundingSigned_read(struct LDKu8slice ser);
26455 * Serialize the ChannelReady object into a byte array which can be read by ChannelReady_read
26457 struct LDKCVec_u8Z ChannelReady_write(const struct LDKChannelReady *NONNULL_PTR obj);
26460 * Read a ChannelReady from a byte array, created by ChannelReady_write
26462 struct LDKCResult_ChannelReadyDecodeErrorZ ChannelReady_read(struct LDKu8slice ser);
26465 * Serialize the Init object into a byte array which can be read by Init_read
26467 struct LDKCVec_u8Z Init_write(const struct LDKInit *NONNULL_PTR obj);
26470 * Read a Init from a byte array, created by Init_write
26472 struct LDKCResult_InitDecodeErrorZ Init_read(struct LDKu8slice ser);
26475 * Serialize the OpenChannel object into a byte array which can be read by OpenChannel_read
26477 struct LDKCVec_u8Z OpenChannel_write(const struct LDKOpenChannel *NONNULL_PTR obj);
26480 * Read a OpenChannel from a byte array, created by OpenChannel_write
26482 struct LDKCResult_OpenChannelDecodeErrorZ OpenChannel_read(struct LDKu8slice ser);
26485 * Serialize the RevokeAndACK object into a byte array which can be read by RevokeAndACK_read
26487 struct LDKCVec_u8Z RevokeAndACK_write(const struct LDKRevokeAndACK *NONNULL_PTR obj);
26490 * Read a RevokeAndACK from a byte array, created by RevokeAndACK_write
26492 struct LDKCResult_RevokeAndACKDecodeErrorZ RevokeAndACK_read(struct LDKu8slice ser);
26495 * Serialize the Shutdown object into a byte array which can be read by Shutdown_read
26497 struct LDKCVec_u8Z Shutdown_write(const struct LDKShutdown *NONNULL_PTR obj);
26500 * Read a Shutdown from a byte array, created by Shutdown_write
26502 struct LDKCResult_ShutdownDecodeErrorZ Shutdown_read(struct LDKu8slice ser);
26505 * Serialize the UpdateFailHTLC object into a byte array which can be read by UpdateFailHTLC_read
26507 struct LDKCVec_u8Z UpdateFailHTLC_write(const struct LDKUpdateFailHTLC *NONNULL_PTR obj);
26510 * Read a UpdateFailHTLC from a byte array, created by UpdateFailHTLC_write
26512 struct LDKCResult_UpdateFailHTLCDecodeErrorZ UpdateFailHTLC_read(struct LDKu8slice ser);
26515 * Serialize the UpdateFailMalformedHTLC object into a byte array which can be read by UpdateFailMalformedHTLC_read
26517 struct LDKCVec_u8Z UpdateFailMalformedHTLC_write(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR obj);
26520 * Read a UpdateFailMalformedHTLC from a byte array, created by UpdateFailMalformedHTLC_write
26522 struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ UpdateFailMalformedHTLC_read(struct LDKu8slice ser);
26525 * Serialize the UpdateFee object into a byte array which can be read by UpdateFee_read
26527 struct LDKCVec_u8Z UpdateFee_write(const struct LDKUpdateFee *NONNULL_PTR obj);
26530 * Read a UpdateFee from a byte array, created by UpdateFee_write
26532 struct LDKCResult_UpdateFeeDecodeErrorZ UpdateFee_read(struct LDKu8slice ser);
26535 * Serialize the UpdateFulfillHTLC object into a byte array which can be read by UpdateFulfillHTLC_read
26537 struct LDKCVec_u8Z UpdateFulfillHTLC_write(const struct LDKUpdateFulfillHTLC *NONNULL_PTR obj);
26540 * Read a UpdateFulfillHTLC from a byte array, created by UpdateFulfillHTLC_write
26542 struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ UpdateFulfillHTLC_read(struct LDKu8slice ser);
26545 * Serialize the UpdateAddHTLC object into a byte array which can be read by UpdateAddHTLC_read
26547 struct LDKCVec_u8Z UpdateAddHTLC_write(const struct LDKUpdateAddHTLC *NONNULL_PTR obj);
26550 * Read a UpdateAddHTLC from a byte array, created by UpdateAddHTLC_write
26552 struct LDKCResult_UpdateAddHTLCDecodeErrorZ UpdateAddHTLC_read(struct LDKu8slice ser);
26555 * Read a OnionMessage from a byte array, created by OnionMessage_write
26557 struct LDKCResult_OnionMessageDecodeErrorZ OnionMessage_read(struct LDKu8slice ser);
26560 * Serialize the OnionMessage object into a byte array which can be read by OnionMessage_read
26562 struct LDKCVec_u8Z OnionMessage_write(const struct LDKOnionMessage *NONNULL_PTR obj);
26565 * Serialize the Ping object into a byte array which can be read by Ping_read
26567 struct LDKCVec_u8Z Ping_write(const struct LDKPing *NONNULL_PTR obj);
26570 * Read a Ping from a byte array, created by Ping_write
26572 struct LDKCResult_PingDecodeErrorZ Ping_read(struct LDKu8slice ser);
26575 * Serialize the Pong object into a byte array which can be read by Pong_read
26577 struct LDKCVec_u8Z Pong_write(const struct LDKPong *NONNULL_PTR obj);
26580 * Read a Pong from a byte array, created by Pong_write
26582 struct LDKCResult_PongDecodeErrorZ Pong_read(struct LDKu8slice ser);
26585 * Serialize the UnsignedChannelAnnouncement object into a byte array which can be read by UnsignedChannelAnnouncement_read
26587 struct LDKCVec_u8Z UnsignedChannelAnnouncement_write(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR obj);
26590 * Read a UnsignedChannelAnnouncement from a byte array, created by UnsignedChannelAnnouncement_write
26592 struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ UnsignedChannelAnnouncement_read(struct LDKu8slice ser);
26595 * Serialize the ChannelAnnouncement object into a byte array which can be read by ChannelAnnouncement_read
26597 struct LDKCVec_u8Z ChannelAnnouncement_write(const struct LDKChannelAnnouncement *NONNULL_PTR obj);
26600 * Read a ChannelAnnouncement from a byte array, created by ChannelAnnouncement_write
26602 struct LDKCResult_ChannelAnnouncementDecodeErrorZ ChannelAnnouncement_read(struct LDKu8slice ser);
26605 * Serialize the UnsignedChannelUpdate object into a byte array which can be read by UnsignedChannelUpdate_read
26607 struct LDKCVec_u8Z UnsignedChannelUpdate_write(const struct LDKUnsignedChannelUpdate *NONNULL_PTR obj);
26610 * Read a UnsignedChannelUpdate from a byte array, created by UnsignedChannelUpdate_write
26612 struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ UnsignedChannelUpdate_read(struct LDKu8slice ser);
26615 * Serialize the ChannelUpdate object into a byte array which can be read by ChannelUpdate_read
26617 struct LDKCVec_u8Z ChannelUpdate_write(const struct LDKChannelUpdate *NONNULL_PTR obj);
26620 * Read a ChannelUpdate from a byte array, created by ChannelUpdate_write
26622 struct LDKCResult_ChannelUpdateDecodeErrorZ ChannelUpdate_read(struct LDKu8slice ser);
26625 * Serialize the ErrorMessage object into a byte array which can be read by ErrorMessage_read
26627 struct LDKCVec_u8Z ErrorMessage_write(const struct LDKErrorMessage *NONNULL_PTR obj);
26630 * Read a ErrorMessage from a byte array, created by ErrorMessage_write
26632 struct LDKCResult_ErrorMessageDecodeErrorZ ErrorMessage_read(struct LDKu8slice ser);
26635 * Serialize the WarningMessage object into a byte array which can be read by WarningMessage_read
26637 struct LDKCVec_u8Z WarningMessage_write(const struct LDKWarningMessage *NONNULL_PTR obj);
26640 * Read a WarningMessage from a byte array, created by WarningMessage_write
26642 struct LDKCResult_WarningMessageDecodeErrorZ WarningMessage_read(struct LDKu8slice ser);
26645 * Serialize the UnsignedNodeAnnouncement object into a byte array which can be read by UnsignedNodeAnnouncement_read
26647 struct LDKCVec_u8Z UnsignedNodeAnnouncement_write(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR obj);
26650 * Read a UnsignedNodeAnnouncement from a byte array, created by UnsignedNodeAnnouncement_write
26652 struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ UnsignedNodeAnnouncement_read(struct LDKu8slice ser);
26655 * Serialize the NodeAnnouncement object into a byte array which can be read by NodeAnnouncement_read
26657 struct LDKCVec_u8Z NodeAnnouncement_write(const struct LDKNodeAnnouncement *NONNULL_PTR obj);
26660 * Read a NodeAnnouncement from a byte array, created by NodeAnnouncement_write
26662 struct LDKCResult_NodeAnnouncementDecodeErrorZ NodeAnnouncement_read(struct LDKu8slice ser);
26665 * Read a QueryShortChannelIds from a byte array, created by QueryShortChannelIds_write
26667 struct LDKCResult_QueryShortChannelIdsDecodeErrorZ QueryShortChannelIds_read(struct LDKu8slice ser);
26670 * Serialize the QueryShortChannelIds object into a byte array which can be read by QueryShortChannelIds_read
26672 struct LDKCVec_u8Z QueryShortChannelIds_write(const struct LDKQueryShortChannelIds *NONNULL_PTR obj);
26675 * Serialize the ReplyShortChannelIdsEnd object into a byte array which can be read by ReplyShortChannelIdsEnd_read
26677 struct LDKCVec_u8Z ReplyShortChannelIdsEnd_write(const struct LDKReplyShortChannelIdsEnd *NONNULL_PTR obj);
26680 * Read a ReplyShortChannelIdsEnd from a byte array, created by ReplyShortChannelIdsEnd_write
26682 struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ ReplyShortChannelIdsEnd_read(struct LDKu8slice ser);
26685 *\n\t * Calculates the overflow safe ending block height for the query.\n\t * Overflow returns `0xffffffff`, otherwise returns `first_blocknum + number_of_blocks`\n\t
26687 MUST_USE_RES uint32_t QueryChannelRange_end_blocknum(const struct LDKQueryChannelRange *NONNULL_PTR this_arg);
26690 * Serialize the QueryChannelRange object into a byte array which can be read by QueryChannelRange_read
26692 struct LDKCVec_u8Z QueryChannelRange_write(const struct LDKQueryChannelRange *NONNULL_PTR obj);
26695 * Read a QueryChannelRange from a byte array, created by QueryChannelRange_write
26697 struct LDKCResult_QueryChannelRangeDecodeErrorZ QueryChannelRange_read(struct LDKu8slice ser);
26700 * Read a ReplyChannelRange from a byte array, created by ReplyChannelRange_write
26702 struct LDKCResult_ReplyChannelRangeDecodeErrorZ ReplyChannelRange_read(struct LDKu8slice ser);
26705 * Serialize the ReplyChannelRange object into a byte array which can be read by ReplyChannelRange_read
26707 struct LDKCVec_u8Z ReplyChannelRange_write(const struct LDKReplyChannelRange *NONNULL_PTR obj);
26710 * Serialize the GossipTimestampFilter object into a byte array which can be read by GossipTimestampFilter_read
26712 struct LDKCVec_u8Z GossipTimestampFilter_write(const struct LDKGossipTimestampFilter *NONNULL_PTR obj);
26715 * Read a GossipTimestampFilter from a byte array, created by GossipTimestampFilter_write
26717 struct LDKCResult_GossipTimestampFilterDecodeErrorZ GossipTimestampFilter_read(struct LDKu8slice ser);
26720 * Calls the free function if one is set
26722 void CustomMessageHandler_free(struct LDKCustomMessageHandler this_ptr);
26725 * Frees any resources used by the IgnoringMessageHandler, if is_owned is set and inner is non-NULL.
26727 void IgnoringMessageHandler_free(struct LDKIgnoringMessageHandler this_obj);
26730 * Constructs a new IgnoringMessageHandler given each field
26732 MUST_USE_RES struct LDKIgnoringMessageHandler IgnoringMessageHandler_new(void);
26735 * Constructs a new MessageSendEventsProvider which calls the relevant methods on this_arg.
26736 * This copies the `inner` pointer in this_arg and thus the returned MessageSendEventsProvider must be freed before this_arg is
26738 struct LDKMessageSendEventsProvider IgnoringMessageHandler_as_MessageSendEventsProvider(const struct LDKIgnoringMessageHandler *NONNULL_PTR this_arg);
26741 * Constructs a new RoutingMessageHandler which calls the relevant methods on this_arg.
26742 * This copies the `inner` pointer in this_arg and thus the returned RoutingMessageHandler must be freed before this_arg is
26744 struct LDKRoutingMessageHandler IgnoringMessageHandler_as_RoutingMessageHandler(const struct LDKIgnoringMessageHandler *NONNULL_PTR this_arg);
26747 * Constructs a new OnionMessageProvider which calls the relevant methods on this_arg.
26748 * This copies the `inner` pointer in this_arg and thus the returned OnionMessageProvider must be freed before this_arg is
26750 struct LDKOnionMessageProvider IgnoringMessageHandler_as_OnionMessageProvider(const struct LDKIgnoringMessageHandler *NONNULL_PTR this_arg);
26753 * Constructs a new OnionMessageHandler which calls the relevant methods on this_arg.
26754 * This copies the `inner` pointer in this_arg and thus the returned OnionMessageHandler must be freed before this_arg is
26756 struct LDKOnionMessageHandler IgnoringMessageHandler_as_OnionMessageHandler(const struct LDKIgnoringMessageHandler *NONNULL_PTR this_arg);
26759 * Constructs a new CustomOnionMessageHandler which calls the relevant methods on this_arg.
26760 * This copies the `inner` pointer in this_arg and thus the returned CustomOnionMessageHandler must be freed before this_arg is
26762 struct LDKCustomOnionMessageHandler IgnoringMessageHandler_as_CustomOnionMessageHandler(const struct LDKIgnoringMessageHandler *NONNULL_PTR this_arg);
26765 * Constructs a new CustomMessageReader which calls the relevant methods on this_arg.
26766 * This copies the `inner` pointer in this_arg and thus the returned CustomMessageReader must be freed before this_arg is
26768 struct LDKCustomMessageReader IgnoringMessageHandler_as_CustomMessageReader(const struct LDKIgnoringMessageHandler *NONNULL_PTR this_arg);
26771 * Constructs a new CustomMessageHandler which calls the relevant methods on this_arg.
26772 * This copies the `inner` pointer in this_arg and thus the returned CustomMessageHandler must be freed before this_arg is
26774 struct LDKCustomMessageHandler IgnoringMessageHandler_as_CustomMessageHandler(const struct LDKIgnoringMessageHandler *NONNULL_PTR this_arg);
26777 * Frees any resources used by the ErroringMessageHandler, if is_owned is set and inner is non-NULL.
26779 void ErroringMessageHandler_free(struct LDKErroringMessageHandler this_obj);
26782 * Constructs a new ErroringMessageHandler
26784 MUST_USE_RES struct LDKErroringMessageHandler ErroringMessageHandler_new(void);
26787 * Constructs a new MessageSendEventsProvider which calls the relevant methods on this_arg.
26788 * This copies the `inner` pointer in this_arg and thus the returned MessageSendEventsProvider must be freed before this_arg is
26790 struct LDKMessageSendEventsProvider ErroringMessageHandler_as_MessageSendEventsProvider(const struct LDKErroringMessageHandler *NONNULL_PTR this_arg);
26793 * Constructs a new ChannelMessageHandler which calls the relevant methods on this_arg.
26794 * This copies the `inner` pointer in this_arg and thus the returned ChannelMessageHandler must be freed before this_arg is
26796 struct LDKChannelMessageHandler ErroringMessageHandler_as_ChannelMessageHandler(const struct LDKErroringMessageHandler *NONNULL_PTR this_arg);
26799 * Frees any resources used by the MessageHandler, if is_owned is set and inner is non-NULL.
26801 void MessageHandler_free(struct LDKMessageHandler this_obj);
26804 * A message handler which handles messages specific to channels. Usually this is just a
26805 * [`ChannelManager`] object or an [`ErroringMessageHandler`].
26807 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
26809 const struct LDKChannelMessageHandler *MessageHandler_get_chan_handler(const struct LDKMessageHandler *NONNULL_PTR this_ptr);
26812 * A message handler which handles messages specific to channels. Usually this is just a
26813 * [`ChannelManager`] object or an [`ErroringMessageHandler`].
26815 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
26817 void MessageHandler_set_chan_handler(struct LDKMessageHandler *NONNULL_PTR this_ptr, struct LDKChannelMessageHandler val);
26820 * A message handler which handles messages updating our knowledge of the network channel
26821 * graph. Usually this is just a [`P2PGossipSync`] object or an [`IgnoringMessageHandler`].
26823 * [`P2PGossipSync`]: crate::routing::gossip::P2PGossipSync
26825 const struct LDKRoutingMessageHandler *MessageHandler_get_route_handler(const struct LDKMessageHandler *NONNULL_PTR this_ptr);
26828 * A message handler which handles messages updating our knowledge of the network channel
26829 * graph. Usually this is just a [`P2PGossipSync`] object or an [`IgnoringMessageHandler`].
26831 * [`P2PGossipSync`]: crate::routing::gossip::P2PGossipSync
26833 void MessageHandler_set_route_handler(struct LDKMessageHandler *NONNULL_PTR this_ptr, struct LDKRoutingMessageHandler val);
26836 * A message handler which handles onion messages. For now, this can only be an
26837 * [`IgnoringMessageHandler`].
26839 const struct LDKOnionMessageHandler *MessageHandler_get_onion_message_handler(const struct LDKMessageHandler *NONNULL_PTR this_ptr);
26842 * A message handler which handles onion messages. For now, this can only be an
26843 * [`IgnoringMessageHandler`].
26845 void MessageHandler_set_onion_message_handler(struct LDKMessageHandler *NONNULL_PTR this_ptr, struct LDKOnionMessageHandler val);
26848 * Constructs a new MessageHandler given each field
26850 MUST_USE_RES struct LDKMessageHandler MessageHandler_new(struct LDKChannelMessageHandler chan_handler_arg, struct LDKRoutingMessageHandler route_handler_arg, struct LDKOnionMessageHandler onion_message_handler_arg);
26853 * Creates a copy of a SocketDescriptor
26855 struct LDKSocketDescriptor SocketDescriptor_clone(const struct LDKSocketDescriptor *NONNULL_PTR orig);
26858 * Calls the free function if one is set
26860 void SocketDescriptor_free(struct LDKSocketDescriptor this_ptr);
26863 * Frees any resources used by the PeerHandleError, if is_owned is set and inner is non-NULL.
26865 void PeerHandleError_free(struct LDKPeerHandleError this_obj);
26868 * Used to indicate that we probably can't make any future connections to this peer (e.g.
26869 * because we required features that our peer was missing, or vice versa).
26871 * While LDK's [`ChannelManager`] will not do it automatically, you likely wish to force-close
26872 * any channels with this peer or check for new versions of LDK.
26874 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
26876 bool PeerHandleError_get_no_connection_possible(const struct LDKPeerHandleError *NONNULL_PTR this_ptr);
26879 * Used to indicate that we probably can't make any future connections to this peer (e.g.
26880 * because we required features that our peer was missing, or vice versa).
26882 * While LDK's [`ChannelManager`] will not do it automatically, you likely wish to force-close
26883 * any channels with this peer or check for new versions of LDK.
26885 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
26887 void PeerHandleError_set_no_connection_possible(struct LDKPeerHandleError *NONNULL_PTR this_ptr, bool val);
26890 * Constructs a new PeerHandleError given each field
26892 MUST_USE_RES struct LDKPeerHandleError PeerHandleError_new(bool no_connection_possible_arg);
26895 * Creates a copy of the PeerHandleError
26897 struct LDKPeerHandleError PeerHandleError_clone(const struct LDKPeerHandleError *NONNULL_PTR orig);
26900 * Frees any resources used by the PeerManager, if is_owned is set and inner is non-NULL.
26902 void PeerManager_free(struct LDKPeerManager this_obj);
26905 * Constructs a new PeerManager with the given message handlers and node_id secret key
26906 * ephemeral_random_data is used to derive per-connection ephemeral keys and must be
26907 * cryptographically secure random bytes.
26909 * `current_time` is used as an always-increasing counter that survives across restarts and is
26910 * incremented irregularly internally. In general it is best to simply use the current UNIX
26911 * timestamp, however if it is not available a persistent counter that increases once per
26912 * minute should suffice.
26914 MUST_USE_RES struct LDKPeerManager PeerManager_new(struct LDKMessageHandler message_handler, struct LDKSecretKey our_node_secret, uint32_t current_time, const uint8_t (*ephemeral_random_data)[32], struct LDKLogger logger, struct LDKCustomMessageHandler custom_message_handler);
26917 * Get the list of node ids for peers which have completed the initial handshake.
26919 * For outbound connections, this will be the same as the their_node_id parameter passed in to
26920 * new_outbound_connection, however entries will only appear once the initial handshake has
26921 * completed and we are sure the remote peer has the private key for the given node_id.
26923 MUST_USE_RES struct LDKCVec_PublicKeyZ PeerManager_get_peer_node_ids(const struct LDKPeerManager *NONNULL_PTR this_arg);
26926 * Indicates a new outbound connection has been established to a node with the given node_id
26927 * and an optional remote network address.
26929 * The remote network address adds the option to report a remote IP address back to a connecting
26930 * peer using the init message.
26931 * The user should pass the remote network address of the host they are connected to.
26933 * If an `Err` is returned here you must disconnect the connection immediately.
26935 * Returns a small number of bytes to send to the remote node (currently always 50).
26937 * Panics if descriptor is duplicative with some other descriptor which has not yet been
26938 * [`socket_disconnected()`].
26940 * [`socket_disconnected()`]: PeerManager::socket_disconnected
26942 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_NetAddressZ remote_network_address);
26945 * Indicates a new inbound connection has been established to a node with an optional remote
26948 * The remote network address adds the option to report a remote IP address back to a connecting
26949 * peer using the init message.
26950 * The user should pass the remote network address of the host they are connected to.
26952 * May refuse the connection by returning an Err, but will never write bytes to the remote end
26953 * (outbound connector always speaks first). If an `Err` is returned here you must disconnect
26954 * the connection immediately.
26956 * Panics if descriptor is duplicative with some other descriptor which has not yet been
26957 * [`socket_disconnected()`].
26959 * [`socket_disconnected()`]: PeerManager::socket_disconnected
26961 MUST_USE_RES struct LDKCResult_NonePeerHandleErrorZ PeerManager_new_inbound_connection(const struct LDKPeerManager *NONNULL_PTR this_arg, struct LDKSocketDescriptor descriptor, struct LDKCOption_NetAddressZ remote_network_address);
26964 * Indicates that there is room to write data to the given socket descriptor.
26966 * May return an Err to indicate that the connection should be closed.
26968 * May call [`send_data`] on the descriptor passed in (or an equal descriptor) before
26969 * returning. Thus, be very careful with reentrancy issues! The invariants around calling
26970 * [`write_buffer_space_avail`] in case a write did not fully complete must still hold - be
26971 * ready to call `[write_buffer_space_avail`] again if a write call generated here isn't
26974 * [`send_data`]: SocketDescriptor::send_data
26975 * [`write_buffer_space_avail`]: PeerManager::write_buffer_space_avail
26977 MUST_USE_RES struct LDKCResult_NonePeerHandleErrorZ PeerManager_write_buffer_space_avail(const struct LDKPeerManager *NONNULL_PTR this_arg, struct LDKSocketDescriptor *NONNULL_PTR descriptor);
26980 * Indicates that data was read from the given socket descriptor.
26982 * May return an Err to indicate that the connection should be closed.
26984 * Will *not* call back into [`send_data`] on any descriptors to avoid reentrancy complexity.
26985 * Thus, however, you should call [`process_events`] after any `read_event` to generate
26986 * [`send_data`] calls to handle responses.
26988 * If `Ok(true)` is returned, further read_events should not be triggered until a
26989 * [`send_data`] call on this descriptor has `resume_read` set (preventing DoS issues in the
26992 * [`send_data`]: SocketDescriptor::send_data
26993 * [`process_events`]: PeerManager::process_events
26995 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);
26998 * Checks for any events generated by our handlers and processes them. Includes sending most
26999 * response messages as well as messages generated by calls to handler functions directly (eg
27000 * functions like [`ChannelManager::process_pending_htlc_forwards`] or [`send_payment`]).
27002 * May call [`send_data`] on [`SocketDescriptor`]s. Thus, be very careful with reentrancy
27005 * You don't have to call this function explicitly if you are using [`lightning-net-tokio`]
27006 * or one of the other clients provided in our language bindings.
27008 * Note that if there are any other calls to this function waiting on lock(s) this may return
27009 * without doing any work. All available events that need handling will be handled before the
27010 * other calls return.
27012 * [`send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
27013 * [`ChannelManager::process_pending_htlc_forwards`]: crate::ln::channelmanager::ChannelManager::process_pending_htlc_forwards
27014 * [`send_data`]: SocketDescriptor::send_data
27016 void PeerManager_process_events(const struct LDKPeerManager *NONNULL_PTR this_arg);
27019 * Indicates that the given socket descriptor's connection is now closed.
27021 void PeerManager_socket_disconnected(const struct LDKPeerManager *NONNULL_PTR this_arg, const struct LDKSocketDescriptor *NONNULL_PTR descriptor);
27024 * Disconnect a peer given its node id.
27026 * Set `no_connection_possible` to true to prevent any further connection with this peer,
27027 * force-closing any channels we have with it.
27029 * If a peer is connected, this will call [`disconnect_socket`] on the descriptor for the
27030 * peer. Thus, be very careful about reentrancy issues.
27032 * [`disconnect_socket`]: SocketDescriptor::disconnect_socket
27034 void PeerManager_disconnect_by_node_id(const struct LDKPeerManager *NONNULL_PTR this_arg, struct LDKPublicKey node_id, bool no_connection_possible);
27037 * Disconnects all currently-connected peers. This is useful on platforms where there may be
27038 * an indication that TCP sockets have stalled even if we weren't around to time them out
27039 * using regular ping/pongs.
27041 void PeerManager_disconnect_all_peers(const struct LDKPeerManager *NONNULL_PTR this_arg);
27044 * Send pings to each peer and disconnect those which did not respond to the last round of
27047 * This may be called on any timescale you want, however, roughly once every ten seconds is
27048 * preferred. The call rate determines both how often we send a ping to our peers and how much
27049 * time they have to respond before we disconnect them.
27051 * May call [`send_data`] on all [`SocketDescriptor`]s. Thus, be very careful with reentrancy
27054 * [`send_data`]: SocketDescriptor::send_data
27056 void PeerManager_timer_tick_occurred(const struct LDKPeerManager *NONNULL_PTR this_arg);
27059 * Generates a signed node_announcement from the given arguments, sending it to all connected
27060 * peers. Note that peers will likely ignore this message unless we have at least one public
27061 * channel which has at least six confirmations on-chain.
27063 * `rgb` is a node \"color\" and `alias` is a printable human-readable string to describe this
27064 * node to humans. They carry no in-protocol meaning.
27066 * `addresses` represent the set (possibly empty) of socket addresses on which this node
27067 * accepts incoming connections. These will be included in the node_announcement, publicly
27068 * tying these addresses together and to this node. If you wish to preserve user privacy,
27069 * addresses should likely contain only Tor Onion addresses.
27071 * Panics if `addresses` is absurdly large (more than 100).
27073 * [`get_and_clear_pending_msg_events`]: MessageSendEventsProvider::get_and_clear_pending_msg_events
27075 void PeerManager_broadcast_node_announcement(const struct LDKPeerManager *NONNULL_PTR this_arg, struct LDKThreeBytes rgb, struct LDKThirtyTwoBytes alias, struct LDKCVec_NetAddressZ addresses);
27078 * Gets the weight for an HTLC-Success transaction.
27080 uint64_t htlc_success_tx_weight(bool opt_anchors);
27083 * Gets the weight for an HTLC-Timeout transaction.
27085 uint64_t htlc_timeout_tx_weight(bool opt_anchors);
27088 * Creates a copy of the HTLCClaim
27090 enum LDKHTLCClaim HTLCClaim_clone(const enum LDKHTLCClaim *NONNULL_PTR orig);
27093 * Utility method to constructs a new OfferedTimeout-variant HTLCClaim
27095 enum LDKHTLCClaim HTLCClaim_offered_timeout(void);
27098 * Utility method to constructs a new OfferedPreimage-variant HTLCClaim
27100 enum LDKHTLCClaim HTLCClaim_offered_preimage(void);
27103 * Utility method to constructs a new AcceptedTimeout-variant HTLCClaim
27105 enum LDKHTLCClaim HTLCClaim_accepted_timeout(void);
27108 * Utility method to constructs a new AcceptedPreimage-variant HTLCClaim
27110 enum LDKHTLCClaim HTLCClaim_accepted_preimage(void);
27113 * Utility method to constructs a new Revocation-variant HTLCClaim
27115 enum LDKHTLCClaim HTLCClaim_revocation(void);
27118 * Checks if two HTLCClaims contain equal inner contents.
27119 * This ignores pointers and is_owned flags and looks at the values in fields.
27121 bool HTLCClaim_eq(const enum LDKHTLCClaim *NONNULL_PTR a, const enum LDKHTLCClaim *NONNULL_PTR b);
27124 * Check if a given input witness attempts to claim a HTLC.
27126 MUST_USE_RES struct LDKCOption_HTLCClaimZ HTLCClaim_from_witness(struct LDKWitness witness);
27129 * Build the commitment secret from the seed and the commitment number
27131 struct LDKThirtyTwoBytes build_commitment_secret(const uint8_t (*commitment_seed)[32], uint64_t idx);
27134 * Build a closing transaction
27136 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);
27139 * Frees any resources used by the CounterpartyCommitmentSecrets, if is_owned is set and inner is non-NULL.
27141 void CounterpartyCommitmentSecrets_free(struct LDKCounterpartyCommitmentSecrets this_obj);
27144 * Creates a copy of the CounterpartyCommitmentSecrets
27146 struct LDKCounterpartyCommitmentSecrets CounterpartyCommitmentSecrets_clone(const struct LDKCounterpartyCommitmentSecrets *NONNULL_PTR orig);
27149 * Creates a new empty `CounterpartyCommitmentSecrets` structure.
27151 MUST_USE_RES struct LDKCounterpartyCommitmentSecrets CounterpartyCommitmentSecrets_new(void);
27154 * Returns the minimum index of all stored secrets. Note that indexes start
27155 * at 1 << 48 and get decremented by one for each new secret.
27157 MUST_USE_RES uint64_t CounterpartyCommitmentSecrets_get_min_seen_secret(const struct LDKCounterpartyCommitmentSecrets *NONNULL_PTR this_arg);
27160 * Inserts the `secret` at `idx`. Returns `Ok(())` if the secret
27161 * was generated in accordance with BOLT 3 and is consistent with previous secrets.
27163 MUST_USE_RES struct LDKCResult_NoneNoneZ CounterpartyCommitmentSecrets_provide_secret(struct LDKCounterpartyCommitmentSecrets *NONNULL_PTR this_arg, uint64_t idx, struct LDKThirtyTwoBytes secret);
27166 * Returns the secret at `idx`.
27167 * Returns `None` if `idx` is < [`CounterpartyCommitmentSecrets::get_min_seen_secret`].
27169 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
27171 MUST_USE_RES struct LDKThirtyTwoBytes CounterpartyCommitmentSecrets_get_secret(const struct LDKCounterpartyCommitmentSecrets *NONNULL_PTR this_arg, uint64_t idx);
27174 * Serialize the CounterpartyCommitmentSecrets object into a byte array which can be read by CounterpartyCommitmentSecrets_read
27176 struct LDKCVec_u8Z CounterpartyCommitmentSecrets_write(const struct LDKCounterpartyCommitmentSecrets *NONNULL_PTR obj);
27179 * Read a CounterpartyCommitmentSecrets from a byte array, created by CounterpartyCommitmentSecrets_write
27181 struct LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ CounterpartyCommitmentSecrets_read(struct LDKu8slice ser);
27184 * Derives a per-commitment-transaction private key (eg an htlc key or delayed_payment key)
27185 * from the base secret and the per_commitment_point.
27187 struct LDKSecretKey derive_private_key(struct LDKPublicKey per_commitment_point, const uint8_t (*base_secret)[32]);
27190 * Derives a per-commitment-transaction public key (eg an htlc key or a delayed_payment key)
27191 * from the base point and the per_commitment_key. This is the public equivalent of
27192 * derive_private_key - using only public keys to derive a public key instead of private keys.
27194 struct LDKPublicKey derive_public_key(struct LDKPublicKey per_commitment_point, struct LDKPublicKey base_point);
27197 * Derives a per-commitment-transaction revocation key from its constituent parts.
27199 * Only the cheating participant owns a valid witness to propagate a revoked
27200 * commitment transaction, thus per_commitment_secret always come from cheater
27201 * and revocation_base_secret always come from punisher, which is the broadcaster
27202 * of the transaction spending with this key knowledge.
27204 struct LDKSecretKey derive_private_revocation_key(const uint8_t (*per_commitment_secret)[32], const uint8_t (*countersignatory_revocation_base_secret)[32]);
27207 * Derives a per-commitment-transaction revocation public key from its constituent parts. This is
27208 * the public equivalend of derive_private_revocation_key - using only public keys to derive a
27209 * public key instead of private keys.
27211 * Only the cheating participant owns a valid witness to propagate a revoked
27212 * commitment transaction, thus per_commitment_point always come from cheater
27213 * and revocation_base_point always come from punisher, which is the broadcaster
27214 * of the transaction spending with this key knowledge.
27216 * Note that this is infallible iff we trust that at least one of the two input keys are randomly
27217 * generated (ie our own).
27219 struct LDKPublicKey derive_public_revocation_key(struct LDKPublicKey per_commitment_point, struct LDKPublicKey countersignatory_revocation_base_point);
27222 * Frees any resources used by the TxCreationKeys, if is_owned is set and inner is non-NULL.
27224 void TxCreationKeys_free(struct LDKTxCreationKeys this_obj);
27227 * The broadcaster's per-commitment public key which was used to derive the other keys.
27229 struct LDKPublicKey TxCreationKeys_get_per_commitment_point(const struct LDKTxCreationKeys *NONNULL_PTR this_ptr);
27232 * The broadcaster's per-commitment public key which was used to derive the other keys.
27234 void TxCreationKeys_set_per_commitment_point(struct LDKTxCreationKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
27237 * The revocation key which is used to allow the broadcaster of the commitment
27238 * transaction to provide their counterparty the ability to punish them if they broadcast
27241 struct LDKPublicKey TxCreationKeys_get_revocation_key(const struct LDKTxCreationKeys *NONNULL_PTR this_ptr);
27244 * The revocation key which is used to allow the broadcaster of the commitment
27245 * transaction to provide their counterparty the ability to punish them if they broadcast
27248 void TxCreationKeys_set_revocation_key(struct LDKTxCreationKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
27251 * Broadcaster's HTLC Key
27253 struct LDKPublicKey TxCreationKeys_get_broadcaster_htlc_key(const struct LDKTxCreationKeys *NONNULL_PTR this_ptr);
27256 * Broadcaster's HTLC Key
27258 void TxCreationKeys_set_broadcaster_htlc_key(struct LDKTxCreationKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
27261 * Countersignatory's HTLC Key
27263 struct LDKPublicKey TxCreationKeys_get_countersignatory_htlc_key(const struct LDKTxCreationKeys *NONNULL_PTR this_ptr);
27266 * Countersignatory's HTLC Key
27268 void TxCreationKeys_set_countersignatory_htlc_key(struct LDKTxCreationKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
27271 * Broadcaster's Payment Key (which isn't allowed to be spent from for some delay)
27273 struct LDKPublicKey TxCreationKeys_get_broadcaster_delayed_payment_key(const struct LDKTxCreationKeys *NONNULL_PTR this_ptr);
27276 * Broadcaster's Payment Key (which isn't allowed to be spent from for some delay)
27278 void TxCreationKeys_set_broadcaster_delayed_payment_key(struct LDKTxCreationKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
27281 * Constructs a new TxCreationKeys given each field
27283 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);
27286 * Checks if two TxCreationKeyss contain equal inner contents.
27287 * This ignores pointers and is_owned flags and looks at the values in fields.
27288 * Two objects with NULL inner values will be considered "equal" here.
27290 bool TxCreationKeys_eq(const struct LDKTxCreationKeys *NONNULL_PTR a, const struct LDKTxCreationKeys *NONNULL_PTR b);
27293 * Creates a copy of the TxCreationKeys
27295 struct LDKTxCreationKeys TxCreationKeys_clone(const struct LDKTxCreationKeys *NONNULL_PTR orig);
27298 * Serialize the TxCreationKeys object into a byte array which can be read by TxCreationKeys_read
27300 struct LDKCVec_u8Z TxCreationKeys_write(const struct LDKTxCreationKeys *NONNULL_PTR obj);
27303 * Read a TxCreationKeys from a byte array, created by TxCreationKeys_write
27305 struct LDKCResult_TxCreationKeysDecodeErrorZ TxCreationKeys_read(struct LDKu8slice ser);
27308 * Frees any resources used by the ChannelPublicKeys, if is_owned is set and inner is non-NULL.
27310 void ChannelPublicKeys_free(struct LDKChannelPublicKeys this_obj);
27313 * The public key which is used to sign all commitment transactions, as it appears in the
27314 * on-chain channel lock-in 2-of-2 multisig output.
27316 struct LDKPublicKey ChannelPublicKeys_get_funding_pubkey(const struct LDKChannelPublicKeys *NONNULL_PTR this_ptr);
27319 * The public key which is used to sign all commitment transactions, as it appears in the
27320 * on-chain channel lock-in 2-of-2 multisig output.
27322 void ChannelPublicKeys_set_funding_pubkey(struct LDKChannelPublicKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
27325 * The base point which is used (with derive_public_revocation_key) to derive per-commitment
27326 * revocation keys. This is combined with the per-commitment-secret generated by the
27327 * counterparty to create a secret which the counterparty can reveal to revoke previous
27330 struct LDKPublicKey ChannelPublicKeys_get_revocation_basepoint(const struct LDKChannelPublicKeys *NONNULL_PTR this_ptr);
27333 * The base point which is used (with derive_public_revocation_key) to derive per-commitment
27334 * revocation keys. This is combined with the per-commitment-secret generated by the
27335 * counterparty to create a secret which the counterparty can reveal to revoke previous
27338 void ChannelPublicKeys_set_revocation_basepoint(struct LDKChannelPublicKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
27341 * The public key on which the non-broadcaster (ie the countersignatory) receives an immediately
27342 * spendable primary channel balance on the broadcaster's commitment transaction. This key is
27343 * static across every commitment transaction.
27345 struct LDKPublicKey ChannelPublicKeys_get_payment_point(const struct LDKChannelPublicKeys *NONNULL_PTR this_ptr);
27348 * The public key on which the non-broadcaster (ie the countersignatory) receives an immediately
27349 * spendable primary channel balance on the broadcaster's commitment transaction. This key is
27350 * static across every commitment transaction.
27352 void ChannelPublicKeys_set_payment_point(struct LDKChannelPublicKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
27355 * The base point which is used (with derive_public_key) to derive a per-commitment payment
27356 * public key which receives non-HTLC-encumbered funds which are only available for spending
27357 * after some delay (or can be claimed via the revocation path).
27359 struct LDKPublicKey ChannelPublicKeys_get_delayed_payment_basepoint(const struct LDKChannelPublicKeys *NONNULL_PTR this_ptr);
27362 * The base point which is used (with derive_public_key) to derive a per-commitment payment
27363 * public key which receives non-HTLC-encumbered funds which are only available for spending
27364 * after some delay (or can be claimed via the revocation path).
27366 void ChannelPublicKeys_set_delayed_payment_basepoint(struct LDKChannelPublicKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
27369 * The base point which is used (with derive_public_key) to derive a per-commitment public key
27370 * which is used to encumber HTLC-in-flight outputs.
27372 struct LDKPublicKey ChannelPublicKeys_get_htlc_basepoint(const struct LDKChannelPublicKeys *NONNULL_PTR this_ptr);
27375 * The base point which is used (with derive_public_key) to derive a per-commitment public key
27376 * which is used to encumber HTLC-in-flight outputs.
27378 void ChannelPublicKeys_set_htlc_basepoint(struct LDKChannelPublicKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
27381 * Constructs a new ChannelPublicKeys given each field
27383 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);
27386 * Creates a copy of the ChannelPublicKeys
27388 struct LDKChannelPublicKeys ChannelPublicKeys_clone(const struct LDKChannelPublicKeys *NONNULL_PTR orig);
27391 * Checks if two ChannelPublicKeyss contain equal inner contents.
27392 * This ignores pointers and is_owned flags and looks at the values in fields.
27393 * Two objects with NULL inner values will be considered "equal" here.
27395 bool ChannelPublicKeys_eq(const struct LDKChannelPublicKeys *NONNULL_PTR a, const struct LDKChannelPublicKeys *NONNULL_PTR b);
27398 * Serialize the ChannelPublicKeys object into a byte array which can be read by ChannelPublicKeys_read
27400 struct LDKCVec_u8Z ChannelPublicKeys_write(const struct LDKChannelPublicKeys *NONNULL_PTR obj);
27403 * Read a ChannelPublicKeys from a byte array, created by ChannelPublicKeys_write
27405 struct LDKCResult_ChannelPublicKeysDecodeErrorZ ChannelPublicKeys_read(struct LDKu8slice ser);
27408 * Create per-state keys from channel base points and the per-commitment point.
27409 * Key set is asymmetric and can't be used as part of counter-signatory set of transactions.
27411 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);
27414 * Generate per-state keys from channel static keys.
27415 * Key set is asymmetric and can't be used as part of counter-signatory set of transactions.
27417 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);
27420 * A script either spendable by the revocation
27421 * key or the broadcaster_delayed_payment_key and satisfying the relative-locktime OP_CSV constrain.
27422 * Encumbering a `to_holder` output on a commitment transaction or 2nd-stage HTLC transactions.
27424 struct LDKCVec_u8Z get_revokeable_redeemscript(struct LDKPublicKey revocation_key, uint16_t contest_delay, struct LDKPublicKey broadcaster_delayed_payment_key);
27427 * Frees any resources used by the HTLCOutputInCommitment, if is_owned is set and inner is non-NULL.
27429 void HTLCOutputInCommitment_free(struct LDKHTLCOutputInCommitment this_obj);
27432 * Whether the HTLC was \"offered\" (ie outbound in relation to this commitment transaction).
27433 * Note that this is not the same as whether it is ountbound *from us*. To determine that you
27434 * need to compare this value to whether the commitment transaction in question is that of
27435 * the counterparty or our own.
27437 bool HTLCOutputInCommitment_get_offered(const struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr);
27440 * Whether the HTLC was \"offered\" (ie outbound in relation to this commitment transaction).
27441 * Note that this is not the same as whether it is ountbound *from us*. To determine that you
27442 * need to compare this value to whether the commitment transaction in question is that of
27443 * the counterparty or our own.
27445 void HTLCOutputInCommitment_set_offered(struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr, bool val);
27448 * The value, in msat, of the HTLC. The value as it appears in the commitment transaction is
27449 * this divided by 1000.
27451 uint64_t HTLCOutputInCommitment_get_amount_msat(const struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr);
27454 * The value, in msat, of the HTLC. The value as it appears in the commitment transaction is
27455 * this divided by 1000.
27457 void HTLCOutputInCommitment_set_amount_msat(struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr, uint64_t val);
27460 * The CLTV lock-time at which this HTLC expires.
27462 uint32_t HTLCOutputInCommitment_get_cltv_expiry(const struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr);
27465 * The CLTV lock-time at which this HTLC expires.
27467 void HTLCOutputInCommitment_set_cltv_expiry(struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr, uint32_t val);
27470 * The hash of the preimage which unlocks this HTLC.
27472 const uint8_t (*HTLCOutputInCommitment_get_payment_hash(const struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr))[32];
27475 * The hash of the preimage which unlocks this HTLC.
27477 void HTLCOutputInCommitment_set_payment_hash(struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
27480 * The position within the commitment transactions' outputs. This may be None if the value is
27481 * below the dust limit (in which case no output appears in the commitment transaction and the
27482 * value is spent to additional transaction fees).
27484 struct LDKCOption_u32Z HTLCOutputInCommitment_get_transaction_output_index(const struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr);
27487 * The position within the commitment transactions' outputs. This may be None if the value is
27488 * below the dust limit (in which case no output appears in the commitment transaction and the
27489 * value is spent to additional transaction fees).
27491 void HTLCOutputInCommitment_set_transaction_output_index(struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr, struct LDKCOption_u32Z val);
27494 * Constructs a new HTLCOutputInCommitment given each field
27496 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);
27499 * Creates a copy of the HTLCOutputInCommitment
27501 struct LDKHTLCOutputInCommitment HTLCOutputInCommitment_clone(const struct LDKHTLCOutputInCommitment *NONNULL_PTR orig);
27504 * Checks if two HTLCOutputInCommitments contain equal inner contents.
27505 * This ignores pointers and is_owned flags and looks at the values in fields.
27506 * Two objects with NULL inner values will be considered "equal" here.
27508 bool HTLCOutputInCommitment_eq(const struct LDKHTLCOutputInCommitment *NONNULL_PTR a, const struct LDKHTLCOutputInCommitment *NONNULL_PTR b);
27511 * Serialize the HTLCOutputInCommitment object into a byte array which can be read by HTLCOutputInCommitment_read
27513 struct LDKCVec_u8Z HTLCOutputInCommitment_write(const struct LDKHTLCOutputInCommitment *NONNULL_PTR obj);
27516 * Read a HTLCOutputInCommitment from a byte array, created by HTLCOutputInCommitment_write
27518 struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ HTLCOutputInCommitment_read(struct LDKu8slice ser);
27521 * Gets the witness redeemscript for an HTLC output in a commitment transaction. Note that htlc
27522 * does not need to have its previous_output_index filled.
27524 struct LDKCVec_u8Z get_htlc_redeemscript(const struct LDKHTLCOutputInCommitment *NONNULL_PTR htlc, bool opt_anchors, const struct LDKTxCreationKeys *NONNULL_PTR keys);
27527 * Gets the redeemscript for a funding output from the two funding public keys.
27528 * Note that the order of funding public keys does not matter.
27530 struct LDKCVec_u8Z make_funding_redeemscript(struct LDKPublicKey broadcaster, struct LDKPublicKey countersignatory);
27533 * Builds an unsigned HTLC-Success or HTLC-Timeout transaction from the given channel and HTLC
27534 * parameters. This is used by [`TrustedCommitmentTransaction::get_htlc_sigs`] to fetch the
27535 * transaction which needs signing, and can be used to construct an HTLC transaction which is
27536 * broadcastable given a counterparty HTLC signature.
27538 * Panics if htlc.transaction_output_index.is_none() (as such HTLCs do not appear in the
27539 * commitment transaction).
27541 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, bool opt_anchors, bool use_non_zero_fee_anchors, struct LDKPublicKey broadcaster_delayed_payment_key, struct LDKPublicKey revocation_key);
27544 * Returns the witness required to satisfy and spend a HTLC input.
27546 * Note that preimage (or a relevant inner pointer) may be NULL or all-0s to represent None
27548 struct LDKWitness build_htlc_input_witness(struct LDKSignature local_sig, struct LDKSignature remote_sig, struct LDKThirtyTwoBytes preimage, struct LDKu8slice redeem_script, bool opt_anchors);
27551 * Gets the witnessScript for the to_remote output when anchors are enabled.
27553 struct LDKCVec_u8Z get_to_countersignatory_with_anchors_redeemscript(struct LDKPublicKey payment_point);
27556 * Gets the witnessScript for an anchor output from the funding public key.
27557 * The witness in the spending input must be:
27558 * <BIP 143 funding_signature>
27559 * After 16 blocks of confirmation, an alternative satisfying witness could be:
27561 * (empty vector required to satisfy compliance with MINIMALIF-standard rule)
27563 struct LDKCVec_u8Z get_anchor_redeemscript(struct LDKPublicKey funding_pubkey);
27566 * Returns the witness required to satisfy and spend an anchor input.
27568 struct LDKWitness build_anchor_input_witness(struct LDKPublicKey funding_key, struct LDKSignature funding_sig);
27571 * Frees any resources used by the ChannelTransactionParameters, if is_owned is set and inner is non-NULL.
27573 void ChannelTransactionParameters_free(struct LDKChannelTransactionParameters this_obj);
27576 * Holder public keys
27578 struct LDKChannelPublicKeys ChannelTransactionParameters_get_holder_pubkeys(const struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr);
27581 * Holder public keys
27583 void ChannelTransactionParameters_set_holder_pubkeys(struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr, struct LDKChannelPublicKeys val);
27586 * The contest delay selected by the holder, which applies to counterparty-broadcast transactions
27588 uint16_t ChannelTransactionParameters_get_holder_selected_contest_delay(const struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr);
27591 * The contest delay selected by the holder, which applies to counterparty-broadcast transactions
27593 void ChannelTransactionParameters_set_holder_selected_contest_delay(struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr, uint16_t val);
27596 * Whether the holder is the initiator of this channel.
27597 * This is an input to the commitment number obscure factor computation.
27599 bool ChannelTransactionParameters_get_is_outbound_from_holder(const struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr);
27602 * Whether the holder is the initiator of this channel.
27603 * This is an input to the commitment number obscure factor computation.
27605 void ChannelTransactionParameters_set_is_outbound_from_holder(struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr, bool val);
27608 * The late-bound counterparty channel transaction parameters.
27609 * These parameters are populated at the point in the protocol where the counterparty provides them.
27611 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
27613 struct LDKCounterpartyChannelTransactionParameters ChannelTransactionParameters_get_counterparty_parameters(const struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr);
27616 * The late-bound counterparty channel transaction parameters.
27617 * These parameters are populated at the point in the protocol where the counterparty provides them.
27619 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
27621 void ChannelTransactionParameters_set_counterparty_parameters(struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr, struct LDKCounterpartyChannelTransactionParameters val);
27624 * The late-bound funding outpoint
27626 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
27628 struct LDKOutPoint ChannelTransactionParameters_get_funding_outpoint(const struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr);
27631 * The late-bound funding outpoint
27633 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
27635 void ChannelTransactionParameters_set_funding_outpoint(struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr, struct LDKOutPoint val);
27638 * Are anchors (zero fee HTLC transaction variant) used for this channel. Boolean is
27639 * serialization backwards-compatible.
27641 enum LDKCOption_NoneZ ChannelTransactionParameters_get_opt_anchors(const struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr);
27644 * Are anchors (zero fee HTLC transaction variant) used for this channel. Boolean is
27645 * serialization backwards-compatible.
27647 void ChannelTransactionParameters_set_opt_anchors(struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr, enum LDKCOption_NoneZ val);
27650 * Are non-zero-fee anchors are enabled (used in conjuction with opt_anchors)
27651 * It is intended merely for backwards compatibility with signers that need it.
27652 * There is no support for this feature in LDK channel negotiation.
27654 enum LDKCOption_NoneZ ChannelTransactionParameters_get_opt_non_zero_fee_anchors(const struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr);
27657 * Are non-zero-fee anchors are enabled (used in conjuction with opt_anchors)
27658 * It is intended merely for backwards compatibility with signers that need it.
27659 * There is no support for this feature in LDK channel negotiation.
27661 void ChannelTransactionParameters_set_opt_non_zero_fee_anchors(struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr, enum LDKCOption_NoneZ val);
27664 * Constructs a new ChannelTransactionParameters given each field
27666 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, enum LDKCOption_NoneZ opt_anchors_arg, enum LDKCOption_NoneZ opt_non_zero_fee_anchors_arg);
27669 * Creates a copy of the ChannelTransactionParameters
27671 struct LDKChannelTransactionParameters ChannelTransactionParameters_clone(const struct LDKChannelTransactionParameters *NONNULL_PTR orig);
27674 * Frees any resources used by the CounterpartyChannelTransactionParameters, if is_owned is set and inner is non-NULL.
27676 void CounterpartyChannelTransactionParameters_free(struct LDKCounterpartyChannelTransactionParameters this_obj);
27679 * Counter-party public keys
27681 struct LDKChannelPublicKeys CounterpartyChannelTransactionParameters_get_pubkeys(const struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR this_ptr);
27684 * Counter-party public keys
27686 void CounterpartyChannelTransactionParameters_set_pubkeys(struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR this_ptr, struct LDKChannelPublicKeys val);
27689 * The contest delay selected by the counterparty, which applies to holder-broadcast transactions
27691 uint16_t CounterpartyChannelTransactionParameters_get_selected_contest_delay(const struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR this_ptr);
27694 * The contest delay selected by the counterparty, which applies to holder-broadcast transactions
27696 void CounterpartyChannelTransactionParameters_set_selected_contest_delay(struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR this_ptr, uint16_t val);
27699 * Constructs a new CounterpartyChannelTransactionParameters given each field
27701 MUST_USE_RES struct LDKCounterpartyChannelTransactionParameters CounterpartyChannelTransactionParameters_new(struct LDKChannelPublicKeys pubkeys_arg, uint16_t selected_contest_delay_arg);
27704 * Creates a copy of the CounterpartyChannelTransactionParameters
27706 struct LDKCounterpartyChannelTransactionParameters CounterpartyChannelTransactionParameters_clone(const struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR orig);
27709 * Whether the late bound parameters are populated.
27711 MUST_USE_RES bool ChannelTransactionParameters_is_populated(const struct LDKChannelTransactionParameters *NONNULL_PTR this_arg);
27714 * Convert the holder/counterparty parameters to broadcaster/countersignatory-organized parameters,
27715 * given that the holder is the broadcaster.
27717 * self.is_populated() must be true before calling this function.
27719 MUST_USE_RES struct LDKDirectedChannelTransactionParameters ChannelTransactionParameters_as_holder_broadcastable(const struct LDKChannelTransactionParameters *NONNULL_PTR this_arg);
27722 * Convert the holder/counterparty parameters to broadcaster/countersignatory-organized parameters,
27723 * given that the counterparty is the broadcaster.
27725 * self.is_populated() must be true before calling this function.
27727 MUST_USE_RES struct LDKDirectedChannelTransactionParameters ChannelTransactionParameters_as_counterparty_broadcastable(const struct LDKChannelTransactionParameters *NONNULL_PTR this_arg);
27730 * Serialize the CounterpartyChannelTransactionParameters object into a byte array which can be read by CounterpartyChannelTransactionParameters_read
27732 struct LDKCVec_u8Z CounterpartyChannelTransactionParameters_write(const struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR obj);
27735 * Read a CounterpartyChannelTransactionParameters from a byte array, created by CounterpartyChannelTransactionParameters_write
27737 struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ CounterpartyChannelTransactionParameters_read(struct LDKu8slice ser);
27740 * Serialize the ChannelTransactionParameters object into a byte array which can be read by ChannelTransactionParameters_read
27742 struct LDKCVec_u8Z ChannelTransactionParameters_write(const struct LDKChannelTransactionParameters *NONNULL_PTR obj);
27745 * Read a ChannelTransactionParameters from a byte array, created by ChannelTransactionParameters_write
27747 struct LDKCResult_ChannelTransactionParametersDecodeErrorZ ChannelTransactionParameters_read(struct LDKu8slice ser);
27750 * Frees any resources used by the DirectedChannelTransactionParameters, if is_owned is set and inner is non-NULL.
27752 void DirectedChannelTransactionParameters_free(struct LDKDirectedChannelTransactionParameters this_obj);
27755 * Get the channel pubkeys for the broadcaster
27757 MUST_USE_RES struct LDKChannelPublicKeys DirectedChannelTransactionParameters_broadcaster_pubkeys(const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR this_arg);
27760 * Get the channel pubkeys for the countersignatory
27762 MUST_USE_RES struct LDKChannelPublicKeys DirectedChannelTransactionParameters_countersignatory_pubkeys(const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR this_arg);
27765 * Get the contest delay applicable to the transactions.
27766 * Note that the contest delay was selected by the countersignatory.
27768 MUST_USE_RES uint16_t DirectedChannelTransactionParameters_contest_delay(const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR this_arg);
27771 * Whether the channel is outbound from the broadcaster.
27773 * The boolean representing the side that initiated the channel is
27774 * an input to the commitment number obscure factor computation.
27776 MUST_USE_RES bool DirectedChannelTransactionParameters_is_outbound(const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR this_arg);
27779 * The funding outpoint
27781 MUST_USE_RES struct LDKOutPoint DirectedChannelTransactionParameters_funding_outpoint(const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR this_arg);
27784 * Whether to use anchors for this channel
27786 MUST_USE_RES bool DirectedChannelTransactionParameters_opt_anchors(const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR this_arg);
27789 * Frees any resources used by the HolderCommitmentTransaction, if is_owned is set and inner is non-NULL.
27791 void HolderCommitmentTransaction_free(struct LDKHolderCommitmentTransaction this_obj);
27794 * Our counterparty's signature for the transaction
27796 struct LDKSignature HolderCommitmentTransaction_get_counterparty_sig(const struct LDKHolderCommitmentTransaction *NONNULL_PTR this_ptr);
27799 * Our counterparty's signature for the transaction
27801 void HolderCommitmentTransaction_set_counterparty_sig(struct LDKHolderCommitmentTransaction *NONNULL_PTR this_ptr, struct LDKSignature val);
27804 * All non-dust counterparty HTLC signatures, in the order they appear in the transaction
27806 * Returns a copy of the field.
27808 struct LDKCVec_SignatureZ HolderCommitmentTransaction_get_counterparty_htlc_sigs(const struct LDKHolderCommitmentTransaction *NONNULL_PTR this_ptr);
27811 * All non-dust counterparty HTLC signatures, in the order they appear in the transaction
27813 void HolderCommitmentTransaction_set_counterparty_htlc_sigs(struct LDKHolderCommitmentTransaction *NONNULL_PTR this_ptr, struct LDKCVec_SignatureZ val);
27816 * Creates a copy of the HolderCommitmentTransaction
27818 struct LDKHolderCommitmentTransaction HolderCommitmentTransaction_clone(const struct LDKHolderCommitmentTransaction *NONNULL_PTR orig);
27821 * Serialize the HolderCommitmentTransaction object into a byte array which can be read by HolderCommitmentTransaction_read
27823 struct LDKCVec_u8Z HolderCommitmentTransaction_write(const struct LDKHolderCommitmentTransaction *NONNULL_PTR obj);
27826 * Read a HolderCommitmentTransaction from a byte array, created by HolderCommitmentTransaction_write
27828 struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ HolderCommitmentTransaction_read(struct LDKu8slice ser);
27831 * Create a new holder transaction with the given counterparty signatures.
27832 * The funding keys are used to figure out which signature should go first when building the transaction for broadcast.
27834 MUST_USE_RES struct LDKHolderCommitmentTransaction HolderCommitmentTransaction_new(struct LDKCommitmentTransaction commitment_tx, struct LDKSignature counterparty_sig, struct LDKCVec_SignatureZ counterparty_htlc_sigs, struct LDKPublicKey holder_funding_key, struct LDKPublicKey counterparty_funding_key);
27837 * Frees any resources used by the BuiltCommitmentTransaction, if is_owned is set and inner is non-NULL.
27839 void BuiltCommitmentTransaction_free(struct LDKBuiltCommitmentTransaction this_obj);
27842 * The commitment transaction
27844 struct LDKTransaction BuiltCommitmentTransaction_get_transaction(const struct LDKBuiltCommitmentTransaction *NONNULL_PTR this_ptr);
27847 * The commitment transaction
27849 void BuiltCommitmentTransaction_set_transaction(struct LDKBuiltCommitmentTransaction *NONNULL_PTR this_ptr, struct LDKTransaction val);
27852 * The txid for the commitment transaction.
27854 * This is provided as a performance optimization, instead of calling transaction.txid()
27857 const uint8_t (*BuiltCommitmentTransaction_get_txid(const struct LDKBuiltCommitmentTransaction *NONNULL_PTR this_ptr))[32];
27860 * The txid for the commitment transaction.
27862 * This is provided as a performance optimization, instead of calling transaction.txid()
27865 void BuiltCommitmentTransaction_set_txid(struct LDKBuiltCommitmentTransaction *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
27868 * Constructs a new BuiltCommitmentTransaction given each field
27870 MUST_USE_RES struct LDKBuiltCommitmentTransaction BuiltCommitmentTransaction_new(struct LDKTransaction transaction_arg, struct LDKThirtyTwoBytes txid_arg);
27873 * Creates a copy of the BuiltCommitmentTransaction
27875 struct LDKBuiltCommitmentTransaction BuiltCommitmentTransaction_clone(const struct LDKBuiltCommitmentTransaction *NONNULL_PTR orig);
27878 * Serialize the BuiltCommitmentTransaction object into a byte array which can be read by BuiltCommitmentTransaction_read
27880 struct LDKCVec_u8Z BuiltCommitmentTransaction_write(const struct LDKBuiltCommitmentTransaction *NONNULL_PTR obj);
27883 * Read a BuiltCommitmentTransaction from a byte array, created by BuiltCommitmentTransaction_write
27885 struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ BuiltCommitmentTransaction_read(struct LDKu8slice ser);
27888 * Get the SIGHASH_ALL sighash value of the transaction.
27890 * This can be used to verify a signature.
27892 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);
27895 * Sign a transaction, either because we are counter-signing the counterparty's transaction or
27896 * because we are about to broadcast a holder transaction.
27898 MUST_USE_RES struct LDKSignature BuiltCommitmentTransaction_sign(const struct LDKBuiltCommitmentTransaction *NONNULL_PTR this_arg, const uint8_t (*funding_key)[32], struct LDKu8slice funding_redeemscript, uint64_t channel_value_satoshis);
27901 * Frees any resources used by the ClosingTransaction, if is_owned is set and inner is non-NULL.
27903 void ClosingTransaction_free(struct LDKClosingTransaction this_obj);
27906 * Creates a copy of the ClosingTransaction
27908 struct LDKClosingTransaction ClosingTransaction_clone(const struct LDKClosingTransaction *NONNULL_PTR orig);
27911 * Checks if two ClosingTransactions contain equal inner contents.
27913 uint64_t ClosingTransaction_hash(const struct LDKClosingTransaction *NONNULL_PTR o);
27916 * Checks if two ClosingTransactions contain equal inner contents.
27917 * This ignores pointers and is_owned flags and looks at the values in fields.
27918 * Two objects with NULL inner values will be considered "equal" here.
27920 bool ClosingTransaction_eq(const struct LDKClosingTransaction *NONNULL_PTR a, const struct LDKClosingTransaction *NONNULL_PTR b);
27923 * Construct an object of the class
27925 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);
27928 * Trust our pre-built transaction.
27930 * Applies a wrapper which allows access to the transaction.
27932 * This should only be used if you fully trust the builder of this object. It should not
27933 * be used by an external signer - instead use the verify function.
27935 MUST_USE_RES struct LDKTrustedClosingTransaction ClosingTransaction_trust(const struct LDKClosingTransaction *NONNULL_PTR this_arg);
27938 * Verify our pre-built transaction.
27940 * Applies a wrapper which allows access to the transaction.
27942 * An external validating signer must call this method before signing
27943 * or using the built transaction.
27945 MUST_USE_RES struct LDKCResult_TrustedClosingTransactionNoneZ ClosingTransaction_verify(const struct LDKClosingTransaction *NONNULL_PTR this_arg, struct LDKOutPoint funding_outpoint);
27948 * The value to be sent to the holder, or zero if the output will be omitted
27950 MUST_USE_RES uint64_t ClosingTransaction_to_holder_value_sat(const struct LDKClosingTransaction *NONNULL_PTR this_arg);
27953 * The value to be sent to the counterparty, or zero if the output will be omitted
27955 MUST_USE_RES uint64_t ClosingTransaction_to_counterparty_value_sat(const struct LDKClosingTransaction *NONNULL_PTR this_arg);
27958 * The destination of the holder's output
27960 MUST_USE_RES struct LDKu8slice ClosingTransaction_to_holder_script(const struct LDKClosingTransaction *NONNULL_PTR this_arg);
27963 * The destination of the counterparty's output
27965 MUST_USE_RES struct LDKu8slice ClosingTransaction_to_counterparty_script(const struct LDKClosingTransaction *NONNULL_PTR this_arg);
27968 * Frees any resources used by the TrustedClosingTransaction, if is_owned is set and inner is non-NULL.
27970 void TrustedClosingTransaction_free(struct LDKTrustedClosingTransaction this_obj);
27973 * The pre-built Bitcoin commitment transaction
27975 MUST_USE_RES struct LDKTransaction TrustedClosingTransaction_built_transaction(const struct LDKTrustedClosingTransaction *NONNULL_PTR this_arg);
27978 * Get the SIGHASH_ALL sighash value of the transaction.
27980 * This can be used to verify a signature.
27982 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);
27985 * Sign a transaction, either because we are counter-signing the counterparty's transaction or
27986 * because we are about to broadcast a holder transaction.
27988 MUST_USE_RES struct LDKSignature TrustedClosingTransaction_sign(const struct LDKTrustedClosingTransaction *NONNULL_PTR this_arg, const uint8_t (*funding_key)[32], struct LDKu8slice funding_redeemscript, uint64_t channel_value_satoshis);
27991 * Frees any resources used by the CommitmentTransaction, if is_owned is set and inner is non-NULL.
27993 void CommitmentTransaction_free(struct LDKCommitmentTransaction this_obj);
27996 * Creates a copy of the CommitmentTransaction
27998 struct LDKCommitmentTransaction CommitmentTransaction_clone(const struct LDKCommitmentTransaction *NONNULL_PTR orig);
28001 * Serialize the CommitmentTransaction object into a byte array which can be read by CommitmentTransaction_read
28003 struct LDKCVec_u8Z CommitmentTransaction_write(const struct LDKCommitmentTransaction *NONNULL_PTR obj);
28006 * Read a CommitmentTransaction from a byte array, created by CommitmentTransaction_write
28008 struct LDKCResult_CommitmentTransactionDecodeErrorZ CommitmentTransaction_read(struct LDKu8slice ser);
28011 * The backwards-counting commitment number
28013 MUST_USE_RES uint64_t CommitmentTransaction_commitment_number(const struct LDKCommitmentTransaction *NONNULL_PTR this_arg);
28016 * The value to be sent to the broadcaster
28018 MUST_USE_RES uint64_t CommitmentTransaction_to_broadcaster_value_sat(const struct LDKCommitmentTransaction *NONNULL_PTR this_arg);
28021 * The value to be sent to the counterparty
28023 MUST_USE_RES uint64_t CommitmentTransaction_to_countersignatory_value_sat(const struct LDKCommitmentTransaction *NONNULL_PTR this_arg);
28026 * The feerate paid per 1000-weight-unit in this commitment transaction.
28028 MUST_USE_RES uint32_t CommitmentTransaction_feerate_per_kw(const struct LDKCommitmentTransaction *NONNULL_PTR this_arg);
28031 * Trust our pre-built transaction and derived transaction creation public keys.
28033 * Applies a wrapper which allows access to these fields.
28035 * This should only be used if you fully trust the builder of this object. It should not
28036 * be used by an external signer - instead use the verify function.
28038 MUST_USE_RES struct LDKTrustedCommitmentTransaction CommitmentTransaction_trust(const struct LDKCommitmentTransaction *NONNULL_PTR this_arg);
28041 * Verify our pre-built transaction and derived transaction creation public keys.
28043 * Applies a wrapper which allows access to these fields.
28045 * An external validating signer must call this method before signing
28046 * or using the built transaction.
28048 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);
28051 * Frees any resources used by the TrustedCommitmentTransaction, if is_owned is set and inner is non-NULL.
28053 void TrustedCommitmentTransaction_free(struct LDKTrustedCommitmentTransaction this_obj);
28056 * The transaction ID of the built Bitcoin transaction
28058 MUST_USE_RES struct LDKThirtyTwoBytes TrustedCommitmentTransaction_txid(const struct LDKTrustedCommitmentTransaction *NONNULL_PTR this_arg);
28061 * The pre-built Bitcoin commitment transaction
28063 MUST_USE_RES struct LDKBuiltCommitmentTransaction TrustedCommitmentTransaction_built_transaction(const struct LDKTrustedCommitmentTransaction *NONNULL_PTR this_arg);
28066 * The pre-calculated transaction creation public keys.
28068 MUST_USE_RES struct LDKTxCreationKeys TrustedCommitmentTransaction_keys(const struct LDKTrustedCommitmentTransaction *NONNULL_PTR this_arg);
28071 * Should anchors be used.
28073 MUST_USE_RES bool TrustedCommitmentTransaction_opt_anchors(const struct LDKTrustedCommitmentTransaction *NONNULL_PTR this_arg);
28076 * Get a signature for each HTLC which was included in the commitment transaction (ie for
28077 * which HTLCOutputInCommitment::transaction_output_index.is_some()).
28079 * The returned Vec has one entry for each HTLC, and in the same order.
28081 * This function is only valid in the holder commitment context, it always uses EcdsaSighashType::All.
28083 MUST_USE_RES struct LDKCResult_CVec_SignatureZNoneZ 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);
28086 * Commitment transaction numbers which appear in the transactions themselves are XOR'd with a
28087 * shared secret first. This prevents on-chain observers from discovering how many commitment
28088 * transactions occurred in a channel before it was closed.
28090 * This function gets the shared secret from relevant channel public keys and can be used to
28091 * \"decrypt\" the commitment transaction number given a commitment transaction on-chain.
28093 uint64_t get_commitment_transaction_number_obscure_factor(struct LDKPublicKey broadcaster_payment_basepoint, struct LDKPublicKey countersignatory_payment_basepoint, bool outbound_from_broadcaster);
28096 * Checks if two InitFeaturess contain equal inner contents.
28097 * This ignores pointers and is_owned flags and looks at the values in fields.
28098 * Two objects with NULL inner values will be considered "equal" here.
28100 bool InitFeatures_eq(const struct LDKInitFeatures *NONNULL_PTR a, const struct LDKInitFeatures *NONNULL_PTR b);
28103 * Checks if two NodeFeaturess contain equal inner contents.
28104 * This ignores pointers and is_owned flags and looks at the values in fields.
28105 * Two objects with NULL inner values will be considered "equal" here.
28107 bool NodeFeatures_eq(const struct LDKNodeFeatures *NONNULL_PTR a, const struct LDKNodeFeatures *NONNULL_PTR b);
28110 * Checks if two ChannelFeaturess contain equal inner contents.
28111 * This ignores pointers and is_owned flags and looks at the values in fields.
28112 * Two objects with NULL inner values will be considered "equal" here.
28114 bool ChannelFeatures_eq(const struct LDKChannelFeatures *NONNULL_PTR a, const struct LDKChannelFeatures *NONNULL_PTR b);
28117 * Checks if two InvoiceFeaturess contain equal inner contents.
28118 * This ignores pointers and is_owned flags and looks at the values in fields.
28119 * Two objects with NULL inner values will be considered "equal" here.
28121 bool InvoiceFeatures_eq(const struct LDKInvoiceFeatures *NONNULL_PTR a, const struct LDKInvoiceFeatures *NONNULL_PTR b);
28124 * Checks if two OfferFeaturess contain equal inner contents.
28125 * This ignores pointers and is_owned flags and looks at the values in fields.
28126 * Two objects with NULL inner values will be considered "equal" here.
28128 bool OfferFeatures_eq(const struct LDKOfferFeatures *NONNULL_PTR a, const struct LDKOfferFeatures *NONNULL_PTR b);
28131 * Checks if two InvoiceRequestFeaturess contain equal inner contents.
28132 * This ignores pointers and is_owned flags and looks at the values in fields.
28133 * Two objects with NULL inner values will be considered "equal" here.
28135 bool InvoiceRequestFeatures_eq(const struct LDKInvoiceRequestFeatures *NONNULL_PTR a, const struct LDKInvoiceRequestFeatures *NONNULL_PTR b);
28138 * Checks if two ChannelTypeFeaturess contain equal inner contents.
28139 * This ignores pointers and is_owned flags and looks at the values in fields.
28140 * Two objects with NULL inner values will be considered "equal" here.
28142 bool ChannelTypeFeatures_eq(const struct LDKChannelTypeFeatures *NONNULL_PTR a, const struct LDKChannelTypeFeatures *NONNULL_PTR b);
28145 * Creates a copy of the InitFeatures
28147 struct LDKInitFeatures InitFeatures_clone(const struct LDKInitFeatures *NONNULL_PTR orig);
28150 * Creates a copy of the NodeFeatures
28152 struct LDKNodeFeatures NodeFeatures_clone(const struct LDKNodeFeatures *NONNULL_PTR orig);
28155 * Creates a copy of the ChannelFeatures
28157 struct LDKChannelFeatures ChannelFeatures_clone(const struct LDKChannelFeatures *NONNULL_PTR orig);
28160 * Creates a copy of the InvoiceFeatures
28162 struct LDKInvoiceFeatures InvoiceFeatures_clone(const struct LDKInvoiceFeatures *NONNULL_PTR orig);
28165 * Creates a copy of the OfferFeatures
28167 struct LDKOfferFeatures OfferFeatures_clone(const struct LDKOfferFeatures *NONNULL_PTR orig);
28170 * Creates a copy of the InvoiceRequestFeatures
28172 struct LDKInvoiceRequestFeatures InvoiceRequestFeatures_clone(const struct LDKInvoiceRequestFeatures *NONNULL_PTR orig);
28175 * Creates a copy of the ChannelTypeFeatures
28177 struct LDKChannelTypeFeatures ChannelTypeFeatures_clone(const struct LDKChannelTypeFeatures *NONNULL_PTR orig);
28180 * Frees any resources used by the InitFeatures, if is_owned is set and inner is non-NULL.
28182 void InitFeatures_free(struct LDKInitFeatures this_obj);
28185 * Frees any resources used by the NodeFeatures, if is_owned is set and inner is non-NULL.
28187 void NodeFeatures_free(struct LDKNodeFeatures this_obj);
28190 * Frees any resources used by the ChannelFeatures, if is_owned is set and inner is non-NULL.
28192 void ChannelFeatures_free(struct LDKChannelFeatures this_obj);
28195 * Frees any resources used by the InvoiceFeatures, if is_owned is set and inner is non-NULL.
28197 void InvoiceFeatures_free(struct LDKInvoiceFeatures this_obj);
28200 * Frees any resources used by the OfferFeatures, if is_owned is set and inner is non-NULL.
28202 void OfferFeatures_free(struct LDKOfferFeatures this_obj);
28205 * Frees any resources used by the InvoiceRequestFeatures, if is_owned is set and inner is non-NULL.
28207 void InvoiceRequestFeatures_free(struct LDKInvoiceRequestFeatures this_obj);
28210 * Frees any resources used by the ChannelTypeFeatures, if is_owned is set and inner is non-NULL.
28212 void ChannelTypeFeatures_free(struct LDKChannelTypeFeatures this_obj);
28215 * Create a blank Features with no features set
28217 MUST_USE_RES struct LDKInitFeatures InitFeatures_empty(void);
28220 * Returns true if this `Features` object contains unknown feature flags which are set as
28223 MUST_USE_RES bool InitFeatures_requires_unknown_bits(const struct LDKInitFeatures *NONNULL_PTR this_arg);
28226 * Create a blank Features with no features set
28228 MUST_USE_RES struct LDKNodeFeatures NodeFeatures_empty(void);
28231 * Returns true if this `Features` object contains unknown feature flags which are set as
28234 MUST_USE_RES bool NodeFeatures_requires_unknown_bits(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
28237 * Create a blank Features with no features set
28239 MUST_USE_RES struct LDKChannelFeatures ChannelFeatures_empty(void);
28242 * Returns true if this `Features` object contains unknown feature flags which are set as
28245 MUST_USE_RES bool ChannelFeatures_requires_unknown_bits(const struct LDKChannelFeatures *NONNULL_PTR this_arg);
28248 * Create a blank Features with no features set
28250 MUST_USE_RES struct LDKInvoiceFeatures InvoiceFeatures_empty(void);
28253 * Returns true if this `Features` object contains unknown feature flags which are set as
28256 MUST_USE_RES bool InvoiceFeatures_requires_unknown_bits(const struct LDKInvoiceFeatures *NONNULL_PTR this_arg);
28259 * Create a blank Features with no features set
28261 MUST_USE_RES struct LDKOfferFeatures OfferFeatures_empty(void);
28264 * Returns true if this `Features` object contains unknown feature flags which are set as
28267 MUST_USE_RES bool OfferFeatures_requires_unknown_bits(const struct LDKOfferFeatures *NONNULL_PTR this_arg);
28270 * Create a blank Features with no features set
28272 MUST_USE_RES struct LDKInvoiceRequestFeatures InvoiceRequestFeatures_empty(void);
28275 * Returns true if this `Features` object contains unknown feature flags which are set as
28278 MUST_USE_RES bool InvoiceRequestFeatures_requires_unknown_bits(const struct LDKInvoiceRequestFeatures *NONNULL_PTR this_arg);
28281 * Create a blank Features with no features set
28283 MUST_USE_RES struct LDKChannelTypeFeatures ChannelTypeFeatures_empty(void);
28286 * Returns true if this `Features` object contains unknown feature flags which are set as
28289 MUST_USE_RES bool ChannelTypeFeatures_requires_unknown_bits(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
28292 * Serialize the InitFeatures object into a byte array which can be read by InitFeatures_read
28294 struct LDKCVec_u8Z InitFeatures_write(const struct LDKInitFeatures *NONNULL_PTR obj);
28297 * Read a InitFeatures from a byte array, created by InitFeatures_write
28299 struct LDKCResult_InitFeaturesDecodeErrorZ InitFeatures_read(struct LDKu8slice ser);
28302 * Serialize the ChannelFeatures object into a byte array which can be read by ChannelFeatures_read
28304 struct LDKCVec_u8Z ChannelFeatures_write(const struct LDKChannelFeatures *NONNULL_PTR obj);
28307 * Read a ChannelFeatures from a byte array, created by ChannelFeatures_write
28309 struct LDKCResult_ChannelFeaturesDecodeErrorZ ChannelFeatures_read(struct LDKu8slice ser);
28312 * Serialize the NodeFeatures object into a byte array which can be read by NodeFeatures_read
28314 struct LDKCVec_u8Z NodeFeatures_write(const struct LDKNodeFeatures *NONNULL_PTR obj);
28317 * Read a NodeFeatures from a byte array, created by NodeFeatures_write
28319 struct LDKCResult_NodeFeaturesDecodeErrorZ NodeFeatures_read(struct LDKu8slice ser);
28322 * Serialize the InvoiceFeatures object into a byte array which can be read by InvoiceFeatures_read
28324 struct LDKCVec_u8Z InvoiceFeatures_write(const struct LDKInvoiceFeatures *NONNULL_PTR obj);
28327 * Read a InvoiceFeatures from a byte array, created by InvoiceFeatures_write
28329 struct LDKCResult_InvoiceFeaturesDecodeErrorZ InvoiceFeatures_read(struct LDKu8slice ser);
28332 * Serialize the ChannelTypeFeatures object into a byte array which can be read by ChannelTypeFeatures_read
28334 struct LDKCVec_u8Z ChannelTypeFeatures_write(const struct LDKChannelTypeFeatures *NONNULL_PTR obj);
28337 * Read a ChannelTypeFeatures from a byte array, created by ChannelTypeFeatures_write
28339 struct LDKCResult_ChannelTypeFeaturesDecodeErrorZ ChannelTypeFeatures_read(struct LDKu8slice ser);
28342 * Serialize the OfferFeatures object into a byte array which can be read by OfferFeatures_read
28344 struct LDKCVec_u8Z OfferFeatures_write(const struct LDKOfferFeatures *NONNULL_PTR obj);
28347 * Read a OfferFeatures from a byte array, created by OfferFeatures_write
28349 struct LDKCResult_OfferFeaturesDecodeErrorZ OfferFeatures_read(struct LDKu8slice ser);
28352 * Serialize the InvoiceRequestFeatures object into a byte array which can be read by InvoiceRequestFeatures_read
28354 struct LDKCVec_u8Z InvoiceRequestFeatures_write(const struct LDKInvoiceRequestFeatures *NONNULL_PTR obj);
28357 * Read a InvoiceRequestFeatures from a byte array, created by InvoiceRequestFeatures_write
28359 struct LDKCResult_InvoiceRequestFeaturesDecodeErrorZ InvoiceRequestFeatures_read(struct LDKu8slice ser);
28362 * Set this feature as optional.
28364 void InitFeatures_set_data_loss_protect_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
28367 * Set this feature as required.
28369 void InitFeatures_set_data_loss_protect_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
28372 * Checks if this feature is supported.
28374 MUST_USE_RES bool InitFeatures_supports_data_loss_protect(const struct LDKInitFeatures *NONNULL_PTR this_arg);
28377 * Set this feature as optional.
28379 void NodeFeatures_set_data_loss_protect_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
28382 * Set this feature as required.
28384 void NodeFeatures_set_data_loss_protect_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
28387 * Checks if this feature is supported.
28389 MUST_USE_RES bool NodeFeatures_supports_data_loss_protect(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
28392 * Checks if this feature is required.
28394 MUST_USE_RES bool InitFeatures_requires_data_loss_protect(const struct LDKInitFeatures *NONNULL_PTR this_arg);
28397 * Checks if this feature is required.
28399 MUST_USE_RES bool NodeFeatures_requires_data_loss_protect(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
28402 * Set this feature as optional.
28404 void InitFeatures_set_initial_routing_sync_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
28407 * Set this feature as required.
28409 void InitFeatures_set_initial_routing_sync_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
28412 * Checks if this feature is supported.
28414 MUST_USE_RES bool InitFeatures_initial_routing_sync(const struct LDKInitFeatures *NONNULL_PTR this_arg);
28417 * Set this feature as optional.
28419 void InitFeatures_set_upfront_shutdown_script_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
28422 * Set this feature as required.
28424 void InitFeatures_set_upfront_shutdown_script_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
28427 * Checks if this feature is supported.
28429 MUST_USE_RES bool InitFeatures_supports_upfront_shutdown_script(const struct LDKInitFeatures *NONNULL_PTR this_arg);
28432 * Set this feature as optional.
28434 void NodeFeatures_set_upfront_shutdown_script_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
28437 * Set this feature as required.
28439 void NodeFeatures_set_upfront_shutdown_script_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
28442 * Checks if this feature is supported.
28444 MUST_USE_RES bool NodeFeatures_supports_upfront_shutdown_script(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
28447 * Checks if this feature is required.
28449 MUST_USE_RES bool InitFeatures_requires_upfront_shutdown_script(const struct LDKInitFeatures *NONNULL_PTR this_arg);
28452 * Checks if this feature is required.
28454 MUST_USE_RES bool NodeFeatures_requires_upfront_shutdown_script(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
28457 * Set this feature as optional.
28459 void InitFeatures_set_gossip_queries_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
28462 * Set this feature as required.
28464 void InitFeatures_set_gossip_queries_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
28467 * Checks if this feature is supported.
28469 MUST_USE_RES bool InitFeatures_supports_gossip_queries(const struct LDKInitFeatures *NONNULL_PTR this_arg);
28472 * Set this feature as optional.
28474 void NodeFeatures_set_gossip_queries_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
28477 * Set this feature as required.
28479 void NodeFeatures_set_gossip_queries_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
28482 * Checks if this feature is supported.
28484 MUST_USE_RES bool NodeFeatures_supports_gossip_queries(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
28487 * Checks if this feature is required.
28489 MUST_USE_RES bool InitFeatures_requires_gossip_queries(const struct LDKInitFeatures *NONNULL_PTR this_arg);
28492 * Checks if this feature is required.
28494 MUST_USE_RES bool NodeFeatures_requires_gossip_queries(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
28497 * Set this feature as optional.
28499 void InitFeatures_set_variable_length_onion_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
28502 * Set this feature as required.
28504 void InitFeatures_set_variable_length_onion_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
28507 * Checks if this feature is supported.
28509 MUST_USE_RES bool InitFeatures_supports_variable_length_onion(const struct LDKInitFeatures *NONNULL_PTR this_arg);
28512 * Set this feature as optional.
28514 void NodeFeatures_set_variable_length_onion_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
28517 * Set this feature as required.
28519 void NodeFeatures_set_variable_length_onion_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
28522 * Checks if this feature is supported.
28524 MUST_USE_RES bool NodeFeatures_supports_variable_length_onion(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
28527 * Set this feature as optional.
28529 void InvoiceFeatures_set_variable_length_onion_optional(struct LDKInvoiceFeatures *NONNULL_PTR this_arg);
28532 * Set this feature as required.
28534 void InvoiceFeatures_set_variable_length_onion_required(struct LDKInvoiceFeatures *NONNULL_PTR this_arg);
28537 * Checks if this feature is supported.
28539 MUST_USE_RES bool InvoiceFeatures_supports_variable_length_onion(const struct LDKInvoiceFeatures *NONNULL_PTR this_arg);
28542 * Checks if this feature is required.
28544 MUST_USE_RES bool InitFeatures_requires_variable_length_onion(const struct LDKInitFeatures *NONNULL_PTR this_arg);
28547 * Checks if this feature is required.
28549 MUST_USE_RES bool NodeFeatures_requires_variable_length_onion(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
28552 * Checks if this feature is required.
28554 MUST_USE_RES bool InvoiceFeatures_requires_variable_length_onion(const struct LDKInvoiceFeatures *NONNULL_PTR this_arg);
28557 * Set this feature as optional.
28559 void InitFeatures_set_static_remote_key_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
28562 * Set this feature as required.
28564 void InitFeatures_set_static_remote_key_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
28567 * Checks if this feature is supported.
28569 MUST_USE_RES bool InitFeatures_supports_static_remote_key(const struct LDKInitFeatures *NONNULL_PTR this_arg);
28572 * Set this feature as optional.
28574 void NodeFeatures_set_static_remote_key_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
28577 * Set this feature as required.
28579 void NodeFeatures_set_static_remote_key_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
28582 * Checks if this feature is supported.
28584 MUST_USE_RES bool NodeFeatures_supports_static_remote_key(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
28587 * Set this feature as optional.
28589 void ChannelTypeFeatures_set_static_remote_key_optional(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
28592 * Set this feature as required.
28594 void ChannelTypeFeatures_set_static_remote_key_required(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
28597 * Checks if this feature is supported.
28599 MUST_USE_RES bool ChannelTypeFeatures_supports_static_remote_key(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
28602 * Checks if this feature is required.
28604 MUST_USE_RES bool InitFeatures_requires_static_remote_key(const struct LDKInitFeatures *NONNULL_PTR this_arg);
28607 * Checks if this feature is required.
28609 MUST_USE_RES bool NodeFeatures_requires_static_remote_key(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
28612 * Checks if this feature is required.
28614 MUST_USE_RES bool ChannelTypeFeatures_requires_static_remote_key(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
28617 * Set this feature as optional.
28619 void InitFeatures_set_payment_secret_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
28622 * Set this feature as required.
28624 void InitFeatures_set_payment_secret_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
28627 * Checks if this feature is supported.
28629 MUST_USE_RES bool InitFeatures_supports_payment_secret(const struct LDKInitFeatures *NONNULL_PTR this_arg);
28632 * Set this feature as optional.
28634 void NodeFeatures_set_payment_secret_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
28637 * Set this feature as required.
28639 void NodeFeatures_set_payment_secret_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
28642 * Checks if this feature is supported.
28644 MUST_USE_RES bool NodeFeatures_supports_payment_secret(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
28647 * Set this feature as optional.
28649 void InvoiceFeatures_set_payment_secret_optional(struct LDKInvoiceFeatures *NONNULL_PTR this_arg);
28652 * Set this feature as required.
28654 void InvoiceFeatures_set_payment_secret_required(struct LDKInvoiceFeatures *NONNULL_PTR this_arg);
28657 * Checks if this feature is supported.
28659 MUST_USE_RES bool InvoiceFeatures_supports_payment_secret(const struct LDKInvoiceFeatures *NONNULL_PTR this_arg);
28662 * Checks if this feature is required.
28664 MUST_USE_RES bool InitFeatures_requires_payment_secret(const struct LDKInitFeatures *NONNULL_PTR this_arg);
28667 * Checks if this feature is required.
28669 MUST_USE_RES bool NodeFeatures_requires_payment_secret(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
28672 * Checks if this feature is required.
28674 MUST_USE_RES bool InvoiceFeatures_requires_payment_secret(const struct LDKInvoiceFeatures *NONNULL_PTR this_arg);
28677 * Set this feature as optional.
28679 void InitFeatures_set_basic_mpp_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
28682 * Set this feature as required.
28684 void InitFeatures_set_basic_mpp_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
28687 * Checks if this feature is supported.
28689 MUST_USE_RES bool InitFeatures_supports_basic_mpp(const struct LDKInitFeatures *NONNULL_PTR this_arg);
28692 * Set this feature as optional.
28694 void NodeFeatures_set_basic_mpp_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
28697 * Set this feature as required.
28699 void NodeFeatures_set_basic_mpp_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
28702 * Checks if this feature is supported.
28704 MUST_USE_RES bool NodeFeatures_supports_basic_mpp(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
28707 * Set this feature as optional.
28709 void InvoiceFeatures_set_basic_mpp_optional(struct LDKInvoiceFeatures *NONNULL_PTR this_arg);
28712 * Set this feature as required.
28714 void InvoiceFeatures_set_basic_mpp_required(struct LDKInvoiceFeatures *NONNULL_PTR this_arg);
28717 * Checks if this feature is supported.
28719 MUST_USE_RES bool InvoiceFeatures_supports_basic_mpp(const struct LDKInvoiceFeatures *NONNULL_PTR this_arg);
28722 * Checks if this feature is required.
28724 MUST_USE_RES bool InitFeatures_requires_basic_mpp(const struct LDKInitFeatures *NONNULL_PTR this_arg);
28727 * Checks if this feature is required.
28729 MUST_USE_RES bool NodeFeatures_requires_basic_mpp(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
28732 * Checks if this feature is required.
28734 MUST_USE_RES bool InvoiceFeatures_requires_basic_mpp(const struct LDKInvoiceFeatures *NONNULL_PTR this_arg);
28737 * Set this feature as optional.
28739 void InitFeatures_set_wumbo_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
28742 * Set this feature as required.
28744 void InitFeatures_set_wumbo_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
28747 * Checks if this feature is supported.
28749 MUST_USE_RES bool InitFeatures_supports_wumbo(const struct LDKInitFeatures *NONNULL_PTR this_arg);
28752 * Set this feature as optional.
28754 void NodeFeatures_set_wumbo_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
28757 * Set this feature as required.
28759 void NodeFeatures_set_wumbo_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
28762 * Checks if this feature is supported.
28764 MUST_USE_RES bool NodeFeatures_supports_wumbo(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
28767 * Checks if this feature is required.
28769 MUST_USE_RES bool InitFeatures_requires_wumbo(const struct LDKInitFeatures *NONNULL_PTR this_arg);
28772 * Checks if this feature is required.
28774 MUST_USE_RES bool NodeFeatures_requires_wumbo(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
28777 * Set this feature as optional.
28779 void InitFeatures_set_shutdown_any_segwit_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
28782 * Set this feature as required.
28784 void InitFeatures_set_shutdown_any_segwit_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
28787 * Checks if this feature is supported.
28789 MUST_USE_RES bool InitFeatures_supports_shutdown_anysegwit(const struct LDKInitFeatures *NONNULL_PTR this_arg);
28792 * Set this feature as optional.
28794 void NodeFeatures_set_shutdown_any_segwit_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
28797 * Set this feature as required.
28799 void NodeFeatures_set_shutdown_any_segwit_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
28802 * Checks if this feature is supported.
28804 MUST_USE_RES bool NodeFeatures_supports_shutdown_anysegwit(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
28807 * Checks if this feature is required.
28809 MUST_USE_RES bool InitFeatures_requires_shutdown_anysegwit(const struct LDKInitFeatures *NONNULL_PTR this_arg);
28812 * Checks if this feature is required.
28814 MUST_USE_RES bool NodeFeatures_requires_shutdown_anysegwit(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
28817 * Set this feature as optional.
28819 void InitFeatures_set_onion_messages_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
28822 * Set this feature as required.
28824 void InitFeatures_set_onion_messages_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
28827 * Checks if this feature is supported.
28829 MUST_USE_RES bool InitFeatures_supports_onion_messages(const struct LDKInitFeatures *NONNULL_PTR this_arg);
28832 * Set this feature as optional.
28834 void NodeFeatures_set_onion_messages_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
28837 * Set this feature as required.
28839 void NodeFeatures_set_onion_messages_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
28842 * Checks if this feature is supported.
28844 MUST_USE_RES bool NodeFeatures_supports_onion_messages(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
28847 * Checks if this feature is required.
28849 MUST_USE_RES bool InitFeatures_requires_onion_messages(const struct LDKInitFeatures *NONNULL_PTR this_arg);
28852 * Checks if this feature is required.
28854 MUST_USE_RES bool NodeFeatures_requires_onion_messages(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
28857 * Set this feature as optional.
28859 void InitFeatures_set_channel_type_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
28862 * Set this feature as required.
28864 void InitFeatures_set_channel_type_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
28867 * Checks if this feature is supported.
28869 MUST_USE_RES bool InitFeatures_supports_channel_type(const struct LDKInitFeatures *NONNULL_PTR this_arg);
28872 * Set this feature as optional.
28874 void NodeFeatures_set_channel_type_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
28877 * Set this feature as required.
28879 void NodeFeatures_set_channel_type_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
28882 * Checks if this feature is supported.
28884 MUST_USE_RES bool NodeFeatures_supports_channel_type(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
28887 * Checks if this feature is required.
28889 MUST_USE_RES bool InitFeatures_requires_channel_type(const struct LDKInitFeatures *NONNULL_PTR this_arg);
28892 * Checks if this feature is required.
28894 MUST_USE_RES bool NodeFeatures_requires_channel_type(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
28897 * Set this feature as optional.
28899 void InitFeatures_set_scid_privacy_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
28902 * Set this feature as required.
28904 void InitFeatures_set_scid_privacy_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
28907 * Checks if this feature is supported.
28909 MUST_USE_RES bool InitFeatures_supports_scid_privacy(const struct LDKInitFeatures *NONNULL_PTR this_arg);
28912 * Set this feature as optional.
28914 void NodeFeatures_set_scid_privacy_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
28917 * Set this feature as required.
28919 void NodeFeatures_set_scid_privacy_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
28922 * Checks if this feature is supported.
28924 MUST_USE_RES bool NodeFeatures_supports_scid_privacy(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
28927 * Set this feature as optional.
28929 void ChannelTypeFeatures_set_scid_privacy_optional(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
28932 * Set this feature as required.
28934 void ChannelTypeFeatures_set_scid_privacy_required(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
28937 * Checks if this feature is supported.
28939 MUST_USE_RES bool ChannelTypeFeatures_supports_scid_privacy(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
28942 * Checks if this feature is required.
28944 MUST_USE_RES bool InitFeatures_requires_scid_privacy(const struct LDKInitFeatures *NONNULL_PTR this_arg);
28947 * Checks if this feature is required.
28949 MUST_USE_RES bool NodeFeatures_requires_scid_privacy(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
28952 * Checks if this feature is required.
28954 MUST_USE_RES bool ChannelTypeFeatures_requires_scid_privacy(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
28957 * Set this feature as optional.
28959 void InitFeatures_set_zero_conf_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
28962 * Set this feature as required.
28964 void InitFeatures_set_zero_conf_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
28967 * Checks if this feature is supported.
28969 MUST_USE_RES bool InitFeatures_supports_zero_conf(const struct LDKInitFeatures *NONNULL_PTR this_arg);
28972 * Set this feature as optional.
28974 void NodeFeatures_set_zero_conf_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
28977 * Set this feature as required.
28979 void NodeFeatures_set_zero_conf_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
28982 * Checks if this feature is supported.
28984 MUST_USE_RES bool NodeFeatures_supports_zero_conf(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
28987 * Set this feature as optional.
28989 void ChannelTypeFeatures_set_zero_conf_optional(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
28992 * Set this feature as required.
28994 void ChannelTypeFeatures_set_zero_conf_required(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
28997 * Checks if this feature is supported.
28999 MUST_USE_RES bool ChannelTypeFeatures_supports_zero_conf(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
29002 * Checks if this feature is required.
29004 MUST_USE_RES bool InitFeatures_requires_zero_conf(const struct LDKInitFeatures *NONNULL_PTR this_arg);
29007 * Checks if this feature is required.
29009 MUST_USE_RES bool NodeFeatures_requires_zero_conf(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
29012 * Checks if this feature is required.
29014 MUST_USE_RES bool ChannelTypeFeatures_requires_zero_conf(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
29017 * Set this feature as optional.
29019 void NodeFeatures_set_keysend_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
29022 * Set this feature as required.
29024 void NodeFeatures_set_keysend_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
29027 * Checks if this feature is supported.
29029 MUST_USE_RES bool NodeFeatures_supports_keysend(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
29032 * Checks if this feature is required.
29034 MUST_USE_RES bool NodeFeatures_requires_keysend(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
29037 * Frees any resources used by the ShutdownScript, if is_owned is set and inner is non-NULL.
29039 void ShutdownScript_free(struct LDKShutdownScript this_obj);
29042 * Creates a copy of the ShutdownScript
29044 struct LDKShutdownScript ShutdownScript_clone(const struct LDKShutdownScript *NONNULL_PTR orig);
29047 * Checks if two ShutdownScripts contain equal inner contents.
29048 * This ignores pointers and is_owned flags and looks at the values in fields.
29049 * Two objects with NULL inner values will be considered "equal" here.
29051 bool ShutdownScript_eq(const struct LDKShutdownScript *NONNULL_PTR a, const struct LDKShutdownScript *NONNULL_PTR b);
29054 * Frees any resources used by the InvalidShutdownScript, if is_owned is set and inner is non-NULL.
29056 void InvalidShutdownScript_free(struct LDKInvalidShutdownScript this_obj);
29059 * The script that did not meet the requirements from [BOLT #2].
29061 * [BOLT #2]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md
29063 struct LDKu8slice InvalidShutdownScript_get_script(const struct LDKInvalidShutdownScript *NONNULL_PTR this_ptr);
29066 * The script that did not meet the requirements from [BOLT #2].
29068 * [BOLT #2]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md
29070 void InvalidShutdownScript_set_script(struct LDKInvalidShutdownScript *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val);
29073 * Constructs a new InvalidShutdownScript given each field
29075 MUST_USE_RES struct LDKInvalidShutdownScript InvalidShutdownScript_new(struct LDKCVec_u8Z script_arg);
29078 * Creates a copy of the InvalidShutdownScript
29080 struct LDKInvalidShutdownScript InvalidShutdownScript_clone(const struct LDKInvalidShutdownScript *NONNULL_PTR orig);
29083 * Serialize the ShutdownScript object into a byte array which can be read by ShutdownScript_read
29085 struct LDKCVec_u8Z ShutdownScript_write(const struct LDKShutdownScript *NONNULL_PTR obj);
29088 * Read a ShutdownScript from a byte array, created by ShutdownScript_write
29090 struct LDKCResult_ShutdownScriptDecodeErrorZ ShutdownScript_read(struct LDKu8slice ser);
29093 * Generates a P2WPKH script pubkey from the given [`WPubkeyHash`].
29095 MUST_USE_RES struct LDKShutdownScript ShutdownScript_new_p2wpkh(const uint8_t (*pubkey_hash)[20]);
29098 * Generates a P2WSH script pubkey from the given [`WScriptHash`].
29100 MUST_USE_RES struct LDKShutdownScript ShutdownScript_new_p2wsh(const uint8_t (*script_hash)[32]);
29103 * Generates a witness script pubkey from the given segwit version and program.
29105 * Note for version-zero witness scripts you must use [`ShutdownScript::new_p2wpkh`] or
29106 * [`ShutdownScript::new_p2wsh`] instead.
29110 * This function may return an error if `program` is invalid for the segwit `version`.
29112 MUST_USE_RES struct LDKCResult_ShutdownScriptInvalidShutdownScriptZ ShutdownScript_new_witness_program(struct LDKWitnessVersion version, struct LDKu8slice program);
29115 * Converts the shutdown script into the underlying [`Script`].
29117 MUST_USE_RES struct LDKCVec_u8Z ShutdownScript_into_inner(struct LDKShutdownScript this_arg);
29120 * Returns the [`PublicKey`] used for a P2WPKH shutdown script if constructed directly from it.
29122 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
29124 MUST_USE_RES struct LDKPublicKey ShutdownScript_as_legacy_pubkey(const struct LDKShutdownScript *NONNULL_PTR this_arg);
29127 * Returns whether the shutdown script is compatible with the features as defined by BOLT #2.
29129 * Specifically, checks for compliance with feature `option_shutdown_anysegwit`.
29131 MUST_USE_RES bool ShutdownScript_is_compatible(const struct LDKShutdownScript *NONNULL_PTR this_arg, const struct LDKInitFeatures *NONNULL_PTR features);
29134 * Calls the free function if one is set
29136 void CustomMessageReader_free(struct LDKCustomMessageReader this_ptr);
29139 * Calls the free function if one is set
29141 void Type_free(struct LDKType this_ptr);
29144 * Frees any resources used by the NodeId, if is_owned is set and inner is non-NULL.
29146 void NodeId_free(struct LDKNodeId this_obj);
29149 * Creates a copy of the NodeId
29151 struct LDKNodeId NodeId_clone(const struct LDKNodeId *NONNULL_PTR orig);
29154 * Create a new NodeId from a public key
29156 MUST_USE_RES struct LDKNodeId NodeId_from_pubkey(struct LDKPublicKey pubkey);
29159 * Get the public key slice from this NodeId
29161 MUST_USE_RES struct LDKu8slice NodeId_as_slice(const struct LDKNodeId *NONNULL_PTR this_arg);
29164 * Checks if two NodeIds contain equal inner contents.
29166 uint64_t NodeId_hash(const struct LDKNodeId *NONNULL_PTR o);
29169 * Serialize the NodeId object into a byte array which can be read by NodeId_read
29171 struct LDKCVec_u8Z NodeId_write(const struct LDKNodeId *NONNULL_PTR obj);
29174 * Read a NodeId from a byte array, created by NodeId_write
29176 struct LDKCResult_NodeIdDecodeErrorZ NodeId_read(struct LDKu8slice ser);
29179 * Frees any resources used by the NetworkGraph, if is_owned is set and inner is non-NULL.
29181 void NetworkGraph_free(struct LDKNetworkGraph this_obj);
29184 * Frees any resources used by the ReadOnlyNetworkGraph, if is_owned is set and inner is non-NULL.
29186 void ReadOnlyNetworkGraph_free(struct LDKReadOnlyNetworkGraph this_obj);
29189 * Frees any resources used by the NetworkUpdate
29191 void NetworkUpdate_free(struct LDKNetworkUpdate this_ptr);
29194 * Creates a copy of the NetworkUpdate
29196 struct LDKNetworkUpdate NetworkUpdate_clone(const struct LDKNetworkUpdate *NONNULL_PTR orig);
29199 * Utility method to constructs a new ChannelUpdateMessage-variant NetworkUpdate
29201 struct LDKNetworkUpdate NetworkUpdate_channel_update_message(struct LDKChannelUpdate msg);
29204 * Utility method to constructs a new ChannelFailure-variant NetworkUpdate
29206 struct LDKNetworkUpdate NetworkUpdate_channel_failure(uint64_t short_channel_id, bool is_permanent);
29209 * Utility method to constructs a new NodeFailure-variant NetworkUpdate
29211 struct LDKNetworkUpdate NetworkUpdate_node_failure(struct LDKPublicKey node_id, bool is_permanent);
29214 * Checks if two NetworkUpdates contain equal inner contents.
29215 * This ignores pointers and is_owned flags and looks at the values in fields.
29217 bool NetworkUpdate_eq(const struct LDKNetworkUpdate *NONNULL_PTR a, const struct LDKNetworkUpdate *NONNULL_PTR b);
29220 * Serialize the NetworkUpdate object into a byte array which can be read by NetworkUpdate_read
29222 struct LDKCVec_u8Z NetworkUpdate_write(const struct LDKNetworkUpdate *NONNULL_PTR obj);
29225 * Read a NetworkUpdate from a byte array, created by NetworkUpdate_write
29227 struct LDKCResult_COption_NetworkUpdateZDecodeErrorZ NetworkUpdate_read(struct LDKu8slice ser);
29230 * Frees any resources used by the P2PGossipSync, if is_owned is set and inner is non-NULL.
29232 void P2PGossipSync_free(struct LDKP2PGossipSync this_obj);
29235 * Creates a new tracker of the actual state of the network of channels and nodes,
29236 * assuming an existing Network Graph.
29237 * Chain monitor is used to make sure announced channels exist on-chain,
29238 * channel data is correct, and that the announcement is signed with
29239 * channel owners' keys.
29241 MUST_USE_RES struct LDKP2PGossipSync P2PGossipSync_new(const struct LDKNetworkGraph *NONNULL_PTR network_graph, struct LDKCOption_AccessZ chain_access, struct LDKLogger logger);
29244 * Adds a provider used to check new announcements. Does not affect
29245 * existing announcements unless they are updated.
29246 * Add, update or remove the provider would replace the current one.
29248 void P2PGossipSync_add_chain_access(struct LDKP2PGossipSync *NONNULL_PTR this_arg, struct LDKCOption_AccessZ chain_access);
29251 * Handles any network updates originating from [`Event`]s.
29253 * [`Event`]: crate::util::events::Event
29255 void NetworkGraph_handle_network_update(const struct LDKNetworkGraph *NONNULL_PTR this_arg, const struct LDKNetworkUpdate *NONNULL_PTR network_update);
29258 * Constructs a new RoutingMessageHandler which calls the relevant methods on this_arg.
29259 * This copies the `inner` pointer in this_arg and thus the returned RoutingMessageHandler must be freed before this_arg is
29261 struct LDKRoutingMessageHandler P2PGossipSync_as_RoutingMessageHandler(const struct LDKP2PGossipSync *NONNULL_PTR this_arg);
29264 * Constructs a new MessageSendEventsProvider which calls the relevant methods on this_arg.
29265 * This copies the `inner` pointer in this_arg and thus the returned MessageSendEventsProvider must be freed before this_arg is
29267 struct LDKMessageSendEventsProvider P2PGossipSync_as_MessageSendEventsProvider(const struct LDKP2PGossipSync *NONNULL_PTR this_arg);
29270 * Frees any resources used by the ChannelUpdateInfo, if is_owned is set and inner is non-NULL.
29272 void ChannelUpdateInfo_free(struct LDKChannelUpdateInfo this_obj);
29275 * When the last update to the channel direction was issued.
29276 * Value is opaque, as set in the announcement.
29278 uint32_t ChannelUpdateInfo_get_last_update(const struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr);
29281 * When the last update to the channel direction was issued.
29282 * Value is opaque, as set in the announcement.
29284 void ChannelUpdateInfo_set_last_update(struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr, uint32_t val);
29287 * Whether the channel can be currently used for payments (in this one direction).
29289 bool ChannelUpdateInfo_get_enabled(const struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr);
29292 * Whether the channel can be currently used for payments (in this one direction).
29294 void ChannelUpdateInfo_set_enabled(struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr, bool val);
29297 * The difference in CLTV values that you must have when routing through this channel.
29299 uint16_t ChannelUpdateInfo_get_cltv_expiry_delta(const struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr);
29302 * The difference in CLTV values that you must have when routing through this channel.
29304 void ChannelUpdateInfo_set_cltv_expiry_delta(struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr, uint16_t val);
29307 * The minimum value, which must be relayed to the next hop via the channel
29309 uint64_t ChannelUpdateInfo_get_htlc_minimum_msat(const struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr);
29312 * The minimum value, which must be relayed to the next hop via the channel
29314 void ChannelUpdateInfo_set_htlc_minimum_msat(struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr, uint64_t val);
29317 * The maximum value which may be relayed to the next hop via the channel.
29319 uint64_t ChannelUpdateInfo_get_htlc_maximum_msat(const struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr);
29322 * The maximum value which may be relayed to the next hop via the channel.
29324 void ChannelUpdateInfo_set_htlc_maximum_msat(struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr, uint64_t val);
29327 * Fees charged when the channel is used for routing
29329 struct LDKRoutingFees ChannelUpdateInfo_get_fees(const struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr);
29332 * Fees charged when the channel is used for routing
29334 void ChannelUpdateInfo_set_fees(struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr, struct LDKRoutingFees val);
29337 * Most recent update for the channel received from the network
29338 * Mostly redundant with the data we store in fields explicitly.
29339 * Everything else is useful only for sending out for initial routing sync.
29340 * Not stored if contains excess data to prevent DoS.
29342 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
29344 struct LDKChannelUpdate ChannelUpdateInfo_get_last_update_message(const struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr);
29347 * Most recent update for the channel received from the network
29348 * Mostly redundant with the data we store in fields explicitly.
29349 * Everything else is useful only for sending out for initial routing sync.
29350 * Not stored if contains excess data to prevent DoS.
29352 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
29354 void ChannelUpdateInfo_set_last_update_message(struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr, struct LDKChannelUpdate val);
29357 * Constructs a new ChannelUpdateInfo given each field
29359 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);
29362 * Creates a copy of the ChannelUpdateInfo
29364 struct LDKChannelUpdateInfo ChannelUpdateInfo_clone(const struct LDKChannelUpdateInfo *NONNULL_PTR orig);
29367 * Checks if two ChannelUpdateInfos contain equal inner contents.
29368 * This ignores pointers and is_owned flags and looks at the values in fields.
29369 * Two objects with NULL inner values will be considered "equal" here.
29371 bool ChannelUpdateInfo_eq(const struct LDKChannelUpdateInfo *NONNULL_PTR a, const struct LDKChannelUpdateInfo *NONNULL_PTR b);
29374 * Serialize the ChannelUpdateInfo object into a byte array which can be read by ChannelUpdateInfo_read
29376 struct LDKCVec_u8Z ChannelUpdateInfo_write(const struct LDKChannelUpdateInfo *NONNULL_PTR obj);
29379 * Read a ChannelUpdateInfo from a byte array, created by ChannelUpdateInfo_write
29381 struct LDKCResult_ChannelUpdateInfoDecodeErrorZ ChannelUpdateInfo_read(struct LDKu8slice ser);
29384 * Frees any resources used by the ChannelInfo, if is_owned is set and inner is non-NULL.
29386 void ChannelInfo_free(struct LDKChannelInfo this_obj);
29389 * Protocol features of a channel communicated during its announcement
29391 struct LDKChannelFeatures ChannelInfo_get_features(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
29394 * Protocol features of a channel communicated during its announcement
29396 void ChannelInfo_set_features(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKChannelFeatures val);
29399 * Source node of the first direction of a channel
29401 struct LDKNodeId ChannelInfo_get_node_one(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
29404 * Source node of the first direction of a channel
29406 void ChannelInfo_set_node_one(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKNodeId val);
29409 * Details about the first direction of a channel
29411 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
29413 struct LDKChannelUpdateInfo ChannelInfo_get_one_to_two(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
29416 * Details about the first direction of a channel
29418 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
29420 void ChannelInfo_set_one_to_two(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKChannelUpdateInfo val);
29423 * Source node of the second direction of a channel
29425 struct LDKNodeId ChannelInfo_get_node_two(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
29428 * Source node of the second direction of a channel
29430 void ChannelInfo_set_node_two(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKNodeId val);
29433 * Details about the second direction of a channel
29435 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
29437 struct LDKChannelUpdateInfo ChannelInfo_get_two_to_one(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
29440 * Details about the second direction of a channel
29442 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
29444 void ChannelInfo_set_two_to_one(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKChannelUpdateInfo val);
29447 * The channel capacity as seen on-chain, if chain lookup is available.
29449 struct LDKCOption_u64Z ChannelInfo_get_capacity_sats(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
29452 * The channel capacity as seen on-chain, if chain lookup is available.
29454 void ChannelInfo_set_capacity_sats(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
29457 * An initial announcement of the channel
29458 * Mostly redundant with the data we store in fields explicitly.
29459 * Everything else is useful only for sending out for initial routing sync.
29460 * Not stored if contains excess data to prevent DoS.
29462 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
29464 struct LDKChannelAnnouncement ChannelInfo_get_announcement_message(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
29467 * An initial announcement of the channel
29468 * Mostly redundant with the data we store in fields explicitly.
29469 * Everything else is useful only for sending out for initial routing sync.
29470 * Not stored if contains excess data to prevent DoS.
29472 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
29474 void ChannelInfo_set_announcement_message(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKChannelAnnouncement val);
29477 * Creates a copy of the ChannelInfo
29479 struct LDKChannelInfo ChannelInfo_clone(const struct LDKChannelInfo *NONNULL_PTR orig);
29482 * Checks if two ChannelInfos contain equal inner contents.
29483 * This ignores pointers and is_owned flags and looks at the values in fields.
29484 * Two objects with NULL inner values will be considered "equal" here.
29486 bool ChannelInfo_eq(const struct LDKChannelInfo *NONNULL_PTR a, const struct LDKChannelInfo *NONNULL_PTR b);
29489 * Returns a [`ChannelUpdateInfo`] based on the direction implied by the channel_flag.
29491 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
29493 MUST_USE_RES struct LDKChannelUpdateInfo ChannelInfo_get_directional_info(const struct LDKChannelInfo *NONNULL_PTR this_arg, uint8_t channel_flags);
29496 * Serialize the ChannelInfo object into a byte array which can be read by ChannelInfo_read
29498 struct LDKCVec_u8Z ChannelInfo_write(const struct LDKChannelInfo *NONNULL_PTR obj);
29501 * Read a ChannelInfo from a byte array, created by ChannelInfo_write
29503 struct LDKCResult_ChannelInfoDecodeErrorZ ChannelInfo_read(struct LDKu8slice ser);
29506 * Frees any resources used by the DirectedChannelInfo, if is_owned is set and inner is non-NULL.
29508 void DirectedChannelInfo_free(struct LDKDirectedChannelInfo this_obj);
29511 * Creates a copy of the DirectedChannelInfo
29513 struct LDKDirectedChannelInfo DirectedChannelInfo_clone(const struct LDKDirectedChannelInfo *NONNULL_PTR orig);
29516 * Returns information for the channel.
29518 MUST_USE_RES struct LDKChannelInfo DirectedChannelInfo_channel(const struct LDKDirectedChannelInfo *NONNULL_PTR this_arg);
29521 * Returns the maximum HTLC amount allowed over the channel in the direction.
29523 MUST_USE_RES uint64_t DirectedChannelInfo_htlc_maximum_msat(const struct LDKDirectedChannelInfo *NONNULL_PTR this_arg);
29526 * Returns the [`EffectiveCapacity`] of the channel in the direction.
29528 * This is either the total capacity from the funding transaction, if known, or the
29529 * `htlc_maximum_msat` for the direction as advertised by the gossip network, if known,
29532 MUST_USE_RES struct LDKEffectiveCapacity DirectedChannelInfo_effective_capacity(const struct LDKDirectedChannelInfo *NONNULL_PTR this_arg);
29535 * Frees any resources used by the EffectiveCapacity
29537 void EffectiveCapacity_free(struct LDKEffectiveCapacity this_ptr);
29540 * Creates a copy of the EffectiveCapacity
29542 struct LDKEffectiveCapacity EffectiveCapacity_clone(const struct LDKEffectiveCapacity *NONNULL_PTR orig);
29545 * Utility method to constructs a new ExactLiquidity-variant EffectiveCapacity
29547 struct LDKEffectiveCapacity EffectiveCapacity_exact_liquidity(uint64_t liquidity_msat);
29550 * Utility method to constructs a new MaximumHTLC-variant EffectiveCapacity
29552 struct LDKEffectiveCapacity EffectiveCapacity_maximum_htlc(uint64_t amount_msat);
29555 * Utility method to constructs a new Total-variant EffectiveCapacity
29557 struct LDKEffectiveCapacity EffectiveCapacity_total(uint64_t capacity_msat, uint64_t htlc_maximum_msat);
29560 * Utility method to constructs a new Infinite-variant EffectiveCapacity
29562 struct LDKEffectiveCapacity EffectiveCapacity_infinite(void);
29565 * Utility method to constructs a new Unknown-variant EffectiveCapacity
29567 struct LDKEffectiveCapacity EffectiveCapacity_unknown(void);
29570 * Returns the effective capacity denominated in millisatoshi.
29572 MUST_USE_RES uint64_t EffectiveCapacity_as_msat(const struct LDKEffectiveCapacity *NONNULL_PTR this_arg);
29575 * Frees any resources used by the RoutingFees, if is_owned is set and inner is non-NULL.
29577 void RoutingFees_free(struct LDKRoutingFees this_obj);
29580 * Flat routing fee in satoshis
29582 uint32_t RoutingFees_get_base_msat(const struct LDKRoutingFees *NONNULL_PTR this_ptr);
29585 * Flat routing fee in satoshis
29587 void RoutingFees_set_base_msat(struct LDKRoutingFees *NONNULL_PTR this_ptr, uint32_t val);
29590 * Liquidity-based routing fee in millionths of a routed amount.
29591 * In other words, 10000 is 1%.
29593 uint32_t RoutingFees_get_proportional_millionths(const struct LDKRoutingFees *NONNULL_PTR this_ptr);
29596 * Liquidity-based routing fee in millionths of a routed amount.
29597 * In other words, 10000 is 1%.
29599 void RoutingFees_set_proportional_millionths(struct LDKRoutingFees *NONNULL_PTR this_ptr, uint32_t val);
29602 * Constructs a new RoutingFees given each field
29604 MUST_USE_RES struct LDKRoutingFees RoutingFees_new(uint32_t base_msat_arg, uint32_t proportional_millionths_arg);
29607 * Checks if two RoutingFeess contain equal inner contents.
29608 * This ignores pointers and is_owned flags and looks at the values in fields.
29609 * Two objects with NULL inner values will be considered "equal" here.
29611 bool RoutingFees_eq(const struct LDKRoutingFees *NONNULL_PTR a, const struct LDKRoutingFees *NONNULL_PTR b);
29614 * Creates a copy of the RoutingFees
29616 struct LDKRoutingFees RoutingFees_clone(const struct LDKRoutingFees *NONNULL_PTR orig);
29619 * Checks if two RoutingFeess contain equal inner contents.
29621 uint64_t RoutingFees_hash(const struct LDKRoutingFees *NONNULL_PTR o);
29624 * Serialize the RoutingFees object into a byte array which can be read by RoutingFees_read
29626 struct LDKCVec_u8Z RoutingFees_write(const struct LDKRoutingFees *NONNULL_PTR obj);
29629 * Read a RoutingFees from a byte array, created by RoutingFees_write
29631 struct LDKCResult_RoutingFeesDecodeErrorZ RoutingFees_read(struct LDKu8slice ser);
29634 * Frees any resources used by the NodeAnnouncementInfo, if is_owned is set and inner is non-NULL.
29636 void NodeAnnouncementInfo_free(struct LDKNodeAnnouncementInfo this_obj);
29639 * Protocol features the node announced support for
29641 struct LDKNodeFeatures NodeAnnouncementInfo_get_features(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr);
29644 * Protocol features the node announced support for
29646 void NodeAnnouncementInfo_set_features(struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr, struct LDKNodeFeatures val);
29649 * When the last known update to the node state was issued.
29650 * Value is opaque, as set in the announcement.
29652 uint32_t NodeAnnouncementInfo_get_last_update(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr);
29655 * When the last known update to the node state was issued.
29656 * Value is opaque, as set in the announcement.
29658 void NodeAnnouncementInfo_set_last_update(struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr, uint32_t val);
29661 * Color assigned to the node
29663 const uint8_t (*NodeAnnouncementInfo_get_rgb(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr))[3];
29666 * Color assigned to the node
29668 void NodeAnnouncementInfo_set_rgb(struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr, struct LDKThreeBytes val);
29671 * Moniker assigned to the node.
29672 * May be invalid or malicious (eg control chars),
29673 * should not be exposed to the user.
29675 struct LDKNodeAlias NodeAnnouncementInfo_get_alias(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr);
29678 * Moniker assigned to the node.
29679 * May be invalid or malicious (eg control chars),
29680 * should not be exposed to the user.
29682 void NodeAnnouncementInfo_set_alias(struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr, struct LDKNodeAlias val);
29685 * Internet-level addresses via which one can connect to the node
29687 * Returns a copy of the field.
29689 struct LDKCVec_NetAddressZ NodeAnnouncementInfo_get_addresses(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr);
29692 * Internet-level addresses via which one can connect to the node
29694 void NodeAnnouncementInfo_set_addresses(struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr, struct LDKCVec_NetAddressZ val);
29697 * An initial announcement of the node
29698 * Mostly redundant with the data we store in fields explicitly.
29699 * Everything else is useful only for sending out for initial routing sync.
29700 * Not stored if contains excess data to prevent DoS.
29702 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
29704 struct LDKNodeAnnouncement NodeAnnouncementInfo_get_announcement_message(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr);
29707 * An initial announcement of the node
29708 * Mostly redundant with the data we store in fields explicitly.
29709 * Everything else is useful only for sending out for initial routing sync.
29710 * Not stored if contains excess data to prevent DoS.
29712 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
29714 void NodeAnnouncementInfo_set_announcement_message(struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr, struct LDKNodeAnnouncement val);
29717 * Constructs a new NodeAnnouncementInfo given each field
29719 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 LDKCVec_NetAddressZ addresses_arg, struct LDKNodeAnnouncement announcement_message_arg);
29722 * Creates a copy of the NodeAnnouncementInfo
29724 struct LDKNodeAnnouncementInfo NodeAnnouncementInfo_clone(const struct LDKNodeAnnouncementInfo *NONNULL_PTR orig);
29727 * Checks if two NodeAnnouncementInfos contain equal inner contents.
29728 * This ignores pointers and is_owned flags and looks at the values in fields.
29729 * Two objects with NULL inner values will be considered "equal" here.
29731 bool NodeAnnouncementInfo_eq(const struct LDKNodeAnnouncementInfo *NONNULL_PTR a, const struct LDKNodeAnnouncementInfo *NONNULL_PTR b);
29734 * Serialize the NodeAnnouncementInfo object into a byte array which can be read by NodeAnnouncementInfo_read
29736 struct LDKCVec_u8Z NodeAnnouncementInfo_write(const struct LDKNodeAnnouncementInfo *NONNULL_PTR obj);
29739 * Read a NodeAnnouncementInfo from a byte array, created by NodeAnnouncementInfo_write
29741 struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ NodeAnnouncementInfo_read(struct LDKu8slice ser);
29744 * Frees any resources used by the NodeAlias, if is_owned is set and inner is non-NULL.
29746 void NodeAlias_free(struct LDKNodeAlias this_obj);
29748 const uint8_t (*NodeAlias_get_a(const struct LDKNodeAlias *NONNULL_PTR this_ptr))[32];
29750 void NodeAlias_set_a(struct LDKNodeAlias *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
29753 * Constructs a new NodeAlias given each field
29755 MUST_USE_RES struct LDKNodeAlias NodeAlias_new(struct LDKThirtyTwoBytes a_arg);
29758 * Creates a copy of the NodeAlias
29760 struct LDKNodeAlias NodeAlias_clone(const struct LDKNodeAlias *NONNULL_PTR orig);
29763 * Checks if two NodeAliass contain equal inner contents.
29764 * This ignores pointers and is_owned flags and looks at the values in fields.
29765 * Two objects with NULL inner values will be considered "equal" here.
29767 bool NodeAlias_eq(const struct LDKNodeAlias *NONNULL_PTR a, const struct LDKNodeAlias *NONNULL_PTR b);
29770 * Serialize the NodeAlias object into a byte array which can be read by NodeAlias_read
29772 struct LDKCVec_u8Z NodeAlias_write(const struct LDKNodeAlias *NONNULL_PTR obj);
29775 * Read a NodeAlias from a byte array, created by NodeAlias_write
29777 struct LDKCResult_NodeAliasDecodeErrorZ NodeAlias_read(struct LDKu8slice ser);
29780 * Frees any resources used by the NodeInfo, if is_owned is set and inner is non-NULL.
29782 void NodeInfo_free(struct LDKNodeInfo this_obj);
29785 * All valid channels a node has announced
29787 * Returns a copy of the field.
29789 struct LDKCVec_u64Z NodeInfo_get_channels(const struct LDKNodeInfo *NONNULL_PTR this_ptr);
29792 * All valid channels a node has announced
29794 void NodeInfo_set_channels(struct LDKNodeInfo *NONNULL_PTR this_ptr, struct LDKCVec_u64Z val);
29797 * Lowest fees enabling routing via any of the enabled, known channels to a node.
29798 * The two fields (flat and proportional fee) are independent,
29799 * meaning they don't have to refer to the same channel.
29801 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
29803 struct LDKRoutingFees NodeInfo_get_lowest_inbound_channel_fees(const struct LDKNodeInfo *NONNULL_PTR this_ptr);
29806 * Lowest fees enabling routing via any of the enabled, known channels to a node.
29807 * The two fields (flat and proportional fee) are independent,
29808 * meaning they don't have to refer to the same channel.
29810 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
29812 void NodeInfo_set_lowest_inbound_channel_fees(struct LDKNodeInfo *NONNULL_PTR this_ptr, struct LDKRoutingFees val);
29815 * More information about a node from node_announcement.
29816 * Optional because we store a Node entry after learning about it from
29817 * a channel announcement, but before receiving a node announcement.
29819 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
29821 struct LDKNodeAnnouncementInfo NodeInfo_get_announcement_info(const struct LDKNodeInfo *NONNULL_PTR this_ptr);
29824 * More information about a node from node_announcement.
29825 * Optional because we store a Node entry after learning about it from
29826 * a channel announcement, but before receiving a node announcement.
29828 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
29830 void NodeInfo_set_announcement_info(struct LDKNodeInfo *NONNULL_PTR this_ptr, struct LDKNodeAnnouncementInfo val);
29833 * Constructs a new NodeInfo given each field
29835 MUST_USE_RES struct LDKNodeInfo NodeInfo_new(struct LDKCVec_u64Z channels_arg, struct LDKRoutingFees lowest_inbound_channel_fees_arg, struct LDKNodeAnnouncementInfo announcement_info_arg);
29838 * Creates a copy of the NodeInfo
29840 struct LDKNodeInfo NodeInfo_clone(const struct LDKNodeInfo *NONNULL_PTR orig);
29843 * Checks if two NodeInfos contain equal inner contents.
29844 * This ignores pointers and is_owned flags and looks at the values in fields.
29845 * Two objects with NULL inner values will be considered "equal" here.
29847 bool NodeInfo_eq(const struct LDKNodeInfo *NONNULL_PTR a, const struct LDKNodeInfo *NONNULL_PTR b);
29850 * Serialize the NodeInfo object into a byte array which can be read by NodeInfo_read
29852 struct LDKCVec_u8Z NodeInfo_write(const struct LDKNodeInfo *NONNULL_PTR obj);
29855 * Read a NodeInfo from a byte array, created by NodeInfo_write
29857 struct LDKCResult_NodeInfoDecodeErrorZ NodeInfo_read(struct LDKu8slice ser);
29860 * Serialize the NetworkGraph object into a byte array which can be read by NetworkGraph_read
29862 struct LDKCVec_u8Z NetworkGraph_write(const struct LDKNetworkGraph *NONNULL_PTR obj);
29865 * Read a NetworkGraph from a byte array, created by NetworkGraph_write
29867 struct LDKCResult_NetworkGraphDecodeErrorZ NetworkGraph_read(struct LDKu8slice ser, struct LDKLogger arg);
29870 * Creates a new, empty, network graph.
29872 MUST_USE_RES struct LDKNetworkGraph NetworkGraph_new(struct LDKThirtyTwoBytes genesis_hash, struct LDKLogger logger);
29875 * Returns a read-only view of the network graph.
29877 MUST_USE_RES struct LDKReadOnlyNetworkGraph NetworkGraph_read_only(const struct LDKNetworkGraph *NONNULL_PTR this_arg);
29880 * The unix timestamp provided by the most recent rapid gossip sync.
29881 * It will be set by the rapid sync process after every sync completion.
29883 MUST_USE_RES struct LDKCOption_u32Z NetworkGraph_get_last_rapid_gossip_sync_timestamp(const struct LDKNetworkGraph *NONNULL_PTR this_arg);
29886 * Update the unix timestamp provided by the most recent rapid gossip sync.
29887 * This should be done automatically by the rapid sync process after every sync completion.
29889 void NetworkGraph_set_last_rapid_gossip_sync_timestamp(const struct LDKNetworkGraph *NONNULL_PTR this_arg, uint32_t last_rapid_gossip_sync_timestamp);
29892 * For an already known node (from channel announcements), update its stored properties from a
29893 * given node announcement.
29895 * You probably don't want to call this directly, instead relying on a P2PGossipSync's
29896 * RoutingMessageHandler implementation to call it indirectly. This may be useful to accept
29897 * routing messages from a source using a protocol other than the lightning P2P protocol.
29899 MUST_USE_RES struct LDKCResult_NoneLightningErrorZ NetworkGraph_update_node_from_announcement(const struct LDKNetworkGraph *NONNULL_PTR this_arg, const struct LDKNodeAnnouncement *NONNULL_PTR msg);
29902 * For an already known node (from channel announcements), update its stored properties from a
29903 * given node announcement without verifying the associated signatures. Because we aren't
29904 * given the associated signatures here we cannot relay the node announcement to any of our
29907 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);
29910 * Store or update channel info from a channel announcement.
29912 * You probably don't want to call this directly, instead relying on a P2PGossipSync's
29913 * RoutingMessageHandler implementation to call it indirectly. This may be useful to accept
29914 * routing messages from a source using a protocol other than the lightning P2P protocol.
29916 * If a `chain::Access` object is provided via `chain_access`, it will be called to verify
29917 * the corresponding UTXO exists on chain and is correctly-formatted.
29919 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_AccessZ chain_access);
29922 * Store or update channel info from a channel announcement without verifying the associated
29923 * signatures. Because we aren't given the associated signatures here we cannot relay the
29924 * channel announcement to any of our peers.
29926 * If a `chain::Access` object is provided via `chain_access`, it will be called to verify
29927 * the corresponding UTXO exists on chain and is correctly-formatted.
29929 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_AccessZ chain_access);
29932 * Update channel from partial announcement data received via rapid gossip sync
29934 * `timestamp: u64`: Timestamp emulating the backdated original announcement receipt (by the
29935 * rapid gossip sync server)
29937 * All other parameters as used in [`msgs::UnsignedChannelAnnouncement`] fields.
29939 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);
29942 * Marks a channel in the graph as failed if a corresponding HTLC fail was sent.
29943 * If permanent, removes a channel from the local storage.
29944 * May cause the removal of nodes too, if this was their last channel.
29945 * If not permanent, makes channels unavailable for routing.
29947 void NetworkGraph_channel_failed(const struct LDKNetworkGraph *NONNULL_PTR this_arg, uint64_t short_channel_id, bool is_permanent);
29950 * Marks a node in the graph as permanently failed, effectively removing it and its channels
29951 * from local storage.
29953 void NetworkGraph_node_failed_permanent(const struct LDKNetworkGraph *NONNULL_PTR this_arg, struct LDKPublicKey node_id);
29956 * Removes information about channels that we haven't heard any updates about in some time.
29957 * This can be used regularly to prune the network graph of channels that likely no longer
29960 * While there is no formal requirement that nodes regularly re-broadcast their channel
29961 * updates every two weeks, the non-normative section of BOLT 7 currently suggests that
29962 * pruning occur for updates which are at least two weeks old, which we implement here.
29964 * Note that for users of the `lightning-background-processor` crate this method may be
29965 * automatically called regularly for you.
29967 * This method will also cause us to stop tracking removed nodes and channels if they have been
29968 * in the map for a while so that these can be resynced from gossip in the future.
29970 * This method is only available with the `std` feature. See
29971 * [`NetworkGraph::remove_stale_channels_and_tracking_with_time`] for `no-std` use.
29973 void NetworkGraph_remove_stale_channels_and_tracking(const struct LDKNetworkGraph *NONNULL_PTR this_arg);
29976 * Removes information about channels that we haven't heard any updates about in some time.
29977 * This can be used regularly to prune the network graph of channels that likely no longer
29980 * While there is no formal requirement that nodes regularly re-broadcast their channel
29981 * updates every two weeks, the non-normative section of BOLT 7 currently suggests that
29982 * pruning occur for updates which are at least two weeks old, which we implement here.
29984 * This method will also cause us to stop tracking removed nodes and channels if they have been
29985 * in the map for a while so that these can be resynced from gossip in the future.
29987 * This function takes the current unix time as an argument. For users with the `std` feature
29988 * enabled, [`NetworkGraph::remove_stale_channels_and_tracking`] may be preferable.
29990 void NetworkGraph_remove_stale_channels_and_tracking_with_time(const struct LDKNetworkGraph *NONNULL_PTR this_arg, uint64_t current_time_unix);
29993 * For an already known (from announcement) channel, update info about one of the directions
29996 * You probably don't want to call this directly, instead relying on a P2PGossipSync's
29997 * RoutingMessageHandler implementation to call it indirectly. This may be useful to accept
29998 * routing messages from a source using a protocol other than the lightning P2P protocol.
30000 * If built with `no-std`, any updates with a timestamp more than two weeks in the past or
30001 * materially in the future will be rejected.
30003 MUST_USE_RES struct LDKCResult_NoneLightningErrorZ NetworkGraph_update_channel(const struct LDKNetworkGraph *NONNULL_PTR this_arg, const struct LDKChannelUpdate *NONNULL_PTR msg);
30006 * For an already known (from announcement) channel, update info about one of the directions
30007 * of the channel without verifying the associated signatures. Because we aren't given the
30008 * associated signatures here we cannot relay the channel update to any of our peers.
30010 * If built with `no-std`, any updates with a timestamp more than two weeks in the past or
30011 * materially in the future will be rejected.
30013 MUST_USE_RES struct LDKCResult_NoneLightningErrorZ NetworkGraph_update_channel_unsigned(const struct LDKNetworkGraph *NONNULL_PTR this_arg, const struct LDKUnsignedChannelUpdate *NONNULL_PTR msg);
30016 * Returns information on a channel with the given id.
30018 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
30020 MUST_USE_RES struct LDKChannelInfo ReadOnlyNetworkGraph_channel(const struct LDKReadOnlyNetworkGraph *NONNULL_PTR this_arg, uint64_t short_channel_id);
30023 * Returns the list of channels in the graph
30025 MUST_USE_RES struct LDKCVec_u64Z ReadOnlyNetworkGraph_list_channels(const struct LDKReadOnlyNetworkGraph *NONNULL_PTR this_arg);
30028 * Returns information on a node with the given id.
30030 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
30032 MUST_USE_RES struct LDKNodeInfo ReadOnlyNetworkGraph_node(const struct LDKReadOnlyNetworkGraph *NONNULL_PTR this_arg, const struct LDKNodeId *NONNULL_PTR node_id);
30035 * Returns the list of nodes in the graph
30037 MUST_USE_RES struct LDKCVec_NodeIdZ ReadOnlyNetworkGraph_list_nodes(const struct LDKReadOnlyNetworkGraph *NONNULL_PTR this_arg);
30040 * Get network addresses by node id.
30041 * Returns None if the requested node is completely unknown,
30042 * or if node announcement for the node was never received.
30044 MUST_USE_RES struct LDKCOption_CVec_NetAddressZZ ReadOnlyNetworkGraph_get_addresses(const struct LDKReadOnlyNetworkGraph *NONNULL_PTR this_arg, struct LDKPublicKey pubkey);
30047 * Frees any resources used by the DefaultRouter, if is_owned is set and inner is non-NULL.
30049 void DefaultRouter_free(struct LDKDefaultRouter this_obj);
30052 * Creates a new router.
30054 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);
30057 * Constructs a new Router which calls the relevant methods on this_arg.
30058 * This copies the `inner` pointer in this_arg and thus the returned Router must be freed before this_arg is
30060 struct LDKRouter DefaultRouter_as_Router(const struct LDKDefaultRouter *NONNULL_PTR this_arg);
30063 * Calls the free function if one is set
30065 void Router_free(struct LDKRouter this_ptr);
30068 * Frees any resources used by the ScorerAccountingForInFlightHtlcs, if is_owned is set and inner is non-NULL.
30070 void ScorerAccountingForInFlightHtlcs_free(struct LDKScorerAccountingForInFlightHtlcs this_obj);
30073 * Initialize a new `ScorerAccountingForInFlightHtlcs`.
30075 MUST_USE_RES struct LDKScorerAccountingForInFlightHtlcs ScorerAccountingForInFlightHtlcs_new(struct LDKScore scorer, struct LDKInFlightHtlcs inflight_htlcs);
30078 * Serialize the ScorerAccountingForInFlightHtlcs object into a byte array which can be read by ScorerAccountingForInFlightHtlcs_read
30080 struct LDKCVec_u8Z ScorerAccountingForInFlightHtlcs_write(const struct LDKScorerAccountingForInFlightHtlcs *NONNULL_PTR obj);
30083 * Constructs a new Score which calls the relevant methods on this_arg.
30084 * This copies the `inner` pointer in this_arg and thus the returned Score must be freed before this_arg is
30086 struct LDKScore ScorerAccountingForInFlightHtlcs_as_Score(const struct LDKScorerAccountingForInFlightHtlcs *NONNULL_PTR this_arg);
30089 * Frees any resources used by the InFlightHtlcs, if is_owned is set and inner is non-NULL.
30091 void InFlightHtlcs_free(struct LDKInFlightHtlcs this_obj);
30094 * Creates a copy of the InFlightHtlcs
30096 struct LDKInFlightHtlcs InFlightHtlcs_clone(const struct LDKInFlightHtlcs *NONNULL_PTR orig);
30099 * Constructs an empty `InFlightHtlcs`.
30101 MUST_USE_RES struct LDKInFlightHtlcs InFlightHtlcs_new(void);
30104 * Returns liquidity in msat given the public key of the HTLC source, target, and short channel
30107 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);
30110 * Serialize the InFlightHtlcs object into a byte array which can be read by InFlightHtlcs_read
30112 struct LDKCVec_u8Z InFlightHtlcs_write(const struct LDKInFlightHtlcs *NONNULL_PTR obj);
30115 * Read a InFlightHtlcs from a byte array, created by InFlightHtlcs_write
30117 struct LDKCResult_InFlightHtlcsDecodeErrorZ InFlightHtlcs_read(struct LDKu8slice ser);
30120 * Frees any resources used by the RouteHop, if is_owned is set and inner is non-NULL.
30122 void RouteHop_free(struct LDKRouteHop this_obj);
30125 * The node_id of the node at this hop.
30127 struct LDKPublicKey RouteHop_get_pubkey(const struct LDKRouteHop *NONNULL_PTR this_ptr);
30130 * The node_id of the node at this hop.
30132 void RouteHop_set_pubkey(struct LDKRouteHop *NONNULL_PTR this_ptr, struct LDKPublicKey val);
30135 * The node_announcement features of the node at this hop. For the last hop, these may be
30136 * amended to match the features present in the invoice this node generated.
30138 struct LDKNodeFeatures RouteHop_get_node_features(const struct LDKRouteHop *NONNULL_PTR this_ptr);
30141 * The node_announcement features of the node at this hop. For the last hop, these may be
30142 * amended to match the features present in the invoice this node generated.
30144 void RouteHop_set_node_features(struct LDKRouteHop *NONNULL_PTR this_ptr, struct LDKNodeFeatures val);
30147 * The channel that should be used from the previous hop to reach this node.
30149 uint64_t RouteHop_get_short_channel_id(const struct LDKRouteHop *NONNULL_PTR this_ptr);
30152 * The channel that should be used from the previous hop to reach this node.
30154 void RouteHop_set_short_channel_id(struct LDKRouteHop *NONNULL_PTR this_ptr, uint64_t val);
30157 * The channel_announcement features of the channel that should be used from the previous hop
30158 * to reach this node.
30160 struct LDKChannelFeatures RouteHop_get_channel_features(const struct LDKRouteHop *NONNULL_PTR this_ptr);
30163 * The channel_announcement features of the channel that should be used from the previous hop
30164 * to reach this node.
30166 void RouteHop_set_channel_features(struct LDKRouteHop *NONNULL_PTR this_ptr, struct LDKChannelFeatures val);
30169 * The fee taken on this hop (for paying for the use of the *next* channel in the path).
30170 * For the last hop, this should be the full value of the payment (might be more than
30171 * requested if we had to match htlc_minimum_msat).
30173 uint64_t RouteHop_get_fee_msat(const struct LDKRouteHop *NONNULL_PTR this_ptr);
30176 * The fee taken on this hop (for paying for the use of the *next* channel in the path).
30177 * For the last hop, this should be the full value of the payment (might be more than
30178 * requested if we had to match htlc_minimum_msat).
30180 void RouteHop_set_fee_msat(struct LDKRouteHop *NONNULL_PTR this_ptr, uint64_t val);
30183 * The CLTV delta added for this hop. For the last hop, this should be the full CLTV value
30184 * expected at the destination, in excess of the current block height.
30186 uint32_t RouteHop_get_cltv_expiry_delta(const struct LDKRouteHop *NONNULL_PTR this_ptr);
30189 * The CLTV delta added for this hop. For the last hop, this should be the full CLTV value
30190 * expected at the destination, in excess of the current block height.
30192 void RouteHop_set_cltv_expiry_delta(struct LDKRouteHop *NONNULL_PTR this_ptr, uint32_t val);
30195 * Constructs a new RouteHop given each field
30197 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);
30200 * Creates a copy of the RouteHop
30202 struct LDKRouteHop RouteHop_clone(const struct LDKRouteHop *NONNULL_PTR orig);
30205 * Checks if two RouteHops contain equal inner contents.
30207 uint64_t RouteHop_hash(const struct LDKRouteHop *NONNULL_PTR o);
30210 * Checks if two RouteHops contain equal inner contents.
30211 * This ignores pointers and is_owned flags and looks at the values in fields.
30212 * Two objects with NULL inner values will be considered "equal" here.
30214 bool RouteHop_eq(const struct LDKRouteHop *NONNULL_PTR a, const struct LDKRouteHop *NONNULL_PTR b);
30217 * Serialize the RouteHop object into a byte array which can be read by RouteHop_read
30219 struct LDKCVec_u8Z RouteHop_write(const struct LDKRouteHop *NONNULL_PTR obj);
30222 * Read a RouteHop from a byte array, created by RouteHop_write
30224 struct LDKCResult_RouteHopDecodeErrorZ RouteHop_read(struct LDKu8slice ser);
30227 * Frees any resources used by the Route, if is_owned is set and inner is non-NULL.
30229 void Route_free(struct LDKRoute this_obj);
30232 * The list of routes taken for a single (potentially-)multi-part payment. The pubkey of the
30233 * last RouteHop in each path must be the same. Each entry represents a list of hops, NOT
30234 * INCLUDING our own, where the last hop is the destination. Thus, this must always be at
30235 * least length one. While the maximum length of any given path is variable, keeping the length
30236 * of any path less or equal to 19 should currently ensure it is viable.
30238 struct LDKCVec_CVec_RouteHopZZ Route_get_paths(const struct LDKRoute *NONNULL_PTR this_ptr);
30241 * The list of routes taken for a single (potentially-)multi-part payment. The pubkey of the
30242 * last RouteHop in each path must be the same. Each entry represents a list of hops, NOT
30243 * INCLUDING our own, where the last hop is the destination. Thus, this must always be at
30244 * least length one. While the maximum length of any given path is variable, keeping the length
30245 * of any path less or equal to 19 should currently ensure it is viable.
30247 void Route_set_paths(struct LDKRoute *NONNULL_PTR this_ptr, struct LDKCVec_CVec_RouteHopZZ val);
30250 * The `payment_params` parameter passed to [`find_route`].
30251 * This is used by `ChannelManager` to track information which may be required for retries,
30252 * provided back to you via [`Event::PaymentPathFailed`].
30254 * [`Event::PaymentPathFailed`]: crate::util::events::Event::PaymentPathFailed
30256 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
30258 struct LDKPaymentParameters Route_get_payment_params(const struct LDKRoute *NONNULL_PTR this_ptr);
30261 * The `payment_params` parameter passed to [`find_route`].
30262 * This is used by `ChannelManager` to track information which may be required for retries,
30263 * provided back to you via [`Event::PaymentPathFailed`].
30265 * [`Event::PaymentPathFailed`]: crate::util::events::Event::PaymentPathFailed
30267 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
30269 void Route_set_payment_params(struct LDKRoute *NONNULL_PTR this_ptr, struct LDKPaymentParameters val);
30272 * Constructs a new Route given each field
30274 MUST_USE_RES struct LDKRoute Route_new(struct LDKCVec_CVec_RouteHopZZ paths_arg, struct LDKPaymentParameters payment_params_arg);
30277 * Creates a copy of the Route
30279 struct LDKRoute Route_clone(const struct LDKRoute *NONNULL_PTR orig);
30282 * Checks if two Routes contain equal inner contents.
30284 uint64_t Route_hash(const struct LDKRoute *NONNULL_PTR o);
30287 * Checks if two Routes contain equal inner contents.
30288 * This ignores pointers and is_owned flags and looks at the values in fields.
30289 * Two objects with NULL inner values will be considered "equal" here.
30291 bool Route_eq(const struct LDKRoute *NONNULL_PTR a, const struct LDKRoute *NONNULL_PTR b);
30294 * Returns the total amount of fees paid on this [`Route`].
30296 * This doesn't include any extra payment made to the recipient, which can happen in excess of
30297 * the amount passed to [`find_route`]'s `params.final_value_msat`.
30299 MUST_USE_RES uint64_t Route_get_total_fees(const struct LDKRoute *NONNULL_PTR this_arg);
30302 * Returns the total amount paid on this [`Route`], excluding the fees.
30304 MUST_USE_RES uint64_t Route_get_total_amount(const struct LDKRoute *NONNULL_PTR this_arg);
30307 * Serialize the Route object into a byte array which can be read by Route_read
30309 struct LDKCVec_u8Z Route_write(const struct LDKRoute *NONNULL_PTR obj);
30312 * Read a Route from a byte array, created by Route_write
30314 struct LDKCResult_RouteDecodeErrorZ Route_read(struct LDKu8slice ser);
30317 * Frees any resources used by the RouteParameters, if is_owned is set and inner is non-NULL.
30319 void RouteParameters_free(struct LDKRouteParameters this_obj);
30322 * The parameters of the failed payment path.
30324 struct LDKPaymentParameters RouteParameters_get_payment_params(const struct LDKRouteParameters *NONNULL_PTR this_ptr);
30327 * The parameters of the failed payment path.
30329 void RouteParameters_set_payment_params(struct LDKRouteParameters *NONNULL_PTR this_ptr, struct LDKPaymentParameters val);
30332 * The amount in msats sent on the failed payment path.
30334 uint64_t RouteParameters_get_final_value_msat(const struct LDKRouteParameters *NONNULL_PTR this_ptr);
30337 * The amount in msats sent on the failed payment path.
30339 void RouteParameters_set_final_value_msat(struct LDKRouteParameters *NONNULL_PTR this_ptr, uint64_t val);
30342 * The CLTV on the final hop of the failed payment path.
30344 uint32_t RouteParameters_get_final_cltv_expiry_delta(const struct LDKRouteParameters *NONNULL_PTR this_ptr);
30347 * The CLTV on the final hop of the failed payment path.
30349 void RouteParameters_set_final_cltv_expiry_delta(struct LDKRouteParameters *NONNULL_PTR this_ptr, uint32_t val);
30352 * Constructs a new RouteParameters given each field
30354 MUST_USE_RES struct LDKRouteParameters RouteParameters_new(struct LDKPaymentParameters payment_params_arg, uint64_t final_value_msat_arg, uint32_t final_cltv_expiry_delta_arg);
30357 * Creates a copy of the RouteParameters
30359 struct LDKRouteParameters RouteParameters_clone(const struct LDKRouteParameters *NONNULL_PTR orig);
30362 * Serialize the RouteParameters object into a byte array which can be read by RouteParameters_read
30364 struct LDKCVec_u8Z RouteParameters_write(const struct LDKRouteParameters *NONNULL_PTR obj);
30367 * Read a RouteParameters from a byte array, created by RouteParameters_write
30369 struct LDKCResult_RouteParametersDecodeErrorZ RouteParameters_read(struct LDKu8slice ser);
30372 * Frees any resources used by the PaymentParameters, if is_owned is set and inner is non-NULL.
30374 void PaymentParameters_free(struct LDKPaymentParameters this_obj);
30377 * The node id of the payee.
30379 struct LDKPublicKey PaymentParameters_get_payee_pubkey(const struct LDKPaymentParameters *NONNULL_PTR this_ptr);
30382 * The node id of the payee.
30384 void PaymentParameters_set_payee_pubkey(struct LDKPaymentParameters *NONNULL_PTR this_ptr, struct LDKPublicKey val);
30387 * Features supported by the payee.
30389 * May be set from the payee's invoice or via [`for_keysend`]. May be `None` if the invoice
30390 * does not contain any features.
30392 * [`for_keysend`]: Self::for_keysend
30394 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
30396 struct LDKInvoiceFeatures PaymentParameters_get_features(const struct LDKPaymentParameters *NONNULL_PTR this_ptr);
30399 * Features supported by the payee.
30401 * May be set from the payee's invoice or via [`for_keysend`]. May be `None` if the invoice
30402 * does not contain any features.
30404 * [`for_keysend`]: Self::for_keysend
30406 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
30408 void PaymentParameters_set_features(struct LDKPaymentParameters *NONNULL_PTR this_ptr, struct LDKInvoiceFeatures val);
30411 * Hints for routing to the payee, containing channels connecting the payee to public nodes.
30413 struct LDKCVec_RouteHintZ PaymentParameters_get_route_hints(const struct LDKPaymentParameters *NONNULL_PTR this_ptr);
30416 * Hints for routing to the payee, containing channels connecting the payee to public nodes.
30418 void PaymentParameters_set_route_hints(struct LDKPaymentParameters *NONNULL_PTR this_ptr, struct LDKCVec_RouteHintZ val);
30421 * Expiration of a payment to the payee, in seconds relative to the UNIX epoch.
30423 struct LDKCOption_u64Z PaymentParameters_get_expiry_time(const struct LDKPaymentParameters *NONNULL_PTR this_ptr);
30426 * Expiration of a payment to the payee, in seconds relative to the UNIX epoch.
30428 void PaymentParameters_set_expiry_time(struct LDKPaymentParameters *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
30431 * The maximum total CLTV delta we accept for the route.
30432 * Defaults to [`DEFAULT_MAX_TOTAL_CLTV_EXPIRY_DELTA`].
30434 uint32_t PaymentParameters_get_max_total_cltv_expiry_delta(const struct LDKPaymentParameters *NONNULL_PTR this_ptr);
30437 * The maximum total CLTV delta we accept for the route.
30438 * Defaults to [`DEFAULT_MAX_TOTAL_CLTV_EXPIRY_DELTA`].
30440 void PaymentParameters_set_max_total_cltv_expiry_delta(struct LDKPaymentParameters *NONNULL_PTR this_ptr, uint32_t val);
30443 * The maximum number of paths that may be used by (MPP) payments.
30444 * Defaults to [`DEFAULT_MAX_PATH_COUNT`].
30446 uint8_t PaymentParameters_get_max_path_count(const struct LDKPaymentParameters *NONNULL_PTR this_ptr);
30449 * The maximum number of paths that may be used by (MPP) payments.
30450 * Defaults to [`DEFAULT_MAX_PATH_COUNT`].
30452 void PaymentParameters_set_max_path_count(struct LDKPaymentParameters *NONNULL_PTR this_ptr, uint8_t val);
30455 * Selects the maximum share of a channel's total capacity which will be sent over a channel,
30456 * as a power of 1/2. A higher value prefers to send the payment using more MPP parts whereas
30457 * a lower value prefers to send larger MPP parts, potentially saturating channels and
30458 * increasing failure probability for those paths.
30460 * Note that this restriction will be relaxed during pathfinding after paths which meet this
30461 * restriction have been found. While paths which meet this criteria will be searched for, it
30462 * is ultimately up to the scorer to select them over other paths.
30464 * A value of 0 will allow payments up to and including a channel's total announced usable
30465 * capacity, a value of one will only use up to half its capacity, two 1/4, etc.
30469 uint8_t PaymentParameters_get_max_channel_saturation_power_of_half(const struct LDKPaymentParameters *NONNULL_PTR this_ptr);
30472 * Selects the maximum share of a channel's total capacity which will be sent over a channel,
30473 * as a power of 1/2. A higher value prefers to send the payment using more MPP parts whereas
30474 * a lower value prefers to send larger MPP parts, potentially saturating channels and
30475 * increasing failure probability for those paths.
30477 * Note that this restriction will be relaxed during pathfinding after paths which meet this
30478 * restriction have been found. While paths which meet this criteria will be searched for, it
30479 * is ultimately up to the scorer to select them over other paths.
30481 * A value of 0 will allow payments up to and including a channel's total announced usable
30482 * capacity, a value of one will only use up to half its capacity, two 1/4, etc.
30486 void PaymentParameters_set_max_channel_saturation_power_of_half(struct LDKPaymentParameters *NONNULL_PTR this_ptr, uint8_t val);
30489 * A list of SCIDs which this payment was previously attempted over and which caused the
30490 * payment to fail. Future attempts for the same payment shouldn't be relayed through any of
30493 * Returns a copy of the field.
30495 struct LDKCVec_u64Z PaymentParameters_get_previously_failed_channels(const struct LDKPaymentParameters *NONNULL_PTR this_ptr);
30498 * A list of SCIDs which this payment was previously attempted over and which caused the
30499 * payment to fail. Future attempts for the same payment shouldn't be relayed through any of
30502 void PaymentParameters_set_previously_failed_channels(struct LDKPaymentParameters *NONNULL_PTR this_ptr, struct LDKCVec_u64Z val);
30505 * Constructs a new PaymentParameters given each field
30507 MUST_USE_RES struct LDKPaymentParameters PaymentParameters_new(struct LDKPublicKey payee_pubkey_arg, struct LDKInvoiceFeatures features_arg, struct LDKCVec_RouteHintZ route_hints_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);
30510 * Creates a copy of the PaymentParameters
30512 struct LDKPaymentParameters PaymentParameters_clone(const struct LDKPaymentParameters *NONNULL_PTR orig);
30515 * Checks if two PaymentParameterss contain equal inner contents.
30517 uint64_t PaymentParameters_hash(const struct LDKPaymentParameters *NONNULL_PTR o);
30520 * Checks if two PaymentParameterss contain equal inner contents.
30521 * This ignores pointers and is_owned flags and looks at the values in fields.
30522 * Two objects with NULL inner values will be considered "equal" here.
30524 bool PaymentParameters_eq(const struct LDKPaymentParameters *NONNULL_PTR a, const struct LDKPaymentParameters *NONNULL_PTR b);
30527 * Serialize the PaymentParameters object into a byte array which can be read by PaymentParameters_read
30529 struct LDKCVec_u8Z PaymentParameters_write(const struct LDKPaymentParameters *NONNULL_PTR obj);
30532 * Read a PaymentParameters from a byte array, created by PaymentParameters_write
30534 struct LDKCResult_PaymentParametersDecodeErrorZ PaymentParameters_read(struct LDKu8slice ser);
30537 * Creates a payee with the node id of the given `pubkey`.
30539 MUST_USE_RES struct LDKPaymentParameters PaymentParameters_from_node_id(struct LDKPublicKey payee_pubkey);
30542 * Creates a payee with the node id of the given `pubkey` to use for keysend payments.
30544 MUST_USE_RES struct LDKPaymentParameters PaymentParameters_for_keysend(struct LDKPublicKey payee_pubkey);
30547 * Frees any resources used by the RouteHint, if is_owned is set and inner is non-NULL.
30549 void RouteHint_free(struct LDKRouteHint this_obj);
30551 struct LDKCVec_RouteHintHopZ RouteHint_get_a(const struct LDKRouteHint *NONNULL_PTR this_ptr);
30553 void RouteHint_set_a(struct LDKRouteHint *NONNULL_PTR this_ptr, struct LDKCVec_RouteHintHopZ val);
30556 * Constructs a new RouteHint given each field
30558 MUST_USE_RES struct LDKRouteHint RouteHint_new(struct LDKCVec_RouteHintHopZ a_arg);
30561 * Creates a copy of the RouteHint
30563 struct LDKRouteHint RouteHint_clone(const struct LDKRouteHint *NONNULL_PTR orig);
30566 * Checks if two RouteHints contain equal inner contents.
30568 uint64_t RouteHint_hash(const struct LDKRouteHint *NONNULL_PTR o);
30571 * Checks if two RouteHints contain equal inner contents.
30572 * This ignores pointers and is_owned flags and looks at the values in fields.
30573 * Two objects with NULL inner values will be considered "equal" here.
30575 bool RouteHint_eq(const struct LDKRouteHint *NONNULL_PTR a, const struct LDKRouteHint *NONNULL_PTR b);
30578 * Serialize the RouteHint object into a byte array which can be read by RouteHint_read
30580 struct LDKCVec_u8Z RouteHint_write(const struct LDKRouteHint *NONNULL_PTR obj);
30583 * Read a RouteHint from a byte array, created by RouteHint_write
30585 struct LDKCResult_RouteHintDecodeErrorZ RouteHint_read(struct LDKu8slice ser);
30588 * Frees any resources used by the RouteHintHop, if is_owned is set and inner is non-NULL.
30590 void RouteHintHop_free(struct LDKRouteHintHop this_obj);
30593 * The node_id of the non-target end of the route
30595 struct LDKPublicKey RouteHintHop_get_src_node_id(const struct LDKRouteHintHop *NONNULL_PTR this_ptr);
30598 * The node_id of the non-target end of the route
30600 void RouteHintHop_set_src_node_id(struct LDKRouteHintHop *NONNULL_PTR this_ptr, struct LDKPublicKey val);
30603 * The short_channel_id of this channel
30605 uint64_t RouteHintHop_get_short_channel_id(const struct LDKRouteHintHop *NONNULL_PTR this_ptr);
30608 * The short_channel_id of this channel
30610 void RouteHintHop_set_short_channel_id(struct LDKRouteHintHop *NONNULL_PTR this_ptr, uint64_t val);
30613 * The fees which must be paid to use this channel
30615 struct LDKRoutingFees RouteHintHop_get_fees(const struct LDKRouteHintHop *NONNULL_PTR this_ptr);
30618 * The fees which must be paid to use this channel
30620 void RouteHintHop_set_fees(struct LDKRouteHintHop *NONNULL_PTR this_ptr, struct LDKRoutingFees val);
30623 * The difference in CLTV values between this node and the next node.
30625 uint16_t RouteHintHop_get_cltv_expiry_delta(const struct LDKRouteHintHop *NONNULL_PTR this_ptr);
30628 * The difference in CLTV values between this node and the next node.
30630 void RouteHintHop_set_cltv_expiry_delta(struct LDKRouteHintHop *NONNULL_PTR this_ptr, uint16_t val);
30633 * The minimum value, in msat, which must be relayed to the next hop.
30635 struct LDKCOption_u64Z RouteHintHop_get_htlc_minimum_msat(const struct LDKRouteHintHop *NONNULL_PTR this_ptr);
30638 * The minimum value, in msat, which must be relayed to the next hop.
30640 void RouteHintHop_set_htlc_minimum_msat(struct LDKRouteHintHop *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
30643 * The maximum value in msat available for routing with a single HTLC.
30645 struct LDKCOption_u64Z RouteHintHop_get_htlc_maximum_msat(const struct LDKRouteHintHop *NONNULL_PTR this_ptr);
30648 * The maximum value in msat available for routing with a single HTLC.
30650 void RouteHintHop_set_htlc_maximum_msat(struct LDKRouteHintHop *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
30653 * Constructs a new RouteHintHop given each field
30655 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);
30658 * Creates a copy of the RouteHintHop
30660 struct LDKRouteHintHop RouteHintHop_clone(const struct LDKRouteHintHop *NONNULL_PTR orig);
30663 * Checks if two RouteHintHops contain equal inner contents.
30665 uint64_t RouteHintHop_hash(const struct LDKRouteHintHop *NONNULL_PTR o);
30668 * Checks if two RouteHintHops contain equal inner contents.
30669 * This ignores pointers and is_owned flags and looks at the values in fields.
30670 * Two objects with NULL inner values will be considered "equal" here.
30672 bool RouteHintHop_eq(const struct LDKRouteHintHop *NONNULL_PTR a, const struct LDKRouteHintHop *NONNULL_PTR b);
30675 * Serialize the RouteHintHop object into a byte array which can be read by RouteHintHop_read
30677 struct LDKCVec_u8Z RouteHintHop_write(const struct LDKRouteHintHop *NONNULL_PTR obj);
30680 * Read a RouteHintHop from a byte array, created by RouteHintHop_write
30682 struct LDKCResult_RouteHintHopDecodeErrorZ RouteHintHop_read(struct LDKu8slice ser);
30685 * Finds a route from us (payer) to the given target node (payee).
30687 * If the payee provided features in their invoice, they should be provided via `params.payee`.
30688 * Without this, MPP will only be used if the payee's features are available in the network graph.
30690 * Private routing paths between a public node and the target may be included in `params.payee`.
30692 * If some channels aren't announced, it may be useful to fill in `first_hops` with the results
30693 * from [`ChannelManager::list_usable_channels`]. If it is filled in, the view of these channels
30694 * from `network_graph` will be ignored, and only those in `first_hops` will be used.
30696 * The fees on channels from us to the next hop are ignored as they are assumed to all be equal.
30697 * However, the enabled/disabled bit on such channels as well as the `htlc_minimum_msat` /
30698 * `htlc_maximum_msat` *are* checked as they may change based on the receiving node.
30702 * May be used to re-compute a [`Route`] when handling a [`Event::PaymentPathFailed`]. Any
30703 * adjustments to the [`NetworkGraph`] and channel scores should be made prior to calling this
30708 * Panics if first_hops contains channels without short_channel_ids;
30709 * [`ChannelManager::list_usable_channels`] will never include such channels.
30711 * [`ChannelManager::list_usable_channels`]: crate::ln::channelmanager::ChannelManager::list_usable_channels
30712 * [`Event::PaymentPathFailed`]: crate::util::events::Event::PaymentPathFailed
30713 * [`NetworkGraph`]: crate::routing::gossip::NetworkGraph
30715 * Note that first_hops (or a relevant inner pointer) may be NULL or all-0s to represent None
30717 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 LDKScore *NONNULL_PTR scorer, const uint8_t (*random_seed_bytes)[32]);
30720 * Construct a route from us (payer) to the target node (payee) via the given hops (which should
30721 * exclude the payer, but include the payee). This may be useful, e.g., for probing the chosen path.
30723 * Re-uses logic from `find_route`, so the restrictions described there also apply here.
30725 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]);
30728 * Calls the free function if one is set
30730 void Score_free(struct LDKScore this_ptr);
30733 * Calls the free function if one is set
30735 void LockableScore_free(struct LDKLockableScore this_ptr);
30738 * Calls the free function if one is set
30740 void WriteableScore_free(struct LDKWriteableScore this_ptr);
30743 * Frees any resources used by the MultiThreadedLockableScore, if is_owned is set and inner is non-NULL.
30745 void MultiThreadedLockableScore_free(struct LDKMultiThreadedLockableScore this_obj);
30748 * Frees any resources used by the MultiThreadedScoreLock, if is_owned is set and inner is non-NULL.
30750 void MultiThreadedScoreLock_free(struct LDKMultiThreadedScoreLock this_obj);
30753 * Constructs a new Score which calls the relevant methods on this_arg.
30754 * This copies the `inner` pointer in this_arg and thus the returned Score must be freed before this_arg is
30756 struct LDKScore MultiThreadedScoreLock_as_Score(const struct LDKMultiThreadedScoreLock *NONNULL_PTR this_arg);
30759 * Serialize the MultiThreadedScoreLock object into a byte array which can be read by MultiThreadedScoreLock_read
30761 struct LDKCVec_u8Z MultiThreadedScoreLock_write(const struct LDKMultiThreadedScoreLock *NONNULL_PTR obj);
30764 * Constructs a new LockableScore which calls the relevant methods on this_arg.
30765 * This copies the `inner` pointer in this_arg and thus the returned LockableScore must be freed before this_arg is
30767 struct LDKLockableScore MultiThreadedLockableScore_as_LockableScore(const struct LDKMultiThreadedLockableScore *NONNULL_PTR this_arg);
30770 * Serialize the MultiThreadedLockableScore object into a byte array which can be read by MultiThreadedLockableScore_read
30772 struct LDKCVec_u8Z MultiThreadedLockableScore_write(const struct LDKMultiThreadedLockableScore *NONNULL_PTR obj);
30775 * Constructs a new WriteableScore which calls the relevant methods on this_arg.
30776 * This copies the `inner` pointer in this_arg and thus the returned WriteableScore must be freed before this_arg is
30778 struct LDKWriteableScore MultiThreadedLockableScore_as_WriteableScore(const struct LDKMultiThreadedLockableScore *NONNULL_PTR this_arg);
30781 * Creates a new [`MultiThreadedLockableScore`] given an underlying [`Score`].
30783 MUST_USE_RES struct LDKMultiThreadedLockableScore MultiThreadedLockableScore_new(struct LDKScore score);
30786 * Frees any resources used by the ChannelUsage, if is_owned is set and inner is non-NULL.
30788 void ChannelUsage_free(struct LDKChannelUsage this_obj);
30791 * The amount to send through the channel, denominated in millisatoshis.
30793 uint64_t ChannelUsage_get_amount_msat(const struct LDKChannelUsage *NONNULL_PTR this_ptr);
30796 * The amount to send through the channel, denominated in millisatoshis.
30798 void ChannelUsage_set_amount_msat(struct LDKChannelUsage *NONNULL_PTR this_ptr, uint64_t val);
30801 * Total amount, denominated in millisatoshis, already allocated to send through the channel
30802 * as part of a multi-path payment.
30804 uint64_t ChannelUsage_get_inflight_htlc_msat(const struct LDKChannelUsage *NONNULL_PTR this_ptr);
30807 * Total amount, denominated in millisatoshis, already allocated to send through the channel
30808 * as part of a multi-path payment.
30810 void ChannelUsage_set_inflight_htlc_msat(struct LDKChannelUsage *NONNULL_PTR this_ptr, uint64_t val);
30813 * The effective capacity of the channel.
30815 struct LDKEffectiveCapacity ChannelUsage_get_effective_capacity(const struct LDKChannelUsage *NONNULL_PTR this_ptr);
30818 * The effective capacity of the channel.
30820 void ChannelUsage_set_effective_capacity(struct LDKChannelUsage *NONNULL_PTR this_ptr, struct LDKEffectiveCapacity val);
30823 * Constructs a new ChannelUsage given each field
30825 MUST_USE_RES struct LDKChannelUsage ChannelUsage_new(uint64_t amount_msat_arg, uint64_t inflight_htlc_msat_arg, struct LDKEffectiveCapacity effective_capacity_arg);
30828 * Creates a copy of the ChannelUsage
30830 struct LDKChannelUsage ChannelUsage_clone(const struct LDKChannelUsage *NONNULL_PTR orig);
30833 * Frees any resources used by the FixedPenaltyScorer, if is_owned is set and inner is non-NULL.
30835 void FixedPenaltyScorer_free(struct LDKFixedPenaltyScorer this_obj);
30838 * Creates a copy of the FixedPenaltyScorer
30840 struct LDKFixedPenaltyScorer FixedPenaltyScorer_clone(const struct LDKFixedPenaltyScorer *NONNULL_PTR orig);
30843 * Creates a new scorer using `penalty_msat`.
30845 MUST_USE_RES struct LDKFixedPenaltyScorer FixedPenaltyScorer_with_penalty(uint64_t penalty_msat);
30848 * Constructs a new Score which calls the relevant methods on this_arg.
30849 * This copies the `inner` pointer in this_arg and thus the returned Score must be freed before this_arg is
30851 struct LDKScore FixedPenaltyScorer_as_Score(const struct LDKFixedPenaltyScorer *NONNULL_PTR this_arg);
30854 * Serialize the FixedPenaltyScorer object into a byte array which can be read by FixedPenaltyScorer_read
30856 struct LDKCVec_u8Z FixedPenaltyScorer_write(const struct LDKFixedPenaltyScorer *NONNULL_PTR obj);
30859 * Read a FixedPenaltyScorer from a byte array, created by FixedPenaltyScorer_write
30861 struct LDKCResult_FixedPenaltyScorerDecodeErrorZ FixedPenaltyScorer_read(struct LDKu8slice ser, uint64_t arg);
30864 * Frees any resources used by the ProbabilisticScorer, if is_owned is set and inner is non-NULL.
30866 void ProbabilisticScorer_free(struct LDKProbabilisticScorer this_obj);
30869 * Frees any resources used by the ProbabilisticScoringParameters, if is_owned is set and inner is non-NULL.
30871 void ProbabilisticScoringParameters_free(struct LDKProbabilisticScoringParameters this_obj);
30874 * A fixed penalty in msats to apply to each channel.
30876 * Default value: 500 msat
30878 uint64_t ProbabilisticScoringParameters_get_base_penalty_msat(const struct LDKProbabilisticScoringParameters *NONNULL_PTR this_ptr);
30881 * A fixed penalty in msats to apply to each channel.
30883 * Default value: 500 msat
30885 void ProbabilisticScoringParameters_set_base_penalty_msat(struct LDKProbabilisticScoringParameters *NONNULL_PTR this_ptr, uint64_t val);
30888 * A multiplier used with the payment amount to calculate a fixed penalty applied to each
30889 * channel, in excess of the [`base_penalty_msat`].
30891 * The purpose of the amount penalty is to avoid having fees dominate the channel cost (i.e.,
30892 * fees plus penalty) for large payments. The penalty is computed as the product of this
30893 * multiplier and `2^30`ths of the payment amount.
30895 * ie `base_penalty_amount_multiplier_msat * amount_msat / 2^30`
30897 * Default value: 8,192 msat
30899 * [`base_penalty_msat`]: Self::base_penalty_msat
30901 uint64_t ProbabilisticScoringParameters_get_base_penalty_amount_multiplier_msat(const struct LDKProbabilisticScoringParameters *NONNULL_PTR this_ptr);
30904 * A multiplier used with the payment amount to calculate a fixed penalty applied to each
30905 * channel, in excess of the [`base_penalty_msat`].
30907 * The purpose of the amount penalty is to avoid having fees dominate the channel cost (i.e.,
30908 * fees plus penalty) for large payments. The penalty is computed as the product of this
30909 * multiplier and `2^30`ths of the payment amount.
30911 * ie `base_penalty_amount_multiplier_msat * amount_msat / 2^30`
30913 * Default value: 8,192 msat
30915 * [`base_penalty_msat`]: Self::base_penalty_msat
30917 void ProbabilisticScoringParameters_set_base_penalty_amount_multiplier_msat(struct LDKProbabilisticScoringParameters *NONNULL_PTR this_ptr, uint64_t val);
30920 * A multiplier used in conjunction with the negative `log10` of the channel's success
30921 * probability for a payment, as determined by our latest estimates of the channel's
30922 * liquidity, to determine the liquidity penalty.
30924 * The penalty is based in part on the knowledge learned from prior successful and unsuccessful
30925 * payments. This knowledge is decayed over time based on [`liquidity_offset_half_life`]. The
30926 * penalty is effectively limited to `2 * liquidity_penalty_multiplier_msat` (corresponding to
30927 * lower bounding the success probability to `0.01`) when the amount falls within the
30928 * uncertainty bounds of the channel liquidity balance. Amounts above the upper bound will
30929 * result in a `u64::max_value` penalty, however.
30931 * `-log10(success_probability) * liquidity_penalty_multiplier_msat`
30933 * Default value: 30,000 msat
30935 * [`liquidity_offset_half_life`]: Self::liquidity_offset_half_life
30937 uint64_t ProbabilisticScoringParameters_get_liquidity_penalty_multiplier_msat(const struct LDKProbabilisticScoringParameters *NONNULL_PTR this_ptr);
30940 * A multiplier used in conjunction with the negative `log10` of the channel's success
30941 * probability for a payment, as determined by our latest estimates of the channel's
30942 * liquidity, to determine the liquidity penalty.
30944 * The penalty is based in part on the knowledge learned from prior successful and unsuccessful
30945 * payments. This knowledge is decayed over time based on [`liquidity_offset_half_life`]. The
30946 * penalty is effectively limited to `2 * liquidity_penalty_multiplier_msat` (corresponding to
30947 * lower bounding the success probability to `0.01`) when the amount falls within the
30948 * uncertainty bounds of the channel liquidity balance. Amounts above the upper bound will
30949 * result in a `u64::max_value` penalty, however.
30951 * `-log10(success_probability) * liquidity_penalty_multiplier_msat`
30953 * Default value: 30,000 msat
30955 * [`liquidity_offset_half_life`]: Self::liquidity_offset_half_life
30957 void ProbabilisticScoringParameters_set_liquidity_penalty_multiplier_msat(struct LDKProbabilisticScoringParameters *NONNULL_PTR this_ptr, uint64_t val);
30960 * Whenever this amount of time elapses since the last update to a channel's liquidity bounds,
30961 * the distance from the bounds to \"zero\" is cut in half. In other words, the lower-bound on
30962 * the available liquidity is halved and the upper-bound moves half-way to the channel's total
30965 * Because halving the liquidity bounds grows the uncertainty on the channel's liquidity,
30966 * the penalty for an amount within the new bounds may change. See the [`ProbabilisticScorer`]
30967 * struct documentation for more info on the way the liquidity bounds are used.
30969 * For example, if the channel's capacity is 1 million sats, and the current upper and lower
30970 * liquidity bounds are 200,000 sats and 600,000 sats, after this amount of time the upper
30971 * and lower liquidity bounds will be decayed to 100,000 and 800,000 sats.
30973 * Default value: 6 hours
30977 * When built with the `no-std` feature, time will never elapse. Therefore, the channel
30978 * liquidity knowledge will never decay except when the bounds cross.
30980 uint64_t ProbabilisticScoringParameters_get_liquidity_offset_half_life(const struct LDKProbabilisticScoringParameters *NONNULL_PTR this_ptr);
30983 * Whenever this amount of time elapses since the last update to a channel's liquidity bounds,
30984 * the distance from the bounds to \"zero\" is cut in half. In other words, the lower-bound on
30985 * the available liquidity is halved and the upper-bound moves half-way to the channel's total
30988 * Because halving the liquidity bounds grows the uncertainty on the channel's liquidity,
30989 * the penalty for an amount within the new bounds may change. See the [`ProbabilisticScorer`]
30990 * struct documentation for more info on the way the liquidity bounds are used.
30992 * For example, if the channel's capacity is 1 million sats, and the current upper and lower
30993 * liquidity bounds are 200,000 sats and 600,000 sats, after this amount of time the upper
30994 * and lower liquidity bounds will be decayed to 100,000 and 800,000 sats.
30996 * Default value: 6 hours
31000 * When built with the `no-std` feature, time will never elapse. Therefore, the channel
31001 * liquidity knowledge will never decay except when the bounds cross.
31003 void ProbabilisticScoringParameters_set_liquidity_offset_half_life(struct LDKProbabilisticScoringParameters *NONNULL_PTR this_ptr, uint64_t val);
31006 * A multiplier used in conjunction with a payment amount and the negative `log10` of the
31007 * channel's success probability for the payment, as determined by our latest estimates of the
31008 * channel's liquidity, to determine the amount penalty.
31010 * The purpose of the amount penalty is to avoid having fees dominate the channel cost (i.e.,
31011 * fees plus penalty) for large payments. The penalty is computed as the product of this
31012 * multiplier and `2^20`ths of the payment amount, weighted by the negative `log10` of the
31013 * success probability.
31015 * `-log10(success_probability) * liquidity_penalty_amount_multiplier_msat * amount_msat / 2^20`
31017 * In practice, this means for 0.1 success probability (`-log10(0.1) == 1`) each `2^20`th of
31018 * the amount will result in a penalty of the multiplier. And, as the success probability
31019 * decreases, the negative `log10` weighting will increase dramatically. For higher success
31020 * probabilities, the multiplier will have a decreasing effect as the negative `log10` will
31023 * Default value: 192 msat
31025 uint64_t ProbabilisticScoringParameters_get_liquidity_penalty_amount_multiplier_msat(const struct LDKProbabilisticScoringParameters *NONNULL_PTR this_ptr);
31028 * A multiplier used in conjunction with a payment amount and the negative `log10` of the
31029 * channel's success probability for the payment, as determined by our latest estimates of the
31030 * channel's liquidity, to determine the amount penalty.
31032 * The purpose of the amount penalty is to avoid having fees dominate the channel cost (i.e.,
31033 * fees plus penalty) for large payments. The penalty is computed as the product of this
31034 * multiplier and `2^20`ths of the payment amount, weighted by the negative `log10` of the
31035 * success probability.
31037 * `-log10(success_probability) * liquidity_penalty_amount_multiplier_msat * amount_msat / 2^20`
31039 * In practice, this means for 0.1 success probability (`-log10(0.1) == 1`) each `2^20`th of
31040 * the amount will result in a penalty of the multiplier. And, as the success probability
31041 * decreases, the negative `log10` weighting will increase dramatically. For higher success
31042 * probabilities, the multiplier will have a decreasing effect as the negative `log10` will
31045 * Default value: 192 msat
31047 void ProbabilisticScoringParameters_set_liquidity_penalty_amount_multiplier_msat(struct LDKProbabilisticScoringParameters *NONNULL_PTR this_ptr, uint64_t val);
31050 * A multiplier used in conjunction with the negative `log10` of the channel's success
31051 * probability for the payment, as determined based on the history of our estimates of the
31052 * channel's available liquidity, to determine a penalty.
31054 * This penalty is similar to [`liquidity_penalty_multiplier_msat`], however, instead of using
31055 * only our latest estimate for the current liquidity available in the channel, it estimates
31056 * success probability based on the estimated liquidity available in the channel through
31057 * history. Specifically, every time we update our liquidity bounds on a given channel, we
31058 * track which of several buckets those bounds fall into, exponentially decaying the
31059 * probability of each bucket as new samples are added.
31061 * Default value: 10,000 msat
31063 * [`liquidity_penalty_multiplier_msat`]: Self::liquidity_penalty_multiplier_msat
31065 uint64_t ProbabilisticScoringParameters_get_historical_liquidity_penalty_multiplier_msat(const struct LDKProbabilisticScoringParameters *NONNULL_PTR this_ptr);
31068 * A multiplier used in conjunction with the negative `log10` of the channel's success
31069 * probability for the payment, as determined based on the history of our estimates of the
31070 * channel's available liquidity, to determine a penalty.
31072 * This penalty is similar to [`liquidity_penalty_multiplier_msat`], however, instead of using
31073 * only our latest estimate for the current liquidity available in the channel, it estimates
31074 * success probability based on the estimated liquidity available in the channel through
31075 * history. Specifically, every time we update our liquidity bounds on a given channel, we
31076 * track which of several buckets those bounds fall into, exponentially decaying the
31077 * probability of each bucket as new samples are added.
31079 * Default value: 10,000 msat
31081 * [`liquidity_penalty_multiplier_msat`]: Self::liquidity_penalty_multiplier_msat
31083 void ProbabilisticScoringParameters_set_historical_liquidity_penalty_multiplier_msat(struct LDKProbabilisticScoringParameters *NONNULL_PTR this_ptr, uint64_t val);
31086 * A multiplier used in conjunction with the payment amount and the negative `log10` of the
31087 * channel's success probability for the payment, as determined based on the history of our
31088 * estimates of the channel's available liquidity, to determine a penalty.
31090 * The purpose of the amount penalty is to avoid having fees dominate the channel cost for
31091 * large payments. The penalty is computed as the product of this multiplier and the `2^20`ths
31092 * of the payment amount, weighted by the negative `log10` of the success probability.
31094 * This penalty is similar to [`liquidity_penalty_amount_multiplier_msat`], however, instead
31095 * of using only our latest estimate for the current liquidity available in the channel, it
31096 * estimates success probability based on the estimated liquidity available in the channel
31097 * through history. Specifically, every time we update our liquidity bounds on a given
31098 * channel, we track which of several buckets those bounds fall into, exponentially decaying
31099 * the probability of each bucket as new samples are added.
31101 * Default value: 64 msat
31103 * [`liquidity_penalty_amount_multiplier_msat`]: Self::liquidity_penalty_amount_multiplier_msat
31105 uint64_t ProbabilisticScoringParameters_get_historical_liquidity_penalty_amount_multiplier_msat(const struct LDKProbabilisticScoringParameters *NONNULL_PTR this_ptr);
31108 * A multiplier used in conjunction with the payment amount and the negative `log10` of the
31109 * channel's success probability for the payment, as determined based on the history of our
31110 * estimates of the channel's available liquidity, to determine a penalty.
31112 * The purpose of the amount penalty is to avoid having fees dominate the channel cost for
31113 * large payments. The penalty is computed as the product of this multiplier and the `2^20`ths
31114 * of the payment amount, weighted by the negative `log10` of the success probability.
31116 * This penalty is similar to [`liquidity_penalty_amount_multiplier_msat`], however, instead
31117 * of using only our latest estimate for the current liquidity available in the channel, it
31118 * estimates success probability based on the estimated liquidity available in the channel
31119 * through history. Specifically, every time we update our liquidity bounds on a given
31120 * channel, we track which of several buckets those bounds fall into, exponentially decaying
31121 * the probability of each bucket as new samples are added.
31123 * Default value: 64 msat
31125 * [`liquidity_penalty_amount_multiplier_msat`]: Self::liquidity_penalty_amount_multiplier_msat
31127 void ProbabilisticScoringParameters_set_historical_liquidity_penalty_amount_multiplier_msat(struct LDKProbabilisticScoringParameters *NONNULL_PTR this_ptr, uint64_t val);
31130 * If we aren't learning any new datapoints for a channel, the historical liquidity bounds
31131 * tracking can simply live on with increasingly stale data. Instead, when a channel has not
31132 * seen a liquidity estimate update for this amount of time, the historical datapoints are
31135 * Note that after 16 or more half lives all historical data will be completely gone.
31137 * Default value: 14 days
31139 uint64_t ProbabilisticScoringParameters_get_historical_no_updates_half_life(const struct LDKProbabilisticScoringParameters *NONNULL_PTR this_ptr);
31142 * If we aren't learning any new datapoints for a channel, the historical liquidity bounds
31143 * tracking can simply live on with increasingly stale data. Instead, when a channel has not
31144 * seen a liquidity estimate update for this amount of time, the historical datapoints are
31147 * Note that after 16 or more half lives all historical data will be completely gone.
31149 * Default value: 14 days
31151 void ProbabilisticScoringParameters_set_historical_no_updates_half_life(struct LDKProbabilisticScoringParameters *NONNULL_PTR this_ptr, uint64_t val);
31154 * This penalty is applied when `htlc_maximum_msat` is equal to or larger than half of the
31155 * channel's capacity, which makes us prefer nodes with a smaller `htlc_maximum_msat`. We
31156 * treat such nodes preferentially as this makes balance discovery attacks harder to execute,
31157 * thereby creating an incentive to restrict `htlc_maximum_msat` and improve privacy.
31159 * Default value: 250 msat
31161 uint64_t ProbabilisticScoringParameters_get_anti_probing_penalty_msat(const struct LDKProbabilisticScoringParameters *NONNULL_PTR this_ptr);
31164 * This penalty is applied when `htlc_maximum_msat` is equal to or larger than half of the
31165 * channel's capacity, which makes us prefer nodes with a smaller `htlc_maximum_msat`. We
31166 * treat such nodes preferentially as this makes balance discovery attacks harder to execute,
31167 * thereby creating an incentive to restrict `htlc_maximum_msat` and improve privacy.
31169 * Default value: 250 msat
31171 void ProbabilisticScoringParameters_set_anti_probing_penalty_msat(struct LDKProbabilisticScoringParameters *NONNULL_PTR this_ptr, uint64_t val);
31174 * This penalty is applied when the amount we're attempting to send over a channel exceeds our
31175 * current estimate of the channel's available liquidity.
31177 * Note that in this case all other penalties, including the
31178 * [`liquidity_penalty_multiplier_msat`] and [`liquidity_penalty_amount_multiplier_msat`]-based
31179 * penalties, as well as the [`base_penalty_msat`] and the [`anti_probing_penalty_msat`], if
31180 * applicable, are still included in the overall penalty.
31182 * If you wish to avoid creating paths with such channels entirely, setting this to a value of
31183 * `u64::max_value()` will guarantee that.
31185 * Default value: 1_0000_0000_000 msat (1 Bitcoin)
31187 * [`liquidity_penalty_multiplier_msat`]: Self::liquidity_penalty_multiplier_msat
31188 * [`liquidity_penalty_amount_multiplier_msat`]: Self::liquidity_penalty_amount_multiplier_msat
31189 * [`base_penalty_msat`]: Self::base_penalty_msat
31190 * [`anti_probing_penalty_msat`]: Self::anti_probing_penalty_msat
31192 uint64_t ProbabilisticScoringParameters_get_considered_impossible_penalty_msat(const struct LDKProbabilisticScoringParameters *NONNULL_PTR this_ptr);
31195 * This penalty is applied when the amount we're attempting to send over a channel exceeds our
31196 * current estimate of the channel's available liquidity.
31198 * Note that in this case all other penalties, including the
31199 * [`liquidity_penalty_multiplier_msat`] and [`liquidity_penalty_amount_multiplier_msat`]-based
31200 * penalties, as well as the [`base_penalty_msat`] and the [`anti_probing_penalty_msat`], if
31201 * applicable, are still included in the overall penalty.
31203 * If you wish to avoid creating paths with such channels entirely, setting this to a value of
31204 * `u64::max_value()` will guarantee that.
31206 * Default value: 1_0000_0000_000 msat (1 Bitcoin)
31208 * [`liquidity_penalty_multiplier_msat`]: Self::liquidity_penalty_multiplier_msat
31209 * [`liquidity_penalty_amount_multiplier_msat`]: Self::liquidity_penalty_amount_multiplier_msat
31210 * [`base_penalty_msat`]: Self::base_penalty_msat
31211 * [`anti_probing_penalty_msat`]: Self::anti_probing_penalty_msat
31213 void ProbabilisticScoringParameters_set_considered_impossible_penalty_msat(struct LDKProbabilisticScoringParameters *NONNULL_PTR this_ptr, uint64_t val);
31216 * Creates a copy of the ProbabilisticScoringParameters
31218 struct LDKProbabilisticScoringParameters ProbabilisticScoringParameters_clone(const struct LDKProbabilisticScoringParameters *NONNULL_PTR orig);
31221 * Creates a new scorer using the given scoring parameters for sending payments from a node
31222 * through a network graph.
31224 MUST_USE_RES struct LDKProbabilisticScorer ProbabilisticScorer_new(struct LDKProbabilisticScoringParameters params, const struct LDKNetworkGraph *NONNULL_PTR network_graph, struct LDKLogger logger);
31227 * Dump the contents of this scorer into the configured logger.
31229 * Note that this writes roughly one line per channel for which we have a liquidity estimate,
31230 * which may be a substantial amount of log output.
31232 void ProbabilisticScorer_debug_log_liquidity_stats(const struct LDKProbabilisticScorer *NONNULL_PTR this_arg);
31235 * Query the estimated minimum and maximum liquidity available for sending a payment over the
31236 * channel with `scid` towards the given `target` node.
31238 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);
31241 * Marks the node with the given `node_id` as banned, i.e.,
31242 * it will be avoided during path finding.
31244 void ProbabilisticScorer_add_banned(struct LDKProbabilisticScorer *NONNULL_PTR this_arg, const struct LDKNodeId *NONNULL_PTR node_id);
31247 * Removes the node with the given `node_id` from the list of nodes to avoid.
31249 void ProbabilisticScorer_remove_banned(struct LDKProbabilisticScorer *NONNULL_PTR this_arg, const struct LDKNodeId *NONNULL_PTR node_id);
31252 * Sets a manual penalty for the given node.
31254 void ProbabilisticScorer_set_manual_penalty(struct LDKProbabilisticScorer *NONNULL_PTR this_arg, const struct LDKNodeId *NONNULL_PTR node_id, uint64_t penalty);
31257 * Removes the node with the given `node_id` from the list of manual penalties.
31259 void ProbabilisticScorer_remove_manual_penalty(struct LDKProbabilisticScorer *NONNULL_PTR this_arg, const struct LDKNodeId *NONNULL_PTR node_id);
31262 * Clears the list of manual penalties that are applied during path finding.
31264 void ProbabilisticScorer_clear_manual_penalties(struct LDKProbabilisticScorer *NONNULL_PTR this_arg);
31267 * Marks all nodes in the given list as banned, i.e.,
31268 * they will be avoided during path finding.
31270 void ProbabilisticScoringParameters_add_banned_from_list(struct LDKProbabilisticScoringParameters *NONNULL_PTR this_arg, struct LDKCVec_NodeIdZ node_ids);
31273 * Creates a "default" ProbabilisticScoringParameters. See struct and individual field documentaiton for details on which values are used.
31275 MUST_USE_RES struct LDKProbabilisticScoringParameters ProbabilisticScoringParameters_default(void);
31278 * Constructs a new Score which calls the relevant methods on this_arg.
31279 * This copies the `inner` pointer in this_arg and thus the returned Score must be freed before this_arg is
31281 struct LDKScore ProbabilisticScorer_as_Score(const struct LDKProbabilisticScorer *NONNULL_PTR this_arg);
31284 * Serialize the ProbabilisticScorer object into a byte array which can be read by ProbabilisticScorer_read
31286 struct LDKCVec_u8Z ProbabilisticScorer_write(const struct LDKProbabilisticScorer *NONNULL_PTR obj);
31289 * Read a ProbabilisticScorer from a byte array, created by ProbabilisticScorer_write
31291 struct LDKCResult_ProbabilisticScorerDecodeErrorZ ProbabilisticScorer_read(struct LDKu8slice ser, struct LDKProbabilisticScoringParameters arg_a, const struct LDKNetworkGraph *NONNULL_PTR arg_b, struct LDKLogger arg_c);
31294 * Frees any resources used by the BlindedPath, if is_owned is set and inner is non-NULL.
31296 void BlindedPath_free(struct LDKBlindedPath this_obj);
31299 * Creates a copy of the BlindedPath
31301 struct LDKBlindedPath BlindedPath_clone(const struct LDKBlindedPath *NONNULL_PTR orig);
31304 * Frees any resources used by the BlindedHop, if is_owned is set and inner is non-NULL.
31306 void BlindedHop_free(struct LDKBlindedHop this_obj);
31309 * Creates a copy of the BlindedHop
31311 struct LDKBlindedHop BlindedHop_clone(const struct LDKBlindedHop *NONNULL_PTR orig);
31314 * Create a blinded path to be forwarded along `node_pks`. The last node pubkey in `node_pks`
31315 * will be the destination node.
31317 * Errors if less than two hops are provided or if `node_pk`(s) are invalid.
31319 MUST_USE_RES struct LDKCResult_BlindedPathNoneZ BlindedPath_new(struct LDKCVec_PublicKeyZ node_pks, const struct LDKKeysInterface *NONNULL_PTR keys_manager);
31322 * Serialize the BlindedPath object into a byte array which can be read by BlindedPath_read
31324 struct LDKCVec_u8Z BlindedPath_write(const struct LDKBlindedPath *NONNULL_PTR obj);
31327 * Read a BlindedPath from a byte array, created by BlindedPath_write
31329 struct LDKCResult_BlindedPathDecodeErrorZ BlindedPath_read(struct LDKu8slice ser);
31332 * Serialize the BlindedHop object into a byte array which can be read by BlindedHop_read
31334 struct LDKCVec_u8Z BlindedHop_write(const struct LDKBlindedHop *NONNULL_PTR obj);
31337 * Read a BlindedHop from a byte array, created by BlindedHop_write
31339 struct LDKCResult_BlindedHopDecodeErrorZ BlindedHop_read(struct LDKu8slice ser);
31342 * Frees any resources used by the OnionMessenger, if is_owned is set and inner is non-NULL.
31344 void OnionMessenger_free(struct LDKOnionMessenger this_obj);
31347 * Frees any resources used by the Destination
31349 void Destination_free(struct LDKDestination this_ptr);
31352 * Creates a copy of the Destination
31354 struct LDKDestination Destination_clone(const struct LDKDestination *NONNULL_PTR orig);
31357 * Utility method to constructs a new Node-variant Destination
31359 struct LDKDestination Destination_node(struct LDKPublicKey a);
31362 * Utility method to constructs a new BlindedPath-variant Destination
31364 struct LDKDestination Destination_blinded_path(struct LDKBlindedPath a);
31367 * Frees any resources used by the SendError
31369 void SendError_free(struct LDKSendError this_ptr);
31372 * Creates a copy of the SendError
31374 struct LDKSendError SendError_clone(const struct LDKSendError *NONNULL_PTR orig);
31377 * Utility method to constructs a new Secp256k1-variant SendError
31379 struct LDKSendError SendError_secp256k1(enum LDKSecp256k1Error a);
31382 * Utility method to constructs a new TooBigPacket-variant SendError
31384 struct LDKSendError SendError_too_big_packet(void);
31387 * Utility method to constructs a new TooFewBlindedHops-variant SendError
31389 struct LDKSendError SendError_too_few_blinded_hops(void);
31392 * Utility method to constructs a new InvalidFirstHop-variant SendError
31394 struct LDKSendError SendError_invalid_first_hop(void);
31397 * Utility method to constructs a new InvalidMessage-variant SendError
31399 struct LDKSendError SendError_invalid_message(void);
31402 * Utility method to constructs a new BufferFull-variant SendError
31404 struct LDKSendError SendError_buffer_full(void);
31407 * Utility method to constructs a new GetNodeIdFailed-variant SendError
31409 struct LDKSendError SendError_get_node_id_failed(void);
31412 * Utility method to constructs a new BlindedPathAdvanceFailed-variant SendError
31414 struct LDKSendError SendError_blinded_path_advance_failed(void);
31417 * Checks if two SendErrors contain equal inner contents.
31418 * This ignores pointers and is_owned flags and looks at the values in fields.
31420 bool SendError_eq(const struct LDKSendError *NONNULL_PTR a, const struct LDKSendError *NONNULL_PTR b);
31423 * Calls the free function if one is set
31425 void CustomOnionMessageHandler_free(struct LDKCustomOnionMessageHandler this_ptr);
31428 * Constructs a new `OnionMessenger` to send, forward, and delegate received onion messages to
31429 * their respective handlers.
31431 MUST_USE_RES struct LDKOnionMessenger OnionMessenger_new(struct LDKKeysInterface keys_manager, struct LDKLogger logger, struct LDKCustomOnionMessageHandler custom_handler);
31434 * Send an onion message with contents `message` to `destination`, routing it through `intermediate_nodes`.
31435 * See [`OnionMessenger`] for example usage.
31437 * Note that reply_path (or a relevant inner pointer) may be NULL or all-0s to represent None
31439 MUST_USE_RES struct LDKCResult_NoneSendErrorZ OnionMessenger_send_onion_message(const struct LDKOnionMessenger *NONNULL_PTR this_arg, struct LDKCVec_PublicKeyZ intermediate_nodes, struct LDKDestination destination, struct LDKOnionMessageContents message, struct LDKBlindedPath reply_path);
31442 * Constructs a new OnionMessageHandler which calls the relevant methods on this_arg.
31443 * This copies the `inner` pointer in this_arg and thus the returned OnionMessageHandler must be freed before this_arg is
31445 struct LDKOnionMessageHandler OnionMessenger_as_OnionMessageHandler(const struct LDKOnionMessenger *NONNULL_PTR this_arg);
31448 * Constructs a new OnionMessageProvider which calls the relevant methods on this_arg.
31449 * This copies the `inner` pointer in this_arg and thus the returned OnionMessageProvider must be freed before this_arg is
31451 struct LDKOnionMessageProvider OnionMessenger_as_OnionMessageProvider(const struct LDKOnionMessenger *NONNULL_PTR this_arg);
31454 * Frees any resources used by the OnionMessageContents
31456 void OnionMessageContents_free(struct LDKOnionMessageContents this_ptr);
31459 * Utility method to constructs a new Custom-variant OnionMessageContents
31461 struct LDKOnionMessageContents OnionMessageContents_custom(struct LDKCustomOnionMessageContents a);
31464 * Calls the free function if one is set
31466 void CustomOnionMessageContents_free(struct LDKCustomOnionMessageContents this_ptr);
31469 * Frees any resources used by the FilesystemPersister, if is_owned is set and inner is non-NULL.
31471 void FilesystemPersister_free(struct LDKFilesystemPersister this_obj);
31474 * Initialize a new FilesystemPersister and set the path to the individual channels'
31477 MUST_USE_RES struct LDKFilesystemPersister FilesystemPersister_new(struct LDKStr path_to_channel_data);
31480 * Get the directory which was provided when this persister was initialized.
31482 MUST_USE_RES struct LDKStr FilesystemPersister_get_data_dir(const struct LDKFilesystemPersister *NONNULL_PTR this_arg);
31485 * Read `ChannelMonitor`s from disk.
31487 MUST_USE_RES struct LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ FilesystemPersister_read_channelmonitors(const struct LDKFilesystemPersister *NONNULL_PTR this_arg, struct LDKKeysInterface keys_manager);
31490 * Frees any resources used by the BackgroundProcessor, if is_owned is set and inner is non-NULL.
31492 void BackgroundProcessor_free(struct LDKBackgroundProcessor this_obj);
31495 * Frees any resources used by the GossipSync
31497 void GossipSync_free(struct LDKGossipSync this_ptr);
31500 * Utility method to constructs a new P2P-variant GossipSync
31502 struct LDKGossipSync GossipSync_p2_p(const struct LDKP2PGossipSync *NONNULL_PTR a);
31505 * Utility method to constructs a new Rapid-variant GossipSync
31507 struct LDKGossipSync GossipSync_rapid(const struct LDKRapidGossipSync *NONNULL_PTR a);
31510 * Utility method to constructs a new None-variant GossipSync
31512 struct LDKGossipSync GossipSync_none(void);
31515 * Start a background thread that takes care of responsibilities enumerated in the [top-level
31518 * The thread runs indefinitely unless the object is dropped, [`stop`] is called, or
31519 * [`Persister::persist_manager`] returns an error. In case of an error, the error is retrieved by calling
31520 * either [`join`] or [`stop`].
31522 * # Data Persistence
31524 * [`Persister::persist_manager`] is responsible for writing out the [`ChannelManager`] to disk, and/or
31525 * uploading to one or more backup services. See [`ChannelManager::write`] for writing out a
31526 * [`ChannelManager`]. See the `lightning-persister` crate for LDK's
31527 * provided implementation.
31529 * [`Persister::persist_graph`] is responsible for writing out the [`NetworkGraph`] to disk, if
31530 * [`GossipSync`] is supplied. See [`NetworkGraph::write`] for writing out a [`NetworkGraph`].
31531 * See the `lightning-persister` crate for LDK's provided implementation.
31533 * Typically, users should either implement [`Persister::persist_manager`] to never return an
31534 * error or call [`join`] and handle any error that may arise. For the latter case,
31535 * `BackgroundProcessor` must be restarted by calling `start` again after handling the error.
31539 * `event_handler` is responsible for handling events that users should be notified of (e.g.,
31540 * payment failed). [`BackgroundProcessor`] may decorate the given [`EventHandler`] with common
31541 * functionality implemented by other handlers.
31542 * * [`P2PGossipSync`] if given will update the [`NetworkGraph`] based on payment failures.
31544 * # Rapid Gossip Sync
31546 * If rapid gossip sync is meant to run at startup, pass [`RapidGossipSync`] via `gossip_sync`
31547 * to indicate that the [`BackgroundProcessor`] should not prune the [`NetworkGraph`] instance
31548 * until the [`RapidGossipSync`] instance completes its first sync.
31550 * [top-level documentation]: BackgroundProcessor
31551 * [`join`]: Self::join
31552 * [`stop`]: Self::stop
31553 * [`ChannelManager`]: lightning::ln::channelmanager::ChannelManager
31554 * [`ChannelManager::write`]: lightning::ln::channelmanager::ChannelManager#impl-Writeable
31555 * [`Persister::persist_manager`]: lightning::util::persist::Persister::persist_manager
31556 * [`Persister::persist_graph`]: lightning::util::persist::Persister::persist_graph
31557 * [`NetworkGraph`]: lightning::routing::gossip::NetworkGraph
31558 * [`NetworkGraph::write`]: lightning::routing::gossip::NetworkGraph#impl-Writeable
31560 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);
31563 * Join `BackgroundProcessor`'s thread, returning any error that occurred while persisting
31564 * [`ChannelManager`].
31568 * This function panics if the background thread has panicked such as while persisting or
31571 * [`ChannelManager`]: lightning::ln::channelmanager::ChannelManager
31573 MUST_USE_RES struct LDKCResult_NoneErrorZ BackgroundProcessor_join(struct LDKBackgroundProcessor this_arg);
31576 * Stop `BackgroundProcessor`'s thread, returning any error that occurred while persisting
31577 * [`ChannelManager`].
31581 * This function panics if the background thread has panicked such as while persisting or
31584 * [`ChannelManager`]: lightning::ln::channelmanager::ChannelManager
31586 MUST_USE_RES struct LDKCResult_NoneErrorZ BackgroundProcessor_stop(struct LDKBackgroundProcessor this_arg);
31589 * Frees any resources used by the ParseError
31591 void ParseError_free(struct LDKParseError this_ptr);
31594 * Creates a copy of the ParseError
31596 struct LDKParseError ParseError_clone(const struct LDKParseError *NONNULL_PTR orig);
31599 * Utility method to constructs a new Bech32Error-variant ParseError
31601 struct LDKParseError ParseError_bech32_error(struct LDKBech32Error a);
31604 * Utility method to constructs a new ParseAmountError-variant ParseError
31606 struct LDKParseError ParseError_parse_amount_error(struct LDKError a);
31609 * Utility method to constructs a new MalformedSignature-variant ParseError
31611 struct LDKParseError ParseError_malformed_signature(enum LDKSecp256k1Error a);
31614 * Utility method to constructs a new BadPrefix-variant ParseError
31616 struct LDKParseError ParseError_bad_prefix(void);
31619 * Utility method to constructs a new UnknownCurrency-variant ParseError
31621 struct LDKParseError ParseError_unknown_currency(void);
31624 * Utility method to constructs a new UnknownSiPrefix-variant ParseError
31626 struct LDKParseError ParseError_unknown_si_prefix(void);
31629 * Utility method to constructs a new MalformedHRP-variant ParseError
31631 struct LDKParseError ParseError_malformed_hrp(void);
31634 * Utility method to constructs a new TooShortDataPart-variant ParseError
31636 struct LDKParseError ParseError_too_short_data_part(void);
31639 * Utility method to constructs a new UnexpectedEndOfTaggedFields-variant ParseError
31641 struct LDKParseError ParseError_unexpected_end_of_tagged_fields(void);
31644 * Utility method to constructs a new DescriptionDecodeError-variant ParseError
31646 struct LDKParseError ParseError_description_decode_error(struct LDKError a);
31649 * Utility method to constructs a new PaddingError-variant ParseError
31651 struct LDKParseError ParseError_padding_error(void);
31654 * Utility method to constructs a new IntegerOverflowError-variant ParseError
31656 struct LDKParseError ParseError_integer_overflow_error(void);
31659 * Utility method to constructs a new InvalidSegWitProgramLength-variant ParseError
31661 struct LDKParseError ParseError_invalid_seg_wit_program_length(void);
31664 * Utility method to constructs a new InvalidPubKeyHashLength-variant ParseError
31666 struct LDKParseError ParseError_invalid_pub_key_hash_length(void);
31669 * Utility method to constructs a new InvalidScriptHashLength-variant ParseError
31671 struct LDKParseError ParseError_invalid_script_hash_length(void);
31674 * Utility method to constructs a new InvalidRecoveryId-variant ParseError
31676 struct LDKParseError ParseError_invalid_recovery_id(void);
31679 * Utility method to constructs a new InvalidSliceLength-variant ParseError
31681 struct LDKParseError ParseError_invalid_slice_length(struct LDKStr a);
31684 * Utility method to constructs a new Skip-variant ParseError
31686 struct LDKParseError ParseError_skip(void);
31689 * Checks if two ParseErrors contain equal inner contents.
31690 * This ignores pointers and is_owned flags and looks at the values in fields.
31692 bool ParseError_eq(const struct LDKParseError *NONNULL_PTR a, const struct LDKParseError *NONNULL_PTR b);
31695 * Frees any resources used by the ParseOrSemanticError
31697 void ParseOrSemanticError_free(struct LDKParseOrSemanticError this_ptr);
31700 * Creates a copy of the ParseOrSemanticError
31702 struct LDKParseOrSemanticError ParseOrSemanticError_clone(const struct LDKParseOrSemanticError *NONNULL_PTR orig);
31705 * Utility method to constructs a new ParseError-variant ParseOrSemanticError
31707 struct LDKParseOrSemanticError ParseOrSemanticError_parse_error(struct LDKParseError a);
31710 * Utility method to constructs a new SemanticError-variant ParseOrSemanticError
31712 struct LDKParseOrSemanticError ParseOrSemanticError_semantic_error(enum LDKSemanticError a);
31715 * Checks if two ParseOrSemanticErrors contain equal inner contents.
31716 * This ignores pointers and is_owned flags and looks at the values in fields.
31718 bool ParseOrSemanticError_eq(const struct LDKParseOrSemanticError *NONNULL_PTR a, const struct LDKParseOrSemanticError *NONNULL_PTR b);
31721 * Frees any resources used by the Invoice, if is_owned is set and inner is non-NULL.
31723 void Invoice_free(struct LDKInvoice this_obj);
31726 * Checks if two Invoices contain equal inner contents.
31727 * This ignores pointers and is_owned flags and looks at the values in fields.
31728 * Two objects with NULL inner values will be considered "equal" here.
31730 bool Invoice_eq(const struct LDKInvoice *NONNULL_PTR a, const struct LDKInvoice *NONNULL_PTR b);
31733 * Creates a copy of the Invoice
31735 struct LDKInvoice Invoice_clone(const struct LDKInvoice *NONNULL_PTR orig);
31738 * Checks if two Invoices contain equal inner contents.
31740 uint64_t Invoice_hash(const struct LDKInvoice *NONNULL_PTR o);
31743 * Frees any resources used by the SignedRawInvoice, if is_owned is set and inner is non-NULL.
31745 void SignedRawInvoice_free(struct LDKSignedRawInvoice this_obj);
31748 * Checks if two SignedRawInvoices contain equal inner contents.
31749 * This ignores pointers and is_owned flags and looks at the values in fields.
31750 * Two objects with NULL inner values will be considered "equal" here.
31752 bool SignedRawInvoice_eq(const struct LDKSignedRawInvoice *NONNULL_PTR a, const struct LDKSignedRawInvoice *NONNULL_PTR b);
31755 * Creates a copy of the SignedRawInvoice
31757 struct LDKSignedRawInvoice SignedRawInvoice_clone(const struct LDKSignedRawInvoice *NONNULL_PTR orig);
31760 * Checks if two SignedRawInvoices contain equal inner contents.
31762 uint64_t SignedRawInvoice_hash(const struct LDKSignedRawInvoice *NONNULL_PTR o);
31765 * Frees any resources used by the RawInvoice, if is_owned is set and inner is non-NULL.
31767 void RawInvoice_free(struct LDKRawInvoice this_obj);
31772 struct LDKRawDataPart RawInvoice_get_data(const struct LDKRawInvoice *NONNULL_PTR this_ptr);
31777 void RawInvoice_set_data(struct LDKRawInvoice *NONNULL_PTR this_ptr, struct LDKRawDataPart val);
31780 * Checks if two RawInvoices contain equal inner contents.
31781 * This ignores pointers and is_owned flags and looks at the values in fields.
31782 * Two objects with NULL inner values will be considered "equal" here.
31784 bool RawInvoice_eq(const struct LDKRawInvoice *NONNULL_PTR a, const struct LDKRawInvoice *NONNULL_PTR b);
31787 * Creates a copy of the RawInvoice
31789 struct LDKRawInvoice RawInvoice_clone(const struct LDKRawInvoice *NONNULL_PTR orig);
31792 * Checks if two RawInvoices contain equal inner contents.
31794 uint64_t RawInvoice_hash(const struct LDKRawInvoice *NONNULL_PTR o);
31797 * Frees any resources used by the RawDataPart, if is_owned is set and inner is non-NULL.
31799 void RawDataPart_free(struct LDKRawDataPart this_obj);
31802 * generation time of the invoice
31804 struct LDKPositiveTimestamp RawDataPart_get_timestamp(const struct LDKRawDataPart *NONNULL_PTR this_ptr);
31807 * generation time of the invoice
31809 void RawDataPart_set_timestamp(struct LDKRawDataPart *NONNULL_PTR this_ptr, struct LDKPositiveTimestamp val);
31812 * Checks if two RawDataParts contain equal inner contents.
31813 * This ignores pointers and is_owned flags and looks at the values in fields.
31814 * Two objects with NULL inner values will be considered "equal" here.
31816 bool RawDataPart_eq(const struct LDKRawDataPart *NONNULL_PTR a, const struct LDKRawDataPart *NONNULL_PTR b);
31819 * Creates a copy of the RawDataPart
31821 struct LDKRawDataPart RawDataPart_clone(const struct LDKRawDataPart *NONNULL_PTR orig);
31824 * Checks if two RawDataParts contain equal inner contents.
31826 uint64_t RawDataPart_hash(const struct LDKRawDataPart *NONNULL_PTR o);
31829 * Frees any resources used by the PositiveTimestamp, if is_owned is set and inner is non-NULL.
31831 void PositiveTimestamp_free(struct LDKPositiveTimestamp this_obj);
31834 * Checks if two PositiveTimestamps contain equal inner contents.
31835 * This ignores pointers and is_owned flags and looks at the values in fields.
31836 * Two objects with NULL inner values will be considered "equal" here.
31838 bool PositiveTimestamp_eq(const struct LDKPositiveTimestamp *NONNULL_PTR a, const struct LDKPositiveTimestamp *NONNULL_PTR b);
31841 * Creates a copy of the PositiveTimestamp
31843 struct LDKPositiveTimestamp PositiveTimestamp_clone(const struct LDKPositiveTimestamp *NONNULL_PTR orig);
31846 * Checks if two PositiveTimestamps contain equal inner contents.
31848 uint64_t PositiveTimestamp_hash(const struct LDKPositiveTimestamp *NONNULL_PTR o);
31851 * Creates a copy of the SiPrefix
31853 enum LDKSiPrefix SiPrefix_clone(const enum LDKSiPrefix *NONNULL_PTR orig);
31856 * Utility method to constructs a new Milli-variant SiPrefix
31858 enum LDKSiPrefix SiPrefix_milli(void);
31861 * Utility method to constructs a new Micro-variant SiPrefix
31863 enum LDKSiPrefix SiPrefix_micro(void);
31866 * Utility method to constructs a new Nano-variant SiPrefix
31868 enum LDKSiPrefix SiPrefix_nano(void);
31871 * Utility method to constructs a new Pico-variant SiPrefix
31873 enum LDKSiPrefix SiPrefix_pico(void);
31876 * Checks if two SiPrefixs contain equal inner contents.
31877 * This ignores pointers and is_owned flags and looks at the values in fields.
31879 bool SiPrefix_eq(const enum LDKSiPrefix *NONNULL_PTR a, const enum LDKSiPrefix *NONNULL_PTR b);
31882 * Checks if two SiPrefixs contain equal inner contents.
31884 uint64_t SiPrefix_hash(const enum LDKSiPrefix *NONNULL_PTR o);
31887 * Returns the multiplier to go from a BTC value to picoBTC implied by this SiPrefix.
31888 * This is effectively 10^12 * the prefix multiplier
31890 MUST_USE_RES uint64_t SiPrefix_multiplier(const enum LDKSiPrefix *NONNULL_PTR this_arg);
31893 * Creates a copy of the Currency
31895 enum LDKCurrency Currency_clone(const enum LDKCurrency *NONNULL_PTR orig);
31898 * Utility method to constructs a new Bitcoin-variant Currency
31900 enum LDKCurrency Currency_bitcoin(void);
31903 * Utility method to constructs a new BitcoinTestnet-variant Currency
31905 enum LDKCurrency Currency_bitcoin_testnet(void);
31908 * Utility method to constructs a new Regtest-variant Currency
31910 enum LDKCurrency Currency_regtest(void);
31913 * Utility method to constructs a new Simnet-variant Currency
31915 enum LDKCurrency Currency_simnet(void);
31918 * Utility method to constructs a new Signet-variant Currency
31920 enum LDKCurrency Currency_signet(void);
31923 * Checks if two Currencys contain equal inner contents.
31925 uint64_t Currency_hash(const enum LDKCurrency *NONNULL_PTR o);
31928 * Checks if two Currencys contain equal inner contents.
31929 * This ignores pointers and is_owned flags and looks at the values in fields.
31931 bool Currency_eq(const enum LDKCurrency *NONNULL_PTR a, const enum LDKCurrency *NONNULL_PTR b);
31934 * Frees any resources used by the Sha256, if is_owned is set and inner is non-NULL.
31936 void Sha256_free(struct LDKSha256 this_obj);
31939 * Creates a copy of the Sha256
31941 struct LDKSha256 Sha256_clone(const struct LDKSha256 *NONNULL_PTR orig);
31944 * Checks if two Sha256s contain equal inner contents.
31946 uint64_t Sha256_hash(const struct LDKSha256 *NONNULL_PTR o);
31949 * Checks if two Sha256s contain equal inner contents.
31950 * This ignores pointers and is_owned flags and looks at the values in fields.
31951 * Two objects with NULL inner values will be considered "equal" here.
31953 bool Sha256_eq(const struct LDKSha256 *NONNULL_PTR a, const struct LDKSha256 *NONNULL_PTR b);
31956 * Frees any resources used by the Description, if is_owned is set and inner is non-NULL.
31958 void Description_free(struct LDKDescription this_obj);
31961 * Creates a copy of the Description
31963 struct LDKDescription Description_clone(const struct LDKDescription *NONNULL_PTR orig);
31966 * Checks if two Descriptions contain equal inner contents.
31968 uint64_t Description_hash(const struct LDKDescription *NONNULL_PTR o);
31971 * Checks if two Descriptions contain equal inner contents.
31972 * This ignores pointers and is_owned flags and looks at the values in fields.
31973 * Two objects with NULL inner values will be considered "equal" here.
31975 bool Description_eq(const struct LDKDescription *NONNULL_PTR a, const struct LDKDescription *NONNULL_PTR b);
31978 * Frees any resources used by the PayeePubKey, if is_owned is set and inner is non-NULL.
31980 void PayeePubKey_free(struct LDKPayeePubKey this_obj);
31982 struct LDKPublicKey PayeePubKey_get_a(const struct LDKPayeePubKey *NONNULL_PTR this_ptr);
31984 void PayeePubKey_set_a(struct LDKPayeePubKey *NONNULL_PTR this_ptr, struct LDKPublicKey val);
31987 * Constructs a new PayeePubKey given each field
31989 MUST_USE_RES struct LDKPayeePubKey PayeePubKey_new(struct LDKPublicKey a_arg);
31992 * Creates a copy of the PayeePubKey
31994 struct LDKPayeePubKey PayeePubKey_clone(const struct LDKPayeePubKey *NONNULL_PTR orig);
31997 * Checks if two PayeePubKeys contain equal inner contents.
31999 uint64_t PayeePubKey_hash(const struct LDKPayeePubKey *NONNULL_PTR o);
32002 * Checks if two PayeePubKeys contain equal inner contents.
32003 * This ignores pointers and is_owned flags and looks at the values in fields.
32004 * Two objects with NULL inner values will be considered "equal" here.
32006 bool PayeePubKey_eq(const struct LDKPayeePubKey *NONNULL_PTR a, const struct LDKPayeePubKey *NONNULL_PTR b);
32009 * Frees any resources used by the ExpiryTime, if is_owned is set and inner is non-NULL.
32011 void ExpiryTime_free(struct LDKExpiryTime this_obj);
32014 * Creates a copy of the ExpiryTime
32016 struct LDKExpiryTime ExpiryTime_clone(const struct LDKExpiryTime *NONNULL_PTR orig);
32019 * Checks if two ExpiryTimes contain equal inner contents.
32021 uint64_t ExpiryTime_hash(const struct LDKExpiryTime *NONNULL_PTR o);
32024 * Checks if two ExpiryTimes contain equal inner contents.
32025 * This ignores pointers and is_owned flags and looks at the values in fields.
32026 * Two objects with NULL inner values will be considered "equal" here.
32028 bool ExpiryTime_eq(const struct LDKExpiryTime *NONNULL_PTR a, const struct LDKExpiryTime *NONNULL_PTR b);
32031 * Frees any resources used by the MinFinalCltvExpiry, if is_owned is set and inner is non-NULL.
32033 void MinFinalCltvExpiry_free(struct LDKMinFinalCltvExpiry this_obj);
32035 uint64_t MinFinalCltvExpiry_get_a(const struct LDKMinFinalCltvExpiry *NONNULL_PTR this_ptr);
32037 void MinFinalCltvExpiry_set_a(struct LDKMinFinalCltvExpiry *NONNULL_PTR this_ptr, uint64_t val);
32040 * Constructs a new MinFinalCltvExpiry given each field
32042 MUST_USE_RES struct LDKMinFinalCltvExpiry MinFinalCltvExpiry_new(uint64_t a_arg);
32045 * Creates a copy of the MinFinalCltvExpiry
32047 struct LDKMinFinalCltvExpiry MinFinalCltvExpiry_clone(const struct LDKMinFinalCltvExpiry *NONNULL_PTR orig);
32050 * Checks if two MinFinalCltvExpirys contain equal inner contents.
32052 uint64_t MinFinalCltvExpiry_hash(const struct LDKMinFinalCltvExpiry *NONNULL_PTR o);
32055 * Checks if two MinFinalCltvExpirys contain equal inner contents.
32056 * This ignores pointers and is_owned flags and looks at the values in fields.
32057 * Two objects with NULL inner values will be considered "equal" here.
32059 bool MinFinalCltvExpiry_eq(const struct LDKMinFinalCltvExpiry *NONNULL_PTR a, const struct LDKMinFinalCltvExpiry *NONNULL_PTR b);
32062 * Frees any resources used by the Fallback
32064 void Fallback_free(struct LDKFallback this_ptr);
32067 * Creates a copy of the Fallback
32069 struct LDKFallback Fallback_clone(const struct LDKFallback *NONNULL_PTR orig);
32072 * Utility method to constructs a new SegWitProgram-variant Fallback
32074 struct LDKFallback Fallback_seg_wit_program(struct LDKU5 version, struct LDKCVec_u8Z program);
32077 * Utility method to constructs a new PubKeyHash-variant Fallback
32079 struct LDKFallback Fallback_pub_key_hash(struct LDKTwentyBytes a);
32082 * Utility method to constructs a new ScriptHash-variant Fallback
32084 struct LDKFallback Fallback_script_hash(struct LDKTwentyBytes a);
32087 * Checks if two Fallbacks contain equal inner contents.
32089 uint64_t Fallback_hash(const struct LDKFallback *NONNULL_PTR o);
32092 * Checks if two Fallbacks contain equal inner contents.
32093 * This ignores pointers and is_owned flags and looks at the values in fields.
32095 bool Fallback_eq(const struct LDKFallback *NONNULL_PTR a, const struct LDKFallback *NONNULL_PTR b);
32098 * Frees any resources used by the InvoiceSignature, if is_owned is set and inner is non-NULL.
32100 void InvoiceSignature_free(struct LDKInvoiceSignature this_obj);
32103 * Creates a copy of the InvoiceSignature
32105 struct LDKInvoiceSignature InvoiceSignature_clone(const struct LDKInvoiceSignature *NONNULL_PTR orig);
32108 * Checks if two InvoiceSignatures contain equal inner contents.
32110 uint64_t InvoiceSignature_hash(const struct LDKInvoiceSignature *NONNULL_PTR o);
32113 * Checks if two InvoiceSignatures contain equal inner contents.
32114 * This ignores pointers and is_owned flags and looks at the values in fields.
32115 * Two objects with NULL inner values will be considered "equal" here.
32117 bool InvoiceSignature_eq(const struct LDKInvoiceSignature *NONNULL_PTR a, const struct LDKInvoiceSignature *NONNULL_PTR b);
32120 * Frees any resources used by the PrivateRoute, if is_owned is set and inner is non-NULL.
32122 void PrivateRoute_free(struct LDKPrivateRoute this_obj);
32125 * Creates a copy of the PrivateRoute
32127 struct LDKPrivateRoute PrivateRoute_clone(const struct LDKPrivateRoute *NONNULL_PTR orig);
32130 * Checks if two PrivateRoutes contain equal inner contents.
32132 uint64_t PrivateRoute_hash(const struct LDKPrivateRoute *NONNULL_PTR o);
32135 * Checks if two PrivateRoutes contain equal inner contents.
32136 * This ignores pointers and is_owned flags and looks at the values in fields.
32137 * Two objects with NULL inner values will be considered "equal" here.
32139 bool PrivateRoute_eq(const struct LDKPrivateRoute *NONNULL_PTR a, const struct LDKPrivateRoute *NONNULL_PTR b);
32142 * Disassembles the `SignedRawInvoice` into its three parts:
32144 * 2. hash of the raw invoice
32147 MUST_USE_RES struct LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ SignedRawInvoice_into_parts(struct LDKSignedRawInvoice this_arg);
32150 * The `RawInvoice` which was signed.
32152 MUST_USE_RES struct LDKRawInvoice SignedRawInvoice_raw_invoice(const struct LDKSignedRawInvoice *NONNULL_PTR this_arg);
32155 * The hash of the `RawInvoice` that was signed.
32157 MUST_USE_RES const uint8_t (*SignedRawInvoice_signable_hash(const struct LDKSignedRawInvoice *NONNULL_PTR this_arg))[32];
32160 * InvoiceSignature for the invoice.
32162 MUST_USE_RES struct LDKInvoiceSignature SignedRawInvoice_signature(const struct LDKSignedRawInvoice *NONNULL_PTR this_arg);
32165 * Recovers the public key used for signing the invoice from the recoverable signature.
32167 MUST_USE_RES struct LDKCResult_PayeePubKeyErrorZ SignedRawInvoice_recover_payee_pub_key(const struct LDKSignedRawInvoice *NONNULL_PTR this_arg);
32170 * Checks if the signature is valid for the included payee public key or if none exists if it's
32171 * valid for the recovered signature (which should always be true?).
32173 MUST_USE_RES bool SignedRawInvoice_check_signature(const struct LDKSignedRawInvoice *NONNULL_PTR this_arg);
32176 * Calculate the hash of the encoded `RawInvoice` which should be signed.
32178 MUST_USE_RES struct LDKThirtyTwoBytes RawInvoice_signable_hash(const struct LDKRawInvoice *NONNULL_PTR this_arg);
32182 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
32184 MUST_USE_RES struct LDKSha256 RawInvoice_payment_hash(const struct LDKRawInvoice *NONNULL_PTR this_arg);
32188 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
32190 MUST_USE_RES struct LDKDescription RawInvoice_description(const struct LDKRawInvoice *NONNULL_PTR this_arg);
32194 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
32196 MUST_USE_RES struct LDKPayeePubKey RawInvoice_payee_pub_key(const struct LDKRawInvoice *NONNULL_PTR this_arg);
32200 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
32202 MUST_USE_RES struct LDKSha256 RawInvoice_description_hash(const struct LDKRawInvoice *NONNULL_PTR this_arg);
32206 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
32208 MUST_USE_RES struct LDKExpiryTime RawInvoice_expiry_time(const struct LDKRawInvoice *NONNULL_PTR this_arg);
32212 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
32214 MUST_USE_RES struct LDKMinFinalCltvExpiry RawInvoice_min_final_cltv_expiry(const struct LDKRawInvoice *NONNULL_PTR this_arg);
32218 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
32220 MUST_USE_RES struct LDKThirtyTwoBytes RawInvoice_payment_secret(const struct LDKRawInvoice *NONNULL_PTR this_arg);
32224 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
32226 MUST_USE_RES struct LDKInvoiceFeatures RawInvoice_features(const struct LDKRawInvoice *NONNULL_PTR this_arg);
32228 MUST_USE_RES struct LDKCVec_PrivateRouteZ RawInvoice_private_routes(const struct LDKRawInvoice *NONNULL_PTR this_arg);
32230 MUST_USE_RES struct LDKCOption_u64Z RawInvoice_amount_pico_btc(const struct LDKRawInvoice *NONNULL_PTR this_arg);
32232 MUST_USE_RES enum LDKCurrency RawInvoice_currency(const struct LDKRawInvoice *NONNULL_PTR this_arg);
32235 * Creates a `PositiveTimestamp` from a Unix timestamp in the range `0..=MAX_TIMESTAMP`.
32237 * Otherwise, returns a [`CreationError::TimestampOutOfBounds`].
32239 MUST_USE_RES struct LDKCResult_PositiveTimestampCreationErrorZ PositiveTimestamp_from_unix_timestamp(uint64_t unix_seconds);
32242 * Creates a `PositiveTimestamp` from a [`SystemTime`] with a corresponding Unix timestamp in
32243 * the range `0..=MAX_TIMESTAMP`.
32245 * Note that the subsecond part is dropped as it is not representable in BOLT 11 invoices.
32247 * Otherwise, returns a [`CreationError::TimestampOutOfBounds`].
32249 MUST_USE_RES struct LDKCResult_PositiveTimestampCreationErrorZ PositiveTimestamp_from_system_time(uint64_t time);
32252 * Creates a `PositiveTimestamp` from a [`Duration`] since the Unix epoch in the range
32253 * `0..=MAX_TIMESTAMP`.
32255 * Note that the subsecond part is dropped as it is not representable in BOLT 11 invoices.
32257 * Otherwise, returns a [`CreationError::TimestampOutOfBounds`].
32259 MUST_USE_RES struct LDKCResult_PositiveTimestampCreationErrorZ PositiveTimestamp_from_duration_since_epoch(uint64_t duration);
32262 * Returns the Unix timestamp representing the stored time
32264 MUST_USE_RES uint64_t PositiveTimestamp_as_unix_timestamp(const struct LDKPositiveTimestamp *NONNULL_PTR this_arg);
32267 * Returns the duration of the stored time since the Unix epoch
32269 MUST_USE_RES uint64_t PositiveTimestamp_as_duration_since_epoch(const struct LDKPositiveTimestamp *NONNULL_PTR this_arg);
32272 * Returns the [`SystemTime`] representing the stored time
32274 MUST_USE_RES uint64_t PositiveTimestamp_as_time(const struct LDKPositiveTimestamp *NONNULL_PTR this_arg);
32277 * Transform the `Invoice` into it's unchecked version
32279 MUST_USE_RES struct LDKSignedRawInvoice Invoice_into_signed_raw(struct LDKInvoice this_arg);
32282 * Check that the invoice is signed correctly and that key recovery works
32284 MUST_USE_RES struct LDKCResult_NoneSemanticErrorZ Invoice_check_signature(const struct LDKInvoice *NONNULL_PTR this_arg);
32287 * Constructs an `Invoice` from a `SignedRawInvoice` by checking all its invariants.
32289 * use lightning_invoice::*;
32291 * let invoice = \"lnbc100p1psj9jhxdqud3jxktt5w46x7unfv9kz6mn0v3jsnp4q0d3p2sfluzdx45tqcs\\
32292 * h2pu5qc7lgq0xs578ngs6s0s68ua4h7cvspp5q6rmq35js88zp5dvwrv9m459tnk2zunwj5jalqtyxqulh0l\\
32293 * 5gflssp5nf55ny5gcrfl30xuhzj3nphgj27rstekmr9fw3ny5989s300gyus9qyysgqcqpcrzjqw2sxwe993\\
32294 * h5pcm4dxzpvttgza8zhkqxpgffcrf5v25nwpr3cmfg7z54kuqq8rgqqqqqqqq2qqqqq9qq9qrzjqd0ylaqcl\\
32295 * j9424x9m8h2vcukcgnm6s56xfgu3j78zyqzhgs4hlpzvznlugqq9vsqqqqqqqlgqqqqqeqq9qrzjqwldmj9d\\
32296 * ha74df76zhx6l9we0vjdquygcdt3kssupehe64g6yyp5yz5rhuqqwccqqyqqqqlgqqqqjcqq9qrzjqf9e58a\\
32297 * guqr0rcun0ajlvmzq3ek63cw2w282gv3z5uupmuwvgjtq2z55qsqqg6qqqyqqqrtnqqqzq3cqygrzjqvphms\\
32298 * ywntrrhqjcraumvc4y6r8v4z5v593trte429v4hredj7ms5z52usqq9ngqqqqqqqlgqqqqqqgq9qrzjq2v0v\\
32299 * p62g49p7569ev48cmulecsxe59lvaw3wlxm7r982zxa9zzj7z5l0cqqxusqqyqqqqlgqqqqqzsqygarl9fh3\\
32300 * 8s0gyuxjjgux34w75dnc6xp2l35j7es3jd4ugt3lu0xzre26yg5m7ke54n2d5sym4xcmxtl8238xxvw5h5h5\\
32301 * j5r6drg6k6zcqj0fcwg\";
32303 * let signed = invoice.parse::<SignedRawInvoice>().unwrap();
32305 * assert!(Invoice::from_signed(signed).is_ok());
32308 MUST_USE_RES struct LDKCResult_InvoiceSemanticErrorZ Invoice_from_signed(struct LDKSignedRawInvoice signed_invoice);
32311 * Returns the `Invoice`'s timestamp (should equal its creation time)
32313 MUST_USE_RES uint64_t Invoice_timestamp(const struct LDKInvoice *NONNULL_PTR this_arg);
32316 * Returns the `Invoice`'s timestamp as a duration since the Unix epoch
32318 MUST_USE_RES uint64_t Invoice_duration_since_epoch(const struct LDKInvoice *NONNULL_PTR this_arg);
32321 * Returns the hash to which we will receive the preimage on completion of the payment
32323 MUST_USE_RES const uint8_t (*Invoice_payment_hash(const struct LDKInvoice *NONNULL_PTR this_arg))[32];
32326 * Get the payee's public key if one was included in the invoice
32328 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
32330 MUST_USE_RES struct LDKPublicKey Invoice_payee_pub_key(const struct LDKInvoice *NONNULL_PTR this_arg);
32333 * Get the payment secret if one was included in the invoice
32335 MUST_USE_RES const uint8_t (*Invoice_payment_secret(const struct LDKInvoice *NONNULL_PTR this_arg))[32];
32338 * Get the invoice features if they were included in the invoice
32340 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
32342 MUST_USE_RES struct LDKInvoiceFeatures Invoice_features(const struct LDKInvoice *NONNULL_PTR this_arg);
32345 * Recover the payee's public key (only to be used if none was included in the invoice)
32347 MUST_USE_RES struct LDKPublicKey Invoice_recover_payee_pub_key(const struct LDKInvoice *NONNULL_PTR this_arg);
32350 * Returns the invoice's expiry time, if present, otherwise [`DEFAULT_EXPIRY_TIME`].
32352 MUST_USE_RES uint64_t Invoice_expiry_time(const struct LDKInvoice *NONNULL_PTR this_arg);
32355 * Returns whether the invoice has expired.
32357 MUST_USE_RES bool Invoice_is_expired(const struct LDKInvoice *NONNULL_PTR this_arg);
32360 * Returns whether the expiry time would pass at the given point in time.
32361 * `at_time` is the timestamp as a duration since the Unix epoch.
32363 MUST_USE_RES bool Invoice_would_expire(const struct LDKInvoice *NONNULL_PTR this_arg, uint64_t at_time);
32366 * Returns the invoice's `min_final_cltv_expiry` time, if present, otherwise
32367 * [`DEFAULT_MIN_FINAL_CLTV_EXPIRY`].
32369 MUST_USE_RES uint64_t Invoice_min_final_cltv_expiry(const struct LDKInvoice *NONNULL_PTR this_arg);
32372 * Returns a list of all routes included in the invoice
32374 MUST_USE_RES struct LDKCVec_PrivateRouteZ Invoice_private_routes(const struct LDKInvoice *NONNULL_PTR this_arg);
32377 * Returns a list of all routes included in the invoice as the underlying hints
32379 MUST_USE_RES struct LDKCVec_RouteHintZ Invoice_route_hints(const struct LDKInvoice *NONNULL_PTR this_arg);
32382 * Returns the currency for which the invoice was issued
32384 MUST_USE_RES enum LDKCurrency Invoice_currency(const struct LDKInvoice *NONNULL_PTR this_arg);
32387 * Returns the amount if specified in the invoice as millisatoshis.
32389 MUST_USE_RES struct LDKCOption_u64Z Invoice_amount_milli_satoshis(const struct LDKInvoice *NONNULL_PTR this_arg);
32392 * Creates a new `Description` if `description` is at most 1023 __bytes__ long,
32393 * returns `CreationError::DescriptionTooLong` otherwise
32395 * Please note that single characters may use more than one byte due to UTF8 encoding.
32397 MUST_USE_RES struct LDKCResult_DescriptionCreationErrorZ Description_new(struct LDKStr description);
32400 * Returns the underlying description `String`
32402 MUST_USE_RES struct LDKStr Description_into_inner(struct LDKDescription this_arg);
32405 * Construct an `ExpiryTime` from seconds.
32407 MUST_USE_RES struct LDKExpiryTime ExpiryTime_from_seconds(uint64_t seconds);
32410 * Construct an `ExpiryTime` from a `Duration`, dropping the sub-second part.
32412 MUST_USE_RES struct LDKExpiryTime ExpiryTime_from_duration(uint64_t duration);
32415 * Returns the expiry time in seconds
32417 MUST_USE_RES uint64_t ExpiryTime_as_seconds(const struct LDKExpiryTime *NONNULL_PTR this_arg);
32420 * Returns a reference to the underlying `Duration` (=expiry time)
32422 MUST_USE_RES uint64_t ExpiryTime_as_duration(const struct LDKExpiryTime *NONNULL_PTR this_arg);
32425 * Creates a new (partial) route from a list of hops
32427 MUST_USE_RES struct LDKCResult_PrivateRouteCreationErrorZ PrivateRoute_new(struct LDKRouteHint hops);
32430 * Returns the underlying list of hops
32432 MUST_USE_RES struct LDKRouteHint PrivateRoute_into_inner(struct LDKPrivateRoute this_arg);
32435 * Creates a copy of the CreationError
32437 enum LDKCreationError CreationError_clone(const enum LDKCreationError *NONNULL_PTR orig);
32440 * Utility method to constructs a new DescriptionTooLong-variant CreationError
32442 enum LDKCreationError CreationError_description_too_long(void);
32445 * Utility method to constructs a new RouteTooLong-variant CreationError
32447 enum LDKCreationError CreationError_route_too_long(void);
32450 * Utility method to constructs a new TimestampOutOfBounds-variant CreationError
32452 enum LDKCreationError CreationError_timestamp_out_of_bounds(void);
32455 * Utility method to constructs a new InvalidAmount-variant CreationError
32457 enum LDKCreationError CreationError_invalid_amount(void);
32460 * Utility method to constructs a new MissingRouteHints-variant CreationError
32462 enum LDKCreationError CreationError_missing_route_hints(void);
32465 * Checks if two CreationErrors contain equal inner contents.
32466 * This ignores pointers and is_owned flags and looks at the values in fields.
32468 bool CreationError_eq(const enum LDKCreationError *NONNULL_PTR a, const enum LDKCreationError *NONNULL_PTR b);
32471 * Get the string representation of a CreationError object
32473 struct LDKStr CreationError_to_str(const enum LDKCreationError *NONNULL_PTR o);
32476 * Creates a copy of the SemanticError
32478 enum LDKSemanticError SemanticError_clone(const enum LDKSemanticError *NONNULL_PTR orig);
32481 * Utility method to constructs a new NoPaymentHash-variant SemanticError
32483 enum LDKSemanticError SemanticError_no_payment_hash(void);
32486 * Utility method to constructs a new MultiplePaymentHashes-variant SemanticError
32488 enum LDKSemanticError SemanticError_multiple_payment_hashes(void);
32491 * Utility method to constructs a new NoDescription-variant SemanticError
32493 enum LDKSemanticError SemanticError_no_description(void);
32496 * Utility method to constructs a new MultipleDescriptions-variant SemanticError
32498 enum LDKSemanticError SemanticError_multiple_descriptions(void);
32501 * Utility method to constructs a new NoPaymentSecret-variant SemanticError
32503 enum LDKSemanticError SemanticError_no_payment_secret(void);
32506 * Utility method to constructs a new MultiplePaymentSecrets-variant SemanticError
32508 enum LDKSemanticError SemanticError_multiple_payment_secrets(void);
32511 * Utility method to constructs a new InvalidFeatures-variant SemanticError
32513 enum LDKSemanticError SemanticError_invalid_features(void);
32516 * Utility method to constructs a new InvalidRecoveryId-variant SemanticError
32518 enum LDKSemanticError SemanticError_invalid_recovery_id(void);
32521 * Utility method to constructs a new InvalidSignature-variant SemanticError
32523 enum LDKSemanticError SemanticError_invalid_signature(void);
32526 * Utility method to constructs a new ImpreciseAmount-variant SemanticError
32528 enum LDKSemanticError SemanticError_imprecise_amount(void);
32531 * Checks if two SemanticErrors contain equal inner contents.
32532 * This ignores pointers and is_owned flags and looks at the values in fields.
32534 bool SemanticError_eq(const enum LDKSemanticError *NONNULL_PTR a, const enum LDKSemanticError *NONNULL_PTR b);
32537 * Get the string representation of a SemanticError object
32539 struct LDKStr SemanticError_to_str(const enum LDKSemanticError *NONNULL_PTR o);
32542 * Frees any resources used by the SignOrCreationError
32544 void SignOrCreationError_free(struct LDKSignOrCreationError this_ptr);
32547 * Creates a copy of the SignOrCreationError
32549 struct LDKSignOrCreationError SignOrCreationError_clone(const struct LDKSignOrCreationError *NONNULL_PTR orig);
32552 * Utility method to constructs a new SignError-variant SignOrCreationError
32554 struct LDKSignOrCreationError SignOrCreationError_sign_error(void);
32557 * Utility method to constructs a new CreationError-variant SignOrCreationError
32559 struct LDKSignOrCreationError SignOrCreationError_creation_error(enum LDKCreationError a);
32562 * Checks if two SignOrCreationErrors contain equal inner contents.
32563 * This ignores pointers and is_owned flags and looks at the values in fields.
32565 bool SignOrCreationError_eq(const struct LDKSignOrCreationError *NONNULL_PTR a, const struct LDKSignOrCreationError *NONNULL_PTR b);
32568 * Get the string representation of a SignOrCreationError object
32570 struct LDKStr SignOrCreationError_to_str(const struct LDKSignOrCreationError *NONNULL_PTR o);
32573 * Frees any resources used by the InvoicePayer, if is_owned is set and inner is non-NULL.
32575 void InvoicePayer_free(struct LDKInvoicePayer this_obj);
32578 * Calls the free function if one is set
32580 void Payer_free(struct LDKPayer this_ptr);
32583 * Frees any resources used by the Retry
32585 void Retry_free(struct LDKRetry this_ptr);
32588 * Creates a copy of the Retry
32590 struct LDKRetry Retry_clone(const struct LDKRetry *NONNULL_PTR orig);
32593 * Utility method to constructs a new Attempts-variant Retry
32595 struct LDKRetry Retry_attempts(uintptr_t a);
32598 * Utility method to constructs a new Timeout-variant Retry
32600 struct LDKRetry Retry_timeout(uint64_t a);
32603 * Checks if two Retrys contain equal inner contents.
32604 * This ignores pointers and is_owned flags and looks at the values in fields.
32606 bool Retry_eq(const struct LDKRetry *NONNULL_PTR a, const struct LDKRetry *NONNULL_PTR b);
32609 * Checks if two Retrys contain equal inner contents.
32611 uint64_t Retry_hash(const struct LDKRetry *NONNULL_PTR o);
32614 * Frees any resources used by the PaymentError
32616 void PaymentError_free(struct LDKPaymentError this_ptr);
32619 * Creates a copy of the PaymentError
32621 struct LDKPaymentError PaymentError_clone(const struct LDKPaymentError *NONNULL_PTR orig);
32624 * Utility method to constructs a new Invoice-variant PaymentError
32626 struct LDKPaymentError PaymentError_invoice(struct LDKStr a);
32629 * Utility method to constructs a new Routing-variant PaymentError
32631 struct LDKPaymentError PaymentError_routing(struct LDKLightningError a);
32634 * Utility method to constructs a new Sending-variant PaymentError
32636 struct LDKPaymentError PaymentError_sending(struct LDKPaymentSendFailure a);
32639 * Creates an invoice payer that retries failed payment paths.
32641 * Will forward any [`Event::PaymentPathFailed`] events to the decorated `event_handler` once
32642 * `retry` has been exceeded for a given [`Invoice`].
32644 MUST_USE_RES struct LDKInvoicePayer InvoicePayer_new(struct LDKPayer payer, struct LDKRouter router, struct LDKLogger logger, struct LDKEventHandler event_handler, struct LDKRetry retry);
32647 * Pays the given [`Invoice`], caching it for later use in case a retry is needed.
32649 * [`Invoice::payment_hash`] is used as the [`PaymentId`], which ensures idempotency as long
32650 * as the payment is still pending. Once the payment completes or fails, you must ensure that
32651 * a second payment with the same [`PaymentHash`] is never sent.
32653 * If you wish to use a different payment idempotency token, see
32654 * [`Self::pay_invoice_with_id`].
32656 MUST_USE_RES struct LDKCResult_PaymentIdPaymentErrorZ InvoicePayer_pay_invoice(const struct LDKInvoicePayer *NONNULL_PTR this_arg, const struct LDKInvoice *NONNULL_PTR invoice);
32659 * Pays the given [`Invoice`] with a custom idempotency key, caching the invoice for later use
32660 * in case a retry is needed.
32662 * Note that idempotency is only guaranteed as long as the payment is still pending. Once the
32663 * payment completes or fails, no idempotency guarantees are made.
32665 * You should ensure that the [`Invoice::payment_hash`] is unique and the same [`PaymentHash`]
32666 * has never been paid before.
32668 * See [`Self::pay_invoice`] for a variant which uses the [`PaymentHash`] for the idempotency
32671 MUST_USE_RES struct LDKCResult_NonePaymentErrorZ InvoicePayer_pay_invoice_with_id(const struct LDKInvoicePayer *NONNULL_PTR this_arg, const struct LDKInvoice *NONNULL_PTR invoice, struct LDKThirtyTwoBytes payment_id);
32674 * Pays the given zero-value [`Invoice`] using the given amount, caching it for later use in
32675 * case a retry is needed.
32677 * [`Invoice::payment_hash`] is used as the [`PaymentId`], which ensures idempotency as long
32678 * as the payment is still pending. Once the payment completes or fails, you must ensure that
32679 * a second payment with the same [`PaymentHash`] is never sent.
32681 * If you wish to use a different payment idempotency token, see
32682 * [`Self::pay_zero_value_invoice_with_id`].
32684 MUST_USE_RES struct LDKCResult_PaymentIdPaymentErrorZ InvoicePayer_pay_zero_value_invoice(const struct LDKInvoicePayer *NONNULL_PTR this_arg, const struct LDKInvoice *NONNULL_PTR invoice, uint64_t amount_msats);
32687 * Pays the given zero-value [`Invoice`] using the given amount and custom idempotency key,
32688 * caching the invoice for later use in case a retry is needed.
32690 * Note that idempotency is only guaranteed as long as the payment is still pending. Once the
32691 * payment completes or fails, no idempotency guarantees are made.
32693 * You should ensure that the [`Invoice::payment_hash`] is unique and the same [`PaymentHash`]
32694 * has never been paid before.
32696 * See [`Self::pay_zero_value_invoice`] for a variant which uses the [`PaymentHash`] for the
32697 * idempotency token.
32699 MUST_USE_RES struct LDKCResult_NonePaymentErrorZ InvoicePayer_pay_zero_value_invoice_with_id(const struct LDKInvoicePayer *NONNULL_PTR this_arg, const struct LDKInvoice *NONNULL_PTR invoice, uint64_t amount_msats, struct LDKThirtyTwoBytes payment_id);
32702 * Pays `pubkey` an amount using the hash of the given preimage, caching it for later use in
32703 * case a retry is needed.
32705 * The hash of the [`PaymentPreimage`] is used as the [`PaymentId`], which ensures idempotency
32706 * as long as the payment is still pending. Once the payment completes or fails, you must
32707 * ensure that a second payment with the same [`PaymentPreimage`] is never sent.
32709 MUST_USE_RES struct LDKCResult_PaymentIdPaymentErrorZ InvoicePayer_pay_pubkey(const struct LDKInvoicePayer *NONNULL_PTR this_arg, struct LDKPublicKey pubkey, struct LDKThirtyTwoBytes payment_preimage, uint64_t amount_msats, uint32_t final_cltv_expiry_delta);
32712 * Pays `pubkey` an amount using the hash of the given preimage and a custom idempotency key,
32713 * caching the invoice for later use in case a retry is needed.
32715 * Note that idempotency is only guaranteed as long as the payment is still pending. Once the
32716 * payment completes or fails, no idempotency guarantees are made.
32718 * You should ensure that the [`PaymentPreimage`] is unique and the corresponding
32719 * [`PaymentHash`] has never been paid before.
32721 MUST_USE_RES struct LDKCResult_NonePaymentErrorZ InvoicePayer_pay_pubkey_with_id(const struct LDKInvoicePayer *NONNULL_PTR this_arg, struct LDKPublicKey pubkey, struct LDKThirtyTwoBytes payment_preimage, struct LDKThirtyTwoBytes payment_id, uint64_t amount_msats, uint32_t final_cltv_expiry_delta);
32724 * Removes the payment cached by the given payment hash.
32726 * Should be called once a payment has failed or succeeded if not using [`InvoicePayer`] as an
32727 * [`EventHandler`]. Otherwise, calling this method is unnecessary.
32729 void InvoicePayer_remove_cached_payment(const struct LDKInvoicePayer *NONNULL_PTR this_arg, const uint8_t (*payment_hash)[32]);
32732 * Constructs a new EventHandler which calls the relevant methods on this_arg.
32733 * This copies the `inner` pointer in this_arg and thus the returned EventHandler must be freed before this_arg is
32735 struct LDKEventHandler InvoicePayer_as_EventHandler(const struct LDKInvoicePayer *NONNULL_PTR this_arg);
32738 * Utility to create an invoice that can be paid to one of multiple nodes, or a \"phantom invoice.\"
32739 * See [`PhantomKeysManager`] for more information on phantom node payments.
32741 * `phantom_route_hints` parameter:
32742 * * Contains channel info for all nodes participating in the phantom invoice
32743 * * Entries are retrieved from a call to [`ChannelManager::get_phantom_route_hints`] on each
32744 * participating node
32745 * * It is fine to cache `phantom_route_hints` and reuse it across invoices, as long as the data is
32746 * updated when a channel becomes disabled or closes
32747 * * Note that if too many channels are included in [`PhantomRouteHints::channels`], the invoice
32748 * may be too long for QR code scanning. To fix this, `PhantomRouteHints::channels` may be pared
32751 * `payment_hash` can be specified if you have a specific need for a custom payment hash (see the difference
32752 * between [`ChannelManager::create_inbound_payment`] and [`ChannelManager::create_inbound_payment_for_hash`]).
32753 * If `None` is provided for `payment_hash`, then one will be created.
32755 * `invoice_expiry_delta_secs` describes the number of seconds that the invoice is valid for
32756 * in excess of the current time.
32758 * Note that the provided `keys_manager`'s `KeysInterface` implementation must support phantom
32759 * invoices in its `sign_invoice` implementation ([`PhantomKeysManager`] satisfies this
32762 * [`PhantomKeysManager`]: lightning::chain::keysinterface::PhantomKeysManager
32763 * [`ChannelManager::get_phantom_route_hints`]: lightning::ln::channelmanager::ChannelManager::get_phantom_route_hints
32764 * [`ChannelManager::create_inbound_payment`]: lightning::ln::channelmanager::ChannelManager::create_inbound_payment
32765 * [`ChannelManager::create_inbound_payment_for_hash`]: lightning::ln::channelmanager::ChannelManager::create_inbound_payment_for_hash
32766 * [`PhantomRouteHints::channels`]: lightning::ln::channelmanager::PhantomRouteHints::channels
32768 * Note that payment_hash (or a relevant inner pointer) may be NULL or all-0s to represent None
32770 struct LDKCResult_InvoiceSignOrCreationErrorZ create_phantom_invoice(struct LDKCOption_u64Z amt_msat, struct LDKThirtyTwoBytes payment_hash, struct LDKStr description, uint32_t invoice_expiry_delta_secs, struct LDKCVec_PhantomRouteHintsZ phantom_route_hints, struct LDKKeysInterface keys_manager, struct LDKLogger logger, enum LDKCurrency network);
32773 * Utility to create an invoice that can be paid to one of multiple nodes, or a \"phantom invoice.\"
32774 * See [`PhantomKeysManager`] for more information on phantom node payments.
32776 * `phantom_route_hints` parameter:
32777 * * Contains channel info for all nodes participating in the phantom invoice
32778 * * Entries are retrieved from a call to [`ChannelManager::get_phantom_route_hints`] on each
32779 * participating node
32780 * * It is fine to cache `phantom_route_hints` and reuse it across invoices, as long as the data is
32781 * updated when a channel becomes disabled or closes
32782 * * Note that if too many channels are included in [`PhantomRouteHints::channels`], the invoice
32783 * may be too long for QR code scanning. To fix this, `PhantomRouteHints::channels` may be pared
32786 * `description_hash` is a SHA-256 hash of the description text
32788 * `payment_hash` can be specified if you have a specific need for a custom payment hash (see the difference
32789 * between [`ChannelManager::create_inbound_payment`] and [`ChannelManager::create_inbound_payment_for_hash`]).
32790 * If `None` is provided for `payment_hash`, then one will be created.
32792 * `invoice_expiry_delta_secs` describes the number of seconds that the invoice is valid for
32793 * in excess of the current time.
32795 * Note that the provided `keys_manager`'s `KeysInterface` implementation must support phantom
32796 * invoices in its `sign_invoice` implementation ([`PhantomKeysManager`] satisfies this
32799 * [`PhantomKeysManager`]: lightning::chain::keysinterface::PhantomKeysManager
32800 * [`ChannelManager::get_phantom_route_hints`]: lightning::ln::channelmanager::ChannelManager::get_phantom_route_hints
32801 * [`ChannelManager::create_inbound_payment`]: lightning::ln::channelmanager::ChannelManager::create_inbound_payment
32802 * [`ChannelManager::create_inbound_payment_for_hash`]: lightning::ln::channelmanager::ChannelManager::create_inbound_payment_for_hash
32803 * [`PhantomRouteHints::channels`]: lightning::ln::channelmanager::PhantomRouteHints::channels
32805 * Note that payment_hash (or a relevant inner pointer) may be NULL or all-0s to represent None
32807 struct LDKCResult_InvoiceSignOrCreationErrorZ create_phantom_invoice_with_description_hash(struct LDKCOption_u64Z amt_msat, struct LDKThirtyTwoBytes payment_hash, uint32_t invoice_expiry_delta_secs, struct LDKSha256 description_hash, struct LDKCVec_PhantomRouteHintsZ phantom_route_hints, struct LDKKeysInterface keys_manager, struct LDKLogger logger, enum LDKCurrency network);
32810 * Utility to construct an invoice. Generally, unless you want to do something like a custom
32811 * cltv_expiry, this is what you should be using to create an invoice. The reason being, this
32812 * method stores the invoice's payment secret and preimage in `ChannelManager`, so (a) the user
32813 * doesn't have to store preimage/payment secret information and (b) `ChannelManager` can verify
32814 * that the payment secret is valid when the invoice is paid.
32816 * `invoice_expiry_delta_secs` describes the number of seconds that the invoice is valid for
32817 * in excess of the current time.
32819 struct LDKCResult_InvoiceSignOrCreationErrorZ create_invoice_from_channelmanager(const struct LDKChannelManager *NONNULL_PTR channelmanager, struct LDKKeysInterface keys_manager, struct LDKLogger logger, enum LDKCurrency network, struct LDKCOption_u64Z amt_msat, struct LDKStr description, uint32_t invoice_expiry_delta_secs);
32822 * Utility to construct an invoice. Generally, unless you want to do something like a custom
32823 * cltv_expiry, this is what you should be using to create an invoice. The reason being, this
32824 * method stores the invoice's payment secret and preimage in `ChannelManager`, so (a) the user
32825 * doesn't have to store preimage/payment secret information and (b) `ChannelManager` can verify
32826 * that the payment secret is valid when the invoice is paid.
32827 * Use this variant if you want to pass the `description_hash` to the invoice.
32829 * `invoice_expiry_delta_secs` describes the number of seconds that the invoice is valid for
32830 * in excess of the current time.
32832 struct LDKCResult_InvoiceSignOrCreationErrorZ create_invoice_from_channelmanager_with_description_hash(const struct LDKChannelManager *NONNULL_PTR channelmanager, struct LDKKeysInterface keys_manager, struct LDKLogger logger, enum LDKCurrency network, struct LDKCOption_u64Z amt_msat, struct LDKSha256 description_hash, uint32_t invoice_expiry_delta_secs);
32835 * See [`create_invoice_from_channelmanager_with_description_hash`]
32836 * This version can be used in a `no_std` environment, where [`std::time::SystemTime`] is not
32837 * available and the current time is supplied by the caller.
32839 struct LDKCResult_InvoiceSignOrCreationErrorZ create_invoice_from_channelmanager_with_description_hash_and_duration_since_epoch(const struct LDKChannelManager *NONNULL_PTR channelmanager, struct LDKKeysInterface keys_manager, 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);
32842 * See [`create_invoice_from_channelmanager`]
32843 * This version can be used in a `no_std` environment, where [`std::time::SystemTime`] is not
32844 * available and the current time is supplied by the caller.
32846 struct LDKCResult_InvoiceSignOrCreationErrorZ create_invoice_from_channelmanager_and_duration_since_epoch(const struct LDKChannelManager *NONNULL_PTR channelmanager, struct LDKKeysInterface keys_manager, 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);
32849 * See [`create_invoice_from_channelmanager_and_duration_since_epoch`]
32850 * This version allows for providing a custom [`PaymentHash`] for the invoice.
32851 * This may be useful if you're building an on-chain swap or involving another protocol where
32852 * the payment hash is also involved outside the scope of lightning.
32854 struct LDKCResult_InvoiceSignOrCreationErrorZ create_invoice_from_channelmanager_and_duration_since_epoch_with_payment_hash(const struct LDKChannelManager *NONNULL_PTR channelmanager, struct LDKKeysInterface keys_manager, 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);
32857 * Constructs a new Payer which calls the relevant methods on this_arg.
32858 * This copies the `inner` pointer in this_arg and thus the returned Payer must be freed before this_arg is
32860 struct LDKPayer ChannelManager_as_Payer(const struct LDKChannelManager *NONNULL_PTR this_arg);
32863 * Read a SiPrefix object from a string
32865 struct LDKCResult_SiPrefixParseErrorZ SiPrefix_from_str(struct LDKStr s);
32868 * Read a Invoice object from a string
32870 struct LDKCResult_InvoiceParseOrSemanticErrorZ Invoice_from_str(struct LDKStr s);
32873 * Read a SignedRawInvoice object from a string
32875 struct LDKCResult_SignedRawInvoiceParseErrorZ SignedRawInvoice_from_str(struct LDKStr s);
32878 * Get the string representation of a ParseError object
32880 struct LDKStr ParseError_to_str(const struct LDKParseError *NONNULL_PTR o);
32883 * Get the string representation of a ParseOrSemanticError object
32885 struct LDKStr ParseOrSemanticError_to_str(const struct LDKParseOrSemanticError *NONNULL_PTR o);
32888 * Get the string representation of a Invoice object
32890 struct LDKStr Invoice_to_str(const struct LDKInvoice *NONNULL_PTR o);
32893 * Get the string representation of a SignedRawInvoice object
32895 struct LDKStr SignedRawInvoice_to_str(const struct LDKSignedRawInvoice *NONNULL_PTR o);
32898 * Get the string representation of a Currency object
32900 struct LDKStr Currency_to_str(const enum LDKCurrency *NONNULL_PTR o);
32903 * Get the string representation of a SiPrefix object
32905 struct LDKStr SiPrefix_to_str(const enum LDKSiPrefix *NONNULL_PTR o);
32908 * Frees any resources used by the RapidGossipSync, if is_owned is set and inner is non-NULL.
32910 void RapidGossipSync_free(struct LDKRapidGossipSync this_obj);
32913 * Instantiate a new [`RapidGossipSync`] instance.
32915 MUST_USE_RES struct LDKRapidGossipSync RapidGossipSync_new(const struct LDKNetworkGraph *NONNULL_PTR network_graph);
32918 * Update network graph from binary data.
32919 * Returns the last sync timestamp to be used the next time rapid sync data is queried.
32921 * `network_graph`: network graph to be updated
32923 * `update_data`: `&[u8]` binary stream that comprises the update data
32925 MUST_USE_RES struct LDKCResult_u32GraphSyncErrorZ RapidGossipSync_update_network_graph(const struct LDKRapidGossipSync *NONNULL_PTR this_arg, struct LDKu8slice update_data);
32928 * Returns whether a rapid gossip sync has completed at least once.
32930 MUST_USE_RES bool RapidGossipSync_is_initial_sync_complete(const struct LDKRapidGossipSync *NONNULL_PTR this_arg);
32933 * Frees any resources used by the GraphSyncError
32935 void GraphSyncError_free(struct LDKGraphSyncError this_ptr);
32938 * Creates a copy of the GraphSyncError
32940 struct LDKGraphSyncError GraphSyncError_clone(const struct LDKGraphSyncError *NONNULL_PTR orig);
32943 * Utility method to constructs a new DecodeError-variant GraphSyncError
32945 struct LDKGraphSyncError GraphSyncError_decode_error(struct LDKDecodeError a);
32948 * Utility method to constructs a new LightningError-variant GraphSyncError
32950 struct LDKGraphSyncError GraphSyncError_lightning_error(struct LDKLightningError a);
32952 #endif /* LDK_C_BINDINGS_H */
32954 #include "ldk_ver.h"