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 * Represents an IO Error. Note that some information is lost in the conversion from Rust.
227 typedef enum LDKIOError {
229 LDKIOError_PermissionDenied,
230 LDKIOError_ConnectionRefused,
231 LDKIOError_ConnectionReset,
232 LDKIOError_ConnectionAborted,
233 LDKIOError_NotConnected,
234 LDKIOError_AddrInUse,
235 LDKIOError_AddrNotAvailable,
236 LDKIOError_BrokenPipe,
237 LDKIOError_AlreadyExists,
238 LDKIOError_WouldBlock,
239 LDKIOError_InvalidInput,
240 LDKIOError_InvalidData,
242 LDKIOError_WriteZero,
243 LDKIOError_Interrupted,
245 LDKIOError_UnexpectedEof,
247 * Must be last for serialization purposes
253 * An enum representing the available verbosity levels of the logger.
255 typedef enum LDKLevel {
257 * Designates extremely verbose information, including gossip-induced messages
261 * Designates very low priority, often extremely verbose, information
265 * Designates lower priority information
269 * Designates useful information
273 * Designates hazardous situations
277 * Designates very serious errors
281 * Must be last for serialization purposes
287 * An enum representing the possible Bitcoin or test networks which we can run on
289 typedef enum LDKNetwork {
291 * The main Bitcoin blockchain.
295 * The testnet3 blockchain.
299 * A local test blockchain.
303 * A blockchain on which blocks are signed instead of mined.
307 * Must be last for serialization purposes
313 * Specifies the recipient of an invoice, to indicate to [`KeysInterface::sign_invoice`] what node
314 * secret key should be used to sign the invoice.
316 typedef enum LDKRecipient {
318 * The invoice should be signed with the local node secret key.
322 * The invoice should be signed with the phantom node secret key. This secret key must be the
323 * same for all nodes participating in the [phantom node payment].
325 * [phantom node payment]: PhantomKeysManager
327 LDKRecipient_PhantomNode,
329 * Must be last for serialization purposes
331 LDKRecipient_Sentinel,
335 * Represents an error returned from libsecp256k1 during validation of some secp256k1 data
337 typedef enum LDKSecp256k1Error {
339 * Signature failed verification
341 LDKSecp256k1Error_IncorrectSignature,
343 * Badly sized message ("messages" are actually fixed-sized digests; see the MESSAGE_SIZE constant)
345 LDKSecp256k1Error_InvalidMessage,
349 LDKSecp256k1Error_InvalidPublicKey,
353 LDKSecp256k1Error_InvalidSignature,
357 LDKSecp256k1Error_InvalidSecretKey,
361 LDKSecp256k1Error_InvalidSharedSecret,
365 LDKSecp256k1Error_InvalidRecoveryId,
367 * Invalid tweak for add_assign or mul_assign
369 LDKSecp256k1Error_InvalidTweak,
371 * Didn't pass enough memory to context creation with preallocated memory
373 LDKSecp256k1Error_NotEnoughMemory,
375 * Bad set of public keys.
377 LDKSecp256k1Error_InvalidPublicKeySum,
379 * The only valid parity values are 0 or 1.
381 LDKSecp256k1Error_InvalidParityValue,
383 * Must be last for serialization purposes
385 LDKSecp256k1Error_Sentinel,
389 * Errors that may occur when converting a `RawInvoice` to an `Invoice`. They relate to the
390 * requirements sections in BOLT #11
392 typedef enum LDKSemanticError {
394 * The invoice is missing the mandatory payment hash
396 LDKSemanticError_NoPaymentHash,
398 * The invoice has multiple payment hashes which isn't allowed
400 LDKSemanticError_MultiplePaymentHashes,
402 * No description or description hash are part of the invoice
404 LDKSemanticError_NoDescription,
406 * The invoice contains multiple descriptions and/or description hashes which isn't allowed
408 LDKSemanticError_MultipleDescriptions,
410 * The invoice is missing the mandatory payment secret, which all modern lightning nodes
413 LDKSemanticError_NoPaymentSecret,
415 * The invoice contains multiple payment secrets
417 LDKSemanticError_MultiplePaymentSecrets,
419 * The invoice's features are invalid
421 LDKSemanticError_InvalidFeatures,
423 * The recovery id doesn't fit the signature/pub key
425 LDKSemanticError_InvalidRecoveryId,
427 * The invoice's signature is invalid
429 LDKSemanticError_InvalidSignature,
431 * The invoice's amount was not a whole number of millisatoshis
433 LDKSemanticError_ImpreciseAmount,
435 * Must be last for serialization purposes
437 LDKSemanticError_Sentinel,
441 * SI prefixes for the human readable part
443 typedef enum LDKSiPrefix {
461 * Must be last for serialization purposes
463 LDKSiPrefix_Sentinel,
467 * A Rust str object, ie a reference to a UTF8-valid string.
468 * This is *not* null-terminated so cannot be used directly as a C string!
470 typedef struct LDKStr {
472 * A pointer to the string's bytes, in UTF8 encoding
474 const uint8_t *chars;
476 * The number of bytes (not characters!) pointed to by `chars`
480 * Whether the data pointed to by `chars` should be freed or not.
486 * Represents a scalar value between zero and the secp256k1 curve order, in big endian.
488 typedef struct LDKBigEndianScalar {
490 * The bytes of the scalar value.
492 uint8_t big_endian_bytes[32];
493 } LDKBigEndianScalar;
496 * Arbitrary 32 bytes, which could represent one of a few different things. You probably want to
497 * look up the corresponding function in rust-lightning's docs.
499 typedef struct LDKThirtyTwoBytes {
501 * The thirty-two bytes
507 * Represents an error returned from the bech32 library during validation of some bech32 data
509 typedef enum LDKBech32Error_Tag {
511 * String does not contain the separator character
513 LDKBech32Error_MissingSeparator,
515 * The checksum does not match the rest of the data
517 LDKBech32Error_InvalidChecksum,
519 * The data or human-readable part is too long or too short
521 LDKBech32Error_InvalidLength,
523 * Some part of the string contains an invalid character
525 LDKBech32Error_InvalidChar,
527 * Some part of the data has an invalid value
529 LDKBech32Error_InvalidData,
531 * The bit conversion failed due to a padding issue
533 LDKBech32Error_InvalidPadding,
535 * The whole string must be of one case
537 LDKBech32Error_MixedCase,
539 * Must be last for serialization purposes
541 LDKBech32Error_Sentinel,
542 } LDKBech32Error_Tag;
544 typedef struct LDKBech32Error {
545 LDKBech32Error_Tag tag;
548 uint32_t invalid_char;
551 uint8_t invalid_data;
557 * A serialized transaction, in (pointer, length) form.
559 * This type optionally owns its own memory, and thus the semantics around access change based on
560 * the `data_is_owned` flag. If `data_is_owned` is set, you must call `Transaction_free` to free
561 * the underlying buffer before the object goes out of scope. If `data_is_owned` is not set, any
562 * access to the buffer after the scope in which the object was provided to you is invalid. eg,
563 * access after you return from the call in which a `!data_is_owned` `Transaction` is provided to
564 * you would be invalid.
566 * Note that, while it may change in the future, because transactions on the Rust side are stored
567 * in a deserialized form, all `Transaction`s generated on the Rust side will have `data_is_owned`
568 * set. Similarly, while it may change in the future, all `Transaction`s you pass to Rust may have
569 * `data_is_owned` either set or unset at your discretion.
571 typedef struct LDKTransaction {
573 * The serialized transaction data.
575 * This is non-const for your convenience, an object passed to Rust is never written to.
579 * The length of the serialized transaction
583 * Whether the data pointed to by `data` should be freed or not.
589 * A dynamically-allocated array of u8s of arbitrary size.
590 * This corresponds to std::vector in C++
592 typedef struct LDKCVec_u8Z {
594 * The elements in the array.
595 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
599 * The number of elements pointed to by `data`.
605 * A transaction output including a scriptPubKey and value.
606 * This type *does* own its own memory, so must be free'd appropriately.
608 typedef struct LDKTxOut {
610 * The script_pubkey in this output
612 struct LDKCVec_u8Z script_pubkey;
614 * The value, in satoshis, of this output
620 * Represents a valid secp256k1 public key serialized in "compressed form" as a 33 byte array.
622 typedef struct LDKPublicKey {
624 * The bytes of the public key
626 uint8_t compressed_form[33];
630 * A dynamically-allocated array of crate::c_types::PublicKeys of arbitrary size.
631 * This corresponds to std::vector in C++
633 typedef struct LDKCVec_PublicKeyZ {
635 * The elements in the array.
636 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
638 struct LDKPublicKey *data;
640 * The number of elements pointed to by `data`.
643 } LDKCVec_PublicKeyZ;
648 * Onion messages can be sent and received to blinded routes, which serve to hide the identity of
651 typedef struct MUST_USE_STRUCT LDKBlindedRoute {
653 * A pointer to the opaque Rust object.
654 * Nearly everywhere, inner must be non-null, however in places where
655 * the Rust equivalent takes an Option, it may be set to null to indicate None.
657 LDKnativeBlindedRoute *inner;
659 * Indicates that this is the only struct which contains the same pointer.
660 * Rust functions which take ownership of an object provided via an argument require
661 * this to be true and invalidate the object pointed to by inner.
667 * The contents of CResult_BlindedRouteNoneZ
669 typedef union LDKCResult_BlindedRouteNoneZPtr {
671 * A pointer to the contents in the success state.
672 * Reading from this pointer when `result_ok` is not set is undefined.
674 struct LDKBlindedRoute *result;
676 * Note that this value is always NULL, as there are no contents in the Err variant
679 } LDKCResult_BlindedRouteNoneZPtr;
682 * A CResult_BlindedRouteNoneZ represents the result of a fallible operation,
683 * containing a crate::lightning::onion_message::blinded_route::BlindedRoute on success and a () on failure.
684 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
686 typedef struct LDKCResult_BlindedRouteNoneZ {
688 * The contents of this CResult_BlindedRouteNoneZ, accessible via either
689 * `err` or `result` depending on the state of `result_ok`.
691 union LDKCResult_BlindedRouteNoneZPtr contents;
693 * Whether this CResult_BlindedRouteNoneZ represents a success state.
696 } LDKCResult_BlindedRouteNoneZ;
699 * An error in decoding a message or struct.
701 typedef enum LDKDecodeError_Tag {
703 * A version byte specified something we don't know how to handle.
704 * Includes unknown realm byte in an OnionHopData packet
706 LDKDecodeError_UnknownVersion,
708 * Unknown feature mandating we fail to parse message (eg TLV with an even, unknown type)
710 LDKDecodeError_UnknownRequiredFeature,
712 * Value was invalid, eg a byte which was supposed to be a bool was something other than a 0
713 * or 1, a public key/private key/signature was invalid, text wasn't UTF-8, TLV was
714 * syntactically incorrect, etc
716 LDKDecodeError_InvalidValue,
720 LDKDecodeError_ShortRead,
722 * A length descriptor in the packet didn't describe the later data correctly
724 LDKDecodeError_BadLengthDescriptor,
730 * The message included zlib-compressed values, which we don't support.
732 LDKDecodeError_UnsupportedCompression,
734 * Must be last for serialization purposes
736 LDKDecodeError_Sentinel,
737 } LDKDecodeError_Tag;
739 typedef struct MUST_USE_STRUCT LDKDecodeError {
740 LDKDecodeError_Tag tag;
749 * The contents of CResult_BlindedRouteDecodeErrorZ
751 typedef union LDKCResult_BlindedRouteDecodeErrorZPtr {
753 * A pointer to the contents in the success state.
754 * Reading from this pointer when `result_ok` is not set is undefined.
756 struct LDKBlindedRoute *result;
758 * A pointer to the contents in the error state.
759 * Reading from this pointer when `result_ok` is set is undefined.
761 struct LDKDecodeError *err;
762 } LDKCResult_BlindedRouteDecodeErrorZPtr;
765 * A CResult_BlindedRouteDecodeErrorZ represents the result of a fallible operation,
766 * containing a crate::lightning::onion_message::blinded_route::BlindedRoute on success and a crate::lightning::ln::msgs::DecodeError on failure.
767 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
769 typedef struct LDKCResult_BlindedRouteDecodeErrorZ {
771 * The contents of this CResult_BlindedRouteDecodeErrorZ, accessible via either
772 * `err` or `result` depending on the state of `result_ok`.
774 union LDKCResult_BlindedRouteDecodeErrorZPtr contents;
776 * Whether this CResult_BlindedRouteDecodeErrorZ represents a success state.
779 } LDKCResult_BlindedRouteDecodeErrorZ;
784 * Used to construct the blinded hops portion of a blinded route. These hops cannot be identified
785 * by outside observers and thus can be used to hide the identity of the recipient.
787 typedef struct MUST_USE_STRUCT LDKBlindedHop {
789 * A pointer to the opaque Rust object.
790 * Nearly everywhere, inner must be non-null, however in places where
791 * the Rust equivalent takes an Option, it may be set to null to indicate None.
793 LDKnativeBlindedHop *inner;
795 * Indicates that this is the only struct which contains the same pointer.
796 * Rust functions which take ownership of an object provided via an argument require
797 * this to be true and invalidate the object pointed to by inner.
803 * The contents of CResult_BlindedHopDecodeErrorZ
805 typedef union LDKCResult_BlindedHopDecodeErrorZPtr {
807 * A pointer to the contents in the success state.
808 * Reading from this pointer when `result_ok` is not set is undefined.
810 struct LDKBlindedHop *result;
812 * A pointer to the contents in the error state.
813 * Reading from this pointer when `result_ok` is set is undefined.
815 struct LDKDecodeError *err;
816 } LDKCResult_BlindedHopDecodeErrorZPtr;
819 * A CResult_BlindedHopDecodeErrorZ represents the result of a fallible operation,
820 * containing a crate::lightning::onion_message::blinded_route::BlindedHop on success and a crate::lightning::ln::msgs::DecodeError on failure.
821 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
823 typedef struct LDKCResult_BlindedHopDecodeErrorZ {
825 * The contents of this CResult_BlindedHopDecodeErrorZ, accessible via either
826 * `err` or `result` depending on the state of `result_ok`.
828 union LDKCResult_BlindedHopDecodeErrorZPtr contents;
830 * Whether this CResult_BlindedHopDecodeErrorZ represents a success state.
833 } LDKCResult_BlindedHopDecodeErrorZ;
836 * The contents of CResult_NoneNoneZ
838 typedef union LDKCResult_NoneNoneZPtr {
840 * Note that this value is always NULL, as there are no contents in the OK variant
844 * Note that this value is always NULL, as there are no contents in the Err variant
847 } LDKCResult_NoneNoneZPtr;
850 * A CResult_NoneNoneZ represents the result of a fallible operation,
851 * containing a () on success and a () on failure.
852 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
854 typedef struct LDKCResult_NoneNoneZ {
856 * The contents of this CResult_NoneNoneZ, accessible via either
857 * `err` or `result` depending on the state of `result_ok`.
859 union LDKCResult_NoneNoneZPtr contents;
861 * Whether this CResult_NoneNoneZ represents a success state.
864 } LDKCResult_NoneNoneZ;
869 * Implements the per-commitment secret storage scheme from
870 * [BOLT 3](https://github.com/lightning/bolts/blob/dcbf8583976df087c79c3ce0b535311212e6812d/03-transactions.md#efficient-per-commitment-secret-storage).
872 * Allows us to keep track of all of the revocation secrets of our counterparty in just 50*32 bytes
875 typedef struct MUST_USE_STRUCT LDKCounterpartyCommitmentSecrets {
877 * A pointer to the opaque Rust object.
878 * Nearly everywhere, inner must be non-null, however in places where
879 * the Rust equivalent takes an Option, it may be set to null to indicate None.
881 LDKnativeCounterpartyCommitmentSecrets *inner;
883 * Indicates that this is the only struct which contains the same pointer.
884 * Rust functions which take ownership of an object provided via an argument require
885 * this to be true and invalidate the object pointed to by inner.
888 } LDKCounterpartyCommitmentSecrets;
891 * The contents of CResult_CounterpartyCommitmentSecretsDecodeErrorZ
893 typedef union LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZPtr {
895 * A pointer to the contents in the success state.
896 * Reading from this pointer when `result_ok` is not set is undefined.
898 struct LDKCounterpartyCommitmentSecrets *result;
900 * A pointer to the contents in the error state.
901 * Reading from this pointer when `result_ok` is set is undefined.
903 struct LDKDecodeError *err;
904 } LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZPtr;
907 * A CResult_CounterpartyCommitmentSecretsDecodeErrorZ represents the result of a fallible operation,
908 * containing a crate::lightning::ln::chan_utils::CounterpartyCommitmentSecrets on success and a crate::lightning::ln::msgs::DecodeError on failure.
909 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
911 typedef struct LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ {
913 * The contents of this CResult_CounterpartyCommitmentSecretsDecodeErrorZ, accessible via either
914 * `err` or `result` depending on the state of `result_ok`.
916 union LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZPtr contents;
918 * Whether this CResult_CounterpartyCommitmentSecretsDecodeErrorZ represents a success state.
921 } LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ;
924 * Represents a valid secp256k1 secret key serialized as a 32 byte array.
926 typedef struct LDKSecretKey {
928 * The bytes of the secret key
934 * The contents of CResult_SecretKeyErrorZ
936 typedef union LDKCResult_SecretKeyErrorZPtr {
938 * A pointer to the contents in the success state.
939 * Reading from this pointer when `result_ok` is not set is undefined.
941 struct LDKSecretKey *result;
943 * A pointer to the contents in the error state.
944 * Reading from this pointer when `result_ok` is set is undefined.
946 enum LDKSecp256k1Error *err;
947 } LDKCResult_SecretKeyErrorZPtr;
950 * A CResult_SecretKeyErrorZ represents the result of a fallible operation,
951 * containing a crate::c_types::SecretKey on success and a crate::c_types::Secp256k1Error on failure.
952 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
954 typedef struct LDKCResult_SecretKeyErrorZ {
956 * The contents of this CResult_SecretKeyErrorZ, accessible via either
957 * `err` or `result` depending on the state of `result_ok`.
959 union LDKCResult_SecretKeyErrorZPtr contents;
961 * Whether this CResult_SecretKeyErrorZ represents a success state.
964 } LDKCResult_SecretKeyErrorZ;
967 * The contents of CResult_PublicKeyErrorZ
969 typedef union LDKCResult_PublicKeyErrorZPtr {
971 * A pointer to the contents in the success state.
972 * Reading from this pointer when `result_ok` is not set is undefined.
974 struct LDKPublicKey *result;
976 * A pointer to the contents in the error state.
977 * Reading from this pointer when `result_ok` is set is undefined.
979 enum LDKSecp256k1Error *err;
980 } LDKCResult_PublicKeyErrorZPtr;
983 * A CResult_PublicKeyErrorZ represents the result of a fallible operation,
984 * containing a crate::c_types::PublicKey on success and a crate::c_types::Secp256k1Error on failure.
985 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
987 typedef struct LDKCResult_PublicKeyErrorZ {
989 * The contents of this CResult_PublicKeyErrorZ, accessible via either
990 * `err` or `result` depending on the state of `result_ok`.
992 union LDKCResult_PublicKeyErrorZPtr contents;
994 * Whether this CResult_PublicKeyErrorZ represents a success state.
997 } LDKCResult_PublicKeyErrorZ;
1002 * The set of public keys which are used in the creation of one commitment transaction.
1003 * These are derived from the channel base keys and per-commitment data.
1005 * A broadcaster key is provided from potential broadcaster of the computed transaction.
1006 * A countersignatory key is coming from a protocol participant unable to broadcast the
1009 * These keys are assumed to be good, either because the code derived them from
1010 * channel basepoints via the new function, or they were obtained via
1011 * CommitmentTransaction.trust().keys() because we trusted the source of the
1012 * pre-calculated keys.
1014 typedef struct MUST_USE_STRUCT LDKTxCreationKeys {
1016 * A pointer to the opaque Rust object.
1017 * Nearly everywhere, inner must be non-null, however in places where
1018 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1020 LDKnativeTxCreationKeys *inner;
1022 * Indicates that this is the only struct which contains the same pointer.
1023 * Rust functions which take ownership of an object provided via an argument require
1024 * this to be true and invalidate the object pointed to by inner.
1027 } LDKTxCreationKeys;
1030 * The contents of CResult_TxCreationKeysDecodeErrorZ
1032 typedef union LDKCResult_TxCreationKeysDecodeErrorZPtr {
1034 * A pointer to the contents in the success state.
1035 * Reading from this pointer when `result_ok` is not set is undefined.
1037 struct LDKTxCreationKeys *result;
1039 * A pointer to the contents in the error state.
1040 * Reading from this pointer when `result_ok` is set is undefined.
1042 struct LDKDecodeError *err;
1043 } LDKCResult_TxCreationKeysDecodeErrorZPtr;
1046 * A CResult_TxCreationKeysDecodeErrorZ represents the result of a fallible operation,
1047 * containing a crate::lightning::ln::chan_utils::TxCreationKeys on success and a crate::lightning::ln::msgs::DecodeError on failure.
1048 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1050 typedef struct LDKCResult_TxCreationKeysDecodeErrorZ {
1052 * The contents of this CResult_TxCreationKeysDecodeErrorZ, accessible via either
1053 * `err` or `result` depending on the state of `result_ok`.
1055 union LDKCResult_TxCreationKeysDecodeErrorZPtr contents;
1057 * Whether this CResult_TxCreationKeysDecodeErrorZ represents a success state.
1060 } LDKCResult_TxCreationKeysDecodeErrorZ;
1065 * One counterparty's public keys which do not change over the life of a channel.
1067 typedef struct MUST_USE_STRUCT LDKChannelPublicKeys {
1069 * A pointer to the opaque Rust object.
1070 * Nearly everywhere, inner must be non-null, however in places where
1071 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1073 LDKnativeChannelPublicKeys *inner;
1075 * Indicates that this is the only struct which contains the same pointer.
1076 * Rust functions which take ownership of an object provided via an argument require
1077 * this to be true and invalidate the object pointed to by inner.
1080 } LDKChannelPublicKeys;
1083 * The contents of CResult_ChannelPublicKeysDecodeErrorZ
1085 typedef union LDKCResult_ChannelPublicKeysDecodeErrorZPtr {
1087 * A pointer to the contents in the success state.
1088 * Reading from this pointer when `result_ok` is not set is undefined.
1090 struct LDKChannelPublicKeys *result;
1092 * A pointer to the contents in the error state.
1093 * Reading from this pointer when `result_ok` is set is undefined.
1095 struct LDKDecodeError *err;
1096 } LDKCResult_ChannelPublicKeysDecodeErrorZPtr;
1099 * A CResult_ChannelPublicKeysDecodeErrorZ represents the result of a fallible operation,
1100 * containing a crate::lightning::ln::chan_utils::ChannelPublicKeys on success and a crate::lightning::ln::msgs::DecodeError on failure.
1101 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1103 typedef struct LDKCResult_ChannelPublicKeysDecodeErrorZ {
1105 * The contents of this CResult_ChannelPublicKeysDecodeErrorZ, accessible via either
1106 * `err` or `result` depending on the state of `result_ok`.
1108 union LDKCResult_ChannelPublicKeysDecodeErrorZPtr contents;
1110 * Whether this CResult_ChannelPublicKeysDecodeErrorZ represents a success state.
1113 } LDKCResult_ChannelPublicKeysDecodeErrorZ;
1116 * The contents of CResult_TxCreationKeysErrorZ
1118 typedef union LDKCResult_TxCreationKeysErrorZPtr {
1120 * A pointer to the contents in the success state.
1121 * Reading from this pointer when `result_ok` is not set is undefined.
1123 struct LDKTxCreationKeys *result;
1125 * A pointer to the contents in the error state.
1126 * Reading from this pointer when `result_ok` is set is undefined.
1128 enum LDKSecp256k1Error *err;
1129 } LDKCResult_TxCreationKeysErrorZPtr;
1132 * A CResult_TxCreationKeysErrorZ represents the result of a fallible operation,
1133 * containing a crate::lightning::ln::chan_utils::TxCreationKeys on success and a crate::c_types::Secp256k1Error on failure.
1134 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1136 typedef struct LDKCResult_TxCreationKeysErrorZ {
1138 * The contents of this CResult_TxCreationKeysErrorZ, accessible via either
1139 * `err` or `result` depending on the state of `result_ok`.
1141 union LDKCResult_TxCreationKeysErrorZPtr contents;
1143 * Whether this CResult_TxCreationKeysErrorZ represents a success state.
1146 } LDKCResult_TxCreationKeysErrorZ;
1149 * An enum which can either contain a u32 or not
1151 typedef enum LDKCOption_u32Z_Tag {
1153 * When we're in this state, this COption_u32Z contains a u32
1155 LDKCOption_u32Z_Some,
1157 * When we're in this state, this COption_u32Z contains nothing
1159 LDKCOption_u32Z_None,
1161 * Must be last for serialization purposes
1163 LDKCOption_u32Z_Sentinel,
1164 } LDKCOption_u32Z_Tag;
1166 typedef struct LDKCOption_u32Z {
1167 LDKCOption_u32Z_Tag tag;
1178 * Information about an HTLC as it appears in a commitment transaction
1180 typedef struct MUST_USE_STRUCT LDKHTLCOutputInCommitment {
1182 * A pointer to the opaque Rust object.
1183 * Nearly everywhere, inner must be non-null, however in places where
1184 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1186 LDKnativeHTLCOutputInCommitment *inner;
1188 * Indicates that this is the only struct which contains the same pointer.
1189 * Rust functions which take ownership of an object provided via an argument require
1190 * this to be true and invalidate the object pointed to by inner.
1193 } LDKHTLCOutputInCommitment;
1196 * The contents of CResult_HTLCOutputInCommitmentDecodeErrorZ
1198 typedef union LDKCResult_HTLCOutputInCommitmentDecodeErrorZPtr {
1200 * A pointer to the contents in the success state.
1201 * Reading from this pointer when `result_ok` is not set is undefined.
1203 struct LDKHTLCOutputInCommitment *result;
1205 * A pointer to the contents in the error state.
1206 * Reading from this pointer when `result_ok` is set is undefined.
1208 struct LDKDecodeError *err;
1209 } LDKCResult_HTLCOutputInCommitmentDecodeErrorZPtr;
1212 * A CResult_HTLCOutputInCommitmentDecodeErrorZ represents the result of a fallible operation,
1213 * containing a crate::lightning::ln::chan_utils::HTLCOutputInCommitment on success and a crate::lightning::ln::msgs::DecodeError on failure.
1214 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1216 typedef struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ {
1218 * The contents of this CResult_HTLCOutputInCommitmentDecodeErrorZ, accessible via either
1219 * `err` or `result` depending on the state of `result_ok`.
1221 union LDKCResult_HTLCOutputInCommitmentDecodeErrorZPtr contents;
1223 * Whether this CResult_HTLCOutputInCommitmentDecodeErrorZ represents a success state.
1226 } LDKCResult_HTLCOutputInCommitmentDecodeErrorZ;
1231 * Late-bound per-channel counterparty data used to build transactions.
1233 typedef struct MUST_USE_STRUCT LDKCounterpartyChannelTransactionParameters {
1235 * A pointer to the opaque Rust object.
1236 * Nearly everywhere, inner must be non-null, however in places where
1237 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1239 LDKnativeCounterpartyChannelTransactionParameters *inner;
1241 * Indicates that this is the only struct which contains the same pointer.
1242 * Rust functions which take ownership of an object provided via an argument require
1243 * this to be true and invalidate the object pointed to by inner.
1246 } LDKCounterpartyChannelTransactionParameters;
1249 * The contents of CResult_CounterpartyChannelTransactionParametersDecodeErrorZ
1251 typedef union LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZPtr {
1253 * A pointer to the contents in the success state.
1254 * Reading from this pointer when `result_ok` is not set is undefined.
1256 struct LDKCounterpartyChannelTransactionParameters *result;
1258 * A pointer to the contents in the error state.
1259 * Reading from this pointer when `result_ok` is set is undefined.
1261 struct LDKDecodeError *err;
1262 } LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZPtr;
1265 * A CResult_CounterpartyChannelTransactionParametersDecodeErrorZ represents the result of a fallible operation,
1266 * containing a crate::lightning::ln::chan_utils::CounterpartyChannelTransactionParameters on success and a crate::lightning::ln::msgs::DecodeError on failure.
1267 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1269 typedef struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ {
1271 * The contents of this CResult_CounterpartyChannelTransactionParametersDecodeErrorZ, accessible via either
1272 * `err` or `result` depending on the state of `result_ok`.
1274 union LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZPtr contents;
1276 * Whether this CResult_CounterpartyChannelTransactionParametersDecodeErrorZ represents a success state.
1279 } LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ;
1284 * Per-channel data used to build transactions in conjunction with the per-commitment data (CommitmentTransaction).
1285 * The fields are organized by holder/counterparty.
1287 * Normally, this is converted to the broadcaster/countersignatory-organized DirectedChannelTransactionParameters
1288 * before use, via the as_holder_broadcastable and as_counterparty_broadcastable functions.
1290 typedef struct MUST_USE_STRUCT LDKChannelTransactionParameters {
1292 * A pointer to the opaque Rust object.
1293 * Nearly everywhere, inner must be non-null, however in places where
1294 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1296 LDKnativeChannelTransactionParameters *inner;
1298 * Indicates that this is the only struct which contains the same pointer.
1299 * Rust functions which take ownership of an object provided via an argument require
1300 * this to be true and invalidate the object pointed to by inner.
1303 } LDKChannelTransactionParameters;
1306 * The contents of CResult_ChannelTransactionParametersDecodeErrorZ
1308 typedef union LDKCResult_ChannelTransactionParametersDecodeErrorZPtr {
1310 * A pointer to the contents in the success state.
1311 * Reading from this pointer when `result_ok` is not set is undefined.
1313 struct LDKChannelTransactionParameters *result;
1315 * A pointer to the contents in the error state.
1316 * Reading from this pointer when `result_ok` is set is undefined.
1318 struct LDKDecodeError *err;
1319 } LDKCResult_ChannelTransactionParametersDecodeErrorZPtr;
1322 * A CResult_ChannelTransactionParametersDecodeErrorZ represents the result of a fallible operation,
1323 * containing a crate::lightning::ln::chan_utils::ChannelTransactionParameters on success and a crate::lightning::ln::msgs::DecodeError on failure.
1324 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1326 typedef struct LDKCResult_ChannelTransactionParametersDecodeErrorZ {
1328 * The contents of this CResult_ChannelTransactionParametersDecodeErrorZ, accessible via either
1329 * `err` or `result` depending on the state of `result_ok`.
1331 union LDKCResult_ChannelTransactionParametersDecodeErrorZPtr contents;
1333 * Whether this CResult_ChannelTransactionParametersDecodeErrorZ represents a success state.
1336 } LDKCResult_ChannelTransactionParametersDecodeErrorZ;
1339 * Represents a secp256k1 signature serialized as two 32-byte numbers
1341 typedef struct LDKSignature {
1343 * The bytes of the signature in "compact" form
1345 uint8_t compact_form[64];
1349 * A dynamically-allocated array of crate::c_types::Signatures of arbitrary size.
1350 * This corresponds to std::vector in C++
1352 typedef struct LDKCVec_SignatureZ {
1354 * The elements in the array.
1355 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
1357 struct LDKSignature *data;
1359 * The number of elements pointed to by `data`.
1362 } LDKCVec_SignatureZ;
1367 * Information needed to build and sign a holder's commitment transaction.
1369 * The transaction is only signed once we are ready to broadcast.
1371 typedef struct MUST_USE_STRUCT LDKHolderCommitmentTransaction {
1373 * A pointer to the opaque Rust object.
1374 * Nearly everywhere, inner must be non-null, however in places where
1375 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1377 LDKnativeHolderCommitmentTransaction *inner;
1379 * Indicates that this is the only struct which contains the same pointer.
1380 * Rust functions which take ownership of an object provided via an argument require
1381 * this to be true and invalidate the object pointed to by inner.
1384 } LDKHolderCommitmentTransaction;
1387 * The contents of CResult_HolderCommitmentTransactionDecodeErrorZ
1389 typedef union LDKCResult_HolderCommitmentTransactionDecodeErrorZPtr {
1391 * A pointer to the contents in the success state.
1392 * Reading from this pointer when `result_ok` is not set is undefined.
1394 struct LDKHolderCommitmentTransaction *result;
1396 * A pointer to the contents in the error state.
1397 * Reading from this pointer when `result_ok` is set is undefined.
1399 struct LDKDecodeError *err;
1400 } LDKCResult_HolderCommitmentTransactionDecodeErrorZPtr;
1403 * A CResult_HolderCommitmentTransactionDecodeErrorZ represents the result of a fallible operation,
1404 * containing a crate::lightning::ln::chan_utils::HolderCommitmentTransaction on success and a crate::lightning::ln::msgs::DecodeError on failure.
1405 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1407 typedef struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ {
1409 * The contents of this CResult_HolderCommitmentTransactionDecodeErrorZ, accessible via either
1410 * `err` or `result` depending on the state of `result_ok`.
1412 union LDKCResult_HolderCommitmentTransactionDecodeErrorZPtr contents;
1414 * Whether this CResult_HolderCommitmentTransactionDecodeErrorZ represents a success state.
1417 } LDKCResult_HolderCommitmentTransactionDecodeErrorZ;
1422 * A pre-built Bitcoin commitment transaction and its txid.
1424 typedef struct MUST_USE_STRUCT LDKBuiltCommitmentTransaction {
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 LDKnativeBuiltCommitmentTransaction *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 } LDKBuiltCommitmentTransaction;
1440 * The contents of CResult_BuiltCommitmentTransactionDecodeErrorZ
1442 typedef union LDKCResult_BuiltCommitmentTransactionDecodeErrorZPtr {
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 LDKBuiltCommitmentTransaction *result;
1449 * A pointer to the contents in the error state.
1450 * Reading from this pointer when `result_ok` is set is undefined.
1452 struct LDKDecodeError *err;
1453 } LDKCResult_BuiltCommitmentTransactionDecodeErrorZPtr;
1456 * A CResult_BuiltCommitmentTransactionDecodeErrorZ represents the result of a fallible operation,
1457 * containing a crate::lightning::ln::chan_utils::BuiltCommitmentTransaction on success and a crate::lightning::ln::msgs::DecodeError on failure.
1458 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1460 typedef struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ {
1462 * The contents of this CResult_BuiltCommitmentTransactionDecodeErrorZ, accessible via either
1463 * `err` or `result` depending on the state of `result_ok`.
1465 union LDKCResult_BuiltCommitmentTransactionDecodeErrorZPtr contents;
1467 * Whether this CResult_BuiltCommitmentTransactionDecodeErrorZ represents a success state.
1470 } LDKCResult_BuiltCommitmentTransactionDecodeErrorZ;
1475 * A wrapper on ClosingTransaction indicating that the built bitcoin
1476 * transaction is trusted.
1478 * See trust() and verify() functions on CommitmentTransaction.
1480 * This structure implements Deref.
1482 typedef struct MUST_USE_STRUCT LDKTrustedClosingTransaction {
1484 * A pointer to the opaque Rust object.
1485 * Nearly everywhere, inner must be non-null, however in places where
1486 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1488 LDKnativeTrustedClosingTransaction *inner;
1490 * Indicates that this is the only struct which contains the same pointer.
1491 * Rust functions which take ownership of an object provided via an argument require
1492 * this to be true and invalidate the object pointed to by inner.
1495 } LDKTrustedClosingTransaction;
1498 * The contents of CResult_TrustedClosingTransactionNoneZ
1500 typedef union LDKCResult_TrustedClosingTransactionNoneZPtr {
1502 * A pointer to the contents in the success state.
1503 * Reading from this pointer when `result_ok` is not set is undefined.
1505 struct LDKTrustedClosingTransaction *result;
1507 * Note that this value is always NULL, as there are no contents in the Err variant
1510 } LDKCResult_TrustedClosingTransactionNoneZPtr;
1513 * A CResult_TrustedClosingTransactionNoneZ represents the result of a fallible operation,
1514 * containing a crate::lightning::ln::chan_utils::TrustedClosingTransaction on success and a () on failure.
1515 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1517 typedef struct LDKCResult_TrustedClosingTransactionNoneZ {
1519 * The contents of this CResult_TrustedClosingTransactionNoneZ, accessible via either
1520 * `err` or `result` depending on the state of `result_ok`.
1522 union LDKCResult_TrustedClosingTransactionNoneZPtr contents;
1524 * Whether this CResult_TrustedClosingTransactionNoneZ represents a success state.
1527 } LDKCResult_TrustedClosingTransactionNoneZ;
1532 * This class tracks the per-transaction information needed to build a commitment transaction and will
1533 * actually build it and sign. It is used for holder transactions that we sign only when needed
1534 * and for transactions we sign for the counterparty.
1536 * This class can be used inside a signer implementation to generate a signature given the relevant
1539 typedef struct MUST_USE_STRUCT LDKCommitmentTransaction {
1541 * A pointer to the opaque Rust object.
1542 * Nearly everywhere, inner must be non-null, however in places where
1543 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1545 LDKnativeCommitmentTransaction *inner;
1547 * Indicates that this is the only struct which contains the same pointer.
1548 * Rust functions which take ownership of an object provided via an argument require
1549 * this to be true and invalidate the object pointed to by inner.
1552 } LDKCommitmentTransaction;
1555 * The contents of CResult_CommitmentTransactionDecodeErrorZ
1557 typedef union LDKCResult_CommitmentTransactionDecodeErrorZPtr {
1559 * A pointer to the contents in the success state.
1560 * Reading from this pointer when `result_ok` is not set is undefined.
1562 struct LDKCommitmentTransaction *result;
1564 * A pointer to the contents in the error state.
1565 * Reading from this pointer when `result_ok` is set is undefined.
1567 struct LDKDecodeError *err;
1568 } LDKCResult_CommitmentTransactionDecodeErrorZPtr;
1571 * A CResult_CommitmentTransactionDecodeErrorZ represents the result of a fallible operation,
1572 * containing a crate::lightning::ln::chan_utils::CommitmentTransaction on success and a crate::lightning::ln::msgs::DecodeError on failure.
1573 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1575 typedef struct LDKCResult_CommitmentTransactionDecodeErrorZ {
1577 * The contents of this CResult_CommitmentTransactionDecodeErrorZ, accessible via either
1578 * `err` or `result` depending on the state of `result_ok`.
1580 union LDKCResult_CommitmentTransactionDecodeErrorZPtr contents;
1582 * Whether this CResult_CommitmentTransactionDecodeErrorZ represents a success state.
1585 } LDKCResult_CommitmentTransactionDecodeErrorZ;
1590 * A wrapper on CommitmentTransaction indicating that the derived fields (the built bitcoin
1591 * transaction and the transaction creation keys) are trusted.
1593 * See trust() and verify() functions on CommitmentTransaction.
1595 * This structure implements Deref.
1597 typedef struct MUST_USE_STRUCT LDKTrustedCommitmentTransaction {
1599 * A pointer to the opaque Rust object.
1600 * Nearly everywhere, inner must be non-null, however in places where
1601 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1603 LDKnativeTrustedCommitmentTransaction *inner;
1605 * Indicates that this is the only struct which contains the same pointer.
1606 * Rust functions which take ownership of an object provided via an argument require
1607 * this to be true and invalidate the object pointed to by inner.
1610 } LDKTrustedCommitmentTransaction;
1613 * The contents of CResult_TrustedCommitmentTransactionNoneZ
1615 typedef union LDKCResult_TrustedCommitmentTransactionNoneZPtr {
1617 * A pointer to the contents in the success state.
1618 * Reading from this pointer when `result_ok` is not set is undefined.
1620 struct LDKTrustedCommitmentTransaction *result;
1622 * Note that this value is always NULL, as there are no contents in the Err variant
1625 } LDKCResult_TrustedCommitmentTransactionNoneZPtr;
1628 * A CResult_TrustedCommitmentTransactionNoneZ represents the result of a fallible operation,
1629 * containing a crate::lightning::ln::chan_utils::TrustedCommitmentTransaction on success and a () on failure.
1630 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1632 typedef struct LDKCResult_TrustedCommitmentTransactionNoneZ {
1634 * The contents of this CResult_TrustedCommitmentTransactionNoneZ, accessible via either
1635 * `err` or `result` depending on the state of `result_ok`.
1637 union LDKCResult_TrustedCommitmentTransactionNoneZPtr contents;
1639 * Whether this CResult_TrustedCommitmentTransactionNoneZ represents a success state.
1642 } LDKCResult_TrustedCommitmentTransactionNoneZ;
1645 * The contents of CResult_CVec_SignatureZNoneZ
1647 typedef union LDKCResult_CVec_SignatureZNoneZPtr {
1649 * A pointer to the contents in the success state.
1650 * Reading from this pointer when `result_ok` is not set is undefined.
1652 struct LDKCVec_SignatureZ *result;
1654 * Note that this value is always NULL, as there are no contents in the Err variant
1657 } LDKCResult_CVec_SignatureZNoneZPtr;
1660 * A CResult_CVec_SignatureZNoneZ represents the result of a fallible operation,
1661 * containing a crate::c_types::derived::CVec_SignatureZ on success and a () on failure.
1662 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1664 typedef struct LDKCResult_CVec_SignatureZNoneZ {
1666 * The contents of this CResult_CVec_SignatureZNoneZ, accessible via either
1667 * `err` or `result` depending on the state of `result_ok`.
1669 union LDKCResult_CVec_SignatureZNoneZPtr contents;
1671 * Whether this CResult_CVec_SignatureZNoneZ represents a success state.
1674 } LDKCResult_CVec_SignatureZNoneZ;
1679 * A script pubkey for shutting down a channel as defined by [BOLT #2].
1681 * [BOLT #2]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md
1683 typedef struct MUST_USE_STRUCT LDKShutdownScript {
1685 * A pointer to the opaque Rust object.
1686 * Nearly everywhere, inner must be non-null, however in places where
1687 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1689 LDKnativeShutdownScript *inner;
1691 * Indicates that this is the only struct which contains the same pointer.
1692 * Rust functions which take ownership of an object provided via an argument require
1693 * this to be true and invalidate the object pointed to by inner.
1696 } LDKShutdownScript;
1699 * The contents of CResult_ShutdownScriptDecodeErrorZ
1701 typedef union LDKCResult_ShutdownScriptDecodeErrorZPtr {
1703 * A pointer to the contents in the success state.
1704 * Reading from this pointer when `result_ok` is not set is undefined.
1706 struct LDKShutdownScript *result;
1708 * A pointer to the contents in the error state.
1709 * Reading from this pointer when `result_ok` is set is undefined.
1711 struct LDKDecodeError *err;
1712 } LDKCResult_ShutdownScriptDecodeErrorZPtr;
1715 * A CResult_ShutdownScriptDecodeErrorZ represents the result of a fallible operation,
1716 * containing a crate::lightning::ln::script::ShutdownScript on success and a crate::lightning::ln::msgs::DecodeError on failure.
1717 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1719 typedef struct LDKCResult_ShutdownScriptDecodeErrorZ {
1721 * The contents of this CResult_ShutdownScriptDecodeErrorZ, accessible via either
1722 * `err` or `result` depending on the state of `result_ok`.
1724 union LDKCResult_ShutdownScriptDecodeErrorZPtr contents;
1726 * Whether this CResult_ShutdownScriptDecodeErrorZ represents a success state.
1729 } LDKCResult_ShutdownScriptDecodeErrorZ;
1734 * An error occurring when converting from [`Script`] to [`ShutdownScript`].
1736 typedef struct MUST_USE_STRUCT LDKInvalidShutdownScript {
1738 * A pointer to the opaque Rust object.
1739 * Nearly everywhere, inner must be non-null, however in places where
1740 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1742 LDKnativeInvalidShutdownScript *inner;
1744 * Indicates that this is the only struct which contains the same pointer.
1745 * Rust functions which take ownership of an object provided via an argument require
1746 * this to be true and invalidate the object pointed to by inner.
1749 } LDKInvalidShutdownScript;
1752 * The contents of CResult_ShutdownScriptInvalidShutdownScriptZ
1754 typedef union LDKCResult_ShutdownScriptInvalidShutdownScriptZPtr {
1756 * A pointer to the contents in the success state.
1757 * Reading from this pointer when `result_ok` is not set is undefined.
1759 struct LDKShutdownScript *result;
1761 * A pointer to the contents in the error state.
1762 * Reading from this pointer when `result_ok` is set is undefined.
1764 struct LDKInvalidShutdownScript *err;
1765 } LDKCResult_ShutdownScriptInvalidShutdownScriptZPtr;
1768 * A CResult_ShutdownScriptInvalidShutdownScriptZ represents the result of a fallible operation,
1769 * containing a crate::lightning::ln::script::ShutdownScript on success and a crate::lightning::ln::script::InvalidShutdownScript on failure.
1770 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1772 typedef struct LDKCResult_ShutdownScriptInvalidShutdownScriptZ {
1774 * The contents of this CResult_ShutdownScriptInvalidShutdownScriptZ, accessible via either
1775 * `err` or `result` depending on the state of `result_ok`.
1777 union LDKCResult_ShutdownScriptInvalidShutdownScriptZPtr contents;
1779 * Whether this CResult_ShutdownScriptInvalidShutdownScriptZ represents a success state.
1782 } LDKCResult_ShutdownScriptInvalidShutdownScriptZ;
1787 * Represents the compressed public key of a node
1789 typedef struct MUST_USE_STRUCT LDKNodeId {
1791 * A pointer to the opaque Rust object.
1792 * Nearly everywhere, inner must be non-null, however in places where
1793 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1795 LDKnativeNodeId *inner;
1797 * Indicates that this is the only struct which contains the same pointer.
1798 * Rust functions which take ownership of an object provided via an argument require
1799 * this to be true and invalidate the object pointed to by inner.
1807 * Proposed use of a channel passed as a parameter to [`Score::channel_penalty_msat`].
1809 typedef struct MUST_USE_STRUCT LDKChannelUsage {
1811 * A pointer to the opaque Rust object.
1812 * Nearly everywhere, inner must be non-null, however in places where
1813 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1815 LDKnativeChannelUsage *inner;
1817 * Indicates that this is the only struct which contains the same pointer.
1818 * Rust functions which take ownership of an object provided via an argument require
1819 * this to be true and invalidate the object pointed to by inner.
1829 typedef struct MUST_USE_STRUCT LDKRouteHop {
1831 * A pointer to the opaque Rust object.
1832 * Nearly everywhere, inner must be non-null, however in places where
1833 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1835 LDKnativeRouteHop *inner;
1837 * Indicates that this is the only struct which contains the same pointer.
1838 * Rust functions which take ownership of an object provided via an argument require
1839 * this to be true and invalidate the object pointed to by inner.
1845 * A dynamically-allocated array of crate::lightning::routing::router::RouteHops of arbitrary size.
1846 * This corresponds to std::vector in C++
1848 typedef struct LDKCVec_RouteHopZ {
1850 * The elements in the array.
1851 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
1853 struct LDKRouteHop *data;
1855 * The number of elements pointed to by `data`.
1858 } LDKCVec_RouteHopZ;
1861 * An interface used to score payment channels for path finding.
1863 *\tScoring is in terms of fees willing to be paid in order to avoid routing through a channel.
1865 typedef struct LDKScore {
1867 * An opaque pointer which is passed to your function implementations as an argument.
1868 * This has no meaning in the LDK, and can be NULL or any other value.
1872 * Returns the fee in msats willing to be paid to avoid routing `send_amt_msat` through the
1873 * given channel in the direction from `source` to `target`.
1875 * The channel's capacity (less any other MPP parts that are also being considered for use in
1876 * the same payment) is given by `capacity_msat`. It may be determined from various sources
1877 * such as a chain data, network gossip, or invoice hints. For invoice hints, a capacity near
1878 * [`u64::max_value`] is given to indicate sufficient capacity for the invoice's full amount.
1879 * Thus, implementations should be overflow-safe.
1881 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);
1883 * Handles updating channel penalties after failing to route through a channel.
1885 void (*payment_path_failed)(void *this_arg, struct LDKCVec_RouteHopZ path, uint64_t short_channel_id);
1887 * Handles updating channel penalties after successfully routing along a path.
1889 void (*payment_path_successful)(void *this_arg, struct LDKCVec_RouteHopZ path);
1891 * Handles updating channel penalties after a probe over the given path failed.
1893 void (*probe_failed)(void *this_arg, struct LDKCVec_RouteHopZ path, uint64_t short_channel_id);
1895 * Handles updating channel penalties after a probe over the given path succeeded.
1897 void (*probe_successful)(void *this_arg, struct LDKCVec_RouteHopZ path);
1899 * Serialize the object into a byte array
1901 struct LDKCVec_u8Z (*write)(const void *this_arg);
1903 * Frees any resources associated with this object given its this_arg pointer.
1904 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
1906 void (*free)(void *this_arg);
1910 * A scorer that is accessed under a lock.
1912 * Needed so that calls to [`Score::channel_penalty_msat`] in [`find_route`] can be made while
1913 * having shared ownership of a scorer but without requiring internal locking in [`Score`]
1914 * implementations. Internal locking would be detrimental to route finding performance and could
1915 * result in [`Score::channel_penalty_msat`] returning a different value for the same channel.
1917 * [`find_route`]: crate::routing::router::find_route
1919 typedef struct LDKLockableScore {
1921 * An opaque pointer which is passed to your function implementations as an argument.
1922 * This has no meaning in the LDK, and can be NULL or any other value.
1926 * Returns the locked scorer.
1928 struct LDKScore (*lock)(const void *this_arg);
1930 * Frees any resources associated with this object given its this_arg pointer.
1931 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
1933 void (*free)(void *this_arg);
1937 * Refers to a scorer that is accessible under lock and also writeable to disk
1939 * We need this trait to be able to pass in a scorer to `lightning-background-processor` that will enable us to
1940 * use the Persister to persist it.
1942 typedef struct LDKWriteableScore {
1944 * An opaque pointer which is passed to your function implementations as an argument.
1945 * This has no meaning in the LDK, and can be NULL or any other value.
1949 * Implementation of LockableScore for this object.
1951 struct LDKLockableScore LockableScore;
1953 * Serialize the object into a byte array
1955 struct LDKCVec_u8Z (*write)(const void *this_arg);
1957 * Frees any resources associated with this object given its this_arg pointer.
1958 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
1960 void (*free)(void *this_arg);
1961 } LDKWriteableScore;
1964 * An enum which can either contain a crate::lightning::routing::scoring::WriteableScore or not
1966 typedef enum LDKCOption_WriteableScoreZ_Tag {
1968 * When we're in this state, this COption_WriteableScoreZ contains a crate::lightning::routing::scoring::WriteableScore
1970 LDKCOption_WriteableScoreZ_Some,
1972 * When we're in this state, this COption_WriteableScoreZ contains nothing
1974 LDKCOption_WriteableScoreZ_None,
1976 * Must be last for serialization purposes
1978 LDKCOption_WriteableScoreZ_Sentinel,
1979 } LDKCOption_WriteableScoreZ_Tag;
1981 typedef struct LDKCOption_WriteableScoreZ {
1982 LDKCOption_WriteableScoreZ_Tag tag;
1985 struct LDKWriteableScore some;
1988 } LDKCOption_WriteableScoreZ;
1991 * The contents of CResult_NoneErrorZ
1993 typedef union LDKCResult_NoneErrorZPtr {
1995 * Note that this value is always NULL, as there are no contents in the OK variant
1999 * A pointer to the contents in the error state.
2000 * Reading from this pointer when `result_ok` is set is undefined.
2002 enum LDKIOError *err;
2003 } LDKCResult_NoneErrorZPtr;
2006 * A CResult_NoneErrorZ represents the result of a fallible operation,
2007 * containing a () on success and a crate::c_types::IOError on failure.
2008 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
2010 typedef struct LDKCResult_NoneErrorZ {
2012 * The contents of this CResult_NoneErrorZ, accessible via either
2013 * `err` or `result` depending on the state of `result_ok`.
2015 union LDKCResult_NoneErrorZPtr contents;
2017 * Whether this CResult_NoneErrorZ represents a success state.
2020 } LDKCResult_NoneErrorZ;
2023 * The contents of CResult_RouteHopDecodeErrorZ
2025 typedef union LDKCResult_RouteHopDecodeErrorZPtr {
2027 * A pointer to the contents in the success state.
2028 * Reading from this pointer when `result_ok` is not set is undefined.
2030 struct LDKRouteHop *result;
2032 * A pointer to the contents in the error state.
2033 * Reading from this pointer when `result_ok` is set is undefined.
2035 struct LDKDecodeError *err;
2036 } LDKCResult_RouteHopDecodeErrorZPtr;
2039 * A CResult_RouteHopDecodeErrorZ represents the result of a fallible operation,
2040 * containing a crate::lightning::routing::router::RouteHop on success and a crate::lightning::ln::msgs::DecodeError on failure.
2041 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
2043 typedef struct LDKCResult_RouteHopDecodeErrorZ {
2045 * The contents of this CResult_RouteHopDecodeErrorZ, accessible via either
2046 * `err` or `result` depending on the state of `result_ok`.
2048 union LDKCResult_RouteHopDecodeErrorZPtr contents;
2050 * Whether this CResult_RouteHopDecodeErrorZ represents a success state.
2053 } LDKCResult_RouteHopDecodeErrorZ;
2056 * A dynamically-allocated array of crate::c_types::derived::CVec_RouteHopZs of arbitrary size.
2057 * This corresponds to std::vector in C++
2059 typedef struct LDKCVec_CVec_RouteHopZZ {
2061 * The elements in the array.
2062 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
2064 struct LDKCVec_RouteHopZ *data;
2066 * The number of elements pointed to by `data`.
2069 } LDKCVec_CVec_RouteHopZZ;
2074 * A route directs a payment from the sender (us) to the recipient. If the recipient supports MPP,
2075 * it can take multiple paths. Each path is composed of one or more hops through the network.
2077 typedef struct MUST_USE_STRUCT LDKRoute {
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 LDKnativeRoute *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.
2093 * The contents of CResult_RouteDecodeErrorZ
2095 typedef union LDKCResult_RouteDecodeErrorZPtr {
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 LDKDecodeError *err;
2106 } LDKCResult_RouteDecodeErrorZPtr;
2109 * A CResult_RouteDecodeErrorZ represents the result of a fallible operation,
2110 * containing a crate::lightning::routing::router::Route on success and a crate::lightning::ln::msgs::DecodeError on failure.
2111 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
2113 typedef struct LDKCResult_RouteDecodeErrorZ {
2115 * The contents of this CResult_RouteDecodeErrorZ, accessible via either
2116 * `err` or `result` depending on the state of `result_ok`.
2118 union LDKCResult_RouteDecodeErrorZPtr contents;
2120 * Whether this CResult_RouteDecodeErrorZ represents a success state.
2123 } LDKCResult_RouteDecodeErrorZ;
2128 * Parameters needed to find a [`Route`].
2130 * Passed to [`find_route`] and [`build_route_from_hops`], but also provided in
2131 * [`Event::PaymentPathFailed`] for retrying a failed payment path.
2133 * [`Event::PaymentPathFailed`]: crate::util::events::Event::PaymentPathFailed
2135 typedef struct MUST_USE_STRUCT LDKRouteParameters {
2137 * A pointer to the opaque Rust object.
2138 * Nearly everywhere, inner must be non-null, however in places where
2139 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2141 LDKnativeRouteParameters *inner;
2143 * Indicates that this is the only struct which contains the same pointer.
2144 * Rust functions which take ownership of an object provided via an argument require
2145 * this to be true and invalidate the object pointed to by inner.
2148 } LDKRouteParameters;
2151 * The contents of CResult_RouteParametersDecodeErrorZ
2153 typedef union LDKCResult_RouteParametersDecodeErrorZPtr {
2155 * A pointer to the contents in the success state.
2156 * Reading from this pointer when `result_ok` is not set is undefined.
2158 struct LDKRouteParameters *result;
2160 * A pointer to the contents in the error state.
2161 * Reading from this pointer when `result_ok` is set is undefined.
2163 struct LDKDecodeError *err;
2164 } LDKCResult_RouteParametersDecodeErrorZPtr;
2167 * A CResult_RouteParametersDecodeErrorZ represents the result of a fallible operation,
2168 * containing a crate::lightning::routing::router::RouteParameters on success and a crate::lightning::ln::msgs::DecodeError on failure.
2169 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
2171 typedef struct LDKCResult_RouteParametersDecodeErrorZ {
2173 * The contents of this CResult_RouteParametersDecodeErrorZ, accessible via either
2174 * `err` or `result` depending on the state of `result_ok`.
2176 union LDKCResult_RouteParametersDecodeErrorZPtr contents;
2178 * Whether this CResult_RouteParametersDecodeErrorZ represents a success state.
2181 } LDKCResult_RouteParametersDecodeErrorZ;
2186 * A list of hops along a payment path terminating with a channel to the recipient.
2188 typedef struct MUST_USE_STRUCT LDKRouteHint {
2190 * A pointer to the opaque Rust object.
2191 * Nearly everywhere, inner must be non-null, however in places where
2192 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2194 LDKnativeRouteHint *inner;
2196 * Indicates that this is the only struct which contains the same pointer.
2197 * Rust functions which take ownership of an object provided via an argument require
2198 * this to be true and invalidate the object pointed to by inner.
2204 * A dynamically-allocated array of crate::lightning::routing::router::RouteHints of arbitrary size.
2205 * This corresponds to std::vector in C++
2207 typedef struct LDKCVec_RouteHintZ {
2209 * The elements in the array.
2210 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
2212 struct LDKRouteHint *data;
2214 * The number of elements pointed to by `data`.
2217 } LDKCVec_RouteHintZ;
2220 * An enum which can either contain a u64 or not
2222 typedef enum LDKCOption_u64Z_Tag {
2224 * When we're in this state, this COption_u64Z contains a u64
2226 LDKCOption_u64Z_Some,
2228 * When we're in this state, this COption_u64Z contains nothing
2230 LDKCOption_u64Z_None,
2232 * Must be last for serialization purposes
2234 LDKCOption_u64Z_Sentinel,
2235 } LDKCOption_u64Z_Tag;
2237 typedef struct LDKCOption_u64Z {
2238 LDKCOption_u64Z_Tag tag;
2247 * A dynamically-allocated array of u64s of arbitrary size.
2248 * This corresponds to std::vector in C++
2250 typedef struct LDKCVec_u64Z {
2252 * The elements in the array.
2253 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
2257 * The number of elements pointed to by `data`.
2265 * The recipient of a payment.
2267 typedef struct MUST_USE_STRUCT LDKPaymentParameters {
2269 * A pointer to the opaque Rust object.
2270 * Nearly everywhere, inner must be non-null, however in places where
2271 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2273 LDKnativePaymentParameters *inner;
2275 * Indicates that this is the only struct which contains the same pointer.
2276 * Rust functions which take ownership of an object provided via an argument require
2277 * this to be true and invalidate the object pointed to by inner.
2280 } LDKPaymentParameters;
2283 * The contents of CResult_PaymentParametersDecodeErrorZ
2285 typedef union LDKCResult_PaymentParametersDecodeErrorZPtr {
2287 * A pointer to the contents in the success state.
2288 * Reading from this pointer when `result_ok` is not set is undefined.
2290 struct LDKPaymentParameters *result;
2292 * A pointer to the contents in the error state.
2293 * Reading from this pointer when `result_ok` is set is undefined.
2295 struct LDKDecodeError *err;
2296 } LDKCResult_PaymentParametersDecodeErrorZPtr;
2299 * A CResult_PaymentParametersDecodeErrorZ represents the result of a fallible operation,
2300 * containing a crate::lightning::routing::router::PaymentParameters on success and a crate::lightning::ln::msgs::DecodeError on failure.
2301 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
2303 typedef struct LDKCResult_PaymentParametersDecodeErrorZ {
2305 * The contents of this CResult_PaymentParametersDecodeErrorZ, accessible via either
2306 * `err` or `result` depending on the state of `result_ok`.
2308 union LDKCResult_PaymentParametersDecodeErrorZPtr contents;
2310 * Whether this CResult_PaymentParametersDecodeErrorZ represents a success state.
2313 } LDKCResult_PaymentParametersDecodeErrorZ;
2318 * A channel descriptor for a hop along a payment path.
2320 typedef struct MUST_USE_STRUCT LDKRouteHintHop {
2322 * A pointer to the opaque Rust object.
2323 * Nearly everywhere, inner must be non-null, however in places where
2324 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2326 LDKnativeRouteHintHop *inner;
2328 * Indicates that this is the only struct which contains the same pointer.
2329 * Rust functions which take ownership of an object provided via an argument require
2330 * this to be true and invalidate the object pointed to by inner.
2336 * A dynamically-allocated array of crate::lightning::routing::router::RouteHintHops of arbitrary size.
2337 * This corresponds to std::vector in C++
2339 typedef struct LDKCVec_RouteHintHopZ {
2341 * The elements in the array.
2342 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
2344 struct LDKRouteHintHop *data;
2346 * The number of elements pointed to by `data`.
2349 } LDKCVec_RouteHintHopZ;
2352 * The contents of CResult_RouteHintDecodeErrorZ
2354 typedef union LDKCResult_RouteHintDecodeErrorZPtr {
2356 * A pointer to the contents in the success state.
2357 * Reading from this pointer when `result_ok` is not set is undefined.
2359 struct LDKRouteHint *result;
2361 * A pointer to the contents in the error state.
2362 * Reading from this pointer when `result_ok` is set is undefined.
2364 struct LDKDecodeError *err;
2365 } LDKCResult_RouteHintDecodeErrorZPtr;
2368 * A CResult_RouteHintDecodeErrorZ represents the result of a fallible operation,
2369 * containing a crate::lightning::routing::router::RouteHint on success and a crate::lightning::ln::msgs::DecodeError on failure.
2370 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
2372 typedef struct LDKCResult_RouteHintDecodeErrorZ {
2374 * The contents of this CResult_RouteHintDecodeErrorZ, accessible via either
2375 * `err` or `result` depending on the state of `result_ok`.
2377 union LDKCResult_RouteHintDecodeErrorZPtr contents;
2379 * Whether this CResult_RouteHintDecodeErrorZ represents a success state.
2382 } LDKCResult_RouteHintDecodeErrorZ;
2385 * The contents of CResult_RouteHintHopDecodeErrorZ
2387 typedef union LDKCResult_RouteHintHopDecodeErrorZPtr {
2389 * A pointer to the contents in the success state.
2390 * Reading from this pointer when `result_ok` is not set is undefined.
2392 struct LDKRouteHintHop *result;
2394 * A pointer to the contents in the error state.
2395 * Reading from this pointer when `result_ok` is set is undefined.
2397 struct LDKDecodeError *err;
2398 } LDKCResult_RouteHintHopDecodeErrorZPtr;
2401 * A CResult_RouteHintHopDecodeErrorZ represents the result of a fallible operation,
2402 * containing a crate::lightning::routing::router::RouteHintHop on success and a crate::lightning::ln::msgs::DecodeError on failure.
2403 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
2405 typedef struct LDKCResult_RouteHintHopDecodeErrorZ {
2407 * The contents of this CResult_RouteHintHopDecodeErrorZ, accessible via either
2408 * `err` or `result` depending on the state of `result_ok`.
2410 union LDKCResult_RouteHintHopDecodeErrorZPtr contents;
2412 * Whether this CResult_RouteHintHopDecodeErrorZ represents a success state.
2415 } LDKCResult_RouteHintHopDecodeErrorZ;
2420 * Details of a channel, as returned by ChannelManager::list_channels and ChannelManager::list_usable_channels
2422 typedef struct MUST_USE_STRUCT LDKChannelDetails {
2424 * A pointer to the opaque Rust object.
2425 * Nearly everywhere, inner must be non-null, however in places where
2426 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2428 LDKnativeChannelDetails *inner;
2430 * Indicates that this is the only struct which contains the same pointer.
2431 * Rust functions which take ownership of an object provided via an argument require
2432 * this to be true and invalidate the object pointed to by inner.
2435 } LDKChannelDetails;
2438 * A dynamically-allocated array of crate::lightning::ln::channelmanager::ChannelDetailss of arbitrary size.
2439 * This corresponds to std::vector in C++
2441 typedef struct LDKCVec_ChannelDetailsZ {
2443 * The elements in the array.
2444 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
2446 struct LDKChannelDetails *data;
2448 * The number of elements pointed to by `data`.
2451 } LDKCVec_ChannelDetailsZ;
2456 * An Err type for failure to process messages.
2458 typedef struct MUST_USE_STRUCT LDKLightningError {
2460 * A pointer to the opaque Rust object.
2461 * Nearly everywhere, inner must be non-null, however in places where
2462 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2464 LDKnativeLightningError *inner;
2466 * Indicates that this is the only struct which contains the same pointer.
2467 * Rust functions which take ownership of an object provided via an argument require
2468 * this to be true and invalidate the object pointed to by inner.
2471 } LDKLightningError;
2474 * The contents of CResult_RouteLightningErrorZ
2476 typedef union LDKCResult_RouteLightningErrorZPtr {
2478 * A pointer to the contents in the success state.
2479 * Reading from this pointer when `result_ok` is not set is undefined.
2481 struct LDKRoute *result;
2483 * A pointer to the contents in the error state.
2484 * Reading from this pointer when `result_ok` is set is undefined.
2486 struct LDKLightningError *err;
2487 } LDKCResult_RouteLightningErrorZPtr;
2490 * A CResult_RouteLightningErrorZ represents the result of a fallible operation,
2491 * containing a crate::lightning::routing::router::Route on success and a crate::lightning::ln::msgs::LightningError on failure.
2492 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
2494 typedef struct LDKCResult_RouteLightningErrorZ {
2496 * The contents of this CResult_RouteLightningErrorZ, accessible via either
2497 * `err` or `result` depending on the state of `result_ok`.
2499 union LDKCResult_RouteLightningErrorZPtr contents;
2501 * Whether this CResult_RouteLightningErrorZ represents a success state.
2504 } LDKCResult_RouteLightningErrorZ;
2507 * Some information provided on receipt of payment depends on whether the payment received is a
2508 * spontaneous payment or a \"conventional\" lightning payment that's paying an invoice.
2510 typedef enum LDKPaymentPurpose_Tag {
2512 * Information for receiving a payment that we generated an invoice for.
2514 LDKPaymentPurpose_InvoicePayment,
2516 * Because this is a spontaneous payment, the payer generated their own preimage rather than us
2517 * (the payee) providing a preimage.
2519 LDKPaymentPurpose_SpontaneousPayment,
2521 * Must be last for serialization purposes
2523 LDKPaymentPurpose_Sentinel,
2524 } LDKPaymentPurpose_Tag;
2526 typedef struct LDKPaymentPurpose_LDKInvoicePayment_Body {
2528 * The preimage to the payment_hash, if the payment hash (and secret) were fetched via
2529 * [`ChannelManager::create_inbound_payment`]. If provided, this can be handed directly to
2530 * [`ChannelManager::claim_funds`].
2532 * [`ChannelManager::create_inbound_payment`]: crate::ln::channelmanager::ChannelManager::create_inbound_payment
2533 * [`ChannelManager::claim_funds`]: crate::ln::channelmanager::ChannelManager::claim_funds
2535 * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
2537 struct LDKThirtyTwoBytes payment_preimage;
2539 * The \"payment secret\". This authenticates the sender to the recipient, preventing a
2540 * number of deanonymization attacks during the routing process.
2541 * It is provided here for your reference, however its accuracy is enforced directly by
2542 * [`ChannelManager`] using the values you previously provided to
2543 * [`ChannelManager::create_inbound_payment`] or
2544 * [`ChannelManager::create_inbound_payment_for_hash`].
2546 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
2547 * [`ChannelManager::create_inbound_payment`]: crate::ln::channelmanager::ChannelManager::create_inbound_payment
2548 * [`ChannelManager::create_inbound_payment_for_hash`]: crate::ln::channelmanager::ChannelManager::create_inbound_payment_for_hash
2550 struct LDKThirtyTwoBytes payment_secret;
2551 } LDKPaymentPurpose_LDKInvoicePayment_Body;
2553 typedef struct MUST_USE_STRUCT LDKPaymentPurpose {
2554 LDKPaymentPurpose_Tag tag;
2556 LDKPaymentPurpose_LDKInvoicePayment_Body invoice_payment;
2558 struct LDKThirtyTwoBytes spontaneous_payment;
2561 } LDKPaymentPurpose;
2564 * The contents of CResult_PaymentPurposeDecodeErrorZ
2566 typedef union LDKCResult_PaymentPurposeDecodeErrorZPtr {
2568 * A pointer to the contents in the success state.
2569 * Reading from this pointer when `result_ok` is not set is undefined.
2571 struct LDKPaymentPurpose *result;
2573 * A pointer to the contents in the error state.
2574 * Reading from this pointer when `result_ok` is set is undefined.
2576 struct LDKDecodeError *err;
2577 } LDKCResult_PaymentPurposeDecodeErrorZPtr;
2580 * A CResult_PaymentPurposeDecodeErrorZ represents the result of a fallible operation,
2581 * containing a crate::lightning::util::events::PaymentPurpose on success and a crate::lightning::ln::msgs::DecodeError on failure.
2582 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
2584 typedef struct LDKCResult_PaymentPurposeDecodeErrorZ {
2586 * The contents of this CResult_PaymentPurposeDecodeErrorZ, accessible via either
2587 * `err` or `result` depending on the state of `result_ok`.
2589 union LDKCResult_PaymentPurposeDecodeErrorZPtr contents;
2591 * Whether this CResult_PaymentPurposeDecodeErrorZ represents a success state.
2594 } LDKCResult_PaymentPurposeDecodeErrorZ;
2597 * The reason the channel was closed. See individual variants more details.
2599 typedef enum LDKClosureReason_Tag {
2601 * Closure generated from receiving a peer error message.
2603 * Our counterparty may have broadcasted their latest commitment state, and we have
2606 LDKClosureReason_CounterpartyForceClosed,
2608 * Closure generated from [`ChannelManager::force_close_channel`], called by the user.
2610 * [`ChannelManager::force_close_channel`]: crate::ln::channelmanager::ChannelManager::force_close_channel.
2612 LDKClosureReason_HolderForceClosed,
2614 * The channel was closed after negotiating a cooperative close and we've now broadcasted
2615 * the cooperative close transaction. Note the shutdown may have been initiated by us.
2617 LDKClosureReason_CooperativeClosure,
2619 * A commitment transaction was confirmed on chain, closing the channel. Most likely this
2620 * commitment transaction came from our counterparty, but it may also have come from
2621 * a copy of our own `ChannelMonitor`.
2623 LDKClosureReason_CommitmentTxConfirmed,
2625 * The funding transaction failed to confirm in a timely manner on an inbound channel.
2627 LDKClosureReason_FundingTimedOut,
2629 * Closure generated from processing an event, likely a HTLC forward/relay/reception.
2631 LDKClosureReason_ProcessingError,
2633 * The peer disconnected prior to funding completing. In this case the spec mandates that we
2634 * forget the channel entirely - we can attempt again if the peer reconnects.
2636 * This includes cases where we restarted prior to funding completion, including prior to the
2637 * initial [`ChannelMonitor`] persistence completing.
2639 * In LDK versions prior to 0.0.107 this could also occur if we were unable to connect to the
2640 * peer because of mutual incompatibility between us and our channel counterparty.
2642 * [`ChannelMonitor`]: crate::chain::channelmonitor::ChannelMonitor
2644 LDKClosureReason_DisconnectedPeer,
2646 * Closure generated from `ChannelManager::read` if the [`ChannelMonitor`] is newer than
2647 * the [`ChannelManager`] deserialized.
2649 * [`ChannelMonitor`]: crate::chain::channelmonitor::ChannelMonitor
2650 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
2652 LDKClosureReason_OutdatedChannelManager,
2654 * Must be last for serialization purposes
2656 LDKClosureReason_Sentinel,
2657 } LDKClosureReason_Tag;
2659 typedef struct LDKClosureReason_LDKCounterpartyForceClosed_Body {
2661 * The error which the peer sent us.
2663 * The string should be sanitized before it is used (e.g emitted to logs
2664 * or printed to stdout). Otherwise, a well crafted error message may exploit
2665 * a security vulnerability in the terminal emulator or the logging subsystem.
2667 struct LDKStr peer_msg;
2668 } LDKClosureReason_LDKCounterpartyForceClosed_Body;
2670 typedef struct LDKClosureReason_LDKProcessingError_Body {
2672 * A developer-readable error message which we generated.
2675 } LDKClosureReason_LDKProcessingError_Body;
2677 typedef struct MUST_USE_STRUCT LDKClosureReason {
2678 LDKClosureReason_Tag tag;
2680 LDKClosureReason_LDKCounterpartyForceClosed_Body counterparty_force_closed;
2681 LDKClosureReason_LDKProcessingError_Body processing_error;
2686 * An enum which can either contain a crate::lightning::util::events::ClosureReason or not
2688 typedef enum LDKCOption_ClosureReasonZ_Tag {
2690 * When we're in this state, this COption_ClosureReasonZ contains a crate::lightning::util::events::ClosureReason
2692 LDKCOption_ClosureReasonZ_Some,
2694 * When we're in this state, this COption_ClosureReasonZ contains nothing
2696 LDKCOption_ClosureReasonZ_None,
2698 * Must be last for serialization purposes
2700 LDKCOption_ClosureReasonZ_Sentinel,
2701 } LDKCOption_ClosureReasonZ_Tag;
2703 typedef struct LDKCOption_ClosureReasonZ {
2704 LDKCOption_ClosureReasonZ_Tag tag;
2707 struct LDKClosureReason some;
2710 } LDKCOption_ClosureReasonZ;
2713 * The contents of CResult_COption_ClosureReasonZDecodeErrorZ
2715 typedef union LDKCResult_COption_ClosureReasonZDecodeErrorZPtr {
2717 * A pointer to the contents in the success state.
2718 * Reading from this pointer when `result_ok` is not set is undefined.
2720 struct LDKCOption_ClosureReasonZ *result;
2722 * A pointer to the contents in the error state.
2723 * Reading from this pointer when `result_ok` is set is undefined.
2725 struct LDKDecodeError *err;
2726 } LDKCResult_COption_ClosureReasonZDecodeErrorZPtr;
2729 * A CResult_COption_ClosureReasonZDecodeErrorZ represents the result of a fallible operation,
2730 * containing a crate::c_types::derived::COption_ClosureReasonZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
2731 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
2733 typedef struct LDKCResult_COption_ClosureReasonZDecodeErrorZ {
2735 * The contents of this CResult_COption_ClosureReasonZDecodeErrorZ, accessible via either
2736 * `err` or `result` depending on the state of `result_ok`.
2738 union LDKCResult_COption_ClosureReasonZDecodeErrorZPtr contents;
2740 * Whether this CResult_COption_ClosureReasonZDecodeErrorZ represents a success state.
2743 } LDKCResult_COption_ClosureReasonZDecodeErrorZ;
2746 * Intended destination of a failed HTLC as indicated in [`Event::HTLCHandlingFailed`].
2748 typedef enum LDKHTLCDestination_Tag {
2750 * We tried forwarding to a channel but failed to do so. An example of such an instance is when
2751 * there is insufficient capacity in our outbound channel.
2753 LDKHTLCDestination_NextHopChannel,
2755 * Scenario where we are unsure of the next node to forward the HTLC to.
2757 LDKHTLCDestination_UnknownNextHop,
2759 * Failure scenario where an HTLC may have been forwarded to be intended for us,
2760 * but is invalid for some reason, so we reject it.
2762 * Some of the reasons may include:
2764 * * Expected MPP amount to claim does not equal HTLC total
2765 * * Claimable amount does not match expected amount
2767 LDKHTLCDestination_FailedPayment,
2769 * Must be last for serialization purposes
2771 LDKHTLCDestination_Sentinel,
2772 } LDKHTLCDestination_Tag;
2774 typedef struct LDKHTLCDestination_LDKNextHopChannel_Body {
2776 * The `node_id` of the next node. For backwards compatibility, this field is
2777 * marked as optional, versions prior to 0.0.110 may not always be able to provide
2778 * counterparty node information.
2780 * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
2782 struct LDKPublicKey node_id;
2784 * The outgoing `channel_id` between us and the next node.
2786 struct LDKThirtyTwoBytes channel_id;
2787 } LDKHTLCDestination_LDKNextHopChannel_Body;
2789 typedef struct LDKHTLCDestination_LDKUnknownNextHop_Body {
2791 * Short channel id we are requesting to forward an HTLC to.
2793 uint64_t requested_forward_scid;
2794 } LDKHTLCDestination_LDKUnknownNextHop_Body;
2796 typedef struct LDKHTLCDestination_LDKFailedPayment_Body {
2798 * The payment hash of the payment we attempted to process.
2800 struct LDKThirtyTwoBytes payment_hash;
2801 } LDKHTLCDestination_LDKFailedPayment_Body;
2803 typedef struct MUST_USE_STRUCT LDKHTLCDestination {
2804 LDKHTLCDestination_Tag tag;
2806 LDKHTLCDestination_LDKNextHopChannel_Body next_hop_channel;
2807 LDKHTLCDestination_LDKUnknownNextHop_Body unknown_next_hop;
2808 LDKHTLCDestination_LDKFailedPayment_Body failed_payment;
2810 } LDKHTLCDestination;
2813 * An enum which can either contain a crate::lightning::util::events::HTLCDestination or not
2815 typedef enum LDKCOption_HTLCDestinationZ_Tag {
2817 * When we're in this state, this COption_HTLCDestinationZ contains a crate::lightning::util::events::HTLCDestination
2819 LDKCOption_HTLCDestinationZ_Some,
2821 * When we're in this state, this COption_HTLCDestinationZ contains nothing
2823 LDKCOption_HTLCDestinationZ_None,
2825 * Must be last for serialization purposes
2827 LDKCOption_HTLCDestinationZ_Sentinel,
2828 } LDKCOption_HTLCDestinationZ_Tag;
2830 typedef struct LDKCOption_HTLCDestinationZ {
2831 LDKCOption_HTLCDestinationZ_Tag tag;
2834 struct LDKHTLCDestination some;
2837 } LDKCOption_HTLCDestinationZ;
2840 * The contents of CResult_COption_HTLCDestinationZDecodeErrorZ
2842 typedef union LDKCResult_COption_HTLCDestinationZDecodeErrorZPtr {
2844 * A pointer to the contents in the success state.
2845 * Reading from this pointer when `result_ok` is not set is undefined.
2847 struct LDKCOption_HTLCDestinationZ *result;
2849 * A pointer to the contents in the error state.
2850 * Reading from this pointer when `result_ok` is set is undefined.
2852 struct LDKDecodeError *err;
2853 } LDKCResult_COption_HTLCDestinationZDecodeErrorZPtr;
2856 * A CResult_COption_HTLCDestinationZDecodeErrorZ represents the result of a fallible operation,
2857 * containing a crate::c_types::derived::COption_HTLCDestinationZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
2858 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
2860 typedef struct LDKCResult_COption_HTLCDestinationZDecodeErrorZ {
2862 * The contents of this CResult_COption_HTLCDestinationZDecodeErrorZ, accessible via either
2863 * `err` or `result` depending on the state of `result_ok`.
2865 union LDKCResult_COption_HTLCDestinationZDecodeErrorZPtr contents;
2867 * Whether this CResult_COption_HTLCDestinationZDecodeErrorZ represents a success state.
2870 } LDKCResult_COption_HTLCDestinationZDecodeErrorZ;
2875 * A channel_update message to be sent or received from a peer
2877 typedef struct MUST_USE_STRUCT LDKChannelUpdate {
2879 * A pointer to the opaque Rust object.
2880 * Nearly everywhere, inner must be non-null, however in places where
2881 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2883 LDKnativeChannelUpdate *inner;
2885 * Indicates that this is the only struct which contains the same pointer.
2886 * Rust functions which take ownership of an object provided via an argument require
2887 * this to be true and invalidate the object pointed to by inner.
2893 * Update to the [`NetworkGraph`] based on payment failure information conveyed via the Onion
2894 * return packet by a node along the route. See [BOLT #4] for details.
2896 * [BOLT #4]: https://github.com/lightning/bolts/blob/master/04-onion-routing.md
2898 typedef enum LDKNetworkUpdate_Tag {
2900 * An error indicating a `channel_update` messages should be applied via
2901 * [`NetworkGraph::update_channel`].
2903 LDKNetworkUpdate_ChannelUpdateMessage,
2905 * An error indicating that a channel failed to route a payment, which should be applied via
2906 * [`NetworkGraph::channel_failed`].
2908 LDKNetworkUpdate_ChannelFailure,
2910 * An error indicating that a node failed to route a payment, which should be applied via
2911 * [`NetworkGraph::node_failed_permanent`] if permanent.
2913 LDKNetworkUpdate_NodeFailure,
2915 * Must be last for serialization purposes
2917 LDKNetworkUpdate_Sentinel,
2918 } LDKNetworkUpdate_Tag;
2920 typedef struct LDKNetworkUpdate_LDKChannelUpdateMessage_Body {
2922 * The update to apply via [`NetworkGraph::update_channel`].
2924 struct LDKChannelUpdate msg;
2925 } LDKNetworkUpdate_LDKChannelUpdateMessage_Body;
2927 typedef struct LDKNetworkUpdate_LDKChannelFailure_Body {
2929 * The short channel id of the closed channel.
2931 uint64_t short_channel_id;
2933 * Whether the channel should be permanently removed or temporarily disabled until a new
2934 * `channel_update` message is received.
2937 } LDKNetworkUpdate_LDKChannelFailure_Body;
2939 typedef struct LDKNetworkUpdate_LDKNodeFailure_Body {
2941 * The node id of the failed node.
2943 struct LDKPublicKey node_id;
2945 * Whether the node should be permanently removed from consideration or can be restored
2946 * when a new `channel_update` message is received.
2949 } LDKNetworkUpdate_LDKNodeFailure_Body;
2951 typedef struct MUST_USE_STRUCT LDKNetworkUpdate {
2952 LDKNetworkUpdate_Tag tag;
2954 LDKNetworkUpdate_LDKChannelUpdateMessage_Body channel_update_message;
2955 LDKNetworkUpdate_LDKChannelFailure_Body channel_failure;
2956 LDKNetworkUpdate_LDKNodeFailure_Body node_failure;
2961 * An enum which can either contain a crate::lightning::routing::gossip::NetworkUpdate or not
2963 typedef enum LDKCOption_NetworkUpdateZ_Tag {
2965 * When we're in this state, this COption_NetworkUpdateZ contains a crate::lightning::routing::gossip::NetworkUpdate
2967 LDKCOption_NetworkUpdateZ_Some,
2969 * When we're in this state, this COption_NetworkUpdateZ contains nothing
2971 LDKCOption_NetworkUpdateZ_None,
2973 * Must be last for serialization purposes
2975 LDKCOption_NetworkUpdateZ_Sentinel,
2976 } LDKCOption_NetworkUpdateZ_Tag;
2978 typedef struct LDKCOption_NetworkUpdateZ {
2979 LDKCOption_NetworkUpdateZ_Tag tag;
2982 struct LDKNetworkUpdate some;
2985 } LDKCOption_NetworkUpdateZ;
2990 * A reference to a transaction output.
2992 * Differs from bitcoin::blockdata::transaction::OutPoint as the index is a u16 instead of u32
2993 * due to LN's restrictions on index values. Should reduce (possibly) unsafe conversions this way.
2995 typedef struct MUST_USE_STRUCT LDKOutPoint {
2997 * A pointer to the opaque Rust object.
2998 * Nearly everywhere, inner must be non-null, however in places where
2999 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3001 LDKnativeOutPoint *inner;
3003 * Indicates that this is the only struct which contains the same pointer.
3004 * Rust functions which take ownership of an object provided via an argument require
3005 * this to be true and invalidate the object pointed to by inner.
3013 * Information about a spendable output to a P2WSH script. See
3014 * SpendableOutputDescriptor::DelayedPaymentOutput for more details on how to spend this.
3016 typedef struct MUST_USE_STRUCT LDKDelayedPaymentOutputDescriptor {
3018 * A pointer to the opaque Rust object.
3019 * Nearly everywhere, inner must be non-null, however in places where
3020 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3022 LDKnativeDelayedPaymentOutputDescriptor *inner;
3024 * Indicates that this is the only struct which contains the same pointer.
3025 * Rust functions which take ownership of an object provided via an argument require
3026 * this to be true and invalidate the object pointed to by inner.
3029 } LDKDelayedPaymentOutputDescriptor;
3034 * Information about a spendable output to our \"payment key\". See
3035 * SpendableOutputDescriptor::StaticPaymentOutput for more details on how to spend this.
3037 typedef struct MUST_USE_STRUCT LDKStaticPaymentOutputDescriptor {
3039 * A pointer to the opaque Rust object.
3040 * Nearly everywhere, inner must be non-null, however in places where
3041 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3043 LDKnativeStaticPaymentOutputDescriptor *inner;
3045 * Indicates that this is the only struct which contains the same pointer.
3046 * Rust functions which take ownership of an object provided via an argument require
3047 * this to be true and invalidate the object pointed to by inner.
3050 } LDKStaticPaymentOutputDescriptor;
3053 * When on-chain outputs are created by rust-lightning (which our counterparty is not able to
3054 * claim at any point in the future) an event is generated which you must track and be able to
3055 * spend on-chain. The information needed to do this is provided in this enum, including the
3056 * outpoint describing which txid and output index is available, the full output which exists at
3057 * that txid/index, and any keys or other information required to sign.
3059 typedef enum LDKSpendableOutputDescriptor_Tag {
3061 * An output to a script which was provided via KeysInterface directly, either from
3062 * `get_destination_script()` or `get_shutdown_scriptpubkey()`, thus you should already know
3063 * how to spend it. No secret keys are provided as rust-lightning was never given any key.
3064 * These may include outputs from a transaction punishing our counterparty or claiming an HTLC
3065 * on-chain using the payment preimage or after it has timed out.
3067 LDKSpendableOutputDescriptor_StaticOutput,
3069 * An output to a P2WSH script which can be spent with a single signature after a CSV delay.
3071 * The witness in the spending input should be:
3072 * <BIP 143 signature> <empty vector> (MINIMALIF standard rule) <provided witnessScript>
3074 * Note that the nSequence field in the spending input must be set to to_self_delay
3075 * (which means the transaction is not broadcastable until at least to_self_delay
3076 * blocks after the outpoint confirms).
3078 * These are generally the result of a \"revocable\" output to us, spendable only by us unless
3079 * it is an output from an old state which we broadcast (which should never happen).
3081 * To derive the delayed_payment key which is used to sign for this input, you must pass the
3082 * holder delayed_payment_base_key (ie the private key which corresponds to the pubkey in
3083 * Sign::pubkeys().delayed_payment_basepoint) and the provided per_commitment_point to
3084 * chan_utils::derive_private_key. The public key can be generated without the secret key
3085 * using chan_utils::derive_public_key and only the delayed_payment_basepoint which appears in
3088 * To derive the revocation_pubkey provided here (which is used in the witness
3089 * script generation), you must pass the counterparty revocation_basepoint (which appears in the
3090 * call to Sign::ready_channel) and the provided per_commitment point
3091 * to chan_utils::derive_public_revocation_key.
3093 * The witness script which is hashed and included in the output script_pubkey may be
3094 * regenerated by passing the revocation_pubkey (derived as above), our delayed_payment pubkey
3095 * (derived as above), and the to_self_delay contained here to
3096 * chan_utils::get_revokeable_redeemscript.
3098 LDKSpendableOutputDescriptor_DelayedPaymentOutput,
3100 * An output to a P2WPKH, spendable exclusively by our payment key (ie the private key which
3101 * corresponds to the public key in Sign::pubkeys().payment_point).
3102 * The witness in the spending input, is, thus, simply:
3103 * <BIP 143 signature> <payment key>
3105 * These are generally the result of our counterparty having broadcast the current state,
3106 * allowing us to claim the non-HTLC-encumbered outputs immediately.
3108 LDKSpendableOutputDescriptor_StaticPaymentOutput,
3110 * Must be last for serialization purposes
3112 LDKSpendableOutputDescriptor_Sentinel,
3113 } LDKSpendableOutputDescriptor_Tag;
3115 typedef struct LDKSpendableOutputDescriptor_LDKStaticOutput_Body {
3117 * The outpoint which is spendable
3119 struct LDKOutPoint outpoint;
3121 * The output which is referenced by the given outpoint.
3123 struct LDKTxOut output;
3124 } LDKSpendableOutputDescriptor_LDKStaticOutput_Body;
3126 typedef struct MUST_USE_STRUCT LDKSpendableOutputDescriptor {
3127 LDKSpendableOutputDescriptor_Tag tag;
3129 LDKSpendableOutputDescriptor_LDKStaticOutput_Body static_output;
3131 struct LDKDelayedPaymentOutputDescriptor delayed_payment_output;
3134 struct LDKStaticPaymentOutputDescriptor static_payment_output;
3137 } LDKSpendableOutputDescriptor;
3140 * A dynamically-allocated array of crate::lightning::chain::keysinterface::SpendableOutputDescriptors of arbitrary size.
3141 * This corresponds to std::vector in C++
3143 typedef struct LDKCVec_SpendableOutputDescriptorZ {
3145 * The elements in the array.
3146 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
3148 struct LDKSpendableOutputDescriptor *data;
3150 * The number of elements pointed to by `data`.
3153 } LDKCVec_SpendableOutputDescriptorZ;
3158 * Features used within the channel_type field in an OpenChannel message.
3160 * A channel is always of some known \"type\", describing the transaction formats used and the exact
3161 * semantics of our interaction with our peer.
3163 * Note that because a channel is a specific type which is proposed by the opener and accepted by
3164 * the counterparty, only required features are allowed here.
3166 * This is serialized differently from other feature types - it is not prefixed by a length, and
3167 * thus must only appear inside a TLV where its length is known in advance.
3169 typedef struct MUST_USE_STRUCT LDKChannelTypeFeatures {
3171 * A pointer to the opaque Rust object.
3172 * Nearly everywhere, inner must be non-null, however in places where
3173 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3175 LDKnativeChannelTypeFeatures *inner;
3177 * Indicates that this is the only struct which contains the same pointer.
3178 * Rust functions which take ownership of an object provided via an argument require
3179 * this to be true and invalidate the object pointed to by inner.
3182 } LDKChannelTypeFeatures;
3185 * An Event which you should probably take some action in response to.
3187 * Note that while Writeable and Readable are implemented for Event, you probably shouldn't use
3188 * them directly as they don't round-trip exactly (for example FundingGenerationReady is never
3189 * written as it makes no sense to respond to it after reconnecting to peers).
3191 typedef enum LDKEvent_Tag {
3193 * Used to indicate that the client should generate a funding transaction with the given
3194 * parameters and then call [`ChannelManager::funding_transaction_generated`].
3195 * Generated in [`ChannelManager`] message handling.
3196 * Note that *all inputs* in the funding transaction must spend SegWit outputs or your
3197 * counterparty can steal your funds!
3199 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
3200 * [`ChannelManager::funding_transaction_generated`]: crate::ln::channelmanager::ChannelManager::funding_transaction_generated
3202 LDKEvent_FundingGenerationReady,
3204 * Indicates we've received (an offer of) money! Just gotta dig out that payment preimage and
3205 * feed it to [`ChannelManager::claim_funds`] to get it....
3207 * Note that if the preimage is not known, you should call
3208 * [`ChannelManager::fail_htlc_backwards`] to free up resources for this HTLC and avoid
3209 * network congestion.
3210 * If you fail to call either [`ChannelManager::claim_funds`] or
3211 * [`ChannelManager::fail_htlc_backwards`] within the HTLC's timeout, the HTLC will be
3212 * automatically failed.
3215 * LDK will not stop an inbound payment from being paid multiple times, so multiple
3216 * `PaymentReceived` events may be generated for the same payment.
3218 * [`ChannelManager::claim_funds`]: crate::ln::channelmanager::ChannelManager::claim_funds
3219 * [`ChannelManager::fail_htlc_backwards`]: crate::ln::channelmanager::ChannelManager::fail_htlc_backwards
3221 LDKEvent_PaymentReceived,
3223 * Indicates a payment has been claimed and we've received money!
3225 * This most likely occurs when [`ChannelManager::claim_funds`] has been called in response
3226 * to an [`Event::PaymentReceived`]. However, if we previously crashed during a
3227 * [`ChannelManager::claim_funds`] call you may see this event without a corresponding
3228 * [`Event::PaymentReceived`] event.
3231 * LDK will not stop an inbound payment from being paid multiple times, so multiple
3232 * `PaymentReceived` events may be generated for the same payment. If you then call
3233 * [`ChannelManager::claim_funds`] twice for the same [`Event::PaymentReceived`] you may get
3234 * multiple `PaymentClaimed` events.
3236 * [`ChannelManager::claim_funds`]: crate::ln::channelmanager::ChannelManager::claim_funds
3238 LDKEvent_PaymentClaimed,
3240 * Indicates an outbound payment we made succeeded (i.e. it made it all the way to its target
3241 * and we got back the payment preimage for it).
3243 * Note for MPP payments: in rare cases, this event may be preceded by a `PaymentPathFailed`
3244 * event. In this situation, you SHOULD treat this payment as having succeeded.
3246 LDKEvent_PaymentSent,
3248 * Indicates an outbound payment failed. Individual [`Event::PaymentPathFailed`] events
3249 * provide failure information for each MPP part in the payment.
3251 * This event is provided once there are no further pending HTLCs for the payment and the
3252 * payment is no longer retryable, either due to a several-block timeout or because
3253 * [`ChannelManager::abandon_payment`] was previously called for the corresponding payment.
3255 * [`ChannelManager::abandon_payment`]: crate::ln::channelmanager::ChannelManager::abandon_payment
3257 LDKEvent_PaymentFailed,
3259 * Indicates that a path for an outbound payment was successful.
3261 * Always generated after [`Event::PaymentSent`] and thus useful for scoring channels. See
3262 * [`Event::PaymentSent`] for obtaining the payment preimage.
3264 LDKEvent_PaymentPathSuccessful,
3266 * Indicates an outbound HTLC we sent failed. Probably some intermediary node dropped
3267 * something. You may wish to retry with a different route.
3269 * Note that this does *not* indicate that all paths for an MPP payment have failed, see
3270 * [`Event::PaymentFailed`] and [`all_paths_failed`].
3272 * [`all_paths_failed`]: Self::PaymentPathFailed::all_paths_failed
3274 LDKEvent_PaymentPathFailed,
3276 * Indicates that a probe payment we sent returned successful, i.e., only failed at the destination.
3278 LDKEvent_ProbeSuccessful,
3280 * Indicates that a probe payment we sent failed at an intermediary node on the path.
3282 LDKEvent_ProbeFailed,
3284 * Used to indicate that [`ChannelManager::process_pending_htlc_forwards`] should be called at
3285 * a time in the future.
3287 * [`ChannelManager::process_pending_htlc_forwards`]: crate::ln::channelmanager::ChannelManager::process_pending_htlc_forwards
3289 LDKEvent_PendingHTLCsForwardable,
3291 * Used to indicate that an output which you should know how to spend was confirmed on chain
3292 * and is now spendable.
3293 * Such an output will *not* ever be spent by rust-lightning, and are not at risk of your
3294 * counterparty spending them due to some kind of timeout. Thus, you need to store them
3295 * somewhere and spend them when you create on-chain transactions.
3297 LDKEvent_SpendableOutputs,
3299 * This event is generated when a payment has been successfully forwarded through us and a
3300 * forwarding fee earned.
3302 LDKEvent_PaymentForwarded,
3304 * Used to indicate that a previously opened channel with the given `channel_id` is in the
3305 * process of closure.
3307 LDKEvent_ChannelClosed,
3309 * Used to indicate to the user that they can abandon the funding transaction and recycle the
3310 * inputs for another purpose.
3312 LDKEvent_DiscardFunding,
3314 * Indicates a request to open a new channel by a peer.
3316 * To accept the request, call [`ChannelManager::accept_inbound_channel`]. To reject the
3317 * request, call [`ChannelManager::force_close_without_broadcasting_txn`].
3319 * The event is only triggered when a new open channel request is received and the
3320 * [`UserConfig::manually_accept_inbound_channels`] config flag is set to true.
3322 * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
3323 * [`ChannelManager::force_close_without_broadcasting_txn`]: crate::ln::channelmanager::ChannelManager::force_close_without_broadcasting_txn
3324 * [`UserConfig::manually_accept_inbound_channels`]: crate::util::config::UserConfig::manually_accept_inbound_channels
3326 LDKEvent_OpenChannelRequest,
3328 * Indicates that the HTLC was accepted, but could not be processed when or after attempting to
3331 * Some scenarios where this event may be sent include:
3332 * * Insufficient capacity in the outbound channel
3333 * * While waiting to forward the HTLC, the channel it is meant to be forwarded through closes
3334 * * When an unknown SCID is requested for forwarding a payment.
3335 * * Claiming an amount for an MPP payment that exceeds the HTLC total
3336 * * The HTLC has timed out
3338 * This event, however, does not get generated if an HTLC fails to meet the forwarding
3339 * requirements (i.e. insufficient fees paid, or a CLTV that is too soon).
3341 LDKEvent_HTLCHandlingFailed,
3343 * Must be last for serialization purposes
3348 typedef struct LDKEvent_LDKFundingGenerationReady_Body {
3350 * The random channel_id we picked which you'll need to pass into
3351 * [`ChannelManager::funding_transaction_generated`].
3353 * [`ChannelManager::funding_transaction_generated`]: crate::ln::channelmanager::ChannelManager::funding_transaction_generated
3355 struct LDKThirtyTwoBytes temporary_channel_id;
3357 * The counterparty's node_id, which you'll need to pass back into
3358 * [`ChannelManager::funding_transaction_generated`].
3360 * [`ChannelManager::funding_transaction_generated`]: crate::ln::channelmanager::ChannelManager::funding_transaction_generated
3362 struct LDKPublicKey counterparty_node_id;
3364 * The value, in satoshis, that the output should have.
3366 uint64_t channel_value_satoshis;
3368 * The script which should be used in the transaction output.
3370 struct LDKCVec_u8Z output_script;
3372 * The `user_channel_id` value passed in to [`ChannelManager::create_channel`], or 0 for
3373 * an inbound channel.
3375 * [`ChannelManager::create_channel`]: crate::ln::channelmanager::ChannelManager::create_channel
3377 uint64_t user_channel_id;
3378 } LDKEvent_LDKFundingGenerationReady_Body;
3380 typedef struct LDKEvent_LDKPaymentReceived_Body {
3382 * The hash for which the preimage should be handed to the ChannelManager. Note that LDK will
3383 * not stop you from registering duplicate payment hashes for inbound payments.
3385 struct LDKThirtyTwoBytes payment_hash;
3387 * The value, in thousandths of a satoshi, that this payment is for.
3389 uint64_t amount_msat;
3391 * Information for claiming this received payment, based on whether the purpose of the
3392 * payment is to pay an invoice or to send a spontaneous payment.
3394 struct LDKPaymentPurpose purpose;
3395 } LDKEvent_LDKPaymentReceived_Body;
3397 typedef struct LDKEvent_LDKPaymentClaimed_Body {
3399 * The payment hash of the claimed payment. Note that LDK will not stop you from
3400 * registering duplicate payment hashes for inbound payments.
3402 struct LDKThirtyTwoBytes payment_hash;
3404 * The value, in thousandths of a satoshi, that this payment is for.
3406 uint64_t amount_msat;
3408 * The purpose of this claimed payment, i.e. whether the payment was for an invoice or a
3409 * spontaneous payment.
3411 struct LDKPaymentPurpose purpose;
3412 } LDKEvent_LDKPaymentClaimed_Body;
3414 typedef struct LDKEvent_LDKPaymentSent_Body {
3416 * The id returned by [`ChannelManager::send_payment`] and used with
3417 * [`ChannelManager::retry_payment`].
3419 * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
3420 * [`ChannelManager::retry_payment`]: crate::ln::channelmanager::ChannelManager::retry_payment
3422 * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
3424 struct LDKThirtyTwoBytes payment_id;
3426 * The preimage to the hash given to ChannelManager::send_payment.
3427 * Note that this serves as a payment receipt, if you wish to have such a thing, you must
3430 struct LDKThirtyTwoBytes payment_preimage;
3432 * The hash that was given to [`ChannelManager::send_payment`].
3434 * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
3436 struct LDKThirtyTwoBytes payment_hash;
3438 * The total fee which was spent at intermediate hops in this payment, across all paths.
3440 * Note that, like [`Route::get_total_fees`] this does *not* include any potential
3441 * overpayment to the recipient node.
3443 * If the recipient or an intermediate node misbehaves and gives us free money, this may
3444 * overstate the amount paid, though this is unlikely.
3446 * [`Route::get_total_fees`]: crate::routing::router::Route::get_total_fees
3448 struct LDKCOption_u64Z fee_paid_msat;
3449 } LDKEvent_LDKPaymentSent_Body;
3451 typedef struct LDKEvent_LDKPaymentFailed_Body {
3453 * The id returned by [`ChannelManager::send_payment`] and used with
3454 * [`ChannelManager::retry_payment`] and [`ChannelManager::abandon_payment`].
3456 * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
3457 * [`ChannelManager::retry_payment`]: crate::ln::channelmanager::ChannelManager::retry_payment
3458 * [`ChannelManager::abandon_payment`]: crate::ln::channelmanager::ChannelManager::abandon_payment
3460 struct LDKThirtyTwoBytes payment_id;
3462 * The hash that was given to [`ChannelManager::send_payment`].
3464 * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
3466 struct LDKThirtyTwoBytes payment_hash;
3467 } LDKEvent_LDKPaymentFailed_Body;
3469 typedef struct LDKEvent_LDKPaymentPathSuccessful_Body {
3471 * The id returned by [`ChannelManager::send_payment`] and used with
3472 * [`ChannelManager::retry_payment`].
3474 * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
3475 * [`ChannelManager::retry_payment`]: crate::ln::channelmanager::ChannelManager::retry_payment
3477 struct LDKThirtyTwoBytes payment_id;
3479 * The hash that was given to [`ChannelManager::send_payment`].
3481 * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
3483 * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
3485 struct LDKThirtyTwoBytes payment_hash;
3487 * The payment path that was successful.
3489 * May contain a closed channel if the HTLC sent along the path was fulfilled on chain.
3491 struct LDKCVec_RouteHopZ path;
3492 } LDKEvent_LDKPaymentPathSuccessful_Body;
3494 typedef struct LDKEvent_LDKPaymentPathFailed_Body {
3496 * The id returned by [`ChannelManager::send_payment`] and used with
3497 * [`ChannelManager::retry_payment`] and [`ChannelManager::abandon_payment`].
3499 * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
3500 * [`ChannelManager::retry_payment`]: crate::ln::channelmanager::ChannelManager::retry_payment
3501 * [`ChannelManager::abandon_payment`]: crate::ln::channelmanager::ChannelManager::abandon_payment
3503 * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
3505 struct LDKThirtyTwoBytes payment_id;
3507 * The hash that was given to [`ChannelManager::send_payment`].
3509 * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
3511 struct LDKThirtyTwoBytes payment_hash;
3513 * Indicates the payment was rejected for some reason by the recipient. This implies that
3514 * the payment has failed, not just the route in question. If this is not set, you may
3515 * retry the payment via a different route.
3517 bool payment_failed_permanently;
3519 * Any failure information conveyed via the Onion return packet by a node along the failed
3522 * Should be applied to the [`NetworkGraph`] so that routing decisions can take into
3523 * account the update.
3525 * [`NetworkGraph`]: crate::routing::gossip::NetworkGraph
3527 struct LDKCOption_NetworkUpdateZ network_update;
3529 * For both single-path and multi-path payments, this is set if all paths of the payment have
3530 * failed. This will be set to false if (1) this is an MPP payment and (2) other parts of the
3531 * larger MPP payment were still in flight when this event was generated.
3533 * Note that if you are retrying individual MPP parts, using this value to determine if a
3534 * payment has fully failed is race-y. Because multiple failures can happen prior to events
3535 * being processed, you may retry in response to a first failure, with a second failure
3536 * (with `all_paths_failed` set) still pending. Then, when the second failure is processed
3537 * you will see `all_paths_failed` set even though the retry of the first failure still
3538 * has an associated in-flight HTLC. See (1) for an example of such a failure.
3540 * If you wish to retry individual MPP parts and learn when a payment has failed, you must
3541 * call [`ChannelManager::abandon_payment`] and wait for a [`Event::PaymentFailed`] event.
3543 * (1) <https://github.com/lightningdevkit/rust-lightning/issues/1164>
3545 * [`ChannelManager::abandon_payment`]: crate::ln::channelmanager::ChannelManager::abandon_payment
3547 bool all_paths_failed;
3549 * The payment path that failed.
3551 struct LDKCVec_RouteHopZ path;
3553 * The channel responsible for the failed payment path.
3555 * Note that for route hints or for the first hop in a path this may be an SCID alias and
3556 * may not refer to a channel in the public network graph. These aliases may also collide
3557 * with channels in the public network graph.
3559 * If this is `Some`, then the corresponding channel should be avoided when the payment is
3560 * retried. May be `None` for older [`Event`] serializations.
3562 struct LDKCOption_u64Z short_channel_id;
3564 * Parameters needed to compute a new [`Route`] when retrying the failed payment path.
3566 * See [`find_route`] for details.
3568 * [`Route`]: crate::routing::router::Route
3569 * [`find_route`]: crate::routing::router::find_route
3571 * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
3573 struct LDKRouteParameters retry;
3574 } LDKEvent_LDKPaymentPathFailed_Body;
3576 typedef struct LDKEvent_LDKProbeSuccessful_Body {
3578 * The id returned by [`ChannelManager::send_probe`].
3580 * [`ChannelManager::send_probe`]: crate::ln::channelmanager::ChannelManager::send_probe
3582 struct LDKThirtyTwoBytes payment_id;
3584 * The hash generated by [`ChannelManager::send_probe`].
3586 * [`ChannelManager::send_probe`]: crate::ln::channelmanager::ChannelManager::send_probe
3588 struct LDKThirtyTwoBytes payment_hash;
3590 * The payment path that was successful.
3592 struct LDKCVec_RouteHopZ path;
3593 } LDKEvent_LDKProbeSuccessful_Body;
3595 typedef struct LDKEvent_LDKProbeFailed_Body {
3597 * The id returned by [`ChannelManager::send_probe`].
3599 * [`ChannelManager::send_probe`]: crate::ln::channelmanager::ChannelManager::send_probe
3601 struct LDKThirtyTwoBytes payment_id;
3603 * The hash generated by [`ChannelManager::send_probe`].
3605 * [`ChannelManager::send_probe`]: crate::ln::channelmanager::ChannelManager::send_probe
3607 struct LDKThirtyTwoBytes payment_hash;
3609 * The payment path that failed.
3611 struct LDKCVec_RouteHopZ path;
3613 * The channel responsible for the failed probe.
3615 * Note that for route hints or for the first hop in a path this may be an SCID alias and
3616 * may not refer to a channel in the public network graph. These aliases may also collide
3617 * with channels in the public network graph.
3619 struct LDKCOption_u64Z short_channel_id;
3620 } LDKEvent_LDKProbeFailed_Body;
3622 typedef struct LDKEvent_LDKPendingHTLCsForwardable_Body {
3624 * The minimum amount of time that should be waited prior to calling
3625 * process_pending_htlc_forwards. To increase the effort required to correlate payments,
3626 * you should wait a random amount of time in roughly the range (now + time_forwardable,
3627 * now + 5*time_forwardable).
3629 uint64_t time_forwardable;
3630 } LDKEvent_LDKPendingHTLCsForwardable_Body;
3632 typedef struct LDKEvent_LDKSpendableOutputs_Body {
3634 * The outputs which you should store as spendable by you.
3636 struct LDKCVec_SpendableOutputDescriptorZ outputs;
3637 } LDKEvent_LDKSpendableOutputs_Body;
3639 typedef struct LDKEvent_LDKPaymentForwarded_Body {
3641 * The incoming channel between the previous node and us. This is only `None` for events
3642 * generated or serialized by versions prior to 0.0.107.
3644 * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
3646 struct LDKThirtyTwoBytes prev_channel_id;
3648 * The outgoing channel between the next node and us. This is only `None` for events
3649 * generated or serialized by versions prior to 0.0.107.
3651 * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
3653 struct LDKThirtyTwoBytes next_channel_id;
3655 * The fee, in milli-satoshis, which was earned as a result of the payment.
3657 * Note that if we force-closed the channel over which we forwarded an HTLC while the HTLC
3658 * was pending, the amount the next hop claimed will have been rounded down to the nearest
3659 * whole satoshi. Thus, the fee calculated here may be higher than expected as we still
3660 * claimed the full value in millisatoshis from the source. In this case,
3661 * `claim_from_onchain_tx` will be set.
3663 * If the channel which sent us the payment has been force-closed, we will claim the funds
3664 * via an on-chain transaction. In that case we do not yet know the on-chain transaction
3665 * fees which we will spend and will instead set this to `None`. It is possible duplicate
3666 * `PaymentForwarded` events are generated for the same payment iff `fee_earned_msat` is
3669 struct LDKCOption_u64Z fee_earned_msat;
3671 * If this is `true`, the forwarded HTLC was claimed by our counterparty via an on-chain
3674 bool claim_from_onchain_tx;
3675 } LDKEvent_LDKPaymentForwarded_Body;
3677 typedef struct LDKEvent_LDKChannelClosed_Body {
3679 * The channel_id of the channel which has been closed. Note that on-chain transactions
3680 * resolving the channel are likely still awaiting confirmation.
3682 struct LDKThirtyTwoBytes channel_id;
3684 * The `user_channel_id` value passed in to [`ChannelManager::create_channel`] for outbound
3685 * channels, or to [`ChannelManager::accept_inbound_channel`] for inbound channels if
3686 * [`UserConfig::manually_accept_inbound_channels`] config flag is set to true. Otherwise
3687 * `user_channel_id` will be 0 for an inbound channel.
3688 * This will always be zero for objects serialized with LDK versions prior to 0.0.102.
3690 * [`ChannelManager::create_channel`]: crate::ln::channelmanager::ChannelManager::create_channel
3691 * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
3692 * [`UserConfig::manually_accept_inbound_channels`]: crate::util::config::UserConfig::manually_accept_inbound_channels
3694 uint64_t user_channel_id;
3696 * The reason the channel was closed.
3698 struct LDKClosureReason reason;
3699 } LDKEvent_LDKChannelClosed_Body;
3701 typedef struct LDKEvent_LDKDiscardFunding_Body {
3703 * The channel_id of the channel which has been closed.
3705 struct LDKThirtyTwoBytes channel_id;
3707 * The full transaction received from the user
3709 struct LDKTransaction transaction;
3710 } LDKEvent_LDKDiscardFunding_Body;
3712 typedef struct LDKEvent_LDKOpenChannelRequest_Body {
3714 * The temporary channel ID of the channel requested to be opened.
3716 * When responding to the request, the `temporary_channel_id` should be passed
3717 * back to the ChannelManager through [`ChannelManager::accept_inbound_channel`] to accept,
3718 * or through [`ChannelManager::force_close_without_broadcasting_txn`] to reject.
3720 * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
3721 * [`ChannelManager::force_close_without_broadcasting_txn`]: crate::ln::channelmanager::ChannelManager::force_close_without_broadcasting_txn
3723 struct LDKThirtyTwoBytes temporary_channel_id;
3725 * The node_id of the counterparty requesting to open the channel.
3727 * When responding to the request, the `counterparty_node_id` should be passed
3728 * back to the `ChannelManager` through [`ChannelManager::accept_inbound_channel`] to
3729 * accept the request, or through [`ChannelManager::force_close_without_broadcasting_txn`] to reject the
3732 * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
3733 * [`ChannelManager::force_close_without_broadcasting_txn`]: crate::ln::channelmanager::ChannelManager::force_close_without_broadcasting_txn
3735 struct LDKPublicKey counterparty_node_id;
3737 * The channel value of the requested channel.
3739 uint64_t funding_satoshis;
3741 * Our starting balance in the channel if the request is accepted, in milli-satoshi.
3745 * The features that this channel will operate with. If you reject the channel, a
3746 * well-behaved counterparty may automatically re-attempt the channel with a new set of
3749 * Note that if [`ChannelTypeFeatures::supports_scid_privacy`] returns true on this type,
3750 * the resulting [`ChannelManager`] will not be readable by versions of LDK prior to
3753 * Furthermore, note that if [`ChannelTypeFeatures::supports_zero_conf`] returns true on this type,
3754 * the resulting [`ChannelManager`] will not be readable by versions of LDK prior to
3755 * 0.0.107. Channels setting this type also need to get manually accepted via
3756 * [`crate::ln::channelmanager::ChannelManager::accept_inbound_channel_from_trusted_peer_0conf`],
3757 * or will be rejected otherwise.
3759 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
3761 struct LDKChannelTypeFeatures channel_type;
3762 } LDKEvent_LDKOpenChannelRequest_Body;
3764 typedef struct LDKEvent_LDKHTLCHandlingFailed_Body {
3766 * The channel over which the HTLC was received.
3768 struct LDKThirtyTwoBytes prev_channel_id;
3770 * Destination of the HTLC that failed to be processed.
3772 struct LDKHTLCDestination failed_next_destination;
3773 } LDKEvent_LDKHTLCHandlingFailed_Body;
3775 typedef struct MUST_USE_STRUCT LDKEvent {
3778 LDKEvent_LDKFundingGenerationReady_Body funding_generation_ready;
3779 LDKEvent_LDKPaymentReceived_Body payment_received;
3780 LDKEvent_LDKPaymentClaimed_Body payment_claimed;
3781 LDKEvent_LDKPaymentSent_Body payment_sent;
3782 LDKEvent_LDKPaymentFailed_Body payment_failed;
3783 LDKEvent_LDKPaymentPathSuccessful_Body payment_path_successful;
3784 LDKEvent_LDKPaymentPathFailed_Body payment_path_failed;
3785 LDKEvent_LDKProbeSuccessful_Body probe_successful;
3786 LDKEvent_LDKProbeFailed_Body probe_failed;
3787 LDKEvent_LDKPendingHTLCsForwardable_Body pending_htl_cs_forwardable;
3788 LDKEvent_LDKSpendableOutputs_Body spendable_outputs;
3789 LDKEvent_LDKPaymentForwarded_Body payment_forwarded;
3790 LDKEvent_LDKChannelClosed_Body channel_closed;
3791 LDKEvent_LDKDiscardFunding_Body discard_funding;
3792 LDKEvent_LDKOpenChannelRequest_Body open_channel_request;
3793 LDKEvent_LDKHTLCHandlingFailed_Body htlc_handling_failed;
3798 * An enum which can either contain a crate::lightning::util::events::Event or not
3800 typedef enum LDKCOption_EventZ_Tag {
3802 * When we're in this state, this COption_EventZ contains a crate::lightning::util::events::Event
3804 LDKCOption_EventZ_Some,
3806 * When we're in this state, this COption_EventZ contains nothing
3808 LDKCOption_EventZ_None,
3810 * Must be last for serialization purposes
3812 LDKCOption_EventZ_Sentinel,
3813 } LDKCOption_EventZ_Tag;
3815 typedef struct LDKCOption_EventZ {
3816 LDKCOption_EventZ_Tag tag;
3819 struct LDKEvent some;
3822 } LDKCOption_EventZ;
3825 * The contents of CResult_COption_EventZDecodeErrorZ
3827 typedef union LDKCResult_COption_EventZDecodeErrorZPtr {
3829 * A pointer to the contents in the success state.
3830 * Reading from this pointer when `result_ok` is not set is undefined.
3832 struct LDKCOption_EventZ *result;
3834 * A pointer to the contents in the error state.
3835 * Reading from this pointer when `result_ok` is set is undefined.
3837 struct LDKDecodeError *err;
3838 } LDKCResult_COption_EventZDecodeErrorZPtr;
3841 * A CResult_COption_EventZDecodeErrorZ represents the result of a fallible operation,
3842 * containing a crate::c_types::derived::COption_EventZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
3843 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
3845 typedef struct LDKCResult_COption_EventZDecodeErrorZ {
3847 * The contents of this CResult_COption_EventZDecodeErrorZ, accessible via either
3848 * `err` or `result` depending on the state of `result_ok`.
3850 union LDKCResult_COption_EventZDecodeErrorZPtr contents;
3852 * Whether this CResult_COption_EventZDecodeErrorZ represents a success state.
3855 } LDKCResult_COption_EventZDecodeErrorZ;
3860 * An accept_channel message to be sent or received from a peer
3862 typedef struct MUST_USE_STRUCT LDKAcceptChannel {
3864 * A pointer to the opaque Rust object.
3865 * Nearly everywhere, inner must be non-null, however in places where
3866 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3868 LDKnativeAcceptChannel *inner;
3870 * Indicates that this is the only struct which contains the same pointer.
3871 * Rust functions which take ownership of an object provided via an argument require
3872 * this to be true and invalidate the object pointed to by inner.
3880 * An open_channel message to be sent or received from a peer
3882 typedef struct MUST_USE_STRUCT LDKOpenChannel {
3884 * A pointer to the opaque Rust object.
3885 * Nearly everywhere, inner must be non-null, however in places where
3886 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3888 LDKnativeOpenChannel *inner;
3890 * Indicates that this is the only struct which contains the same pointer.
3891 * Rust functions which take ownership of an object provided via an argument require
3892 * this to be true and invalidate the object pointed to by inner.
3900 * A funding_created message to be sent or received from a peer
3902 typedef struct MUST_USE_STRUCT LDKFundingCreated {
3904 * A pointer to the opaque Rust object.
3905 * Nearly everywhere, inner must be non-null, however in places where
3906 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3908 LDKnativeFundingCreated *inner;
3910 * Indicates that this is the only struct which contains the same pointer.
3911 * Rust functions which take ownership of an object provided via an argument require
3912 * this to be true and invalidate the object pointed to by inner.
3915 } LDKFundingCreated;
3920 * A funding_signed message to be sent or received from a peer
3922 typedef struct MUST_USE_STRUCT LDKFundingSigned {
3924 * A pointer to the opaque Rust object.
3925 * Nearly everywhere, inner must be non-null, however in places where
3926 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3928 LDKnativeFundingSigned *inner;
3930 * Indicates that this is the only struct which contains the same pointer.
3931 * Rust functions which take ownership of an object provided via an argument require
3932 * this to be true and invalidate the object pointed to by inner.
3940 * A channel_ready message to be sent or received from a peer
3942 typedef struct MUST_USE_STRUCT LDKChannelReady {
3944 * A pointer to the opaque Rust object.
3945 * Nearly everywhere, inner must be non-null, however in places where
3946 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3948 LDKnativeChannelReady *inner;
3950 * Indicates that this is the only struct which contains the same pointer.
3951 * Rust functions which take ownership of an object provided via an argument require
3952 * this to be true and invalidate the object pointed to by inner.
3960 * An announcement_signatures message to be sent or received from a peer
3962 typedef struct MUST_USE_STRUCT LDKAnnouncementSignatures {
3964 * A pointer to the opaque Rust object.
3965 * Nearly everywhere, inner must be non-null, however in places where
3966 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3968 LDKnativeAnnouncementSignatures *inner;
3970 * Indicates that this is the only struct which contains the same pointer.
3971 * Rust functions which take ownership of an object provided via an argument require
3972 * this to be true and invalidate the object pointed to by inner.
3975 } LDKAnnouncementSignatures;
3980 * Struct used to return values from revoke_and_ack messages, containing a bunch of commitment
3981 * transaction updates if they were pending.
3983 typedef struct MUST_USE_STRUCT LDKCommitmentUpdate {
3985 * A pointer to the opaque Rust object.
3986 * Nearly everywhere, inner must be non-null, however in places where
3987 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3989 LDKnativeCommitmentUpdate *inner;
3991 * Indicates that this is the only struct which contains the same pointer.
3992 * Rust functions which take ownership of an object provided via an argument require
3993 * this to be true and invalidate the object pointed to by inner.
3996 } LDKCommitmentUpdate;
4001 * A revoke_and_ack message to be sent or received from a peer
4003 typedef struct MUST_USE_STRUCT LDKRevokeAndACK {
4005 * A pointer to the opaque Rust object.
4006 * Nearly everywhere, inner must be non-null, however in places where
4007 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4009 LDKnativeRevokeAndACK *inner;
4011 * Indicates that this is the only struct which contains the same pointer.
4012 * Rust functions which take ownership of an object provided via an argument require
4013 * this to be true and invalidate the object pointed to by inner.
4021 * A closing_signed message to be sent or received from a peer
4023 typedef struct MUST_USE_STRUCT LDKClosingSigned {
4025 * A pointer to the opaque Rust object.
4026 * Nearly everywhere, inner must be non-null, however in places where
4027 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4029 LDKnativeClosingSigned *inner;
4031 * Indicates that this is the only struct which contains the same pointer.
4032 * Rust functions which take ownership of an object provided via an argument require
4033 * this to be true and invalidate the object pointed to by inner.
4041 * A shutdown message to be sent or received from a peer
4043 typedef struct MUST_USE_STRUCT LDKShutdown {
4045 * A pointer to the opaque Rust object.
4046 * Nearly everywhere, inner must be non-null, however in places where
4047 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4049 LDKnativeShutdown *inner;
4051 * Indicates that this is the only struct which contains the same pointer.
4052 * Rust functions which take ownership of an object provided via an argument require
4053 * this to be true and invalidate the object pointed to by inner.
4061 * A channel_reestablish message to be sent or received from a peer
4063 typedef struct MUST_USE_STRUCT LDKChannelReestablish {
4065 * A pointer to the opaque Rust object.
4066 * Nearly everywhere, inner must be non-null, however in places where
4067 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4069 LDKnativeChannelReestablish *inner;
4071 * Indicates that this is the only struct which contains the same pointer.
4072 * Rust functions which take ownership of an object provided via an argument require
4073 * this to be true and invalidate the object pointed to by inner.
4076 } LDKChannelReestablish;
4081 * A channel_announcement message to be sent or received from a peer
4083 typedef struct MUST_USE_STRUCT LDKChannelAnnouncement {
4085 * A pointer to the opaque Rust object.
4086 * Nearly everywhere, inner must be non-null, however in places where
4087 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4089 LDKnativeChannelAnnouncement *inner;
4091 * Indicates that this is the only struct which contains the same pointer.
4092 * Rust functions which take ownership of an object provided via an argument require
4093 * this to be true and invalidate the object pointed to by inner.
4096 } LDKChannelAnnouncement;
4101 * An error message to be sent or received from a peer
4103 typedef struct MUST_USE_STRUCT LDKErrorMessage {
4105 * A pointer to the opaque Rust object.
4106 * Nearly everywhere, inner must be non-null, however in places where
4107 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4109 LDKnativeErrorMessage *inner;
4111 * Indicates that this is the only struct which contains the same pointer.
4112 * Rust functions which take ownership of an object provided via an argument require
4113 * this to be true and invalidate the object pointed to by inner.
4121 * A warning message to be sent or received from a peer
4123 typedef struct MUST_USE_STRUCT LDKWarningMessage {
4125 * A pointer to the opaque Rust object.
4126 * Nearly everywhere, inner must be non-null, however in places where
4127 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4129 LDKnativeWarningMessage *inner;
4131 * Indicates that this is the only struct which contains the same pointer.
4132 * Rust functions which take ownership of an object provided via an argument require
4133 * this to be true and invalidate the object pointed to by inner.
4136 } LDKWarningMessage;
4139 * Used to put an error message in a LightningError
4141 typedef enum LDKErrorAction_Tag {
4143 * The peer took some action which made us think they were useless. Disconnect them.
4145 LDKErrorAction_DisconnectPeer,
4147 * The peer did something harmless that we weren't able to process, just log and ignore
4149 LDKErrorAction_IgnoreError,
4151 * The peer did something harmless that we weren't able to meaningfully process.
4152 * If the error is logged, log it at the given level.
4154 LDKErrorAction_IgnoreAndLog,
4156 * The peer provided us with a gossip message which we'd already seen. In most cases this
4157 * should be ignored, but it may result in the message being forwarded if it is a duplicate of
4158 * our own channel announcements.
4160 LDKErrorAction_IgnoreDuplicateGossip,
4162 * The peer did something incorrect. Tell them.
4164 LDKErrorAction_SendErrorMessage,
4166 * The peer did something incorrect. Tell them without closing any channels.
4168 LDKErrorAction_SendWarningMessage,
4170 * Must be last for serialization purposes
4172 LDKErrorAction_Sentinel,
4173 } LDKErrorAction_Tag;
4175 typedef struct LDKErrorAction_LDKDisconnectPeer_Body {
4177 * An error message which we should make an effort to send before we disconnect.
4179 * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
4181 struct LDKErrorMessage msg;
4182 } LDKErrorAction_LDKDisconnectPeer_Body;
4184 typedef struct LDKErrorAction_LDKSendErrorMessage_Body {
4186 * The message to send.
4188 struct LDKErrorMessage msg;
4189 } LDKErrorAction_LDKSendErrorMessage_Body;
4191 typedef struct LDKErrorAction_LDKSendWarningMessage_Body {
4193 * The message to send.
4195 struct LDKWarningMessage msg;
4197 * The peer may have done something harmless that we weren't able to meaningfully process,
4198 * though we should still tell them about it.
4199 * If this event is logged, log it at the given level.
4201 enum LDKLevel log_level;
4202 } LDKErrorAction_LDKSendWarningMessage_Body;
4204 typedef struct MUST_USE_STRUCT LDKErrorAction {
4205 LDKErrorAction_Tag tag;
4207 LDKErrorAction_LDKDisconnectPeer_Body disconnect_peer;
4209 enum LDKLevel ignore_and_log;
4211 LDKErrorAction_LDKSendErrorMessage_Body send_error_message;
4212 LDKErrorAction_LDKSendWarningMessage_Body send_warning_message;
4219 * A query_channel_range message is used to query a peer for channel
4220 * UTXOs in a range of blocks. The recipient of a query makes a best
4221 * effort to reply to the query using one or more reply_channel_range
4224 typedef struct MUST_USE_STRUCT LDKQueryChannelRange {
4226 * A pointer to the opaque Rust object.
4227 * Nearly everywhere, inner must be non-null, however in places where
4228 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4230 LDKnativeQueryChannelRange *inner;
4232 * Indicates that this is the only struct which contains the same pointer.
4233 * Rust functions which take ownership of an object provided via an argument require
4234 * this to be true and invalidate the object pointed to by inner.
4237 } LDKQueryChannelRange;
4242 * A query_short_channel_ids message is used to query a peer for
4243 * routing gossip messages related to one or more short_channel_ids.
4244 * The query recipient will reply with the latest, if available,
4245 * channel_announcement, channel_update and node_announcement messages
4246 * it maintains for the requested short_channel_ids followed by a
4247 * reply_short_channel_ids_end message. The short_channel_ids sent in
4248 * this query are encoded. We only support encoding_type=0 uncompressed
4249 * serialization and do not support encoding_type=1 zlib serialization.
4251 typedef struct MUST_USE_STRUCT LDKQueryShortChannelIds {
4253 * A pointer to the opaque Rust object.
4254 * Nearly everywhere, inner must be non-null, however in places where
4255 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4257 LDKnativeQueryShortChannelIds *inner;
4259 * Indicates that this is the only struct which contains the same pointer.
4260 * Rust functions which take ownership of an object provided via an argument require
4261 * this to be true and invalidate the object pointed to by inner.
4264 } LDKQueryShortChannelIds;
4269 * A reply_channel_range message is a reply to a query_channel_range
4270 * message. Multiple reply_channel_range messages can be sent in reply
4271 * to a single query_channel_range message. The query recipient makes a
4272 * best effort to respond based on their local network view which may
4273 * not be a perfect view of the network. The short_channel_ids in the
4274 * reply are encoded. We only support encoding_type=0 uncompressed
4275 * serialization and do not support encoding_type=1 zlib serialization.
4277 typedef struct MUST_USE_STRUCT LDKReplyChannelRange {
4279 * A pointer to the opaque Rust object.
4280 * Nearly everywhere, inner must be non-null, however in places where
4281 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4283 LDKnativeReplyChannelRange *inner;
4285 * Indicates that this is the only struct which contains the same pointer.
4286 * Rust functions which take ownership of an object provided via an argument require
4287 * this to be true and invalidate the object pointed to by inner.
4290 } LDKReplyChannelRange;
4295 * A gossip_timestamp_filter message is used by a node to request
4296 * gossip relay for messages in the requested time range when the
4297 * gossip_queries feature has been negotiated.
4299 typedef struct MUST_USE_STRUCT LDKGossipTimestampFilter {
4301 * A pointer to the opaque Rust object.
4302 * Nearly everywhere, inner must be non-null, however in places where
4303 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4305 LDKnativeGossipTimestampFilter *inner;
4307 * Indicates that this is the only struct which contains the same pointer.
4308 * Rust functions which take ownership of an object provided via an argument require
4309 * this to be true and invalidate the object pointed to by inner.
4312 } LDKGossipTimestampFilter;
4315 * An event generated by ChannelManager which indicates a message should be sent to a peer (or
4316 * broadcast to most peers).
4317 * These events are handled by PeerManager::process_events if you are using a PeerManager.
4319 typedef enum LDKMessageSendEvent_Tag {
4321 * Used to indicate that we've accepted a channel open and should send the accept_channel
4322 * message provided to the given peer.
4324 LDKMessageSendEvent_SendAcceptChannel,
4326 * Used to indicate that we've initiated a channel open and should send the open_channel
4327 * message provided to the given peer.
4329 LDKMessageSendEvent_SendOpenChannel,
4331 * Used to indicate that a funding_created message should be sent to the peer with the given node_id.
4333 LDKMessageSendEvent_SendFundingCreated,
4335 * Used to indicate that a funding_signed message should be sent to the peer with the given node_id.
4337 LDKMessageSendEvent_SendFundingSigned,
4339 * Used to indicate that a channel_ready message should be sent to the peer with the given node_id.
4341 LDKMessageSendEvent_SendChannelReady,
4343 * Used to indicate that an announcement_signatures message should be sent to the peer with the given node_id.
4345 LDKMessageSendEvent_SendAnnouncementSignatures,
4347 * Used to indicate that a series of HTLC update messages, as well as a commitment_signed
4348 * message should be sent to the peer with the given node_id.
4350 LDKMessageSendEvent_UpdateHTLCs,
4352 * Used to indicate that a revoke_and_ack message should be sent to the peer with the given node_id.
4354 LDKMessageSendEvent_SendRevokeAndACK,
4356 * Used to indicate that a closing_signed message should be sent to the peer with the given node_id.
4358 LDKMessageSendEvent_SendClosingSigned,
4360 * Used to indicate that a shutdown message should be sent to the peer with the given node_id.
4362 LDKMessageSendEvent_SendShutdown,
4364 * Used to indicate that a channel_reestablish message should be sent to the peer with the given node_id.
4366 LDKMessageSendEvent_SendChannelReestablish,
4368 * Used to send a channel_announcement and channel_update to a specific peer, likely on
4369 * initial connection to ensure our peers know about our channels.
4371 LDKMessageSendEvent_SendChannelAnnouncement,
4373 * Used to indicate that a channel_announcement and channel_update should be broadcast to all
4374 * peers (except the peer with node_id either msg.contents.node_id_1 or msg.contents.node_id_2).
4376 * Note that after doing so, you very likely (unless you did so very recently) want to
4377 * broadcast a node_announcement (e.g. via [`PeerManager::broadcast_node_announcement`]). This
4378 * ensures that any nodes which see our channel_announcement also have a relevant
4379 * node_announcement, including relevant feature flags which may be important for routing
4382 * [`PeerManager::broadcast_node_announcement`]: crate::ln::peer_handler::PeerManager::broadcast_node_announcement
4384 LDKMessageSendEvent_BroadcastChannelAnnouncement,
4386 * Used to indicate that a channel_update should be broadcast to all peers.
4388 LDKMessageSendEvent_BroadcastChannelUpdate,
4390 * Used to indicate that a channel_update should be sent to a single peer.
4391 * In contrast to [`Self::BroadcastChannelUpdate`], this is used when the channel is a
4392 * private channel and we shouldn't be informing all of our peers of channel parameters.
4394 LDKMessageSendEvent_SendChannelUpdate,
4396 * Broadcast an error downstream to be handled
4398 LDKMessageSendEvent_HandleError,
4400 * Query a peer for channels with funding transaction UTXOs in a block range.
4402 LDKMessageSendEvent_SendChannelRangeQuery,
4404 * Request routing gossip messages from a peer for a list of channels identified by
4405 * their short_channel_ids.
4407 LDKMessageSendEvent_SendShortIdsQuery,
4409 * Sends a reply to a channel range query. This may be one of several SendReplyChannelRange events
4410 * emitted during processing of the query.
4412 LDKMessageSendEvent_SendReplyChannelRange,
4414 * Sends a timestamp filter for inbound gossip. This should be sent on each new connection to
4415 * enable receiving gossip messages from the peer.
4417 LDKMessageSendEvent_SendGossipTimestampFilter,
4419 * Must be last for serialization purposes
4421 LDKMessageSendEvent_Sentinel,
4422 } LDKMessageSendEvent_Tag;
4424 typedef struct LDKMessageSendEvent_LDKSendAcceptChannel_Body {
4426 * The node_id of the node which should receive this message
4428 struct LDKPublicKey node_id;
4430 * The message which should be sent.
4432 struct LDKAcceptChannel msg;
4433 } LDKMessageSendEvent_LDKSendAcceptChannel_Body;
4435 typedef struct LDKMessageSendEvent_LDKSendOpenChannel_Body {
4437 * The node_id of the node which should receive this message
4439 struct LDKPublicKey node_id;
4441 * The message which should be sent.
4443 struct LDKOpenChannel msg;
4444 } LDKMessageSendEvent_LDKSendOpenChannel_Body;
4446 typedef struct LDKMessageSendEvent_LDKSendFundingCreated_Body {
4448 * The node_id of the node which should receive this message
4450 struct LDKPublicKey node_id;
4452 * The message which should be sent.
4454 struct LDKFundingCreated msg;
4455 } LDKMessageSendEvent_LDKSendFundingCreated_Body;
4457 typedef struct LDKMessageSendEvent_LDKSendFundingSigned_Body {
4459 * The node_id of the node which should receive this message
4461 struct LDKPublicKey node_id;
4463 * The message which should be sent.
4465 struct LDKFundingSigned msg;
4466 } LDKMessageSendEvent_LDKSendFundingSigned_Body;
4468 typedef struct LDKMessageSendEvent_LDKSendChannelReady_Body {
4470 * The node_id of the node which should receive these message(s)
4472 struct LDKPublicKey node_id;
4474 * The channel_ready message which should be sent.
4476 struct LDKChannelReady msg;
4477 } LDKMessageSendEvent_LDKSendChannelReady_Body;
4479 typedef struct LDKMessageSendEvent_LDKSendAnnouncementSignatures_Body {
4481 * The node_id of the node which should receive these message(s)
4483 struct LDKPublicKey node_id;
4485 * The announcement_signatures message which should be sent.
4487 struct LDKAnnouncementSignatures msg;
4488 } LDKMessageSendEvent_LDKSendAnnouncementSignatures_Body;
4490 typedef struct LDKMessageSendEvent_LDKUpdateHTLCs_Body {
4492 * The node_id of the node which should receive these message(s)
4494 struct LDKPublicKey node_id;
4496 * The update messages which should be sent. ALL messages in the struct should be sent!
4498 struct LDKCommitmentUpdate updates;
4499 } LDKMessageSendEvent_LDKUpdateHTLCs_Body;
4501 typedef struct LDKMessageSendEvent_LDKSendRevokeAndACK_Body {
4503 * The node_id of the node which should receive this message
4505 struct LDKPublicKey node_id;
4507 * The message which should be sent.
4509 struct LDKRevokeAndACK msg;
4510 } LDKMessageSendEvent_LDKSendRevokeAndACK_Body;
4512 typedef struct LDKMessageSendEvent_LDKSendClosingSigned_Body {
4514 * The node_id of the node which should receive this message
4516 struct LDKPublicKey node_id;
4518 * The message which should be sent.
4520 struct LDKClosingSigned msg;
4521 } LDKMessageSendEvent_LDKSendClosingSigned_Body;
4523 typedef struct LDKMessageSendEvent_LDKSendShutdown_Body {
4525 * The node_id of the node which should receive this message
4527 struct LDKPublicKey node_id;
4529 * The message which should be sent.
4531 struct LDKShutdown msg;
4532 } LDKMessageSendEvent_LDKSendShutdown_Body;
4534 typedef struct LDKMessageSendEvent_LDKSendChannelReestablish_Body {
4536 * The node_id of the node which should receive this message
4538 struct LDKPublicKey node_id;
4540 * The message which should be sent.
4542 struct LDKChannelReestablish msg;
4543 } LDKMessageSendEvent_LDKSendChannelReestablish_Body;
4545 typedef struct LDKMessageSendEvent_LDKSendChannelAnnouncement_Body {
4547 * The node_id of the node which should receive this message
4549 struct LDKPublicKey node_id;
4551 * The channel_announcement which should be sent.
4553 struct LDKChannelAnnouncement msg;
4555 * The followup channel_update which should be sent.
4557 struct LDKChannelUpdate update_msg;
4558 } LDKMessageSendEvent_LDKSendChannelAnnouncement_Body;
4560 typedef struct LDKMessageSendEvent_LDKBroadcastChannelAnnouncement_Body {
4562 * The channel_announcement which should be sent.
4564 struct LDKChannelAnnouncement msg;
4566 * The followup channel_update which should be sent.
4568 struct LDKChannelUpdate update_msg;
4569 } LDKMessageSendEvent_LDKBroadcastChannelAnnouncement_Body;
4571 typedef struct LDKMessageSendEvent_LDKBroadcastChannelUpdate_Body {
4573 * The channel_update which should be sent.
4575 struct LDKChannelUpdate msg;
4576 } LDKMessageSendEvent_LDKBroadcastChannelUpdate_Body;
4578 typedef struct LDKMessageSendEvent_LDKSendChannelUpdate_Body {
4580 * The node_id of the node which should receive this message
4582 struct LDKPublicKey node_id;
4584 * The channel_update which should be sent.
4586 struct LDKChannelUpdate msg;
4587 } LDKMessageSendEvent_LDKSendChannelUpdate_Body;
4589 typedef struct LDKMessageSendEvent_LDKHandleError_Body {
4591 * The node_id of the node which should receive this message
4593 struct LDKPublicKey node_id;
4595 * The action which should be taken.
4597 struct LDKErrorAction action;
4598 } LDKMessageSendEvent_LDKHandleError_Body;
4600 typedef struct LDKMessageSendEvent_LDKSendChannelRangeQuery_Body {
4602 * The node_id of this message recipient
4604 struct LDKPublicKey node_id;
4606 * The query_channel_range which should be sent.
4608 struct LDKQueryChannelRange msg;
4609 } LDKMessageSendEvent_LDKSendChannelRangeQuery_Body;
4611 typedef struct LDKMessageSendEvent_LDKSendShortIdsQuery_Body {
4613 * The node_id of this message recipient
4615 struct LDKPublicKey node_id;
4617 * The query_short_channel_ids which should be sent.
4619 struct LDKQueryShortChannelIds msg;
4620 } LDKMessageSendEvent_LDKSendShortIdsQuery_Body;
4622 typedef struct LDKMessageSendEvent_LDKSendReplyChannelRange_Body {
4624 * The node_id of this message recipient
4626 struct LDKPublicKey node_id;
4628 * The reply_channel_range which should be sent.
4630 struct LDKReplyChannelRange msg;
4631 } LDKMessageSendEvent_LDKSendReplyChannelRange_Body;
4633 typedef struct LDKMessageSendEvent_LDKSendGossipTimestampFilter_Body {
4635 * The node_id of this message recipient
4637 struct LDKPublicKey node_id;
4639 * The gossip_timestamp_filter which should be sent.
4641 struct LDKGossipTimestampFilter msg;
4642 } LDKMessageSendEvent_LDKSendGossipTimestampFilter_Body;
4644 typedef struct MUST_USE_STRUCT LDKMessageSendEvent {
4645 LDKMessageSendEvent_Tag tag;
4647 LDKMessageSendEvent_LDKSendAcceptChannel_Body send_accept_channel;
4648 LDKMessageSendEvent_LDKSendOpenChannel_Body send_open_channel;
4649 LDKMessageSendEvent_LDKSendFundingCreated_Body send_funding_created;
4650 LDKMessageSendEvent_LDKSendFundingSigned_Body send_funding_signed;
4651 LDKMessageSendEvent_LDKSendChannelReady_Body send_channel_ready;
4652 LDKMessageSendEvent_LDKSendAnnouncementSignatures_Body send_announcement_signatures;
4653 LDKMessageSendEvent_LDKUpdateHTLCs_Body update_htl_cs;
4654 LDKMessageSendEvent_LDKSendRevokeAndACK_Body send_revoke_and_ack;
4655 LDKMessageSendEvent_LDKSendClosingSigned_Body send_closing_signed;
4656 LDKMessageSendEvent_LDKSendShutdown_Body send_shutdown;
4657 LDKMessageSendEvent_LDKSendChannelReestablish_Body send_channel_reestablish;
4658 LDKMessageSendEvent_LDKSendChannelAnnouncement_Body send_channel_announcement;
4659 LDKMessageSendEvent_LDKBroadcastChannelAnnouncement_Body broadcast_channel_announcement;
4660 LDKMessageSendEvent_LDKBroadcastChannelUpdate_Body broadcast_channel_update;
4661 LDKMessageSendEvent_LDKSendChannelUpdate_Body send_channel_update;
4662 LDKMessageSendEvent_LDKHandleError_Body handle_error;
4663 LDKMessageSendEvent_LDKSendChannelRangeQuery_Body send_channel_range_query;
4664 LDKMessageSendEvent_LDKSendShortIdsQuery_Body send_short_ids_query;
4665 LDKMessageSendEvent_LDKSendReplyChannelRange_Body send_reply_channel_range;
4666 LDKMessageSendEvent_LDKSendGossipTimestampFilter_Body send_gossip_timestamp_filter;
4668 } LDKMessageSendEvent;
4671 * A dynamically-allocated array of crate::lightning::util::events::MessageSendEvents of arbitrary size.
4672 * This corresponds to std::vector in C++
4674 typedef struct LDKCVec_MessageSendEventZ {
4676 * The elements in the array.
4677 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
4679 struct LDKMessageSendEvent *data;
4681 * The number of elements pointed to by `data`.
4684 } LDKCVec_MessageSendEventZ;
4687 * The contents of CResult_TxOutAccessErrorZ
4689 typedef union LDKCResult_TxOutAccessErrorZPtr {
4691 * A pointer to the contents in the success state.
4692 * Reading from this pointer when `result_ok` is not set is undefined.
4694 struct LDKTxOut *result;
4696 * A pointer to the contents in the error state.
4697 * Reading from this pointer when `result_ok` is set is undefined.
4699 enum LDKAccessError *err;
4700 } LDKCResult_TxOutAccessErrorZPtr;
4703 * A CResult_TxOutAccessErrorZ represents the result of a fallible operation,
4704 * containing a crate::c_types::TxOut on success and a crate::lightning::chain::AccessError on failure.
4705 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4707 typedef struct LDKCResult_TxOutAccessErrorZ {
4709 * The contents of this CResult_TxOutAccessErrorZ, accessible via either
4710 * `err` or `result` depending on the state of `result_ok`.
4712 union LDKCResult_TxOutAccessErrorZPtr contents;
4714 * Whether this CResult_TxOutAccessErrorZ represents a success state.
4717 } LDKCResult_TxOutAccessErrorZ;
4720 * A tuple of 2 elements. See the individual fields for the types contained.
4722 typedef struct LDKC2Tuple_usizeTransactionZ {
4724 * The element at position 0
4728 * The element at position 1
4730 struct LDKTransaction b;
4731 } LDKC2Tuple_usizeTransactionZ;
4734 * A dynamically-allocated array of crate::c_types::derived::C2Tuple_usizeTransactionZs of arbitrary size.
4735 * This corresponds to std::vector in C++
4737 typedef struct LDKCVec_C2Tuple_usizeTransactionZZ {
4739 * The elements in the array.
4740 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
4742 struct LDKC2Tuple_usizeTransactionZ *data;
4744 * The number of elements pointed to by `data`.
4747 } LDKCVec_C2Tuple_usizeTransactionZZ;
4750 * A dynamically-allocated array of crate::c_types::ThirtyTwoBytess of arbitrary size.
4751 * This corresponds to std::vector in C++
4753 typedef struct LDKCVec_TxidZ {
4755 * The elements in the array.
4756 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
4758 struct LDKThirtyTwoBytes *data;
4760 * The number of elements pointed to by `data`.
4768 * Simple structure sent back by `chain::Watch` when an HTLC from a forward channel is detected on
4769 * chain. Used to update the corresponding HTLC in the backward channel. Failing to pass the
4770 * preimage claim backward will lead to loss of funds.
4772 typedef struct MUST_USE_STRUCT LDKHTLCUpdate {
4774 * A pointer to the opaque Rust object.
4775 * Nearly everywhere, inner must be non-null, however in places where
4776 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4778 LDKnativeHTLCUpdate *inner;
4780 * Indicates that this is the only struct which contains the same pointer.
4781 * Rust functions which take ownership of an object provided via an argument require
4782 * this to be true and invalidate the object pointed to by inner.
4788 * An event to be processed by the ChannelManager.
4790 typedef enum LDKMonitorEvent_Tag {
4792 * A monitor event containing an HTLCUpdate.
4794 LDKMonitorEvent_HTLCEvent,
4796 * A monitor event that the Channel's commitment transaction was confirmed.
4798 LDKMonitorEvent_CommitmentTxConfirmed,
4800 * Indicates a [`ChannelMonitor`] update has completed. See
4801 * [`ChannelMonitorUpdateStatus::InProgress`] for more information on how this is used.
4803 * [`ChannelMonitorUpdateStatus::InProgress`]: super::ChannelMonitorUpdateStatus::InProgress
4805 LDKMonitorEvent_Completed,
4807 * Indicates a [`ChannelMonitor`] update has failed. See
4808 * [`ChannelMonitorUpdateStatus::PermanentFailure`] for more information on how this is used.
4810 * [`ChannelMonitorUpdateStatus::PermanentFailure`]: super::ChannelMonitorUpdateStatus::PermanentFailure
4812 LDKMonitorEvent_UpdateFailed,
4814 * Must be last for serialization purposes
4816 LDKMonitorEvent_Sentinel,
4817 } LDKMonitorEvent_Tag;
4819 typedef struct LDKMonitorEvent_LDKCompleted_Body {
4821 * The funding outpoint of the [`ChannelMonitor`] that was updated
4823 struct LDKOutPoint funding_txo;
4825 * The Update ID from [`ChannelMonitorUpdate::update_id`] which was applied or
4826 * [`ChannelMonitor::get_latest_update_id`].
4828 * Note that this should only be set to a given update's ID if all previous updates for the
4829 * same [`ChannelMonitor`] have been applied and persisted.
4831 uint64_t monitor_update_id;
4832 } LDKMonitorEvent_LDKCompleted_Body;
4834 typedef struct MUST_USE_STRUCT LDKMonitorEvent {
4835 LDKMonitorEvent_Tag tag;
4838 struct LDKHTLCUpdate htlc_event;
4841 struct LDKOutPoint commitment_tx_confirmed;
4843 LDKMonitorEvent_LDKCompleted_Body completed;
4845 struct LDKOutPoint update_failed;
4851 * A dynamically-allocated array of crate::lightning::chain::channelmonitor::MonitorEvents of arbitrary size.
4852 * This corresponds to std::vector in C++
4854 typedef struct LDKCVec_MonitorEventZ {
4856 * The elements in the array.
4857 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
4859 struct LDKMonitorEvent *data;
4861 * The number of elements pointed to by `data`.
4864 } LDKCVec_MonitorEventZ;
4867 * A tuple of 3 elements. See the individual fields for the types contained.
4869 typedef struct LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ {
4871 * The element at position 0
4873 struct LDKOutPoint a;
4875 * The element at position 1
4877 struct LDKCVec_MonitorEventZ b;
4879 * The element at position 2
4881 struct LDKPublicKey c;
4882 } LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ;
4885 * A dynamically-allocated array of crate::c_types::derived::C3Tuple_OutPointCVec_MonitorEventZPublicKeyZs of arbitrary size.
4886 * This corresponds to std::vector in C++
4888 typedef struct LDKCVec_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZZ {
4890 * The elements in the array.
4891 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
4893 struct LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ *data;
4895 * The number of elements pointed to by `data`.
4898 } LDKCVec_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZZ;
4903 * [`Score`] implementation that uses a fixed penalty.
4905 typedef struct MUST_USE_STRUCT LDKFixedPenaltyScorer {
4907 * A pointer to the opaque Rust object.
4908 * Nearly everywhere, inner must be non-null, however in places where
4909 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4911 LDKnativeFixedPenaltyScorer *inner;
4913 * Indicates that this is the only struct which contains the same pointer.
4914 * Rust functions which take ownership of an object provided via an argument require
4915 * this to be true and invalidate the object pointed to by inner.
4918 } LDKFixedPenaltyScorer;
4921 * The contents of CResult_FixedPenaltyScorerDecodeErrorZ
4923 typedef union LDKCResult_FixedPenaltyScorerDecodeErrorZPtr {
4925 * A pointer to the contents in the success state.
4926 * Reading from this pointer when `result_ok` is not set is undefined.
4928 struct LDKFixedPenaltyScorer *result;
4930 * A pointer to the contents in the error state.
4931 * Reading from this pointer when `result_ok` is set is undefined.
4933 struct LDKDecodeError *err;
4934 } LDKCResult_FixedPenaltyScorerDecodeErrorZPtr;
4937 * A CResult_FixedPenaltyScorerDecodeErrorZ represents the result of a fallible operation,
4938 * containing a crate::lightning::routing::scoring::FixedPenaltyScorer on success and a crate::lightning::ln::msgs::DecodeError on failure.
4939 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4941 typedef struct LDKCResult_FixedPenaltyScorerDecodeErrorZ {
4943 * The contents of this CResult_FixedPenaltyScorerDecodeErrorZ, accessible via either
4944 * `err` or `result` depending on the state of `result_ok`.
4946 union LDKCResult_FixedPenaltyScorerDecodeErrorZPtr contents;
4948 * Whether this CResult_FixedPenaltyScorerDecodeErrorZ represents a success state.
4951 } LDKCResult_FixedPenaltyScorerDecodeErrorZ;
4954 * A tuple of 2 elements. See the individual fields for the types contained.
4956 typedef struct LDKC2Tuple_u64u64Z {
4958 * The element at position 0
4962 * The element at position 1
4965 } LDKC2Tuple_u64u64Z;
4968 * An enum which can either contain a crate::c_types::derived::C2Tuple_u64u64Z or not
4970 typedef enum LDKCOption_C2Tuple_u64u64ZZ_Tag {
4972 * When we're in this state, this COption_C2Tuple_u64u64ZZ contains a crate::c_types::derived::C2Tuple_u64u64Z
4974 LDKCOption_C2Tuple_u64u64ZZ_Some,
4976 * When we're in this state, this COption_C2Tuple_u64u64ZZ contains nothing
4978 LDKCOption_C2Tuple_u64u64ZZ_None,
4980 * Must be last for serialization purposes
4982 LDKCOption_C2Tuple_u64u64ZZ_Sentinel,
4983 } LDKCOption_C2Tuple_u64u64ZZ_Tag;
4985 typedef struct LDKCOption_C2Tuple_u64u64ZZ {
4986 LDKCOption_C2Tuple_u64u64ZZ_Tag tag;
4989 struct LDKC2Tuple_u64u64Z some;
4992 } LDKCOption_C2Tuple_u64u64ZZ;
4995 * A dynamically-allocated array of crate::lightning::routing::gossip::NodeIds of arbitrary size.
4996 * This corresponds to std::vector in C++
4998 typedef struct LDKCVec_NodeIdZ {
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 LDKNodeId *data;
5005 * The number of elements pointed to by `data`.
5013 * A Record, unit of logging output with Metadata to enable filtering
5014 * Module_path, file, line to inform on log's source
5016 typedef struct MUST_USE_STRUCT LDKRecord {
5018 * A pointer to the opaque Rust object.
5019 * Nearly everywhere, inner must be non-null, however in places where
5020 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5022 LDKnativeRecord *inner;
5024 * Indicates that this is the only struct which contains the same pointer.
5025 * Rust functions which take ownership of an object provided via an argument require
5026 * this to be true and invalidate the object pointed to by inner.
5032 * A trait encapsulating the operations required of a logger
5034 typedef struct LDKLogger {
5036 * An opaque pointer which is passed to your function implementations as an argument.
5037 * This has no meaning in the LDK, and can be NULL or any other value.
5043 void (*log)(const void *this_arg, const struct LDKRecord *NONNULL_PTR record);
5045 * Frees any resources associated with this object given its this_arg pointer.
5046 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
5048 void (*free)(void *this_arg);
5054 * Represents the network as nodes and channels between them
5056 typedef struct MUST_USE_STRUCT LDKNetworkGraph {
5058 * A pointer to the opaque Rust object.
5059 * Nearly everywhere, inner must be non-null, however in places where
5060 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5062 LDKnativeNetworkGraph *inner;
5064 * Indicates that this is the only struct which contains the same pointer.
5065 * Rust functions which take ownership of an object provided via an argument require
5066 * this to be true and invalidate the object pointed to by inner.
5074 * [`Score`] implementation using channel success probability distributions.
5076 * Channels are tracked with upper and lower liquidity bounds - when an HTLC fails at a channel,
5077 * we learn that the upper-bound on the available liquidity is lower than the amount of the HTLC.
5078 * When a payment is forwarded through a channel (but fails later in the route), we learn the
5079 * lower-bound on the channel's available liquidity must be at least the value of the HTLC.
5081 * These bounds are then used to determine a success probability using the formula from
5082 * *Optimally Reliable & Cheap Payment Flows on the Lightning Network* by Rene Pickhardt
5083 * and Stefan Richter [[1]] (i.e. `(upper_bound - payment_amount) / (upper_bound - lower_bound)`).
5085 * This probability is combined with the [`liquidity_penalty_multiplier_msat`] and
5086 * [`liquidity_penalty_amount_multiplier_msat`] parameters to calculate a concrete penalty in
5087 * milli-satoshis. The penalties, when added across all hops, have the property of being linear in
5088 * terms of the entire path's success probability. This allows the router to directly compare
5089 * penalties for different paths. See the documentation of those parameters for the exact formulas.
5091 * The liquidity bounds are decayed by halving them every [`liquidity_offset_half_life`].
5093 * Further, we track the history of our upper and lower liquidity bounds for each channel,
5094 * allowing us to assign a second penalty (using [`historical_liquidity_penalty_multiplier_msat`]
5095 * and [`historical_liquidity_penalty_amount_multiplier_msat`]) based on the same probability
5096 * formula, but using the history of a channel rather than our latest estimates for the liquidity
5101 * Mixing the `no-std` feature between serialization and deserialization results in undefined
5104 * [1]: https://arxiv.org/abs/2107.05322
5105 * [`liquidity_penalty_multiplier_msat`]: ProbabilisticScoringParameters::liquidity_penalty_multiplier_msat
5106 * [`liquidity_penalty_amount_multiplier_msat`]: ProbabilisticScoringParameters::liquidity_penalty_amount_multiplier_msat
5107 * [`liquidity_offset_half_life`]: ProbabilisticScoringParameters::liquidity_offset_half_life
5108 * [`historical_liquidity_penalty_multiplier_msat`]: ProbabilisticScoringParameters::historical_liquidity_penalty_multiplier_msat
5109 * [`historical_liquidity_penalty_amount_multiplier_msat`]: ProbabilisticScoringParameters::historical_liquidity_penalty_amount_multiplier_msat
5111 typedef struct MUST_USE_STRUCT LDKProbabilisticScorer {
5113 * A pointer to the opaque Rust object.
5114 * Nearly everywhere, inner must be non-null, however in places where
5115 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5117 LDKnativeProbabilisticScorer *inner;
5119 * Indicates that this is the only struct which contains the same pointer.
5120 * Rust functions which take ownership of an object provided via an argument require
5121 * this to be true and invalidate the object pointed to by inner.
5124 } LDKProbabilisticScorer;
5127 * The contents of CResult_ProbabilisticScorerDecodeErrorZ
5129 typedef union LDKCResult_ProbabilisticScorerDecodeErrorZPtr {
5131 * A pointer to the contents in the success state.
5132 * Reading from this pointer when `result_ok` is not set is undefined.
5134 struct LDKProbabilisticScorer *result;
5136 * A pointer to the contents in the error state.
5137 * Reading from this pointer when `result_ok` is set is undefined.
5139 struct LDKDecodeError *err;
5140 } LDKCResult_ProbabilisticScorerDecodeErrorZPtr;
5143 * A CResult_ProbabilisticScorerDecodeErrorZ represents the result of a fallible operation,
5144 * containing a crate::lightning::routing::scoring::ProbabilisticScorer on success and a crate::lightning::ln::msgs::DecodeError on failure.
5145 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5147 typedef struct LDKCResult_ProbabilisticScorerDecodeErrorZ {
5149 * The contents of this CResult_ProbabilisticScorerDecodeErrorZ, accessible via either
5150 * `err` or `result` depending on the state of `result_ok`.
5152 union LDKCResult_ProbabilisticScorerDecodeErrorZPtr contents;
5154 * Whether this CResult_ProbabilisticScorerDecodeErrorZ represents a success state.
5157 } LDKCResult_ProbabilisticScorerDecodeErrorZ;
5162 * Features used within an `init` message.
5164 typedef struct MUST_USE_STRUCT LDKInitFeatures {
5166 * A pointer to the opaque Rust object.
5167 * Nearly everywhere, inner must be non-null, however in places where
5168 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5170 LDKnativeInitFeatures *inner;
5172 * Indicates that this is the only struct which contains the same pointer.
5173 * Rust functions which take ownership of an object provided via an argument require
5174 * this to be true and invalidate the object pointed to by inner.
5180 * The contents of CResult_InitFeaturesDecodeErrorZ
5182 typedef union LDKCResult_InitFeaturesDecodeErrorZPtr {
5184 * A pointer to the contents in the success state.
5185 * Reading from this pointer when `result_ok` is not set is undefined.
5187 struct LDKInitFeatures *result;
5189 * A pointer to the contents in the error state.
5190 * Reading from this pointer when `result_ok` is set is undefined.
5192 struct LDKDecodeError *err;
5193 } LDKCResult_InitFeaturesDecodeErrorZPtr;
5196 * A CResult_InitFeaturesDecodeErrorZ represents the result of a fallible operation,
5197 * containing a crate::lightning::ln::features::InitFeatures on success and a crate::lightning::ln::msgs::DecodeError on failure.
5198 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5200 typedef struct LDKCResult_InitFeaturesDecodeErrorZ {
5202 * The contents of this CResult_InitFeaturesDecodeErrorZ, accessible via either
5203 * `err` or `result` depending on the state of `result_ok`.
5205 union LDKCResult_InitFeaturesDecodeErrorZPtr contents;
5207 * Whether this CResult_InitFeaturesDecodeErrorZ represents a success state.
5210 } LDKCResult_InitFeaturesDecodeErrorZ;
5215 * Features used within a `channel_announcement` message.
5217 typedef struct MUST_USE_STRUCT LDKChannelFeatures {
5219 * A pointer to the opaque Rust object.
5220 * Nearly everywhere, inner must be non-null, however in places where
5221 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5223 LDKnativeChannelFeatures *inner;
5225 * Indicates that this is the only struct which contains the same pointer.
5226 * Rust functions which take ownership of an object provided via an argument require
5227 * this to be true and invalidate the object pointed to by inner.
5230 } LDKChannelFeatures;
5233 * The contents of CResult_ChannelFeaturesDecodeErrorZ
5235 typedef union LDKCResult_ChannelFeaturesDecodeErrorZPtr {
5237 * A pointer to the contents in the success state.
5238 * Reading from this pointer when `result_ok` is not set is undefined.
5240 struct LDKChannelFeatures *result;
5242 * A pointer to the contents in the error state.
5243 * Reading from this pointer when `result_ok` is set is undefined.
5245 struct LDKDecodeError *err;
5246 } LDKCResult_ChannelFeaturesDecodeErrorZPtr;
5249 * A CResult_ChannelFeaturesDecodeErrorZ represents the result of a fallible operation,
5250 * containing a crate::lightning::ln::features::ChannelFeatures on success and a crate::lightning::ln::msgs::DecodeError on failure.
5251 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5253 typedef struct LDKCResult_ChannelFeaturesDecodeErrorZ {
5255 * The contents of this CResult_ChannelFeaturesDecodeErrorZ, accessible via either
5256 * `err` or `result` depending on the state of `result_ok`.
5258 union LDKCResult_ChannelFeaturesDecodeErrorZPtr contents;
5260 * Whether this CResult_ChannelFeaturesDecodeErrorZ represents a success state.
5263 } LDKCResult_ChannelFeaturesDecodeErrorZ;
5268 * Features used within a `node_announcement` message.
5270 typedef struct MUST_USE_STRUCT LDKNodeFeatures {
5272 * A pointer to the opaque Rust object.
5273 * Nearly everywhere, inner must be non-null, however in places where
5274 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5276 LDKnativeNodeFeatures *inner;
5278 * Indicates that this is the only struct which contains the same pointer.
5279 * Rust functions which take ownership of an object provided via an argument require
5280 * this to be true and invalidate the object pointed to by inner.
5286 * The contents of CResult_NodeFeaturesDecodeErrorZ
5288 typedef union LDKCResult_NodeFeaturesDecodeErrorZPtr {
5290 * A pointer to the contents in the success state.
5291 * Reading from this pointer when `result_ok` is not set is undefined.
5293 struct LDKNodeFeatures *result;
5295 * A pointer to the contents in the error state.
5296 * Reading from this pointer when `result_ok` is set is undefined.
5298 struct LDKDecodeError *err;
5299 } LDKCResult_NodeFeaturesDecodeErrorZPtr;
5302 * A CResult_NodeFeaturesDecodeErrorZ represents the result of a fallible operation,
5303 * containing a crate::lightning::ln::features::NodeFeatures on success and a crate::lightning::ln::msgs::DecodeError on failure.
5304 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5306 typedef struct LDKCResult_NodeFeaturesDecodeErrorZ {
5308 * The contents of this CResult_NodeFeaturesDecodeErrorZ, accessible via either
5309 * `err` or `result` depending on the state of `result_ok`.
5311 union LDKCResult_NodeFeaturesDecodeErrorZPtr contents;
5313 * Whether this CResult_NodeFeaturesDecodeErrorZ represents a success state.
5316 } LDKCResult_NodeFeaturesDecodeErrorZ;
5321 * Features used within an invoice.
5323 typedef struct MUST_USE_STRUCT LDKInvoiceFeatures {
5325 * A pointer to the opaque Rust object.
5326 * Nearly everywhere, inner must be non-null, however in places where
5327 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5329 LDKnativeInvoiceFeatures *inner;
5331 * Indicates that this is the only struct which contains the same pointer.
5332 * Rust functions which take ownership of an object provided via an argument require
5333 * this to be true and invalidate the object pointed to by inner.
5336 } LDKInvoiceFeatures;
5339 * The contents of CResult_InvoiceFeaturesDecodeErrorZ
5341 typedef union LDKCResult_InvoiceFeaturesDecodeErrorZPtr {
5343 * A pointer to the contents in the success state.
5344 * Reading from this pointer when `result_ok` is not set is undefined.
5346 struct LDKInvoiceFeatures *result;
5348 * A pointer to the contents in the error state.
5349 * Reading from this pointer when `result_ok` is set is undefined.
5351 struct LDKDecodeError *err;
5352 } LDKCResult_InvoiceFeaturesDecodeErrorZPtr;
5355 * A CResult_InvoiceFeaturesDecodeErrorZ represents the result of a fallible operation,
5356 * containing a crate::lightning::ln::features::InvoiceFeatures on success and a crate::lightning::ln::msgs::DecodeError on failure.
5357 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5359 typedef struct LDKCResult_InvoiceFeaturesDecodeErrorZ {
5361 * The contents of this CResult_InvoiceFeaturesDecodeErrorZ, accessible via either
5362 * `err` or `result` depending on the state of `result_ok`.
5364 union LDKCResult_InvoiceFeaturesDecodeErrorZPtr contents;
5366 * Whether this CResult_InvoiceFeaturesDecodeErrorZ represents a success state.
5369 } LDKCResult_InvoiceFeaturesDecodeErrorZ;
5372 * The contents of CResult_ChannelTypeFeaturesDecodeErrorZ
5374 typedef union LDKCResult_ChannelTypeFeaturesDecodeErrorZPtr {
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 LDKChannelTypeFeatures *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_ChannelTypeFeaturesDecodeErrorZPtr;
5388 * A CResult_ChannelTypeFeaturesDecodeErrorZ represents the result of a fallible operation,
5389 * containing a crate::lightning::ln::features::ChannelTypeFeatures 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_ChannelTypeFeaturesDecodeErrorZ {
5394 * The contents of this CResult_ChannelTypeFeaturesDecodeErrorZ, accessible via either
5395 * `err` or `result` depending on the state of `result_ok`.
5397 union LDKCResult_ChannelTypeFeaturesDecodeErrorZPtr contents;
5399 * Whether this CResult_ChannelTypeFeaturesDecodeErrorZ represents a success state.
5402 } LDKCResult_ChannelTypeFeaturesDecodeErrorZ;
5405 * The contents of CResult_NodeIdDecodeErrorZ
5407 typedef union LDKCResult_NodeIdDecodeErrorZPtr {
5409 * A pointer to the contents in the success state.
5410 * Reading from this pointer when `result_ok` is not set is undefined.
5412 struct LDKNodeId *result;
5414 * A pointer to the contents in the error state.
5415 * Reading from this pointer when `result_ok` is set is undefined.
5417 struct LDKDecodeError *err;
5418 } LDKCResult_NodeIdDecodeErrorZPtr;
5421 * A CResult_NodeIdDecodeErrorZ represents the result of a fallible operation,
5422 * containing a crate::lightning::routing::gossip::NodeId on success and a crate::lightning::ln::msgs::DecodeError on failure.
5423 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5425 typedef struct LDKCResult_NodeIdDecodeErrorZ {
5427 * The contents of this CResult_NodeIdDecodeErrorZ, accessible via either
5428 * `err` or `result` depending on the state of `result_ok`.
5430 union LDKCResult_NodeIdDecodeErrorZPtr contents;
5432 * Whether this CResult_NodeIdDecodeErrorZ represents a success state.
5435 } LDKCResult_NodeIdDecodeErrorZ;
5438 * The contents of CResult_COption_NetworkUpdateZDecodeErrorZ
5440 typedef union LDKCResult_COption_NetworkUpdateZDecodeErrorZPtr {
5442 * A pointer to the contents in the success state.
5443 * Reading from this pointer when `result_ok` is not set is undefined.
5445 struct LDKCOption_NetworkUpdateZ *result;
5447 * A pointer to the contents in the error state.
5448 * Reading from this pointer when `result_ok` is set is undefined.
5450 struct LDKDecodeError *err;
5451 } LDKCResult_COption_NetworkUpdateZDecodeErrorZPtr;
5454 * A CResult_COption_NetworkUpdateZDecodeErrorZ represents the result of a fallible operation,
5455 * containing a crate::c_types::derived::COption_NetworkUpdateZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
5456 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5458 typedef struct LDKCResult_COption_NetworkUpdateZDecodeErrorZ {
5460 * The contents of this CResult_COption_NetworkUpdateZDecodeErrorZ, accessible via either
5461 * `err` or `result` depending on the state of `result_ok`.
5463 union LDKCResult_COption_NetworkUpdateZDecodeErrorZPtr contents;
5465 * Whether this CResult_COption_NetworkUpdateZDecodeErrorZ represents a success state.
5468 } LDKCResult_COption_NetworkUpdateZDecodeErrorZ;
5471 * The `Access` trait defines behavior for accessing chain data and state, such as blocks and
5474 typedef struct LDKAccess {
5476 * An opaque pointer which is passed to your function implementations as an argument.
5477 * This has no meaning in the LDK, and can be NULL or any other value.
5481 * Returns the transaction output of a funding transaction encoded by [`short_channel_id`].
5482 * Returns an error if `genesis_hash` is for a different chain or if such a transaction output
5485 * [`short_channel_id`]: https://github.com/lightning/bolts/blob/master/07-routing-gossip.md#definition-of-short_channel_id
5487 struct LDKCResult_TxOutAccessErrorZ (*get_utxo)(const void *this_arg, const uint8_t (*genesis_hash)[32], uint64_t short_channel_id);
5489 * Frees any resources associated with this object given its this_arg pointer.
5490 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
5492 void (*free)(void *this_arg);
5496 * An enum which can either contain a crate::lightning::chain::Access or not
5498 typedef enum LDKCOption_AccessZ_Tag {
5500 * When we're in this state, this COption_AccessZ contains a crate::lightning::chain::Access
5502 LDKCOption_AccessZ_Some,
5504 * When we're in this state, this COption_AccessZ contains nothing
5506 LDKCOption_AccessZ_None,
5508 * Must be last for serialization purposes
5510 LDKCOption_AccessZ_Sentinel,
5511 } LDKCOption_AccessZ_Tag;
5513 typedef struct LDKCOption_AccessZ {
5514 LDKCOption_AccessZ_Tag tag;
5517 struct LDKAccess some;
5520 } LDKCOption_AccessZ;
5523 * The contents of CResult_boolLightningErrorZ
5525 typedef union LDKCResult_boolLightningErrorZPtr {
5527 * A pointer to the contents in the success state.
5528 * Reading from this pointer when `result_ok` is not set is undefined.
5532 * A pointer to the contents in the error state.
5533 * Reading from this pointer when `result_ok` is set is undefined.
5535 struct LDKLightningError *err;
5536 } LDKCResult_boolLightningErrorZPtr;
5539 * A CResult_boolLightningErrorZ represents the result of a fallible operation,
5540 * containing a bool on success and a crate::lightning::ln::msgs::LightningError on failure.
5541 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5543 typedef struct LDKCResult_boolLightningErrorZ {
5545 * The contents of this CResult_boolLightningErrorZ, accessible via either
5546 * `err` or `result` depending on the state of `result_ok`.
5548 union LDKCResult_boolLightningErrorZPtr contents;
5550 * Whether this CResult_boolLightningErrorZ represents a success state.
5553 } LDKCResult_boolLightningErrorZ;
5556 * A tuple of 3 elements. See the individual fields for the types contained.
5558 typedef struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ {
5560 * The element at position 0
5562 struct LDKChannelAnnouncement a;
5564 * The element at position 1
5566 struct LDKChannelUpdate b;
5568 * The element at position 2
5570 struct LDKChannelUpdate c;
5571 } LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ;
5574 * An enum which can either contain a crate::c_types::derived::C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ or not
5576 typedef enum LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_Tag {
5578 * When we're in this state, this COption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ contains a crate::c_types::derived::C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ
5580 LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_Some,
5582 * When we're in this state, this COption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ contains nothing
5584 LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_None,
5586 * Must be last for serialization purposes
5588 LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_Sentinel,
5589 } LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_Tag;
5591 typedef struct LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ {
5592 LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_Tag tag;
5595 struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ some;
5598 } LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ;
5601 * The contents of CResult_NoneLightningErrorZ
5603 typedef union LDKCResult_NoneLightningErrorZPtr {
5605 * Note that this value is always NULL, as there are no contents in the OK variant
5609 * A pointer to the contents in the error state.
5610 * Reading from this pointer when `result_ok` is set is undefined.
5612 struct LDKLightningError *err;
5613 } LDKCResult_NoneLightningErrorZPtr;
5616 * A CResult_NoneLightningErrorZ represents the result of a fallible operation,
5617 * containing a () on success and a crate::lightning::ln::msgs::LightningError on failure.
5618 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5620 typedef struct LDKCResult_NoneLightningErrorZ {
5622 * The contents of this CResult_NoneLightningErrorZ, accessible via either
5623 * `err` or `result` depending on the state of `result_ok`.
5625 union LDKCResult_NoneLightningErrorZPtr contents;
5627 * Whether this CResult_NoneLightningErrorZ represents a success state.
5630 } LDKCResult_NoneLightningErrorZ;
5635 * Details about one direction of a channel as received within a [`ChannelUpdate`].
5637 typedef struct MUST_USE_STRUCT LDKChannelUpdateInfo {
5639 * A pointer to the opaque Rust object.
5640 * Nearly everywhere, inner must be non-null, however in places where
5641 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5643 LDKnativeChannelUpdateInfo *inner;
5645 * Indicates that this is the only struct which contains the same pointer.
5646 * Rust functions which take ownership of an object provided via an argument require
5647 * this to be true and invalidate the object pointed to by inner.
5650 } LDKChannelUpdateInfo;
5653 * The contents of CResult_ChannelUpdateInfoDecodeErrorZ
5655 typedef union LDKCResult_ChannelUpdateInfoDecodeErrorZPtr {
5657 * A pointer to the contents in the success state.
5658 * Reading from this pointer when `result_ok` is not set is undefined.
5660 struct LDKChannelUpdateInfo *result;
5662 * A pointer to the contents in the error state.
5663 * Reading from this pointer when `result_ok` is set is undefined.
5665 struct LDKDecodeError *err;
5666 } LDKCResult_ChannelUpdateInfoDecodeErrorZPtr;
5669 * A CResult_ChannelUpdateInfoDecodeErrorZ represents the result of a fallible operation,
5670 * containing a crate::lightning::routing::gossip::ChannelUpdateInfo on success and a crate::lightning::ln::msgs::DecodeError on failure.
5671 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5673 typedef struct LDKCResult_ChannelUpdateInfoDecodeErrorZ {
5675 * The contents of this CResult_ChannelUpdateInfoDecodeErrorZ, accessible via either
5676 * `err` or `result` depending on the state of `result_ok`.
5678 union LDKCResult_ChannelUpdateInfoDecodeErrorZPtr contents;
5680 * Whether this CResult_ChannelUpdateInfoDecodeErrorZ represents a success state.
5683 } LDKCResult_ChannelUpdateInfoDecodeErrorZ;
5688 * Details about a channel (both directions).
5689 * Received within a channel announcement.
5691 typedef struct MUST_USE_STRUCT LDKChannelInfo {
5693 * A pointer to the opaque Rust object.
5694 * Nearly everywhere, inner must be non-null, however in places where
5695 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5697 LDKnativeChannelInfo *inner;
5699 * Indicates that this is the only struct which contains the same pointer.
5700 * Rust functions which take ownership of an object provided via an argument require
5701 * this to be true and invalidate the object pointed to by inner.
5707 * The contents of CResult_ChannelInfoDecodeErrorZ
5709 typedef union LDKCResult_ChannelInfoDecodeErrorZPtr {
5711 * A pointer to the contents in the success state.
5712 * Reading from this pointer when `result_ok` is not set is undefined.
5714 struct LDKChannelInfo *result;
5716 * A pointer to the contents in the error state.
5717 * Reading from this pointer when `result_ok` is set is undefined.
5719 struct LDKDecodeError *err;
5720 } LDKCResult_ChannelInfoDecodeErrorZPtr;
5723 * A CResult_ChannelInfoDecodeErrorZ represents the result of a fallible operation,
5724 * containing a crate::lightning::routing::gossip::ChannelInfo on success and a crate::lightning::ln::msgs::DecodeError on failure.
5725 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5727 typedef struct LDKCResult_ChannelInfoDecodeErrorZ {
5729 * The contents of this CResult_ChannelInfoDecodeErrorZ, accessible via either
5730 * `err` or `result` depending on the state of `result_ok`.
5732 union LDKCResult_ChannelInfoDecodeErrorZPtr contents;
5734 * Whether this CResult_ChannelInfoDecodeErrorZ represents a success state.
5737 } LDKCResult_ChannelInfoDecodeErrorZ;
5742 * Fees for routing via a given channel or a node
5744 typedef struct MUST_USE_STRUCT LDKRoutingFees {
5746 * A pointer to the opaque Rust object.
5747 * Nearly everywhere, inner must be non-null, however in places where
5748 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5750 LDKnativeRoutingFees *inner;
5752 * Indicates that this is the only struct which contains the same pointer.
5753 * Rust functions which take ownership of an object provided via an argument require
5754 * this to be true and invalidate the object pointed to by inner.
5760 * The contents of CResult_RoutingFeesDecodeErrorZ
5762 typedef union LDKCResult_RoutingFeesDecodeErrorZPtr {
5764 * A pointer to the contents in the success state.
5765 * Reading from this pointer when `result_ok` is not set is undefined.
5767 struct LDKRoutingFees *result;
5769 * A pointer to the contents in the error state.
5770 * Reading from this pointer when `result_ok` is set is undefined.
5772 struct LDKDecodeError *err;
5773 } LDKCResult_RoutingFeesDecodeErrorZPtr;
5776 * A CResult_RoutingFeesDecodeErrorZ represents the result of a fallible operation,
5777 * containing a crate::lightning::routing::gossip::RoutingFees on success and a crate::lightning::ln::msgs::DecodeError on failure.
5778 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5780 typedef struct LDKCResult_RoutingFeesDecodeErrorZ {
5782 * The contents of this CResult_RoutingFeesDecodeErrorZ, accessible via either
5783 * `err` or `result` depending on the state of `result_ok`.
5785 union LDKCResult_RoutingFeesDecodeErrorZPtr contents;
5787 * Whether this CResult_RoutingFeesDecodeErrorZ represents a success state.
5790 } LDKCResult_RoutingFeesDecodeErrorZ;
5793 * A 4-byte byte array.
5795 typedef struct LDKFourBytes {
5803 * A 16-byte byte array.
5805 typedef struct LDKSixteenBytes {
5813 * A 12-byte byte array.
5815 typedef struct LDKTwelveBytes {
5825 * Represents a hostname for serialization purposes.
5826 * Only the character set and length will be validated.
5827 * The character set consists of ASCII alphanumeric characters, hyphens, and periods.
5828 * Its length is guaranteed to be representable by a single byte.
5829 * This serialization is used by BOLT 7 hostnames.
5831 typedef struct MUST_USE_STRUCT LDKHostname {
5833 * A pointer to the opaque Rust object.
5834 * Nearly everywhere, inner must be non-null, however in places where
5835 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5837 LDKnativeHostname *inner;
5839 * Indicates that this is the only struct which contains the same pointer.
5840 * Rust functions which take ownership of an object provided via an argument require
5841 * this to be true and invalidate the object pointed to by inner.
5847 * An address which can be used to connect to a remote peer
5849 typedef enum LDKNetAddress_Tag {
5851 * An IPv4 address/port on which the peer is listening.
5855 * An IPv6 address/port on which the peer is listening.
5859 * An old-style Tor onion address/port on which the peer is listening.
5861 * This field is deprecated and the Tor network generally no longer supports V2 Onion
5862 * addresses. Thus, the details are not parsed here.
5864 LDKNetAddress_OnionV2,
5866 * A new-style Tor onion address/port on which the peer is listening.
5867 * To create the human-readable \"hostname\", concatenate ed25519_pubkey, checksum, and version,
5868 * wrap as base32 and append \".onion\".
5870 LDKNetAddress_OnionV3,
5872 * A hostname/port on which the peer is listening.
5874 LDKNetAddress_Hostname,
5876 * Must be last for serialization purposes
5878 LDKNetAddress_Sentinel,
5879 } LDKNetAddress_Tag;
5881 typedef struct LDKNetAddress_LDKIPv4_Body {
5883 * The 4-byte IPv4 address
5885 struct LDKFourBytes addr;
5887 * The port on which the node is listening
5890 } LDKNetAddress_LDKIPv4_Body;
5892 typedef struct LDKNetAddress_LDKIPv6_Body {
5894 * The 16-byte IPv6 address
5896 struct LDKSixteenBytes addr;
5898 * The port on which the node is listening
5901 } LDKNetAddress_LDKIPv6_Body;
5903 typedef struct LDKNetAddress_LDKOnionV3_Body {
5905 * The ed25519 long-term public key of the peer
5907 struct LDKThirtyTwoBytes ed25519_pubkey;
5909 * The checksum of the pubkey and version, as included in the onion address
5913 * The version byte, as defined by the Tor Onion v3 spec.
5917 * The port on which the node is listening
5920 } LDKNetAddress_LDKOnionV3_Body;
5922 typedef struct LDKNetAddress_LDKHostname_Body {
5924 * The hostname on which the node is listening.
5926 struct LDKHostname hostname;
5928 * The port on which the node is listening.
5931 } LDKNetAddress_LDKHostname_Body;
5933 typedef struct MUST_USE_STRUCT LDKNetAddress {
5934 LDKNetAddress_Tag tag;
5936 LDKNetAddress_LDKIPv4_Body i_pv4;
5937 LDKNetAddress_LDKIPv6_Body i_pv6;
5939 struct LDKTwelveBytes onion_v2;
5941 LDKNetAddress_LDKOnionV3_Body onion_v3;
5942 LDKNetAddress_LDKHostname_Body hostname;
5947 * A dynamically-allocated array of crate::lightning::ln::msgs::NetAddresss of arbitrary size.
5948 * This corresponds to std::vector in C++
5950 typedef struct LDKCVec_NetAddressZ {
5952 * The elements in the array.
5953 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
5955 struct LDKNetAddress *data;
5957 * The number of elements pointed to by `data`.
5960 } LDKCVec_NetAddressZ;
5965 * Information received in the latest node_announcement from this node.
5967 typedef struct MUST_USE_STRUCT LDKNodeAnnouncementInfo {
5969 * A pointer to the opaque Rust object.
5970 * Nearly everywhere, inner must be non-null, however in places where
5971 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5973 LDKnativeNodeAnnouncementInfo *inner;
5975 * Indicates that this is the only struct which contains the same pointer.
5976 * Rust functions which take ownership of an object provided via an argument require
5977 * this to be true and invalidate the object pointed to by inner.
5980 } LDKNodeAnnouncementInfo;
5983 * The contents of CResult_NodeAnnouncementInfoDecodeErrorZ
5985 typedef union LDKCResult_NodeAnnouncementInfoDecodeErrorZPtr {
5987 * A pointer to the contents in the success state.
5988 * Reading from this pointer when `result_ok` is not set is undefined.
5990 struct LDKNodeAnnouncementInfo *result;
5992 * A pointer to the contents in the error state.
5993 * Reading from this pointer when `result_ok` is set is undefined.
5995 struct LDKDecodeError *err;
5996 } LDKCResult_NodeAnnouncementInfoDecodeErrorZPtr;
5999 * A CResult_NodeAnnouncementInfoDecodeErrorZ represents the result of a fallible operation,
6000 * containing a crate::lightning::routing::gossip::NodeAnnouncementInfo on success and a crate::lightning::ln::msgs::DecodeError on failure.
6001 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6003 typedef struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ {
6005 * The contents of this CResult_NodeAnnouncementInfoDecodeErrorZ, accessible via either
6006 * `err` or `result` depending on the state of `result_ok`.
6008 union LDKCResult_NodeAnnouncementInfoDecodeErrorZPtr contents;
6010 * Whether this CResult_NodeAnnouncementInfoDecodeErrorZ represents a success state.
6013 } LDKCResult_NodeAnnouncementInfoDecodeErrorZ;
6018 * A user-defined name for a node, which may be used when displaying the node in a graph.
6020 * Since node aliases are provided by third parties, they are a potential avenue for injection
6021 * attacks. Care must be taken when processing.
6023 typedef struct MUST_USE_STRUCT LDKNodeAlias {
6025 * A pointer to the opaque Rust object.
6026 * Nearly everywhere, inner must be non-null, however in places where
6027 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6029 LDKnativeNodeAlias *inner;
6031 * Indicates that this is the only struct which contains the same pointer.
6032 * Rust functions which take ownership of an object provided via an argument require
6033 * this to be true and invalidate the object pointed to by inner.
6039 * The contents of CResult_NodeAliasDecodeErrorZ
6041 typedef union LDKCResult_NodeAliasDecodeErrorZPtr {
6043 * A pointer to the contents in the success state.
6044 * Reading from this pointer when `result_ok` is not set is undefined.
6046 struct LDKNodeAlias *result;
6048 * A pointer to the contents in the error state.
6049 * Reading from this pointer when `result_ok` is set is undefined.
6051 struct LDKDecodeError *err;
6052 } LDKCResult_NodeAliasDecodeErrorZPtr;
6055 * A CResult_NodeAliasDecodeErrorZ represents the result of a fallible operation,
6056 * containing a crate::lightning::routing::gossip::NodeAlias on success and a crate::lightning::ln::msgs::DecodeError on failure.
6057 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6059 typedef struct LDKCResult_NodeAliasDecodeErrorZ {
6061 * The contents of this CResult_NodeAliasDecodeErrorZ, accessible via either
6062 * `err` or `result` depending on the state of `result_ok`.
6064 union LDKCResult_NodeAliasDecodeErrorZPtr contents;
6066 * Whether this CResult_NodeAliasDecodeErrorZ represents a success state.
6069 } LDKCResult_NodeAliasDecodeErrorZ;
6074 * Details about a node in the network, known from the network announcement.
6076 typedef struct MUST_USE_STRUCT LDKNodeInfo {
6078 * A pointer to the opaque Rust object.
6079 * Nearly everywhere, inner must be non-null, however in places where
6080 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6082 LDKnativeNodeInfo *inner;
6084 * Indicates that this is the only struct which contains the same pointer.
6085 * Rust functions which take ownership of an object provided via an argument require
6086 * this to be true and invalidate the object pointed to by inner.
6092 * The contents of CResult_NodeInfoDecodeErrorZ
6094 typedef union LDKCResult_NodeInfoDecodeErrorZPtr {
6096 * A pointer to the contents in the success state.
6097 * Reading from this pointer when `result_ok` is not set is undefined.
6099 struct LDKNodeInfo *result;
6101 * A pointer to the contents in the error state.
6102 * Reading from this pointer when `result_ok` is set is undefined.
6104 struct LDKDecodeError *err;
6105 } LDKCResult_NodeInfoDecodeErrorZPtr;
6108 * A CResult_NodeInfoDecodeErrorZ represents the result of a fallible operation,
6109 * containing a crate::lightning::routing::gossip::NodeInfo on success and a crate::lightning::ln::msgs::DecodeError on failure.
6110 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6112 typedef struct LDKCResult_NodeInfoDecodeErrorZ {
6114 * The contents of this CResult_NodeInfoDecodeErrorZ, accessible via either
6115 * `err` or `result` depending on the state of `result_ok`.
6117 union LDKCResult_NodeInfoDecodeErrorZPtr contents;
6119 * Whether this CResult_NodeInfoDecodeErrorZ represents a success state.
6122 } LDKCResult_NodeInfoDecodeErrorZ;
6125 * The contents of CResult_NetworkGraphDecodeErrorZ
6127 typedef union LDKCResult_NetworkGraphDecodeErrorZPtr {
6129 * A pointer to the contents in the success state.
6130 * Reading from this pointer when `result_ok` is not set is undefined.
6132 struct LDKNetworkGraph *result;
6134 * A pointer to the contents in the error state.
6135 * Reading from this pointer when `result_ok` is set is undefined.
6137 struct LDKDecodeError *err;
6138 } LDKCResult_NetworkGraphDecodeErrorZPtr;
6141 * A CResult_NetworkGraphDecodeErrorZ represents the result of a fallible operation,
6142 * containing a crate::lightning::routing::gossip::NetworkGraph on success and a crate::lightning::ln::msgs::DecodeError on failure.
6143 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6145 typedef struct LDKCResult_NetworkGraphDecodeErrorZ {
6147 * The contents of this CResult_NetworkGraphDecodeErrorZ, accessible via either
6148 * `err` or `result` depending on the state of `result_ok`.
6150 union LDKCResult_NetworkGraphDecodeErrorZPtr contents;
6152 * Whether this CResult_NetworkGraphDecodeErrorZ represents a success state.
6155 } LDKCResult_NetworkGraphDecodeErrorZ;
6158 * An enum which can either contain a crate::c_types::derived::CVec_NetAddressZ or not
6160 typedef enum LDKCOption_CVec_NetAddressZZ_Tag {
6162 * When we're in this state, this COption_CVec_NetAddressZZ contains a crate::c_types::derived::CVec_NetAddressZ
6164 LDKCOption_CVec_NetAddressZZ_Some,
6166 * When we're in this state, this COption_CVec_NetAddressZZ contains nothing
6168 LDKCOption_CVec_NetAddressZZ_None,
6170 * Must be last for serialization purposes
6172 LDKCOption_CVec_NetAddressZZ_Sentinel,
6173 } LDKCOption_CVec_NetAddressZZ_Tag;
6175 typedef struct LDKCOption_CVec_NetAddressZZ {
6176 LDKCOption_CVec_NetAddressZZ_Tag tag;
6179 struct LDKCVec_NetAddressZ some;
6182 } LDKCOption_CVec_NetAddressZZ;
6185 * The contents of CResult_DelayedPaymentOutputDescriptorDecodeErrorZ
6187 typedef union LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZPtr {
6189 * A pointer to the contents in the success state.
6190 * Reading from this pointer when `result_ok` is not set is undefined.
6192 struct LDKDelayedPaymentOutputDescriptor *result;
6194 * A pointer to the contents in the error state.
6195 * Reading from this pointer when `result_ok` is set is undefined.
6197 struct LDKDecodeError *err;
6198 } LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZPtr;
6201 * A CResult_DelayedPaymentOutputDescriptorDecodeErrorZ represents the result of a fallible operation,
6202 * containing a crate::lightning::chain::keysinterface::DelayedPaymentOutputDescriptor on success and a crate::lightning::ln::msgs::DecodeError on failure.
6203 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6205 typedef struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ {
6207 * The contents of this CResult_DelayedPaymentOutputDescriptorDecodeErrorZ, accessible via either
6208 * `err` or `result` depending on the state of `result_ok`.
6210 union LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZPtr contents;
6212 * Whether this CResult_DelayedPaymentOutputDescriptorDecodeErrorZ represents a success state.
6215 } LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ;
6218 * The contents of CResult_StaticPaymentOutputDescriptorDecodeErrorZ
6220 typedef union LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZPtr {
6222 * A pointer to the contents in the success state.
6223 * Reading from this pointer when `result_ok` is not set is undefined.
6225 struct LDKStaticPaymentOutputDescriptor *result;
6227 * A pointer to the contents in the error state.
6228 * Reading from this pointer when `result_ok` is set is undefined.
6230 struct LDKDecodeError *err;
6231 } LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZPtr;
6234 * A CResult_StaticPaymentOutputDescriptorDecodeErrorZ represents the result of a fallible operation,
6235 * containing a crate::lightning::chain::keysinterface::StaticPaymentOutputDescriptor on success and a crate::lightning::ln::msgs::DecodeError on failure.
6236 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6238 typedef struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ {
6240 * The contents of this CResult_StaticPaymentOutputDescriptorDecodeErrorZ, accessible via either
6241 * `err` or `result` depending on the state of `result_ok`.
6243 union LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZPtr contents;
6245 * Whether this CResult_StaticPaymentOutputDescriptorDecodeErrorZ represents a success state.
6248 } LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ;
6251 * The contents of CResult_SpendableOutputDescriptorDecodeErrorZ
6253 typedef union LDKCResult_SpendableOutputDescriptorDecodeErrorZPtr {
6255 * A pointer to the contents in the success state.
6256 * Reading from this pointer when `result_ok` is not set is undefined.
6258 struct LDKSpendableOutputDescriptor *result;
6260 * A pointer to the contents in the error state.
6261 * Reading from this pointer when `result_ok` is set is undefined.
6263 struct LDKDecodeError *err;
6264 } LDKCResult_SpendableOutputDescriptorDecodeErrorZPtr;
6267 * A CResult_SpendableOutputDescriptorDecodeErrorZ represents the result of a fallible operation,
6268 * containing a crate::lightning::chain::keysinterface::SpendableOutputDescriptor on success and a crate::lightning::ln::msgs::DecodeError on failure.
6269 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6271 typedef struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ {
6273 * The contents of this CResult_SpendableOutputDescriptorDecodeErrorZ, accessible via either
6274 * `err` or `result` depending on the state of `result_ok`.
6276 union LDKCResult_SpendableOutputDescriptorDecodeErrorZPtr contents;
6278 * Whether this CResult_SpendableOutputDescriptorDecodeErrorZ represents a success state.
6281 } LDKCResult_SpendableOutputDescriptorDecodeErrorZ;
6284 * A dynamically-allocated array of crate::c_types::ThirtyTwoBytess of arbitrary size.
6285 * This corresponds to std::vector in C++
6287 typedef struct LDKCVec_PaymentPreimageZ {
6289 * The elements in the array.
6290 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
6292 struct LDKThirtyTwoBytes *data;
6294 * The number of elements pointed to by `data`.
6297 } LDKCVec_PaymentPreimageZ;
6300 * A tuple of 2 elements. See the individual fields for the types contained.
6302 typedef struct LDKC2Tuple_SignatureCVec_SignatureZZ {
6304 * The element at position 0
6306 struct LDKSignature a;
6308 * The element at position 1
6310 struct LDKCVec_SignatureZ b;
6311 } LDKC2Tuple_SignatureCVec_SignatureZZ;
6314 * The contents of CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ
6316 typedef union LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZPtr {
6318 * A pointer to the contents in the success state.
6319 * Reading from this pointer when `result_ok` is not set is undefined.
6321 struct LDKC2Tuple_SignatureCVec_SignatureZZ *result;
6323 * Note that this value is always NULL, as there are no contents in the Err variant
6326 } LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZPtr;
6329 * A CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ represents the result of a fallible operation,
6330 * containing a crate::c_types::derived::C2Tuple_SignatureCVec_SignatureZZ on success and a () on failure.
6331 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6333 typedef struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ {
6335 * The contents of this CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ, accessible via either
6336 * `err` or `result` depending on the state of `result_ok`.
6338 union LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZPtr contents;
6340 * Whether this CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ represents a success state.
6343 } LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ;
6346 * The contents of CResult_SignatureNoneZ
6348 typedef union LDKCResult_SignatureNoneZPtr {
6350 * A pointer to the contents in the success state.
6351 * Reading from this pointer when `result_ok` is not set is undefined.
6353 struct LDKSignature *result;
6355 * Note that this value is always NULL, as there are no contents in the Err variant
6358 } LDKCResult_SignatureNoneZPtr;
6361 * A CResult_SignatureNoneZ represents the result of a fallible operation,
6362 * containing a crate::c_types::Signature on success and a () on failure.
6363 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6365 typedef struct LDKCResult_SignatureNoneZ {
6367 * The contents of this CResult_SignatureNoneZ, accessible via either
6368 * `err` or `result` depending on the state of `result_ok`.
6370 union LDKCResult_SignatureNoneZPtr contents;
6372 * Whether this CResult_SignatureNoneZ represents a success state.
6375 } LDKCResult_SignatureNoneZ;
6378 * A tuple of 2 elements. See the individual fields for the types contained.
6380 typedef struct LDKC2Tuple_SignatureSignatureZ {
6382 * The element at position 0
6384 struct LDKSignature a;
6386 * The element at position 1
6388 struct LDKSignature b;
6389 } LDKC2Tuple_SignatureSignatureZ;
6392 * The contents of CResult_C2Tuple_SignatureSignatureZNoneZ
6394 typedef union LDKCResult_C2Tuple_SignatureSignatureZNoneZPtr {
6396 * A pointer to the contents in the success state.
6397 * Reading from this pointer when `result_ok` is not set is undefined.
6399 struct LDKC2Tuple_SignatureSignatureZ *result;
6401 * Note that this value is always NULL, as there are no contents in the Err variant
6404 } LDKCResult_C2Tuple_SignatureSignatureZNoneZPtr;
6407 * A CResult_C2Tuple_SignatureSignatureZNoneZ represents the result of a fallible operation,
6408 * containing a crate::c_types::derived::C2Tuple_SignatureSignatureZ on success and a () on failure.
6409 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6411 typedef struct LDKCResult_C2Tuple_SignatureSignatureZNoneZ {
6413 * The contents of this CResult_C2Tuple_SignatureSignatureZNoneZ, accessible via either
6414 * `err` or `result` depending on the state of `result_ok`.
6416 union LDKCResult_C2Tuple_SignatureSignatureZNoneZPtr contents;
6418 * Whether this CResult_C2Tuple_SignatureSignatureZNoneZ represents a success state.
6421 } LDKCResult_C2Tuple_SignatureSignatureZNoneZ;
6424 * The contents of CResult_SecretKeyNoneZ
6426 typedef union LDKCResult_SecretKeyNoneZPtr {
6428 * A pointer to the contents in the success state.
6429 * Reading from this pointer when `result_ok` is not set is undefined.
6431 struct LDKSecretKey *result;
6433 * Note that this value is always NULL, as there are no contents in the Err variant
6436 } LDKCResult_SecretKeyNoneZPtr;
6439 * A CResult_SecretKeyNoneZ represents the result of a fallible operation,
6440 * containing a crate::c_types::SecretKey on success and a () on failure.
6441 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6443 typedef struct LDKCResult_SecretKeyNoneZ {
6445 * The contents of this CResult_SecretKeyNoneZ, accessible via either
6446 * `err` or `result` depending on the state of `result_ok`.
6448 union LDKCResult_SecretKeyNoneZPtr contents;
6450 * Whether this CResult_SecretKeyNoneZ represents a success state.
6453 } LDKCResult_SecretKeyNoneZ;
6456 * The contents of CResult_PublicKeyNoneZ
6458 typedef union LDKCResult_PublicKeyNoneZPtr {
6460 * A pointer to the contents in the success state.
6461 * Reading from this pointer when `result_ok` is not set is undefined.
6463 struct LDKPublicKey *result;
6465 * Note that this value is always NULL, as there are no contents in the Err variant
6468 } LDKCResult_PublicKeyNoneZPtr;
6471 * A CResult_PublicKeyNoneZ represents the result of a fallible operation,
6472 * containing a crate::c_types::PublicKey on success and a () on failure.
6473 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6475 typedef struct LDKCResult_PublicKeyNoneZ {
6477 * The contents of this CResult_PublicKeyNoneZ, accessible via either
6478 * `err` or `result` depending on the state of `result_ok`.
6480 union LDKCResult_PublicKeyNoneZPtr contents;
6482 * Whether this CResult_PublicKeyNoneZ represents a success state.
6485 } LDKCResult_PublicKeyNoneZ;
6488 * An enum which can either contain a crate::c_types::BigEndianScalar or not
6490 typedef enum LDKCOption_ScalarZ_Tag {
6492 * When we're in this state, this COption_ScalarZ contains a crate::c_types::BigEndianScalar
6494 LDKCOption_ScalarZ_Some,
6496 * When we're in this state, this COption_ScalarZ contains nothing
6498 LDKCOption_ScalarZ_None,
6500 * Must be last for serialization purposes
6502 LDKCOption_ScalarZ_Sentinel,
6503 } LDKCOption_ScalarZ_Tag;
6505 typedef struct LDKCOption_ScalarZ {
6506 LDKCOption_ScalarZ_Tag tag;
6509 struct LDKBigEndianScalar some;
6512 } LDKCOption_ScalarZ;
6515 * The contents of CResult_SharedSecretNoneZ
6517 typedef union LDKCResult_SharedSecretNoneZPtr {
6519 * A pointer to the contents in the success state.
6520 * Reading from this pointer when `result_ok` is not set is undefined.
6522 struct LDKThirtyTwoBytes *result;
6524 * Note that this value is always NULL, as there are no contents in the Err variant
6527 } LDKCResult_SharedSecretNoneZPtr;
6530 * A CResult_SharedSecretNoneZ represents the result of a fallible operation,
6531 * containing a crate::c_types::ThirtyTwoBytes on success and a () on failure.
6532 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6534 typedef struct LDKCResult_SharedSecretNoneZ {
6536 * The contents of this CResult_SharedSecretNoneZ, accessible via either
6537 * `err` or `result` depending on the state of `result_ok`.
6539 union LDKCResult_SharedSecretNoneZPtr contents;
6541 * Whether this CResult_SharedSecretNoneZ represents a success state.
6544 } LDKCResult_SharedSecretNoneZ;
6549 * This class tracks the per-transaction information needed to build a closing transaction and will
6550 * actually build it and sign.
6552 * This class can be used inside a signer implementation to generate a signature given the relevant
6555 typedef struct MUST_USE_STRUCT LDKClosingTransaction {
6557 * A pointer to the opaque Rust object.
6558 * Nearly everywhere, inner must be non-null, however in places where
6559 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6561 LDKnativeClosingTransaction *inner;
6563 * Indicates that this is the only struct which contains the same pointer.
6564 * Rust functions which take ownership of an object provided via an argument require
6565 * this to be true and invalidate the object pointed to by inner.
6568 } LDKClosingTransaction;
6573 * The unsigned part of a channel_announcement
6575 typedef struct MUST_USE_STRUCT LDKUnsignedChannelAnnouncement {
6577 * A pointer to the opaque Rust object.
6578 * Nearly everywhere, inner must be non-null, however in places where
6579 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6581 LDKnativeUnsignedChannelAnnouncement *inner;
6583 * Indicates that this is the only struct which contains the same pointer.
6584 * Rust functions which take ownership of an object provided via an argument require
6585 * this to be true and invalidate the object pointed to by inner.
6588 } LDKUnsignedChannelAnnouncement;
6591 * A trait to sign lightning channel transactions as described in BOLT 3.
6593 * Signing services could be implemented on a hardware wallet. In this case,
6594 * the current Sign would be a front-end on top of a communication
6595 * channel connected to your secure device and lightning key material wouldn't
6596 * reside on a hot server. Nevertheless, a this deployment would still need
6597 * to trust the ChannelManager to avoid loss of funds as this latest component
6598 * could ask to sign commitment transaction with HTLCs paying to attacker pubkeys.
6600 * A more secure iteration would be to use hashlock (or payment points) to pair
6601 * invoice/incoming HTLCs with outgoing HTLCs to implement a no-trust-ChannelManager
6602 * at the price of more state and computation on the hardware wallet side. In the future,
6603 * we are looking forward to design such interface.
6605 * In any case, ChannelMonitor or fallback watchtowers are always going to be trusted
6606 * to act, as liveness and breach reply correctness are always going to be hard requirements
6607 * of LN security model, orthogonal of key management issues.
6609 typedef struct LDKBaseSign {
6611 * An opaque pointer which is passed to your function implementations as an argument.
6612 * This has no meaning in the LDK, and can be NULL or any other value.
6616 * Gets the per-commitment point for a specific commitment number
6618 * Note that the commitment number starts at (1 << 48) - 1 and counts backwards.
6620 struct LDKPublicKey (*get_per_commitment_point)(const void *this_arg, uint64_t idx);
6622 * Gets the commitment secret for a specific commitment number as part of the revocation process
6624 * An external signer implementation should error here if the commitment was already signed
6625 * and should refuse to sign it in the future.
6627 * May be called more than once for the same index.
6629 * Note that the commitment number starts at (1 << 48) - 1 and counts backwards.
6631 struct LDKThirtyTwoBytes (*release_commitment_secret)(const void *this_arg, uint64_t idx);
6633 * Validate the counterparty's signatures on the holder commitment transaction and HTLCs.
6635 * This is required in order for the signer to make sure that releasing a commitment
6636 * secret won't leave us without a broadcastable holder transaction.
6637 * Policy checks should be implemented in this function, including checking the amount
6638 * sent to us and checking the HTLCs.
6640 * The preimages of outgoing HTLCs that were fulfilled since the last commitment are provided.
6641 * A validating signer should ensure that an HTLC output is removed only when the matching
6642 * preimage is provided, or when the value to holder is restored.
6644 * NOTE: all the relevant preimages will be provided, but there may also be additional
6645 * irrelevant or duplicate preimages.
6647 struct LDKCResult_NoneNoneZ (*validate_holder_commitment)(const void *this_arg, const struct LDKHolderCommitmentTransaction *NONNULL_PTR holder_tx, struct LDKCVec_PaymentPreimageZ preimages);
6649 * Gets the holder's channel public keys and basepoints
6651 struct LDKChannelPublicKeys pubkeys;
6653 * Fill in the pubkeys field as a reference to it will be given to Rust after this returns
6654 * Note that this takes a pointer to this object, not the this_ptr like other methods do
6655 * This function pointer may be NULL if pubkeys is filled in when this object is created and never needs updating.
6657 void (*set_pubkeys)(const struct LDKBaseSign*NONNULL_PTR );
6659 * Gets an arbitrary identifier describing the set of keys which are provided back to you in
6660 * some SpendableOutputDescriptor types. This should be sufficient to identify this
6661 * Sign object uniquely and lookup or re-derive its keys.
6663 struct LDKThirtyTwoBytes (*channel_keys_id)(const void *this_arg);
6665 * Create a signature for a counterparty's commitment transaction and associated HTLC transactions.
6667 * Note that if signing fails or is rejected, the channel will be force-closed.
6669 * Policy checks should be implemented in this function, including checking the amount
6670 * sent to us and checking the HTLCs.
6672 * The preimages of outgoing HTLCs that were fulfilled since the last commitment are provided.
6673 * A validating signer should ensure that an HTLC output is removed only when the matching
6674 * preimage is provided, or when the value to holder is restored.
6676 * NOTE: all the relevant preimages will be provided, but there may also be additional
6677 * irrelevant or duplicate preimages.
6679 struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ (*sign_counterparty_commitment)(const void *this_arg, const struct LDKCommitmentTransaction *NONNULL_PTR commitment_tx, struct LDKCVec_PaymentPreimageZ preimages);
6681 * Validate the counterparty's revocation.
6683 * This is required in order for the signer to make sure that the state has moved
6684 * forward and it is safe to sign the next counterparty commitment.
6686 struct LDKCResult_NoneNoneZ (*validate_counterparty_revocation)(const void *this_arg, uint64_t idx, const uint8_t (*secret)[32]);
6688 * Create a signatures for a holder's commitment transaction and its claiming HTLC transactions.
6689 * This will only ever be called with a non-revoked commitment_tx. This will be called with the
6690 * latest commitment_tx when we initiate a force-close.
6691 * This will be called with the previous latest, just to get claiming HTLC signatures, if we are
6692 * reacting to a ChannelMonitor replica that decided to broadcast before it had been updated to
6694 * This may be called multiple times for the same transaction.
6696 * An external signer implementation should check that the commitment has not been revoked.
6698 * May return Err if key derivation fails. Callers, such as ChannelMonitor, will panic in such a case.
6700 struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ (*sign_holder_commitment_and_htlcs)(const void *this_arg, const struct LDKHolderCommitmentTransaction *NONNULL_PTR commitment_tx);
6702 * Create a signature for the given input in a transaction spending an HTLC transaction output
6703 * or a commitment transaction `to_local` output when our counterparty broadcasts an old state.
6705 * A justice transaction may claim multiple outputs at the same time if timelocks are
6706 * similar, but only a signature for the input at index `input` should be signed for here.
6707 * It may be called multiple times for same output(s) if a fee-bump is needed with regards
6708 * to an upcoming timelock expiration.
6710 * Amount is value of the output spent by this input, committed to in the BIP 143 signature.
6712 * per_commitment_key is revocation secret which was provided by our counterparty when they
6713 * revoked the state which they eventually broadcast. It's not a _holder_ secret key and does
6714 * not allow the spending of any funds by itself (you need our holder revocation_secret to do
6717 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]);
6719 * Create a signature for the given input in a transaction spending a commitment transaction
6720 * HTLC output when our counterparty broadcasts an old state.
6722 * A justice transaction may claim multiple outputs at the same time if timelocks are
6723 * similar, but only a signature for the input at index `input` should be signed for here.
6724 * It may be called multiple times for same output(s) if a fee-bump is needed with regards
6725 * to an upcoming timelock expiration.
6727 * Amount is value of the output spent by this input, committed to in the BIP 143 signature.
6729 * per_commitment_key is revocation secret which was provided by our counterparty when they
6730 * revoked the state which they eventually broadcast. It's not a _holder_ secret key and does
6731 * not allow the spending of any funds by itself (you need our holder revocation_secret to do
6734 * htlc holds HTLC elements (hash, timelock), thus changing the format of the witness script
6735 * (which is committed to in the BIP 143 signatures).
6737 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);
6739 * Create a signature for a claiming transaction for a HTLC output on a counterparty's commitment
6740 * transaction, either offered or received.
6742 * Such a transaction may claim multiples offered outputs at same time if we know the
6743 * preimage for each when we create it, but only the input at index `input` should be
6744 * signed for here. It may be called multiple times for same output(s) if a fee-bump is
6745 * needed with regards to an upcoming timelock expiration.
6747 * Witness_script is either a offered or received script as defined in BOLT3 for HTLC
6750 * Amount is value of the output spent by this input, committed to in the BIP 143 signature.
6752 * Per_commitment_point is the dynamic point corresponding to the channel state
6753 * detected onchain. It has been generated by our counterparty and is used to derive
6754 * channel state keys, which are then included in the witness script and committed to in the
6755 * BIP 143 signature.
6757 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);
6759 * Create a signature for a (proposed) closing transaction.
6761 * Note that, due to rounding, there may be one \"missing\" satoshi, and either party may have
6762 * chosen to forgo their output as dust.
6764 struct LDKCResult_SignatureNoneZ (*sign_closing_transaction)(const void *this_arg, const struct LDKClosingTransaction *NONNULL_PTR closing_tx);
6766 * Computes the signature for a commitment transaction's anchor output used as an
6767 * input within `anchor_tx`, which spends the commitment transaction, at index `input`.
6769 struct LDKCResult_SignatureNoneZ (*sign_holder_anchor_input)(const void *this_arg, struct LDKTransaction anchor_tx, uintptr_t input);
6771 * Signs a channel announcement message with our funding key and our node secret key (aka
6772 * node_id or network_key), proving it comes from one of the channel participants.
6774 * The first returned signature should be from our node secret key, the second from our
6777 * Note that if this fails or is rejected, the channel will not be publicly announced and
6778 * our counterparty may (though likely will not) close the channel on us for violating the
6781 struct LDKCResult_C2Tuple_SignatureSignatureZNoneZ (*sign_channel_announcement)(const void *this_arg, const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR msg);
6783 * Set the counterparty static channel data, including basepoints,
6784 * counterparty_selected/holder_selected_contest_delay and funding outpoint.
6785 * This is done as soon as the funding outpoint is known. Since these are static channel data,
6786 * they MUST NOT be allowed to change to different values once set.
6788 * channel_parameters.is_populated() MUST be true.
6790 * We bind holder_selected_contest_delay late here for API convenience.
6792 * Will be called before any signatures are applied.
6794 void (*ready_channel)(void *this_arg, const struct LDKChannelTransactionParameters *NONNULL_PTR channel_parameters);
6796 * Frees any resources associated with this object given its this_arg pointer.
6797 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
6799 void (*free)(void *this_arg);
6803 * A cloneable signer.
6805 * Although we require signers to be cloneable, it may be useful for developers to be able to use
6806 * signers in an un-sized way, for example as `dyn BaseSign`. Therefore we separate the Clone trait,
6807 * which implies Sized, into this derived trait.
6809 typedef struct LDKSign {
6811 * An opaque pointer which is passed to your function implementations as an argument.
6812 * This has no meaning in the LDK, and can be NULL or any other value.
6816 * Implementation of BaseSign for this object.
6818 struct LDKBaseSign BaseSign;
6820 * Serialize the object into a byte array
6822 struct LDKCVec_u8Z (*write)(const void *this_arg);
6824 * Called, if set, after this Sign has been cloned into a duplicate object.
6825 * The new Sign is provided, and should be mutated as needed to perform a
6826 * deep copy of the object pointed to by this_arg or avoid any double-freeing.
6828 void (*cloned)(struct LDKSign *NONNULL_PTR new_Sign);
6830 * Frees any resources associated with this object given its this_arg pointer.
6831 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
6833 void (*free)(void *this_arg);
6837 * The contents of CResult_SignDecodeErrorZ
6839 typedef union LDKCResult_SignDecodeErrorZPtr {
6841 * A pointer to the contents in the success state.
6842 * Reading from this pointer when `result_ok` is not set is undefined.
6844 struct LDKSign *result;
6846 * A pointer to the contents in the error state.
6847 * Reading from this pointer when `result_ok` is set is undefined.
6849 struct LDKDecodeError *err;
6850 } LDKCResult_SignDecodeErrorZPtr;
6853 * A CResult_SignDecodeErrorZ represents the result of a fallible operation,
6854 * containing a crate::lightning::chain::keysinterface::Sign on success and a crate::lightning::ln::msgs::DecodeError on failure.
6855 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6857 typedef struct LDKCResult_SignDecodeErrorZ {
6859 * The contents of this CResult_SignDecodeErrorZ, accessible via either
6860 * `err` or `result` depending on the state of `result_ok`.
6862 union LDKCResult_SignDecodeErrorZPtr contents;
6864 * Whether this CResult_SignDecodeErrorZ represents a success state.
6867 } LDKCResult_SignDecodeErrorZ;
6870 * Integer in the range `0..32`
6872 typedef struct LDKu5 {
6877 * A dynamically-allocated array of crate::c_types::u5s of arbitrary size.
6878 * This corresponds to std::vector in C++
6880 typedef struct LDKCVec_u5Z {
6882 * The elements in the array.
6883 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
6887 * The number of elements pointed to by `data`.
6893 * Represents a secp256k1 signature serialized as two 32-byte numbers as well as a tag which
6894 * allows recovering the exact public key which created the signature given the message.
6896 typedef struct LDKRecoverableSignature {
6898 * The bytes of the signature in "compact" form plus a "Recovery ID" which allows for
6901 uint8_t serialized_form[68];
6902 } LDKRecoverableSignature;
6905 * The contents of CResult_RecoverableSignatureNoneZ
6907 typedef union LDKCResult_RecoverableSignatureNoneZPtr {
6909 * A pointer to the contents in the success state.
6910 * Reading from this pointer when `result_ok` is not set is undefined.
6912 struct LDKRecoverableSignature *result;
6914 * Note that this value is always NULL, as there are no contents in the Err variant
6917 } LDKCResult_RecoverableSignatureNoneZPtr;
6920 * A CResult_RecoverableSignatureNoneZ represents the result of a fallible operation,
6921 * containing a crate::c_types::RecoverableSignature on success and a () on failure.
6922 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6924 typedef struct LDKCResult_RecoverableSignatureNoneZ {
6926 * The contents of this CResult_RecoverableSignatureNoneZ, accessible via either
6927 * `err` or `result` depending on the state of `result_ok`.
6929 union LDKCResult_RecoverableSignatureNoneZPtr contents;
6931 * Whether this CResult_RecoverableSignatureNoneZ represents a success state.
6934 } LDKCResult_RecoverableSignatureNoneZ;
6937 * A dynamically-allocated array of crate::c_types::derived::CVec_u8Zs of arbitrary size.
6938 * This corresponds to std::vector in C++
6940 typedef struct LDKCVec_CVec_u8ZZ {
6942 * The elements in the array.
6943 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
6945 struct LDKCVec_u8Z *data;
6947 * The number of elements pointed to by `data`.
6950 } LDKCVec_CVec_u8ZZ;
6953 * The contents of CResult_CVec_CVec_u8ZZNoneZ
6955 typedef union LDKCResult_CVec_CVec_u8ZZNoneZPtr {
6957 * A pointer to the contents in the success state.
6958 * Reading from this pointer when `result_ok` is not set is undefined.
6960 struct LDKCVec_CVec_u8ZZ *result;
6962 * Note that this value is always NULL, as there are no contents in the Err variant
6965 } LDKCResult_CVec_CVec_u8ZZNoneZPtr;
6968 * A CResult_CVec_CVec_u8ZZNoneZ represents the result of a fallible operation,
6969 * containing a crate::c_types::derived::CVec_CVec_u8ZZ on success and a () on failure.
6970 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6972 typedef struct LDKCResult_CVec_CVec_u8ZZNoneZ {
6974 * The contents of this CResult_CVec_CVec_u8ZZNoneZ, accessible via either
6975 * `err` or `result` depending on the state of `result_ok`.
6977 union LDKCResult_CVec_CVec_u8ZZNoneZPtr contents;
6979 * Whether this CResult_CVec_CVec_u8ZZNoneZ represents a success state.
6982 } LDKCResult_CVec_CVec_u8ZZNoneZ;
6987 * A simple implementation of Sign that just keeps the private keys in memory.
6989 * This implementation performs no policy checks and is insufficient by itself as
6990 * a secure external signer.
6992 typedef struct MUST_USE_STRUCT LDKInMemorySigner {
6994 * A pointer to the opaque Rust object.
6995 * Nearly everywhere, inner must be non-null, however in places where
6996 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6998 LDKnativeInMemorySigner *inner;
7000 * Indicates that this is the only struct which contains the same pointer.
7001 * Rust functions which take ownership of an object provided via an argument require
7002 * this to be true and invalidate the object pointed to by inner.
7005 } LDKInMemorySigner;
7008 * The contents of CResult_InMemorySignerDecodeErrorZ
7010 typedef union LDKCResult_InMemorySignerDecodeErrorZPtr {
7012 * A pointer to the contents in the success state.
7013 * Reading from this pointer when `result_ok` is not set is undefined.
7015 struct LDKInMemorySigner *result;
7017 * A pointer to the contents in the error state.
7018 * Reading from this pointer when `result_ok` is set is undefined.
7020 struct LDKDecodeError *err;
7021 } LDKCResult_InMemorySignerDecodeErrorZPtr;
7024 * A CResult_InMemorySignerDecodeErrorZ represents the result of a fallible operation,
7025 * containing a crate::lightning::chain::keysinterface::InMemorySigner on success and a crate::lightning::ln::msgs::DecodeError on failure.
7026 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7028 typedef struct LDKCResult_InMemorySignerDecodeErrorZ {
7030 * The contents of this CResult_InMemorySignerDecodeErrorZ, accessible via either
7031 * `err` or `result` depending on the state of `result_ok`.
7033 union LDKCResult_InMemorySignerDecodeErrorZPtr contents;
7035 * Whether this CResult_InMemorySignerDecodeErrorZ represents a success state.
7038 } LDKCResult_InMemorySignerDecodeErrorZ;
7041 * A dynamically-allocated array of crate::c_types::TxOuts of arbitrary size.
7042 * This corresponds to std::vector in C++
7044 typedef struct LDKCVec_TxOutZ {
7046 * The elements in the array.
7047 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
7049 struct LDKTxOut *data;
7051 * The number of elements pointed to by `data`.
7057 * The contents of CResult_TransactionNoneZ
7059 typedef union LDKCResult_TransactionNoneZPtr {
7061 * A pointer to the contents in the success state.
7062 * Reading from this pointer when `result_ok` is not set is undefined.
7064 struct LDKTransaction *result;
7066 * Note that this value is always NULL, as there are no contents in the Err variant
7069 } LDKCResult_TransactionNoneZPtr;
7072 * A CResult_TransactionNoneZ represents the result of a fallible operation,
7073 * containing a crate::c_types::Transaction on success and a () on failure.
7074 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7076 typedef struct LDKCResult_TransactionNoneZ {
7078 * The contents of this CResult_TransactionNoneZ, accessible via either
7079 * `err` or `result` depending on the state of `result_ok`.
7081 union LDKCResult_TransactionNoneZPtr contents;
7083 * Whether this CResult_TransactionNoneZ represents a success state.
7086 } LDKCResult_TransactionNoneZ;
7091 * A ChannelMonitor handles chain events (blocks connected and disconnected) and generates
7092 * on-chain transactions to ensure no loss of funds occurs.
7094 * You MUST ensure that no ChannelMonitors for a given channel anywhere contain out-of-date
7095 * information and are actively monitoring the chain.
7097 * Pending Events or updated HTLCs which have not yet been read out by
7098 * get_and_clear_pending_monitor_events or get_and_clear_pending_events are serialized to disk and
7099 * reloaded at deserialize-time. Thus, you must ensure that, when handling events, all events
7100 * gotten are fully handled before re-serializing the new state.
7102 * Note that the deserializer is only implemented for (BlockHash, ChannelMonitor), which
7103 * tells you the last block hash which was block_connect()ed. You MUST rescan any blocks along
7104 * the \"reorg path\" (ie disconnecting blocks until you find a common ancestor from both the
7105 * returned block hash and the the current chain and then reconnecting blocks to get to the
7106 * best chain) upon deserializing the object!
7108 typedef struct MUST_USE_STRUCT LDKChannelMonitor {
7110 * A pointer to the opaque Rust object.
7111 * Nearly everywhere, inner must be non-null, however in places where
7112 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7114 LDKnativeChannelMonitor *inner;
7116 * Indicates that this is the only struct which contains the same pointer.
7117 * Rust functions which take ownership of an object provided via an argument require
7118 * this to be true and invalidate the object pointed to by inner.
7121 } LDKChannelMonitor;
7124 * A tuple of 2 elements. See the individual fields for the types contained.
7126 typedef struct LDKC2Tuple_BlockHashChannelMonitorZ {
7128 * The element at position 0
7130 struct LDKThirtyTwoBytes a;
7132 * The element at position 1
7134 struct LDKChannelMonitor b;
7135 } LDKC2Tuple_BlockHashChannelMonitorZ;
7138 * A dynamically-allocated array of crate::c_types::derived::C2Tuple_BlockHashChannelMonitorZs of arbitrary size.
7139 * This corresponds to std::vector in C++
7141 typedef struct LDKCVec_C2Tuple_BlockHashChannelMonitorZZ {
7143 * The elements in the array.
7144 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
7146 struct LDKC2Tuple_BlockHashChannelMonitorZ *data;
7148 * The number of elements pointed to by `data`.
7151 } LDKCVec_C2Tuple_BlockHashChannelMonitorZZ;
7154 * The contents of CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ
7156 typedef union LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZPtr {
7158 * A pointer to the contents in the success state.
7159 * Reading from this pointer when `result_ok` is not set is undefined.
7161 struct LDKCVec_C2Tuple_BlockHashChannelMonitorZZ *result;
7163 * A pointer to the contents in the error state.
7164 * Reading from this pointer when `result_ok` is set is undefined.
7166 enum LDKIOError *err;
7167 } LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZPtr;
7170 * A CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ represents the result of a fallible operation,
7171 * containing a crate::c_types::derived::CVec_C2Tuple_BlockHashChannelMonitorZZ on success and a crate::c_types::IOError on failure.
7172 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7174 typedef struct LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ {
7176 * The contents of this CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ, accessible via either
7177 * `err` or `result` depending on the state of `result_ok`.
7179 union LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZPtr contents;
7181 * Whether this CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ represents a success state.
7184 } LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ;
7187 * An enum which can either contain a u16 or not
7189 typedef enum LDKCOption_u16Z_Tag {
7191 * When we're in this state, this COption_u16Z contains a u16
7193 LDKCOption_u16Z_Some,
7195 * When we're in this state, this COption_u16Z contains nothing
7197 LDKCOption_u16Z_None,
7199 * Must be last for serialization purposes
7201 LDKCOption_u16Z_Sentinel,
7202 } LDKCOption_u16Z_Tag;
7204 typedef struct LDKCOption_u16Z {
7205 LDKCOption_u16Z_Tag tag;
7214 * Indicates an error on the client's part (usually some variant of attempting to use too-low or
7217 typedef enum LDKAPIError_Tag {
7219 * Indicates the API was wholly misused (see err for more). Cases where these can be returned
7220 * are documented, but generally indicates some precondition of a function was violated.
7222 LDKAPIError_APIMisuseError,
7224 * Due to a high feerate, we were unable to complete the request.
7225 * For example, this may be returned if the feerate implies we cannot open a channel at the
7226 * requested value, but opening a larger channel would succeed.
7228 LDKAPIError_FeeRateTooHigh,
7230 * A malformed Route was provided (eg overflowed value, node id mismatch, overly-looped route,
7231 * too-many-hops, etc).
7233 LDKAPIError_RouteError,
7235 * We were unable to complete the request as the Channel required to do so is unable to
7236 * complete the request (or was not found). This can take many forms, including disconnected
7237 * peer, channel at capacity, channel shutting down, etc.
7239 LDKAPIError_ChannelUnavailable,
7241 * An attempt to call [`chain::Watch::watch_channel`]/[`chain::Watch::update_channel`]
7242 * returned a [`ChannelMonitorUpdateStatus::InProgress`] indicating the persistence of a
7243 * monitor update is awaiting async resolution. Once it resolves the attempted action should
7244 * complete automatically.
7246 * [`chain::Watch::watch_channel`]: crate::chain::Watch::watch_channel
7247 * [`chain::Watch::update_channel`]: crate::chain::Watch::update_channel
7248 * [`ChannelMonitorUpdateStatus::InProgress`]: crate::chain::ChannelMonitorUpdateStatus::InProgress
7250 LDKAPIError_MonitorUpdateInProgress,
7252 * [`KeysInterface::get_shutdown_scriptpubkey`] returned a shutdown scriptpubkey incompatible
7253 * with the channel counterparty as negotiated in [`InitFeatures`].
7255 * Using a SegWit v0 script should resolve this issue. If you cannot, you won't be able to open
7256 * a channel or cooperatively close one with this peer (and will have to force-close instead).
7258 * [`KeysInterface::get_shutdown_scriptpubkey`]: crate::chain::keysinterface::KeysInterface::get_shutdown_scriptpubkey
7259 * [`InitFeatures`]: crate::ln::features::InitFeatures
7261 LDKAPIError_IncompatibleShutdownScript,
7263 * Must be last for serialization purposes
7265 LDKAPIError_Sentinel,
7268 typedef struct LDKAPIError_LDKAPIMisuseError_Body {
7270 * A human-readable error message
7273 } LDKAPIError_LDKAPIMisuseError_Body;
7275 typedef struct LDKAPIError_LDKFeeRateTooHigh_Body {
7277 * A human-readable error message
7281 * The feerate which was too high.
7284 } LDKAPIError_LDKFeeRateTooHigh_Body;
7286 typedef struct LDKAPIError_LDKRouteError_Body {
7288 * A human-readable error message
7291 } LDKAPIError_LDKRouteError_Body;
7293 typedef struct LDKAPIError_LDKChannelUnavailable_Body {
7295 * A human-readable error message
7298 } LDKAPIError_LDKChannelUnavailable_Body;
7300 typedef struct LDKAPIError_LDKIncompatibleShutdownScript_Body {
7302 * The incompatible shutdown script.
7304 struct LDKShutdownScript script;
7305 } LDKAPIError_LDKIncompatibleShutdownScript_Body;
7307 typedef struct MUST_USE_STRUCT LDKAPIError {
7308 LDKAPIError_Tag tag;
7310 LDKAPIError_LDKAPIMisuseError_Body api_misuse_error;
7311 LDKAPIError_LDKFeeRateTooHigh_Body fee_rate_too_high;
7312 LDKAPIError_LDKRouteError_Body route_error;
7313 LDKAPIError_LDKChannelUnavailable_Body channel_unavailable;
7314 LDKAPIError_LDKIncompatibleShutdownScript_Body incompatible_shutdown_script;
7319 * The contents of CResult_NoneAPIErrorZ
7321 typedef union LDKCResult_NoneAPIErrorZPtr {
7323 * Note that this value is always NULL, as there are no contents in the OK variant
7327 * A pointer to the contents in the error state.
7328 * Reading from this pointer when `result_ok` is set is undefined.
7330 struct LDKAPIError *err;
7331 } LDKCResult_NoneAPIErrorZPtr;
7334 * A CResult_NoneAPIErrorZ represents the result of a fallible operation,
7335 * containing a () on success and a crate::lightning::util::errors::APIError on failure.
7336 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7338 typedef struct LDKCResult_NoneAPIErrorZ {
7340 * The contents of this CResult_NoneAPIErrorZ, accessible via either
7341 * `err` or `result` depending on the state of `result_ok`.
7343 union LDKCResult_NoneAPIErrorZPtr contents;
7345 * Whether this CResult_NoneAPIErrorZ represents a success state.
7348 } LDKCResult_NoneAPIErrorZ;
7351 * A dynamically-allocated array of crate::c_types::derived::CResult_NoneAPIErrorZs of arbitrary size.
7352 * This corresponds to std::vector in C++
7354 typedef struct LDKCVec_CResult_NoneAPIErrorZZ {
7356 * The elements in the array.
7357 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
7359 struct LDKCResult_NoneAPIErrorZ *data;
7361 * The number of elements pointed to by `data`.
7364 } LDKCVec_CResult_NoneAPIErrorZZ;
7367 * A dynamically-allocated array of crate::lightning::util::errors::APIErrors of arbitrary size.
7368 * This corresponds to std::vector in C++
7370 typedef struct LDKCVec_APIErrorZ {
7372 * The elements in the array.
7373 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
7375 struct LDKAPIError *data;
7377 * The number of elements pointed to by `data`.
7380 } LDKCVec_APIErrorZ;
7383 * The contents of CResult__u832APIErrorZ
7385 typedef union LDKCResult__u832APIErrorZPtr {
7387 * A pointer to the contents in the success state.
7388 * Reading from this pointer when `result_ok` is not set is undefined.
7390 struct LDKThirtyTwoBytes *result;
7392 * A pointer to the contents in the error state.
7393 * Reading from this pointer when `result_ok` is set is undefined.
7395 struct LDKAPIError *err;
7396 } LDKCResult__u832APIErrorZPtr;
7399 * A CResult__u832APIErrorZ represents the result of a fallible operation,
7400 * containing a crate::c_types::ThirtyTwoBytes on success and a crate::lightning::util::errors::APIError on failure.
7401 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7403 typedef struct LDKCResult__u832APIErrorZ {
7405 * The contents of this CResult__u832APIErrorZ, accessible via either
7406 * `err` or `result` depending on the state of `result_ok`.
7408 union LDKCResult__u832APIErrorZPtr contents;
7410 * Whether this CResult__u832APIErrorZ represents a success state.
7413 } LDKCResult__u832APIErrorZ;
7416 * If a payment fails to send, it can be in one of several states. This enum is returned as the
7417 * Err() type describing which state the payment is in, see the description of individual enum
7420 typedef enum LDKPaymentSendFailure_Tag {
7422 * A parameter which was passed to send_payment was invalid, preventing us from attempting to
7423 * send the payment at all. No channel state has been changed or messages sent to peers, and
7424 * once you've changed the parameter at error, you can freely retry the payment in full.
7426 LDKPaymentSendFailure_ParameterError,
7428 * A parameter in a single path which was passed to send_payment was invalid, preventing us
7429 * from attempting to send the payment at all. No channel state has been changed or messages
7430 * sent to peers, and once you've changed the parameter at error, you can freely retry the
7433 * The results here are ordered the same as the paths in the route object which was passed to
7436 LDKPaymentSendFailure_PathParameterError,
7438 * All paths which were attempted failed to send, with no channel state change taking place.
7439 * You can freely retry the payment in full (though you probably want to do so over different
7440 * paths than the ones selected).
7442 LDKPaymentSendFailure_AllFailedRetrySafe,
7444 * Some paths which were attempted failed to send, though possibly not all. At least some
7445 * paths have irrevocably committed to the HTLC and retrying the payment in full would result
7446 * in over-/re-payment.
7448 * The results here are ordered the same as the paths in the route object which was passed to
7449 * send_payment, and any `Err`s which are not [`APIError::MonitorUpdateInProgress`] can be
7450 * safely retried via [`ChannelManager::retry_payment`].
7452 * Any entries which contain `Err(APIError::MonitorUpdateInprogress)` or `Ok(())` MUST NOT be
7453 * retried as they will result in over-/re-payment. These HTLCs all either successfully sent
7454 * (in the case of `Ok(())`) or will send once a [`MonitorEvent::Completed`] is provided for
7455 * the next-hop channel with the latest update_id.
7457 LDKPaymentSendFailure_PartialFailure,
7459 * Must be last for serialization purposes
7461 LDKPaymentSendFailure_Sentinel,
7462 } LDKPaymentSendFailure_Tag;
7464 typedef struct LDKPaymentSendFailure_LDKPartialFailure_Body {
7466 * The errors themselves, in the same order as the route hops.
7468 struct LDKCVec_CResult_NoneAPIErrorZZ results;
7470 * If some paths failed without irrevocably committing to the new HTLC(s), this will
7471 * contain a [`RouteParameters`] object which can be used to calculate a new route that
7472 * will pay all remaining unpaid balance.
7474 * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
7476 struct LDKRouteParameters failed_paths_retry;
7478 * The payment id for the payment, which is now at least partially pending.
7480 struct LDKThirtyTwoBytes payment_id;
7481 } LDKPaymentSendFailure_LDKPartialFailure_Body;
7483 typedef struct MUST_USE_STRUCT LDKPaymentSendFailure {
7484 LDKPaymentSendFailure_Tag tag;
7487 struct LDKAPIError parameter_error;
7490 struct LDKCVec_CResult_NoneAPIErrorZZ path_parameter_error;
7493 struct LDKCVec_APIErrorZ all_failed_retry_safe;
7495 LDKPaymentSendFailure_LDKPartialFailure_Body partial_failure;
7497 } LDKPaymentSendFailure;
7500 * The contents of CResult_PaymentIdPaymentSendFailureZ
7502 typedef union LDKCResult_PaymentIdPaymentSendFailureZPtr {
7504 * A pointer to the contents in the success state.
7505 * Reading from this pointer when `result_ok` is not set is undefined.
7507 struct LDKThirtyTwoBytes *result;
7509 * A pointer to the contents in the error state.
7510 * Reading from this pointer when `result_ok` is set is undefined.
7512 struct LDKPaymentSendFailure *err;
7513 } LDKCResult_PaymentIdPaymentSendFailureZPtr;
7516 * A CResult_PaymentIdPaymentSendFailureZ represents the result of a fallible operation,
7517 * containing a crate::c_types::ThirtyTwoBytes on success and a crate::lightning::ln::channelmanager::PaymentSendFailure on failure.
7518 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7520 typedef struct LDKCResult_PaymentIdPaymentSendFailureZ {
7522 * The contents of this CResult_PaymentIdPaymentSendFailureZ, accessible via either
7523 * `err` or `result` depending on the state of `result_ok`.
7525 union LDKCResult_PaymentIdPaymentSendFailureZPtr contents;
7527 * Whether this CResult_PaymentIdPaymentSendFailureZ represents a success state.
7530 } LDKCResult_PaymentIdPaymentSendFailureZ;
7533 * The contents of CResult_NonePaymentSendFailureZ
7535 typedef union LDKCResult_NonePaymentSendFailureZPtr {
7537 * Note that this value is always NULL, as there are no contents in the OK variant
7541 * A pointer to the contents in the error state.
7542 * Reading from this pointer when `result_ok` is set is undefined.
7544 struct LDKPaymentSendFailure *err;
7545 } LDKCResult_NonePaymentSendFailureZPtr;
7548 * A CResult_NonePaymentSendFailureZ represents the result of a fallible operation,
7549 * containing a () on success and a crate::lightning::ln::channelmanager::PaymentSendFailure on failure.
7550 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7552 typedef struct LDKCResult_NonePaymentSendFailureZ {
7554 * The contents of this CResult_NonePaymentSendFailureZ, accessible via either
7555 * `err` or `result` depending on the state of `result_ok`.
7557 union LDKCResult_NonePaymentSendFailureZPtr contents;
7559 * Whether this CResult_NonePaymentSendFailureZ represents a success state.
7562 } LDKCResult_NonePaymentSendFailureZ;
7565 * A tuple of 2 elements. See the individual fields for the types contained.
7567 typedef struct LDKC2Tuple_PaymentHashPaymentIdZ {
7569 * The element at position 0
7571 struct LDKThirtyTwoBytes a;
7573 * The element at position 1
7575 struct LDKThirtyTwoBytes b;
7576 } LDKC2Tuple_PaymentHashPaymentIdZ;
7579 * The contents of CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ
7581 typedef union LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZPtr {
7583 * A pointer to the contents in the success state.
7584 * Reading from this pointer when `result_ok` is not set is undefined.
7586 struct LDKC2Tuple_PaymentHashPaymentIdZ *result;
7588 * A pointer to the contents in the error state.
7589 * Reading from this pointer when `result_ok` is set is undefined.
7591 struct LDKPaymentSendFailure *err;
7592 } LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZPtr;
7595 * A CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ represents the result of a fallible operation,
7596 * containing a crate::c_types::derived::C2Tuple_PaymentHashPaymentIdZ on success and a crate::lightning::ln::channelmanager::PaymentSendFailure on failure.
7597 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7599 typedef struct LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ {
7601 * The contents of this CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ, accessible via either
7602 * `err` or `result` depending on the state of `result_ok`.
7604 union LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZPtr contents;
7606 * Whether this CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ represents a success state.
7609 } LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ;
7612 * A dynamically-allocated array of crate::c_types::ThirtyTwoBytess of arbitrary size.
7613 * This corresponds to std::vector in C++
7615 typedef struct LDKCVec_ThirtyTwoBytesZ {
7617 * The elements in the array.
7618 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
7620 struct LDKThirtyTwoBytes *data;
7622 * The number of elements pointed to by `data`.
7625 } LDKCVec_ThirtyTwoBytesZ;
7628 * A tuple of 2 elements. See the individual fields for the types contained.
7630 typedef struct LDKC2Tuple_PaymentHashPaymentSecretZ {
7632 * The element at position 0
7634 struct LDKThirtyTwoBytes a;
7636 * The element at position 1
7638 struct LDKThirtyTwoBytes b;
7639 } LDKC2Tuple_PaymentHashPaymentSecretZ;
7642 * The contents of CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ
7644 typedef union LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZPtr {
7646 * A pointer to the contents in the success state.
7647 * Reading from this pointer when `result_ok` is not set is undefined.
7649 struct LDKC2Tuple_PaymentHashPaymentSecretZ *result;
7651 * Note that this value is always NULL, as there are no contents in the Err variant
7654 } LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZPtr;
7657 * A CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ represents the result of a fallible operation,
7658 * containing a crate::c_types::derived::C2Tuple_PaymentHashPaymentSecretZ on success and a () on failure.
7659 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7661 typedef struct LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ {
7663 * The contents of this CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ, accessible via either
7664 * `err` or `result` depending on the state of `result_ok`.
7666 union LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZPtr contents;
7668 * Whether this CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ represents a success state.
7671 } LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ;
7674 * The contents of CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ
7676 typedef union LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZPtr {
7678 * A pointer to the contents in the success state.
7679 * Reading from this pointer when `result_ok` is not set is undefined.
7681 struct LDKC2Tuple_PaymentHashPaymentSecretZ *result;
7683 * A pointer to the contents in the error state.
7684 * Reading from this pointer when `result_ok` is set is undefined.
7686 struct LDKAPIError *err;
7687 } LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZPtr;
7690 * A CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ represents the result of a fallible operation,
7691 * containing a crate::c_types::derived::C2Tuple_PaymentHashPaymentSecretZ on success and a crate::lightning::util::errors::APIError on failure.
7692 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7694 typedef struct LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ {
7696 * The contents of this CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ, accessible via either
7697 * `err` or `result` depending on the state of `result_ok`.
7699 union LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZPtr contents;
7701 * Whether this CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ represents a success state.
7704 } LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ;
7707 * The contents of CResult_PaymentSecretNoneZ
7709 typedef union LDKCResult_PaymentSecretNoneZPtr {
7711 * A pointer to the contents in the success state.
7712 * Reading from this pointer when `result_ok` is not set is undefined.
7714 struct LDKThirtyTwoBytes *result;
7716 * Note that this value is always NULL, as there are no contents in the Err variant
7719 } LDKCResult_PaymentSecretNoneZPtr;
7722 * A CResult_PaymentSecretNoneZ represents the result of a fallible operation,
7723 * containing a crate::c_types::ThirtyTwoBytes on success and a () on failure.
7724 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7726 typedef struct LDKCResult_PaymentSecretNoneZ {
7728 * The contents of this CResult_PaymentSecretNoneZ, accessible via either
7729 * `err` or `result` depending on the state of `result_ok`.
7731 union LDKCResult_PaymentSecretNoneZPtr contents;
7733 * Whether this CResult_PaymentSecretNoneZ represents a success state.
7736 } LDKCResult_PaymentSecretNoneZ;
7739 * The contents of CResult_PaymentSecretAPIErrorZ
7741 typedef union LDKCResult_PaymentSecretAPIErrorZPtr {
7743 * A pointer to the contents in the success state.
7744 * Reading from this pointer when `result_ok` is not set is undefined.
7746 struct LDKThirtyTwoBytes *result;
7748 * A pointer to the contents in the error state.
7749 * Reading from this pointer when `result_ok` is set is undefined.
7751 struct LDKAPIError *err;
7752 } LDKCResult_PaymentSecretAPIErrorZPtr;
7755 * A CResult_PaymentSecretAPIErrorZ represents the result of a fallible operation,
7756 * containing a crate::c_types::ThirtyTwoBytes on success and a crate::lightning::util::errors::APIError on failure.
7757 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7759 typedef struct LDKCResult_PaymentSecretAPIErrorZ {
7761 * The contents of this CResult_PaymentSecretAPIErrorZ, accessible via either
7762 * `err` or `result` depending on the state of `result_ok`.
7764 union LDKCResult_PaymentSecretAPIErrorZPtr contents;
7766 * Whether this CResult_PaymentSecretAPIErrorZ represents a success state.
7769 } LDKCResult_PaymentSecretAPIErrorZ;
7772 * The contents of CResult_PaymentPreimageAPIErrorZ
7774 typedef union LDKCResult_PaymentPreimageAPIErrorZPtr {
7776 * A pointer to the contents in the success state.
7777 * Reading from this pointer when `result_ok` is not set is undefined.
7779 struct LDKThirtyTwoBytes *result;
7781 * A pointer to the contents in the error state.
7782 * Reading from this pointer when `result_ok` is set is undefined.
7784 struct LDKAPIError *err;
7785 } LDKCResult_PaymentPreimageAPIErrorZPtr;
7788 * A CResult_PaymentPreimageAPIErrorZ represents the result of a fallible operation,
7789 * containing a crate::c_types::ThirtyTwoBytes on success and a crate::lightning::util::errors::APIError on failure.
7790 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7792 typedef struct LDKCResult_PaymentPreimageAPIErrorZ {
7794 * The contents of this CResult_PaymentPreimageAPIErrorZ, accessible via either
7795 * `err` or `result` depending on the state of `result_ok`.
7797 union LDKCResult_PaymentPreimageAPIErrorZPtr contents;
7799 * Whether this CResult_PaymentPreimageAPIErrorZ represents a success state.
7802 } LDKCResult_PaymentPreimageAPIErrorZ;
7807 * Information needed for constructing an invoice route hint for this channel.
7809 typedef struct MUST_USE_STRUCT LDKCounterpartyForwardingInfo {
7811 * A pointer to the opaque Rust object.
7812 * Nearly everywhere, inner must be non-null, however in places where
7813 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7815 LDKnativeCounterpartyForwardingInfo *inner;
7817 * Indicates that this is the only struct which contains the same pointer.
7818 * Rust functions which take ownership of an object provided via an argument require
7819 * this to be true and invalidate the object pointed to by inner.
7822 } LDKCounterpartyForwardingInfo;
7825 * The contents of CResult_CounterpartyForwardingInfoDecodeErrorZ
7827 typedef union LDKCResult_CounterpartyForwardingInfoDecodeErrorZPtr {
7829 * A pointer to the contents in the success state.
7830 * Reading from this pointer when `result_ok` is not set is undefined.
7832 struct LDKCounterpartyForwardingInfo *result;
7834 * A pointer to the contents in the error state.
7835 * Reading from this pointer when `result_ok` is set is undefined.
7837 struct LDKDecodeError *err;
7838 } LDKCResult_CounterpartyForwardingInfoDecodeErrorZPtr;
7841 * A CResult_CounterpartyForwardingInfoDecodeErrorZ represents the result of a fallible operation,
7842 * containing a crate::lightning::ln::channelmanager::CounterpartyForwardingInfo on success and a crate::lightning::ln::msgs::DecodeError on failure.
7843 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7845 typedef struct LDKCResult_CounterpartyForwardingInfoDecodeErrorZ {
7847 * The contents of this CResult_CounterpartyForwardingInfoDecodeErrorZ, accessible via either
7848 * `err` or `result` depending on the state of `result_ok`.
7850 union LDKCResult_CounterpartyForwardingInfoDecodeErrorZPtr contents;
7852 * Whether this CResult_CounterpartyForwardingInfoDecodeErrorZ represents a success state.
7855 } LDKCResult_CounterpartyForwardingInfoDecodeErrorZ;
7860 * Channel parameters which apply to our counterparty. These are split out from [`ChannelDetails`]
7861 * to better separate parameters.
7863 typedef struct MUST_USE_STRUCT LDKChannelCounterparty {
7865 * A pointer to the opaque Rust object.
7866 * Nearly everywhere, inner must be non-null, however in places where
7867 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7869 LDKnativeChannelCounterparty *inner;
7871 * Indicates that this is the only struct which contains the same pointer.
7872 * Rust functions which take ownership of an object provided via an argument require
7873 * this to be true and invalidate the object pointed to by inner.
7876 } LDKChannelCounterparty;
7879 * The contents of CResult_ChannelCounterpartyDecodeErrorZ
7881 typedef union LDKCResult_ChannelCounterpartyDecodeErrorZPtr {
7883 * A pointer to the contents in the success state.
7884 * Reading from this pointer when `result_ok` is not set is undefined.
7886 struct LDKChannelCounterparty *result;
7888 * A pointer to the contents in the error state.
7889 * Reading from this pointer when `result_ok` is set is undefined.
7891 struct LDKDecodeError *err;
7892 } LDKCResult_ChannelCounterpartyDecodeErrorZPtr;
7895 * A CResult_ChannelCounterpartyDecodeErrorZ represents the result of a fallible operation,
7896 * containing a crate::lightning::ln::channelmanager::ChannelCounterparty on success and a crate::lightning::ln::msgs::DecodeError on failure.
7897 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7899 typedef struct LDKCResult_ChannelCounterpartyDecodeErrorZ {
7901 * The contents of this CResult_ChannelCounterpartyDecodeErrorZ, accessible via either
7902 * `err` or `result` depending on the state of `result_ok`.
7904 union LDKCResult_ChannelCounterpartyDecodeErrorZPtr contents;
7906 * Whether this CResult_ChannelCounterpartyDecodeErrorZ represents a success state.
7909 } LDKCResult_ChannelCounterpartyDecodeErrorZ;
7912 * The contents of CResult_ChannelDetailsDecodeErrorZ
7914 typedef union LDKCResult_ChannelDetailsDecodeErrorZPtr {
7916 * A pointer to the contents in the success state.
7917 * Reading from this pointer when `result_ok` is not set is undefined.
7919 struct LDKChannelDetails *result;
7921 * A pointer to the contents in the error state.
7922 * Reading from this pointer when `result_ok` is set is undefined.
7924 struct LDKDecodeError *err;
7925 } LDKCResult_ChannelDetailsDecodeErrorZPtr;
7928 * A CResult_ChannelDetailsDecodeErrorZ represents the result of a fallible operation,
7929 * containing a crate::lightning::ln::channelmanager::ChannelDetails on success and a crate::lightning::ln::msgs::DecodeError on failure.
7930 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7932 typedef struct LDKCResult_ChannelDetailsDecodeErrorZ {
7934 * The contents of this CResult_ChannelDetailsDecodeErrorZ, accessible via either
7935 * `err` or `result` depending on the state of `result_ok`.
7937 union LDKCResult_ChannelDetailsDecodeErrorZPtr contents;
7939 * Whether this CResult_ChannelDetailsDecodeErrorZ represents a success state.
7942 } LDKCResult_ChannelDetailsDecodeErrorZ;
7947 * Route hints used in constructing invoices for [phantom node payents].
7949 * [phantom node payments]: crate::chain::keysinterface::PhantomKeysManager
7951 typedef struct MUST_USE_STRUCT LDKPhantomRouteHints {
7953 * A pointer to the opaque Rust object.
7954 * Nearly everywhere, inner must be non-null, however in places where
7955 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7957 LDKnativePhantomRouteHints *inner;
7959 * Indicates that this is the only struct which contains the same pointer.
7960 * Rust functions which take ownership of an object provided via an argument require
7961 * this to be true and invalidate the object pointed to by inner.
7964 } LDKPhantomRouteHints;
7967 * The contents of CResult_PhantomRouteHintsDecodeErrorZ
7969 typedef union LDKCResult_PhantomRouteHintsDecodeErrorZPtr {
7971 * A pointer to the contents in the success state.
7972 * Reading from this pointer when `result_ok` is not set is undefined.
7974 struct LDKPhantomRouteHints *result;
7976 * A pointer to the contents in the error state.
7977 * Reading from this pointer when `result_ok` is set is undefined.
7979 struct LDKDecodeError *err;
7980 } LDKCResult_PhantomRouteHintsDecodeErrorZPtr;
7983 * A CResult_PhantomRouteHintsDecodeErrorZ represents the result of a fallible operation,
7984 * containing a crate::lightning::ln::channelmanager::PhantomRouteHints on success and a crate::lightning::ln::msgs::DecodeError on failure.
7985 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7987 typedef struct LDKCResult_PhantomRouteHintsDecodeErrorZ {
7989 * The contents of this CResult_PhantomRouteHintsDecodeErrorZ, accessible via either
7990 * `err` or `result` depending on the state of `result_ok`.
7992 union LDKCResult_PhantomRouteHintsDecodeErrorZPtr contents;
7994 * Whether this CResult_PhantomRouteHintsDecodeErrorZ represents a success state.
7997 } LDKCResult_PhantomRouteHintsDecodeErrorZ;
8000 * A dynamically-allocated array of crate::lightning::chain::channelmonitor::ChannelMonitors of arbitrary size.
8001 * This corresponds to std::vector in C++
8003 typedef struct LDKCVec_ChannelMonitorZ {
8005 * The elements in the array.
8006 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
8008 struct LDKChannelMonitor *data;
8010 * The number of elements pointed to by `data`.
8013 } LDKCVec_ChannelMonitorZ;
8018 * An update generated by the underlying channel itself which contains some new information the
8019 * [`ChannelMonitor`] should be made aware of.
8021 * Because this represents only a small number of updates to the underlying state, it is generally
8022 * much smaller than a full [`ChannelMonitor`]. However, for large single commitment transaction
8023 * updates (e.g. ones during which there are hundreds of HTLCs pending on the commitment
8024 * transaction), a single update may reach upwards of 1 MiB in serialized size.
8026 typedef struct MUST_USE_STRUCT LDKChannelMonitorUpdate {
8028 * A pointer to the opaque Rust object.
8029 * Nearly everywhere, inner must be non-null, however in places where
8030 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8032 LDKnativeChannelMonitorUpdate *inner;
8034 * Indicates that this is the only struct which contains the same pointer.
8035 * Rust functions which take ownership of an object provided via an argument require
8036 * this to be true and invalidate the object pointed to by inner.
8039 } LDKChannelMonitorUpdate;
8042 * The `Watch` trait defines behavior for watching on-chain activity pertaining to channels as
8043 * blocks are connected and disconnected.
8045 * Each channel is associated with a [`ChannelMonitor`]. Implementations of this trait are
8046 * responsible for maintaining a set of monitors such that they can be updated accordingly as
8047 * channel state changes and HTLCs are resolved. See method documentation for specific
8050 * Implementations **must** ensure that updates are successfully applied and persisted upon method
8051 * completion. If an update fails with a [`PermanentFailure`], then it must immediately shut down
8052 * without taking any further action such as persisting the current state.
8054 * If an implementation maintains multiple instances of a channel's monitor (e.g., by storing
8055 * backup copies), then it must ensure that updates are applied across all instances. Otherwise, it
8056 * could result in a revoked transaction being broadcast, allowing the counterparty to claim all
8057 * funds in the channel. See [`ChannelMonitorUpdateStatus`] for more details about how to handle
8058 * multiple instances.
8060 * [`PermanentFailure`]: ChannelMonitorUpdateStatus::PermanentFailure
8062 typedef struct LDKWatch {
8064 * An opaque pointer which is passed to your function implementations as an argument.
8065 * This has no meaning in the LDK, and can be NULL or any other value.
8069 * Watches a channel identified by `funding_txo` using `monitor`.
8071 * Implementations are responsible for watching the chain for the funding transaction along
8072 * with any spends of outputs returned by [`get_outputs_to_watch`]. In practice, this means
8073 * calling [`block_connected`] and [`block_disconnected`] on the monitor.
8075 * Note: this interface MUST error with [`ChannelMonitorUpdateStatus::PermanentFailure`] if
8076 * the given `funding_txo` has previously been registered via `watch_channel`.
8078 * [`get_outputs_to_watch`]: channelmonitor::ChannelMonitor::get_outputs_to_watch
8079 * [`block_connected`]: channelmonitor::ChannelMonitor::block_connected
8080 * [`block_disconnected`]: channelmonitor::ChannelMonitor::block_disconnected
8082 enum LDKChannelMonitorUpdateStatus (*watch_channel)(const void *this_arg, struct LDKOutPoint funding_txo, struct LDKChannelMonitor monitor);
8084 * Updates a channel identified by `funding_txo` by applying `update` to its monitor.
8086 * Implementations must call [`update_monitor`] with the given update. See
8087 * [`ChannelMonitorUpdateStatus`] for invariants around returning an error.
8089 * [`update_monitor`]: channelmonitor::ChannelMonitor::update_monitor
8091 enum LDKChannelMonitorUpdateStatus (*update_channel)(const void *this_arg, struct LDKOutPoint funding_txo, struct LDKChannelMonitorUpdate update);
8093 * Returns any monitor events since the last call. Subsequent calls must only return new
8096 * Note that after any block- or transaction-connection calls to a [`ChannelMonitor`], no
8097 * further events may be returned here until the [`ChannelMonitor`] has been fully persisted
8100 * For details on asynchronous [`ChannelMonitor`] updating and returning
8101 * [`MonitorEvent::Completed`] here, see [`ChannelMonitorUpdateStatus::InProgress`].
8103 struct LDKCVec_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZZ (*release_pending_monitor_events)(const void *this_arg);
8105 * Frees any resources associated with this object given its this_arg pointer.
8106 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
8108 void (*free)(void *this_arg);
8112 * An interface to send a transaction to the Bitcoin network.
8114 typedef struct LDKBroadcasterInterface {
8116 * An opaque pointer which is passed to your function implementations as an argument.
8117 * This has no meaning in the LDK, and can be NULL or any other value.
8121 * Sends a transaction out to (hopefully) be mined.
8123 void (*broadcast_transaction)(const void *this_arg, struct LDKTransaction tx);
8125 * Frees any resources associated with this object given its this_arg pointer.
8126 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
8128 void (*free)(void *this_arg);
8129 } LDKBroadcasterInterface;
8132 * A "slice" referencing some byte array. This is simply a length-tagged pointer which does not
8133 * own the memory pointed to by data.
8135 typedef struct LDKu8slice {
8137 * A pointer to the byte buffer
8139 const uint8_t *data;
8141 * The number of bytes pointed to by `data`.
8147 * A trait to describe an object which can get user secrets and key material.
8149 typedef struct LDKKeysInterface {
8151 * An opaque pointer which is passed to your function implementations as an argument.
8152 * This has no meaning in the LDK, and can be NULL or any other value.
8156 * Get node secret key based on the provided [`Recipient`].
8158 * The node_id/network_key is the public key that corresponds to this secret key.
8160 * This method must return the same value each time it is called with a given `Recipient`
8163 * Errors if the `Recipient` variant is not supported by the implementation.
8165 struct LDKCResult_SecretKeyNoneZ (*get_node_secret)(const void *this_arg, enum LDKRecipient recipient);
8167 * Get node id based on the provided [`Recipient`]. This public key corresponds to the secret in
8168 * [`get_node_secret`].
8170 * This method must return the same value each time it is called with a given `Recipient`
8173 * Errors if the `Recipient` variant is not supported by the implementation.
8175 * [`get_node_secret`]: KeysInterface::get_node_secret
8177 struct LDKCResult_PublicKeyNoneZ (*get_node_id)(const void *this_arg, enum LDKRecipient recipient);
8179 * Gets the ECDH shared secret of our [`node secret`] and `other_key`, multiplying by `tweak` if
8180 * one is provided. Note that this tweak can be applied to `other_key` instead of our node
8181 * secret, though this is less efficient.
8183 * Errors if the `Recipient` variant is not supported by the implementation.
8185 * [`node secret`]: Self::get_node_secret
8187 struct LDKCResult_SharedSecretNoneZ (*ecdh)(const void *this_arg, enum LDKRecipient recipient, struct LDKPublicKey other_key, struct LDKCOption_ScalarZ tweak);
8189 * Get a script pubkey which we send funds to when claiming on-chain contestable outputs.
8191 * This method should return a different value each time it is called, to avoid linking
8192 * on-chain funds across channels as controlled to the same user.
8194 struct LDKCVec_u8Z (*get_destination_script)(const void *this_arg);
8196 * Get a script pubkey which we will send funds to when closing a channel.
8198 * This method should return a different value each time it is called, to avoid linking
8199 * on-chain funds across channels as controlled to the same user.
8201 struct LDKShutdownScript (*get_shutdown_scriptpubkey)(const void *this_arg);
8203 * Get a new set of Sign for per-channel secrets. These MUST be unique even if you
8204 * restarted with some stale data!
8206 * This method must return a different value each time it is called.
8208 struct LDKSign (*get_channel_signer)(const void *this_arg, bool inbound, uint64_t channel_value_satoshis);
8210 * Gets a unique, cryptographically-secure, random 32 byte value. This is used for encrypting
8211 * onion packets and for temporary channel IDs. There is no requirement that these be
8212 * persisted anywhere, though they must be unique across restarts.
8214 * This method must return a different value each time it is called.
8216 struct LDKThirtyTwoBytes (*get_secure_random_bytes)(const void *this_arg);
8218 * Reads a `Signer` for this `KeysInterface` from the given input stream.
8219 * This is only called during deserialization of other objects which contain
8220 * `Sign`-implementing objects (ie `ChannelMonitor`s and `ChannelManager`s).
8221 * The bytes are exactly those which `<Self::Signer as Writeable>::write()` writes, and
8222 * contain no versioning scheme. You may wish to include your own version prefix and ensure
8223 * you've read all of the provided bytes to ensure no corruption occurred.
8225 struct LDKCResult_SignDecodeErrorZ (*read_chan_signer)(const void *this_arg, struct LDKu8slice reader);
8228 * By parameterizing by the raw invoice bytes instead of the hash, we allow implementors of
8229 * this trait to parse the invoice and make sure they're signing what they expect, rather than
8230 * blindly signing the hash.
8231 * The hrp is ascii bytes, while the invoice data is base32.
8233 * The secret key used to sign the invoice is dependent on the [`Recipient`].
8235 * Errors if the `Recipient` variant is not supported by the implementation.
8237 struct LDKCResult_RecoverableSignatureNoneZ (*sign_invoice)(const void *this_arg, struct LDKu8slice hrp_bytes, struct LDKCVec_u5Z invoice_data, enum LDKRecipient receipient);
8239 * Get secret key material as bytes for use in encrypting and decrypting inbound payment data.
8241 * If the implementor of this trait supports [phantom node payments], then every node that is
8242 * intended to be included in the phantom invoice route hints must return the same value from
8245 * This method must return the same value each time it is called.
8247 * [phantom node payments]: PhantomKeysManager
8249 struct LDKThirtyTwoBytes (*get_inbound_payment_key_material)(const void *this_arg);
8251 * Frees any resources associated with this object given its this_arg pointer.
8252 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
8254 void (*free)(void *this_arg);
8258 * A trait which should be implemented to provide feerate information on a number of time
8261 * Note that all of the functions implemented here *must* be reentrant-safe (obviously - they're
8262 * called from inside the library in response to chain events, P2P events, or timer events).
8264 typedef struct LDKFeeEstimator {
8266 * An opaque pointer which is passed to your function implementations as an argument.
8267 * This has no meaning in the LDK, and can be NULL or any other value.
8271 * Gets estimated satoshis of fee required per 1000 Weight-Units.
8273 * LDK will wrap this method and ensure that the value returned is no smaller than 253
8274 * (ie 1 satoshi-per-byte rounded up to ensure later round-downs don't put us below 1 satoshi-per-byte).
8276 * The following unit conversions can be used to convert to sats/KW:
8277 * * satoshis-per-byte * 250
8278 * * satoshis-per-kbyte / 4
8280 uint32_t (*get_est_sat_per_1000_weight)(const void *this_arg, enum LDKConfirmationTarget confirmation_target);
8282 * Frees any resources associated with this object given its this_arg pointer.
8283 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
8285 void (*free)(void *this_arg);
8291 * Manager which keeps track of a number of channels and sends messages to the appropriate
8292 * channel, also tracking HTLC preimages and forwarding onion packets appropriately.
8294 * Implements ChannelMessageHandler, handling the multi-channel parts and passing things through
8295 * to individual Channels.
8297 * Implements Writeable to write out all channel state to disk. Implies peer_disconnected() for
8298 * all peers during write/read (though does not modify this instance, only the instance being
8299 * serialized). This will result in any channels which have not yet exchanged funding_created (ie
8300 * called funding_transaction_generated for outbound channels).
8302 * Note that you can be a bit lazier about writing out ChannelManager than you can be with
8303 * ChannelMonitors. With ChannelMonitors you MUST write each monitor update out to disk before
8304 * returning from chain::Watch::watch_/update_channel, with ChannelManagers, writing updates
8305 * happens out-of-band (and will prevent any other ChannelManager operations from occurring during
8306 * the serialization process). If the deserialized version is out-of-date compared to the
8307 * ChannelMonitors passed by reference to read(), those channels will be force-closed based on the
8308 * ChannelMonitor state and no funds will be lost (mod on-chain transaction fees).
8310 * Note that the deserializer is only implemented for (BlockHash, ChannelManager), which
8311 * tells you the last block hash which was block_connect()ed. You MUST rescan any blocks along
8312 * the \"reorg path\" (ie call block_disconnected() until you get to a common block and then call
8313 * block_connected() to step towards your best block) upon deserialization before using the
8316 * Note that ChannelManager is responsible for tracking liveness of its channels and generating
8317 * ChannelUpdate messages informing peers that the channel is temporarily disabled. To avoid
8318 * spam due to quick disconnection/reconnection, updates are not sent until the channel has been
8319 * offline for a full minute. In order to track this, you must call
8320 * timer_tick_occurred roughly once per minute, though it doesn't have to be perfect.
8322 * Rather than using a plain ChannelManager, it is preferable to use either a SimpleArcChannelManager
8323 * a SimpleRefChannelManager, for conciseness. See their documentation for more details, but
8324 * essentially you should default to using a SimpleRefChannelManager, and use a
8325 * SimpleArcChannelManager when you require a ChannelManager with a static lifetime, such as when
8326 * you're using lightning-net-tokio.
8328 typedef struct MUST_USE_STRUCT LDKChannelManager {
8330 * A pointer to the opaque Rust object.
8331 * Nearly everywhere, inner must be non-null, however in places where
8332 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8334 LDKnativeChannelManager *inner;
8336 * Indicates that this is the only struct which contains the same pointer.
8337 * Rust functions which take ownership of an object provided via an argument require
8338 * this to be true and invalidate the object pointed to by inner.
8341 } LDKChannelManager;
8344 * A tuple of 2 elements. See the individual fields for the types contained.
8346 typedef struct LDKC2Tuple_BlockHashChannelManagerZ {
8348 * The element at position 0
8350 struct LDKThirtyTwoBytes a;
8352 * The element at position 1
8354 struct LDKChannelManager b;
8355 } LDKC2Tuple_BlockHashChannelManagerZ;
8358 * The contents of CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ
8360 typedef union LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZPtr {
8362 * A pointer to the contents in the success state.
8363 * Reading from this pointer when `result_ok` is not set is undefined.
8365 struct LDKC2Tuple_BlockHashChannelManagerZ *result;
8367 * A pointer to the contents in the error state.
8368 * Reading from this pointer when `result_ok` is set is undefined.
8370 struct LDKDecodeError *err;
8371 } LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZPtr;
8374 * A CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ represents the result of a fallible operation,
8375 * containing a crate::c_types::derived::C2Tuple_BlockHashChannelManagerZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
8376 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8378 typedef struct LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ {
8380 * The contents of this CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ, accessible via either
8381 * `err` or `result` depending on the state of `result_ok`.
8383 union LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZPtr contents;
8385 * Whether this CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ represents a success state.
8388 } LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ;
8393 * Options which apply on a per-channel basis and may change at runtime or based on negotiation
8394 * with our counterparty.
8396 typedef struct MUST_USE_STRUCT LDKChannelConfig {
8398 * A pointer to the opaque Rust object.
8399 * Nearly everywhere, inner must be non-null, however in places where
8400 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8402 LDKnativeChannelConfig *inner;
8404 * Indicates that this is the only struct which contains the same pointer.
8405 * Rust functions which take ownership of an object provided via an argument require
8406 * this to be true and invalidate the object pointed to by inner.
8412 * The contents of CResult_ChannelConfigDecodeErrorZ
8414 typedef union LDKCResult_ChannelConfigDecodeErrorZPtr {
8416 * A pointer to the contents in the success state.
8417 * Reading from this pointer when `result_ok` is not set is undefined.
8419 struct LDKChannelConfig *result;
8421 * A pointer to the contents in the error state.
8422 * Reading from this pointer when `result_ok` is set is undefined.
8424 struct LDKDecodeError *err;
8425 } LDKCResult_ChannelConfigDecodeErrorZPtr;
8428 * A CResult_ChannelConfigDecodeErrorZ represents the result of a fallible operation,
8429 * containing a crate::lightning::util::config::ChannelConfig on success and a crate::lightning::ln::msgs::DecodeError on failure.
8430 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8432 typedef struct LDKCResult_ChannelConfigDecodeErrorZ {
8434 * The contents of this CResult_ChannelConfigDecodeErrorZ, accessible via either
8435 * `err` or `result` depending on the state of `result_ok`.
8437 union LDKCResult_ChannelConfigDecodeErrorZPtr contents;
8439 * Whether this CResult_ChannelConfigDecodeErrorZ represents a success state.
8442 } LDKCResult_ChannelConfigDecodeErrorZ;
8445 * The contents of CResult_OutPointDecodeErrorZ
8447 typedef union LDKCResult_OutPointDecodeErrorZPtr {
8449 * A pointer to the contents in the success state.
8450 * Reading from this pointer when `result_ok` is not set is undefined.
8452 struct LDKOutPoint *result;
8454 * A pointer to the contents in the error state.
8455 * Reading from this pointer when `result_ok` is set is undefined.
8457 struct LDKDecodeError *err;
8458 } LDKCResult_OutPointDecodeErrorZPtr;
8461 * A CResult_OutPointDecodeErrorZ represents the result of a fallible operation,
8462 * containing a crate::lightning::chain::transaction::OutPoint on success and a crate::lightning::ln::msgs::DecodeError on failure.
8463 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8465 typedef struct LDKCResult_OutPointDecodeErrorZ {
8467 * The contents of this CResult_OutPointDecodeErrorZ, accessible via either
8468 * `err` or `result` depending on the state of `result_ok`.
8470 union LDKCResult_OutPointDecodeErrorZPtr contents;
8472 * Whether this CResult_OutPointDecodeErrorZ represents a success state.
8475 } LDKCResult_OutPointDecodeErrorZ;
8478 * Defines a type identifier for sending messages over the wire.
8480 * Messages implementing this trait specify a type and must be [`Writeable`].
8482 typedef struct LDKType {
8484 * An opaque pointer which is passed to your function implementations as an argument.
8485 * This has no meaning in the LDK, and can be NULL or any other value.
8489 * Returns the type identifying the message payload.
8491 uint16_t (*type_id)(const void *this_arg);
8493 * Return a human-readable "debug" string describing this object
8495 struct LDKStr (*debug_str)(const void *this_arg);
8497 * Serialize the object into a byte array
8499 struct LDKCVec_u8Z (*write)(const void *this_arg);
8501 * Frees any resources associated with this object given its this_arg pointer.
8502 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
8504 void (*free)(void *this_arg);
8508 * An enum which can either contain a crate::lightning::ln::wire::Type or not
8510 typedef enum LDKCOption_TypeZ_Tag {
8512 * When we're in this state, this COption_TypeZ contains a crate::lightning::ln::wire::Type
8514 LDKCOption_TypeZ_Some,
8516 * When we're in this state, this COption_TypeZ contains nothing
8518 LDKCOption_TypeZ_None,
8520 * Must be last for serialization purposes
8522 LDKCOption_TypeZ_Sentinel,
8523 } LDKCOption_TypeZ_Tag;
8525 typedef struct LDKCOption_TypeZ {
8526 LDKCOption_TypeZ_Tag tag;
8529 struct LDKType some;
8535 * The contents of CResult_COption_TypeZDecodeErrorZ
8537 typedef union LDKCResult_COption_TypeZDecodeErrorZPtr {
8539 * A pointer to the contents in the success state.
8540 * Reading from this pointer when `result_ok` is not set is undefined.
8542 struct LDKCOption_TypeZ *result;
8544 * A pointer to the contents in the error state.
8545 * Reading from this pointer when `result_ok` is set is undefined.
8547 struct LDKDecodeError *err;
8548 } LDKCResult_COption_TypeZDecodeErrorZPtr;
8551 * A CResult_COption_TypeZDecodeErrorZ represents the result of a fallible operation,
8552 * containing a crate::c_types::derived::COption_TypeZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
8553 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8555 typedef struct LDKCResult_COption_TypeZDecodeErrorZ {
8557 * The contents of this CResult_COption_TypeZDecodeErrorZ, accessible via either
8558 * `err` or `result` depending on the state of `result_ok`.
8560 union LDKCResult_COption_TypeZDecodeErrorZPtr contents;
8562 * Whether this CResult_COption_TypeZDecodeErrorZ represents a success state.
8565 } LDKCResult_COption_TypeZDecodeErrorZ;
8568 * An error that may occur when making a payment.
8570 typedef enum LDKPaymentError_Tag {
8572 * An error resulting from the provided [`Invoice`] or payment hash.
8574 LDKPaymentError_Invoice,
8576 * An error occurring when finding a route.
8578 LDKPaymentError_Routing,
8580 * An error occurring when sending a payment.
8582 LDKPaymentError_Sending,
8584 * Must be last for serialization purposes
8586 LDKPaymentError_Sentinel,
8587 } LDKPaymentError_Tag;
8589 typedef struct MUST_USE_STRUCT LDKPaymentError {
8590 LDKPaymentError_Tag tag;
8593 struct LDKStr invoice;
8596 struct LDKLightningError routing;
8599 struct LDKPaymentSendFailure sending;
8605 * The contents of CResult_PaymentIdPaymentErrorZ
8607 typedef union LDKCResult_PaymentIdPaymentErrorZPtr {
8609 * A pointer to the contents in the success state.
8610 * Reading from this pointer when `result_ok` is not set is undefined.
8612 struct LDKThirtyTwoBytes *result;
8614 * A pointer to the contents in the error state.
8615 * Reading from this pointer when `result_ok` is set is undefined.
8617 struct LDKPaymentError *err;
8618 } LDKCResult_PaymentIdPaymentErrorZPtr;
8621 * A CResult_PaymentIdPaymentErrorZ represents the result of a fallible operation,
8622 * containing a crate::c_types::ThirtyTwoBytes on success and a crate::lightning_invoice::payment::PaymentError on failure.
8623 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8625 typedef struct LDKCResult_PaymentIdPaymentErrorZ {
8627 * The contents of this CResult_PaymentIdPaymentErrorZ, accessible via either
8628 * `err` or `result` depending on the state of `result_ok`.
8630 union LDKCResult_PaymentIdPaymentErrorZPtr contents;
8632 * Whether this CResult_PaymentIdPaymentErrorZ represents a success state.
8635 } LDKCResult_PaymentIdPaymentErrorZ;
8640 * A map with liquidity value (in msat) keyed by a short channel id and the direction the HTLC
8641 * is traveling in. The direction boolean is determined by checking if the HTLC source's public
8642 * key is less than its destination. See [`InFlightHtlcs::used_liquidity_msat`] for more
8645 typedef struct MUST_USE_STRUCT LDKInFlightHtlcs {
8647 * A pointer to the opaque Rust object.
8648 * Nearly everywhere, inner must be non-null, however in places where
8649 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8651 LDKnativeInFlightHtlcs *inner;
8653 * Indicates that this is the only struct which contains the same pointer.
8654 * Rust functions which take ownership of an object provided via an argument require
8655 * this to be true and invalidate the object pointed to by inner.
8661 * The contents of CResult_InFlightHtlcsDecodeErrorZ
8663 typedef union LDKCResult_InFlightHtlcsDecodeErrorZPtr {
8665 * A pointer to the contents in the success state.
8666 * Reading from this pointer when `result_ok` is not set is undefined.
8668 struct LDKInFlightHtlcs *result;
8670 * A pointer to the contents in the error state.
8671 * Reading from this pointer when `result_ok` is set is undefined.
8673 struct LDKDecodeError *err;
8674 } LDKCResult_InFlightHtlcsDecodeErrorZPtr;
8677 * A CResult_InFlightHtlcsDecodeErrorZ represents the result of a fallible operation,
8678 * containing a crate::lightning_invoice::payment::InFlightHtlcs on success and a crate::lightning::ln::msgs::DecodeError on failure.
8679 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8681 typedef struct LDKCResult_InFlightHtlcsDecodeErrorZ {
8683 * The contents of this CResult_InFlightHtlcsDecodeErrorZ, accessible via either
8684 * `err` or `result` depending on the state of `result_ok`.
8686 union LDKCResult_InFlightHtlcsDecodeErrorZPtr contents;
8688 * Whether this CResult_InFlightHtlcsDecodeErrorZ represents a success state.
8691 } LDKCResult_InFlightHtlcsDecodeErrorZ;
8694 * Sub-errors which don't have specific information in them use this type.
8696 typedef struct LDKError {
8698 * Zero-Sized_types aren't consistent across Rust/C/C++, so we add some size here
8704 * Errors that indicate what is wrong with the invoice. They have some granularity for debug
8705 * reasons, but should generally result in an \"invalid BOLT11 invoice\" message for the user.
8707 typedef enum LDKParseError_Tag {
8708 LDKParseError_Bech32Error,
8709 LDKParseError_ParseAmountError,
8710 LDKParseError_MalformedSignature,
8711 LDKParseError_BadPrefix,
8712 LDKParseError_UnknownCurrency,
8713 LDKParseError_UnknownSiPrefix,
8714 LDKParseError_MalformedHRP,
8715 LDKParseError_TooShortDataPart,
8716 LDKParseError_UnexpectedEndOfTaggedFields,
8717 LDKParseError_DescriptionDecodeError,
8718 LDKParseError_PaddingError,
8719 LDKParseError_IntegerOverflowError,
8720 LDKParseError_InvalidSegWitProgramLength,
8721 LDKParseError_InvalidPubKeyHashLength,
8722 LDKParseError_InvalidScriptHashLength,
8723 LDKParseError_InvalidRecoveryId,
8724 LDKParseError_InvalidSliceLength,
8726 * Not an error, but used internally to signal that a part of the invoice should be ignored
8727 * according to BOLT11
8731 * Must be last for serialization purposes
8733 LDKParseError_Sentinel,
8734 } LDKParseError_Tag;
8736 typedef struct MUST_USE_STRUCT LDKParseError {
8737 LDKParseError_Tag tag;
8740 struct LDKBech32Error bech32_error;
8743 struct LDKError parse_amount_error;
8746 enum LDKSecp256k1Error malformed_signature;
8749 struct LDKError description_decode_error;
8752 struct LDKStr invalid_slice_length;
8758 * The contents of CResult_SiPrefixParseErrorZ
8760 typedef union LDKCResult_SiPrefixParseErrorZPtr {
8762 * A pointer to the contents in the success state.
8763 * Reading from this pointer when `result_ok` is not set is undefined.
8765 enum LDKSiPrefix *result;
8767 * A pointer to the contents in the error state.
8768 * Reading from this pointer when `result_ok` is set is undefined.
8770 struct LDKParseError *err;
8771 } LDKCResult_SiPrefixParseErrorZPtr;
8774 * A CResult_SiPrefixParseErrorZ represents the result of a fallible operation,
8775 * containing a crate::lightning_invoice::SiPrefix on success and a crate::lightning_invoice::ParseError on failure.
8776 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8778 typedef struct LDKCResult_SiPrefixParseErrorZ {
8780 * The contents of this CResult_SiPrefixParseErrorZ, accessible via either
8781 * `err` or `result` depending on the state of `result_ok`.
8783 union LDKCResult_SiPrefixParseErrorZPtr contents;
8785 * Whether this CResult_SiPrefixParseErrorZ represents a success state.
8788 } LDKCResult_SiPrefixParseErrorZ;
8793 * Represents a syntactically and semantically correct lightning BOLT11 invoice.
8795 * There are three ways to construct an `Invoice`:
8796 * 1. using `InvoiceBuilder`
8797 * 2. using `Invoice::from_signed(SignedRawInvoice)`
8798 * 3. using `str::parse::<Invoice>(&str)`
8800 typedef struct MUST_USE_STRUCT LDKInvoice {
8802 * A pointer to the opaque Rust object.
8803 * Nearly everywhere, inner must be non-null, however in places where
8804 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8806 LDKnativeInvoice *inner;
8808 * Indicates that this is the only struct which contains the same pointer.
8809 * Rust functions which take ownership of an object provided via an argument require
8810 * this to be true and invalidate the object pointed to by inner.
8816 * Indicates that something went wrong while parsing or validating the invoice. Parsing errors
8817 * should be mostly seen as opaque and are only there for debugging reasons. Semantic errors
8818 * like wrong signatures, missing fields etc. could mean that someone tampered with the invoice.
8820 typedef enum LDKParseOrSemanticError_Tag {
8822 * The invoice couldn't be decoded
8824 LDKParseOrSemanticError_ParseError,
8826 * The invoice could be decoded but violates the BOLT11 standard
8828 LDKParseOrSemanticError_SemanticError,
8830 * Must be last for serialization purposes
8832 LDKParseOrSemanticError_Sentinel,
8833 } LDKParseOrSemanticError_Tag;
8835 typedef struct MUST_USE_STRUCT LDKParseOrSemanticError {
8836 LDKParseOrSemanticError_Tag tag;
8839 struct LDKParseError parse_error;
8842 enum LDKSemanticError semantic_error;
8845 } LDKParseOrSemanticError;
8848 * The contents of CResult_InvoiceParseOrSemanticErrorZ
8850 typedef union LDKCResult_InvoiceParseOrSemanticErrorZPtr {
8852 * A pointer to the contents in the success state.
8853 * Reading from this pointer when `result_ok` is not set is undefined.
8855 struct LDKInvoice *result;
8857 * A pointer to the contents in the error state.
8858 * Reading from this pointer when `result_ok` is set is undefined.
8860 struct LDKParseOrSemanticError *err;
8861 } LDKCResult_InvoiceParseOrSemanticErrorZPtr;
8864 * A CResult_InvoiceParseOrSemanticErrorZ represents the result of a fallible operation,
8865 * containing a crate::lightning_invoice::Invoice on success and a crate::lightning_invoice::ParseOrSemanticError on failure.
8866 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8868 typedef struct LDKCResult_InvoiceParseOrSemanticErrorZ {
8870 * The contents of this CResult_InvoiceParseOrSemanticErrorZ, accessible via either
8871 * `err` or `result` depending on the state of `result_ok`.
8873 union LDKCResult_InvoiceParseOrSemanticErrorZPtr contents;
8875 * Whether this CResult_InvoiceParseOrSemanticErrorZ represents a success state.
8878 } LDKCResult_InvoiceParseOrSemanticErrorZ;
8883 * Represents a signed `RawInvoice` with cached hash. The signature is not checked and may be
8887 * The hash has to be either from the deserialized invoice or from the serialized `raw_invoice`.
8889 typedef struct MUST_USE_STRUCT LDKSignedRawInvoice {
8891 * A pointer to the opaque Rust object.
8892 * Nearly everywhere, inner must be non-null, however in places where
8893 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8895 LDKnativeSignedRawInvoice *inner;
8897 * Indicates that this is the only struct which contains the same pointer.
8898 * Rust functions which take ownership of an object provided via an argument require
8899 * this to be true and invalidate the object pointed to by inner.
8902 } LDKSignedRawInvoice;
8905 * The contents of CResult_SignedRawInvoiceParseErrorZ
8907 typedef union LDKCResult_SignedRawInvoiceParseErrorZPtr {
8909 * A pointer to the contents in the success state.
8910 * Reading from this pointer when `result_ok` is not set is undefined.
8912 struct LDKSignedRawInvoice *result;
8914 * A pointer to the contents in the error state.
8915 * Reading from this pointer when `result_ok` is set is undefined.
8917 struct LDKParseError *err;
8918 } LDKCResult_SignedRawInvoiceParseErrorZPtr;
8921 * A CResult_SignedRawInvoiceParseErrorZ represents the result of a fallible operation,
8922 * containing a crate::lightning_invoice::SignedRawInvoice on success and a crate::lightning_invoice::ParseError on failure.
8923 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8925 typedef struct LDKCResult_SignedRawInvoiceParseErrorZ {
8927 * The contents of this CResult_SignedRawInvoiceParseErrorZ, accessible via either
8928 * `err` or `result` depending on the state of `result_ok`.
8930 union LDKCResult_SignedRawInvoiceParseErrorZPtr contents;
8932 * Whether this CResult_SignedRawInvoiceParseErrorZ represents a success state.
8935 } LDKCResult_SignedRawInvoiceParseErrorZ;
8940 * Represents an syntactically correct Invoice for a payment on the lightning network,
8941 * but without the signature information.
8942 * De- and encoding should not lead to information loss but may lead to different hashes.
8944 * For methods without docs see the corresponding methods in `Invoice`.
8946 typedef struct MUST_USE_STRUCT LDKRawInvoice {
8948 * A pointer to the opaque Rust object.
8949 * Nearly everywhere, inner must be non-null, however in places where
8950 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8952 LDKnativeRawInvoice *inner;
8954 * Indicates that this is the only struct which contains the same pointer.
8955 * Rust functions which take ownership of an object provided via an argument require
8956 * this to be true and invalidate the object pointed to by inner.
8964 * Recoverable signature
8966 typedef struct MUST_USE_STRUCT LDKInvoiceSignature {
8968 * A pointer to the opaque Rust object.
8969 * Nearly everywhere, inner must be non-null, however in places where
8970 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8972 LDKnativeInvoiceSignature *inner;
8974 * Indicates that this is the only struct which contains the same pointer.
8975 * Rust functions which take ownership of an object provided via an argument require
8976 * this to be true and invalidate the object pointed to by inner.
8979 } LDKInvoiceSignature;
8982 * A tuple of 3 elements. See the individual fields for the types contained.
8984 typedef struct LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ {
8986 * The element at position 0
8988 struct LDKRawInvoice a;
8990 * The element at position 1
8992 struct LDKThirtyTwoBytes b;
8994 * The element at position 2
8996 struct LDKInvoiceSignature c;
8997 } LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ;
9004 typedef struct MUST_USE_STRUCT LDKPayeePubKey {
9006 * A pointer to the opaque Rust object.
9007 * Nearly everywhere, inner must be non-null, however in places where
9008 * the Rust equivalent takes an Option, it may be set to null to indicate None.
9010 LDKnativePayeePubKey *inner;
9012 * Indicates that this is the only struct which contains the same pointer.
9013 * Rust functions which take ownership of an object provided via an argument require
9014 * this to be true and invalidate the object pointed to by inner.
9020 * The contents of CResult_PayeePubKeyErrorZ
9022 typedef union LDKCResult_PayeePubKeyErrorZPtr {
9024 * A pointer to the contents in the success state.
9025 * Reading from this pointer when `result_ok` is not set is undefined.
9027 struct LDKPayeePubKey *result;
9029 * A pointer to the contents in the error state.
9030 * Reading from this pointer when `result_ok` is set is undefined.
9032 enum LDKSecp256k1Error *err;
9033 } LDKCResult_PayeePubKeyErrorZPtr;
9036 * A CResult_PayeePubKeyErrorZ represents the result of a fallible operation,
9037 * containing a crate::lightning_invoice::PayeePubKey on success and a crate::c_types::Secp256k1Error on failure.
9038 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9040 typedef struct LDKCResult_PayeePubKeyErrorZ {
9042 * The contents of this CResult_PayeePubKeyErrorZ, accessible via either
9043 * `err` or `result` depending on the state of `result_ok`.
9045 union LDKCResult_PayeePubKeyErrorZPtr contents;
9047 * Whether this CResult_PayeePubKeyErrorZ represents a success state.
9050 } LDKCResult_PayeePubKeyErrorZ;
9055 * Private routing information
9058 * The encoded route has to be <1024 5bit characters long (<=639 bytes or <=12 hops)
9061 typedef struct MUST_USE_STRUCT LDKPrivateRoute {
9063 * A pointer to the opaque Rust object.
9064 * Nearly everywhere, inner must be non-null, however in places where
9065 * the Rust equivalent takes an Option, it may be set to null to indicate None.
9067 LDKnativePrivateRoute *inner;
9069 * Indicates that this is the only struct which contains the same pointer.
9070 * Rust functions which take ownership of an object provided via an argument require
9071 * this to be true and invalidate the object pointed to by inner.
9077 * A dynamically-allocated array of crate::lightning_invoice::PrivateRoutes of arbitrary size.
9078 * This corresponds to std::vector in C++
9080 typedef struct LDKCVec_PrivateRouteZ {
9082 * The elements in the array.
9083 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
9085 struct LDKPrivateRoute *data;
9087 * The number of elements pointed to by `data`.
9090 } LDKCVec_PrivateRouteZ;
9095 * A timestamp that refers to a date after 1 January 1970.
9099 * The Unix timestamp representing the stored time has to be positive and no greater than
9100 * [`MAX_TIMESTAMP`].
9102 typedef struct MUST_USE_STRUCT LDKPositiveTimestamp {
9104 * A pointer to the opaque Rust object.
9105 * Nearly everywhere, inner must be non-null, however in places where
9106 * the Rust equivalent takes an Option, it may be set to null to indicate None.
9108 LDKnativePositiveTimestamp *inner;
9110 * Indicates that this is the only struct which contains the same pointer.
9111 * Rust functions which take ownership of an object provided via an argument require
9112 * this to be true and invalidate the object pointed to by inner.
9115 } LDKPositiveTimestamp;
9118 * The contents of CResult_PositiveTimestampCreationErrorZ
9120 typedef union LDKCResult_PositiveTimestampCreationErrorZPtr {
9122 * A pointer to the contents in the success state.
9123 * Reading from this pointer when `result_ok` is not set is undefined.
9125 struct LDKPositiveTimestamp *result;
9127 * A pointer to the contents in the error state.
9128 * Reading from this pointer when `result_ok` is set is undefined.
9130 enum LDKCreationError *err;
9131 } LDKCResult_PositiveTimestampCreationErrorZPtr;
9134 * A CResult_PositiveTimestampCreationErrorZ represents the result of a fallible operation,
9135 * containing a crate::lightning_invoice::PositiveTimestamp on success and a crate::lightning_invoice::CreationError on failure.
9136 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9138 typedef struct LDKCResult_PositiveTimestampCreationErrorZ {
9140 * The contents of this CResult_PositiveTimestampCreationErrorZ, accessible via either
9141 * `err` or `result` depending on the state of `result_ok`.
9143 union LDKCResult_PositiveTimestampCreationErrorZPtr contents;
9145 * Whether this CResult_PositiveTimestampCreationErrorZ represents a success state.
9148 } LDKCResult_PositiveTimestampCreationErrorZ;
9151 * The contents of CResult_NoneSemanticErrorZ
9153 typedef union LDKCResult_NoneSemanticErrorZPtr {
9155 * Note that this value is always NULL, as there are no contents in the OK variant
9159 * A pointer to the contents in the error state.
9160 * Reading from this pointer when `result_ok` is set is undefined.
9162 enum LDKSemanticError *err;
9163 } LDKCResult_NoneSemanticErrorZPtr;
9166 * A CResult_NoneSemanticErrorZ represents the result of a fallible operation,
9167 * containing a () on success and a crate::lightning_invoice::SemanticError on failure.
9168 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9170 typedef struct LDKCResult_NoneSemanticErrorZ {
9172 * The contents of this CResult_NoneSemanticErrorZ, accessible via either
9173 * `err` or `result` depending on the state of `result_ok`.
9175 union LDKCResult_NoneSemanticErrorZPtr contents;
9177 * Whether this CResult_NoneSemanticErrorZ represents a success state.
9180 } LDKCResult_NoneSemanticErrorZ;
9183 * The contents of CResult_InvoiceSemanticErrorZ
9185 typedef union LDKCResult_InvoiceSemanticErrorZPtr {
9187 * A pointer to the contents in the success state.
9188 * Reading from this pointer when `result_ok` is not set is undefined.
9190 struct LDKInvoice *result;
9192 * A pointer to the contents in the error state.
9193 * Reading from this pointer when `result_ok` is set is undefined.
9195 enum LDKSemanticError *err;
9196 } LDKCResult_InvoiceSemanticErrorZPtr;
9199 * A CResult_InvoiceSemanticErrorZ represents the result of a fallible operation,
9200 * containing a crate::lightning_invoice::Invoice on success and a crate::lightning_invoice::SemanticError on failure.
9201 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9203 typedef struct LDKCResult_InvoiceSemanticErrorZ {
9205 * The contents of this CResult_InvoiceSemanticErrorZ, accessible via either
9206 * `err` or `result` depending on the state of `result_ok`.
9208 union LDKCResult_InvoiceSemanticErrorZPtr contents;
9210 * Whether this CResult_InvoiceSemanticErrorZ represents a success state.
9213 } LDKCResult_InvoiceSemanticErrorZ;
9218 * Description string
9221 * The description can be at most 639 __bytes__ long
9223 typedef struct MUST_USE_STRUCT LDKDescription {
9225 * A pointer to the opaque Rust object.
9226 * Nearly everywhere, inner must be non-null, however in places where
9227 * the Rust equivalent takes an Option, it may be set to null to indicate None.
9229 LDKnativeDescription *inner;
9231 * Indicates that this is the only struct which contains the same pointer.
9232 * Rust functions which take ownership of an object provided via an argument require
9233 * this to be true and invalidate the object pointed to by inner.
9239 * The contents of CResult_DescriptionCreationErrorZ
9241 typedef union LDKCResult_DescriptionCreationErrorZPtr {
9243 * A pointer to the contents in the success state.
9244 * Reading from this pointer when `result_ok` is not set is undefined.
9246 struct LDKDescription *result;
9248 * A pointer to the contents in the error state.
9249 * Reading from this pointer when `result_ok` is set is undefined.
9251 enum LDKCreationError *err;
9252 } LDKCResult_DescriptionCreationErrorZPtr;
9255 * A CResult_DescriptionCreationErrorZ represents the result of a fallible operation,
9256 * containing a crate::lightning_invoice::Description on success and a crate::lightning_invoice::CreationError on failure.
9257 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9259 typedef struct LDKCResult_DescriptionCreationErrorZ {
9261 * The contents of this CResult_DescriptionCreationErrorZ, accessible via either
9262 * `err` or `result` depending on the state of `result_ok`.
9264 union LDKCResult_DescriptionCreationErrorZPtr contents;
9266 * Whether this CResult_DescriptionCreationErrorZ represents a success state.
9269 } LDKCResult_DescriptionCreationErrorZ;
9272 * The contents of CResult_PrivateRouteCreationErrorZ
9274 typedef union LDKCResult_PrivateRouteCreationErrorZPtr {
9276 * A pointer to the contents in the success state.
9277 * Reading from this pointer when `result_ok` is not set is undefined.
9279 struct LDKPrivateRoute *result;
9281 * A pointer to the contents in the error state.
9282 * Reading from this pointer when `result_ok` is set is undefined.
9284 enum LDKCreationError *err;
9285 } LDKCResult_PrivateRouteCreationErrorZPtr;
9288 * A CResult_PrivateRouteCreationErrorZ represents the result of a fallible operation,
9289 * containing a crate::lightning_invoice::PrivateRoute on success and a crate::lightning_invoice::CreationError on failure.
9290 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9292 typedef struct LDKCResult_PrivateRouteCreationErrorZ {
9294 * The contents of this CResult_PrivateRouteCreationErrorZ, accessible via either
9295 * `err` or `result` depending on the state of `result_ok`.
9297 union LDKCResult_PrivateRouteCreationErrorZPtr contents;
9299 * Whether this CResult_PrivateRouteCreationErrorZ represents a success state.
9302 } LDKCResult_PrivateRouteCreationErrorZ;
9305 * The contents of CResult_StringErrorZ
9307 typedef union LDKCResult_StringErrorZPtr {
9309 * A pointer to the contents in the success state.
9310 * Reading from this pointer when `result_ok` is not set is undefined.
9312 struct LDKStr *result;
9314 * A pointer to the contents in the error state.
9315 * Reading from this pointer when `result_ok` is set is undefined.
9317 enum LDKSecp256k1Error *err;
9318 } LDKCResult_StringErrorZPtr;
9321 * A CResult_StringErrorZ represents the result of a fallible operation,
9322 * containing a crate::c_types::Str on success and a crate::c_types::Secp256k1Error on failure.
9323 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9325 typedef struct LDKCResult_StringErrorZ {
9327 * The contents of this CResult_StringErrorZ, accessible via either
9328 * `err` or `result` depending on the state of `result_ok`.
9330 union LDKCResult_StringErrorZPtr contents;
9332 * Whether this CResult_StringErrorZ represents a success state.
9335 } LDKCResult_StringErrorZ;
9338 * The contents of CResult_ChannelMonitorUpdateDecodeErrorZ
9340 typedef union LDKCResult_ChannelMonitorUpdateDecodeErrorZPtr {
9342 * A pointer to the contents in the success state.
9343 * Reading from this pointer when `result_ok` is not set is undefined.
9345 struct LDKChannelMonitorUpdate *result;
9347 * A pointer to the contents in the error state.
9348 * Reading from this pointer when `result_ok` is set is undefined.
9350 struct LDKDecodeError *err;
9351 } LDKCResult_ChannelMonitorUpdateDecodeErrorZPtr;
9354 * A CResult_ChannelMonitorUpdateDecodeErrorZ represents the result of a fallible operation,
9355 * containing a crate::lightning::chain::channelmonitor::ChannelMonitorUpdate on success and a crate::lightning::ln::msgs::DecodeError on failure.
9356 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9358 typedef struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ {
9360 * The contents of this CResult_ChannelMonitorUpdateDecodeErrorZ, accessible via either
9361 * `err` or `result` depending on the state of `result_ok`.
9363 union LDKCResult_ChannelMonitorUpdateDecodeErrorZPtr contents;
9365 * Whether this CResult_ChannelMonitorUpdateDecodeErrorZ represents a success state.
9368 } LDKCResult_ChannelMonitorUpdateDecodeErrorZ;
9371 * An enum which can either contain a crate::lightning::chain::channelmonitor::MonitorEvent or not
9373 typedef enum LDKCOption_MonitorEventZ_Tag {
9375 * When we're in this state, this COption_MonitorEventZ contains a crate::lightning::chain::channelmonitor::MonitorEvent
9377 LDKCOption_MonitorEventZ_Some,
9379 * When we're in this state, this COption_MonitorEventZ contains nothing
9381 LDKCOption_MonitorEventZ_None,
9383 * Must be last for serialization purposes
9385 LDKCOption_MonitorEventZ_Sentinel,
9386 } LDKCOption_MonitorEventZ_Tag;
9388 typedef struct LDKCOption_MonitorEventZ {
9389 LDKCOption_MonitorEventZ_Tag tag;
9392 struct LDKMonitorEvent some;
9395 } LDKCOption_MonitorEventZ;
9398 * The contents of CResult_COption_MonitorEventZDecodeErrorZ
9400 typedef union LDKCResult_COption_MonitorEventZDecodeErrorZPtr {
9402 * A pointer to the contents in the success state.
9403 * Reading from this pointer when `result_ok` is not set is undefined.
9405 struct LDKCOption_MonitorEventZ *result;
9407 * A pointer to the contents in the error state.
9408 * Reading from this pointer when `result_ok` is set is undefined.
9410 struct LDKDecodeError *err;
9411 } LDKCResult_COption_MonitorEventZDecodeErrorZPtr;
9414 * A CResult_COption_MonitorEventZDecodeErrorZ represents the result of a fallible operation,
9415 * containing a crate::c_types::derived::COption_MonitorEventZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
9416 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9418 typedef struct LDKCResult_COption_MonitorEventZDecodeErrorZ {
9420 * The contents of this CResult_COption_MonitorEventZDecodeErrorZ, accessible via either
9421 * `err` or `result` depending on the state of `result_ok`.
9423 union LDKCResult_COption_MonitorEventZDecodeErrorZPtr contents;
9425 * Whether this CResult_COption_MonitorEventZDecodeErrorZ represents a success state.
9428 } LDKCResult_COption_MonitorEventZDecodeErrorZ;
9431 * The contents of CResult_HTLCUpdateDecodeErrorZ
9433 typedef union LDKCResult_HTLCUpdateDecodeErrorZPtr {
9435 * A pointer to the contents in the success state.
9436 * Reading from this pointer when `result_ok` is not set is undefined.
9438 struct LDKHTLCUpdate *result;
9440 * A pointer to the contents in the error state.
9441 * Reading from this pointer when `result_ok` is set is undefined.
9443 struct LDKDecodeError *err;
9444 } LDKCResult_HTLCUpdateDecodeErrorZPtr;
9447 * A CResult_HTLCUpdateDecodeErrorZ represents the result of a fallible operation,
9448 * containing a crate::lightning::chain::channelmonitor::HTLCUpdate on success and a crate::lightning::ln::msgs::DecodeError on failure.
9449 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9451 typedef struct LDKCResult_HTLCUpdateDecodeErrorZ {
9453 * The contents of this CResult_HTLCUpdateDecodeErrorZ, accessible via either
9454 * `err` or `result` depending on the state of `result_ok`.
9456 union LDKCResult_HTLCUpdateDecodeErrorZPtr contents;
9458 * Whether this CResult_HTLCUpdateDecodeErrorZ represents a success state.
9461 } LDKCResult_HTLCUpdateDecodeErrorZ;
9464 * A tuple of 2 elements. See the individual fields for the types contained.
9466 typedef struct LDKC2Tuple_OutPointScriptZ {
9468 * The element at position 0
9470 struct LDKOutPoint a;
9472 * The element at position 1
9474 struct LDKCVec_u8Z b;
9475 } LDKC2Tuple_OutPointScriptZ;
9478 * A tuple of 2 elements. See the individual fields for the types contained.
9480 typedef struct LDKC2Tuple_u32ScriptZ {
9482 * The element at position 0
9486 * The element at position 1
9488 struct LDKCVec_u8Z b;
9489 } LDKC2Tuple_u32ScriptZ;
9492 * A dynamically-allocated array of crate::c_types::derived::C2Tuple_u32ScriptZs of arbitrary size.
9493 * This corresponds to std::vector in C++
9495 typedef struct LDKCVec_C2Tuple_u32ScriptZZ {
9497 * The elements in the array.
9498 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
9500 struct LDKC2Tuple_u32ScriptZ *data;
9502 * The number of elements pointed to by `data`.
9505 } LDKCVec_C2Tuple_u32ScriptZZ;
9508 * A tuple of 2 elements. See the individual fields for the types contained.
9510 typedef struct LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ {
9512 * The element at position 0
9514 struct LDKThirtyTwoBytes a;
9516 * The element at position 1
9518 struct LDKCVec_C2Tuple_u32ScriptZZ b;
9519 } LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ;
9522 * A dynamically-allocated array of crate::c_types::derived::C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZs of arbitrary size.
9523 * This corresponds to std::vector in C++
9525 typedef struct LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ {
9527 * The elements in the array.
9528 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
9530 struct LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ *data;
9532 * The number of elements pointed to by `data`.
9535 } LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ;
9538 * A dynamically-allocated array of crate::lightning::util::events::Events of arbitrary size.
9539 * This corresponds to std::vector in C++
9541 typedef struct LDKCVec_EventZ {
9543 * The elements in the array.
9544 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
9546 struct LDKEvent *data;
9548 * The number of elements pointed to by `data`.
9554 * A dynamically-allocated array of crate::c_types::Transactions of arbitrary size.
9555 * This corresponds to std::vector in C++
9557 typedef struct LDKCVec_TransactionZ {
9559 * The elements in the array.
9560 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
9562 struct LDKTransaction *data;
9564 * The number of elements pointed to by `data`.
9567 } LDKCVec_TransactionZ;
9570 * A tuple of 2 elements. See the individual fields for the types contained.
9572 typedef struct LDKC2Tuple_u32TxOutZ {
9574 * The element at position 0
9578 * The element at position 1
9581 } LDKC2Tuple_u32TxOutZ;
9584 * A dynamically-allocated array of crate::c_types::derived::C2Tuple_u32TxOutZs of arbitrary size.
9585 * This corresponds to std::vector in C++
9587 typedef struct LDKCVec_C2Tuple_u32TxOutZZ {
9589 * The elements in the array.
9590 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
9592 struct LDKC2Tuple_u32TxOutZ *data;
9594 * The number of elements pointed to by `data`.
9597 } LDKCVec_C2Tuple_u32TxOutZZ;
9600 * A tuple of 2 elements. See the individual fields for the types contained.
9602 typedef struct LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ {
9604 * The element at position 0
9606 struct LDKThirtyTwoBytes a;
9608 * The element at position 1
9610 struct LDKCVec_C2Tuple_u32TxOutZZ b;
9611 } LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ;
9614 * A dynamically-allocated array of crate::c_types::derived::C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZs of arbitrary size.
9615 * This corresponds to std::vector in C++
9617 typedef struct LDKCVec_TransactionOutputsZ {
9619 * The elements in the array.
9620 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
9622 struct LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ *data;
9624 * The number of elements pointed to by `data`.
9627 } LDKCVec_TransactionOutputsZ;
9630 * Details about the balance(s) available for spending once the channel appears on chain.
9632 * See [`ChannelMonitor::get_claimable_balances`] for more details on when these will or will not
9635 typedef enum LDKBalance_Tag {
9637 * The channel is not yet closed (or the commitment or closing transaction has not yet
9638 * appeared in a block). The given balance is claimable (less on-chain fees) if the channel is
9641 LDKBalance_ClaimableOnChannelClose,
9643 * The channel has been closed, and the given balance is ours but awaiting confirmations until
9644 * we consider it spendable.
9646 LDKBalance_ClaimableAwaitingConfirmations,
9648 * The channel has been closed, and the given balance should be ours but awaiting spending
9649 * transaction confirmation. If the spending transaction does not confirm in time, it is
9650 * possible our counterparty can take the funds by broadcasting an HTLC timeout on-chain.
9652 * Once the spending transaction confirms, before it has reached enough confirmations to be
9653 * considered safe from chain reorganizations, the balance will instead be provided via
9654 * [`Balance::ClaimableAwaitingConfirmations`].
9656 LDKBalance_ContentiousClaimable,
9658 * HTLCs which we sent to our counterparty which are claimable after a timeout (less on-chain
9659 * fees) if the counterparty does not know the preimage for the HTLCs. These are somewhat
9660 * likely to be claimed by our counterparty before we do.
9662 LDKBalance_MaybeTimeoutClaimableHTLC,
9664 * HTLCs which we received from our counterparty which are claimable with a preimage which we
9665 * do not currently have. This will only be claimable if we receive the preimage from the node
9666 * to which we forwarded this HTLC before the timeout.
9668 LDKBalance_MaybePreimageClaimableHTLC,
9670 * The channel has been closed, and our counterparty broadcasted a revoked commitment
9673 * Thus, we're able to claim all outputs in the commitment transaction, one of which has the
9676 LDKBalance_CounterpartyRevokedOutputClaimable,
9678 * Must be last for serialization purposes
9680 LDKBalance_Sentinel,
9683 typedef struct LDKBalance_LDKClaimableOnChannelClose_Body {
9685 * The amount available to claim, in satoshis, excluding the on-chain fees which will be
9686 * required to do so.
9688 uint64_t claimable_amount_satoshis;
9689 } LDKBalance_LDKClaimableOnChannelClose_Body;
9691 typedef struct LDKBalance_LDKClaimableAwaitingConfirmations_Body {
9693 * The amount available to claim, in satoshis, possibly excluding the on-chain fees which
9694 * were spent in broadcasting the transaction.
9696 uint64_t claimable_amount_satoshis;
9698 * The height at which an [`Event::SpendableOutputs`] event will be generated for this
9701 uint32_t confirmation_height;
9702 } LDKBalance_LDKClaimableAwaitingConfirmations_Body;
9704 typedef struct LDKBalance_LDKContentiousClaimable_Body {
9706 * The amount available to claim, in satoshis, excluding the on-chain fees which will be
9707 * required to do so.
9709 uint64_t claimable_amount_satoshis;
9711 * The height at which the counterparty may be able to claim the balance if we have not
9714 uint32_t timeout_height;
9715 } LDKBalance_LDKContentiousClaimable_Body;
9717 typedef struct LDKBalance_LDKMaybeTimeoutClaimableHTLC_Body {
9719 * The amount potentially available to claim, in satoshis, excluding the on-chain fees
9720 * which will be required to do so.
9722 uint64_t claimable_amount_satoshis;
9724 * The height at which we will be able to claim the balance if our counterparty has not
9727 uint32_t claimable_height;
9728 } LDKBalance_LDKMaybeTimeoutClaimableHTLC_Body;
9730 typedef struct LDKBalance_LDKMaybePreimageClaimableHTLC_Body {
9732 * The amount potentially available to claim, in satoshis, excluding the on-chain fees
9733 * which will be required to do so.
9735 uint64_t claimable_amount_satoshis;
9737 * The height at which our counterparty will be able to claim the balance if we have not
9738 * yet received the preimage and claimed it ourselves.
9740 uint32_t expiry_height;
9741 } LDKBalance_LDKMaybePreimageClaimableHTLC_Body;
9743 typedef struct LDKBalance_LDKCounterpartyRevokedOutputClaimable_Body {
9745 * The amount, in satoshis, of the output which we can claim.
9747 * Note that for outputs from HTLC balances this may be excluding some on-chain fees that
9748 * were already spent.
9750 uint64_t claimable_amount_satoshis;
9751 } LDKBalance_LDKCounterpartyRevokedOutputClaimable_Body;
9753 typedef struct MUST_USE_STRUCT LDKBalance {
9756 LDKBalance_LDKClaimableOnChannelClose_Body claimable_on_channel_close;
9757 LDKBalance_LDKClaimableAwaitingConfirmations_Body claimable_awaiting_confirmations;
9758 LDKBalance_LDKContentiousClaimable_Body contentious_claimable;
9759 LDKBalance_LDKMaybeTimeoutClaimableHTLC_Body maybe_timeout_claimable_htlc;
9760 LDKBalance_LDKMaybePreimageClaimableHTLC_Body maybe_preimage_claimable_htlc;
9761 LDKBalance_LDKCounterpartyRevokedOutputClaimable_Body counterparty_revoked_output_claimable;
9766 * A dynamically-allocated array of crate::lightning::chain::channelmonitor::Balances of arbitrary size.
9767 * This corresponds to std::vector in C++
9769 typedef struct LDKCVec_BalanceZ {
9771 * The elements in the array.
9772 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
9774 struct LDKBalance *data;
9776 * The number of elements pointed to by `data`.
9782 * The contents of CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ
9784 typedef union LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZPtr {
9786 * A pointer to the contents in the success state.
9787 * Reading from this pointer when `result_ok` is not set is undefined.
9789 struct LDKC2Tuple_BlockHashChannelMonitorZ *result;
9791 * A pointer to the contents in the error state.
9792 * Reading from this pointer when `result_ok` is set is undefined.
9794 struct LDKDecodeError *err;
9795 } LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZPtr;
9798 * A CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ represents the result of a fallible operation,
9799 * containing a crate::c_types::derived::C2Tuple_BlockHashChannelMonitorZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
9800 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9802 typedef struct LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ {
9804 * The contents of this CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ, accessible via either
9805 * `err` or `result` depending on the state of `result_ok`.
9807 union LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZPtr contents;
9809 * Whether this CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ represents a success state.
9812 } LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ;
9815 * A tuple of 2 elements. See the individual fields for the types contained.
9817 typedef struct LDKC2Tuple_PublicKeyTypeZ {
9819 * The element at position 0
9821 struct LDKPublicKey a;
9823 * The element at position 1
9826 } LDKC2Tuple_PublicKeyTypeZ;
9829 * A dynamically-allocated array of crate::c_types::derived::C2Tuple_PublicKeyTypeZs of arbitrary size.
9830 * This corresponds to std::vector in C++
9832 typedef struct LDKCVec_C2Tuple_PublicKeyTypeZZ {
9834 * The elements in the array.
9835 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
9837 struct LDKC2Tuple_PublicKeyTypeZ *data;
9839 * The number of elements pointed to by `data`.
9842 } LDKCVec_C2Tuple_PublicKeyTypeZZ;
9845 * The contents of a custom onion message.
9847 typedef struct LDKCustomOnionMessageContents {
9849 * An opaque pointer which is passed to your function implementations as an argument.
9850 * This has no meaning in the LDK, and can be NULL or any other value.
9854 * Returns the TLV type identifying the message contents. MUST be >= 64.
9856 uint64_t (*tlv_type)(const void *this_arg);
9858 * Serialize the object into a byte array
9860 struct LDKCVec_u8Z (*write)(const void *this_arg);
9862 * Frees any resources associated with this object given its this_arg pointer.
9863 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
9865 void (*free)(void *this_arg);
9866 } LDKCustomOnionMessageContents;
9869 * An enum which can either contain a crate::lightning::onion_message::packet::CustomOnionMessageContents or not
9871 typedef enum LDKCOption_CustomOnionMessageContentsZ_Tag {
9873 * When we're in this state, this COption_CustomOnionMessageContentsZ contains a crate::lightning::onion_message::packet::CustomOnionMessageContents
9875 LDKCOption_CustomOnionMessageContentsZ_Some,
9877 * When we're in this state, this COption_CustomOnionMessageContentsZ contains nothing
9879 LDKCOption_CustomOnionMessageContentsZ_None,
9881 * Must be last for serialization purposes
9883 LDKCOption_CustomOnionMessageContentsZ_Sentinel,
9884 } LDKCOption_CustomOnionMessageContentsZ_Tag;
9886 typedef struct LDKCOption_CustomOnionMessageContentsZ {
9887 LDKCOption_CustomOnionMessageContentsZ_Tag tag;
9890 struct LDKCustomOnionMessageContents some;
9893 } LDKCOption_CustomOnionMessageContentsZ;
9896 * The contents of CResult_COption_CustomOnionMessageContentsZDecodeErrorZ
9898 typedef union LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZPtr {
9900 * A pointer to the contents in the success state.
9901 * Reading from this pointer when `result_ok` is not set is undefined.
9903 struct LDKCOption_CustomOnionMessageContentsZ *result;
9905 * A pointer to the contents in the error state.
9906 * Reading from this pointer when `result_ok` is set is undefined.
9908 struct LDKDecodeError *err;
9909 } LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZPtr;
9912 * A CResult_COption_CustomOnionMessageContentsZDecodeErrorZ represents the result of a fallible operation,
9913 * containing a crate::c_types::derived::COption_CustomOnionMessageContentsZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
9914 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9916 typedef struct LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ {
9918 * The contents of this CResult_COption_CustomOnionMessageContentsZDecodeErrorZ, accessible via either
9919 * `err` or `result` depending on the state of `result_ok`.
9921 union LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZPtr contents;
9923 * Whether this CResult_COption_CustomOnionMessageContentsZDecodeErrorZ represents a success state.
9926 } LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ;
9929 * An enum which can either contain a crate::lightning::ln::msgs::NetAddress or not
9931 typedef enum LDKCOption_NetAddressZ_Tag {
9933 * When we're in this state, this COption_NetAddressZ contains a crate::lightning::ln::msgs::NetAddress
9935 LDKCOption_NetAddressZ_Some,
9937 * When we're in this state, this COption_NetAddressZ contains nothing
9939 LDKCOption_NetAddressZ_None,
9941 * Must be last for serialization purposes
9943 LDKCOption_NetAddressZ_Sentinel,
9944 } LDKCOption_NetAddressZ_Tag;
9946 typedef struct LDKCOption_NetAddressZ {
9947 LDKCOption_NetAddressZ_Tag tag;
9950 struct LDKNetAddress some;
9953 } LDKCOption_NetAddressZ;
9958 * Error for PeerManager errors. If you get one of these, you must disconnect the socket and
9959 * generate no further read_event/write_buffer_space_avail/socket_disconnected calls for the
9962 typedef struct MUST_USE_STRUCT LDKPeerHandleError {
9964 * A pointer to the opaque Rust object.
9965 * Nearly everywhere, inner must be non-null, however in places where
9966 * the Rust equivalent takes an Option, it may be set to null to indicate None.
9968 LDKnativePeerHandleError *inner;
9970 * Indicates that this is the only struct which contains the same pointer.
9971 * Rust functions which take ownership of an object provided via an argument require
9972 * this to be true and invalidate the object pointed to by inner.
9975 } LDKPeerHandleError;
9978 * The contents of CResult_CVec_u8ZPeerHandleErrorZ
9980 typedef union LDKCResult_CVec_u8ZPeerHandleErrorZPtr {
9982 * A pointer to the contents in the success state.
9983 * Reading from this pointer when `result_ok` is not set is undefined.
9985 struct LDKCVec_u8Z *result;
9987 * A pointer to the contents in the error state.
9988 * Reading from this pointer when `result_ok` is set is undefined.
9990 struct LDKPeerHandleError *err;
9991 } LDKCResult_CVec_u8ZPeerHandleErrorZPtr;
9994 * A CResult_CVec_u8ZPeerHandleErrorZ represents the result of a fallible operation,
9995 * containing a crate::c_types::derived::CVec_u8Z on success and a crate::lightning::ln::peer_handler::PeerHandleError on failure.
9996 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9998 typedef struct LDKCResult_CVec_u8ZPeerHandleErrorZ {
10000 * The contents of this CResult_CVec_u8ZPeerHandleErrorZ, accessible via either
10001 * `err` or `result` depending on the state of `result_ok`.
10003 union LDKCResult_CVec_u8ZPeerHandleErrorZPtr contents;
10005 * Whether this CResult_CVec_u8ZPeerHandleErrorZ represents a success state.
10008 } LDKCResult_CVec_u8ZPeerHandleErrorZ;
10011 * The contents of CResult_NonePeerHandleErrorZ
10013 typedef union LDKCResult_NonePeerHandleErrorZPtr {
10015 * Note that this value is always NULL, as there are no contents in the OK variant
10019 * A pointer to the contents in the error state.
10020 * Reading from this pointer when `result_ok` is set is undefined.
10022 struct LDKPeerHandleError *err;
10023 } LDKCResult_NonePeerHandleErrorZPtr;
10026 * A CResult_NonePeerHandleErrorZ represents the result of a fallible operation,
10027 * containing a () on success and a crate::lightning::ln::peer_handler::PeerHandleError on failure.
10028 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10030 typedef struct LDKCResult_NonePeerHandleErrorZ {
10032 * The contents of this CResult_NonePeerHandleErrorZ, accessible via either
10033 * `err` or `result` depending on the state of `result_ok`.
10035 union LDKCResult_NonePeerHandleErrorZPtr contents;
10037 * Whether this CResult_NonePeerHandleErrorZ represents a success state.
10040 } LDKCResult_NonePeerHandleErrorZ;
10043 * The contents of CResult_boolPeerHandleErrorZ
10045 typedef union LDKCResult_boolPeerHandleErrorZPtr {
10047 * A pointer to the contents in the success state.
10048 * Reading from this pointer when `result_ok` is not set is undefined.
10052 * A pointer to the contents in the error state.
10053 * Reading from this pointer when `result_ok` is set is undefined.
10055 struct LDKPeerHandleError *err;
10056 } LDKCResult_boolPeerHandleErrorZPtr;
10059 * A CResult_boolPeerHandleErrorZ represents the result of a fallible operation,
10060 * containing a bool on success and a crate::lightning::ln::peer_handler::PeerHandleError on failure.
10061 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10063 typedef struct LDKCResult_boolPeerHandleErrorZ {
10065 * The contents of this CResult_boolPeerHandleErrorZ, accessible via either
10066 * `err` or `result` depending on the state of `result_ok`.
10068 union LDKCResult_boolPeerHandleErrorZPtr contents;
10070 * Whether this CResult_boolPeerHandleErrorZ represents a success state.
10073 } LDKCResult_boolPeerHandleErrorZ;
10076 * Errors that may occur when [sending an onion message].
10078 * [sending an onion message]: OnionMessenger::send_custom_onion_message
10080 typedef enum LDKSendError_Tag {
10082 * Errored computing onion message packet keys.
10084 LDKSendError_Secp256k1,
10086 * Because implementations such as Eclair will drop onion messages where the message packet
10087 * exceeds 32834 bytes, we refuse to send messages where the packet exceeds this size.
10089 LDKSendError_TooBigPacket,
10091 * The provided [`Destination`] was an invalid [`BlindedRoute`], due to having fewer than two
10094 LDKSendError_TooFewBlindedHops,
10096 * Our next-hop peer was offline or does not support onion message forwarding.
10098 LDKSendError_InvalidFirstHop,
10100 * Onion message contents must have a TLV type >= 64.
10102 LDKSendError_InvalidMessage,
10104 * Our next-hop peer's buffer was full or our total outbound buffer was full.
10106 LDKSendError_BufferFull,
10108 * Must be last for serialization purposes
10110 LDKSendError_Sentinel,
10111 } LDKSendError_Tag;
10113 typedef struct MUST_USE_STRUCT LDKSendError {
10114 LDKSendError_Tag tag;
10117 enum LDKSecp256k1Error secp256k1;
10123 * The contents of CResult_NoneSendErrorZ
10125 typedef union LDKCResult_NoneSendErrorZPtr {
10127 * Note that this value is always NULL, as there are no contents in the OK variant
10131 * A pointer to the contents in the error state.
10132 * Reading from this pointer when `result_ok` is set is undefined.
10134 struct LDKSendError *err;
10135 } LDKCResult_NoneSendErrorZPtr;
10138 * A CResult_NoneSendErrorZ represents the result of a fallible operation,
10139 * containing a () on success and a crate::lightning::onion_message::messenger::SendError on failure.
10140 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10142 typedef struct LDKCResult_NoneSendErrorZ {
10144 * The contents of this CResult_NoneSendErrorZ, accessible via either
10145 * `err` or `result` depending on the state of `result_ok`.
10147 union LDKCResult_NoneSendErrorZPtr contents;
10149 * Whether this CResult_NoneSendErrorZ represents a success state.
10152 } LDKCResult_NoneSendErrorZ;
10155 * All-encompassing standard error type that processing can return
10157 typedef enum LDKGraphSyncError_Tag {
10159 * Error trying to read the update data, typically due to an erroneous data length indication
10160 * that is greater than the actual amount of data provided
10162 LDKGraphSyncError_DecodeError,
10164 * Error applying the patch to the network graph, usually the result of updates that are too
10165 * old or missing prerequisite data to the application of updates out of order
10167 LDKGraphSyncError_LightningError,
10169 * Must be last for serialization purposes
10171 LDKGraphSyncError_Sentinel,
10172 } LDKGraphSyncError_Tag;
10174 typedef struct MUST_USE_STRUCT LDKGraphSyncError {
10175 LDKGraphSyncError_Tag tag;
10178 struct LDKDecodeError decode_error;
10181 struct LDKLightningError lightning_error;
10184 } LDKGraphSyncError;
10187 * The contents of CResult_u32GraphSyncErrorZ
10189 typedef union LDKCResult_u32GraphSyncErrorZPtr {
10191 * A pointer to the contents in the success state.
10192 * Reading from this pointer when `result_ok` is not set is undefined.
10196 * A pointer to the contents in the error state.
10197 * Reading from this pointer when `result_ok` is set is undefined.
10199 struct LDKGraphSyncError *err;
10200 } LDKCResult_u32GraphSyncErrorZPtr;
10203 * A CResult_u32GraphSyncErrorZ represents the result of a fallible operation,
10204 * containing a u32 on success and a crate::lightning_rapid_gossip_sync::error::GraphSyncError on failure.
10205 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10207 typedef struct LDKCResult_u32GraphSyncErrorZ {
10209 * The contents of this CResult_u32GraphSyncErrorZ, accessible via either
10210 * `err` or `result` depending on the state of `result_ok`.
10212 union LDKCResult_u32GraphSyncErrorZPtr contents;
10214 * Whether this CResult_u32GraphSyncErrorZ represents a success state.
10217 } LDKCResult_u32GraphSyncErrorZ;
10220 * The contents of CResult_NetAddressDecodeErrorZ
10222 typedef union LDKCResult_NetAddressDecodeErrorZPtr {
10224 * A pointer to the contents in the success state.
10225 * Reading from this pointer when `result_ok` is not set is undefined.
10227 struct LDKNetAddress *result;
10229 * A pointer to the contents in the error state.
10230 * Reading from this pointer when `result_ok` is set is undefined.
10232 struct LDKDecodeError *err;
10233 } LDKCResult_NetAddressDecodeErrorZPtr;
10236 * A CResult_NetAddressDecodeErrorZ represents the result of a fallible operation,
10237 * containing a crate::lightning::ln::msgs::NetAddress on success and a crate::lightning::ln::msgs::DecodeError on failure.
10238 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10240 typedef struct LDKCResult_NetAddressDecodeErrorZ {
10242 * The contents of this CResult_NetAddressDecodeErrorZ, accessible via either
10243 * `err` or `result` depending on the state of `result_ok`.
10245 union LDKCResult_NetAddressDecodeErrorZPtr contents;
10247 * Whether this CResult_NetAddressDecodeErrorZ represents a success state.
10250 } LDKCResult_NetAddressDecodeErrorZ;
10255 * An update_add_htlc message to be sent or received from a peer
10257 typedef struct MUST_USE_STRUCT LDKUpdateAddHTLC {
10259 * A pointer to the opaque Rust object.
10260 * Nearly everywhere, inner must be non-null, however in places where
10261 * the Rust equivalent takes an Option, it may be set to null to indicate None.
10263 LDKnativeUpdateAddHTLC *inner;
10265 * Indicates that this is the only struct which contains the same pointer.
10266 * Rust functions which take ownership of an object provided via an argument require
10267 * this to be true and invalidate the object pointed to by inner.
10270 } LDKUpdateAddHTLC;
10273 * A dynamically-allocated array of crate::lightning::ln::msgs::UpdateAddHTLCs of arbitrary size.
10274 * This corresponds to std::vector in C++
10276 typedef struct LDKCVec_UpdateAddHTLCZ {
10278 * The elements in the array.
10279 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
10281 struct LDKUpdateAddHTLC *data;
10283 * The number of elements pointed to by `data`.
10286 } LDKCVec_UpdateAddHTLCZ;
10291 * An update_fulfill_htlc message to be sent or received from a peer
10293 typedef struct MUST_USE_STRUCT LDKUpdateFulfillHTLC {
10295 * A pointer to the opaque Rust object.
10296 * Nearly everywhere, inner must be non-null, however in places where
10297 * the Rust equivalent takes an Option, it may be set to null to indicate None.
10299 LDKnativeUpdateFulfillHTLC *inner;
10301 * Indicates that this is the only struct which contains the same pointer.
10302 * Rust functions which take ownership of an object provided via an argument require
10303 * this to be true and invalidate the object pointed to by inner.
10306 } LDKUpdateFulfillHTLC;
10309 * A dynamically-allocated array of crate::lightning::ln::msgs::UpdateFulfillHTLCs of arbitrary size.
10310 * This corresponds to std::vector in C++
10312 typedef struct LDKCVec_UpdateFulfillHTLCZ {
10314 * The elements in the array.
10315 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
10317 struct LDKUpdateFulfillHTLC *data;
10319 * The number of elements pointed to by `data`.
10322 } LDKCVec_UpdateFulfillHTLCZ;
10327 * An update_fail_htlc message to be sent or received from a peer
10329 typedef struct MUST_USE_STRUCT LDKUpdateFailHTLC {
10331 * A pointer to the opaque Rust object.
10332 * Nearly everywhere, inner must be non-null, however in places where
10333 * the Rust equivalent takes an Option, it may be set to null to indicate None.
10335 LDKnativeUpdateFailHTLC *inner;
10337 * Indicates that this is the only struct which contains the same pointer.
10338 * Rust functions which take ownership of an object provided via an argument require
10339 * this to be true and invalidate the object pointed to by inner.
10342 } LDKUpdateFailHTLC;
10345 * A dynamically-allocated array of crate::lightning::ln::msgs::UpdateFailHTLCs of arbitrary size.
10346 * This corresponds to std::vector in C++
10348 typedef struct LDKCVec_UpdateFailHTLCZ {
10350 * The elements in the array.
10351 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
10353 struct LDKUpdateFailHTLC *data;
10355 * The number of elements pointed to by `data`.
10358 } LDKCVec_UpdateFailHTLCZ;
10363 * An update_fail_malformed_htlc message to be sent or received from a peer
10365 typedef struct MUST_USE_STRUCT LDKUpdateFailMalformedHTLC {
10367 * A pointer to the opaque Rust object.
10368 * Nearly everywhere, inner must be non-null, however in places where
10369 * the Rust equivalent takes an Option, it may be set to null to indicate None.
10371 LDKnativeUpdateFailMalformedHTLC *inner;
10373 * Indicates that this is the only struct which contains the same pointer.
10374 * Rust functions which take ownership of an object provided via an argument require
10375 * this to be true and invalidate the object pointed to by inner.
10378 } LDKUpdateFailMalformedHTLC;
10381 * A dynamically-allocated array of crate::lightning::ln::msgs::UpdateFailMalformedHTLCs of arbitrary size.
10382 * This corresponds to std::vector in C++
10384 typedef struct LDKCVec_UpdateFailMalformedHTLCZ {
10386 * The elements in the array.
10387 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
10389 struct LDKUpdateFailMalformedHTLC *data;
10391 * The number of elements pointed to by `data`.
10394 } LDKCVec_UpdateFailMalformedHTLCZ;
10397 * The contents of CResult_AcceptChannelDecodeErrorZ
10399 typedef union LDKCResult_AcceptChannelDecodeErrorZPtr {
10401 * A pointer to the contents in the success state.
10402 * Reading from this pointer when `result_ok` is not set is undefined.
10404 struct LDKAcceptChannel *result;
10406 * A pointer to the contents in the error state.
10407 * Reading from this pointer when `result_ok` is set is undefined.
10409 struct LDKDecodeError *err;
10410 } LDKCResult_AcceptChannelDecodeErrorZPtr;
10413 * A CResult_AcceptChannelDecodeErrorZ represents the result of a fallible operation,
10414 * containing a crate::lightning::ln::msgs::AcceptChannel on success and a crate::lightning::ln::msgs::DecodeError on failure.
10415 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10417 typedef struct LDKCResult_AcceptChannelDecodeErrorZ {
10419 * The contents of this CResult_AcceptChannelDecodeErrorZ, accessible via either
10420 * `err` or `result` depending on the state of `result_ok`.
10422 union LDKCResult_AcceptChannelDecodeErrorZPtr contents;
10424 * Whether this CResult_AcceptChannelDecodeErrorZ represents a success state.
10427 } LDKCResult_AcceptChannelDecodeErrorZ;
10430 * The contents of CResult_AnnouncementSignaturesDecodeErrorZ
10432 typedef union LDKCResult_AnnouncementSignaturesDecodeErrorZPtr {
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 LDKAnnouncementSignatures *result;
10439 * A pointer to the contents in the error state.
10440 * Reading from this pointer when `result_ok` is set is undefined.
10442 struct LDKDecodeError *err;
10443 } LDKCResult_AnnouncementSignaturesDecodeErrorZPtr;
10446 * A CResult_AnnouncementSignaturesDecodeErrorZ represents the result of a fallible operation,
10447 * containing a crate::lightning::ln::msgs::AnnouncementSignatures on success and a crate::lightning::ln::msgs::DecodeError on failure.
10448 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10450 typedef struct LDKCResult_AnnouncementSignaturesDecodeErrorZ {
10452 * The contents of this CResult_AnnouncementSignaturesDecodeErrorZ, accessible via either
10453 * `err` or `result` depending on the state of `result_ok`.
10455 union LDKCResult_AnnouncementSignaturesDecodeErrorZPtr contents;
10457 * Whether this CResult_AnnouncementSignaturesDecodeErrorZ represents a success state.
10460 } LDKCResult_AnnouncementSignaturesDecodeErrorZ;
10463 * The contents of CResult_ChannelReestablishDecodeErrorZ
10465 typedef union LDKCResult_ChannelReestablishDecodeErrorZPtr {
10467 * A pointer to the contents in the success state.
10468 * Reading from this pointer when `result_ok` is not set is undefined.
10470 struct LDKChannelReestablish *result;
10472 * A pointer to the contents in the error state.
10473 * Reading from this pointer when `result_ok` is set is undefined.
10475 struct LDKDecodeError *err;
10476 } LDKCResult_ChannelReestablishDecodeErrorZPtr;
10479 * A CResult_ChannelReestablishDecodeErrorZ represents the result of a fallible operation,
10480 * containing a crate::lightning::ln::msgs::ChannelReestablish on success and a crate::lightning::ln::msgs::DecodeError on failure.
10481 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10483 typedef struct LDKCResult_ChannelReestablishDecodeErrorZ {
10485 * The contents of this CResult_ChannelReestablishDecodeErrorZ, accessible via either
10486 * `err` or `result` depending on the state of `result_ok`.
10488 union LDKCResult_ChannelReestablishDecodeErrorZPtr contents;
10490 * Whether this CResult_ChannelReestablishDecodeErrorZ represents a success state.
10493 } LDKCResult_ChannelReestablishDecodeErrorZ;
10496 * The contents of CResult_ClosingSignedDecodeErrorZ
10498 typedef union LDKCResult_ClosingSignedDecodeErrorZPtr {
10500 * A pointer to the contents in the success state.
10501 * Reading from this pointer when `result_ok` is not set is undefined.
10503 struct LDKClosingSigned *result;
10505 * A pointer to the contents in the error state.
10506 * Reading from this pointer when `result_ok` is set is undefined.
10508 struct LDKDecodeError *err;
10509 } LDKCResult_ClosingSignedDecodeErrorZPtr;
10512 * A CResult_ClosingSignedDecodeErrorZ represents the result of a fallible operation,
10513 * containing a crate::lightning::ln::msgs::ClosingSigned on success and a crate::lightning::ln::msgs::DecodeError on failure.
10514 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10516 typedef struct LDKCResult_ClosingSignedDecodeErrorZ {
10518 * The contents of this CResult_ClosingSignedDecodeErrorZ, accessible via either
10519 * `err` or `result` depending on the state of `result_ok`.
10521 union LDKCResult_ClosingSignedDecodeErrorZPtr contents;
10523 * Whether this CResult_ClosingSignedDecodeErrorZ represents a success state.
10526 } LDKCResult_ClosingSignedDecodeErrorZ;
10531 * The minimum and maximum fees which the sender is willing to place on the closing transaction.
10532 * This is provided in [`ClosingSigned`] by both sides to indicate the fee range they are willing
10535 typedef struct MUST_USE_STRUCT LDKClosingSignedFeeRange {
10537 * A pointer to the opaque Rust object.
10538 * Nearly everywhere, inner must be non-null, however in places where
10539 * the Rust equivalent takes an Option, it may be set to null to indicate None.
10541 LDKnativeClosingSignedFeeRange *inner;
10543 * Indicates that this is the only struct which contains the same pointer.
10544 * Rust functions which take ownership of an object provided via an argument require
10545 * this to be true and invalidate the object pointed to by inner.
10548 } LDKClosingSignedFeeRange;
10551 * The contents of CResult_ClosingSignedFeeRangeDecodeErrorZ
10553 typedef union LDKCResult_ClosingSignedFeeRangeDecodeErrorZPtr {
10555 * A pointer to the contents in the success state.
10556 * Reading from this pointer when `result_ok` is not set is undefined.
10558 struct LDKClosingSignedFeeRange *result;
10560 * A pointer to the contents in the error state.
10561 * Reading from this pointer when `result_ok` is set is undefined.
10563 struct LDKDecodeError *err;
10564 } LDKCResult_ClosingSignedFeeRangeDecodeErrorZPtr;
10567 * A CResult_ClosingSignedFeeRangeDecodeErrorZ represents the result of a fallible operation,
10568 * containing a crate::lightning::ln::msgs::ClosingSignedFeeRange on success and a crate::lightning::ln::msgs::DecodeError on failure.
10569 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10571 typedef struct LDKCResult_ClosingSignedFeeRangeDecodeErrorZ {
10573 * The contents of this CResult_ClosingSignedFeeRangeDecodeErrorZ, accessible via either
10574 * `err` or `result` depending on the state of `result_ok`.
10576 union LDKCResult_ClosingSignedFeeRangeDecodeErrorZPtr contents;
10578 * Whether this CResult_ClosingSignedFeeRangeDecodeErrorZ represents a success state.
10581 } LDKCResult_ClosingSignedFeeRangeDecodeErrorZ;
10586 * A commitment_signed message to be sent or received from a peer
10588 typedef struct MUST_USE_STRUCT LDKCommitmentSigned {
10590 * A pointer to the opaque Rust object.
10591 * Nearly everywhere, inner must be non-null, however in places where
10592 * the Rust equivalent takes an Option, it may be set to null to indicate None.
10594 LDKnativeCommitmentSigned *inner;
10596 * Indicates that this is the only struct which contains the same pointer.
10597 * Rust functions which take ownership of an object provided via an argument require
10598 * this to be true and invalidate the object pointed to by inner.
10601 } LDKCommitmentSigned;
10604 * The contents of CResult_CommitmentSignedDecodeErrorZ
10606 typedef union LDKCResult_CommitmentSignedDecodeErrorZPtr {
10608 * A pointer to the contents in the success state.
10609 * Reading from this pointer when `result_ok` is not set is undefined.
10611 struct LDKCommitmentSigned *result;
10613 * A pointer to the contents in the error state.
10614 * Reading from this pointer when `result_ok` is set is undefined.
10616 struct LDKDecodeError *err;
10617 } LDKCResult_CommitmentSignedDecodeErrorZPtr;
10620 * A CResult_CommitmentSignedDecodeErrorZ represents the result of a fallible operation,
10621 * containing a crate::lightning::ln::msgs::CommitmentSigned on success and a crate::lightning::ln::msgs::DecodeError on failure.
10622 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10624 typedef struct LDKCResult_CommitmentSignedDecodeErrorZ {
10626 * The contents of this CResult_CommitmentSignedDecodeErrorZ, accessible via either
10627 * `err` or `result` depending on the state of `result_ok`.
10629 union LDKCResult_CommitmentSignedDecodeErrorZPtr contents;
10631 * Whether this CResult_CommitmentSignedDecodeErrorZ represents a success state.
10634 } LDKCResult_CommitmentSignedDecodeErrorZ;
10637 * The contents of CResult_FundingCreatedDecodeErrorZ
10639 typedef union LDKCResult_FundingCreatedDecodeErrorZPtr {
10641 * A pointer to the contents in the success state.
10642 * Reading from this pointer when `result_ok` is not set is undefined.
10644 struct LDKFundingCreated *result;
10646 * A pointer to the contents in the error state.
10647 * Reading from this pointer when `result_ok` is set is undefined.
10649 struct LDKDecodeError *err;
10650 } LDKCResult_FundingCreatedDecodeErrorZPtr;
10653 * A CResult_FundingCreatedDecodeErrorZ represents the result of a fallible operation,
10654 * containing a crate::lightning::ln::msgs::FundingCreated on success and a crate::lightning::ln::msgs::DecodeError on failure.
10655 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10657 typedef struct LDKCResult_FundingCreatedDecodeErrorZ {
10659 * The contents of this CResult_FundingCreatedDecodeErrorZ, accessible via either
10660 * `err` or `result` depending on the state of `result_ok`.
10662 union LDKCResult_FundingCreatedDecodeErrorZPtr contents;
10664 * Whether this CResult_FundingCreatedDecodeErrorZ represents a success state.
10667 } LDKCResult_FundingCreatedDecodeErrorZ;
10670 * The contents of CResult_FundingSignedDecodeErrorZ
10672 typedef union LDKCResult_FundingSignedDecodeErrorZPtr {
10674 * A pointer to the contents in the success state.
10675 * Reading from this pointer when `result_ok` is not set is undefined.
10677 struct LDKFundingSigned *result;
10679 * A pointer to the contents in the error state.
10680 * Reading from this pointer when `result_ok` is set is undefined.
10682 struct LDKDecodeError *err;
10683 } LDKCResult_FundingSignedDecodeErrorZPtr;
10686 * A CResult_FundingSignedDecodeErrorZ represents the result of a fallible operation,
10687 * containing a crate::lightning::ln::msgs::FundingSigned on success and a crate::lightning::ln::msgs::DecodeError on failure.
10688 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10690 typedef struct LDKCResult_FundingSignedDecodeErrorZ {
10692 * The contents of this CResult_FundingSignedDecodeErrorZ, accessible via either
10693 * `err` or `result` depending on the state of `result_ok`.
10695 union LDKCResult_FundingSignedDecodeErrorZPtr contents;
10697 * Whether this CResult_FundingSignedDecodeErrorZ represents a success state.
10700 } LDKCResult_FundingSignedDecodeErrorZ;
10703 * The contents of CResult_ChannelReadyDecodeErrorZ
10705 typedef union LDKCResult_ChannelReadyDecodeErrorZPtr {
10707 * A pointer to the contents in the success state.
10708 * Reading from this pointer when `result_ok` is not set is undefined.
10710 struct LDKChannelReady *result;
10712 * A pointer to the contents in the error state.
10713 * Reading from this pointer when `result_ok` is set is undefined.
10715 struct LDKDecodeError *err;
10716 } LDKCResult_ChannelReadyDecodeErrorZPtr;
10719 * A CResult_ChannelReadyDecodeErrorZ represents the result of a fallible operation,
10720 * containing a crate::lightning::ln::msgs::ChannelReady on success and a crate::lightning::ln::msgs::DecodeError on failure.
10721 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10723 typedef struct LDKCResult_ChannelReadyDecodeErrorZ {
10725 * The contents of this CResult_ChannelReadyDecodeErrorZ, accessible via either
10726 * `err` or `result` depending on the state of `result_ok`.
10728 union LDKCResult_ChannelReadyDecodeErrorZPtr contents;
10730 * Whether this CResult_ChannelReadyDecodeErrorZ represents a success state.
10733 } LDKCResult_ChannelReadyDecodeErrorZ;
10738 * An init message to be sent or received from a peer
10740 typedef struct MUST_USE_STRUCT LDKInit {
10742 * A pointer to the opaque Rust object.
10743 * Nearly everywhere, inner must be non-null, however in places where
10744 * the Rust equivalent takes an Option, it may be set to null to indicate None.
10746 LDKnativeInit *inner;
10748 * Indicates that this is the only struct which contains the same pointer.
10749 * Rust functions which take ownership of an object provided via an argument require
10750 * this to be true and invalidate the object pointed to by inner.
10756 * The contents of CResult_InitDecodeErrorZ
10758 typedef union LDKCResult_InitDecodeErrorZPtr {
10760 * A pointer to the contents in the success state.
10761 * Reading from this pointer when `result_ok` is not set is undefined.
10763 struct LDKInit *result;
10765 * A pointer to the contents in the error state.
10766 * Reading from this pointer when `result_ok` is set is undefined.
10768 struct LDKDecodeError *err;
10769 } LDKCResult_InitDecodeErrorZPtr;
10772 * A CResult_InitDecodeErrorZ represents the result of a fallible operation,
10773 * containing a crate::lightning::ln::msgs::Init on success and a crate::lightning::ln::msgs::DecodeError on failure.
10774 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10776 typedef struct LDKCResult_InitDecodeErrorZ {
10778 * The contents of this CResult_InitDecodeErrorZ, accessible via either
10779 * `err` or `result` depending on the state of `result_ok`.
10781 union LDKCResult_InitDecodeErrorZPtr contents;
10783 * Whether this CResult_InitDecodeErrorZ represents a success state.
10786 } LDKCResult_InitDecodeErrorZ;
10789 * The contents of CResult_OpenChannelDecodeErrorZ
10791 typedef union LDKCResult_OpenChannelDecodeErrorZPtr {
10793 * A pointer to the contents in the success state.
10794 * Reading from this pointer when `result_ok` is not set is undefined.
10796 struct LDKOpenChannel *result;
10798 * A pointer to the contents in the error state.
10799 * Reading from this pointer when `result_ok` is set is undefined.
10801 struct LDKDecodeError *err;
10802 } LDKCResult_OpenChannelDecodeErrorZPtr;
10805 * A CResult_OpenChannelDecodeErrorZ represents the result of a fallible operation,
10806 * containing a crate::lightning::ln::msgs::OpenChannel on success and a crate::lightning::ln::msgs::DecodeError on failure.
10807 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10809 typedef struct LDKCResult_OpenChannelDecodeErrorZ {
10811 * The contents of this CResult_OpenChannelDecodeErrorZ, accessible via either
10812 * `err` or `result` depending on the state of `result_ok`.
10814 union LDKCResult_OpenChannelDecodeErrorZPtr contents;
10816 * Whether this CResult_OpenChannelDecodeErrorZ represents a success state.
10819 } LDKCResult_OpenChannelDecodeErrorZ;
10822 * The contents of CResult_RevokeAndACKDecodeErrorZ
10824 typedef union LDKCResult_RevokeAndACKDecodeErrorZPtr {
10826 * A pointer to the contents in the success state.
10827 * Reading from this pointer when `result_ok` is not set is undefined.
10829 struct LDKRevokeAndACK *result;
10831 * A pointer to the contents in the error state.
10832 * Reading from this pointer when `result_ok` is set is undefined.
10834 struct LDKDecodeError *err;
10835 } LDKCResult_RevokeAndACKDecodeErrorZPtr;
10838 * A CResult_RevokeAndACKDecodeErrorZ represents the result of a fallible operation,
10839 * containing a crate::lightning::ln::msgs::RevokeAndACK on success and a crate::lightning::ln::msgs::DecodeError on failure.
10840 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10842 typedef struct LDKCResult_RevokeAndACKDecodeErrorZ {
10844 * The contents of this CResult_RevokeAndACKDecodeErrorZ, accessible via either
10845 * `err` or `result` depending on the state of `result_ok`.
10847 union LDKCResult_RevokeAndACKDecodeErrorZPtr contents;
10849 * Whether this CResult_RevokeAndACKDecodeErrorZ represents a success state.
10852 } LDKCResult_RevokeAndACKDecodeErrorZ;
10855 * The contents of CResult_ShutdownDecodeErrorZ
10857 typedef union LDKCResult_ShutdownDecodeErrorZPtr {
10859 * A pointer to the contents in the success state.
10860 * Reading from this pointer when `result_ok` is not set is undefined.
10862 struct LDKShutdown *result;
10864 * A pointer to the contents in the error state.
10865 * Reading from this pointer when `result_ok` is set is undefined.
10867 struct LDKDecodeError *err;
10868 } LDKCResult_ShutdownDecodeErrorZPtr;
10871 * A CResult_ShutdownDecodeErrorZ represents the result of a fallible operation,
10872 * containing a crate::lightning::ln::msgs::Shutdown on success and a crate::lightning::ln::msgs::DecodeError on failure.
10873 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10875 typedef struct LDKCResult_ShutdownDecodeErrorZ {
10877 * The contents of this CResult_ShutdownDecodeErrorZ, accessible via either
10878 * `err` or `result` depending on the state of `result_ok`.
10880 union LDKCResult_ShutdownDecodeErrorZPtr contents;
10882 * Whether this CResult_ShutdownDecodeErrorZ represents a success state.
10885 } LDKCResult_ShutdownDecodeErrorZ;
10888 * The contents of CResult_UpdateFailHTLCDecodeErrorZ
10890 typedef union LDKCResult_UpdateFailHTLCDecodeErrorZPtr {
10892 * A pointer to the contents in the success state.
10893 * Reading from this pointer when `result_ok` is not set is undefined.
10895 struct LDKUpdateFailHTLC *result;
10897 * A pointer to the contents in the error state.
10898 * Reading from this pointer when `result_ok` is set is undefined.
10900 struct LDKDecodeError *err;
10901 } LDKCResult_UpdateFailHTLCDecodeErrorZPtr;
10904 * A CResult_UpdateFailHTLCDecodeErrorZ represents the result of a fallible operation,
10905 * containing a crate::lightning::ln::msgs::UpdateFailHTLC on success and a crate::lightning::ln::msgs::DecodeError on failure.
10906 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10908 typedef struct LDKCResult_UpdateFailHTLCDecodeErrorZ {
10910 * The contents of this CResult_UpdateFailHTLCDecodeErrorZ, accessible via either
10911 * `err` or `result` depending on the state of `result_ok`.
10913 union LDKCResult_UpdateFailHTLCDecodeErrorZPtr contents;
10915 * Whether this CResult_UpdateFailHTLCDecodeErrorZ represents a success state.
10918 } LDKCResult_UpdateFailHTLCDecodeErrorZ;
10921 * The contents of CResult_UpdateFailMalformedHTLCDecodeErrorZ
10923 typedef union LDKCResult_UpdateFailMalformedHTLCDecodeErrorZPtr {
10925 * A pointer to the contents in the success state.
10926 * Reading from this pointer when `result_ok` is not set is undefined.
10928 struct LDKUpdateFailMalformedHTLC *result;
10930 * A pointer to the contents in the error state.
10931 * Reading from this pointer when `result_ok` is set is undefined.
10933 struct LDKDecodeError *err;
10934 } LDKCResult_UpdateFailMalformedHTLCDecodeErrorZPtr;
10937 * A CResult_UpdateFailMalformedHTLCDecodeErrorZ represents the result of a fallible operation,
10938 * containing a crate::lightning::ln::msgs::UpdateFailMalformedHTLC on success and a crate::lightning::ln::msgs::DecodeError on failure.
10939 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10941 typedef struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ {
10943 * The contents of this CResult_UpdateFailMalformedHTLCDecodeErrorZ, accessible via either
10944 * `err` or `result` depending on the state of `result_ok`.
10946 union LDKCResult_UpdateFailMalformedHTLCDecodeErrorZPtr contents;
10948 * Whether this CResult_UpdateFailMalformedHTLCDecodeErrorZ represents a success state.
10951 } LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ;
10956 * An update_fee message to be sent or received from a peer
10958 typedef struct MUST_USE_STRUCT LDKUpdateFee {
10960 * A pointer to the opaque Rust object.
10961 * Nearly everywhere, inner must be non-null, however in places where
10962 * the Rust equivalent takes an Option, it may be set to null to indicate None.
10964 LDKnativeUpdateFee *inner;
10966 * Indicates that this is the only struct which contains the same pointer.
10967 * Rust functions which take ownership of an object provided via an argument require
10968 * this to be true and invalidate the object pointed to by inner.
10974 * The contents of CResult_UpdateFeeDecodeErrorZ
10976 typedef union LDKCResult_UpdateFeeDecodeErrorZPtr {
10978 * A pointer to the contents in the success state.
10979 * Reading from this pointer when `result_ok` is not set is undefined.
10981 struct LDKUpdateFee *result;
10983 * A pointer to the contents in the error state.
10984 * Reading from this pointer when `result_ok` is set is undefined.
10986 struct LDKDecodeError *err;
10987 } LDKCResult_UpdateFeeDecodeErrorZPtr;
10990 * A CResult_UpdateFeeDecodeErrorZ represents the result of a fallible operation,
10991 * containing a crate::lightning::ln::msgs::UpdateFee on success and a crate::lightning::ln::msgs::DecodeError on failure.
10992 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10994 typedef struct LDKCResult_UpdateFeeDecodeErrorZ {
10996 * The contents of this CResult_UpdateFeeDecodeErrorZ, accessible via either
10997 * `err` or `result` depending on the state of `result_ok`.
10999 union LDKCResult_UpdateFeeDecodeErrorZPtr contents;
11001 * Whether this CResult_UpdateFeeDecodeErrorZ represents a success state.
11004 } LDKCResult_UpdateFeeDecodeErrorZ;
11007 * The contents of CResult_UpdateFulfillHTLCDecodeErrorZ
11009 typedef union LDKCResult_UpdateFulfillHTLCDecodeErrorZPtr {
11011 * A pointer to the contents in the success state.
11012 * Reading from this pointer when `result_ok` is not set is undefined.
11014 struct LDKUpdateFulfillHTLC *result;
11016 * A pointer to the contents in the error state.
11017 * Reading from this pointer when `result_ok` is set is undefined.
11019 struct LDKDecodeError *err;
11020 } LDKCResult_UpdateFulfillHTLCDecodeErrorZPtr;
11023 * A CResult_UpdateFulfillHTLCDecodeErrorZ represents the result of a fallible operation,
11024 * containing a crate::lightning::ln::msgs::UpdateFulfillHTLC on success and a crate::lightning::ln::msgs::DecodeError on failure.
11025 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
11027 typedef struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ {
11029 * The contents of this CResult_UpdateFulfillHTLCDecodeErrorZ, accessible via either
11030 * `err` or `result` depending on the state of `result_ok`.
11032 union LDKCResult_UpdateFulfillHTLCDecodeErrorZPtr contents;
11034 * Whether this CResult_UpdateFulfillHTLCDecodeErrorZ represents a success state.
11037 } LDKCResult_UpdateFulfillHTLCDecodeErrorZ;
11040 * The contents of CResult_UpdateAddHTLCDecodeErrorZ
11042 typedef union LDKCResult_UpdateAddHTLCDecodeErrorZPtr {
11044 * A pointer to the contents in the success state.
11045 * Reading from this pointer when `result_ok` is not set is undefined.
11047 struct LDKUpdateAddHTLC *result;
11049 * A pointer to the contents in the error state.
11050 * Reading from this pointer when `result_ok` is set is undefined.
11052 struct LDKDecodeError *err;
11053 } LDKCResult_UpdateAddHTLCDecodeErrorZPtr;
11056 * A CResult_UpdateAddHTLCDecodeErrorZ represents the result of a fallible operation,
11057 * containing a crate::lightning::ln::msgs::UpdateAddHTLC on success and a crate::lightning::ln::msgs::DecodeError on failure.
11058 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
11060 typedef struct LDKCResult_UpdateAddHTLCDecodeErrorZ {
11062 * The contents of this CResult_UpdateAddHTLCDecodeErrorZ, accessible via either
11063 * `err` or `result` depending on the state of `result_ok`.
11065 union LDKCResult_UpdateAddHTLCDecodeErrorZPtr contents;
11067 * Whether this CResult_UpdateAddHTLCDecodeErrorZ represents a success state.
11070 } LDKCResult_UpdateAddHTLCDecodeErrorZ;
11075 * An onion message to be sent or received from a peer
11077 typedef struct MUST_USE_STRUCT LDKOnionMessage {
11079 * A pointer to the opaque Rust object.
11080 * Nearly everywhere, inner must be non-null, however in places where
11081 * the Rust equivalent takes an Option, it may be set to null to indicate None.
11083 LDKnativeOnionMessage *inner;
11085 * Indicates that this is the only struct which contains the same pointer.
11086 * Rust functions which take ownership of an object provided via an argument require
11087 * this to be true and invalidate the object pointed to by inner.
11093 * The contents of CResult_OnionMessageDecodeErrorZ
11095 typedef union LDKCResult_OnionMessageDecodeErrorZPtr {
11097 * A pointer to the contents in the success state.
11098 * Reading from this pointer when `result_ok` is not set is undefined.
11100 struct LDKOnionMessage *result;
11102 * A pointer to the contents in the error state.
11103 * Reading from this pointer when `result_ok` is set is undefined.
11105 struct LDKDecodeError *err;
11106 } LDKCResult_OnionMessageDecodeErrorZPtr;
11109 * A CResult_OnionMessageDecodeErrorZ represents the result of a fallible operation,
11110 * containing a crate::lightning::ln::msgs::OnionMessage on success and a crate::lightning::ln::msgs::DecodeError on failure.
11111 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
11113 typedef struct LDKCResult_OnionMessageDecodeErrorZ {
11115 * The contents of this CResult_OnionMessageDecodeErrorZ, accessible via either
11116 * `err` or `result` depending on the state of `result_ok`.
11118 union LDKCResult_OnionMessageDecodeErrorZPtr contents;
11120 * Whether this CResult_OnionMessageDecodeErrorZ represents a success state.
11123 } LDKCResult_OnionMessageDecodeErrorZ;
11128 * A ping message to be sent or received from a peer
11130 typedef struct MUST_USE_STRUCT LDKPing {
11132 * A pointer to the opaque Rust object.
11133 * Nearly everywhere, inner must be non-null, however in places where
11134 * the Rust equivalent takes an Option, it may be set to null to indicate None.
11136 LDKnativePing *inner;
11138 * Indicates that this is the only struct which contains the same pointer.
11139 * Rust functions which take ownership of an object provided via an argument require
11140 * this to be true and invalidate the object pointed to by inner.
11146 * The contents of CResult_PingDecodeErrorZ
11148 typedef union LDKCResult_PingDecodeErrorZPtr {
11150 * A pointer to the contents in the success state.
11151 * Reading from this pointer when `result_ok` is not set is undefined.
11153 struct LDKPing *result;
11155 * A pointer to the contents in the error state.
11156 * Reading from this pointer when `result_ok` is set is undefined.
11158 struct LDKDecodeError *err;
11159 } LDKCResult_PingDecodeErrorZPtr;
11162 * A CResult_PingDecodeErrorZ represents the result of a fallible operation,
11163 * containing a crate::lightning::ln::msgs::Ping on success and a crate::lightning::ln::msgs::DecodeError on failure.
11164 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
11166 typedef struct LDKCResult_PingDecodeErrorZ {
11168 * The contents of this CResult_PingDecodeErrorZ, accessible via either
11169 * `err` or `result` depending on the state of `result_ok`.
11171 union LDKCResult_PingDecodeErrorZPtr contents;
11173 * Whether this CResult_PingDecodeErrorZ represents a success state.
11176 } LDKCResult_PingDecodeErrorZ;
11181 * A pong message to be sent or received from a peer
11183 typedef struct MUST_USE_STRUCT LDKPong {
11185 * A pointer to the opaque Rust object.
11186 * Nearly everywhere, inner must be non-null, however in places where
11187 * the Rust equivalent takes an Option, it may be set to null to indicate None.
11189 LDKnativePong *inner;
11191 * Indicates that this is the only struct which contains the same pointer.
11192 * Rust functions which take ownership of an object provided via an argument require
11193 * this to be true and invalidate the object pointed to by inner.
11199 * The contents of CResult_PongDecodeErrorZ
11201 typedef union LDKCResult_PongDecodeErrorZPtr {
11203 * A pointer to the contents in the success state.
11204 * Reading from this pointer when `result_ok` is not set is undefined.
11206 struct LDKPong *result;
11208 * A pointer to the contents in the error state.
11209 * Reading from this pointer when `result_ok` is set is undefined.
11211 struct LDKDecodeError *err;
11212 } LDKCResult_PongDecodeErrorZPtr;
11215 * A CResult_PongDecodeErrorZ represents the result of a fallible operation,
11216 * containing a crate::lightning::ln::msgs::Pong on success and a crate::lightning::ln::msgs::DecodeError on failure.
11217 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
11219 typedef struct LDKCResult_PongDecodeErrorZ {
11221 * The contents of this CResult_PongDecodeErrorZ, accessible via either
11222 * `err` or `result` depending on the state of `result_ok`.
11224 union LDKCResult_PongDecodeErrorZPtr contents;
11226 * Whether this CResult_PongDecodeErrorZ represents a success state.
11229 } LDKCResult_PongDecodeErrorZ;
11232 * The contents of CResult_UnsignedChannelAnnouncementDecodeErrorZ
11234 typedef union LDKCResult_UnsignedChannelAnnouncementDecodeErrorZPtr {
11236 * A pointer to the contents in the success state.
11237 * Reading from this pointer when `result_ok` is not set is undefined.
11239 struct LDKUnsignedChannelAnnouncement *result;
11241 * A pointer to the contents in the error state.
11242 * Reading from this pointer when `result_ok` is set is undefined.
11244 struct LDKDecodeError *err;
11245 } LDKCResult_UnsignedChannelAnnouncementDecodeErrorZPtr;
11248 * A CResult_UnsignedChannelAnnouncementDecodeErrorZ represents the result of a fallible operation,
11249 * containing a crate::lightning::ln::msgs::UnsignedChannelAnnouncement on success and a crate::lightning::ln::msgs::DecodeError on failure.
11250 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
11252 typedef struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ {
11254 * The contents of this CResult_UnsignedChannelAnnouncementDecodeErrorZ, accessible via either
11255 * `err` or `result` depending on the state of `result_ok`.
11257 union LDKCResult_UnsignedChannelAnnouncementDecodeErrorZPtr contents;
11259 * Whether this CResult_UnsignedChannelAnnouncementDecodeErrorZ represents a success state.
11262 } LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ;
11265 * The contents of CResult_ChannelAnnouncementDecodeErrorZ
11267 typedef union LDKCResult_ChannelAnnouncementDecodeErrorZPtr {
11269 * A pointer to the contents in the success state.
11270 * Reading from this pointer when `result_ok` is not set is undefined.
11272 struct LDKChannelAnnouncement *result;
11274 * A pointer to the contents in the error state.
11275 * Reading from this pointer when `result_ok` is set is undefined.
11277 struct LDKDecodeError *err;
11278 } LDKCResult_ChannelAnnouncementDecodeErrorZPtr;
11281 * A CResult_ChannelAnnouncementDecodeErrorZ represents the result of a fallible operation,
11282 * containing a crate::lightning::ln::msgs::ChannelAnnouncement on success and a crate::lightning::ln::msgs::DecodeError on failure.
11283 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
11285 typedef struct LDKCResult_ChannelAnnouncementDecodeErrorZ {
11287 * The contents of this CResult_ChannelAnnouncementDecodeErrorZ, accessible via either
11288 * `err` or `result` depending on the state of `result_ok`.
11290 union LDKCResult_ChannelAnnouncementDecodeErrorZPtr contents;
11292 * Whether this CResult_ChannelAnnouncementDecodeErrorZ represents a success state.
11295 } LDKCResult_ChannelAnnouncementDecodeErrorZ;
11300 * The unsigned part of a channel_update
11302 typedef struct MUST_USE_STRUCT LDKUnsignedChannelUpdate {
11304 * A pointer to the opaque Rust object.
11305 * Nearly everywhere, inner must be non-null, however in places where
11306 * the Rust equivalent takes an Option, it may be set to null to indicate None.
11308 LDKnativeUnsignedChannelUpdate *inner;
11310 * Indicates that this is the only struct which contains the same pointer.
11311 * Rust functions which take ownership of an object provided via an argument require
11312 * this to be true and invalidate the object pointed to by inner.
11315 } LDKUnsignedChannelUpdate;
11318 * The contents of CResult_UnsignedChannelUpdateDecodeErrorZ
11320 typedef union LDKCResult_UnsignedChannelUpdateDecodeErrorZPtr {
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 LDKUnsignedChannelUpdate *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_UnsignedChannelUpdateDecodeErrorZPtr;
11334 * A CResult_UnsignedChannelUpdateDecodeErrorZ represents the result of a fallible operation,
11335 * containing a crate::lightning::ln::msgs::UnsignedChannelUpdate 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_UnsignedChannelUpdateDecodeErrorZ {
11340 * The contents of this CResult_UnsignedChannelUpdateDecodeErrorZ, accessible via either
11341 * `err` or `result` depending on the state of `result_ok`.
11343 union LDKCResult_UnsignedChannelUpdateDecodeErrorZPtr contents;
11345 * Whether this CResult_UnsignedChannelUpdateDecodeErrorZ represents a success state.
11348 } LDKCResult_UnsignedChannelUpdateDecodeErrorZ;
11351 * The contents of CResult_ChannelUpdateDecodeErrorZ
11353 typedef union LDKCResult_ChannelUpdateDecodeErrorZPtr {
11355 * A pointer to the contents in the success state.
11356 * Reading from this pointer when `result_ok` is not set is undefined.
11358 struct LDKChannelUpdate *result;
11360 * A pointer to the contents in the error state.
11361 * Reading from this pointer when `result_ok` is set is undefined.
11363 struct LDKDecodeError *err;
11364 } LDKCResult_ChannelUpdateDecodeErrorZPtr;
11367 * A CResult_ChannelUpdateDecodeErrorZ represents the result of a fallible operation,
11368 * containing a crate::lightning::ln::msgs::ChannelUpdate on success and a crate::lightning::ln::msgs::DecodeError on failure.
11369 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
11371 typedef struct LDKCResult_ChannelUpdateDecodeErrorZ {
11373 * The contents of this CResult_ChannelUpdateDecodeErrorZ, accessible via either
11374 * `err` or `result` depending on the state of `result_ok`.
11376 union LDKCResult_ChannelUpdateDecodeErrorZPtr contents;
11378 * Whether this CResult_ChannelUpdateDecodeErrorZ represents a success state.
11381 } LDKCResult_ChannelUpdateDecodeErrorZ;
11384 * The contents of CResult_ErrorMessageDecodeErrorZ
11386 typedef union LDKCResult_ErrorMessageDecodeErrorZPtr {
11388 * A pointer to the contents in the success state.
11389 * Reading from this pointer when `result_ok` is not set is undefined.
11391 struct LDKErrorMessage *result;
11393 * A pointer to the contents in the error state.
11394 * Reading from this pointer when `result_ok` is set is undefined.
11396 struct LDKDecodeError *err;
11397 } LDKCResult_ErrorMessageDecodeErrorZPtr;
11400 * A CResult_ErrorMessageDecodeErrorZ represents the result of a fallible operation,
11401 * containing a crate::lightning::ln::msgs::ErrorMessage on success and a crate::lightning::ln::msgs::DecodeError on failure.
11402 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
11404 typedef struct LDKCResult_ErrorMessageDecodeErrorZ {
11406 * The contents of this CResult_ErrorMessageDecodeErrorZ, accessible via either
11407 * `err` or `result` depending on the state of `result_ok`.
11409 union LDKCResult_ErrorMessageDecodeErrorZPtr contents;
11411 * Whether this CResult_ErrorMessageDecodeErrorZ represents a success state.
11414 } LDKCResult_ErrorMessageDecodeErrorZ;
11417 * The contents of CResult_WarningMessageDecodeErrorZ
11419 typedef union LDKCResult_WarningMessageDecodeErrorZPtr {
11421 * A pointer to the contents in the success state.
11422 * Reading from this pointer when `result_ok` is not set is undefined.
11424 struct LDKWarningMessage *result;
11426 * A pointer to the contents in the error state.
11427 * Reading from this pointer when `result_ok` is set is undefined.
11429 struct LDKDecodeError *err;
11430 } LDKCResult_WarningMessageDecodeErrorZPtr;
11433 * A CResult_WarningMessageDecodeErrorZ represents the result of a fallible operation,
11434 * containing a crate::lightning::ln::msgs::WarningMessage on success and a crate::lightning::ln::msgs::DecodeError on failure.
11435 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
11437 typedef struct LDKCResult_WarningMessageDecodeErrorZ {
11439 * The contents of this CResult_WarningMessageDecodeErrorZ, accessible via either
11440 * `err` or `result` depending on the state of `result_ok`.
11442 union LDKCResult_WarningMessageDecodeErrorZPtr contents;
11444 * Whether this CResult_WarningMessageDecodeErrorZ represents a success state.
11447 } LDKCResult_WarningMessageDecodeErrorZ;
11452 * The unsigned part of a node_announcement
11454 typedef struct MUST_USE_STRUCT LDKUnsignedNodeAnnouncement {
11456 * A pointer to the opaque Rust object.
11457 * Nearly everywhere, inner must be non-null, however in places where
11458 * the Rust equivalent takes an Option, it may be set to null to indicate None.
11460 LDKnativeUnsignedNodeAnnouncement *inner;
11462 * Indicates that this is the only struct which contains the same pointer.
11463 * Rust functions which take ownership of an object provided via an argument require
11464 * this to be true and invalidate the object pointed to by inner.
11467 } LDKUnsignedNodeAnnouncement;
11470 * The contents of CResult_UnsignedNodeAnnouncementDecodeErrorZ
11472 typedef union LDKCResult_UnsignedNodeAnnouncementDecodeErrorZPtr {
11474 * A pointer to the contents in the success state.
11475 * Reading from this pointer when `result_ok` is not set is undefined.
11477 struct LDKUnsignedNodeAnnouncement *result;
11479 * A pointer to the contents in the error state.
11480 * Reading from this pointer when `result_ok` is set is undefined.
11482 struct LDKDecodeError *err;
11483 } LDKCResult_UnsignedNodeAnnouncementDecodeErrorZPtr;
11486 * A CResult_UnsignedNodeAnnouncementDecodeErrorZ represents the result of a fallible operation,
11487 * containing a crate::lightning::ln::msgs::UnsignedNodeAnnouncement on success and a crate::lightning::ln::msgs::DecodeError on failure.
11488 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
11490 typedef struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ {
11492 * The contents of this CResult_UnsignedNodeAnnouncementDecodeErrorZ, accessible via either
11493 * `err` or `result` depending on the state of `result_ok`.
11495 union LDKCResult_UnsignedNodeAnnouncementDecodeErrorZPtr contents;
11497 * Whether this CResult_UnsignedNodeAnnouncementDecodeErrorZ represents a success state.
11500 } LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ;
11505 * A node_announcement message to be sent or received from a peer
11507 typedef struct MUST_USE_STRUCT LDKNodeAnnouncement {
11509 * A pointer to the opaque Rust object.
11510 * Nearly everywhere, inner must be non-null, however in places where
11511 * the Rust equivalent takes an Option, it may be set to null to indicate None.
11513 LDKnativeNodeAnnouncement *inner;
11515 * Indicates that this is the only struct which contains the same pointer.
11516 * Rust functions which take ownership of an object provided via an argument require
11517 * this to be true and invalidate the object pointed to by inner.
11520 } LDKNodeAnnouncement;
11523 * The contents of CResult_NodeAnnouncementDecodeErrorZ
11525 typedef union LDKCResult_NodeAnnouncementDecodeErrorZPtr {
11527 * A pointer to the contents in the success state.
11528 * Reading from this pointer when `result_ok` is not set is undefined.
11530 struct LDKNodeAnnouncement *result;
11532 * A pointer to the contents in the error state.
11533 * Reading from this pointer when `result_ok` is set is undefined.
11535 struct LDKDecodeError *err;
11536 } LDKCResult_NodeAnnouncementDecodeErrorZPtr;
11539 * A CResult_NodeAnnouncementDecodeErrorZ represents the result of a fallible operation,
11540 * containing a crate::lightning::ln::msgs::NodeAnnouncement on success and a crate::lightning::ln::msgs::DecodeError on failure.
11541 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
11543 typedef struct LDKCResult_NodeAnnouncementDecodeErrorZ {
11545 * The contents of this CResult_NodeAnnouncementDecodeErrorZ, accessible via either
11546 * `err` or `result` depending on the state of `result_ok`.
11548 union LDKCResult_NodeAnnouncementDecodeErrorZPtr contents;
11550 * Whether this CResult_NodeAnnouncementDecodeErrorZ represents a success state.
11553 } LDKCResult_NodeAnnouncementDecodeErrorZ;
11556 * The contents of CResult_QueryShortChannelIdsDecodeErrorZ
11558 typedef union LDKCResult_QueryShortChannelIdsDecodeErrorZPtr {
11560 * A pointer to the contents in the success state.
11561 * Reading from this pointer when `result_ok` is not set is undefined.
11563 struct LDKQueryShortChannelIds *result;
11565 * A pointer to the contents in the error state.
11566 * Reading from this pointer when `result_ok` is set is undefined.
11568 struct LDKDecodeError *err;
11569 } LDKCResult_QueryShortChannelIdsDecodeErrorZPtr;
11572 * A CResult_QueryShortChannelIdsDecodeErrorZ represents the result of a fallible operation,
11573 * containing a crate::lightning::ln::msgs::QueryShortChannelIds on success and a crate::lightning::ln::msgs::DecodeError on failure.
11574 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
11576 typedef struct LDKCResult_QueryShortChannelIdsDecodeErrorZ {
11578 * The contents of this CResult_QueryShortChannelIdsDecodeErrorZ, accessible via either
11579 * `err` or `result` depending on the state of `result_ok`.
11581 union LDKCResult_QueryShortChannelIdsDecodeErrorZPtr contents;
11583 * Whether this CResult_QueryShortChannelIdsDecodeErrorZ represents a success state.
11586 } LDKCResult_QueryShortChannelIdsDecodeErrorZ;
11591 * A reply_short_channel_ids_end message is sent as a reply to a
11592 * query_short_channel_ids message. The query recipient makes a best
11593 * effort to respond based on their local network view which may not be
11594 * a perfect view of the network.
11596 typedef struct MUST_USE_STRUCT LDKReplyShortChannelIdsEnd {
11598 * A pointer to the opaque Rust object.
11599 * Nearly everywhere, inner must be non-null, however in places where
11600 * the Rust equivalent takes an Option, it may be set to null to indicate None.
11602 LDKnativeReplyShortChannelIdsEnd *inner;
11604 * Indicates that this is the only struct which contains the same pointer.
11605 * Rust functions which take ownership of an object provided via an argument require
11606 * this to be true and invalidate the object pointed to by inner.
11609 } LDKReplyShortChannelIdsEnd;
11612 * The contents of CResult_ReplyShortChannelIdsEndDecodeErrorZ
11614 typedef union LDKCResult_ReplyShortChannelIdsEndDecodeErrorZPtr {
11616 * A pointer to the contents in the success state.
11617 * Reading from this pointer when `result_ok` is not set is undefined.
11619 struct LDKReplyShortChannelIdsEnd *result;
11621 * A pointer to the contents in the error state.
11622 * Reading from this pointer when `result_ok` is set is undefined.
11624 struct LDKDecodeError *err;
11625 } LDKCResult_ReplyShortChannelIdsEndDecodeErrorZPtr;
11628 * A CResult_ReplyShortChannelIdsEndDecodeErrorZ represents the result of a fallible operation,
11629 * containing a crate::lightning::ln::msgs::ReplyShortChannelIdsEnd on success and a crate::lightning::ln::msgs::DecodeError on failure.
11630 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
11632 typedef struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ {
11634 * The contents of this CResult_ReplyShortChannelIdsEndDecodeErrorZ, accessible via either
11635 * `err` or `result` depending on the state of `result_ok`.
11637 union LDKCResult_ReplyShortChannelIdsEndDecodeErrorZPtr contents;
11639 * Whether this CResult_ReplyShortChannelIdsEndDecodeErrorZ represents a success state.
11642 } LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ;
11645 * The contents of CResult_QueryChannelRangeDecodeErrorZ
11647 typedef union LDKCResult_QueryChannelRangeDecodeErrorZPtr {
11649 * A pointer to the contents in the success state.
11650 * Reading from this pointer when `result_ok` is not set is undefined.
11652 struct LDKQueryChannelRange *result;
11654 * A pointer to the contents in the error state.
11655 * Reading from this pointer when `result_ok` is set is undefined.
11657 struct LDKDecodeError *err;
11658 } LDKCResult_QueryChannelRangeDecodeErrorZPtr;
11661 * A CResult_QueryChannelRangeDecodeErrorZ represents the result of a fallible operation,
11662 * containing a crate::lightning::ln::msgs::QueryChannelRange on success and a crate::lightning::ln::msgs::DecodeError on failure.
11663 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
11665 typedef struct LDKCResult_QueryChannelRangeDecodeErrorZ {
11667 * The contents of this CResult_QueryChannelRangeDecodeErrorZ, accessible via either
11668 * `err` or `result` depending on the state of `result_ok`.
11670 union LDKCResult_QueryChannelRangeDecodeErrorZPtr contents;
11672 * Whether this CResult_QueryChannelRangeDecodeErrorZ represents a success state.
11675 } LDKCResult_QueryChannelRangeDecodeErrorZ;
11678 * The contents of CResult_ReplyChannelRangeDecodeErrorZ
11680 typedef union LDKCResult_ReplyChannelRangeDecodeErrorZPtr {
11682 * A pointer to the contents in the success state.
11683 * Reading from this pointer when `result_ok` is not set is undefined.
11685 struct LDKReplyChannelRange *result;
11687 * A pointer to the contents in the error state.
11688 * Reading from this pointer when `result_ok` is set is undefined.
11690 struct LDKDecodeError *err;
11691 } LDKCResult_ReplyChannelRangeDecodeErrorZPtr;
11694 * A CResult_ReplyChannelRangeDecodeErrorZ represents the result of a fallible operation,
11695 * containing a crate::lightning::ln::msgs::ReplyChannelRange on success and a crate::lightning::ln::msgs::DecodeError on failure.
11696 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
11698 typedef struct LDKCResult_ReplyChannelRangeDecodeErrorZ {
11700 * The contents of this CResult_ReplyChannelRangeDecodeErrorZ, accessible via either
11701 * `err` or `result` depending on the state of `result_ok`.
11703 union LDKCResult_ReplyChannelRangeDecodeErrorZPtr contents;
11705 * Whether this CResult_ReplyChannelRangeDecodeErrorZ represents a success state.
11708 } LDKCResult_ReplyChannelRangeDecodeErrorZ;
11711 * The contents of CResult_GossipTimestampFilterDecodeErrorZ
11713 typedef union LDKCResult_GossipTimestampFilterDecodeErrorZPtr {
11715 * A pointer to the contents in the success state.
11716 * Reading from this pointer when `result_ok` is not set is undefined.
11718 struct LDKGossipTimestampFilter *result;
11720 * A pointer to the contents in the error state.
11721 * Reading from this pointer when `result_ok` is set is undefined.
11723 struct LDKDecodeError *err;
11724 } LDKCResult_GossipTimestampFilterDecodeErrorZPtr;
11727 * A CResult_GossipTimestampFilterDecodeErrorZ represents the result of a fallible operation,
11728 * containing a crate::lightning::ln::msgs::GossipTimestampFilter on success and a crate::lightning::ln::msgs::DecodeError on failure.
11729 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
11731 typedef struct LDKCResult_GossipTimestampFilterDecodeErrorZ {
11733 * The contents of this CResult_GossipTimestampFilterDecodeErrorZ, accessible via either
11734 * `err` or `result` depending on the state of `result_ok`.
11736 union LDKCResult_GossipTimestampFilterDecodeErrorZPtr contents;
11738 * Whether this CResult_GossipTimestampFilterDecodeErrorZ represents a success state.
11741 } LDKCResult_GossipTimestampFilterDecodeErrorZ;
11744 * A dynamically-allocated array of crate::lightning::ln::channelmanager::PhantomRouteHintss of arbitrary size.
11745 * This corresponds to std::vector in C++
11747 typedef struct LDKCVec_PhantomRouteHintsZ {
11749 * The elements in the array.
11750 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
11752 struct LDKPhantomRouteHints *data;
11754 * The number of elements pointed to by `data`.
11757 } LDKCVec_PhantomRouteHintsZ;
11760 * When signing using a fallible method either an user-supplied `SignError` or a `CreationError`
11763 typedef enum LDKSignOrCreationError_Tag {
11765 * An error occurred during signing
11767 LDKSignOrCreationError_SignError,
11769 * An error occurred while building the transaction
11771 LDKSignOrCreationError_CreationError,
11773 * Must be last for serialization purposes
11775 LDKSignOrCreationError_Sentinel,
11776 } LDKSignOrCreationError_Tag;
11778 typedef struct MUST_USE_STRUCT LDKSignOrCreationError {
11779 LDKSignOrCreationError_Tag tag;
11782 enum LDKCreationError creation_error;
11785 } LDKSignOrCreationError;
11788 * The contents of CResult_InvoiceSignOrCreationErrorZ
11790 typedef union LDKCResult_InvoiceSignOrCreationErrorZPtr {
11792 * A pointer to the contents in the success state.
11793 * Reading from this pointer when `result_ok` is not set is undefined.
11795 struct LDKInvoice *result;
11797 * A pointer to the contents in the error state.
11798 * Reading from this pointer when `result_ok` is set is undefined.
11800 struct LDKSignOrCreationError *err;
11801 } LDKCResult_InvoiceSignOrCreationErrorZPtr;
11804 * A CResult_InvoiceSignOrCreationErrorZ represents the result of a fallible operation,
11805 * containing a crate::lightning_invoice::Invoice on success and a crate::lightning_invoice::SignOrCreationError on failure.
11806 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
11808 typedef struct LDKCResult_InvoiceSignOrCreationErrorZ {
11810 * The contents of this CResult_InvoiceSignOrCreationErrorZ, accessible via either
11811 * `err` or `result` depending on the state of `result_ok`.
11813 union LDKCResult_InvoiceSignOrCreationErrorZPtr contents;
11815 * Whether this CResult_InvoiceSignOrCreationErrorZ represents a success state.
11818 } LDKCResult_InvoiceSignOrCreationErrorZ;
11823 * A transaction output watched by a [`ChannelMonitor`] for spends on-chain.
11825 * Used to convey to a [`Filter`] such an output with a given spending condition. Any transaction
11826 * spending the output must be given to [`ChannelMonitor::block_connected`] either directly or via
11827 * [`Confirm::transactions_confirmed`].
11829 * If `block_hash` is `Some`, this indicates the output was created in the corresponding block and
11830 * may have been spent there. See [`Filter::register_output`] for details.
11832 * [`ChannelMonitor`]: channelmonitor::ChannelMonitor
11833 * [`ChannelMonitor::block_connected`]: channelmonitor::ChannelMonitor::block_connected
11835 typedef struct MUST_USE_STRUCT LDKWatchedOutput {
11837 * A pointer to the opaque Rust object.
11838 * Nearly everywhere, inner must be non-null, however in places where
11839 * the Rust equivalent takes an Option, it may be set to null to indicate None.
11841 LDKnativeWatchedOutput *inner;
11843 * Indicates that this is the only struct which contains the same pointer.
11844 * Rust functions which take ownership of an object provided via an argument require
11845 * this to be true and invalidate the object pointed to by inner.
11848 } LDKWatchedOutput;
11851 * The `Filter` trait defines behavior for indicating chain activity of interest pertaining to
11854 * This is useful in order to have a [`Watch`] implementation convey to a chain source which
11855 * transactions to be notified of. Notification may take the form of pre-filtering blocks or, in
11856 * the case of [BIP 157]/[BIP 158], only fetching a block if the compact filter matches. If
11857 * receiving full blocks from a chain source, any further filtering is unnecessary.
11859 * After an output has been registered, subsequent block retrievals from the chain source must not
11860 * exclude any transactions matching the new criteria nor any in-block descendants of such
11863 * Note that use as part of a [`Watch`] implementation involves reentrancy. Therefore, the `Filter`
11864 * should not block on I/O. Implementations should instead queue the newly monitored data to be
11865 * processed later. Then, in order to block until the data has been processed, any [`Watch`]
11866 * invocation that has called the `Filter` must return [`InProgress`].
11868 * [`InProgress`]: ChannelMonitorUpdateStatus::InProgress
11869 * [BIP 157]: https://github.com/bitcoin/bips/blob/master/bip-0157.mediawiki
11870 * [BIP 158]: https://github.com/bitcoin/bips/blob/master/bip-0158.mediawiki
11872 typedef struct LDKFilter {
11874 * An opaque pointer which is passed to your function implementations as an argument.
11875 * This has no meaning in the LDK, and can be NULL or any other value.
11879 * Registers interest in a transaction with `txid` and having an output with `script_pubkey` as
11880 * a spending condition.
11882 void (*register_tx)(const void *this_arg, const uint8_t (*txid)[32], struct LDKu8slice script_pubkey);
11884 * Registers interest in spends of a transaction output.
11886 * Note that this method might be called during processing of a new block. You therefore need
11887 * to ensure that also dependent output spents within an already connected block are correctly
11888 * handled, e.g., by re-scanning the block in question whenever new outputs have been
11889 * registered mid-processing.
11891 void (*register_output)(const void *this_arg, struct LDKWatchedOutput output);
11893 * Frees any resources associated with this object given its this_arg pointer.
11894 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
11896 void (*free)(void *this_arg);
11900 * An enum which can either contain a crate::lightning::chain::Filter or not
11902 typedef enum LDKCOption_FilterZ_Tag {
11904 * When we're in this state, this COption_FilterZ contains a crate::lightning::chain::Filter
11906 LDKCOption_FilterZ_Some,
11908 * When we're in this state, this COption_FilterZ contains nothing
11910 LDKCOption_FilterZ_None,
11912 * Must be last for serialization purposes
11914 LDKCOption_FilterZ_Sentinel,
11915 } LDKCOption_FilterZ_Tag;
11917 typedef struct LDKCOption_FilterZ {
11918 LDKCOption_FilterZ_Tag tag;
11921 struct LDKFilter some;
11924 } LDKCOption_FilterZ;
11929 * A read-only reference to a current ChannelMonitor.
11931 * Note that this holds a mutex in [`ChainMonitor`] and may block other events until it is
11934 typedef struct MUST_USE_STRUCT LDKLockedChannelMonitor {
11936 * A pointer to the opaque Rust object.
11937 * Nearly everywhere, inner must be non-null, however in places where
11938 * the Rust equivalent takes an Option, it may be set to null to indicate None.
11940 LDKnativeLockedChannelMonitor *inner;
11942 * Indicates that this is the only struct which contains the same pointer.
11943 * Rust functions which take ownership of an object provided via an argument require
11944 * this to be true and invalidate the object pointed to by inner.
11947 } LDKLockedChannelMonitor;
11950 * The contents of CResult_LockedChannelMonitorNoneZ
11952 typedef union LDKCResult_LockedChannelMonitorNoneZPtr {
11954 * A pointer to the contents in the success state.
11955 * Reading from this pointer when `result_ok` is not set is undefined.
11957 struct LDKLockedChannelMonitor *result;
11959 * Note that this value is always NULL, as there are no contents in the Err variant
11962 } LDKCResult_LockedChannelMonitorNoneZPtr;
11965 * A CResult_LockedChannelMonitorNoneZ represents the result of a fallible operation,
11966 * containing a crate::lightning::chain::chainmonitor::LockedChannelMonitor on success and a () on failure.
11967 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
11969 typedef struct LDKCResult_LockedChannelMonitorNoneZ {
11971 * The contents of this CResult_LockedChannelMonitorNoneZ, accessible via either
11972 * `err` or `result` depending on the state of `result_ok`.
11974 union LDKCResult_LockedChannelMonitorNoneZPtr contents;
11976 * Whether this CResult_LockedChannelMonitorNoneZ represents a success state.
11979 } LDKCResult_LockedChannelMonitorNoneZ;
11982 * A dynamically-allocated array of crate::lightning::chain::transaction::OutPoints of arbitrary size.
11983 * This corresponds to std::vector in C++
11985 typedef struct LDKCVec_OutPointZ {
11987 * The elements in the array.
11988 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
11990 struct LDKOutPoint *data;
11992 * The number of elements pointed to by `data`.
11995 } LDKCVec_OutPointZ;
11998 * A trait indicating an object may generate message send events
12000 typedef struct LDKMessageSendEventsProvider {
12002 * An opaque pointer which is passed to your function implementations as an argument.
12003 * This has no meaning in the LDK, and can be NULL or any other value.
12007 * Gets the list of pending events which were generated by previous actions, clearing the list
12010 struct LDKCVec_MessageSendEventZ (*get_and_clear_pending_msg_events)(const void *this_arg);
12012 * Frees any resources associated with this object given its this_arg pointer.
12013 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
12015 void (*free)(void *this_arg);
12016 } LDKMessageSendEventsProvider;
12019 * A trait indicating an object may generate onion messages to send
12021 typedef struct LDKOnionMessageProvider {
12023 * An opaque pointer which is passed to your function implementations as an argument.
12024 * This has no meaning in the LDK, and can be NULL or any other value.
12028 * Gets the next pending onion message for the peer with the given node id.
12030 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
12032 struct LDKOnionMessage (*next_onion_message_for_peer)(const void *this_arg, struct LDKPublicKey peer_node_id);
12034 * Frees any resources associated with this object given its this_arg pointer.
12035 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
12037 void (*free)(void *this_arg);
12038 } LDKOnionMessageProvider;
12041 * A trait implemented for objects handling events from [`EventsProvider`].
12043 typedef struct LDKEventHandler {
12045 * An opaque pointer which is passed to your function implementations as an argument.
12046 * This has no meaning in the LDK, and can be NULL or any other value.
12050 * Handles the given [`Event`].
12052 * See [`EventsProvider`] for details that must be considered when implementing this method.
12054 void (*handle_event)(const void *this_arg, const struct LDKEvent *NONNULL_PTR event);
12056 * Frees any resources associated with this object given its this_arg pointer.
12057 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
12059 void (*free)(void *this_arg);
12063 * A trait indicating an object may generate events.
12065 * Events are processed by passing an [`EventHandler`] to [`process_pending_events`].
12069 * When using this trait, [`process_pending_events`] will call [`handle_event`] for each pending
12070 * event since the last invocation.
12072 * In order to ensure no [`Event`]s are lost, implementors of this trait will persist [`Event`]s
12073 * and replay any unhandled events on startup. An [`Event`] is considered handled when
12074 * [`process_pending_events`] returns, thus handlers MUST fully handle [`Event`]s and persist any
12075 * relevant changes to disk *before* returning.
12077 * Further, because an application may crash between an [`Event`] being handled and the
12078 * implementor of this trait being re-serialized, [`Event`] handling must be idempotent - in
12079 * effect, [`Event`]s may be replayed.
12081 * Note, handlers may call back into the provider and thus deadlocking must be avoided. Be sure to
12082 * consult the provider's documentation on the implication of processing events and how a handler
12083 * may safely use the provider (e.g., see [`ChannelManager::process_pending_events`] and
12084 * [`ChainMonitor::process_pending_events`]).
12086 * (C-not implementable) As there is likely no reason for a user to implement this trait on their
12089 * [`process_pending_events`]: Self::process_pending_events
12090 * [`handle_event`]: EventHandler::handle_event
12091 * [`ChannelManager::process_pending_events`]: crate::ln::channelmanager::ChannelManager#method.process_pending_events
12092 * [`ChainMonitor::process_pending_events`]: crate::chain::chainmonitor::ChainMonitor#method.process_pending_events
12094 typedef struct LDKEventsProvider {
12096 * An opaque pointer which is passed to your function implementations as an argument.
12097 * This has no meaning in the LDK, and can be NULL or any other value.
12101 * Processes any events generated since the last call using the given event handler.
12103 * See the trait-level documentation for requirements.
12105 void (*process_pending_events)(const void *this_arg, struct LDKEventHandler handler);
12107 * Frees any resources associated with this object given its this_arg pointer.
12108 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
12110 void (*free)(void *this_arg);
12111 } LDKEventsProvider;
12116 * Lightning TLV uses a custom variable-length integer called BigSize. It is similar to Bitcoin's
12117 * variable-length integers except that it is serialized in big-endian instead of little-endian.
12119 * Like Bitcoin's variable-length integer, it exhibits ambiguity in that certain values can be
12120 * encoded in several different ways, which we must check for at deserialization-time. Thus, if
12121 * you're looking for an example of a variable-length integer to use for your own project, move
12122 * along, this is a rather poor design.
12124 typedef struct MUST_USE_STRUCT LDKBigSize {
12126 * A pointer to the opaque Rust object.
12127 * Nearly everywhere, inner must be non-null, however in places where
12128 * the Rust equivalent takes an Option, it may be set to null to indicate None.
12130 LDKnativeBigSize *inner;
12132 * Indicates that this is the only struct which contains the same pointer.
12133 * Rust functions which take ownership of an object provided via an argument require
12134 * this to be true and invalidate the object pointed to by inner.
12140 * Trait that handles persisting a [`ChannelManager`], [`NetworkGraph`], and [`WriteableScore`] to disk.
12142 typedef struct LDKPersister {
12144 * An opaque pointer which is passed to your function implementations as an argument.
12145 * This has no meaning in the LDK, and can be NULL or any other value.
12149 * Persist the given ['ChannelManager'] to disk, returning an error if persistence failed.
12151 struct LDKCResult_NoneErrorZ (*persist_manager)(const void *this_arg, const struct LDKChannelManager *NONNULL_PTR channel_manager);
12153 * Persist the given [`NetworkGraph`] to disk, returning an error if persistence failed.
12155 struct LDKCResult_NoneErrorZ (*persist_graph)(const void *this_arg, const struct LDKNetworkGraph *NONNULL_PTR network_graph);
12157 * Persist the given [`WriteableScore`] to disk, returning an error if persistence failed.
12159 struct LDKCResult_NoneErrorZ (*persist_scorer)(const void *this_arg, const struct LDKWriteableScore *NONNULL_PTR scorer);
12161 * Frees any resources associated with this object given its this_arg pointer.
12162 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
12164 void (*free)(void *this_arg);
12168 * A callback which is called when a [`Future`] completes.
12170 * Note that this MUST NOT call back into LDK directly, it must instead schedule actions to be
12171 * taken later. Rust users should use the [`std::future::Future`] implementation for [`Future`]
12174 * Note that the [`std::future::Future`] implementation may only work for runtimes which schedule
12175 * futures when they receive a wake, rather than immediately executing them.
12177 typedef struct LDKFutureCallback {
12179 * An opaque pointer which is passed to your function implementations as an argument.
12180 * This has no meaning in the LDK, and can be NULL or any other value.
12184 * The method which is called.
12186 void (*call)(const void *this_arg);
12188 * Frees any resources associated with this object given its this_arg pointer.
12189 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
12191 void (*free)(void *this_arg);
12192 } LDKFutureCallback;
12197 * A simple future which can complete once, and calls some callback(s) when it does so.
12199 typedef struct MUST_USE_STRUCT LDKFuture {
12201 * A pointer to the opaque Rust object.
12202 * Nearly everywhere, inner must be non-null, however in places where
12203 * the Rust equivalent takes an Option, it may be set to null to indicate None.
12205 LDKnativeFuture *inner;
12207 * Indicates that this is the only struct which contains the same pointer.
12208 * Rust functions which take ownership of an object provided via an argument require
12209 * this to be true and invalidate the object pointed to by inner.
12217 * Configuration we set when applicable.
12219 * Default::default() provides sane defaults.
12221 typedef struct MUST_USE_STRUCT LDKChannelHandshakeConfig {
12223 * A pointer to the opaque Rust object.
12224 * Nearly everywhere, inner must be non-null, however in places where
12225 * the Rust equivalent takes an Option, it may be set to null to indicate None.
12227 LDKnativeChannelHandshakeConfig *inner;
12229 * Indicates that this is the only struct which contains the same pointer.
12230 * Rust functions which take ownership of an object provided via an argument require
12231 * this to be true and invalidate the object pointed to by inner.
12234 } LDKChannelHandshakeConfig;
12239 * Optional channel limits which are applied during channel creation.
12241 * These limits are only applied to our counterparty's limits, not our own.
12243 * Use 0/<type>::max_value() as appropriate to skip checking.
12245 * Provides sane defaults for most configurations.
12247 * Most additional limits are disabled except those with which specify a default in individual
12248 * field documentation. Note that this may result in barely-usable channels, but since they
12249 * are applied mostly only to incoming channels that's not much of a problem.
12251 typedef struct MUST_USE_STRUCT LDKChannelHandshakeLimits {
12253 * A pointer to the opaque Rust object.
12254 * Nearly everywhere, inner must be non-null, however in places where
12255 * the Rust equivalent takes an Option, it may be set to null to indicate None.
12257 LDKnativeChannelHandshakeLimits *inner;
12259 * Indicates that this is the only struct which contains the same pointer.
12260 * Rust functions which take ownership of an object provided via an argument require
12261 * this to be true and invalidate the object pointed to by inner.
12264 } LDKChannelHandshakeLimits;
12269 * Top-level config which holds ChannelHandshakeLimits and ChannelConfig.
12271 * Default::default() provides sane defaults for most configurations
12272 * (but currently with 0 relay fees!)
12274 typedef struct MUST_USE_STRUCT LDKUserConfig {
12276 * A pointer to the opaque Rust object.
12277 * Nearly everywhere, inner must be non-null, however in places where
12278 * the Rust equivalent takes an Option, it may be set to null to indicate None.
12280 LDKnativeUserConfig *inner;
12282 * Indicates that this is the only struct which contains the same pointer.
12283 * Rust functions which take ownership of an object provided via an argument require
12284 * this to be true and invalidate the object pointed to by inner.
12292 * The best known block as identified by its hash and height.
12294 typedef struct MUST_USE_STRUCT LDKBestBlock {
12296 * A pointer to the opaque Rust object.
12297 * Nearly everywhere, inner must be non-null, however in places where
12298 * the Rust equivalent takes an Option, it may be set to null to indicate None.
12300 LDKnativeBestBlock *inner;
12302 * Indicates that this is the only struct which contains the same pointer.
12303 * Rust functions which take ownership of an object provided via an argument require
12304 * this to be true and invalidate the object pointed to by inner.
12310 * The `Listen` trait is used to notify when blocks have been connected or disconnected from the
12313 * Useful when needing to replay chain data upon startup or as new chain events occur. Clients
12314 * sourcing chain data using a block-oriented API should prefer this interface over [`Confirm`].
12315 * Such clients fetch the entire header chain whereas clients using [`Confirm`] only fetch headers
12318 * By using [`Listen::filtered_block_connected`] this interface supports clients fetching the
12319 * entire header chain and only blocks with matching transaction data using BIP 157 filters or
12320 * other similar filtering.
12322 typedef struct LDKListen {
12324 * An opaque pointer which is passed to your function implementations as an argument.
12325 * This has no meaning in the LDK, and can be NULL or any other value.
12329 * Notifies the listener that a block was added at the given height, with the transaction data
12330 * possibly filtered.
12332 void (*filtered_block_connected)(const void *this_arg, const uint8_t (*header)[80], struct LDKCVec_C2Tuple_usizeTransactionZZ txdata, uint32_t height);
12334 * Notifies the listener that a block was added at the given height.
12336 void (*block_connected)(const void *this_arg, struct LDKu8slice block, uint32_t height);
12338 * Notifies the listener that a block was removed at the given height.
12340 void (*block_disconnected)(const void *this_arg, const uint8_t (*header)[80], uint32_t height);
12342 * Frees any resources associated with this object given its this_arg pointer.
12343 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
12345 void (*free)(void *this_arg);
12349 * The `Confirm` trait is used to notify when transactions have been confirmed on chain or
12350 * unconfirmed during a chain reorganization.
12352 * Clients sourcing chain data using a transaction-oriented API should prefer this interface over
12353 * [`Listen`]. For instance, an Electrum client may implement [`Filter`] by subscribing to activity
12354 * related to registered transactions and outputs. Upon notification, it would pass along the
12355 * matching transactions using this interface.
12359 * The intended use is as follows:
12360 * - Call [`transactions_confirmed`] to process any on-chain activity of interest.
12361 * - Call [`transaction_unconfirmed`] to process any transaction returned by [`get_relevant_txids`]
12362 * that has been reorganized out of the chain.
12363 * - Call [`best_block_updated`] whenever a new chain tip becomes available.
12367 * Clients must call these methods in chain order. Specifically:
12368 * - Transactions confirmed in a block must be given before transactions confirmed in a later
12370 * - Dependent transactions within the same block must be given in topological order, possibly in
12372 * - Unconfirmed transactions must be given after the original confirmations and before any
12375 * See individual method documentation for further details.
12377 * [`transactions_confirmed`]: Self::transactions_confirmed
12378 * [`transaction_unconfirmed`]: Self::transaction_unconfirmed
12379 * [`best_block_updated`]: Self::best_block_updated
12380 * [`get_relevant_txids`]: Self::get_relevant_txids
12382 typedef struct LDKConfirm {
12384 * An opaque pointer which is passed to your function implementations as an argument.
12385 * This has no meaning in the LDK, and can be NULL or any other value.
12389 * Processes transactions confirmed in a block with a given header and height.
12391 * Should be called for any transactions registered by [`Filter::register_tx`] or any
12392 * transactions spending an output registered by [`Filter::register_output`]. Such transactions
12393 * appearing in the same block do not need to be included in the same call; instead, multiple
12394 * calls with additional transactions may be made so long as they are made in [chain order].
12396 * May be called before or after [`best_block_updated`] for the corresponding block. However,
12397 * in the event of a chain reorganization, it must not be called with a `header` that is no
12398 * longer in the chain as of the last call to [`best_block_updated`].
12400 * [chain order]: Confirm#order
12401 * [`best_block_updated`]: Self::best_block_updated
12403 void (*transactions_confirmed)(const void *this_arg, const uint8_t (*header)[80], struct LDKCVec_C2Tuple_usizeTransactionZZ txdata, uint32_t height);
12405 * Processes a transaction that is no longer confirmed as result of a chain reorganization.
12407 * Should be called for any transaction returned by [`get_relevant_txids`] if it has been
12408 * reorganized out of the best chain. Once called, the given transaction will not be returned
12409 * by [`get_relevant_txids`], unless it has been reconfirmed via [`transactions_confirmed`].
12411 * [`get_relevant_txids`]: Self::get_relevant_txids
12412 * [`transactions_confirmed`]: Self::transactions_confirmed
12414 void (*transaction_unconfirmed)(const void *this_arg, const uint8_t (*txid)[32]);
12416 * Processes an update to the best header connected at the given height.
12418 * Should be called when a new header is available but may be skipped for intermediary blocks
12419 * if they become available at the same time.
12421 void (*best_block_updated)(const void *this_arg, const uint8_t (*header)[80], uint32_t height);
12423 * Returns transactions that should be monitored for reorganization out of the chain.
12425 * Will include any transactions passed to [`transactions_confirmed`] that have insufficient
12426 * confirmations to be safe from a chain reorganization. Will not include any transactions
12427 * passed to [`transaction_unconfirmed`], unless later reconfirmed.
12429 * May be called to determine the subset of transactions that must still be monitored for
12430 * reorganization. Will be idempotent between calls but may change as a result of calls to the
12431 * other interface methods. Thus, this is useful to determine which transactions may need to be
12432 * given to [`transaction_unconfirmed`].
12434 * [`transactions_confirmed`]: Self::transactions_confirmed
12435 * [`transaction_unconfirmed`]: Self::transaction_unconfirmed
12437 struct LDKCVec_TxidZ (*get_relevant_txids)(const void *this_arg);
12439 * Frees any resources associated with this object given its this_arg pointer.
12440 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
12442 void (*free)(void *this_arg);
12448 * An opaque identifier describing a specific [`Persist`] method call.
12450 typedef struct MUST_USE_STRUCT LDKMonitorUpdateId {
12452 * A pointer to the opaque Rust object.
12453 * Nearly everywhere, inner must be non-null, however in places where
12454 * the Rust equivalent takes an Option, it may be set to null to indicate None.
12456 LDKnativeMonitorUpdateId *inner;
12458 * Indicates that this is the only struct which contains the same pointer.
12459 * Rust functions which take ownership of an object provided via an argument require
12460 * this to be true and invalidate the object pointed to by inner.
12463 } LDKMonitorUpdateId;
12466 * `Persist` defines behavior for persisting channel monitors: this could mean
12467 * writing once to disk, and/or uploading to one or more backup services.
12469 * Each method can return three possible values:
12470 * * If persistence (including any relevant `fsync()` calls) happens immediately, the
12471 * implementation should return [`ChannelMonitorUpdateStatus::Completed`], indicating normal
12472 * channel operation should continue.
12473 * * If persistence happens asynchronously, implementations should first ensure the
12474 * [`ChannelMonitor`] or [`ChannelMonitorUpdate`] are written durably to disk, and then return
12475 * [`ChannelMonitorUpdateStatus::InProgress`] while the update continues in the background.
12476 * Once the update completes, [`ChainMonitor::channel_monitor_updated`] should be called with
12477 * the corresponding [`MonitorUpdateId`].
12479 * Note that unlike the direct [`chain::Watch`] interface,
12480 * [`ChainMonitor::channel_monitor_updated`] must be called once for *each* update which occurs.
12482 * * If persistence fails for some reason, implementations should return
12483 * [`ChannelMonitorUpdateStatus::PermanentFailure`], in which case the channel will likely be
12484 * closed without broadcasting the latest state. See
12485 * [`ChannelMonitorUpdateStatus::PermanentFailure`] for more details.
12487 typedef struct LDKPersist {
12489 * An opaque pointer which is passed to your function implementations as an argument.
12490 * This has no meaning in the LDK, and can be NULL or any other value.
12494 * Persist a new channel's data in response to a [`chain::Watch::watch_channel`] call. This is
12495 * called by [`ChannelManager`] for new channels, or may be called directly, e.g. on startup.
12497 * The data can be stored any way you want, but the identifier provided by LDK is the
12498 * channel's outpoint (and it is up to you to maintain a correct mapping between the outpoint
12499 * and the stored channel data). Note that you **must** persist every new monitor to disk.
12501 * The `update_id` is used to identify this call to [`ChainMonitor::channel_monitor_updated`],
12502 * if you return [`ChannelMonitorUpdateStatus::InProgress`].
12504 * See [`Writeable::write`] on [`ChannelMonitor`] for writing out a `ChannelMonitor`
12505 * and [`ChannelMonitorUpdateStatus`] for requirements when returning errors.
12507 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
12508 * [`Writeable::write`]: crate::util::ser::Writeable::write
12510 enum LDKChannelMonitorUpdateStatus (*persist_new_channel)(const void *this_arg, struct LDKOutPoint channel_id, const struct LDKChannelMonitor *NONNULL_PTR data, struct LDKMonitorUpdateId update_id);
12512 * Update one channel's data. The provided [`ChannelMonitor`] has already applied the given
12515 * Note that on every update, you **must** persist either the [`ChannelMonitorUpdate`] or the
12516 * updated monitor itself to disk/backups. See the [`Persist`] trait documentation for more
12519 * During blockchain synchronization operations, this may be called with no
12520 * [`ChannelMonitorUpdate`], in which case the full [`ChannelMonitor`] needs to be persisted.
12521 * Note that after the full [`ChannelMonitor`] is persisted any previous
12522 * [`ChannelMonitorUpdate`]s which were persisted should be discarded - they can no longer be
12523 * applied to the persisted [`ChannelMonitor`] as they were already applied.
12525 * If an implementer chooses to persist the updates only, they need to make
12526 * sure that all the updates are applied to the `ChannelMonitors` *before*
12527 * the set of channel monitors is given to the `ChannelManager`
12528 * deserialization routine. See [`ChannelMonitor::update_monitor`] for
12529 * applying a monitor update to a monitor. If full `ChannelMonitors` are
12530 * persisted, then there is no need to persist individual updates.
12532 * Note that there could be a performance tradeoff between persisting complete
12533 * channel monitors on every update vs. persisting only updates and applying
12534 * them in batches. The size of each monitor grows `O(number of state updates)`
12535 * whereas updates are small and `O(1)`.
12537 * The `update_id` is used to identify this call to [`ChainMonitor::channel_monitor_updated`],
12538 * if you return [`ChannelMonitorUpdateStatus::InProgress`].
12540 * See [`Writeable::write`] on [`ChannelMonitor`] for writing out a `ChannelMonitor`,
12541 * [`Writeable::write`] on [`ChannelMonitorUpdate`] for writing out an update, and
12542 * [`ChannelMonitorUpdateStatus`] for requirements when returning errors.
12544 * [`Writeable::write`]: crate::util::ser::Writeable::write
12546 * Note that update (or a relevant inner pointer) may be NULL or all-0s to represent None
12548 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);
12550 * Frees any resources associated with this object given its this_arg pointer.
12551 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
12553 void (*free)(void *this_arg);
12559 * An implementation of [`chain::Watch`] for monitoring channels.
12561 * Connected and disconnected blocks must be provided to `ChainMonitor` as documented by
12562 * [`chain::Watch`]. May be used in conjunction with [`ChannelManager`] to monitor channels locally
12563 * or used independently to monitor channels remotely. See the [module-level documentation] for
12566 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
12567 * [module-level documentation]: crate::chain::chainmonitor
12569 typedef struct MUST_USE_STRUCT LDKChainMonitor {
12571 * A pointer to the opaque Rust object.
12572 * Nearly everywhere, inner must be non-null, however in places where
12573 * the Rust equivalent takes an Option, it may be set to null to indicate None.
12575 LDKnativeChainMonitor *inner;
12577 * Indicates that this is the only struct which contains the same pointer.
12578 * Rust functions which take ownership of an object provided via an argument require
12579 * this to be true and invalidate the object pointed to by inner.
12587 * Simple KeysInterface implementor that takes a 32-byte seed for use as a BIP 32 extended key
12588 * and derives keys from that.
12590 * Your node_id is seed/0'
12591 * ChannelMonitor closes may use seed/1'
12592 * Cooperative closes may use seed/2'
12593 * The two close keys may be needed to claim on-chain funds!
12595 * This struct cannot be used for nodes that wish to support receiving phantom payments;
12596 * [`PhantomKeysManager`] must be used instead.
12598 * Note that switching between this struct and [`PhantomKeysManager`] will invalidate any
12599 * previously issued invoices and attempts to pay previous invoices will fail.
12601 typedef struct MUST_USE_STRUCT LDKKeysManager {
12603 * A pointer to the opaque Rust object.
12604 * Nearly everywhere, inner must be non-null, however in places where
12605 * the Rust equivalent takes an Option, it may be set to null to indicate None.
12607 LDKnativeKeysManager *inner;
12609 * Indicates that this is the only struct which contains the same pointer.
12610 * Rust functions which take ownership of an object provided via an argument require
12611 * this to be true and invalidate the object pointed to by inner.
12619 * Similar to [`KeysManager`], but allows the node using this struct to receive phantom node
12622 * A phantom node payment is a payment made to a phantom invoice, which is an invoice that can be
12623 * paid to one of multiple nodes. This works because we encode the invoice route hints such that
12624 * LDK will recognize an incoming payment as destined for a phantom node, and collect the payment
12625 * itself without ever needing to forward to this fake node.
12627 * Phantom node payments are useful for load balancing between multiple LDK nodes. They also
12628 * provide some fault tolerance, because payers will automatically retry paying other provided
12629 * nodes in the case that one node goes down.
12631 * Note that multi-path payments are not supported in phantom invoices for security reasons.
12632 * Switching between this struct and [`KeysManager`] will invalidate any previously issued
12633 * invoices and attempts to pay previous invoices will fail.
12635 typedef struct MUST_USE_STRUCT LDKPhantomKeysManager {
12637 * A pointer to the opaque Rust object.
12638 * Nearly everywhere, inner must be non-null, however in places where
12639 * the Rust equivalent takes an Option, it may be set to null to indicate None.
12641 LDKnativePhantomKeysManager *inner;
12643 * Indicates that this is the only struct which contains the same pointer.
12644 * Rust functions which take ownership of an object provided via an argument require
12645 * this to be true and invalidate the object pointed to by inner.
12648 } LDKPhantomKeysManager;
12653 * Chain-related parameters used to construct a new `ChannelManager`.
12655 * Typically, the block-specific parameters are derived from the best block hash for the network,
12656 * as a newly constructed `ChannelManager` will not have created any channels yet. These parameters
12657 * are not needed when deserializing a previously constructed `ChannelManager`.
12659 typedef struct MUST_USE_STRUCT LDKChainParameters {
12661 * A pointer to the opaque Rust object.
12662 * Nearly everywhere, inner must be non-null, however in places where
12663 * the Rust equivalent takes an Option, it may be set to null to indicate None.
12665 LDKnativeChainParameters *inner;
12667 * Indicates that this is the only struct which contains the same pointer.
12668 * Rust functions which take ownership of an object provided via an argument require
12669 * this to be true and invalidate the object pointed to by inner.
12672 } LDKChainParameters;
12675 * A trait to describe an object which can receive channel messages.
12677 * Messages MAY be called in parallel when they originate from different their_node_ids, however
12678 * they MUST NOT be called in parallel when the two calls have the same their_node_id.
12680 typedef struct LDKChannelMessageHandler {
12682 * An opaque pointer which is passed to your function implementations as an argument.
12683 * This has no meaning in the LDK, and can be NULL or any other value.
12687 * Handle an incoming open_channel message from the given peer.
12689 void (*handle_open_channel)(const void *this_arg, struct LDKPublicKey their_node_id, struct LDKInitFeatures their_features, const struct LDKOpenChannel *NONNULL_PTR msg);
12691 * Handle an incoming accept_channel message from the given peer.
12693 void (*handle_accept_channel)(const void *this_arg, struct LDKPublicKey their_node_id, struct LDKInitFeatures their_features, const struct LDKAcceptChannel *NONNULL_PTR msg);
12695 * Handle an incoming funding_created message from the given peer.
12697 void (*handle_funding_created)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKFundingCreated *NONNULL_PTR msg);
12699 * Handle an incoming funding_signed message from the given peer.
12701 void (*handle_funding_signed)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKFundingSigned *NONNULL_PTR msg);
12703 * Handle an incoming channel_ready message from the given peer.
12705 void (*handle_channel_ready)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKChannelReady *NONNULL_PTR msg);
12707 * Handle an incoming shutdown message from the given peer.
12709 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);
12711 * Handle an incoming closing_signed message from the given peer.
12713 void (*handle_closing_signed)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKClosingSigned *NONNULL_PTR msg);
12715 * Handle an incoming update_add_htlc message from the given peer.
12717 void (*handle_update_add_htlc)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKUpdateAddHTLC *NONNULL_PTR msg);
12719 * Handle an incoming update_fulfill_htlc message from the given peer.
12721 void (*handle_update_fulfill_htlc)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKUpdateFulfillHTLC *NONNULL_PTR msg);
12723 * Handle an incoming update_fail_htlc message from the given peer.
12725 void (*handle_update_fail_htlc)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKUpdateFailHTLC *NONNULL_PTR msg);
12727 * Handle an incoming update_fail_malformed_htlc message from the given peer.
12729 void (*handle_update_fail_malformed_htlc)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR msg);
12731 * Handle an incoming commitment_signed message from the given peer.
12733 void (*handle_commitment_signed)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKCommitmentSigned *NONNULL_PTR msg);
12735 * Handle an incoming revoke_and_ack message from the given peer.
12737 void (*handle_revoke_and_ack)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKRevokeAndACK *NONNULL_PTR msg);
12739 * Handle an incoming update_fee message from the given peer.
12741 void (*handle_update_fee)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKUpdateFee *NONNULL_PTR msg);
12743 * Handle an incoming announcement_signatures message from the given peer.
12745 void (*handle_announcement_signatures)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKAnnouncementSignatures *NONNULL_PTR msg);
12747 * Indicates a connection to the peer failed/an existing connection was lost. If no connection
12748 * is believed to be possible in the future (eg they're sending us messages we don't
12749 * understand or indicate they require unknown feature bits), no_connection_possible is set
12750 * and any outstanding channels should be failed.
12752 * Note that in some rare cases this may be called without a corresponding
12753 * [`Self::peer_connected`].
12755 void (*peer_disconnected)(const void *this_arg, struct LDKPublicKey their_node_id, bool no_connection_possible);
12757 * Handle a peer reconnecting, possibly generating channel_reestablish message(s).
12759 * May return an `Err(())` if the features the peer supports are not sufficient to communicate
12760 * with us. Implementors should be somewhat conservative about doing so, however, as other
12761 * message handlers may still wish to communicate with this peer.
12763 struct LDKCResult_NoneNoneZ (*peer_connected)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKInit *NONNULL_PTR msg);
12765 * Handle an incoming channel_reestablish message from the given peer.
12767 void (*handle_channel_reestablish)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKChannelReestablish *NONNULL_PTR msg);
12769 * Handle an incoming channel update from the given peer.
12771 void (*handle_channel_update)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKChannelUpdate *NONNULL_PTR msg);
12773 * Handle an incoming error message from the given peer.
12775 void (*handle_error)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKErrorMessage *NONNULL_PTR msg);
12777 * Gets the node feature flags which this handler itself supports. All available handlers are
12778 * queried similarly and their feature flags are OR'd together to form the [`NodeFeatures`]
12779 * which are broadcasted in our [`NodeAnnouncement`] message.
12781 struct LDKNodeFeatures (*provided_node_features)(const void *this_arg);
12783 * Gets the init feature flags which should be sent to the given peer. All available handlers
12784 * are queried similarly and their feature flags are OR'd together to form the [`InitFeatures`]
12785 * which are sent in our [`Init`] message.
12787 * Note that this method is called before [`Self::peer_connected`].
12789 struct LDKInitFeatures (*provided_init_features)(const void *this_arg, struct LDKPublicKey their_node_id);
12791 * Implementation of MessageSendEventsProvider for this object.
12793 struct LDKMessageSendEventsProvider MessageSendEventsProvider;
12795 * Frees any resources associated with this object given its this_arg pointer.
12796 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
12798 void (*free)(void *this_arg);
12799 } LDKChannelMessageHandler;
12804 * Arguments for the creation of a ChannelManager that are not deserialized.
12806 * At a high-level, the process for deserializing a ChannelManager and resuming normal operation
12808 * 1) Deserialize all stored [`ChannelMonitor`]s.
12809 * 2) Deserialize the [`ChannelManager`] by filling in this struct and calling:
12810 * `<(BlockHash, ChannelManager)>::read(reader, args)`
12811 * This may result in closing some channels if the [`ChannelMonitor`] is newer than the stored
12812 * [`ChannelManager`] state to ensure no loss of funds. Thus, transactions may be broadcasted.
12813 * 3) If you are not fetching full blocks, register all relevant [`ChannelMonitor`] outpoints the
12814 * same way you would handle a [`chain::Filter`] call using
12815 * [`ChannelMonitor::get_outputs_to_watch`] and [`ChannelMonitor::get_funding_txo`].
12816 * 4) Reconnect blocks on your [`ChannelMonitor`]s.
12817 * 5) Disconnect/connect blocks on the [`ChannelManager`].
12818 * 6) Re-persist the [`ChannelMonitor`]s to ensure the latest state is on disk.
12819 * Note that if you're using a [`ChainMonitor`] for your [`chain::Watch`] implementation, you
12820 * will likely accomplish this as a side-effect of calling [`chain::Watch::watch_channel`] in
12822 * 7) Move the [`ChannelMonitor`]s into your local [`chain::Watch`]. If you're using a
12823 * [`ChainMonitor`], this is done by calling [`chain::Watch::watch_channel`].
12825 * Note that the ordering of #4-7 is not of importance, however all four must occur before you
12826 * call any other methods on the newly-deserialized [`ChannelManager`].
12828 * Note that because some channels may be closed during deserialization, it is critical that you
12829 * always deserialize only the latest version of a ChannelManager and ChannelMonitors available to
12830 * you. If you deserialize an old ChannelManager (during which force-closure transactions may be
12831 * broadcast), and then later deserialize a newer version of the same ChannelManager (which will
12832 * not force-close the same channels but consider them live), you may end up revoking a state for
12833 * which you've already broadcasted the transaction.
12835 * [`ChainMonitor`]: crate::chain::chainmonitor::ChainMonitor
12837 typedef struct MUST_USE_STRUCT LDKChannelManagerReadArgs {
12839 * A pointer to the opaque Rust object.
12840 * Nearly everywhere, inner must be non-null, however in places where
12841 * the Rust equivalent takes an Option, it may be set to null to indicate None.
12843 LDKnativeChannelManagerReadArgs *inner;
12845 * Indicates that this is the only struct which contains the same pointer.
12846 * Rust functions which take ownership of an object provided via an argument require
12847 * this to be true and invalidate the object pointed to by inner.
12850 } LDKChannelManagerReadArgs;
12855 * A set of keys that were HKDF-expanded from an initial call to
12856 * [`KeysInterface::get_inbound_payment_key_material`].
12858 * [`KeysInterface::get_inbound_payment_key_material`]: crate::chain::keysinterface::KeysInterface::get_inbound_payment_key_material
12860 typedef struct MUST_USE_STRUCT LDKExpandedKey {
12862 * A pointer to the opaque Rust object.
12863 * Nearly everywhere, inner must be non-null, however in places where
12864 * the Rust equivalent takes an Option, it may be set to null to indicate None.
12866 LDKnativeExpandedKey *inner;
12868 * Indicates that this is the only struct which contains the same pointer.
12869 * Rust functions which take ownership of an object provided via an argument require
12870 * this to be true and invalidate the object pointed to by inner.
12878 * Proof that the sender knows the per-commitment secret of the previous commitment transaction.
12879 * This is used to convince the recipient that the channel is at a certain commitment
12880 * number even if they lost that data due to a local failure. Of course, the peer may lie
12881 * and even later commitments may have been revoked.
12883 typedef struct MUST_USE_STRUCT LDKDataLossProtect {
12885 * A pointer to the opaque Rust object.
12886 * Nearly everywhere, inner must be non-null, however in places where
12887 * the Rust equivalent takes an Option, it may be set to null to indicate None.
12889 LDKnativeDataLossProtect *inner;
12891 * Indicates that this is the only struct which contains the same pointer.
12892 * Rust functions which take ownership of an object provided via an argument require
12893 * this to be true and invalidate the object pointed to by inner.
12896 } LDKDataLossProtect;
12899 * A 3-byte byte array.
12901 typedef struct LDKThreeBytes {
12909 * A trait to describe an object which can receive routing messages.
12911 * # Implementor DoS Warnings
12913 * For `gossip_queries` messages there are potential DoS vectors when handling
12914 * inbound queries. Implementors using an on-disk network graph should be aware of
12915 * repeated disk I/O for queries accessing different parts of the network graph.
12917 typedef struct LDKRoutingMessageHandler {
12919 * An opaque pointer which is passed to your function implementations as an argument.
12920 * This has no meaning in the LDK, and can be NULL or any other value.
12924 * Handle an incoming node_announcement message, returning true if it should be forwarded on,
12925 * false or returning an Err otherwise.
12927 struct LDKCResult_boolLightningErrorZ (*handle_node_announcement)(const void *this_arg, const struct LDKNodeAnnouncement *NONNULL_PTR msg);
12929 * Handle a channel_announcement message, returning true if it should be forwarded on, false
12930 * or returning an Err otherwise.
12932 struct LDKCResult_boolLightningErrorZ (*handle_channel_announcement)(const void *this_arg, const struct LDKChannelAnnouncement *NONNULL_PTR msg);
12934 * Handle an incoming channel_update message, returning true if it should be forwarded on,
12935 * false or returning an Err otherwise.
12937 struct LDKCResult_boolLightningErrorZ (*handle_channel_update)(const void *this_arg, const struct LDKChannelUpdate *NONNULL_PTR msg);
12939 * Gets channel announcements and updates required to dump our routing table to a remote node,
12940 * starting at the short_channel_id indicated by starting_point and including announcements
12941 * for a single channel.
12943 struct LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ (*get_next_channel_announcement)(const void *this_arg, uint64_t starting_point);
12945 * Gets a node announcement required to dump our routing table to a remote node, starting at
12946 * the node *after* the provided pubkey and including up to one announcement immediately
12947 * higher (as defined by <PublicKey as Ord>::cmp) than starting_point.
12948 * If None is provided for starting_point, we start at the first node.
12950 * Note that starting_point (or a relevant inner pointer) may be NULL or all-0s to represent None
12951 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
12953 struct LDKNodeAnnouncement (*get_next_node_announcement)(const void *this_arg, struct LDKPublicKey starting_point);
12955 * Called when a connection is established with a peer. This can be used to
12956 * perform routing table synchronization using a strategy defined by the
12959 * May return an `Err(())` if the features the peer supports are not sufficient to communicate
12960 * with us. Implementors should be somewhat conservative about doing so, however, as other
12961 * message handlers may still wish to communicate with this peer.
12963 struct LDKCResult_NoneNoneZ (*peer_connected)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKInit *NONNULL_PTR init);
12965 * Handles the reply of a query we initiated to learn about channels
12966 * for a given range of blocks. We can expect to receive one or more
12967 * replies to a single query.
12969 struct LDKCResult_NoneLightningErrorZ (*handle_reply_channel_range)(const void *this_arg, struct LDKPublicKey their_node_id, struct LDKReplyChannelRange msg);
12971 * Handles the reply of a query we initiated asking for routing gossip
12972 * messages for a list of channels. We should receive this message when
12973 * a node has completed its best effort to send us the pertaining routing
12976 struct LDKCResult_NoneLightningErrorZ (*handle_reply_short_channel_ids_end)(const void *this_arg, struct LDKPublicKey their_node_id, struct LDKReplyShortChannelIdsEnd msg);
12978 * Handles when a peer asks us to send a list of short_channel_ids
12979 * for the requested range of blocks.
12981 struct LDKCResult_NoneLightningErrorZ (*handle_query_channel_range)(const void *this_arg, struct LDKPublicKey their_node_id, struct LDKQueryChannelRange msg);
12983 * Handles when a peer asks us to send routing gossip messages for a
12984 * list of short_channel_ids.
12986 struct LDKCResult_NoneLightningErrorZ (*handle_query_short_channel_ids)(const void *this_arg, struct LDKPublicKey their_node_id, struct LDKQueryShortChannelIds msg);
12988 * Gets the node feature flags which this handler itself supports. All available handlers are
12989 * queried similarly and their feature flags are OR'd together to form the [`NodeFeatures`]
12990 * which are broadcasted in our [`NodeAnnouncement`] message.
12992 struct LDKNodeFeatures (*provided_node_features)(const void *this_arg);
12994 * Gets the init feature flags which should be sent to the given peer. All available handlers
12995 * are queried similarly and their feature flags are OR'd together to form the [`InitFeatures`]
12996 * which are sent in our [`Init`] message.
12998 * Note that this method is called before [`Self::peer_connected`].
13000 struct LDKInitFeatures (*provided_init_features)(const void *this_arg, struct LDKPublicKey their_node_id);
13002 * Implementation of MessageSendEventsProvider for this object.
13004 struct LDKMessageSendEventsProvider MessageSendEventsProvider;
13006 * Frees any resources associated with this object given its this_arg pointer.
13007 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
13009 void (*free)(void *this_arg);
13010 } LDKRoutingMessageHandler;
13013 * A trait to describe an object that can receive onion messages.
13015 typedef struct LDKOnionMessageHandler {
13017 * An opaque pointer which is passed to your function implementations as an argument.
13018 * This has no meaning in the LDK, and can be NULL or any other value.
13022 * Handle an incoming onion_message message from the given peer.
13024 void (*handle_onion_message)(const void *this_arg, struct LDKPublicKey peer_node_id, const struct LDKOnionMessage *NONNULL_PTR msg);
13026 * Called when a connection is established with a peer. Can be used to track which peers
13027 * advertise onion message support and are online.
13029 * May return an `Err(())` if the features the peer supports are not sufficient to communicate
13030 * with us. Implementors should be somewhat conservative about doing so, however, as other
13031 * message handlers may still wish to communicate with this peer.
13033 struct LDKCResult_NoneNoneZ (*peer_connected)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKInit *NONNULL_PTR init);
13035 * Indicates a connection to the peer failed/an existing connection was lost. Allows handlers to
13036 * drop and refuse to forward onion messages to this peer.
13038 * Note that in some rare cases this may be called without a corresponding
13039 * [`Self::peer_connected`].
13041 void (*peer_disconnected)(const void *this_arg, struct LDKPublicKey their_node_id, bool no_connection_possible);
13043 * Gets the node feature flags which this handler itself supports. All available handlers are
13044 * queried similarly and their feature flags are OR'd together to form the [`NodeFeatures`]
13045 * which are broadcasted in our [`NodeAnnouncement`] message.
13047 struct LDKNodeFeatures (*provided_node_features)(const void *this_arg);
13049 * Gets the init feature flags which should be sent to the given peer. All available handlers
13050 * are queried similarly and their feature flags are OR'd together to form the [`InitFeatures`]
13051 * which are sent in our [`Init`] message.
13053 * Note that this method is called before [`Self::peer_connected`].
13055 struct LDKInitFeatures (*provided_init_features)(const void *this_arg, struct LDKPublicKey their_node_id);
13057 * Implementation of OnionMessageProvider for this object.
13059 struct LDKOnionMessageProvider OnionMessageProvider;
13061 * Frees any resources associated with this object given its this_arg pointer.
13062 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
13064 void (*free)(void *this_arg);
13065 } LDKOnionMessageHandler;
13068 * Trait to be implemented by custom message (unrelated to the channel/gossip LN layers)
13071 typedef struct LDKCustomMessageReader {
13073 * An opaque pointer which is passed to your function implementations as an argument.
13074 * This has no meaning in the LDK, and can be NULL or any other value.
13078 * Decodes a custom message to `CustomMessageType`. If the given message type is known to the
13079 * implementation and the message could be decoded, must return `Ok(Some(message))`. If the
13080 * message type is unknown to the implementation, must return `Ok(None)`. If a decoding error
13081 * occur, must return `Err(DecodeError::X)` where `X` details the encountered error.
13083 struct LDKCResult_COption_TypeZDecodeErrorZ (*read)(const void *this_arg, uint16_t message_type, struct LDKu8slice buffer);
13085 * Frees any resources associated with this object given its this_arg pointer.
13086 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
13088 void (*free)(void *this_arg);
13089 } LDKCustomMessageReader;
13092 * Handler for BOLT1-compliant messages.
13094 typedef struct LDKCustomMessageHandler {
13096 * An opaque pointer which is passed to your function implementations as an argument.
13097 * This has no meaning in the LDK, and can be NULL or any other value.
13101 * Called with the message type that was received and the buffer to be read.
13102 * Can return a `MessageHandlingError` if the message could not be handled.
13104 struct LDKCResult_NoneLightningErrorZ (*handle_custom_message)(const void *this_arg, struct LDKType msg, struct LDKPublicKey sender_node_id);
13106 * Gets the list of pending messages which were generated by the custom message
13107 * handler, clearing the list in the process. The first tuple element must
13108 * correspond to the intended recipients node ids. If no connection to one of the
13109 * specified node does not exist, the message is simply not sent to it.
13111 struct LDKCVec_C2Tuple_PublicKeyTypeZZ (*get_and_clear_pending_msg)(const void *this_arg);
13113 * Implementation of CustomMessageReader for this object.
13115 struct LDKCustomMessageReader CustomMessageReader;
13117 * Frees any resources associated with this object given its this_arg pointer.
13118 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
13120 void (*free)(void *this_arg);
13121 } LDKCustomMessageHandler;
13126 * A dummy struct which implements `RoutingMessageHandler` without storing any routing information
13127 * or doing any processing. You can provide one of these as the route_handler in a MessageHandler.
13129 typedef struct MUST_USE_STRUCT LDKIgnoringMessageHandler {
13131 * A pointer to the opaque Rust object.
13132 * Nearly everywhere, inner must be non-null, however in places where
13133 * the Rust equivalent takes an Option, it may be set to null to indicate None.
13135 LDKnativeIgnoringMessageHandler *inner;
13137 * Indicates that this is the only struct which contains the same pointer.
13138 * Rust functions which take ownership of an object provided via an argument require
13139 * this to be true and invalidate the object pointed to by inner.
13142 } LDKIgnoringMessageHandler;
13145 * Handler for custom onion messages. If you are using [`SimpleArcOnionMessenger`],
13146 * [`SimpleRefOnionMessenger`], or prefer to ignore inbound custom onion messages,
13147 * [`IgnoringMessageHandler`] must be provided to [`OnionMessenger::new`]. Otherwise, a custom
13148 * implementation of this trait must be provided, with [`CustomMessage`] specifying the supported
13151 * See [`OnionMessenger`] for example usage.
13153 * [`IgnoringMessageHandler`]: crate::ln::peer_handler::IgnoringMessageHandler
13154 * [`CustomMessage`]: Self::CustomMessage
13156 typedef struct LDKCustomOnionMessageHandler {
13158 * An opaque pointer which is passed to your function implementations as an argument.
13159 * This has no meaning in the LDK, and can be NULL or any other value.
13163 * Called with the custom message that was received.
13165 void (*handle_custom_message)(const void *this_arg, struct LDKCustomOnionMessageContents msg);
13167 * Read a custom message of type `message_type` from `buffer`, returning `Ok(None)` if the
13168 * message type is unknown.
13170 struct LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ (*read_custom_message)(const void *this_arg, uint64_t message_type, struct LDKu8slice buffer);
13172 * Frees any resources associated with this object given its this_arg pointer.
13173 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
13175 void (*free)(void *this_arg);
13176 } LDKCustomOnionMessageHandler;
13181 * A dummy struct which implements `ChannelMessageHandler` without having any channels.
13182 * You can provide one of these as the route_handler in a MessageHandler.
13184 typedef struct MUST_USE_STRUCT LDKErroringMessageHandler {
13186 * A pointer to the opaque Rust object.
13187 * Nearly everywhere, inner must be non-null, however in places where
13188 * the Rust equivalent takes an Option, it may be set to null to indicate None.
13190 LDKnativeErroringMessageHandler *inner;
13192 * Indicates that this is the only struct which contains the same pointer.
13193 * Rust functions which take ownership of an object provided via an argument require
13194 * this to be true and invalidate the object pointed to by inner.
13197 } LDKErroringMessageHandler;
13202 * Provides references to trait impls which handle different types of messages.
13204 typedef struct MUST_USE_STRUCT LDKMessageHandler {
13206 * A pointer to the opaque Rust object.
13207 * Nearly everywhere, inner must be non-null, however in places where
13208 * the Rust equivalent takes an Option, it may be set to null to indicate None.
13210 LDKnativeMessageHandler *inner;
13212 * Indicates that this is the only struct which contains the same pointer.
13213 * Rust functions which take ownership of an object provided via an argument require
13214 * this to be true and invalidate the object pointed to by inner.
13217 } LDKMessageHandler;
13220 * Provides an object which can be used to send data to and which uniquely identifies a connection
13221 * to a remote host. You will need to be able to generate multiple of these which meet Eq and
13222 * implement Hash to meet the PeerManager API.
13224 * For efficiency, Clone should be relatively cheap for this type.
13226 * Two descriptors may compare equal (by [`cmp::Eq`] and [`hash::Hash`]) as long as the original
13227 * has been disconnected, the [`PeerManager`] has been informed of the disconnection (either by it
13228 * having triggered the disconnection or a call to [`PeerManager::socket_disconnected`]), and no
13229 * further calls to the [`PeerManager`] related to the original socket occur. This allows you to
13230 * use a file descriptor for your SocketDescriptor directly, however for simplicity you may wish
13231 * to simply use another value which is guaranteed to be globally unique instead.
13233 typedef struct LDKSocketDescriptor {
13235 * An opaque pointer which is passed to your function implementations as an argument.
13236 * This has no meaning in the LDK, and can be NULL or any other value.
13240 * Attempts to send some data from the given slice to the peer.
13242 * Returns the amount of data which was sent, possibly 0 if the socket has since disconnected.
13243 * Note that in the disconnected case, [`PeerManager::socket_disconnected`] must still be
13244 * called and further write attempts may occur until that time.
13246 * If the returned size is smaller than `data.len()`, a
13247 * [`PeerManager::write_buffer_space_avail`] call must be made the next time more data can be
13248 * written. Additionally, until a `send_data` event completes fully, no further
13249 * [`PeerManager::read_event`] calls should be made for the same peer! Because this is to
13250 * prevent denial-of-service issues, you should not read or buffer any data from the socket
13253 * If a [`PeerManager::read_event`] call on this descriptor had previously returned true
13254 * (indicating that read events should be paused to prevent DoS in the send buffer),
13255 * `resume_read` may be set indicating that read events on this descriptor should resume. A
13256 * `resume_read` of false carries no meaning, and should not cause any action.
13258 uintptr_t (*send_data)(void *this_arg, struct LDKu8slice data, bool resume_read);
13260 * Disconnect the socket pointed to by this SocketDescriptor.
13262 * You do *not* need to call [`PeerManager::socket_disconnected`] with this socket after this
13263 * call (doing so is a noop).
13265 void (*disconnect_socket)(void *this_arg);
13267 * Checks if two objects are equal given this object's this_arg pointer and another object.
13269 bool (*eq)(const void *this_arg, const struct LDKSocketDescriptor *NONNULL_PTR other_arg);
13271 * Calculate a succinct non-cryptographic hash for an object given its this_arg pointer.
13272 * This is used, for example, for inclusion of this object in a hash map.
13274 uint64_t (*hash)(const void *this_arg);
13276 * Called, if set, after this SocketDescriptor has been cloned into a duplicate object.
13277 * The new SocketDescriptor is provided, and should be mutated as needed to perform a
13278 * deep copy of the object pointed to by this_arg or avoid any double-freeing.
13280 void (*cloned)(struct LDKSocketDescriptor *NONNULL_PTR new_SocketDescriptor);
13282 * Frees any resources associated with this object given its this_arg pointer.
13283 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
13285 void (*free)(void *this_arg);
13286 } LDKSocketDescriptor;
13291 * A PeerManager manages a set of peers, described by their [`SocketDescriptor`] and marshalls
13292 * socket events into messages which it passes on to its [`MessageHandler`].
13294 * Locks are taken internally, so you must never assume that reentrancy from a
13295 * [`SocketDescriptor`] call back into [`PeerManager`] methods will not deadlock.
13297 * Calls to [`read_event`] will decode relevant messages and pass them to the
13298 * [`ChannelMessageHandler`], likely doing message processing in-line. Thus, the primary form of
13299 * parallelism in Rust-Lightning is in calls to [`read_event`]. Note, however, that calls to any
13300 * [`PeerManager`] functions related to the same connection must occur only in serial, making new
13301 * calls only after previous ones have returned.
13303 * Rather than using a plain PeerManager, it is preferable to use either a SimpleArcPeerManager
13304 * a SimpleRefPeerManager, for conciseness. See their documentation for more details, but
13305 * essentially you should default to using a SimpleRefPeerManager, and use a
13306 * SimpleArcPeerManager when you require a PeerManager with a static lifetime, such as when
13307 * you're using lightning-net-tokio.
13309 * [`read_event`]: PeerManager::read_event
13311 typedef struct MUST_USE_STRUCT LDKPeerManager {
13313 * A pointer to the opaque Rust object.
13314 * Nearly everywhere, inner must be non-null, however in places where
13315 * the Rust equivalent takes an Option, it may be set to null to indicate None.
13317 LDKnativePeerManager *inner;
13319 * Indicates that this is the only struct which contains the same pointer.
13320 * Rust functions which take ownership of an object provided via an argument require
13321 * this to be true and invalidate the object pointed to by inner.
13329 * Static channel fields used to build transactions given per-commitment fields, organized by
13330 * broadcaster/countersignatory.
13332 * This is derived from the holder/counterparty-organized ChannelTransactionParameters via the
13333 * as_holder_broadcastable and as_counterparty_broadcastable functions.
13335 typedef struct MUST_USE_STRUCT LDKDirectedChannelTransactionParameters {
13337 * A pointer to the opaque Rust object.
13338 * Nearly everywhere, inner must be non-null, however in places where
13339 * the Rust equivalent takes an Option, it may be set to null to indicate None.
13341 LDKnativeDirectedChannelTransactionParameters *inner;
13343 * Indicates that this is the only struct which contains the same pointer.
13344 * Rust functions which take ownership of an object provided via an argument require
13345 * this to be true and invalidate the object pointed to by inner.
13348 } LDKDirectedChannelTransactionParameters;
13351 * Integer in the range `0..=16`
13353 typedef struct LDKWitnessVersion {
13355 } LDKWitnessVersion;
13360 * A read-only view of [`NetworkGraph`].
13362 typedef struct MUST_USE_STRUCT LDKReadOnlyNetworkGraph {
13364 * A pointer to the opaque Rust object.
13365 * Nearly everywhere, inner must be non-null, however in places where
13366 * the Rust equivalent takes an Option, it may be set to null to indicate None.
13368 LDKnativeReadOnlyNetworkGraph *inner;
13370 * Indicates that this is the only struct which contains the same pointer.
13371 * Rust functions which take ownership of an object provided via an argument require
13372 * this to be true and invalidate the object pointed to by inner.
13375 } LDKReadOnlyNetworkGraph;
13380 * Receives and validates network updates from peers,
13381 * stores authentic and relevant data as a network graph.
13382 * This network graph is then used for routing payments.
13383 * Provides interface to help with initial routing sync by
13384 * serving historical announcements.
13386 * Serves as an [`EventHandler`] for applying updates from [`Event::PaymentPathFailed`] to the
13387 * [`NetworkGraph`].
13389 typedef struct MUST_USE_STRUCT LDKP2PGossipSync {
13391 * A pointer to the opaque Rust object.
13392 * Nearly everywhere, inner must be non-null, however in places where
13393 * the Rust equivalent takes an Option, it may be set to null to indicate None.
13395 LDKnativeP2PGossipSync *inner;
13397 * Indicates that this is the only struct which contains the same pointer.
13398 * Rust functions which take ownership of an object provided via an argument require
13399 * this to be true and invalidate the object pointed to by inner.
13402 } LDKP2PGossipSync;
13407 * A wrapper around [`ChannelInfo`] representing information about the channel as directed from a
13408 * source node to a target node.
13410 typedef struct MUST_USE_STRUCT LDKDirectedChannelInfo {
13412 * A pointer to the opaque Rust object.
13413 * Nearly everywhere, inner must be non-null, however in places where
13414 * the Rust equivalent takes an Option, it may be set to null to indicate None.
13416 LDKnativeDirectedChannelInfo *inner;
13418 * Indicates that this is the only struct which contains the same pointer.
13419 * Rust functions which take ownership of an object provided via an argument require
13420 * this to be true and invalidate the object pointed to by inner.
13423 } LDKDirectedChannelInfo;
13426 * The effective capacity of a channel for routing purposes.
13428 * While this may be smaller than the actual channel capacity, amounts greater than
13429 * [`Self::as_msat`] should not be routed through the channel.
13431 typedef enum LDKEffectiveCapacity_Tag {
13433 * The available liquidity in the channel known from being a channel counterparty, and thus a
13436 LDKEffectiveCapacity_ExactLiquidity,
13438 * The maximum HTLC amount in one direction as advertised on the gossip network.
13440 LDKEffectiveCapacity_MaximumHTLC,
13442 * The total capacity of the channel as determined by the funding transaction.
13444 LDKEffectiveCapacity_Total,
13446 * A capacity sufficient to route any payment, typically used for private channels provided by
13449 LDKEffectiveCapacity_Infinite,
13451 * A capacity that is unknown possibly because either the chain state is unavailable to know
13452 * the total capacity or the `htlc_maximum_msat` was not advertised on the gossip network.
13454 LDKEffectiveCapacity_Unknown,
13456 * Must be last for serialization purposes
13458 LDKEffectiveCapacity_Sentinel,
13459 } LDKEffectiveCapacity_Tag;
13461 typedef struct LDKEffectiveCapacity_LDKExactLiquidity_Body {
13463 * Either the inbound or outbound liquidity depending on the direction, denominated in
13466 uint64_t liquidity_msat;
13467 } LDKEffectiveCapacity_LDKExactLiquidity_Body;
13469 typedef struct LDKEffectiveCapacity_LDKMaximumHTLC_Body {
13471 * The maximum HTLC amount denominated in millisatoshi.
13473 uint64_t amount_msat;
13474 } LDKEffectiveCapacity_LDKMaximumHTLC_Body;
13476 typedef struct LDKEffectiveCapacity_LDKTotal_Body {
13478 * The funding amount denominated in millisatoshi.
13480 uint64_t capacity_msat;
13482 * The maximum HTLC amount denominated in millisatoshi.
13484 struct LDKCOption_u64Z htlc_maximum_msat;
13485 } LDKEffectiveCapacity_LDKTotal_Body;
13487 typedef struct MUST_USE_STRUCT LDKEffectiveCapacity {
13488 LDKEffectiveCapacity_Tag tag;
13490 LDKEffectiveCapacity_LDKExactLiquidity_Body exact_liquidity;
13491 LDKEffectiveCapacity_LDKMaximumHTLC_Body maximum_htlc;
13492 LDKEffectiveCapacity_LDKTotal_Body total;
13494 } LDKEffectiveCapacity;
13499 * A concrete implementation of [`LockableScore`] which supports multi-threading.
13501 typedef struct MUST_USE_STRUCT LDKMultiThreadedLockableScore {
13503 * A pointer to the opaque Rust object.
13504 * Nearly everywhere, inner must be non-null, however in places where
13505 * the Rust equivalent takes an Option, it may be set to null to indicate None.
13507 LDKnativeMultiThreadedLockableScore *inner;
13509 * Indicates that this is the only struct which contains the same pointer.
13510 * Rust functions which take ownership of an object provided via an argument require
13511 * this to be true and invalidate the object pointed to by inner.
13514 } LDKMultiThreadedLockableScore;
13519 * A locked `MultiThreadedLockableScore`.
13521 typedef struct MUST_USE_STRUCT LDKMultiThreadedScoreLock {
13523 * A pointer to the opaque Rust object.
13524 * Nearly everywhere, inner must be non-null, however in places where
13525 * the Rust equivalent takes an Option, it may be set to null to indicate None.
13527 LDKnativeMultiThreadedScoreLock *inner;
13529 * Indicates that this is the only struct which contains the same pointer.
13530 * Rust functions which take ownership of an object provided via an argument require
13531 * this to be true and invalidate the object pointed to by inner.
13534 } LDKMultiThreadedScoreLock;
13539 * Parameters for configuring [`ProbabilisticScorer`].
13541 * Used to configure base, liquidity, and amount penalties, the sum of which comprises the channel
13542 * penalty (i.e., the amount in msats willing to be paid to avoid routing through the channel).
13544 * The penalty applied to any channel by the [`ProbabilisticScorer`] is the sum of each of the
13547 typedef struct MUST_USE_STRUCT LDKProbabilisticScoringParameters {
13549 * A pointer to the opaque Rust object.
13550 * Nearly everywhere, inner must be non-null, however in places where
13551 * the Rust equivalent takes an Option, it may be set to null to indicate None.
13553 LDKnativeProbabilisticScoringParameters *inner;
13555 * Indicates that this is the only struct which contains the same pointer.
13556 * Rust functions which take ownership of an object provided via an argument require
13557 * this to be true and invalidate the object pointed to by inner.
13560 } LDKProbabilisticScoringParameters;
13565 * A sender, receiver and forwarder of onion messages. In upcoming releases, this object will be
13566 * used to retrieve invoices and fulfill invoice requests from [offers]. Currently, only sending
13567 * and receiving custom onion messages is supported.
13572 * # extern crate bitcoin;
13573 * # use bitcoin::hashes::_export::_core::time::Duration;
13574 * # use bitcoin::secp256k1::{PublicKey, Secp256k1, SecretKey};
13575 * # use lightning::chain::keysinterface::{InMemorySigner, KeysManager, KeysInterface};
13576 * # use lightning::ln::msgs::DecodeError;
13577 * # use lightning::ln::peer_handler::IgnoringMessageHandler;
13578 * # use lightning::onion_message::messenger::{Destination, OnionMessenger};
13579 * # use lightning::onion_message::packet::CustomOnionMessageContents;
13580 * # use lightning::onion_message::blinded_route::BlindedRoute;
13581 * # use lightning::util::logger::{Logger, Record};
13582 * # use lightning::util::ser::{Writeable, Writer};
13583 * # use lightning::io;
13584 * # use std::sync::Arc;
13585 * # struct FakeLogger {};
13586 * # impl Logger for FakeLogger {
13587 * # fn log(&self, record: &Record) { unimplemented!() }
13589 * # let seed = [42u8; 32];
13590 * # let time = Duration::from_secs(123456);
13591 * # let keys_manager = KeysManager::new(&seed, time.as_secs(), time.subsec_nanos());
13592 * # let logger = Arc::new(FakeLogger {});
13593 * # let node_secret = SecretKey::from_slice(&hex::decode(\"0101010101010101010101010101010101010101010101010101010101010101\").unwrap()[..]).unwrap();
13594 * # let secp_ctx = Secp256k1::new();
13595 * # let hop_node_id1 = PublicKey::from_secret_key(&secp_ctx, &node_secret);
13596 * # let (hop_node_id2, hop_node_id3, hop_node_id4) = (hop_node_id1, hop_node_id1, hop_node_id1);
13597 * # let destination_node_id = hop_node_id1;
13598 * # let your_custom_message_handler = IgnoringMessageHandler {};
13599 * // Create the onion messenger. This must use the same `keys_manager` as is passed to your
13600 * // ChannelManager.
13601 * let onion_messenger = OnionMessenger::new(&keys_manager, logger, your_custom_message_handler);
13603 * # struct YourCustomMessage {}
13604 * impl Writeable for YourCustomMessage {
13605 * \tfn write<W: Writer>(&self, w: &mut W) -> Result<(), io::Error> {
13607 * \t\t// Write your custom onion message to `w`
13610 * impl CustomOnionMessageContents for YourCustomMessage {
13611 * \tfn tlv_type(&self) -> u64 {
13612 * \t\t# let your_custom_message_type = 42;
13613 * \t\tyour_custom_message_type
13616 * // Send a custom onion message to a node id.
13617 * let intermediate_hops = [hop_node_id1, hop_node_id2];
13618 * let reply_path = None;
13619 * # let your_custom_message = YourCustomMessage {};
13620 * onion_messenger.send_custom_onion_message(&intermediate_hops, Destination::Node(destination_node_id), your_custom_message, reply_path);
13622 * // Create a blinded route to yourself, for someone to send an onion message to.
13623 * # let your_node_id = hop_node_id1;
13624 * let hops = [hop_node_id3, hop_node_id4, your_node_id];
13625 * let blinded_route = BlindedRoute::new(&hops, &keys_manager, &secp_ctx).unwrap();
13627 * // Send a custom onion message to a blinded route.
13628 * # let intermediate_hops = [hop_node_id1, hop_node_id2];
13629 * let reply_path = None;
13630 * # let your_custom_message = YourCustomMessage {};
13631 * onion_messenger.send_custom_onion_message(&intermediate_hops, Destination::BlindedRoute(blinded_route), your_custom_message, reply_path);
13634 * [offers]: <https://github.com/lightning/bolts/pull/798>
13635 * [`OnionMessenger`]: crate::onion_message::OnionMessenger
13637 typedef struct MUST_USE_STRUCT LDKOnionMessenger {
13639 * A pointer to the opaque Rust object.
13640 * Nearly everywhere, inner must be non-null, however in places where
13641 * the Rust equivalent takes an Option, it may be set to null to indicate None.
13643 LDKnativeOnionMessenger *inner;
13645 * Indicates that this is the only struct which contains the same pointer.
13646 * Rust functions which take ownership of an object provided via an argument require
13647 * this to be true and invalidate the object pointed to by inner.
13650 } LDKOnionMessenger;
13653 * The destination of an onion message.
13655 typedef enum LDKDestination_Tag {
13657 * We're sending this onion message to a node.
13659 LDKDestination_Node,
13661 * We're sending this onion message to a blinded route.
13663 LDKDestination_BlindedRoute,
13665 * Must be last for serialization purposes
13667 LDKDestination_Sentinel,
13668 } LDKDestination_Tag;
13670 typedef struct MUST_USE_STRUCT LDKDestination {
13671 LDKDestination_Tag tag;
13674 struct LDKPublicKey node;
13677 struct LDKBlindedRoute blinded_route;
13685 * FilesystemPersister persists channel data on disk, where each channel's
13686 * data is stored in a file named after its funding outpoint.
13688 * Warning: this module does the best it can with calls to persist data, but it
13689 * can only guarantee that the data is passed to the drive. It is up to the
13690 * drive manufacturers to do the actual persistence properly, which they often
13691 * don't (especially on consumer-grade hardware). Therefore, it is up to the
13692 * user to validate their entire storage stack, to ensure the writes are
13694 * Corollary: especially when dealing with larger amounts of money, it is best
13695 * practice to have multiple channel data backups and not rely only on one
13696 * FilesystemPersister.
13698 typedef struct MUST_USE_STRUCT LDKFilesystemPersister {
13700 * A pointer to the opaque Rust object.
13701 * Nearly everywhere, inner must be non-null, however in places where
13702 * the Rust equivalent takes an Option, it may be set to null to indicate None.
13704 LDKnativeFilesystemPersister *inner;
13706 * Indicates that this is the only struct which contains the same pointer.
13707 * Rust functions which take ownership of an object provided via an argument require
13708 * this to be true and invalidate the object pointed to by inner.
13711 } LDKFilesystemPersister;
13716 * `BackgroundProcessor` takes care of tasks that (1) need to happen periodically to keep
13717 * Rust-Lightning running properly, and (2) either can or should be run in the background. Its
13718 * responsibilities are:
13719 * * Processing [`Event`]s with a user-provided [`EventHandler`].
13720 * * Monitoring whether the [`ChannelManager`] needs to be re-persisted to disk, and if so,
13721 * writing it to disk/backups by invoking the callback given to it at startup.
13722 * [`ChannelManager`] persistence should be done in the background.
13723 * * Calling [`ChannelManager::timer_tick_occurred`] and [`PeerManager::timer_tick_occurred`]
13724 * at the appropriate intervals.
13725 * * Calling [`NetworkGraph::remove_stale_channels_and_tracking`] (if a [`GossipSync`] with a
13726 * [`NetworkGraph`] is provided to [`BackgroundProcessor::start`]).
13728 * It will also call [`PeerManager::process_events`] periodically though this shouldn't be relied
13729 * upon as doing so may result in high latency.
13733 * If [`ChannelManager`] persistence fails and the persisted manager becomes out-of-date, then
13734 * there is a risk of channels force-closing on startup when the manager realizes it's outdated.
13735 * However, as long as [`ChannelMonitor`] backups are sound, no funds besides those used for
13736 * unilateral chain closure fees are at risk.
13738 * [`ChannelMonitor`]: lightning::chain::channelmonitor::ChannelMonitor
13739 * [`Event`]: lightning::util::events::Event
13740 *BackgroundProcessor will immediately stop on drop. It should be stored until shutdown.
13742 typedef struct MUST_USE_STRUCT LDKBackgroundProcessor {
13744 * A pointer to the opaque Rust object.
13745 * Nearly everywhere, inner must be non-null, however in places where
13746 * the Rust equivalent takes an Option, it may be set to null to indicate None.
13748 LDKnativeBackgroundProcessor *inner;
13750 * Indicates that this is the only struct which contains the same pointer.
13751 * Rust functions which take ownership of an object provided via an argument require
13752 * this to be true and invalidate the object pointed to by inner.
13755 } LDKBackgroundProcessor;
13760 * The main Rapid Gossip Sync object.
13762 * See [crate-level documentation] for usage.
13764 * [crate-level documentation]: crate
13766 typedef struct MUST_USE_STRUCT LDKRapidGossipSync {
13768 * A pointer to the opaque Rust object.
13769 * Nearly everywhere, inner must be non-null, however in places where
13770 * the Rust equivalent takes an Option, it may be set to null to indicate None.
13772 LDKnativeRapidGossipSync *inner;
13774 * Indicates that this is the only struct which contains the same pointer.
13775 * Rust functions which take ownership of an object provided via an argument require
13776 * this to be true and invalidate the object pointed to by inner.
13779 } LDKRapidGossipSync;
13782 * Either [`P2PGossipSync`] or [`RapidGossipSync`].
13784 typedef enum LDKGossipSync_Tag {
13786 * Gossip sync via the lightning peer-to-peer network as defined by BOLT 7.
13790 * Rapid gossip sync from a trusted server.
13792 LDKGossipSync_Rapid,
13796 LDKGossipSync_None,
13798 * Must be last for serialization purposes
13800 LDKGossipSync_Sentinel,
13801 } LDKGossipSync_Tag;
13803 typedef struct MUST_USE_STRUCT LDKGossipSync {
13804 LDKGossipSync_Tag tag;
13808 * Note that this field is expected to be a reference.
13810 struct LDKP2PGossipSync p2p;
13814 * Note that this field is expected to be a reference.
13816 struct LDKRapidGossipSync rapid;
13824 * Data of the `RawInvoice` that is encoded in the data part
13826 typedef struct MUST_USE_STRUCT LDKRawDataPart {
13828 * A pointer to the opaque Rust object.
13829 * Nearly everywhere, inner must be non-null, however in places where
13830 * the Rust equivalent takes an Option, it may be set to null to indicate None.
13832 LDKnativeRawDataPart *inner;
13834 * Indicates that this is the only struct which contains the same pointer.
13835 * Rust functions which take ownership of an object provided via an argument require
13836 * this to be true and invalidate the object pointed to by inner.
13846 typedef struct MUST_USE_STRUCT LDKSha256 {
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 LDKnativeSha256 *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.
13864 * Positive duration that defines when (relatively to the timestamp) in the future the invoice
13867 typedef struct MUST_USE_STRUCT LDKExpiryTime {
13869 * A pointer to the opaque Rust object.
13870 * Nearly everywhere, inner must be non-null, however in places where
13871 * the Rust equivalent takes an Option, it may be set to null to indicate None.
13873 LDKnativeExpiryTime *inner;
13875 * Indicates that this is the only struct which contains the same pointer.
13876 * Rust functions which take ownership of an object provided via an argument require
13877 * this to be true and invalidate the object pointed to by inner.
13885 * `min_final_cltv_expiry` to use for the last HTLC in the route
13887 typedef struct MUST_USE_STRUCT LDKMinFinalCltvExpiry {
13889 * A pointer to the opaque Rust object.
13890 * Nearly everywhere, inner must be non-null, however in places where
13891 * the Rust equivalent takes an Option, it may be set to null to indicate None.
13893 LDKnativeMinFinalCltvExpiry *inner;
13895 * Indicates that this is the only struct which contains the same pointer.
13896 * Rust functions which take ownership of an object provided via an argument require
13897 * this to be true and invalidate the object pointed to by inner.
13900 } LDKMinFinalCltvExpiry;
13903 * A 20-byte byte array.
13905 typedef struct LDKTwentyBytes {
13913 * Fallback address in case no LN payment is possible
13915 typedef enum LDKFallback_Tag {
13916 LDKFallback_SegWitProgram,
13917 LDKFallback_PubKeyHash,
13918 LDKFallback_ScriptHash,
13920 * Must be last for serialization purposes
13922 LDKFallback_Sentinel,
13925 typedef struct LDKFallback_LDKSegWitProgram_Body {
13926 struct LDKu5 version;
13927 struct LDKCVec_u8Z program;
13928 } LDKFallback_LDKSegWitProgram_Body;
13930 typedef struct MUST_USE_STRUCT LDKFallback {
13931 LDKFallback_Tag tag;
13933 LDKFallback_LDKSegWitProgram_Body seg_wit_program;
13935 struct LDKTwentyBytes pub_key_hash;
13938 struct LDKTwentyBytes script_hash;
13944 * A trait defining behavior of an [`Invoice`] payer.
13946 typedef struct LDKPayer {
13948 * An opaque pointer which is passed to your function implementations as an argument.
13949 * This has no meaning in the LDK, and can be NULL or any other value.
13953 * Returns the payer's node id.
13955 struct LDKPublicKey (*node_id)(const void *this_arg);
13957 * Returns the payer's channels.
13959 struct LDKCVec_ChannelDetailsZ (*first_hops)(const void *this_arg);
13961 * Sends a payment over the Lightning Network using the given [`Route`].
13963 * Note that payment_secret (or a relevant inner pointer) may be NULL or all-0s to represent None
13965 struct LDKCResult_PaymentIdPaymentSendFailureZ (*send_payment)(const void *this_arg, const struct LDKRoute *NONNULL_PTR route, struct LDKThirtyTwoBytes payment_hash, struct LDKThirtyTwoBytes payment_secret);
13967 * Sends a spontaneous payment over the Lightning Network using the given [`Route`].
13969 struct LDKCResult_PaymentIdPaymentSendFailureZ (*send_spontaneous_payment)(const void *this_arg, const struct LDKRoute *NONNULL_PTR route, struct LDKThirtyTwoBytes payment_preimage);
13971 * Retries a failed payment path for the [`PaymentId`] using the given [`Route`].
13973 struct LDKCResult_NonePaymentSendFailureZ (*retry_payment)(const void *this_arg, const struct LDKRoute *NONNULL_PTR route, struct LDKThirtyTwoBytes payment_id);
13975 * Signals that no further retries for the given payment will occur.
13977 void (*abandon_payment)(const void *this_arg, struct LDKThirtyTwoBytes payment_id);
13979 * Frees any resources associated with this object given its this_arg pointer.
13980 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
13982 void (*free)(void *this_arg);
13986 * A trait defining behavior for routing an [`Invoice`] payment.
13988 typedef struct LDKRouter {
13990 * An opaque pointer which is passed to your function implementations as an argument.
13991 * This has no meaning in the LDK, and can be NULL or any other value.
13995 * Finds a [`Route`] between `payer` and `payee` for a payment with the given values.
13997 * Note that first_hops (or a relevant inner pointer) may be NULL or all-0s to represent None
13999 struct LDKCResult_RouteLightningErrorZ (*find_route)(const void *this_arg, struct LDKPublicKey payer, const struct LDKRouteParameters *NONNULL_PTR route_params, const uint8_t (*payment_hash)[32], struct LDKCVec_ChannelDetailsZ *first_hops, struct LDKInFlightHtlcs inflight_htlcs);
14001 * Lets the router know that payment through a specific path has failed.
14003 void (*notify_payment_path_failed)(const void *this_arg, struct LDKCVec_RouteHopZ path, uint64_t short_channel_id);
14005 * Lets the router know that payment through a specific path was successful.
14007 void (*notify_payment_path_successful)(const void *this_arg, struct LDKCVec_RouteHopZ path);
14009 * Lets the router know that a payment probe was successful.
14011 void (*notify_payment_probe_successful)(const void *this_arg, struct LDKCVec_RouteHopZ path);
14013 * Lets the router know that a payment probe failed.
14015 void (*notify_payment_probe_failed)(const void *this_arg, struct LDKCVec_RouteHopZ path, uint64_t short_channel_id);
14017 * Frees any resources associated with this object given its this_arg pointer.
14018 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
14020 void (*free)(void *this_arg);
14026 * A utility for paying [`Invoice`]s and sending spontaneous payments.
14028 * See [module-level documentation] for details.
14030 * [module-level documentation]: crate::payment
14032 typedef struct MUST_USE_STRUCT LDKInvoicePayer {
14034 * A pointer to the opaque Rust object.
14035 * Nearly everywhere, inner must be non-null, however in places where
14036 * the Rust equivalent takes an Option, it may be set to null to indicate None.
14038 LDKnativeInvoicePayer *inner;
14040 * Indicates that this is the only struct which contains the same pointer.
14041 * Rust functions which take ownership of an object provided via an argument require
14042 * this to be true and invalidate the object pointed to by inner.
14048 * Strategies available to retry payment path failures for an [`Invoice`].
14051 typedef enum LDKRetry_Tag {
14053 * Max number of attempts to retry payment.
14055 * Note that this is the number of *path* failures, not full payment retries. For multi-path
14056 * payments, if this is less than the total number of paths, we will never even retry all of the
14061 * Time elapsed before abandoning retries for a payment.
14065 * Must be last for serialization purposes
14070 typedef struct MUST_USE_STRUCT LDKRetry {
14074 uintptr_t attempts;
14085 * A [`Router`] implemented using [`find_route`].
14087 typedef struct MUST_USE_STRUCT LDKDefaultRouter {
14089 * A pointer to the opaque Rust object.
14090 * Nearly everywhere, inner must be non-null, however in places where
14091 * the Rust equivalent takes an Option, it may be set to null to indicate None.
14093 LDKnativeDefaultRouter *inner;
14095 * Indicates that this is the only struct which contains the same pointer.
14096 * Rust functions which take ownership of an object provided via an argument require
14097 * this to be true and invalidate the object pointed to by inner.
14100 } LDKDefaultRouter;
14102 extern const uintptr_t MAX_BUF_SIZE;
14104 extern const uint64_t MIN_RELAY_FEE_SAT_PER_1000_WEIGHT;
14106 extern const uint32_t FEERATE_FLOOR_SATS_PER_KW;
14108 extern const uint64_t CLOSED_CHANNEL_UPDATE_ID;
14110 extern const uint32_t ANTI_REORG_DELAY;
14112 extern const uint16_t BREAKDOWN_TIMEOUT;
14114 extern const uint16_t MIN_CLTV_EXPIRY_DELTA;
14116 extern const uint32_t MIN_FINAL_CLTV_EXPIRY;
14118 extern const uintptr_t REVOKEABLE_REDEEMSCRIPT_MAX_LENGTH;
14120 extern const uint64_t UNKNOWN_CHANNEL_CAPACITY_MSAT;
14122 extern const uint32_t DEFAULT_MAX_TOTAL_CLTV_EXPIRY_DELTA;
14124 extern const uint8_t DEFAULT_MAX_PATH_COUNT;
14126 extern const uint64_t MAX_TIMESTAMP;
14128 extern const uint64_t DEFAULT_EXPIRY_TIME;
14130 extern const uint64_t DEFAULT_MIN_FINAL_CLTV_EXPIRY;
14132 extern const uint8_t TAG_PAYMENT_HASH;
14134 extern const uint8_t TAG_DESCRIPTION;
14136 extern const uint8_t TAG_PAYEE_PUB_KEY;
14138 extern const uint8_t TAG_DESCRIPTION_HASH;
14140 extern const uint8_t TAG_EXPIRY_TIME;
14142 extern const uint8_t TAG_MIN_FINAL_CLTV_EXPIRY;
14144 extern const uint8_t TAG_FALLBACK;
14146 extern const uint8_t TAG_PRIVATE_ROUTE;
14148 extern const uint8_t TAG_PAYMENT_SECRET;
14150 extern const uint8_t TAG_FEATURES;
14152 struct LDKStr _ldk_get_compiled_version(void);
14154 struct LDKStr _ldk_c_bindings_get_compiled_version(void);
14157 * Convenience function for constructing a new BigEndianScalar
14159 struct LDKBigEndianScalar BigEndianScalar_new(struct LDKThirtyTwoBytes big_endian_bytes);
14162 * Creates a new Bech32Error which has the same data as `orig`
14164 struct LDKBech32Error Bech32Error_clone(const struct LDKBech32Error *NONNULL_PTR orig);
14167 * Releases any memory held by the given `Bech32Error` (which is currently none)
14169 void Bech32Error_free(struct LDKBech32Error o);
14172 * Frees the data buffer, if data_is_owned is set and datalen > 0.
14174 void Transaction_free(struct LDKTransaction _res);
14177 * Convenience function for constructing a new TxOut
14179 struct LDKTxOut TxOut_new(struct LDKCVec_u8Z script_pubkey, uint64_t value);
14182 * Frees the data pointed to by script_pubkey.
14184 void TxOut_free(struct LDKTxOut _res);
14187 * Creates a new TxOut which has the same data as `orig` but with a new script buffer.
14189 struct LDKTxOut TxOut_clone(const struct LDKTxOut *NONNULL_PTR orig);
14192 * Frees the data buffer, if chars_is_owned is set and len > 0.
14194 void Str_free(struct LDKStr _res);
14196 #if defined(LDK_DEBUG_BUILD)
14198 * This function exists for memory safety testing purposes. It should never be used in production
14201 const void *__unmangle_inner_ptr(const void *ptr);
14205 * Frees the buffer pointed to by `data` if `datalen` is non-0.
14207 void CVec_PublicKeyZ_free(struct LDKCVec_PublicKeyZ _res);
14210 * Creates a new CResult_BlindedRouteNoneZ in the success state.
14212 struct LDKCResult_BlindedRouteNoneZ CResult_BlindedRouteNoneZ_ok(struct LDKBlindedRoute o);
14215 * Creates a new CResult_BlindedRouteNoneZ in the error state.
14217 struct LDKCResult_BlindedRouteNoneZ CResult_BlindedRouteNoneZ_err(void);
14220 * Checks if the given object is currently in the success state
14222 bool CResult_BlindedRouteNoneZ_is_ok(const struct LDKCResult_BlindedRouteNoneZ *NONNULL_PTR o);
14225 * Frees any resources used by the CResult_BlindedRouteNoneZ.
14227 void CResult_BlindedRouteNoneZ_free(struct LDKCResult_BlindedRouteNoneZ _res);
14230 * Creates a new CResult_BlindedRouteDecodeErrorZ in the success state.
14232 struct LDKCResult_BlindedRouteDecodeErrorZ CResult_BlindedRouteDecodeErrorZ_ok(struct LDKBlindedRoute o);
14235 * Creates a new CResult_BlindedRouteDecodeErrorZ in the error state.
14237 struct LDKCResult_BlindedRouteDecodeErrorZ CResult_BlindedRouteDecodeErrorZ_err(struct LDKDecodeError e);
14240 * Checks if the given object is currently in the success state
14242 bool CResult_BlindedRouteDecodeErrorZ_is_ok(const struct LDKCResult_BlindedRouteDecodeErrorZ *NONNULL_PTR o);
14245 * Frees any resources used by the CResult_BlindedRouteDecodeErrorZ.
14247 void CResult_BlindedRouteDecodeErrorZ_free(struct LDKCResult_BlindedRouteDecodeErrorZ _res);
14250 * Creates a new CResult_BlindedHopDecodeErrorZ in the success state.
14252 struct LDKCResult_BlindedHopDecodeErrorZ CResult_BlindedHopDecodeErrorZ_ok(struct LDKBlindedHop o);
14255 * Creates a new CResult_BlindedHopDecodeErrorZ in the error state.
14257 struct LDKCResult_BlindedHopDecodeErrorZ CResult_BlindedHopDecodeErrorZ_err(struct LDKDecodeError e);
14260 * Checks if the given object is currently in the success state
14262 bool CResult_BlindedHopDecodeErrorZ_is_ok(const struct LDKCResult_BlindedHopDecodeErrorZ *NONNULL_PTR o);
14265 * Frees any resources used by the CResult_BlindedHopDecodeErrorZ.
14267 void CResult_BlindedHopDecodeErrorZ_free(struct LDKCResult_BlindedHopDecodeErrorZ _res);
14270 * Creates a new CResult_NoneNoneZ in the success state.
14272 struct LDKCResult_NoneNoneZ CResult_NoneNoneZ_ok(void);
14275 * Creates a new CResult_NoneNoneZ in the error state.
14277 struct LDKCResult_NoneNoneZ CResult_NoneNoneZ_err(void);
14280 * Checks if the given object is currently in the success state
14282 bool CResult_NoneNoneZ_is_ok(const struct LDKCResult_NoneNoneZ *NONNULL_PTR o);
14285 * Frees any resources used by the CResult_NoneNoneZ.
14287 void CResult_NoneNoneZ_free(struct LDKCResult_NoneNoneZ _res);
14290 * Creates a new CResult_NoneNoneZ which has the same data as `orig`
14291 * but with all dynamically-allocated buffers duplicated in new buffers.
14293 struct LDKCResult_NoneNoneZ CResult_NoneNoneZ_clone(const struct LDKCResult_NoneNoneZ *NONNULL_PTR orig);
14296 * Creates a new CResult_CounterpartyCommitmentSecretsDecodeErrorZ in the success state.
14298 struct LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ CResult_CounterpartyCommitmentSecretsDecodeErrorZ_ok(struct LDKCounterpartyCommitmentSecrets o);
14301 * Creates a new CResult_CounterpartyCommitmentSecretsDecodeErrorZ in the error state.
14303 struct LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ CResult_CounterpartyCommitmentSecretsDecodeErrorZ_err(struct LDKDecodeError e);
14306 * Checks if the given object is currently in the success state
14308 bool CResult_CounterpartyCommitmentSecretsDecodeErrorZ_is_ok(const struct LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ *NONNULL_PTR o);
14311 * Frees any resources used by the CResult_CounterpartyCommitmentSecretsDecodeErrorZ.
14313 void CResult_CounterpartyCommitmentSecretsDecodeErrorZ_free(struct LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ _res);
14316 * Creates a new CResult_CounterpartyCommitmentSecretsDecodeErrorZ which has the same data as `orig`
14317 * but with all dynamically-allocated buffers duplicated in new buffers.
14319 struct LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ CResult_CounterpartyCommitmentSecretsDecodeErrorZ_clone(const struct LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ *NONNULL_PTR orig);
14322 * Creates a new CResult_SecretKeyErrorZ in the success state.
14324 struct LDKCResult_SecretKeyErrorZ CResult_SecretKeyErrorZ_ok(struct LDKSecretKey o);
14327 * Creates a new CResult_SecretKeyErrorZ in the error state.
14329 struct LDKCResult_SecretKeyErrorZ CResult_SecretKeyErrorZ_err(enum LDKSecp256k1Error e);
14332 * Checks if the given object is currently in the success state
14334 bool CResult_SecretKeyErrorZ_is_ok(const struct LDKCResult_SecretKeyErrorZ *NONNULL_PTR o);
14337 * Frees any resources used by the CResult_SecretKeyErrorZ.
14339 void CResult_SecretKeyErrorZ_free(struct LDKCResult_SecretKeyErrorZ _res);
14342 * Creates a new CResult_SecretKeyErrorZ which has the same data as `orig`
14343 * but with all dynamically-allocated buffers duplicated in new buffers.
14345 struct LDKCResult_SecretKeyErrorZ CResult_SecretKeyErrorZ_clone(const struct LDKCResult_SecretKeyErrorZ *NONNULL_PTR orig);
14348 * Creates a new CResult_PublicKeyErrorZ in the success state.
14350 struct LDKCResult_PublicKeyErrorZ CResult_PublicKeyErrorZ_ok(struct LDKPublicKey o);
14353 * Creates a new CResult_PublicKeyErrorZ in the error state.
14355 struct LDKCResult_PublicKeyErrorZ CResult_PublicKeyErrorZ_err(enum LDKSecp256k1Error e);
14358 * Checks if the given object is currently in the success state
14360 bool CResult_PublicKeyErrorZ_is_ok(const struct LDKCResult_PublicKeyErrorZ *NONNULL_PTR o);
14363 * Frees any resources used by the CResult_PublicKeyErrorZ.
14365 void CResult_PublicKeyErrorZ_free(struct LDKCResult_PublicKeyErrorZ _res);
14368 * Creates a new CResult_PublicKeyErrorZ which has the same data as `orig`
14369 * but with all dynamically-allocated buffers duplicated in new buffers.
14371 struct LDKCResult_PublicKeyErrorZ CResult_PublicKeyErrorZ_clone(const struct LDKCResult_PublicKeyErrorZ *NONNULL_PTR orig);
14374 * Creates a new CResult_TxCreationKeysDecodeErrorZ in the success state.
14376 struct LDKCResult_TxCreationKeysDecodeErrorZ CResult_TxCreationKeysDecodeErrorZ_ok(struct LDKTxCreationKeys o);
14379 * Creates a new CResult_TxCreationKeysDecodeErrorZ in the error state.
14381 struct LDKCResult_TxCreationKeysDecodeErrorZ CResult_TxCreationKeysDecodeErrorZ_err(struct LDKDecodeError e);
14384 * Checks if the given object is currently in the success state
14386 bool CResult_TxCreationKeysDecodeErrorZ_is_ok(const struct LDKCResult_TxCreationKeysDecodeErrorZ *NONNULL_PTR o);
14389 * Frees any resources used by the CResult_TxCreationKeysDecodeErrorZ.
14391 void CResult_TxCreationKeysDecodeErrorZ_free(struct LDKCResult_TxCreationKeysDecodeErrorZ _res);
14394 * Creates a new CResult_TxCreationKeysDecodeErrorZ which has the same data as `orig`
14395 * but with all dynamically-allocated buffers duplicated in new buffers.
14397 struct LDKCResult_TxCreationKeysDecodeErrorZ CResult_TxCreationKeysDecodeErrorZ_clone(const struct LDKCResult_TxCreationKeysDecodeErrorZ *NONNULL_PTR orig);
14400 * Creates a new CResult_ChannelPublicKeysDecodeErrorZ in the success state.
14402 struct LDKCResult_ChannelPublicKeysDecodeErrorZ CResult_ChannelPublicKeysDecodeErrorZ_ok(struct LDKChannelPublicKeys o);
14405 * Creates a new CResult_ChannelPublicKeysDecodeErrorZ in the error state.
14407 struct LDKCResult_ChannelPublicKeysDecodeErrorZ CResult_ChannelPublicKeysDecodeErrorZ_err(struct LDKDecodeError e);
14410 * Checks if the given object is currently in the success state
14412 bool CResult_ChannelPublicKeysDecodeErrorZ_is_ok(const struct LDKCResult_ChannelPublicKeysDecodeErrorZ *NONNULL_PTR o);
14415 * Frees any resources used by the CResult_ChannelPublicKeysDecodeErrorZ.
14417 void CResult_ChannelPublicKeysDecodeErrorZ_free(struct LDKCResult_ChannelPublicKeysDecodeErrorZ _res);
14420 * Creates a new CResult_ChannelPublicKeysDecodeErrorZ which has the same data as `orig`
14421 * but with all dynamically-allocated buffers duplicated in new buffers.
14423 struct LDKCResult_ChannelPublicKeysDecodeErrorZ CResult_ChannelPublicKeysDecodeErrorZ_clone(const struct LDKCResult_ChannelPublicKeysDecodeErrorZ *NONNULL_PTR orig);
14426 * Creates a new CResult_TxCreationKeysErrorZ in the success state.
14428 struct LDKCResult_TxCreationKeysErrorZ CResult_TxCreationKeysErrorZ_ok(struct LDKTxCreationKeys o);
14431 * Creates a new CResult_TxCreationKeysErrorZ in the error state.
14433 struct LDKCResult_TxCreationKeysErrorZ CResult_TxCreationKeysErrorZ_err(enum LDKSecp256k1Error e);
14436 * Checks if the given object is currently in the success state
14438 bool CResult_TxCreationKeysErrorZ_is_ok(const struct LDKCResult_TxCreationKeysErrorZ *NONNULL_PTR o);
14441 * Frees any resources used by the CResult_TxCreationKeysErrorZ.
14443 void CResult_TxCreationKeysErrorZ_free(struct LDKCResult_TxCreationKeysErrorZ _res);
14446 * Creates a new CResult_TxCreationKeysErrorZ which has the same data as `orig`
14447 * but with all dynamically-allocated buffers duplicated in new buffers.
14449 struct LDKCResult_TxCreationKeysErrorZ CResult_TxCreationKeysErrorZ_clone(const struct LDKCResult_TxCreationKeysErrorZ *NONNULL_PTR orig);
14452 * Constructs a new COption_u32Z containing a u32
14454 struct LDKCOption_u32Z COption_u32Z_some(uint32_t o);
14457 * Constructs a new COption_u32Z containing nothing
14459 struct LDKCOption_u32Z COption_u32Z_none(void);
14462 * Frees any resources associated with the u32, if we are in the Some state
14464 void COption_u32Z_free(struct LDKCOption_u32Z _res);
14467 * Creates a new COption_u32Z which has the same data as `orig`
14468 * but with all dynamically-allocated buffers duplicated in new buffers.
14470 struct LDKCOption_u32Z COption_u32Z_clone(const struct LDKCOption_u32Z *NONNULL_PTR orig);
14473 * Creates a new CResult_HTLCOutputInCommitmentDecodeErrorZ in the success state.
14475 struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ CResult_HTLCOutputInCommitmentDecodeErrorZ_ok(struct LDKHTLCOutputInCommitment o);
14478 * Creates a new CResult_HTLCOutputInCommitmentDecodeErrorZ in the error state.
14480 struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ CResult_HTLCOutputInCommitmentDecodeErrorZ_err(struct LDKDecodeError e);
14483 * Checks if the given object is currently in the success state
14485 bool CResult_HTLCOutputInCommitmentDecodeErrorZ_is_ok(const struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ *NONNULL_PTR o);
14488 * Frees any resources used by the CResult_HTLCOutputInCommitmentDecodeErrorZ.
14490 void CResult_HTLCOutputInCommitmentDecodeErrorZ_free(struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ _res);
14493 * Creates a new CResult_HTLCOutputInCommitmentDecodeErrorZ which has the same data as `orig`
14494 * but with all dynamically-allocated buffers duplicated in new buffers.
14496 struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ CResult_HTLCOutputInCommitmentDecodeErrorZ_clone(const struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ *NONNULL_PTR orig);
14499 * Constructs a new COption_NoneZ containing a
14501 enum LDKCOption_NoneZ COption_NoneZ_some(void);
14504 * Constructs a new COption_NoneZ containing nothing
14506 enum LDKCOption_NoneZ COption_NoneZ_none(void);
14509 * Frees any resources associated with the , if we are in the Some state
14511 void COption_NoneZ_free(enum LDKCOption_NoneZ _res);
14514 * Creates a new CResult_CounterpartyChannelTransactionParametersDecodeErrorZ in the success state.
14516 struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_ok(struct LDKCounterpartyChannelTransactionParameters o);
14519 * Creates a new CResult_CounterpartyChannelTransactionParametersDecodeErrorZ in the error state.
14521 struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_err(struct LDKDecodeError e);
14524 * Checks if the given object is currently in the success state
14526 bool CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_is_ok(const struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ *NONNULL_PTR o);
14529 * Frees any resources used by the CResult_CounterpartyChannelTransactionParametersDecodeErrorZ.
14531 void CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_free(struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ _res);
14534 * Creates a new CResult_CounterpartyChannelTransactionParametersDecodeErrorZ which has the same data as `orig`
14535 * but with all dynamically-allocated buffers duplicated in new buffers.
14537 struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_clone(const struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ *NONNULL_PTR orig);
14540 * Creates a new CResult_ChannelTransactionParametersDecodeErrorZ in the success state.
14542 struct LDKCResult_ChannelTransactionParametersDecodeErrorZ CResult_ChannelTransactionParametersDecodeErrorZ_ok(struct LDKChannelTransactionParameters o);
14545 * Creates a new CResult_ChannelTransactionParametersDecodeErrorZ in the error state.
14547 struct LDKCResult_ChannelTransactionParametersDecodeErrorZ CResult_ChannelTransactionParametersDecodeErrorZ_err(struct LDKDecodeError e);
14550 * Checks if the given object is currently in the success state
14552 bool CResult_ChannelTransactionParametersDecodeErrorZ_is_ok(const struct LDKCResult_ChannelTransactionParametersDecodeErrorZ *NONNULL_PTR o);
14555 * Frees any resources used by the CResult_ChannelTransactionParametersDecodeErrorZ.
14557 void CResult_ChannelTransactionParametersDecodeErrorZ_free(struct LDKCResult_ChannelTransactionParametersDecodeErrorZ _res);
14560 * Creates a new CResult_ChannelTransactionParametersDecodeErrorZ which has the same data as `orig`
14561 * but with all dynamically-allocated buffers duplicated in new buffers.
14563 struct LDKCResult_ChannelTransactionParametersDecodeErrorZ CResult_ChannelTransactionParametersDecodeErrorZ_clone(const struct LDKCResult_ChannelTransactionParametersDecodeErrorZ *NONNULL_PTR orig);
14566 * Frees the buffer pointed to by `data` if `datalen` is non-0.
14568 void CVec_SignatureZ_free(struct LDKCVec_SignatureZ _res);
14571 * Creates a new CResult_HolderCommitmentTransactionDecodeErrorZ in the success state.
14573 struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ CResult_HolderCommitmentTransactionDecodeErrorZ_ok(struct LDKHolderCommitmentTransaction o);
14576 * Creates a new CResult_HolderCommitmentTransactionDecodeErrorZ in the error state.
14578 struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ CResult_HolderCommitmentTransactionDecodeErrorZ_err(struct LDKDecodeError e);
14581 * Checks if the given object is currently in the success state
14583 bool CResult_HolderCommitmentTransactionDecodeErrorZ_is_ok(const struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ *NONNULL_PTR o);
14586 * Frees any resources used by the CResult_HolderCommitmentTransactionDecodeErrorZ.
14588 void CResult_HolderCommitmentTransactionDecodeErrorZ_free(struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ _res);
14591 * Creates a new CResult_HolderCommitmentTransactionDecodeErrorZ which has the same data as `orig`
14592 * but with all dynamically-allocated buffers duplicated in new buffers.
14594 struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ CResult_HolderCommitmentTransactionDecodeErrorZ_clone(const struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ *NONNULL_PTR orig);
14597 * Creates a new CResult_BuiltCommitmentTransactionDecodeErrorZ in the success state.
14599 struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ CResult_BuiltCommitmentTransactionDecodeErrorZ_ok(struct LDKBuiltCommitmentTransaction o);
14602 * Creates a new CResult_BuiltCommitmentTransactionDecodeErrorZ in the error state.
14604 struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ CResult_BuiltCommitmentTransactionDecodeErrorZ_err(struct LDKDecodeError e);
14607 * Checks if the given object is currently in the success state
14609 bool CResult_BuiltCommitmentTransactionDecodeErrorZ_is_ok(const struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ *NONNULL_PTR o);
14612 * Frees any resources used by the CResult_BuiltCommitmentTransactionDecodeErrorZ.
14614 void CResult_BuiltCommitmentTransactionDecodeErrorZ_free(struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ _res);
14617 * Creates a new CResult_BuiltCommitmentTransactionDecodeErrorZ which has the same data as `orig`
14618 * but with all dynamically-allocated buffers duplicated in new buffers.
14620 struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ CResult_BuiltCommitmentTransactionDecodeErrorZ_clone(const struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ *NONNULL_PTR orig);
14623 * Creates a new CResult_TrustedClosingTransactionNoneZ in the success state.
14625 struct LDKCResult_TrustedClosingTransactionNoneZ CResult_TrustedClosingTransactionNoneZ_ok(struct LDKTrustedClosingTransaction o);
14628 * Creates a new CResult_TrustedClosingTransactionNoneZ in the error state.
14630 struct LDKCResult_TrustedClosingTransactionNoneZ CResult_TrustedClosingTransactionNoneZ_err(void);
14633 * Checks if the given object is currently in the success state
14635 bool CResult_TrustedClosingTransactionNoneZ_is_ok(const struct LDKCResult_TrustedClosingTransactionNoneZ *NONNULL_PTR o);
14638 * Frees any resources used by the CResult_TrustedClosingTransactionNoneZ.
14640 void CResult_TrustedClosingTransactionNoneZ_free(struct LDKCResult_TrustedClosingTransactionNoneZ _res);
14643 * Creates a new CResult_CommitmentTransactionDecodeErrorZ in the success state.
14645 struct LDKCResult_CommitmentTransactionDecodeErrorZ CResult_CommitmentTransactionDecodeErrorZ_ok(struct LDKCommitmentTransaction o);
14648 * Creates a new CResult_CommitmentTransactionDecodeErrorZ in the error state.
14650 struct LDKCResult_CommitmentTransactionDecodeErrorZ CResult_CommitmentTransactionDecodeErrorZ_err(struct LDKDecodeError e);
14653 * Checks if the given object is currently in the success state
14655 bool CResult_CommitmentTransactionDecodeErrorZ_is_ok(const struct LDKCResult_CommitmentTransactionDecodeErrorZ *NONNULL_PTR o);
14658 * Frees any resources used by the CResult_CommitmentTransactionDecodeErrorZ.
14660 void CResult_CommitmentTransactionDecodeErrorZ_free(struct LDKCResult_CommitmentTransactionDecodeErrorZ _res);
14663 * Creates a new CResult_CommitmentTransactionDecodeErrorZ which has the same data as `orig`
14664 * but with all dynamically-allocated buffers duplicated in new buffers.
14666 struct LDKCResult_CommitmentTransactionDecodeErrorZ CResult_CommitmentTransactionDecodeErrorZ_clone(const struct LDKCResult_CommitmentTransactionDecodeErrorZ *NONNULL_PTR orig);
14669 * Creates a new CResult_TrustedCommitmentTransactionNoneZ in the success state.
14671 struct LDKCResult_TrustedCommitmentTransactionNoneZ CResult_TrustedCommitmentTransactionNoneZ_ok(struct LDKTrustedCommitmentTransaction o);
14674 * Creates a new CResult_TrustedCommitmentTransactionNoneZ in the error state.
14676 struct LDKCResult_TrustedCommitmentTransactionNoneZ CResult_TrustedCommitmentTransactionNoneZ_err(void);
14679 * Checks if the given object is currently in the success state
14681 bool CResult_TrustedCommitmentTransactionNoneZ_is_ok(const struct LDKCResult_TrustedCommitmentTransactionNoneZ *NONNULL_PTR o);
14684 * Frees any resources used by the CResult_TrustedCommitmentTransactionNoneZ.
14686 void CResult_TrustedCommitmentTransactionNoneZ_free(struct LDKCResult_TrustedCommitmentTransactionNoneZ _res);
14689 * Creates a new CResult_CVec_SignatureZNoneZ in the success state.
14691 struct LDKCResult_CVec_SignatureZNoneZ CResult_CVec_SignatureZNoneZ_ok(struct LDKCVec_SignatureZ o);
14694 * Creates a new CResult_CVec_SignatureZNoneZ in the error state.
14696 struct LDKCResult_CVec_SignatureZNoneZ CResult_CVec_SignatureZNoneZ_err(void);
14699 * Checks if the given object is currently in the success state
14701 bool CResult_CVec_SignatureZNoneZ_is_ok(const struct LDKCResult_CVec_SignatureZNoneZ *NONNULL_PTR o);
14704 * Frees any resources used by the CResult_CVec_SignatureZNoneZ.
14706 void CResult_CVec_SignatureZNoneZ_free(struct LDKCResult_CVec_SignatureZNoneZ _res);
14709 * Creates a new CResult_CVec_SignatureZNoneZ which has the same data as `orig`
14710 * but with all dynamically-allocated buffers duplicated in new buffers.
14712 struct LDKCResult_CVec_SignatureZNoneZ CResult_CVec_SignatureZNoneZ_clone(const struct LDKCResult_CVec_SignatureZNoneZ *NONNULL_PTR orig);
14715 * Creates a new CResult_ShutdownScriptDecodeErrorZ in the success state.
14717 struct LDKCResult_ShutdownScriptDecodeErrorZ CResult_ShutdownScriptDecodeErrorZ_ok(struct LDKShutdownScript o);
14720 * Creates a new CResult_ShutdownScriptDecodeErrorZ in the error state.
14722 struct LDKCResult_ShutdownScriptDecodeErrorZ CResult_ShutdownScriptDecodeErrorZ_err(struct LDKDecodeError e);
14725 * Checks if the given object is currently in the success state
14727 bool CResult_ShutdownScriptDecodeErrorZ_is_ok(const struct LDKCResult_ShutdownScriptDecodeErrorZ *NONNULL_PTR o);
14730 * Frees any resources used by the CResult_ShutdownScriptDecodeErrorZ.
14732 void CResult_ShutdownScriptDecodeErrorZ_free(struct LDKCResult_ShutdownScriptDecodeErrorZ _res);
14735 * Creates a new CResult_ShutdownScriptDecodeErrorZ which has the same data as `orig`
14736 * but with all dynamically-allocated buffers duplicated in new buffers.
14738 struct LDKCResult_ShutdownScriptDecodeErrorZ CResult_ShutdownScriptDecodeErrorZ_clone(const struct LDKCResult_ShutdownScriptDecodeErrorZ *NONNULL_PTR orig);
14741 * Creates a new CResult_ShutdownScriptInvalidShutdownScriptZ in the success state.
14743 struct LDKCResult_ShutdownScriptInvalidShutdownScriptZ CResult_ShutdownScriptInvalidShutdownScriptZ_ok(struct LDKShutdownScript o);
14746 * Creates a new CResult_ShutdownScriptInvalidShutdownScriptZ in the error state.
14748 struct LDKCResult_ShutdownScriptInvalidShutdownScriptZ CResult_ShutdownScriptInvalidShutdownScriptZ_err(struct LDKInvalidShutdownScript e);
14751 * Checks if the given object is currently in the success state
14753 bool CResult_ShutdownScriptInvalidShutdownScriptZ_is_ok(const struct LDKCResult_ShutdownScriptInvalidShutdownScriptZ *NONNULL_PTR o);
14756 * Frees any resources used by the CResult_ShutdownScriptInvalidShutdownScriptZ.
14758 void CResult_ShutdownScriptInvalidShutdownScriptZ_free(struct LDKCResult_ShutdownScriptInvalidShutdownScriptZ _res);
14761 * Creates a new CResult_ShutdownScriptInvalidShutdownScriptZ which has the same data as `orig`
14762 * but with all dynamically-allocated buffers duplicated in new buffers.
14764 struct LDKCResult_ShutdownScriptInvalidShutdownScriptZ CResult_ShutdownScriptInvalidShutdownScriptZ_clone(const struct LDKCResult_ShutdownScriptInvalidShutdownScriptZ *NONNULL_PTR orig);
14767 * Constructs a new COption_WriteableScoreZ containing a crate::lightning::routing::scoring::WriteableScore
14769 struct LDKCOption_WriteableScoreZ COption_WriteableScoreZ_some(struct LDKWriteableScore o);
14772 * Constructs a new COption_WriteableScoreZ containing nothing
14774 struct LDKCOption_WriteableScoreZ COption_WriteableScoreZ_none(void);
14777 * Frees any resources associated with the crate::lightning::routing::scoring::WriteableScore, if we are in the Some state
14779 void COption_WriteableScoreZ_free(struct LDKCOption_WriteableScoreZ _res);
14782 * Creates a new CResult_NoneErrorZ in the success state.
14784 struct LDKCResult_NoneErrorZ CResult_NoneErrorZ_ok(void);
14787 * Creates a new CResult_NoneErrorZ in the error state.
14789 struct LDKCResult_NoneErrorZ CResult_NoneErrorZ_err(enum LDKIOError e);
14792 * Checks if the given object is currently in the success state
14794 bool CResult_NoneErrorZ_is_ok(const struct LDKCResult_NoneErrorZ *NONNULL_PTR o);
14797 * Frees any resources used by the CResult_NoneErrorZ.
14799 void CResult_NoneErrorZ_free(struct LDKCResult_NoneErrorZ _res);
14802 * Creates a new CResult_NoneErrorZ which has the same data as `orig`
14803 * but with all dynamically-allocated buffers duplicated in new buffers.
14805 struct LDKCResult_NoneErrorZ CResult_NoneErrorZ_clone(const struct LDKCResult_NoneErrorZ *NONNULL_PTR orig);
14808 * Creates a new CResult_RouteHopDecodeErrorZ in the success state.
14810 struct LDKCResult_RouteHopDecodeErrorZ CResult_RouteHopDecodeErrorZ_ok(struct LDKRouteHop o);
14813 * Creates a new CResult_RouteHopDecodeErrorZ in the error state.
14815 struct LDKCResult_RouteHopDecodeErrorZ CResult_RouteHopDecodeErrorZ_err(struct LDKDecodeError e);
14818 * Checks if the given object is currently in the success state
14820 bool CResult_RouteHopDecodeErrorZ_is_ok(const struct LDKCResult_RouteHopDecodeErrorZ *NONNULL_PTR o);
14823 * Frees any resources used by the CResult_RouteHopDecodeErrorZ.
14825 void CResult_RouteHopDecodeErrorZ_free(struct LDKCResult_RouteHopDecodeErrorZ _res);
14828 * Creates a new CResult_RouteHopDecodeErrorZ which has the same data as `orig`
14829 * but with all dynamically-allocated buffers duplicated in new buffers.
14831 struct LDKCResult_RouteHopDecodeErrorZ CResult_RouteHopDecodeErrorZ_clone(const struct LDKCResult_RouteHopDecodeErrorZ *NONNULL_PTR orig);
14834 * Frees the buffer pointed to by `data` if `datalen` is non-0.
14836 void CVec_RouteHopZ_free(struct LDKCVec_RouteHopZ _res);
14839 * Frees the buffer pointed to by `data` if `datalen` is non-0.
14841 void CVec_CVec_RouteHopZZ_free(struct LDKCVec_CVec_RouteHopZZ _res);
14844 * Creates a new CResult_RouteDecodeErrorZ in the success state.
14846 struct LDKCResult_RouteDecodeErrorZ CResult_RouteDecodeErrorZ_ok(struct LDKRoute o);
14849 * Creates a new CResult_RouteDecodeErrorZ in the error state.
14851 struct LDKCResult_RouteDecodeErrorZ CResult_RouteDecodeErrorZ_err(struct LDKDecodeError e);
14854 * Checks if the given object is currently in the success state
14856 bool CResult_RouteDecodeErrorZ_is_ok(const struct LDKCResult_RouteDecodeErrorZ *NONNULL_PTR o);
14859 * Frees any resources used by the CResult_RouteDecodeErrorZ.
14861 void CResult_RouteDecodeErrorZ_free(struct LDKCResult_RouteDecodeErrorZ _res);
14864 * Creates a new CResult_RouteDecodeErrorZ which has the same data as `orig`
14865 * but with all dynamically-allocated buffers duplicated in new buffers.
14867 struct LDKCResult_RouteDecodeErrorZ CResult_RouteDecodeErrorZ_clone(const struct LDKCResult_RouteDecodeErrorZ *NONNULL_PTR orig);
14870 * Creates a new CResult_RouteParametersDecodeErrorZ in the success state.
14872 struct LDKCResult_RouteParametersDecodeErrorZ CResult_RouteParametersDecodeErrorZ_ok(struct LDKRouteParameters o);
14875 * Creates a new CResult_RouteParametersDecodeErrorZ in the error state.
14877 struct LDKCResult_RouteParametersDecodeErrorZ CResult_RouteParametersDecodeErrorZ_err(struct LDKDecodeError e);
14880 * Checks if the given object is currently in the success state
14882 bool CResult_RouteParametersDecodeErrorZ_is_ok(const struct LDKCResult_RouteParametersDecodeErrorZ *NONNULL_PTR o);
14885 * Frees any resources used by the CResult_RouteParametersDecodeErrorZ.
14887 void CResult_RouteParametersDecodeErrorZ_free(struct LDKCResult_RouteParametersDecodeErrorZ _res);
14890 * Creates a new CResult_RouteParametersDecodeErrorZ which has the same data as `orig`
14891 * but with all dynamically-allocated buffers duplicated in new buffers.
14893 struct LDKCResult_RouteParametersDecodeErrorZ CResult_RouteParametersDecodeErrorZ_clone(const struct LDKCResult_RouteParametersDecodeErrorZ *NONNULL_PTR orig);
14896 * Frees the buffer pointed to by `data` if `datalen` is non-0.
14898 void CVec_RouteHintZ_free(struct LDKCVec_RouteHintZ _res);
14901 * Constructs a new COption_u64Z containing a u64
14903 struct LDKCOption_u64Z COption_u64Z_some(uint64_t o);
14906 * Constructs a new COption_u64Z containing nothing
14908 struct LDKCOption_u64Z COption_u64Z_none(void);
14911 * Frees any resources associated with the u64, if we are in the Some state
14913 void COption_u64Z_free(struct LDKCOption_u64Z _res);
14916 * Creates a new COption_u64Z which has the same data as `orig`
14917 * but with all dynamically-allocated buffers duplicated in new buffers.
14919 struct LDKCOption_u64Z COption_u64Z_clone(const struct LDKCOption_u64Z *NONNULL_PTR orig);
14922 * Frees the buffer pointed to by `data` if `datalen` is non-0.
14924 void CVec_u64Z_free(struct LDKCVec_u64Z _res);
14927 * Creates a new CResult_PaymentParametersDecodeErrorZ in the success state.
14929 struct LDKCResult_PaymentParametersDecodeErrorZ CResult_PaymentParametersDecodeErrorZ_ok(struct LDKPaymentParameters o);
14932 * Creates a new CResult_PaymentParametersDecodeErrorZ in the error state.
14934 struct LDKCResult_PaymentParametersDecodeErrorZ CResult_PaymentParametersDecodeErrorZ_err(struct LDKDecodeError e);
14937 * Checks if the given object is currently in the success state
14939 bool CResult_PaymentParametersDecodeErrorZ_is_ok(const struct LDKCResult_PaymentParametersDecodeErrorZ *NONNULL_PTR o);
14942 * Frees any resources used by the CResult_PaymentParametersDecodeErrorZ.
14944 void CResult_PaymentParametersDecodeErrorZ_free(struct LDKCResult_PaymentParametersDecodeErrorZ _res);
14947 * Creates a new CResult_PaymentParametersDecodeErrorZ which has the same data as `orig`
14948 * but with all dynamically-allocated buffers duplicated in new buffers.
14950 struct LDKCResult_PaymentParametersDecodeErrorZ CResult_PaymentParametersDecodeErrorZ_clone(const struct LDKCResult_PaymentParametersDecodeErrorZ *NONNULL_PTR orig);
14953 * Frees the buffer pointed to by `data` if `datalen` is non-0.
14955 void CVec_RouteHintHopZ_free(struct LDKCVec_RouteHintHopZ _res);
14958 * Creates a new CResult_RouteHintDecodeErrorZ in the success state.
14960 struct LDKCResult_RouteHintDecodeErrorZ CResult_RouteHintDecodeErrorZ_ok(struct LDKRouteHint o);
14963 * Creates a new CResult_RouteHintDecodeErrorZ in the error state.
14965 struct LDKCResult_RouteHintDecodeErrorZ CResult_RouteHintDecodeErrorZ_err(struct LDKDecodeError e);
14968 * Checks if the given object is currently in the success state
14970 bool CResult_RouteHintDecodeErrorZ_is_ok(const struct LDKCResult_RouteHintDecodeErrorZ *NONNULL_PTR o);
14973 * Frees any resources used by the CResult_RouteHintDecodeErrorZ.
14975 void CResult_RouteHintDecodeErrorZ_free(struct LDKCResult_RouteHintDecodeErrorZ _res);
14978 * Creates a new CResult_RouteHintDecodeErrorZ which has the same data as `orig`
14979 * but with all dynamically-allocated buffers duplicated in new buffers.
14981 struct LDKCResult_RouteHintDecodeErrorZ CResult_RouteHintDecodeErrorZ_clone(const struct LDKCResult_RouteHintDecodeErrorZ *NONNULL_PTR orig);
14984 * Creates a new CResult_RouteHintHopDecodeErrorZ in the success state.
14986 struct LDKCResult_RouteHintHopDecodeErrorZ CResult_RouteHintHopDecodeErrorZ_ok(struct LDKRouteHintHop o);
14989 * Creates a new CResult_RouteHintHopDecodeErrorZ in the error state.
14991 struct LDKCResult_RouteHintHopDecodeErrorZ CResult_RouteHintHopDecodeErrorZ_err(struct LDKDecodeError e);
14994 * Checks if the given object is currently in the success state
14996 bool CResult_RouteHintHopDecodeErrorZ_is_ok(const struct LDKCResult_RouteHintHopDecodeErrorZ *NONNULL_PTR o);
14999 * Frees any resources used by the CResult_RouteHintHopDecodeErrorZ.
15001 void CResult_RouteHintHopDecodeErrorZ_free(struct LDKCResult_RouteHintHopDecodeErrorZ _res);
15004 * Creates a new CResult_RouteHintHopDecodeErrorZ which has the same data as `orig`
15005 * but with all dynamically-allocated buffers duplicated in new buffers.
15007 struct LDKCResult_RouteHintHopDecodeErrorZ CResult_RouteHintHopDecodeErrorZ_clone(const struct LDKCResult_RouteHintHopDecodeErrorZ *NONNULL_PTR orig);
15010 * Frees the buffer pointed to by `data` if `datalen` is non-0.
15012 void CVec_ChannelDetailsZ_free(struct LDKCVec_ChannelDetailsZ _res);
15015 * Creates a new CResult_RouteLightningErrorZ in the success state.
15017 struct LDKCResult_RouteLightningErrorZ CResult_RouteLightningErrorZ_ok(struct LDKRoute o);
15020 * Creates a new CResult_RouteLightningErrorZ in the error state.
15022 struct LDKCResult_RouteLightningErrorZ CResult_RouteLightningErrorZ_err(struct LDKLightningError e);
15025 * Checks if the given object is currently in the success state
15027 bool CResult_RouteLightningErrorZ_is_ok(const struct LDKCResult_RouteLightningErrorZ *NONNULL_PTR o);
15030 * Frees any resources used by the CResult_RouteLightningErrorZ.
15032 void CResult_RouteLightningErrorZ_free(struct LDKCResult_RouteLightningErrorZ _res);
15035 * Creates a new CResult_RouteLightningErrorZ which has the same data as `orig`
15036 * but with all dynamically-allocated buffers duplicated in new buffers.
15038 struct LDKCResult_RouteLightningErrorZ CResult_RouteLightningErrorZ_clone(const struct LDKCResult_RouteLightningErrorZ *NONNULL_PTR orig);
15041 * Creates a new CResult_PaymentPurposeDecodeErrorZ in the success state.
15043 struct LDKCResult_PaymentPurposeDecodeErrorZ CResult_PaymentPurposeDecodeErrorZ_ok(struct LDKPaymentPurpose o);
15046 * Creates a new CResult_PaymentPurposeDecodeErrorZ in the error state.
15048 struct LDKCResult_PaymentPurposeDecodeErrorZ CResult_PaymentPurposeDecodeErrorZ_err(struct LDKDecodeError e);
15051 * Checks if the given object is currently in the success state
15053 bool CResult_PaymentPurposeDecodeErrorZ_is_ok(const struct LDKCResult_PaymentPurposeDecodeErrorZ *NONNULL_PTR o);
15056 * Frees any resources used by the CResult_PaymentPurposeDecodeErrorZ.
15058 void CResult_PaymentPurposeDecodeErrorZ_free(struct LDKCResult_PaymentPurposeDecodeErrorZ _res);
15061 * Creates a new CResult_PaymentPurposeDecodeErrorZ which has the same data as `orig`
15062 * but with all dynamically-allocated buffers duplicated in new buffers.
15064 struct LDKCResult_PaymentPurposeDecodeErrorZ CResult_PaymentPurposeDecodeErrorZ_clone(const struct LDKCResult_PaymentPurposeDecodeErrorZ *NONNULL_PTR orig);
15067 * Constructs a new COption_ClosureReasonZ containing a crate::lightning::util::events::ClosureReason
15069 struct LDKCOption_ClosureReasonZ COption_ClosureReasonZ_some(struct LDKClosureReason o);
15072 * Constructs a new COption_ClosureReasonZ containing nothing
15074 struct LDKCOption_ClosureReasonZ COption_ClosureReasonZ_none(void);
15077 * Frees any resources associated with the crate::lightning::util::events::ClosureReason, if we are in the Some state
15079 void COption_ClosureReasonZ_free(struct LDKCOption_ClosureReasonZ _res);
15082 * Creates a new COption_ClosureReasonZ which has the same data as `orig`
15083 * but with all dynamically-allocated buffers duplicated in new buffers.
15085 struct LDKCOption_ClosureReasonZ COption_ClosureReasonZ_clone(const struct LDKCOption_ClosureReasonZ *NONNULL_PTR orig);
15088 * Creates a new CResult_COption_ClosureReasonZDecodeErrorZ in the success state.
15090 struct LDKCResult_COption_ClosureReasonZDecodeErrorZ CResult_COption_ClosureReasonZDecodeErrorZ_ok(struct LDKCOption_ClosureReasonZ o);
15093 * Creates a new CResult_COption_ClosureReasonZDecodeErrorZ in the error state.
15095 struct LDKCResult_COption_ClosureReasonZDecodeErrorZ CResult_COption_ClosureReasonZDecodeErrorZ_err(struct LDKDecodeError e);
15098 * Checks if the given object is currently in the success state
15100 bool CResult_COption_ClosureReasonZDecodeErrorZ_is_ok(const struct LDKCResult_COption_ClosureReasonZDecodeErrorZ *NONNULL_PTR o);
15103 * Frees any resources used by the CResult_COption_ClosureReasonZDecodeErrorZ.
15105 void CResult_COption_ClosureReasonZDecodeErrorZ_free(struct LDKCResult_COption_ClosureReasonZDecodeErrorZ _res);
15108 * Creates a new CResult_COption_ClosureReasonZDecodeErrorZ which has the same data as `orig`
15109 * but with all dynamically-allocated buffers duplicated in new buffers.
15111 struct LDKCResult_COption_ClosureReasonZDecodeErrorZ CResult_COption_ClosureReasonZDecodeErrorZ_clone(const struct LDKCResult_COption_ClosureReasonZDecodeErrorZ *NONNULL_PTR orig);
15114 * Constructs a new COption_HTLCDestinationZ containing a crate::lightning::util::events::HTLCDestination
15116 struct LDKCOption_HTLCDestinationZ COption_HTLCDestinationZ_some(struct LDKHTLCDestination o);
15119 * Constructs a new COption_HTLCDestinationZ containing nothing
15121 struct LDKCOption_HTLCDestinationZ COption_HTLCDestinationZ_none(void);
15124 * Frees any resources associated with the crate::lightning::util::events::HTLCDestination, if we are in the Some state
15126 void COption_HTLCDestinationZ_free(struct LDKCOption_HTLCDestinationZ _res);
15129 * Creates a new COption_HTLCDestinationZ which has the same data as `orig`
15130 * but with all dynamically-allocated buffers duplicated in new buffers.
15132 struct LDKCOption_HTLCDestinationZ COption_HTLCDestinationZ_clone(const struct LDKCOption_HTLCDestinationZ *NONNULL_PTR orig);
15135 * Creates a new CResult_COption_HTLCDestinationZDecodeErrorZ in the success state.
15137 struct LDKCResult_COption_HTLCDestinationZDecodeErrorZ CResult_COption_HTLCDestinationZDecodeErrorZ_ok(struct LDKCOption_HTLCDestinationZ o);
15140 * Creates a new CResult_COption_HTLCDestinationZDecodeErrorZ in the error state.
15142 struct LDKCResult_COption_HTLCDestinationZDecodeErrorZ CResult_COption_HTLCDestinationZDecodeErrorZ_err(struct LDKDecodeError e);
15145 * Checks if the given object is currently in the success state
15147 bool CResult_COption_HTLCDestinationZDecodeErrorZ_is_ok(const struct LDKCResult_COption_HTLCDestinationZDecodeErrorZ *NONNULL_PTR o);
15150 * Frees any resources used by the CResult_COption_HTLCDestinationZDecodeErrorZ.
15152 void CResult_COption_HTLCDestinationZDecodeErrorZ_free(struct LDKCResult_COption_HTLCDestinationZDecodeErrorZ _res);
15155 * Creates a new CResult_COption_HTLCDestinationZDecodeErrorZ which has the same data as `orig`
15156 * but with all dynamically-allocated buffers duplicated in new buffers.
15158 struct LDKCResult_COption_HTLCDestinationZDecodeErrorZ CResult_COption_HTLCDestinationZDecodeErrorZ_clone(const struct LDKCResult_COption_HTLCDestinationZDecodeErrorZ *NONNULL_PTR orig);
15161 * Constructs a new COption_NetworkUpdateZ containing a crate::lightning::routing::gossip::NetworkUpdate
15163 struct LDKCOption_NetworkUpdateZ COption_NetworkUpdateZ_some(struct LDKNetworkUpdate o);
15166 * Constructs a new COption_NetworkUpdateZ containing nothing
15168 struct LDKCOption_NetworkUpdateZ COption_NetworkUpdateZ_none(void);
15171 * Frees any resources associated with the crate::lightning::routing::gossip::NetworkUpdate, if we are in the Some state
15173 void COption_NetworkUpdateZ_free(struct LDKCOption_NetworkUpdateZ _res);
15176 * Creates a new COption_NetworkUpdateZ which has the same data as `orig`
15177 * but with all dynamically-allocated buffers duplicated in new buffers.
15179 struct LDKCOption_NetworkUpdateZ COption_NetworkUpdateZ_clone(const struct LDKCOption_NetworkUpdateZ *NONNULL_PTR orig);
15182 * Frees the buffer pointed to by `data` if `datalen` is non-0.
15184 void CVec_SpendableOutputDescriptorZ_free(struct LDKCVec_SpendableOutputDescriptorZ _res);
15187 * Constructs a new COption_EventZ containing a crate::lightning::util::events::Event
15189 struct LDKCOption_EventZ COption_EventZ_some(struct LDKEvent o);
15192 * Constructs a new COption_EventZ containing nothing
15194 struct LDKCOption_EventZ COption_EventZ_none(void);
15197 * Frees any resources associated with the crate::lightning::util::events::Event, if we are in the Some state
15199 void COption_EventZ_free(struct LDKCOption_EventZ _res);
15202 * Creates a new COption_EventZ which has the same data as `orig`
15203 * but with all dynamically-allocated buffers duplicated in new buffers.
15205 struct LDKCOption_EventZ COption_EventZ_clone(const struct LDKCOption_EventZ *NONNULL_PTR orig);
15208 * Creates a new CResult_COption_EventZDecodeErrorZ in the success state.
15210 struct LDKCResult_COption_EventZDecodeErrorZ CResult_COption_EventZDecodeErrorZ_ok(struct LDKCOption_EventZ o);
15213 * Creates a new CResult_COption_EventZDecodeErrorZ in the error state.
15215 struct LDKCResult_COption_EventZDecodeErrorZ CResult_COption_EventZDecodeErrorZ_err(struct LDKDecodeError e);
15218 * Checks if the given object is currently in the success state
15220 bool CResult_COption_EventZDecodeErrorZ_is_ok(const struct LDKCResult_COption_EventZDecodeErrorZ *NONNULL_PTR o);
15223 * Frees any resources used by the CResult_COption_EventZDecodeErrorZ.
15225 void CResult_COption_EventZDecodeErrorZ_free(struct LDKCResult_COption_EventZDecodeErrorZ _res);
15228 * Creates a new CResult_COption_EventZDecodeErrorZ which has the same data as `orig`
15229 * but with all dynamically-allocated buffers duplicated in new buffers.
15231 struct LDKCResult_COption_EventZDecodeErrorZ CResult_COption_EventZDecodeErrorZ_clone(const struct LDKCResult_COption_EventZDecodeErrorZ *NONNULL_PTR orig);
15234 * Frees the buffer pointed to by `data` if `datalen` is non-0.
15236 void CVec_MessageSendEventZ_free(struct LDKCVec_MessageSendEventZ _res);
15239 * Creates a new CResult_TxOutAccessErrorZ in the success state.
15241 struct LDKCResult_TxOutAccessErrorZ CResult_TxOutAccessErrorZ_ok(struct LDKTxOut o);
15244 * Creates a new CResult_TxOutAccessErrorZ in the error state.
15246 struct LDKCResult_TxOutAccessErrorZ CResult_TxOutAccessErrorZ_err(enum LDKAccessError e);
15249 * Checks if the given object is currently in the success state
15251 bool CResult_TxOutAccessErrorZ_is_ok(const struct LDKCResult_TxOutAccessErrorZ *NONNULL_PTR o);
15254 * Frees any resources used by the CResult_TxOutAccessErrorZ.
15256 void CResult_TxOutAccessErrorZ_free(struct LDKCResult_TxOutAccessErrorZ _res);
15259 * Creates a new CResult_TxOutAccessErrorZ which has the same data as `orig`
15260 * but with all dynamically-allocated buffers duplicated in new buffers.
15262 struct LDKCResult_TxOutAccessErrorZ CResult_TxOutAccessErrorZ_clone(const struct LDKCResult_TxOutAccessErrorZ *NONNULL_PTR orig);
15265 * Creates a new tuple which has the same data as `orig`
15266 * but with all dynamically-allocated buffers duplicated in new buffers.
15268 struct LDKC2Tuple_usizeTransactionZ C2Tuple_usizeTransactionZ_clone(const struct LDKC2Tuple_usizeTransactionZ *NONNULL_PTR orig);
15271 * Creates a new C2Tuple_usizeTransactionZ from the contained elements.
15273 struct LDKC2Tuple_usizeTransactionZ C2Tuple_usizeTransactionZ_new(uintptr_t a, struct LDKTransaction b);
15276 * Frees any resources used by the C2Tuple_usizeTransactionZ.
15278 void C2Tuple_usizeTransactionZ_free(struct LDKC2Tuple_usizeTransactionZ _res);
15281 * Frees the buffer pointed to by `data` if `datalen` is non-0.
15283 void CVec_C2Tuple_usizeTransactionZZ_free(struct LDKCVec_C2Tuple_usizeTransactionZZ _res);
15286 * Frees the buffer pointed to by `data` if `datalen` is non-0.
15288 void CVec_TxidZ_free(struct LDKCVec_TxidZ _res);
15291 * Frees the buffer pointed to by `data` if `datalen` is non-0.
15293 void CVec_MonitorEventZ_free(struct LDKCVec_MonitorEventZ _res);
15296 * Creates a new tuple which has the same data as `orig`
15297 * but with all dynamically-allocated buffers duplicated in new buffers.
15299 struct LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_clone(const struct LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ *NONNULL_PTR orig);
15302 * Creates a new C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ from the contained elements.
15304 struct LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_new(struct LDKOutPoint a, struct LDKCVec_MonitorEventZ b, struct LDKPublicKey c);
15307 * Frees any resources used by the C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ.
15309 void C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_free(struct LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ _res);
15312 * Frees the buffer pointed to by `data` if `datalen` is non-0.
15314 void CVec_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZZ_free(struct LDKCVec_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZZ _res);
15317 * Creates a new CResult_FixedPenaltyScorerDecodeErrorZ in the success state.
15319 struct LDKCResult_FixedPenaltyScorerDecodeErrorZ CResult_FixedPenaltyScorerDecodeErrorZ_ok(struct LDKFixedPenaltyScorer o);
15322 * Creates a new CResult_FixedPenaltyScorerDecodeErrorZ in the error state.
15324 struct LDKCResult_FixedPenaltyScorerDecodeErrorZ CResult_FixedPenaltyScorerDecodeErrorZ_err(struct LDKDecodeError e);
15327 * Checks if the given object is currently in the success state
15329 bool CResult_FixedPenaltyScorerDecodeErrorZ_is_ok(const struct LDKCResult_FixedPenaltyScorerDecodeErrorZ *NONNULL_PTR o);
15332 * Frees any resources used by the CResult_FixedPenaltyScorerDecodeErrorZ.
15334 void CResult_FixedPenaltyScorerDecodeErrorZ_free(struct LDKCResult_FixedPenaltyScorerDecodeErrorZ _res);
15337 * Creates a new CResult_FixedPenaltyScorerDecodeErrorZ which has the same data as `orig`
15338 * but with all dynamically-allocated buffers duplicated in new buffers.
15340 struct LDKCResult_FixedPenaltyScorerDecodeErrorZ CResult_FixedPenaltyScorerDecodeErrorZ_clone(const struct LDKCResult_FixedPenaltyScorerDecodeErrorZ *NONNULL_PTR orig);
15343 * Creates a new tuple which has the same data as `orig`
15344 * but with all dynamically-allocated buffers duplicated in new buffers.
15346 struct LDKC2Tuple_u64u64Z C2Tuple_u64u64Z_clone(const struct LDKC2Tuple_u64u64Z *NONNULL_PTR orig);
15349 * Creates a new C2Tuple_u64u64Z from the contained elements.
15351 struct LDKC2Tuple_u64u64Z C2Tuple_u64u64Z_new(uint64_t a, uint64_t b);
15354 * Frees any resources used by the C2Tuple_u64u64Z.
15356 void C2Tuple_u64u64Z_free(struct LDKC2Tuple_u64u64Z _res);
15359 * Constructs a new COption_C2Tuple_u64u64ZZ containing a crate::c_types::derived::C2Tuple_u64u64Z
15361 struct LDKCOption_C2Tuple_u64u64ZZ COption_C2Tuple_u64u64ZZ_some(struct LDKC2Tuple_u64u64Z o);
15364 * Constructs a new COption_C2Tuple_u64u64ZZ containing nothing
15366 struct LDKCOption_C2Tuple_u64u64ZZ COption_C2Tuple_u64u64ZZ_none(void);
15369 * Frees any resources associated with the crate::c_types::derived::C2Tuple_u64u64Z, if we are in the Some state
15371 void COption_C2Tuple_u64u64ZZ_free(struct LDKCOption_C2Tuple_u64u64ZZ _res);
15374 * Creates a new COption_C2Tuple_u64u64ZZ which has the same data as `orig`
15375 * but with all dynamically-allocated buffers duplicated in new buffers.
15377 struct LDKCOption_C2Tuple_u64u64ZZ COption_C2Tuple_u64u64ZZ_clone(const struct LDKCOption_C2Tuple_u64u64ZZ *NONNULL_PTR orig);
15380 * Frees the buffer pointed to by `data` if `datalen` is non-0.
15382 void CVec_NodeIdZ_free(struct LDKCVec_NodeIdZ _res);
15385 * Creates a new CResult_ProbabilisticScorerDecodeErrorZ in the success state.
15387 struct LDKCResult_ProbabilisticScorerDecodeErrorZ CResult_ProbabilisticScorerDecodeErrorZ_ok(struct LDKProbabilisticScorer o);
15390 * Creates a new CResult_ProbabilisticScorerDecodeErrorZ in the error state.
15392 struct LDKCResult_ProbabilisticScorerDecodeErrorZ CResult_ProbabilisticScorerDecodeErrorZ_err(struct LDKDecodeError e);
15395 * Checks if the given object is currently in the success state
15397 bool CResult_ProbabilisticScorerDecodeErrorZ_is_ok(const struct LDKCResult_ProbabilisticScorerDecodeErrorZ *NONNULL_PTR o);
15400 * Frees any resources used by the CResult_ProbabilisticScorerDecodeErrorZ.
15402 void CResult_ProbabilisticScorerDecodeErrorZ_free(struct LDKCResult_ProbabilisticScorerDecodeErrorZ _res);
15405 * Creates a new CResult_InitFeaturesDecodeErrorZ in the success state.
15407 struct LDKCResult_InitFeaturesDecodeErrorZ CResult_InitFeaturesDecodeErrorZ_ok(struct LDKInitFeatures o);
15410 * Creates a new CResult_InitFeaturesDecodeErrorZ in the error state.
15412 struct LDKCResult_InitFeaturesDecodeErrorZ CResult_InitFeaturesDecodeErrorZ_err(struct LDKDecodeError e);
15415 * Checks if the given object is currently in the success state
15417 bool CResult_InitFeaturesDecodeErrorZ_is_ok(const struct LDKCResult_InitFeaturesDecodeErrorZ *NONNULL_PTR o);
15420 * Frees any resources used by the CResult_InitFeaturesDecodeErrorZ.
15422 void CResult_InitFeaturesDecodeErrorZ_free(struct LDKCResult_InitFeaturesDecodeErrorZ _res);
15425 * Creates a new CResult_InitFeaturesDecodeErrorZ which has the same data as `orig`
15426 * but with all dynamically-allocated buffers duplicated in new buffers.
15428 struct LDKCResult_InitFeaturesDecodeErrorZ CResult_InitFeaturesDecodeErrorZ_clone(const struct LDKCResult_InitFeaturesDecodeErrorZ *NONNULL_PTR orig);
15431 * Creates a new CResult_ChannelFeaturesDecodeErrorZ in the success state.
15433 struct LDKCResult_ChannelFeaturesDecodeErrorZ CResult_ChannelFeaturesDecodeErrorZ_ok(struct LDKChannelFeatures o);
15436 * Creates a new CResult_ChannelFeaturesDecodeErrorZ in the error state.
15438 struct LDKCResult_ChannelFeaturesDecodeErrorZ CResult_ChannelFeaturesDecodeErrorZ_err(struct LDKDecodeError e);
15441 * Checks if the given object is currently in the success state
15443 bool CResult_ChannelFeaturesDecodeErrorZ_is_ok(const struct LDKCResult_ChannelFeaturesDecodeErrorZ *NONNULL_PTR o);
15446 * Frees any resources used by the CResult_ChannelFeaturesDecodeErrorZ.
15448 void CResult_ChannelFeaturesDecodeErrorZ_free(struct LDKCResult_ChannelFeaturesDecodeErrorZ _res);
15451 * Creates a new CResult_ChannelFeaturesDecodeErrorZ which has the same data as `orig`
15452 * but with all dynamically-allocated buffers duplicated in new buffers.
15454 struct LDKCResult_ChannelFeaturesDecodeErrorZ CResult_ChannelFeaturesDecodeErrorZ_clone(const struct LDKCResult_ChannelFeaturesDecodeErrorZ *NONNULL_PTR orig);
15457 * Creates a new CResult_NodeFeaturesDecodeErrorZ in the success state.
15459 struct LDKCResult_NodeFeaturesDecodeErrorZ CResult_NodeFeaturesDecodeErrorZ_ok(struct LDKNodeFeatures o);
15462 * Creates a new CResult_NodeFeaturesDecodeErrorZ in the error state.
15464 struct LDKCResult_NodeFeaturesDecodeErrorZ CResult_NodeFeaturesDecodeErrorZ_err(struct LDKDecodeError e);
15467 * Checks if the given object is currently in the success state
15469 bool CResult_NodeFeaturesDecodeErrorZ_is_ok(const struct LDKCResult_NodeFeaturesDecodeErrorZ *NONNULL_PTR o);
15472 * Frees any resources used by the CResult_NodeFeaturesDecodeErrorZ.
15474 void CResult_NodeFeaturesDecodeErrorZ_free(struct LDKCResult_NodeFeaturesDecodeErrorZ _res);
15477 * Creates a new CResult_NodeFeaturesDecodeErrorZ which has the same data as `orig`
15478 * but with all dynamically-allocated buffers duplicated in new buffers.
15480 struct LDKCResult_NodeFeaturesDecodeErrorZ CResult_NodeFeaturesDecodeErrorZ_clone(const struct LDKCResult_NodeFeaturesDecodeErrorZ *NONNULL_PTR orig);
15483 * Creates a new CResult_InvoiceFeaturesDecodeErrorZ in the success state.
15485 struct LDKCResult_InvoiceFeaturesDecodeErrorZ CResult_InvoiceFeaturesDecodeErrorZ_ok(struct LDKInvoiceFeatures o);
15488 * Creates a new CResult_InvoiceFeaturesDecodeErrorZ in the error state.
15490 struct LDKCResult_InvoiceFeaturesDecodeErrorZ CResult_InvoiceFeaturesDecodeErrorZ_err(struct LDKDecodeError e);
15493 * Checks if the given object is currently in the success state
15495 bool CResult_InvoiceFeaturesDecodeErrorZ_is_ok(const struct LDKCResult_InvoiceFeaturesDecodeErrorZ *NONNULL_PTR o);
15498 * Frees any resources used by the CResult_InvoiceFeaturesDecodeErrorZ.
15500 void CResult_InvoiceFeaturesDecodeErrorZ_free(struct LDKCResult_InvoiceFeaturesDecodeErrorZ _res);
15503 * Creates a new CResult_InvoiceFeaturesDecodeErrorZ which has the same data as `orig`
15504 * but with all dynamically-allocated buffers duplicated in new buffers.
15506 struct LDKCResult_InvoiceFeaturesDecodeErrorZ CResult_InvoiceFeaturesDecodeErrorZ_clone(const struct LDKCResult_InvoiceFeaturesDecodeErrorZ *NONNULL_PTR orig);
15509 * Creates a new CResult_ChannelTypeFeaturesDecodeErrorZ in the success state.
15511 struct LDKCResult_ChannelTypeFeaturesDecodeErrorZ CResult_ChannelTypeFeaturesDecodeErrorZ_ok(struct LDKChannelTypeFeatures o);
15514 * Creates a new CResult_ChannelTypeFeaturesDecodeErrorZ in the error state.
15516 struct LDKCResult_ChannelTypeFeaturesDecodeErrorZ CResult_ChannelTypeFeaturesDecodeErrorZ_err(struct LDKDecodeError e);
15519 * Checks if the given object is currently in the success state
15521 bool CResult_ChannelTypeFeaturesDecodeErrorZ_is_ok(const struct LDKCResult_ChannelTypeFeaturesDecodeErrorZ *NONNULL_PTR o);
15524 * Frees any resources used by the CResult_ChannelTypeFeaturesDecodeErrorZ.
15526 void CResult_ChannelTypeFeaturesDecodeErrorZ_free(struct LDKCResult_ChannelTypeFeaturesDecodeErrorZ _res);
15529 * Creates a new CResult_ChannelTypeFeaturesDecodeErrorZ which has the same data as `orig`
15530 * but with all dynamically-allocated buffers duplicated in new buffers.
15532 struct LDKCResult_ChannelTypeFeaturesDecodeErrorZ CResult_ChannelTypeFeaturesDecodeErrorZ_clone(const struct LDKCResult_ChannelTypeFeaturesDecodeErrorZ *NONNULL_PTR orig);
15535 * Creates a new CResult_NodeIdDecodeErrorZ in the success state.
15537 struct LDKCResult_NodeIdDecodeErrorZ CResult_NodeIdDecodeErrorZ_ok(struct LDKNodeId o);
15540 * Creates a new CResult_NodeIdDecodeErrorZ in the error state.
15542 struct LDKCResult_NodeIdDecodeErrorZ CResult_NodeIdDecodeErrorZ_err(struct LDKDecodeError e);
15545 * Checks if the given object is currently in the success state
15547 bool CResult_NodeIdDecodeErrorZ_is_ok(const struct LDKCResult_NodeIdDecodeErrorZ *NONNULL_PTR o);
15550 * Frees any resources used by the CResult_NodeIdDecodeErrorZ.
15552 void CResult_NodeIdDecodeErrorZ_free(struct LDKCResult_NodeIdDecodeErrorZ _res);
15555 * Creates a new CResult_NodeIdDecodeErrorZ which has the same data as `orig`
15556 * but with all dynamically-allocated buffers duplicated in new buffers.
15558 struct LDKCResult_NodeIdDecodeErrorZ CResult_NodeIdDecodeErrorZ_clone(const struct LDKCResult_NodeIdDecodeErrorZ *NONNULL_PTR orig);
15561 * Creates a new CResult_COption_NetworkUpdateZDecodeErrorZ in the success state.
15563 struct LDKCResult_COption_NetworkUpdateZDecodeErrorZ CResult_COption_NetworkUpdateZDecodeErrorZ_ok(struct LDKCOption_NetworkUpdateZ o);
15566 * Creates a new CResult_COption_NetworkUpdateZDecodeErrorZ in the error state.
15568 struct LDKCResult_COption_NetworkUpdateZDecodeErrorZ CResult_COption_NetworkUpdateZDecodeErrorZ_err(struct LDKDecodeError e);
15571 * Checks if the given object is currently in the success state
15573 bool CResult_COption_NetworkUpdateZDecodeErrorZ_is_ok(const struct LDKCResult_COption_NetworkUpdateZDecodeErrorZ *NONNULL_PTR o);
15576 * Frees any resources used by the CResult_COption_NetworkUpdateZDecodeErrorZ.
15578 void CResult_COption_NetworkUpdateZDecodeErrorZ_free(struct LDKCResult_COption_NetworkUpdateZDecodeErrorZ _res);
15581 * Creates a new CResult_COption_NetworkUpdateZDecodeErrorZ which has the same data as `orig`
15582 * but with all dynamically-allocated buffers duplicated in new buffers.
15584 struct LDKCResult_COption_NetworkUpdateZDecodeErrorZ CResult_COption_NetworkUpdateZDecodeErrorZ_clone(const struct LDKCResult_COption_NetworkUpdateZDecodeErrorZ *NONNULL_PTR orig);
15587 * Constructs a new COption_AccessZ containing a crate::lightning::chain::Access
15589 struct LDKCOption_AccessZ COption_AccessZ_some(struct LDKAccess o);
15592 * Constructs a new COption_AccessZ containing nothing
15594 struct LDKCOption_AccessZ COption_AccessZ_none(void);
15597 * Frees any resources associated with the crate::lightning::chain::Access, if we are in the Some state
15599 void COption_AccessZ_free(struct LDKCOption_AccessZ _res);
15602 * Creates a new CResult_boolLightningErrorZ in the success state.
15604 struct LDKCResult_boolLightningErrorZ CResult_boolLightningErrorZ_ok(bool o);
15607 * Creates a new CResult_boolLightningErrorZ in the error state.
15609 struct LDKCResult_boolLightningErrorZ CResult_boolLightningErrorZ_err(struct LDKLightningError e);
15612 * Checks if the given object is currently in the success state
15614 bool CResult_boolLightningErrorZ_is_ok(const struct LDKCResult_boolLightningErrorZ *NONNULL_PTR o);
15617 * Frees any resources used by the CResult_boolLightningErrorZ.
15619 void CResult_boolLightningErrorZ_free(struct LDKCResult_boolLightningErrorZ _res);
15622 * Creates a new CResult_boolLightningErrorZ which has the same data as `orig`
15623 * but with all dynamically-allocated buffers duplicated in new buffers.
15625 struct LDKCResult_boolLightningErrorZ CResult_boolLightningErrorZ_clone(const struct LDKCResult_boolLightningErrorZ *NONNULL_PTR orig);
15628 * Creates a new tuple which has the same data as `orig`
15629 * but with all dynamically-allocated buffers duplicated in new buffers.
15631 struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_clone(const struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ *NONNULL_PTR orig);
15634 * Creates a new C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ from the contained elements.
15636 struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_new(struct LDKChannelAnnouncement a, struct LDKChannelUpdate b, struct LDKChannelUpdate c);
15639 * Frees any resources used by the C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ.
15641 void C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_free(struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ _res);
15644 * Constructs a new COption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ containing a crate::c_types::derived::C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ
15646 struct LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ COption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_some(struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ o);
15649 * Constructs a new COption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ containing nothing
15651 struct LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ COption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_none(void);
15654 * Frees any resources associated with the crate::c_types::derived::C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ, if we are in the Some state
15656 void COption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_free(struct LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ _res);
15659 * Creates a new COption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ which has the same data as `orig`
15660 * but with all dynamically-allocated buffers duplicated in new buffers.
15662 struct LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ COption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_clone(const struct LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ *NONNULL_PTR orig);
15665 * Creates a new CResult_NoneLightningErrorZ in the success state.
15667 struct LDKCResult_NoneLightningErrorZ CResult_NoneLightningErrorZ_ok(void);
15670 * Creates a new CResult_NoneLightningErrorZ in the error state.
15672 struct LDKCResult_NoneLightningErrorZ CResult_NoneLightningErrorZ_err(struct LDKLightningError e);
15675 * Checks if the given object is currently in the success state
15677 bool CResult_NoneLightningErrorZ_is_ok(const struct LDKCResult_NoneLightningErrorZ *NONNULL_PTR o);
15680 * Frees any resources used by the CResult_NoneLightningErrorZ.
15682 void CResult_NoneLightningErrorZ_free(struct LDKCResult_NoneLightningErrorZ _res);
15685 * Creates a new CResult_NoneLightningErrorZ which has the same data as `orig`
15686 * but with all dynamically-allocated buffers duplicated in new buffers.
15688 struct LDKCResult_NoneLightningErrorZ CResult_NoneLightningErrorZ_clone(const struct LDKCResult_NoneLightningErrorZ *NONNULL_PTR orig);
15691 * Creates a new CResult_ChannelUpdateInfoDecodeErrorZ in the success state.
15693 struct LDKCResult_ChannelUpdateInfoDecodeErrorZ CResult_ChannelUpdateInfoDecodeErrorZ_ok(struct LDKChannelUpdateInfo o);
15696 * Creates a new CResult_ChannelUpdateInfoDecodeErrorZ in the error state.
15698 struct LDKCResult_ChannelUpdateInfoDecodeErrorZ CResult_ChannelUpdateInfoDecodeErrorZ_err(struct LDKDecodeError e);
15701 * Checks if the given object is currently in the success state
15703 bool CResult_ChannelUpdateInfoDecodeErrorZ_is_ok(const struct LDKCResult_ChannelUpdateInfoDecodeErrorZ *NONNULL_PTR o);
15706 * Frees any resources used by the CResult_ChannelUpdateInfoDecodeErrorZ.
15708 void CResult_ChannelUpdateInfoDecodeErrorZ_free(struct LDKCResult_ChannelUpdateInfoDecodeErrorZ _res);
15711 * Creates a new CResult_ChannelUpdateInfoDecodeErrorZ which has the same data as `orig`
15712 * but with all dynamically-allocated buffers duplicated in new buffers.
15714 struct LDKCResult_ChannelUpdateInfoDecodeErrorZ CResult_ChannelUpdateInfoDecodeErrorZ_clone(const struct LDKCResult_ChannelUpdateInfoDecodeErrorZ *NONNULL_PTR orig);
15717 * Creates a new CResult_ChannelInfoDecodeErrorZ in the success state.
15719 struct LDKCResult_ChannelInfoDecodeErrorZ CResult_ChannelInfoDecodeErrorZ_ok(struct LDKChannelInfo o);
15722 * Creates a new CResult_ChannelInfoDecodeErrorZ in the error state.
15724 struct LDKCResult_ChannelInfoDecodeErrorZ CResult_ChannelInfoDecodeErrorZ_err(struct LDKDecodeError e);
15727 * Checks if the given object is currently in the success state
15729 bool CResult_ChannelInfoDecodeErrorZ_is_ok(const struct LDKCResult_ChannelInfoDecodeErrorZ *NONNULL_PTR o);
15732 * Frees any resources used by the CResult_ChannelInfoDecodeErrorZ.
15734 void CResult_ChannelInfoDecodeErrorZ_free(struct LDKCResult_ChannelInfoDecodeErrorZ _res);
15737 * Creates a new CResult_ChannelInfoDecodeErrorZ which has the same data as `orig`
15738 * but with all dynamically-allocated buffers duplicated in new buffers.
15740 struct LDKCResult_ChannelInfoDecodeErrorZ CResult_ChannelInfoDecodeErrorZ_clone(const struct LDKCResult_ChannelInfoDecodeErrorZ *NONNULL_PTR orig);
15743 * Creates a new CResult_RoutingFeesDecodeErrorZ in the success state.
15745 struct LDKCResult_RoutingFeesDecodeErrorZ CResult_RoutingFeesDecodeErrorZ_ok(struct LDKRoutingFees o);
15748 * Creates a new CResult_RoutingFeesDecodeErrorZ in the error state.
15750 struct LDKCResult_RoutingFeesDecodeErrorZ CResult_RoutingFeesDecodeErrorZ_err(struct LDKDecodeError e);
15753 * Checks if the given object is currently in the success state
15755 bool CResult_RoutingFeesDecodeErrorZ_is_ok(const struct LDKCResult_RoutingFeesDecodeErrorZ *NONNULL_PTR o);
15758 * Frees any resources used by the CResult_RoutingFeesDecodeErrorZ.
15760 void CResult_RoutingFeesDecodeErrorZ_free(struct LDKCResult_RoutingFeesDecodeErrorZ _res);
15763 * Creates a new CResult_RoutingFeesDecodeErrorZ which has the same data as `orig`
15764 * but with all dynamically-allocated buffers duplicated in new buffers.
15766 struct LDKCResult_RoutingFeesDecodeErrorZ CResult_RoutingFeesDecodeErrorZ_clone(const struct LDKCResult_RoutingFeesDecodeErrorZ *NONNULL_PTR orig);
15769 * Frees the buffer pointed to by `data` if `datalen` is non-0.
15771 void CVec_NetAddressZ_free(struct LDKCVec_NetAddressZ _res);
15774 * Creates a new CResult_NodeAnnouncementInfoDecodeErrorZ in the success state.
15776 struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ CResult_NodeAnnouncementInfoDecodeErrorZ_ok(struct LDKNodeAnnouncementInfo o);
15779 * Creates a new CResult_NodeAnnouncementInfoDecodeErrorZ in the error state.
15781 struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ CResult_NodeAnnouncementInfoDecodeErrorZ_err(struct LDKDecodeError e);
15784 * Checks if the given object is currently in the success state
15786 bool CResult_NodeAnnouncementInfoDecodeErrorZ_is_ok(const struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ *NONNULL_PTR o);
15789 * Frees any resources used by the CResult_NodeAnnouncementInfoDecodeErrorZ.
15791 void CResult_NodeAnnouncementInfoDecodeErrorZ_free(struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ _res);
15794 * Creates a new CResult_NodeAnnouncementInfoDecodeErrorZ which has the same data as `orig`
15795 * but with all dynamically-allocated buffers duplicated in new buffers.
15797 struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ CResult_NodeAnnouncementInfoDecodeErrorZ_clone(const struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ *NONNULL_PTR orig);
15800 * Creates a new CResult_NodeAliasDecodeErrorZ in the success state.
15802 struct LDKCResult_NodeAliasDecodeErrorZ CResult_NodeAliasDecodeErrorZ_ok(struct LDKNodeAlias o);
15805 * Creates a new CResult_NodeAliasDecodeErrorZ in the error state.
15807 struct LDKCResult_NodeAliasDecodeErrorZ CResult_NodeAliasDecodeErrorZ_err(struct LDKDecodeError e);
15810 * Checks if the given object is currently in the success state
15812 bool CResult_NodeAliasDecodeErrorZ_is_ok(const struct LDKCResult_NodeAliasDecodeErrorZ *NONNULL_PTR o);
15815 * Frees any resources used by the CResult_NodeAliasDecodeErrorZ.
15817 void CResult_NodeAliasDecodeErrorZ_free(struct LDKCResult_NodeAliasDecodeErrorZ _res);
15820 * Creates a new CResult_NodeAliasDecodeErrorZ which has the same data as `orig`
15821 * but with all dynamically-allocated buffers duplicated in new buffers.
15823 struct LDKCResult_NodeAliasDecodeErrorZ CResult_NodeAliasDecodeErrorZ_clone(const struct LDKCResult_NodeAliasDecodeErrorZ *NONNULL_PTR orig);
15826 * Creates a new CResult_NodeInfoDecodeErrorZ in the success state.
15828 struct LDKCResult_NodeInfoDecodeErrorZ CResult_NodeInfoDecodeErrorZ_ok(struct LDKNodeInfo o);
15831 * Creates a new CResult_NodeInfoDecodeErrorZ in the error state.
15833 struct LDKCResult_NodeInfoDecodeErrorZ CResult_NodeInfoDecodeErrorZ_err(struct LDKDecodeError e);
15836 * Checks if the given object is currently in the success state
15838 bool CResult_NodeInfoDecodeErrorZ_is_ok(const struct LDKCResult_NodeInfoDecodeErrorZ *NONNULL_PTR o);
15841 * Frees any resources used by the CResult_NodeInfoDecodeErrorZ.
15843 void CResult_NodeInfoDecodeErrorZ_free(struct LDKCResult_NodeInfoDecodeErrorZ _res);
15846 * Creates a new CResult_NodeInfoDecodeErrorZ which has the same data as `orig`
15847 * but with all dynamically-allocated buffers duplicated in new buffers.
15849 struct LDKCResult_NodeInfoDecodeErrorZ CResult_NodeInfoDecodeErrorZ_clone(const struct LDKCResult_NodeInfoDecodeErrorZ *NONNULL_PTR orig);
15852 * Creates a new CResult_NetworkGraphDecodeErrorZ in the success state.
15854 struct LDKCResult_NetworkGraphDecodeErrorZ CResult_NetworkGraphDecodeErrorZ_ok(struct LDKNetworkGraph o);
15857 * Creates a new CResult_NetworkGraphDecodeErrorZ in the error state.
15859 struct LDKCResult_NetworkGraphDecodeErrorZ CResult_NetworkGraphDecodeErrorZ_err(struct LDKDecodeError e);
15862 * Checks if the given object is currently in the success state
15864 bool CResult_NetworkGraphDecodeErrorZ_is_ok(const struct LDKCResult_NetworkGraphDecodeErrorZ *NONNULL_PTR o);
15867 * Frees any resources used by the CResult_NetworkGraphDecodeErrorZ.
15869 void CResult_NetworkGraphDecodeErrorZ_free(struct LDKCResult_NetworkGraphDecodeErrorZ _res);
15872 * Constructs a new COption_CVec_NetAddressZZ containing a crate::c_types::derived::CVec_NetAddressZ
15874 struct LDKCOption_CVec_NetAddressZZ COption_CVec_NetAddressZZ_some(struct LDKCVec_NetAddressZ o);
15877 * Constructs a new COption_CVec_NetAddressZZ containing nothing
15879 struct LDKCOption_CVec_NetAddressZZ COption_CVec_NetAddressZZ_none(void);
15882 * Frees any resources associated with the crate::c_types::derived::CVec_NetAddressZ, if we are in the Some state
15884 void COption_CVec_NetAddressZZ_free(struct LDKCOption_CVec_NetAddressZZ _res);
15887 * Creates a new COption_CVec_NetAddressZZ which has the same data as `orig`
15888 * but with all dynamically-allocated buffers duplicated in new buffers.
15890 struct LDKCOption_CVec_NetAddressZZ COption_CVec_NetAddressZZ_clone(const struct LDKCOption_CVec_NetAddressZZ *NONNULL_PTR orig);
15893 * Creates a new CResult_DelayedPaymentOutputDescriptorDecodeErrorZ in the success state.
15895 struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_ok(struct LDKDelayedPaymentOutputDescriptor o);
15898 * Creates a new CResult_DelayedPaymentOutputDescriptorDecodeErrorZ in the error state.
15900 struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_err(struct LDKDecodeError e);
15903 * Checks if the given object is currently in the success state
15905 bool CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_is_ok(const struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ *NONNULL_PTR o);
15908 * Frees any resources used by the CResult_DelayedPaymentOutputDescriptorDecodeErrorZ.
15910 void CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_free(struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ _res);
15913 * Creates a new CResult_DelayedPaymentOutputDescriptorDecodeErrorZ which has the same data as `orig`
15914 * but with all dynamically-allocated buffers duplicated in new buffers.
15916 struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_clone(const struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ *NONNULL_PTR orig);
15919 * Creates a new CResult_StaticPaymentOutputDescriptorDecodeErrorZ in the success state.
15921 struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ CResult_StaticPaymentOutputDescriptorDecodeErrorZ_ok(struct LDKStaticPaymentOutputDescriptor o);
15924 * Creates a new CResult_StaticPaymentOutputDescriptorDecodeErrorZ in the error state.
15926 struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ CResult_StaticPaymentOutputDescriptorDecodeErrorZ_err(struct LDKDecodeError e);
15929 * Checks if the given object is currently in the success state
15931 bool CResult_StaticPaymentOutputDescriptorDecodeErrorZ_is_ok(const struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ *NONNULL_PTR o);
15934 * Frees any resources used by the CResult_StaticPaymentOutputDescriptorDecodeErrorZ.
15936 void CResult_StaticPaymentOutputDescriptorDecodeErrorZ_free(struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ _res);
15939 * Creates a new CResult_StaticPaymentOutputDescriptorDecodeErrorZ which has the same data as `orig`
15940 * but with all dynamically-allocated buffers duplicated in new buffers.
15942 struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ CResult_StaticPaymentOutputDescriptorDecodeErrorZ_clone(const struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ *NONNULL_PTR orig);
15945 * Creates a new CResult_SpendableOutputDescriptorDecodeErrorZ in the success state.
15947 struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ CResult_SpendableOutputDescriptorDecodeErrorZ_ok(struct LDKSpendableOutputDescriptor o);
15950 * Creates a new CResult_SpendableOutputDescriptorDecodeErrorZ in the error state.
15952 struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ CResult_SpendableOutputDescriptorDecodeErrorZ_err(struct LDKDecodeError e);
15955 * Checks if the given object is currently in the success state
15957 bool CResult_SpendableOutputDescriptorDecodeErrorZ_is_ok(const struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ *NONNULL_PTR o);
15960 * Frees any resources used by the CResult_SpendableOutputDescriptorDecodeErrorZ.
15962 void CResult_SpendableOutputDescriptorDecodeErrorZ_free(struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ _res);
15965 * Creates a new CResult_SpendableOutputDescriptorDecodeErrorZ which has the same data as `orig`
15966 * but with all dynamically-allocated buffers duplicated in new buffers.
15968 struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ CResult_SpendableOutputDescriptorDecodeErrorZ_clone(const struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ *NONNULL_PTR orig);
15971 * Frees the buffer pointed to by `data` if `datalen` is non-0.
15973 void CVec_PaymentPreimageZ_free(struct LDKCVec_PaymentPreimageZ _res);
15976 * Creates a new tuple which has the same data as `orig`
15977 * but with all dynamically-allocated buffers duplicated in new buffers.
15979 struct LDKC2Tuple_SignatureCVec_SignatureZZ C2Tuple_SignatureCVec_SignatureZZ_clone(const struct LDKC2Tuple_SignatureCVec_SignatureZZ *NONNULL_PTR orig);
15982 * Creates a new C2Tuple_SignatureCVec_SignatureZZ from the contained elements.
15984 struct LDKC2Tuple_SignatureCVec_SignatureZZ C2Tuple_SignatureCVec_SignatureZZ_new(struct LDKSignature a, struct LDKCVec_SignatureZ b);
15987 * Frees any resources used by the C2Tuple_SignatureCVec_SignatureZZ.
15989 void C2Tuple_SignatureCVec_SignatureZZ_free(struct LDKC2Tuple_SignatureCVec_SignatureZZ _res);
15992 * Creates a new CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ in the success state.
15994 struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_ok(struct LDKC2Tuple_SignatureCVec_SignatureZZ o);
15997 * Creates a new CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ in the error state.
15999 struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_err(void);
16002 * Checks if the given object is currently in the success state
16004 bool CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_is_ok(const struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ *NONNULL_PTR o);
16007 * Frees any resources used by the CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ.
16009 void CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_free(struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ _res);
16012 * Creates a new CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ which has the same data as `orig`
16013 * but with all dynamically-allocated buffers duplicated in new buffers.
16015 struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_clone(const struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ *NONNULL_PTR orig);
16018 * Creates a new CResult_SignatureNoneZ in the success state.
16020 struct LDKCResult_SignatureNoneZ CResult_SignatureNoneZ_ok(struct LDKSignature o);
16023 * Creates a new CResult_SignatureNoneZ in the error state.
16025 struct LDKCResult_SignatureNoneZ CResult_SignatureNoneZ_err(void);
16028 * Checks if the given object is currently in the success state
16030 bool CResult_SignatureNoneZ_is_ok(const struct LDKCResult_SignatureNoneZ *NONNULL_PTR o);
16033 * Frees any resources used by the CResult_SignatureNoneZ.
16035 void CResult_SignatureNoneZ_free(struct LDKCResult_SignatureNoneZ _res);
16038 * Creates a new CResult_SignatureNoneZ which has the same data as `orig`
16039 * but with all dynamically-allocated buffers duplicated in new buffers.
16041 struct LDKCResult_SignatureNoneZ CResult_SignatureNoneZ_clone(const struct LDKCResult_SignatureNoneZ *NONNULL_PTR orig);
16044 * Creates a new tuple which has the same data as `orig`
16045 * but with all dynamically-allocated buffers duplicated in new buffers.
16047 struct LDKC2Tuple_SignatureSignatureZ C2Tuple_SignatureSignatureZ_clone(const struct LDKC2Tuple_SignatureSignatureZ *NONNULL_PTR orig);
16050 * Creates a new C2Tuple_SignatureSignatureZ from the contained elements.
16052 struct LDKC2Tuple_SignatureSignatureZ C2Tuple_SignatureSignatureZ_new(struct LDKSignature a, struct LDKSignature b);
16055 * Frees any resources used by the C2Tuple_SignatureSignatureZ.
16057 void C2Tuple_SignatureSignatureZ_free(struct LDKC2Tuple_SignatureSignatureZ _res);
16060 * Creates a new CResult_C2Tuple_SignatureSignatureZNoneZ in the success state.
16062 struct LDKCResult_C2Tuple_SignatureSignatureZNoneZ CResult_C2Tuple_SignatureSignatureZNoneZ_ok(struct LDKC2Tuple_SignatureSignatureZ o);
16065 * Creates a new CResult_C2Tuple_SignatureSignatureZNoneZ in the error state.
16067 struct LDKCResult_C2Tuple_SignatureSignatureZNoneZ CResult_C2Tuple_SignatureSignatureZNoneZ_err(void);
16070 * Checks if the given object is currently in the success state
16072 bool CResult_C2Tuple_SignatureSignatureZNoneZ_is_ok(const struct LDKCResult_C2Tuple_SignatureSignatureZNoneZ *NONNULL_PTR o);
16075 * Frees any resources used by the CResult_C2Tuple_SignatureSignatureZNoneZ.
16077 void CResult_C2Tuple_SignatureSignatureZNoneZ_free(struct LDKCResult_C2Tuple_SignatureSignatureZNoneZ _res);
16080 * Creates a new CResult_C2Tuple_SignatureSignatureZNoneZ which has the same data as `orig`
16081 * but with all dynamically-allocated buffers duplicated in new buffers.
16083 struct LDKCResult_C2Tuple_SignatureSignatureZNoneZ CResult_C2Tuple_SignatureSignatureZNoneZ_clone(const struct LDKCResult_C2Tuple_SignatureSignatureZNoneZ *NONNULL_PTR orig);
16086 * Creates a new CResult_SecretKeyNoneZ in the success state.
16088 struct LDKCResult_SecretKeyNoneZ CResult_SecretKeyNoneZ_ok(struct LDKSecretKey o);
16091 * Creates a new CResult_SecretKeyNoneZ in the error state.
16093 struct LDKCResult_SecretKeyNoneZ CResult_SecretKeyNoneZ_err(void);
16096 * Checks if the given object is currently in the success state
16098 bool CResult_SecretKeyNoneZ_is_ok(const struct LDKCResult_SecretKeyNoneZ *NONNULL_PTR o);
16101 * Frees any resources used by the CResult_SecretKeyNoneZ.
16103 void CResult_SecretKeyNoneZ_free(struct LDKCResult_SecretKeyNoneZ _res);
16106 * Creates a new CResult_SecretKeyNoneZ which has the same data as `orig`
16107 * but with all dynamically-allocated buffers duplicated in new buffers.
16109 struct LDKCResult_SecretKeyNoneZ CResult_SecretKeyNoneZ_clone(const struct LDKCResult_SecretKeyNoneZ *NONNULL_PTR orig);
16112 * Creates a new CResult_PublicKeyNoneZ in the success state.
16114 struct LDKCResult_PublicKeyNoneZ CResult_PublicKeyNoneZ_ok(struct LDKPublicKey o);
16117 * Creates a new CResult_PublicKeyNoneZ in the error state.
16119 struct LDKCResult_PublicKeyNoneZ CResult_PublicKeyNoneZ_err(void);
16122 * Checks if the given object is currently in the success state
16124 bool CResult_PublicKeyNoneZ_is_ok(const struct LDKCResult_PublicKeyNoneZ *NONNULL_PTR o);
16127 * Frees any resources used by the CResult_PublicKeyNoneZ.
16129 void CResult_PublicKeyNoneZ_free(struct LDKCResult_PublicKeyNoneZ _res);
16132 * Creates a new CResult_PublicKeyNoneZ which has the same data as `orig`
16133 * but with all dynamically-allocated buffers duplicated in new buffers.
16135 struct LDKCResult_PublicKeyNoneZ CResult_PublicKeyNoneZ_clone(const struct LDKCResult_PublicKeyNoneZ *NONNULL_PTR orig);
16138 * Constructs a new COption_ScalarZ containing a crate::c_types::BigEndianScalar
16140 struct LDKCOption_ScalarZ COption_ScalarZ_some(struct LDKBigEndianScalar o);
16143 * Constructs a new COption_ScalarZ containing nothing
16145 struct LDKCOption_ScalarZ COption_ScalarZ_none(void);
16148 * Frees any resources associated with the crate::c_types::BigEndianScalar, if we are in the Some state
16150 void COption_ScalarZ_free(struct LDKCOption_ScalarZ _res);
16153 * Creates a new CResult_SharedSecretNoneZ in the success state.
16155 struct LDKCResult_SharedSecretNoneZ CResult_SharedSecretNoneZ_ok(struct LDKThirtyTwoBytes o);
16158 * Creates a new CResult_SharedSecretNoneZ in the error state.
16160 struct LDKCResult_SharedSecretNoneZ CResult_SharedSecretNoneZ_err(void);
16163 * Checks if the given object is currently in the success state
16165 bool CResult_SharedSecretNoneZ_is_ok(const struct LDKCResult_SharedSecretNoneZ *NONNULL_PTR o);
16168 * Frees any resources used by the CResult_SharedSecretNoneZ.
16170 void CResult_SharedSecretNoneZ_free(struct LDKCResult_SharedSecretNoneZ _res);
16173 * Creates a new CResult_SharedSecretNoneZ which has the same data as `orig`
16174 * but with all dynamically-allocated buffers duplicated in new buffers.
16176 struct LDKCResult_SharedSecretNoneZ CResult_SharedSecretNoneZ_clone(const struct LDKCResult_SharedSecretNoneZ *NONNULL_PTR orig);
16179 * Creates a new CResult_SignDecodeErrorZ in the success state.
16181 struct LDKCResult_SignDecodeErrorZ CResult_SignDecodeErrorZ_ok(struct LDKSign o);
16184 * Creates a new CResult_SignDecodeErrorZ in the error state.
16186 struct LDKCResult_SignDecodeErrorZ CResult_SignDecodeErrorZ_err(struct LDKDecodeError e);
16189 * Checks if the given object is currently in the success state
16191 bool CResult_SignDecodeErrorZ_is_ok(const struct LDKCResult_SignDecodeErrorZ *NONNULL_PTR o);
16194 * Frees any resources used by the CResult_SignDecodeErrorZ.
16196 void CResult_SignDecodeErrorZ_free(struct LDKCResult_SignDecodeErrorZ _res);
16199 * Creates a new CResult_SignDecodeErrorZ which has the same data as `orig`
16200 * but with all dynamically-allocated buffers duplicated in new buffers.
16202 struct LDKCResult_SignDecodeErrorZ CResult_SignDecodeErrorZ_clone(const struct LDKCResult_SignDecodeErrorZ *NONNULL_PTR orig);
16205 * Frees the buffer pointed to by `data` if `datalen` is non-0.
16207 void CVec_u5Z_free(struct LDKCVec_u5Z _res);
16210 * Creates a new CResult_RecoverableSignatureNoneZ in the success state.
16212 struct LDKCResult_RecoverableSignatureNoneZ CResult_RecoverableSignatureNoneZ_ok(struct LDKRecoverableSignature o);
16215 * Creates a new CResult_RecoverableSignatureNoneZ in the error state.
16217 struct LDKCResult_RecoverableSignatureNoneZ CResult_RecoverableSignatureNoneZ_err(void);
16220 * Checks if the given object is currently in the success state
16222 bool CResult_RecoverableSignatureNoneZ_is_ok(const struct LDKCResult_RecoverableSignatureNoneZ *NONNULL_PTR o);
16225 * Frees any resources used by the CResult_RecoverableSignatureNoneZ.
16227 void CResult_RecoverableSignatureNoneZ_free(struct LDKCResult_RecoverableSignatureNoneZ _res);
16230 * Creates a new CResult_RecoverableSignatureNoneZ which has the same data as `orig`
16231 * but with all dynamically-allocated buffers duplicated in new buffers.
16233 struct LDKCResult_RecoverableSignatureNoneZ CResult_RecoverableSignatureNoneZ_clone(const struct LDKCResult_RecoverableSignatureNoneZ *NONNULL_PTR orig);
16236 * Frees the buffer pointed to by `data` if `datalen` is non-0.
16238 void CVec_u8Z_free(struct LDKCVec_u8Z _res);
16241 * Frees the buffer pointed to by `data` if `datalen` is non-0.
16243 void CVec_CVec_u8ZZ_free(struct LDKCVec_CVec_u8ZZ _res);
16246 * Creates a new CResult_CVec_CVec_u8ZZNoneZ in the success state.
16248 struct LDKCResult_CVec_CVec_u8ZZNoneZ CResult_CVec_CVec_u8ZZNoneZ_ok(struct LDKCVec_CVec_u8ZZ o);
16251 * Creates a new CResult_CVec_CVec_u8ZZNoneZ in the error state.
16253 struct LDKCResult_CVec_CVec_u8ZZNoneZ CResult_CVec_CVec_u8ZZNoneZ_err(void);
16256 * Checks if the given object is currently in the success state
16258 bool CResult_CVec_CVec_u8ZZNoneZ_is_ok(const struct LDKCResult_CVec_CVec_u8ZZNoneZ *NONNULL_PTR o);
16261 * Frees any resources used by the CResult_CVec_CVec_u8ZZNoneZ.
16263 void CResult_CVec_CVec_u8ZZNoneZ_free(struct LDKCResult_CVec_CVec_u8ZZNoneZ _res);
16266 * Creates a new CResult_CVec_CVec_u8ZZNoneZ which has the same data as `orig`
16267 * but with all dynamically-allocated buffers duplicated in new buffers.
16269 struct LDKCResult_CVec_CVec_u8ZZNoneZ CResult_CVec_CVec_u8ZZNoneZ_clone(const struct LDKCResult_CVec_CVec_u8ZZNoneZ *NONNULL_PTR orig);
16272 * Creates a new CResult_InMemorySignerDecodeErrorZ in the success state.
16274 struct LDKCResult_InMemorySignerDecodeErrorZ CResult_InMemorySignerDecodeErrorZ_ok(struct LDKInMemorySigner o);
16277 * Creates a new CResult_InMemorySignerDecodeErrorZ in the error state.
16279 struct LDKCResult_InMemorySignerDecodeErrorZ CResult_InMemorySignerDecodeErrorZ_err(struct LDKDecodeError e);
16282 * Checks if the given object is currently in the success state
16284 bool CResult_InMemorySignerDecodeErrorZ_is_ok(const struct LDKCResult_InMemorySignerDecodeErrorZ *NONNULL_PTR o);
16287 * Frees any resources used by the CResult_InMemorySignerDecodeErrorZ.
16289 void CResult_InMemorySignerDecodeErrorZ_free(struct LDKCResult_InMemorySignerDecodeErrorZ _res);
16292 * Creates a new CResult_InMemorySignerDecodeErrorZ which has the same data as `orig`
16293 * but with all dynamically-allocated buffers duplicated in new buffers.
16295 struct LDKCResult_InMemorySignerDecodeErrorZ CResult_InMemorySignerDecodeErrorZ_clone(const struct LDKCResult_InMemorySignerDecodeErrorZ *NONNULL_PTR orig);
16298 * Frees the buffer pointed to by `data` if `datalen` is non-0.
16300 void CVec_TxOutZ_free(struct LDKCVec_TxOutZ _res);
16303 * Creates a new CResult_TransactionNoneZ in the success state.
16305 struct LDKCResult_TransactionNoneZ CResult_TransactionNoneZ_ok(struct LDKTransaction o);
16308 * Creates a new CResult_TransactionNoneZ in the error state.
16310 struct LDKCResult_TransactionNoneZ CResult_TransactionNoneZ_err(void);
16313 * Checks if the given object is currently in the success state
16315 bool CResult_TransactionNoneZ_is_ok(const struct LDKCResult_TransactionNoneZ *NONNULL_PTR o);
16318 * Frees any resources used by the CResult_TransactionNoneZ.
16320 void CResult_TransactionNoneZ_free(struct LDKCResult_TransactionNoneZ _res);
16323 * Creates a new CResult_TransactionNoneZ which has the same data as `orig`
16324 * but with all dynamically-allocated buffers duplicated in new buffers.
16326 struct LDKCResult_TransactionNoneZ CResult_TransactionNoneZ_clone(const struct LDKCResult_TransactionNoneZ *NONNULL_PTR orig);
16329 * Creates a new C2Tuple_BlockHashChannelMonitorZ from the contained elements.
16331 struct LDKC2Tuple_BlockHashChannelMonitorZ C2Tuple_BlockHashChannelMonitorZ_new(struct LDKThirtyTwoBytes a, struct LDKChannelMonitor b);
16334 * Frees any resources used by the C2Tuple_BlockHashChannelMonitorZ.
16336 void C2Tuple_BlockHashChannelMonitorZ_free(struct LDKC2Tuple_BlockHashChannelMonitorZ _res);
16339 * Frees the buffer pointed to by `data` if `datalen` is non-0.
16341 void CVec_C2Tuple_BlockHashChannelMonitorZZ_free(struct LDKCVec_C2Tuple_BlockHashChannelMonitorZZ _res);
16344 * Creates a new CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ in the success state.
16346 struct LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_ok(struct LDKCVec_C2Tuple_BlockHashChannelMonitorZZ o);
16349 * Creates a new CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ in the error state.
16351 struct LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_err(enum LDKIOError e);
16354 * Checks if the given object is currently in the success state
16356 bool CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_is_ok(const struct LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ *NONNULL_PTR o);
16359 * Frees any resources used by the CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ.
16361 void CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_free(struct LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ _res);
16364 * Constructs a new COption_u16Z containing a u16
16366 struct LDKCOption_u16Z COption_u16Z_some(uint16_t o);
16369 * Constructs a new COption_u16Z containing nothing
16371 struct LDKCOption_u16Z COption_u16Z_none(void);
16374 * Frees any resources associated with the u16, if we are in the Some state
16376 void COption_u16Z_free(struct LDKCOption_u16Z _res);
16379 * Creates a new COption_u16Z which has the same data as `orig`
16380 * but with all dynamically-allocated buffers duplicated in new buffers.
16382 struct LDKCOption_u16Z COption_u16Z_clone(const struct LDKCOption_u16Z *NONNULL_PTR orig);
16385 * Creates a new CResult_NoneAPIErrorZ in the success state.
16387 struct LDKCResult_NoneAPIErrorZ CResult_NoneAPIErrorZ_ok(void);
16390 * Creates a new CResult_NoneAPIErrorZ in the error state.
16392 struct LDKCResult_NoneAPIErrorZ CResult_NoneAPIErrorZ_err(struct LDKAPIError e);
16395 * Checks if the given object is currently in the success state
16397 bool CResult_NoneAPIErrorZ_is_ok(const struct LDKCResult_NoneAPIErrorZ *NONNULL_PTR o);
16400 * Frees any resources used by the CResult_NoneAPIErrorZ.
16402 void CResult_NoneAPIErrorZ_free(struct LDKCResult_NoneAPIErrorZ _res);
16405 * Creates a new CResult_NoneAPIErrorZ which has the same data as `orig`
16406 * but with all dynamically-allocated buffers duplicated in new buffers.
16408 struct LDKCResult_NoneAPIErrorZ CResult_NoneAPIErrorZ_clone(const struct LDKCResult_NoneAPIErrorZ *NONNULL_PTR orig);
16411 * Frees the buffer pointed to by `data` if `datalen` is non-0.
16413 void CVec_CResult_NoneAPIErrorZZ_free(struct LDKCVec_CResult_NoneAPIErrorZZ _res);
16416 * Frees the buffer pointed to by `data` if `datalen` is non-0.
16418 void CVec_APIErrorZ_free(struct LDKCVec_APIErrorZ _res);
16421 * Creates a new CResult__u832APIErrorZ in the success state.
16423 struct LDKCResult__u832APIErrorZ CResult__u832APIErrorZ_ok(struct LDKThirtyTwoBytes o);
16426 * Creates a new CResult__u832APIErrorZ in the error state.
16428 struct LDKCResult__u832APIErrorZ CResult__u832APIErrorZ_err(struct LDKAPIError e);
16431 * Checks if the given object is currently in the success state
16433 bool CResult__u832APIErrorZ_is_ok(const struct LDKCResult__u832APIErrorZ *NONNULL_PTR o);
16436 * Frees any resources used by the CResult__u832APIErrorZ.
16438 void CResult__u832APIErrorZ_free(struct LDKCResult__u832APIErrorZ _res);
16441 * Creates a new CResult__u832APIErrorZ which has the same data as `orig`
16442 * but with all dynamically-allocated buffers duplicated in new buffers.
16444 struct LDKCResult__u832APIErrorZ CResult__u832APIErrorZ_clone(const struct LDKCResult__u832APIErrorZ *NONNULL_PTR orig);
16447 * Creates a new CResult_PaymentIdPaymentSendFailureZ in the success state.
16449 struct LDKCResult_PaymentIdPaymentSendFailureZ CResult_PaymentIdPaymentSendFailureZ_ok(struct LDKThirtyTwoBytes o);
16452 * Creates a new CResult_PaymentIdPaymentSendFailureZ in the error state.
16454 struct LDKCResult_PaymentIdPaymentSendFailureZ CResult_PaymentIdPaymentSendFailureZ_err(struct LDKPaymentSendFailure e);
16457 * Checks if the given object is currently in the success state
16459 bool CResult_PaymentIdPaymentSendFailureZ_is_ok(const struct LDKCResult_PaymentIdPaymentSendFailureZ *NONNULL_PTR o);
16462 * Frees any resources used by the CResult_PaymentIdPaymentSendFailureZ.
16464 void CResult_PaymentIdPaymentSendFailureZ_free(struct LDKCResult_PaymentIdPaymentSendFailureZ _res);
16467 * Creates a new CResult_PaymentIdPaymentSendFailureZ which has the same data as `orig`
16468 * but with all dynamically-allocated buffers duplicated in new buffers.
16470 struct LDKCResult_PaymentIdPaymentSendFailureZ CResult_PaymentIdPaymentSendFailureZ_clone(const struct LDKCResult_PaymentIdPaymentSendFailureZ *NONNULL_PTR orig);
16473 * Creates a new CResult_NonePaymentSendFailureZ in the success state.
16475 struct LDKCResult_NonePaymentSendFailureZ CResult_NonePaymentSendFailureZ_ok(void);
16478 * Creates a new CResult_NonePaymentSendFailureZ in the error state.
16480 struct LDKCResult_NonePaymentSendFailureZ CResult_NonePaymentSendFailureZ_err(struct LDKPaymentSendFailure e);
16483 * Checks if the given object is currently in the success state
16485 bool CResult_NonePaymentSendFailureZ_is_ok(const struct LDKCResult_NonePaymentSendFailureZ *NONNULL_PTR o);
16488 * Frees any resources used by the CResult_NonePaymentSendFailureZ.
16490 void CResult_NonePaymentSendFailureZ_free(struct LDKCResult_NonePaymentSendFailureZ _res);
16493 * Creates a new CResult_NonePaymentSendFailureZ which has the same data as `orig`
16494 * but with all dynamically-allocated buffers duplicated in new buffers.
16496 struct LDKCResult_NonePaymentSendFailureZ CResult_NonePaymentSendFailureZ_clone(const struct LDKCResult_NonePaymentSendFailureZ *NONNULL_PTR orig);
16499 * Creates a new tuple which has the same data as `orig`
16500 * but with all dynamically-allocated buffers duplicated in new buffers.
16502 struct LDKC2Tuple_PaymentHashPaymentIdZ C2Tuple_PaymentHashPaymentIdZ_clone(const struct LDKC2Tuple_PaymentHashPaymentIdZ *NONNULL_PTR orig);
16505 * Creates a new C2Tuple_PaymentHashPaymentIdZ from the contained elements.
16507 struct LDKC2Tuple_PaymentHashPaymentIdZ C2Tuple_PaymentHashPaymentIdZ_new(struct LDKThirtyTwoBytes a, struct LDKThirtyTwoBytes b);
16510 * Frees any resources used by the C2Tuple_PaymentHashPaymentIdZ.
16512 void C2Tuple_PaymentHashPaymentIdZ_free(struct LDKC2Tuple_PaymentHashPaymentIdZ _res);
16515 * Creates a new CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ in the success state.
16517 struct LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_ok(struct LDKC2Tuple_PaymentHashPaymentIdZ o);
16520 * Creates a new CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ in the error state.
16522 struct LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_err(struct LDKPaymentSendFailure e);
16525 * Checks if the given object is currently in the success state
16527 bool CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_is_ok(const struct LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ *NONNULL_PTR o);
16530 * Frees any resources used by the CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ.
16532 void CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_free(struct LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ _res);
16535 * Creates a new CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ which has the same data as `orig`
16536 * but with all dynamically-allocated buffers duplicated in new buffers.
16538 struct LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_clone(const struct LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ *NONNULL_PTR orig);
16541 * Frees the buffer pointed to by `data` if `datalen` is non-0.
16543 void CVec_ThirtyTwoBytesZ_free(struct LDKCVec_ThirtyTwoBytesZ _res);
16546 * Creates a new tuple which has the same data as `orig`
16547 * but with all dynamically-allocated buffers duplicated in new buffers.
16549 struct LDKC2Tuple_PaymentHashPaymentSecretZ C2Tuple_PaymentHashPaymentSecretZ_clone(const struct LDKC2Tuple_PaymentHashPaymentSecretZ *NONNULL_PTR orig);
16552 * Creates a new C2Tuple_PaymentHashPaymentSecretZ from the contained elements.
16554 struct LDKC2Tuple_PaymentHashPaymentSecretZ C2Tuple_PaymentHashPaymentSecretZ_new(struct LDKThirtyTwoBytes a, struct LDKThirtyTwoBytes b);
16557 * Frees any resources used by the C2Tuple_PaymentHashPaymentSecretZ.
16559 void C2Tuple_PaymentHashPaymentSecretZ_free(struct LDKC2Tuple_PaymentHashPaymentSecretZ _res);
16562 * Creates a new CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ in the success state.
16564 struct LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_ok(struct LDKC2Tuple_PaymentHashPaymentSecretZ o);
16567 * Creates a new CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ in the error state.
16569 struct LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_err(void);
16572 * Checks if the given object is currently in the success state
16574 bool CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_is_ok(const struct LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ *NONNULL_PTR o);
16577 * Frees any resources used by the CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ.
16579 void CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_free(struct LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ _res);
16582 * Creates a new CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ which has the same data as `orig`
16583 * but with all dynamically-allocated buffers duplicated in new buffers.
16585 struct LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_clone(const struct LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ *NONNULL_PTR orig);
16588 * Creates a new CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ in the success state.
16590 struct LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_ok(struct LDKC2Tuple_PaymentHashPaymentSecretZ o);
16593 * Creates a new CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ in the error state.
16595 struct LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_err(struct LDKAPIError e);
16598 * Checks if the given object is currently in the success state
16600 bool CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_is_ok(const struct LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ *NONNULL_PTR o);
16603 * Frees any resources used by the CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ.
16605 void CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_free(struct LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ _res);
16608 * Creates a new CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ which has the same data as `orig`
16609 * but with all dynamically-allocated buffers duplicated in new buffers.
16611 struct LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_clone(const struct LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ *NONNULL_PTR orig);
16614 * Creates a new CResult_PaymentSecretNoneZ in the success state.
16616 struct LDKCResult_PaymentSecretNoneZ CResult_PaymentSecretNoneZ_ok(struct LDKThirtyTwoBytes o);
16619 * Creates a new CResult_PaymentSecretNoneZ in the error state.
16621 struct LDKCResult_PaymentSecretNoneZ CResult_PaymentSecretNoneZ_err(void);
16624 * Checks if the given object is currently in the success state
16626 bool CResult_PaymentSecretNoneZ_is_ok(const struct LDKCResult_PaymentSecretNoneZ *NONNULL_PTR o);
16629 * Frees any resources used by the CResult_PaymentSecretNoneZ.
16631 void CResult_PaymentSecretNoneZ_free(struct LDKCResult_PaymentSecretNoneZ _res);
16634 * Creates a new CResult_PaymentSecretNoneZ which has the same data as `orig`
16635 * but with all dynamically-allocated buffers duplicated in new buffers.
16637 struct LDKCResult_PaymentSecretNoneZ CResult_PaymentSecretNoneZ_clone(const struct LDKCResult_PaymentSecretNoneZ *NONNULL_PTR orig);
16640 * Creates a new CResult_PaymentSecretAPIErrorZ in the success state.
16642 struct LDKCResult_PaymentSecretAPIErrorZ CResult_PaymentSecretAPIErrorZ_ok(struct LDKThirtyTwoBytes o);
16645 * Creates a new CResult_PaymentSecretAPIErrorZ in the error state.
16647 struct LDKCResult_PaymentSecretAPIErrorZ CResult_PaymentSecretAPIErrorZ_err(struct LDKAPIError e);
16650 * Checks if the given object is currently in the success state
16652 bool CResult_PaymentSecretAPIErrorZ_is_ok(const struct LDKCResult_PaymentSecretAPIErrorZ *NONNULL_PTR o);
16655 * Frees any resources used by the CResult_PaymentSecretAPIErrorZ.
16657 void CResult_PaymentSecretAPIErrorZ_free(struct LDKCResult_PaymentSecretAPIErrorZ _res);
16660 * Creates a new CResult_PaymentSecretAPIErrorZ which has the same data as `orig`
16661 * but with all dynamically-allocated buffers duplicated in new buffers.
16663 struct LDKCResult_PaymentSecretAPIErrorZ CResult_PaymentSecretAPIErrorZ_clone(const struct LDKCResult_PaymentSecretAPIErrorZ *NONNULL_PTR orig);
16666 * Creates a new CResult_PaymentPreimageAPIErrorZ in the success state.
16668 struct LDKCResult_PaymentPreimageAPIErrorZ CResult_PaymentPreimageAPIErrorZ_ok(struct LDKThirtyTwoBytes o);
16671 * Creates a new CResult_PaymentPreimageAPIErrorZ in the error state.
16673 struct LDKCResult_PaymentPreimageAPIErrorZ CResult_PaymentPreimageAPIErrorZ_err(struct LDKAPIError e);
16676 * Checks if the given object is currently in the success state
16678 bool CResult_PaymentPreimageAPIErrorZ_is_ok(const struct LDKCResult_PaymentPreimageAPIErrorZ *NONNULL_PTR o);
16681 * Frees any resources used by the CResult_PaymentPreimageAPIErrorZ.
16683 void CResult_PaymentPreimageAPIErrorZ_free(struct LDKCResult_PaymentPreimageAPIErrorZ _res);
16686 * Creates a new CResult_PaymentPreimageAPIErrorZ which has the same data as `orig`
16687 * but with all dynamically-allocated buffers duplicated in new buffers.
16689 struct LDKCResult_PaymentPreimageAPIErrorZ CResult_PaymentPreimageAPIErrorZ_clone(const struct LDKCResult_PaymentPreimageAPIErrorZ *NONNULL_PTR orig);
16692 * Creates a new CResult_CounterpartyForwardingInfoDecodeErrorZ in the success state.
16694 struct LDKCResult_CounterpartyForwardingInfoDecodeErrorZ CResult_CounterpartyForwardingInfoDecodeErrorZ_ok(struct LDKCounterpartyForwardingInfo o);
16697 * Creates a new CResult_CounterpartyForwardingInfoDecodeErrorZ in the error state.
16699 struct LDKCResult_CounterpartyForwardingInfoDecodeErrorZ CResult_CounterpartyForwardingInfoDecodeErrorZ_err(struct LDKDecodeError e);
16702 * Checks if the given object is currently in the success state
16704 bool CResult_CounterpartyForwardingInfoDecodeErrorZ_is_ok(const struct LDKCResult_CounterpartyForwardingInfoDecodeErrorZ *NONNULL_PTR o);
16707 * Frees any resources used by the CResult_CounterpartyForwardingInfoDecodeErrorZ.
16709 void CResult_CounterpartyForwardingInfoDecodeErrorZ_free(struct LDKCResult_CounterpartyForwardingInfoDecodeErrorZ _res);
16712 * Creates a new CResult_CounterpartyForwardingInfoDecodeErrorZ which has the same data as `orig`
16713 * but with all dynamically-allocated buffers duplicated in new buffers.
16715 struct LDKCResult_CounterpartyForwardingInfoDecodeErrorZ CResult_CounterpartyForwardingInfoDecodeErrorZ_clone(const struct LDKCResult_CounterpartyForwardingInfoDecodeErrorZ *NONNULL_PTR orig);
16718 * Creates a new CResult_ChannelCounterpartyDecodeErrorZ in the success state.
16720 struct LDKCResult_ChannelCounterpartyDecodeErrorZ CResult_ChannelCounterpartyDecodeErrorZ_ok(struct LDKChannelCounterparty o);
16723 * Creates a new CResult_ChannelCounterpartyDecodeErrorZ in the error state.
16725 struct LDKCResult_ChannelCounterpartyDecodeErrorZ CResult_ChannelCounterpartyDecodeErrorZ_err(struct LDKDecodeError e);
16728 * Checks if the given object is currently in the success state
16730 bool CResult_ChannelCounterpartyDecodeErrorZ_is_ok(const struct LDKCResult_ChannelCounterpartyDecodeErrorZ *NONNULL_PTR o);
16733 * Frees any resources used by the CResult_ChannelCounterpartyDecodeErrorZ.
16735 void CResult_ChannelCounterpartyDecodeErrorZ_free(struct LDKCResult_ChannelCounterpartyDecodeErrorZ _res);
16738 * Creates a new CResult_ChannelCounterpartyDecodeErrorZ which has the same data as `orig`
16739 * but with all dynamically-allocated buffers duplicated in new buffers.
16741 struct LDKCResult_ChannelCounterpartyDecodeErrorZ CResult_ChannelCounterpartyDecodeErrorZ_clone(const struct LDKCResult_ChannelCounterpartyDecodeErrorZ *NONNULL_PTR orig);
16744 * Creates a new CResult_ChannelDetailsDecodeErrorZ in the success state.
16746 struct LDKCResult_ChannelDetailsDecodeErrorZ CResult_ChannelDetailsDecodeErrorZ_ok(struct LDKChannelDetails o);
16749 * Creates a new CResult_ChannelDetailsDecodeErrorZ in the error state.
16751 struct LDKCResult_ChannelDetailsDecodeErrorZ CResult_ChannelDetailsDecodeErrorZ_err(struct LDKDecodeError e);
16754 * Checks if the given object is currently in the success state
16756 bool CResult_ChannelDetailsDecodeErrorZ_is_ok(const struct LDKCResult_ChannelDetailsDecodeErrorZ *NONNULL_PTR o);
16759 * Frees any resources used by the CResult_ChannelDetailsDecodeErrorZ.
16761 void CResult_ChannelDetailsDecodeErrorZ_free(struct LDKCResult_ChannelDetailsDecodeErrorZ _res);
16764 * Creates a new CResult_ChannelDetailsDecodeErrorZ which has the same data as `orig`
16765 * but with all dynamically-allocated buffers duplicated in new buffers.
16767 struct LDKCResult_ChannelDetailsDecodeErrorZ CResult_ChannelDetailsDecodeErrorZ_clone(const struct LDKCResult_ChannelDetailsDecodeErrorZ *NONNULL_PTR orig);
16770 * Creates a new CResult_PhantomRouteHintsDecodeErrorZ in the success state.
16772 struct LDKCResult_PhantomRouteHintsDecodeErrorZ CResult_PhantomRouteHintsDecodeErrorZ_ok(struct LDKPhantomRouteHints o);
16775 * Creates a new CResult_PhantomRouteHintsDecodeErrorZ in the error state.
16777 struct LDKCResult_PhantomRouteHintsDecodeErrorZ CResult_PhantomRouteHintsDecodeErrorZ_err(struct LDKDecodeError e);
16780 * Checks if the given object is currently in the success state
16782 bool CResult_PhantomRouteHintsDecodeErrorZ_is_ok(const struct LDKCResult_PhantomRouteHintsDecodeErrorZ *NONNULL_PTR o);
16785 * Frees any resources used by the CResult_PhantomRouteHintsDecodeErrorZ.
16787 void CResult_PhantomRouteHintsDecodeErrorZ_free(struct LDKCResult_PhantomRouteHintsDecodeErrorZ _res);
16790 * Creates a new CResult_PhantomRouteHintsDecodeErrorZ which has the same data as `orig`
16791 * but with all dynamically-allocated buffers duplicated in new buffers.
16793 struct LDKCResult_PhantomRouteHintsDecodeErrorZ CResult_PhantomRouteHintsDecodeErrorZ_clone(const struct LDKCResult_PhantomRouteHintsDecodeErrorZ *NONNULL_PTR orig);
16796 * Frees the buffer pointed to by `data` if `datalen` is non-0.
16798 void CVec_ChannelMonitorZ_free(struct LDKCVec_ChannelMonitorZ _res);
16801 * Creates a new C2Tuple_BlockHashChannelManagerZ from the contained elements.
16803 struct LDKC2Tuple_BlockHashChannelManagerZ C2Tuple_BlockHashChannelManagerZ_new(struct LDKThirtyTwoBytes a, struct LDKChannelManager b);
16806 * Frees any resources used by the C2Tuple_BlockHashChannelManagerZ.
16808 void C2Tuple_BlockHashChannelManagerZ_free(struct LDKC2Tuple_BlockHashChannelManagerZ _res);
16811 * Creates a new CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ in the success state.
16813 struct LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_ok(struct LDKC2Tuple_BlockHashChannelManagerZ o);
16816 * Creates a new CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ in the error state.
16818 struct LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_err(struct LDKDecodeError e);
16821 * Checks if the given object is currently in the success state
16823 bool CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_is_ok(const struct LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ *NONNULL_PTR o);
16826 * Frees any resources used by the CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ.
16828 void CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_free(struct LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ _res);
16831 * Creates a new CResult_ChannelConfigDecodeErrorZ in the success state.
16833 struct LDKCResult_ChannelConfigDecodeErrorZ CResult_ChannelConfigDecodeErrorZ_ok(struct LDKChannelConfig o);
16836 * Creates a new CResult_ChannelConfigDecodeErrorZ in the error state.
16838 struct LDKCResult_ChannelConfigDecodeErrorZ CResult_ChannelConfigDecodeErrorZ_err(struct LDKDecodeError e);
16841 * Checks if the given object is currently in the success state
16843 bool CResult_ChannelConfigDecodeErrorZ_is_ok(const struct LDKCResult_ChannelConfigDecodeErrorZ *NONNULL_PTR o);
16846 * Frees any resources used by the CResult_ChannelConfigDecodeErrorZ.
16848 void CResult_ChannelConfigDecodeErrorZ_free(struct LDKCResult_ChannelConfigDecodeErrorZ _res);
16851 * Creates a new CResult_ChannelConfigDecodeErrorZ which has the same data as `orig`
16852 * but with all dynamically-allocated buffers duplicated in new buffers.
16854 struct LDKCResult_ChannelConfigDecodeErrorZ CResult_ChannelConfigDecodeErrorZ_clone(const struct LDKCResult_ChannelConfigDecodeErrorZ *NONNULL_PTR orig);
16857 * Creates a new CResult_OutPointDecodeErrorZ in the success state.
16859 struct LDKCResult_OutPointDecodeErrorZ CResult_OutPointDecodeErrorZ_ok(struct LDKOutPoint o);
16862 * Creates a new CResult_OutPointDecodeErrorZ in the error state.
16864 struct LDKCResult_OutPointDecodeErrorZ CResult_OutPointDecodeErrorZ_err(struct LDKDecodeError e);
16867 * Checks if the given object is currently in the success state
16869 bool CResult_OutPointDecodeErrorZ_is_ok(const struct LDKCResult_OutPointDecodeErrorZ *NONNULL_PTR o);
16872 * Frees any resources used by the CResult_OutPointDecodeErrorZ.
16874 void CResult_OutPointDecodeErrorZ_free(struct LDKCResult_OutPointDecodeErrorZ _res);
16877 * Creates a new CResult_OutPointDecodeErrorZ which has the same data as `orig`
16878 * but with all dynamically-allocated buffers duplicated in new buffers.
16880 struct LDKCResult_OutPointDecodeErrorZ CResult_OutPointDecodeErrorZ_clone(const struct LDKCResult_OutPointDecodeErrorZ *NONNULL_PTR orig);
16883 * Constructs a new COption_TypeZ containing a crate::lightning::ln::wire::Type
16885 struct LDKCOption_TypeZ COption_TypeZ_some(struct LDKType o);
16888 * Constructs a new COption_TypeZ containing nothing
16890 struct LDKCOption_TypeZ COption_TypeZ_none(void);
16893 * Frees any resources associated with the crate::lightning::ln::wire::Type, if we are in the Some state
16895 void COption_TypeZ_free(struct LDKCOption_TypeZ _res);
16898 * Creates a new CResult_COption_TypeZDecodeErrorZ in the success state.
16900 struct LDKCResult_COption_TypeZDecodeErrorZ CResult_COption_TypeZDecodeErrorZ_ok(struct LDKCOption_TypeZ o);
16903 * Creates a new CResult_COption_TypeZDecodeErrorZ in the error state.
16905 struct LDKCResult_COption_TypeZDecodeErrorZ CResult_COption_TypeZDecodeErrorZ_err(struct LDKDecodeError e);
16908 * Checks if the given object is currently in the success state
16910 bool CResult_COption_TypeZDecodeErrorZ_is_ok(const struct LDKCResult_COption_TypeZDecodeErrorZ *NONNULL_PTR o);
16913 * Frees any resources used by the CResult_COption_TypeZDecodeErrorZ.
16915 void CResult_COption_TypeZDecodeErrorZ_free(struct LDKCResult_COption_TypeZDecodeErrorZ _res);
16918 * Creates a new CResult_PaymentIdPaymentErrorZ in the success state.
16920 struct LDKCResult_PaymentIdPaymentErrorZ CResult_PaymentIdPaymentErrorZ_ok(struct LDKThirtyTwoBytes o);
16923 * Creates a new CResult_PaymentIdPaymentErrorZ in the error state.
16925 struct LDKCResult_PaymentIdPaymentErrorZ CResult_PaymentIdPaymentErrorZ_err(struct LDKPaymentError e);
16928 * Checks if the given object is currently in the success state
16930 bool CResult_PaymentIdPaymentErrorZ_is_ok(const struct LDKCResult_PaymentIdPaymentErrorZ *NONNULL_PTR o);
16933 * Frees any resources used by the CResult_PaymentIdPaymentErrorZ.
16935 void CResult_PaymentIdPaymentErrorZ_free(struct LDKCResult_PaymentIdPaymentErrorZ _res);
16938 * Creates a new CResult_PaymentIdPaymentErrorZ which has the same data as `orig`
16939 * but with all dynamically-allocated buffers duplicated in new buffers.
16941 struct LDKCResult_PaymentIdPaymentErrorZ CResult_PaymentIdPaymentErrorZ_clone(const struct LDKCResult_PaymentIdPaymentErrorZ *NONNULL_PTR orig);
16944 * Creates a new CResult_InFlightHtlcsDecodeErrorZ in the success state.
16946 struct LDKCResult_InFlightHtlcsDecodeErrorZ CResult_InFlightHtlcsDecodeErrorZ_ok(struct LDKInFlightHtlcs o);
16949 * Creates a new CResult_InFlightHtlcsDecodeErrorZ in the error state.
16951 struct LDKCResult_InFlightHtlcsDecodeErrorZ CResult_InFlightHtlcsDecodeErrorZ_err(struct LDKDecodeError e);
16954 * Checks if the given object is currently in the success state
16956 bool CResult_InFlightHtlcsDecodeErrorZ_is_ok(const struct LDKCResult_InFlightHtlcsDecodeErrorZ *NONNULL_PTR o);
16959 * Frees any resources used by the CResult_InFlightHtlcsDecodeErrorZ.
16961 void CResult_InFlightHtlcsDecodeErrorZ_free(struct LDKCResult_InFlightHtlcsDecodeErrorZ _res);
16964 * Creates a new CResult_SiPrefixParseErrorZ in the success state.
16966 struct LDKCResult_SiPrefixParseErrorZ CResult_SiPrefixParseErrorZ_ok(enum LDKSiPrefix o);
16969 * Creates a new CResult_SiPrefixParseErrorZ in the error state.
16971 struct LDKCResult_SiPrefixParseErrorZ CResult_SiPrefixParseErrorZ_err(struct LDKParseError e);
16974 * Checks if the given object is currently in the success state
16976 bool CResult_SiPrefixParseErrorZ_is_ok(const struct LDKCResult_SiPrefixParseErrorZ *NONNULL_PTR o);
16979 * Frees any resources used by the CResult_SiPrefixParseErrorZ.
16981 void CResult_SiPrefixParseErrorZ_free(struct LDKCResult_SiPrefixParseErrorZ _res);
16984 * Creates a new CResult_SiPrefixParseErrorZ which has the same data as `orig`
16985 * but with all dynamically-allocated buffers duplicated in new buffers.
16987 struct LDKCResult_SiPrefixParseErrorZ CResult_SiPrefixParseErrorZ_clone(const struct LDKCResult_SiPrefixParseErrorZ *NONNULL_PTR orig);
16990 * Creates a new CResult_InvoiceParseOrSemanticErrorZ in the success state.
16992 struct LDKCResult_InvoiceParseOrSemanticErrorZ CResult_InvoiceParseOrSemanticErrorZ_ok(struct LDKInvoice o);
16995 * Creates a new CResult_InvoiceParseOrSemanticErrorZ in the error state.
16997 struct LDKCResult_InvoiceParseOrSemanticErrorZ CResult_InvoiceParseOrSemanticErrorZ_err(struct LDKParseOrSemanticError e);
17000 * Checks if the given object is currently in the success state
17002 bool CResult_InvoiceParseOrSemanticErrorZ_is_ok(const struct LDKCResult_InvoiceParseOrSemanticErrorZ *NONNULL_PTR o);
17005 * Frees any resources used by the CResult_InvoiceParseOrSemanticErrorZ.
17007 void CResult_InvoiceParseOrSemanticErrorZ_free(struct LDKCResult_InvoiceParseOrSemanticErrorZ _res);
17010 * Creates a new CResult_InvoiceParseOrSemanticErrorZ which has the same data as `orig`
17011 * but with all dynamically-allocated buffers duplicated in new buffers.
17013 struct LDKCResult_InvoiceParseOrSemanticErrorZ CResult_InvoiceParseOrSemanticErrorZ_clone(const struct LDKCResult_InvoiceParseOrSemanticErrorZ *NONNULL_PTR orig);
17016 * Creates a new CResult_SignedRawInvoiceParseErrorZ in the success state.
17018 struct LDKCResult_SignedRawInvoiceParseErrorZ CResult_SignedRawInvoiceParseErrorZ_ok(struct LDKSignedRawInvoice o);
17021 * Creates a new CResult_SignedRawInvoiceParseErrorZ in the error state.
17023 struct LDKCResult_SignedRawInvoiceParseErrorZ CResult_SignedRawInvoiceParseErrorZ_err(struct LDKParseError e);
17026 * Checks if the given object is currently in the success state
17028 bool CResult_SignedRawInvoiceParseErrorZ_is_ok(const struct LDKCResult_SignedRawInvoiceParseErrorZ *NONNULL_PTR o);
17031 * Frees any resources used by the CResult_SignedRawInvoiceParseErrorZ.
17033 void CResult_SignedRawInvoiceParseErrorZ_free(struct LDKCResult_SignedRawInvoiceParseErrorZ _res);
17036 * Creates a new CResult_SignedRawInvoiceParseErrorZ which has the same data as `orig`
17037 * but with all dynamically-allocated buffers duplicated in new buffers.
17039 struct LDKCResult_SignedRawInvoiceParseErrorZ CResult_SignedRawInvoiceParseErrorZ_clone(const struct LDKCResult_SignedRawInvoiceParseErrorZ *NONNULL_PTR orig);
17042 * Creates a new tuple which has the same data as `orig`
17043 * but with all dynamically-allocated buffers duplicated in new buffers.
17045 struct LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ C3Tuple_RawInvoice_u832InvoiceSignatureZ_clone(const struct LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ *NONNULL_PTR orig);
17048 * Creates a new C3Tuple_RawInvoice_u832InvoiceSignatureZ from the contained elements.
17050 struct LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ C3Tuple_RawInvoice_u832InvoiceSignatureZ_new(struct LDKRawInvoice a, struct LDKThirtyTwoBytes b, struct LDKInvoiceSignature c);
17053 * Frees any resources used by the C3Tuple_RawInvoice_u832InvoiceSignatureZ.
17055 void C3Tuple_RawInvoice_u832InvoiceSignatureZ_free(struct LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ _res);
17058 * Creates a new CResult_PayeePubKeyErrorZ in the success state.
17060 struct LDKCResult_PayeePubKeyErrorZ CResult_PayeePubKeyErrorZ_ok(struct LDKPayeePubKey o);
17063 * Creates a new CResult_PayeePubKeyErrorZ in the error state.
17065 struct LDKCResult_PayeePubKeyErrorZ CResult_PayeePubKeyErrorZ_err(enum LDKSecp256k1Error e);
17068 * Checks if the given object is currently in the success state
17070 bool CResult_PayeePubKeyErrorZ_is_ok(const struct LDKCResult_PayeePubKeyErrorZ *NONNULL_PTR o);
17073 * Frees any resources used by the CResult_PayeePubKeyErrorZ.
17075 void CResult_PayeePubKeyErrorZ_free(struct LDKCResult_PayeePubKeyErrorZ _res);
17078 * Creates a new CResult_PayeePubKeyErrorZ which has the same data as `orig`
17079 * but with all dynamically-allocated buffers duplicated in new buffers.
17081 struct LDKCResult_PayeePubKeyErrorZ CResult_PayeePubKeyErrorZ_clone(const struct LDKCResult_PayeePubKeyErrorZ *NONNULL_PTR orig);
17084 * Frees the buffer pointed to by `data` if `datalen` is non-0.
17086 void CVec_PrivateRouteZ_free(struct LDKCVec_PrivateRouteZ _res);
17089 * Creates a new CResult_PositiveTimestampCreationErrorZ in the success state.
17091 struct LDKCResult_PositiveTimestampCreationErrorZ CResult_PositiveTimestampCreationErrorZ_ok(struct LDKPositiveTimestamp o);
17094 * Creates a new CResult_PositiveTimestampCreationErrorZ in the error state.
17096 struct LDKCResult_PositiveTimestampCreationErrorZ CResult_PositiveTimestampCreationErrorZ_err(enum LDKCreationError e);
17099 * Checks if the given object is currently in the success state
17101 bool CResult_PositiveTimestampCreationErrorZ_is_ok(const struct LDKCResult_PositiveTimestampCreationErrorZ *NONNULL_PTR o);
17104 * Frees any resources used by the CResult_PositiveTimestampCreationErrorZ.
17106 void CResult_PositiveTimestampCreationErrorZ_free(struct LDKCResult_PositiveTimestampCreationErrorZ _res);
17109 * Creates a new CResult_PositiveTimestampCreationErrorZ which has the same data as `orig`
17110 * but with all dynamically-allocated buffers duplicated in new buffers.
17112 struct LDKCResult_PositiveTimestampCreationErrorZ CResult_PositiveTimestampCreationErrorZ_clone(const struct LDKCResult_PositiveTimestampCreationErrorZ *NONNULL_PTR orig);
17115 * Creates a new CResult_NoneSemanticErrorZ in the success state.
17117 struct LDKCResult_NoneSemanticErrorZ CResult_NoneSemanticErrorZ_ok(void);
17120 * Creates a new CResult_NoneSemanticErrorZ in the error state.
17122 struct LDKCResult_NoneSemanticErrorZ CResult_NoneSemanticErrorZ_err(enum LDKSemanticError e);
17125 * Checks if the given object is currently in the success state
17127 bool CResult_NoneSemanticErrorZ_is_ok(const struct LDKCResult_NoneSemanticErrorZ *NONNULL_PTR o);
17130 * Frees any resources used by the CResult_NoneSemanticErrorZ.
17132 void CResult_NoneSemanticErrorZ_free(struct LDKCResult_NoneSemanticErrorZ _res);
17135 * Creates a new CResult_NoneSemanticErrorZ which has the same data as `orig`
17136 * but with all dynamically-allocated buffers duplicated in new buffers.
17138 struct LDKCResult_NoneSemanticErrorZ CResult_NoneSemanticErrorZ_clone(const struct LDKCResult_NoneSemanticErrorZ *NONNULL_PTR orig);
17141 * Creates a new CResult_InvoiceSemanticErrorZ in the success state.
17143 struct LDKCResult_InvoiceSemanticErrorZ CResult_InvoiceSemanticErrorZ_ok(struct LDKInvoice o);
17146 * Creates a new CResult_InvoiceSemanticErrorZ in the error state.
17148 struct LDKCResult_InvoiceSemanticErrorZ CResult_InvoiceSemanticErrorZ_err(enum LDKSemanticError e);
17151 * Checks if the given object is currently in the success state
17153 bool CResult_InvoiceSemanticErrorZ_is_ok(const struct LDKCResult_InvoiceSemanticErrorZ *NONNULL_PTR o);
17156 * Frees any resources used by the CResult_InvoiceSemanticErrorZ.
17158 void CResult_InvoiceSemanticErrorZ_free(struct LDKCResult_InvoiceSemanticErrorZ _res);
17161 * Creates a new CResult_InvoiceSemanticErrorZ which has the same data as `orig`
17162 * but with all dynamically-allocated buffers duplicated in new buffers.
17164 struct LDKCResult_InvoiceSemanticErrorZ CResult_InvoiceSemanticErrorZ_clone(const struct LDKCResult_InvoiceSemanticErrorZ *NONNULL_PTR orig);
17167 * Creates a new CResult_DescriptionCreationErrorZ in the success state.
17169 struct LDKCResult_DescriptionCreationErrorZ CResult_DescriptionCreationErrorZ_ok(struct LDKDescription o);
17172 * Creates a new CResult_DescriptionCreationErrorZ in the error state.
17174 struct LDKCResult_DescriptionCreationErrorZ CResult_DescriptionCreationErrorZ_err(enum LDKCreationError e);
17177 * Checks if the given object is currently in the success state
17179 bool CResult_DescriptionCreationErrorZ_is_ok(const struct LDKCResult_DescriptionCreationErrorZ *NONNULL_PTR o);
17182 * Frees any resources used by the CResult_DescriptionCreationErrorZ.
17184 void CResult_DescriptionCreationErrorZ_free(struct LDKCResult_DescriptionCreationErrorZ _res);
17187 * Creates a new CResult_DescriptionCreationErrorZ which has the same data as `orig`
17188 * but with all dynamically-allocated buffers duplicated in new buffers.
17190 struct LDKCResult_DescriptionCreationErrorZ CResult_DescriptionCreationErrorZ_clone(const struct LDKCResult_DescriptionCreationErrorZ *NONNULL_PTR orig);
17193 * Creates a new CResult_PrivateRouteCreationErrorZ in the success state.
17195 struct LDKCResult_PrivateRouteCreationErrorZ CResult_PrivateRouteCreationErrorZ_ok(struct LDKPrivateRoute o);
17198 * Creates a new CResult_PrivateRouteCreationErrorZ in the error state.
17200 struct LDKCResult_PrivateRouteCreationErrorZ CResult_PrivateRouteCreationErrorZ_err(enum LDKCreationError e);
17203 * Checks if the given object is currently in the success state
17205 bool CResult_PrivateRouteCreationErrorZ_is_ok(const struct LDKCResult_PrivateRouteCreationErrorZ *NONNULL_PTR o);
17208 * Frees any resources used by the CResult_PrivateRouteCreationErrorZ.
17210 void CResult_PrivateRouteCreationErrorZ_free(struct LDKCResult_PrivateRouteCreationErrorZ _res);
17213 * Creates a new CResult_PrivateRouteCreationErrorZ which has the same data as `orig`
17214 * but with all dynamically-allocated buffers duplicated in new buffers.
17216 struct LDKCResult_PrivateRouteCreationErrorZ CResult_PrivateRouteCreationErrorZ_clone(const struct LDKCResult_PrivateRouteCreationErrorZ *NONNULL_PTR orig);
17219 * Creates a new CResult_StringErrorZ in the success state.
17221 struct LDKCResult_StringErrorZ CResult_StringErrorZ_ok(struct LDKStr o);
17224 * Creates a new CResult_StringErrorZ in the error state.
17226 struct LDKCResult_StringErrorZ CResult_StringErrorZ_err(enum LDKSecp256k1Error e);
17229 * Checks if the given object is currently in the success state
17231 bool CResult_StringErrorZ_is_ok(const struct LDKCResult_StringErrorZ *NONNULL_PTR o);
17234 * Frees any resources used by the CResult_StringErrorZ.
17236 void CResult_StringErrorZ_free(struct LDKCResult_StringErrorZ _res);
17239 * Creates a new CResult_StringErrorZ which has the same data as `orig`
17240 * but with all dynamically-allocated buffers duplicated in new buffers.
17242 struct LDKCResult_StringErrorZ CResult_StringErrorZ_clone(const struct LDKCResult_StringErrorZ *NONNULL_PTR orig);
17245 * Creates a new CResult_ChannelMonitorUpdateDecodeErrorZ in the success state.
17247 struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ CResult_ChannelMonitorUpdateDecodeErrorZ_ok(struct LDKChannelMonitorUpdate o);
17250 * Creates a new CResult_ChannelMonitorUpdateDecodeErrorZ in the error state.
17252 struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ CResult_ChannelMonitorUpdateDecodeErrorZ_err(struct LDKDecodeError e);
17255 * Checks if the given object is currently in the success state
17257 bool CResult_ChannelMonitorUpdateDecodeErrorZ_is_ok(const struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ *NONNULL_PTR o);
17260 * Frees any resources used by the CResult_ChannelMonitorUpdateDecodeErrorZ.
17262 void CResult_ChannelMonitorUpdateDecodeErrorZ_free(struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ _res);
17265 * Creates a new CResult_ChannelMonitorUpdateDecodeErrorZ which has the same data as `orig`
17266 * but with all dynamically-allocated buffers duplicated in new buffers.
17268 struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ CResult_ChannelMonitorUpdateDecodeErrorZ_clone(const struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ *NONNULL_PTR orig);
17271 * Constructs a new COption_MonitorEventZ containing a crate::lightning::chain::channelmonitor::MonitorEvent
17273 struct LDKCOption_MonitorEventZ COption_MonitorEventZ_some(struct LDKMonitorEvent o);
17276 * Constructs a new COption_MonitorEventZ containing nothing
17278 struct LDKCOption_MonitorEventZ COption_MonitorEventZ_none(void);
17281 * Frees any resources associated with the crate::lightning::chain::channelmonitor::MonitorEvent, if we are in the Some state
17283 void COption_MonitorEventZ_free(struct LDKCOption_MonitorEventZ _res);
17286 * Creates a new COption_MonitorEventZ which has the same data as `orig`
17287 * but with all dynamically-allocated buffers duplicated in new buffers.
17289 struct LDKCOption_MonitorEventZ COption_MonitorEventZ_clone(const struct LDKCOption_MonitorEventZ *NONNULL_PTR orig);
17292 * Creates a new CResult_COption_MonitorEventZDecodeErrorZ in the success state.
17294 struct LDKCResult_COption_MonitorEventZDecodeErrorZ CResult_COption_MonitorEventZDecodeErrorZ_ok(struct LDKCOption_MonitorEventZ o);
17297 * Creates a new CResult_COption_MonitorEventZDecodeErrorZ in the error state.
17299 struct LDKCResult_COption_MonitorEventZDecodeErrorZ CResult_COption_MonitorEventZDecodeErrorZ_err(struct LDKDecodeError e);
17302 * Checks if the given object is currently in the success state
17304 bool CResult_COption_MonitorEventZDecodeErrorZ_is_ok(const struct LDKCResult_COption_MonitorEventZDecodeErrorZ *NONNULL_PTR o);
17307 * Frees any resources used by the CResult_COption_MonitorEventZDecodeErrorZ.
17309 void CResult_COption_MonitorEventZDecodeErrorZ_free(struct LDKCResult_COption_MonitorEventZDecodeErrorZ _res);
17312 * Creates a new CResult_COption_MonitorEventZDecodeErrorZ which has the same data as `orig`
17313 * but with all dynamically-allocated buffers duplicated in new buffers.
17315 struct LDKCResult_COption_MonitorEventZDecodeErrorZ CResult_COption_MonitorEventZDecodeErrorZ_clone(const struct LDKCResult_COption_MonitorEventZDecodeErrorZ *NONNULL_PTR orig);
17318 * Creates a new CResult_HTLCUpdateDecodeErrorZ in the success state.
17320 struct LDKCResult_HTLCUpdateDecodeErrorZ CResult_HTLCUpdateDecodeErrorZ_ok(struct LDKHTLCUpdate o);
17323 * Creates a new CResult_HTLCUpdateDecodeErrorZ in the error state.
17325 struct LDKCResult_HTLCUpdateDecodeErrorZ CResult_HTLCUpdateDecodeErrorZ_err(struct LDKDecodeError e);
17328 * Checks if the given object is currently in the success state
17330 bool CResult_HTLCUpdateDecodeErrorZ_is_ok(const struct LDKCResult_HTLCUpdateDecodeErrorZ *NONNULL_PTR o);
17333 * Frees any resources used by the CResult_HTLCUpdateDecodeErrorZ.
17335 void CResult_HTLCUpdateDecodeErrorZ_free(struct LDKCResult_HTLCUpdateDecodeErrorZ _res);
17338 * Creates a new CResult_HTLCUpdateDecodeErrorZ which has the same data as `orig`
17339 * but with all dynamically-allocated buffers duplicated in new buffers.
17341 struct LDKCResult_HTLCUpdateDecodeErrorZ CResult_HTLCUpdateDecodeErrorZ_clone(const struct LDKCResult_HTLCUpdateDecodeErrorZ *NONNULL_PTR orig);
17344 * Creates a new tuple which has the same data as `orig`
17345 * but with all dynamically-allocated buffers duplicated in new buffers.
17347 struct LDKC2Tuple_OutPointScriptZ C2Tuple_OutPointScriptZ_clone(const struct LDKC2Tuple_OutPointScriptZ *NONNULL_PTR orig);
17350 * Creates a new C2Tuple_OutPointScriptZ from the contained elements.
17352 struct LDKC2Tuple_OutPointScriptZ C2Tuple_OutPointScriptZ_new(struct LDKOutPoint a, struct LDKCVec_u8Z b);
17355 * Frees any resources used by the C2Tuple_OutPointScriptZ.
17357 void C2Tuple_OutPointScriptZ_free(struct LDKC2Tuple_OutPointScriptZ _res);
17360 * Creates a new tuple which has the same data as `orig`
17361 * but with all dynamically-allocated buffers duplicated in new buffers.
17363 struct LDKC2Tuple_u32ScriptZ C2Tuple_u32ScriptZ_clone(const struct LDKC2Tuple_u32ScriptZ *NONNULL_PTR orig);
17366 * Creates a new C2Tuple_u32ScriptZ from the contained elements.
17368 struct LDKC2Tuple_u32ScriptZ C2Tuple_u32ScriptZ_new(uint32_t a, struct LDKCVec_u8Z b);
17371 * Frees any resources used by the C2Tuple_u32ScriptZ.
17373 void C2Tuple_u32ScriptZ_free(struct LDKC2Tuple_u32ScriptZ _res);
17376 * Frees the buffer pointed to by `data` if `datalen` is non-0.
17378 void CVec_C2Tuple_u32ScriptZZ_free(struct LDKCVec_C2Tuple_u32ScriptZZ _res);
17381 * Creates a new tuple which has the same data as `orig`
17382 * but with all dynamically-allocated buffers duplicated in new buffers.
17384 struct LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_clone(const struct LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ *NONNULL_PTR orig);
17387 * Creates a new C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ from the contained elements.
17389 struct LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_new(struct LDKThirtyTwoBytes a, struct LDKCVec_C2Tuple_u32ScriptZZ b);
17392 * Frees any resources used by the C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ.
17394 void C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_free(struct LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ _res);
17397 * Frees the buffer pointed to by `data` if `datalen` is non-0.
17399 void CVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ_free(struct LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ _res);
17402 * Frees the buffer pointed to by `data` if `datalen` is non-0.
17404 void CVec_EventZ_free(struct LDKCVec_EventZ _res);
17407 * Frees the buffer pointed to by `data` if `datalen` is non-0.
17409 void CVec_TransactionZ_free(struct LDKCVec_TransactionZ _res);
17412 * Creates a new tuple which has the same data as `orig`
17413 * but with all dynamically-allocated buffers duplicated in new buffers.
17415 struct LDKC2Tuple_u32TxOutZ C2Tuple_u32TxOutZ_clone(const struct LDKC2Tuple_u32TxOutZ *NONNULL_PTR orig);
17418 * Creates a new C2Tuple_u32TxOutZ from the contained elements.
17420 struct LDKC2Tuple_u32TxOutZ C2Tuple_u32TxOutZ_new(uint32_t a, struct LDKTxOut b);
17423 * Frees any resources used by the C2Tuple_u32TxOutZ.
17425 void C2Tuple_u32TxOutZ_free(struct LDKC2Tuple_u32TxOutZ _res);
17428 * Frees the buffer pointed to by `data` if `datalen` is non-0.
17430 void CVec_C2Tuple_u32TxOutZZ_free(struct LDKCVec_C2Tuple_u32TxOutZZ _res);
17433 * Creates a new tuple which has the same data as `orig`
17434 * but with all dynamically-allocated buffers duplicated in new buffers.
17436 struct LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_clone(const struct LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ *NONNULL_PTR orig);
17439 * Creates a new C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ from the contained elements.
17441 struct LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_new(struct LDKThirtyTwoBytes a, struct LDKCVec_C2Tuple_u32TxOutZZ b);
17444 * Frees any resources used by the C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ.
17446 void C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_free(struct LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ _res);
17449 * Frees the buffer pointed to by `data` if `datalen` is non-0.
17451 void CVec_TransactionOutputsZ_free(struct LDKCVec_TransactionOutputsZ _res);
17454 * Frees the buffer pointed to by `data` if `datalen` is non-0.
17456 void CVec_BalanceZ_free(struct LDKCVec_BalanceZ _res);
17459 * Creates a new CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ in the success state.
17461 struct LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_ok(struct LDKC2Tuple_BlockHashChannelMonitorZ o);
17464 * Creates a new CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ in the error state.
17466 struct LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_err(struct LDKDecodeError e);
17469 * Checks if the given object is currently in the success state
17471 bool CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_is_ok(const struct LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ *NONNULL_PTR o);
17474 * Frees any resources used by the CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ.
17476 void CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_free(struct LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ _res);
17479 * Creates a new C2Tuple_PublicKeyTypeZ from the contained elements.
17481 struct LDKC2Tuple_PublicKeyTypeZ C2Tuple_PublicKeyTypeZ_new(struct LDKPublicKey a, struct LDKType b);
17484 * Frees any resources used by the C2Tuple_PublicKeyTypeZ.
17486 void C2Tuple_PublicKeyTypeZ_free(struct LDKC2Tuple_PublicKeyTypeZ _res);
17489 * Frees the buffer pointed to by `data` if `datalen` is non-0.
17491 void CVec_C2Tuple_PublicKeyTypeZZ_free(struct LDKCVec_C2Tuple_PublicKeyTypeZZ _res);
17494 * Constructs a new COption_CustomOnionMessageContentsZ containing a crate::lightning::onion_message::packet::CustomOnionMessageContents
17496 struct LDKCOption_CustomOnionMessageContentsZ COption_CustomOnionMessageContentsZ_some(struct LDKCustomOnionMessageContents o);
17499 * Constructs a new COption_CustomOnionMessageContentsZ containing nothing
17501 struct LDKCOption_CustomOnionMessageContentsZ COption_CustomOnionMessageContentsZ_none(void);
17504 * Frees any resources associated with the crate::lightning::onion_message::packet::CustomOnionMessageContents, if we are in the Some state
17506 void COption_CustomOnionMessageContentsZ_free(struct LDKCOption_CustomOnionMessageContentsZ _res);
17509 * Creates a new CResult_COption_CustomOnionMessageContentsZDecodeErrorZ in the success state.
17511 struct LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ CResult_COption_CustomOnionMessageContentsZDecodeErrorZ_ok(struct LDKCOption_CustomOnionMessageContentsZ o);
17514 * Creates a new CResult_COption_CustomOnionMessageContentsZDecodeErrorZ in the error state.
17516 struct LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ CResult_COption_CustomOnionMessageContentsZDecodeErrorZ_err(struct LDKDecodeError e);
17519 * Checks if the given object is currently in the success state
17521 bool CResult_COption_CustomOnionMessageContentsZDecodeErrorZ_is_ok(const struct LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ *NONNULL_PTR o);
17524 * Frees any resources used by the CResult_COption_CustomOnionMessageContentsZDecodeErrorZ.
17526 void CResult_COption_CustomOnionMessageContentsZDecodeErrorZ_free(struct LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ _res);
17529 * Constructs a new COption_NetAddressZ containing a crate::lightning::ln::msgs::NetAddress
17531 struct LDKCOption_NetAddressZ COption_NetAddressZ_some(struct LDKNetAddress o);
17534 * Constructs a new COption_NetAddressZ containing nothing
17536 struct LDKCOption_NetAddressZ COption_NetAddressZ_none(void);
17539 * Frees any resources associated with the crate::lightning::ln::msgs::NetAddress, if we are in the Some state
17541 void COption_NetAddressZ_free(struct LDKCOption_NetAddressZ _res);
17544 * Creates a new COption_NetAddressZ which has the same data as `orig`
17545 * but with all dynamically-allocated buffers duplicated in new buffers.
17547 struct LDKCOption_NetAddressZ COption_NetAddressZ_clone(const struct LDKCOption_NetAddressZ *NONNULL_PTR orig);
17550 * Creates a new CResult_CVec_u8ZPeerHandleErrorZ in the success state.
17552 struct LDKCResult_CVec_u8ZPeerHandleErrorZ CResult_CVec_u8ZPeerHandleErrorZ_ok(struct LDKCVec_u8Z o);
17555 * Creates a new CResult_CVec_u8ZPeerHandleErrorZ in the error state.
17557 struct LDKCResult_CVec_u8ZPeerHandleErrorZ CResult_CVec_u8ZPeerHandleErrorZ_err(struct LDKPeerHandleError e);
17560 * Checks if the given object is currently in the success state
17562 bool CResult_CVec_u8ZPeerHandleErrorZ_is_ok(const struct LDKCResult_CVec_u8ZPeerHandleErrorZ *NONNULL_PTR o);
17565 * Frees any resources used by the CResult_CVec_u8ZPeerHandleErrorZ.
17567 void CResult_CVec_u8ZPeerHandleErrorZ_free(struct LDKCResult_CVec_u8ZPeerHandleErrorZ _res);
17570 * Creates a new CResult_CVec_u8ZPeerHandleErrorZ which has the same data as `orig`
17571 * but with all dynamically-allocated buffers duplicated in new buffers.
17573 struct LDKCResult_CVec_u8ZPeerHandleErrorZ CResult_CVec_u8ZPeerHandleErrorZ_clone(const struct LDKCResult_CVec_u8ZPeerHandleErrorZ *NONNULL_PTR orig);
17576 * Creates a new CResult_NonePeerHandleErrorZ in the success state.
17578 struct LDKCResult_NonePeerHandleErrorZ CResult_NonePeerHandleErrorZ_ok(void);
17581 * Creates a new CResult_NonePeerHandleErrorZ in the error state.
17583 struct LDKCResult_NonePeerHandleErrorZ CResult_NonePeerHandleErrorZ_err(struct LDKPeerHandleError e);
17586 * Checks if the given object is currently in the success state
17588 bool CResult_NonePeerHandleErrorZ_is_ok(const struct LDKCResult_NonePeerHandleErrorZ *NONNULL_PTR o);
17591 * Frees any resources used by the CResult_NonePeerHandleErrorZ.
17593 void CResult_NonePeerHandleErrorZ_free(struct LDKCResult_NonePeerHandleErrorZ _res);
17596 * Creates a new CResult_NonePeerHandleErrorZ which has the same data as `orig`
17597 * but with all dynamically-allocated buffers duplicated in new buffers.
17599 struct LDKCResult_NonePeerHandleErrorZ CResult_NonePeerHandleErrorZ_clone(const struct LDKCResult_NonePeerHandleErrorZ *NONNULL_PTR orig);
17602 * Creates a new CResult_boolPeerHandleErrorZ in the success state.
17604 struct LDKCResult_boolPeerHandleErrorZ CResult_boolPeerHandleErrorZ_ok(bool o);
17607 * Creates a new CResult_boolPeerHandleErrorZ in the error state.
17609 struct LDKCResult_boolPeerHandleErrorZ CResult_boolPeerHandleErrorZ_err(struct LDKPeerHandleError e);
17612 * Checks if the given object is currently in the success state
17614 bool CResult_boolPeerHandleErrorZ_is_ok(const struct LDKCResult_boolPeerHandleErrorZ *NONNULL_PTR o);
17617 * Frees any resources used by the CResult_boolPeerHandleErrorZ.
17619 void CResult_boolPeerHandleErrorZ_free(struct LDKCResult_boolPeerHandleErrorZ _res);
17622 * Creates a new CResult_boolPeerHandleErrorZ which has the same data as `orig`
17623 * but with all dynamically-allocated buffers duplicated in new buffers.
17625 struct LDKCResult_boolPeerHandleErrorZ CResult_boolPeerHandleErrorZ_clone(const struct LDKCResult_boolPeerHandleErrorZ *NONNULL_PTR orig);
17628 * Creates a new CResult_NoneSendErrorZ in the success state.
17630 struct LDKCResult_NoneSendErrorZ CResult_NoneSendErrorZ_ok(void);
17633 * Creates a new CResult_NoneSendErrorZ in the error state.
17635 struct LDKCResult_NoneSendErrorZ CResult_NoneSendErrorZ_err(struct LDKSendError e);
17638 * Checks if the given object is currently in the success state
17640 bool CResult_NoneSendErrorZ_is_ok(const struct LDKCResult_NoneSendErrorZ *NONNULL_PTR o);
17643 * Frees any resources used by the CResult_NoneSendErrorZ.
17645 void CResult_NoneSendErrorZ_free(struct LDKCResult_NoneSendErrorZ _res);
17648 * Creates a new CResult_u32GraphSyncErrorZ in the success state.
17650 struct LDKCResult_u32GraphSyncErrorZ CResult_u32GraphSyncErrorZ_ok(uint32_t o);
17653 * Creates a new CResult_u32GraphSyncErrorZ in the error state.
17655 struct LDKCResult_u32GraphSyncErrorZ CResult_u32GraphSyncErrorZ_err(struct LDKGraphSyncError e);
17658 * Checks if the given object is currently in the success state
17660 bool CResult_u32GraphSyncErrorZ_is_ok(const struct LDKCResult_u32GraphSyncErrorZ *NONNULL_PTR o);
17663 * Frees any resources used by the CResult_u32GraphSyncErrorZ.
17665 void CResult_u32GraphSyncErrorZ_free(struct LDKCResult_u32GraphSyncErrorZ _res);
17668 * Creates a new CResult_NetAddressDecodeErrorZ in the success state.
17670 struct LDKCResult_NetAddressDecodeErrorZ CResult_NetAddressDecodeErrorZ_ok(struct LDKNetAddress o);
17673 * Creates a new CResult_NetAddressDecodeErrorZ in the error state.
17675 struct LDKCResult_NetAddressDecodeErrorZ CResult_NetAddressDecodeErrorZ_err(struct LDKDecodeError e);
17678 * Checks if the given object is currently in the success state
17680 bool CResult_NetAddressDecodeErrorZ_is_ok(const struct LDKCResult_NetAddressDecodeErrorZ *NONNULL_PTR o);
17683 * Frees any resources used by the CResult_NetAddressDecodeErrorZ.
17685 void CResult_NetAddressDecodeErrorZ_free(struct LDKCResult_NetAddressDecodeErrorZ _res);
17688 * Creates a new CResult_NetAddressDecodeErrorZ which has the same data as `orig`
17689 * but with all dynamically-allocated buffers duplicated in new buffers.
17691 struct LDKCResult_NetAddressDecodeErrorZ CResult_NetAddressDecodeErrorZ_clone(const struct LDKCResult_NetAddressDecodeErrorZ *NONNULL_PTR orig);
17694 * Frees the buffer pointed to by `data` if `datalen` is non-0.
17696 void CVec_UpdateAddHTLCZ_free(struct LDKCVec_UpdateAddHTLCZ _res);
17699 * Frees the buffer pointed to by `data` if `datalen` is non-0.
17701 void CVec_UpdateFulfillHTLCZ_free(struct LDKCVec_UpdateFulfillHTLCZ _res);
17704 * Frees the buffer pointed to by `data` if `datalen` is non-0.
17706 void CVec_UpdateFailHTLCZ_free(struct LDKCVec_UpdateFailHTLCZ _res);
17709 * Frees the buffer pointed to by `data` if `datalen` is non-0.
17711 void CVec_UpdateFailMalformedHTLCZ_free(struct LDKCVec_UpdateFailMalformedHTLCZ _res);
17714 * Creates a new CResult_AcceptChannelDecodeErrorZ in the success state.
17716 struct LDKCResult_AcceptChannelDecodeErrorZ CResult_AcceptChannelDecodeErrorZ_ok(struct LDKAcceptChannel o);
17719 * Creates a new CResult_AcceptChannelDecodeErrorZ in the error state.
17721 struct LDKCResult_AcceptChannelDecodeErrorZ CResult_AcceptChannelDecodeErrorZ_err(struct LDKDecodeError e);
17724 * Checks if the given object is currently in the success state
17726 bool CResult_AcceptChannelDecodeErrorZ_is_ok(const struct LDKCResult_AcceptChannelDecodeErrorZ *NONNULL_PTR o);
17729 * Frees any resources used by the CResult_AcceptChannelDecodeErrorZ.
17731 void CResult_AcceptChannelDecodeErrorZ_free(struct LDKCResult_AcceptChannelDecodeErrorZ _res);
17734 * Creates a new CResult_AcceptChannelDecodeErrorZ which has the same data as `orig`
17735 * but with all dynamically-allocated buffers duplicated in new buffers.
17737 struct LDKCResult_AcceptChannelDecodeErrorZ CResult_AcceptChannelDecodeErrorZ_clone(const struct LDKCResult_AcceptChannelDecodeErrorZ *NONNULL_PTR orig);
17740 * Creates a new CResult_AnnouncementSignaturesDecodeErrorZ in the success state.
17742 struct LDKCResult_AnnouncementSignaturesDecodeErrorZ CResult_AnnouncementSignaturesDecodeErrorZ_ok(struct LDKAnnouncementSignatures o);
17745 * Creates a new CResult_AnnouncementSignaturesDecodeErrorZ in the error state.
17747 struct LDKCResult_AnnouncementSignaturesDecodeErrorZ CResult_AnnouncementSignaturesDecodeErrorZ_err(struct LDKDecodeError e);
17750 * Checks if the given object is currently in the success state
17752 bool CResult_AnnouncementSignaturesDecodeErrorZ_is_ok(const struct LDKCResult_AnnouncementSignaturesDecodeErrorZ *NONNULL_PTR o);
17755 * Frees any resources used by the CResult_AnnouncementSignaturesDecodeErrorZ.
17757 void CResult_AnnouncementSignaturesDecodeErrorZ_free(struct LDKCResult_AnnouncementSignaturesDecodeErrorZ _res);
17760 * Creates a new CResult_AnnouncementSignaturesDecodeErrorZ which has the same data as `orig`
17761 * but with all dynamically-allocated buffers duplicated in new buffers.
17763 struct LDKCResult_AnnouncementSignaturesDecodeErrorZ CResult_AnnouncementSignaturesDecodeErrorZ_clone(const struct LDKCResult_AnnouncementSignaturesDecodeErrorZ *NONNULL_PTR orig);
17766 * Creates a new CResult_ChannelReestablishDecodeErrorZ in the success state.
17768 struct LDKCResult_ChannelReestablishDecodeErrorZ CResult_ChannelReestablishDecodeErrorZ_ok(struct LDKChannelReestablish o);
17771 * Creates a new CResult_ChannelReestablishDecodeErrorZ in the error state.
17773 struct LDKCResult_ChannelReestablishDecodeErrorZ CResult_ChannelReestablishDecodeErrorZ_err(struct LDKDecodeError e);
17776 * Checks if the given object is currently in the success state
17778 bool CResult_ChannelReestablishDecodeErrorZ_is_ok(const struct LDKCResult_ChannelReestablishDecodeErrorZ *NONNULL_PTR o);
17781 * Frees any resources used by the CResult_ChannelReestablishDecodeErrorZ.
17783 void CResult_ChannelReestablishDecodeErrorZ_free(struct LDKCResult_ChannelReestablishDecodeErrorZ _res);
17786 * Creates a new CResult_ChannelReestablishDecodeErrorZ which has the same data as `orig`
17787 * but with all dynamically-allocated buffers duplicated in new buffers.
17789 struct LDKCResult_ChannelReestablishDecodeErrorZ CResult_ChannelReestablishDecodeErrorZ_clone(const struct LDKCResult_ChannelReestablishDecodeErrorZ *NONNULL_PTR orig);
17792 * Creates a new CResult_ClosingSignedDecodeErrorZ in the success state.
17794 struct LDKCResult_ClosingSignedDecodeErrorZ CResult_ClosingSignedDecodeErrorZ_ok(struct LDKClosingSigned o);
17797 * Creates a new CResult_ClosingSignedDecodeErrorZ in the error state.
17799 struct LDKCResult_ClosingSignedDecodeErrorZ CResult_ClosingSignedDecodeErrorZ_err(struct LDKDecodeError e);
17802 * Checks if the given object is currently in the success state
17804 bool CResult_ClosingSignedDecodeErrorZ_is_ok(const struct LDKCResult_ClosingSignedDecodeErrorZ *NONNULL_PTR o);
17807 * Frees any resources used by the CResult_ClosingSignedDecodeErrorZ.
17809 void CResult_ClosingSignedDecodeErrorZ_free(struct LDKCResult_ClosingSignedDecodeErrorZ _res);
17812 * Creates a new CResult_ClosingSignedDecodeErrorZ which has the same data as `orig`
17813 * but with all dynamically-allocated buffers duplicated in new buffers.
17815 struct LDKCResult_ClosingSignedDecodeErrorZ CResult_ClosingSignedDecodeErrorZ_clone(const struct LDKCResult_ClosingSignedDecodeErrorZ *NONNULL_PTR orig);
17818 * Creates a new CResult_ClosingSignedFeeRangeDecodeErrorZ in the success state.
17820 struct LDKCResult_ClosingSignedFeeRangeDecodeErrorZ CResult_ClosingSignedFeeRangeDecodeErrorZ_ok(struct LDKClosingSignedFeeRange o);
17823 * Creates a new CResult_ClosingSignedFeeRangeDecodeErrorZ in the error state.
17825 struct LDKCResult_ClosingSignedFeeRangeDecodeErrorZ CResult_ClosingSignedFeeRangeDecodeErrorZ_err(struct LDKDecodeError e);
17828 * Checks if the given object is currently in the success state
17830 bool CResult_ClosingSignedFeeRangeDecodeErrorZ_is_ok(const struct LDKCResult_ClosingSignedFeeRangeDecodeErrorZ *NONNULL_PTR o);
17833 * Frees any resources used by the CResult_ClosingSignedFeeRangeDecodeErrorZ.
17835 void CResult_ClosingSignedFeeRangeDecodeErrorZ_free(struct LDKCResult_ClosingSignedFeeRangeDecodeErrorZ _res);
17838 * Creates a new CResult_ClosingSignedFeeRangeDecodeErrorZ which has the same data as `orig`
17839 * but with all dynamically-allocated buffers duplicated in new buffers.
17841 struct LDKCResult_ClosingSignedFeeRangeDecodeErrorZ CResult_ClosingSignedFeeRangeDecodeErrorZ_clone(const struct LDKCResult_ClosingSignedFeeRangeDecodeErrorZ *NONNULL_PTR orig);
17844 * Creates a new CResult_CommitmentSignedDecodeErrorZ in the success state.
17846 struct LDKCResult_CommitmentSignedDecodeErrorZ CResult_CommitmentSignedDecodeErrorZ_ok(struct LDKCommitmentSigned o);
17849 * Creates a new CResult_CommitmentSignedDecodeErrorZ in the error state.
17851 struct LDKCResult_CommitmentSignedDecodeErrorZ CResult_CommitmentSignedDecodeErrorZ_err(struct LDKDecodeError e);
17854 * Checks if the given object is currently in the success state
17856 bool CResult_CommitmentSignedDecodeErrorZ_is_ok(const struct LDKCResult_CommitmentSignedDecodeErrorZ *NONNULL_PTR o);
17859 * Frees any resources used by the CResult_CommitmentSignedDecodeErrorZ.
17861 void CResult_CommitmentSignedDecodeErrorZ_free(struct LDKCResult_CommitmentSignedDecodeErrorZ _res);
17864 * Creates a new CResult_CommitmentSignedDecodeErrorZ which has the same data as `orig`
17865 * but with all dynamically-allocated buffers duplicated in new buffers.
17867 struct LDKCResult_CommitmentSignedDecodeErrorZ CResult_CommitmentSignedDecodeErrorZ_clone(const struct LDKCResult_CommitmentSignedDecodeErrorZ *NONNULL_PTR orig);
17870 * Creates a new CResult_FundingCreatedDecodeErrorZ in the success state.
17872 struct LDKCResult_FundingCreatedDecodeErrorZ CResult_FundingCreatedDecodeErrorZ_ok(struct LDKFundingCreated o);
17875 * Creates a new CResult_FundingCreatedDecodeErrorZ in the error state.
17877 struct LDKCResult_FundingCreatedDecodeErrorZ CResult_FundingCreatedDecodeErrorZ_err(struct LDKDecodeError e);
17880 * Checks if the given object is currently in the success state
17882 bool CResult_FundingCreatedDecodeErrorZ_is_ok(const struct LDKCResult_FundingCreatedDecodeErrorZ *NONNULL_PTR o);
17885 * Frees any resources used by the CResult_FundingCreatedDecodeErrorZ.
17887 void CResult_FundingCreatedDecodeErrorZ_free(struct LDKCResult_FundingCreatedDecodeErrorZ _res);
17890 * Creates a new CResult_FundingCreatedDecodeErrorZ which has the same data as `orig`
17891 * but with all dynamically-allocated buffers duplicated in new buffers.
17893 struct LDKCResult_FundingCreatedDecodeErrorZ CResult_FundingCreatedDecodeErrorZ_clone(const struct LDKCResult_FundingCreatedDecodeErrorZ *NONNULL_PTR orig);
17896 * Creates a new CResult_FundingSignedDecodeErrorZ in the success state.
17898 struct LDKCResult_FundingSignedDecodeErrorZ CResult_FundingSignedDecodeErrorZ_ok(struct LDKFundingSigned o);
17901 * Creates a new CResult_FundingSignedDecodeErrorZ in the error state.
17903 struct LDKCResult_FundingSignedDecodeErrorZ CResult_FundingSignedDecodeErrorZ_err(struct LDKDecodeError e);
17906 * Checks if the given object is currently in the success state
17908 bool CResult_FundingSignedDecodeErrorZ_is_ok(const struct LDKCResult_FundingSignedDecodeErrorZ *NONNULL_PTR o);
17911 * Frees any resources used by the CResult_FundingSignedDecodeErrorZ.
17913 void CResult_FundingSignedDecodeErrorZ_free(struct LDKCResult_FundingSignedDecodeErrorZ _res);
17916 * Creates a new CResult_FundingSignedDecodeErrorZ which has the same data as `orig`
17917 * but with all dynamically-allocated buffers duplicated in new buffers.
17919 struct LDKCResult_FundingSignedDecodeErrorZ CResult_FundingSignedDecodeErrorZ_clone(const struct LDKCResult_FundingSignedDecodeErrorZ *NONNULL_PTR orig);
17922 * Creates a new CResult_ChannelReadyDecodeErrorZ in the success state.
17924 struct LDKCResult_ChannelReadyDecodeErrorZ CResult_ChannelReadyDecodeErrorZ_ok(struct LDKChannelReady o);
17927 * Creates a new CResult_ChannelReadyDecodeErrorZ in the error state.
17929 struct LDKCResult_ChannelReadyDecodeErrorZ CResult_ChannelReadyDecodeErrorZ_err(struct LDKDecodeError e);
17932 * Checks if the given object is currently in the success state
17934 bool CResult_ChannelReadyDecodeErrorZ_is_ok(const struct LDKCResult_ChannelReadyDecodeErrorZ *NONNULL_PTR o);
17937 * Frees any resources used by the CResult_ChannelReadyDecodeErrorZ.
17939 void CResult_ChannelReadyDecodeErrorZ_free(struct LDKCResult_ChannelReadyDecodeErrorZ _res);
17942 * Creates a new CResult_ChannelReadyDecodeErrorZ which has the same data as `orig`
17943 * but with all dynamically-allocated buffers duplicated in new buffers.
17945 struct LDKCResult_ChannelReadyDecodeErrorZ CResult_ChannelReadyDecodeErrorZ_clone(const struct LDKCResult_ChannelReadyDecodeErrorZ *NONNULL_PTR orig);
17948 * Creates a new CResult_InitDecodeErrorZ in the success state.
17950 struct LDKCResult_InitDecodeErrorZ CResult_InitDecodeErrorZ_ok(struct LDKInit o);
17953 * Creates a new CResult_InitDecodeErrorZ in the error state.
17955 struct LDKCResult_InitDecodeErrorZ CResult_InitDecodeErrorZ_err(struct LDKDecodeError e);
17958 * Checks if the given object is currently in the success state
17960 bool CResult_InitDecodeErrorZ_is_ok(const struct LDKCResult_InitDecodeErrorZ *NONNULL_PTR o);
17963 * Frees any resources used by the CResult_InitDecodeErrorZ.
17965 void CResult_InitDecodeErrorZ_free(struct LDKCResult_InitDecodeErrorZ _res);
17968 * Creates a new CResult_InitDecodeErrorZ which has the same data as `orig`
17969 * but with all dynamically-allocated buffers duplicated in new buffers.
17971 struct LDKCResult_InitDecodeErrorZ CResult_InitDecodeErrorZ_clone(const struct LDKCResult_InitDecodeErrorZ *NONNULL_PTR orig);
17974 * Creates a new CResult_OpenChannelDecodeErrorZ in the success state.
17976 struct LDKCResult_OpenChannelDecodeErrorZ CResult_OpenChannelDecodeErrorZ_ok(struct LDKOpenChannel o);
17979 * Creates a new CResult_OpenChannelDecodeErrorZ in the error state.
17981 struct LDKCResult_OpenChannelDecodeErrorZ CResult_OpenChannelDecodeErrorZ_err(struct LDKDecodeError e);
17984 * Checks if the given object is currently in the success state
17986 bool CResult_OpenChannelDecodeErrorZ_is_ok(const struct LDKCResult_OpenChannelDecodeErrorZ *NONNULL_PTR o);
17989 * Frees any resources used by the CResult_OpenChannelDecodeErrorZ.
17991 void CResult_OpenChannelDecodeErrorZ_free(struct LDKCResult_OpenChannelDecodeErrorZ _res);
17994 * Creates a new CResult_OpenChannelDecodeErrorZ which has the same data as `orig`
17995 * but with all dynamically-allocated buffers duplicated in new buffers.
17997 struct LDKCResult_OpenChannelDecodeErrorZ CResult_OpenChannelDecodeErrorZ_clone(const struct LDKCResult_OpenChannelDecodeErrorZ *NONNULL_PTR orig);
18000 * Creates a new CResult_RevokeAndACKDecodeErrorZ in the success state.
18002 struct LDKCResult_RevokeAndACKDecodeErrorZ CResult_RevokeAndACKDecodeErrorZ_ok(struct LDKRevokeAndACK o);
18005 * Creates a new CResult_RevokeAndACKDecodeErrorZ in the error state.
18007 struct LDKCResult_RevokeAndACKDecodeErrorZ CResult_RevokeAndACKDecodeErrorZ_err(struct LDKDecodeError e);
18010 * Checks if the given object is currently in the success state
18012 bool CResult_RevokeAndACKDecodeErrorZ_is_ok(const struct LDKCResult_RevokeAndACKDecodeErrorZ *NONNULL_PTR o);
18015 * Frees any resources used by the CResult_RevokeAndACKDecodeErrorZ.
18017 void CResult_RevokeAndACKDecodeErrorZ_free(struct LDKCResult_RevokeAndACKDecodeErrorZ _res);
18020 * Creates a new CResult_RevokeAndACKDecodeErrorZ which has the same data as `orig`
18021 * but with all dynamically-allocated buffers duplicated in new buffers.
18023 struct LDKCResult_RevokeAndACKDecodeErrorZ CResult_RevokeAndACKDecodeErrorZ_clone(const struct LDKCResult_RevokeAndACKDecodeErrorZ *NONNULL_PTR orig);
18026 * Creates a new CResult_ShutdownDecodeErrorZ in the success state.
18028 struct LDKCResult_ShutdownDecodeErrorZ CResult_ShutdownDecodeErrorZ_ok(struct LDKShutdown o);
18031 * Creates a new CResult_ShutdownDecodeErrorZ in the error state.
18033 struct LDKCResult_ShutdownDecodeErrorZ CResult_ShutdownDecodeErrorZ_err(struct LDKDecodeError e);
18036 * Checks if the given object is currently in the success state
18038 bool CResult_ShutdownDecodeErrorZ_is_ok(const struct LDKCResult_ShutdownDecodeErrorZ *NONNULL_PTR o);
18041 * Frees any resources used by the CResult_ShutdownDecodeErrorZ.
18043 void CResult_ShutdownDecodeErrorZ_free(struct LDKCResult_ShutdownDecodeErrorZ _res);
18046 * Creates a new CResult_ShutdownDecodeErrorZ which has the same data as `orig`
18047 * but with all dynamically-allocated buffers duplicated in new buffers.
18049 struct LDKCResult_ShutdownDecodeErrorZ CResult_ShutdownDecodeErrorZ_clone(const struct LDKCResult_ShutdownDecodeErrorZ *NONNULL_PTR orig);
18052 * Creates a new CResult_UpdateFailHTLCDecodeErrorZ in the success state.
18054 struct LDKCResult_UpdateFailHTLCDecodeErrorZ CResult_UpdateFailHTLCDecodeErrorZ_ok(struct LDKUpdateFailHTLC o);
18057 * Creates a new CResult_UpdateFailHTLCDecodeErrorZ in the error state.
18059 struct LDKCResult_UpdateFailHTLCDecodeErrorZ CResult_UpdateFailHTLCDecodeErrorZ_err(struct LDKDecodeError e);
18062 * Checks if the given object is currently in the success state
18064 bool CResult_UpdateFailHTLCDecodeErrorZ_is_ok(const struct LDKCResult_UpdateFailHTLCDecodeErrorZ *NONNULL_PTR o);
18067 * Frees any resources used by the CResult_UpdateFailHTLCDecodeErrorZ.
18069 void CResult_UpdateFailHTLCDecodeErrorZ_free(struct LDKCResult_UpdateFailHTLCDecodeErrorZ _res);
18072 * Creates a new CResult_UpdateFailHTLCDecodeErrorZ which has the same data as `orig`
18073 * but with all dynamically-allocated buffers duplicated in new buffers.
18075 struct LDKCResult_UpdateFailHTLCDecodeErrorZ CResult_UpdateFailHTLCDecodeErrorZ_clone(const struct LDKCResult_UpdateFailHTLCDecodeErrorZ *NONNULL_PTR orig);
18078 * Creates a new CResult_UpdateFailMalformedHTLCDecodeErrorZ in the success state.
18080 struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ CResult_UpdateFailMalformedHTLCDecodeErrorZ_ok(struct LDKUpdateFailMalformedHTLC o);
18083 * Creates a new CResult_UpdateFailMalformedHTLCDecodeErrorZ in the error state.
18085 struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ CResult_UpdateFailMalformedHTLCDecodeErrorZ_err(struct LDKDecodeError e);
18088 * Checks if the given object is currently in the success state
18090 bool CResult_UpdateFailMalformedHTLCDecodeErrorZ_is_ok(const struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ *NONNULL_PTR o);
18093 * Frees any resources used by the CResult_UpdateFailMalformedHTLCDecodeErrorZ.
18095 void CResult_UpdateFailMalformedHTLCDecodeErrorZ_free(struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ _res);
18098 * Creates a new CResult_UpdateFailMalformedHTLCDecodeErrorZ which has the same data as `orig`
18099 * but with all dynamically-allocated buffers duplicated in new buffers.
18101 struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ CResult_UpdateFailMalformedHTLCDecodeErrorZ_clone(const struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ *NONNULL_PTR orig);
18104 * Creates a new CResult_UpdateFeeDecodeErrorZ in the success state.
18106 struct LDKCResult_UpdateFeeDecodeErrorZ CResult_UpdateFeeDecodeErrorZ_ok(struct LDKUpdateFee o);
18109 * Creates a new CResult_UpdateFeeDecodeErrorZ in the error state.
18111 struct LDKCResult_UpdateFeeDecodeErrorZ CResult_UpdateFeeDecodeErrorZ_err(struct LDKDecodeError e);
18114 * Checks if the given object is currently in the success state
18116 bool CResult_UpdateFeeDecodeErrorZ_is_ok(const struct LDKCResult_UpdateFeeDecodeErrorZ *NONNULL_PTR o);
18119 * Frees any resources used by the CResult_UpdateFeeDecodeErrorZ.
18121 void CResult_UpdateFeeDecodeErrorZ_free(struct LDKCResult_UpdateFeeDecodeErrorZ _res);
18124 * Creates a new CResult_UpdateFeeDecodeErrorZ which has the same data as `orig`
18125 * but with all dynamically-allocated buffers duplicated in new buffers.
18127 struct LDKCResult_UpdateFeeDecodeErrorZ CResult_UpdateFeeDecodeErrorZ_clone(const struct LDKCResult_UpdateFeeDecodeErrorZ *NONNULL_PTR orig);
18130 * Creates a new CResult_UpdateFulfillHTLCDecodeErrorZ in the success state.
18132 struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ CResult_UpdateFulfillHTLCDecodeErrorZ_ok(struct LDKUpdateFulfillHTLC o);
18135 * Creates a new CResult_UpdateFulfillHTLCDecodeErrorZ in the error state.
18137 struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ CResult_UpdateFulfillHTLCDecodeErrorZ_err(struct LDKDecodeError e);
18140 * Checks if the given object is currently in the success state
18142 bool CResult_UpdateFulfillHTLCDecodeErrorZ_is_ok(const struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ *NONNULL_PTR o);
18145 * Frees any resources used by the CResult_UpdateFulfillHTLCDecodeErrorZ.
18147 void CResult_UpdateFulfillHTLCDecodeErrorZ_free(struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ _res);
18150 * Creates a new CResult_UpdateFulfillHTLCDecodeErrorZ which has the same data as `orig`
18151 * but with all dynamically-allocated buffers duplicated in new buffers.
18153 struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ CResult_UpdateFulfillHTLCDecodeErrorZ_clone(const struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ *NONNULL_PTR orig);
18156 * Creates a new CResult_UpdateAddHTLCDecodeErrorZ in the success state.
18158 struct LDKCResult_UpdateAddHTLCDecodeErrorZ CResult_UpdateAddHTLCDecodeErrorZ_ok(struct LDKUpdateAddHTLC o);
18161 * Creates a new CResult_UpdateAddHTLCDecodeErrorZ in the error state.
18163 struct LDKCResult_UpdateAddHTLCDecodeErrorZ CResult_UpdateAddHTLCDecodeErrorZ_err(struct LDKDecodeError e);
18166 * Checks if the given object is currently in the success state
18168 bool CResult_UpdateAddHTLCDecodeErrorZ_is_ok(const struct LDKCResult_UpdateAddHTLCDecodeErrorZ *NONNULL_PTR o);
18171 * Frees any resources used by the CResult_UpdateAddHTLCDecodeErrorZ.
18173 void CResult_UpdateAddHTLCDecodeErrorZ_free(struct LDKCResult_UpdateAddHTLCDecodeErrorZ _res);
18176 * Creates a new CResult_UpdateAddHTLCDecodeErrorZ which has the same data as `orig`
18177 * but with all dynamically-allocated buffers duplicated in new buffers.
18179 struct LDKCResult_UpdateAddHTLCDecodeErrorZ CResult_UpdateAddHTLCDecodeErrorZ_clone(const struct LDKCResult_UpdateAddHTLCDecodeErrorZ *NONNULL_PTR orig);
18182 * Creates a new CResult_OnionMessageDecodeErrorZ in the success state.
18184 struct LDKCResult_OnionMessageDecodeErrorZ CResult_OnionMessageDecodeErrorZ_ok(struct LDKOnionMessage o);
18187 * Creates a new CResult_OnionMessageDecodeErrorZ in the error state.
18189 struct LDKCResult_OnionMessageDecodeErrorZ CResult_OnionMessageDecodeErrorZ_err(struct LDKDecodeError e);
18192 * Checks if the given object is currently in the success state
18194 bool CResult_OnionMessageDecodeErrorZ_is_ok(const struct LDKCResult_OnionMessageDecodeErrorZ *NONNULL_PTR o);
18197 * Frees any resources used by the CResult_OnionMessageDecodeErrorZ.
18199 void CResult_OnionMessageDecodeErrorZ_free(struct LDKCResult_OnionMessageDecodeErrorZ _res);
18202 * Creates a new CResult_OnionMessageDecodeErrorZ which has the same data as `orig`
18203 * but with all dynamically-allocated buffers duplicated in new buffers.
18205 struct LDKCResult_OnionMessageDecodeErrorZ CResult_OnionMessageDecodeErrorZ_clone(const struct LDKCResult_OnionMessageDecodeErrorZ *NONNULL_PTR orig);
18208 * Creates a new CResult_PingDecodeErrorZ in the success state.
18210 struct LDKCResult_PingDecodeErrorZ CResult_PingDecodeErrorZ_ok(struct LDKPing o);
18213 * Creates a new CResult_PingDecodeErrorZ in the error state.
18215 struct LDKCResult_PingDecodeErrorZ CResult_PingDecodeErrorZ_err(struct LDKDecodeError e);
18218 * Checks if the given object is currently in the success state
18220 bool CResult_PingDecodeErrorZ_is_ok(const struct LDKCResult_PingDecodeErrorZ *NONNULL_PTR o);
18223 * Frees any resources used by the CResult_PingDecodeErrorZ.
18225 void CResult_PingDecodeErrorZ_free(struct LDKCResult_PingDecodeErrorZ _res);
18228 * Creates a new CResult_PingDecodeErrorZ which has the same data as `orig`
18229 * but with all dynamically-allocated buffers duplicated in new buffers.
18231 struct LDKCResult_PingDecodeErrorZ CResult_PingDecodeErrorZ_clone(const struct LDKCResult_PingDecodeErrorZ *NONNULL_PTR orig);
18234 * Creates a new CResult_PongDecodeErrorZ in the success state.
18236 struct LDKCResult_PongDecodeErrorZ CResult_PongDecodeErrorZ_ok(struct LDKPong o);
18239 * Creates a new CResult_PongDecodeErrorZ in the error state.
18241 struct LDKCResult_PongDecodeErrorZ CResult_PongDecodeErrorZ_err(struct LDKDecodeError e);
18244 * Checks if the given object is currently in the success state
18246 bool CResult_PongDecodeErrorZ_is_ok(const struct LDKCResult_PongDecodeErrorZ *NONNULL_PTR o);
18249 * Frees any resources used by the CResult_PongDecodeErrorZ.
18251 void CResult_PongDecodeErrorZ_free(struct LDKCResult_PongDecodeErrorZ _res);
18254 * Creates a new CResult_PongDecodeErrorZ which has the same data as `orig`
18255 * but with all dynamically-allocated buffers duplicated in new buffers.
18257 struct LDKCResult_PongDecodeErrorZ CResult_PongDecodeErrorZ_clone(const struct LDKCResult_PongDecodeErrorZ *NONNULL_PTR orig);
18260 * Creates a new CResult_UnsignedChannelAnnouncementDecodeErrorZ in the success state.
18262 struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ CResult_UnsignedChannelAnnouncementDecodeErrorZ_ok(struct LDKUnsignedChannelAnnouncement o);
18265 * Creates a new CResult_UnsignedChannelAnnouncementDecodeErrorZ in the error state.
18267 struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ CResult_UnsignedChannelAnnouncementDecodeErrorZ_err(struct LDKDecodeError e);
18270 * Checks if the given object is currently in the success state
18272 bool CResult_UnsignedChannelAnnouncementDecodeErrorZ_is_ok(const struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ *NONNULL_PTR o);
18275 * Frees any resources used by the CResult_UnsignedChannelAnnouncementDecodeErrorZ.
18277 void CResult_UnsignedChannelAnnouncementDecodeErrorZ_free(struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ _res);
18280 * Creates a new CResult_UnsignedChannelAnnouncementDecodeErrorZ which has the same data as `orig`
18281 * but with all dynamically-allocated buffers duplicated in new buffers.
18283 struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ CResult_UnsignedChannelAnnouncementDecodeErrorZ_clone(const struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ *NONNULL_PTR orig);
18286 * Creates a new CResult_ChannelAnnouncementDecodeErrorZ in the success state.
18288 struct LDKCResult_ChannelAnnouncementDecodeErrorZ CResult_ChannelAnnouncementDecodeErrorZ_ok(struct LDKChannelAnnouncement o);
18291 * Creates a new CResult_ChannelAnnouncementDecodeErrorZ in the error state.
18293 struct LDKCResult_ChannelAnnouncementDecodeErrorZ CResult_ChannelAnnouncementDecodeErrorZ_err(struct LDKDecodeError e);
18296 * Checks if the given object is currently in the success state
18298 bool CResult_ChannelAnnouncementDecodeErrorZ_is_ok(const struct LDKCResult_ChannelAnnouncementDecodeErrorZ *NONNULL_PTR o);
18301 * Frees any resources used by the CResult_ChannelAnnouncementDecodeErrorZ.
18303 void CResult_ChannelAnnouncementDecodeErrorZ_free(struct LDKCResult_ChannelAnnouncementDecodeErrorZ _res);
18306 * Creates a new CResult_ChannelAnnouncementDecodeErrorZ which has the same data as `orig`
18307 * but with all dynamically-allocated buffers duplicated in new buffers.
18309 struct LDKCResult_ChannelAnnouncementDecodeErrorZ CResult_ChannelAnnouncementDecodeErrorZ_clone(const struct LDKCResult_ChannelAnnouncementDecodeErrorZ *NONNULL_PTR orig);
18312 * Creates a new CResult_UnsignedChannelUpdateDecodeErrorZ in the success state.
18314 struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ CResult_UnsignedChannelUpdateDecodeErrorZ_ok(struct LDKUnsignedChannelUpdate o);
18317 * Creates a new CResult_UnsignedChannelUpdateDecodeErrorZ in the error state.
18319 struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ CResult_UnsignedChannelUpdateDecodeErrorZ_err(struct LDKDecodeError e);
18322 * Checks if the given object is currently in the success state
18324 bool CResult_UnsignedChannelUpdateDecodeErrorZ_is_ok(const struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ *NONNULL_PTR o);
18327 * Frees any resources used by the CResult_UnsignedChannelUpdateDecodeErrorZ.
18329 void CResult_UnsignedChannelUpdateDecodeErrorZ_free(struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ _res);
18332 * Creates a new CResult_UnsignedChannelUpdateDecodeErrorZ which has the same data as `orig`
18333 * but with all dynamically-allocated buffers duplicated in new buffers.
18335 struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ CResult_UnsignedChannelUpdateDecodeErrorZ_clone(const struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ *NONNULL_PTR orig);
18338 * Creates a new CResult_ChannelUpdateDecodeErrorZ in the success state.
18340 struct LDKCResult_ChannelUpdateDecodeErrorZ CResult_ChannelUpdateDecodeErrorZ_ok(struct LDKChannelUpdate o);
18343 * Creates a new CResult_ChannelUpdateDecodeErrorZ in the error state.
18345 struct LDKCResult_ChannelUpdateDecodeErrorZ CResult_ChannelUpdateDecodeErrorZ_err(struct LDKDecodeError e);
18348 * Checks if the given object is currently in the success state
18350 bool CResult_ChannelUpdateDecodeErrorZ_is_ok(const struct LDKCResult_ChannelUpdateDecodeErrorZ *NONNULL_PTR o);
18353 * Frees any resources used by the CResult_ChannelUpdateDecodeErrorZ.
18355 void CResult_ChannelUpdateDecodeErrorZ_free(struct LDKCResult_ChannelUpdateDecodeErrorZ _res);
18358 * Creates a new CResult_ChannelUpdateDecodeErrorZ which has the same data as `orig`
18359 * but with all dynamically-allocated buffers duplicated in new buffers.
18361 struct LDKCResult_ChannelUpdateDecodeErrorZ CResult_ChannelUpdateDecodeErrorZ_clone(const struct LDKCResult_ChannelUpdateDecodeErrorZ *NONNULL_PTR orig);
18364 * Creates a new CResult_ErrorMessageDecodeErrorZ in the success state.
18366 struct LDKCResult_ErrorMessageDecodeErrorZ CResult_ErrorMessageDecodeErrorZ_ok(struct LDKErrorMessage o);
18369 * Creates a new CResult_ErrorMessageDecodeErrorZ in the error state.
18371 struct LDKCResult_ErrorMessageDecodeErrorZ CResult_ErrorMessageDecodeErrorZ_err(struct LDKDecodeError e);
18374 * Checks if the given object is currently in the success state
18376 bool CResult_ErrorMessageDecodeErrorZ_is_ok(const struct LDKCResult_ErrorMessageDecodeErrorZ *NONNULL_PTR o);
18379 * Frees any resources used by the CResult_ErrorMessageDecodeErrorZ.
18381 void CResult_ErrorMessageDecodeErrorZ_free(struct LDKCResult_ErrorMessageDecodeErrorZ _res);
18384 * Creates a new CResult_ErrorMessageDecodeErrorZ which has the same data as `orig`
18385 * but with all dynamically-allocated buffers duplicated in new buffers.
18387 struct LDKCResult_ErrorMessageDecodeErrorZ CResult_ErrorMessageDecodeErrorZ_clone(const struct LDKCResult_ErrorMessageDecodeErrorZ *NONNULL_PTR orig);
18390 * Creates a new CResult_WarningMessageDecodeErrorZ in the success state.
18392 struct LDKCResult_WarningMessageDecodeErrorZ CResult_WarningMessageDecodeErrorZ_ok(struct LDKWarningMessage o);
18395 * Creates a new CResult_WarningMessageDecodeErrorZ in the error state.
18397 struct LDKCResult_WarningMessageDecodeErrorZ CResult_WarningMessageDecodeErrorZ_err(struct LDKDecodeError e);
18400 * Checks if the given object is currently in the success state
18402 bool CResult_WarningMessageDecodeErrorZ_is_ok(const struct LDKCResult_WarningMessageDecodeErrorZ *NONNULL_PTR o);
18405 * Frees any resources used by the CResult_WarningMessageDecodeErrorZ.
18407 void CResult_WarningMessageDecodeErrorZ_free(struct LDKCResult_WarningMessageDecodeErrorZ _res);
18410 * Creates a new CResult_WarningMessageDecodeErrorZ which has the same data as `orig`
18411 * but with all dynamically-allocated buffers duplicated in new buffers.
18413 struct LDKCResult_WarningMessageDecodeErrorZ CResult_WarningMessageDecodeErrorZ_clone(const struct LDKCResult_WarningMessageDecodeErrorZ *NONNULL_PTR orig);
18416 * Creates a new CResult_UnsignedNodeAnnouncementDecodeErrorZ in the success state.
18418 struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ CResult_UnsignedNodeAnnouncementDecodeErrorZ_ok(struct LDKUnsignedNodeAnnouncement o);
18421 * Creates a new CResult_UnsignedNodeAnnouncementDecodeErrorZ in the error state.
18423 struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ CResult_UnsignedNodeAnnouncementDecodeErrorZ_err(struct LDKDecodeError e);
18426 * Checks if the given object is currently in the success state
18428 bool CResult_UnsignedNodeAnnouncementDecodeErrorZ_is_ok(const struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ *NONNULL_PTR o);
18431 * Frees any resources used by the CResult_UnsignedNodeAnnouncementDecodeErrorZ.
18433 void CResult_UnsignedNodeAnnouncementDecodeErrorZ_free(struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ _res);
18436 * Creates a new CResult_UnsignedNodeAnnouncementDecodeErrorZ which has the same data as `orig`
18437 * but with all dynamically-allocated buffers duplicated in new buffers.
18439 struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ CResult_UnsignedNodeAnnouncementDecodeErrorZ_clone(const struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ *NONNULL_PTR orig);
18442 * Creates a new CResult_NodeAnnouncementDecodeErrorZ in the success state.
18444 struct LDKCResult_NodeAnnouncementDecodeErrorZ CResult_NodeAnnouncementDecodeErrorZ_ok(struct LDKNodeAnnouncement o);
18447 * Creates a new CResult_NodeAnnouncementDecodeErrorZ in the error state.
18449 struct LDKCResult_NodeAnnouncementDecodeErrorZ CResult_NodeAnnouncementDecodeErrorZ_err(struct LDKDecodeError e);
18452 * Checks if the given object is currently in the success state
18454 bool CResult_NodeAnnouncementDecodeErrorZ_is_ok(const struct LDKCResult_NodeAnnouncementDecodeErrorZ *NONNULL_PTR o);
18457 * Frees any resources used by the CResult_NodeAnnouncementDecodeErrorZ.
18459 void CResult_NodeAnnouncementDecodeErrorZ_free(struct LDKCResult_NodeAnnouncementDecodeErrorZ _res);
18462 * Creates a new CResult_NodeAnnouncementDecodeErrorZ which has the same data as `orig`
18463 * but with all dynamically-allocated buffers duplicated in new buffers.
18465 struct LDKCResult_NodeAnnouncementDecodeErrorZ CResult_NodeAnnouncementDecodeErrorZ_clone(const struct LDKCResult_NodeAnnouncementDecodeErrorZ *NONNULL_PTR orig);
18468 * Creates a new CResult_QueryShortChannelIdsDecodeErrorZ in the success state.
18470 struct LDKCResult_QueryShortChannelIdsDecodeErrorZ CResult_QueryShortChannelIdsDecodeErrorZ_ok(struct LDKQueryShortChannelIds o);
18473 * Creates a new CResult_QueryShortChannelIdsDecodeErrorZ in the error state.
18475 struct LDKCResult_QueryShortChannelIdsDecodeErrorZ CResult_QueryShortChannelIdsDecodeErrorZ_err(struct LDKDecodeError e);
18478 * Checks if the given object is currently in the success state
18480 bool CResult_QueryShortChannelIdsDecodeErrorZ_is_ok(const struct LDKCResult_QueryShortChannelIdsDecodeErrorZ *NONNULL_PTR o);
18483 * Frees any resources used by the CResult_QueryShortChannelIdsDecodeErrorZ.
18485 void CResult_QueryShortChannelIdsDecodeErrorZ_free(struct LDKCResult_QueryShortChannelIdsDecodeErrorZ _res);
18488 * Creates a new CResult_QueryShortChannelIdsDecodeErrorZ which has the same data as `orig`
18489 * but with all dynamically-allocated buffers duplicated in new buffers.
18491 struct LDKCResult_QueryShortChannelIdsDecodeErrorZ CResult_QueryShortChannelIdsDecodeErrorZ_clone(const struct LDKCResult_QueryShortChannelIdsDecodeErrorZ *NONNULL_PTR orig);
18494 * Creates a new CResult_ReplyShortChannelIdsEndDecodeErrorZ in the success state.
18496 struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ CResult_ReplyShortChannelIdsEndDecodeErrorZ_ok(struct LDKReplyShortChannelIdsEnd o);
18499 * Creates a new CResult_ReplyShortChannelIdsEndDecodeErrorZ in the error state.
18501 struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ CResult_ReplyShortChannelIdsEndDecodeErrorZ_err(struct LDKDecodeError e);
18504 * Checks if the given object is currently in the success state
18506 bool CResult_ReplyShortChannelIdsEndDecodeErrorZ_is_ok(const struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ *NONNULL_PTR o);
18509 * Frees any resources used by the CResult_ReplyShortChannelIdsEndDecodeErrorZ.
18511 void CResult_ReplyShortChannelIdsEndDecodeErrorZ_free(struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ _res);
18514 * Creates a new CResult_ReplyShortChannelIdsEndDecodeErrorZ which has the same data as `orig`
18515 * but with all dynamically-allocated buffers duplicated in new buffers.
18517 struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ CResult_ReplyShortChannelIdsEndDecodeErrorZ_clone(const struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ *NONNULL_PTR orig);
18520 * Creates a new CResult_QueryChannelRangeDecodeErrorZ in the success state.
18522 struct LDKCResult_QueryChannelRangeDecodeErrorZ CResult_QueryChannelRangeDecodeErrorZ_ok(struct LDKQueryChannelRange o);
18525 * Creates a new CResult_QueryChannelRangeDecodeErrorZ in the error state.
18527 struct LDKCResult_QueryChannelRangeDecodeErrorZ CResult_QueryChannelRangeDecodeErrorZ_err(struct LDKDecodeError e);
18530 * Checks if the given object is currently in the success state
18532 bool CResult_QueryChannelRangeDecodeErrorZ_is_ok(const struct LDKCResult_QueryChannelRangeDecodeErrorZ *NONNULL_PTR o);
18535 * Frees any resources used by the CResult_QueryChannelRangeDecodeErrorZ.
18537 void CResult_QueryChannelRangeDecodeErrorZ_free(struct LDKCResult_QueryChannelRangeDecodeErrorZ _res);
18540 * Creates a new CResult_QueryChannelRangeDecodeErrorZ which has the same data as `orig`
18541 * but with all dynamically-allocated buffers duplicated in new buffers.
18543 struct LDKCResult_QueryChannelRangeDecodeErrorZ CResult_QueryChannelRangeDecodeErrorZ_clone(const struct LDKCResult_QueryChannelRangeDecodeErrorZ *NONNULL_PTR orig);
18546 * Creates a new CResult_ReplyChannelRangeDecodeErrorZ in the success state.
18548 struct LDKCResult_ReplyChannelRangeDecodeErrorZ CResult_ReplyChannelRangeDecodeErrorZ_ok(struct LDKReplyChannelRange o);
18551 * Creates a new CResult_ReplyChannelRangeDecodeErrorZ in the error state.
18553 struct LDKCResult_ReplyChannelRangeDecodeErrorZ CResult_ReplyChannelRangeDecodeErrorZ_err(struct LDKDecodeError e);
18556 * Checks if the given object is currently in the success state
18558 bool CResult_ReplyChannelRangeDecodeErrorZ_is_ok(const struct LDKCResult_ReplyChannelRangeDecodeErrorZ *NONNULL_PTR o);
18561 * Frees any resources used by the CResult_ReplyChannelRangeDecodeErrorZ.
18563 void CResult_ReplyChannelRangeDecodeErrorZ_free(struct LDKCResult_ReplyChannelRangeDecodeErrorZ _res);
18566 * Creates a new CResult_ReplyChannelRangeDecodeErrorZ which has the same data as `orig`
18567 * but with all dynamically-allocated buffers duplicated in new buffers.
18569 struct LDKCResult_ReplyChannelRangeDecodeErrorZ CResult_ReplyChannelRangeDecodeErrorZ_clone(const struct LDKCResult_ReplyChannelRangeDecodeErrorZ *NONNULL_PTR orig);
18572 * Creates a new CResult_GossipTimestampFilterDecodeErrorZ in the success state.
18574 struct LDKCResult_GossipTimestampFilterDecodeErrorZ CResult_GossipTimestampFilterDecodeErrorZ_ok(struct LDKGossipTimestampFilter o);
18577 * Creates a new CResult_GossipTimestampFilterDecodeErrorZ in the error state.
18579 struct LDKCResult_GossipTimestampFilterDecodeErrorZ CResult_GossipTimestampFilterDecodeErrorZ_err(struct LDKDecodeError e);
18582 * Checks if the given object is currently in the success state
18584 bool CResult_GossipTimestampFilterDecodeErrorZ_is_ok(const struct LDKCResult_GossipTimestampFilterDecodeErrorZ *NONNULL_PTR o);
18587 * Frees any resources used by the CResult_GossipTimestampFilterDecodeErrorZ.
18589 void CResult_GossipTimestampFilterDecodeErrorZ_free(struct LDKCResult_GossipTimestampFilterDecodeErrorZ _res);
18592 * Creates a new CResult_GossipTimestampFilterDecodeErrorZ which has the same data as `orig`
18593 * but with all dynamically-allocated buffers duplicated in new buffers.
18595 struct LDKCResult_GossipTimestampFilterDecodeErrorZ CResult_GossipTimestampFilterDecodeErrorZ_clone(const struct LDKCResult_GossipTimestampFilterDecodeErrorZ *NONNULL_PTR orig);
18598 * Frees the buffer pointed to by `data` if `datalen` is non-0.
18600 void CVec_PhantomRouteHintsZ_free(struct LDKCVec_PhantomRouteHintsZ _res);
18603 * Creates a new CResult_InvoiceSignOrCreationErrorZ in the success state.
18605 struct LDKCResult_InvoiceSignOrCreationErrorZ CResult_InvoiceSignOrCreationErrorZ_ok(struct LDKInvoice o);
18608 * Creates a new CResult_InvoiceSignOrCreationErrorZ in the error state.
18610 struct LDKCResult_InvoiceSignOrCreationErrorZ CResult_InvoiceSignOrCreationErrorZ_err(struct LDKSignOrCreationError e);
18613 * Checks if the given object is currently in the success state
18615 bool CResult_InvoiceSignOrCreationErrorZ_is_ok(const struct LDKCResult_InvoiceSignOrCreationErrorZ *NONNULL_PTR o);
18618 * Frees any resources used by the CResult_InvoiceSignOrCreationErrorZ.
18620 void CResult_InvoiceSignOrCreationErrorZ_free(struct LDKCResult_InvoiceSignOrCreationErrorZ _res);
18623 * Creates a new CResult_InvoiceSignOrCreationErrorZ which has the same data as `orig`
18624 * but with all dynamically-allocated buffers duplicated in new buffers.
18626 struct LDKCResult_InvoiceSignOrCreationErrorZ CResult_InvoiceSignOrCreationErrorZ_clone(const struct LDKCResult_InvoiceSignOrCreationErrorZ *NONNULL_PTR orig);
18629 * Constructs a new COption_FilterZ containing a crate::lightning::chain::Filter
18631 struct LDKCOption_FilterZ COption_FilterZ_some(struct LDKFilter o);
18634 * Constructs a new COption_FilterZ containing nothing
18636 struct LDKCOption_FilterZ COption_FilterZ_none(void);
18639 * Frees any resources associated with the crate::lightning::chain::Filter, if we are in the Some state
18641 void COption_FilterZ_free(struct LDKCOption_FilterZ _res);
18644 * Creates a new CResult_LockedChannelMonitorNoneZ in the success state.
18646 struct LDKCResult_LockedChannelMonitorNoneZ CResult_LockedChannelMonitorNoneZ_ok(struct LDKLockedChannelMonitor o);
18649 * Creates a new CResult_LockedChannelMonitorNoneZ in the error state.
18651 struct LDKCResult_LockedChannelMonitorNoneZ CResult_LockedChannelMonitorNoneZ_err(void);
18654 * Checks if the given object is currently in the success state
18656 bool CResult_LockedChannelMonitorNoneZ_is_ok(const struct LDKCResult_LockedChannelMonitorNoneZ *NONNULL_PTR o);
18659 * Frees any resources used by the CResult_LockedChannelMonitorNoneZ.
18661 void CResult_LockedChannelMonitorNoneZ_free(struct LDKCResult_LockedChannelMonitorNoneZ _res);
18664 * Frees the buffer pointed to by `data` if `datalen` is non-0.
18666 void CVec_OutPointZ_free(struct LDKCVec_OutPointZ _res);
18669 * Frees any resources used by the PaymentPurpose
18671 void PaymentPurpose_free(struct LDKPaymentPurpose this_ptr);
18674 * Creates a copy of the PaymentPurpose
18676 struct LDKPaymentPurpose PaymentPurpose_clone(const struct LDKPaymentPurpose *NONNULL_PTR orig);
18679 * Utility method to constructs a new InvoicePayment-variant PaymentPurpose
18681 struct LDKPaymentPurpose PaymentPurpose_invoice_payment(struct LDKThirtyTwoBytes payment_preimage, struct LDKThirtyTwoBytes payment_secret);
18684 * Utility method to constructs a new SpontaneousPayment-variant PaymentPurpose
18686 struct LDKPaymentPurpose PaymentPurpose_spontaneous_payment(struct LDKThirtyTwoBytes a);
18689 * Serialize the PaymentPurpose object into a byte array which can be read by PaymentPurpose_read
18691 struct LDKCVec_u8Z PaymentPurpose_write(const struct LDKPaymentPurpose *NONNULL_PTR obj);
18694 * Read a PaymentPurpose from a byte array, created by PaymentPurpose_write
18696 struct LDKCResult_PaymentPurposeDecodeErrorZ PaymentPurpose_read(struct LDKu8slice ser);
18699 * Frees any resources used by the ClosureReason
18701 void ClosureReason_free(struct LDKClosureReason this_ptr);
18704 * Creates a copy of the ClosureReason
18706 struct LDKClosureReason ClosureReason_clone(const struct LDKClosureReason *NONNULL_PTR orig);
18709 * Utility method to constructs a new CounterpartyForceClosed-variant ClosureReason
18711 struct LDKClosureReason ClosureReason_counterparty_force_closed(struct LDKStr peer_msg);
18714 * Utility method to constructs a new HolderForceClosed-variant ClosureReason
18716 struct LDKClosureReason ClosureReason_holder_force_closed(void);
18719 * Utility method to constructs a new CooperativeClosure-variant ClosureReason
18721 struct LDKClosureReason ClosureReason_cooperative_closure(void);
18724 * Utility method to constructs a new CommitmentTxConfirmed-variant ClosureReason
18726 struct LDKClosureReason ClosureReason_commitment_tx_confirmed(void);
18729 * Utility method to constructs a new FundingTimedOut-variant ClosureReason
18731 struct LDKClosureReason ClosureReason_funding_timed_out(void);
18734 * Utility method to constructs a new ProcessingError-variant ClosureReason
18736 struct LDKClosureReason ClosureReason_processing_error(struct LDKStr err);
18739 * Utility method to constructs a new DisconnectedPeer-variant ClosureReason
18741 struct LDKClosureReason ClosureReason_disconnected_peer(void);
18744 * Utility method to constructs a new OutdatedChannelManager-variant ClosureReason
18746 struct LDKClosureReason ClosureReason_outdated_channel_manager(void);
18749 * Checks if two ClosureReasons contain equal inner contents.
18750 * This ignores pointers and is_owned flags and looks at the values in fields.
18752 bool ClosureReason_eq(const struct LDKClosureReason *NONNULL_PTR a, const struct LDKClosureReason *NONNULL_PTR b);
18755 * Serialize the ClosureReason object into a byte array which can be read by ClosureReason_read
18757 struct LDKCVec_u8Z ClosureReason_write(const struct LDKClosureReason *NONNULL_PTR obj);
18760 * Read a ClosureReason from a byte array, created by ClosureReason_write
18762 struct LDKCResult_COption_ClosureReasonZDecodeErrorZ ClosureReason_read(struct LDKu8slice ser);
18765 * Frees any resources used by the HTLCDestination
18767 void HTLCDestination_free(struct LDKHTLCDestination this_ptr);
18770 * Creates a copy of the HTLCDestination
18772 struct LDKHTLCDestination HTLCDestination_clone(const struct LDKHTLCDestination *NONNULL_PTR orig);
18775 * Utility method to constructs a new NextHopChannel-variant HTLCDestination
18777 struct LDKHTLCDestination HTLCDestination_next_hop_channel(struct LDKPublicKey node_id, struct LDKThirtyTwoBytes channel_id);
18780 * Utility method to constructs a new UnknownNextHop-variant HTLCDestination
18782 struct LDKHTLCDestination HTLCDestination_unknown_next_hop(uint64_t requested_forward_scid);
18785 * Utility method to constructs a new FailedPayment-variant HTLCDestination
18787 struct LDKHTLCDestination HTLCDestination_failed_payment(struct LDKThirtyTwoBytes payment_hash);
18790 * Checks if two HTLCDestinations contain equal inner contents.
18791 * This ignores pointers and is_owned flags and looks at the values in fields.
18793 bool HTLCDestination_eq(const struct LDKHTLCDestination *NONNULL_PTR a, const struct LDKHTLCDestination *NONNULL_PTR b);
18796 * Serialize the HTLCDestination object into a byte array which can be read by HTLCDestination_read
18798 struct LDKCVec_u8Z HTLCDestination_write(const struct LDKHTLCDestination *NONNULL_PTR obj);
18801 * Read a HTLCDestination from a byte array, created by HTLCDestination_write
18803 struct LDKCResult_COption_HTLCDestinationZDecodeErrorZ HTLCDestination_read(struct LDKu8slice ser);
18806 * Frees any resources used by the Event
18808 void Event_free(struct LDKEvent this_ptr);
18811 * Creates a copy of the Event
18813 struct LDKEvent Event_clone(const struct LDKEvent *NONNULL_PTR orig);
18816 * Utility method to constructs a new FundingGenerationReady-variant Event
18818 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, uint64_t user_channel_id);
18821 * Utility method to constructs a new PaymentReceived-variant Event
18823 struct LDKEvent Event_payment_received(struct LDKThirtyTwoBytes payment_hash, uint64_t amount_msat, struct LDKPaymentPurpose purpose);
18826 * Utility method to constructs a new PaymentClaimed-variant Event
18828 struct LDKEvent Event_payment_claimed(struct LDKThirtyTwoBytes payment_hash, uint64_t amount_msat, struct LDKPaymentPurpose purpose);
18831 * Utility method to constructs a new PaymentSent-variant Event
18833 struct LDKEvent Event_payment_sent(struct LDKThirtyTwoBytes payment_id, struct LDKThirtyTwoBytes payment_preimage, struct LDKThirtyTwoBytes payment_hash, struct LDKCOption_u64Z fee_paid_msat);
18836 * Utility method to constructs a new PaymentFailed-variant Event
18838 struct LDKEvent Event_payment_failed(struct LDKThirtyTwoBytes payment_id, struct LDKThirtyTwoBytes payment_hash);
18841 * Utility method to constructs a new PaymentPathSuccessful-variant Event
18843 struct LDKEvent Event_payment_path_successful(struct LDKThirtyTwoBytes payment_id, struct LDKThirtyTwoBytes payment_hash, struct LDKCVec_RouteHopZ path);
18846 * Utility method to constructs a new PaymentPathFailed-variant Event
18848 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);
18851 * Utility method to constructs a new ProbeSuccessful-variant Event
18853 struct LDKEvent Event_probe_successful(struct LDKThirtyTwoBytes payment_id, struct LDKThirtyTwoBytes payment_hash, struct LDKCVec_RouteHopZ path);
18856 * Utility method to constructs a new ProbeFailed-variant Event
18858 struct LDKEvent Event_probe_failed(struct LDKThirtyTwoBytes payment_id, struct LDKThirtyTwoBytes payment_hash, struct LDKCVec_RouteHopZ path, struct LDKCOption_u64Z short_channel_id);
18861 * Utility method to constructs a new PendingHTLCsForwardable-variant Event
18863 struct LDKEvent Event_pending_htlcs_forwardable(uint64_t time_forwardable);
18866 * Utility method to constructs a new SpendableOutputs-variant Event
18868 struct LDKEvent Event_spendable_outputs(struct LDKCVec_SpendableOutputDescriptorZ outputs);
18871 * Utility method to constructs a new PaymentForwarded-variant Event
18873 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);
18876 * Utility method to constructs a new ChannelClosed-variant Event
18878 struct LDKEvent Event_channel_closed(struct LDKThirtyTwoBytes channel_id, uint64_t user_channel_id, struct LDKClosureReason reason);
18881 * Utility method to constructs a new DiscardFunding-variant Event
18883 struct LDKEvent Event_discard_funding(struct LDKThirtyTwoBytes channel_id, struct LDKTransaction transaction);
18886 * Utility method to constructs a new OpenChannelRequest-variant Event
18888 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);
18891 * Utility method to constructs a new HTLCHandlingFailed-variant Event
18893 struct LDKEvent Event_htlchandling_failed(struct LDKThirtyTwoBytes prev_channel_id, struct LDKHTLCDestination failed_next_destination);
18896 * Serialize the Event object into a byte array which can be read by Event_read
18898 struct LDKCVec_u8Z Event_write(const struct LDKEvent *NONNULL_PTR obj);
18901 * Read a Event from a byte array, created by Event_write
18903 struct LDKCResult_COption_EventZDecodeErrorZ Event_read(struct LDKu8slice ser);
18906 * Frees any resources used by the MessageSendEvent
18908 void MessageSendEvent_free(struct LDKMessageSendEvent this_ptr);
18911 * Creates a copy of the MessageSendEvent
18913 struct LDKMessageSendEvent MessageSendEvent_clone(const struct LDKMessageSendEvent *NONNULL_PTR orig);
18916 * Utility method to constructs a new SendAcceptChannel-variant MessageSendEvent
18918 struct LDKMessageSendEvent MessageSendEvent_send_accept_channel(struct LDKPublicKey node_id, struct LDKAcceptChannel msg);
18921 * Utility method to constructs a new SendOpenChannel-variant MessageSendEvent
18923 struct LDKMessageSendEvent MessageSendEvent_send_open_channel(struct LDKPublicKey node_id, struct LDKOpenChannel msg);
18926 * Utility method to constructs a new SendFundingCreated-variant MessageSendEvent
18928 struct LDKMessageSendEvent MessageSendEvent_send_funding_created(struct LDKPublicKey node_id, struct LDKFundingCreated msg);
18931 * Utility method to constructs a new SendFundingSigned-variant MessageSendEvent
18933 struct LDKMessageSendEvent MessageSendEvent_send_funding_signed(struct LDKPublicKey node_id, struct LDKFundingSigned msg);
18936 * Utility method to constructs a new SendChannelReady-variant MessageSendEvent
18938 struct LDKMessageSendEvent MessageSendEvent_send_channel_ready(struct LDKPublicKey node_id, struct LDKChannelReady msg);
18941 * Utility method to constructs a new SendAnnouncementSignatures-variant MessageSendEvent
18943 struct LDKMessageSendEvent MessageSendEvent_send_announcement_signatures(struct LDKPublicKey node_id, struct LDKAnnouncementSignatures msg);
18946 * Utility method to constructs a new UpdateHTLCs-variant MessageSendEvent
18948 struct LDKMessageSendEvent MessageSendEvent_update_htlcs(struct LDKPublicKey node_id, struct LDKCommitmentUpdate updates);
18951 * Utility method to constructs a new SendRevokeAndACK-variant MessageSendEvent
18953 struct LDKMessageSendEvent MessageSendEvent_send_revoke_and_ack(struct LDKPublicKey node_id, struct LDKRevokeAndACK msg);
18956 * Utility method to constructs a new SendClosingSigned-variant MessageSendEvent
18958 struct LDKMessageSendEvent MessageSendEvent_send_closing_signed(struct LDKPublicKey node_id, struct LDKClosingSigned msg);
18961 * Utility method to constructs a new SendShutdown-variant MessageSendEvent
18963 struct LDKMessageSendEvent MessageSendEvent_send_shutdown(struct LDKPublicKey node_id, struct LDKShutdown msg);
18966 * Utility method to constructs a new SendChannelReestablish-variant MessageSendEvent
18968 struct LDKMessageSendEvent MessageSendEvent_send_channel_reestablish(struct LDKPublicKey node_id, struct LDKChannelReestablish msg);
18971 * Utility method to constructs a new SendChannelAnnouncement-variant MessageSendEvent
18973 struct LDKMessageSendEvent MessageSendEvent_send_channel_announcement(struct LDKPublicKey node_id, struct LDKChannelAnnouncement msg, struct LDKChannelUpdate update_msg);
18976 * Utility method to constructs a new BroadcastChannelAnnouncement-variant MessageSendEvent
18978 struct LDKMessageSendEvent MessageSendEvent_broadcast_channel_announcement(struct LDKChannelAnnouncement msg, struct LDKChannelUpdate update_msg);
18981 * Utility method to constructs a new BroadcastChannelUpdate-variant MessageSendEvent
18983 struct LDKMessageSendEvent MessageSendEvent_broadcast_channel_update(struct LDKChannelUpdate msg);
18986 * Utility method to constructs a new SendChannelUpdate-variant MessageSendEvent
18988 struct LDKMessageSendEvent MessageSendEvent_send_channel_update(struct LDKPublicKey node_id, struct LDKChannelUpdate msg);
18991 * Utility method to constructs a new HandleError-variant MessageSendEvent
18993 struct LDKMessageSendEvent MessageSendEvent_handle_error(struct LDKPublicKey node_id, struct LDKErrorAction action);
18996 * Utility method to constructs a new SendChannelRangeQuery-variant MessageSendEvent
18998 struct LDKMessageSendEvent MessageSendEvent_send_channel_range_query(struct LDKPublicKey node_id, struct LDKQueryChannelRange msg);
19001 * Utility method to constructs a new SendShortIdsQuery-variant MessageSendEvent
19003 struct LDKMessageSendEvent MessageSendEvent_send_short_ids_query(struct LDKPublicKey node_id, struct LDKQueryShortChannelIds msg);
19006 * Utility method to constructs a new SendReplyChannelRange-variant MessageSendEvent
19008 struct LDKMessageSendEvent MessageSendEvent_send_reply_channel_range(struct LDKPublicKey node_id, struct LDKReplyChannelRange msg);
19011 * Utility method to constructs a new SendGossipTimestampFilter-variant MessageSendEvent
19013 struct LDKMessageSendEvent MessageSendEvent_send_gossip_timestamp_filter(struct LDKPublicKey node_id, struct LDKGossipTimestampFilter msg);
19016 * Calls the free function if one is set
19018 void MessageSendEventsProvider_free(struct LDKMessageSendEventsProvider this_ptr);
19021 * Calls the free function if one is set
19023 void OnionMessageProvider_free(struct LDKOnionMessageProvider this_ptr);
19026 * Calls the free function if one is set
19028 void EventsProvider_free(struct LDKEventsProvider this_ptr);
19031 * Calls the free function if one is set
19033 void EventHandler_free(struct LDKEventHandler this_ptr);
19036 * Frees any resources used by the APIError
19038 void APIError_free(struct LDKAPIError this_ptr);
19041 * Creates a copy of the APIError
19043 struct LDKAPIError APIError_clone(const struct LDKAPIError *NONNULL_PTR orig);
19046 * Utility method to constructs a new APIMisuseError-variant APIError
19048 struct LDKAPIError APIError_apimisuse_error(struct LDKStr err);
19051 * Utility method to constructs a new FeeRateTooHigh-variant APIError
19053 struct LDKAPIError APIError_fee_rate_too_high(struct LDKStr err, uint32_t feerate);
19056 * Utility method to constructs a new RouteError-variant APIError
19058 struct LDKAPIError APIError_route_error(struct LDKStr err);
19061 * Utility method to constructs a new ChannelUnavailable-variant APIError
19063 struct LDKAPIError APIError_channel_unavailable(struct LDKStr err);
19066 * Utility method to constructs a new MonitorUpdateInProgress-variant APIError
19068 struct LDKAPIError APIError_monitor_update_in_progress(void);
19071 * Utility method to constructs a new IncompatibleShutdownScript-variant APIError
19073 struct LDKAPIError APIError_incompatible_shutdown_script(struct LDKShutdownScript script);
19076 * Checks if two APIErrors contain equal inner contents.
19077 * This ignores pointers and is_owned flags and looks at the values in fields.
19079 bool APIError_eq(const struct LDKAPIError *NONNULL_PTR a, const struct LDKAPIError *NONNULL_PTR b);
19082 * Frees any resources used by the BigSize, if is_owned is set and inner is non-NULL.
19084 void BigSize_free(struct LDKBigSize this_obj);
19086 uint64_t BigSize_get_a(const struct LDKBigSize *NONNULL_PTR this_ptr);
19088 void BigSize_set_a(struct LDKBigSize *NONNULL_PTR this_ptr, uint64_t val);
19091 * Constructs a new BigSize given each field
19093 MUST_USE_RES struct LDKBigSize BigSize_new(uint64_t a_arg);
19096 * Frees any resources used by the Hostname, if is_owned is set and inner is non-NULL.
19098 void Hostname_free(struct LDKHostname this_obj);
19101 * Creates a copy of the Hostname
19103 struct LDKHostname Hostname_clone(const struct LDKHostname *NONNULL_PTR orig);
19106 * Checks if two Hostnames contain equal inner contents.
19107 * This ignores pointers and is_owned flags and looks at the values in fields.
19108 * Two objects with NULL inner values will be considered "equal" here.
19110 bool Hostname_eq(const struct LDKHostname *NONNULL_PTR a, const struct LDKHostname *NONNULL_PTR b);
19113 * Returns the length of the hostname.
19115 MUST_USE_RES uint8_t Hostname_len(const struct LDKHostname *NONNULL_PTR this_arg);
19118 * Creates a digital signature of a message given a SecretKey, like the node's secret.
19119 * 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.
19120 * Signatures are EC recoverable, meaning that given the message and the signature the PublicKey of the signer can be extracted.
19122 struct LDKCResult_StringErrorZ sign(struct LDKu8slice msg, const uint8_t (*sk)[32]);
19125 * Recovers the PublicKey of the signer of the message given the message and the signature.
19127 struct LDKCResult_PublicKeyErrorZ recover_pk(struct LDKu8slice msg, struct LDKStr sig);
19130 * Verifies a message was signed by a PrivateKey that derives to a given PublicKey, given a message, a signature,
19131 * and the PublicKey.
19133 bool verify(struct LDKu8slice msg, struct LDKStr sig, struct LDKPublicKey pk);
19136 * Construct the invoice's HRP and signatureless data into a preimage to be hashed.
19138 struct LDKCVec_u8Z construct_invoice_preimage(struct LDKu8slice hrp_bytes, struct LDKCVec_u5Z data_without_signature);
19141 * Calls the free function if one is set
19143 void Persister_free(struct LDKPersister this_ptr);
19146 * Calls the free function if one is set
19148 void FutureCallback_free(struct LDKFutureCallback this_ptr);
19151 * Frees any resources used by the Future, if is_owned is set and inner is non-NULL.
19153 void Future_free(struct LDKFuture this_obj);
19156 * Registers a callback to be called upon completion of this future. If the future has already
19157 * completed, the callback will be called immediately.
19159 void Future_register_callback_fn(const struct LDKFuture *NONNULL_PTR this_arg, struct LDKFutureCallback callback);
19162 * Creates a copy of the Level
19164 enum LDKLevel Level_clone(const enum LDKLevel *NONNULL_PTR orig);
19167 * Utility method to constructs a new Gossip-variant Level
19169 enum LDKLevel Level_gossip(void);
19172 * Utility method to constructs a new Trace-variant Level
19174 enum LDKLevel Level_trace(void);
19177 * Utility method to constructs a new Debug-variant Level
19179 enum LDKLevel Level_debug(void);
19182 * Utility method to constructs a new Info-variant Level
19184 enum LDKLevel Level_info(void);
19187 * Utility method to constructs a new Warn-variant Level
19189 enum LDKLevel Level_warn(void);
19192 * Utility method to constructs a new Error-variant Level
19194 enum LDKLevel Level_error(void);
19197 * Checks if two Levels contain equal inner contents.
19198 * This ignores pointers and is_owned flags and looks at the values in fields.
19200 bool Level_eq(const enum LDKLevel *NONNULL_PTR a, const enum LDKLevel *NONNULL_PTR b);
19203 * Checks if two Levels contain equal inner contents.
19205 uint64_t Level_hash(const enum LDKLevel *NONNULL_PTR o);
19208 * Returns the most verbose logging level.
19210 MUST_USE_RES enum LDKLevel Level_max(void);
19213 * Frees any resources used by the Record, if is_owned is set and inner is non-NULL.
19215 void Record_free(struct LDKRecord this_obj);
19218 * The verbosity level of the message.
19220 enum LDKLevel Record_get_level(const struct LDKRecord *NONNULL_PTR this_ptr);
19223 * The verbosity level of the message.
19225 void Record_set_level(struct LDKRecord *NONNULL_PTR this_ptr, enum LDKLevel val);
19228 * The message body.
19230 struct LDKStr Record_get_args(const struct LDKRecord *NONNULL_PTR this_ptr);
19233 * The message body.
19235 void Record_set_args(struct LDKRecord *NONNULL_PTR this_ptr, struct LDKStr val);
19238 * The module path of the message.
19240 struct LDKStr Record_get_module_path(const struct LDKRecord *NONNULL_PTR this_ptr);
19243 * The module path of the message.
19245 void Record_set_module_path(struct LDKRecord *NONNULL_PTR this_ptr, struct LDKStr val);
19248 * The source file containing the message.
19250 struct LDKStr Record_get_file(const struct LDKRecord *NONNULL_PTR this_ptr);
19253 * The source file containing the message.
19255 void Record_set_file(struct LDKRecord *NONNULL_PTR this_ptr, struct LDKStr val);
19258 * The line containing the message.
19260 uint32_t Record_get_line(const struct LDKRecord *NONNULL_PTR this_ptr);
19263 * The line containing the message.
19265 void Record_set_line(struct LDKRecord *NONNULL_PTR this_ptr, uint32_t val);
19268 * Creates a copy of the Record
19270 struct LDKRecord Record_clone(const struct LDKRecord *NONNULL_PTR orig);
19273 * Calls the free function if one is set
19275 void Logger_free(struct LDKLogger this_ptr);
19278 * Frees any resources used by the ChannelHandshakeConfig, if is_owned is set and inner is non-NULL.
19280 void ChannelHandshakeConfig_free(struct LDKChannelHandshakeConfig this_obj);
19283 * Confirmations we will wait for before considering the channel locked in.
19284 * Applied only for inbound channels (see ChannelHandshakeLimits::max_minimum_depth for the
19285 * equivalent limit applied to outbound channels).
19287 * A lower-bound of 1 is applied, requiring all channels to have a confirmed commitment
19288 * transaction before operation. If you wish to accept channels with zero confirmations, see
19289 * [`UserConfig::manually_accept_inbound_channels`] and
19290 * [`ChannelManager::accept_inbound_channel_from_trusted_peer_0conf`].
19292 * Default value: 6.
19294 * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
19295 * [`ChannelManager::accept_inbound_channel_from_trusted_peer_0conf`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel_from_trusted_peer_0conf
19297 uint32_t ChannelHandshakeConfig_get_minimum_depth(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr);
19300 * Confirmations we will wait for before considering the channel locked in.
19301 * Applied only for inbound channels (see ChannelHandshakeLimits::max_minimum_depth for the
19302 * equivalent limit applied to outbound channels).
19304 * A lower-bound of 1 is applied, requiring all channels to have a confirmed commitment
19305 * transaction before operation. If you wish to accept channels with zero confirmations, see
19306 * [`UserConfig::manually_accept_inbound_channels`] and
19307 * [`ChannelManager::accept_inbound_channel_from_trusted_peer_0conf`].
19309 * Default value: 6.
19311 * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
19312 * [`ChannelManager::accept_inbound_channel_from_trusted_peer_0conf`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel_from_trusted_peer_0conf
19314 void ChannelHandshakeConfig_set_minimum_depth(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, uint32_t val);
19317 * Set to the number of blocks we require our counterparty to wait to claim their money (ie
19318 * the number of blocks we have to punish our counterparty if they broadcast a revoked
19321 * This is one of the main parameters of our security model. We (or one of our watchtowers) MUST
19322 * be online to check for revoked transactions on-chain at least once every our_to_self_delay
19323 * blocks (minus some margin to allow us enough time to broadcast and confirm a transaction,
19324 * possibly with time in between to RBF the spending transaction).
19326 * Meanwhile, asking for a too high delay, we bother peer to freeze funds for nothing in
19327 * case of an honest unilateral channel close, which implicitly decrease the economic value of
19330 * Default value: [`BREAKDOWN_TIMEOUT`], we enforce it as a minimum at channel opening so you
19331 * can tweak config to ask for more security, not less.
19333 uint16_t ChannelHandshakeConfig_get_our_to_self_delay(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr);
19336 * Set to the number of blocks we require our counterparty to wait to claim their money (ie
19337 * the number of blocks we have to punish our counterparty if they broadcast a revoked
19340 * This is one of the main parameters of our security model. We (or one of our watchtowers) MUST
19341 * be online to check for revoked transactions on-chain at least once every our_to_self_delay
19342 * blocks (minus some margin to allow us enough time to broadcast and confirm a transaction,
19343 * possibly with time in between to RBF the spending transaction).
19345 * Meanwhile, asking for a too high delay, we bother peer to freeze funds for nothing in
19346 * case of an honest unilateral channel close, which implicitly decrease the economic value of
19349 * Default value: [`BREAKDOWN_TIMEOUT`], we enforce it as a minimum at channel opening so you
19350 * can tweak config to ask for more security, not less.
19352 void ChannelHandshakeConfig_set_our_to_self_delay(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, uint16_t val);
19355 * Set to the smallest value HTLC we will accept to process.
19357 * This value is sent to our counterparty on channel-open and we close the channel any time
19358 * our counterparty misbehaves by sending us an HTLC with a value smaller than this.
19360 * Default value: 1. If the value is less than 1, it is ignored and set to 1, as is required
19363 uint64_t ChannelHandshakeConfig_get_our_htlc_minimum_msat(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr);
19366 * Set to the smallest value HTLC we will accept to process.
19368 * This value is sent to our counterparty on channel-open and we close the channel any time
19369 * our counterparty misbehaves by sending us an HTLC with a value smaller than this.
19371 * Default value: 1. If the value is less than 1, it is ignored and set to 1, as is required
19374 void ChannelHandshakeConfig_set_our_htlc_minimum_msat(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, uint64_t val);
19377 * Sets the percentage of the channel value we will cap the total value of outstanding inbound
19380 * This can be set to a value between 1-100, where the value corresponds to the percent of the
19381 * channel value in whole percentages.
19384 * * If configured to another value than the default value 10, any new channels created with
19385 * the non default value will cause versions of LDK prior to 0.0.104 to refuse to read the
19386 * `ChannelManager`.
19388 * * This caps the total value for inbound HTLCs in-flight only, and there's currently
19389 * no way to configure the cap for the total value of outbound HTLCs in-flight.
19391 * * The requirements for your node being online to ensure the safety of HTLC-encumbered funds
19392 * are different from the non-HTLC-encumbered funds. This makes this an important knob to
19393 * restrict exposure to loss due to being offline for too long.
19394 * See [`ChannelHandshakeConfig::our_to_self_delay`] and [`ChannelConfig::cltv_expiry_delta`]
19395 * for more information.
19397 * Default value: 10.
19398 * Minimum value: 1, any values less than 1 will be treated as 1 instead.
19399 * Maximum value: 100, any values larger than 100 will be treated as 100 instead.
19401 uint8_t ChannelHandshakeConfig_get_max_inbound_htlc_value_in_flight_percent_of_channel(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr);
19404 * Sets the percentage of the channel value we will cap the total value of outstanding inbound
19407 * This can be set to a value between 1-100, where the value corresponds to the percent of the
19408 * channel value in whole percentages.
19411 * * If configured to another value than the default value 10, any new channels created with
19412 * the non default value will cause versions of LDK prior to 0.0.104 to refuse to read the
19413 * `ChannelManager`.
19415 * * This caps the total value for inbound HTLCs in-flight only, and there's currently
19416 * no way to configure the cap for the total value of outbound HTLCs in-flight.
19418 * * The requirements for your node being online to ensure the safety of HTLC-encumbered funds
19419 * are different from the non-HTLC-encumbered funds. This makes this an important knob to
19420 * restrict exposure to loss due to being offline for too long.
19421 * See [`ChannelHandshakeConfig::our_to_self_delay`] and [`ChannelConfig::cltv_expiry_delta`]
19422 * for more information.
19424 * Default value: 10.
19425 * Minimum value: 1, any values less than 1 will be treated as 1 instead.
19426 * Maximum value: 100, any values larger than 100 will be treated as 100 instead.
19428 void ChannelHandshakeConfig_set_max_inbound_htlc_value_in_flight_percent_of_channel(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, uint8_t val);
19431 * If set, we attempt to negotiate the `scid_privacy` (referred to as `scid_alias` in the
19432 * BOLTs) option for outbound private channels. This provides better privacy by not including
19433 * our real on-chain channel UTXO in each invoice and requiring that our counterparty only
19434 * relay HTLCs to us using the channel's SCID alias.
19436 * If this option is set, channels may be created that will not be readable by LDK versions
19437 * prior to 0.0.106, causing [`ChannelManager`]'s read method to return a
19438 * [`DecodeError::InvalidValue`].
19440 * Note that setting this to true does *not* prevent us from opening channels with
19441 * counterparties that do not support the `scid_alias` option; we will simply fall back to a
19442 * private channel without that option.
19444 * Ignored if the channel is negotiated to be announced, see
19445 * [`ChannelHandshakeConfig::announced_channel`] and
19446 * [`ChannelHandshakeLimits::force_announced_channel_preference`] for more.
19448 * Default value: false. This value is likely to change to true in the future.
19450 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
19451 * [`DecodeError::InvalidValue`]: crate::ln::msgs::DecodeError::InvalidValue
19453 bool ChannelHandshakeConfig_get_negotiate_scid_privacy(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr);
19456 * If set, we attempt to negotiate the `scid_privacy` (referred to as `scid_alias` in the
19457 * BOLTs) option for outbound private channels. This provides better privacy by not including
19458 * our real on-chain channel UTXO in each invoice and requiring that our counterparty only
19459 * relay HTLCs to us using the channel's SCID alias.
19461 * If this option is set, channels may be created that will not be readable by LDK versions
19462 * prior to 0.0.106, causing [`ChannelManager`]'s read method to return a
19463 * [`DecodeError::InvalidValue`].
19465 * Note that setting this to true does *not* prevent us from opening channels with
19466 * counterparties that do not support the `scid_alias` option; we will simply fall back to a
19467 * private channel without that option.
19469 * Ignored if the channel is negotiated to be announced, see
19470 * [`ChannelHandshakeConfig::announced_channel`] and
19471 * [`ChannelHandshakeLimits::force_announced_channel_preference`] for more.
19473 * Default value: false. This value is likely to change to true in the future.
19475 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
19476 * [`DecodeError::InvalidValue`]: crate::ln::msgs::DecodeError::InvalidValue
19478 void ChannelHandshakeConfig_set_negotiate_scid_privacy(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, bool val);
19481 * Set to announce the channel publicly and notify all nodes that they can route via this
19484 * This should only be set to true for nodes which expect to be online reliably.
19486 * As the node which funds a channel picks this value this will only apply for new outbound
19487 * channels unless [`ChannelHandshakeLimits::force_announced_channel_preference`] is set.
19489 * Default value: false.
19491 bool ChannelHandshakeConfig_get_announced_channel(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr);
19494 * Set to announce the channel publicly and notify all nodes that they can route via this
19497 * This should only be set to true for nodes which expect to be online reliably.
19499 * As the node which funds a channel picks this value this will only apply for new outbound
19500 * channels unless [`ChannelHandshakeLimits::force_announced_channel_preference`] is set.
19502 * Default value: false.
19504 void ChannelHandshakeConfig_set_announced_channel(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, bool val);
19507 * When set, we commit to an upfront shutdown_pubkey at channel open. If our counterparty
19508 * supports it, they will then enforce the mutual-close output to us matches what we provided
19509 * at intialization, preventing us from closing to an alternate pubkey.
19511 * This is set to true by default to provide a slight increase in security, though ultimately
19512 * any attacker who is able to take control of a channel can just as easily send the funds via
19513 * lightning payments, so we never require that our counterparties support this option.
19515 * The upfront key committed is provided from [`KeysInterface::get_shutdown_scriptpubkey`].
19517 * Default value: true.
19519 * [`KeysInterface::get_shutdown_scriptpubkey`]: crate::chain::keysinterface::KeysInterface::get_shutdown_scriptpubkey
19521 bool ChannelHandshakeConfig_get_commit_upfront_shutdown_pubkey(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr);
19524 * When set, we commit to an upfront shutdown_pubkey at channel open. If our counterparty
19525 * supports it, they will then enforce the mutual-close output to us matches what we provided
19526 * at intialization, preventing us from closing to an alternate pubkey.
19528 * This is set to true by default to provide a slight increase in security, though ultimately
19529 * any attacker who is able to take control of a channel can just as easily send the funds via
19530 * lightning payments, so we never require that our counterparties support this option.
19532 * The upfront key committed is provided from [`KeysInterface::get_shutdown_scriptpubkey`].
19534 * Default value: true.
19536 * [`KeysInterface::get_shutdown_scriptpubkey`]: crate::chain::keysinterface::KeysInterface::get_shutdown_scriptpubkey
19538 void ChannelHandshakeConfig_set_commit_upfront_shutdown_pubkey(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, bool val);
19541 * The Proportion of the channel value to configure as counterparty's channel reserve,
19542 * i.e., `their_channel_reserve_satoshis` for both outbound and inbound channels.
19544 * `their_channel_reserve_satoshis` is the minimum balance that the other node has to maintain
19545 * on their side, at all times.
19546 * This ensures that if our counterparty broadcasts a revoked state, we can punish them by
19547 * claiming at least this value on chain.
19549 * Channel reserve values greater than 30% could be considered highly unreasonable, since that
19550 * amount can never be used for payments.
19551 * Also, if our selected channel reserve for counterparty and counterparty's selected
19552 * channel reserve for us sum up to equal or greater than channel value, channel negotiations
19555 * Note: Versions of LDK earlier than v0.0.104 will fail to read channels with any channel reserve
19556 * other than the default value.
19558 * Default value: 1% of channel value, i.e., configured as 10,000 millionths.
19559 * Minimum value: If the calculated proportional value is less than 1000 sats, it will be treated
19560 * as 1000 sats instead, which is a safe implementation-specific lower bound.
19561 * Maximum value: 1,000,000, any values larger than 1 Million will be treated as 1 Million (or 100%)
19562 * instead, although channel negotiations will fail in that case.
19564 uint32_t ChannelHandshakeConfig_get_their_channel_reserve_proportional_millionths(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr);
19567 * The Proportion of the channel value to configure as counterparty's channel reserve,
19568 * i.e., `their_channel_reserve_satoshis` for both outbound and inbound channels.
19570 * `their_channel_reserve_satoshis` is the minimum balance that the other node has to maintain
19571 * on their side, at all times.
19572 * This ensures that if our counterparty broadcasts a revoked state, we can punish them by
19573 * claiming at least this value on chain.
19575 * Channel reserve values greater than 30% could be considered highly unreasonable, since that
19576 * amount can never be used for payments.
19577 * Also, if our selected channel reserve for counterparty and counterparty's selected
19578 * channel reserve for us sum up to equal or greater than channel value, channel negotiations
19581 * Note: Versions of LDK earlier than v0.0.104 will fail to read channels with any channel reserve
19582 * other than the default value.
19584 * Default value: 1% of channel value, i.e., configured as 10,000 millionths.
19585 * Minimum value: If the calculated proportional value is less than 1000 sats, it will be treated
19586 * as 1000 sats instead, which is a safe implementation-specific lower bound.
19587 * Maximum value: 1,000,000, any values larger than 1 Million will be treated as 1 Million (or 100%)
19588 * instead, although channel negotiations will fail in that case.
19590 void ChannelHandshakeConfig_set_their_channel_reserve_proportional_millionths(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, uint32_t val);
19593 * Constructs a new ChannelHandshakeConfig given each field
19595 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);
19598 * Creates a copy of the ChannelHandshakeConfig
19600 struct LDKChannelHandshakeConfig ChannelHandshakeConfig_clone(const struct LDKChannelHandshakeConfig *NONNULL_PTR orig);
19603 * Creates a "default" ChannelHandshakeConfig. See struct and individual field documentaiton for details on which values are used.
19605 MUST_USE_RES struct LDKChannelHandshakeConfig ChannelHandshakeConfig_default(void);
19608 * Frees any resources used by the ChannelHandshakeLimits, if is_owned is set and inner is non-NULL.
19610 void ChannelHandshakeLimits_free(struct LDKChannelHandshakeLimits this_obj);
19613 * Minimum allowed satoshis when a channel is funded. This is supplied by the sender and so
19614 * only applies to inbound channels.
19616 * Default value: 0.
19618 uint64_t ChannelHandshakeLimits_get_min_funding_satoshis(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
19621 * Minimum allowed satoshis when a channel is funded. This is supplied by the sender and so
19622 * only applies to inbound channels.
19624 * Default value: 0.
19626 void ChannelHandshakeLimits_set_min_funding_satoshis(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint64_t val);
19629 * Maximum allowed satoshis when a channel is funded. This is supplied by the sender and so
19630 * only applies to inbound channels.
19632 * Default value: 2^24 - 1.
19634 uint64_t ChannelHandshakeLimits_get_max_funding_satoshis(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
19637 * Maximum allowed satoshis when a channel is funded. This is supplied by the sender and so
19638 * only applies to inbound channels.
19640 * Default value: 2^24 - 1.
19642 void ChannelHandshakeLimits_set_max_funding_satoshis(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint64_t val);
19645 * The remote node sets a limit on the minimum size of HTLCs we can send to them. This allows
19646 * you to limit the maximum minimum-size they can require.
19648 * Default value: u64::max_value.
19650 uint64_t ChannelHandshakeLimits_get_max_htlc_minimum_msat(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
19653 * The remote node sets a limit on the minimum size of HTLCs we can send to them. This allows
19654 * you to limit the maximum minimum-size they can require.
19656 * Default value: u64::max_value.
19658 void ChannelHandshakeLimits_set_max_htlc_minimum_msat(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint64_t val);
19661 * The remote node sets a limit on the maximum value of pending HTLCs to them at any given
19662 * time to limit their funds exposure to HTLCs. This allows you to set a minimum such value.
19664 * Default value: 0.
19666 uint64_t ChannelHandshakeLimits_get_min_max_htlc_value_in_flight_msat(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
19669 * The remote node sets a limit on the maximum value of pending HTLCs to them at any given
19670 * time to limit their funds exposure to HTLCs. This allows you to set a minimum such value.
19672 * Default value: 0.
19674 void ChannelHandshakeLimits_set_min_max_htlc_value_in_flight_msat(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint64_t val);
19677 * The remote node will require we keep a certain amount in direct payment to ourselves at all
19678 * time, ensuring that we are able to be punished if we broadcast an old state. This allows to
19679 * you limit the amount which we will have to keep to ourselves (and cannot use for HTLCs).
19681 * Default value: u64::max_value.
19683 uint64_t ChannelHandshakeLimits_get_max_channel_reserve_satoshis(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
19686 * The remote node will require we keep a certain amount in direct payment to ourselves at all
19687 * time, ensuring that we are able to be punished if we broadcast an old state. This allows to
19688 * you limit the amount which we will have to keep to ourselves (and cannot use for HTLCs).
19690 * Default value: u64::max_value.
19692 void ChannelHandshakeLimits_set_max_channel_reserve_satoshis(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint64_t val);
19695 * The remote node sets a limit on the maximum number of pending HTLCs to them at any given
19696 * time. This allows you to set a minimum such value.
19698 * Default value: 0.
19700 uint16_t ChannelHandshakeLimits_get_min_max_accepted_htlcs(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
19703 * The remote node sets a limit on the maximum number of pending HTLCs to them at any given
19704 * time. This allows you to set a minimum such value.
19706 * Default value: 0.
19708 void ChannelHandshakeLimits_set_min_max_accepted_htlcs(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint16_t val);
19711 * Before a channel is usable the funding transaction will need to be confirmed by at least a
19712 * certain number of blocks, specified by the node which is not the funder (as the funder can
19713 * assume they aren't going to double-spend themselves).
19714 * This config allows you to set a limit on the maximum amount of time to wait.
19716 * Default value: 144, or roughly one day and only applies to outbound channels.
19718 uint32_t ChannelHandshakeLimits_get_max_minimum_depth(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
19721 * Before a channel is usable the funding transaction will need to be confirmed by at least a
19722 * certain number of blocks, specified by the node which is not the funder (as the funder can
19723 * assume they aren't going to double-spend themselves).
19724 * This config allows you to set a limit on the maximum amount of time to wait.
19726 * Default value: 144, or roughly one day and only applies to outbound channels.
19728 void ChannelHandshakeLimits_set_max_minimum_depth(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint32_t val);
19731 * Whether we implicitly trust funding transactions generated by us for our own outbound
19732 * channels to not be double-spent.
19734 * If this is set, we assume that our own funding transactions are *never* double-spent, and
19735 * thus we can trust them without any confirmations. This is generally a reasonable
19736 * assumption, given we're the only ones who could ever double-spend it (assuming we have sole
19737 * control of the signing keys).
19739 * You may wish to un-set this if you allow the user to (or do in an automated fashion)
19740 * double-spend the funding transaction to RBF with an alternative channel open.
19742 * This only applies if our counterparty set their confirmations-required value to 0, and we
19743 * always trust our own funding transaction at 1 confirmation irrespective of this value.
19744 * Thus, this effectively acts as a `min_minimum_depth`, with the only possible values being
19745 * `true` (0) and `false` (1).
19747 * Default value: true
19749 bool ChannelHandshakeLimits_get_trust_own_funding_0conf(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
19752 * Whether we implicitly trust funding transactions generated by us for our own outbound
19753 * channels to not be double-spent.
19755 * If this is set, we assume that our own funding transactions are *never* double-spent, and
19756 * thus we can trust them without any confirmations. This is generally a reasonable
19757 * assumption, given we're the only ones who could ever double-spend it (assuming we have sole
19758 * control of the signing keys).
19760 * You may wish to un-set this if you allow the user to (or do in an automated fashion)
19761 * double-spend the funding transaction to RBF with an alternative channel open.
19763 * This only applies if our counterparty set their confirmations-required value to 0, and we
19764 * always trust our own funding transaction at 1 confirmation irrespective of this value.
19765 * Thus, this effectively acts as a `min_minimum_depth`, with the only possible values being
19766 * `true` (0) and `false` (1).
19768 * Default value: true
19770 void ChannelHandshakeLimits_set_trust_own_funding_0conf(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, bool val);
19773 * Set to force an incoming channel to match our announced channel preference in
19774 * [`ChannelHandshakeConfig::announced_channel`].
19776 * For a node which is not online reliably, this should be set to true and
19777 * [`ChannelHandshakeConfig::announced_channel`] set to false, ensuring that no announced (aka public)
19778 * channels will ever be opened.
19780 * Default value: true.
19782 bool ChannelHandshakeLimits_get_force_announced_channel_preference(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
19785 * Set to force an incoming channel to match our announced channel preference in
19786 * [`ChannelHandshakeConfig::announced_channel`].
19788 * For a node which is not online reliably, this should be set to true and
19789 * [`ChannelHandshakeConfig::announced_channel`] set to false, ensuring that no announced (aka public)
19790 * channels will ever be opened.
19792 * Default value: true.
19794 void ChannelHandshakeLimits_set_force_announced_channel_preference(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, bool val);
19797 * Set to the amount of time we're willing to wait to claim money back to us.
19799 * Not checking this value would be a security issue, as our peer would be able to set it to
19800 * max relative lock-time (a year) and we would \"lose\" money as it would be locked for a long time.
19802 * Default value: 2016, which we also enforce as a maximum value so you can tweak config to
19803 * reduce the loss of having useless locked funds (if your peer accepts)
19805 uint16_t ChannelHandshakeLimits_get_their_to_self_delay(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
19808 * Set to the amount of time we're willing to wait to claim money back to us.
19810 * Not checking this value would be a security issue, as our peer would be able to set it to
19811 * max relative lock-time (a year) and we would \"lose\" money as it would be locked for a long time.
19813 * Default value: 2016, which we also enforce as a maximum value so you can tweak config to
19814 * reduce the loss of having useless locked funds (if your peer accepts)
19816 void ChannelHandshakeLimits_set_their_to_self_delay(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint16_t val);
19819 * Constructs a new ChannelHandshakeLimits given each field
19821 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);
19824 * Creates a copy of the ChannelHandshakeLimits
19826 struct LDKChannelHandshakeLimits ChannelHandshakeLimits_clone(const struct LDKChannelHandshakeLimits *NONNULL_PTR orig);
19829 * Creates a "default" ChannelHandshakeLimits. See struct and individual field documentaiton for details on which values are used.
19831 MUST_USE_RES struct LDKChannelHandshakeLimits ChannelHandshakeLimits_default(void);
19834 * Frees any resources used by the ChannelConfig, if is_owned is set and inner is non-NULL.
19836 void ChannelConfig_free(struct LDKChannelConfig this_obj);
19839 * Amount (in millionths of a satoshi) charged per satoshi for payments forwarded outbound
19840 * over the channel.
19841 * This may be allowed to change at runtime in a later update, however doing so must result in
19842 * update messages sent to notify all nodes of our updated relay fee.
19844 * Default value: 0.
19846 uint32_t ChannelConfig_get_forwarding_fee_proportional_millionths(const struct LDKChannelConfig *NONNULL_PTR this_ptr);
19849 * Amount (in millionths of a satoshi) charged per satoshi for payments forwarded outbound
19850 * over the channel.
19851 * This may be allowed to change at runtime in a later update, however doing so must result in
19852 * update messages sent to notify all nodes of our updated relay fee.
19854 * Default value: 0.
19856 void ChannelConfig_set_forwarding_fee_proportional_millionths(struct LDKChannelConfig *NONNULL_PTR this_ptr, uint32_t val);
19859 * Amount (in milli-satoshi) charged for payments forwarded outbound over the channel, in
19860 * excess of [`forwarding_fee_proportional_millionths`].
19861 * This may be allowed to change at runtime in a later update, however doing so must result in
19862 * update messages sent to notify all nodes of our updated relay fee.
19864 * The default value of a single satoshi roughly matches the market rate on many routing nodes
19865 * as of July 2021. Adjusting it upwards or downwards may change whether nodes route through
19868 * Default value: 1000.
19870 * [`forwarding_fee_proportional_millionths`]: ChannelConfig::forwarding_fee_proportional_millionths
19872 uint32_t ChannelConfig_get_forwarding_fee_base_msat(const struct LDKChannelConfig *NONNULL_PTR this_ptr);
19875 * Amount (in milli-satoshi) charged for payments forwarded outbound over the channel, in
19876 * excess of [`forwarding_fee_proportional_millionths`].
19877 * This may be allowed to change at runtime in a later update, however doing so must result in
19878 * update messages sent to notify all nodes of our updated relay fee.
19880 * The default value of a single satoshi roughly matches the market rate on many routing nodes
19881 * as of July 2021. Adjusting it upwards or downwards may change whether nodes route through
19884 * Default value: 1000.
19886 * [`forwarding_fee_proportional_millionths`]: ChannelConfig::forwarding_fee_proportional_millionths
19888 void ChannelConfig_set_forwarding_fee_base_msat(struct LDKChannelConfig *NONNULL_PTR this_ptr, uint32_t val);
19891 * The difference in the CLTV value between incoming HTLCs and an outbound HTLC forwarded over
19892 * the channel this config applies to.
19894 * This is analogous to [`ChannelHandshakeConfig::our_to_self_delay`] but applies to in-flight
19895 * HTLC balance when a channel appears on-chain whereas
19896 * [`ChannelHandshakeConfig::our_to_self_delay`] applies to the remaining
19897 * (non-HTLC-encumbered) balance.
19899 * Thus, for HTLC-encumbered balances to be enforced on-chain when a channel is force-closed,
19900 * we (or one of our watchtowers) MUST be online to check for broadcast of the current
19901 * commitment transaction at least once per this many blocks (minus some margin to allow us
19902 * enough time to broadcast and confirm a transaction, possibly with time in between to RBF
19903 * the spending transaction).
19905 * Default value: 72 (12 hours at an average of 6 blocks/hour).
19906 * Minimum value: [`MIN_CLTV_EXPIRY_DELTA`], any values less than this will be treated as
19907 * [`MIN_CLTV_EXPIRY_DELTA`] instead.
19909 * [`MIN_CLTV_EXPIRY_DELTA`]: crate::ln::channelmanager::MIN_CLTV_EXPIRY_DELTA
19911 uint16_t ChannelConfig_get_cltv_expiry_delta(const struct LDKChannelConfig *NONNULL_PTR this_ptr);
19914 * The difference in the CLTV value between incoming HTLCs and an outbound HTLC forwarded over
19915 * the channel this config applies to.
19917 * This is analogous to [`ChannelHandshakeConfig::our_to_self_delay`] but applies to in-flight
19918 * HTLC balance when a channel appears on-chain whereas
19919 * [`ChannelHandshakeConfig::our_to_self_delay`] applies to the remaining
19920 * (non-HTLC-encumbered) balance.
19922 * Thus, for HTLC-encumbered balances to be enforced on-chain when a channel is force-closed,
19923 * we (or one of our watchtowers) MUST be online to check for broadcast of the current
19924 * commitment transaction at least once per this many blocks (minus some margin to allow us
19925 * enough time to broadcast and confirm a transaction, possibly with time in between to RBF
19926 * the spending transaction).
19928 * Default value: 72 (12 hours at an average of 6 blocks/hour).
19929 * Minimum value: [`MIN_CLTV_EXPIRY_DELTA`], any values less than this will be treated as
19930 * [`MIN_CLTV_EXPIRY_DELTA`] instead.
19932 * [`MIN_CLTV_EXPIRY_DELTA`]: crate::ln::channelmanager::MIN_CLTV_EXPIRY_DELTA
19934 void ChannelConfig_set_cltv_expiry_delta(struct LDKChannelConfig *NONNULL_PTR this_ptr, uint16_t val);
19937 * Limit our total exposure to in-flight HTLCs which are burned to fees as they are too
19938 * small to claim on-chain.
19940 * When an HTLC present in one of our channels is below a \"dust\" threshold, the HTLC will
19941 * not be claimable on-chain, instead being turned into additional miner fees if either
19942 * party force-closes the channel. Because the threshold is per-HTLC, our total exposure
19943 * to such payments may be sustantial if there are many dust HTLCs present when the
19944 * channel is force-closed.
19946 * The dust threshold for each HTLC is based on the `dust_limit_satoshis` for each party in a
19947 * channel negotiated throughout the channel open process, along with the fees required to have
19948 * a broadcastable HTLC spending transaction. When a channel supports anchor outputs
19949 * (specifically the zero fee HTLC transaction variant), this threshold no longer takes into
19950 * account the HTLC transaction fee as it is zero.
19952 * This limit is applied for sent, forwarded, and received HTLCs and limits the total
19953 * exposure across all three types per-channel. Setting this too low may prevent the
19954 * sending or receipt of low-value HTLCs on high-traffic nodes, and this limit is very
19955 * important to prevent stealing of dust HTLCs by miners.
19957 * Default value: 5_000_000 msat.
19959 uint64_t ChannelConfig_get_max_dust_htlc_exposure_msat(const struct LDKChannelConfig *NONNULL_PTR this_ptr);
19962 * Limit our total exposure to in-flight HTLCs which are burned to fees as they are too
19963 * small to claim on-chain.
19965 * When an HTLC present in one of our channels is below a \"dust\" threshold, the HTLC will
19966 * not be claimable on-chain, instead being turned into additional miner fees if either
19967 * party force-closes the channel. Because the threshold is per-HTLC, our total exposure
19968 * to such payments may be sustantial if there are many dust HTLCs present when the
19969 * channel is force-closed.
19971 * The dust threshold for each HTLC is based on the `dust_limit_satoshis` for each party in a
19972 * channel negotiated throughout the channel open process, along with the fees required to have
19973 * a broadcastable HTLC spending transaction. When a channel supports anchor outputs
19974 * (specifically the zero fee HTLC transaction variant), this threshold no longer takes into
19975 * account the HTLC transaction fee as it is zero.
19977 * This limit is applied for sent, forwarded, and received HTLCs and limits the total
19978 * exposure across all three types per-channel. Setting this too low may prevent the
19979 * sending or receipt of low-value HTLCs on high-traffic nodes, and this limit is very
19980 * important to prevent stealing of dust HTLCs by miners.
19982 * Default value: 5_000_000 msat.
19984 void ChannelConfig_set_max_dust_htlc_exposure_msat(struct LDKChannelConfig *NONNULL_PTR this_ptr, uint64_t val);
19987 * The additional fee we're willing to pay to avoid waiting for the counterparty's
19988 * `to_self_delay` to reclaim funds.
19990 * When we close a channel cooperatively with our counterparty, we negotiate a fee for the
19991 * closing transaction which both sides find acceptable, ultimately paid by the channel
19992 * funder/initiator.
19994 * When we are the funder, because we have to pay the channel closing fee, we bound the
19995 * acceptable fee by our [`Background`] and [`Normal`] fees, with the upper bound increased by
19996 * this value. Because the on-chain fee we'd pay to force-close the channel is kept near our
19997 * [`Normal`] feerate during normal operation, this value represents the additional fee we're
19998 * willing to pay in order to avoid waiting for our counterparty's to_self_delay to reclaim our
20001 * When we are not the funder, we require the closing transaction fee pay at least our
20002 * [`Background`] fee estimate, but allow our counterparty to pay as much fee as they like.
20003 * Thus, this value is ignored when we are not the funder.
20005 * Default value: 1000 satoshis.
20007 * [`Normal`]: crate::chain::chaininterface::ConfirmationTarget::Normal
20008 * [`Background`]: crate::chain::chaininterface::ConfirmationTarget::Background
20010 uint64_t ChannelConfig_get_force_close_avoidance_max_fee_satoshis(const struct LDKChannelConfig *NONNULL_PTR this_ptr);
20013 * The additional fee we're willing to pay to avoid waiting for the counterparty's
20014 * `to_self_delay` to reclaim funds.
20016 * When we close a channel cooperatively with our counterparty, we negotiate a fee for the
20017 * closing transaction which both sides find acceptable, ultimately paid by the channel
20018 * funder/initiator.
20020 * When we are the funder, because we have to pay the channel closing fee, we bound the
20021 * acceptable fee by our [`Background`] and [`Normal`] fees, with the upper bound increased by
20022 * this value. Because the on-chain fee we'd pay to force-close the channel is kept near our
20023 * [`Normal`] feerate during normal operation, this value represents the additional fee we're
20024 * willing to pay in order to avoid waiting for our counterparty's to_self_delay to reclaim our
20027 * When we are not the funder, we require the closing transaction fee pay at least our
20028 * [`Background`] fee estimate, but allow our counterparty to pay as much fee as they like.
20029 * Thus, this value is ignored when we are not the funder.
20031 * Default value: 1000 satoshis.
20033 * [`Normal`]: crate::chain::chaininterface::ConfirmationTarget::Normal
20034 * [`Background`]: crate::chain::chaininterface::ConfirmationTarget::Background
20036 void ChannelConfig_set_force_close_avoidance_max_fee_satoshis(struct LDKChannelConfig *NONNULL_PTR this_ptr, uint64_t val);
20039 * Constructs a new ChannelConfig given each field
20041 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);
20044 * Creates a copy of the ChannelConfig
20046 struct LDKChannelConfig ChannelConfig_clone(const struct LDKChannelConfig *NONNULL_PTR orig);
20049 * Checks if two ChannelConfigs contain equal inner contents.
20050 * This ignores pointers and is_owned flags and looks at the values in fields.
20051 * Two objects with NULL inner values will be considered "equal" here.
20053 bool ChannelConfig_eq(const struct LDKChannelConfig *NONNULL_PTR a, const struct LDKChannelConfig *NONNULL_PTR b);
20056 * Creates a "default" ChannelConfig. See struct and individual field documentaiton for details on which values are used.
20058 MUST_USE_RES struct LDKChannelConfig ChannelConfig_default(void);
20061 * Serialize the ChannelConfig object into a byte array which can be read by ChannelConfig_read
20063 struct LDKCVec_u8Z ChannelConfig_write(const struct LDKChannelConfig *NONNULL_PTR obj);
20066 * Read a ChannelConfig from a byte array, created by ChannelConfig_write
20068 struct LDKCResult_ChannelConfigDecodeErrorZ ChannelConfig_read(struct LDKu8slice ser);
20071 * Frees any resources used by the UserConfig, if is_owned is set and inner is non-NULL.
20073 void UserConfig_free(struct LDKUserConfig this_obj);
20076 * Channel handshake config that we propose to our counterparty.
20078 struct LDKChannelHandshakeConfig UserConfig_get_channel_handshake_config(const struct LDKUserConfig *NONNULL_PTR this_ptr);
20081 * Channel handshake config that we propose to our counterparty.
20083 void UserConfig_set_channel_handshake_config(struct LDKUserConfig *NONNULL_PTR this_ptr, struct LDKChannelHandshakeConfig val);
20086 * Limits applied to our counterparty's proposed channel handshake config settings.
20088 struct LDKChannelHandshakeLimits UserConfig_get_channel_handshake_limits(const struct LDKUserConfig *NONNULL_PTR this_ptr);
20091 * Limits applied to our counterparty's proposed channel handshake config settings.
20093 void UserConfig_set_channel_handshake_limits(struct LDKUserConfig *NONNULL_PTR this_ptr, struct LDKChannelHandshakeLimits val);
20096 * Channel config which affects behavior during channel lifetime.
20098 struct LDKChannelConfig UserConfig_get_channel_config(const struct LDKUserConfig *NONNULL_PTR this_ptr);
20101 * Channel config which affects behavior during channel lifetime.
20103 void UserConfig_set_channel_config(struct LDKUserConfig *NONNULL_PTR this_ptr, struct LDKChannelConfig val);
20106 * If this is set to false, we will reject any HTLCs which were to be forwarded over private
20107 * channels. This prevents us from taking on HTLC-forwarding risk when we intend to run as a
20108 * node which is not online reliably.
20110 * For nodes which are not online reliably, you should set all channels to *not* be announced
20111 * (using [`ChannelHandshakeConfig::announced_channel`] and
20112 * [`ChannelHandshakeLimits::force_announced_channel_preference`]) and set this to false to
20113 * ensure you are not exposed to any forwarding risk.
20115 * Note that because you cannot change a channel's announced state after creation, there is no
20116 * way to disable forwarding on public channels retroactively. Thus, in order to change a node
20117 * from a publicly-announced forwarding node to a private non-forwarding node you must close
20118 * all your channels and open new ones. For privacy, you should also change your node_id
20119 * (swapping all private and public key material for new ones) at that time.
20121 * Default value: false.
20123 bool UserConfig_get_accept_forwards_to_priv_channels(const struct LDKUserConfig *NONNULL_PTR this_ptr);
20126 * If this is set to false, we will reject any HTLCs which were to be forwarded over private
20127 * channels. This prevents us from taking on HTLC-forwarding risk when we intend to run as a
20128 * node which is not online reliably.
20130 * For nodes which are not online reliably, you should set all channels to *not* be announced
20131 * (using [`ChannelHandshakeConfig::announced_channel`] and
20132 * [`ChannelHandshakeLimits::force_announced_channel_preference`]) and set this to false to
20133 * ensure you are not exposed to any forwarding risk.
20135 * Note that because you cannot change a channel's announced state after creation, there is no
20136 * way to disable forwarding on public channels retroactively. Thus, in order to change a node
20137 * from a publicly-announced forwarding node to a private non-forwarding node you must close
20138 * all your channels and open new ones. For privacy, you should also change your node_id
20139 * (swapping all private and public key material for new ones) at that time.
20141 * Default value: false.
20143 void UserConfig_set_accept_forwards_to_priv_channels(struct LDKUserConfig *NONNULL_PTR this_ptr, bool val);
20146 * If this is set to false, we do not accept inbound requests to open a new channel.
20147 * Default value: true.
20149 bool UserConfig_get_accept_inbound_channels(const struct LDKUserConfig *NONNULL_PTR this_ptr);
20152 * If this is set to false, we do not accept inbound requests to open a new channel.
20153 * Default value: true.
20155 void UserConfig_set_accept_inbound_channels(struct LDKUserConfig *NONNULL_PTR this_ptr, bool val);
20158 * If this is set to true, the user needs to manually accept inbound requests to open a new
20161 * When set to true, [`Event::OpenChannelRequest`] will be triggered once a request to open a
20162 * new inbound channel is received through a [`msgs::OpenChannel`] message. In that case, a
20163 * [`msgs::AcceptChannel`] message will not be sent back to the counterparty node unless the
20164 * user explicitly chooses to accept the request.
20166 * Default value: false.
20168 * [`Event::OpenChannelRequest`]: crate::util::events::Event::OpenChannelRequest
20169 * [`msgs::OpenChannel`]: crate::ln::msgs::OpenChannel
20170 * [`msgs::AcceptChannel`]: crate::ln::msgs::AcceptChannel
20172 bool UserConfig_get_manually_accept_inbound_channels(const struct LDKUserConfig *NONNULL_PTR this_ptr);
20175 * If this is set to true, the user needs to manually accept inbound requests to open a new
20178 * When set to true, [`Event::OpenChannelRequest`] will be triggered once a request to open a
20179 * new inbound channel is received through a [`msgs::OpenChannel`] message. In that case, a
20180 * [`msgs::AcceptChannel`] message will not be sent back to the counterparty node unless the
20181 * user explicitly chooses to accept the request.
20183 * Default value: false.
20185 * [`Event::OpenChannelRequest`]: crate::util::events::Event::OpenChannelRequest
20186 * [`msgs::OpenChannel`]: crate::ln::msgs::OpenChannel
20187 * [`msgs::AcceptChannel`]: crate::ln::msgs::AcceptChannel
20189 void UserConfig_set_manually_accept_inbound_channels(struct LDKUserConfig *NONNULL_PTR this_ptr, bool val);
20192 * Constructs a new UserConfig given each field
20194 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);
20197 * Creates a copy of the UserConfig
20199 struct LDKUserConfig UserConfig_clone(const struct LDKUserConfig *NONNULL_PTR orig);
20202 * Creates a "default" UserConfig. See struct and individual field documentaiton for details on which values are used.
20204 MUST_USE_RES struct LDKUserConfig UserConfig_default(void);
20207 * Frees any resources used by the BestBlock, if is_owned is set and inner is non-NULL.
20209 void BestBlock_free(struct LDKBestBlock this_obj);
20212 * Creates a copy of the BestBlock
20214 struct LDKBestBlock BestBlock_clone(const struct LDKBestBlock *NONNULL_PTR orig);
20217 * Checks if two BestBlocks contain equal inner contents.
20218 * This ignores pointers and is_owned flags and looks at the values in fields.
20219 * Two objects with NULL inner values will be considered "equal" here.
20221 bool BestBlock_eq(const struct LDKBestBlock *NONNULL_PTR a, const struct LDKBestBlock *NONNULL_PTR b);
20224 * Constructs a `BestBlock` that represents the genesis block at height 0 of the given
20227 MUST_USE_RES struct LDKBestBlock BestBlock_from_genesis(enum LDKNetwork network);
20230 * Returns a `BestBlock` as identified by the given block hash and height.
20232 MUST_USE_RES struct LDKBestBlock BestBlock_new(struct LDKThirtyTwoBytes block_hash, uint32_t height);
20235 * Returns the best block hash.
20237 MUST_USE_RES struct LDKThirtyTwoBytes BestBlock_block_hash(const struct LDKBestBlock *NONNULL_PTR this_arg);
20240 * Returns the best block height.
20242 MUST_USE_RES uint32_t BestBlock_height(const struct LDKBestBlock *NONNULL_PTR this_arg);
20245 * Creates a copy of the AccessError
20247 enum LDKAccessError AccessError_clone(const enum LDKAccessError *NONNULL_PTR orig);
20250 * Utility method to constructs a new UnknownChain-variant AccessError
20252 enum LDKAccessError AccessError_unknown_chain(void);
20255 * Utility method to constructs a new UnknownTx-variant AccessError
20257 enum LDKAccessError AccessError_unknown_tx(void);
20260 * Calls the free function if one is set
20262 void Access_free(struct LDKAccess this_ptr);
20265 * Calls the free function if one is set
20267 void Listen_free(struct LDKListen this_ptr);
20270 * Calls the free function if one is set
20272 void Confirm_free(struct LDKConfirm this_ptr);
20275 * Creates a copy of the ChannelMonitorUpdateStatus
20277 enum LDKChannelMonitorUpdateStatus ChannelMonitorUpdateStatus_clone(const enum LDKChannelMonitorUpdateStatus *NONNULL_PTR orig);
20280 * Utility method to constructs a new Completed-variant ChannelMonitorUpdateStatus
20282 enum LDKChannelMonitorUpdateStatus ChannelMonitorUpdateStatus_completed(void);
20285 * Utility method to constructs a new InProgress-variant ChannelMonitorUpdateStatus
20287 enum LDKChannelMonitorUpdateStatus ChannelMonitorUpdateStatus_in_progress(void);
20290 * Utility method to constructs a new PermanentFailure-variant ChannelMonitorUpdateStatus
20292 enum LDKChannelMonitorUpdateStatus ChannelMonitorUpdateStatus_permanent_failure(void);
20295 * Checks if two ChannelMonitorUpdateStatuss contain equal inner contents.
20296 * This ignores pointers and is_owned flags and looks at the values in fields.
20298 bool ChannelMonitorUpdateStatus_eq(const enum LDKChannelMonitorUpdateStatus *NONNULL_PTR a, const enum LDKChannelMonitorUpdateStatus *NONNULL_PTR b);
20301 * Calls the free function if one is set
20303 void Watch_free(struct LDKWatch this_ptr);
20306 * Calls the free function if one is set
20308 void Filter_free(struct LDKFilter this_ptr);
20311 * Frees any resources used by the WatchedOutput, if is_owned is set and inner is non-NULL.
20313 void WatchedOutput_free(struct LDKWatchedOutput this_obj);
20316 * First block where the transaction output may have been spent.
20318 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
20320 struct LDKThirtyTwoBytes WatchedOutput_get_block_hash(const struct LDKWatchedOutput *NONNULL_PTR this_ptr);
20323 * First block where the transaction output may have been spent.
20325 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
20327 void WatchedOutput_set_block_hash(struct LDKWatchedOutput *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
20330 * Outpoint identifying the transaction output.
20332 struct LDKOutPoint WatchedOutput_get_outpoint(const struct LDKWatchedOutput *NONNULL_PTR this_ptr);
20335 * Outpoint identifying the transaction output.
20337 void WatchedOutput_set_outpoint(struct LDKWatchedOutput *NONNULL_PTR this_ptr, struct LDKOutPoint val);
20340 * Spending condition of the transaction output.
20342 struct LDKu8slice WatchedOutput_get_script_pubkey(const struct LDKWatchedOutput *NONNULL_PTR this_ptr);
20345 * Spending condition of the transaction output.
20347 void WatchedOutput_set_script_pubkey(struct LDKWatchedOutput *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val);
20350 * Constructs a new WatchedOutput given each field
20352 MUST_USE_RES struct LDKWatchedOutput WatchedOutput_new(struct LDKThirtyTwoBytes block_hash_arg, struct LDKOutPoint outpoint_arg, struct LDKCVec_u8Z script_pubkey_arg);
20355 * Creates a copy of the WatchedOutput
20357 struct LDKWatchedOutput WatchedOutput_clone(const struct LDKWatchedOutput *NONNULL_PTR orig);
20360 * Checks if two WatchedOutputs contain equal inner contents.
20361 * This ignores pointers and is_owned flags and looks at the values in fields.
20362 * Two objects with NULL inner values will be considered "equal" here.
20364 bool WatchedOutput_eq(const struct LDKWatchedOutput *NONNULL_PTR a, const struct LDKWatchedOutput *NONNULL_PTR b);
20367 * Checks if two WatchedOutputs contain equal inner contents.
20369 uint64_t WatchedOutput_hash(const struct LDKWatchedOutput *NONNULL_PTR o);
20372 * Calls the free function if one is set
20374 void BroadcasterInterface_free(struct LDKBroadcasterInterface this_ptr);
20377 * Creates a copy of the ConfirmationTarget
20379 enum LDKConfirmationTarget ConfirmationTarget_clone(const enum LDKConfirmationTarget *NONNULL_PTR orig);
20382 * Utility method to constructs a new Background-variant ConfirmationTarget
20384 enum LDKConfirmationTarget ConfirmationTarget_background(void);
20387 * Utility method to constructs a new Normal-variant ConfirmationTarget
20389 enum LDKConfirmationTarget ConfirmationTarget_normal(void);
20392 * Utility method to constructs a new HighPriority-variant ConfirmationTarget
20394 enum LDKConfirmationTarget ConfirmationTarget_high_priority(void);
20397 * Checks if two ConfirmationTargets contain equal inner contents.
20398 * This ignores pointers and is_owned flags and looks at the values in fields.
20400 bool ConfirmationTarget_eq(const enum LDKConfirmationTarget *NONNULL_PTR a, const enum LDKConfirmationTarget *NONNULL_PTR b);
20403 * Calls the free function if one is set
20405 void FeeEstimator_free(struct LDKFeeEstimator this_ptr);
20408 * Frees any resources used by the MonitorUpdateId, if is_owned is set and inner is non-NULL.
20410 void MonitorUpdateId_free(struct LDKMonitorUpdateId this_obj);
20413 * Creates a copy of the MonitorUpdateId
20415 struct LDKMonitorUpdateId MonitorUpdateId_clone(const struct LDKMonitorUpdateId *NONNULL_PTR orig);
20418 * Checks if two MonitorUpdateIds contain equal inner contents.
20420 uint64_t MonitorUpdateId_hash(const struct LDKMonitorUpdateId *NONNULL_PTR o);
20423 * Checks if two MonitorUpdateIds contain equal inner contents.
20424 * This ignores pointers and is_owned flags and looks at the values in fields.
20425 * Two objects with NULL inner values will be considered "equal" here.
20427 bool MonitorUpdateId_eq(const struct LDKMonitorUpdateId *NONNULL_PTR a, const struct LDKMonitorUpdateId *NONNULL_PTR b);
20430 * Calls the free function if one is set
20432 void Persist_free(struct LDKPersist this_ptr);
20435 * Frees any resources used by the LockedChannelMonitor, if is_owned is set and inner is non-NULL.
20437 void LockedChannelMonitor_free(struct LDKLockedChannelMonitor this_obj);
20440 * Frees any resources used by the ChainMonitor, if is_owned is set and inner is non-NULL.
20442 void ChainMonitor_free(struct LDKChainMonitor this_obj);
20445 * Creates a new `ChainMonitor` used to watch on-chain activity pertaining to channels.
20447 * When an optional chain source implementing [`chain::Filter`] is provided, the chain monitor
20448 * will call back to it indicating transactions and outputs of interest. This allows clients to
20449 * pre-filter blocks or only fetch blocks matching a compact filter. Otherwise, clients may
20450 * always need to fetch full blocks absent another means for determining which blocks contain
20451 * transactions relevant to the watched channels.
20453 MUST_USE_RES struct LDKChainMonitor ChainMonitor_new(struct LDKCOption_FilterZ chain_source, struct LDKBroadcasterInterface broadcaster, struct LDKLogger logger, struct LDKFeeEstimator feeest, struct LDKPersist persister);
20456 * Gets the balances in the contained [`ChannelMonitor`]s which are claimable on-chain or
20457 * claims which are awaiting confirmation.
20459 * Includes the balances from each [`ChannelMonitor`] *except* those included in
20460 * `ignored_channels`, allowing you to filter out balances from channels which are still open
20461 * (and whose balance should likely be pulled from the [`ChannelDetails`]).
20463 * See [`ChannelMonitor::get_claimable_balances`] for more details on the exact criteria for
20464 * inclusion in the return value.
20466 MUST_USE_RES struct LDKCVec_BalanceZ ChainMonitor_get_claimable_balances(const struct LDKChainMonitor *NONNULL_PTR this_arg, struct LDKCVec_ChannelDetailsZ ignored_channels);
20469 * Gets the [`LockedChannelMonitor`] for a given funding outpoint, returning an `Err` if no
20470 * such [`ChannelMonitor`] is currently being monitored for.
20472 * Note that the result holds a mutex over our monitor set, and should not be held
20475 MUST_USE_RES struct LDKCResult_LockedChannelMonitorNoneZ ChainMonitor_get_monitor(const struct LDKChainMonitor *NONNULL_PTR this_arg, struct LDKOutPoint funding_txo);
20478 * Lists the funding outpoint of each [`ChannelMonitor`] being monitored.
20480 * Note that [`ChannelMonitor`]s are not removed when a channel is closed as they are always
20481 * monitoring for on-chain state resolutions.
20483 MUST_USE_RES struct LDKCVec_OutPointZ ChainMonitor_list_monitors(const struct LDKChainMonitor *NONNULL_PTR this_arg);
20486 * Indicates the persistence of a [`ChannelMonitor`] has completed after
20487 * [`ChannelMonitorUpdateStatus::InProgress`] was returned from an update operation.
20489 * Thus, the anticipated use is, at a high level:
20490 * 1) This [`ChainMonitor`] calls [`Persist::update_persisted_channel`] which stores the
20491 * update to disk and begins updating any remote (e.g. watchtower/backup) copies,
20492 * returning [`ChannelMonitorUpdateStatus::InProgress`],
20493 * 2) once all remote copies are updated, you call this function with the
20494 * `completed_update_id` that completed, and once all pending updates have completed the
20495 * channel will be re-enabled.
20497 * Returns an [`APIError::APIMisuseError`] if `funding_txo` does not match any currently
20498 * registered [`ChannelMonitor`]s.
20500 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);
20503 * Constructs a new Listen which calls the relevant methods on this_arg.
20504 * This copies the `inner` pointer in this_arg and thus the returned Listen must be freed before this_arg is
20506 struct LDKListen ChainMonitor_as_Listen(const struct LDKChainMonitor *NONNULL_PTR this_arg);
20509 * Constructs a new Confirm which calls the relevant methods on this_arg.
20510 * This copies the `inner` pointer in this_arg and thus the returned Confirm must be freed before this_arg is
20512 struct LDKConfirm ChainMonitor_as_Confirm(const struct LDKChainMonitor *NONNULL_PTR this_arg);
20515 * Constructs a new Watch which calls the relevant methods on this_arg.
20516 * This copies the `inner` pointer in this_arg and thus the returned Watch must be freed before this_arg is
20518 struct LDKWatch ChainMonitor_as_Watch(const struct LDKChainMonitor *NONNULL_PTR this_arg);
20521 * Constructs a new EventsProvider which calls the relevant methods on this_arg.
20522 * This copies the `inner` pointer in this_arg and thus the returned EventsProvider must be freed before this_arg is
20524 struct LDKEventsProvider ChainMonitor_as_EventsProvider(const struct LDKChainMonitor *NONNULL_PTR this_arg);
20527 * Frees any resources used by the ChannelMonitorUpdate, if is_owned is set and inner is non-NULL.
20529 void ChannelMonitorUpdate_free(struct LDKChannelMonitorUpdate this_obj);
20532 * The sequence number of this update. Updates *must* be replayed in-order according to this
20533 * sequence number (and updates may panic if they are not). The update_id values are strictly
20534 * increasing and increase by one for each new update, with one exception specified below.
20536 * This sequence number is also used to track up to which points updates which returned
20537 * [`ChannelMonitorUpdateStatus::InProgress`] have been applied to all copies of a given
20538 * ChannelMonitor when ChannelManager::channel_monitor_updated is called.
20540 * The only instance where update_id values are not strictly increasing is the case where we
20541 * allow post-force-close updates with a special update ID of [`CLOSED_CHANNEL_UPDATE_ID`]. See
20542 * its docs for more details.
20544 * [`ChannelMonitorUpdateStatus::InProgress`]: super::ChannelMonitorUpdateStatus::InProgress
20546 uint64_t ChannelMonitorUpdate_get_update_id(const struct LDKChannelMonitorUpdate *NONNULL_PTR this_ptr);
20549 * The sequence number of this update. Updates *must* be replayed in-order according to this
20550 * sequence number (and updates may panic if they are not). The update_id values are strictly
20551 * increasing and increase by one for each new update, with one exception specified below.
20553 * This sequence number is also used to track up to which points updates which returned
20554 * [`ChannelMonitorUpdateStatus::InProgress`] have been applied to all copies of a given
20555 * ChannelMonitor when ChannelManager::channel_monitor_updated is called.
20557 * The only instance where update_id values are not strictly increasing is the case where we
20558 * allow post-force-close updates with a special update ID of [`CLOSED_CHANNEL_UPDATE_ID`]. See
20559 * its docs for more details.
20561 * [`ChannelMonitorUpdateStatus::InProgress`]: super::ChannelMonitorUpdateStatus::InProgress
20563 void ChannelMonitorUpdate_set_update_id(struct LDKChannelMonitorUpdate *NONNULL_PTR this_ptr, uint64_t val);
20566 * Creates a copy of the ChannelMonitorUpdate
20568 struct LDKChannelMonitorUpdate ChannelMonitorUpdate_clone(const struct LDKChannelMonitorUpdate *NONNULL_PTR orig);
20571 * Serialize the ChannelMonitorUpdate object into a byte array which can be read by ChannelMonitorUpdate_read
20573 struct LDKCVec_u8Z ChannelMonitorUpdate_write(const struct LDKChannelMonitorUpdate *NONNULL_PTR obj);
20576 * Read a ChannelMonitorUpdate from a byte array, created by ChannelMonitorUpdate_write
20578 struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ ChannelMonitorUpdate_read(struct LDKu8slice ser);
20581 * Frees any resources used by the MonitorEvent
20583 void MonitorEvent_free(struct LDKMonitorEvent this_ptr);
20586 * Creates a copy of the MonitorEvent
20588 struct LDKMonitorEvent MonitorEvent_clone(const struct LDKMonitorEvent *NONNULL_PTR orig);
20591 * Utility method to constructs a new HTLCEvent-variant MonitorEvent
20593 struct LDKMonitorEvent MonitorEvent_htlcevent(struct LDKHTLCUpdate a);
20596 * Utility method to constructs a new CommitmentTxConfirmed-variant MonitorEvent
20598 struct LDKMonitorEvent MonitorEvent_commitment_tx_confirmed(struct LDKOutPoint a);
20601 * Utility method to constructs a new Completed-variant MonitorEvent
20603 struct LDKMonitorEvent MonitorEvent_completed(struct LDKOutPoint funding_txo, uint64_t monitor_update_id);
20606 * Utility method to constructs a new UpdateFailed-variant MonitorEvent
20608 struct LDKMonitorEvent MonitorEvent_update_failed(struct LDKOutPoint a);
20611 * Checks if two MonitorEvents contain equal inner contents.
20612 * This ignores pointers and is_owned flags and looks at the values in fields.
20614 bool MonitorEvent_eq(const struct LDKMonitorEvent *NONNULL_PTR a, const struct LDKMonitorEvent *NONNULL_PTR b);
20617 * Serialize the MonitorEvent object into a byte array which can be read by MonitorEvent_read
20619 struct LDKCVec_u8Z MonitorEvent_write(const struct LDKMonitorEvent *NONNULL_PTR obj);
20622 * Read a MonitorEvent from a byte array, created by MonitorEvent_write
20624 struct LDKCResult_COption_MonitorEventZDecodeErrorZ MonitorEvent_read(struct LDKu8slice ser);
20627 * Frees any resources used by the HTLCUpdate, if is_owned is set and inner is non-NULL.
20629 void HTLCUpdate_free(struct LDKHTLCUpdate this_obj);
20632 * Creates a copy of the HTLCUpdate
20634 struct LDKHTLCUpdate HTLCUpdate_clone(const struct LDKHTLCUpdate *NONNULL_PTR orig);
20637 * Checks if two HTLCUpdates contain equal inner contents.
20638 * This ignores pointers and is_owned flags and looks at the values in fields.
20639 * Two objects with NULL inner values will be considered "equal" here.
20641 bool HTLCUpdate_eq(const struct LDKHTLCUpdate *NONNULL_PTR a, const struct LDKHTLCUpdate *NONNULL_PTR b);
20644 * Serialize the HTLCUpdate object into a byte array which can be read by HTLCUpdate_read
20646 struct LDKCVec_u8Z HTLCUpdate_write(const struct LDKHTLCUpdate *NONNULL_PTR obj);
20649 * Read a HTLCUpdate from a byte array, created by HTLCUpdate_write
20651 struct LDKCResult_HTLCUpdateDecodeErrorZ HTLCUpdate_read(struct LDKu8slice ser);
20654 * Frees any resources used by the Balance
20656 void Balance_free(struct LDKBalance this_ptr);
20659 * Creates a copy of the Balance
20661 struct LDKBalance Balance_clone(const struct LDKBalance *NONNULL_PTR orig);
20664 * Utility method to constructs a new ClaimableOnChannelClose-variant Balance
20666 struct LDKBalance Balance_claimable_on_channel_close(uint64_t claimable_amount_satoshis);
20669 * Utility method to constructs a new ClaimableAwaitingConfirmations-variant Balance
20671 struct LDKBalance Balance_claimable_awaiting_confirmations(uint64_t claimable_amount_satoshis, uint32_t confirmation_height);
20674 * Utility method to constructs a new ContentiousClaimable-variant Balance
20676 struct LDKBalance Balance_contentious_claimable(uint64_t claimable_amount_satoshis, uint32_t timeout_height);
20679 * Utility method to constructs a new MaybeTimeoutClaimableHTLC-variant Balance
20681 struct LDKBalance Balance_maybe_timeout_claimable_htlc(uint64_t claimable_amount_satoshis, uint32_t claimable_height);
20684 * Utility method to constructs a new MaybePreimageClaimableHTLC-variant Balance
20686 struct LDKBalance Balance_maybe_preimage_claimable_htlc(uint64_t claimable_amount_satoshis, uint32_t expiry_height);
20689 * Utility method to constructs a new CounterpartyRevokedOutputClaimable-variant Balance
20691 struct LDKBalance Balance_counterparty_revoked_output_claimable(uint64_t claimable_amount_satoshis);
20694 * Checks if two Balances contain equal inner contents.
20695 * This ignores pointers and is_owned flags and looks at the values in fields.
20697 bool Balance_eq(const struct LDKBalance *NONNULL_PTR a, const struct LDKBalance *NONNULL_PTR b);
20700 * Frees any resources used by the ChannelMonitor, if is_owned is set and inner is non-NULL.
20702 void ChannelMonitor_free(struct LDKChannelMonitor this_obj);
20705 * Serialize the ChannelMonitor object into a byte array which can be read by ChannelMonitor_read
20707 struct LDKCVec_u8Z ChannelMonitor_write(const struct LDKChannelMonitor *NONNULL_PTR obj);
20710 * Updates a ChannelMonitor on the basis of some new information provided by the Channel
20713 * panics if the given update is not the next update by update_id.
20715 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);
20718 * Gets the update_id from the latest ChannelMonitorUpdate which was applied to this
20721 MUST_USE_RES uint64_t ChannelMonitor_get_latest_update_id(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
20724 * Gets the funding transaction outpoint of the channel this ChannelMonitor is monitoring for.
20726 MUST_USE_RES struct LDKC2Tuple_OutPointScriptZ ChannelMonitor_get_funding_txo(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
20729 * Gets a list of txids, with their output scripts (in the order they appear in the
20730 * transaction), which we must learn about spends of via block_connected().
20732 MUST_USE_RES struct LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ ChannelMonitor_get_outputs_to_watch(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
20735 * Loads the funding txo and outputs to watch into the given `chain::Filter` by repeatedly
20736 * calling `chain::Filter::register_output` and `chain::Filter::register_tx` until all outputs
20737 * have been registered.
20739 void ChannelMonitor_load_outputs_to_watch(const struct LDKChannelMonitor *NONNULL_PTR this_arg, const struct LDKFilter *NONNULL_PTR filter);
20742 * Get the list of HTLCs who's status has been updated on chain. This should be called by
20743 * ChannelManager via [`chain::Watch::release_pending_monitor_events`].
20745 MUST_USE_RES struct LDKCVec_MonitorEventZ ChannelMonitor_get_and_clear_pending_monitor_events(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
20748 * Gets the list of pending events which were generated by previous actions, clearing the list
20751 * This is called by ChainMonitor::get_and_clear_pending_events() and is equivalent to
20752 * EventsProvider::get_and_clear_pending_events() except that it requires &mut self as we do
20753 * no internal locking in ChannelMonitors.
20755 MUST_USE_RES struct LDKCVec_EventZ ChannelMonitor_get_and_clear_pending_events(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
20758 * Gets the `node_id` of the counterparty for this channel.
20760 * Will be `None` for channels constructed on LDK versions prior to 0.0.110 and always `Some`
20763 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
20765 MUST_USE_RES struct LDKPublicKey ChannelMonitor_get_counterparty_node_id(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
20768 * Used by ChannelManager deserialization to broadcast the latest holder state if its copy of
20769 * the Channel was out-of-date.
20771 * You may also use this to broadcast the latest local commitment transaction, either because
20772 * a monitor update failed with [`ChannelMonitorUpdateStatus::PermanentFailure`] or because we've
20773 * fallen behind (i.e. we've received proof that our counterparty side knows a revocation
20774 * secret we gave them that they shouldn't know).
20776 * Broadcasting these transactions in the second case is UNSAFE, as they allow counterparty
20777 * side to punish you. Nevertheless you may want to broadcast them if counterparty doesn't
20778 * close channel with their commitment transaction after a substantial amount of time. Best
20779 * may be to contact the other node operator out-of-band to coordinate other options available
20780 * to you. In any-case, the choice is up to you.
20782 * [`ChannelMonitorUpdateStatus::PermanentFailure`]: super::ChannelMonitorUpdateStatus::PermanentFailure
20784 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);
20787 * Processes transactions in a newly connected block, which may result in any of the following:
20788 * - update the monitor's state against resolved HTLCs
20789 * - punish the counterparty in the case of seeing a revoked commitment transaction
20790 * - force close the channel and claim/timeout incoming/outgoing HTLCs if near expiration
20791 * - detect settled outputs for later spending
20792 * - schedule and bump any in-flight claims
20794 * Returns any new outputs to watch from `txdata`; after called, these are also included in
20795 * [`get_outputs_to_watch`].
20797 * [`get_outputs_to_watch`]: #method.get_outputs_to_watch
20799 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);
20802 * Determines if the disconnected block contained any transactions of interest and updates
20805 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);
20808 * Processes transactions confirmed in a block with the given header and height, returning new
20809 * outputs to watch. See [`block_connected`] for details.
20811 * Used instead of [`block_connected`] by clients that are notified of transactions rather than
20812 * blocks. See [`chain::Confirm`] for calling expectations.
20814 * [`block_connected`]: Self::block_connected
20816 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);
20819 * Processes a transaction that was reorganized out of the chain.
20821 * Used instead of [`block_disconnected`] by clients that are notified of transactions rather
20822 * than blocks. See [`chain::Confirm`] for calling expectations.
20824 * [`block_disconnected`]: Self::block_disconnected
20826 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);
20829 * Updates the monitor with the current best chain tip, returning new outputs to watch. See
20830 * [`block_connected`] for details.
20832 * Used instead of [`block_connected`] by clients that are notified of transactions rather than
20833 * blocks. See [`chain::Confirm`] for calling expectations.
20835 * [`block_connected`]: Self::block_connected
20837 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);
20840 * Returns the set of txids that should be monitored for re-organization out of the chain.
20842 MUST_USE_RES struct LDKCVec_TxidZ ChannelMonitor_get_relevant_txids(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
20845 * Gets the latest best block which was connected either via the [`chain::Listen`] or
20846 * [`chain::Confirm`] interfaces.
20848 MUST_USE_RES struct LDKBestBlock ChannelMonitor_current_best_block(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
20851 * Gets the balances in this channel which are either claimable by us if we were to
20852 * force-close the channel now or which are claimable on-chain (possibly awaiting
20855 * Any balances in the channel which are available on-chain (excluding on-chain fees) are
20856 * included here until an [`Event::SpendableOutputs`] event has been generated for the
20857 * balance, or until our counterparty has claimed the balance and accrued several
20858 * confirmations on the claim transaction.
20860 * Note that for `ChannelMonitors` which track a channel which went on-chain with versions of
20861 * LDK prior to 0.0.111, balances may not be fully captured if our counterparty broadcasted
20864 * See [`Balance`] for additional details on the types of claimable balances which
20865 * may be returned here and their meanings.
20867 MUST_USE_RES struct LDKCVec_BalanceZ ChannelMonitor_get_claimable_balances(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
20870 * Read a C2Tuple_BlockHashChannelMonitorZ from a byte array, created by C2Tuple_BlockHashChannelMonitorZ_write
20872 struct LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ C2Tuple_BlockHashChannelMonitorZ_read(struct LDKu8slice ser, const struct LDKKeysInterface *NONNULL_PTR arg);
20875 * Frees any resources used by the OutPoint, if is_owned is set and inner is non-NULL.
20877 void OutPoint_free(struct LDKOutPoint this_obj);
20880 * The referenced transaction's txid.
20882 const uint8_t (*OutPoint_get_txid(const struct LDKOutPoint *NONNULL_PTR this_ptr))[32];
20885 * The referenced transaction's txid.
20887 void OutPoint_set_txid(struct LDKOutPoint *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
20890 * The index of the referenced output in its transaction's vout.
20892 uint16_t OutPoint_get_index(const struct LDKOutPoint *NONNULL_PTR this_ptr);
20895 * The index of the referenced output in its transaction's vout.
20897 void OutPoint_set_index(struct LDKOutPoint *NONNULL_PTR this_ptr, uint16_t val);
20900 * Constructs a new OutPoint given each field
20902 MUST_USE_RES struct LDKOutPoint OutPoint_new(struct LDKThirtyTwoBytes txid_arg, uint16_t index_arg);
20905 * Creates a copy of the OutPoint
20907 struct LDKOutPoint OutPoint_clone(const struct LDKOutPoint *NONNULL_PTR orig);
20910 * Checks if two OutPoints contain equal inner contents.
20911 * This ignores pointers and is_owned flags and looks at the values in fields.
20912 * Two objects with NULL inner values will be considered "equal" here.
20914 bool OutPoint_eq(const struct LDKOutPoint *NONNULL_PTR a, const struct LDKOutPoint *NONNULL_PTR b);
20917 * Checks if two OutPoints contain equal inner contents.
20919 uint64_t OutPoint_hash(const struct LDKOutPoint *NONNULL_PTR o);
20922 * Convert an `OutPoint` to a lightning channel id.
20924 MUST_USE_RES struct LDKThirtyTwoBytes OutPoint_to_channel_id(const struct LDKOutPoint *NONNULL_PTR this_arg);
20927 * Serialize the OutPoint object into a byte array which can be read by OutPoint_read
20929 struct LDKCVec_u8Z OutPoint_write(const struct LDKOutPoint *NONNULL_PTR obj);
20932 * Read a OutPoint from a byte array, created by OutPoint_write
20934 struct LDKCResult_OutPointDecodeErrorZ OutPoint_read(struct LDKu8slice ser);
20937 * Frees any resources used by the DelayedPaymentOutputDescriptor, if is_owned is set and inner is non-NULL.
20939 void DelayedPaymentOutputDescriptor_free(struct LDKDelayedPaymentOutputDescriptor this_obj);
20942 * The outpoint which is spendable
20944 struct LDKOutPoint DelayedPaymentOutputDescriptor_get_outpoint(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr);
20947 * The outpoint which is spendable
20949 void DelayedPaymentOutputDescriptor_set_outpoint(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKOutPoint val);
20952 * Per commitment point to derive delayed_payment_key by key holder
20954 struct LDKPublicKey DelayedPaymentOutputDescriptor_get_per_commitment_point(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr);
20957 * Per commitment point to derive delayed_payment_key by key holder
20959 void DelayedPaymentOutputDescriptor_set_per_commitment_point(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKPublicKey val);
20962 * The nSequence value which must be set in the spending input to satisfy the OP_CSV in
20963 * the witness_script.
20965 uint16_t DelayedPaymentOutputDescriptor_get_to_self_delay(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr);
20968 * The nSequence value which must be set in the spending input to satisfy the OP_CSV in
20969 * the witness_script.
20971 void DelayedPaymentOutputDescriptor_set_to_self_delay(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, uint16_t val);
20974 * The output which is referenced by the given outpoint
20976 * Returns a copy of the field.
20978 struct LDKTxOut DelayedPaymentOutputDescriptor_get_output(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr);
20981 * The output which is referenced by the given outpoint
20983 void DelayedPaymentOutputDescriptor_set_output(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKTxOut val);
20986 * The revocation point specific to the commitment transaction which was broadcast. Used to
20987 * derive the witnessScript for this output.
20989 struct LDKPublicKey DelayedPaymentOutputDescriptor_get_revocation_pubkey(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr);
20992 * The revocation point specific to the commitment transaction which was broadcast. Used to
20993 * derive the witnessScript for this output.
20995 void DelayedPaymentOutputDescriptor_set_revocation_pubkey(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKPublicKey val);
20998 * Arbitrary identification information returned by a call to
20999 * `Sign::channel_keys_id()`. This may be useful in re-deriving keys used in
21000 * the channel to spend the output.
21002 const uint8_t (*DelayedPaymentOutputDescriptor_get_channel_keys_id(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr))[32];
21005 * Arbitrary identification information returned by a call to
21006 * `Sign::channel_keys_id()`. This may be useful in re-deriving keys used in
21007 * the channel to spend the output.
21009 void DelayedPaymentOutputDescriptor_set_channel_keys_id(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
21012 * The value of the channel which this output originated from, possibly indirectly.
21014 uint64_t DelayedPaymentOutputDescriptor_get_channel_value_satoshis(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr);
21017 * The value of the channel which this output originated from, possibly indirectly.
21019 void DelayedPaymentOutputDescriptor_set_channel_value_satoshis(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, uint64_t val);
21022 * Constructs a new DelayedPaymentOutputDescriptor given each field
21024 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);
21027 * Creates a copy of the DelayedPaymentOutputDescriptor
21029 struct LDKDelayedPaymentOutputDescriptor DelayedPaymentOutputDescriptor_clone(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR orig);
21032 * Checks if two DelayedPaymentOutputDescriptors contain equal inner contents.
21033 * This ignores pointers and is_owned flags and looks at the values in fields.
21034 * Two objects with NULL inner values will be considered "equal" here.
21036 bool DelayedPaymentOutputDescriptor_eq(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR a, const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR b);
21039 * Serialize the DelayedPaymentOutputDescriptor object into a byte array which can be read by DelayedPaymentOutputDescriptor_read
21041 struct LDKCVec_u8Z DelayedPaymentOutputDescriptor_write(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR obj);
21044 * Read a DelayedPaymentOutputDescriptor from a byte array, created by DelayedPaymentOutputDescriptor_write
21046 struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ DelayedPaymentOutputDescriptor_read(struct LDKu8slice ser);
21049 * Frees any resources used by the StaticPaymentOutputDescriptor, if is_owned is set and inner is non-NULL.
21051 void StaticPaymentOutputDescriptor_free(struct LDKStaticPaymentOutputDescriptor this_obj);
21054 * The outpoint which is spendable
21056 struct LDKOutPoint StaticPaymentOutputDescriptor_get_outpoint(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr);
21059 * The outpoint which is spendable
21061 void StaticPaymentOutputDescriptor_set_outpoint(struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKOutPoint val);
21064 * The output which is referenced by the given outpoint
21066 * Returns a copy of the field.
21068 struct LDKTxOut StaticPaymentOutputDescriptor_get_output(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr);
21071 * The output which is referenced by the given outpoint
21073 void StaticPaymentOutputDescriptor_set_output(struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKTxOut val);
21076 * Arbitrary identification information returned by a call to
21077 * `Sign::channel_keys_id()`. This may be useful in re-deriving keys used in
21078 * the channel to spend the output.
21080 const uint8_t (*StaticPaymentOutputDescriptor_get_channel_keys_id(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr))[32];
21083 * Arbitrary identification information returned by a call to
21084 * `Sign::channel_keys_id()`. This may be useful in re-deriving keys used in
21085 * the channel to spend the output.
21087 void StaticPaymentOutputDescriptor_set_channel_keys_id(struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
21090 * The value of the channel which this transactions spends.
21092 uint64_t StaticPaymentOutputDescriptor_get_channel_value_satoshis(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr);
21095 * The value of the channel which this transactions spends.
21097 void StaticPaymentOutputDescriptor_set_channel_value_satoshis(struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr, uint64_t val);
21100 * Constructs a new StaticPaymentOutputDescriptor given each field
21102 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);
21105 * Creates a copy of the StaticPaymentOutputDescriptor
21107 struct LDKStaticPaymentOutputDescriptor StaticPaymentOutputDescriptor_clone(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR orig);
21110 * Checks if two StaticPaymentOutputDescriptors contain equal inner contents.
21111 * This ignores pointers and is_owned flags and looks at the values in fields.
21112 * Two objects with NULL inner values will be considered "equal" here.
21114 bool StaticPaymentOutputDescriptor_eq(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR a, const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR b);
21117 * Serialize the StaticPaymentOutputDescriptor object into a byte array which can be read by StaticPaymentOutputDescriptor_read
21119 struct LDKCVec_u8Z StaticPaymentOutputDescriptor_write(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR obj);
21122 * Read a StaticPaymentOutputDescriptor from a byte array, created by StaticPaymentOutputDescriptor_write
21124 struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ StaticPaymentOutputDescriptor_read(struct LDKu8slice ser);
21127 * Frees any resources used by the SpendableOutputDescriptor
21129 void SpendableOutputDescriptor_free(struct LDKSpendableOutputDescriptor this_ptr);
21132 * Creates a copy of the SpendableOutputDescriptor
21134 struct LDKSpendableOutputDescriptor SpendableOutputDescriptor_clone(const struct LDKSpendableOutputDescriptor *NONNULL_PTR orig);
21137 * Utility method to constructs a new StaticOutput-variant SpendableOutputDescriptor
21139 struct LDKSpendableOutputDescriptor SpendableOutputDescriptor_static_output(struct LDKOutPoint outpoint, struct LDKTxOut output);
21142 * Utility method to constructs a new DelayedPaymentOutput-variant SpendableOutputDescriptor
21144 struct LDKSpendableOutputDescriptor SpendableOutputDescriptor_delayed_payment_output(struct LDKDelayedPaymentOutputDescriptor a);
21147 * Utility method to constructs a new StaticPaymentOutput-variant SpendableOutputDescriptor
21149 struct LDKSpendableOutputDescriptor SpendableOutputDescriptor_static_payment_output(struct LDKStaticPaymentOutputDescriptor a);
21152 * Checks if two SpendableOutputDescriptors contain equal inner contents.
21153 * This ignores pointers and is_owned flags and looks at the values in fields.
21155 bool SpendableOutputDescriptor_eq(const struct LDKSpendableOutputDescriptor *NONNULL_PTR a, const struct LDKSpendableOutputDescriptor *NONNULL_PTR b);
21158 * Serialize the SpendableOutputDescriptor object into a byte array which can be read by SpendableOutputDescriptor_read
21160 struct LDKCVec_u8Z SpendableOutputDescriptor_write(const struct LDKSpendableOutputDescriptor *NONNULL_PTR obj);
21163 * Read a SpendableOutputDescriptor from a byte array, created by SpendableOutputDescriptor_write
21165 struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ SpendableOutputDescriptor_read(struct LDKu8slice ser);
21168 * Calls the free function if one is set
21170 void BaseSign_free(struct LDKBaseSign this_ptr);
21173 * Creates a copy of a Sign
21175 struct LDKSign Sign_clone(const struct LDKSign *NONNULL_PTR orig);
21178 * Calls the free function if one is set
21180 void Sign_free(struct LDKSign this_ptr);
21183 * Creates a copy of the Recipient
21185 enum LDKRecipient Recipient_clone(const enum LDKRecipient *NONNULL_PTR orig);
21188 * Utility method to constructs a new Node-variant Recipient
21190 enum LDKRecipient Recipient_node(void);
21193 * Utility method to constructs a new PhantomNode-variant Recipient
21195 enum LDKRecipient Recipient_phantom_node(void);
21198 * Calls the free function if one is set
21200 void KeysInterface_free(struct LDKKeysInterface this_ptr);
21203 * Frees any resources used by the InMemorySigner, if is_owned is set and inner is non-NULL.
21205 void InMemorySigner_free(struct LDKInMemorySigner this_obj);
21208 * Private key of anchor tx
21210 const uint8_t (*InMemorySigner_get_funding_key(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32];
21213 * Private key of anchor tx
21215 void InMemorySigner_set_funding_key(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKSecretKey val);
21218 * Holder secret key for blinded revocation pubkey
21220 const uint8_t (*InMemorySigner_get_revocation_base_key(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32];
21223 * Holder secret key for blinded revocation pubkey
21225 void InMemorySigner_set_revocation_base_key(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKSecretKey val);
21228 * Holder secret key used for our balance in counterparty-broadcasted commitment transactions
21230 const uint8_t (*InMemorySigner_get_payment_key(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32];
21233 * Holder secret key used for our balance in counterparty-broadcasted commitment transactions
21235 void InMemorySigner_set_payment_key(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKSecretKey val);
21238 * Holder secret key used in HTLC tx
21240 const uint8_t (*InMemorySigner_get_delayed_payment_base_key(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32];
21243 * Holder secret key used in HTLC tx
21245 void InMemorySigner_set_delayed_payment_base_key(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKSecretKey val);
21248 * Holder htlc secret key used in commitment tx htlc outputs
21250 const uint8_t (*InMemorySigner_get_htlc_base_key(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32];
21253 * Holder htlc secret key used in commitment tx htlc outputs
21255 void InMemorySigner_set_htlc_base_key(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKSecretKey val);
21260 const uint8_t (*InMemorySigner_get_commitment_seed(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32];
21265 void InMemorySigner_set_commitment_seed(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
21268 * Creates a copy of the InMemorySigner
21270 struct LDKInMemorySigner InMemorySigner_clone(const struct LDKInMemorySigner *NONNULL_PTR orig);
21273 * Create a new InMemorySigner
21275 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);
21278 * Counterparty pubkeys.
21279 * Will panic if ready_channel wasn't called.
21281 MUST_USE_RES struct LDKChannelPublicKeys InMemorySigner_counterparty_pubkeys(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
21284 * The contest_delay value specified by our counterparty and applied on holder-broadcastable
21285 * transactions, ie the amount of time that we have to wait to recover our funds if we
21286 * broadcast a transaction.
21287 * Will panic if ready_channel wasn't called.
21289 MUST_USE_RES uint16_t InMemorySigner_counterparty_selected_contest_delay(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
21292 * The contest_delay value specified by us and applied on transactions broadcastable
21293 * by our counterparty, ie the amount of time that they have to wait to recover their funds
21294 * if they broadcast a transaction.
21295 * Will panic if ready_channel wasn't called.
21297 MUST_USE_RES uint16_t InMemorySigner_holder_selected_contest_delay(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
21300 * Whether the holder is the initiator
21301 * Will panic if ready_channel wasn't called.
21303 MUST_USE_RES bool InMemorySigner_is_outbound(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
21307 * Will panic if ready_channel wasn't called.
21309 MUST_USE_RES struct LDKOutPoint InMemorySigner_funding_outpoint(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
21312 * Obtain a ChannelTransactionParameters for this channel, to be used when verifying or
21313 * building transactions.
21315 * Will panic if ready_channel wasn't called.
21317 MUST_USE_RES struct LDKChannelTransactionParameters InMemorySigner_get_channel_parameters(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
21320 * Whether anchors should be used.
21321 * Will panic if ready_channel wasn't called.
21323 MUST_USE_RES bool InMemorySigner_opt_anchors(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
21326 * Sign the single input of spend_tx at index `input_idx` which spends the output
21327 * described by descriptor, returning the witness stack for the input.
21329 * Returns an Err if the input at input_idx does not exist, has a non-empty script_sig,
21330 * is not spending the outpoint described by `descriptor.outpoint`,
21331 * or if an output descriptor script_pubkey does not match the one we can spend.
21333 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);
21336 * Sign the single input of spend_tx at index `input_idx` which spends the output
21337 * described by descriptor, returning the witness stack for the input.
21339 * Returns an Err if the input at input_idx does not exist, has a non-empty script_sig,
21340 * is not spending the outpoint described by `descriptor.outpoint`, does not have a
21341 * sequence set to `descriptor.to_self_delay`, or if an output descriptor
21342 * script_pubkey does not match the one we can spend.
21344 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);
21347 * Constructs a new BaseSign which calls the relevant methods on this_arg.
21348 * This copies the `inner` pointer in this_arg and thus the returned BaseSign must be freed before this_arg is
21350 struct LDKBaseSign InMemorySigner_as_BaseSign(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
21353 * Constructs a new Sign which calls the relevant methods on this_arg.
21354 * This copies the `inner` pointer in this_arg and thus the returned Sign must be freed before this_arg is
21356 struct LDKSign InMemorySigner_as_Sign(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
21359 * Serialize the InMemorySigner object into a byte array which can be read by InMemorySigner_read
21361 struct LDKCVec_u8Z InMemorySigner_write(const struct LDKInMemorySigner *NONNULL_PTR obj);
21364 * Read a InMemorySigner from a byte array, created by InMemorySigner_write
21366 struct LDKCResult_InMemorySignerDecodeErrorZ InMemorySigner_read(struct LDKu8slice ser, struct LDKSecretKey arg);
21369 * Frees any resources used by the KeysManager, if is_owned is set and inner is non-NULL.
21371 void KeysManager_free(struct LDKKeysManager this_obj);
21374 * Constructs a KeysManager from a 32-byte seed. If the seed is in some way biased (eg your
21375 * CSRNG is busted) this may panic (but more importantly, you will possibly lose funds).
21376 * starting_time isn't strictly required to actually be a time, but it must absolutely,
21377 * without a doubt, be unique to this instance. ie if you start multiple times with the same
21378 * seed, starting_time must be unique to each run. Thus, the easiest way to achieve this is to
21379 * simply use the current time (with very high precision).
21381 * The seed MUST be backed up safely prior to use so that the keys can be re-created, however,
21382 * obviously, starting_time should be unique every time you reload the library - it is only
21383 * used to generate new ephemeral key data (which will be stored by the individual channel if
21386 * Note that the seed is required to recover certain on-chain funds independent of
21387 * ChannelMonitor data, though a current copy of ChannelMonitor data is also required for any
21388 * channel, and some on-chain during-closing funds.
21390 * Note that until the 0.1 release there is no guarantee of backward compatibility between
21391 * versions. Once the library is more fully supported, the docs will be updated to include a
21392 * detailed description of the guarantee.
21394 MUST_USE_RES struct LDKKeysManager KeysManager_new(const uint8_t (*seed)[32], uint64_t starting_time_secs, uint32_t starting_time_nanos);
21397 * Derive an old Sign containing per-channel secrets based on a key derivation parameters.
21399 * Key derivation parameters are accessible through a per-channel secrets
21400 * Sign::channel_keys_id and is provided inside DynamicOuputP2WSH in case of
21401 * onchain output detection for which a corresponding delayed_payment_key must be derived.
21403 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]);
21406 * Creates a Transaction which spends the given descriptors to the given outputs, plus an
21407 * output to the given change destination (if sufficient change value remains). The
21408 * transaction will have a feerate, at least, of the given value.
21410 * Returns `Err(())` if the output value is greater than the input value minus required fee,
21411 * if a descriptor was duplicated, or if an output descriptor `script_pubkey`
21412 * does not match the one we can spend.
21414 * We do not enforce that outputs meet the dust limit or that any output scripts are standard.
21416 * May panic if the `SpendableOutputDescriptor`s were not generated by Channels which used
21417 * this KeysManager or one of the `InMemorySigner` created by this KeysManager.
21419 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);
21422 * Constructs a new KeysInterface which calls the relevant methods on this_arg.
21423 * This copies the `inner` pointer in this_arg and thus the returned KeysInterface must be freed before this_arg is
21425 struct LDKKeysInterface KeysManager_as_KeysInterface(const struct LDKKeysManager *NONNULL_PTR this_arg);
21428 * Frees any resources used by the PhantomKeysManager, if is_owned is set and inner is non-NULL.
21430 void PhantomKeysManager_free(struct LDKPhantomKeysManager this_obj);
21433 * Constructs a new KeysInterface which calls the relevant methods on this_arg.
21434 * This copies the `inner` pointer in this_arg and thus the returned KeysInterface must be freed before this_arg is
21436 struct LDKKeysInterface PhantomKeysManager_as_KeysInterface(const struct LDKPhantomKeysManager *NONNULL_PTR this_arg);
21439 * Constructs a `PhantomKeysManager` given a 32-byte seed and an additional `cross_node_seed`
21440 * that is shared across all nodes that intend to participate in [phantom node payments] together.
21442 * See [`KeysManager::new`] for more information on `seed`, `starting_time_secs`, and
21443 * `starting_time_nanos`.
21445 * `cross_node_seed` must be the same across all phantom payment-receiving nodes and also the
21446 * same across restarts, or else inbound payments may fail.
21448 * [phantom node payments]: PhantomKeysManager
21450 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]);
21453 * See [`KeysManager::spend_spendable_outputs`] for documentation on this method.
21455 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);
21458 * See [`KeysManager::derive_channel_keys`] for documentation on this method.
21460 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]);
21463 * Frees any resources used by the ChannelManager, if is_owned is set and inner is non-NULL.
21465 void ChannelManager_free(struct LDKChannelManager this_obj);
21468 * Frees any resources used by the ChainParameters, if is_owned is set and inner is non-NULL.
21470 void ChainParameters_free(struct LDKChainParameters this_obj);
21473 * The network for determining the `chain_hash` in Lightning messages.
21475 enum LDKNetwork ChainParameters_get_network(const struct LDKChainParameters *NONNULL_PTR this_ptr);
21478 * The network for determining the `chain_hash` in Lightning messages.
21480 void ChainParameters_set_network(struct LDKChainParameters *NONNULL_PTR this_ptr, enum LDKNetwork val);
21483 * The hash and height of the latest block successfully connected.
21485 * Used to track on-chain channel funding outputs and send payments with reliable timelocks.
21487 struct LDKBestBlock ChainParameters_get_best_block(const struct LDKChainParameters *NONNULL_PTR this_ptr);
21490 * The hash and height of the latest block successfully connected.
21492 * Used to track on-chain channel funding outputs and send payments with reliable timelocks.
21494 void ChainParameters_set_best_block(struct LDKChainParameters *NONNULL_PTR this_ptr, struct LDKBestBlock val);
21497 * Constructs a new ChainParameters given each field
21499 MUST_USE_RES struct LDKChainParameters ChainParameters_new(enum LDKNetwork network_arg, struct LDKBestBlock best_block_arg);
21502 * Creates a copy of the ChainParameters
21504 struct LDKChainParameters ChainParameters_clone(const struct LDKChainParameters *NONNULL_PTR orig);
21507 * Frees any resources used by the CounterpartyForwardingInfo, if is_owned is set and inner is non-NULL.
21509 void CounterpartyForwardingInfo_free(struct LDKCounterpartyForwardingInfo this_obj);
21512 * Base routing fee in millisatoshis.
21514 uint32_t CounterpartyForwardingInfo_get_fee_base_msat(const struct LDKCounterpartyForwardingInfo *NONNULL_PTR this_ptr);
21517 * Base routing fee in millisatoshis.
21519 void CounterpartyForwardingInfo_set_fee_base_msat(struct LDKCounterpartyForwardingInfo *NONNULL_PTR this_ptr, uint32_t val);
21522 * Amount in millionths of a satoshi the channel will charge per transferred satoshi.
21524 uint32_t CounterpartyForwardingInfo_get_fee_proportional_millionths(const struct LDKCounterpartyForwardingInfo *NONNULL_PTR this_ptr);
21527 * Amount in millionths of a satoshi the channel will charge per transferred satoshi.
21529 void CounterpartyForwardingInfo_set_fee_proportional_millionths(struct LDKCounterpartyForwardingInfo *NONNULL_PTR this_ptr, uint32_t val);
21532 * The minimum difference in cltv_expiry between an ingoing HTLC and its outgoing counterpart,
21533 * such that the outgoing HTLC is forwardable to this counterparty. See `msgs::ChannelUpdate`'s
21534 * `cltv_expiry_delta` for more details.
21536 uint16_t CounterpartyForwardingInfo_get_cltv_expiry_delta(const struct LDKCounterpartyForwardingInfo *NONNULL_PTR this_ptr);
21539 * The minimum difference in cltv_expiry between an ingoing HTLC and its outgoing counterpart,
21540 * such that the outgoing HTLC is forwardable to this counterparty. See `msgs::ChannelUpdate`'s
21541 * `cltv_expiry_delta` for more details.
21543 void CounterpartyForwardingInfo_set_cltv_expiry_delta(struct LDKCounterpartyForwardingInfo *NONNULL_PTR this_ptr, uint16_t val);
21546 * Constructs a new CounterpartyForwardingInfo given each field
21548 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);
21551 * Creates a copy of the CounterpartyForwardingInfo
21553 struct LDKCounterpartyForwardingInfo CounterpartyForwardingInfo_clone(const struct LDKCounterpartyForwardingInfo *NONNULL_PTR orig);
21556 * Frees any resources used by the ChannelCounterparty, if is_owned is set and inner is non-NULL.
21558 void ChannelCounterparty_free(struct LDKChannelCounterparty this_obj);
21561 * The node_id of our counterparty
21563 struct LDKPublicKey ChannelCounterparty_get_node_id(const struct LDKChannelCounterparty *NONNULL_PTR this_ptr);
21566 * The node_id of our counterparty
21568 void ChannelCounterparty_set_node_id(struct LDKChannelCounterparty *NONNULL_PTR this_ptr, struct LDKPublicKey val);
21571 * The Features the channel counterparty provided upon last connection.
21572 * Useful for routing as it is the most up-to-date copy of the counterparty's features and
21573 * many routing-relevant features are present in the init context.
21575 struct LDKInitFeatures ChannelCounterparty_get_features(const struct LDKChannelCounterparty *NONNULL_PTR this_ptr);
21578 * The Features the channel counterparty provided upon last connection.
21579 * Useful for routing as it is the most up-to-date copy of the counterparty's features and
21580 * many routing-relevant features are present in the init context.
21582 void ChannelCounterparty_set_features(struct LDKChannelCounterparty *NONNULL_PTR this_ptr, struct LDKInitFeatures val);
21585 * The value, in satoshis, that must always be held in the channel for our counterparty. This
21586 * value ensures that if our counterparty broadcasts a revoked state, we can punish them by
21587 * claiming at least this value on chain.
21589 * This value is not included in [`inbound_capacity_msat`] as it can never be spent.
21591 * [`inbound_capacity_msat`]: ChannelDetails::inbound_capacity_msat
21593 uint64_t ChannelCounterparty_get_unspendable_punishment_reserve(const struct LDKChannelCounterparty *NONNULL_PTR this_ptr);
21596 * The value, in satoshis, that must always be held in the channel for our counterparty. This
21597 * value ensures that if our counterparty broadcasts a revoked state, we can punish them by
21598 * claiming at least this value on chain.
21600 * This value is not included in [`inbound_capacity_msat`] as it can never be spent.
21602 * [`inbound_capacity_msat`]: ChannelDetails::inbound_capacity_msat
21604 void ChannelCounterparty_set_unspendable_punishment_reserve(struct LDKChannelCounterparty *NONNULL_PTR this_ptr, uint64_t val);
21607 * Information on the fees and requirements that the counterparty requires when forwarding
21608 * payments to us through this channel.
21610 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
21612 struct LDKCounterpartyForwardingInfo ChannelCounterparty_get_forwarding_info(const struct LDKChannelCounterparty *NONNULL_PTR this_ptr);
21615 * Information on the fees and requirements that the counterparty requires when forwarding
21616 * payments to us through this channel.
21618 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
21620 void ChannelCounterparty_set_forwarding_info(struct LDKChannelCounterparty *NONNULL_PTR this_ptr, struct LDKCounterpartyForwardingInfo val);
21623 * The smallest value HTLC (in msat) the remote peer will accept, for this channel. This field
21624 * is only `None` before we have received either the `OpenChannel` or `AcceptChannel` message
21625 * from the remote peer, or for `ChannelCounterparty` objects serialized prior to LDK 0.0.107.
21627 struct LDKCOption_u64Z ChannelCounterparty_get_outbound_htlc_minimum_msat(const struct LDKChannelCounterparty *NONNULL_PTR this_ptr);
21630 * The smallest value HTLC (in msat) the remote peer will accept, for this channel. This field
21631 * is only `None` before we have received either the `OpenChannel` or `AcceptChannel` message
21632 * from the remote peer, or for `ChannelCounterparty` objects serialized prior to LDK 0.0.107.
21634 void ChannelCounterparty_set_outbound_htlc_minimum_msat(struct LDKChannelCounterparty *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
21637 * The largest value HTLC (in msat) the remote peer currently will accept, for this channel.
21639 struct LDKCOption_u64Z ChannelCounterparty_get_outbound_htlc_maximum_msat(const struct LDKChannelCounterparty *NONNULL_PTR this_ptr);
21642 * The largest value HTLC (in msat) the remote peer currently will accept, for this channel.
21644 void ChannelCounterparty_set_outbound_htlc_maximum_msat(struct LDKChannelCounterparty *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
21647 * Constructs a new ChannelCounterparty given each field
21649 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);
21652 * Creates a copy of the ChannelCounterparty
21654 struct LDKChannelCounterparty ChannelCounterparty_clone(const struct LDKChannelCounterparty *NONNULL_PTR orig);
21657 * Frees any resources used by the ChannelDetails, if is_owned is set and inner is non-NULL.
21659 void ChannelDetails_free(struct LDKChannelDetails this_obj);
21662 * The channel's ID (prior to funding transaction generation, this is a random 32 bytes,
21663 * thereafter this is the txid of the funding transaction xor the funding transaction output).
21664 * Note that this means this value is *not* persistent - it can change once during the
21665 * lifetime of the channel.
21667 const uint8_t (*ChannelDetails_get_channel_id(const struct LDKChannelDetails *NONNULL_PTR this_ptr))[32];
21670 * The channel's ID (prior to funding transaction generation, this is a random 32 bytes,
21671 * thereafter this is the txid of the funding transaction xor the funding transaction output).
21672 * Note that this means this value is *not* persistent - it can change once during the
21673 * lifetime of the channel.
21675 void ChannelDetails_set_channel_id(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
21678 * Parameters which apply to our counterparty. See individual fields for more information.
21680 struct LDKChannelCounterparty ChannelDetails_get_counterparty(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
21683 * Parameters which apply to our counterparty. See individual fields for more information.
21685 void ChannelDetails_set_counterparty(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKChannelCounterparty val);
21688 * The Channel's funding transaction output, if we've negotiated the funding transaction with
21689 * our counterparty already.
21691 * Note that, if this has been set, `channel_id` will be equivalent to
21692 * `funding_txo.unwrap().to_channel_id()`.
21694 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
21696 struct LDKOutPoint ChannelDetails_get_funding_txo(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
21699 * The Channel's funding transaction output, if we've negotiated the funding transaction with
21700 * our counterparty already.
21702 * Note that, if this has been set, `channel_id` will be equivalent to
21703 * `funding_txo.unwrap().to_channel_id()`.
21705 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
21707 void ChannelDetails_set_funding_txo(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKOutPoint val);
21710 * The features which this channel operates with. See individual features for more info.
21712 * `None` until negotiation completes and the channel type is finalized.
21714 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
21716 struct LDKChannelTypeFeatures ChannelDetails_get_channel_type(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
21719 * The features which this channel operates with. See individual features for more info.
21721 * `None` until negotiation completes and the channel type is finalized.
21723 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
21725 void ChannelDetails_set_channel_type(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKChannelTypeFeatures val);
21728 * The position of the funding transaction in the chain. None if the funding transaction has
21729 * not yet been confirmed and the channel fully opened.
21731 * Note that if [`inbound_scid_alias`] is set, it must be used for invoices and inbound
21732 * payments instead of this. See [`get_inbound_payment_scid`].
21734 * For channels with [`confirmations_required`] set to `Some(0)`, [`outbound_scid_alias`] may
21735 * be used in place of this in outbound routes. See [`get_outbound_payment_scid`].
21737 * [`inbound_scid_alias`]: Self::inbound_scid_alias
21738 * [`outbound_scid_alias`]: Self::outbound_scid_alias
21739 * [`get_inbound_payment_scid`]: Self::get_inbound_payment_scid
21740 * [`get_outbound_payment_scid`]: Self::get_outbound_payment_scid
21741 * [`confirmations_required`]: Self::confirmations_required
21743 struct LDKCOption_u64Z ChannelDetails_get_short_channel_id(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
21746 * The position of the funding transaction in the chain. None if the funding transaction has
21747 * not yet been confirmed and the channel fully opened.
21749 * Note that if [`inbound_scid_alias`] is set, it must be used for invoices and inbound
21750 * payments instead of this. See [`get_inbound_payment_scid`].
21752 * For channels with [`confirmations_required`] set to `Some(0)`, [`outbound_scid_alias`] may
21753 * be used in place of this in outbound routes. See [`get_outbound_payment_scid`].
21755 * [`inbound_scid_alias`]: Self::inbound_scid_alias
21756 * [`outbound_scid_alias`]: Self::outbound_scid_alias
21757 * [`get_inbound_payment_scid`]: Self::get_inbound_payment_scid
21758 * [`get_outbound_payment_scid`]: Self::get_outbound_payment_scid
21759 * [`confirmations_required`]: Self::confirmations_required
21761 void ChannelDetails_set_short_channel_id(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
21764 * An optional [`short_channel_id`] alias for this channel, randomly generated by us and
21765 * usable in place of [`short_channel_id`] to reference the channel in outbound routes when
21766 * the channel has not yet been confirmed (as long as [`confirmations_required`] is
21769 * This will be `None` as long as the channel is not available for routing outbound payments.
21771 * [`short_channel_id`]: Self::short_channel_id
21772 * [`confirmations_required`]: Self::confirmations_required
21774 struct LDKCOption_u64Z ChannelDetails_get_outbound_scid_alias(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
21777 * An optional [`short_channel_id`] alias for this channel, randomly generated by us and
21778 * usable in place of [`short_channel_id`] to reference the channel in outbound routes when
21779 * the channel has not yet been confirmed (as long as [`confirmations_required`] is
21782 * This will be `None` as long as the channel is not available for routing outbound payments.
21784 * [`short_channel_id`]: Self::short_channel_id
21785 * [`confirmations_required`]: Self::confirmations_required
21787 void ChannelDetails_set_outbound_scid_alias(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
21790 * An optional [`short_channel_id`] alias for this channel, randomly generated by our
21791 * counterparty and usable in place of [`short_channel_id`] in invoice route hints. Our
21792 * counterparty will recognize the alias provided here in place of the [`short_channel_id`]
21793 * when they see a payment to be routed to us.
21795 * Our counterparty may choose to rotate this value at any time, though will always recognize
21796 * previous values for inbound payment forwarding.
21798 * [`short_channel_id`]: Self::short_channel_id
21800 struct LDKCOption_u64Z ChannelDetails_get_inbound_scid_alias(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
21803 * An optional [`short_channel_id`] alias for this channel, randomly generated by our
21804 * counterparty and usable in place of [`short_channel_id`] in invoice route hints. Our
21805 * counterparty will recognize the alias provided here in place of the [`short_channel_id`]
21806 * when they see a payment to be routed to us.
21808 * Our counterparty may choose to rotate this value at any time, though will always recognize
21809 * previous values for inbound payment forwarding.
21811 * [`short_channel_id`]: Self::short_channel_id
21813 void ChannelDetails_set_inbound_scid_alias(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
21816 * The value, in satoshis, of this channel as appears in the funding output
21818 uint64_t ChannelDetails_get_channel_value_satoshis(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
21821 * The value, in satoshis, of this channel as appears in the funding output
21823 void ChannelDetails_set_channel_value_satoshis(struct LDKChannelDetails *NONNULL_PTR this_ptr, uint64_t val);
21826 * The value, in satoshis, that must always be held in the channel for us. This value ensures
21827 * that if we broadcast a revoked state, our counterparty can punish us by claiming at least
21828 * this value on chain.
21830 * This value is not included in [`outbound_capacity_msat`] as it can never be spent.
21832 * This value will be `None` for outbound channels until the counterparty accepts the channel.
21834 * [`outbound_capacity_msat`]: ChannelDetails::outbound_capacity_msat
21836 struct LDKCOption_u64Z ChannelDetails_get_unspendable_punishment_reserve(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
21839 * The value, in satoshis, that must always be held in the channel for us. This value ensures
21840 * that if we broadcast a revoked state, our counterparty can punish us by claiming at least
21841 * this value on chain.
21843 * This value is not included in [`outbound_capacity_msat`] as it can never be spent.
21845 * This value will be `None` for outbound channels until the counterparty accepts the channel.
21847 * [`outbound_capacity_msat`]: ChannelDetails::outbound_capacity_msat
21849 void ChannelDetails_set_unspendable_punishment_reserve(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
21852 * The `user_channel_id` passed in to create_channel, or 0 if the channel was inbound.
21854 uint64_t ChannelDetails_get_user_channel_id(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
21857 * The `user_channel_id` passed in to create_channel, or 0 if the channel was inbound.
21859 void ChannelDetails_set_user_channel_id(struct LDKChannelDetails *NONNULL_PTR this_ptr, uint64_t val);
21862 * Our total balance. This is the amount we would get if we close the channel.
21863 * This value is not exact. Due to various in-flight changes and feerate changes, exactly this
21864 * amount is not likely to be recoverable on close.
21866 * This does not include any pending HTLCs which are not yet fully resolved (and, thus, whose
21867 * balance is not available for inclusion in new outbound HTLCs). This further does not include
21868 * any pending outgoing HTLCs which are awaiting some other resolution to be sent.
21869 * This does not consider any on-chain fees.
21871 * See also [`ChannelDetails::outbound_capacity_msat`]
21873 uint64_t ChannelDetails_get_balance_msat(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
21876 * Our total balance. This is the amount we would get if we close the channel.
21877 * This value is not exact. Due to various in-flight changes and feerate changes, exactly this
21878 * amount is not likely to be recoverable on close.
21880 * This does not include any pending HTLCs which are not yet fully resolved (and, thus, whose
21881 * balance is not available for inclusion in new outbound HTLCs). This further does not include
21882 * any pending outgoing HTLCs which are awaiting some other resolution to be sent.
21883 * This does not consider any on-chain fees.
21885 * See also [`ChannelDetails::outbound_capacity_msat`]
21887 void ChannelDetails_set_balance_msat(struct LDKChannelDetails *NONNULL_PTR this_ptr, uint64_t val);
21890 * The available outbound capacity for sending HTLCs to the remote peer. This does not include
21891 * any pending HTLCs which are not yet fully resolved (and, thus, whose balance is not
21892 * available for inclusion in new outbound HTLCs). This further does not include any pending
21893 * outgoing HTLCs which are awaiting some other resolution to be sent.
21895 * See also [`ChannelDetails::balance_msat`]
21897 * This value is not exact. Due to various in-flight changes, feerate changes, and our
21898 * conflict-avoidance policy, exactly this amount is not likely to be spendable. However, we
21899 * should be able to spend nearly this amount.
21901 uint64_t ChannelDetails_get_outbound_capacity_msat(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
21904 * The available outbound capacity for sending HTLCs to the remote peer. This does not include
21905 * any pending HTLCs which are not yet fully resolved (and, thus, whose balance is not
21906 * available for inclusion in new outbound HTLCs). This further does not include any pending
21907 * outgoing HTLCs which are awaiting some other resolution to be sent.
21909 * See also [`ChannelDetails::balance_msat`]
21911 * This value is not exact. Due to various in-flight changes, feerate changes, and our
21912 * conflict-avoidance policy, exactly this amount is not likely to be spendable. However, we
21913 * should be able to spend nearly this amount.
21915 void ChannelDetails_set_outbound_capacity_msat(struct LDKChannelDetails *NONNULL_PTR this_ptr, uint64_t val);
21918 * The available outbound capacity for sending a single HTLC to the remote peer. This is
21919 * similar to [`ChannelDetails::outbound_capacity_msat`] but it may be further restricted by
21920 * the current state and per-HTLC limit(s). This is intended for use when routing, allowing us
21921 * to use a limit as close as possible to the HTLC limit we can currently send.
21923 * See also [`ChannelDetails::balance_msat`] and [`ChannelDetails::outbound_capacity_msat`].
21925 uint64_t ChannelDetails_get_next_outbound_htlc_limit_msat(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
21928 * The available outbound capacity for sending a single HTLC to the remote peer. This is
21929 * similar to [`ChannelDetails::outbound_capacity_msat`] but it may be further restricted by
21930 * the current state and per-HTLC limit(s). This is intended for use when routing, allowing us
21931 * to use a limit as close as possible to the HTLC limit we can currently send.
21933 * See also [`ChannelDetails::balance_msat`] and [`ChannelDetails::outbound_capacity_msat`].
21935 void ChannelDetails_set_next_outbound_htlc_limit_msat(struct LDKChannelDetails *NONNULL_PTR this_ptr, uint64_t val);
21938 * The available inbound capacity for the remote peer to send HTLCs to us. This does not
21939 * include any pending HTLCs which are not yet fully resolved (and, thus, whose balance is not
21940 * available for inclusion in new inbound HTLCs).
21941 * Note that there are some corner cases not fully handled here, so the actual available
21942 * inbound capacity may be slightly higher than this.
21944 * This value is not exact. Due to various in-flight changes, feerate changes, and our
21945 * counterparty's conflict-avoidance policy, exactly this amount is not likely to be spendable.
21946 * However, our counterparty should be able to spend nearly this amount.
21948 uint64_t ChannelDetails_get_inbound_capacity_msat(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
21951 * The available inbound capacity for the remote peer to send HTLCs to us. This does not
21952 * include any pending HTLCs which are not yet fully resolved (and, thus, whose balance is not
21953 * available for inclusion in new inbound HTLCs).
21954 * Note that there are some corner cases not fully handled here, so the actual available
21955 * inbound capacity may be slightly higher than this.
21957 * This value is not exact. Due to various in-flight changes, feerate changes, and our
21958 * counterparty's conflict-avoidance policy, exactly this amount is not likely to be spendable.
21959 * However, our counterparty should be able to spend nearly this amount.
21961 void ChannelDetails_set_inbound_capacity_msat(struct LDKChannelDetails *NONNULL_PTR this_ptr, uint64_t val);
21964 * The number of required confirmations on the funding transaction before the funding will be
21965 * considered \"locked\". This number is selected by the channel fundee (i.e. us if
21966 * [`is_outbound`] is *not* set), and can be selected for inbound channels with
21967 * [`ChannelHandshakeConfig::minimum_depth`] or limited for outbound channels with
21968 * [`ChannelHandshakeLimits::max_minimum_depth`].
21970 * This value will be `None` for outbound channels until the counterparty accepts the channel.
21972 * [`is_outbound`]: ChannelDetails::is_outbound
21973 * [`ChannelHandshakeConfig::minimum_depth`]: crate::util::config::ChannelHandshakeConfig::minimum_depth
21974 * [`ChannelHandshakeLimits::max_minimum_depth`]: crate::util::config::ChannelHandshakeLimits::max_minimum_depth
21976 struct LDKCOption_u32Z ChannelDetails_get_confirmations_required(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
21979 * The number of required confirmations on the funding transaction before the funding will be
21980 * considered \"locked\". This number is selected by the channel fundee (i.e. us if
21981 * [`is_outbound`] is *not* set), and can be selected for inbound channels with
21982 * [`ChannelHandshakeConfig::minimum_depth`] or limited for outbound channels with
21983 * [`ChannelHandshakeLimits::max_minimum_depth`].
21985 * This value will be `None` for outbound channels until the counterparty accepts the channel.
21987 * [`is_outbound`]: ChannelDetails::is_outbound
21988 * [`ChannelHandshakeConfig::minimum_depth`]: crate::util::config::ChannelHandshakeConfig::minimum_depth
21989 * [`ChannelHandshakeLimits::max_minimum_depth`]: crate::util::config::ChannelHandshakeLimits::max_minimum_depth
21991 void ChannelDetails_set_confirmations_required(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u32Z val);
21994 * The number of blocks (after our commitment transaction confirms) that we will need to wait
21995 * until we can claim our funds after we force-close the channel. During this time our
21996 * counterparty is allowed to punish us if we broadcasted a stale state. If our counterparty
21997 * force-closes the channel and broadcasts a commitment transaction we do not have to wait any
21998 * time to claim our non-HTLC-encumbered funds.
22000 * This value will be `None` for outbound channels until the counterparty accepts the channel.
22002 struct LDKCOption_u16Z ChannelDetails_get_force_close_spend_delay(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
22005 * The number of blocks (after our commitment transaction confirms) that we will need to wait
22006 * until we can claim our funds after we force-close the channel. During this time our
22007 * counterparty is allowed to punish us if we broadcasted a stale state. If our counterparty
22008 * force-closes the channel and broadcasts a commitment transaction we do not have to wait any
22009 * time to claim our non-HTLC-encumbered funds.
22011 * This value will be `None` for outbound channels until the counterparty accepts the channel.
22013 void ChannelDetails_set_force_close_spend_delay(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u16Z val);
22016 * True if the channel was initiated (and thus funded) by us.
22018 bool ChannelDetails_get_is_outbound(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
22021 * True if the channel was initiated (and thus funded) by us.
22023 void ChannelDetails_set_is_outbound(struct LDKChannelDetails *NONNULL_PTR this_ptr, bool val);
22026 * True if the channel is confirmed, channel_ready messages have been exchanged, and the
22027 * channel is not currently being shut down. `channel_ready` message exchange implies the
22028 * required confirmation count has been reached (and we were connected to the peer at some
22029 * point after the funding transaction received enough confirmations). The required
22030 * confirmation count is provided in [`confirmations_required`].
22032 * [`confirmations_required`]: ChannelDetails::confirmations_required
22034 bool ChannelDetails_get_is_channel_ready(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
22037 * True if the channel is confirmed, channel_ready messages have been exchanged, and the
22038 * channel is not currently being shut down. `channel_ready` message exchange implies the
22039 * required confirmation count has been reached (and we were connected to the peer at some
22040 * point after the funding transaction received enough confirmations). The required
22041 * confirmation count is provided in [`confirmations_required`].
22043 * [`confirmations_required`]: ChannelDetails::confirmations_required
22045 void ChannelDetails_set_is_channel_ready(struct LDKChannelDetails *NONNULL_PTR this_ptr, bool val);
22048 * True if the channel is (a) confirmed and channel_ready messages have been exchanged, (b)
22049 * the peer is connected, and (c) the channel is not currently negotiating a shutdown.
22051 * This is a strict superset of `is_channel_ready`.
22053 bool ChannelDetails_get_is_usable(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
22056 * True if the channel is (a) confirmed and channel_ready messages have been exchanged, (b)
22057 * the peer is connected, and (c) the channel is not currently negotiating a shutdown.
22059 * This is a strict superset of `is_channel_ready`.
22061 void ChannelDetails_set_is_usable(struct LDKChannelDetails *NONNULL_PTR this_ptr, bool val);
22064 * True if this channel is (or will be) publicly-announced.
22066 bool ChannelDetails_get_is_public(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
22069 * True if this channel is (or will be) publicly-announced.
22071 void ChannelDetails_set_is_public(struct LDKChannelDetails *NONNULL_PTR this_ptr, bool val);
22074 * The smallest value HTLC (in msat) we will accept, for this channel. This field
22075 * is only `None` for `ChannelDetails` objects serialized prior to LDK 0.0.107
22077 struct LDKCOption_u64Z ChannelDetails_get_inbound_htlc_minimum_msat(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
22080 * The smallest value HTLC (in msat) we will accept, for this channel. This field
22081 * is only `None` for `ChannelDetails` objects serialized prior to LDK 0.0.107
22083 void ChannelDetails_set_inbound_htlc_minimum_msat(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
22086 * The largest value HTLC (in msat) we currently will accept, for this channel.
22088 struct LDKCOption_u64Z ChannelDetails_get_inbound_htlc_maximum_msat(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
22091 * The largest value HTLC (in msat) we currently will accept, for this channel.
22093 void ChannelDetails_set_inbound_htlc_maximum_msat(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
22096 * Set of configurable parameters that affect channel operation.
22098 * This field is only `None` for `ChannelDetails` objects serialized prior to LDK 0.0.109.
22100 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
22102 struct LDKChannelConfig ChannelDetails_get_config(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
22105 * Set of configurable parameters that affect channel operation.
22107 * This field is only `None` for `ChannelDetails` objects serialized prior to LDK 0.0.109.
22109 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
22111 void ChannelDetails_set_config(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKChannelConfig val);
22114 * Constructs a new ChannelDetails given each field
22116 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, uint64_t 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_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);
22119 * Creates a copy of the ChannelDetails
22121 struct LDKChannelDetails ChannelDetails_clone(const struct LDKChannelDetails *NONNULL_PTR orig);
22124 * Gets the current SCID which should be used to identify this channel for inbound payments.
22125 * This should be used for providing invoice hints or in any other context where our
22126 * counterparty will forward a payment to us.
22128 * This is either the [`ChannelDetails::inbound_scid_alias`], if set, or the
22129 * [`ChannelDetails::short_channel_id`]. See those for more information.
22131 MUST_USE_RES struct LDKCOption_u64Z ChannelDetails_get_inbound_payment_scid(const struct LDKChannelDetails *NONNULL_PTR this_arg);
22134 * Gets the current SCID which should be used to identify this channel for outbound payments.
22135 * This should be used in [`Route`]s to describe the first hop or in other contexts where
22136 * we're sending or forwarding a payment outbound over this channel.
22138 * This is either the [`ChannelDetails::short_channel_id`], if set, or the
22139 * [`ChannelDetails::outbound_scid_alias`]. See those for more information.
22141 MUST_USE_RES struct LDKCOption_u64Z ChannelDetails_get_outbound_payment_scid(const struct LDKChannelDetails *NONNULL_PTR this_arg);
22144 * Frees any resources used by the PaymentSendFailure
22146 void PaymentSendFailure_free(struct LDKPaymentSendFailure this_ptr);
22149 * Creates a copy of the PaymentSendFailure
22151 struct LDKPaymentSendFailure PaymentSendFailure_clone(const struct LDKPaymentSendFailure *NONNULL_PTR orig);
22154 * Utility method to constructs a new ParameterError-variant PaymentSendFailure
22156 struct LDKPaymentSendFailure PaymentSendFailure_parameter_error(struct LDKAPIError a);
22159 * Utility method to constructs a new PathParameterError-variant PaymentSendFailure
22161 struct LDKPaymentSendFailure PaymentSendFailure_path_parameter_error(struct LDKCVec_CResult_NoneAPIErrorZZ a);
22164 * Utility method to constructs a new AllFailedRetrySafe-variant PaymentSendFailure
22166 struct LDKPaymentSendFailure PaymentSendFailure_all_failed_retry_safe(struct LDKCVec_APIErrorZ a);
22169 * Utility method to constructs a new PartialFailure-variant PaymentSendFailure
22171 struct LDKPaymentSendFailure PaymentSendFailure_partial_failure(struct LDKCVec_CResult_NoneAPIErrorZZ results, struct LDKRouteParameters failed_paths_retry, struct LDKThirtyTwoBytes payment_id);
22174 * Frees any resources used by the PhantomRouteHints, if is_owned is set and inner is non-NULL.
22176 void PhantomRouteHints_free(struct LDKPhantomRouteHints this_obj);
22179 * The list of channels to be included in the invoice route hints.
22181 struct LDKCVec_ChannelDetailsZ PhantomRouteHints_get_channels(const struct LDKPhantomRouteHints *NONNULL_PTR this_ptr);
22184 * The list of channels to be included in the invoice route hints.
22186 void PhantomRouteHints_set_channels(struct LDKPhantomRouteHints *NONNULL_PTR this_ptr, struct LDKCVec_ChannelDetailsZ val);
22189 * A fake scid used for representing the phantom node's fake channel in generating the invoice
22192 uint64_t PhantomRouteHints_get_phantom_scid(const struct LDKPhantomRouteHints *NONNULL_PTR this_ptr);
22195 * A fake scid used for representing the phantom node's fake channel in generating the invoice
22198 void PhantomRouteHints_set_phantom_scid(struct LDKPhantomRouteHints *NONNULL_PTR this_ptr, uint64_t val);
22201 * The pubkey of the real backing node that would ultimately receive the payment.
22203 struct LDKPublicKey PhantomRouteHints_get_real_node_pubkey(const struct LDKPhantomRouteHints *NONNULL_PTR this_ptr);
22206 * The pubkey of the real backing node that would ultimately receive the payment.
22208 void PhantomRouteHints_set_real_node_pubkey(struct LDKPhantomRouteHints *NONNULL_PTR this_ptr, struct LDKPublicKey val);
22211 * Constructs a new PhantomRouteHints given each field
22213 MUST_USE_RES struct LDKPhantomRouteHints PhantomRouteHints_new(struct LDKCVec_ChannelDetailsZ channels_arg, uint64_t phantom_scid_arg, struct LDKPublicKey real_node_pubkey_arg);
22216 * Creates a copy of the PhantomRouteHints
22218 struct LDKPhantomRouteHints PhantomRouteHints_clone(const struct LDKPhantomRouteHints *NONNULL_PTR orig);
22221 * Constructs a new ChannelManager to hold several channels and route between them.
22223 * This is the main \"logic hub\" for all channel-related actions, and implements
22224 * ChannelMessageHandler.
22226 * Non-proportional fees are fixed according to our risk using the provided fee estimator.
22228 * Users need to notify the new ChannelManager when a new block is connected or
22229 * disconnected using its `block_connected` and `block_disconnected` methods, starting
22230 * from after `params.latest_hash`.
22232 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);
22235 * Gets the current configuration applied to all new channels.
22237 MUST_USE_RES struct LDKUserConfig ChannelManager_get_current_default_configuration(const struct LDKChannelManager *NONNULL_PTR this_arg);
22240 * Creates a new outbound channel to the given remote node and with the given value.
22242 * `user_channel_id` will be provided back as in
22243 * [`Event::FundingGenerationReady::user_channel_id`] to allow tracking of which events
22244 * correspond with which `create_channel` call. Note that the `user_channel_id` defaults to 0
22245 * for inbound channels, so you may wish to avoid using 0 for `user_channel_id` here.
22246 * `user_channel_id` has no meaning inside of LDK, it is simply copied to events and otherwise
22249 * Raises [`APIError::APIMisuseError`] when `channel_value_satoshis` > 2**24 or `push_msat` is
22250 * greater than `channel_value_satoshis * 1k` or `channel_value_satoshis < 1000`.
22252 * Note that we do not check if you are currently connected to the given peer. If no
22253 * connection is available, the outbound `open_channel` message may fail to send, resulting in
22254 * the channel eventually being silently forgotten (dropped on reload).
22256 * Returns the new Channel's temporary `channel_id`. This ID will appear as
22257 * [`Event::FundingGenerationReady::temporary_channel_id`] and in
22258 * [`ChannelDetails::channel_id`] until after
22259 * [`ChannelManager::funding_transaction_generated`] is called, swapping the Channel's ID for
22260 * one derived from the funding transaction's TXID. If the counterparty rejects the channel
22261 * immediately, this temporary ID will appear in [`Event::ChannelClosed::channel_id`].
22263 * [`Event::FundingGenerationReady::user_channel_id`]: events::Event::FundingGenerationReady::user_channel_id
22264 * [`Event::FundingGenerationReady::temporary_channel_id`]: events::Event::FundingGenerationReady::temporary_channel_id
22265 * [`Event::ChannelClosed::channel_id`]: events::Event::ChannelClosed::channel_id
22267 * Note that override_config (or a relevant inner pointer) may be NULL or all-0s to represent None
22269 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, uint64_t user_channel_id, struct LDKUserConfig override_config);
22272 * Gets the list of open channels, in random order. See ChannelDetail field documentation for
22273 * more information.
22275 MUST_USE_RES struct LDKCVec_ChannelDetailsZ ChannelManager_list_channels(const struct LDKChannelManager *NONNULL_PTR this_arg);
22278 * Gets the list of usable channels, in random order. Useful as an argument to [`find_route`]
22279 * to ensure non-announced channels are used.
22281 * These are guaranteed to have their [`ChannelDetails::is_usable`] value set to true, see the
22282 * documentation for [`ChannelDetails::is_usable`] for more info on exactly what the criteria
22285 * [`find_route`]: crate::routing::router::find_route
22287 MUST_USE_RES struct LDKCVec_ChannelDetailsZ ChannelManager_list_usable_channels(const struct LDKChannelManager *NONNULL_PTR this_arg);
22290 * Begins the process of closing a channel. After this call (plus some timeout), no new HTLCs
22291 * will be accepted on the given channel, and after additional timeout/the closing of all
22292 * pending HTLCs, the channel will be closed on chain.
22294 * * If we are the channel initiator, we will pay between our [`Background`] and
22295 * [`ChannelConfig::force_close_avoidance_max_fee_satoshis`] plus our [`Normal`] fee
22297 * * If our counterparty is the channel initiator, we will require a channel closing
22298 * transaction feerate of at least our [`Background`] feerate or the feerate which
22299 * would appear on a force-closure transaction, whichever is lower. We will allow our
22300 * counterparty to pay as much fee as they'd like, however.
22302 * May generate a SendShutdown message event on success, which should be relayed.
22304 * [`ChannelConfig::force_close_avoidance_max_fee_satoshis`]: crate::util::config::ChannelConfig::force_close_avoidance_max_fee_satoshis
22305 * [`Background`]: crate::chain::chaininterface::ConfirmationTarget::Background
22306 * [`Normal`]: crate::chain::chaininterface::ConfirmationTarget::Normal
22308 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);
22311 * Begins the process of closing a channel. After this call (plus some timeout), no new HTLCs
22312 * will be accepted on the given channel, and after additional timeout/the closing of all
22313 * pending HTLCs, the channel will be closed on chain.
22315 * `target_feerate_sat_per_1000_weight` has different meanings depending on if we initiated
22316 * the channel being closed or not:
22317 * * If we are the channel initiator, we will pay at least this feerate on the closing
22318 * transaction. The upper-bound is set by
22319 * [`ChannelConfig::force_close_avoidance_max_fee_satoshis`] plus our [`Normal`] fee
22320 * estimate (or `target_feerate_sat_per_1000_weight`, if it is greater).
22321 * * If our counterparty is the channel initiator, we will refuse to accept a channel closure
22322 * transaction feerate below `target_feerate_sat_per_1000_weight` (or the feerate which
22323 * will appear on a force-closure transaction, whichever is lower).
22325 * May generate a SendShutdown message event on success, which should be relayed.
22327 * [`ChannelConfig::force_close_avoidance_max_fee_satoshis`]: crate::util::config::ChannelConfig::force_close_avoidance_max_fee_satoshis
22328 * [`Background`]: crate::chain::chaininterface::ConfirmationTarget::Background
22329 * [`Normal`]: crate::chain::chaininterface::ConfirmationTarget::Normal
22331 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);
22334 * Force closes a channel, immediately broadcasting the latest local transaction(s) and
22335 * rejecting new HTLCs on the given channel. Fails if `channel_id` is unknown to
22336 * the manager, or if the `counterparty_node_id` isn't the counterparty of the corresponding
22339 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);
22342 * Force closes a channel, rejecting new HTLCs on the given channel but skips broadcasting
22343 * the latest local transaction(s). Fails if `channel_id` is unknown to the manager, or if the
22344 * `counterparty_node_id` isn't the counterparty of the corresponding channel.
22346 * You can always get the latest local transaction(s) to broadcast from
22347 * [`ChannelMonitor::get_latest_holder_commitment_txn`].
22349 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);
22352 * Force close all channels, immediately broadcasting the latest local commitment transaction
22353 * for each to the chain and rejecting new HTLCs on each.
22355 void ChannelManager_force_close_all_channels_broadcasting_latest_txn(const struct LDKChannelManager *NONNULL_PTR this_arg);
22358 * Force close all channels rejecting new HTLCs on each but without broadcasting the latest
22359 * local transaction(s).
22361 void ChannelManager_force_close_all_channels_without_broadcasting_txn(const struct LDKChannelManager *NONNULL_PTR this_arg);
22364 * Sends a payment along a given route.
22366 * Value parameters are provided via the last hop in route, see documentation for RouteHop
22367 * fields for more info.
22369 * Note that if the payment_hash already exists elsewhere (eg you're sending a duplicative
22370 * payment), we don't do anything to stop you! We always try to ensure that if the provided
22371 * next hop knows the preimage to payment_hash they can claim an additional amount as
22372 * specified in the last hop in the route! Thus, you should probably do your own
22373 * payment_preimage tracking (which you should already be doing as they represent \"proof of
22374 * payment\") and prevent double-sends yourself.
22376 * May generate SendHTLCs message(s) event on success, which should be relayed.
22378 * Each path may have a different return value, and PaymentSendValue may return a Vec with
22379 * each entry matching the corresponding-index entry in the route paths, see
22380 * PaymentSendFailure for more info.
22382 * In general, a path may raise:
22383 * * [`APIError::RouteError`] when an invalid route or forwarding parameter (cltv_delta, fee,
22384 * node public key) is specified.
22385 * * [`APIError::ChannelUnavailable`] if the next-hop channel is not available for updates
22386 * (including due to previous monitor update failure or new permanent monitor update
22388 * * [`APIError::MonitorUpdateInProgress`] if a new monitor update failure prevented sending the
22389 * relevant updates.
22391 * Note that depending on the type of the PaymentSendFailure the HTLC may have been
22392 * irrevocably committed to on our end. In such a case, do NOT retry the payment with a
22393 * different route unless you intend to pay twice!
22395 * payment_secret is unrelated to payment_hash (or PaymentPreimage) and exists to authenticate
22396 * the sender to the recipient and prevent payment-probing (deanonymization) attacks. For
22397 * newer nodes, it will be provided to you in the invoice. If you do not have one, the Route
22398 * must not contain multiple paths as multi-path payments require a recipient-provided
22400 * If a payment_secret *is* provided, we assume that the invoice had the payment_secret feature
22401 * bit set (either as required or as available). If multiple paths are present in the Route,
22402 * we assume the invoice had the basic_mpp feature set.
22404 * Note that payment_secret (or a relevant inner pointer) may be NULL or all-0s to represent None
22406 MUST_USE_RES struct LDKCResult_PaymentIdPaymentSendFailureZ ChannelManager_send_payment(const struct LDKChannelManager *NONNULL_PTR this_arg, const struct LDKRoute *NONNULL_PTR route, struct LDKThirtyTwoBytes payment_hash, struct LDKThirtyTwoBytes payment_secret);
22409 * Retries a payment along the given [`Route`].
22411 * Errors returned are a superset of those returned from [`send_payment`], so see
22412 * [`send_payment`] documentation for more details on errors. This method will also error if the
22413 * retry amount puts the payment more than 10% over the payment's total amount, if the payment
22414 * for the given `payment_id` cannot be found (likely due to timeout or success), or if
22415 * further retries have been disabled with [`abandon_payment`].
22417 * [`send_payment`]: [`ChannelManager::send_payment`]
22418 * [`abandon_payment`]: [`ChannelManager::abandon_payment`]
22420 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);
22423 * Signals that no further retries for the given payment will occur.
22425 * After this method returns, any future calls to [`retry_payment`] for the given `payment_id`
22426 * will fail with [`PaymentSendFailure::ParameterError`]. If no such event has been generated,
22427 * an [`Event::PaymentFailed`] event will be generated as soon as there are no remaining
22428 * pending HTLCs for this payment.
22430 * Note that calling this method does *not* prevent a payment from succeeding. You must still
22431 * wait until you receive either a [`Event::PaymentFailed`] or [`Event::PaymentSent`] event to
22432 * determine the ultimate status of a payment.
22434 * [`retry_payment`]: Self::retry_payment
22435 * [`Event::PaymentFailed`]: events::Event::PaymentFailed
22436 * [`Event::PaymentSent`]: events::Event::PaymentSent
22438 void ChannelManager_abandon_payment(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKThirtyTwoBytes payment_id);
22441 * Send a spontaneous payment, which is a payment that does not require the recipient to have
22442 * generated an invoice. Optionally, you may specify the preimage. If you do choose to specify
22443 * the preimage, it must be a cryptographically secure random value that no intermediate node
22444 * would be able to guess -- otherwise, an intermediate node may claim the payment and it will
22445 * never reach the recipient.
22447 * See [`send_payment`] documentation for more details on the return value of this function.
22449 * Similar to regular payments, you MUST NOT reuse a `payment_preimage` value. See
22450 * [`send_payment`] for more information about the risks of duplicate preimage usage.
22452 * Note that `route` must have exactly one path.
22454 * [`send_payment`]: Self::send_payment
22456 * Note that payment_preimage (or a relevant inner pointer) may be NULL or all-0s to represent None
22458 MUST_USE_RES struct LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ ChannelManager_send_spontaneous_payment(const struct LDKChannelManager *NONNULL_PTR this_arg, const struct LDKRoute *NONNULL_PTR route, struct LDKThirtyTwoBytes payment_preimage);
22461 * Send a payment that is probing the given route for liquidity. We calculate the
22462 * [`PaymentHash`] of probes based on a static secret and a random [`PaymentId`], which allows
22463 * us to easily discern them from real payments.
22465 MUST_USE_RES struct LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ ChannelManager_send_probe(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKCVec_RouteHopZ hops);
22468 * Call this upon creation of a funding transaction for the given channel.
22470 * Returns an [`APIError::APIMisuseError`] if the funding_transaction spent non-SegWit outputs
22471 * or if no output was found which matches the parameters in [`Event::FundingGenerationReady`].
22473 * Returns [`APIError::APIMisuseError`] if the funding transaction is not final for propagation
22474 * across the p2p network.
22476 * Returns [`APIError::ChannelUnavailable`] if a funding transaction has already been provided
22477 * for the channel or if the channel has been closed as indicated by [`Event::ChannelClosed`].
22479 * May panic if the output found in the funding transaction is duplicative with some other
22480 * channel (note that this should be trivially prevented by using unique funding transaction
22481 * keys per-channel).
22483 * Do NOT broadcast the funding transaction yourself. When we have safely received our
22484 * counterparty's signature the funding transaction will automatically be broadcast via the
22485 * [`BroadcasterInterface`] provided when this `ChannelManager` was constructed.
22487 * Note that this includes RBF or similar transaction replacement strategies - lightning does
22488 * not currently support replacing a funding transaction on an existing channel. Instead,
22489 * create a new channel with a conflicting funding transaction.
22491 * Note to keep the miner incentives aligned in moving the blockchain forward, we recommend
22492 * the wallet software generating the funding transaction to apply anti-fee sniping as
22493 * implemented by Bitcoin Core wallet. See <https://bitcoinops.org/en/topics/fee-sniping/>
22494 * for more details.
22496 * [`Event::FundingGenerationReady`]: crate::util::events::Event::FundingGenerationReady
22497 * [`Event::ChannelClosed`]: crate::util::events::Event::ChannelClosed
22499 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);
22502 * Atomically updates the [`ChannelConfig`] for the given channels.
22504 * Once the updates are applied, each eligible channel (advertised with a known short channel
22505 * ID and a change in [`forwarding_fee_proportional_millionths`], [`forwarding_fee_base_msat`],
22506 * or [`cltv_expiry_delta`]) has a [`BroadcastChannelUpdate`] event message generated
22507 * containing the new [`ChannelUpdate`] message which should be broadcast to the network.
22509 * Returns [`ChannelUnavailable`] when a channel is not found or an incorrect
22510 * `counterparty_node_id` is provided.
22512 * Returns [`APIMisuseError`] when a [`cltv_expiry_delta`] update is to be applied with a value
22513 * below [`MIN_CLTV_EXPIRY_DELTA`].
22515 * If an error is returned, none of the updates should be considered applied.
22517 * [`forwarding_fee_proportional_millionths`]: ChannelConfig::forwarding_fee_proportional_millionths
22518 * [`forwarding_fee_base_msat`]: ChannelConfig::forwarding_fee_base_msat
22519 * [`cltv_expiry_delta`]: ChannelConfig::cltv_expiry_delta
22520 * [`BroadcastChannelUpdate`]: events::MessageSendEvent::BroadcastChannelUpdate
22521 * [`ChannelUpdate`]: msgs::ChannelUpdate
22522 * [`ChannelUnavailable`]: APIError::ChannelUnavailable
22523 * [`APIMisuseError`]: APIError::APIMisuseError
22525 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);
22528 * Processes HTLCs which are pending waiting on random forward delay.
22530 * Should only really ever be called in response to a PendingHTLCsForwardable event.
22531 * Will likely generate further events.
22533 void ChannelManager_process_pending_htlc_forwards(const struct LDKChannelManager *NONNULL_PTR this_arg);
22536 * Performs actions which should happen on startup and roughly once per minute thereafter.
22538 * This currently includes:
22539 * * Increasing or decreasing the on-chain feerate estimates for our outbound channels,
22540 * * Broadcasting `ChannelUpdate` messages if we've been disconnected from our peer for more
22541 * than a minute, informing the network that they should no longer attempt to route over
22543 * * Expiring a channel's previous `ChannelConfig` if necessary to only allow forwarding HTLCs
22544 * with the current `ChannelConfig`.
22546 * Note that this may cause reentrancy through `chain::Watch::update_channel` calls or feerate
22547 * estimate fetches.
22549 void ChannelManager_timer_tick_occurred(const struct LDKChannelManager *NONNULL_PTR this_arg);
22552 * Indicates that the preimage for payment_hash is unknown or the received amount is incorrect
22553 * after a PaymentReceived event, failing the HTLC back to its origin and freeing resources
22554 * along the path (including in our own channel on which we received it).
22556 * Note that in some cases around unclean shutdown, it is possible the payment may have
22557 * already been claimed by you via [`ChannelManager::claim_funds`] prior to you seeing (a
22558 * second copy of) the [`events::Event::PaymentReceived`] event. Alternatively, the payment
22559 * may have already been failed automatically by LDK if it was nearing its expiration time.
22561 * While LDK will never claim a payment automatically on your behalf (i.e. without you calling
22562 * [`ChannelManager::claim_funds`]), you should still monitor for
22563 * [`events::Event::PaymentClaimed`] events even for payments you intend to fail, especially on
22564 * startup during which time claims that were in-progress at shutdown may be replayed.
22566 void ChannelManager_fail_htlc_backwards(const struct LDKChannelManager *NONNULL_PTR this_arg, const uint8_t (*payment_hash)[32]);
22569 * Provides a payment preimage in response to [`Event::PaymentReceived`], generating any
22570 * [`MessageSendEvent`]s needed to claim the payment.
22572 * Note that calling this method does *not* guarantee that the payment has been claimed. You
22573 * *must* wait for an [`Event::PaymentClaimed`] event which upon a successful claim will be
22574 * provided to your [`EventHandler`] when [`process_pending_events`] is next called.
22576 * Note that if you did not set an `amount_msat` when calling [`create_inbound_payment`] or
22577 * [`create_inbound_payment_for_hash`] you must check that the amount in the `PaymentReceived`
22578 * event matches your expectation. If you fail to do so and call this method, you may provide
22579 * the sender \"proof-of-payment\" when they did not fulfill the full expected payment.
22581 * [`Event::PaymentReceived`]: crate::util::events::Event::PaymentReceived
22582 * [`Event::PaymentClaimed`]: crate::util::events::Event::PaymentClaimed
22583 * [`process_pending_events`]: EventsProvider::process_pending_events
22584 * [`create_inbound_payment`]: Self::create_inbound_payment
22585 * [`create_inbound_payment_for_hash`]: Self::create_inbound_payment_for_hash
22586 * [`get_and_clear_pending_msg_events`]: MessageSendEventsProvider::get_and_clear_pending_msg_events
22588 void ChannelManager_claim_funds(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKThirtyTwoBytes payment_preimage);
22591 * Gets the node_id held by this ChannelManager
22593 MUST_USE_RES struct LDKPublicKey ChannelManager_get_our_node_id(const struct LDKChannelManager *NONNULL_PTR this_arg);
22596 * Accepts a request to open a channel after a [`Event::OpenChannelRequest`].
22598 * The `temporary_channel_id` parameter indicates which inbound channel should be accepted,
22599 * and the `counterparty_node_id` parameter is the id of the peer which has requested to open
22602 * The `user_channel_id` parameter will be provided back in
22603 * [`Event::ChannelClosed::user_channel_id`] to allow tracking of which events correspond
22604 * with which `accept_inbound_channel`/`accept_inbound_channel_from_trusted_peer_0conf` call.
22606 * Note that this method will return an error and reject the channel, if it requires support
22607 * for zero confirmations. Instead, `accept_inbound_channel_from_trusted_peer_0conf` must be
22608 * used to accept such channels.
22610 * [`Event::OpenChannelRequest`]: events::Event::OpenChannelRequest
22611 * [`Event::ChannelClosed::user_channel_id`]: events::Event::ChannelClosed::user_channel_id
22613 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, uint64_t user_channel_id);
22616 * Accepts a request to open a channel after a [`events::Event::OpenChannelRequest`], treating
22617 * it as confirmed immediately.
22619 * The `user_channel_id` parameter will be provided back in
22620 * [`Event::ChannelClosed::user_channel_id`] to allow tracking of which events correspond
22621 * with which `accept_inbound_channel`/`accept_inbound_channel_from_trusted_peer_0conf` call.
22623 * Unlike [`ChannelManager::accept_inbound_channel`], this method accepts the incoming channel
22624 * and (if the counterparty agrees), enables forwarding of payments immediately.
22626 * This fully trusts that the counterparty has honestly and correctly constructed the funding
22627 * transaction and blindly assumes that it will eventually confirm.
22629 * If it does not confirm before we decide to close the channel, or if the funding transaction
22630 * does not pay to the correct script the correct amount, *you will lose funds*.
22632 * [`Event::OpenChannelRequest`]: events::Event::OpenChannelRequest
22633 * [`Event::ChannelClosed::user_channel_id`]: events::Event::ChannelClosed::user_channel_id
22635 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, uint64_t user_channel_id);
22638 * Gets a payment secret and payment hash for use in an invoice given to a third party wishing
22641 * This differs from [`create_inbound_payment_for_hash`] only in that it generates the
22642 * [`PaymentHash`] and [`PaymentPreimage`] for you.
22644 * The [`PaymentPreimage`] will ultimately be returned to you in the [`PaymentReceived`], which
22645 * will have the [`PaymentReceived::payment_preimage`] field filled in. That should then be
22646 * passed directly to [`claim_funds`].
22648 * See [`create_inbound_payment_for_hash`] for detailed documentation on behavior and requirements.
22650 * Note that a malicious eavesdropper can intuit whether an inbound payment was created by
22651 * `create_inbound_payment` or `create_inbound_payment_for_hash` based on runtime.
22655 * If you register an inbound payment with this method, then serialize the `ChannelManager`, then
22656 * deserialize it with a node running 0.0.103 and earlier, the payment will fail to be received.
22658 * Errors if `min_value_msat` is greater than total bitcoin supply.
22660 * [`claim_funds`]: Self::claim_funds
22661 * [`PaymentReceived`]: events::Event::PaymentReceived
22662 * [`PaymentReceived::payment_preimage`]: events::Event::PaymentReceived::payment_preimage
22663 * [`create_inbound_payment_for_hash`]: Self::create_inbound_payment_for_hash
22665 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);
22668 * Legacy version of [`create_inbound_payment`]. Use this method if you wish to share
22669 * serialized state with LDK node(s) running 0.0.103 and earlier.
22671 * May panic if `invoice_expiry_delta_secs` is greater than one year.
22674 * This method is deprecated and will be removed soon.
22676 * [`create_inbound_payment`]: Self::create_inbound_payment
22678 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);
22681 * Gets a [`PaymentSecret`] for a given [`PaymentHash`], for which the payment preimage is
22682 * stored external to LDK.
22684 * A [`PaymentReceived`] event will only be generated if the [`PaymentSecret`] matches a
22685 * payment secret fetched via this method or [`create_inbound_payment`], and which is at least
22686 * the `min_value_msat` provided here, if one is provided.
22688 * The [`PaymentHash`] (and corresponding [`PaymentPreimage`]) should be globally unique, though
22689 * note that LDK will not stop you from registering duplicate payment hashes for inbound
22692 * `min_value_msat` should be set if the invoice being generated contains a value. Any payment
22693 * received for the returned [`PaymentHash`] will be required to be at least `min_value_msat`
22694 * before a [`PaymentReceived`] event will be generated, ensuring that we do not provide the
22695 * sender \"proof-of-payment\" unless they have paid the required amount.
22697 * `invoice_expiry_delta_secs` describes the number of seconds that the invoice is valid for
22698 * in excess of the current time. This should roughly match the expiry time set in the invoice.
22699 * After this many seconds, we will remove the inbound payment, resulting in any attempts to
22700 * pay the invoice failing. The BOLT spec suggests 3,600 secs as a default validity time for
22701 * invoices when no timeout is set.
22703 * Note that we use block header time to time-out pending inbound payments (with some margin
22704 * to compensate for the inaccuracy of block header timestamps). Thus, in practice we will
22705 * accept a payment and generate a [`PaymentReceived`] event for some time after the expiry.
22706 * If you need exact expiry semantics, you should enforce them upon receipt of
22707 * [`PaymentReceived`].
22709 * Note that invoices generated for inbound payments should have their `min_final_cltv_expiry`
22710 * set to at least [`MIN_FINAL_CLTV_EXPIRY`].
22712 * Note that a malicious eavesdropper can intuit whether an inbound payment was created by
22713 * `create_inbound_payment` or `create_inbound_payment_for_hash` based on runtime.
22717 * If you register an inbound payment with this method, then serialize the `ChannelManager`, then
22718 * deserialize it with a node running 0.0.103 and earlier, the payment will fail to be received.
22720 * Errors if `min_value_msat` is greater than total bitcoin supply.
22722 * [`create_inbound_payment`]: Self::create_inbound_payment
22723 * [`PaymentReceived`]: events::Event::PaymentReceived
22725 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);
22728 * Legacy version of [`create_inbound_payment_for_hash`]. Use this method if you wish to share
22729 * serialized state with LDK node(s) running 0.0.103 and earlier.
22731 * May panic if `invoice_expiry_delta_secs` is greater than one year.
22734 * This method is deprecated and will be removed soon.
22736 * [`create_inbound_payment_for_hash`]: Self::create_inbound_payment_for_hash
22738 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);
22741 * Gets an LDK-generated payment preimage from a payment hash and payment secret that were
22742 * previously returned from [`create_inbound_payment`].
22744 * [`create_inbound_payment`]: Self::create_inbound_payment
22746 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);
22749 * Gets a fake short channel id for use in receiving [phantom node payments]. These fake scids
22750 * are used when constructing the phantom invoice's route hints.
22752 * [phantom node payments]: crate::chain::keysinterface::PhantomKeysManager
22754 MUST_USE_RES uint64_t ChannelManager_get_phantom_scid(const struct LDKChannelManager *NONNULL_PTR this_arg);
22757 * Gets route hints for use in receiving [phantom node payments].
22759 * [phantom node payments]: crate::chain::keysinterface::PhantomKeysManager
22761 MUST_USE_RES struct LDKPhantomRouteHints ChannelManager_get_phantom_route_hints(const struct LDKChannelManager *NONNULL_PTR this_arg);
22764 * Constructs a new MessageSendEventsProvider which calls the relevant methods on this_arg.
22765 * This copies the `inner` pointer in this_arg and thus the returned MessageSendEventsProvider must be freed before this_arg is
22767 struct LDKMessageSendEventsProvider ChannelManager_as_MessageSendEventsProvider(const struct LDKChannelManager *NONNULL_PTR this_arg);
22770 * Constructs a new EventsProvider which calls the relevant methods on this_arg.
22771 * This copies the `inner` pointer in this_arg and thus the returned EventsProvider must be freed before this_arg is
22773 struct LDKEventsProvider ChannelManager_as_EventsProvider(const struct LDKChannelManager *NONNULL_PTR this_arg);
22776 * Constructs a new Listen which calls the relevant methods on this_arg.
22777 * This copies the `inner` pointer in this_arg and thus the returned Listen must be freed before this_arg is
22779 struct LDKListen ChannelManager_as_Listen(const struct LDKChannelManager *NONNULL_PTR this_arg);
22782 * Constructs a new Confirm which calls the relevant methods on this_arg.
22783 * This copies the `inner` pointer in this_arg and thus the returned Confirm must be freed before this_arg is
22785 struct LDKConfirm ChannelManager_as_Confirm(const struct LDKChannelManager *NONNULL_PTR this_arg);
22788 * Blocks until ChannelManager needs to be persisted or a timeout is reached. It returns a bool
22789 * indicating whether persistence is necessary. Only one listener on
22790 * `await_persistable_update` or `await_persistable_update_timeout` is guaranteed to be woken
22793 * Note that this method is not available with the `no-std` feature.
22795 MUST_USE_RES bool ChannelManager_await_persistable_update_timeout(const struct LDKChannelManager *NONNULL_PTR this_arg, uint64_t max_wait);
22798 * Blocks until ChannelManager needs to be persisted. Only one listener on
22799 * `await_persistable_update` or `await_persistable_update_timeout` is guaranteed to be woken
22802 void ChannelManager_await_persistable_update(const struct LDKChannelManager *NONNULL_PTR this_arg);
22805 * Gets a [`Future`] that completes when a persistable update is available. Note that
22806 * callbacks registered on the [`Future`] MUST NOT call back into this [`ChannelManager`] and
22807 * should instead register actions to be taken later.
22809 MUST_USE_RES struct LDKFuture ChannelManager_get_persistable_update_future(const struct LDKChannelManager *NONNULL_PTR this_arg);
22812 * Gets the latest best block which was connected either via the [`chain::Listen`] or
22813 * [`chain::Confirm`] interfaces.
22815 MUST_USE_RES struct LDKBestBlock ChannelManager_current_best_block(const struct LDKChannelManager *NONNULL_PTR this_arg);
22818 * Constructs a new ChannelMessageHandler which calls the relevant methods on this_arg.
22819 * This copies the `inner` pointer in this_arg and thus the returned ChannelMessageHandler must be freed before this_arg is
22821 struct LDKChannelMessageHandler ChannelManager_as_ChannelMessageHandler(const struct LDKChannelManager *NONNULL_PTR this_arg);
22824 * Fetches the set of [`NodeFeatures`] flags which are provided by or required by
22825 * [`ChannelManager`].
22827 struct LDKNodeFeatures provided_node_features(void);
22830 * Fetches the set of [`ChannelFeatures`] flags which are provided by or required by
22831 * [`ChannelManager`].
22833 struct LDKChannelFeatures provided_channel_features(void);
22836 * Fetches the set of [`InitFeatures`] flags which are provided by or required by
22837 * [`ChannelManager`].
22839 struct LDKInitFeatures provided_init_features(void);
22842 * Serialize the CounterpartyForwardingInfo object into a byte array which can be read by CounterpartyForwardingInfo_read
22844 struct LDKCVec_u8Z CounterpartyForwardingInfo_write(const struct LDKCounterpartyForwardingInfo *NONNULL_PTR obj);
22847 * Read a CounterpartyForwardingInfo from a byte array, created by CounterpartyForwardingInfo_write
22849 struct LDKCResult_CounterpartyForwardingInfoDecodeErrorZ CounterpartyForwardingInfo_read(struct LDKu8slice ser);
22852 * Serialize the ChannelCounterparty object into a byte array which can be read by ChannelCounterparty_read
22854 struct LDKCVec_u8Z ChannelCounterparty_write(const struct LDKChannelCounterparty *NONNULL_PTR obj);
22857 * Read a ChannelCounterparty from a byte array, created by ChannelCounterparty_write
22859 struct LDKCResult_ChannelCounterpartyDecodeErrorZ ChannelCounterparty_read(struct LDKu8slice ser);
22862 * Serialize the ChannelDetails object into a byte array which can be read by ChannelDetails_read
22864 struct LDKCVec_u8Z ChannelDetails_write(const struct LDKChannelDetails *NONNULL_PTR obj);
22867 * Read a ChannelDetails from a byte array, created by ChannelDetails_write
22869 struct LDKCResult_ChannelDetailsDecodeErrorZ ChannelDetails_read(struct LDKu8slice ser);
22872 * Serialize the PhantomRouteHints object into a byte array which can be read by PhantomRouteHints_read
22874 struct LDKCVec_u8Z PhantomRouteHints_write(const struct LDKPhantomRouteHints *NONNULL_PTR obj);
22877 * Read a PhantomRouteHints from a byte array, created by PhantomRouteHints_write
22879 struct LDKCResult_PhantomRouteHintsDecodeErrorZ PhantomRouteHints_read(struct LDKu8slice ser);
22882 * Serialize the ChannelManager object into a byte array which can be read by ChannelManager_read
22884 struct LDKCVec_u8Z ChannelManager_write(const struct LDKChannelManager *NONNULL_PTR obj);
22887 * Frees any resources used by the ChannelManagerReadArgs, if is_owned is set and inner is non-NULL.
22889 void ChannelManagerReadArgs_free(struct LDKChannelManagerReadArgs this_obj);
22892 * The keys provider which will give us relevant keys. Some keys will be loaded during
22893 * deserialization and KeysInterface::read_chan_signer will be used to read per-Channel
22896 const struct LDKKeysInterface *ChannelManagerReadArgs_get_keys_manager(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
22899 * The keys provider which will give us relevant keys. Some keys will be loaded during
22900 * deserialization and KeysInterface::read_chan_signer will be used to read per-Channel
22903 void ChannelManagerReadArgs_set_keys_manager(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKKeysInterface val);
22906 * The fee_estimator for use in the ChannelManager in the future.
22908 * No calls to the FeeEstimator will be made during deserialization.
22910 const struct LDKFeeEstimator *ChannelManagerReadArgs_get_fee_estimator(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
22913 * The fee_estimator for use in the ChannelManager in the future.
22915 * No calls to the FeeEstimator will be made during deserialization.
22917 void ChannelManagerReadArgs_set_fee_estimator(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKFeeEstimator val);
22920 * The chain::Watch for use in the ChannelManager in the future.
22922 * No calls to the chain::Watch will be made during deserialization. It is assumed that
22923 * you have deserialized ChannelMonitors separately and will add them to your
22924 * chain::Watch after deserializing this ChannelManager.
22926 const struct LDKWatch *ChannelManagerReadArgs_get_chain_monitor(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
22929 * The chain::Watch for use in the ChannelManager in the future.
22931 * No calls to the chain::Watch will be made during deserialization. It is assumed that
22932 * you have deserialized ChannelMonitors separately and will add them to your
22933 * chain::Watch after deserializing this ChannelManager.
22935 void ChannelManagerReadArgs_set_chain_monitor(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKWatch val);
22938 * The BroadcasterInterface which will be used in the ChannelManager in the future and may be
22939 * used to broadcast the latest local commitment transactions of channels which must be
22940 * force-closed during deserialization.
22942 const struct LDKBroadcasterInterface *ChannelManagerReadArgs_get_tx_broadcaster(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
22945 * The BroadcasterInterface which will be used in the ChannelManager in the future and may be
22946 * used to broadcast the latest local commitment transactions of channels which must be
22947 * force-closed during deserialization.
22949 void ChannelManagerReadArgs_set_tx_broadcaster(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKBroadcasterInterface val);
22952 * The Logger for use in the ChannelManager and which may be used to log information during
22955 const struct LDKLogger *ChannelManagerReadArgs_get_logger(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
22958 * The Logger for use in the ChannelManager and which may be used to log information during
22961 void ChannelManagerReadArgs_set_logger(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKLogger val);
22964 * Default settings used for new channels. Any existing channels will continue to use the
22965 * runtime settings which were stored when the ChannelManager was serialized.
22967 struct LDKUserConfig ChannelManagerReadArgs_get_default_config(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
22970 * Default settings used for new channels. Any existing channels will continue to use the
22971 * runtime settings which were stored when the ChannelManager was serialized.
22973 void ChannelManagerReadArgs_set_default_config(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKUserConfig val);
22976 * Simple utility function to create a ChannelManagerReadArgs which creates the monitor
22977 * HashMap for you. This is primarily useful for C bindings where it is not practical to
22978 * populate a HashMap directly from C.
22980 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);
22983 * Read a C2Tuple_BlockHashChannelManagerZ from a byte array, created by C2Tuple_BlockHashChannelManagerZ_write
22985 struct LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ C2Tuple_BlockHashChannelManagerZ_read(struct LDKu8slice ser, struct LDKChannelManagerReadArgs arg);
22988 * Frees any resources used by the ExpandedKey, if is_owned is set and inner is non-NULL.
22990 void ExpandedKey_free(struct LDKExpandedKey this_obj);
22993 * Create a new [`ExpandedKey`] for generating an inbound payment hash and secret.
22995 * It is recommended to cache this value and not regenerate it for each new inbound payment.
22997 MUST_USE_RES struct LDKExpandedKey ExpandedKey_new(const uint8_t (*key_material)[32]);
23000 * Equivalent to [`crate::ln::channelmanager::ChannelManager::create_inbound_payment`], but no
23001 * `ChannelManager` is required. Useful for generating invoices for [phantom node payments] without
23002 * a `ChannelManager`.
23004 * `keys` is generated by calling [`KeysInterface::get_inbound_payment_key_material`] and then
23005 * calling [`ExpandedKey::new`] with its result. It is recommended to cache this value and not
23006 * regenerate it for each new inbound payment.
23008 * `current_time` is a Unix timestamp representing the current time.
23010 * [phantom node payments]: crate::chain::keysinterface::PhantomKeysManager
23012 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);
23015 * Equivalent to [`crate::ln::channelmanager::ChannelManager::create_inbound_payment_for_hash`],
23016 * but no `ChannelManager` is required. Useful for generating invoices for [phantom node payments]
23017 * without a `ChannelManager`.
23019 * See [`create`] for information on the `keys` and `current_time` parameters.
23021 * [phantom node payments]: crate::chain::keysinterface::PhantomKeysManager
23023 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);
23026 * Frees any resources used by the DecodeError
23028 void DecodeError_free(struct LDKDecodeError this_ptr);
23031 * Creates a copy of the DecodeError
23033 struct LDKDecodeError DecodeError_clone(const struct LDKDecodeError *NONNULL_PTR orig);
23036 * Utility method to constructs a new UnknownVersion-variant DecodeError
23038 struct LDKDecodeError DecodeError_unknown_version(void);
23041 * Utility method to constructs a new UnknownRequiredFeature-variant DecodeError
23043 struct LDKDecodeError DecodeError_unknown_required_feature(void);
23046 * Utility method to constructs a new InvalidValue-variant DecodeError
23048 struct LDKDecodeError DecodeError_invalid_value(void);
23051 * Utility method to constructs a new ShortRead-variant DecodeError
23053 struct LDKDecodeError DecodeError_short_read(void);
23056 * Utility method to constructs a new BadLengthDescriptor-variant DecodeError
23058 struct LDKDecodeError DecodeError_bad_length_descriptor(void);
23061 * Utility method to constructs a new Io-variant DecodeError
23063 struct LDKDecodeError DecodeError_io(enum LDKIOError a);
23066 * Utility method to constructs a new UnsupportedCompression-variant DecodeError
23068 struct LDKDecodeError DecodeError_unsupported_compression(void);
23071 * Checks if two DecodeErrors contain equal inner contents.
23072 * This ignores pointers and is_owned flags and looks at the values in fields.
23074 bool DecodeError_eq(const struct LDKDecodeError *NONNULL_PTR a, const struct LDKDecodeError *NONNULL_PTR b);
23077 * Frees any resources used by the Init, if is_owned is set and inner is non-NULL.
23079 void Init_free(struct LDKInit this_obj);
23082 * The relevant features which the sender supports
23084 struct LDKInitFeatures Init_get_features(const struct LDKInit *NONNULL_PTR this_ptr);
23087 * The relevant features which the sender supports
23089 void Init_set_features(struct LDKInit *NONNULL_PTR this_ptr, struct LDKInitFeatures val);
23092 * The receipient's network address. This adds the option to report a remote IP address
23093 * back to a connecting peer using the init message. A node can decide to use that information
23094 * to discover a potential update to its public IPv4 address (NAT) and use
23095 * that for a node_announcement update message containing the new address.
23097 struct LDKCOption_NetAddressZ Init_get_remote_network_address(const struct LDKInit *NONNULL_PTR this_ptr);
23100 * The receipient's network address. This adds the option to report a remote IP address
23101 * back to a connecting peer using the init message. A node can decide to use that information
23102 * to discover a potential update to its public IPv4 address (NAT) and use
23103 * that for a node_announcement update message containing the new address.
23105 void Init_set_remote_network_address(struct LDKInit *NONNULL_PTR this_ptr, struct LDKCOption_NetAddressZ val);
23108 * Constructs a new Init given each field
23110 MUST_USE_RES struct LDKInit Init_new(struct LDKInitFeatures features_arg, struct LDKCOption_NetAddressZ remote_network_address_arg);
23113 * Creates a copy of the Init
23115 struct LDKInit Init_clone(const struct LDKInit *NONNULL_PTR orig);
23118 * Checks if two Inits contain equal inner contents.
23119 * This ignores pointers and is_owned flags and looks at the values in fields.
23120 * Two objects with NULL inner values will be considered "equal" here.
23122 bool Init_eq(const struct LDKInit *NONNULL_PTR a, const struct LDKInit *NONNULL_PTR b);
23125 * Frees any resources used by the ErrorMessage, if is_owned is set and inner is non-NULL.
23127 void ErrorMessage_free(struct LDKErrorMessage this_obj);
23130 * The channel ID involved in the error.
23132 * All-0s indicates a general error unrelated to a specific channel, after which all channels
23133 * with the sending peer should be closed.
23135 const uint8_t (*ErrorMessage_get_channel_id(const struct LDKErrorMessage *NONNULL_PTR this_ptr))[32];
23138 * The channel ID involved in the error.
23140 * All-0s indicates a general error unrelated to a specific channel, after which all channels
23141 * with the sending peer should be closed.
23143 void ErrorMessage_set_channel_id(struct LDKErrorMessage *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
23146 * A possibly human-readable error description.
23147 * The string should be sanitized before it is used (e.g. emitted to logs or printed to
23148 * stdout). Otherwise, a well crafted error message may trigger a security vulnerability in
23149 * the terminal emulator or the logging subsystem.
23151 struct LDKStr ErrorMessage_get_data(const struct LDKErrorMessage *NONNULL_PTR this_ptr);
23154 * A possibly human-readable error description.
23155 * The string should be sanitized before it is used (e.g. emitted to logs or printed to
23156 * stdout). Otherwise, a well crafted error message may trigger a security vulnerability in
23157 * the terminal emulator or the logging subsystem.
23159 void ErrorMessage_set_data(struct LDKErrorMessage *NONNULL_PTR this_ptr, struct LDKStr val);
23162 * Constructs a new ErrorMessage given each field
23164 MUST_USE_RES struct LDKErrorMessage ErrorMessage_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKStr data_arg);
23167 * Creates a copy of the ErrorMessage
23169 struct LDKErrorMessage ErrorMessage_clone(const struct LDKErrorMessage *NONNULL_PTR orig);
23172 * Checks if two ErrorMessages contain equal inner contents.
23173 * This ignores pointers and is_owned flags and looks at the values in fields.
23174 * Two objects with NULL inner values will be considered "equal" here.
23176 bool ErrorMessage_eq(const struct LDKErrorMessage *NONNULL_PTR a, const struct LDKErrorMessage *NONNULL_PTR b);
23179 * Frees any resources used by the WarningMessage, if is_owned is set and inner is non-NULL.
23181 void WarningMessage_free(struct LDKWarningMessage this_obj);
23184 * The channel ID involved in the warning.
23186 * All-0s indicates a warning unrelated to a specific channel.
23188 const uint8_t (*WarningMessage_get_channel_id(const struct LDKWarningMessage *NONNULL_PTR this_ptr))[32];
23191 * The channel ID involved in the warning.
23193 * All-0s indicates a warning unrelated to a specific channel.
23195 void WarningMessage_set_channel_id(struct LDKWarningMessage *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
23198 * A possibly human-readable warning description.
23199 * The string should be sanitized before it is used (e.g. emitted to logs or printed to
23200 * stdout). Otherwise, a well crafted error message may trigger a security vulnerability in
23201 * the terminal emulator or the logging subsystem.
23203 struct LDKStr WarningMessage_get_data(const struct LDKWarningMessage *NONNULL_PTR this_ptr);
23206 * A possibly human-readable warning description.
23207 * The string should be sanitized before it is used (e.g. emitted to logs or printed to
23208 * stdout). Otherwise, a well crafted error message may trigger a security vulnerability in
23209 * the terminal emulator or the logging subsystem.
23211 void WarningMessage_set_data(struct LDKWarningMessage *NONNULL_PTR this_ptr, struct LDKStr val);
23214 * Constructs a new WarningMessage given each field
23216 MUST_USE_RES struct LDKWarningMessage WarningMessage_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKStr data_arg);
23219 * Creates a copy of the WarningMessage
23221 struct LDKWarningMessage WarningMessage_clone(const struct LDKWarningMessage *NONNULL_PTR orig);
23224 * Checks if two WarningMessages contain equal inner contents.
23225 * This ignores pointers and is_owned flags and looks at the values in fields.
23226 * Two objects with NULL inner values will be considered "equal" here.
23228 bool WarningMessage_eq(const struct LDKWarningMessage *NONNULL_PTR a, const struct LDKWarningMessage *NONNULL_PTR b);
23231 * Frees any resources used by the Ping, if is_owned is set and inner is non-NULL.
23233 void Ping_free(struct LDKPing this_obj);
23236 * The desired response length
23238 uint16_t Ping_get_ponglen(const struct LDKPing *NONNULL_PTR this_ptr);
23241 * The desired response length
23243 void Ping_set_ponglen(struct LDKPing *NONNULL_PTR this_ptr, uint16_t val);
23246 * The ping packet size.
23247 * This field is not sent on the wire. byteslen zeros are sent.
23249 uint16_t Ping_get_byteslen(const struct LDKPing *NONNULL_PTR this_ptr);
23252 * The ping packet size.
23253 * This field is not sent on the wire. byteslen zeros are sent.
23255 void Ping_set_byteslen(struct LDKPing *NONNULL_PTR this_ptr, uint16_t val);
23258 * Constructs a new Ping given each field
23260 MUST_USE_RES struct LDKPing Ping_new(uint16_t ponglen_arg, uint16_t byteslen_arg);
23263 * Creates a copy of the Ping
23265 struct LDKPing Ping_clone(const struct LDKPing *NONNULL_PTR orig);
23268 * Checks if two Pings contain equal inner contents.
23269 * This ignores pointers and is_owned flags and looks at the values in fields.
23270 * Two objects with NULL inner values will be considered "equal" here.
23272 bool Ping_eq(const struct LDKPing *NONNULL_PTR a, const struct LDKPing *NONNULL_PTR b);
23275 * Frees any resources used by the Pong, if is_owned is set and inner is non-NULL.
23277 void Pong_free(struct LDKPong this_obj);
23280 * The pong packet size.
23281 * This field is not sent on the wire. byteslen zeros are sent.
23283 uint16_t Pong_get_byteslen(const struct LDKPong *NONNULL_PTR this_ptr);
23286 * The pong packet size.
23287 * This field is not sent on the wire. byteslen zeros are sent.
23289 void Pong_set_byteslen(struct LDKPong *NONNULL_PTR this_ptr, uint16_t val);
23292 * Constructs a new Pong given each field
23294 MUST_USE_RES struct LDKPong Pong_new(uint16_t byteslen_arg);
23297 * Creates a copy of the Pong
23299 struct LDKPong Pong_clone(const struct LDKPong *NONNULL_PTR orig);
23302 * Checks if two Pongs contain equal inner contents.
23303 * This ignores pointers and is_owned flags and looks at the values in fields.
23304 * Two objects with NULL inner values will be considered "equal" here.
23306 bool Pong_eq(const struct LDKPong *NONNULL_PTR a, const struct LDKPong *NONNULL_PTR b);
23309 * Frees any resources used by the OpenChannel, if is_owned is set and inner is non-NULL.
23311 void OpenChannel_free(struct LDKOpenChannel this_obj);
23314 * The genesis hash of the blockchain where the channel is to be opened
23316 const uint8_t (*OpenChannel_get_chain_hash(const struct LDKOpenChannel *NONNULL_PTR this_ptr))[32];
23319 * The genesis hash of the blockchain where the channel is to be opened
23321 void OpenChannel_set_chain_hash(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
23324 * A temporary channel ID, until the funding outpoint is announced
23326 const uint8_t (*OpenChannel_get_temporary_channel_id(const struct LDKOpenChannel *NONNULL_PTR this_ptr))[32];
23329 * A temporary channel ID, until the funding outpoint is announced
23331 void OpenChannel_set_temporary_channel_id(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
23334 * The channel value
23336 uint64_t OpenChannel_get_funding_satoshis(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
23339 * The channel value
23341 void OpenChannel_set_funding_satoshis(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint64_t val);
23344 * The amount to push to the counterparty as part of the open, in milli-satoshi
23346 uint64_t OpenChannel_get_push_msat(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
23349 * The amount to push to the counterparty as part of the open, in milli-satoshi
23351 void OpenChannel_set_push_msat(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint64_t val);
23354 * The threshold below which outputs on transactions broadcast by sender will be omitted
23356 uint64_t OpenChannel_get_dust_limit_satoshis(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
23359 * The threshold below which outputs on transactions broadcast by sender will be omitted
23361 void OpenChannel_set_dust_limit_satoshis(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint64_t val);
23364 * The maximum inbound HTLC value in flight towards sender, in milli-satoshi
23366 uint64_t OpenChannel_get_max_htlc_value_in_flight_msat(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
23369 * The maximum inbound HTLC value in flight towards sender, in milli-satoshi
23371 void OpenChannel_set_max_htlc_value_in_flight_msat(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint64_t val);
23374 * The minimum value unencumbered by HTLCs for the counterparty to keep in the channel
23376 uint64_t OpenChannel_get_channel_reserve_satoshis(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
23379 * The minimum value unencumbered by HTLCs for the counterparty to keep in the channel
23381 void OpenChannel_set_channel_reserve_satoshis(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint64_t val);
23384 * The minimum HTLC size incoming to sender, in milli-satoshi
23386 uint64_t OpenChannel_get_htlc_minimum_msat(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
23389 * The minimum HTLC size incoming to sender, in milli-satoshi
23391 void OpenChannel_set_htlc_minimum_msat(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint64_t val);
23394 * The feerate per 1000-weight of sender generated transactions, until updated by update_fee
23396 uint32_t OpenChannel_get_feerate_per_kw(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
23399 * The feerate per 1000-weight of sender generated transactions, until updated by update_fee
23401 void OpenChannel_set_feerate_per_kw(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint32_t val);
23404 * The number of blocks which the counterparty will have to wait to claim on-chain funds if they broadcast a commitment transaction
23406 uint16_t OpenChannel_get_to_self_delay(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
23409 * The number of blocks which the counterparty will have to wait to claim on-chain funds if they broadcast a commitment transaction
23411 void OpenChannel_set_to_self_delay(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint16_t val);
23414 * The maximum number of inbound HTLCs towards sender
23416 uint16_t OpenChannel_get_max_accepted_htlcs(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
23419 * The maximum number of inbound HTLCs towards sender
23421 void OpenChannel_set_max_accepted_htlcs(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint16_t val);
23424 * The sender's key controlling the funding transaction
23426 struct LDKPublicKey OpenChannel_get_funding_pubkey(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
23429 * The sender's key controlling the funding transaction
23431 void OpenChannel_set_funding_pubkey(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
23434 * Used to derive a revocation key for transactions broadcast by counterparty
23436 struct LDKPublicKey OpenChannel_get_revocation_basepoint(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
23439 * Used to derive a revocation key for transactions broadcast by counterparty
23441 void OpenChannel_set_revocation_basepoint(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
23444 * A payment key to sender for transactions broadcast by counterparty
23446 struct LDKPublicKey OpenChannel_get_payment_point(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
23449 * A payment key to sender for transactions broadcast by counterparty
23451 void OpenChannel_set_payment_point(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
23454 * Used to derive a payment key to sender for transactions broadcast by sender
23456 struct LDKPublicKey OpenChannel_get_delayed_payment_basepoint(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
23459 * Used to derive a payment key to sender for transactions broadcast by sender
23461 void OpenChannel_set_delayed_payment_basepoint(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
23464 * Used to derive an HTLC payment key to sender
23466 struct LDKPublicKey OpenChannel_get_htlc_basepoint(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
23469 * Used to derive an HTLC payment key to sender
23471 void OpenChannel_set_htlc_basepoint(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
23474 * The first to-be-broadcast-by-sender transaction's per commitment point
23476 struct LDKPublicKey OpenChannel_get_first_per_commitment_point(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
23479 * The first to-be-broadcast-by-sender transaction's per commitment point
23481 void OpenChannel_set_first_per_commitment_point(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
23486 uint8_t OpenChannel_get_channel_flags(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
23491 void OpenChannel_set_channel_flags(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint8_t val);
23494 * The channel type that this channel will represent. If none is set, we derive the channel
23495 * type from the intersection of our feature bits with our counterparty's feature bits from
23496 * the Init message.
23498 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
23500 struct LDKChannelTypeFeatures OpenChannel_get_channel_type(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
23503 * The channel type that this channel will represent. If none is set, we derive the channel
23504 * type from the intersection of our feature bits with our counterparty's feature bits from
23505 * the Init message.
23507 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
23509 void OpenChannel_set_channel_type(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKChannelTypeFeatures val);
23512 * Creates a copy of the OpenChannel
23514 struct LDKOpenChannel OpenChannel_clone(const struct LDKOpenChannel *NONNULL_PTR orig);
23517 * Checks if two OpenChannels contain equal inner contents.
23518 * This ignores pointers and is_owned flags and looks at the values in fields.
23519 * Two objects with NULL inner values will be considered "equal" here.
23521 bool OpenChannel_eq(const struct LDKOpenChannel *NONNULL_PTR a, const struct LDKOpenChannel *NONNULL_PTR b);
23524 * Frees any resources used by the AcceptChannel, if is_owned is set and inner is non-NULL.
23526 void AcceptChannel_free(struct LDKAcceptChannel this_obj);
23529 * A temporary channel ID, until the funding outpoint is announced
23531 const uint8_t (*AcceptChannel_get_temporary_channel_id(const struct LDKAcceptChannel *NONNULL_PTR this_ptr))[32];
23534 * A temporary channel ID, until the funding outpoint is announced
23536 void AcceptChannel_set_temporary_channel_id(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
23539 * The threshold below which outputs on transactions broadcast by sender will be omitted
23541 uint64_t AcceptChannel_get_dust_limit_satoshis(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
23544 * The threshold below which outputs on transactions broadcast by sender will be omitted
23546 void AcceptChannel_set_dust_limit_satoshis(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint64_t val);
23549 * The maximum inbound HTLC value in flight towards sender, in milli-satoshi
23551 uint64_t AcceptChannel_get_max_htlc_value_in_flight_msat(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
23554 * The maximum inbound HTLC value in flight towards sender, in milli-satoshi
23556 void AcceptChannel_set_max_htlc_value_in_flight_msat(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint64_t val);
23559 * The minimum value unencumbered by HTLCs for the counterparty to keep in the channel
23561 uint64_t AcceptChannel_get_channel_reserve_satoshis(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
23564 * The minimum value unencumbered by HTLCs for the counterparty to keep in the channel
23566 void AcceptChannel_set_channel_reserve_satoshis(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint64_t val);
23569 * The minimum HTLC size incoming to sender, in milli-satoshi
23571 uint64_t AcceptChannel_get_htlc_minimum_msat(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
23574 * The minimum HTLC size incoming to sender, in milli-satoshi
23576 void AcceptChannel_set_htlc_minimum_msat(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint64_t val);
23579 * Minimum depth of the funding transaction before the channel is considered open
23581 uint32_t AcceptChannel_get_minimum_depth(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
23584 * Minimum depth of the funding transaction before the channel is considered open
23586 void AcceptChannel_set_minimum_depth(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint32_t val);
23589 * The number of blocks which the counterparty will have to wait to claim on-chain funds if they broadcast a commitment transaction
23591 uint16_t AcceptChannel_get_to_self_delay(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
23594 * The number of blocks which the counterparty will have to wait to claim on-chain funds if they broadcast a commitment transaction
23596 void AcceptChannel_set_to_self_delay(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint16_t val);
23599 * The maximum number of inbound HTLCs towards sender
23601 uint16_t AcceptChannel_get_max_accepted_htlcs(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
23604 * The maximum number of inbound HTLCs towards sender
23606 void AcceptChannel_set_max_accepted_htlcs(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint16_t val);
23609 * The sender's key controlling the funding transaction
23611 struct LDKPublicKey AcceptChannel_get_funding_pubkey(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
23614 * The sender's key controlling the funding transaction
23616 void AcceptChannel_set_funding_pubkey(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
23619 * Used to derive a revocation key for transactions broadcast by counterparty
23621 struct LDKPublicKey AcceptChannel_get_revocation_basepoint(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
23624 * Used to derive a revocation key for transactions broadcast by counterparty
23626 void AcceptChannel_set_revocation_basepoint(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
23629 * A payment key to sender for transactions broadcast by counterparty
23631 struct LDKPublicKey AcceptChannel_get_payment_point(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
23634 * A payment key to sender for transactions broadcast by counterparty
23636 void AcceptChannel_set_payment_point(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
23639 * Used to derive a payment key to sender for transactions broadcast by sender
23641 struct LDKPublicKey AcceptChannel_get_delayed_payment_basepoint(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
23644 * Used to derive a payment key to sender for transactions broadcast by sender
23646 void AcceptChannel_set_delayed_payment_basepoint(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
23649 * Used to derive an HTLC payment key to sender for transactions broadcast by counterparty
23651 struct LDKPublicKey AcceptChannel_get_htlc_basepoint(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
23654 * Used to derive an HTLC payment key to sender for transactions broadcast by counterparty
23656 void AcceptChannel_set_htlc_basepoint(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
23659 * The first to-be-broadcast-by-sender transaction's per commitment point
23661 struct LDKPublicKey AcceptChannel_get_first_per_commitment_point(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
23664 * The first to-be-broadcast-by-sender transaction's per commitment point
23666 void AcceptChannel_set_first_per_commitment_point(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
23669 * The channel type that this channel will represent. If none is set, we derive the channel
23670 * type from the intersection of our feature bits with our counterparty's feature bits from
23671 * the Init message.
23673 * This is required to match the equivalent field in [`OpenChannel::channel_type`].
23675 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
23677 struct LDKChannelTypeFeatures AcceptChannel_get_channel_type(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
23680 * The channel type that this channel will represent. If none is set, we derive the channel
23681 * type from the intersection of our feature bits with our counterparty's feature bits from
23682 * the Init message.
23684 * This is required to match the equivalent field in [`OpenChannel::channel_type`].
23686 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
23688 void AcceptChannel_set_channel_type(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKChannelTypeFeatures val);
23691 * Creates a copy of the AcceptChannel
23693 struct LDKAcceptChannel AcceptChannel_clone(const struct LDKAcceptChannel *NONNULL_PTR orig);
23696 * Checks if two AcceptChannels contain equal inner contents.
23697 * This ignores pointers and is_owned flags and looks at the values in fields.
23698 * Two objects with NULL inner values will be considered "equal" here.
23700 bool AcceptChannel_eq(const struct LDKAcceptChannel *NONNULL_PTR a, const struct LDKAcceptChannel *NONNULL_PTR b);
23703 * Frees any resources used by the FundingCreated, if is_owned is set and inner is non-NULL.
23705 void FundingCreated_free(struct LDKFundingCreated this_obj);
23708 * A temporary channel ID, until the funding is established
23710 const uint8_t (*FundingCreated_get_temporary_channel_id(const struct LDKFundingCreated *NONNULL_PTR this_ptr))[32];
23713 * A temporary channel ID, until the funding is established
23715 void FundingCreated_set_temporary_channel_id(struct LDKFundingCreated *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
23718 * The funding transaction ID
23720 const uint8_t (*FundingCreated_get_funding_txid(const struct LDKFundingCreated *NONNULL_PTR this_ptr))[32];
23723 * The funding transaction ID
23725 void FundingCreated_set_funding_txid(struct LDKFundingCreated *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
23728 * The specific output index funding this channel
23730 uint16_t FundingCreated_get_funding_output_index(const struct LDKFundingCreated *NONNULL_PTR this_ptr);
23733 * The specific output index funding this channel
23735 void FundingCreated_set_funding_output_index(struct LDKFundingCreated *NONNULL_PTR this_ptr, uint16_t val);
23738 * The signature of the channel initiator (funder) on the initial commitment transaction
23740 struct LDKSignature FundingCreated_get_signature(const struct LDKFundingCreated *NONNULL_PTR this_ptr);
23743 * The signature of the channel initiator (funder) on the initial commitment transaction
23745 void FundingCreated_set_signature(struct LDKFundingCreated *NONNULL_PTR this_ptr, struct LDKSignature val);
23748 * Constructs a new FundingCreated given each field
23750 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);
23753 * Creates a copy of the FundingCreated
23755 struct LDKFundingCreated FundingCreated_clone(const struct LDKFundingCreated *NONNULL_PTR orig);
23758 * Checks if two FundingCreateds contain equal inner contents.
23759 * This ignores pointers and is_owned flags and looks at the values in fields.
23760 * Two objects with NULL inner values will be considered "equal" here.
23762 bool FundingCreated_eq(const struct LDKFundingCreated *NONNULL_PTR a, const struct LDKFundingCreated *NONNULL_PTR b);
23765 * Frees any resources used by the FundingSigned, if is_owned is set and inner is non-NULL.
23767 void FundingSigned_free(struct LDKFundingSigned this_obj);
23772 const uint8_t (*FundingSigned_get_channel_id(const struct LDKFundingSigned *NONNULL_PTR this_ptr))[32];
23777 void FundingSigned_set_channel_id(struct LDKFundingSigned *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
23780 * The signature of the channel acceptor (fundee) on the initial commitment transaction
23782 struct LDKSignature FundingSigned_get_signature(const struct LDKFundingSigned *NONNULL_PTR this_ptr);
23785 * The signature of the channel acceptor (fundee) on the initial commitment transaction
23787 void FundingSigned_set_signature(struct LDKFundingSigned *NONNULL_PTR this_ptr, struct LDKSignature val);
23790 * Constructs a new FundingSigned given each field
23792 MUST_USE_RES struct LDKFundingSigned FundingSigned_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKSignature signature_arg);
23795 * Creates a copy of the FundingSigned
23797 struct LDKFundingSigned FundingSigned_clone(const struct LDKFundingSigned *NONNULL_PTR orig);
23800 * Checks if two FundingSigneds contain equal inner contents.
23801 * This ignores pointers and is_owned flags and looks at the values in fields.
23802 * Two objects with NULL inner values will be considered "equal" here.
23804 bool FundingSigned_eq(const struct LDKFundingSigned *NONNULL_PTR a, const struct LDKFundingSigned *NONNULL_PTR b);
23807 * Frees any resources used by the ChannelReady, if is_owned is set and inner is non-NULL.
23809 void ChannelReady_free(struct LDKChannelReady this_obj);
23814 const uint8_t (*ChannelReady_get_channel_id(const struct LDKChannelReady *NONNULL_PTR this_ptr))[32];
23819 void ChannelReady_set_channel_id(struct LDKChannelReady *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
23822 * The per-commitment point of the second commitment transaction
23824 struct LDKPublicKey ChannelReady_get_next_per_commitment_point(const struct LDKChannelReady *NONNULL_PTR this_ptr);
23827 * The per-commitment point of the second commitment transaction
23829 void ChannelReady_set_next_per_commitment_point(struct LDKChannelReady *NONNULL_PTR this_ptr, struct LDKPublicKey val);
23832 * If set, provides a short_channel_id alias for this channel. The sender will accept payments
23833 * to be forwarded over this SCID and forward them to this messages' recipient.
23835 struct LDKCOption_u64Z ChannelReady_get_short_channel_id_alias(const struct LDKChannelReady *NONNULL_PTR this_ptr);
23838 * If set, provides a short_channel_id alias for this channel. The sender will accept payments
23839 * to be forwarded over this SCID and forward them to this messages' recipient.
23841 void ChannelReady_set_short_channel_id_alias(struct LDKChannelReady *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
23844 * Constructs a new ChannelReady given each field
23846 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);
23849 * Creates a copy of the ChannelReady
23851 struct LDKChannelReady ChannelReady_clone(const struct LDKChannelReady *NONNULL_PTR orig);
23854 * Checks if two ChannelReadys contain equal inner contents.
23855 * This ignores pointers and is_owned flags and looks at the values in fields.
23856 * Two objects with NULL inner values will be considered "equal" here.
23858 bool ChannelReady_eq(const struct LDKChannelReady *NONNULL_PTR a, const struct LDKChannelReady *NONNULL_PTR b);
23861 * Frees any resources used by the Shutdown, if is_owned is set and inner is non-NULL.
23863 void Shutdown_free(struct LDKShutdown this_obj);
23868 const uint8_t (*Shutdown_get_channel_id(const struct LDKShutdown *NONNULL_PTR this_ptr))[32];
23873 void Shutdown_set_channel_id(struct LDKShutdown *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
23876 * The destination of this peer's funds on closing.
23877 * Must be in one of these forms: p2pkh, p2sh, p2wpkh, p2wsh.
23879 struct LDKu8slice Shutdown_get_scriptpubkey(const struct LDKShutdown *NONNULL_PTR this_ptr);
23882 * The destination of this peer's funds on closing.
23883 * Must be in one of these forms: p2pkh, p2sh, p2wpkh, p2wsh.
23885 void Shutdown_set_scriptpubkey(struct LDKShutdown *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val);
23888 * Constructs a new Shutdown given each field
23890 MUST_USE_RES struct LDKShutdown Shutdown_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKCVec_u8Z scriptpubkey_arg);
23893 * Creates a copy of the Shutdown
23895 struct LDKShutdown Shutdown_clone(const struct LDKShutdown *NONNULL_PTR orig);
23898 * Checks if two Shutdowns contain equal inner contents.
23899 * This ignores pointers and is_owned flags and looks at the values in fields.
23900 * Two objects with NULL inner values will be considered "equal" here.
23902 bool Shutdown_eq(const struct LDKShutdown *NONNULL_PTR a, const struct LDKShutdown *NONNULL_PTR b);
23905 * Frees any resources used by the ClosingSignedFeeRange, if is_owned is set and inner is non-NULL.
23907 void ClosingSignedFeeRange_free(struct LDKClosingSignedFeeRange this_obj);
23910 * The minimum absolute fee, in satoshis, which the sender is willing to place on the closing
23913 uint64_t ClosingSignedFeeRange_get_min_fee_satoshis(const struct LDKClosingSignedFeeRange *NONNULL_PTR this_ptr);
23916 * The minimum absolute fee, in satoshis, which the sender is willing to place on the closing
23919 void ClosingSignedFeeRange_set_min_fee_satoshis(struct LDKClosingSignedFeeRange *NONNULL_PTR this_ptr, uint64_t val);
23922 * The maximum absolute fee, in satoshis, which the sender is willing to place on the closing
23925 uint64_t ClosingSignedFeeRange_get_max_fee_satoshis(const struct LDKClosingSignedFeeRange *NONNULL_PTR this_ptr);
23928 * The maximum absolute fee, in satoshis, which the sender is willing to place on the closing
23931 void ClosingSignedFeeRange_set_max_fee_satoshis(struct LDKClosingSignedFeeRange *NONNULL_PTR this_ptr, uint64_t val);
23934 * Constructs a new ClosingSignedFeeRange given each field
23936 MUST_USE_RES struct LDKClosingSignedFeeRange ClosingSignedFeeRange_new(uint64_t min_fee_satoshis_arg, uint64_t max_fee_satoshis_arg);
23939 * Creates a copy of the ClosingSignedFeeRange
23941 struct LDKClosingSignedFeeRange ClosingSignedFeeRange_clone(const struct LDKClosingSignedFeeRange *NONNULL_PTR orig);
23944 * Checks if two ClosingSignedFeeRanges contain equal inner contents.
23945 * This ignores pointers and is_owned flags and looks at the values in fields.
23946 * Two objects with NULL inner values will be considered "equal" here.
23948 bool ClosingSignedFeeRange_eq(const struct LDKClosingSignedFeeRange *NONNULL_PTR a, const struct LDKClosingSignedFeeRange *NONNULL_PTR b);
23951 * Frees any resources used by the ClosingSigned, if is_owned is set and inner is non-NULL.
23953 void ClosingSigned_free(struct LDKClosingSigned this_obj);
23958 const uint8_t (*ClosingSigned_get_channel_id(const struct LDKClosingSigned *NONNULL_PTR this_ptr))[32];
23963 void ClosingSigned_set_channel_id(struct LDKClosingSigned *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
23966 * The proposed total fee for the closing transaction
23968 uint64_t ClosingSigned_get_fee_satoshis(const struct LDKClosingSigned *NONNULL_PTR this_ptr);
23971 * The proposed total fee for the closing transaction
23973 void ClosingSigned_set_fee_satoshis(struct LDKClosingSigned *NONNULL_PTR this_ptr, uint64_t val);
23976 * A signature on the closing transaction
23978 struct LDKSignature ClosingSigned_get_signature(const struct LDKClosingSigned *NONNULL_PTR this_ptr);
23981 * A signature on the closing transaction
23983 void ClosingSigned_set_signature(struct LDKClosingSigned *NONNULL_PTR this_ptr, struct LDKSignature val);
23986 * The minimum and maximum fees which the sender is willing to accept, provided only by new
23989 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
23991 struct LDKClosingSignedFeeRange ClosingSigned_get_fee_range(const struct LDKClosingSigned *NONNULL_PTR this_ptr);
23994 * The minimum and maximum fees which the sender is willing to accept, provided only by new
23997 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
23999 void ClosingSigned_set_fee_range(struct LDKClosingSigned *NONNULL_PTR this_ptr, struct LDKClosingSignedFeeRange val);
24002 * Constructs a new ClosingSigned given each field
24004 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);
24007 * Creates a copy of the ClosingSigned
24009 struct LDKClosingSigned ClosingSigned_clone(const struct LDKClosingSigned *NONNULL_PTR orig);
24012 * Checks if two ClosingSigneds contain equal inner contents.
24013 * This ignores pointers and is_owned flags and looks at the values in fields.
24014 * Two objects with NULL inner values will be considered "equal" here.
24016 bool ClosingSigned_eq(const struct LDKClosingSigned *NONNULL_PTR a, const struct LDKClosingSigned *NONNULL_PTR b);
24019 * Frees any resources used by the UpdateAddHTLC, if is_owned is set and inner is non-NULL.
24021 void UpdateAddHTLC_free(struct LDKUpdateAddHTLC this_obj);
24026 const uint8_t (*UpdateAddHTLC_get_channel_id(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr))[32];
24031 void UpdateAddHTLC_set_channel_id(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
24036 uint64_t UpdateAddHTLC_get_htlc_id(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr);
24041 void UpdateAddHTLC_set_htlc_id(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, uint64_t val);
24044 * The HTLC value in milli-satoshi
24046 uint64_t UpdateAddHTLC_get_amount_msat(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr);
24049 * The HTLC value in milli-satoshi
24051 void UpdateAddHTLC_set_amount_msat(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, uint64_t val);
24054 * The payment hash, the pre-image of which controls HTLC redemption
24056 const uint8_t (*UpdateAddHTLC_get_payment_hash(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr))[32];
24059 * The payment hash, the pre-image of which controls HTLC redemption
24061 void UpdateAddHTLC_set_payment_hash(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
24064 * The expiry height of the HTLC
24066 uint32_t UpdateAddHTLC_get_cltv_expiry(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr);
24069 * The expiry height of the HTLC
24071 void UpdateAddHTLC_set_cltv_expiry(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, uint32_t val);
24074 * Creates a copy of the UpdateAddHTLC
24076 struct LDKUpdateAddHTLC UpdateAddHTLC_clone(const struct LDKUpdateAddHTLC *NONNULL_PTR orig);
24079 * Checks if two UpdateAddHTLCs contain equal inner contents.
24080 * This ignores pointers and is_owned flags and looks at the values in fields.
24081 * Two objects with NULL inner values will be considered "equal" here.
24083 bool UpdateAddHTLC_eq(const struct LDKUpdateAddHTLC *NONNULL_PTR a, const struct LDKUpdateAddHTLC *NONNULL_PTR b);
24086 * Frees any resources used by the OnionMessage, if is_owned is set and inner is non-NULL.
24088 void OnionMessage_free(struct LDKOnionMessage this_obj);
24091 * Used in decrypting the onion packet's payload.
24093 struct LDKPublicKey OnionMessage_get_blinding_point(const struct LDKOnionMessage *NONNULL_PTR this_ptr);
24096 * Used in decrypting the onion packet's payload.
24098 void OnionMessage_set_blinding_point(struct LDKOnionMessage *NONNULL_PTR this_ptr, struct LDKPublicKey val);
24101 * Creates a copy of the OnionMessage
24103 struct LDKOnionMessage OnionMessage_clone(const struct LDKOnionMessage *NONNULL_PTR orig);
24106 * Checks if two OnionMessages contain equal inner contents.
24107 * This ignores pointers and is_owned flags and looks at the values in fields.
24108 * Two objects with NULL inner values will be considered "equal" here.
24110 bool OnionMessage_eq(const struct LDKOnionMessage *NONNULL_PTR a, const struct LDKOnionMessage *NONNULL_PTR b);
24113 * Frees any resources used by the UpdateFulfillHTLC, if is_owned is set and inner is non-NULL.
24115 void UpdateFulfillHTLC_free(struct LDKUpdateFulfillHTLC this_obj);
24120 const uint8_t (*UpdateFulfillHTLC_get_channel_id(const struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr))[32];
24125 void UpdateFulfillHTLC_set_channel_id(struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
24130 uint64_t UpdateFulfillHTLC_get_htlc_id(const struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr);
24135 void UpdateFulfillHTLC_set_htlc_id(struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr, uint64_t val);
24138 * The pre-image of the payment hash, allowing HTLC redemption
24140 const uint8_t (*UpdateFulfillHTLC_get_payment_preimage(const struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr))[32];
24143 * The pre-image of the payment hash, allowing HTLC redemption
24145 void UpdateFulfillHTLC_set_payment_preimage(struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
24148 * Constructs a new UpdateFulfillHTLC given each field
24150 MUST_USE_RES struct LDKUpdateFulfillHTLC UpdateFulfillHTLC_new(struct LDKThirtyTwoBytes channel_id_arg, uint64_t htlc_id_arg, struct LDKThirtyTwoBytes payment_preimage_arg);
24153 * Creates a copy of the UpdateFulfillHTLC
24155 struct LDKUpdateFulfillHTLC UpdateFulfillHTLC_clone(const struct LDKUpdateFulfillHTLC *NONNULL_PTR orig);
24158 * Checks if two UpdateFulfillHTLCs contain equal inner contents.
24159 * This ignores pointers and is_owned flags and looks at the values in fields.
24160 * Two objects with NULL inner values will be considered "equal" here.
24162 bool UpdateFulfillHTLC_eq(const struct LDKUpdateFulfillHTLC *NONNULL_PTR a, const struct LDKUpdateFulfillHTLC *NONNULL_PTR b);
24165 * Frees any resources used by the UpdateFailHTLC, if is_owned is set and inner is non-NULL.
24167 void UpdateFailHTLC_free(struct LDKUpdateFailHTLC this_obj);
24172 const uint8_t (*UpdateFailHTLC_get_channel_id(const struct LDKUpdateFailHTLC *NONNULL_PTR this_ptr))[32];
24177 void UpdateFailHTLC_set_channel_id(struct LDKUpdateFailHTLC *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
24182 uint64_t UpdateFailHTLC_get_htlc_id(const struct LDKUpdateFailHTLC *NONNULL_PTR this_ptr);
24187 void UpdateFailHTLC_set_htlc_id(struct LDKUpdateFailHTLC *NONNULL_PTR this_ptr, uint64_t val);
24190 * Creates a copy of the UpdateFailHTLC
24192 struct LDKUpdateFailHTLC UpdateFailHTLC_clone(const struct LDKUpdateFailHTLC *NONNULL_PTR orig);
24195 * Checks if two UpdateFailHTLCs contain equal inner contents.
24196 * This ignores pointers and is_owned flags and looks at the values in fields.
24197 * Two objects with NULL inner values will be considered "equal" here.
24199 bool UpdateFailHTLC_eq(const struct LDKUpdateFailHTLC *NONNULL_PTR a, const struct LDKUpdateFailHTLC *NONNULL_PTR b);
24202 * Frees any resources used by the UpdateFailMalformedHTLC, if is_owned is set and inner is non-NULL.
24204 void UpdateFailMalformedHTLC_free(struct LDKUpdateFailMalformedHTLC this_obj);
24209 const uint8_t (*UpdateFailMalformedHTLC_get_channel_id(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr))[32];
24214 void UpdateFailMalformedHTLC_set_channel_id(struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
24219 uint64_t UpdateFailMalformedHTLC_get_htlc_id(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr);
24224 void UpdateFailMalformedHTLC_set_htlc_id(struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr, uint64_t val);
24229 uint16_t UpdateFailMalformedHTLC_get_failure_code(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr);
24234 void UpdateFailMalformedHTLC_set_failure_code(struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr, uint16_t val);
24237 * Creates a copy of the UpdateFailMalformedHTLC
24239 struct LDKUpdateFailMalformedHTLC UpdateFailMalformedHTLC_clone(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR orig);
24242 * Checks if two UpdateFailMalformedHTLCs contain equal inner contents.
24243 * This ignores pointers and is_owned flags and looks at the values in fields.
24244 * Two objects with NULL inner values will be considered "equal" here.
24246 bool UpdateFailMalformedHTLC_eq(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR a, const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR b);
24249 * Frees any resources used by the CommitmentSigned, if is_owned is set and inner is non-NULL.
24251 void CommitmentSigned_free(struct LDKCommitmentSigned this_obj);
24256 const uint8_t (*CommitmentSigned_get_channel_id(const struct LDKCommitmentSigned *NONNULL_PTR this_ptr))[32];
24261 void CommitmentSigned_set_channel_id(struct LDKCommitmentSigned *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
24264 * A signature on the commitment transaction
24266 struct LDKSignature CommitmentSigned_get_signature(const struct LDKCommitmentSigned *NONNULL_PTR this_ptr);
24269 * A signature on the commitment transaction
24271 void CommitmentSigned_set_signature(struct LDKCommitmentSigned *NONNULL_PTR this_ptr, struct LDKSignature val);
24274 * Signatures on the HTLC transactions
24276 * Returns a copy of the field.
24278 struct LDKCVec_SignatureZ CommitmentSigned_get_htlc_signatures(const struct LDKCommitmentSigned *NONNULL_PTR this_ptr);
24281 * Signatures on the HTLC transactions
24283 void CommitmentSigned_set_htlc_signatures(struct LDKCommitmentSigned *NONNULL_PTR this_ptr, struct LDKCVec_SignatureZ val);
24286 * Constructs a new CommitmentSigned given each field
24288 MUST_USE_RES struct LDKCommitmentSigned CommitmentSigned_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKSignature signature_arg, struct LDKCVec_SignatureZ htlc_signatures_arg);
24291 * Creates a copy of the CommitmentSigned
24293 struct LDKCommitmentSigned CommitmentSigned_clone(const struct LDKCommitmentSigned *NONNULL_PTR orig);
24296 * Checks if two CommitmentSigneds contain equal inner contents.
24297 * This ignores pointers and is_owned flags and looks at the values in fields.
24298 * Two objects with NULL inner values will be considered "equal" here.
24300 bool CommitmentSigned_eq(const struct LDKCommitmentSigned *NONNULL_PTR a, const struct LDKCommitmentSigned *NONNULL_PTR b);
24303 * Frees any resources used by the RevokeAndACK, if is_owned is set and inner is non-NULL.
24305 void RevokeAndACK_free(struct LDKRevokeAndACK this_obj);
24310 const uint8_t (*RevokeAndACK_get_channel_id(const struct LDKRevokeAndACK *NONNULL_PTR this_ptr))[32];
24315 void RevokeAndACK_set_channel_id(struct LDKRevokeAndACK *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
24318 * The secret corresponding to the per-commitment point
24320 const uint8_t (*RevokeAndACK_get_per_commitment_secret(const struct LDKRevokeAndACK *NONNULL_PTR this_ptr))[32];
24323 * The secret corresponding to the per-commitment point
24325 void RevokeAndACK_set_per_commitment_secret(struct LDKRevokeAndACK *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
24328 * The next sender-broadcast commitment transaction's per-commitment point
24330 struct LDKPublicKey RevokeAndACK_get_next_per_commitment_point(const struct LDKRevokeAndACK *NONNULL_PTR this_ptr);
24333 * The next sender-broadcast commitment transaction's per-commitment point
24335 void RevokeAndACK_set_next_per_commitment_point(struct LDKRevokeAndACK *NONNULL_PTR this_ptr, struct LDKPublicKey val);
24338 * Constructs a new RevokeAndACK given each field
24340 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);
24343 * Creates a copy of the RevokeAndACK
24345 struct LDKRevokeAndACK RevokeAndACK_clone(const struct LDKRevokeAndACK *NONNULL_PTR orig);
24348 * Checks if two RevokeAndACKs contain equal inner contents.
24349 * This ignores pointers and is_owned flags and looks at the values in fields.
24350 * Two objects with NULL inner values will be considered "equal" here.
24352 bool RevokeAndACK_eq(const struct LDKRevokeAndACK *NONNULL_PTR a, const struct LDKRevokeAndACK *NONNULL_PTR b);
24355 * Frees any resources used by the UpdateFee, if is_owned is set and inner is non-NULL.
24357 void UpdateFee_free(struct LDKUpdateFee this_obj);
24362 const uint8_t (*UpdateFee_get_channel_id(const struct LDKUpdateFee *NONNULL_PTR this_ptr))[32];
24367 void UpdateFee_set_channel_id(struct LDKUpdateFee *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
24370 * Fee rate per 1000-weight of the transaction
24372 uint32_t UpdateFee_get_feerate_per_kw(const struct LDKUpdateFee *NONNULL_PTR this_ptr);
24375 * Fee rate per 1000-weight of the transaction
24377 void UpdateFee_set_feerate_per_kw(struct LDKUpdateFee *NONNULL_PTR this_ptr, uint32_t val);
24380 * Constructs a new UpdateFee given each field
24382 MUST_USE_RES struct LDKUpdateFee UpdateFee_new(struct LDKThirtyTwoBytes channel_id_arg, uint32_t feerate_per_kw_arg);
24385 * Creates a copy of the UpdateFee
24387 struct LDKUpdateFee UpdateFee_clone(const struct LDKUpdateFee *NONNULL_PTR orig);
24390 * Checks if two UpdateFees contain equal inner contents.
24391 * This ignores pointers and is_owned flags and looks at the values in fields.
24392 * Two objects with NULL inner values will be considered "equal" here.
24394 bool UpdateFee_eq(const struct LDKUpdateFee *NONNULL_PTR a, const struct LDKUpdateFee *NONNULL_PTR b);
24397 * Frees any resources used by the DataLossProtect, if is_owned is set and inner is non-NULL.
24399 void DataLossProtect_free(struct LDKDataLossProtect this_obj);
24402 * Proof that the sender knows the per-commitment secret of a specific commitment transaction
24403 * belonging to the recipient
24405 const uint8_t (*DataLossProtect_get_your_last_per_commitment_secret(const struct LDKDataLossProtect *NONNULL_PTR this_ptr))[32];
24408 * Proof that the sender knows the per-commitment secret of a specific commitment transaction
24409 * belonging to the recipient
24411 void DataLossProtect_set_your_last_per_commitment_secret(struct LDKDataLossProtect *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
24414 * The sender's per-commitment point for their current commitment transaction
24416 struct LDKPublicKey DataLossProtect_get_my_current_per_commitment_point(const struct LDKDataLossProtect *NONNULL_PTR this_ptr);
24419 * The sender's per-commitment point for their current commitment transaction
24421 void DataLossProtect_set_my_current_per_commitment_point(struct LDKDataLossProtect *NONNULL_PTR this_ptr, struct LDKPublicKey val);
24424 * Constructs a new DataLossProtect given each field
24426 MUST_USE_RES struct LDKDataLossProtect DataLossProtect_new(struct LDKThirtyTwoBytes your_last_per_commitment_secret_arg, struct LDKPublicKey my_current_per_commitment_point_arg);
24429 * Creates a copy of the DataLossProtect
24431 struct LDKDataLossProtect DataLossProtect_clone(const struct LDKDataLossProtect *NONNULL_PTR orig);
24434 * Checks if two DataLossProtects contain equal inner contents.
24435 * This ignores pointers and is_owned flags and looks at the values in fields.
24436 * Two objects with NULL inner values will be considered "equal" here.
24438 bool DataLossProtect_eq(const struct LDKDataLossProtect *NONNULL_PTR a, const struct LDKDataLossProtect *NONNULL_PTR b);
24441 * Frees any resources used by the ChannelReestablish, if is_owned is set and inner is non-NULL.
24443 void ChannelReestablish_free(struct LDKChannelReestablish this_obj);
24448 const uint8_t (*ChannelReestablish_get_channel_id(const struct LDKChannelReestablish *NONNULL_PTR this_ptr))[32];
24453 void ChannelReestablish_set_channel_id(struct LDKChannelReestablish *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
24456 * The next commitment number for the sender
24458 uint64_t ChannelReestablish_get_next_local_commitment_number(const struct LDKChannelReestablish *NONNULL_PTR this_ptr);
24461 * The next commitment number for the sender
24463 void ChannelReestablish_set_next_local_commitment_number(struct LDKChannelReestablish *NONNULL_PTR this_ptr, uint64_t val);
24466 * The next commitment number for the recipient
24468 uint64_t ChannelReestablish_get_next_remote_commitment_number(const struct LDKChannelReestablish *NONNULL_PTR this_ptr);
24471 * The next commitment number for the recipient
24473 void ChannelReestablish_set_next_remote_commitment_number(struct LDKChannelReestablish *NONNULL_PTR this_ptr, uint64_t val);
24476 * Creates a copy of the ChannelReestablish
24478 struct LDKChannelReestablish ChannelReestablish_clone(const struct LDKChannelReestablish *NONNULL_PTR orig);
24481 * Checks if two ChannelReestablishs contain equal inner contents.
24482 * This ignores pointers and is_owned flags and looks at the values in fields.
24483 * Two objects with NULL inner values will be considered "equal" here.
24485 bool ChannelReestablish_eq(const struct LDKChannelReestablish *NONNULL_PTR a, const struct LDKChannelReestablish *NONNULL_PTR b);
24488 * Frees any resources used by the AnnouncementSignatures, if is_owned is set and inner is non-NULL.
24490 void AnnouncementSignatures_free(struct LDKAnnouncementSignatures this_obj);
24495 const uint8_t (*AnnouncementSignatures_get_channel_id(const struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr))[32];
24500 void AnnouncementSignatures_set_channel_id(struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
24503 * The short channel ID
24505 uint64_t AnnouncementSignatures_get_short_channel_id(const struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr);
24508 * The short channel ID
24510 void AnnouncementSignatures_set_short_channel_id(struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr, uint64_t val);
24513 * A signature by the node key
24515 struct LDKSignature AnnouncementSignatures_get_node_signature(const struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr);
24518 * A signature by the node key
24520 void AnnouncementSignatures_set_node_signature(struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr, struct LDKSignature val);
24523 * A signature by the funding key
24525 struct LDKSignature AnnouncementSignatures_get_bitcoin_signature(const struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr);
24528 * A signature by the funding key
24530 void AnnouncementSignatures_set_bitcoin_signature(struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr, struct LDKSignature val);
24533 * Constructs a new AnnouncementSignatures given each field
24535 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);
24538 * Creates a copy of the AnnouncementSignatures
24540 struct LDKAnnouncementSignatures AnnouncementSignatures_clone(const struct LDKAnnouncementSignatures *NONNULL_PTR orig);
24543 * Checks if two AnnouncementSignaturess contain equal inner contents.
24544 * This ignores pointers and is_owned flags and looks at the values in fields.
24545 * Two objects with NULL inner values will be considered "equal" here.
24547 bool AnnouncementSignatures_eq(const struct LDKAnnouncementSignatures *NONNULL_PTR a, const struct LDKAnnouncementSignatures *NONNULL_PTR b);
24550 * Frees any resources used by the NetAddress
24552 void NetAddress_free(struct LDKNetAddress this_ptr);
24555 * Creates a copy of the NetAddress
24557 struct LDKNetAddress NetAddress_clone(const struct LDKNetAddress *NONNULL_PTR orig);
24560 * Utility method to constructs a new IPv4-variant NetAddress
24562 struct LDKNetAddress NetAddress_ipv4(struct LDKFourBytes addr, uint16_t port);
24565 * Utility method to constructs a new IPv6-variant NetAddress
24567 struct LDKNetAddress NetAddress_ipv6(struct LDKSixteenBytes addr, uint16_t port);
24570 * Utility method to constructs a new OnionV2-variant NetAddress
24572 struct LDKNetAddress NetAddress_onion_v2(struct LDKTwelveBytes a);
24575 * Utility method to constructs a new OnionV3-variant NetAddress
24577 struct LDKNetAddress NetAddress_onion_v3(struct LDKThirtyTwoBytes ed25519_pubkey, uint16_t checksum, uint8_t version, uint16_t port);
24580 * Utility method to constructs a new Hostname-variant NetAddress
24582 struct LDKNetAddress NetAddress_hostname(struct LDKHostname hostname, uint16_t port);
24585 * Checks if two NetAddresss contain equal inner contents.
24586 * This ignores pointers and is_owned flags and looks at the values in fields.
24588 bool NetAddress_eq(const struct LDKNetAddress *NONNULL_PTR a, const struct LDKNetAddress *NONNULL_PTR b);
24591 * Serialize the NetAddress object into a byte array which can be read by NetAddress_read
24593 struct LDKCVec_u8Z NetAddress_write(const struct LDKNetAddress *NONNULL_PTR obj);
24596 * Read a NetAddress from a byte array, created by NetAddress_write
24598 struct LDKCResult_NetAddressDecodeErrorZ NetAddress_read(struct LDKu8slice ser);
24601 * Frees any resources used by the UnsignedNodeAnnouncement, if is_owned is set and inner is non-NULL.
24603 void UnsignedNodeAnnouncement_free(struct LDKUnsignedNodeAnnouncement this_obj);
24606 * The advertised features
24608 struct LDKNodeFeatures UnsignedNodeAnnouncement_get_features(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr);
24611 * The advertised features
24613 void UnsignedNodeAnnouncement_set_features(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKNodeFeatures val);
24616 * A strictly monotonic announcement counter, with gaps allowed
24618 uint32_t UnsignedNodeAnnouncement_get_timestamp(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr);
24621 * A strictly monotonic announcement counter, with gaps allowed
24623 void UnsignedNodeAnnouncement_set_timestamp(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, uint32_t val);
24626 * The node_id this announcement originated from (don't rebroadcast the node_announcement back
24629 struct LDKPublicKey UnsignedNodeAnnouncement_get_node_id(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr);
24632 * The node_id this announcement originated from (don't rebroadcast the node_announcement back
24635 void UnsignedNodeAnnouncement_set_node_id(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKPublicKey val);
24638 * An RGB color for UI purposes
24640 const uint8_t (*UnsignedNodeAnnouncement_get_rgb(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr))[3];
24643 * An RGB color for UI purposes
24645 void UnsignedNodeAnnouncement_set_rgb(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKThreeBytes val);
24648 * An alias, for UI purposes. This should be sanitized before use. There is no guarantee
24651 const uint8_t (*UnsignedNodeAnnouncement_get_alias(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr))[32];
24654 * An alias, for UI purposes. This should be sanitized before use. There is no guarantee
24657 void UnsignedNodeAnnouncement_set_alias(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
24660 * List of addresses on which this node is reachable
24662 * Returns a copy of the field.
24664 struct LDKCVec_NetAddressZ UnsignedNodeAnnouncement_get_addresses(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr);
24667 * List of addresses on which this node is reachable
24669 void UnsignedNodeAnnouncement_set_addresses(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKCVec_NetAddressZ val);
24672 * Creates a copy of the UnsignedNodeAnnouncement
24674 struct LDKUnsignedNodeAnnouncement UnsignedNodeAnnouncement_clone(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR orig);
24677 * Checks if two UnsignedNodeAnnouncements contain equal inner contents.
24678 * This ignores pointers and is_owned flags and looks at the values in fields.
24679 * Two objects with NULL inner values will be considered "equal" here.
24681 bool UnsignedNodeAnnouncement_eq(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR a, const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR b);
24684 * Frees any resources used by the NodeAnnouncement, if is_owned is set and inner is non-NULL.
24686 void NodeAnnouncement_free(struct LDKNodeAnnouncement this_obj);
24689 * The signature by the node key
24691 struct LDKSignature NodeAnnouncement_get_signature(const struct LDKNodeAnnouncement *NONNULL_PTR this_ptr);
24694 * The signature by the node key
24696 void NodeAnnouncement_set_signature(struct LDKNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKSignature val);
24699 * The actual content of the announcement
24701 struct LDKUnsignedNodeAnnouncement NodeAnnouncement_get_contents(const struct LDKNodeAnnouncement *NONNULL_PTR this_ptr);
24704 * The actual content of the announcement
24706 void NodeAnnouncement_set_contents(struct LDKNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKUnsignedNodeAnnouncement val);
24709 * Constructs a new NodeAnnouncement given each field
24711 MUST_USE_RES struct LDKNodeAnnouncement NodeAnnouncement_new(struct LDKSignature signature_arg, struct LDKUnsignedNodeAnnouncement contents_arg);
24714 * Creates a copy of the NodeAnnouncement
24716 struct LDKNodeAnnouncement NodeAnnouncement_clone(const struct LDKNodeAnnouncement *NONNULL_PTR orig);
24719 * Checks if two NodeAnnouncements contain equal inner contents.
24720 * This ignores pointers and is_owned flags and looks at the values in fields.
24721 * Two objects with NULL inner values will be considered "equal" here.
24723 bool NodeAnnouncement_eq(const struct LDKNodeAnnouncement *NONNULL_PTR a, const struct LDKNodeAnnouncement *NONNULL_PTR b);
24726 * Frees any resources used by the UnsignedChannelAnnouncement, if is_owned is set and inner is non-NULL.
24728 void UnsignedChannelAnnouncement_free(struct LDKUnsignedChannelAnnouncement this_obj);
24731 * The advertised channel features
24733 struct LDKChannelFeatures UnsignedChannelAnnouncement_get_features(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
24736 * The advertised channel features
24738 void UnsignedChannelAnnouncement_set_features(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKChannelFeatures val);
24741 * The genesis hash of the blockchain where the channel is to be opened
24743 const uint8_t (*UnsignedChannelAnnouncement_get_chain_hash(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr))[32];
24746 * The genesis hash of the blockchain where the channel is to be opened
24748 void UnsignedChannelAnnouncement_set_chain_hash(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
24751 * The short channel ID
24753 uint64_t UnsignedChannelAnnouncement_get_short_channel_id(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
24756 * The short channel ID
24758 void UnsignedChannelAnnouncement_set_short_channel_id(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, uint64_t val);
24761 * One of the two node_ids which are endpoints of this channel
24763 struct LDKPublicKey UnsignedChannelAnnouncement_get_node_id_1(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
24766 * One of the two node_ids which are endpoints of this channel
24768 void UnsignedChannelAnnouncement_set_node_id_1(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKPublicKey val);
24771 * The other of the two node_ids which are endpoints of this channel
24773 struct LDKPublicKey UnsignedChannelAnnouncement_get_node_id_2(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
24776 * The other of the two node_ids which are endpoints of this channel
24778 void UnsignedChannelAnnouncement_set_node_id_2(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKPublicKey val);
24781 * The funding key for the first node
24783 struct LDKPublicKey UnsignedChannelAnnouncement_get_bitcoin_key_1(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
24786 * The funding key for the first node
24788 void UnsignedChannelAnnouncement_set_bitcoin_key_1(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKPublicKey val);
24791 * The funding key for the second node
24793 struct LDKPublicKey UnsignedChannelAnnouncement_get_bitcoin_key_2(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
24796 * The funding key for the second node
24798 void UnsignedChannelAnnouncement_set_bitcoin_key_2(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKPublicKey val);
24801 * Creates a copy of the UnsignedChannelAnnouncement
24803 struct LDKUnsignedChannelAnnouncement UnsignedChannelAnnouncement_clone(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR orig);
24806 * Checks if two UnsignedChannelAnnouncements contain equal inner contents.
24807 * This ignores pointers and is_owned flags and looks at the values in fields.
24808 * Two objects with NULL inner values will be considered "equal" here.
24810 bool UnsignedChannelAnnouncement_eq(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR a, const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR b);
24813 * Frees any resources used by the ChannelAnnouncement, if is_owned is set and inner is non-NULL.
24815 void ChannelAnnouncement_free(struct LDKChannelAnnouncement this_obj);
24818 * Authentication of the announcement by the first public node
24820 struct LDKSignature ChannelAnnouncement_get_node_signature_1(const struct LDKChannelAnnouncement *NONNULL_PTR this_ptr);
24823 * Authentication of the announcement by the first public node
24825 void ChannelAnnouncement_set_node_signature_1(struct LDKChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKSignature val);
24828 * Authentication of the announcement by the second public node
24830 struct LDKSignature ChannelAnnouncement_get_node_signature_2(const struct LDKChannelAnnouncement *NONNULL_PTR this_ptr);
24833 * Authentication of the announcement by the second public node
24835 void ChannelAnnouncement_set_node_signature_2(struct LDKChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKSignature val);
24838 * Proof of funding UTXO ownership by the first public node
24840 struct LDKSignature ChannelAnnouncement_get_bitcoin_signature_1(const struct LDKChannelAnnouncement *NONNULL_PTR this_ptr);
24843 * Proof of funding UTXO ownership by the first public node
24845 void ChannelAnnouncement_set_bitcoin_signature_1(struct LDKChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKSignature val);
24848 * Proof of funding UTXO ownership by the second public node
24850 struct LDKSignature ChannelAnnouncement_get_bitcoin_signature_2(const struct LDKChannelAnnouncement *NONNULL_PTR this_ptr);
24853 * Proof of funding UTXO ownership by the second public node
24855 void ChannelAnnouncement_set_bitcoin_signature_2(struct LDKChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKSignature val);
24858 * The actual announcement
24860 struct LDKUnsignedChannelAnnouncement ChannelAnnouncement_get_contents(const struct LDKChannelAnnouncement *NONNULL_PTR this_ptr);
24863 * The actual announcement
24865 void ChannelAnnouncement_set_contents(struct LDKChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKUnsignedChannelAnnouncement val);
24868 * Constructs a new ChannelAnnouncement given each field
24870 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);
24873 * Creates a copy of the ChannelAnnouncement
24875 struct LDKChannelAnnouncement ChannelAnnouncement_clone(const struct LDKChannelAnnouncement *NONNULL_PTR orig);
24878 * Checks if two ChannelAnnouncements contain equal inner contents.
24879 * This ignores pointers and is_owned flags and looks at the values in fields.
24880 * Two objects with NULL inner values will be considered "equal" here.
24882 bool ChannelAnnouncement_eq(const struct LDKChannelAnnouncement *NONNULL_PTR a, const struct LDKChannelAnnouncement *NONNULL_PTR b);
24885 * Frees any resources used by the UnsignedChannelUpdate, if is_owned is set and inner is non-NULL.
24887 void UnsignedChannelUpdate_free(struct LDKUnsignedChannelUpdate this_obj);
24890 * The genesis hash of the blockchain where the channel is to be opened
24892 const uint8_t (*UnsignedChannelUpdate_get_chain_hash(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr))[32];
24895 * The genesis hash of the blockchain where the channel is to be opened
24897 void UnsignedChannelUpdate_set_chain_hash(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
24900 * The short channel ID
24902 uint64_t UnsignedChannelUpdate_get_short_channel_id(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
24905 * The short channel ID
24907 void UnsignedChannelUpdate_set_short_channel_id(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint64_t val);
24910 * A strictly monotonic announcement counter, with gaps allowed, specific to this channel
24912 uint32_t UnsignedChannelUpdate_get_timestamp(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
24915 * A strictly monotonic announcement counter, with gaps allowed, specific to this channel
24917 void UnsignedChannelUpdate_set_timestamp(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint32_t val);
24922 uint8_t UnsignedChannelUpdate_get_flags(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
24927 void UnsignedChannelUpdate_set_flags(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint8_t val);
24930 * The number of blocks such that if:
24931 * `incoming_htlc.cltv_expiry < outgoing_htlc.cltv_expiry + cltv_expiry_delta`
24932 * then we need to fail the HTLC backwards. When forwarding an HTLC, cltv_expiry_delta determines
24933 * the outgoing HTLC's minimum cltv_expiry value -- so, if an incoming HTLC comes in with a
24934 * cltv_expiry of 100000, and the node we're forwarding to has a cltv_expiry_delta value of 10,
24935 * then we'll check that the outgoing HTLC's cltv_expiry value is at least 100010 before
24936 * forwarding. Note that the HTLC sender is the one who originally sets this value when
24937 * constructing the route.
24939 uint16_t UnsignedChannelUpdate_get_cltv_expiry_delta(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
24942 * The number of blocks such that if:
24943 * `incoming_htlc.cltv_expiry < outgoing_htlc.cltv_expiry + cltv_expiry_delta`
24944 * then we need to fail the HTLC backwards. When forwarding an HTLC, cltv_expiry_delta determines
24945 * the outgoing HTLC's minimum cltv_expiry value -- so, if an incoming HTLC comes in with a
24946 * cltv_expiry of 100000, and the node we're forwarding to has a cltv_expiry_delta value of 10,
24947 * then we'll check that the outgoing HTLC's cltv_expiry value is at least 100010 before
24948 * forwarding. Note that the HTLC sender is the one who originally sets this value when
24949 * constructing the route.
24951 void UnsignedChannelUpdate_set_cltv_expiry_delta(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint16_t val);
24954 * The minimum HTLC size incoming to sender, in milli-satoshi
24956 uint64_t UnsignedChannelUpdate_get_htlc_minimum_msat(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
24959 * The minimum HTLC size incoming to sender, in milli-satoshi
24961 void UnsignedChannelUpdate_set_htlc_minimum_msat(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint64_t val);
24964 * The maximum HTLC value incoming to sender, in milli-satoshi. Used to be optional.
24966 uint64_t UnsignedChannelUpdate_get_htlc_maximum_msat(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
24969 * The maximum HTLC value incoming to sender, in milli-satoshi. Used to be optional.
24971 void UnsignedChannelUpdate_set_htlc_maximum_msat(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint64_t val);
24974 * The base HTLC fee charged by sender, in milli-satoshi
24976 uint32_t UnsignedChannelUpdate_get_fee_base_msat(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
24979 * The base HTLC fee charged by sender, in milli-satoshi
24981 void UnsignedChannelUpdate_set_fee_base_msat(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint32_t val);
24984 * The amount to fee multiplier, in micro-satoshi
24986 uint32_t UnsignedChannelUpdate_get_fee_proportional_millionths(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
24989 * The amount to fee multiplier, in micro-satoshi
24991 void UnsignedChannelUpdate_set_fee_proportional_millionths(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint32_t val);
24994 * Excess data which was signed as a part of the message which we do not (yet) understand how
24995 * to decode. This is stored to ensure forward-compatibility as new fields are added to the
24998 * Returns a copy of the field.
25000 struct LDKCVec_u8Z UnsignedChannelUpdate_get_excess_data(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
25003 * Excess data which was signed as a part of the message which we do not (yet) understand how
25004 * to decode. This is stored to ensure forward-compatibility as new fields are added to the
25007 void UnsignedChannelUpdate_set_excess_data(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val);
25010 * Constructs a new UnsignedChannelUpdate given each field
25012 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);
25015 * Creates a copy of the UnsignedChannelUpdate
25017 struct LDKUnsignedChannelUpdate UnsignedChannelUpdate_clone(const struct LDKUnsignedChannelUpdate *NONNULL_PTR orig);
25020 * Checks if two UnsignedChannelUpdates contain equal inner contents.
25021 * This ignores pointers and is_owned flags and looks at the values in fields.
25022 * Two objects with NULL inner values will be considered "equal" here.
25024 bool UnsignedChannelUpdate_eq(const struct LDKUnsignedChannelUpdate *NONNULL_PTR a, const struct LDKUnsignedChannelUpdate *NONNULL_PTR b);
25027 * Frees any resources used by the ChannelUpdate, if is_owned is set and inner is non-NULL.
25029 void ChannelUpdate_free(struct LDKChannelUpdate this_obj);
25032 * A signature of the channel update
25034 struct LDKSignature ChannelUpdate_get_signature(const struct LDKChannelUpdate *NONNULL_PTR this_ptr);
25037 * A signature of the channel update
25039 void ChannelUpdate_set_signature(struct LDKChannelUpdate *NONNULL_PTR this_ptr, struct LDKSignature val);
25042 * The actual channel update
25044 struct LDKUnsignedChannelUpdate ChannelUpdate_get_contents(const struct LDKChannelUpdate *NONNULL_PTR this_ptr);
25047 * The actual channel update
25049 void ChannelUpdate_set_contents(struct LDKChannelUpdate *NONNULL_PTR this_ptr, struct LDKUnsignedChannelUpdate val);
25052 * Constructs a new ChannelUpdate given each field
25054 MUST_USE_RES struct LDKChannelUpdate ChannelUpdate_new(struct LDKSignature signature_arg, struct LDKUnsignedChannelUpdate contents_arg);
25057 * Creates a copy of the ChannelUpdate
25059 struct LDKChannelUpdate ChannelUpdate_clone(const struct LDKChannelUpdate *NONNULL_PTR orig);
25062 * Checks if two ChannelUpdates contain equal inner contents.
25063 * This ignores pointers and is_owned flags and looks at the values in fields.
25064 * Two objects with NULL inner values will be considered "equal" here.
25066 bool ChannelUpdate_eq(const struct LDKChannelUpdate *NONNULL_PTR a, const struct LDKChannelUpdate *NONNULL_PTR b);
25069 * Frees any resources used by the QueryChannelRange, if is_owned is set and inner is non-NULL.
25071 void QueryChannelRange_free(struct LDKQueryChannelRange this_obj);
25074 * The genesis hash of the blockchain being queried
25076 const uint8_t (*QueryChannelRange_get_chain_hash(const struct LDKQueryChannelRange *NONNULL_PTR this_ptr))[32];
25079 * The genesis hash of the blockchain being queried
25081 void QueryChannelRange_set_chain_hash(struct LDKQueryChannelRange *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
25084 * The height of the first block for the channel UTXOs being queried
25086 uint32_t QueryChannelRange_get_first_blocknum(const struct LDKQueryChannelRange *NONNULL_PTR this_ptr);
25089 * The height of the first block for the channel UTXOs being queried
25091 void QueryChannelRange_set_first_blocknum(struct LDKQueryChannelRange *NONNULL_PTR this_ptr, uint32_t val);
25094 * The number of blocks to include in the query results
25096 uint32_t QueryChannelRange_get_number_of_blocks(const struct LDKQueryChannelRange *NONNULL_PTR this_ptr);
25099 * The number of blocks to include in the query results
25101 void QueryChannelRange_set_number_of_blocks(struct LDKQueryChannelRange *NONNULL_PTR this_ptr, uint32_t val);
25104 * Constructs a new QueryChannelRange given each field
25106 MUST_USE_RES struct LDKQueryChannelRange QueryChannelRange_new(struct LDKThirtyTwoBytes chain_hash_arg, uint32_t first_blocknum_arg, uint32_t number_of_blocks_arg);
25109 * Creates a copy of the QueryChannelRange
25111 struct LDKQueryChannelRange QueryChannelRange_clone(const struct LDKQueryChannelRange *NONNULL_PTR orig);
25114 * Checks if two QueryChannelRanges contain equal inner contents.
25115 * This ignores pointers and is_owned flags and looks at the values in fields.
25116 * Two objects with NULL inner values will be considered "equal" here.
25118 bool QueryChannelRange_eq(const struct LDKQueryChannelRange *NONNULL_PTR a, const struct LDKQueryChannelRange *NONNULL_PTR b);
25121 * Frees any resources used by the ReplyChannelRange, if is_owned is set and inner is non-NULL.
25123 void ReplyChannelRange_free(struct LDKReplyChannelRange this_obj);
25126 * The genesis hash of the blockchain being queried
25128 const uint8_t (*ReplyChannelRange_get_chain_hash(const struct LDKReplyChannelRange *NONNULL_PTR this_ptr))[32];
25131 * The genesis hash of the blockchain being queried
25133 void ReplyChannelRange_set_chain_hash(struct LDKReplyChannelRange *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
25136 * The height of the first block in the range of the reply
25138 uint32_t ReplyChannelRange_get_first_blocknum(const struct LDKReplyChannelRange *NONNULL_PTR this_ptr);
25141 * The height of the first block in the range of the reply
25143 void ReplyChannelRange_set_first_blocknum(struct LDKReplyChannelRange *NONNULL_PTR this_ptr, uint32_t val);
25146 * The number of blocks included in the range of the reply
25148 uint32_t ReplyChannelRange_get_number_of_blocks(const struct LDKReplyChannelRange *NONNULL_PTR this_ptr);
25151 * The number of blocks included in the range of the reply
25153 void ReplyChannelRange_set_number_of_blocks(struct LDKReplyChannelRange *NONNULL_PTR this_ptr, uint32_t val);
25156 * True when this is the final reply for a query
25158 bool ReplyChannelRange_get_sync_complete(const struct LDKReplyChannelRange *NONNULL_PTR this_ptr);
25161 * True when this is the final reply for a query
25163 void ReplyChannelRange_set_sync_complete(struct LDKReplyChannelRange *NONNULL_PTR this_ptr, bool val);
25166 * The short_channel_ids in the channel range
25168 * Returns a copy of the field.
25170 struct LDKCVec_u64Z ReplyChannelRange_get_short_channel_ids(const struct LDKReplyChannelRange *NONNULL_PTR this_ptr);
25173 * The short_channel_ids in the channel range
25175 void ReplyChannelRange_set_short_channel_ids(struct LDKReplyChannelRange *NONNULL_PTR this_ptr, struct LDKCVec_u64Z val);
25178 * Constructs a new ReplyChannelRange given each field
25180 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);
25183 * Creates a copy of the ReplyChannelRange
25185 struct LDKReplyChannelRange ReplyChannelRange_clone(const struct LDKReplyChannelRange *NONNULL_PTR orig);
25188 * Checks if two ReplyChannelRanges contain equal inner contents.
25189 * This ignores pointers and is_owned flags and looks at the values in fields.
25190 * Two objects with NULL inner values will be considered "equal" here.
25192 bool ReplyChannelRange_eq(const struct LDKReplyChannelRange *NONNULL_PTR a, const struct LDKReplyChannelRange *NONNULL_PTR b);
25195 * Frees any resources used by the QueryShortChannelIds, if is_owned is set and inner is non-NULL.
25197 void QueryShortChannelIds_free(struct LDKQueryShortChannelIds this_obj);
25200 * The genesis hash of the blockchain being queried
25202 const uint8_t (*QueryShortChannelIds_get_chain_hash(const struct LDKQueryShortChannelIds *NONNULL_PTR this_ptr))[32];
25205 * The genesis hash of the blockchain being queried
25207 void QueryShortChannelIds_set_chain_hash(struct LDKQueryShortChannelIds *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
25210 * The short_channel_ids that are being queried
25212 * Returns a copy of the field.
25214 struct LDKCVec_u64Z QueryShortChannelIds_get_short_channel_ids(const struct LDKQueryShortChannelIds *NONNULL_PTR this_ptr);
25217 * The short_channel_ids that are being queried
25219 void QueryShortChannelIds_set_short_channel_ids(struct LDKQueryShortChannelIds *NONNULL_PTR this_ptr, struct LDKCVec_u64Z val);
25222 * Constructs a new QueryShortChannelIds given each field
25224 MUST_USE_RES struct LDKQueryShortChannelIds QueryShortChannelIds_new(struct LDKThirtyTwoBytes chain_hash_arg, struct LDKCVec_u64Z short_channel_ids_arg);
25227 * Creates a copy of the QueryShortChannelIds
25229 struct LDKQueryShortChannelIds QueryShortChannelIds_clone(const struct LDKQueryShortChannelIds *NONNULL_PTR orig);
25232 * Checks if two QueryShortChannelIdss contain equal inner contents.
25233 * This ignores pointers and is_owned flags and looks at the values in fields.
25234 * Two objects with NULL inner values will be considered "equal" here.
25236 bool QueryShortChannelIds_eq(const struct LDKQueryShortChannelIds *NONNULL_PTR a, const struct LDKQueryShortChannelIds *NONNULL_PTR b);
25239 * Frees any resources used by the ReplyShortChannelIdsEnd, if is_owned is set and inner is non-NULL.
25241 void ReplyShortChannelIdsEnd_free(struct LDKReplyShortChannelIdsEnd this_obj);
25244 * The genesis hash of the blockchain that was queried
25246 const uint8_t (*ReplyShortChannelIdsEnd_get_chain_hash(const struct LDKReplyShortChannelIdsEnd *NONNULL_PTR this_ptr))[32];
25249 * The genesis hash of the blockchain that was queried
25251 void ReplyShortChannelIdsEnd_set_chain_hash(struct LDKReplyShortChannelIdsEnd *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
25254 * Indicates if the query recipient maintains up-to-date channel
25255 * information for the chain_hash
25257 bool ReplyShortChannelIdsEnd_get_full_information(const struct LDKReplyShortChannelIdsEnd *NONNULL_PTR this_ptr);
25260 * Indicates if the query recipient maintains up-to-date channel
25261 * information for the chain_hash
25263 void ReplyShortChannelIdsEnd_set_full_information(struct LDKReplyShortChannelIdsEnd *NONNULL_PTR this_ptr, bool val);
25266 * Constructs a new ReplyShortChannelIdsEnd given each field
25268 MUST_USE_RES struct LDKReplyShortChannelIdsEnd ReplyShortChannelIdsEnd_new(struct LDKThirtyTwoBytes chain_hash_arg, bool full_information_arg);
25271 * Creates a copy of the ReplyShortChannelIdsEnd
25273 struct LDKReplyShortChannelIdsEnd ReplyShortChannelIdsEnd_clone(const struct LDKReplyShortChannelIdsEnd *NONNULL_PTR orig);
25276 * Checks if two ReplyShortChannelIdsEnds contain equal inner contents.
25277 * This ignores pointers and is_owned flags and looks at the values in fields.
25278 * Two objects with NULL inner values will be considered "equal" here.
25280 bool ReplyShortChannelIdsEnd_eq(const struct LDKReplyShortChannelIdsEnd *NONNULL_PTR a, const struct LDKReplyShortChannelIdsEnd *NONNULL_PTR b);
25283 * Frees any resources used by the GossipTimestampFilter, if is_owned is set and inner is non-NULL.
25285 void GossipTimestampFilter_free(struct LDKGossipTimestampFilter this_obj);
25288 * The genesis hash of the blockchain for channel and node information
25290 const uint8_t (*GossipTimestampFilter_get_chain_hash(const struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr))[32];
25293 * The genesis hash of the blockchain for channel and node information
25295 void GossipTimestampFilter_set_chain_hash(struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
25298 * The starting unix timestamp
25300 uint32_t GossipTimestampFilter_get_first_timestamp(const struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr);
25303 * The starting unix timestamp
25305 void GossipTimestampFilter_set_first_timestamp(struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr, uint32_t val);
25308 * The range of information in seconds
25310 uint32_t GossipTimestampFilter_get_timestamp_range(const struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr);
25313 * The range of information in seconds
25315 void GossipTimestampFilter_set_timestamp_range(struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr, uint32_t val);
25318 * Constructs a new GossipTimestampFilter given each field
25320 MUST_USE_RES struct LDKGossipTimestampFilter GossipTimestampFilter_new(struct LDKThirtyTwoBytes chain_hash_arg, uint32_t first_timestamp_arg, uint32_t timestamp_range_arg);
25323 * Creates a copy of the GossipTimestampFilter
25325 struct LDKGossipTimestampFilter GossipTimestampFilter_clone(const struct LDKGossipTimestampFilter *NONNULL_PTR orig);
25328 * Checks if two GossipTimestampFilters contain equal inner contents.
25329 * This ignores pointers and is_owned flags and looks at the values in fields.
25330 * Two objects with NULL inner values will be considered "equal" here.
25332 bool GossipTimestampFilter_eq(const struct LDKGossipTimestampFilter *NONNULL_PTR a, const struct LDKGossipTimestampFilter *NONNULL_PTR b);
25335 * Frees any resources used by the ErrorAction
25337 void ErrorAction_free(struct LDKErrorAction this_ptr);
25340 * Creates a copy of the ErrorAction
25342 struct LDKErrorAction ErrorAction_clone(const struct LDKErrorAction *NONNULL_PTR orig);
25345 * Utility method to constructs a new DisconnectPeer-variant ErrorAction
25347 struct LDKErrorAction ErrorAction_disconnect_peer(struct LDKErrorMessage msg);
25350 * Utility method to constructs a new IgnoreError-variant ErrorAction
25352 struct LDKErrorAction ErrorAction_ignore_error(void);
25355 * Utility method to constructs a new IgnoreAndLog-variant ErrorAction
25357 struct LDKErrorAction ErrorAction_ignore_and_log(enum LDKLevel a);
25360 * Utility method to constructs a new IgnoreDuplicateGossip-variant ErrorAction
25362 struct LDKErrorAction ErrorAction_ignore_duplicate_gossip(void);
25365 * Utility method to constructs a new SendErrorMessage-variant ErrorAction
25367 struct LDKErrorAction ErrorAction_send_error_message(struct LDKErrorMessage msg);
25370 * Utility method to constructs a new SendWarningMessage-variant ErrorAction
25372 struct LDKErrorAction ErrorAction_send_warning_message(struct LDKWarningMessage msg, enum LDKLevel log_level);
25375 * Frees any resources used by the LightningError, if is_owned is set and inner is non-NULL.
25377 void LightningError_free(struct LDKLightningError this_obj);
25380 * A human-readable message describing the error
25382 struct LDKStr LightningError_get_err(const struct LDKLightningError *NONNULL_PTR this_ptr);
25385 * A human-readable message describing the error
25387 void LightningError_set_err(struct LDKLightningError *NONNULL_PTR this_ptr, struct LDKStr val);
25390 * The action which should be taken against the offending peer.
25392 struct LDKErrorAction LightningError_get_action(const struct LDKLightningError *NONNULL_PTR this_ptr);
25395 * The action which should be taken against the offending peer.
25397 void LightningError_set_action(struct LDKLightningError *NONNULL_PTR this_ptr, struct LDKErrorAction val);
25400 * Constructs a new LightningError given each field
25402 MUST_USE_RES struct LDKLightningError LightningError_new(struct LDKStr err_arg, struct LDKErrorAction action_arg);
25405 * Creates a copy of the LightningError
25407 struct LDKLightningError LightningError_clone(const struct LDKLightningError *NONNULL_PTR orig);
25410 * Frees any resources used by the CommitmentUpdate, if is_owned is set and inner is non-NULL.
25412 void CommitmentUpdate_free(struct LDKCommitmentUpdate this_obj);
25415 * update_add_htlc messages which should be sent
25417 struct LDKCVec_UpdateAddHTLCZ CommitmentUpdate_get_update_add_htlcs(const struct LDKCommitmentUpdate *NONNULL_PTR this_ptr);
25420 * update_add_htlc messages which should be sent
25422 void CommitmentUpdate_set_update_add_htlcs(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKCVec_UpdateAddHTLCZ val);
25425 * update_fulfill_htlc messages which should be sent
25427 struct LDKCVec_UpdateFulfillHTLCZ CommitmentUpdate_get_update_fulfill_htlcs(const struct LDKCommitmentUpdate *NONNULL_PTR this_ptr);
25430 * update_fulfill_htlc messages which should be sent
25432 void CommitmentUpdate_set_update_fulfill_htlcs(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKCVec_UpdateFulfillHTLCZ val);
25435 * update_fail_htlc messages which should be sent
25437 struct LDKCVec_UpdateFailHTLCZ CommitmentUpdate_get_update_fail_htlcs(const struct LDKCommitmentUpdate *NONNULL_PTR this_ptr);
25440 * update_fail_htlc messages which should be sent
25442 void CommitmentUpdate_set_update_fail_htlcs(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKCVec_UpdateFailHTLCZ val);
25445 * update_fail_malformed_htlc messages which should be sent
25447 struct LDKCVec_UpdateFailMalformedHTLCZ CommitmentUpdate_get_update_fail_malformed_htlcs(const struct LDKCommitmentUpdate *NONNULL_PTR this_ptr);
25450 * update_fail_malformed_htlc messages which should be sent
25452 void CommitmentUpdate_set_update_fail_malformed_htlcs(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKCVec_UpdateFailMalformedHTLCZ val);
25455 * An update_fee message which should be sent
25457 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
25459 struct LDKUpdateFee CommitmentUpdate_get_update_fee(const struct LDKCommitmentUpdate *NONNULL_PTR this_ptr);
25462 * An update_fee message which should be sent
25464 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
25466 void CommitmentUpdate_set_update_fee(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKUpdateFee val);
25469 * Finally, the commitment_signed message which should be sent
25471 struct LDKCommitmentSigned CommitmentUpdate_get_commitment_signed(const struct LDKCommitmentUpdate *NONNULL_PTR this_ptr);
25474 * Finally, the commitment_signed message which should be sent
25476 void CommitmentUpdate_set_commitment_signed(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKCommitmentSigned val);
25479 * Constructs a new CommitmentUpdate given each field
25481 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);
25484 * Creates a copy of the CommitmentUpdate
25486 struct LDKCommitmentUpdate CommitmentUpdate_clone(const struct LDKCommitmentUpdate *NONNULL_PTR orig);
25489 * Checks if two CommitmentUpdates contain equal inner contents.
25490 * This ignores pointers and is_owned flags and looks at the values in fields.
25491 * Two objects with NULL inner values will be considered "equal" here.
25493 bool CommitmentUpdate_eq(const struct LDKCommitmentUpdate *NONNULL_PTR a, const struct LDKCommitmentUpdate *NONNULL_PTR b);
25496 * Calls the free function if one is set
25498 void ChannelMessageHandler_free(struct LDKChannelMessageHandler this_ptr);
25501 * Calls the free function if one is set
25503 void RoutingMessageHandler_free(struct LDKRoutingMessageHandler this_ptr);
25506 * Calls the free function if one is set
25508 void OnionMessageHandler_free(struct LDKOnionMessageHandler this_ptr);
25511 * Serialize the AcceptChannel object into a byte array which can be read by AcceptChannel_read
25513 struct LDKCVec_u8Z AcceptChannel_write(const struct LDKAcceptChannel *NONNULL_PTR obj);
25516 * Read a AcceptChannel from a byte array, created by AcceptChannel_write
25518 struct LDKCResult_AcceptChannelDecodeErrorZ AcceptChannel_read(struct LDKu8slice ser);
25521 * Serialize the AnnouncementSignatures object into a byte array which can be read by AnnouncementSignatures_read
25523 struct LDKCVec_u8Z AnnouncementSignatures_write(const struct LDKAnnouncementSignatures *NONNULL_PTR obj);
25526 * Read a AnnouncementSignatures from a byte array, created by AnnouncementSignatures_write
25528 struct LDKCResult_AnnouncementSignaturesDecodeErrorZ AnnouncementSignatures_read(struct LDKu8slice ser);
25531 * Serialize the ChannelReestablish object into a byte array which can be read by ChannelReestablish_read
25533 struct LDKCVec_u8Z ChannelReestablish_write(const struct LDKChannelReestablish *NONNULL_PTR obj);
25536 * Read a ChannelReestablish from a byte array, created by ChannelReestablish_write
25538 struct LDKCResult_ChannelReestablishDecodeErrorZ ChannelReestablish_read(struct LDKu8slice ser);
25541 * Serialize the ClosingSigned object into a byte array which can be read by ClosingSigned_read
25543 struct LDKCVec_u8Z ClosingSigned_write(const struct LDKClosingSigned *NONNULL_PTR obj);
25546 * Read a ClosingSigned from a byte array, created by ClosingSigned_write
25548 struct LDKCResult_ClosingSignedDecodeErrorZ ClosingSigned_read(struct LDKu8slice ser);
25551 * Serialize the ClosingSignedFeeRange object into a byte array which can be read by ClosingSignedFeeRange_read
25553 struct LDKCVec_u8Z ClosingSignedFeeRange_write(const struct LDKClosingSignedFeeRange *NONNULL_PTR obj);
25556 * Read a ClosingSignedFeeRange from a byte array, created by ClosingSignedFeeRange_write
25558 struct LDKCResult_ClosingSignedFeeRangeDecodeErrorZ ClosingSignedFeeRange_read(struct LDKu8slice ser);
25561 * Serialize the CommitmentSigned object into a byte array which can be read by CommitmentSigned_read
25563 struct LDKCVec_u8Z CommitmentSigned_write(const struct LDKCommitmentSigned *NONNULL_PTR obj);
25566 * Read a CommitmentSigned from a byte array, created by CommitmentSigned_write
25568 struct LDKCResult_CommitmentSignedDecodeErrorZ CommitmentSigned_read(struct LDKu8slice ser);
25571 * Serialize the FundingCreated object into a byte array which can be read by FundingCreated_read
25573 struct LDKCVec_u8Z FundingCreated_write(const struct LDKFundingCreated *NONNULL_PTR obj);
25576 * Read a FundingCreated from a byte array, created by FundingCreated_write
25578 struct LDKCResult_FundingCreatedDecodeErrorZ FundingCreated_read(struct LDKu8slice ser);
25581 * Serialize the FundingSigned object into a byte array which can be read by FundingSigned_read
25583 struct LDKCVec_u8Z FundingSigned_write(const struct LDKFundingSigned *NONNULL_PTR obj);
25586 * Read a FundingSigned from a byte array, created by FundingSigned_write
25588 struct LDKCResult_FundingSignedDecodeErrorZ FundingSigned_read(struct LDKu8slice ser);
25591 * Serialize the ChannelReady object into a byte array which can be read by ChannelReady_read
25593 struct LDKCVec_u8Z ChannelReady_write(const struct LDKChannelReady *NONNULL_PTR obj);
25596 * Read a ChannelReady from a byte array, created by ChannelReady_write
25598 struct LDKCResult_ChannelReadyDecodeErrorZ ChannelReady_read(struct LDKu8slice ser);
25601 * Serialize the Init object into a byte array which can be read by Init_read
25603 struct LDKCVec_u8Z Init_write(const struct LDKInit *NONNULL_PTR obj);
25606 * Read a Init from a byte array, created by Init_write
25608 struct LDKCResult_InitDecodeErrorZ Init_read(struct LDKu8slice ser);
25611 * Serialize the OpenChannel object into a byte array which can be read by OpenChannel_read
25613 struct LDKCVec_u8Z OpenChannel_write(const struct LDKOpenChannel *NONNULL_PTR obj);
25616 * Read a OpenChannel from a byte array, created by OpenChannel_write
25618 struct LDKCResult_OpenChannelDecodeErrorZ OpenChannel_read(struct LDKu8slice ser);
25621 * Serialize the RevokeAndACK object into a byte array which can be read by RevokeAndACK_read
25623 struct LDKCVec_u8Z RevokeAndACK_write(const struct LDKRevokeAndACK *NONNULL_PTR obj);
25626 * Read a RevokeAndACK from a byte array, created by RevokeAndACK_write
25628 struct LDKCResult_RevokeAndACKDecodeErrorZ RevokeAndACK_read(struct LDKu8slice ser);
25631 * Serialize the Shutdown object into a byte array which can be read by Shutdown_read
25633 struct LDKCVec_u8Z Shutdown_write(const struct LDKShutdown *NONNULL_PTR obj);
25636 * Read a Shutdown from a byte array, created by Shutdown_write
25638 struct LDKCResult_ShutdownDecodeErrorZ Shutdown_read(struct LDKu8slice ser);
25641 * Serialize the UpdateFailHTLC object into a byte array which can be read by UpdateFailHTLC_read
25643 struct LDKCVec_u8Z UpdateFailHTLC_write(const struct LDKUpdateFailHTLC *NONNULL_PTR obj);
25646 * Read a UpdateFailHTLC from a byte array, created by UpdateFailHTLC_write
25648 struct LDKCResult_UpdateFailHTLCDecodeErrorZ UpdateFailHTLC_read(struct LDKu8slice ser);
25651 * Serialize the UpdateFailMalformedHTLC object into a byte array which can be read by UpdateFailMalformedHTLC_read
25653 struct LDKCVec_u8Z UpdateFailMalformedHTLC_write(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR obj);
25656 * Read a UpdateFailMalformedHTLC from a byte array, created by UpdateFailMalformedHTLC_write
25658 struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ UpdateFailMalformedHTLC_read(struct LDKu8slice ser);
25661 * Serialize the UpdateFee object into a byte array which can be read by UpdateFee_read
25663 struct LDKCVec_u8Z UpdateFee_write(const struct LDKUpdateFee *NONNULL_PTR obj);
25666 * Read a UpdateFee from a byte array, created by UpdateFee_write
25668 struct LDKCResult_UpdateFeeDecodeErrorZ UpdateFee_read(struct LDKu8slice ser);
25671 * Serialize the UpdateFulfillHTLC object into a byte array which can be read by UpdateFulfillHTLC_read
25673 struct LDKCVec_u8Z UpdateFulfillHTLC_write(const struct LDKUpdateFulfillHTLC *NONNULL_PTR obj);
25676 * Read a UpdateFulfillHTLC from a byte array, created by UpdateFulfillHTLC_write
25678 struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ UpdateFulfillHTLC_read(struct LDKu8slice ser);
25681 * Serialize the UpdateAddHTLC object into a byte array which can be read by UpdateAddHTLC_read
25683 struct LDKCVec_u8Z UpdateAddHTLC_write(const struct LDKUpdateAddHTLC *NONNULL_PTR obj);
25686 * Read a UpdateAddHTLC from a byte array, created by UpdateAddHTLC_write
25688 struct LDKCResult_UpdateAddHTLCDecodeErrorZ UpdateAddHTLC_read(struct LDKu8slice ser);
25691 * Read a OnionMessage from a byte array, created by OnionMessage_write
25693 struct LDKCResult_OnionMessageDecodeErrorZ OnionMessage_read(struct LDKu8slice ser);
25696 * Serialize the OnionMessage object into a byte array which can be read by OnionMessage_read
25698 struct LDKCVec_u8Z OnionMessage_write(const struct LDKOnionMessage *NONNULL_PTR obj);
25701 * Serialize the Ping object into a byte array which can be read by Ping_read
25703 struct LDKCVec_u8Z Ping_write(const struct LDKPing *NONNULL_PTR obj);
25706 * Read a Ping from a byte array, created by Ping_write
25708 struct LDKCResult_PingDecodeErrorZ Ping_read(struct LDKu8slice ser);
25711 * Serialize the Pong object into a byte array which can be read by Pong_read
25713 struct LDKCVec_u8Z Pong_write(const struct LDKPong *NONNULL_PTR obj);
25716 * Read a Pong from a byte array, created by Pong_write
25718 struct LDKCResult_PongDecodeErrorZ Pong_read(struct LDKu8slice ser);
25721 * Serialize the UnsignedChannelAnnouncement object into a byte array which can be read by UnsignedChannelAnnouncement_read
25723 struct LDKCVec_u8Z UnsignedChannelAnnouncement_write(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR obj);
25726 * Read a UnsignedChannelAnnouncement from a byte array, created by UnsignedChannelAnnouncement_write
25728 struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ UnsignedChannelAnnouncement_read(struct LDKu8slice ser);
25731 * Serialize the ChannelAnnouncement object into a byte array which can be read by ChannelAnnouncement_read
25733 struct LDKCVec_u8Z ChannelAnnouncement_write(const struct LDKChannelAnnouncement *NONNULL_PTR obj);
25736 * Read a ChannelAnnouncement from a byte array, created by ChannelAnnouncement_write
25738 struct LDKCResult_ChannelAnnouncementDecodeErrorZ ChannelAnnouncement_read(struct LDKu8slice ser);
25741 * Serialize the UnsignedChannelUpdate object into a byte array which can be read by UnsignedChannelUpdate_read
25743 struct LDKCVec_u8Z UnsignedChannelUpdate_write(const struct LDKUnsignedChannelUpdate *NONNULL_PTR obj);
25746 * Read a UnsignedChannelUpdate from a byte array, created by UnsignedChannelUpdate_write
25748 struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ UnsignedChannelUpdate_read(struct LDKu8slice ser);
25751 * Serialize the ChannelUpdate object into a byte array which can be read by ChannelUpdate_read
25753 struct LDKCVec_u8Z ChannelUpdate_write(const struct LDKChannelUpdate *NONNULL_PTR obj);
25756 * Read a ChannelUpdate from a byte array, created by ChannelUpdate_write
25758 struct LDKCResult_ChannelUpdateDecodeErrorZ ChannelUpdate_read(struct LDKu8slice ser);
25761 * Serialize the ErrorMessage object into a byte array which can be read by ErrorMessage_read
25763 struct LDKCVec_u8Z ErrorMessage_write(const struct LDKErrorMessage *NONNULL_PTR obj);
25766 * Read a ErrorMessage from a byte array, created by ErrorMessage_write
25768 struct LDKCResult_ErrorMessageDecodeErrorZ ErrorMessage_read(struct LDKu8slice ser);
25771 * Serialize the WarningMessage object into a byte array which can be read by WarningMessage_read
25773 struct LDKCVec_u8Z WarningMessage_write(const struct LDKWarningMessage *NONNULL_PTR obj);
25776 * Read a WarningMessage from a byte array, created by WarningMessage_write
25778 struct LDKCResult_WarningMessageDecodeErrorZ WarningMessage_read(struct LDKu8slice ser);
25781 * Serialize the UnsignedNodeAnnouncement object into a byte array which can be read by UnsignedNodeAnnouncement_read
25783 struct LDKCVec_u8Z UnsignedNodeAnnouncement_write(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR obj);
25786 * Read a UnsignedNodeAnnouncement from a byte array, created by UnsignedNodeAnnouncement_write
25788 struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ UnsignedNodeAnnouncement_read(struct LDKu8slice ser);
25791 * Serialize the NodeAnnouncement object into a byte array which can be read by NodeAnnouncement_read
25793 struct LDKCVec_u8Z NodeAnnouncement_write(const struct LDKNodeAnnouncement *NONNULL_PTR obj);
25796 * Read a NodeAnnouncement from a byte array, created by NodeAnnouncement_write
25798 struct LDKCResult_NodeAnnouncementDecodeErrorZ NodeAnnouncement_read(struct LDKu8slice ser);
25801 * Read a QueryShortChannelIds from a byte array, created by QueryShortChannelIds_write
25803 struct LDKCResult_QueryShortChannelIdsDecodeErrorZ QueryShortChannelIds_read(struct LDKu8slice ser);
25806 * Serialize the QueryShortChannelIds object into a byte array which can be read by QueryShortChannelIds_read
25808 struct LDKCVec_u8Z QueryShortChannelIds_write(const struct LDKQueryShortChannelIds *NONNULL_PTR obj);
25811 * Serialize the ReplyShortChannelIdsEnd object into a byte array which can be read by ReplyShortChannelIdsEnd_read
25813 struct LDKCVec_u8Z ReplyShortChannelIdsEnd_write(const struct LDKReplyShortChannelIdsEnd *NONNULL_PTR obj);
25816 * Read a ReplyShortChannelIdsEnd from a byte array, created by ReplyShortChannelIdsEnd_write
25818 struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ ReplyShortChannelIdsEnd_read(struct LDKu8slice ser);
25821 *\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
25823 MUST_USE_RES uint32_t QueryChannelRange_end_blocknum(const struct LDKQueryChannelRange *NONNULL_PTR this_arg);
25826 * Serialize the QueryChannelRange object into a byte array which can be read by QueryChannelRange_read
25828 struct LDKCVec_u8Z QueryChannelRange_write(const struct LDKQueryChannelRange *NONNULL_PTR obj);
25831 * Read a QueryChannelRange from a byte array, created by QueryChannelRange_write
25833 struct LDKCResult_QueryChannelRangeDecodeErrorZ QueryChannelRange_read(struct LDKu8slice ser);
25836 * Read a ReplyChannelRange from a byte array, created by ReplyChannelRange_write
25838 struct LDKCResult_ReplyChannelRangeDecodeErrorZ ReplyChannelRange_read(struct LDKu8slice ser);
25841 * Serialize the ReplyChannelRange object into a byte array which can be read by ReplyChannelRange_read
25843 struct LDKCVec_u8Z ReplyChannelRange_write(const struct LDKReplyChannelRange *NONNULL_PTR obj);
25846 * Serialize the GossipTimestampFilter object into a byte array which can be read by GossipTimestampFilter_read
25848 struct LDKCVec_u8Z GossipTimestampFilter_write(const struct LDKGossipTimestampFilter *NONNULL_PTR obj);
25851 * Read a GossipTimestampFilter from a byte array, created by GossipTimestampFilter_write
25853 struct LDKCResult_GossipTimestampFilterDecodeErrorZ GossipTimestampFilter_read(struct LDKu8slice ser);
25856 * Calls the free function if one is set
25858 void CustomMessageHandler_free(struct LDKCustomMessageHandler this_ptr);
25861 * Frees any resources used by the IgnoringMessageHandler, if is_owned is set and inner is non-NULL.
25863 void IgnoringMessageHandler_free(struct LDKIgnoringMessageHandler this_obj);
25866 * Constructs a new IgnoringMessageHandler given each field
25868 MUST_USE_RES struct LDKIgnoringMessageHandler IgnoringMessageHandler_new(void);
25871 * Constructs a new MessageSendEventsProvider which calls the relevant methods on this_arg.
25872 * This copies the `inner` pointer in this_arg and thus the returned MessageSendEventsProvider must be freed before this_arg is
25874 struct LDKMessageSendEventsProvider IgnoringMessageHandler_as_MessageSendEventsProvider(const struct LDKIgnoringMessageHandler *NONNULL_PTR this_arg);
25877 * Constructs a new RoutingMessageHandler which calls the relevant methods on this_arg.
25878 * This copies the `inner` pointer in this_arg and thus the returned RoutingMessageHandler must be freed before this_arg is
25880 struct LDKRoutingMessageHandler IgnoringMessageHandler_as_RoutingMessageHandler(const struct LDKIgnoringMessageHandler *NONNULL_PTR this_arg);
25883 * Constructs a new OnionMessageProvider which calls the relevant methods on this_arg.
25884 * This copies the `inner` pointer in this_arg and thus the returned OnionMessageProvider must be freed before this_arg is
25886 struct LDKOnionMessageProvider IgnoringMessageHandler_as_OnionMessageProvider(const struct LDKIgnoringMessageHandler *NONNULL_PTR this_arg);
25889 * Constructs a new OnionMessageHandler which calls the relevant methods on this_arg.
25890 * This copies the `inner` pointer in this_arg and thus the returned OnionMessageHandler must be freed before this_arg is
25892 struct LDKOnionMessageHandler IgnoringMessageHandler_as_OnionMessageHandler(const struct LDKIgnoringMessageHandler *NONNULL_PTR this_arg);
25895 * Constructs a new CustomOnionMessageHandler which calls the relevant methods on this_arg.
25896 * This copies the `inner` pointer in this_arg and thus the returned CustomOnionMessageHandler must be freed before this_arg is
25898 struct LDKCustomOnionMessageHandler IgnoringMessageHandler_as_CustomOnionMessageHandler(const struct LDKIgnoringMessageHandler *NONNULL_PTR this_arg);
25901 * Constructs a new CustomMessageReader which calls the relevant methods on this_arg.
25902 * This copies the `inner` pointer in this_arg and thus the returned CustomMessageReader must be freed before this_arg is
25904 struct LDKCustomMessageReader IgnoringMessageHandler_as_CustomMessageReader(const struct LDKIgnoringMessageHandler *NONNULL_PTR this_arg);
25907 * Constructs a new CustomMessageHandler which calls the relevant methods on this_arg.
25908 * This copies the `inner` pointer in this_arg and thus the returned CustomMessageHandler must be freed before this_arg is
25910 struct LDKCustomMessageHandler IgnoringMessageHandler_as_CustomMessageHandler(const struct LDKIgnoringMessageHandler *NONNULL_PTR this_arg);
25913 * Frees any resources used by the ErroringMessageHandler, if is_owned is set and inner is non-NULL.
25915 void ErroringMessageHandler_free(struct LDKErroringMessageHandler this_obj);
25918 * Constructs a new ErroringMessageHandler
25920 MUST_USE_RES struct LDKErroringMessageHandler ErroringMessageHandler_new(void);
25923 * Constructs a new MessageSendEventsProvider which calls the relevant methods on this_arg.
25924 * This copies the `inner` pointer in this_arg and thus the returned MessageSendEventsProvider must be freed before this_arg is
25926 struct LDKMessageSendEventsProvider ErroringMessageHandler_as_MessageSendEventsProvider(const struct LDKErroringMessageHandler *NONNULL_PTR this_arg);
25929 * Constructs a new ChannelMessageHandler which calls the relevant methods on this_arg.
25930 * This copies the `inner` pointer in this_arg and thus the returned ChannelMessageHandler must be freed before this_arg is
25932 struct LDKChannelMessageHandler ErroringMessageHandler_as_ChannelMessageHandler(const struct LDKErroringMessageHandler *NONNULL_PTR this_arg);
25935 * Frees any resources used by the MessageHandler, if is_owned is set and inner is non-NULL.
25937 void MessageHandler_free(struct LDKMessageHandler this_obj);
25940 * A message handler which handles messages specific to channels. Usually this is just a
25941 * [`ChannelManager`] object or an [`ErroringMessageHandler`].
25943 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
25945 const struct LDKChannelMessageHandler *MessageHandler_get_chan_handler(const struct LDKMessageHandler *NONNULL_PTR this_ptr);
25948 * A message handler which handles messages specific to channels. Usually this is just a
25949 * [`ChannelManager`] object or an [`ErroringMessageHandler`].
25951 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
25953 void MessageHandler_set_chan_handler(struct LDKMessageHandler *NONNULL_PTR this_ptr, struct LDKChannelMessageHandler val);
25956 * A message handler which handles messages updating our knowledge of the network channel
25957 * graph. Usually this is just a [`P2PGossipSync`] object or an [`IgnoringMessageHandler`].
25959 * [`P2PGossipSync`]: crate::routing::gossip::P2PGossipSync
25961 const struct LDKRoutingMessageHandler *MessageHandler_get_route_handler(const struct LDKMessageHandler *NONNULL_PTR this_ptr);
25964 * A message handler which handles messages updating our knowledge of the network channel
25965 * graph. Usually this is just a [`P2PGossipSync`] object or an [`IgnoringMessageHandler`].
25967 * [`P2PGossipSync`]: crate::routing::gossip::P2PGossipSync
25969 void MessageHandler_set_route_handler(struct LDKMessageHandler *NONNULL_PTR this_ptr, struct LDKRoutingMessageHandler val);
25972 * A message handler which handles onion messages. For now, this can only be an
25973 * [`IgnoringMessageHandler`].
25975 const struct LDKOnionMessageHandler *MessageHandler_get_onion_message_handler(const struct LDKMessageHandler *NONNULL_PTR this_ptr);
25978 * A message handler which handles onion messages. For now, this can only be an
25979 * [`IgnoringMessageHandler`].
25981 void MessageHandler_set_onion_message_handler(struct LDKMessageHandler *NONNULL_PTR this_ptr, struct LDKOnionMessageHandler val);
25984 * Constructs a new MessageHandler given each field
25986 MUST_USE_RES struct LDKMessageHandler MessageHandler_new(struct LDKChannelMessageHandler chan_handler_arg, struct LDKRoutingMessageHandler route_handler_arg, struct LDKOnionMessageHandler onion_message_handler_arg);
25989 * Creates a copy of a SocketDescriptor
25991 struct LDKSocketDescriptor SocketDescriptor_clone(const struct LDKSocketDescriptor *NONNULL_PTR orig);
25994 * Calls the free function if one is set
25996 void SocketDescriptor_free(struct LDKSocketDescriptor this_ptr);
25999 * Frees any resources used by the PeerHandleError, if is_owned is set and inner is non-NULL.
26001 void PeerHandleError_free(struct LDKPeerHandleError this_obj);
26004 * Used to indicate that we probably can't make any future connections to this peer (e.g.
26005 * because we required features that our peer was missing, or vice versa).
26007 * While LDK's [`ChannelManager`] will not do it automatically, you likely wish to force-close
26008 * any channels with this peer or check for new versions of LDK.
26010 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
26012 bool PeerHandleError_get_no_connection_possible(const struct LDKPeerHandleError *NONNULL_PTR this_ptr);
26015 * Used to indicate that we probably can't make any future connections to this peer (e.g.
26016 * because we required features that our peer was missing, or vice versa).
26018 * While LDK's [`ChannelManager`] will not do it automatically, you likely wish to force-close
26019 * any channels with this peer or check for new versions of LDK.
26021 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
26023 void PeerHandleError_set_no_connection_possible(struct LDKPeerHandleError *NONNULL_PTR this_ptr, bool val);
26026 * Constructs a new PeerHandleError given each field
26028 MUST_USE_RES struct LDKPeerHandleError PeerHandleError_new(bool no_connection_possible_arg);
26031 * Creates a copy of the PeerHandleError
26033 struct LDKPeerHandleError PeerHandleError_clone(const struct LDKPeerHandleError *NONNULL_PTR orig);
26036 * Frees any resources used by the PeerManager, if is_owned is set and inner is non-NULL.
26038 void PeerManager_free(struct LDKPeerManager this_obj);
26041 * Constructs a new PeerManager with the given message handlers and node_id secret key
26042 * ephemeral_random_data is used to derive per-connection ephemeral keys and must be
26043 * cryptographically secure random bytes.
26045 * `current_time` is used as an always-increasing counter that survives across restarts and is
26046 * incremented irregularly internally. In general it is best to simply use the current UNIX
26047 * timestamp, however if it is not available a persistent counter that increases once per
26048 * minute should suffice.
26050 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);
26053 * Get the list of node ids for peers which have completed the initial handshake.
26055 * For outbound connections, this will be the same as the their_node_id parameter passed in to
26056 * new_outbound_connection, however entries will only appear once the initial handshake has
26057 * completed and we are sure the remote peer has the private key for the given node_id.
26059 MUST_USE_RES struct LDKCVec_PublicKeyZ PeerManager_get_peer_node_ids(const struct LDKPeerManager *NONNULL_PTR this_arg);
26062 * Indicates a new outbound connection has been established to a node with the given node_id
26063 * and an optional remote network address.
26065 * The remote network address adds the option to report a remote IP address back to a connecting
26066 * peer using the init message.
26067 * The user should pass the remote network address of the host they are connected to.
26069 * If an `Err` is returned here you must disconnect the connection immediately.
26071 * Returns a small number of bytes to send to the remote node (currently always 50).
26073 * Panics if descriptor is duplicative with some other descriptor which has not yet been
26074 * [`socket_disconnected()`].
26076 * [`socket_disconnected()`]: PeerManager::socket_disconnected
26078 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);
26081 * Indicates a new inbound connection has been established to a node with an optional remote
26084 * The remote network address adds the option to report a remote IP address back to a connecting
26085 * peer using the init message.
26086 * The user should pass the remote network address of the host they are connected to.
26088 * May refuse the connection by returning an Err, but will never write bytes to the remote end
26089 * (outbound connector always speaks first). If an `Err` is returned here you must disconnect
26090 * the connection immediately.
26092 * Panics if descriptor is duplicative with some other descriptor which has not yet been
26093 * [`socket_disconnected()`].
26095 * [`socket_disconnected()`]: PeerManager::socket_disconnected
26097 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);
26100 * Indicates that there is room to write data to the given socket descriptor.
26102 * May return an Err to indicate that the connection should be closed.
26104 * May call [`send_data`] on the descriptor passed in (or an equal descriptor) before
26105 * returning. Thus, be very careful with reentrancy issues! The invariants around calling
26106 * [`write_buffer_space_avail`] in case a write did not fully complete must still hold - be
26107 * ready to call `[write_buffer_space_avail`] again if a write call generated here isn't
26110 * [`send_data`]: SocketDescriptor::send_data
26111 * [`write_buffer_space_avail`]: PeerManager::write_buffer_space_avail
26113 MUST_USE_RES struct LDKCResult_NonePeerHandleErrorZ PeerManager_write_buffer_space_avail(const struct LDKPeerManager *NONNULL_PTR this_arg, struct LDKSocketDescriptor *NONNULL_PTR descriptor);
26116 * Indicates that data was read from the given socket descriptor.
26118 * May return an Err to indicate that the connection should be closed.
26120 * Will *not* call back into [`send_data`] on any descriptors to avoid reentrancy complexity.
26121 * Thus, however, you should call [`process_events`] after any `read_event` to generate
26122 * [`send_data`] calls to handle responses.
26124 * If `Ok(true)` is returned, further read_events should not be triggered until a
26125 * [`send_data`] call on this descriptor has `resume_read` set (preventing DoS issues in the
26128 * [`send_data`]: SocketDescriptor::send_data
26129 * [`process_events`]: PeerManager::process_events
26131 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);
26134 * Checks for any events generated by our handlers and processes them. Includes sending most
26135 * response messages as well as messages generated by calls to handler functions directly (eg
26136 * functions like [`ChannelManager::process_pending_htlc_forwards`] or [`send_payment`]).
26138 * May call [`send_data`] on [`SocketDescriptor`]s. Thus, be very careful with reentrancy
26141 * You don't have to call this function explicitly if you are using [`lightning-net-tokio`]
26142 * or one of the other clients provided in our language bindings.
26144 * Note that if there are any other calls to this function waiting on lock(s) this may return
26145 * without doing any work. All available events that need handling will be handled before the
26146 * other calls return.
26148 * [`send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
26149 * [`ChannelManager::process_pending_htlc_forwards`]: crate::ln::channelmanager::ChannelManager::process_pending_htlc_forwards
26150 * [`send_data`]: SocketDescriptor::send_data
26152 void PeerManager_process_events(const struct LDKPeerManager *NONNULL_PTR this_arg);
26155 * Indicates that the given socket descriptor's connection is now closed.
26157 void PeerManager_socket_disconnected(const struct LDKPeerManager *NONNULL_PTR this_arg, const struct LDKSocketDescriptor *NONNULL_PTR descriptor);
26160 * Disconnect a peer given its node id.
26162 * Set `no_connection_possible` to true to prevent any further connection with this peer,
26163 * force-closing any channels we have with it.
26165 * If a peer is connected, this will call [`disconnect_socket`] on the descriptor for the
26166 * peer. Thus, be very careful about reentrancy issues.
26168 * [`disconnect_socket`]: SocketDescriptor::disconnect_socket
26170 void PeerManager_disconnect_by_node_id(const struct LDKPeerManager *NONNULL_PTR this_arg, struct LDKPublicKey node_id, bool no_connection_possible);
26173 * Disconnects all currently-connected peers. This is useful on platforms where there may be
26174 * an indication that TCP sockets have stalled even if we weren't around to time them out
26175 * using regular ping/pongs.
26177 void PeerManager_disconnect_all_peers(const struct LDKPeerManager *NONNULL_PTR this_arg);
26180 * Send pings to each peer and disconnect those which did not respond to the last round of
26183 * This may be called on any timescale you want, however, roughly once every ten seconds is
26184 * preferred. The call rate determines both how often we send a ping to our peers and how much
26185 * time they have to respond before we disconnect them.
26187 * May call [`send_data`] on all [`SocketDescriptor`]s. Thus, be very careful with reentrancy
26190 * [`send_data`]: SocketDescriptor::send_data
26192 void PeerManager_timer_tick_occurred(const struct LDKPeerManager *NONNULL_PTR this_arg);
26195 * Generates a signed node_announcement from the given arguments, sending it to all connected
26196 * peers. Note that peers will likely ignore this message unless we have at least one public
26197 * channel which has at least six confirmations on-chain.
26199 * `rgb` is a node \"color\" and `alias` is a printable human-readable string to describe this
26200 * node to humans. They carry no in-protocol meaning.
26202 * `addresses` represent the set (possibly empty) of socket addresses on which this node
26203 * accepts incoming connections. These will be included in the node_announcement, publicly
26204 * tying these addresses together and to this node. If you wish to preserve user privacy,
26205 * addresses should likely contain only Tor Onion addresses.
26207 * Panics if `addresses` is absurdly large (more than 100).
26209 * [`get_and_clear_pending_msg_events`]: MessageSendEventsProvider::get_and_clear_pending_msg_events
26211 void PeerManager_broadcast_node_announcement(const struct LDKPeerManager *NONNULL_PTR this_arg, struct LDKThreeBytes rgb, struct LDKThirtyTwoBytes alias, struct LDKCVec_NetAddressZ addresses);
26214 * Gets the weight for an HTLC-Success transaction.
26216 uint64_t htlc_success_tx_weight(bool opt_anchors);
26219 * Gets the weight for an HTLC-Timeout transaction.
26221 uint64_t htlc_timeout_tx_weight(bool opt_anchors);
26224 * Build the commitment secret from the seed and the commitment number
26226 struct LDKThirtyTwoBytes build_commitment_secret(const uint8_t (*commitment_seed)[32], uint64_t idx);
26229 * Build a closing transaction
26231 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);
26234 * Frees any resources used by the CounterpartyCommitmentSecrets, if is_owned is set and inner is non-NULL.
26236 void CounterpartyCommitmentSecrets_free(struct LDKCounterpartyCommitmentSecrets this_obj);
26239 * Creates a copy of the CounterpartyCommitmentSecrets
26241 struct LDKCounterpartyCommitmentSecrets CounterpartyCommitmentSecrets_clone(const struct LDKCounterpartyCommitmentSecrets *NONNULL_PTR orig);
26244 * Creates a new empty `CounterpartyCommitmentSecrets` structure.
26246 MUST_USE_RES struct LDKCounterpartyCommitmentSecrets CounterpartyCommitmentSecrets_new(void);
26249 * Returns the minimum index of all stored secrets. Note that indexes start
26250 * at 1 << 48 and get decremented by one for each new secret.
26252 MUST_USE_RES uint64_t CounterpartyCommitmentSecrets_get_min_seen_secret(const struct LDKCounterpartyCommitmentSecrets *NONNULL_PTR this_arg);
26255 * Inserts the `secret` at `idx`. Returns `Ok(())` if the secret
26256 * was generated in accordance with BOLT 3 and is consistent with previous secrets.
26258 MUST_USE_RES struct LDKCResult_NoneNoneZ CounterpartyCommitmentSecrets_provide_secret(struct LDKCounterpartyCommitmentSecrets *NONNULL_PTR this_arg, uint64_t idx, struct LDKThirtyTwoBytes secret);
26261 * Returns the secret at `idx`.
26262 * Returns `None` if `idx` is < [`CounterpartyCommitmentSecrets::get_min_seen_secret`].
26264 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
26266 MUST_USE_RES struct LDKThirtyTwoBytes CounterpartyCommitmentSecrets_get_secret(const struct LDKCounterpartyCommitmentSecrets *NONNULL_PTR this_arg, uint64_t idx);
26269 * Serialize the CounterpartyCommitmentSecrets object into a byte array which can be read by CounterpartyCommitmentSecrets_read
26271 struct LDKCVec_u8Z CounterpartyCommitmentSecrets_write(const struct LDKCounterpartyCommitmentSecrets *NONNULL_PTR obj);
26274 * Read a CounterpartyCommitmentSecrets from a byte array, created by CounterpartyCommitmentSecrets_write
26276 struct LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ CounterpartyCommitmentSecrets_read(struct LDKu8slice ser);
26279 * Derives a per-commitment-transaction private key (eg an htlc key or delayed_payment key)
26280 * from the base secret and the per_commitment_point.
26282 * Note that this is infallible iff we trust that at least one of the two input keys are randomly
26283 * generated (ie our own).
26285 struct LDKCResult_SecretKeyErrorZ derive_private_key(struct LDKPublicKey per_commitment_point, const uint8_t (*base_secret)[32]);
26288 * Derives a per-commitment-transaction public key (eg an htlc key or a delayed_payment key)
26289 * from the base point and the per_commitment_key. This is the public equivalent of
26290 * derive_private_key - using only public keys to derive a public key instead of private keys.
26292 * Note that this is infallible iff we trust that at least one of the two input keys are randomly
26293 * generated (ie our own).
26295 struct LDKCResult_PublicKeyErrorZ derive_public_key(struct LDKPublicKey per_commitment_point, struct LDKPublicKey base_point);
26298 * Derives a per-commitment-transaction revocation key from its constituent parts.
26300 * Only the cheating participant owns a valid witness to propagate a revoked
26301 * commitment transaction, thus per_commitment_secret always come from cheater
26302 * and revocation_base_secret always come from punisher, which is the broadcaster
26303 * of the transaction spending with this key knowledge.
26305 * Note that this is infallible iff we trust that at least one of the two input keys are randomly
26306 * generated (ie our own).
26308 struct LDKCResult_SecretKeyErrorZ derive_private_revocation_key(const uint8_t (*per_commitment_secret)[32], const uint8_t (*countersignatory_revocation_base_secret)[32]);
26311 * Derives a per-commitment-transaction revocation public key from its constituent parts. This is
26312 * the public equivalend of derive_private_revocation_key - using only public keys to derive a
26313 * public key instead of private keys.
26315 * Only the cheating participant owns a valid witness to propagate a revoked
26316 * commitment transaction, thus per_commitment_point always come from cheater
26317 * and revocation_base_point always come from punisher, which is the broadcaster
26318 * of the transaction spending with this key knowledge.
26320 * Note that this is infallible iff we trust that at least one of the two input keys are randomly
26321 * generated (ie our own).
26323 struct LDKCResult_PublicKeyErrorZ derive_public_revocation_key(struct LDKPublicKey per_commitment_point, struct LDKPublicKey countersignatory_revocation_base_point);
26326 * Frees any resources used by the TxCreationKeys, if is_owned is set and inner is non-NULL.
26328 void TxCreationKeys_free(struct LDKTxCreationKeys this_obj);
26331 * The broadcaster's per-commitment public key which was used to derive the other keys.
26333 struct LDKPublicKey TxCreationKeys_get_per_commitment_point(const struct LDKTxCreationKeys *NONNULL_PTR this_ptr);
26336 * The broadcaster's per-commitment public key which was used to derive the other keys.
26338 void TxCreationKeys_set_per_commitment_point(struct LDKTxCreationKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
26341 * The revocation key which is used to allow the broadcaster of the commitment
26342 * transaction to provide their counterparty the ability to punish them if they broadcast
26345 struct LDKPublicKey TxCreationKeys_get_revocation_key(const struct LDKTxCreationKeys *NONNULL_PTR this_ptr);
26348 * The revocation key which is used to allow the broadcaster of the commitment
26349 * transaction to provide their counterparty the ability to punish them if they broadcast
26352 void TxCreationKeys_set_revocation_key(struct LDKTxCreationKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
26355 * Broadcaster's HTLC Key
26357 struct LDKPublicKey TxCreationKeys_get_broadcaster_htlc_key(const struct LDKTxCreationKeys *NONNULL_PTR this_ptr);
26360 * Broadcaster's HTLC Key
26362 void TxCreationKeys_set_broadcaster_htlc_key(struct LDKTxCreationKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
26365 * Countersignatory's HTLC Key
26367 struct LDKPublicKey TxCreationKeys_get_countersignatory_htlc_key(const struct LDKTxCreationKeys *NONNULL_PTR this_ptr);
26370 * Countersignatory's HTLC Key
26372 void TxCreationKeys_set_countersignatory_htlc_key(struct LDKTxCreationKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
26375 * Broadcaster's Payment Key (which isn't allowed to be spent from for some delay)
26377 struct LDKPublicKey TxCreationKeys_get_broadcaster_delayed_payment_key(const struct LDKTxCreationKeys *NONNULL_PTR this_ptr);
26380 * Broadcaster's Payment Key (which isn't allowed to be spent from for some delay)
26382 void TxCreationKeys_set_broadcaster_delayed_payment_key(struct LDKTxCreationKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
26385 * Constructs a new TxCreationKeys given each field
26387 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);
26390 * Checks if two TxCreationKeyss contain equal inner contents.
26391 * This ignores pointers and is_owned flags and looks at the values in fields.
26392 * Two objects with NULL inner values will be considered "equal" here.
26394 bool TxCreationKeys_eq(const struct LDKTxCreationKeys *NONNULL_PTR a, const struct LDKTxCreationKeys *NONNULL_PTR b);
26397 * Creates a copy of the TxCreationKeys
26399 struct LDKTxCreationKeys TxCreationKeys_clone(const struct LDKTxCreationKeys *NONNULL_PTR orig);
26402 * Serialize the TxCreationKeys object into a byte array which can be read by TxCreationKeys_read
26404 struct LDKCVec_u8Z TxCreationKeys_write(const struct LDKTxCreationKeys *NONNULL_PTR obj);
26407 * Read a TxCreationKeys from a byte array, created by TxCreationKeys_write
26409 struct LDKCResult_TxCreationKeysDecodeErrorZ TxCreationKeys_read(struct LDKu8slice ser);
26412 * Frees any resources used by the ChannelPublicKeys, if is_owned is set and inner is non-NULL.
26414 void ChannelPublicKeys_free(struct LDKChannelPublicKeys this_obj);
26417 * The public key which is used to sign all commitment transactions, as it appears in the
26418 * on-chain channel lock-in 2-of-2 multisig output.
26420 struct LDKPublicKey ChannelPublicKeys_get_funding_pubkey(const struct LDKChannelPublicKeys *NONNULL_PTR this_ptr);
26423 * The public key which is used to sign all commitment transactions, as it appears in the
26424 * on-chain channel lock-in 2-of-2 multisig output.
26426 void ChannelPublicKeys_set_funding_pubkey(struct LDKChannelPublicKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
26429 * The base point which is used (with derive_public_revocation_key) to derive per-commitment
26430 * revocation keys. This is combined with the per-commitment-secret generated by the
26431 * counterparty to create a secret which the counterparty can reveal to revoke previous
26434 struct LDKPublicKey ChannelPublicKeys_get_revocation_basepoint(const struct LDKChannelPublicKeys *NONNULL_PTR this_ptr);
26437 * The base point which is used (with derive_public_revocation_key) to derive per-commitment
26438 * revocation keys. This is combined with the per-commitment-secret generated by the
26439 * counterparty to create a secret which the counterparty can reveal to revoke previous
26442 void ChannelPublicKeys_set_revocation_basepoint(struct LDKChannelPublicKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
26445 * The public key on which the non-broadcaster (ie the countersignatory) receives an immediately
26446 * spendable primary channel balance on the broadcaster's commitment transaction. This key is
26447 * static across every commitment transaction.
26449 struct LDKPublicKey ChannelPublicKeys_get_payment_point(const struct LDKChannelPublicKeys *NONNULL_PTR this_ptr);
26452 * The public key on which the non-broadcaster (ie the countersignatory) receives an immediately
26453 * spendable primary channel balance on the broadcaster's commitment transaction. This key is
26454 * static across every commitment transaction.
26456 void ChannelPublicKeys_set_payment_point(struct LDKChannelPublicKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
26459 * The base point which is used (with derive_public_key) to derive a per-commitment payment
26460 * public key which receives non-HTLC-encumbered funds which are only available for spending
26461 * after some delay (or can be claimed via the revocation path).
26463 struct LDKPublicKey ChannelPublicKeys_get_delayed_payment_basepoint(const struct LDKChannelPublicKeys *NONNULL_PTR this_ptr);
26466 * The base point which is used (with derive_public_key) to derive a per-commitment payment
26467 * public key which receives non-HTLC-encumbered funds which are only available for spending
26468 * after some delay (or can be claimed via the revocation path).
26470 void ChannelPublicKeys_set_delayed_payment_basepoint(struct LDKChannelPublicKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
26473 * The base point which is used (with derive_public_key) to derive a per-commitment public key
26474 * which is used to encumber HTLC-in-flight outputs.
26476 struct LDKPublicKey ChannelPublicKeys_get_htlc_basepoint(const struct LDKChannelPublicKeys *NONNULL_PTR this_ptr);
26479 * The base point which is used (with derive_public_key) to derive a per-commitment public key
26480 * which is used to encumber HTLC-in-flight outputs.
26482 void ChannelPublicKeys_set_htlc_basepoint(struct LDKChannelPublicKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
26485 * Constructs a new ChannelPublicKeys given each field
26487 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);
26490 * Creates a copy of the ChannelPublicKeys
26492 struct LDKChannelPublicKeys ChannelPublicKeys_clone(const struct LDKChannelPublicKeys *NONNULL_PTR orig);
26495 * Checks if two ChannelPublicKeyss contain equal inner contents.
26496 * This ignores pointers and is_owned flags and looks at the values in fields.
26497 * Two objects with NULL inner values will be considered "equal" here.
26499 bool ChannelPublicKeys_eq(const struct LDKChannelPublicKeys *NONNULL_PTR a, const struct LDKChannelPublicKeys *NONNULL_PTR b);
26502 * Serialize the ChannelPublicKeys object into a byte array which can be read by ChannelPublicKeys_read
26504 struct LDKCVec_u8Z ChannelPublicKeys_write(const struct LDKChannelPublicKeys *NONNULL_PTR obj);
26507 * Read a ChannelPublicKeys from a byte array, created by ChannelPublicKeys_write
26509 struct LDKCResult_ChannelPublicKeysDecodeErrorZ ChannelPublicKeys_read(struct LDKu8slice ser);
26512 * Create per-state keys from channel base points and the per-commitment point.
26513 * Key set is asymmetric and can't be used as part of counter-signatory set of transactions.
26515 MUST_USE_RES struct LDKCResult_TxCreationKeysErrorZ 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);
26518 * Generate per-state keys from channel static keys.
26519 * Key set is asymmetric and can't be used as part of counter-signatory set of transactions.
26521 MUST_USE_RES struct LDKCResult_TxCreationKeysErrorZ TxCreationKeys_from_channel_static_keys(struct LDKPublicKey per_commitment_point, const struct LDKChannelPublicKeys *NONNULL_PTR broadcaster_keys, const struct LDKChannelPublicKeys *NONNULL_PTR countersignatory_keys);
26524 * A script either spendable by the revocation
26525 * key or the broadcaster_delayed_payment_key and satisfying the relative-locktime OP_CSV constrain.
26526 * Encumbering a `to_holder` output on a commitment transaction or 2nd-stage HTLC transactions.
26528 struct LDKCVec_u8Z get_revokeable_redeemscript(struct LDKPublicKey revocation_key, uint16_t contest_delay, struct LDKPublicKey broadcaster_delayed_payment_key);
26531 * Frees any resources used by the HTLCOutputInCommitment, if is_owned is set and inner is non-NULL.
26533 void HTLCOutputInCommitment_free(struct LDKHTLCOutputInCommitment this_obj);
26536 * Whether the HTLC was \"offered\" (ie outbound in relation to this commitment transaction).
26537 * Note that this is not the same as whether it is ountbound *from us*. To determine that you
26538 * need to compare this value to whether the commitment transaction in question is that of
26539 * the counterparty or our own.
26541 bool HTLCOutputInCommitment_get_offered(const struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr);
26544 * Whether the HTLC was \"offered\" (ie outbound in relation to this commitment transaction).
26545 * Note that this is not the same as whether it is ountbound *from us*. To determine that you
26546 * need to compare this value to whether the commitment transaction in question is that of
26547 * the counterparty or our own.
26549 void HTLCOutputInCommitment_set_offered(struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr, bool val);
26552 * The value, in msat, of the HTLC. The value as it appears in the commitment transaction is
26553 * this divided by 1000.
26555 uint64_t HTLCOutputInCommitment_get_amount_msat(const struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr);
26558 * The value, in msat, of the HTLC. The value as it appears in the commitment transaction is
26559 * this divided by 1000.
26561 void HTLCOutputInCommitment_set_amount_msat(struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr, uint64_t val);
26564 * The CLTV lock-time at which this HTLC expires.
26566 uint32_t HTLCOutputInCommitment_get_cltv_expiry(const struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr);
26569 * The CLTV lock-time at which this HTLC expires.
26571 void HTLCOutputInCommitment_set_cltv_expiry(struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr, uint32_t val);
26574 * The hash of the preimage which unlocks this HTLC.
26576 const uint8_t (*HTLCOutputInCommitment_get_payment_hash(const struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr))[32];
26579 * The hash of the preimage which unlocks this HTLC.
26581 void HTLCOutputInCommitment_set_payment_hash(struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
26584 * The position within the commitment transactions' outputs. This may be None if the value is
26585 * below the dust limit (in which case no output appears in the commitment transaction and the
26586 * value is spent to additional transaction fees).
26588 struct LDKCOption_u32Z HTLCOutputInCommitment_get_transaction_output_index(const struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr);
26591 * The position within the commitment transactions' outputs. This may be None if the value is
26592 * below the dust limit (in which case no output appears in the commitment transaction and the
26593 * value is spent to additional transaction fees).
26595 void HTLCOutputInCommitment_set_transaction_output_index(struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr, struct LDKCOption_u32Z val);
26598 * Constructs a new HTLCOutputInCommitment given each field
26600 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);
26603 * Creates a copy of the HTLCOutputInCommitment
26605 struct LDKHTLCOutputInCommitment HTLCOutputInCommitment_clone(const struct LDKHTLCOutputInCommitment *NONNULL_PTR orig);
26608 * Checks if two HTLCOutputInCommitments contain equal inner contents.
26609 * This ignores pointers and is_owned flags and looks at the values in fields.
26610 * Two objects with NULL inner values will be considered "equal" here.
26612 bool HTLCOutputInCommitment_eq(const struct LDKHTLCOutputInCommitment *NONNULL_PTR a, const struct LDKHTLCOutputInCommitment *NONNULL_PTR b);
26615 * Serialize the HTLCOutputInCommitment object into a byte array which can be read by HTLCOutputInCommitment_read
26617 struct LDKCVec_u8Z HTLCOutputInCommitment_write(const struct LDKHTLCOutputInCommitment *NONNULL_PTR obj);
26620 * Read a HTLCOutputInCommitment from a byte array, created by HTLCOutputInCommitment_write
26622 struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ HTLCOutputInCommitment_read(struct LDKu8slice ser);
26625 * Gets the witness redeemscript for an HTLC output in a commitment transaction. Note that htlc
26626 * does not need to have its previous_output_index filled.
26628 struct LDKCVec_u8Z get_htlc_redeemscript(const struct LDKHTLCOutputInCommitment *NONNULL_PTR htlc, bool opt_anchors, const struct LDKTxCreationKeys *NONNULL_PTR keys);
26631 * Gets the redeemscript for a funding output from the two funding public keys.
26632 * Note that the order of funding public keys does not matter.
26634 struct LDKCVec_u8Z make_funding_redeemscript(struct LDKPublicKey broadcaster, struct LDKPublicKey countersignatory);
26637 * Builds an unsigned HTLC-Success or HTLC-Timeout transaction from the given channel and HTLC
26638 * parameters. This is used by [`TrustedCommitmentTransaction::get_htlc_sigs`] to fetch the
26639 * transaction which needs signing, and can be used to construct an HTLC transaction which is
26640 * broadcastable given a counterparty HTLC signature.
26642 * Panics if htlc.transaction_output_index.is_none() (as such HTLCs do not appear in the
26643 * commitment transaction).
26645 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, struct LDKPublicKey broadcaster_delayed_payment_key, struct LDKPublicKey revocation_key);
26648 * Gets the witnessScript for an anchor output from the funding public key.
26649 * The witness in the spending input must be:
26650 * <BIP 143 funding_signature>
26651 * After 16 blocks of confirmation, an alternative satisfying witness could be:
26653 * (empty vector required to satisfy compliance with MINIMALIF-standard rule)
26655 struct LDKCVec_u8Z get_anchor_redeemscript(struct LDKPublicKey funding_pubkey);
26658 * Frees any resources used by the ChannelTransactionParameters, if is_owned is set and inner is non-NULL.
26660 void ChannelTransactionParameters_free(struct LDKChannelTransactionParameters this_obj);
26663 * Holder public keys
26665 struct LDKChannelPublicKeys ChannelTransactionParameters_get_holder_pubkeys(const struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr);
26668 * Holder public keys
26670 void ChannelTransactionParameters_set_holder_pubkeys(struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr, struct LDKChannelPublicKeys val);
26673 * The contest delay selected by the holder, which applies to counterparty-broadcast transactions
26675 uint16_t ChannelTransactionParameters_get_holder_selected_contest_delay(const struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr);
26678 * The contest delay selected by the holder, which applies to counterparty-broadcast transactions
26680 void ChannelTransactionParameters_set_holder_selected_contest_delay(struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr, uint16_t val);
26683 * Whether the holder is the initiator of this channel.
26684 * This is an input to the commitment number obscure factor computation.
26686 bool ChannelTransactionParameters_get_is_outbound_from_holder(const struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr);
26689 * Whether the holder is the initiator of this channel.
26690 * This is an input to the commitment number obscure factor computation.
26692 void ChannelTransactionParameters_set_is_outbound_from_holder(struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr, bool val);
26695 * The late-bound counterparty channel transaction parameters.
26696 * These parameters are populated at the point in the protocol where the counterparty provides them.
26698 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
26700 struct LDKCounterpartyChannelTransactionParameters ChannelTransactionParameters_get_counterparty_parameters(const struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr);
26703 * The late-bound counterparty channel transaction parameters.
26704 * These parameters are populated at the point in the protocol where the counterparty provides them.
26706 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
26708 void ChannelTransactionParameters_set_counterparty_parameters(struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr, struct LDKCounterpartyChannelTransactionParameters val);
26711 * The late-bound funding outpoint
26713 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
26715 struct LDKOutPoint ChannelTransactionParameters_get_funding_outpoint(const struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr);
26718 * The late-bound funding outpoint
26720 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
26722 void ChannelTransactionParameters_set_funding_outpoint(struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr, struct LDKOutPoint val);
26725 * Are anchors (zero fee HTLC transaction variant) used for this channel. Boolean is
26726 * serialization backwards-compatible.
26728 enum LDKCOption_NoneZ ChannelTransactionParameters_get_opt_anchors(const struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr);
26731 * Are anchors (zero fee HTLC transaction variant) used for this channel. Boolean is
26732 * serialization backwards-compatible.
26734 void ChannelTransactionParameters_set_opt_anchors(struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr, enum LDKCOption_NoneZ val);
26737 * Constructs a new ChannelTransactionParameters given each field
26739 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);
26742 * Creates a copy of the ChannelTransactionParameters
26744 struct LDKChannelTransactionParameters ChannelTransactionParameters_clone(const struct LDKChannelTransactionParameters *NONNULL_PTR orig);
26747 * Frees any resources used by the CounterpartyChannelTransactionParameters, if is_owned is set and inner is non-NULL.
26749 void CounterpartyChannelTransactionParameters_free(struct LDKCounterpartyChannelTransactionParameters this_obj);
26752 * Counter-party public keys
26754 struct LDKChannelPublicKeys CounterpartyChannelTransactionParameters_get_pubkeys(const struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR this_ptr);
26757 * Counter-party public keys
26759 void CounterpartyChannelTransactionParameters_set_pubkeys(struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR this_ptr, struct LDKChannelPublicKeys val);
26762 * The contest delay selected by the counterparty, which applies to holder-broadcast transactions
26764 uint16_t CounterpartyChannelTransactionParameters_get_selected_contest_delay(const struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR this_ptr);
26767 * The contest delay selected by the counterparty, which applies to holder-broadcast transactions
26769 void CounterpartyChannelTransactionParameters_set_selected_contest_delay(struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR this_ptr, uint16_t val);
26772 * Constructs a new CounterpartyChannelTransactionParameters given each field
26774 MUST_USE_RES struct LDKCounterpartyChannelTransactionParameters CounterpartyChannelTransactionParameters_new(struct LDKChannelPublicKeys pubkeys_arg, uint16_t selected_contest_delay_arg);
26777 * Creates a copy of the CounterpartyChannelTransactionParameters
26779 struct LDKCounterpartyChannelTransactionParameters CounterpartyChannelTransactionParameters_clone(const struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR orig);
26782 * Whether the late bound parameters are populated.
26784 MUST_USE_RES bool ChannelTransactionParameters_is_populated(const struct LDKChannelTransactionParameters *NONNULL_PTR this_arg);
26787 * Convert the holder/counterparty parameters to broadcaster/countersignatory-organized parameters,
26788 * given that the holder is the broadcaster.
26790 * self.is_populated() must be true before calling this function.
26792 MUST_USE_RES struct LDKDirectedChannelTransactionParameters ChannelTransactionParameters_as_holder_broadcastable(const struct LDKChannelTransactionParameters *NONNULL_PTR this_arg);
26795 * Convert the holder/counterparty parameters to broadcaster/countersignatory-organized parameters,
26796 * given that the counterparty is the broadcaster.
26798 * self.is_populated() must be true before calling this function.
26800 MUST_USE_RES struct LDKDirectedChannelTransactionParameters ChannelTransactionParameters_as_counterparty_broadcastable(const struct LDKChannelTransactionParameters *NONNULL_PTR this_arg);
26803 * Serialize the CounterpartyChannelTransactionParameters object into a byte array which can be read by CounterpartyChannelTransactionParameters_read
26805 struct LDKCVec_u8Z CounterpartyChannelTransactionParameters_write(const struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR obj);
26808 * Read a CounterpartyChannelTransactionParameters from a byte array, created by CounterpartyChannelTransactionParameters_write
26810 struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ CounterpartyChannelTransactionParameters_read(struct LDKu8slice ser);
26813 * Serialize the ChannelTransactionParameters object into a byte array which can be read by ChannelTransactionParameters_read
26815 struct LDKCVec_u8Z ChannelTransactionParameters_write(const struct LDKChannelTransactionParameters *NONNULL_PTR obj);
26818 * Read a ChannelTransactionParameters from a byte array, created by ChannelTransactionParameters_write
26820 struct LDKCResult_ChannelTransactionParametersDecodeErrorZ ChannelTransactionParameters_read(struct LDKu8slice ser);
26823 * Frees any resources used by the DirectedChannelTransactionParameters, if is_owned is set and inner is non-NULL.
26825 void DirectedChannelTransactionParameters_free(struct LDKDirectedChannelTransactionParameters this_obj);
26828 * Get the channel pubkeys for the broadcaster
26830 MUST_USE_RES struct LDKChannelPublicKeys DirectedChannelTransactionParameters_broadcaster_pubkeys(const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR this_arg);
26833 * Get the channel pubkeys for the countersignatory
26835 MUST_USE_RES struct LDKChannelPublicKeys DirectedChannelTransactionParameters_countersignatory_pubkeys(const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR this_arg);
26838 * Get the contest delay applicable to the transactions.
26839 * Note that the contest delay was selected by the countersignatory.
26841 MUST_USE_RES uint16_t DirectedChannelTransactionParameters_contest_delay(const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR this_arg);
26844 * Whether the channel is outbound from the broadcaster.
26846 * The boolean representing the side that initiated the channel is
26847 * an input to the commitment number obscure factor computation.
26849 MUST_USE_RES bool DirectedChannelTransactionParameters_is_outbound(const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR this_arg);
26852 * The funding outpoint
26854 MUST_USE_RES struct LDKOutPoint DirectedChannelTransactionParameters_funding_outpoint(const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR this_arg);
26857 * Whether to use anchors for this channel
26859 MUST_USE_RES bool DirectedChannelTransactionParameters_opt_anchors(const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR this_arg);
26862 * Frees any resources used by the HolderCommitmentTransaction, if is_owned is set and inner is non-NULL.
26864 void HolderCommitmentTransaction_free(struct LDKHolderCommitmentTransaction this_obj);
26867 * Our counterparty's signature for the transaction
26869 struct LDKSignature HolderCommitmentTransaction_get_counterparty_sig(const struct LDKHolderCommitmentTransaction *NONNULL_PTR this_ptr);
26872 * Our counterparty's signature for the transaction
26874 void HolderCommitmentTransaction_set_counterparty_sig(struct LDKHolderCommitmentTransaction *NONNULL_PTR this_ptr, struct LDKSignature val);
26877 * All non-dust counterparty HTLC signatures, in the order they appear in the transaction
26879 * Returns a copy of the field.
26881 struct LDKCVec_SignatureZ HolderCommitmentTransaction_get_counterparty_htlc_sigs(const struct LDKHolderCommitmentTransaction *NONNULL_PTR this_ptr);
26884 * All non-dust counterparty HTLC signatures, in the order they appear in the transaction
26886 void HolderCommitmentTransaction_set_counterparty_htlc_sigs(struct LDKHolderCommitmentTransaction *NONNULL_PTR this_ptr, struct LDKCVec_SignatureZ val);
26889 * Creates a copy of the HolderCommitmentTransaction
26891 struct LDKHolderCommitmentTransaction HolderCommitmentTransaction_clone(const struct LDKHolderCommitmentTransaction *NONNULL_PTR orig);
26894 * Serialize the HolderCommitmentTransaction object into a byte array which can be read by HolderCommitmentTransaction_read
26896 struct LDKCVec_u8Z HolderCommitmentTransaction_write(const struct LDKHolderCommitmentTransaction *NONNULL_PTR obj);
26899 * Read a HolderCommitmentTransaction from a byte array, created by HolderCommitmentTransaction_write
26901 struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ HolderCommitmentTransaction_read(struct LDKu8slice ser);
26904 * Create a new holder transaction with the given counterparty signatures.
26905 * The funding keys are used to figure out which signature should go first when building the transaction for broadcast.
26907 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);
26910 * Frees any resources used by the BuiltCommitmentTransaction, if is_owned is set and inner is non-NULL.
26912 void BuiltCommitmentTransaction_free(struct LDKBuiltCommitmentTransaction this_obj);
26915 * The commitment transaction
26917 struct LDKTransaction BuiltCommitmentTransaction_get_transaction(const struct LDKBuiltCommitmentTransaction *NONNULL_PTR this_ptr);
26920 * The commitment transaction
26922 void BuiltCommitmentTransaction_set_transaction(struct LDKBuiltCommitmentTransaction *NONNULL_PTR this_ptr, struct LDKTransaction val);
26925 * The txid for the commitment transaction.
26927 * This is provided as a performance optimization, instead of calling transaction.txid()
26930 const uint8_t (*BuiltCommitmentTransaction_get_txid(const struct LDKBuiltCommitmentTransaction *NONNULL_PTR this_ptr))[32];
26933 * The txid for the commitment transaction.
26935 * This is provided as a performance optimization, instead of calling transaction.txid()
26938 void BuiltCommitmentTransaction_set_txid(struct LDKBuiltCommitmentTransaction *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
26941 * Constructs a new BuiltCommitmentTransaction given each field
26943 MUST_USE_RES struct LDKBuiltCommitmentTransaction BuiltCommitmentTransaction_new(struct LDKTransaction transaction_arg, struct LDKThirtyTwoBytes txid_arg);
26946 * Creates a copy of the BuiltCommitmentTransaction
26948 struct LDKBuiltCommitmentTransaction BuiltCommitmentTransaction_clone(const struct LDKBuiltCommitmentTransaction *NONNULL_PTR orig);
26951 * Serialize the BuiltCommitmentTransaction object into a byte array which can be read by BuiltCommitmentTransaction_read
26953 struct LDKCVec_u8Z BuiltCommitmentTransaction_write(const struct LDKBuiltCommitmentTransaction *NONNULL_PTR obj);
26956 * Read a BuiltCommitmentTransaction from a byte array, created by BuiltCommitmentTransaction_write
26958 struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ BuiltCommitmentTransaction_read(struct LDKu8slice ser);
26961 * Get the SIGHASH_ALL sighash value of the transaction.
26963 * This can be used to verify a signature.
26965 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);
26968 * Sign a transaction, either because we are counter-signing the counterparty's transaction or
26969 * because we are about to broadcast a holder transaction.
26971 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);
26974 * Frees any resources used by the ClosingTransaction, if is_owned is set and inner is non-NULL.
26976 void ClosingTransaction_free(struct LDKClosingTransaction this_obj);
26979 * Creates a copy of the ClosingTransaction
26981 struct LDKClosingTransaction ClosingTransaction_clone(const struct LDKClosingTransaction *NONNULL_PTR orig);
26984 * Checks if two ClosingTransactions contain equal inner contents.
26986 uint64_t ClosingTransaction_hash(const struct LDKClosingTransaction *NONNULL_PTR o);
26989 * Checks if two ClosingTransactions contain equal inner contents.
26990 * This ignores pointers and is_owned flags and looks at the values in fields.
26991 * Two objects with NULL inner values will be considered "equal" here.
26993 bool ClosingTransaction_eq(const struct LDKClosingTransaction *NONNULL_PTR a, const struct LDKClosingTransaction *NONNULL_PTR b);
26996 * Construct an object of the class
26998 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);
27001 * Trust our pre-built transaction.
27003 * Applies a wrapper which allows access to the transaction.
27005 * This should only be used if you fully trust the builder of this object. It should not
27006 * be used by an external signer - instead use the verify function.
27008 MUST_USE_RES struct LDKTrustedClosingTransaction ClosingTransaction_trust(const struct LDKClosingTransaction *NONNULL_PTR this_arg);
27011 * Verify our pre-built transaction.
27013 * Applies a wrapper which allows access to the transaction.
27015 * An external validating signer must call this method before signing
27016 * or using the built transaction.
27018 MUST_USE_RES struct LDKCResult_TrustedClosingTransactionNoneZ ClosingTransaction_verify(const struct LDKClosingTransaction *NONNULL_PTR this_arg, struct LDKOutPoint funding_outpoint);
27021 * The value to be sent to the holder, or zero if the output will be omitted
27023 MUST_USE_RES uint64_t ClosingTransaction_to_holder_value_sat(const struct LDKClosingTransaction *NONNULL_PTR this_arg);
27026 * The value to be sent to the counterparty, or zero if the output will be omitted
27028 MUST_USE_RES uint64_t ClosingTransaction_to_counterparty_value_sat(const struct LDKClosingTransaction *NONNULL_PTR this_arg);
27031 * The destination of the holder's output
27033 MUST_USE_RES struct LDKu8slice ClosingTransaction_to_holder_script(const struct LDKClosingTransaction *NONNULL_PTR this_arg);
27036 * The destination of the counterparty's output
27038 MUST_USE_RES struct LDKu8slice ClosingTransaction_to_counterparty_script(const struct LDKClosingTransaction *NONNULL_PTR this_arg);
27041 * Frees any resources used by the TrustedClosingTransaction, if is_owned is set and inner is non-NULL.
27043 void TrustedClosingTransaction_free(struct LDKTrustedClosingTransaction this_obj);
27046 * The pre-built Bitcoin commitment transaction
27048 MUST_USE_RES struct LDKTransaction TrustedClosingTransaction_built_transaction(const struct LDKTrustedClosingTransaction *NONNULL_PTR this_arg);
27051 * Get the SIGHASH_ALL sighash value of the transaction.
27053 * This can be used to verify a signature.
27055 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);
27058 * Sign a transaction, either because we are counter-signing the counterparty's transaction or
27059 * because we are about to broadcast a holder transaction.
27061 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);
27064 * Frees any resources used by the CommitmentTransaction, if is_owned is set and inner is non-NULL.
27066 void CommitmentTransaction_free(struct LDKCommitmentTransaction this_obj);
27069 * Creates a copy of the CommitmentTransaction
27071 struct LDKCommitmentTransaction CommitmentTransaction_clone(const struct LDKCommitmentTransaction *NONNULL_PTR orig);
27074 * Serialize the CommitmentTransaction object into a byte array which can be read by CommitmentTransaction_read
27076 struct LDKCVec_u8Z CommitmentTransaction_write(const struct LDKCommitmentTransaction *NONNULL_PTR obj);
27079 * Read a CommitmentTransaction from a byte array, created by CommitmentTransaction_write
27081 struct LDKCResult_CommitmentTransactionDecodeErrorZ CommitmentTransaction_read(struct LDKu8slice ser);
27084 * The backwards-counting commitment number
27086 MUST_USE_RES uint64_t CommitmentTransaction_commitment_number(const struct LDKCommitmentTransaction *NONNULL_PTR this_arg);
27089 * The value to be sent to the broadcaster
27091 MUST_USE_RES uint64_t CommitmentTransaction_to_broadcaster_value_sat(const struct LDKCommitmentTransaction *NONNULL_PTR this_arg);
27094 * The value to be sent to the counterparty
27096 MUST_USE_RES uint64_t CommitmentTransaction_to_countersignatory_value_sat(const struct LDKCommitmentTransaction *NONNULL_PTR this_arg);
27099 * The feerate paid per 1000-weight-unit in this commitment transaction.
27101 MUST_USE_RES uint32_t CommitmentTransaction_feerate_per_kw(const struct LDKCommitmentTransaction *NONNULL_PTR this_arg);
27104 * Trust our pre-built transaction and derived transaction creation public keys.
27106 * Applies a wrapper which allows access to these fields.
27108 * This should only be used if you fully trust the builder of this object. It should not
27109 * be used by an external signer - instead use the verify function.
27111 MUST_USE_RES struct LDKTrustedCommitmentTransaction CommitmentTransaction_trust(const struct LDKCommitmentTransaction *NONNULL_PTR this_arg);
27114 * Verify our pre-built transaction and derived transaction creation public keys.
27116 * Applies a wrapper which allows access to these fields.
27118 * An external validating signer must call this method before signing
27119 * or using the built transaction.
27121 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);
27124 * Frees any resources used by the TrustedCommitmentTransaction, if is_owned is set and inner is non-NULL.
27126 void TrustedCommitmentTransaction_free(struct LDKTrustedCommitmentTransaction this_obj);
27129 * The transaction ID of the built Bitcoin transaction
27131 MUST_USE_RES struct LDKThirtyTwoBytes TrustedCommitmentTransaction_txid(const struct LDKTrustedCommitmentTransaction *NONNULL_PTR this_arg);
27134 * The pre-built Bitcoin commitment transaction
27136 MUST_USE_RES struct LDKBuiltCommitmentTransaction TrustedCommitmentTransaction_built_transaction(const struct LDKTrustedCommitmentTransaction *NONNULL_PTR this_arg);
27139 * The pre-calculated transaction creation public keys.
27141 MUST_USE_RES struct LDKTxCreationKeys TrustedCommitmentTransaction_keys(const struct LDKTrustedCommitmentTransaction *NONNULL_PTR this_arg);
27144 * Should anchors be used.
27146 MUST_USE_RES bool TrustedCommitmentTransaction_opt_anchors(const struct LDKTrustedCommitmentTransaction *NONNULL_PTR this_arg);
27149 * Get a signature for each HTLC which was included in the commitment transaction (ie for
27150 * which HTLCOutputInCommitment::transaction_output_index.is_some()).
27152 * The returned Vec has one entry for each HTLC, and in the same order.
27154 * This function is only valid in the holder commitment context, it always uses EcdsaSighashType::All.
27156 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);
27159 * Commitment transaction numbers which appear in the transactions themselves are XOR'd with a
27160 * shared secret first. This prevents on-chain observers from discovering how many commitment
27161 * transactions occurred in a channel before it was closed.
27163 * This function gets the shared secret from relevant channel public keys and can be used to
27164 * \"decrypt\" the commitment transaction number given a commitment transaction on-chain.
27166 uint64_t get_commitment_transaction_number_obscure_factor(struct LDKPublicKey broadcaster_payment_basepoint, struct LDKPublicKey countersignatory_payment_basepoint, bool outbound_from_broadcaster);
27169 * Checks if two InitFeaturess contain equal inner contents.
27170 * This ignores pointers and is_owned flags and looks at the values in fields.
27171 * Two objects with NULL inner values will be considered "equal" here.
27173 bool InitFeatures_eq(const struct LDKInitFeatures *NONNULL_PTR a, const struct LDKInitFeatures *NONNULL_PTR b);
27176 * Checks if two NodeFeaturess contain equal inner contents.
27177 * This ignores pointers and is_owned flags and looks at the values in fields.
27178 * Two objects with NULL inner values will be considered "equal" here.
27180 bool NodeFeatures_eq(const struct LDKNodeFeatures *NONNULL_PTR a, const struct LDKNodeFeatures *NONNULL_PTR b);
27183 * Checks if two ChannelFeaturess contain equal inner contents.
27184 * This ignores pointers and is_owned flags and looks at the values in fields.
27185 * Two objects with NULL inner values will be considered "equal" here.
27187 bool ChannelFeatures_eq(const struct LDKChannelFeatures *NONNULL_PTR a, const struct LDKChannelFeatures *NONNULL_PTR b);
27190 * Checks if two InvoiceFeaturess contain equal inner contents.
27191 * This ignores pointers and is_owned flags and looks at the values in fields.
27192 * Two objects with NULL inner values will be considered "equal" here.
27194 bool InvoiceFeatures_eq(const struct LDKInvoiceFeatures *NONNULL_PTR a, const struct LDKInvoiceFeatures *NONNULL_PTR b);
27197 * Checks if two ChannelTypeFeaturess contain equal inner contents.
27198 * This ignores pointers and is_owned flags and looks at the values in fields.
27199 * Two objects with NULL inner values will be considered "equal" here.
27201 bool ChannelTypeFeatures_eq(const struct LDKChannelTypeFeatures *NONNULL_PTR a, const struct LDKChannelTypeFeatures *NONNULL_PTR b);
27204 * Creates a copy of the InitFeatures
27206 struct LDKInitFeatures InitFeatures_clone(const struct LDKInitFeatures *NONNULL_PTR orig);
27209 * Creates a copy of the NodeFeatures
27211 struct LDKNodeFeatures NodeFeatures_clone(const struct LDKNodeFeatures *NONNULL_PTR orig);
27214 * Creates a copy of the ChannelFeatures
27216 struct LDKChannelFeatures ChannelFeatures_clone(const struct LDKChannelFeatures *NONNULL_PTR orig);
27219 * Creates a copy of the InvoiceFeatures
27221 struct LDKInvoiceFeatures InvoiceFeatures_clone(const struct LDKInvoiceFeatures *NONNULL_PTR orig);
27224 * Creates a copy of the ChannelTypeFeatures
27226 struct LDKChannelTypeFeatures ChannelTypeFeatures_clone(const struct LDKChannelTypeFeatures *NONNULL_PTR orig);
27229 * Frees any resources used by the InitFeatures, if is_owned is set and inner is non-NULL.
27231 void InitFeatures_free(struct LDKInitFeatures this_obj);
27234 * Frees any resources used by the NodeFeatures, if is_owned is set and inner is non-NULL.
27236 void NodeFeatures_free(struct LDKNodeFeatures this_obj);
27239 * Frees any resources used by the ChannelFeatures, if is_owned is set and inner is non-NULL.
27241 void ChannelFeatures_free(struct LDKChannelFeatures this_obj);
27244 * Frees any resources used by the InvoiceFeatures, if is_owned is set and inner is non-NULL.
27246 void InvoiceFeatures_free(struct LDKInvoiceFeatures this_obj);
27249 * Frees any resources used by the ChannelTypeFeatures, if is_owned is set and inner is non-NULL.
27251 void ChannelTypeFeatures_free(struct LDKChannelTypeFeatures this_obj);
27254 * Create a blank Features with no features set
27256 MUST_USE_RES struct LDKInitFeatures InitFeatures_empty(void);
27259 * Returns true if this `Features` object contains unknown feature flags which are set as
27262 MUST_USE_RES bool InitFeatures_requires_unknown_bits(const struct LDKInitFeatures *NONNULL_PTR this_arg);
27265 * Create a blank Features with no features set
27267 MUST_USE_RES struct LDKNodeFeatures NodeFeatures_empty(void);
27270 * Returns true if this `Features` object contains unknown feature flags which are set as
27273 MUST_USE_RES bool NodeFeatures_requires_unknown_bits(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
27276 * Create a blank Features with no features set
27278 MUST_USE_RES struct LDKChannelFeatures ChannelFeatures_empty(void);
27281 * Returns true if this `Features` object contains unknown feature flags which are set as
27284 MUST_USE_RES bool ChannelFeatures_requires_unknown_bits(const struct LDKChannelFeatures *NONNULL_PTR this_arg);
27287 * Create a blank Features with no features set
27289 MUST_USE_RES struct LDKInvoiceFeatures InvoiceFeatures_empty(void);
27292 * Returns true if this `Features` object contains unknown feature flags which are set as
27295 MUST_USE_RES bool InvoiceFeatures_requires_unknown_bits(const struct LDKInvoiceFeatures *NONNULL_PTR this_arg);
27298 * Create a blank Features with no features set
27300 MUST_USE_RES struct LDKChannelTypeFeatures ChannelTypeFeatures_empty(void);
27303 * Returns true if this `Features` object contains unknown feature flags which are set as
27306 MUST_USE_RES bool ChannelTypeFeatures_requires_unknown_bits(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
27309 * Serialize the InitFeatures object into a byte array which can be read by InitFeatures_read
27311 struct LDKCVec_u8Z InitFeatures_write(const struct LDKInitFeatures *NONNULL_PTR obj);
27314 * Read a InitFeatures from a byte array, created by InitFeatures_write
27316 struct LDKCResult_InitFeaturesDecodeErrorZ InitFeatures_read(struct LDKu8slice ser);
27319 * Serialize the ChannelFeatures object into a byte array which can be read by ChannelFeatures_read
27321 struct LDKCVec_u8Z ChannelFeatures_write(const struct LDKChannelFeatures *NONNULL_PTR obj);
27324 * Read a ChannelFeatures from a byte array, created by ChannelFeatures_write
27326 struct LDKCResult_ChannelFeaturesDecodeErrorZ ChannelFeatures_read(struct LDKu8slice ser);
27329 * Serialize the NodeFeatures object into a byte array which can be read by NodeFeatures_read
27331 struct LDKCVec_u8Z NodeFeatures_write(const struct LDKNodeFeatures *NONNULL_PTR obj);
27334 * Read a NodeFeatures from a byte array, created by NodeFeatures_write
27336 struct LDKCResult_NodeFeaturesDecodeErrorZ NodeFeatures_read(struct LDKu8slice ser);
27339 * Serialize the InvoiceFeatures object into a byte array which can be read by InvoiceFeatures_read
27341 struct LDKCVec_u8Z InvoiceFeatures_write(const struct LDKInvoiceFeatures *NONNULL_PTR obj);
27344 * Read a InvoiceFeatures from a byte array, created by InvoiceFeatures_write
27346 struct LDKCResult_InvoiceFeaturesDecodeErrorZ InvoiceFeatures_read(struct LDKu8slice ser);
27349 * Serialize the ChannelTypeFeatures object into a byte array which can be read by ChannelTypeFeatures_read
27351 struct LDKCVec_u8Z ChannelTypeFeatures_write(const struct LDKChannelTypeFeatures *NONNULL_PTR obj);
27354 * Read a ChannelTypeFeatures from a byte array, created by ChannelTypeFeatures_write
27356 struct LDKCResult_ChannelTypeFeaturesDecodeErrorZ ChannelTypeFeatures_read(struct LDKu8slice ser);
27359 * Set this feature as optional.
27361 void InitFeatures_set_data_loss_protect_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
27364 * Set this feature as required.
27366 void InitFeatures_set_data_loss_protect_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
27369 * Checks if this feature is supported.
27371 MUST_USE_RES bool InitFeatures_supports_data_loss_protect(const struct LDKInitFeatures *NONNULL_PTR this_arg);
27374 * Set this feature as optional.
27376 void NodeFeatures_set_data_loss_protect_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
27379 * Set this feature as required.
27381 void NodeFeatures_set_data_loss_protect_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
27384 * Checks if this feature is supported.
27386 MUST_USE_RES bool NodeFeatures_supports_data_loss_protect(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
27389 * Checks if this feature is required.
27391 MUST_USE_RES bool InitFeatures_requires_data_loss_protect(const struct LDKInitFeatures *NONNULL_PTR this_arg);
27394 * Checks if this feature is required.
27396 MUST_USE_RES bool NodeFeatures_requires_data_loss_protect(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
27399 * Set this feature as optional.
27401 void InitFeatures_set_initial_routing_sync_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
27404 * Set this feature as required.
27406 void InitFeatures_set_initial_routing_sync_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
27409 * Checks if this feature is supported.
27411 MUST_USE_RES bool InitFeatures_initial_routing_sync(const struct LDKInitFeatures *NONNULL_PTR this_arg);
27414 * Set this feature as optional.
27416 void InitFeatures_set_upfront_shutdown_script_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
27419 * Set this feature as required.
27421 void InitFeatures_set_upfront_shutdown_script_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
27424 * Checks if this feature is supported.
27426 MUST_USE_RES bool InitFeatures_supports_upfront_shutdown_script(const struct LDKInitFeatures *NONNULL_PTR this_arg);
27429 * Set this feature as optional.
27431 void NodeFeatures_set_upfront_shutdown_script_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
27434 * Set this feature as required.
27436 void NodeFeatures_set_upfront_shutdown_script_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
27439 * Checks if this feature is supported.
27441 MUST_USE_RES bool NodeFeatures_supports_upfront_shutdown_script(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
27444 * Checks if this feature is required.
27446 MUST_USE_RES bool InitFeatures_requires_upfront_shutdown_script(const struct LDKInitFeatures *NONNULL_PTR this_arg);
27449 * Checks if this feature is required.
27451 MUST_USE_RES bool NodeFeatures_requires_upfront_shutdown_script(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
27454 * Set this feature as optional.
27456 void InitFeatures_set_gossip_queries_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
27459 * Set this feature as required.
27461 void InitFeatures_set_gossip_queries_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
27464 * Checks if this feature is supported.
27466 MUST_USE_RES bool InitFeatures_supports_gossip_queries(const struct LDKInitFeatures *NONNULL_PTR this_arg);
27469 * Set this feature as optional.
27471 void NodeFeatures_set_gossip_queries_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
27474 * Set this feature as required.
27476 void NodeFeatures_set_gossip_queries_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
27479 * Checks if this feature is supported.
27481 MUST_USE_RES bool NodeFeatures_supports_gossip_queries(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
27484 * Checks if this feature is required.
27486 MUST_USE_RES bool InitFeatures_requires_gossip_queries(const struct LDKInitFeatures *NONNULL_PTR this_arg);
27489 * Checks if this feature is required.
27491 MUST_USE_RES bool NodeFeatures_requires_gossip_queries(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
27494 * Set this feature as optional.
27496 void InitFeatures_set_variable_length_onion_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
27499 * Set this feature as required.
27501 void InitFeatures_set_variable_length_onion_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
27504 * Checks if this feature is supported.
27506 MUST_USE_RES bool InitFeatures_supports_variable_length_onion(const struct LDKInitFeatures *NONNULL_PTR this_arg);
27509 * Set this feature as optional.
27511 void NodeFeatures_set_variable_length_onion_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
27514 * Set this feature as required.
27516 void NodeFeatures_set_variable_length_onion_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
27519 * Checks if this feature is supported.
27521 MUST_USE_RES bool NodeFeatures_supports_variable_length_onion(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
27524 * Set this feature as optional.
27526 void InvoiceFeatures_set_variable_length_onion_optional(struct LDKInvoiceFeatures *NONNULL_PTR this_arg);
27529 * Set this feature as required.
27531 void InvoiceFeatures_set_variable_length_onion_required(struct LDKInvoiceFeatures *NONNULL_PTR this_arg);
27534 * Checks if this feature is supported.
27536 MUST_USE_RES bool InvoiceFeatures_supports_variable_length_onion(const struct LDKInvoiceFeatures *NONNULL_PTR this_arg);
27539 * Checks if this feature is required.
27541 MUST_USE_RES bool InitFeatures_requires_variable_length_onion(const struct LDKInitFeatures *NONNULL_PTR this_arg);
27544 * Checks if this feature is required.
27546 MUST_USE_RES bool NodeFeatures_requires_variable_length_onion(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
27549 * Checks if this feature is required.
27551 MUST_USE_RES bool InvoiceFeatures_requires_variable_length_onion(const struct LDKInvoiceFeatures *NONNULL_PTR this_arg);
27554 * Set this feature as optional.
27556 void InitFeatures_set_static_remote_key_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
27559 * Set this feature as required.
27561 void InitFeatures_set_static_remote_key_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
27564 * Checks if this feature is supported.
27566 MUST_USE_RES bool InitFeatures_supports_static_remote_key(const struct LDKInitFeatures *NONNULL_PTR this_arg);
27569 * Set this feature as optional.
27571 void NodeFeatures_set_static_remote_key_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
27574 * Set this feature as required.
27576 void NodeFeatures_set_static_remote_key_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
27579 * Checks if this feature is supported.
27581 MUST_USE_RES bool NodeFeatures_supports_static_remote_key(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
27584 * Set this feature as optional.
27586 void ChannelTypeFeatures_set_static_remote_key_optional(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
27589 * Set this feature as required.
27591 void ChannelTypeFeatures_set_static_remote_key_required(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
27594 * Checks if this feature is supported.
27596 MUST_USE_RES bool ChannelTypeFeatures_supports_static_remote_key(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
27599 * Checks if this feature is required.
27601 MUST_USE_RES bool InitFeatures_requires_static_remote_key(const struct LDKInitFeatures *NONNULL_PTR this_arg);
27604 * Checks if this feature is required.
27606 MUST_USE_RES bool NodeFeatures_requires_static_remote_key(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
27609 * Checks if this feature is required.
27611 MUST_USE_RES bool ChannelTypeFeatures_requires_static_remote_key(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
27614 * Set this feature as optional.
27616 void InitFeatures_set_payment_secret_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
27619 * Set this feature as required.
27621 void InitFeatures_set_payment_secret_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
27624 * Checks if this feature is supported.
27626 MUST_USE_RES bool InitFeatures_supports_payment_secret(const struct LDKInitFeatures *NONNULL_PTR this_arg);
27629 * Set this feature as optional.
27631 void NodeFeatures_set_payment_secret_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
27634 * Set this feature as required.
27636 void NodeFeatures_set_payment_secret_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
27639 * Checks if this feature is supported.
27641 MUST_USE_RES bool NodeFeatures_supports_payment_secret(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
27644 * Set this feature as optional.
27646 void InvoiceFeatures_set_payment_secret_optional(struct LDKInvoiceFeatures *NONNULL_PTR this_arg);
27649 * Set this feature as required.
27651 void InvoiceFeatures_set_payment_secret_required(struct LDKInvoiceFeatures *NONNULL_PTR this_arg);
27654 * Checks if this feature is supported.
27656 MUST_USE_RES bool InvoiceFeatures_supports_payment_secret(const struct LDKInvoiceFeatures *NONNULL_PTR this_arg);
27659 * Checks if this feature is required.
27661 MUST_USE_RES bool InitFeatures_requires_payment_secret(const struct LDKInitFeatures *NONNULL_PTR this_arg);
27664 * Checks if this feature is required.
27666 MUST_USE_RES bool NodeFeatures_requires_payment_secret(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
27669 * Checks if this feature is required.
27671 MUST_USE_RES bool InvoiceFeatures_requires_payment_secret(const struct LDKInvoiceFeatures *NONNULL_PTR this_arg);
27674 * Set this feature as optional.
27676 void InitFeatures_set_basic_mpp_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
27679 * Set this feature as required.
27681 void InitFeatures_set_basic_mpp_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
27684 * Checks if this feature is supported.
27686 MUST_USE_RES bool InitFeatures_supports_basic_mpp(const struct LDKInitFeatures *NONNULL_PTR this_arg);
27689 * Set this feature as optional.
27691 void NodeFeatures_set_basic_mpp_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
27694 * Set this feature as required.
27696 void NodeFeatures_set_basic_mpp_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
27699 * Checks if this feature is supported.
27701 MUST_USE_RES bool NodeFeatures_supports_basic_mpp(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
27704 * Set this feature as optional.
27706 void InvoiceFeatures_set_basic_mpp_optional(struct LDKInvoiceFeatures *NONNULL_PTR this_arg);
27709 * Set this feature as required.
27711 void InvoiceFeatures_set_basic_mpp_required(struct LDKInvoiceFeatures *NONNULL_PTR this_arg);
27714 * Checks if this feature is supported.
27716 MUST_USE_RES bool InvoiceFeatures_supports_basic_mpp(const struct LDKInvoiceFeatures *NONNULL_PTR this_arg);
27719 * Checks if this feature is required.
27721 MUST_USE_RES bool InitFeatures_requires_basic_mpp(const struct LDKInitFeatures *NONNULL_PTR this_arg);
27724 * Checks if this feature is required.
27726 MUST_USE_RES bool NodeFeatures_requires_basic_mpp(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
27729 * Checks if this feature is required.
27731 MUST_USE_RES bool InvoiceFeatures_requires_basic_mpp(const struct LDKInvoiceFeatures *NONNULL_PTR this_arg);
27734 * Set this feature as optional.
27736 void InitFeatures_set_wumbo_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
27739 * Set this feature as required.
27741 void InitFeatures_set_wumbo_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
27744 * Checks if this feature is supported.
27746 MUST_USE_RES bool InitFeatures_supports_wumbo(const struct LDKInitFeatures *NONNULL_PTR this_arg);
27749 * Set this feature as optional.
27751 void NodeFeatures_set_wumbo_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
27754 * Set this feature as required.
27756 void NodeFeatures_set_wumbo_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
27759 * Checks if this feature is supported.
27761 MUST_USE_RES bool NodeFeatures_supports_wumbo(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
27764 * Checks if this feature is required.
27766 MUST_USE_RES bool InitFeatures_requires_wumbo(const struct LDKInitFeatures *NONNULL_PTR this_arg);
27769 * Checks if this feature is required.
27771 MUST_USE_RES bool NodeFeatures_requires_wumbo(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
27774 * Set this feature as optional.
27776 void InitFeatures_set_shutdown_any_segwit_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
27779 * Set this feature as required.
27781 void InitFeatures_set_shutdown_any_segwit_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
27784 * Checks if this feature is supported.
27786 MUST_USE_RES bool InitFeatures_supports_shutdown_anysegwit(const struct LDKInitFeatures *NONNULL_PTR this_arg);
27789 * Set this feature as optional.
27791 void NodeFeatures_set_shutdown_any_segwit_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
27794 * Set this feature as required.
27796 void NodeFeatures_set_shutdown_any_segwit_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
27799 * Checks if this feature is supported.
27801 MUST_USE_RES bool NodeFeatures_supports_shutdown_anysegwit(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
27804 * Checks if this feature is required.
27806 MUST_USE_RES bool InitFeatures_requires_shutdown_anysegwit(const struct LDKInitFeatures *NONNULL_PTR this_arg);
27809 * Checks if this feature is required.
27811 MUST_USE_RES bool NodeFeatures_requires_shutdown_anysegwit(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
27814 * Set this feature as optional.
27816 void InitFeatures_set_onion_messages_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
27819 * Set this feature as required.
27821 void InitFeatures_set_onion_messages_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
27824 * Checks if this feature is supported.
27826 MUST_USE_RES bool InitFeatures_supports_onion_messages(const struct LDKInitFeatures *NONNULL_PTR this_arg);
27829 * Set this feature as optional.
27831 void NodeFeatures_set_onion_messages_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
27834 * Set this feature as required.
27836 void NodeFeatures_set_onion_messages_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
27839 * Checks if this feature is supported.
27841 MUST_USE_RES bool NodeFeatures_supports_onion_messages(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
27844 * Checks if this feature is required.
27846 MUST_USE_RES bool InitFeatures_requires_onion_messages(const struct LDKInitFeatures *NONNULL_PTR this_arg);
27849 * Checks if this feature is required.
27851 MUST_USE_RES bool NodeFeatures_requires_onion_messages(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
27854 * Set this feature as optional.
27856 void InitFeatures_set_channel_type_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
27859 * Set this feature as required.
27861 void InitFeatures_set_channel_type_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
27864 * Checks if this feature is supported.
27866 MUST_USE_RES bool InitFeatures_supports_channel_type(const struct LDKInitFeatures *NONNULL_PTR this_arg);
27869 * Set this feature as optional.
27871 void NodeFeatures_set_channel_type_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
27874 * Set this feature as required.
27876 void NodeFeatures_set_channel_type_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
27879 * Checks if this feature is supported.
27881 MUST_USE_RES bool NodeFeatures_supports_channel_type(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
27884 * Checks if this feature is required.
27886 MUST_USE_RES bool InitFeatures_requires_channel_type(const struct LDKInitFeatures *NONNULL_PTR this_arg);
27889 * Checks if this feature is required.
27891 MUST_USE_RES bool NodeFeatures_requires_channel_type(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
27894 * Set this feature as optional.
27896 void InitFeatures_set_scid_privacy_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
27899 * Set this feature as required.
27901 void InitFeatures_set_scid_privacy_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
27904 * Checks if this feature is supported.
27906 MUST_USE_RES bool InitFeatures_supports_scid_privacy(const struct LDKInitFeatures *NONNULL_PTR this_arg);
27909 * Set this feature as optional.
27911 void NodeFeatures_set_scid_privacy_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
27914 * Set this feature as required.
27916 void NodeFeatures_set_scid_privacy_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
27919 * Checks if this feature is supported.
27921 MUST_USE_RES bool NodeFeatures_supports_scid_privacy(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
27924 * Set this feature as optional.
27926 void ChannelTypeFeatures_set_scid_privacy_optional(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
27929 * Set this feature as required.
27931 void ChannelTypeFeatures_set_scid_privacy_required(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
27934 * Checks if this feature is supported.
27936 MUST_USE_RES bool ChannelTypeFeatures_supports_scid_privacy(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
27939 * Checks if this feature is required.
27941 MUST_USE_RES bool InitFeatures_requires_scid_privacy(const struct LDKInitFeatures *NONNULL_PTR this_arg);
27944 * Checks if this feature is required.
27946 MUST_USE_RES bool NodeFeatures_requires_scid_privacy(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
27949 * Checks if this feature is required.
27951 MUST_USE_RES bool ChannelTypeFeatures_requires_scid_privacy(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
27954 * Set this feature as optional.
27956 void InitFeatures_set_zero_conf_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
27959 * Set this feature as required.
27961 void InitFeatures_set_zero_conf_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
27964 * Checks if this feature is supported.
27966 MUST_USE_RES bool InitFeatures_supports_zero_conf(const struct LDKInitFeatures *NONNULL_PTR this_arg);
27969 * Set this feature as optional.
27971 void NodeFeatures_set_zero_conf_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
27974 * Set this feature as required.
27976 void NodeFeatures_set_zero_conf_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
27979 * Checks if this feature is supported.
27981 MUST_USE_RES bool NodeFeatures_supports_zero_conf(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
27984 * Set this feature as optional.
27986 void ChannelTypeFeatures_set_zero_conf_optional(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
27989 * Set this feature as required.
27991 void ChannelTypeFeatures_set_zero_conf_required(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
27994 * Checks if this feature is supported.
27996 MUST_USE_RES bool ChannelTypeFeatures_supports_zero_conf(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
27999 * Checks if this feature is required.
28001 MUST_USE_RES bool InitFeatures_requires_zero_conf(const struct LDKInitFeatures *NONNULL_PTR this_arg);
28004 * Checks if this feature is required.
28006 MUST_USE_RES bool NodeFeatures_requires_zero_conf(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
28009 * Checks if this feature is required.
28011 MUST_USE_RES bool ChannelTypeFeatures_requires_zero_conf(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
28014 * Set this feature as optional.
28016 void NodeFeatures_set_keysend_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
28019 * Set this feature as required.
28021 void NodeFeatures_set_keysend_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
28024 * Checks if this feature is supported.
28026 MUST_USE_RES bool NodeFeatures_supports_keysend(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
28029 * Checks if this feature is required.
28031 MUST_USE_RES bool NodeFeatures_requires_keysend(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
28034 * Frees any resources used by the ShutdownScript, if is_owned is set and inner is non-NULL.
28036 void ShutdownScript_free(struct LDKShutdownScript this_obj);
28039 * Creates a copy of the ShutdownScript
28041 struct LDKShutdownScript ShutdownScript_clone(const struct LDKShutdownScript *NONNULL_PTR orig);
28044 * Checks if two ShutdownScripts contain equal inner contents.
28045 * This ignores pointers and is_owned flags and looks at the values in fields.
28046 * Two objects with NULL inner values will be considered "equal" here.
28048 bool ShutdownScript_eq(const struct LDKShutdownScript *NONNULL_PTR a, const struct LDKShutdownScript *NONNULL_PTR b);
28051 * Frees any resources used by the InvalidShutdownScript, if is_owned is set and inner is non-NULL.
28053 void InvalidShutdownScript_free(struct LDKInvalidShutdownScript this_obj);
28056 * The script that did not meet the requirements from [BOLT #2].
28058 * [BOLT #2]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md
28060 struct LDKu8slice InvalidShutdownScript_get_script(const struct LDKInvalidShutdownScript *NONNULL_PTR this_ptr);
28063 * The script that did not meet the requirements from [BOLT #2].
28065 * [BOLT #2]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md
28067 void InvalidShutdownScript_set_script(struct LDKInvalidShutdownScript *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val);
28070 * Constructs a new InvalidShutdownScript given each field
28072 MUST_USE_RES struct LDKInvalidShutdownScript InvalidShutdownScript_new(struct LDKCVec_u8Z script_arg);
28075 * Creates a copy of the InvalidShutdownScript
28077 struct LDKInvalidShutdownScript InvalidShutdownScript_clone(const struct LDKInvalidShutdownScript *NONNULL_PTR orig);
28080 * Serialize the ShutdownScript object into a byte array which can be read by ShutdownScript_read
28082 struct LDKCVec_u8Z ShutdownScript_write(const struct LDKShutdownScript *NONNULL_PTR obj);
28085 * Read a ShutdownScript from a byte array, created by ShutdownScript_write
28087 struct LDKCResult_ShutdownScriptDecodeErrorZ ShutdownScript_read(struct LDKu8slice ser);
28090 * Generates a P2WPKH script pubkey from the given [`WPubkeyHash`].
28092 MUST_USE_RES struct LDKShutdownScript ShutdownScript_new_p2wpkh(const uint8_t (*pubkey_hash)[20]);
28095 * Generates a P2WSH script pubkey from the given [`WScriptHash`].
28097 MUST_USE_RES struct LDKShutdownScript ShutdownScript_new_p2wsh(const uint8_t (*script_hash)[32]);
28100 * Generates a witness script pubkey from the given segwit version and program.
28102 * Note for version-zero witness scripts you must use [`ShutdownScript::new_p2wpkh`] or
28103 * [`ShutdownScript::new_p2wsh`] instead.
28107 * This function may return an error if `program` is invalid for the segwit `version`.
28109 MUST_USE_RES struct LDKCResult_ShutdownScriptInvalidShutdownScriptZ ShutdownScript_new_witness_program(struct LDKWitnessVersion version, struct LDKu8slice program);
28112 * Converts the shutdown script into the underlying [`Script`].
28114 MUST_USE_RES struct LDKCVec_u8Z ShutdownScript_into_inner(struct LDKShutdownScript this_arg);
28117 * Returns the [`PublicKey`] used for a P2WPKH shutdown script if constructed directly from it.
28119 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
28121 MUST_USE_RES struct LDKPublicKey ShutdownScript_as_legacy_pubkey(const struct LDKShutdownScript *NONNULL_PTR this_arg);
28124 * Returns whether the shutdown script is compatible with the features as defined by BOLT #2.
28126 * Specifically, checks for compliance with feature `option_shutdown_anysegwit`.
28128 MUST_USE_RES bool ShutdownScript_is_compatible(const struct LDKShutdownScript *NONNULL_PTR this_arg, const struct LDKInitFeatures *NONNULL_PTR features);
28131 * Calls the free function if one is set
28133 void CustomMessageReader_free(struct LDKCustomMessageReader this_ptr);
28136 * Calls the free function if one is set
28138 void Type_free(struct LDKType this_ptr);
28141 * Frees any resources used by the NodeId, if is_owned is set and inner is non-NULL.
28143 void NodeId_free(struct LDKNodeId this_obj);
28146 * Creates a copy of the NodeId
28148 struct LDKNodeId NodeId_clone(const struct LDKNodeId *NONNULL_PTR orig);
28151 * Create a new NodeId from a public key
28153 MUST_USE_RES struct LDKNodeId NodeId_from_pubkey(struct LDKPublicKey pubkey);
28156 * Get the public key slice from this NodeId
28158 MUST_USE_RES struct LDKu8slice NodeId_as_slice(const struct LDKNodeId *NONNULL_PTR this_arg);
28161 * Checks if two NodeIds contain equal inner contents.
28163 uint64_t NodeId_hash(const struct LDKNodeId *NONNULL_PTR o);
28166 * Serialize the NodeId object into a byte array which can be read by NodeId_read
28168 struct LDKCVec_u8Z NodeId_write(const struct LDKNodeId *NONNULL_PTR obj);
28171 * Read a NodeId from a byte array, created by NodeId_write
28173 struct LDKCResult_NodeIdDecodeErrorZ NodeId_read(struct LDKu8slice ser);
28176 * Frees any resources used by the NetworkGraph, if is_owned is set and inner is non-NULL.
28178 void NetworkGraph_free(struct LDKNetworkGraph this_obj);
28181 * Frees any resources used by the ReadOnlyNetworkGraph, if is_owned is set and inner is non-NULL.
28183 void ReadOnlyNetworkGraph_free(struct LDKReadOnlyNetworkGraph this_obj);
28186 * Frees any resources used by the NetworkUpdate
28188 void NetworkUpdate_free(struct LDKNetworkUpdate this_ptr);
28191 * Creates a copy of the NetworkUpdate
28193 struct LDKNetworkUpdate NetworkUpdate_clone(const struct LDKNetworkUpdate *NONNULL_PTR orig);
28196 * Utility method to constructs a new ChannelUpdateMessage-variant NetworkUpdate
28198 struct LDKNetworkUpdate NetworkUpdate_channel_update_message(struct LDKChannelUpdate msg);
28201 * Utility method to constructs a new ChannelFailure-variant NetworkUpdate
28203 struct LDKNetworkUpdate NetworkUpdate_channel_failure(uint64_t short_channel_id, bool is_permanent);
28206 * Utility method to constructs a new NodeFailure-variant NetworkUpdate
28208 struct LDKNetworkUpdate NetworkUpdate_node_failure(struct LDKPublicKey node_id, bool is_permanent);
28211 * Checks if two NetworkUpdates contain equal inner contents.
28212 * This ignores pointers and is_owned flags and looks at the values in fields.
28214 bool NetworkUpdate_eq(const struct LDKNetworkUpdate *NONNULL_PTR a, const struct LDKNetworkUpdate *NONNULL_PTR b);
28217 * Serialize the NetworkUpdate object into a byte array which can be read by NetworkUpdate_read
28219 struct LDKCVec_u8Z NetworkUpdate_write(const struct LDKNetworkUpdate *NONNULL_PTR obj);
28222 * Read a NetworkUpdate from a byte array, created by NetworkUpdate_write
28224 struct LDKCResult_COption_NetworkUpdateZDecodeErrorZ NetworkUpdate_read(struct LDKu8slice ser);
28227 * Frees any resources used by the P2PGossipSync, if is_owned is set and inner is non-NULL.
28229 void P2PGossipSync_free(struct LDKP2PGossipSync this_obj);
28232 * Creates a new tracker of the actual state of the network of channels and nodes,
28233 * assuming an existing Network Graph.
28234 * Chain monitor is used to make sure announced channels exist on-chain,
28235 * channel data is correct, and that the announcement is signed with
28236 * channel owners' keys.
28238 MUST_USE_RES struct LDKP2PGossipSync P2PGossipSync_new(const struct LDKNetworkGraph *NONNULL_PTR network_graph, struct LDKCOption_AccessZ chain_access, struct LDKLogger logger);
28241 * Adds a provider used to check new announcements. Does not affect
28242 * existing announcements unless they are updated.
28243 * Add, update or remove the provider would replace the current one.
28245 void P2PGossipSync_add_chain_access(struct LDKP2PGossipSync *NONNULL_PTR this_arg, struct LDKCOption_AccessZ chain_access);
28248 * Constructs a new EventHandler which calls the relevant methods on this_arg.
28249 * This copies the `inner` pointer in this_arg and thus the returned EventHandler must be freed before this_arg is
28251 struct LDKEventHandler NetworkGraph_as_EventHandler(const struct LDKNetworkGraph *NONNULL_PTR this_arg);
28254 * Constructs a new RoutingMessageHandler which calls the relevant methods on this_arg.
28255 * This copies the `inner` pointer in this_arg and thus the returned RoutingMessageHandler must be freed before this_arg is
28257 struct LDKRoutingMessageHandler P2PGossipSync_as_RoutingMessageHandler(const struct LDKP2PGossipSync *NONNULL_PTR this_arg);
28260 * Constructs a new MessageSendEventsProvider which calls the relevant methods on this_arg.
28261 * This copies the `inner` pointer in this_arg and thus the returned MessageSendEventsProvider must be freed before this_arg is
28263 struct LDKMessageSendEventsProvider P2PGossipSync_as_MessageSendEventsProvider(const struct LDKP2PGossipSync *NONNULL_PTR this_arg);
28266 * Frees any resources used by the ChannelUpdateInfo, if is_owned is set and inner is non-NULL.
28268 void ChannelUpdateInfo_free(struct LDKChannelUpdateInfo this_obj);
28271 * When the last update to the channel direction was issued.
28272 * Value is opaque, as set in the announcement.
28274 uint32_t ChannelUpdateInfo_get_last_update(const struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr);
28277 * When the last update to the channel direction was issued.
28278 * Value is opaque, as set in the announcement.
28280 void ChannelUpdateInfo_set_last_update(struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr, uint32_t val);
28283 * Whether the channel can be currently used for payments (in this one direction).
28285 bool ChannelUpdateInfo_get_enabled(const struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr);
28288 * Whether the channel can be currently used for payments (in this one direction).
28290 void ChannelUpdateInfo_set_enabled(struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr, bool val);
28293 * The difference in CLTV values that you must have when routing through this channel.
28295 uint16_t ChannelUpdateInfo_get_cltv_expiry_delta(const struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr);
28298 * The difference in CLTV values that you must have when routing through this channel.
28300 void ChannelUpdateInfo_set_cltv_expiry_delta(struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr, uint16_t val);
28303 * The minimum value, which must be relayed to the next hop via the channel
28305 uint64_t ChannelUpdateInfo_get_htlc_minimum_msat(const struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr);
28308 * The minimum value, which must be relayed to the next hop via the channel
28310 void ChannelUpdateInfo_set_htlc_minimum_msat(struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr, uint64_t val);
28313 * The maximum value which may be relayed to the next hop via the channel.
28315 uint64_t ChannelUpdateInfo_get_htlc_maximum_msat(const struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr);
28318 * The maximum value which may be relayed to the next hop via the channel.
28320 void ChannelUpdateInfo_set_htlc_maximum_msat(struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr, uint64_t val);
28323 * Fees charged when the channel is used for routing
28325 struct LDKRoutingFees ChannelUpdateInfo_get_fees(const struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr);
28328 * Fees charged when the channel is used for routing
28330 void ChannelUpdateInfo_set_fees(struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr, struct LDKRoutingFees val);
28333 * Most recent update for the channel received from the network
28334 * Mostly redundant with the data we store in fields explicitly.
28335 * Everything else is useful only for sending out for initial routing sync.
28336 * Not stored if contains excess data to prevent DoS.
28338 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
28340 struct LDKChannelUpdate ChannelUpdateInfo_get_last_update_message(const struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr);
28343 * Most recent update for the channel received from the network
28344 * Mostly redundant with the data we store in fields explicitly.
28345 * Everything else is useful only for sending out for initial routing sync.
28346 * Not stored if contains excess data to prevent DoS.
28348 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
28350 void ChannelUpdateInfo_set_last_update_message(struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr, struct LDKChannelUpdate val);
28353 * Constructs a new ChannelUpdateInfo given each field
28355 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);
28358 * Creates a copy of the ChannelUpdateInfo
28360 struct LDKChannelUpdateInfo ChannelUpdateInfo_clone(const struct LDKChannelUpdateInfo *NONNULL_PTR orig);
28363 * Checks if two ChannelUpdateInfos contain equal inner contents.
28364 * This ignores pointers and is_owned flags and looks at the values in fields.
28365 * Two objects with NULL inner values will be considered "equal" here.
28367 bool ChannelUpdateInfo_eq(const struct LDKChannelUpdateInfo *NONNULL_PTR a, const struct LDKChannelUpdateInfo *NONNULL_PTR b);
28370 * Serialize the ChannelUpdateInfo object into a byte array which can be read by ChannelUpdateInfo_read
28372 struct LDKCVec_u8Z ChannelUpdateInfo_write(const struct LDKChannelUpdateInfo *NONNULL_PTR obj);
28375 * Read a ChannelUpdateInfo from a byte array, created by ChannelUpdateInfo_write
28377 struct LDKCResult_ChannelUpdateInfoDecodeErrorZ ChannelUpdateInfo_read(struct LDKu8slice ser);
28380 * Frees any resources used by the ChannelInfo, if is_owned is set and inner is non-NULL.
28382 void ChannelInfo_free(struct LDKChannelInfo this_obj);
28385 * Protocol features of a channel communicated during its announcement
28387 struct LDKChannelFeatures ChannelInfo_get_features(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
28390 * Protocol features of a channel communicated during its announcement
28392 void ChannelInfo_set_features(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKChannelFeatures val);
28395 * Source node of the first direction of a channel
28397 struct LDKNodeId ChannelInfo_get_node_one(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
28400 * Source node of the first direction of a channel
28402 void ChannelInfo_set_node_one(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKNodeId val);
28405 * Details about the first direction of a channel
28407 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
28409 struct LDKChannelUpdateInfo ChannelInfo_get_one_to_two(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
28412 * Details about the first direction of a channel
28414 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
28416 void ChannelInfo_set_one_to_two(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKChannelUpdateInfo val);
28419 * Source node of the second direction of a channel
28421 struct LDKNodeId ChannelInfo_get_node_two(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
28424 * Source node of the second direction of a channel
28426 void ChannelInfo_set_node_two(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKNodeId val);
28429 * Details about the second direction of a channel
28431 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
28433 struct LDKChannelUpdateInfo ChannelInfo_get_two_to_one(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
28436 * Details about the second direction of a channel
28438 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
28440 void ChannelInfo_set_two_to_one(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKChannelUpdateInfo val);
28443 * The channel capacity as seen on-chain, if chain lookup is available.
28445 struct LDKCOption_u64Z ChannelInfo_get_capacity_sats(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
28448 * The channel capacity as seen on-chain, if chain lookup is available.
28450 void ChannelInfo_set_capacity_sats(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
28453 * An initial announcement of the channel
28454 * Mostly redundant with the data we store in fields explicitly.
28455 * Everything else is useful only for sending out for initial routing sync.
28456 * Not stored if contains excess data to prevent DoS.
28458 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
28460 struct LDKChannelAnnouncement ChannelInfo_get_announcement_message(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
28463 * An initial announcement of the channel
28464 * Mostly redundant with the data we store in fields explicitly.
28465 * Everything else is useful only for sending out for initial routing sync.
28466 * Not stored if contains excess data to prevent DoS.
28468 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
28470 void ChannelInfo_set_announcement_message(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKChannelAnnouncement val);
28473 * Creates a copy of the ChannelInfo
28475 struct LDKChannelInfo ChannelInfo_clone(const struct LDKChannelInfo *NONNULL_PTR orig);
28478 * Checks if two ChannelInfos contain equal inner contents.
28479 * This ignores pointers and is_owned flags and looks at the values in fields.
28480 * Two objects with NULL inner values will be considered "equal" here.
28482 bool ChannelInfo_eq(const struct LDKChannelInfo *NONNULL_PTR a, const struct LDKChannelInfo *NONNULL_PTR b);
28485 * Returns a [`ChannelUpdateInfo`] based on the direction implied by the channel_flag.
28487 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
28489 MUST_USE_RES struct LDKChannelUpdateInfo ChannelInfo_get_directional_info(const struct LDKChannelInfo *NONNULL_PTR this_arg, uint8_t channel_flags);
28492 * Serialize the ChannelInfo object into a byte array which can be read by ChannelInfo_read
28494 struct LDKCVec_u8Z ChannelInfo_write(const struct LDKChannelInfo *NONNULL_PTR obj);
28497 * Read a ChannelInfo from a byte array, created by ChannelInfo_write
28499 struct LDKCResult_ChannelInfoDecodeErrorZ ChannelInfo_read(struct LDKu8slice ser);
28502 * Frees any resources used by the DirectedChannelInfo, if is_owned is set and inner is non-NULL.
28504 void DirectedChannelInfo_free(struct LDKDirectedChannelInfo this_obj);
28507 * Creates a copy of the DirectedChannelInfo
28509 struct LDKDirectedChannelInfo DirectedChannelInfo_clone(const struct LDKDirectedChannelInfo *NONNULL_PTR orig);
28512 * Returns information for the channel.
28514 MUST_USE_RES struct LDKChannelInfo DirectedChannelInfo_channel(const struct LDKDirectedChannelInfo *NONNULL_PTR this_arg);
28517 * Returns information for the direction.
28519 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
28521 MUST_USE_RES struct LDKChannelUpdateInfo DirectedChannelInfo_direction(const struct LDKDirectedChannelInfo *NONNULL_PTR this_arg);
28524 * Returns the maximum HTLC amount allowed over the channel in the direction.
28526 MUST_USE_RES uint64_t DirectedChannelInfo_htlc_maximum_msat(const struct LDKDirectedChannelInfo *NONNULL_PTR this_arg);
28529 * Returns the [`EffectiveCapacity`] of the channel in the direction.
28531 * This is either the total capacity from the funding transaction, if known, or the
28532 * `htlc_maximum_msat` for the direction as advertised by the gossip network, if known,
28535 MUST_USE_RES struct LDKEffectiveCapacity DirectedChannelInfo_effective_capacity(const struct LDKDirectedChannelInfo *NONNULL_PTR this_arg);
28538 * Frees any resources used by the EffectiveCapacity
28540 void EffectiveCapacity_free(struct LDKEffectiveCapacity this_ptr);
28543 * Creates a copy of the EffectiveCapacity
28545 struct LDKEffectiveCapacity EffectiveCapacity_clone(const struct LDKEffectiveCapacity *NONNULL_PTR orig);
28548 * Utility method to constructs a new ExactLiquidity-variant EffectiveCapacity
28550 struct LDKEffectiveCapacity EffectiveCapacity_exact_liquidity(uint64_t liquidity_msat);
28553 * Utility method to constructs a new MaximumHTLC-variant EffectiveCapacity
28555 struct LDKEffectiveCapacity EffectiveCapacity_maximum_htlc(uint64_t amount_msat);
28558 * Utility method to constructs a new Total-variant EffectiveCapacity
28560 struct LDKEffectiveCapacity EffectiveCapacity_total(uint64_t capacity_msat, struct LDKCOption_u64Z htlc_maximum_msat);
28563 * Utility method to constructs a new Infinite-variant EffectiveCapacity
28565 struct LDKEffectiveCapacity EffectiveCapacity_infinite(void);
28568 * Utility method to constructs a new Unknown-variant EffectiveCapacity
28570 struct LDKEffectiveCapacity EffectiveCapacity_unknown(void);
28573 * Returns the effective capacity denominated in millisatoshi.
28575 MUST_USE_RES uint64_t EffectiveCapacity_as_msat(const struct LDKEffectiveCapacity *NONNULL_PTR this_arg);
28578 * Frees any resources used by the RoutingFees, if is_owned is set and inner is non-NULL.
28580 void RoutingFees_free(struct LDKRoutingFees this_obj);
28583 * Flat routing fee in satoshis
28585 uint32_t RoutingFees_get_base_msat(const struct LDKRoutingFees *NONNULL_PTR this_ptr);
28588 * Flat routing fee in satoshis
28590 void RoutingFees_set_base_msat(struct LDKRoutingFees *NONNULL_PTR this_ptr, uint32_t val);
28593 * Liquidity-based routing fee in millionths of a routed amount.
28594 * In other words, 10000 is 1%.
28596 uint32_t RoutingFees_get_proportional_millionths(const struct LDKRoutingFees *NONNULL_PTR this_ptr);
28599 * Liquidity-based routing fee in millionths of a routed amount.
28600 * In other words, 10000 is 1%.
28602 void RoutingFees_set_proportional_millionths(struct LDKRoutingFees *NONNULL_PTR this_ptr, uint32_t val);
28605 * Constructs a new RoutingFees given each field
28607 MUST_USE_RES struct LDKRoutingFees RoutingFees_new(uint32_t base_msat_arg, uint32_t proportional_millionths_arg);
28610 * Checks if two RoutingFeess contain equal inner contents.
28611 * This ignores pointers and is_owned flags and looks at the values in fields.
28612 * Two objects with NULL inner values will be considered "equal" here.
28614 bool RoutingFees_eq(const struct LDKRoutingFees *NONNULL_PTR a, const struct LDKRoutingFees *NONNULL_PTR b);
28617 * Creates a copy of the RoutingFees
28619 struct LDKRoutingFees RoutingFees_clone(const struct LDKRoutingFees *NONNULL_PTR orig);
28622 * Checks if two RoutingFeess contain equal inner contents.
28624 uint64_t RoutingFees_hash(const struct LDKRoutingFees *NONNULL_PTR o);
28627 * Serialize the RoutingFees object into a byte array which can be read by RoutingFees_read
28629 struct LDKCVec_u8Z RoutingFees_write(const struct LDKRoutingFees *NONNULL_PTR obj);
28632 * Read a RoutingFees from a byte array, created by RoutingFees_write
28634 struct LDKCResult_RoutingFeesDecodeErrorZ RoutingFees_read(struct LDKu8slice ser);
28637 * Frees any resources used by the NodeAnnouncementInfo, if is_owned is set and inner is non-NULL.
28639 void NodeAnnouncementInfo_free(struct LDKNodeAnnouncementInfo this_obj);
28642 * Protocol features the node announced support for
28644 struct LDKNodeFeatures NodeAnnouncementInfo_get_features(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr);
28647 * Protocol features the node announced support for
28649 void NodeAnnouncementInfo_set_features(struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr, struct LDKNodeFeatures val);
28652 * When the last known update to the node state was issued.
28653 * Value is opaque, as set in the announcement.
28655 uint32_t NodeAnnouncementInfo_get_last_update(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr);
28658 * When the last known update to the node state was issued.
28659 * Value is opaque, as set in the announcement.
28661 void NodeAnnouncementInfo_set_last_update(struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr, uint32_t val);
28664 * Color assigned to the node
28666 const uint8_t (*NodeAnnouncementInfo_get_rgb(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr))[3];
28669 * Color assigned to the node
28671 void NodeAnnouncementInfo_set_rgb(struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr, struct LDKThreeBytes val);
28674 * Moniker assigned to the node.
28675 * May be invalid or malicious (eg control chars),
28676 * should not be exposed to the user.
28678 struct LDKNodeAlias NodeAnnouncementInfo_get_alias(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr);
28681 * Moniker assigned to the node.
28682 * May be invalid or malicious (eg control chars),
28683 * should not be exposed to the user.
28685 void NodeAnnouncementInfo_set_alias(struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr, struct LDKNodeAlias val);
28688 * Internet-level addresses via which one can connect to the node
28690 * Returns a copy of the field.
28692 struct LDKCVec_NetAddressZ NodeAnnouncementInfo_get_addresses(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr);
28695 * Internet-level addresses via which one can connect to the node
28697 void NodeAnnouncementInfo_set_addresses(struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr, struct LDKCVec_NetAddressZ val);
28700 * An initial announcement of the node
28701 * Mostly redundant with the data we store in fields explicitly.
28702 * Everything else is useful only for sending out for initial routing sync.
28703 * Not stored if contains excess data to prevent DoS.
28705 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
28707 struct LDKNodeAnnouncement NodeAnnouncementInfo_get_announcement_message(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr);
28710 * An initial announcement of the node
28711 * Mostly redundant with the data we store in fields explicitly.
28712 * Everything else is useful only for sending out for initial routing sync.
28713 * Not stored if contains excess data to prevent DoS.
28715 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
28717 void NodeAnnouncementInfo_set_announcement_message(struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr, struct LDKNodeAnnouncement val);
28720 * Constructs a new NodeAnnouncementInfo given each field
28722 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);
28725 * Creates a copy of the NodeAnnouncementInfo
28727 struct LDKNodeAnnouncementInfo NodeAnnouncementInfo_clone(const struct LDKNodeAnnouncementInfo *NONNULL_PTR orig);
28730 * Checks if two NodeAnnouncementInfos contain equal inner contents.
28731 * This ignores pointers and is_owned flags and looks at the values in fields.
28732 * Two objects with NULL inner values will be considered "equal" here.
28734 bool NodeAnnouncementInfo_eq(const struct LDKNodeAnnouncementInfo *NONNULL_PTR a, const struct LDKNodeAnnouncementInfo *NONNULL_PTR b);
28737 * Serialize the NodeAnnouncementInfo object into a byte array which can be read by NodeAnnouncementInfo_read
28739 struct LDKCVec_u8Z NodeAnnouncementInfo_write(const struct LDKNodeAnnouncementInfo *NONNULL_PTR obj);
28742 * Read a NodeAnnouncementInfo from a byte array, created by NodeAnnouncementInfo_write
28744 struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ NodeAnnouncementInfo_read(struct LDKu8slice ser);
28747 * Frees any resources used by the NodeAlias, if is_owned is set and inner is non-NULL.
28749 void NodeAlias_free(struct LDKNodeAlias this_obj);
28751 const uint8_t (*NodeAlias_get_a(const struct LDKNodeAlias *NONNULL_PTR this_ptr))[32];
28753 void NodeAlias_set_a(struct LDKNodeAlias *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
28756 * Constructs a new NodeAlias given each field
28758 MUST_USE_RES struct LDKNodeAlias NodeAlias_new(struct LDKThirtyTwoBytes a_arg);
28761 * Creates a copy of the NodeAlias
28763 struct LDKNodeAlias NodeAlias_clone(const struct LDKNodeAlias *NONNULL_PTR orig);
28766 * Checks if two NodeAliass contain equal inner contents.
28767 * This ignores pointers and is_owned flags and looks at the values in fields.
28768 * Two objects with NULL inner values will be considered "equal" here.
28770 bool NodeAlias_eq(const struct LDKNodeAlias *NONNULL_PTR a, const struct LDKNodeAlias *NONNULL_PTR b);
28773 * Serialize the NodeAlias object into a byte array which can be read by NodeAlias_read
28775 struct LDKCVec_u8Z NodeAlias_write(const struct LDKNodeAlias *NONNULL_PTR obj);
28778 * Read a NodeAlias from a byte array, created by NodeAlias_write
28780 struct LDKCResult_NodeAliasDecodeErrorZ NodeAlias_read(struct LDKu8slice ser);
28783 * Frees any resources used by the NodeInfo, if is_owned is set and inner is non-NULL.
28785 void NodeInfo_free(struct LDKNodeInfo this_obj);
28788 * All valid channels a node has announced
28790 * Returns a copy of the field.
28792 struct LDKCVec_u64Z NodeInfo_get_channels(const struct LDKNodeInfo *NONNULL_PTR this_ptr);
28795 * All valid channels a node has announced
28797 void NodeInfo_set_channels(struct LDKNodeInfo *NONNULL_PTR this_ptr, struct LDKCVec_u64Z val);
28800 * Lowest fees enabling routing via any of the enabled, known channels to a node.
28801 * The two fields (flat and proportional fee) are independent,
28802 * meaning they don't have to refer to the same channel.
28804 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
28806 struct LDKRoutingFees NodeInfo_get_lowest_inbound_channel_fees(const struct LDKNodeInfo *NONNULL_PTR this_ptr);
28809 * Lowest fees enabling routing via any of the enabled, known channels to a node.
28810 * The two fields (flat and proportional fee) are independent,
28811 * meaning they don't have to refer to the same channel.
28813 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
28815 void NodeInfo_set_lowest_inbound_channel_fees(struct LDKNodeInfo *NONNULL_PTR this_ptr, struct LDKRoutingFees val);
28818 * More information about a node from node_announcement.
28819 * Optional because we store a Node entry after learning about it from
28820 * a channel announcement, but before receiving a node announcement.
28822 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
28824 struct LDKNodeAnnouncementInfo NodeInfo_get_announcement_info(const struct LDKNodeInfo *NONNULL_PTR this_ptr);
28827 * More information about a node from node_announcement.
28828 * Optional because we store a Node entry after learning about it from
28829 * a channel announcement, but before receiving a node announcement.
28831 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
28833 void NodeInfo_set_announcement_info(struct LDKNodeInfo *NONNULL_PTR this_ptr, struct LDKNodeAnnouncementInfo val);
28836 * Constructs a new NodeInfo given each field
28838 MUST_USE_RES struct LDKNodeInfo NodeInfo_new(struct LDKCVec_u64Z channels_arg, struct LDKRoutingFees lowest_inbound_channel_fees_arg, struct LDKNodeAnnouncementInfo announcement_info_arg);
28841 * Creates a copy of the NodeInfo
28843 struct LDKNodeInfo NodeInfo_clone(const struct LDKNodeInfo *NONNULL_PTR orig);
28846 * Checks if two NodeInfos contain equal inner contents.
28847 * This ignores pointers and is_owned flags and looks at the values in fields.
28848 * Two objects with NULL inner values will be considered "equal" here.
28850 bool NodeInfo_eq(const struct LDKNodeInfo *NONNULL_PTR a, const struct LDKNodeInfo *NONNULL_PTR b);
28853 * Serialize the NodeInfo object into a byte array which can be read by NodeInfo_read
28855 struct LDKCVec_u8Z NodeInfo_write(const struct LDKNodeInfo *NONNULL_PTR obj);
28858 * Read a NodeInfo from a byte array, created by NodeInfo_write
28860 struct LDKCResult_NodeInfoDecodeErrorZ NodeInfo_read(struct LDKu8slice ser);
28863 * Serialize the NetworkGraph object into a byte array which can be read by NetworkGraph_read
28865 struct LDKCVec_u8Z NetworkGraph_write(const struct LDKNetworkGraph *NONNULL_PTR obj);
28868 * Read a NetworkGraph from a byte array, created by NetworkGraph_write
28870 struct LDKCResult_NetworkGraphDecodeErrorZ NetworkGraph_read(struct LDKu8slice ser, struct LDKLogger arg);
28873 * Creates a new, empty, network graph.
28875 MUST_USE_RES struct LDKNetworkGraph NetworkGraph_new(struct LDKThirtyTwoBytes genesis_hash, struct LDKLogger logger);
28878 * Returns a read-only view of the network graph.
28880 MUST_USE_RES struct LDKReadOnlyNetworkGraph NetworkGraph_read_only(const struct LDKNetworkGraph *NONNULL_PTR this_arg);
28883 * The unix timestamp provided by the most recent rapid gossip sync.
28884 * It will be set by the rapid sync process after every sync completion.
28886 MUST_USE_RES struct LDKCOption_u32Z NetworkGraph_get_last_rapid_gossip_sync_timestamp(const struct LDKNetworkGraph *NONNULL_PTR this_arg);
28889 * Update the unix timestamp provided by the most recent rapid gossip sync.
28890 * This should be done automatically by the rapid sync process after every sync completion.
28892 void NetworkGraph_set_last_rapid_gossip_sync_timestamp(const struct LDKNetworkGraph *NONNULL_PTR this_arg, uint32_t last_rapid_gossip_sync_timestamp);
28895 * For an already known node (from channel announcements), update its stored properties from a
28896 * given node announcement.
28898 * You probably don't want to call this directly, instead relying on a P2PGossipSync's
28899 * RoutingMessageHandler implementation to call it indirectly. This may be useful to accept
28900 * routing messages from a source using a protocol other than the lightning P2P protocol.
28902 MUST_USE_RES struct LDKCResult_NoneLightningErrorZ NetworkGraph_update_node_from_announcement(const struct LDKNetworkGraph *NONNULL_PTR this_arg, const struct LDKNodeAnnouncement *NONNULL_PTR msg);
28905 * For an already known node (from channel announcements), update its stored properties from a
28906 * given node announcement without verifying the associated signatures. Because we aren't
28907 * given the associated signatures here we cannot relay the node announcement to any of our
28910 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);
28913 * Store or update channel info from a channel announcement.
28915 * You probably don't want to call this directly, instead relying on a P2PGossipSync's
28916 * RoutingMessageHandler implementation to call it indirectly. This may be useful to accept
28917 * routing messages from a source using a protocol other than the lightning P2P protocol.
28919 * If a `chain::Access` object is provided via `chain_access`, it will be called to verify
28920 * the corresponding UTXO exists on chain and is correctly-formatted.
28922 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);
28925 * Store or update channel info from a channel announcement without verifying the associated
28926 * signatures. Because we aren't given the associated signatures here we cannot relay the
28927 * channel announcement to any of our peers.
28929 * If a `chain::Access` object is provided via `chain_access`, it will be called to verify
28930 * the corresponding UTXO exists on chain and is correctly-formatted.
28932 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);
28935 * Update channel from partial announcement data received via rapid gossip sync
28937 * `timestamp: u64`: Timestamp emulating the backdated original announcement receipt (by the
28938 * rapid gossip sync server)
28940 * All other parameters as used in [`msgs::UnsignedChannelAnnouncement`] fields.
28942 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);
28945 * Marks a channel in the graph as failed if a corresponding HTLC fail was sent.
28946 * If permanent, removes a channel from the local storage.
28947 * May cause the removal of nodes too, if this was their last channel.
28948 * If not permanent, makes channels unavailable for routing.
28950 void NetworkGraph_channel_failed(const struct LDKNetworkGraph *NONNULL_PTR this_arg, uint64_t short_channel_id, bool is_permanent);
28953 * Marks a node in the graph as permanently failed, effectively removing it and its channels
28954 * from local storage.
28956 void NetworkGraph_node_failed_permanent(const struct LDKNetworkGraph *NONNULL_PTR this_arg, struct LDKPublicKey node_id);
28959 * Removes information about channels that we haven't heard any updates about in some time.
28960 * This can be used regularly to prune the network graph of channels that likely no longer
28963 * While there is no formal requirement that nodes regularly re-broadcast their channel
28964 * updates every two weeks, the non-normative section of BOLT 7 currently suggests that
28965 * pruning occur for updates which are at least two weeks old, which we implement here.
28967 * Note that for users of the `lightning-background-processor` crate this method may be
28968 * automatically called regularly for you.
28970 * This method will also cause us to stop tracking removed nodes and channels if they have been
28971 * in the map for a while so that these can be resynced from gossip in the future.
28973 * This method is only available with the `std` feature. See
28974 * [`NetworkGraph::remove_stale_channels_and_tracking_with_time`] for `no-std` use.
28976 void NetworkGraph_remove_stale_channels_and_tracking(const struct LDKNetworkGraph *NONNULL_PTR this_arg);
28979 * Removes information about channels that we haven't heard any updates about in some time.
28980 * This can be used regularly to prune the network graph of channels that likely no longer
28983 * While there is no formal requirement that nodes regularly re-broadcast their channel
28984 * updates every two weeks, the non-normative section of BOLT 7 currently suggests that
28985 * pruning occur for updates which are at least two weeks old, which we implement here.
28987 * This method will also cause us to stop tracking removed nodes and channels if they have been
28988 * in the map for a while so that these can be resynced from gossip in the future.
28990 * This function takes the current unix time as an argument. For users with the `std` feature
28991 * enabled, [`NetworkGraph::remove_stale_channels_and_tracking`] may be preferable.
28993 void NetworkGraph_remove_stale_channels_and_tracking_with_time(const struct LDKNetworkGraph *NONNULL_PTR this_arg, uint64_t current_time_unix);
28996 * For an already known (from announcement) channel, update info about one of the directions
28999 * You probably don't want to call this directly, instead relying on a P2PGossipSync's
29000 * RoutingMessageHandler implementation to call it indirectly. This may be useful to accept
29001 * routing messages from a source using a protocol other than the lightning P2P protocol.
29003 * If built with `no-std`, any updates with a timestamp more than two weeks in the past or
29004 * materially in the future will be rejected.
29006 MUST_USE_RES struct LDKCResult_NoneLightningErrorZ NetworkGraph_update_channel(const struct LDKNetworkGraph *NONNULL_PTR this_arg, const struct LDKChannelUpdate *NONNULL_PTR msg);
29009 * For an already known (from announcement) channel, update info about one of the directions
29010 * of the channel without verifying the associated signatures. Because we aren't given the
29011 * associated signatures here we cannot relay the channel update to any of our peers.
29013 * If built with `no-std`, any updates with a timestamp more than two weeks in the past or
29014 * materially in the future will be rejected.
29016 MUST_USE_RES struct LDKCResult_NoneLightningErrorZ NetworkGraph_update_channel_unsigned(const struct LDKNetworkGraph *NONNULL_PTR this_arg, const struct LDKUnsignedChannelUpdate *NONNULL_PTR msg);
29019 * Returns information on a channel with the given id.
29021 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
29023 MUST_USE_RES struct LDKChannelInfo ReadOnlyNetworkGraph_channel(const struct LDKReadOnlyNetworkGraph *NONNULL_PTR this_arg, uint64_t short_channel_id);
29026 * Returns the list of channels in the graph
29028 MUST_USE_RES struct LDKCVec_u64Z ReadOnlyNetworkGraph_list_channels(const struct LDKReadOnlyNetworkGraph *NONNULL_PTR this_arg);
29031 * Returns information on a node with the given id.
29033 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
29035 MUST_USE_RES struct LDKNodeInfo ReadOnlyNetworkGraph_node(const struct LDKReadOnlyNetworkGraph *NONNULL_PTR this_arg, const struct LDKNodeId *NONNULL_PTR node_id);
29038 * Returns the list of nodes in the graph
29040 MUST_USE_RES struct LDKCVec_NodeIdZ ReadOnlyNetworkGraph_list_nodes(const struct LDKReadOnlyNetworkGraph *NONNULL_PTR this_arg);
29043 * Get network addresses by node id.
29044 * Returns None if the requested node is completely unknown,
29045 * or if node announcement for the node was never received.
29047 MUST_USE_RES struct LDKCOption_CVec_NetAddressZZ ReadOnlyNetworkGraph_get_addresses(const struct LDKReadOnlyNetworkGraph *NONNULL_PTR this_arg, struct LDKPublicKey pubkey);
29050 * Frees any resources used by the RouteHop, if is_owned is set and inner is non-NULL.
29052 void RouteHop_free(struct LDKRouteHop this_obj);
29055 * The node_id of the node at this hop.
29057 struct LDKPublicKey RouteHop_get_pubkey(const struct LDKRouteHop *NONNULL_PTR this_ptr);
29060 * The node_id of the node at this hop.
29062 void RouteHop_set_pubkey(struct LDKRouteHop *NONNULL_PTR this_ptr, struct LDKPublicKey val);
29065 * The node_announcement features of the node at this hop. For the last hop, these may be
29066 * amended to match the features present in the invoice this node generated.
29068 struct LDKNodeFeatures RouteHop_get_node_features(const struct LDKRouteHop *NONNULL_PTR this_ptr);
29071 * The node_announcement features of the node at this hop. For the last hop, these may be
29072 * amended to match the features present in the invoice this node generated.
29074 void RouteHop_set_node_features(struct LDKRouteHop *NONNULL_PTR this_ptr, struct LDKNodeFeatures val);
29077 * The channel that should be used from the previous hop to reach this node.
29079 uint64_t RouteHop_get_short_channel_id(const struct LDKRouteHop *NONNULL_PTR this_ptr);
29082 * The channel that should be used from the previous hop to reach this node.
29084 void RouteHop_set_short_channel_id(struct LDKRouteHop *NONNULL_PTR this_ptr, uint64_t val);
29087 * The channel_announcement features of the channel that should be used from the previous hop
29088 * to reach this node.
29090 struct LDKChannelFeatures RouteHop_get_channel_features(const struct LDKRouteHop *NONNULL_PTR this_ptr);
29093 * The channel_announcement features of the channel that should be used from the previous hop
29094 * to reach this node.
29096 void RouteHop_set_channel_features(struct LDKRouteHop *NONNULL_PTR this_ptr, struct LDKChannelFeatures val);
29099 * The fee taken on this hop (for paying for the use of the *next* channel in the path).
29100 * For the last hop, this should be the full value of the payment (might be more than
29101 * requested if we had to match htlc_minimum_msat).
29103 uint64_t RouteHop_get_fee_msat(const struct LDKRouteHop *NONNULL_PTR this_ptr);
29106 * The fee taken on this hop (for paying for the use of the *next* channel in the path).
29107 * For the last hop, this should be the full value of the payment (might be more than
29108 * requested if we had to match htlc_minimum_msat).
29110 void RouteHop_set_fee_msat(struct LDKRouteHop *NONNULL_PTR this_ptr, uint64_t val);
29113 * The CLTV delta added for this hop. For the last hop, this should be the full CLTV value
29114 * expected at the destination, in excess of the current block height.
29116 uint32_t RouteHop_get_cltv_expiry_delta(const struct LDKRouteHop *NONNULL_PTR this_ptr);
29119 * The CLTV delta added for this hop. For the last hop, this should be the full CLTV value
29120 * expected at the destination, in excess of the current block height.
29122 void RouteHop_set_cltv_expiry_delta(struct LDKRouteHop *NONNULL_PTR this_ptr, uint32_t val);
29125 * Constructs a new RouteHop given each field
29127 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);
29130 * Creates a copy of the RouteHop
29132 struct LDKRouteHop RouteHop_clone(const struct LDKRouteHop *NONNULL_PTR orig);
29135 * Checks if two RouteHops contain equal inner contents.
29137 uint64_t RouteHop_hash(const struct LDKRouteHop *NONNULL_PTR o);
29140 * Checks if two RouteHops contain equal inner contents.
29141 * This ignores pointers and is_owned flags and looks at the values in fields.
29142 * Two objects with NULL inner values will be considered "equal" here.
29144 bool RouteHop_eq(const struct LDKRouteHop *NONNULL_PTR a, const struct LDKRouteHop *NONNULL_PTR b);
29147 * Serialize the RouteHop object into a byte array which can be read by RouteHop_read
29149 struct LDKCVec_u8Z RouteHop_write(const struct LDKRouteHop *NONNULL_PTR obj);
29152 * Read a RouteHop from a byte array, created by RouteHop_write
29154 struct LDKCResult_RouteHopDecodeErrorZ RouteHop_read(struct LDKu8slice ser);
29157 * Frees any resources used by the Route, if is_owned is set and inner is non-NULL.
29159 void Route_free(struct LDKRoute this_obj);
29162 * The list of routes taken for a single (potentially-)multi-part payment. The pubkey of the
29163 * last RouteHop in each path must be the same. Each entry represents a list of hops, NOT
29164 * INCLUDING our own, where the last hop is the destination. Thus, this must always be at
29165 * least length one. While the maximum length of any given path is variable, keeping the length
29166 * of any path less or equal to 19 should currently ensure it is viable.
29168 struct LDKCVec_CVec_RouteHopZZ Route_get_paths(const struct LDKRoute *NONNULL_PTR this_ptr);
29171 * The list of routes taken for a single (potentially-)multi-part payment. The pubkey of the
29172 * last RouteHop in each path must be the same. Each entry represents a list of hops, NOT
29173 * INCLUDING our own, where the last hop is the destination. Thus, this must always be at
29174 * least length one. While the maximum length of any given path is variable, keeping the length
29175 * of any path less or equal to 19 should currently ensure it is viable.
29177 void Route_set_paths(struct LDKRoute *NONNULL_PTR this_ptr, struct LDKCVec_CVec_RouteHopZZ val);
29180 * The `payment_params` parameter passed to [`find_route`].
29181 * This is used by `ChannelManager` to track information which may be required for retries,
29182 * provided back to you via [`Event::PaymentPathFailed`].
29184 * [`Event::PaymentPathFailed`]: crate::util::events::Event::PaymentPathFailed
29186 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
29188 struct LDKPaymentParameters Route_get_payment_params(const struct LDKRoute *NONNULL_PTR this_ptr);
29191 * The `payment_params` parameter passed to [`find_route`].
29192 * This is used by `ChannelManager` to track information which may be required for retries,
29193 * provided back to you via [`Event::PaymentPathFailed`].
29195 * [`Event::PaymentPathFailed`]: crate::util::events::Event::PaymentPathFailed
29197 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
29199 void Route_set_payment_params(struct LDKRoute *NONNULL_PTR this_ptr, struct LDKPaymentParameters val);
29202 * Constructs a new Route given each field
29204 MUST_USE_RES struct LDKRoute Route_new(struct LDKCVec_CVec_RouteHopZZ paths_arg, struct LDKPaymentParameters payment_params_arg);
29207 * Creates a copy of the Route
29209 struct LDKRoute Route_clone(const struct LDKRoute *NONNULL_PTR orig);
29212 * Checks if two Routes contain equal inner contents.
29214 uint64_t Route_hash(const struct LDKRoute *NONNULL_PTR o);
29217 * Checks if two Routes contain equal inner contents.
29218 * This ignores pointers and is_owned flags and looks at the values in fields.
29219 * Two objects with NULL inner values will be considered "equal" here.
29221 bool Route_eq(const struct LDKRoute *NONNULL_PTR a, const struct LDKRoute *NONNULL_PTR b);
29224 * Returns the total amount of fees paid on this [`Route`].
29226 * This doesn't include any extra payment made to the recipient, which can happen in excess of
29227 * the amount passed to [`find_route`]'s `params.final_value_msat`.
29229 MUST_USE_RES uint64_t Route_get_total_fees(const struct LDKRoute *NONNULL_PTR this_arg);
29232 * Returns the total amount paid on this [`Route`], excluding the fees.
29234 MUST_USE_RES uint64_t Route_get_total_amount(const struct LDKRoute *NONNULL_PTR this_arg);
29237 * Serialize the Route object into a byte array which can be read by Route_read
29239 struct LDKCVec_u8Z Route_write(const struct LDKRoute *NONNULL_PTR obj);
29242 * Read a Route from a byte array, created by Route_write
29244 struct LDKCResult_RouteDecodeErrorZ Route_read(struct LDKu8slice ser);
29247 * Frees any resources used by the RouteParameters, if is_owned is set and inner is non-NULL.
29249 void RouteParameters_free(struct LDKRouteParameters this_obj);
29252 * The parameters of the failed payment path.
29254 struct LDKPaymentParameters RouteParameters_get_payment_params(const struct LDKRouteParameters *NONNULL_PTR this_ptr);
29257 * The parameters of the failed payment path.
29259 void RouteParameters_set_payment_params(struct LDKRouteParameters *NONNULL_PTR this_ptr, struct LDKPaymentParameters val);
29262 * The amount in msats sent on the failed payment path.
29264 uint64_t RouteParameters_get_final_value_msat(const struct LDKRouteParameters *NONNULL_PTR this_ptr);
29267 * The amount in msats sent on the failed payment path.
29269 void RouteParameters_set_final_value_msat(struct LDKRouteParameters *NONNULL_PTR this_ptr, uint64_t val);
29272 * The CLTV on the final hop of the failed payment path.
29274 uint32_t RouteParameters_get_final_cltv_expiry_delta(const struct LDKRouteParameters *NONNULL_PTR this_ptr);
29277 * The CLTV on the final hop of the failed payment path.
29279 void RouteParameters_set_final_cltv_expiry_delta(struct LDKRouteParameters *NONNULL_PTR this_ptr, uint32_t val);
29282 * Constructs a new RouteParameters given each field
29284 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);
29287 * Creates a copy of the RouteParameters
29289 struct LDKRouteParameters RouteParameters_clone(const struct LDKRouteParameters *NONNULL_PTR orig);
29292 * Serialize the RouteParameters object into a byte array which can be read by RouteParameters_read
29294 struct LDKCVec_u8Z RouteParameters_write(const struct LDKRouteParameters *NONNULL_PTR obj);
29297 * Read a RouteParameters from a byte array, created by RouteParameters_write
29299 struct LDKCResult_RouteParametersDecodeErrorZ RouteParameters_read(struct LDKu8slice ser);
29302 * Frees any resources used by the PaymentParameters, if is_owned is set and inner is non-NULL.
29304 void PaymentParameters_free(struct LDKPaymentParameters this_obj);
29307 * The node id of the payee.
29309 struct LDKPublicKey PaymentParameters_get_payee_pubkey(const struct LDKPaymentParameters *NONNULL_PTR this_ptr);
29312 * The node id of the payee.
29314 void PaymentParameters_set_payee_pubkey(struct LDKPaymentParameters *NONNULL_PTR this_ptr, struct LDKPublicKey val);
29317 * Features supported by the payee.
29319 * May be set from the payee's invoice or via [`for_keysend`]. May be `None` if the invoice
29320 * does not contain any features.
29322 * [`for_keysend`]: Self::for_keysend
29324 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
29326 struct LDKInvoiceFeatures PaymentParameters_get_features(const struct LDKPaymentParameters *NONNULL_PTR this_ptr);
29329 * Features supported by the payee.
29331 * May be set from the payee's invoice or via [`for_keysend`]. May be `None` if the invoice
29332 * does not contain any features.
29334 * [`for_keysend`]: Self::for_keysend
29336 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
29338 void PaymentParameters_set_features(struct LDKPaymentParameters *NONNULL_PTR this_ptr, struct LDKInvoiceFeatures val);
29341 * Hints for routing to the payee, containing channels connecting the payee to public nodes.
29343 struct LDKCVec_RouteHintZ PaymentParameters_get_route_hints(const struct LDKPaymentParameters *NONNULL_PTR this_ptr);
29346 * Hints for routing to the payee, containing channels connecting the payee to public nodes.
29348 void PaymentParameters_set_route_hints(struct LDKPaymentParameters *NONNULL_PTR this_ptr, struct LDKCVec_RouteHintZ val);
29351 * Expiration of a payment to the payee, in seconds relative to the UNIX epoch.
29353 struct LDKCOption_u64Z PaymentParameters_get_expiry_time(const struct LDKPaymentParameters *NONNULL_PTR this_ptr);
29356 * Expiration of a payment to the payee, in seconds relative to the UNIX epoch.
29358 void PaymentParameters_set_expiry_time(struct LDKPaymentParameters *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
29361 * The maximum total CLTV delta we accept for the route.
29362 * Defaults to [`DEFAULT_MAX_TOTAL_CLTV_EXPIRY_DELTA`].
29364 uint32_t PaymentParameters_get_max_total_cltv_expiry_delta(const struct LDKPaymentParameters *NONNULL_PTR this_ptr);
29367 * The maximum total CLTV delta we accept for the route.
29368 * Defaults to [`DEFAULT_MAX_TOTAL_CLTV_EXPIRY_DELTA`].
29370 void PaymentParameters_set_max_total_cltv_expiry_delta(struct LDKPaymentParameters *NONNULL_PTR this_ptr, uint32_t val);
29373 * The maximum number of paths that may be used by (MPP) payments.
29374 * Defaults to [`DEFAULT_MAX_PATH_COUNT`].
29376 uint8_t PaymentParameters_get_max_path_count(const struct LDKPaymentParameters *NONNULL_PTR this_ptr);
29379 * The maximum number of paths that may be used by (MPP) payments.
29380 * Defaults to [`DEFAULT_MAX_PATH_COUNT`].
29382 void PaymentParameters_set_max_path_count(struct LDKPaymentParameters *NONNULL_PTR this_ptr, uint8_t val);
29385 * Selects the maximum share of a channel's total capacity which will be sent over a channel,
29386 * as a power of 1/2. A higher value prefers to send the payment using more MPP parts whereas
29387 * a lower value prefers to send larger MPP parts, potentially saturating channels and
29388 * increasing failure probability for those paths.
29390 * Note that this restriction will be relaxed during pathfinding after paths which meet this
29391 * restriction have been found. While paths which meet this criteria will be searched for, it
29392 * is ultimately up to the scorer to select them over other paths.
29394 * A value of 0 will allow payments up to and including a channel's total announced usable
29395 * capacity, a value of one will only use up to half its capacity, two 1/4, etc.
29399 uint8_t PaymentParameters_get_max_channel_saturation_power_of_half(const struct LDKPaymentParameters *NONNULL_PTR this_ptr);
29402 * Selects the maximum share of a channel's total capacity which will be sent over a channel,
29403 * as a power of 1/2. A higher value prefers to send the payment using more MPP parts whereas
29404 * a lower value prefers to send larger MPP parts, potentially saturating channels and
29405 * increasing failure probability for those paths.
29407 * Note that this restriction will be relaxed during pathfinding after paths which meet this
29408 * restriction have been found. While paths which meet this criteria will be searched for, it
29409 * is ultimately up to the scorer to select them over other paths.
29411 * A value of 0 will allow payments up to and including a channel's total announced usable
29412 * capacity, a value of one will only use up to half its capacity, two 1/4, etc.
29416 void PaymentParameters_set_max_channel_saturation_power_of_half(struct LDKPaymentParameters *NONNULL_PTR this_ptr, uint8_t val);
29419 * A list of SCIDs which this payment was previously attempted over and which caused the
29420 * payment to fail. Future attempts for the same payment shouldn't be relayed through any of
29423 * Returns a copy of the field.
29425 struct LDKCVec_u64Z PaymentParameters_get_previously_failed_channels(const struct LDKPaymentParameters *NONNULL_PTR this_ptr);
29428 * A list of SCIDs which this payment was previously attempted over and which caused the
29429 * payment to fail. Future attempts for the same payment shouldn't be relayed through any of
29432 void PaymentParameters_set_previously_failed_channels(struct LDKPaymentParameters *NONNULL_PTR this_ptr, struct LDKCVec_u64Z val);
29435 * Constructs a new PaymentParameters given each field
29437 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);
29440 * Creates a copy of the PaymentParameters
29442 struct LDKPaymentParameters PaymentParameters_clone(const struct LDKPaymentParameters *NONNULL_PTR orig);
29445 * Checks if two PaymentParameterss contain equal inner contents.
29447 uint64_t PaymentParameters_hash(const struct LDKPaymentParameters *NONNULL_PTR o);
29450 * Checks if two PaymentParameterss contain equal inner contents.
29451 * This ignores pointers and is_owned flags and looks at the values in fields.
29452 * Two objects with NULL inner values will be considered "equal" here.
29454 bool PaymentParameters_eq(const struct LDKPaymentParameters *NONNULL_PTR a, const struct LDKPaymentParameters *NONNULL_PTR b);
29457 * Serialize the PaymentParameters object into a byte array which can be read by PaymentParameters_read
29459 struct LDKCVec_u8Z PaymentParameters_write(const struct LDKPaymentParameters *NONNULL_PTR obj);
29462 * Read a PaymentParameters from a byte array, created by PaymentParameters_write
29464 struct LDKCResult_PaymentParametersDecodeErrorZ PaymentParameters_read(struct LDKu8slice ser);
29467 * Creates a payee with the node id of the given `pubkey`.
29469 MUST_USE_RES struct LDKPaymentParameters PaymentParameters_from_node_id(struct LDKPublicKey payee_pubkey);
29472 * Creates a payee with the node id of the given `pubkey` to use for keysend payments.
29474 MUST_USE_RES struct LDKPaymentParameters PaymentParameters_for_keysend(struct LDKPublicKey payee_pubkey);
29477 * Frees any resources used by the RouteHint, if is_owned is set and inner is non-NULL.
29479 void RouteHint_free(struct LDKRouteHint this_obj);
29481 struct LDKCVec_RouteHintHopZ RouteHint_get_a(const struct LDKRouteHint *NONNULL_PTR this_ptr);
29483 void RouteHint_set_a(struct LDKRouteHint *NONNULL_PTR this_ptr, struct LDKCVec_RouteHintHopZ val);
29486 * Constructs a new RouteHint given each field
29488 MUST_USE_RES struct LDKRouteHint RouteHint_new(struct LDKCVec_RouteHintHopZ a_arg);
29491 * Creates a copy of the RouteHint
29493 struct LDKRouteHint RouteHint_clone(const struct LDKRouteHint *NONNULL_PTR orig);
29496 * Checks if two RouteHints contain equal inner contents.
29498 uint64_t RouteHint_hash(const struct LDKRouteHint *NONNULL_PTR o);
29501 * Checks if two RouteHints contain equal inner contents.
29502 * This ignores pointers and is_owned flags and looks at the values in fields.
29503 * Two objects with NULL inner values will be considered "equal" here.
29505 bool RouteHint_eq(const struct LDKRouteHint *NONNULL_PTR a, const struct LDKRouteHint *NONNULL_PTR b);
29508 * Serialize the RouteHint object into a byte array which can be read by RouteHint_read
29510 struct LDKCVec_u8Z RouteHint_write(const struct LDKRouteHint *NONNULL_PTR obj);
29513 * Read a RouteHint from a byte array, created by RouteHint_write
29515 struct LDKCResult_RouteHintDecodeErrorZ RouteHint_read(struct LDKu8slice ser);
29518 * Frees any resources used by the RouteHintHop, if is_owned is set and inner is non-NULL.
29520 void RouteHintHop_free(struct LDKRouteHintHop this_obj);
29523 * The node_id of the non-target end of the route
29525 struct LDKPublicKey RouteHintHop_get_src_node_id(const struct LDKRouteHintHop *NONNULL_PTR this_ptr);
29528 * The node_id of the non-target end of the route
29530 void RouteHintHop_set_src_node_id(struct LDKRouteHintHop *NONNULL_PTR this_ptr, struct LDKPublicKey val);
29533 * The short_channel_id of this channel
29535 uint64_t RouteHintHop_get_short_channel_id(const struct LDKRouteHintHop *NONNULL_PTR this_ptr);
29538 * The short_channel_id of this channel
29540 void RouteHintHop_set_short_channel_id(struct LDKRouteHintHop *NONNULL_PTR this_ptr, uint64_t val);
29543 * The fees which must be paid to use this channel
29545 struct LDKRoutingFees RouteHintHop_get_fees(const struct LDKRouteHintHop *NONNULL_PTR this_ptr);
29548 * The fees which must be paid to use this channel
29550 void RouteHintHop_set_fees(struct LDKRouteHintHop *NONNULL_PTR this_ptr, struct LDKRoutingFees val);
29553 * The difference in CLTV values between this node and the next node.
29555 uint16_t RouteHintHop_get_cltv_expiry_delta(const struct LDKRouteHintHop *NONNULL_PTR this_ptr);
29558 * The difference in CLTV values between this node and the next node.
29560 void RouteHintHop_set_cltv_expiry_delta(struct LDKRouteHintHop *NONNULL_PTR this_ptr, uint16_t val);
29563 * The minimum value, in msat, which must be relayed to the next hop.
29565 struct LDKCOption_u64Z RouteHintHop_get_htlc_minimum_msat(const struct LDKRouteHintHop *NONNULL_PTR this_ptr);
29568 * The minimum value, in msat, which must be relayed to the next hop.
29570 void RouteHintHop_set_htlc_minimum_msat(struct LDKRouteHintHop *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
29573 * The maximum value in msat available for routing with a single HTLC.
29575 struct LDKCOption_u64Z RouteHintHop_get_htlc_maximum_msat(const struct LDKRouteHintHop *NONNULL_PTR this_ptr);
29578 * The maximum value in msat available for routing with a single HTLC.
29580 void RouteHintHop_set_htlc_maximum_msat(struct LDKRouteHintHop *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
29583 * Constructs a new RouteHintHop given each field
29585 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);
29588 * Creates a copy of the RouteHintHop
29590 struct LDKRouteHintHop RouteHintHop_clone(const struct LDKRouteHintHop *NONNULL_PTR orig);
29593 * Checks if two RouteHintHops contain equal inner contents.
29595 uint64_t RouteHintHop_hash(const struct LDKRouteHintHop *NONNULL_PTR o);
29598 * Checks if two RouteHintHops contain equal inner contents.
29599 * This ignores pointers and is_owned flags and looks at the values in fields.
29600 * Two objects with NULL inner values will be considered "equal" here.
29602 bool RouteHintHop_eq(const struct LDKRouteHintHop *NONNULL_PTR a, const struct LDKRouteHintHop *NONNULL_PTR b);
29605 * Serialize the RouteHintHop object into a byte array which can be read by RouteHintHop_read
29607 struct LDKCVec_u8Z RouteHintHop_write(const struct LDKRouteHintHop *NONNULL_PTR obj);
29610 * Read a RouteHintHop from a byte array, created by RouteHintHop_write
29612 struct LDKCResult_RouteHintHopDecodeErrorZ RouteHintHop_read(struct LDKu8slice ser);
29615 * Finds a route from us (payer) to the given target node (payee).
29617 * If the payee provided features in their invoice, they should be provided via `params.payee`.
29618 * Without this, MPP will only be used if the payee's features are available in the network graph.
29620 * Private routing paths between a public node and the target may be included in `params.payee`.
29622 * If some channels aren't announced, it may be useful to fill in `first_hops` with the results
29623 * from [`ChannelManager::list_usable_channels`]. If it is filled in, the view of these channels
29624 * from `network_graph` will be ignored, and only those in `first_hops` will be used.
29626 * The fees on channels from us to the next hop are ignored as they are assumed to all be equal.
29627 * However, the enabled/disabled bit on such channels as well as the `htlc_minimum_msat` /
29628 * `htlc_maximum_msat` *are* checked as they may change based on the receiving node.
29632 * May be used to re-compute a [`Route`] when handling a [`Event::PaymentPathFailed`]. Any
29633 * adjustments to the [`NetworkGraph`] and channel scores should be made prior to calling this
29638 * Panics if first_hops contains channels without short_channel_ids;
29639 * [`ChannelManager::list_usable_channels`] will never include such channels.
29641 * [`ChannelManager::list_usable_channels`]: crate::ln::channelmanager::ChannelManager::list_usable_channels
29642 * [`Event::PaymentPathFailed`]: crate::util::events::Event::PaymentPathFailed
29643 * [`NetworkGraph`]: crate::routing::gossip::NetworkGraph
29645 * Note that first_hops (or a relevant inner pointer) may be NULL or all-0s to represent None
29647 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]);
29650 * Construct a route from us (payer) to the target node (payee) via the given hops (which should
29651 * exclude the payer, but include the payee). This may be useful, e.g., for probing the chosen path.
29653 * Re-uses logic from `find_route`, so the restrictions described there also apply here.
29655 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]);
29658 * Calls the free function if one is set
29660 void Score_free(struct LDKScore this_ptr);
29663 * Calls the free function if one is set
29665 void LockableScore_free(struct LDKLockableScore this_ptr);
29668 * Calls the free function if one is set
29670 void WriteableScore_free(struct LDKWriteableScore this_ptr);
29673 * Frees any resources used by the MultiThreadedLockableScore, if is_owned is set and inner is non-NULL.
29675 void MultiThreadedLockableScore_free(struct LDKMultiThreadedLockableScore this_obj);
29678 * Frees any resources used by the MultiThreadedScoreLock, if is_owned is set and inner is non-NULL.
29680 void MultiThreadedScoreLock_free(struct LDKMultiThreadedScoreLock this_obj);
29683 * Constructs a new Score which calls the relevant methods on this_arg.
29684 * This copies the `inner` pointer in this_arg and thus the returned Score must be freed before this_arg is
29686 struct LDKScore MultiThreadedScoreLock_as_Score(const struct LDKMultiThreadedScoreLock *NONNULL_PTR this_arg);
29689 * Serialize the MultiThreadedScoreLock object into a byte array which can be read by MultiThreadedScoreLock_read
29691 struct LDKCVec_u8Z MultiThreadedScoreLock_write(const struct LDKMultiThreadedScoreLock *NONNULL_PTR obj);
29694 * Constructs a new LockableScore which calls the relevant methods on this_arg.
29695 * This copies the `inner` pointer in this_arg and thus the returned LockableScore must be freed before this_arg is
29697 struct LDKLockableScore MultiThreadedLockableScore_as_LockableScore(const struct LDKMultiThreadedLockableScore *NONNULL_PTR this_arg);
29700 * Serialize the MultiThreadedLockableScore object into a byte array which can be read by MultiThreadedLockableScore_read
29702 struct LDKCVec_u8Z MultiThreadedLockableScore_write(const struct LDKMultiThreadedLockableScore *NONNULL_PTR obj);
29705 * Constructs a new WriteableScore which calls the relevant methods on this_arg.
29706 * This copies the `inner` pointer in this_arg and thus the returned WriteableScore must be freed before this_arg is
29708 struct LDKWriteableScore MultiThreadedLockableScore_as_WriteableScore(const struct LDKMultiThreadedLockableScore *NONNULL_PTR this_arg);
29711 * Creates a new [`MultiThreadedLockableScore`] given an underlying [`Score`].
29713 MUST_USE_RES struct LDKMultiThreadedLockableScore MultiThreadedLockableScore_new(struct LDKScore score);
29716 * Frees any resources used by the ChannelUsage, if is_owned is set and inner is non-NULL.
29718 void ChannelUsage_free(struct LDKChannelUsage this_obj);
29721 * The amount to send through the channel, denominated in millisatoshis.
29723 uint64_t ChannelUsage_get_amount_msat(const struct LDKChannelUsage *NONNULL_PTR this_ptr);
29726 * The amount to send through the channel, denominated in millisatoshis.
29728 void ChannelUsage_set_amount_msat(struct LDKChannelUsage *NONNULL_PTR this_ptr, uint64_t val);
29731 * Total amount, denominated in millisatoshis, already allocated to send through the channel
29732 * as part of a multi-path payment.
29734 uint64_t ChannelUsage_get_inflight_htlc_msat(const struct LDKChannelUsage *NONNULL_PTR this_ptr);
29737 * Total amount, denominated in millisatoshis, already allocated to send through the channel
29738 * as part of a multi-path payment.
29740 void ChannelUsage_set_inflight_htlc_msat(struct LDKChannelUsage *NONNULL_PTR this_ptr, uint64_t val);
29743 * The effective capacity of the channel.
29745 struct LDKEffectiveCapacity ChannelUsage_get_effective_capacity(const struct LDKChannelUsage *NONNULL_PTR this_ptr);
29748 * The effective capacity of the channel.
29750 void ChannelUsage_set_effective_capacity(struct LDKChannelUsage *NONNULL_PTR this_ptr, struct LDKEffectiveCapacity val);
29753 * Constructs a new ChannelUsage given each field
29755 MUST_USE_RES struct LDKChannelUsage ChannelUsage_new(uint64_t amount_msat_arg, uint64_t inflight_htlc_msat_arg, struct LDKEffectiveCapacity effective_capacity_arg);
29758 * Creates a copy of the ChannelUsage
29760 struct LDKChannelUsage ChannelUsage_clone(const struct LDKChannelUsage *NONNULL_PTR orig);
29763 * Frees any resources used by the FixedPenaltyScorer, if is_owned is set and inner is non-NULL.
29765 void FixedPenaltyScorer_free(struct LDKFixedPenaltyScorer this_obj);
29768 * Creates a copy of the FixedPenaltyScorer
29770 struct LDKFixedPenaltyScorer FixedPenaltyScorer_clone(const struct LDKFixedPenaltyScorer *NONNULL_PTR orig);
29773 * Creates a new scorer using `penalty_msat`.
29775 MUST_USE_RES struct LDKFixedPenaltyScorer FixedPenaltyScorer_with_penalty(uint64_t penalty_msat);
29778 * Constructs a new Score which calls the relevant methods on this_arg.
29779 * This copies the `inner` pointer in this_arg and thus the returned Score must be freed before this_arg is
29781 struct LDKScore FixedPenaltyScorer_as_Score(const struct LDKFixedPenaltyScorer *NONNULL_PTR this_arg);
29784 * Serialize the FixedPenaltyScorer object into a byte array which can be read by FixedPenaltyScorer_read
29786 struct LDKCVec_u8Z FixedPenaltyScorer_write(const struct LDKFixedPenaltyScorer *NONNULL_PTR obj);
29789 * Read a FixedPenaltyScorer from a byte array, created by FixedPenaltyScorer_write
29791 struct LDKCResult_FixedPenaltyScorerDecodeErrorZ FixedPenaltyScorer_read(struct LDKu8slice ser, uint64_t arg);
29794 * Frees any resources used by the ProbabilisticScorer, if is_owned is set and inner is non-NULL.
29796 void ProbabilisticScorer_free(struct LDKProbabilisticScorer this_obj);
29799 * Frees any resources used by the ProbabilisticScoringParameters, if is_owned is set and inner is non-NULL.
29801 void ProbabilisticScoringParameters_free(struct LDKProbabilisticScoringParameters this_obj);
29804 * A fixed penalty in msats to apply to each channel.
29806 * Default value: 500 msat
29808 uint64_t ProbabilisticScoringParameters_get_base_penalty_msat(const struct LDKProbabilisticScoringParameters *NONNULL_PTR this_ptr);
29811 * A fixed penalty in msats to apply to each channel.
29813 * Default value: 500 msat
29815 void ProbabilisticScoringParameters_set_base_penalty_msat(struct LDKProbabilisticScoringParameters *NONNULL_PTR this_ptr, uint64_t val);
29818 * A multiplier used with the payment amount to calculate a fixed penalty applied to each
29819 * channel, in excess of the [`base_penalty_msat`].
29821 * The purpose of the amount penalty is to avoid having fees dominate the channel cost (i.e.,
29822 * fees plus penalty) for large payments. The penalty is computed as the product of this
29823 * multiplier and `2^30`ths of the payment amount.
29825 * ie `base_penalty_amount_multiplier_msat * amount_msat / 2^30`
29827 * Default value: 8,192 msat
29829 * [`base_penalty_msat`]: Self::base_penalty_msat
29831 uint64_t ProbabilisticScoringParameters_get_base_penalty_amount_multiplier_msat(const struct LDKProbabilisticScoringParameters *NONNULL_PTR this_ptr);
29834 * A multiplier used with the payment amount to calculate a fixed penalty applied to each
29835 * channel, in excess of the [`base_penalty_msat`].
29837 * The purpose of the amount penalty is to avoid having fees dominate the channel cost (i.e.,
29838 * fees plus penalty) for large payments. The penalty is computed as the product of this
29839 * multiplier and `2^30`ths of the payment amount.
29841 * ie `base_penalty_amount_multiplier_msat * amount_msat / 2^30`
29843 * Default value: 8,192 msat
29845 * [`base_penalty_msat`]: Self::base_penalty_msat
29847 void ProbabilisticScoringParameters_set_base_penalty_amount_multiplier_msat(struct LDKProbabilisticScoringParameters *NONNULL_PTR this_ptr, uint64_t val);
29850 * A multiplier used in conjunction with the negative `log10` of the channel's success
29851 * probability for a payment, as determined by our latest estimates of the channel's
29852 * liquidity, to determine the liquidity penalty.
29854 * The penalty is based in part on the knowledge learned from prior successful and unsuccessful
29855 * payments. This knowledge is decayed over time based on [`liquidity_offset_half_life`]. The
29856 * penalty is effectively limited to `2 * liquidity_penalty_multiplier_msat` (corresponding to
29857 * lower bounding the success probability to `0.01`) when the amount falls within the
29858 * uncertainty bounds of the channel liquidity balance. Amounts above the upper bound will
29859 * result in a `u64::max_value` penalty, however.
29861 * `-log10(success_probability) * liquidity_penalty_multiplier_msat`
29863 * Default value: 30,000 msat
29865 * [`liquidity_offset_half_life`]: Self::liquidity_offset_half_life
29867 uint64_t ProbabilisticScoringParameters_get_liquidity_penalty_multiplier_msat(const struct LDKProbabilisticScoringParameters *NONNULL_PTR this_ptr);
29870 * A multiplier used in conjunction with the negative `log10` of the channel's success
29871 * probability for a payment, as determined by our latest estimates of the channel's
29872 * liquidity, to determine the liquidity penalty.
29874 * The penalty is based in part on the knowledge learned from prior successful and unsuccessful
29875 * payments. This knowledge is decayed over time based on [`liquidity_offset_half_life`]. The
29876 * penalty is effectively limited to `2 * liquidity_penalty_multiplier_msat` (corresponding to
29877 * lower bounding the success probability to `0.01`) when the amount falls within the
29878 * uncertainty bounds of the channel liquidity balance. Amounts above the upper bound will
29879 * result in a `u64::max_value` penalty, however.
29881 * `-log10(success_probability) * liquidity_penalty_multiplier_msat`
29883 * Default value: 30,000 msat
29885 * [`liquidity_offset_half_life`]: Self::liquidity_offset_half_life
29887 void ProbabilisticScoringParameters_set_liquidity_penalty_multiplier_msat(struct LDKProbabilisticScoringParameters *NONNULL_PTR this_ptr, uint64_t val);
29890 * Whenever this amount of time elapses since the last update to a channel's liquidity bounds,
29891 * the distance from the bounds to \"zero\" is cut in half. In other words, the lower-bound on
29892 * the available liquidity is halved and the upper-bound moves half-way to the channel's total
29895 * Because halving the liquidity bounds grows the uncertainty on the channel's liquidity,
29896 * the penalty for an amount within the new bounds may change. See the [`ProbabilisticScorer`]
29897 * struct documentation for more info on the way the liquidity bounds are used.
29899 * For example, if the channel's capacity is 1 million sats, and the current upper and lower
29900 * liquidity bounds are 200,000 sats and 600,000 sats, after this amount of time the upper
29901 * and lower liquidity bounds will be decayed to 100,000 and 800,000 sats.
29903 * Default value: 6 hours
29907 * When built with the `no-std` feature, time will never elapse. Therefore, the channel
29908 * liquidity knowledge will never decay except when the bounds cross.
29910 uint64_t ProbabilisticScoringParameters_get_liquidity_offset_half_life(const struct LDKProbabilisticScoringParameters *NONNULL_PTR this_ptr);
29913 * Whenever this amount of time elapses since the last update to a channel's liquidity bounds,
29914 * the distance from the bounds to \"zero\" is cut in half. In other words, the lower-bound on
29915 * the available liquidity is halved and the upper-bound moves half-way to the channel's total
29918 * Because halving the liquidity bounds grows the uncertainty on the channel's liquidity,
29919 * the penalty for an amount within the new bounds may change. See the [`ProbabilisticScorer`]
29920 * struct documentation for more info on the way the liquidity bounds are used.
29922 * For example, if the channel's capacity is 1 million sats, and the current upper and lower
29923 * liquidity bounds are 200,000 sats and 600,000 sats, after this amount of time the upper
29924 * and lower liquidity bounds will be decayed to 100,000 and 800,000 sats.
29926 * Default value: 6 hours
29930 * When built with the `no-std` feature, time will never elapse. Therefore, the channel
29931 * liquidity knowledge will never decay except when the bounds cross.
29933 void ProbabilisticScoringParameters_set_liquidity_offset_half_life(struct LDKProbabilisticScoringParameters *NONNULL_PTR this_ptr, uint64_t val);
29936 * A multiplier used in conjunction with a payment amount and the negative `log10` of the
29937 * channel's success probability for the payment, as determined by our latest estimates of the
29938 * channel's liquidity, to determine the amount penalty.
29940 * The purpose of the amount penalty is to avoid having fees dominate the channel cost (i.e.,
29941 * fees plus penalty) for large payments. The penalty is computed as the product of this
29942 * multiplier and `2^20`ths of the payment amount, weighted by the negative `log10` of the
29943 * success probability.
29945 * `-log10(success_probability) * liquidity_penalty_amount_multiplier_msat * amount_msat / 2^20`
29947 * In practice, this means for 0.1 success probability (`-log10(0.1) == 1`) each `2^20`th of
29948 * the amount will result in a penalty of the multiplier. And, as the success probability
29949 * decreases, the negative `log10` weighting will increase dramatically. For higher success
29950 * probabilities, the multiplier will have a decreasing effect as the negative `log10` will
29953 * Default value: 192 msat
29955 uint64_t ProbabilisticScoringParameters_get_liquidity_penalty_amount_multiplier_msat(const struct LDKProbabilisticScoringParameters *NONNULL_PTR this_ptr);
29958 * A multiplier used in conjunction with a payment amount and the negative `log10` of the
29959 * channel's success probability for the payment, as determined by our latest estimates of the
29960 * channel's liquidity, to determine the amount penalty.
29962 * The purpose of the amount penalty is to avoid having fees dominate the channel cost (i.e.,
29963 * fees plus penalty) for large payments. The penalty is computed as the product of this
29964 * multiplier and `2^20`ths of the payment amount, weighted by the negative `log10` of the
29965 * success probability.
29967 * `-log10(success_probability) * liquidity_penalty_amount_multiplier_msat * amount_msat / 2^20`
29969 * In practice, this means for 0.1 success probability (`-log10(0.1) == 1`) each `2^20`th of
29970 * the amount will result in a penalty of the multiplier. And, as the success probability
29971 * decreases, the negative `log10` weighting will increase dramatically. For higher success
29972 * probabilities, the multiplier will have a decreasing effect as the negative `log10` will
29975 * Default value: 192 msat
29977 void ProbabilisticScoringParameters_set_liquidity_penalty_amount_multiplier_msat(struct LDKProbabilisticScoringParameters *NONNULL_PTR this_ptr, uint64_t val);
29980 * A multiplier used in conjunction with the negative `log10` of the channel's success
29981 * probability for the payment, as determined based on the history of our estimates of the
29982 * channel's available liquidity, to determine a penalty.
29984 * This penalty is similar to [`liquidity_penalty_multiplier_msat`], however, instead of using
29985 * only our latest estimate for the current liquidity available in the channel, it estimates
29986 * success probability based on the estimated liquidity available in the channel through
29987 * history. Specifically, every time we update our liquidity bounds on a given channel, we
29988 * track which of several buckets those bounds fall into, exponentially decaying the
29989 * probability of each bucket as new samples are added.
29991 * Default value: 10,000 msat
29993 * [`liquidity_penalty_multiplier_msat`]: Self::liquidity_penalty_multiplier_msat
29995 uint64_t ProbabilisticScoringParameters_get_historical_liquidity_penalty_multiplier_msat(const struct LDKProbabilisticScoringParameters *NONNULL_PTR this_ptr);
29998 * A multiplier used in conjunction with the negative `log10` of the channel's success
29999 * probability for the payment, as determined based on the history of our estimates of the
30000 * channel's available liquidity, to determine a penalty.
30002 * This penalty is similar to [`liquidity_penalty_multiplier_msat`], however, instead of using
30003 * only our latest estimate for the current liquidity available in the channel, it estimates
30004 * success probability based on the estimated liquidity available in the channel through
30005 * history. Specifically, every time we update our liquidity bounds on a given channel, we
30006 * track which of several buckets those bounds fall into, exponentially decaying the
30007 * probability of each bucket as new samples are added.
30009 * Default value: 10,000 msat
30011 * [`liquidity_penalty_multiplier_msat`]: Self::liquidity_penalty_multiplier_msat
30013 void ProbabilisticScoringParameters_set_historical_liquidity_penalty_multiplier_msat(struct LDKProbabilisticScoringParameters *NONNULL_PTR this_ptr, uint64_t val);
30016 * A multiplier used in conjunction with the payment amount and the negative `log10` of the
30017 * channel's success probability for the payment, as determined based on the history of our
30018 * estimates of the channel's available liquidity, to determine a penalty.
30020 * The purpose of the amount penalty is to avoid having fees dominate the channel cost for
30021 * large payments. The penalty is computed as the product of this multiplier and the `2^20`ths
30022 * of the payment amount, weighted by the negative `log10` of the success probability.
30024 * This penalty is similar to [`liquidity_penalty_amount_multiplier_msat`], however, instead
30025 * of using only our latest estimate for the current liquidity available in the channel, it
30026 * estimates success probability based on the estimated liquidity available in the channel
30027 * through history. Specifically, every time we update our liquidity bounds on a given
30028 * channel, we track which of several buckets those bounds fall into, exponentially decaying
30029 * the probability of each bucket as new samples are added.
30031 * Default value: 64 msat
30033 * [`liquidity_penalty_amount_multiplier_msat`]: Self::liquidity_penalty_amount_multiplier_msat
30035 uint64_t ProbabilisticScoringParameters_get_historical_liquidity_penalty_amount_multiplier_msat(const struct LDKProbabilisticScoringParameters *NONNULL_PTR this_ptr);
30038 * A multiplier used in conjunction with the payment amount and the negative `log10` of the
30039 * channel's success probability for the payment, as determined based on the history of our
30040 * estimates of the channel's available liquidity, to determine a penalty.
30042 * The purpose of the amount penalty is to avoid having fees dominate the channel cost for
30043 * large payments. The penalty is computed as the product of this multiplier and the `2^20`ths
30044 * of the payment amount, weighted by the negative `log10` of the success probability.
30046 * This penalty is similar to [`liquidity_penalty_amount_multiplier_msat`], however, instead
30047 * of using only our latest estimate for the current liquidity available in the channel, it
30048 * estimates success probability based on the estimated liquidity available in the channel
30049 * through history. Specifically, every time we update our liquidity bounds on a given
30050 * channel, we track which of several buckets those bounds fall into, exponentially decaying
30051 * the probability of each bucket as new samples are added.
30053 * Default value: 64 msat
30055 * [`liquidity_penalty_amount_multiplier_msat`]: Self::liquidity_penalty_amount_multiplier_msat
30057 void ProbabilisticScoringParameters_set_historical_liquidity_penalty_amount_multiplier_msat(struct LDKProbabilisticScoringParameters *NONNULL_PTR this_ptr, uint64_t val);
30060 * If we aren't learning any new datapoints for a channel, the historical liquidity bounds
30061 * tracking can simply live on with increasingly stale data. Instead, when a channel has not
30062 * seen a liquidity estimate update for this amount of time, the historical datapoints are
30065 * Note that after 16 or more half lives all historical data will be completely gone.
30067 * Default value: 14 days
30069 uint64_t ProbabilisticScoringParameters_get_historical_no_updates_half_life(const struct LDKProbabilisticScoringParameters *NONNULL_PTR this_ptr);
30072 * If we aren't learning any new datapoints for a channel, the historical liquidity bounds
30073 * tracking can simply live on with increasingly stale data. Instead, when a channel has not
30074 * seen a liquidity estimate update for this amount of time, the historical datapoints are
30077 * Note that after 16 or more half lives all historical data will be completely gone.
30079 * Default value: 14 days
30081 void ProbabilisticScoringParameters_set_historical_no_updates_half_life(struct LDKProbabilisticScoringParameters *NONNULL_PTR this_ptr, uint64_t val);
30084 * This penalty is applied when `htlc_maximum_msat` is equal to or larger than half of the
30085 * channel's capacity, which makes us prefer nodes with a smaller `htlc_maximum_msat`. We
30086 * treat such nodes preferentially as this makes balance discovery attacks harder to execute,
30087 * thereby creating an incentive to restrict `htlc_maximum_msat` and improve privacy.
30089 * Default value: 250 msat
30091 uint64_t ProbabilisticScoringParameters_get_anti_probing_penalty_msat(const struct LDKProbabilisticScoringParameters *NONNULL_PTR this_ptr);
30094 * This penalty is applied when `htlc_maximum_msat` is equal to or larger than half of the
30095 * channel's capacity, which makes us prefer nodes with a smaller `htlc_maximum_msat`. We
30096 * treat such nodes preferentially as this makes balance discovery attacks harder to execute,
30097 * thereby creating an incentive to restrict `htlc_maximum_msat` and improve privacy.
30099 * Default value: 250 msat
30101 void ProbabilisticScoringParameters_set_anti_probing_penalty_msat(struct LDKProbabilisticScoringParameters *NONNULL_PTR this_ptr, uint64_t val);
30104 * This penalty is applied when the amount we're attempting to send over a channel exceeds our
30105 * current estimate of the channel's available liquidity.
30107 * Note that in this case all other penalties, including the
30108 * [`liquidity_penalty_multiplier_msat`] and [`liquidity_penalty_amount_multiplier_msat`]-based
30109 * penalties, as well as the [`base_penalty_msat`] and the [`anti_probing_penalty_msat`], if
30110 * applicable, are still included in the overall penalty.
30112 * If you wish to avoid creating paths with such channels entirely, setting this to a value of
30113 * `u64::max_value()` will guarantee that.
30115 * Default value: 1_0000_0000_000 msat (1 Bitcoin)
30117 * [`liquidity_penalty_multiplier_msat`]: Self::liquidity_penalty_multiplier_msat
30118 * [`liquidity_penalty_amount_multiplier_msat`]: Self::liquidity_penalty_amount_multiplier_msat
30119 * [`base_penalty_msat`]: Self::base_penalty_msat
30120 * [`anti_probing_penalty_msat`]: Self::anti_probing_penalty_msat
30122 uint64_t ProbabilisticScoringParameters_get_considered_impossible_penalty_msat(const struct LDKProbabilisticScoringParameters *NONNULL_PTR this_ptr);
30125 * This penalty is applied when the amount we're attempting to send over a channel exceeds our
30126 * current estimate of the channel's available liquidity.
30128 * Note that in this case all other penalties, including the
30129 * [`liquidity_penalty_multiplier_msat`] and [`liquidity_penalty_amount_multiplier_msat`]-based
30130 * penalties, as well as the [`base_penalty_msat`] and the [`anti_probing_penalty_msat`], if
30131 * applicable, are still included in the overall penalty.
30133 * If you wish to avoid creating paths with such channels entirely, setting this to a value of
30134 * `u64::max_value()` will guarantee that.
30136 * Default value: 1_0000_0000_000 msat (1 Bitcoin)
30138 * [`liquidity_penalty_multiplier_msat`]: Self::liquidity_penalty_multiplier_msat
30139 * [`liquidity_penalty_amount_multiplier_msat`]: Self::liquidity_penalty_amount_multiplier_msat
30140 * [`base_penalty_msat`]: Self::base_penalty_msat
30141 * [`anti_probing_penalty_msat`]: Self::anti_probing_penalty_msat
30143 void ProbabilisticScoringParameters_set_considered_impossible_penalty_msat(struct LDKProbabilisticScoringParameters *NONNULL_PTR this_ptr, uint64_t val);
30146 * Creates a copy of the ProbabilisticScoringParameters
30148 struct LDKProbabilisticScoringParameters ProbabilisticScoringParameters_clone(const struct LDKProbabilisticScoringParameters *NONNULL_PTR orig);
30151 * Creates a new scorer using the given scoring parameters for sending payments from a node
30152 * through a network graph.
30154 MUST_USE_RES struct LDKProbabilisticScorer ProbabilisticScorer_new(struct LDKProbabilisticScoringParameters params, const struct LDKNetworkGraph *NONNULL_PTR network_graph, struct LDKLogger logger);
30157 * Dump the contents of this scorer into the configured logger.
30159 * Note that this writes roughly one line per channel for which we have a liquidity estimate,
30160 * which may be a substantial amount of log output.
30162 void ProbabilisticScorer_debug_log_liquidity_stats(const struct LDKProbabilisticScorer *NONNULL_PTR this_arg);
30165 * Query the estimated minimum and maximum liquidity available for sending a payment over the
30166 * channel with `scid` towards the given `target` node.
30168 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);
30171 * Marks the node with the given `node_id` as banned, i.e.,
30172 * it will be avoided during path finding.
30174 void ProbabilisticScorer_add_banned(struct LDKProbabilisticScorer *NONNULL_PTR this_arg, const struct LDKNodeId *NONNULL_PTR node_id);
30177 * Removes the node with the given `node_id` from the list of nodes to avoid.
30179 void ProbabilisticScorer_remove_banned(struct LDKProbabilisticScorer *NONNULL_PTR this_arg, const struct LDKNodeId *NONNULL_PTR node_id);
30182 * Sets a manual penalty for the given node.
30184 void ProbabilisticScorer_set_manual_penalty(struct LDKProbabilisticScorer *NONNULL_PTR this_arg, const struct LDKNodeId *NONNULL_PTR node_id, uint64_t penalty);
30187 * Removes the node with the given `node_id` from the list of manual penalties.
30189 void ProbabilisticScorer_remove_manual_penalty(struct LDKProbabilisticScorer *NONNULL_PTR this_arg, const struct LDKNodeId *NONNULL_PTR node_id);
30192 * Clears the list of manual penalties that are applied during path finding.
30194 void ProbabilisticScorer_clear_manual_penalties(struct LDKProbabilisticScorer *NONNULL_PTR this_arg);
30197 * Marks all nodes in the given list as banned, i.e.,
30198 * they will be avoided during path finding.
30200 void ProbabilisticScoringParameters_add_banned_from_list(struct LDKProbabilisticScoringParameters *NONNULL_PTR this_arg, struct LDKCVec_NodeIdZ node_ids);
30203 * Creates a "default" ProbabilisticScoringParameters. See struct and individual field documentaiton for details on which values are used.
30205 MUST_USE_RES struct LDKProbabilisticScoringParameters ProbabilisticScoringParameters_default(void);
30208 * Constructs a new Score which calls the relevant methods on this_arg.
30209 * This copies the `inner` pointer in this_arg and thus the returned Score must be freed before this_arg is
30211 struct LDKScore ProbabilisticScorer_as_Score(const struct LDKProbabilisticScorer *NONNULL_PTR this_arg);
30214 * Serialize the ProbabilisticScorer object into a byte array which can be read by ProbabilisticScorer_read
30216 struct LDKCVec_u8Z ProbabilisticScorer_write(const struct LDKProbabilisticScorer *NONNULL_PTR obj);
30219 * Read a ProbabilisticScorer from a byte array, created by ProbabilisticScorer_write
30221 struct LDKCResult_ProbabilisticScorerDecodeErrorZ ProbabilisticScorer_read(struct LDKu8slice ser, struct LDKProbabilisticScoringParameters arg_a, const struct LDKNetworkGraph *NONNULL_PTR arg_b, struct LDKLogger arg_c);
30224 * Frees any resources used by the BlindedRoute, if is_owned is set and inner is non-NULL.
30226 void BlindedRoute_free(struct LDKBlindedRoute this_obj);
30229 * Frees any resources used by the BlindedHop, if is_owned is set and inner is non-NULL.
30231 void BlindedHop_free(struct LDKBlindedHop this_obj);
30234 * Create a blinded route to be forwarded along `node_pks`. The last node pubkey in `node_pks`
30235 * will be the destination node.
30237 * Errors if less than two hops are provided or if `node_pk`(s) are invalid.
30239 MUST_USE_RES struct LDKCResult_BlindedRouteNoneZ BlindedRoute_new(struct LDKCVec_PublicKeyZ node_pks, const struct LDKKeysInterface *NONNULL_PTR keys_manager);
30242 * Serialize the BlindedRoute object into a byte array which can be read by BlindedRoute_read
30244 struct LDKCVec_u8Z BlindedRoute_write(const struct LDKBlindedRoute *NONNULL_PTR obj);
30247 * Read a BlindedRoute from a byte array, created by BlindedRoute_write
30249 struct LDKCResult_BlindedRouteDecodeErrorZ BlindedRoute_read(struct LDKu8slice ser);
30252 * Serialize the BlindedHop object into a byte array which can be read by BlindedHop_read
30254 struct LDKCVec_u8Z BlindedHop_write(const struct LDKBlindedHop *NONNULL_PTR obj);
30257 * Read a BlindedHop from a byte array, created by BlindedHop_write
30259 struct LDKCResult_BlindedHopDecodeErrorZ BlindedHop_read(struct LDKu8slice ser);
30262 * Frees any resources used by the OnionMessenger, if is_owned is set and inner is non-NULL.
30264 void OnionMessenger_free(struct LDKOnionMessenger this_obj);
30267 * Frees any resources used by the Destination
30269 void Destination_free(struct LDKDestination this_ptr);
30272 * Utility method to constructs a new Node-variant Destination
30274 struct LDKDestination Destination_node(struct LDKPublicKey a);
30277 * Utility method to constructs a new BlindedRoute-variant Destination
30279 struct LDKDestination Destination_blinded_route(struct LDKBlindedRoute a);
30282 * Frees any resources used by the SendError
30284 void SendError_free(struct LDKSendError this_ptr);
30287 * Creates a copy of the SendError
30289 struct LDKSendError SendError_clone(const struct LDKSendError *NONNULL_PTR orig);
30292 * Utility method to constructs a new Secp256k1-variant SendError
30294 struct LDKSendError SendError_secp256k1(enum LDKSecp256k1Error a);
30297 * Utility method to constructs a new TooBigPacket-variant SendError
30299 struct LDKSendError SendError_too_big_packet(void);
30302 * Utility method to constructs a new TooFewBlindedHops-variant SendError
30304 struct LDKSendError SendError_too_few_blinded_hops(void);
30307 * Utility method to constructs a new InvalidFirstHop-variant SendError
30309 struct LDKSendError SendError_invalid_first_hop(void);
30312 * Utility method to constructs a new InvalidMessage-variant SendError
30314 struct LDKSendError SendError_invalid_message(void);
30317 * Utility method to constructs a new BufferFull-variant SendError
30319 struct LDKSendError SendError_buffer_full(void);
30322 * Checks if two SendErrors contain equal inner contents.
30323 * This ignores pointers and is_owned flags and looks at the values in fields.
30325 bool SendError_eq(const struct LDKSendError *NONNULL_PTR a, const struct LDKSendError *NONNULL_PTR b);
30328 * Calls the free function if one is set
30330 void CustomOnionMessageHandler_free(struct LDKCustomOnionMessageHandler this_ptr);
30333 * Constructs a new `OnionMessenger` to send, forward, and delegate received onion messages to
30334 * their respective handlers.
30336 MUST_USE_RES struct LDKOnionMessenger OnionMessenger_new(struct LDKKeysInterface keys_manager, struct LDKLogger logger, struct LDKCustomOnionMessageHandler custom_handler);
30339 * Send an onion message with contents `message` to `destination`, routing it through `intermediate_nodes`.
30340 * See [`OnionMessenger`] for example usage.
30342 * Note that reply_path (or a relevant inner pointer) may be NULL or all-0s to represent None
30344 MUST_USE_RES struct LDKCResult_NoneSendErrorZ OnionMessenger_send_custom_onion_message(const struct LDKOnionMessenger *NONNULL_PTR this_arg, struct LDKCVec_PublicKeyZ intermediate_nodes, struct LDKDestination destination, struct LDKCustomOnionMessageContents msg, struct LDKBlindedRoute reply_path);
30347 * Constructs a new OnionMessageHandler which calls the relevant methods on this_arg.
30348 * This copies the `inner` pointer in this_arg and thus the returned OnionMessageHandler must be freed before this_arg is
30350 struct LDKOnionMessageHandler OnionMessenger_as_OnionMessageHandler(const struct LDKOnionMessenger *NONNULL_PTR this_arg);
30353 * Constructs a new OnionMessageProvider which calls the relevant methods on this_arg.
30354 * This copies the `inner` pointer in this_arg and thus the returned OnionMessageProvider must be freed before this_arg is
30356 struct LDKOnionMessageProvider OnionMessenger_as_OnionMessageProvider(const struct LDKOnionMessenger *NONNULL_PTR this_arg);
30359 * Calls the free function if one is set
30361 void CustomOnionMessageContents_free(struct LDKCustomOnionMessageContents this_ptr);
30364 * Frees any resources used by the FilesystemPersister, if is_owned is set and inner is non-NULL.
30366 void FilesystemPersister_free(struct LDKFilesystemPersister this_obj);
30369 * Initialize a new FilesystemPersister and set the path to the individual channels'
30372 MUST_USE_RES struct LDKFilesystemPersister FilesystemPersister_new(struct LDKStr path_to_channel_data);
30375 * Get the directory which was provided when this persister was initialized.
30377 MUST_USE_RES struct LDKStr FilesystemPersister_get_data_dir(const struct LDKFilesystemPersister *NONNULL_PTR this_arg);
30380 * Read `ChannelMonitor`s from disk.
30382 MUST_USE_RES struct LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ FilesystemPersister_read_channelmonitors(const struct LDKFilesystemPersister *NONNULL_PTR this_arg, struct LDKKeysInterface keys_manager);
30385 * Frees any resources used by the BackgroundProcessor, if is_owned is set and inner is non-NULL.
30387 void BackgroundProcessor_free(struct LDKBackgroundProcessor this_obj);
30390 * Frees any resources used by the GossipSync
30392 void GossipSync_free(struct LDKGossipSync this_ptr);
30395 * Utility method to constructs a new P2P-variant GossipSync
30397 struct LDKGossipSync GossipSync_p2_p(const struct LDKP2PGossipSync *NONNULL_PTR a);
30400 * Utility method to constructs a new Rapid-variant GossipSync
30402 struct LDKGossipSync GossipSync_rapid(const struct LDKRapidGossipSync *NONNULL_PTR a);
30405 * Utility method to constructs a new None-variant GossipSync
30407 struct LDKGossipSync GossipSync_none(void);
30410 * Start a background thread that takes care of responsibilities enumerated in the [top-level
30413 * The thread runs indefinitely unless the object is dropped, [`stop`] is called, or
30414 * [`Persister::persist_manager`] returns an error. In case of an error, the error is retrieved by calling
30415 * either [`join`] or [`stop`].
30417 * # Data Persistence
30419 * [`Persister::persist_manager`] is responsible for writing out the [`ChannelManager`] to disk, and/or
30420 * uploading to one or more backup services. See [`ChannelManager::write`] for writing out a
30421 * [`ChannelManager`]. See the `lightning-persister` crate for LDK's
30422 * provided implementation.
30424 * [`Persister::persist_graph`] is responsible for writing out the [`NetworkGraph`] to disk, if
30425 * [`GossipSync`] is supplied. See [`NetworkGraph::write`] for writing out a [`NetworkGraph`].
30426 * See the `lightning-persister` crate for LDK's provided implementation.
30428 * Typically, users should either implement [`Persister::persist_manager`] to never return an
30429 * error or call [`join`] and handle any error that may arise. For the latter case,
30430 * `BackgroundProcessor` must be restarted by calling `start` again after handling the error.
30434 * `event_handler` is responsible for handling events that users should be notified of (e.g.,
30435 * payment failed). [`BackgroundProcessor`] may decorate the given [`EventHandler`] with common
30436 * functionality implemented by other handlers.
30437 * * [`P2PGossipSync`] if given will update the [`NetworkGraph`] based on payment failures.
30439 * # Rapid Gossip Sync
30441 * If rapid gossip sync is meant to run at startup, pass [`RapidGossipSync`] via `gossip_sync`
30442 * to indicate that the [`BackgroundProcessor`] should not prune the [`NetworkGraph`] instance
30443 * until the [`RapidGossipSync`] instance completes its first sync.
30445 * [top-level documentation]: BackgroundProcessor
30446 * [`join`]: Self::join
30447 * [`stop`]: Self::stop
30448 * [`ChannelManager`]: lightning::ln::channelmanager::ChannelManager
30449 * [`ChannelManager::write`]: lightning::ln::channelmanager::ChannelManager#impl-Writeable
30450 * [`Persister::persist_manager`]: lightning::util::persist::Persister::persist_manager
30451 * [`Persister::persist_graph`]: lightning::util::persist::Persister::persist_graph
30452 * [`NetworkGraph`]: lightning::routing::gossip::NetworkGraph
30453 * [`NetworkGraph::write`]: lightning::routing::gossip::NetworkGraph#impl-Writeable
30455 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);
30458 * Join `BackgroundProcessor`'s thread, returning any error that occurred while persisting
30459 * [`ChannelManager`].
30463 * This function panics if the background thread has panicked such as while persisting or
30466 * [`ChannelManager`]: lightning::ln::channelmanager::ChannelManager
30468 MUST_USE_RES struct LDKCResult_NoneErrorZ BackgroundProcessor_join(struct LDKBackgroundProcessor this_arg);
30471 * Stop `BackgroundProcessor`'s thread, returning any error that occurred while persisting
30472 * [`ChannelManager`].
30476 * This function panics if the background thread has panicked such as while persisting or
30479 * [`ChannelManager`]: lightning::ln::channelmanager::ChannelManager
30481 MUST_USE_RES struct LDKCResult_NoneErrorZ BackgroundProcessor_stop(struct LDKBackgroundProcessor this_arg);
30484 * Frees any resources used by the ParseError
30486 void ParseError_free(struct LDKParseError this_ptr);
30489 * Creates a copy of the ParseError
30491 struct LDKParseError ParseError_clone(const struct LDKParseError *NONNULL_PTR orig);
30494 * Utility method to constructs a new Bech32Error-variant ParseError
30496 struct LDKParseError ParseError_bech32_error(struct LDKBech32Error a);
30499 * Utility method to constructs a new ParseAmountError-variant ParseError
30501 struct LDKParseError ParseError_parse_amount_error(struct LDKError a);
30504 * Utility method to constructs a new MalformedSignature-variant ParseError
30506 struct LDKParseError ParseError_malformed_signature(enum LDKSecp256k1Error a);
30509 * Utility method to constructs a new BadPrefix-variant ParseError
30511 struct LDKParseError ParseError_bad_prefix(void);
30514 * Utility method to constructs a new UnknownCurrency-variant ParseError
30516 struct LDKParseError ParseError_unknown_currency(void);
30519 * Utility method to constructs a new UnknownSiPrefix-variant ParseError
30521 struct LDKParseError ParseError_unknown_si_prefix(void);
30524 * Utility method to constructs a new MalformedHRP-variant ParseError
30526 struct LDKParseError ParseError_malformed_hrp(void);
30529 * Utility method to constructs a new TooShortDataPart-variant ParseError
30531 struct LDKParseError ParseError_too_short_data_part(void);
30534 * Utility method to constructs a new UnexpectedEndOfTaggedFields-variant ParseError
30536 struct LDKParseError ParseError_unexpected_end_of_tagged_fields(void);
30539 * Utility method to constructs a new DescriptionDecodeError-variant ParseError
30541 struct LDKParseError ParseError_description_decode_error(struct LDKError a);
30544 * Utility method to constructs a new PaddingError-variant ParseError
30546 struct LDKParseError ParseError_padding_error(void);
30549 * Utility method to constructs a new IntegerOverflowError-variant ParseError
30551 struct LDKParseError ParseError_integer_overflow_error(void);
30554 * Utility method to constructs a new InvalidSegWitProgramLength-variant ParseError
30556 struct LDKParseError ParseError_invalid_seg_wit_program_length(void);
30559 * Utility method to constructs a new InvalidPubKeyHashLength-variant ParseError
30561 struct LDKParseError ParseError_invalid_pub_key_hash_length(void);
30564 * Utility method to constructs a new InvalidScriptHashLength-variant ParseError
30566 struct LDKParseError ParseError_invalid_script_hash_length(void);
30569 * Utility method to constructs a new InvalidRecoveryId-variant ParseError
30571 struct LDKParseError ParseError_invalid_recovery_id(void);
30574 * Utility method to constructs a new InvalidSliceLength-variant ParseError
30576 struct LDKParseError ParseError_invalid_slice_length(struct LDKStr a);
30579 * Utility method to constructs a new Skip-variant ParseError
30581 struct LDKParseError ParseError_skip(void);
30584 * Checks if two ParseErrors contain equal inner contents.
30585 * This ignores pointers and is_owned flags and looks at the values in fields.
30587 bool ParseError_eq(const struct LDKParseError *NONNULL_PTR a, const struct LDKParseError *NONNULL_PTR b);
30590 * Frees any resources used by the ParseOrSemanticError
30592 void ParseOrSemanticError_free(struct LDKParseOrSemanticError this_ptr);
30595 * Creates a copy of the ParseOrSemanticError
30597 struct LDKParseOrSemanticError ParseOrSemanticError_clone(const struct LDKParseOrSemanticError *NONNULL_PTR orig);
30600 * Utility method to constructs a new ParseError-variant ParseOrSemanticError
30602 struct LDKParseOrSemanticError ParseOrSemanticError_parse_error(struct LDKParseError a);
30605 * Utility method to constructs a new SemanticError-variant ParseOrSemanticError
30607 struct LDKParseOrSemanticError ParseOrSemanticError_semantic_error(enum LDKSemanticError a);
30610 * Checks if two ParseOrSemanticErrors contain equal inner contents.
30611 * This ignores pointers and is_owned flags and looks at the values in fields.
30613 bool ParseOrSemanticError_eq(const struct LDKParseOrSemanticError *NONNULL_PTR a, const struct LDKParseOrSemanticError *NONNULL_PTR b);
30616 * Frees any resources used by the Invoice, if is_owned is set and inner is non-NULL.
30618 void Invoice_free(struct LDKInvoice this_obj);
30621 * Checks if two Invoices contain equal inner contents.
30622 * This ignores pointers and is_owned flags and looks at the values in fields.
30623 * Two objects with NULL inner values will be considered "equal" here.
30625 bool Invoice_eq(const struct LDKInvoice *NONNULL_PTR a, const struct LDKInvoice *NONNULL_PTR b);
30628 * Creates a copy of the Invoice
30630 struct LDKInvoice Invoice_clone(const struct LDKInvoice *NONNULL_PTR orig);
30633 * Checks if two Invoices contain equal inner contents.
30635 uint64_t Invoice_hash(const struct LDKInvoice *NONNULL_PTR o);
30638 * Frees any resources used by the SignedRawInvoice, if is_owned is set and inner is non-NULL.
30640 void SignedRawInvoice_free(struct LDKSignedRawInvoice this_obj);
30643 * Checks if two SignedRawInvoices contain equal inner contents.
30644 * This ignores pointers and is_owned flags and looks at the values in fields.
30645 * Two objects with NULL inner values will be considered "equal" here.
30647 bool SignedRawInvoice_eq(const struct LDKSignedRawInvoice *NONNULL_PTR a, const struct LDKSignedRawInvoice *NONNULL_PTR b);
30650 * Creates a copy of the SignedRawInvoice
30652 struct LDKSignedRawInvoice SignedRawInvoice_clone(const struct LDKSignedRawInvoice *NONNULL_PTR orig);
30655 * Checks if two SignedRawInvoices contain equal inner contents.
30657 uint64_t SignedRawInvoice_hash(const struct LDKSignedRawInvoice *NONNULL_PTR o);
30660 * Frees any resources used by the RawInvoice, if is_owned is set and inner is non-NULL.
30662 void RawInvoice_free(struct LDKRawInvoice this_obj);
30667 struct LDKRawDataPart RawInvoice_get_data(const struct LDKRawInvoice *NONNULL_PTR this_ptr);
30672 void RawInvoice_set_data(struct LDKRawInvoice *NONNULL_PTR this_ptr, struct LDKRawDataPart val);
30675 * Checks if two RawInvoices contain equal inner contents.
30676 * This ignores pointers and is_owned flags and looks at the values in fields.
30677 * Two objects with NULL inner values will be considered "equal" here.
30679 bool RawInvoice_eq(const struct LDKRawInvoice *NONNULL_PTR a, const struct LDKRawInvoice *NONNULL_PTR b);
30682 * Creates a copy of the RawInvoice
30684 struct LDKRawInvoice RawInvoice_clone(const struct LDKRawInvoice *NONNULL_PTR orig);
30687 * Checks if two RawInvoices contain equal inner contents.
30689 uint64_t RawInvoice_hash(const struct LDKRawInvoice *NONNULL_PTR o);
30692 * Frees any resources used by the RawDataPart, if is_owned is set and inner is non-NULL.
30694 void RawDataPart_free(struct LDKRawDataPart this_obj);
30697 * generation time of the invoice
30699 struct LDKPositiveTimestamp RawDataPart_get_timestamp(const struct LDKRawDataPart *NONNULL_PTR this_ptr);
30702 * generation time of the invoice
30704 void RawDataPart_set_timestamp(struct LDKRawDataPart *NONNULL_PTR this_ptr, struct LDKPositiveTimestamp val);
30707 * Checks if two RawDataParts contain equal inner contents.
30708 * This ignores pointers and is_owned flags and looks at the values in fields.
30709 * Two objects with NULL inner values will be considered "equal" here.
30711 bool RawDataPart_eq(const struct LDKRawDataPart *NONNULL_PTR a, const struct LDKRawDataPart *NONNULL_PTR b);
30714 * Creates a copy of the RawDataPart
30716 struct LDKRawDataPart RawDataPart_clone(const struct LDKRawDataPart *NONNULL_PTR orig);
30719 * Checks if two RawDataParts contain equal inner contents.
30721 uint64_t RawDataPart_hash(const struct LDKRawDataPart *NONNULL_PTR o);
30724 * Frees any resources used by the PositiveTimestamp, if is_owned is set and inner is non-NULL.
30726 void PositiveTimestamp_free(struct LDKPositiveTimestamp this_obj);
30729 * Checks if two PositiveTimestamps contain equal inner contents.
30730 * This ignores pointers and is_owned flags and looks at the values in fields.
30731 * Two objects with NULL inner values will be considered "equal" here.
30733 bool PositiveTimestamp_eq(const struct LDKPositiveTimestamp *NONNULL_PTR a, const struct LDKPositiveTimestamp *NONNULL_PTR b);
30736 * Creates a copy of the PositiveTimestamp
30738 struct LDKPositiveTimestamp PositiveTimestamp_clone(const struct LDKPositiveTimestamp *NONNULL_PTR orig);
30741 * Checks if two PositiveTimestamps contain equal inner contents.
30743 uint64_t PositiveTimestamp_hash(const struct LDKPositiveTimestamp *NONNULL_PTR o);
30746 * Creates a copy of the SiPrefix
30748 enum LDKSiPrefix SiPrefix_clone(const enum LDKSiPrefix *NONNULL_PTR orig);
30751 * Utility method to constructs a new Milli-variant SiPrefix
30753 enum LDKSiPrefix SiPrefix_milli(void);
30756 * Utility method to constructs a new Micro-variant SiPrefix
30758 enum LDKSiPrefix SiPrefix_micro(void);
30761 * Utility method to constructs a new Nano-variant SiPrefix
30763 enum LDKSiPrefix SiPrefix_nano(void);
30766 * Utility method to constructs a new Pico-variant SiPrefix
30768 enum LDKSiPrefix SiPrefix_pico(void);
30771 * Checks if two SiPrefixs contain equal inner contents.
30772 * This ignores pointers and is_owned flags and looks at the values in fields.
30774 bool SiPrefix_eq(const enum LDKSiPrefix *NONNULL_PTR a, const enum LDKSiPrefix *NONNULL_PTR b);
30777 * Checks if two SiPrefixs contain equal inner contents.
30779 uint64_t SiPrefix_hash(const enum LDKSiPrefix *NONNULL_PTR o);
30782 * Returns the multiplier to go from a BTC value to picoBTC implied by this SiPrefix.
30783 * This is effectively 10^12 * the prefix multiplier
30785 MUST_USE_RES uint64_t SiPrefix_multiplier(const enum LDKSiPrefix *NONNULL_PTR this_arg);
30788 * Creates a copy of the Currency
30790 enum LDKCurrency Currency_clone(const enum LDKCurrency *NONNULL_PTR orig);
30793 * Utility method to constructs a new Bitcoin-variant Currency
30795 enum LDKCurrency Currency_bitcoin(void);
30798 * Utility method to constructs a new BitcoinTestnet-variant Currency
30800 enum LDKCurrency Currency_bitcoin_testnet(void);
30803 * Utility method to constructs a new Regtest-variant Currency
30805 enum LDKCurrency Currency_regtest(void);
30808 * Utility method to constructs a new Simnet-variant Currency
30810 enum LDKCurrency Currency_simnet(void);
30813 * Utility method to constructs a new Signet-variant Currency
30815 enum LDKCurrency Currency_signet(void);
30818 * Checks if two Currencys contain equal inner contents.
30820 uint64_t Currency_hash(const enum LDKCurrency *NONNULL_PTR o);
30823 * Checks if two Currencys contain equal inner contents.
30824 * This ignores pointers and is_owned flags and looks at the values in fields.
30826 bool Currency_eq(const enum LDKCurrency *NONNULL_PTR a, const enum LDKCurrency *NONNULL_PTR b);
30829 * Frees any resources used by the Sha256, if is_owned is set and inner is non-NULL.
30831 void Sha256_free(struct LDKSha256 this_obj);
30834 * Creates a copy of the Sha256
30836 struct LDKSha256 Sha256_clone(const struct LDKSha256 *NONNULL_PTR orig);
30839 * Checks if two Sha256s contain equal inner contents.
30841 uint64_t Sha256_hash(const struct LDKSha256 *NONNULL_PTR o);
30844 * Checks if two Sha256s contain equal inner contents.
30845 * This ignores pointers and is_owned flags and looks at the values in fields.
30846 * Two objects with NULL inner values will be considered "equal" here.
30848 bool Sha256_eq(const struct LDKSha256 *NONNULL_PTR a, const struct LDKSha256 *NONNULL_PTR b);
30851 * Frees any resources used by the Description, if is_owned is set and inner is non-NULL.
30853 void Description_free(struct LDKDescription this_obj);
30856 * Creates a copy of the Description
30858 struct LDKDescription Description_clone(const struct LDKDescription *NONNULL_PTR orig);
30861 * Checks if two Descriptions contain equal inner contents.
30863 uint64_t Description_hash(const struct LDKDescription *NONNULL_PTR o);
30866 * Checks if two Descriptions contain equal inner contents.
30867 * This ignores pointers and is_owned flags and looks at the values in fields.
30868 * Two objects with NULL inner values will be considered "equal" here.
30870 bool Description_eq(const struct LDKDescription *NONNULL_PTR a, const struct LDKDescription *NONNULL_PTR b);
30873 * Frees any resources used by the PayeePubKey, if is_owned is set and inner is non-NULL.
30875 void PayeePubKey_free(struct LDKPayeePubKey this_obj);
30877 struct LDKPublicKey PayeePubKey_get_a(const struct LDKPayeePubKey *NONNULL_PTR this_ptr);
30879 void PayeePubKey_set_a(struct LDKPayeePubKey *NONNULL_PTR this_ptr, struct LDKPublicKey val);
30882 * Constructs a new PayeePubKey given each field
30884 MUST_USE_RES struct LDKPayeePubKey PayeePubKey_new(struct LDKPublicKey a_arg);
30887 * Creates a copy of the PayeePubKey
30889 struct LDKPayeePubKey PayeePubKey_clone(const struct LDKPayeePubKey *NONNULL_PTR orig);
30892 * Checks if two PayeePubKeys contain equal inner contents.
30894 uint64_t PayeePubKey_hash(const struct LDKPayeePubKey *NONNULL_PTR o);
30897 * Checks if two PayeePubKeys contain equal inner contents.
30898 * This ignores pointers and is_owned flags and looks at the values in fields.
30899 * Two objects with NULL inner values will be considered "equal" here.
30901 bool PayeePubKey_eq(const struct LDKPayeePubKey *NONNULL_PTR a, const struct LDKPayeePubKey *NONNULL_PTR b);
30904 * Frees any resources used by the ExpiryTime, if is_owned is set and inner is non-NULL.
30906 void ExpiryTime_free(struct LDKExpiryTime this_obj);
30909 * Creates a copy of the ExpiryTime
30911 struct LDKExpiryTime ExpiryTime_clone(const struct LDKExpiryTime *NONNULL_PTR orig);
30914 * Checks if two ExpiryTimes contain equal inner contents.
30916 uint64_t ExpiryTime_hash(const struct LDKExpiryTime *NONNULL_PTR o);
30919 * Checks if two ExpiryTimes contain equal inner contents.
30920 * This ignores pointers and is_owned flags and looks at the values in fields.
30921 * Two objects with NULL inner values will be considered "equal" here.
30923 bool ExpiryTime_eq(const struct LDKExpiryTime *NONNULL_PTR a, const struct LDKExpiryTime *NONNULL_PTR b);
30926 * Frees any resources used by the MinFinalCltvExpiry, if is_owned is set and inner is non-NULL.
30928 void MinFinalCltvExpiry_free(struct LDKMinFinalCltvExpiry this_obj);
30930 uint64_t MinFinalCltvExpiry_get_a(const struct LDKMinFinalCltvExpiry *NONNULL_PTR this_ptr);
30932 void MinFinalCltvExpiry_set_a(struct LDKMinFinalCltvExpiry *NONNULL_PTR this_ptr, uint64_t val);
30935 * Constructs a new MinFinalCltvExpiry given each field
30937 MUST_USE_RES struct LDKMinFinalCltvExpiry MinFinalCltvExpiry_new(uint64_t a_arg);
30940 * Creates a copy of the MinFinalCltvExpiry
30942 struct LDKMinFinalCltvExpiry MinFinalCltvExpiry_clone(const struct LDKMinFinalCltvExpiry *NONNULL_PTR orig);
30945 * Checks if two MinFinalCltvExpirys contain equal inner contents.
30947 uint64_t MinFinalCltvExpiry_hash(const struct LDKMinFinalCltvExpiry *NONNULL_PTR o);
30950 * Checks if two MinFinalCltvExpirys contain equal inner contents.
30951 * This ignores pointers and is_owned flags and looks at the values in fields.
30952 * Two objects with NULL inner values will be considered "equal" here.
30954 bool MinFinalCltvExpiry_eq(const struct LDKMinFinalCltvExpiry *NONNULL_PTR a, const struct LDKMinFinalCltvExpiry *NONNULL_PTR b);
30957 * Frees any resources used by the Fallback
30959 void Fallback_free(struct LDKFallback this_ptr);
30962 * Creates a copy of the Fallback
30964 struct LDKFallback Fallback_clone(const struct LDKFallback *NONNULL_PTR orig);
30967 * Utility method to constructs a new SegWitProgram-variant Fallback
30969 struct LDKFallback Fallback_seg_wit_program(struct LDKu5 version, struct LDKCVec_u8Z program);
30972 * Utility method to constructs a new PubKeyHash-variant Fallback
30974 struct LDKFallback Fallback_pub_key_hash(struct LDKTwentyBytes a);
30977 * Utility method to constructs a new ScriptHash-variant Fallback
30979 struct LDKFallback Fallback_script_hash(struct LDKTwentyBytes a);
30982 * Checks if two Fallbacks contain equal inner contents.
30984 uint64_t Fallback_hash(const struct LDKFallback *NONNULL_PTR o);
30987 * Checks if two Fallbacks contain equal inner contents.
30988 * This ignores pointers and is_owned flags and looks at the values in fields.
30990 bool Fallback_eq(const struct LDKFallback *NONNULL_PTR a, const struct LDKFallback *NONNULL_PTR b);
30993 * Frees any resources used by the InvoiceSignature, if is_owned is set and inner is non-NULL.
30995 void InvoiceSignature_free(struct LDKInvoiceSignature this_obj);
30998 * Creates a copy of the InvoiceSignature
31000 struct LDKInvoiceSignature InvoiceSignature_clone(const struct LDKInvoiceSignature *NONNULL_PTR orig);
31003 * Checks if two InvoiceSignatures contain equal inner contents.
31005 uint64_t InvoiceSignature_hash(const struct LDKInvoiceSignature *NONNULL_PTR o);
31008 * Checks if two InvoiceSignatures contain equal inner contents.
31009 * This ignores pointers and is_owned flags and looks at the values in fields.
31010 * Two objects with NULL inner values will be considered "equal" here.
31012 bool InvoiceSignature_eq(const struct LDKInvoiceSignature *NONNULL_PTR a, const struct LDKInvoiceSignature *NONNULL_PTR b);
31015 * Frees any resources used by the PrivateRoute, if is_owned is set and inner is non-NULL.
31017 void PrivateRoute_free(struct LDKPrivateRoute this_obj);
31020 * Creates a copy of the PrivateRoute
31022 struct LDKPrivateRoute PrivateRoute_clone(const struct LDKPrivateRoute *NONNULL_PTR orig);
31025 * Checks if two PrivateRoutes contain equal inner contents.
31027 uint64_t PrivateRoute_hash(const struct LDKPrivateRoute *NONNULL_PTR o);
31030 * Checks if two PrivateRoutes contain equal inner contents.
31031 * This ignores pointers and is_owned flags and looks at the values in fields.
31032 * Two objects with NULL inner values will be considered "equal" here.
31034 bool PrivateRoute_eq(const struct LDKPrivateRoute *NONNULL_PTR a, const struct LDKPrivateRoute *NONNULL_PTR b);
31037 * Disassembles the `SignedRawInvoice` into its three parts:
31039 * 2. hash of the raw invoice
31042 MUST_USE_RES struct LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ SignedRawInvoice_into_parts(struct LDKSignedRawInvoice this_arg);
31045 * The `RawInvoice` which was signed.
31047 MUST_USE_RES struct LDKRawInvoice SignedRawInvoice_raw_invoice(const struct LDKSignedRawInvoice *NONNULL_PTR this_arg);
31050 * The hash of the `RawInvoice` that was signed.
31052 MUST_USE_RES const uint8_t (*SignedRawInvoice_signable_hash(const struct LDKSignedRawInvoice *NONNULL_PTR this_arg))[32];
31055 * InvoiceSignature for the invoice.
31057 MUST_USE_RES struct LDKInvoiceSignature SignedRawInvoice_signature(const struct LDKSignedRawInvoice *NONNULL_PTR this_arg);
31060 * Recovers the public key used for signing the invoice from the recoverable signature.
31062 MUST_USE_RES struct LDKCResult_PayeePubKeyErrorZ SignedRawInvoice_recover_payee_pub_key(const struct LDKSignedRawInvoice *NONNULL_PTR this_arg);
31065 * Checks if the signature is valid for the included payee public key or if none exists if it's
31066 * valid for the recovered signature (which should always be true?).
31068 MUST_USE_RES bool SignedRawInvoice_check_signature(const struct LDKSignedRawInvoice *NONNULL_PTR this_arg);
31071 * Calculate the hash of the encoded `RawInvoice` which should be signed.
31073 MUST_USE_RES struct LDKThirtyTwoBytes RawInvoice_signable_hash(const struct LDKRawInvoice *NONNULL_PTR this_arg);
31077 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
31079 MUST_USE_RES struct LDKSha256 RawInvoice_payment_hash(const struct LDKRawInvoice *NONNULL_PTR this_arg);
31083 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
31085 MUST_USE_RES struct LDKDescription RawInvoice_description(const struct LDKRawInvoice *NONNULL_PTR this_arg);
31089 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
31091 MUST_USE_RES struct LDKPayeePubKey RawInvoice_payee_pub_key(const struct LDKRawInvoice *NONNULL_PTR this_arg);
31095 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
31097 MUST_USE_RES struct LDKSha256 RawInvoice_description_hash(const struct LDKRawInvoice *NONNULL_PTR this_arg);
31101 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
31103 MUST_USE_RES struct LDKExpiryTime RawInvoice_expiry_time(const struct LDKRawInvoice *NONNULL_PTR this_arg);
31107 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
31109 MUST_USE_RES struct LDKMinFinalCltvExpiry RawInvoice_min_final_cltv_expiry(const struct LDKRawInvoice *NONNULL_PTR this_arg);
31113 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
31115 MUST_USE_RES struct LDKThirtyTwoBytes RawInvoice_payment_secret(const struct LDKRawInvoice *NONNULL_PTR this_arg);
31119 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
31121 MUST_USE_RES struct LDKInvoiceFeatures RawInvoice_features(const struct LDKRawInvoice *NONNULL_PTR this_arg);
31123 MUST_USE_RES struct LDKCVec_PrivateRouteZ RawInvoice_private_routes(const struct LDKRawInvoice *NONNULL_PTR this_arg);
31125 MUST_USE_RES struct LDKCOption_u64Z RawInvoice_amount_pico_btc(const struct LDKRawInvoice *NONNULL_PTR this_arg);
31127 MUST_USE_RES enum LDKCurrency RawInvoice_currency(const struct LDKRawInvoice *NONNULL_PTR this_arg);
31130 * Creates a `PositiveTimestamp` from a Unix timestamp in the range `0..=MAX_TIMESTAMP`.
31132 * Otherwise, returns a [`CreationError::TimestampOutOfBounds`].
31134 MUST_USE_RES struct LDKCResult_PositiveTimestampCreationErrorZ PositiveTimestamp_from_unix_timestamp(uint64_t unix_seconds);
31137 * Creates a `PositiveTimestamp` from a [`SystemTime`] with a corresponding Unix timestamp in
31138 * the range `0..=MAX_TIMESTAMP`.
31140 * Note that the subsecond part is dropped as it is not representable in BOLT 11 invoices.
31142 * Otherwise, returns a [`CreationError::TimestampOutOfBounds`].
31144 MUST_USE_RES struct LDKCResult_PositiveTimestampCreationErrorZ PositiveTimestamp_from_system_time(uint64_t time);
31147 * Creates a `PositiveTimestamp` from a [`Duration`] since the Unix epoch in the range
31148 * `0..=MAX_TIMESTAMP`.
31150 * Note that the subsecond part is dropped as it is not representable in BOLT 11 invoices.
31152 * Otherwise, returns a [`CreationError::TimestampOutOfBounds`].
31154 MUST_USE_RES struct LDKCResult_PositiveTimestampCreationErrorZ PositiveTimestamp_from_duration_since_epoch(uint64_t duration);
31157 * Returns the Unix timestamp representing the stored time
31159 MUST_USE_RES uint64_t PositiveTimestamp_as_unix_timestamp(const struct LDKPositiveTimestamp *NONNULL_PTR this_arg);
31162 * Returns the duration of the stored time since the Unix epoch
31164 MUST_USE_RES uint64_t PositiveTimestamp_as_duration_since_epoch(const struct LDKPositiveTimestamp *NONNULL_PTR this_arg);
31167 * Returns the [`SystemTime`] representing the stored time
31169 MUST_USE_RES uint64_t PositiveTimestamp_as_time(const struct LDKPositiveTimestamp *NONNULL_PTR this_arg);
31172 * Transform the `Invoice` into it's unchecked version
31174 MUST_USE_RES struct LDKSignedRawInvoice Invoice_into_signed_raw(struct LDKInvoice this_arg);
31177 * Check that the invoice is signed correctly and that key recovery works
31179 MUST_USE_RES struct LDKCResult_NoneSemanticErrorZ Invoice_check_signature(const struct LDKInvoice *NONNULL_PTR this_arg);
31182 * Constructs an `Invoice` from a `SignedRawInvoice` by checking all its invariants.
31184 * use lightning_invoice::*;
31186 * let invoice = \"lnbc100p1psj9jhxdqud3jxktt5w46x7unfv9kz6mn0v3jsnp4q0d3p2sfluzdx45tqcs\\
31187 * h2pu5qc7lgq0xs578ngs6s0s68ua4h7cvspp5q6rmq35js88zp5dvwrv9m459tnk2zunwj5jalqtyxqulh0l\\
31188 * 5gflssp5nf55ny5gcrfl30xuhzj3nphgj27rstekmr9fw3ny5989s300gyus9qyysgqcqpcrzjqw2sxwe993\\
31189 * h5pcm4dxzpvttgza8zhkqxpgffcrf5v25nwpr3cmfg7z54kuqq8rgqqqqqqqq2qqqqq9qq9qrzjqd0ylaqcl\\
31190 * j9424x9m8h2vcukcgnm6s56xfgu3j78zyqzhgs4hlpzvznlugqq9vsqqqqqqqlgqqqqqeqq9qrzjqwldmj9d\\
31191 * ha74df76zhx6l9we0vjdquygcdt3kssupehe64g6yyp5yz5rhuqqwccqqyqqqqlgqqqqjcqq9qrzjqf9e58a\\
31192 * guqr0rcun0ajlvmzq3ek63cw2w282gv3z5uupmuwvgjtq2z55qsqqg6qqqyqqqrtnqqqzq3cqygrzjqvphms\\
31193 * ywntrrhqjcraumvc4y6r8v4z5v593trte429v4hredj7ms5z52usqq9ngqqqqqqqlgqqqqqqgq9qrzjq2v0v\\
31194 * p62g49p7569ev48cmulecsxe59lvaw3wlxm7r982zxa9zzj7z5l0cqqxusqqyqqqqlgqqqqqzsqygarl9fh3\\
31195 * 8s0gyuxjjgux34w75dnc6xp2l35j7es3jd4ugt3lu0xzre26yg5m7ke54n2d5sym4xcmxtl8238xxvw5h5h5\\
31196 * j5r6drg6k6zcqj0fcwg\";
31198 * let signed = invoice.parse::<SignedRawInvoice>().unwrap();
31200 * assert!(Invoice::from_signed(signed).is_ok());
31203 MUST_USE_RES struct LDKCResult_InvoiceSemanticErrorZ Invoice_from_signed(struct LDKSignedRawInvoice signed_invoice);
31206 * Returns the `Invoice`'s timestamp (should equal its creation time)
31208 MUST_USE_RES uint64_t Invoice_timestamp(const struct LDKInvoice *NONNULL_PTR this_arg);
31211 * Returns the `Invoice`'s timestamp as a duration since the Unix epoch
31213 MUST_USE_RES uint64_t Invoice_duration_since_epoch(const struct LDKInvoice *NONNULL_PTR this_arg);
31216 * Returns the hash to which we will receive the preimage on completion of the payment
31218 MUST_USE_RES const uint8_t (*Invoice_payment_hash(const struct LDKInvoice *NONNULL_PTR this_arg))[32];
31221 * Get the payee's public key if one was included in the invoice
31223 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
31225 MUST_USE_RES struct LDKPublicKey Invoice_payee_pub_key(const struct LDKInvoice *NONNULL_PTR this_arg);
31228 * Get the payment secret if one was included in the invoice
31230 MUST_USE_RES const uint8_t (*Invoice_payment_secret(const struct LDKInvoice *NONNULL_PTR this_arg))[32];
31233 * Get the invoice features if they were included in the invoice
31235 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
31237 MUST_USE_RES struct LDKInvoiceFeatures Invoice_features(const struct LDKInvoice *NONNULL_PTR this_arg);
31240 * Recover the payee's public key (only to be used if none was included in the invoice)
31242 MUST_USE_RES struct LDKPublicKey Invoice_recover_payee_pub_key(const struct LDKInvoice *NONNULL_PTR this_arg);
31245 * Returns the invoice's expiry time, if present, otherwise [`DEFAULT_EXPIRY_TIME`].
31247 MUST_USE_RES uint64_t Invoice_expiry_time(const struct LDKInvoice *NONNULL_PTR this_arg);
31250 * Returns whether the invoice has expired.
31252 MUST_USE_RES bool Invoice_is_expired(const struct LDKInvoice *NONNULL_PTR this_arg);
31255 * Returns whether the expiry time would pass at the given point in time.
31256 * `at_time` is the timestamp as a duration since the Unix epoch.
31258 MUST_USE_RES bool Invoice_would_expire(const struct LDKInvoice *NONNULL_PTR this_arg, uint64_t at_time);
31261 * Returns the invoice's `min_final_cltv_expiry` time, if present, otherwise
31262 * [`DEFAULT_MIN_FINAL_CLTV_EXPIRY`].
31264 MUST_USE_RES uint64_t Invoice_min_final_cltv_expiry(const struct LDKInvoice *NONNULL_PTR this_arg);
31267 * Returns a list of all routes included in the invoice
31269 MUST_USE_RES struct LDKCVec_PrivateRouteZ Invoice_private_routes(const struct LDKInvoice *NONNULL_PTR this_arg);
31272 * Returns a list of all routes included in the invoice as the underlying hints
31274 MUST_USE_RES struct LDKCVec_RouteHintZ Invoice_route_hints(const struct LDKInvoice *NONNULL_PTR this_arg);
31277 * Returns the currency for which the invoice was issued
31279 MUST_USE_RES enum LDKCurrency Invoice_currency(const struct LDKInvoice *NONNULL_PTR this_arg);
31282 * Returns the amount if specified in the invoice as millisatoshis.
31284 MUST_USE_RES struct LDKCOption_u64Z Invoice_amount_milli_satoshis(const struct LDKInvoice *NONNULL_PTR this_arg);
31287 * Creates a new `Description` if `description` is at most 1023 __bytes__ long,
31288 * returns `CreationError::DescriptionTooLong` otherwise
31290 * Please note that single characters may use more than one byte due to UTF8 encoding.
31292 MUST_USE_RES struct LDKCResult_DescriptionCreationErrorZ Description_new(struct LDKStr description);
31295 * Returns the underlying description `String`
31297 MUST_USE_RES struct LDKStr Description_into_inner(struct LDKDescription this_arg);
31300 * Construct an `ExpiryTime` from seconds.
31302 MUST_USE_RES struct LDKExpiryTime ExpiryTime_from_seconds(uint64_t seconds);
31305 * Construct an `ExpiryTime` from a `Duration`, dropping the sub-second part.
31307 MUST_USE_RES struct LDKExpiryTime ExpiryTime_from_duration(uint64_t duration);
31310 * Returns the expiry time in seconds
31312 MUST_USE_RES uint64_t ExpiryTime_as_seconds(const struct LDKExpiryTime *NONNULL_PTR this_arg);
31315 * Returns a reference to the underlying `Duration` (=expiry time)
31317 MUST_USE_RES uint64_t ExpiryTime_as_duration(const struct LDKExpiryTime *NONNULL_PTR this_arg);
31320 * Creates a new (partial) route from a list of hops
31322 MUST_USE_RES struct LDKCResult_PrivateRouteCreationErrorZ PrivateRoute_new(struct LDKRouteHint hops);
31325 * Returns the underlying list of hops
31327 MUST_USE_RES struct LDKRouteHint PrivateRoute_into_inner(struct LDKPrivateRoute this_arg);
31330 * Creates a copy of the CreationError
31332 enum LDKCreationError CreationError_clone(const enum LDKCreationError *NONNULL_PTR orig);
31335 * Utility method to constructs a new DescriptionTooLong-variant CreationError
31337 enum LDKCreationError CreationError_description_too_long(void);
31340 * Utility method to constructs a new RouteTooLong-variant CreationError
31342 enum LDKCreationError CreationError_route_too_long(void);
31345 * Utility method to constructs a new TimestampOutOfBounds-variant CreationError
31347 enum LDKCreationError CreationError_timestamp_out_of_bounds(void);
31350 * Utility method to constructs a new InvalidAmount-variant CreationError
31352 enum LDKCreationError CreationError_invalid_amount(void);
31355 * Utility method to constructs a new MissingRouteHints-variant CreationError
31357 enum LDKCreationError CreationError_missing_route_hints(void);
31360 * Checks if two CreationErrors contain equal inner contents.
31361 * This ignores pointers and is_owned flags and looks at the values in fields.
31363 bool CreationError_eq(const enum LDKCreationError *NONNULL_PTR a, const enum LDKCreationError *NONNULL_PTR b);
31366 * Get the string representation of a CreationError object
31368 struct LDKStr CreationError_to_str(const enum LDKCreationError *NONNULL_PTR o);
31371 * Creates a copy of the SemanticError
31373 enum LDKSemanticError SemanticError_clone(const enum LDKSemanticError *NONNULL_PTR orig);
31376 * Utility method to constructs a new NoPaymentHash-variant SemanticError
31378 enum LDKSemanticError SemanticError_no_payment_hash(void);
31381 * Utility method to constructs a new MultiplePaymentHashes-variant SemanticError
31383 enum LDKSemanticError SemanticError_multiple_payment_hashes(void);
31386 * Utility method to constructs a new NoDescription-variant SemanticError
31388 enum LDKSemanticError SemanticError_no_description(void);
31391 * Utility method to constructs a new MultipleDescriptions-variant SemanticError
31393 enum LDKSemanticError SemanticError_multiple_descriptions(void);
31396 * Utility method to constructs a new NoPaymentSecret-variant SemanticError
31398 enum LDKSemanticError SemanticError_no_payment_secret(void);
31401 * Utility method to constructs a new MultiplePaymentSecrets-variant SemanticError
31403 enum LDKSemanticError SemanticError_multiple_payment_secrets(void);
31406 * Utility method to constructs a new InvalidFeatures-variant SemanticError
31408 enum LDKSemanticError SemanticError_invalid_features(void);
31411 * Utility method to constructs a new InvalidRecoveryId-variant SemanticError
31413 enum LDKSemanticError SemanticError_invalid_recovery_id(void);
31416 * Utility method to constructs a new InvalidSignature-variant SemanticError
31418 enum LDKSemanticError SemanticError_invalid_signature(void);
31421 * Utility method to constructs a new ImpreciseAmount-variant SemanticError
31423 enum LDKSemanticError SemanticError_imprecise_amount(void);
31426 * Checks if two SemanticErrors contain equal inner contents.
31427 * This ignores pointers and is_owned flags and looks at the values in fields.
31429 bool SemanticError_eq(const enum LDKSemanticError *NONNULL_PTR a, const enum LDKSemanticError *NONNULL_PTR b);
31432 * Get the string representation of a SemanticError object
31434 struct LDKStr SemanticError_to_str(const enum LDKSemanticError *NONNULL_PTR o);
31437 * Frees any resources used by the SignOrCreationError
31439 void SignOrCreationError_free(struct LDKSignOrCreationError this_ptr);
31442 * Creates a copy of the SignOrCreationError
31444 struct LDKSignOrCreationError SignOrCreationError_clone(const struct LDKSignOrCreationError *NONNULL_PTR orig);
31447 * Utility method to constructs a new SignError-variant SignOrCreationError
31449 struct LDKSignOrCreationError SignOrCreationError_sign_error(void);
31452 * Utility method to constructs a new CreationError-variant SignOrCreationError
31454 struct LDKSignOrCreationError SignOrCreationError_creation_error(enum LDKCreationError a);
31457 * Checks if two SignOrCreationErrors contain equal inner contents.
31458 * This ignores pointers and is_owned flags and looks at the values in fields.
31460 bool SignOrCreationError_eq(const struct LDKSignOrCreationError *NONNULL_PTR a, const struct LDKSignOrCreationError *NONNULL_PTR b);
31463 * Get the string representation of a SignOrCreationError object
31465 struct LDKStr SignOrCreationError_to_str(const struct LDKSignOrCreationError *NONNULL_PTR o);
31468 * Frees any resources used by the InvoicePayer, if is_owned is set and inner is non-NULL.
31470 void InvoicePayer_free(struct LDKInvoicePayer this_obj);
31473 * Calls the free function if one is set
31475 void Payer_free(struct LDKPayer this_ptr);
31478 * Calls the free function if one is set
31480 void Router_free(struct LDKRouter this_ptr);
31483 * Frees any resources used by the Retry
31485 void Retry_free(struct LDKRetry this_ptr);
31488 * Creates a copy of the Retry
31490 struct LDKRetry Retry_clone(const struct LDKRetry *NONNULL_PTR orig);
31493 * Utility method to constructs a new Attempts-variant Retry
31495 struct LDKRetry Retry_attempts(uintptr_t a);
31498 * Utility method to constructs a new Timeout-variant Retry
31500 struct LDKRetry Retry_timeout(uint64_t a);
31503 * Checks if two Retrys contain equal inner contents.
31504 * This ignores pointers and is_owned flags and looks at the values in fields.
31506 bool Retry_eq(const struct LDKRetry *NONNULL_PTR a, const struct LDKRetry *NONNULL_PTR b);
31509 * Checks if two Retrys contain equal inner contents.
31511 uint64_t Retry_hash(const struct LDKRetry *NONNULL_PTR o);
31514 * Frees any resources used by the PaymentError
31516 void PaymentError_free(struct LDKPaymentError this_ptr);
31519 * Creates a copy of the PaymentError
31521 struct LDKPaymentError PaymentError_clone(const struct LDKPaymentError *NONNULL_PTR orig);
31524 * Utility method to constructs a new Invoice-variant PaymentError
31526 struct LDKPaymentError PaymentError_invoice(struct LDKStr a);
31529 * Utility method to constructs a new Routing-variant PaymentError
31531 struct LDKPaymentError PaymentError_routing(struct LDKLightningError a);
31534 * Utility method to constructs a new Sending-variant PaymentError
31536 struct LDKPaymentError PaymentError_sending(struct LDKPaymentSendFailure a);
31539 * Creates an invoice payer that retries failed payment paths.
31541 * Will forward any [`Event::PaymentPathFailed`] events to the decorated `event_handler` once
31542 * `retry` has been exceeded for a given [`Invoice`].
31544 MUST_USE_RES struct LDKInvoicePayer InvoicePayer_new(struct LDKPayer payer, struct LDKRouter router, struct LDKLogger logger, struct LDKEventHandler event_handler, struct LDKRetry retry);
31547 * Pays the given [`Invoice`], caching it for later use in case a retry is needed.
31549 * You should ensure that the `invoice.payment_hash()` is unique and the same payment_hash has
31550 * never been paid before. Because [`InvoicePayer`] is stateless no effort is made to do so
31553 MUST_USE_RES struct LDKCResult_PaymentIdPaymentErrorZ InvoicePayer_pay_invoice(const struct LDKInvoicePayer *NONNULL_PTR this_arg, const struct LDKInvoice *NONNULL_PTR invoice);
31556 * Pays the given zero-value [`Invoice`] using the given amount, caching it for later use in
31557 * case a retry is needed.
31559 * You should ensure that the `invoice.payment_hash()` is unique and the same payment_hash has
31560 * never been paid before. Because [`InvoicePayer`] is stateless no effort is made to do so
31563 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);
31566 * Pays `pubkey` an amount using the hash of the given preimage, caching it for later use in
31567 * case a retry is needed.
31569 * You should ensure that `payment_preimage` is unique and that its `payment_hash` has never
31570 * been paid before. Because [`InvoicePayer`] is stateless no effort is made to do so for you.
31572 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);
31575 * Removes the payment cached by the given payment hash.
31577 * Should be called once a payment has failed or succeeded if not using [`InvoicePayer`] as an
31578 * [`EventHandler`]. Otherwise, calling this method is unnecessary.
31580 void InvoicePayer_remove_cached_payment(const struct LDKInvoicePayer *NONNULL_PTR this_arg, const uint8_t (*payment_hash)[32]);
31583 * Constructs a new EventHandler which calls the relevant methods on this_arg.
31584 * This copies the `inner` pointer in this_arg and thus the returned EventHandler must be freed before this_arg is
31586 struct LDKEventHandler InvoicePayer_as_EventHandler(const struct LDKInvoicePayer *NONNULL_PTR this_arg);
31589 * Frees any resources used by the InFlightHtlcs, if is_owned is set and inner is non-NULL.
31591 void InFlightHtlcs_free(struct LDKInFlightHtlcs this_obj);
31594 * Returns liquidity in msat given the public key of the HTLC source, target, and short channel
31597 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);
31600 * Serialize the InFlightHtlcs object into a byte array which can be read by InFlightHtlcs_read
31602 struct LDKCVec_u8Z InFlightHtlcs_write(const struct LDKInFlightHtlcs *NONNULL_PTR obj);
31605 * Read a InFlightHtlcs from a byte array, created by InFlightHtlcs_write
31607 struct LDKCResult_InFlightHtlcsDecodeErrorZ InFlightHtlcs_read(struct LDKu8slice ser);
31610 * Utility to create an invoice that can be paid to one of multiple nodes, or a \"phantom invoice.\"
31611 * See [`PhantomKeysManager`] for more information on phantom node payments.
31613 * `phantom_route_hints` parameter:
31614 * * Contains channel info for all nodes participating in the phantom invoice
31615 * * Entries are retrieved from a call to [`ChannelManager::get_phantom_route_hints`] on each
31616 * participating node
31617 * * It is fine to cache `phantom_route_hints` and reuse it across invoices, as long as the data is
31618 * updated when a channel becomes disabled or closes
31619 * * Note that if too many channels are included in [`PhantomRouteHints::channels`], the invoice
31620 * may be too long for QR code scanning. To fix this, `PhantomRouteHints::channels` may be pared
31623 * `payment_hash` can be specified if you have a specific need for a custom payment hash (see the difference
31624 * between [`ChannelManager::create_inbound_payment`] and [`ChannelManager::create_inbound_payment_for_hash`]).
31625 * If `None` is provided for `payment_hash`, then one will be created.
31627 * `invoice_expiry_delta_secs` describes the number of seconds that the invoice is valid for
31628 * in excess of the current time.
31630 * Note that the provided `keys_manager`'s `KeysInterface` implementation must support phantom
31631 * invoices in its `sign_invoice` implementation ([`PhantomKeysManager`] satisfies this
31634 * [`PhantomKeysManager`]: lightning::chain::keysinterface::PhantomKeysManager
31635 * [`ChannelManager::get_phantom_route_hints`]: lightning::ln::channelmanager::ChannelManager::get_phantom_route_hints
31636 * [`ChannelManager::create_inbound_payment`]: lightning::ln::channelmanager::ChannelManager::create_inbound_payment
31637 * [`ChannelManager::create_inbound_payment_for_hash`]: lightning::ln::channelmanager::ChannelManager::create_inbound_payment_for_hash
31638 * [`PhantomRouteHints::channels`]: lightning::ln::channelmanager::PhantomRouteHints::channels
31640 * Note that payment_hash (or a relevant inner pointer) may be NULL or all-0s to represent None
31642 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);
31645 * Utility to create an invoice that can be paid to one of multiple nodes, or a \"phantom invoice.\"
31646 * See [`PhantomKeysManager`] for more information on phantom node payments.
31648 * `phantom_route_hints` parameter:
31649 * * Contains channel info for all nodes participating in the phantom invoice
31650 * * Entries are retrieved from a call to [`ChannelManager::get_phantom_route_hints`] on each
31651 * participating node
31652 * * It is fine to cache `phantom_route_hints` and reuse it across invoices, as long as the data is
31653 * updated when a channel becomes disabled or closes
31654 * * Note that if too many channels are included in [`PhantomRouteHints::channels`], the invoice
31655 * may be too long for QR code scanning. To fix this, `PhantomRouteHints::channels` may be pared
31658 * `description_hash` is a SHA-256 hash of the description text
31660 * `payment_hash` can be specified if you have a specific need for a custom payment hash (see the difference
31661 * between [`ChannelManager::create_inbound_payment`] and [`ChannelManager::create_inbound_payment_for_hash`]).
31662 * If `None` is provided for `payment_hash`, then one will be created.
31664 * `invoice_expiry_delta_secs` describes the number of seconds that the invoice is valid for
31665 * in excess of the current time.
31667 * Note that the provided `keys_manager`'s `KeysInterface` implementation must support phantom
31668 * invoices in its `sign_invoice` implementation ([`PhantomKeysManager`] satisfies this
31671 * [`PhantomKeysManager`]: lightning::chain::keysinterface::PhantomKeysManager
31672 * [`ChannelManager::get_phantom_route_hints`]: lightning::ln::channelmanager::ChannelManager::get_phantom_route_hints
31673 * [`ChannelManager::create_inbound_payment`]: lightning::ln::channelmanager::ChannelManager::create_inbound_payment
31674 * [`ChannelManager::create_inbound_payment_for_hash`]: lightning::ln::channelmanager::ChannelManager::create_inbound_payment_for_hash
31675 * [`PhantomRouteHints::channels`]: lightning::ln::channelmanager::PhantomRouteHints::channels
31677 * Note that payment_hash (or a relevant inner pointer) may be NULL or all-0s to represent None
31679 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);
31682 * Utility to construct an invoice. Generally, unless you want to do something like a custom
31683 * cltv_expiry, this is what you should be using to create an invoice. The reason being, this
31684 * method stores the invoice's payment secret and preimage in `ChannelManager`, so (a) the user
31685 * doesn't have to store preimage/payment secret information and (b) `ChannelManager` can verify
31686 * that the payment secret is valid when the invoice is paid.
31688 * `invoice_expiry_delta_secs` describes the number of seconds that the invoice is valid for
31689 * in excess of the current time.
31691 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);
31694 * Utility to construct an invoice. Generally, unless you want to do something like a custom
31695 * cltv_expiry, this is what you should be using to create an invoice. The reason being, this
31696 * method stores the invoice's payment secret and preimage in `ChannelManager`, so (a) the user
31697 * doesn't have to store preimage/payment secret information and (b) `ChannelManager` can verify
31698 * that the payment secret is valid when the invoice is paid.
31699 * Use this variant if you want to pass the `description_hash` to the invoice.
31701 * `invoice_expiry_delta_secs` describes the number of seconds that the invoice is valid for
31702 * in excess of the current time.
31704 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);
31707 * See [`create_invoice_from_channelmanager_with_description_hash`]
31708 * This version can be used in a `no_std` environment, where [`std::time::SystemTime`] is not
31709 * available and the current time is supplied by the caller.
31711 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);
31714 * See [`create_invoice_from_channelmanager`]
31715 * This version can be used in a `no_std` environment, where [`std::time::SystemTime`] is not
31716 * available and the current time is supplied by the caller.
31718 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);
31721 * Frees any resources used by the DefaultRouter, if is_owned is set and inner is non-NULL.
31723 void DefaultRouter_free(struct LDKDefaultRouter this_obj);
31726 * Creates a new router using the given [`NetworkGraph`], a [`Logger`], and a randomness source
31727 * `random_seed_bytes`.
31729 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);
31732 * Constructs a new Router which calls the relevant methods on this_arg.
31733 * This copies the `inner` pointer in this_arg and thus the returned Router must be freed before this_arg is
31735 struct LDKRouter DefaultRouter_as_Router(const struct LDKDefaultRouter *NONNULL_PTR this_arg);
31738 * Constructs a new Payer which calls the relevant methods on this_arg.
31739 * This copies the `inner` pointer in this_arg and thus the returned Payer must be freed before this_arg is
31741 struct LDKPayer ChannelManager_as_Payer(const struct LDKChannelManager *NONNULL_PTR this_arg);
31744 * Read a SiPrefix object from a string
31746 struct LDKCResult_SiPrefixParseErrorZ SiPrefix_from_str(struct LDKStr s);
31749 * Read a Invoice object from a string
31751 struct LDKCResult_InvoiceParseOrSemanticErrorZ Invoice_from_str(struct LDKStr s);
31754 * Read a SignedRawInvoice object from a string
31756 struct LDKCResult_SignedRawInvoiceParseErrorZ SignedRawInvoice_from_str(struct LDKStr s);
31759 * Get the string representation of a ParseError object
31761 struct LDKStr ParseError_to_str(const struct LDKParseError *NONNULL_PTR o);
31764 * Get the string representation of a ParseOrSemanticError object
31766 struct LDKStr ParseOrSemanticError_to_str(const struct LDKParseOrSemanticError *NONNULL_PTR o);
31769 * Get the string representation of a Invoice object
31771 struct LDKStr Invoice_to_str(const struct LDKInvoice *NONNULL_PTR o);
31774 * Get the string representation of a SignedRawInvoice object
31776 struct LDKStr SignedRawInvoice_to_str(const struct LDKSignedRawInvoice *NONNULL_PTR o);
31779 * Get the string representation of a Currency object
31781 struct LDKStr Currency_to_str(const enum LDKCurrency *NONNULL_PTR o);
31784 * Get the string representation of a SiPrefix object
31786 struct LDKStr SiPrefix_to_str(const enum LDKSiPrefix *NONNULL_PTR o);
31789 * Frees any resources used by the RapidGossipSync, if is_owned is set and inner is non-NULL.
31791 void RapidGossipSync_free(struct LDKRapidGossipSync this_obj);
31794 * Instantiate a new [`RapidGossipSync`] instance.
31796 MUST_USE_RES struct LDKRapidGossipSync RapidGossipSync_new(const struct LDKNetworkGraph *NONNULL_PTR network_graph);
31799 * Update network graph from binary data.
31800 * Returns the last sync timestamp to be used the next time rapid sync data is queried.
31802 * `network_graph`: network graph to be updated
31804 * `update_data`: `&[u8]` binary stream that comprises the update data
31806 MUST_USE_RES struct LDKCResult_u32GraphSyncErrorZ RapidGossipSync_update_network_graph(const struct LDKRapidGossipSync *NONNULL_PTR this_arg, struct LDKu8slice update_data);
31809 * Returns whether a rapid gossip sync has completed at least once.
31811 MUST_USE_RES bool RapidGossipSync_is_initial_sync_complete(const struct LDKRapidGossipSync *NONNULL_PTR this_arg);
31814 * Frees any resources used by the GraphSyncError
31816 void GraphSyncError_free(struct LDKGraphSyncError this_ptr);
31819 * Creates a copy of the GraphSyncError
31821 struct LDKGraphSyncError GraphSyncError_clone(const struct LDKGraphSyncError *NONNULL_PTR orig);
31824 * Utility method to constructs a new DecodeError-variant GraphSyncError
31826 struct LDKGraphSyncError GraphSyncError_decode_error(struct LDKDecodeError a);
31829 * Utility method to constructs a new LightningError-variant GraphSyncError
31831 struct LDKGraphSyncError GraphSyncError_lightning_error(struct LDKLightningError a);
31833 #endif /* LDK_C_BINDINGS_H */
31835 #include "ldk_ver.h"