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 error enum representing a failure to persist a channel monitor update.
52 typedef enum LDKChannelMonitorUpdateErr {
54 * Used to indicate a temporary failure (eg connection to a watchtower or remote backup of
55 * our state failed, but is expected to succeed at some point in the future).
57 * Such a failure will \"freeze\" a channel, preventing us from revoking old states or
58 * submitting new commitment transactions to the counterparty. Once the update(s) that failed
59 * have been successfully applied, a [`MonitorEvent::UpdateCompleted`] event should be returned
60 * via [`Watch::release_pending_monitor_events`] which will then restore the channel to an
63 * Note that a given ChannelManager will *never* re-generate a given ChannelMonitorUpdate. If
64 * you return a TemporaryFailure you must ensure that it is written to disk safely before
65 * writing out the latest ChannelManager state.
67 * Even when a channel has been \"frozen\" updates to the ChannelMonitor can continue to occur
68 * (eg if an inbound HTLC which we forwarded was claimed upstream resulting in us attempting
69 * to claim it on this channel) and those updates must be applied wherever they can be. At
70 * least one such updated ChannelMonitor must be persisted otherwise PermanentFailure should
71 * be returned to get things on-chain ASAP using only the in-memory copy. Obviously updates to
72 * the channel which would invalidate previous ChannelMonitors are not made when a channel has
75 * Note that even if updates made after TemporaryFailure succeed you must still provide a
76 * [`MonitorEvent::UpdateCompleted`] to ensure you have the latest monitor and re-enable
77 * normal channel operation. Note that this is normally generated through a call to
78 * [`ChainMonitor::channel_monitor_updated`].
80 * Note that the update being processed here will not be replayed for you when you return a
81 * [`MonitorEvent::UpdateCompleted`] event via [`Watch::release_pending_monitor_events`], so
82 * you must store the update itself on your own local disk prior to returning a
83 * TemporaryFailure. You may, of course, employ a journaling approach, storing only the
84 * ChannelMonitorUpdate on disk without updating the monitor itself, replaying the journal at
87 * For deployments where a copy of ChannelMonitors and other local state are backed up in a
88 * remote location (with local copies persisted immediately), it is anticipated that all
89 * updates will return TemporaryFailure until the remote copies could be updated.
91 * [`ChainMonitor::channel_monitor_updated`]: chainmonitor::ChainMonitor::channel_monitor_updated
93 LDKChannelMonitorUpdateErr_TemporaryFailure,
95 * Used to indicate no further channel monitor updates will be allowed (eg we've moved on to a
96 * different watchtower and cannot update with all watchtowers that were previously informed
99 * At reception of this error, ChannelManager will force-close the channel and return at
100 * least a final ChannelMonitorUpdate::ChannelForceClosed which must be delivered to at
101 * least one ChannelMonitor copy. Revocation secret MUST NOT be released and offchain channel
102 * update must be rejected.
104 * This failure may also signal a failure to update the local persisted copy of one of
105 * the channel monitor instance.
107 * Note that even when you fail a holder commitment transaction update, you must store the
108 * update to ensure you can claim from it in case of a duplicate copy of this ChannelMonitor
109 * broadcasts it (e.g distributed channel-monitor deployment)
111 * In case of distributed watchtowers deployment, the new version must be written to disk, as
112 * state may have been stored but rejected due to a block forcing a commitment broadcast. This
113 * storage is used to claim outputs of rejected state confirmed onchain by another watchtower,
114 * lagging behind on block processing.
116 LDKChannelMonitorUpdateErr_PermanentFailure,
118 * Must be last for serialization purposes
120 LDKChannelMonitorUpdateErr_Sentinel,
121 } LDKChannelMonitorUpdateErr;
124 * An enum that represents the speed at which we want a transaction to confirm used for feerate
127 typedef enum LDKConfirmationTarget {
129 * We are happy with this transaction confirming slowly when feerate drops some.
131 LDKConfirmationTarget_Background,
133 * We'd like this transaction to confirm without major delay, but 12-18 blocks is fine.
135 LDKConfirmationTarget_Normal,
137 * We'd like this transaction to confirm in the next few blocks.
139 LDKConfirmationTarget_HighPriority,
141 * Must be last for serialization purposes
143 LDKConfirmationTarget_Sentinel,
144 } LDKConfirmationTarget;
147 * Errors that may occur when constructing a new `RawInvoice` or `Invoice`
149 typedef enum LDKCreationError {
151 * The supplied description string was longer than 639 __bytes__ (see [`Description::new(…)`](./struct.Description.html#method.new))
153 LDKCreationError_DescriptionTooLong,
155 * The specified route has too many hops and can't be encoded
157 LDKCreationError_RouteTooLong,
159 * The Unix timestamp of the supplied date is less than zero or greater than 35-bits
161 LDKCreationError_TimestampOutOfBounds,
163 * The supplied millisatoshi amount was greater than the total bitcoin supply.
165 LDKCreationError_InvalidAmount,
167 * Route hints were required for this invoice and were missing. Applies to
168 * [phantom invoices].
170 * [phantom invoices]: crate::utils::create_phantom_invoice
172 LDKCreationError_MissingRouteHints,
174 * Must be last for serialization purposes
176 LDKCreationError_Sentinel,
180 * Enum representing the crypto currencies (or networks) supported by this library
182 typedef enum LDKCurrency {
190 LDKCurrency_BitcoinTestnet,
204 * Must be last for serialization purposes
206 LDKCurrency_Sentinel,
210 * Represents an IO Error. Note that some information is lost in the conversion from Rust.
212 typedef enum LDKIOError {
214 LDKIOError_PermissionDenied,
215 LDKIOError_ConnectionRefused,
216 LDKIOError_ConnectionReset,
217 LDKIOError_ConnectionAborted,
218 LDKIOError_NotConnected,
219 LDKIOError_AddrInUse,
220 LDKIOError_AddrNotAvailable,
221 LDKIOError_BrokenPipe,
222 LDKIOError_AlreadyExists,
223 LDKIOError_WouldBlock,
224 LDKIOError_InvalidInput,
225 LDKIOError_InvalidData,
227 LDKIOError_WriteZero,
228 LDKIOError_Interrupted,
230 LDKIOError_UnexpectedEof,
232 * Must be last for serialization purposes
238 * An enum representing the available verbosity levels of the logger.
240 typedef enum LDKLevel {
242 * Designates extremely verbose information, including gossip-induced messages
246 * Designates very low priority, often extremely verbose, information
250 * Designates lower priority information
254 * Designates useful information
258 * Designates hazardous situations
262 * Designates very serious errors
266 * Must be last for serialization purposes
272 * An enum representing the possible Bitcoin or test networks which we can run on
274 typedef enum LDKNetwork {
276 * The main Bitcoin blockchain.
280 * The testnet3 blockchain.
284 * A local test blockchain.
288 * A blockchain on which blocks are signed instead of mined.
292 * Must be last for serialization purposes
298 * Specifies the recipient of an invoice, to indicate to [`KeysInterface::sign_invoice`] what node
299 * secret key should be used to sign the invoice.
301 typedef enum LDKRecipient {
303 * The invoice should be signed with the local node secret key.
307 * The invoice should be signed with the phantom node secret key. This secret key must be the
308 * same for all nodes participating in the [phantom node payment].
310 * [phantom node payment]: PhantomKeysManager
312 LDKRecipient_PhantomNode,
314 * Must be last for serialization purposes
316 LDKRecipient_Sentinel,
320 * Represents an error returned from libsecp256k1 during validation of some secp256k1 data
322 typedef enum LDKSecp256k1Error {
324 * Signature failed verification
326 LDKSecp256k1Error_IncorrectSignature,
328 * Badly sized message ("messages" are actually fixed-sized digests; see the MESSAGE_SIZE constant)
330 LDKSecp256k1Error_InvalidMessage,
334 LDKSecp256k1Error_InvalidPublicKey,
338 LDKSecp256k1Error_InvalidSignature,
342 LDKSecp256k1Error_InvalidSecretKey,
346 LDKSecp256k1Error_InvalidSharedSecret,
350 LDKSecp256k1Error_InvalidRecoveryId,
352 * Invalid tweak for add_assign or mul_assign
354 LDKSecp256k1Error_InvalidTweak,
356 * Didn't pass enough memory to context creation with preallocated memory
358 LDKSecp256k1Error_NotEnoughMemory,
360 * Bad set of public keys.
362 LDKSecp256k1Error_InvalidPublicKeySum,
364 * The only valid parity values are 0 or 1.
366 LDKSecp256k1Error_InvalidParityValue,
368 * Must be last for serialization purposes
370 LDKSecp256k1Error_Sentinel,
374 * Errors that may occur when converting a `RawInvoice` to an `Invoice`. They relate to the
375 * requirements sections in BOLT #11
377 typedef enum LDKSemanticError {
379 * The invoice is missing the mandatory payment hash
381 LDKSemanticError_NoPaymentHash,
383 * The invoice has multiple payment hashes which isn't allowed
385 LDKSemanticError_MultiplePaymentHashes,
387 * No description or description hash are part of the invoice
389 LDKSemanticError_NoDescription,
391 * The invoice contains multiple descriptions and/or description hashes which isn't allowed
393 LDKSemanticError_MultipleDescriptions,
395 * The invoice is missing the mandatory payment secret, which all modern lightning nodes
398 LDKSemanticError_NoPaymentSecret,
400 * The invoice contains multiple payment secrets
402 LDKSemanticError_MultiplePaymentSecrets,
404 * The invoice's features are invalid
406 LDKSemanticError_InvalidFeatures,
408 * The recovery id doesn't fit the signature/pub key
410 LDKSemanticError_InvalidRecoveryId,
412 * The invoice's signature is invalid
414 LDKSemanticError_InvalidSignature,
416 * The invoice's amount was not a whole number of millisatoshis
418 LDKSemanticError_ImpreciseAmount,
420 * Must be last for serialization purposes
422 LDKSemanticError_Sentinel,
426 * SI prefixes for the human readable part
428 typedef enum LDKSiPrefix {
446 * Must be last for serialization purposes
448 LDKSiPrefix_Sentinel,
452 * A Rust str object, ie a reference to a UTF8-valid string.
453 * This is *not* null-terminated so cannot be used directly as a C string!
455 typedef struct LDKStr {
457 * A pointer to the string's bytes, in UTF8 encoding
459 const uint8_t *chars;
461 * The number of bytes (not characters!) pointed to by `chars`
465 * Whether the data pointed to by `chars` should be freed or not.
471 * Represents an error returned from the bech32 library during validation of some bech32 data
473 typedef enum LDKBech32Error_Tag {
475 * String does not contain the separator character
477 LDKBech32Error_MissingSeparator,
479 * The checksum does not match the rest of the data
481 LDKBech32Error_InvalidChecksum,
483 * The data or human-readable part is too long or too short
485 LDKBech32Error_InvalidLength,
487 * Some part of the string contains an invalid character
489 LDKBech32Error_InvalidChar,
491 * Some part of the data has an invalid value
493 LDKBech32Error_InvalidData,
495 * The bit conversion failed due to a padding issue
497 LDKBech32Error_InvalidPadding,
499 * The whole string must be of one case
501 LDKBech32Error_MixedCase,
503 * Must be last for serialization purposes
505 LDKBech32Error_Sentinel,
506 } LDKBech32Error_Tag;
508 typedef struct LDKBech32Error {
509 LDKBech32Error_Tag tag;
512 uint32_t invalid_char;
515 uint8_t invalid_data;
521 * A serialized transaction, in (pointer, length) form.
523 * This type optionally owns its own memory, and thus the semantics around access change based on
524 * the `data_is_owned` flag. If `data_is_owned` is set, you must call `Transaction_free` to free
525 * the underlying buffer before the object goes out of scope. If `data_is_owned` is not set, any
526 * access to the buffer after the scope in which the object was provided to you is invalid. eg,
527 * access after you return from the call in which a `!data_is_owned` `Transaction` is provided to
528 * you would be invalid.
530 * Note that, while it may change in the future, because transactions on the Rust side are stored
531 * in a deserialized form, all `Transaction`s generated on the Rust side will have `data_is_owned`
532 * set. Similarly, while it may change in the future, all `Transaction`s you pass to Rust may have
533 * `data_is_owned` either set or unset at your discretion.
535 typedef struct LDKTransaction {
537 * The serialized transaction data.
539 * This is non-const for your convenience, an object passed to Rust is never written to.
543 * The length of the serialized transaction
547 * Whether the data pointed to by `data` should be freed or not.
553 * A dynamically-allocated array of u8s of arbitrary size.
554 * This corresponds to std::vector in C++
556 typedef struct LDKCVec_u8Z {
558 * The elements in the array.
559 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
563 * The number of elements pointed to by `data`.
569 * A transaction output including a scriptPubKey and value.
570 * This type *does* own its own memory, so must be free'd appropriately.
572 typedef struct LDKTxOut {
574 * The script_pubkey in this output
576 struct LDKCVec_u8Z script_pubkey;
578 * The value, in satoshis, of this output
584 * Represents a valid secp256k1 public key serialized in "compressed form" as a 33 byte array.
586 typedef struct LDKPublicKey {
588 * The bytes of the public key
590 uint8_t compressed_form[33];
594 * A dynamically-allocated array of crate::c_types::PublicKeys of arbitrary size.
595 * This corresponds to std::vector in C++
597 typedef struct LDKCVec_PublicKeyZ {
599 * The elements in the array.
600 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
602 struct LDKPublicKey *data;
604 * The number of elements pointed to by `data`.
607 } LDKCVec_PublicKeyZ;
612 * Onion messages can be sent and received to blinded routes, which serve to hide the identity of
615 typedef struct MUST_USE_STRUCT LDKBlindedRoute {
617 * A pointer to the opaque Rust object.
618 * Nearly everywhere, inner must be non-null, however in places where
619 * the Rust equivalent takes an Option, it may be set to null to indicate None.
621 LDKnativeBlindedRoute *inner;
623 * Indicates that this is the only struct which contains the same pointer.
624 * Rust functions which take ownership of an object provided via an argument require
625 * this to be true and invalidate the object pointed to by inner.
631 * The contents of CResult_BlindedRouteNoneZ
633 typedef union LDKCResult_BlindedRouteNoneZPtr {
635 * A pointer to the contents in the success state.
636 * Reading from this pointer when `result_ok` is not set is undefined.
638 struct LDKBlindedRoute *result;
640 * Note that this value is always NULL, as there are no contents in the Err variant
643 } LDKCResult_BlindedRouteNoneZPtr;
646 * A CResult_BlindedRouteNoneZ represents the result of a fallible operation,
647 * containing a crate::lightning::onion_message::blinded_route::BlindedRoute on success and a () on failure.
648 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
650 typedef struct LDKCResult_BlindedRouteNoneZ {
652 * The contents of this CResult_BlindedRouteNoneZ, accessible via either
653 * `err` or `result` depending on the state of `result_ok`.
655 union LDKCResult_BlindedRouteNoneZPtr contents;
657 * Whether this CResult_BlindedRouteNoneZ represents a success state.
660 } LDKCResult_BlindedRouteNoneZ;
665 * An error in decoding a message or struct.
667 typedef struct MUST_USE_STRUCT LDKDecodeError {
669 * A pointer to the opaque Rust object.
670 * Nearly everywhere, inner must be non-null, however in places where
671 * the Rust equivalent takes an Option, it may be set to null to indicate None.
673 LDKnativeDecodeError *inner;
675 * Indicates that this is the only struct which contains the same pointer.
676 * Rust functions which take ownership of an object provided via an argument require
677 * this to be true and invalidate the object pointed to by inner.
683 * The contents of CResult_BlindedRouteDecodeErrorZ
685 typedef union LDKCResult_BlindedRouteDecodeErrorZPtr {
687 * A pointer to the contents in the success state.
688 * Reading from this pointer when `result_ok` is not set is undefined.
690 struct LDKBlindedRoute *result;
692 * A pointer to the contents in the error state.
693 * Reading from this pointer when `result_ok` is set is undefined.
695 struct LDKDecodeError *err;
696 } LDKCResult_BlindedRouteDecodeErrorZPtr;
699 * A CResult_BlindedRouteDecodeErrorZ represents the result of a fallible operation,
700 * containing a crate::lightning::onion_message::blinded_route::BlindedRoute on success and a crate::lightning::ln::msgs::DecodeError on failure.
701 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
703 typedef struct LDKCResult_BlindedRouteDecodeErrorZ {
705 * The contents of this CResult_BlindedRouteDecodeErrorZ, accessible via either
706 * `err` or `result` depending on the state of `result_ok`.
708 union LDKCResult_BlindedRouteDecodeErrorZPtr contents;
710 * Whether this CResult_BlindedRouteDecodeErrorZ represents a success state.
713 } LDKCResult_BlindedRouteDecodeErrorZ;
718 * Used to construct the blinded hops portion of a blinded route. These hops cannot be identified
719 * by outside observers and thus can be used to hide the identity of the recipient.
721 typedef struct MUST_USE_STRUCT LDKBlindedHop {
723 * A pointer to the opaque Rust object.
724 * Nearly everywhere, inner must be non-null, however in places where
725 * the Rust equivalent takes an Option, it may be set to null to indicate None.
727 LDKnativeBlindedHop *inner;
729 * Indicates that this is the only struct which contains the same pointer.
730 * Rust functions which take ownership of an object provided via an argument require
731 * this to be true and invalidate the object pointed to by inner.
737 * The contents of CResult_BlindedHopDecodeErrorZ
739 typedef union LDKCResult_BlindedHopDecodeErrorZPtr {
741 * A pointer to the contents in the success state.
742 * Reading from this pointer when `result_ok` is not set is undefined.
744 struct LDKBlindedHop *result;
746 * A pointer to the contents in the error state.
747 * Reading from this pointer when `result_ok` is set is undefined.
749 struct LDKDecodeError *err;
750 } LDKCResult_BlindedHopDecodeErrorZPtr;
753 * A CResult_BlindedHopDecodeErrorZ represents the result of a fallible operation,
754 * containing a crate::lightning::onion_message::blinded_route::BlindedHop on success and a crate::lightning::ln::msgs::DecodeError on failure.
755 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
757 typedef struct LDKCResult_BlindedHopDecodeErrorZ {
759 * The contents of this CResult_BlindedHopDecodeErrorZ, accessible via either
760 * `err` or `result` depending on the state of `result_ok`.
762 union LDKCResult_BlindedHopDecodeErrorZPtr contents;
764 * Whether this CResult_BlindedHopDecodeErrorZ represents a success state.
767 } LDKCResult_BlindedHopDecodeErrorZ;
770 * The contents of CResult_NoneNoneZ
772 typedef union LDKCResult_NoneNoneZPtr {
774 * Note that this value is always NULL, as there are no contents in the OK variant
778 * Note that this value is always NULL, as there are no contents in the Err variant
781 } LDKCResult_NoneNoneZPtr;
784 * A CResult_NoneNoneZ represents the result of a fallible operation,
785 * containing a () on success and a () on failure.
786 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
788 typedef struct LDKCResult_NoneNoneZ {
790 * The contents of this CResult_NoneNoneZ, accessible via either
791 * `err` or `result` depending on the state of `result_ok`.
793 union LDKCResult_NoneNoneZPtr contents;
795 * Whether this CResult_NoneNoneZ represents a success state.
798 } LDKCResult_NoneNoneZ;
803 * Implements the per-commitment secret storage scheme from
804 * [BOLT 3](https://github.com/lightning/bolts/blob/dcbf8583976df087c79c3ce0b535311212e6812d/03-transactions.md#efficient-per-commitment-secret-storage).
806 * Allows us to keep track of all of the revocation secrets of our counterparty in just 50*32 bytes
809 typedef struct MUST_USE_STRUCT LDKCounterpartyCommitmentSecrets {
811 * A pointer to the opaque Rust object.
812 * Nearly everywhere, inner must be non-null, however in places where
813 * the Rust equivalent takes an Option, it may be set to null to indicate None.
815 LDKnativeCounterpartyCommitmentSecrets *inner;
817 * Indicates that this is the only struct which contains the same pointer.
818 * Rust functions which take ownership of an object provided via an argument require
819 * this to be true and invalidate the object pointed to by inner.
822 } LDKCounterpartyCommitmentSecrets;
825 * The contents of CResult_CounterpartyCommitmentSecretsDecodeErrorZ
827 typedef union LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZPtr {
829 * A pointer to the contents in the success state.
830 * Reading from this pointer when `result_ok` is not set is undefined.
832 struct LDKCounterpartyCommitmentSecrets *result;
834 * A pointer to the contents in the error state.
835 * Reading from this pointer when `result_ok` is set is undefined.
837 struct LDKDecodeError *err;
838 } LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZPtr;
841 * A CResult_CounterpartyCommitmentSecretsDecodeErrorZ represents the result of a fallible operation,
842 * containing a crate::lightning::ln::chan_utils::CounterpartyCommitmentSecrets on success and a crate::lightning::ln::msgs::DecodeError on failure.
843 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
845 typedef struct LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ {
847 * The contents of this CResult_CounterpartyCommitmentSecretsDecodeErrorZ, accessible via either
848 * `err` or `result` depending on the state of `result_ok`.
850 union LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZPtr contents;
852 * Whether this CResult_CounterpartyCommitmentSecretsDecodeErrorZ represents a success state.
855 } LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ;
858 * Represents a valid secp256k1 secret key serialized as a 32 byte array.
860 typedef struct LDKSecretKey {
862 * The bytes of the secret key
868 * The contents of CResult_SecretKeyErrorZ
870 typedef union LDKCResult_SecretKeyErrorZPtr {
872 * A pointer to the contents in the success state.
873 * Reading from this pointer when `result_ok` is not set is undefined.
875 struct LDKSecretKey *result;
877 * A pointer to the contents in the error state.
878 * Reading from this pointer when `result_ok` is set is undefined.
880 enum LDKSecp256k1Error *err;
881 } LDKCResult_SecretKeyErrorZPtr;
884 * A CResult_SecretKeyErrorZ represents the result of a fallible operation,
885 * containing a crate::c_types::SecretKey on success and a crate::c_types::Secp256k1Error on failure.
886 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
888 typedef struct LDKCResult_SecretKeyErrorZ {
890 * The contents of this CResult_SecretKeyErrorZ, accessible via either
891 * `err` or `result` depending on the state of `result_ok`.
893 union LDKCResult_SecretKeyErrorZPtr contents;
895 * Whether this CResult_SecretKeyErrorZ represents a success state.
898 } LDKCResult_SecretKeyErrorZ;
901 * The contents of CResult_PublicKeyErrorZ
903 typedef union LDKCResult_PublicKeyErrorZPtr {
905 * A pointer to the contents in the success state.
906 * Reading from this pointer when `result_ok` is not set is undefined.
908 struct LDKPublicKey *result;
910 * A pointer to the contents in the error state.
911 * Reading from this pointer when `result_ok` is set is undefined.
913 enum LDKSecp256k1Error *err;
914 } LDKCResult_PublicKeyErrorZPtr;
917 * A CResult_PublicKeyErrorZ represents the result of a fallible operation,
918 * containing a crate::c_types::PublicKey on success and a crate::c_types::Secp256k1Error on failure.
919 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
921 typedef struct LDKCResult_PublicKeyErrorZ {
923 * The contents of this CResult_PublicKeyErrorZ, accessible via either
924 * `err` or `result` depending on the state of `result_ok`.
926 union LDKCResult_PublicKeyErrorZPtr contents;
928 * Whether this CResult_PublicKeyErrorZ represents a success state.
931 } LDKCResult_PublicKeyErrorZ;
936 * The set of public keys which are used in the creation of one commitment transaction.
937 * These are derived from the channel base keys and per-commitment data.
939 * A broadcaster key is provided from potential broadcaster of the computed transaction.
940 * A countersignatory key is coming from a protocol participant unable to broadcast the
943 * These keys are assumed to be good, either because the code derived them from
944 * channel basepoints via the new function, or they were obtained via
945 * CommitmentTransaction.trust().keys() because we trusted the source of the
946 * pre-calculated keys.
948 typedef struct MUST_USE_STRUCT LDKTxCreationKeys {
950 * A pointer to the opaque Rust object.
951 * Nearly everywhere, inner must be non-null, however in places where
952 * the Rust equivalent takes an Option, it may be set to null to indicate None.
954 LDKnativeTxCreationKeys *inner;
956 * Indicates that this is the only struct which contains the same pointer.
957 * Rust functions which take ownership of an object provided via an argument require
958 * this to be true and invalidate the object pointed to by inner.
964 * The contents of CResult_TxCreationKeysDecodeErrorZ
966 typedef union LDKCResult_TxCreationKeysDecodeErrorZPtr {
968 * A pointer to the contents in the success state.
969 * Reading from this pointer when `result_ok` is not set is undefined.
971 struct LDKTxCreationKeys *result;
973 * A pointer to the contents in the error state.
974 * Reading from this pointer when `result_ok` is set is undefined.
976 struct LDKDecodeError *err;
977 } LDKCResult_TxCreationKeysDecodeErrorZPtr;
980 * A CResult_TxCreationKeysDecodeErrorZ represents the result of a fallible operation,
981 * containing a crate::lightning::ln::chan_utils::TxCreationKeys on success and a crate::lightning::ln::msgs::DecodeError on failure.
982 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
984 typedef struct LDKCResult_TxCreationKeysDecodeErrorZ {
986 * The contents of this CResult_TxCreationKeysDecodeErrorZ, accessible via either
987 * `err` or `result` depending on the state of `result_ok`.
989 union LDKCResult_TxCreationKeysDecodeErrorZPtr contents;
991 * Whether this CResult_TxCreationKeysDecodeErrorZ represents a success state.
994 } LDKCResult_TxCreationKeysDecodeErrorZ;
999 * One counterparty's public keys which do not change over the life of a channel.
1001 typedef struct MUST_USE_STRUCT LDKChannelPublicKeys {
1003 * A pointer to the opaque Rust object.
1004 * Nearly everywhere, inner must be non-null, however in places where
1005 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1007 LDKnativeChannelPublicKeys *inner;
1009 * Indicates that this is the only struct which contains the same pointer.
1010 * Rust functions which take ownership of an object provided via an argument require
1011 * this to be true and invalidate the object pointed to by inner.
1014 } LDKChannelPublicKeys;
1017 * The contents of CResult_ChannelPublicKeysDecodeErrorZ
1019 typedef union LDKCResult_ChannelPublicKeysDecodeErrorZPtr {
1021 * A pointer to the contents in the success state.
1022 * Reading from this pointer when `result_ok` is not set is undefined.
1024 struct LDKChannelPublicKeys *result;
1026 * A pointer to the contents in the error state.
1027 * Reading from this pointer when `result_ok` is set is undefined.
1029 struct LDKDecodeError *err;
1030 } LDKCResult_ChannelPublicKeysDecodeErrorZPtr;
1033 * A CResult_ChannelPublicKeysDecodeErrorZ represents the result of a fallible operation,
1034 * containing a crate::lightning::ln::chan_utils::ChannelPublicKeys on success and a crate::lightning::ln::msgs::DecodeError on failure.
1035 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1037 typedef struct LDKCResult_ChannelPublicKeysDecodeErrorZ {
1039 * The contents of this CResult_ChannelPublicKeysDecodeErrorZ, accessible via either
1040 * `err` or `result` depending on the state of `result_ok`.
1042 union LDKCResult_ChannelPublicKeysDecodeErrorZPtr contents;
1044 * Whether this CResult_ChannelPublicKeysDecodeErrorZ represents a success state.
1047 } LDKCResult_ChannelPublicKeysDecodeErrorZ;
1050 * The contents of CResult_TxCreationKeysErrorZ
1052 typedef union LDKCResult_TxCreationKeysErrorZPtr {
1054 * A pointer to the contents in the success state.
1055 * Reading from this pointer when `result_ok` is not set is undefined.
1057 struct LDKTxCreationKeys *result;
1059 * A pointer to the contents in the error state.
1060 * Reading from this pointer when `result_ok` is set is undefined.
1062 enum LDKSecp256k1Error *err;
1063 } LDKCResult_TxCreationKeysErrorZPtr;
1066 * A CResult_TxCreationKeysErrorZ represents the result of a fallible operation,
1067 * containing a crate::lightning::ln::chan_utils::TxCreationKeys on success and a crate::c_types::Secp256k1Error on failure.
1068 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1070 typedef struct LDKCResult_TxCreationKeysErrorZ {
1072 * The contents of this CResult_TxCreationKeysErrorZ, accessible via either
1073 * `err` or `result` depending on the state of `result_ok`.
1075 union LDKCResult_TxCreationKeysErrorZPtr contents;
1077 * Whether this CResult_TxCreationKeysErrorZ represents a success state.
1080 } LDKCResult_TxCreationKeysErrorZ;
1083 * An enum which can either contain a u32 or not
1085 typedef enum LDKCOption_u32Z_Tag {
1087 * When we're in this state, this COption_u32Z contains a u32
1089 LDKCOption_u32Z_Some,
1091 * When we're in this state, this COption_u32Z contains nothing
1093 LDKCOption_u32Z_None,
1095 * Must be last for serialization purposes
1097 LDKCOption_u32Z_Sentinel,
1098 } LDKCOption_u32Z_Tag;
1100 typedef struct LDKCOption_u32Z {
1101 LDKCOption_u32Z_Tag tag;
1112 * Information about an HTLC as it appears in a commitment transaction
1114 typedef struct MUST_USE_STRUCT LDKHTLCOutputInCommitment {
1116 * A pointer to the opaque Rust object.
1117 * Nearly everywhere, inner must be non-null, however in places where
1118 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1120 LDKnativeHTLCOutputInCommitment *inner;
1122 * Indicates that this is the only struct which contains the same pointer.
1123 * Rust functions which take ownership of an object provided via an argument require
1124 * this to be true and invalidate the object pointed to by inner.
1127 } LDKHTLCOutputInCommitment;
1130 * The contents of CResult_HTLCOutputInCommitmentDecodeErrorZ
1132 typedef union LDKCResult_HTLCOutputInCommitmentDecodeErrorZPtr {
1134 * A pointer to the contents in the success state.
1135 * Reading from this pointer when `result_ok` is not set is undefined.
1137 struct LDKHTLCOutputInCommitment *result;
1139 * A pointer to the contents in the error state.
1140 * Reading from this pointer when `result_ok` is set is undefined.
1142 struct LDKDecodeError *err;
1143 } LDKCResult_HTLCOutputInCommitmentDecodeErrorZPtr;
1146 * A CResult_HTLCOutputInCommitmentDecodeErrorZ represents the result of a fallible operation,
1147 * containing a crate::lightning::ln::chan_utils::HTLCOutputInCommitment on success and a crate::lightning::ln::msgs::DecodeError on failure.
1148 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1150 typedef struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ {
1152 * The contents of this CResult_HTLCOutputInCommitmentDecodeErrorZ, accessible via either
1153 * `err` or `result` depending on the state of `result_ok`.
1155 union LDKCResult_HTLCOutputInCommitmentDecodeErrorZPtr contents;
1157 * Whether this CResult_HTLCOutputInCommitmentDecodeErrorZ represents a success state.
1160 } LDKCResult_HTLCOutputInCommitmentDecodeErrorZ;
1165 * Late-bound per-channel counterparty data used to build transactions.
1167 typedef struct MUST_USE_STRUCT LDKCounterpartyChannelTransactionParameters {
1169 * A pointer to the opaque Rust object.
1170 * Nearly everywhere, inner must be non-null, however in places where
1171 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1173 LDKnativeCounterpartyChannelTransactionParameters *inner;
1175 * Indicates that this is the only struct which contains the same pointer.
1176 * Rust functions which take ownership of an object provided via an argument require
1177 * this to be true and invalidate the object pointed to by inner.
1180 } LDKCounterpartyChannelTransactionParameters;
1183 * The contents of CResult_CounterpartyChannelTransactionParametersDecodeErrorZ
1185 typedef union LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZPtr {
1187 * A pointer to the contents in the success state.
1188 * Reading from this pointer when `result_ok` is not set is undefined.
1190 struct LDKCounterpartyChannelTransactionParameters *result;
1192 * A pointer to the contents in the error state.
1193 * Reading from this pointer when `result_ok` is set is undefined.
1195 struct LDKDecodeError *err;
1196 } LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZPtr;
1199 * A CResult_CounterpartyChannelTransactionParametersDecodeErrorZ represents the result of a fallible operation,
1200 * containing a crate::lightning::ln::chan_utils::CounterpartyChannelTransactionParameters on success and a crate::lightning::ln::msgs::DecodeError on failure.
1201 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1203 typedef struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ {
1205 * The contents of this CResult_CounterpartyChannelTransactionParametersDecodeErrorZ, accessible via either
1206 * `err` or `result` depending on the state of `result_ok`.
1208 union LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZPtr contents;
1210 * Whether this CResult_CounterpartyChannelTransactionParametersDecodeErrorZ represents a success state.
1213 } LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ;
1218 * Per-channel data used to build transactions in conjunction with the per-commitment data (CommitmentTransaction).
1219 * The fields are organized by holder/counterparty.
1221 * Normally, this is converted to the broadcaster/countersignatory-organized DirectedChannelTransactionParameters
1222 * before use, via the as_holder_broadcastable and as_counterparty_broadcastable functions.
1224 typedef struct MUST_USE_STRUCT LDKChannelTransactionParameters {
1226 * A pointer to the opaque Rust object.
1227 * Nearly everywhere, inner must be non-null, however in places where
1228 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1230 LDKnativeChannelTransactionParameters *inner;
1232 * Indicates that this is the only struct which contains the same pointer.
1233 * Rust functions which take ownership of an object provided via an argument require
1234 * this to be true and invalidate the object pointed to by inner.
1237 } LDKChannelTransactionParameters;
1240 * The contents of CResult_ChannelTransactionParametersDecodeErrorZ
1242 typedef union LDKCResult_ChannelTransactionParametersDecodeErrorZPtr {
1244 * A pointer to the contents in the success state.
1245 * Reading from this pointer when `result_ok` is not set is undefined.
1247 struct LDKChannelTransactionParameters *result;
1249 * A pointer to the contents in the error state.
1250 * Reading from this pointer when `result_ok` is set is undefined.
1252 struct LDKDecodeError *err;
1253 } LDKCResult_ChannelTransactionParametersDecodeErrorZPtr;
1256 * A CResult_ChannelTransactionParametersDecodeErrorZ represents the result of a fallible operation,
1257 * containing a crate::lightning::ln::chan_utils::ChannelTransactionParameters on success and a crate::lightning::ln::msgs::DecodeError on failure.
1258 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1260 typedef struct LDKCResult_ChannelTransactionParametersDecodeErrorZ {
1262 * The contents of this CResult_ChannelTransactionParametersDecodeErrorZ, accessible via either
1263 * `err` or `result` depending on the state of `result_ok`.
1265 union LDKCResult_ChannelTransactionParametersDecodeErrorZPtr contents;
1267 * Whether this CResult_ChannelTransactionParametersDecodeErrorZ represents a success state.
1270 } LDKCResult_ChannelTransactionParametersDecodeErrorZ;
1273 * Represents a secp256k1 signature serialized as two 32-byte numbers
1275 typedef struct LDKSignature {
1277 * The bytes of the signature in "compact" form
1279 uint8_t compact_form[64];
1283 * A dynamically-allocated array of crate::c_types::Signatures of arbitrary size.
1284 * This corresponds to std::vector in C++
1286 typedef struct LDKCVec_SignatureZ {
1288 * The elements in the array.
1289 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
1291 struct LDKSignature *data;
1293 * The number of elements pointed to by `data`.
1296 } LDKCVec_SignatureZ;
1301 * Information needed to build and sign a holder's commitment transaction.
1303 * The transaction is only signed once we are ready to broadcast.
1305 typedef struct MUST_USE_STRUCT LDKHolderCommitmentTransaction {
1307 * A pointer to the opaque Rust object.
1308 * Nearly everywhere, inner must be non-null, however in places where
1309 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1311 LDKnativeHolderCommitmentTransaction *inner;
1313 * Indicates that this is the only struct which contains the same pointer.
1314 * Rust functions which take ownership of an object provided via an argument require
1315 * this to be true and invalidate the object pointed to by inner.
1318 } LDKHolderCommitmentTransaction;
1321 * The contents of CResult_HolderCommitmentTransactionDecodeErrorZ
1323 typedef union LDKCResult_HolderCommitmentTransactionDecodeErrorZPtr {
1325 * A pointer to the contents in the success state.
1326 * Reading from this pointer when `result_ok` is not set is undefined.
1328 struct LDKHolderCommitmentTransaction *result;
1330 * A pointer to the contents in the error state.
1331 * Reading from this pointer when `result_ok` is set is undefined.
1333 struct LDKDecodeError *err;
1334 } LDKCResult_HolderCommitmentTransactionDecodeErrorZPtr;
1337 * A CResult_HolderCommitmentTransactionDecodeErrorZ represents the result of a fallible operation,
1338 * containing a crate::lightning::ln::chan_utils::HolderCommitmentTransaction on success and a crate::lightning::ln::msgs::DecodeError on failure.
1339 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1341 typedef struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ {
1343 * The contents of this CResult_HolderCommitmentTransactionDecodeErrorZ, accessible via either
1344 * `err` or `result` depending on the state of `result_ok`.
1346 union LDKCResult_HolderCommitmentTransactionDecodeErrorZPtr contents;
1348 * Whether this CResult_HolderCommitmentTransactionDecodeErrorZ represents a success state.
1351 } LDKCResult_HolderCommitmentTransactionDecodeErrorZ;
1356 * A pre-built Bitcoin commitment transaction and its txid.
1358 typedef struct MUST_USE_STRUCT LDKBuiltCommitmentTransaction {
1360 * A pointer to the opaque Rust object.
1361 * Nearly everywhere, inner must be non-null, however in places where
1362 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1364 LDKnativeBuiltCommitmentTransaction *inner;
1366 * Indicates that this is the only struct which contains the same pointer.
1367 * Rust functions which take ownership of an object provided via an argument require
1368 * this to be true and invalidate the object pointed to by inner.
1371 } LDKBuiltCommitmentTransaction;
1374 * The contents of CResult_BuiltCommitmentTransactionDecodeErrorZ
1376 typedef union LDKCResult_BuiltCommitmentTransactionDecodeErrorZPtr {
1378 * A pointer to the contents in the success state.
1379 * Reading from this pointer when `result_ok` is not set is undefined.
1381 struct LDKBuiltCommitmentTransaction *result;
1383 * A pointer to the contents in the error state.
1384 * Reading from this pointer when `result_ok` is set is undefined.
1386 struct LDKDecodeError *err;
1387 } LDKCResult_BuiltCommitmentTransactionDecodeErrorZPtr;
1390 * A CResult_BuiltCommitmentTransactionDecodeErrorZ represents the result of a fallible operation,
1391 * containing a crate::lightning::ln::chan_utils::BuiltCommitmentTransaction on success and a crate::lightning::ln::msgs::DecodeError on failure.
1392 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1394 typedef struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ {
1396 * The contents of this CResult_BuiltCommitmentTransactionDecodeErrorZ, accessible via either
1397 * `err` or `result` depending on the state of `result_ok`.
1399 union LDKCResult_BuiltCommitmentTransactionDecodeErrorZPtr contents;
1401 * Whether this CResult_BuiltCommitmentTransactionDecodeErrorZ represents a success state.
1404 } LDKCResult_BuiltCommitmentTransactionDecodeErrorZ;
1409 * A wrapper on ClosingTransaction indicating that the built bitcoin
1410 * transaction is trusted.
1412 * See trust() and verify() functions on CommitmentTransaction.
1414 * This structure implements Deref.
1416 typedef struct MUST_USE_STRUCT LDKTrustedClosingTransaction {
1418 * A pointer to the opaque Rust object.
1419 * Nearly everywhere, inner must be non-null, however in places where
1420 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1422 LDKnativeTrustedClosingTransaction *inner;
1424 * Indicates that this is the only struct which contains the same pointer.
1425 * Rust functions which take ownership of an object provided via an argument require
1426 * this to be true and invalidate the object pointed to by inner.
1429 } LDKTrustedClosingTransaction;
1432 * The contents of CResult_TrustedClosingTransactionNoneZ
1434 typedef union LDKCResult_TrustedClosingTransactionNoneZPtr {
1436 * A pointer to the contents in the success state.
1437 * Reading from this pointer when `result_ok` is not set is undefined.
1439 struct LDKTrustedClosingTransaction *result;
1441 * Note that this value is always NULL, as there are no contents in the Err variant
1444 } LDKCResult_TrustedClosingTransactionNoneZPtr;
1447 * A CResult_TrustedClosingTransactionNoneZ represents the result of a fallible operation,
1448 * containing a crate::lightning::ln::chan_utils::TrustedClosingTransaction on success and a () on failure.
1449 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1451 typedef struct LDKCResult_TrustedClosingTransactionNoneZ {
1453 * The contents of this CResult_TrustedClosingTransactionNoneZ, accessible via either
1454 * `err` or `result` depending on the state of `result_ok`.
1456 union LDKCResult_TrustedClosingTransactionNoneZPtr contents;
1458 * Whether this CResult_TrustedClosingTransactionNoneZ represents a success state.
1461 } LDKCResult_TrustedClosingTransactionNoneZ;
1466 * This class tracks the per-transaction information needed to build a commitment transaction and will
1467 * actually build it and sign. It is used for holder transactions that we sign only when needed
1468 * and for transactions we sign for the counterparty.
1470 * This class can be used inside a signer implementation to generate a signature given the relevant
1473 typedef struct MUST_USE_STRUCT LDKCommitmentTransaction {
1475 * A pointer to the opaque Rust object.
1476 * Nearly everywhere, inner must be non-null, however in places where
1477 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1479 LDKnativeCommitmentTransaction *inner;
1481 * Indicates that this is the only struct which contains the same pointer.
1482 * Rust functions which take ownership of an object provided via an argument require
1483 * this to be true and invalidate the object pointed to by inner.
1486 } LDKCommitmentTransaction;
1489 * The contents of CResult_CommitmentTransactionDecodeErrorZ
1491 typedef union LDKCResult_CommitmentTransactionDecodeErrorZPtr {
1493 * A pointer to the contents in the success state.
1494 * Reading from this pointer when `result_ok` is not set is undefined.
1496 struct LDKCommitmentTransaction *result;
1498 * A pointer to the contents in the error state.
1499 * Reading from this pointer when `result_ok` is set is undefined.
1501 struct LDKDecodeError *err;
1502 } LDKCResult_CommitmentTransactionDecodeErrorZPtr;
1505 * A CResult_CommitmentTransactionDecodeErrorZ represents the result of a fallible operation,
1506 * containing a crate::lightning::ln::chan_utils::CommitmentTransaction on success and a crate::lightning::ln::msgs::DecodeError on failure.
1507 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1509 typedef struct LDKCResult_CommitmentTransactionDecodeErrorZ {
1511 * The contents of this CResult_CommitmentTransactionDecodeErrorZ, accessible via either
1512 * `err` or `result` depending on the state of `result_ok`.
1514 union LDKCResult_CommitmentTransactionDecodeErrorZPtr contents;
1516 * Whether this CResult_CommitmentTransactionDecodeErrorZ represents a success state.
1519 } LDKCResult_CommitmentTransactionDecodeErrorZ;
1524 * A wrapper on CommitmentTransaction indicating that the derived fields (the built bitcoin
1525 * transaction and the transaction creation keys) are trusted.
1527 * See trust() and verify() functions on CommitmentTransaction.
1529 * This structure implements Deref.
1531 typedef struct MUST_USE_STRUCT LDKTrustedCommitmentTransaction {
1533 * A pointer to the opaque Rust object.
1534 * Nearly everywhere, inner must be non-null, however in places where
1535 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1537 LDKnativeTrustedCommitmentTransaction *inner;
1539 * Indicates that this is the only struct which contains the same pointer.
1540 * Rust functions which take ownership of an object provided via an argument require
1541 * this to be true and invalidate the object pointed to by inner.
1544 } LDKTrustedCommitmentTransaction;
1547 * The contents of CResult_TrustedCommitmentTransactionNoneZ
1549 typedef union LDKCResult_TrustedCommitmentTransactionNoneZPtr {
1551 * A pointer to the contents in the success state.
1552 * Reading from this pointer when `result_ok` is not set is undefined.
1554 struct LDKTrustedCommitmentTransaction *result;
1556 * Note that this value is always NULL, as there are no contents in the Err variant
1559 } LDKCResult_TrustedCommitmentTransactionNoneZPtr;
1562 * A CResult_TrustedCommitmentTransactionNoneZ represents the result of a fallible operation,
1563 * containing a crate::lightning::ln::chan_utils::TrustedCommitmentTransaction on success and a () on failure.
1564 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1566 typedef struct LDKCResult_TrustedCommitmentTransactionNoneZ {
1568 * The contents of this CResult_TrustedCommitmentTransactionNoneZ, accessible via either
1569 * `err` or `result` depending on the state of `result_ok`.
1571 union LDKCResult_TrustedCommitmentTransactionNoneZPtr contents;
1573 * Whether this CResult_TrustedCommitmentTransactionNoneZ represents a success state.
1576 } LDKCResult_TrustedCommitmentTransactionNoneZ;
1579 * The contents of CResult_CVec_SignatureZNoneZ
1581 typedef union LDKCResult_CVec_SignatureZNoneZPtr {
1583 * A pointer to the contents in the success state.
1584 * Reading from this pointer when `result_ok` is not set is undefined.
1586 struct LDKCVec_SignatureZ *result;
1588 * Note that this value is always NULL, as there are no contents in the Err variant
1591 } LDKCResult_CVec_SignatureZNoneZPtr;
1594 * A CResult_CVec_SignatureZNoneZ represents the result of a fallible operation,
1595 * containing a crate::c_types::derived::CVec_SignatureZ on success and a () on failure.
1596 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1598 typedef struct LDKCResult_CVec_SignatureZNoneZ {
1600 * The contents of this CResult_CVec_SignatureZNoneZ, accessible via either
1601 * `err` or `result` depending on the state of `result_ok`.
1603 union LDKCResult_CVec_SignatureZNoneZPtr contents;
1605 * Whether this CResult_CVec_SignatureZNoneZ represents a success state.
1608 } LDKCResult_CVec_SignatureZNoneZ;
1613 * A script pubkey for shutting down a channel as defined by [BOLT #2].
1615 * [BOLT #2]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md
1617 typedef struct MUST_USE_STRUCT LDKShutdownScript {
1619 * A pointer to the opaque Rust object.
1620 * Nearly everywhere, inner must be non-null, however in places where
1621 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1623 LDKnativeShutdownScript *inner;
1625 * Indicates that this is the only struct which contains the same pointer.
1626 * Rust functions which take ownership of an object provided via an argument require
1627 * this to be true and invalidate the object pointed to by inner.
1630 } LDKShutdownScript;
1633 * The contents of CResult_ShutdownScriptDecodeErrorZ
1635 typedef union LDKCResult_ShutdownScriptDecodeErrorZPtr {
1637 * A pointer to the contents in the success state.
1638 * Reading from this pointer when `result_ok` is not set is undefined.
1640 struct LDKShutdownScript *result;
1642 * A pointer to the contents in the error state.
1643 * Reading from this pointer when `result_ok` is set is undefined.
1645 struct LDKDecodeError *err;
1646 } LDKCResult_ShutdownScriptDecodeErrorZPtr;
1649 * A CResult_ShutdownScriptDecodeErrorZ represents the result of a fallible operation,
1650 * containing a crate::lightning::ln::script::ShutdownScript on success and a crate::lightning::ln::msgs::DecodeError on failure.
1651 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1653 typedef struct LDKCResult_ShutdownScriptDecodeErrorZ {
1655 * The contents of this CResult_ShutdownScriptDecodeErrorZ, accessible via either
1656 * `err` or `result` depending on the state of `result_ok`.
1658 union LDKCResult_ShutdownScriptDecodeErrorZPtr contents;
1660 * Whether this CResult_ShutdownScriptDecodeErrorZ represents a success state.
1663 } LDKCResult_ShutdownScriptDecodeErrorZ;
1668 * An error occurring when converting from [`Script`] to [`ShutdownScript`].
1670 typedef struct MUST_USE_STRUCT LDKInvalidShutdownScript {
1672 * A pointer to the opaque Rust object.
1673 * Nearly everywhere, inner must be non-null, however in places where
1674 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1676 LDKnativeInvalidShutdownScript *inner;
1678 * Indicates that this is the only struct which contains the same pointer.
1679 * Rust functions which take ownership of an object provided via an argument require
1680 * this to be true and invalidate the object pointed to by inner.
1683 } LDKInvalidShutdownScript;
1686 * The contents of CResult_ShutdownScriptInvalidShutdownScriptZ
1688 typedef union LDKCResult_ShutdownScriptInvalidShutdownScriptZPtr {
1690 * A pointer to the contents in the success state.
1691 * Reading from this pointer when `result_ok` is not set is undefined.
1693 struct LDKShutdownScript *result;
1695 * A pointer to the contents in the error state.
1696 * Reading from this pointer when `result_ok` is set is undefined.
1698 struct LDKInvalidShutdownScript *err;
1699 } LDKCResult_ShutdownScriptInvalidShutdownScriptZPtr;
1702 * A CResult_ShutdownScriptInvalidShutdownScriptZ represents the result of a fallible operation,
1703 * containing a crate::lightning::ln::script::ShutdownScript on success and a crate::lightning::ln::script::InvalidShutdownScript on failure.
1704 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1706 typedef struct LDKCResult_ShutdownScriptInvalidShutdownScriptZ {
1708 * The contents of this CResult_ShutdownScriptInvalidShutdownScriptZ, accessible via either
1709 * `err` or `result` depending on the state of `result_ok`.
1711 union LDKCResult_ShutdownScriptInvalidShutdownScriptZPtr contents;
1713 * Whether this CResult_ShutdownScriptInvalidShutdownScriptZ represents a success state.
1716 } LDKCResult_ShutdownScriptInvalidShutdownScriptZ;
1721 * Represents the compressed public key of a node
1723 typedef struct MUST_USE_STRUCT LDKNodeId {
1725 * A pointer to the opaque Rust object.
1726 * Nearly everywhere, inner must be non-null, however in places where
1727 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1729 LDKnativeNodeId *inner;
1731 * Indicates that this is the only struct which contains the same pointer.
1732 * Rust functions which take ownership of an object provided via an argument require
1733 * this to be true and invalidate the object pointed to by inner.
1741 * Proposed use of a channel passed as a parameter to [`Score::channel_penalty_msat`].
1743 typedef struct MUST_USE_STRUCT LDKChannelUsage {
1745 * A pointer to the opaque Rust object.
1746 * Nearly everywhere, inner must be non-null, however in places where
1747 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1749 LDKnativeChannelUsage *inner;
1751 * Indicates that this is the only struct which contains the same pointer.
1752 * Rust functions which take ownership of an object provided via an argument require
1753 * this to be true and invalidate the object pointed to by inner.
1763 typedef struct MUST_USE_STRUCT LDKRouteHop {
1765 * A pointer to the opaque Rust object.
1766 * Nearly everywhere, inner must be non-null, however in places where
1767 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1769 LDKnativeRouteHop *inner;
1771 * Indicates that this is the only struct which contains the same pointer.
1772 * Rust functions which take ownership of an object provided via an argument require
1773 * this to be true and invalidate the object pointed to by inner.
1779 * A dynamically-allocated array of crate::lightning::routing::router::RouteHops of arbitrary size.
1780 * This corresponds to std::vector in C++
1782 typedef struct LDKCVec_RouteHopZ {
1784 * The elements in the array.
1785 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
1787 struct LDKRouteHop *data;
1789 * The number of elements pointed to by `data`.
1792 } LDKCVec_RouteHopZ;
1795 * An interface used to score payment channels for path finding.
1797 *\tScoring is in terms of fees willing to be paid in order to avoid routing through a channel.
1799 typedef struct LDKScore {
1801 * An opaque pointer which is passed to your function implementations as an argument.
1802 * This has no meaning in the LDK, and can be NULL or any other value.
1806 * Returns the fee in msats willing to be paid to avoid routing `send_amt_msat` through the
1807 * given channel in the direction from `source` to `target`.
1809 * The channel's capacity (less any other MPP parts that are also being considered for use in
1810 * the same payment) is given by `capacity_msat`. It may be determined from various sources
1811 * such as a chain data, network gossip, or invoice hints. For invoice hints, a capacity near
1812 * [`u64::max_value`] is given to indicate sufficient capacity for the invoice's full amount.
1813 * Thus, implementations should be overflow-safe.
1815 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);
1817 * Handles updating channel penalties after failing to route through a channel.
1819 void (*payment_path_failed)(void *this_arg, struct LDKCVec_RouteHopZ path, uint64_t short_channel_id);
1821 * Handles updating channel penalties after successfully routing along a path.
1823 void (*payment_path_successful)(void *this_arg, struct LDKCVec_RouteHopZ path);
1825 * Handles updating channel penalties after a probe over the given path failed.
1827 void (*probe_failed)(void *this_arg, struct LDKCVec_RouteHopZ path, uint64_t short_channel_id);
1829 * Handles updating channel penalties after a probe over the given path succeeded.
1831 void (*probe_successful)(void *this_arg, struct LDKCVec_RouteHopZ path);
1833 * Serialize the object into a byte array
1835 struct LDKCVec_u8Z (*write)(const void *this_arg);
1837 * Frees any resources associated with this object given its this_arg pointer.
1838 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
1840 void (*free)(void *this_arg);
1844 * A scorer that is accessed under a lock.
1846 * Needed so that calls to [`Score::channel_penalty_msat`] in [`find_route`] can be made while
1847 * having shared ownership of a scorer but without requiring internal locking in [`Score`]
1848 * implementations. Internal locking would be detrimental to route finding performance and could
1849 * result in [`Score::channel_penalty_msat`] returning a different value for the same channel.
1851 * [`find_route`]: crate::routing::router::find_route
1853 typedef struct LDKLockableScore {
1855 * An opaque pointer which is passed to your function implementations as an argument.
1856 * This has no meaning in the LDK, and can be NULL or any other value.
1860 * Returns the locked scorer.
1862 struct LDKScore (*lock)(const void *this_arg);
1864 * Frees any resources associated with this object given its this_arg pointer.
1865 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
1867 void (*free)(void *this_arg);
1871 * Refers to a scorer that is accessible under lock and also writeable to disk
1873 * We need this trait to be able to pass in a scorer to `lightning-background-processor` that will enable us to
1874 * use the Persister to persist it.
1876 typedef struct LDKWriteableScore {
1878 * An opaque pointer which is passed to your function implementations as an argument.
1879 * This has no meaning in the LDK, and can be NULL or any other value.
1883 * Implementation of LockableScore for this object.
1885 struct LDKLockableScore LockableScore;
1887 * Serialize the object into a byte array
1889 struct LDKCVec_u8Z (*write)(const void *this_arg);
1891 * Frees any resources associated with this object given its this_arg pointer.
1892 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
1894 void (*free)(void *this_arg);
1895 } LDKWriteableScore;
1898 * An enum which can either contain a crate::lightning::routing::scoring::WriteableScore or not
1900 typedef enum LDKCOption_WriteableScoreZ_Tag {
1902 * When we're in this state, this COption_WriteableScoreZ contains a crate::lightning::routing::scoring::WriteableScore
1904 LDKCOption_WriteableScoreZ_Some,
1906 * When we're in this state, this COption_WriteableScoreZ contains nothing
1908 LDKCOption_WriteableScoreZ_None,
1910 * Must be last for serialization purposes
1912 LDKCOption_WriteableScoreZ_Sentinel,
1913 } LDKCOption_WriteableScoreZ_Tag;
1915 typedef struct LDKCOption_WriteableScoreZ {
1916 LDKCOption_WriteableScoreZ_Tag tag;
1919 struct LDKWriteableScore some;
1922 } LDKCOption_WriteableScoreZ;
1925 * The contents of CResult_NoneErrorZ
1927 typedef union LDKCResult_NoneErrorZPtr {
1929 * Note that this value is always NULL, as there are no contents in the OK variant
1933 * A pointer to the contents in the error state.
1934 * Reading from this pointer when `result_ok` is set is undefined.
1936 enum LDKIOError *err;
1937 } LDKCResult_NoneErrorZPtr;
1940 * A CResult_NoneErrorZ represents the result of a fallible operation,
1941 * containing a () on success and a crate::c_types::IOError on failure.
1942 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1944 typedef struct LDKCResult_NoneErrorZ {
1946 * The contents of this CResult_NoneErrorZ, accessible via either
1947 * `err` or `result` depending on the state of `result_ok`.
1949 union LDKCResult_NoneErrorZPtr contents;
1951 * Whether this CResult_NoneErrorZ represents a success state.
1954 } LDKCResult_NoneErrorZ;
1957 * The contents of CResult_RouteHopDecodeErrorZ
1959 typedef union LDKCResult_RouteHopDecodeErrorZPtr {
1961 * A pointer to the contents in the success state.
1962 * Reading from this pointer when `result_ok` is not set is undefined.
1964 struct LDKRouteHop *result;
1966 * A pointer to the contents in the error state.
1967 * Reading from this pointer when `result_ok` is set is undefined.
1969 struct LDKDecodeError *err;
1970 } LDKCResult_RouteHopDecodeErrorZPtr;
1973 * A CResult_RouteHopDecodeErrorZ represents the result of a fallible operation,
1974 * containing a crate::lightning::routing::router::RouteHop on success and a crate::lightning::ln::msgs::DecodeError on failure.
1975 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1977 typedef struct LDKCResult_RouteHopDecodeErrorZ {
1979 * The contents of this CResult_RouteHopDecodeErrorZ, accessible via either
1980 * `err` or `result` depending on the state of `result_ok`.
1982 union LDKCResult_RouteHopDecodeErrorZPtr contents;
1984 * Whether this CResult_RouteHopDecodeErrorZ represents a success state.
1987 } LDKCResult_RouteHopDecodeErrorZ;
1990 * A dynamically-allocated array of crate::c_types::derived::CVec_RouteHopZs of arbitrary size.
1991 * This corresponds to std::vector in C++
1993 typedef struct LDKCVec_CVec_RouteHopZZ {
1995 * The elements in the array.
1996 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
1998 struct LDKCVec_RouteHopZ *data;
2000 * The number of elements pointed to by `data`.
2003 } LDKCVec_CVec_RouteHopZZ;
2008 * A route directs a payment from the sender (us) to the recipient. If the recipient supports MPP,
2009 * it can take multiple paths. Each path is composed of one or more hops through the network.
2011 typedef struct MUST_USE_STRUCT LDKRoute {
2013 * A pointer to the opaque Rust object.
2014 * Nearly everywhere, inner must be non-null, however in places where
2015 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2017 LDKnativeRoute *inner;
2019 * Indicates that this is the only struct which contains the same pointer.
2020 * Rust functions which take ownership of an object provided via an argument require
2021 * this to be true and invalidate the object pointed to by inner.
2027 * The contents of CResult_RouteDecodeErrorZ
2029 typedef union LDKCResult_RouteDecodeErrorZPtr {
2031 * A pointer to the contents in the success state.
2032 * Reading from this pointer when `result_ok` is not set is undefined.
2034 struct LDKRoute *result;
2036 * A pointer to the contents in the error state.
2037 * Reading from this pointer when `result_ok` is set is undefined.
2039 struct LDKDecodeError *err;
2040 } LDKCResult_RouteDecodeErrorZPtr;
2043 * A CResult_RouteDecodeErrorZ represents the result of a fallible operation,
2044 * containing a crate::lightning::routing::router::Route on success and a crate::lightning::ln::msgs::DecodeError on failure.
2045 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
2047 typedef struct LDKCResult_RouteDecodeErrorZ {
2049 * The contents of this CResult_RouteDecodeErrorZ, accessible via either
2050 * `err` or `result` depending on the state of `result_ok`.
2052 union LDKCResult_RouteDecodeErrorZPtr contents;
2054 * Whether this CResult_RouteDecodeErrorZ represents a success state.
2057 } LDKCResult_RouteDecodeErrorZ;
2062 * Parameters needed to find a [`Route`].
2064 * Passed to [`find_route`] and [`build_route_from_hops`], but also provided in
2065 * [`Event::PaymentPathFailed`] for retrying a failed payment path.
2067 * [`Event::PaymentPathFailed`]: crate::util::events::Event::PaymentPathFailed
2069 typedef struct MUST_USE_STRUCT LDKRouteParameters {
2071 * A pointer to the opaque Rust object.
2072 * Nearly everywhere, inner must be non-null, however in places where
2073 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2075 LDKnativeRouteParameters *inner;
2077 * Indicates that this is the only struct which contains the same pointer.
2078 * Rust functions which take ownership of an object provided via an argument require
2079 * this to be true and invalidate the object pointed to by inner.
2082 } LDKRouteParameters;
2085 * The contents of CResult_RouteParametersDecodeErrorZ
2087 typedef union LDKCResult_RouteParametersDecodeErrorZPtr {
2089 * A pointer to the contents in the success state.
2090 * Reading from this pointer when `result_ok` is not set is undefined.
2092 struct LDKRouteParameters *result;
2094 * A pointer to the contents in the error state.
2095 * Reading from this pointer when `result_ok` is set is undefined.
2097 struct LDKDecodeError *err;
2098 } LDKCResult_RouteParametersDecodeErrorZPtr;
2101 * A CResult_RouteParametersDecodeErrorZ represents the result of a fallible operation,
2102 * containing a crate::lightning::routing::router::RouteParameters on success and a crate::lightning::ln::msgs::DecodeError on failure.
2103 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
2105 typedef struct LDKCResult_RouteParametersDecodeErrorZ {
2107 * The contents of this CResult_RouteParametersDecodeErrorZ, accessible via either
2108 * `err` or `result` depending on the state of `result_ok`.
2110 union LDKCResult_RouteParametersDecodeErrorZPtr contents;
2112 * Whether this CResult_RouteParametersDecodeErrorZ represents a success state.
2115 } LDKCResult_RouteParametersDecodeErrorZ;
2120 * A list of hops along a payment path terminating with a channel to the recipient.
2122 typedef struct MUST_USE_STRUCT LDKRouteHint {
2124 * A pointer to the opaque Rust object.
2125 * Nearly everywhere, inner must be non-null, however in places where
2126 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2128 LDKnativeRouteHint *inner;
2130 * Indicates that this is the only struct which contains the same pointer.
2131 * Rust functions which take ownership of an object provided via an argument require
2132 * this to be true and invalidate the object pointed to by inner.
2138 * A dynamically-allocated array of crate::lightning::routing::router::RouteHints of arbitrary size.
2139 * This corresponds to std::vector in C++
2141 typedef struct LDKCVec_RouteHintZ {
2143 * The elements in the array.
2144 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
2146 struct LDKRouteHint *data;
2148 * The number of elements pointed to by `data`.
2151 } LDKCVec_RouteHintZ;
2154 * An enum which can either contain a u64 or not
2156 typedef enum LDKCOption_u64Z_Tag {
2158 * When we're in this state, this COption_u64Z contains a u64
2160 LDKCOption_u64Z_Some,
2162 * When we're in this state, this COption_u64Z contains nothing
2164 LDKCOption_u64Z_None,
2166 * Must be last for serialization purposes
2168 LDKCOption_u64Z_Sentinel,
2169 } LDKCOption_u64Z_Tag;
2171 typedef struct LDKCOption_u64Z {
2172 LDKCOption_u64Z_Tag tag;
2181 * A dynamically-allocated array of u64s of arbitrary size.
2182 * This corresponds to std::vector in C++
2184 typedef struct LDKCVec_u64Z {
2186 * The elements in the array.
2187 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
2191 * The number of elements pointed to by `data`.
2199 * The recipient of a payment.
2201 typedef struct MUST_USE_STRUCT LDKPaymentParameters {
2203 * A pointer to the opaque Rust object.
2204 * Nearly everywhere, inner must be non-null, however in places where
2205 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2207 LDKnativePaymentParameters *inner;
2209 * Indicates that this is the only struct which contains the same pointer.
2210 * Rust functions which take ownership of an object provided via an argument require
2211 * this to be true and invalidate the object pointed to by inner.
2214 } LDKPaymentParameters;
2217 * The contents of CResult_PaymentParametersDecodeErrorZ
2219 typedef union LDKCResult_PaymentParametersDecodeErrorZPtr {
2221 * A pointer to the contents in the success state.
2222 * Reading from this pointer when `result_ok` is not set is undefined.
2224 struct LDKPaymentParameters *result;
2226 * A pointer to the contents in the error state.
2227 * Reading from this pointer when `result_ok` is set is undefined.
2229 struct LDKDecodeError *err;
2230 } LDKCResult_PaymentParametersDecodeErrorZPtr;
2233 * A CResult_PaymentParametersDecodeErrorZ represents the result of a fallible operation,
2234 * containing a crate::lightning::routing::router::PaymentParameters on success and a crate::lightning::ln::msgs::DecodeError on failure.
2235 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
2237 typedef struct LDKCResult_PaymentParametersDecodeErrorZ {
2239 * The contents of this CResult_PaymentParametersDecodeErrorZ, accessible via either
2240 * `err` or `result` depending on the state of `result_ok`.
2242 union LDKCResult_PaymentParametersDecodeErrorZPtr contents;
2244 * Whether this CResult_PaymentParametersDecodeErrorZ represents a success state.
2247 } LDKCResult_PaymentParametersDecodeErrorZ;
2252 * A channel descriptor for a hop along a payment path.
2254 typedef struct MUST_USE_STRUCT LDKRouteHintHop {
2256 * A pointer to the opaque Rust object.
2257 * Nearly everywhere, inner must be non-null, however in places where
2258 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2260 LDKnativeRouteHintHop *inner;
2262 * Indicates that this is the only struct which contains the same pointer.
2263 * Rust functions which take ownership of an object provided via an argument require
2264 * this to be true and invalidate the object pointed to by inner.
2270 * A dynamically-allocated array of crate::lightning::routing::router::RouteHintHops of arbitrary size.
2271 * This corresponds to std::vector in C++
2273 typedef struct LDKCVec_RouteHintHopZ {
2275 * The elements in the array.
2276 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
2278 struct LDKRouteHintHop *data;
2280 * The number of elements pointed to by `data`.
2283 } LDKCVec_RouteHintHopZ;
2286 * The contents of CResult_RouteHintDecodeErrorZ
2288 typedef union LDKCResult_RouteHintDecodeErrorZPtr {
2290 * A pointer to the contents in the success state.
2291 * Reading from this pointer when `result_ok` is not set is undefined.
2293 struct LDKRouteHint *result;
2295 * A pointer to the contents in the error state.
2296 * Reading from this pointer when `result_ok` is set is undefined.
2298 struct LDKDecodeError *err;
2299 } LDKCResult_RouteHintDecodeErrorZPtr;
2302 * A CResult_RouteHintDecodeErrorZ represents the result of a fallible operation,
2303 * containing a crate::lightning::routing::router::RouteHint on success and a crate::lightning::ln::msgs::DecodeError on failure.
2304 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
2306 typedef struct LDKCResult_RouteHintDecodeErrorZ {
2308 * The contents of this CResult_RouteHintDecodeErrorZ, accessible via either
2309 * `err` or `result` depending on the state of `result_ok`.
2311 union LDKCResult_RouteHintDecodeErrorZPtr contents;
2313 * Whether this CResult_RouteHintDecodeErrorZ represents a success state.
2316 } LDKCResult_RouteHintDecodeErrorZ;
2319 * The contents of CResult_RouteHintHopDecodeErrorZ
2321 typedef union LDKCResult_RouteHintHopDecodeErrorZPtr {
2323 * A pointer to the contents in the success state.
2324 * Reading from this pointer when `result_ok` is not set is undefined.
2326 struct LDKRouteHintHop *result;
2328 * A pointer to the contents in the error state.
2329 * Reading from this pointer when `result_ok` is set is undefined.
2331 struct LDKDecodeError *err;
2332 } LDKCResult_RouteHintHopDecodeErrorZPtr;
2335 * A CResult_RouteHintHopDecodeErrorZ represents the result of a fallible operation,
2336 * containing a crate::lightning::routing::router::RouteHintHop on success and a crate::lightning::ln::msgs::DecodeError on failure.
2337 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
2339 typedef struct LDKCResult_RouteHintHopDecodeErrorZ {
2341 * The contents of this CResult_RouteHintHopDecodeErrorZ, accessible via either
2342 * `err` or `result` depending on the state of `result_ok`.
2344 union LDKCResult_RouteHintHopDecodeErrorZPtr contents;
2346 * Whether this CResult_RouteHintHopDecodeErrorZ represents a success state.
2349 } LDKCResult_RouteHintHopDecodeErrorZ;
2354 * Details of a channel, as returned by ChannelManager::list_channels and ChannelManager::list_usable_channels
2356 typedef struct MUST_USE_STRUCT LDKChannelDetails {
2358 * A pointer to the opaque Rust object.
2359 * Nearly everywhere, inner must be non-null, however in places where
2360 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2362 LDKnativeChannelDetails *inner;
2364 * Indicates that this is the only struct which contains the same pointer.
2365 * Rust functions which take ownership of an object provided via an argument require
2366 * this to be true and invalidate the object pointed to by inner.
2369 } LDKChannelDetails;
2372 * A dynamically-allocated array of crate::lightning::ln::channelmanager::ChannelDetailss of arbitrary size.
2373 * This corresponds to std::vector in C++
2375 typedef struct LDKCVec_ChannelDetailsZ {
2377 * The elements in the array.
2378 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
2380 struct LDKChannelDetails *data;
2382 * The number of elements pointed to by `data`.
2385 } LDKCVec_ChannelDetailsZ;
2390 * An Err type for failure to process messages.
2392 typedef struct MUST_USE_STRUCT LDKLightningError {
2394 * A pointer to the opaque Rust object.
2395 * Nearly everywhere, inner must be non-null, however in places where
2396 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2398 LDKnativeLightningError *inner;
2400 * Indicates that this is the only struct which contains the same pointer.
2401 * Rust functions which take ownership of an object provided via an argument require
2402 * this to be true and invalidate the object pointed to by inner.
2405 } LDKLightningError;
2408 * The contents of CResult_RouteLightningErrorZ
2410 typedef union LDKCResult_RouteLightningErrorZPtr {
2412 * A pointer to the contents in the success state.
2413 * Reading from this pointer when `result_ok` is not set is undefined.
2415 struct LDKRoute *result;
2417 * A pointer to the contents in the error state.
2418 * Reading from this pointer when `result_ok` is set is undefined.
2420 struct LDKLightningError *err;
2421 } LDKCResult_RouteLightningErrorZPtr;
2424 * A CResult_RouteLightningErrorZ represents the result of a fallible operation,
2425 * containing a crate::lightning::routing::router::Route on success and a crate::lightning::ln::msgs::LightningError on failure.
2426 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
2428 typedef struct LDKCResult_RouteLightningErrorZ {
2430 * The contents of this CResult_RouteLightningErrorZ, accessible via either
2431 * `err` or `result` depending on the state of `result_ok`.
2433 union LDKCResult_RouteLightningErrorZPtr contents;
2435 * Whether this CResult_RouteLightningErrorZ represents a success state.
2438 } LDKCResult_RouteLightningErrorZ;
2441 * Arbitrary 32 bytes, which could represent one of a few different things. You probably want to
2442 * look up the corresponding function in rust-lightning's docs.
2444 typedef struct LDKThirtyTwoBytes {
2446 * The thirty-two bytes
2449 } LDKThirtyTwoBytes;
2452 * Some information provided on receipt of payment depends on whether the payment received is a
2453 * spontaneous payment or a \"conventional\" lightning payment that's paying an invoice.
2455 typedef enum LDKPaymentPurpose_Tag {
2457 * Information for receiving a payment that we generated an invoice for.
2459 LDKPaymentPurpose_InvoicePayment,
2461 * Because this is a spontaneous payment, the payer generated their own preimage rather than us
2462 * (the payee) providing a preimage.
2464 LDKPaymentPurpose_SpontaneousPayment,
2466 * Must be last for serialization purposes
2468 LDKPaymentPurpose_Sentinel,
2469 } LDKPaymentPurpose_Tag;
2471 typedef struct LDKPaymentPurpose_LDKInvoicePayment_Body {
2473 * The preimage to the payment_hash, if the payment hash (and secret) were fetched via
2474 * [`ChannelManager::create_inbound_payment`]. If provided, this can be handed directly to
2475 * [`ChannelManager::claim_funds`].
2477 * [`ChannelManager::create_inbound_payment`]: crate::ln::channelmanager::ChannelManager::create_inbound_payment
2478 * [`ChannelManager::claim_funds`]: crate::ln::channelmanager::ChannelManager::claim_funds
2480 * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
2482 struct LDKThirtyTwoBytes payment_preimage;
2484 * The \"payment secret\". This authenticates the sender to the recipient, preventing a
2485 * number of deanonymization attacks during the routing process.
2486 * It is provided here for your reference, however its accuracy is enforced directly by
2487 * [`ChannelManager`] using the values you previously provided to
2488 * [`ChannelManager::create_inbound_payment`] or
2489 * [`ChannelManager::create_inbound_payment_for_hash`].
2491 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
2492 * [`ChannelManager::create_inbound_payment`]: crate::ln::channelmanager::ChannelManager::create_inbound_payment
2493 * [`ChannelManager::create_inbound_payment_for_hash`]: crate::ln::channelmanager::ChannelManager::create_inbound_payment_for_hash
2495 struct LDKThirtyTwoBytes payment_secret;
2496 } LDKPaymentPurpose_LDKInvoicePayment_Body;
2498 typedef struct MUST_USE_STRUCT LDKPaymentPurpose {
2499 LDKPaymentPurpose_Tag tag;
2501 LDKPaymentPurpose_LDKInvoicePayment_Body invoice_payment;
2503 struct LDKThirtyTwoBytes spontaneous_payment;
2506 } LDKPaymentPurpose;
2509 * The contents of CResult_PaymentPurposeDecodeErrorZ
2511 typedef union LDKCResult_PaymentPurposeDecodeErrorZPtr {
2513 * A pointer to the contents in the success state.
2514 * Reading from this pointer when `result_ok` is not set is undefined.
2516 struct LDKPaymentPurpose *result;
2518 * A pointer to the contents in the error state.
2519 * Reading from this pointer when `result_ok` is set is undefined.
2521 struct LDKDecodeError *err;
2522 } LDKCResult_PaymentPurposeDecodeErrorZPtr;
2525 * A CResult_PaymentPurposeDecodeErrorZ represents the result of a fallible operation,
2526 * containing a crate::lightning::util::events::PaymentPurpose on success and a crate::lightning::ln::msgs::DecodeError on failure.
2527 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
2529 typedef struct LDKCResult_PaymentPurposeDecodeErrorZ {
2531 * The contents of this CResult_PaymentPurposeDecodeErrorZ, accessible via either
2532 * `err` or `result` depending on the state of `result_ok`.
2534 union LDKCResult_PaymentPurposeDecodeErrorZPtr contents;
2536 * Whether this CResult_PaymentPurposeDecodeErrorZ represents a success state.
2539 } LDKCResult_PaymentPurposeDecodeErrorZ;
2542 * The reason the channel was closed. See individual variants more details.
2544 typedef enum LDKClosureReason_Tag {
2546 * Closure generated from receiving a peer error message.
2548 * Our counterparty may have broadcasted their latest commitment state, and we have
2551 LDKClosureReason_CounterpartyForceClosed,
2553 * Closure generated from [`ChannelManager::force_close_channel`], called by the user.
2555 * [`ChannelManager::force_close_channel`]: crate::ln::channelmanager::ChannelManager::force_close_channel.
2557 LDKClosureReason_HolderForceClosed,
2559 * The channel was closed after negotiating a cooperative close and we've now broadcasted
2560 * the cooperative close transaction. Note the shutdown may have been initiated by us.
2562 LDKClosureReason_CooperativeClosure,
2564 * A commitment transaction was confirmed on chain, closing the channel. Most likely this
2565 * commitment transaction came from our counterparty, but it may also have come from
2566 * a copy of our own `ChannelMonitor`.
2568 LDKClosureReason_CommitmentTxConfirmed,
2570 * The funding transaction failed to confirm in a timely manner on an inbound channel.
2572 LDKClosureReason_FundingTimedOut,
2574 * Closure generated from processing an event, likely a HTLC forward/relay/reception.
2576 LDKClosureReason_ProcessingError,
2578 * The peer disconnected prior to funding completing. In this case the spec mandates that we
2579 * forget the channel entirely - we can attempt again if the peer reconnects.
2581 * In LDK versions prior to 0.0.107 this could also occur if we were unable to connect to the
2582 * peer because of mutual incompatibility between us and our channel counterparty.
2584 LDKClosureReason_DisconnectedPeer,
2586 * Closure generated from `ChannelManager::read` if the ChannelMonitor is newer than
2587 * the ChannelManager deserialized.
2589 LDKClosureReason_OutdatedChannelManager,
2591 * Must be last for serialization purposes
2593 LDKClosureReason_Sentinel,
2594 } LDKClosureReason_Tag;
2596 typedef struct LDKClosureReason_LDKCounterpartyForceClosed_Body {
2598 * The error which the peer sent us.
2600 * The string should be sanitized before it is used (e.g emitted to logs
2601 * or printed to stdout). Otherwise, a well crafted error message may exploit
2602 * a security vulnerability in the terminal emulator or the logging subsystem.
2604 struct LDKStr peer_msg;
2605 } LDKClosureReason_LDKCounterpartyForceClosed_Body;
2607 typedef struct LDKClosureReason_LDKProcessingError_Body {
2609 * A developer-readable error message which we generated.
2612 } LDKClosureReason_LDKProcessingError_Body;
2614 typedef struct MUST_USE_STRUCT LDKClosureReason {
2615 LDKClosureReason_Tag tag;
2617 LDKClosureReason_LDKCounterpartyForceClosed_Body counterparty_force_closed;
2618 LDKClosureReason_LDKProcessingError_Body processing_error;
2623 * An enum which can either contain a crate::lightning::util::events::ClosureReason or not
2625 typedef enum LDKCOption_ClosureReasonZ_Tag {
2627 * When we're in this state, this COption_ClosureReasonZ contains a crate::lightning::util::events::ClosureReason
2629 LDKCOption_ClosureReasonZ_Some,
2631 * When we're in this state, this COption_ClosureReasonZ contains nothing
2633 LDKCOption_ClosureReasonZ_None,
2635 * Must be last for serialization purposes
2637 LDKCOption_ClosureReasonZ_Sentinel,
2638 } LDKCOption_ClosureReasonZ_Tag;
2640 typedef struct LDKCOption_ClosureReasonZ {
2641 LDKCOption_ClosureReasonZ_Tag tag;
2644 struct LDKClosureReason some;
2647 } LDKCOption_ClosureReasonZ;
2650 * The contents of CResult_COption_ClosureReasonZDecodeErrorZ
2652 typedef union LDKCResult_COption_ClosureReasonZDecodeErrorZPtr {
2654 * A pointer to the contents in the success state.
2655 * Reading from this pointer when `result_ok` is not set is undefined.
2657 struct LDKCOption_ClosureReasonZ *result;
2659 * A pointer to the contents in the error state.
2660 * Reading from this pointer when `result_ok` is set is undefined.
2662 struct LDKDecodeError *err;
2663 } LDKCResult_COption_ClosureReasonZDecodeErrorZPtr;
2666 * A CResult_COption_ClosureReasonZDecodeErrorZ represents the result of a fallible operation,
2667 * containing a crate::c_types::derived::COption_ClosureReasonZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
2668 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
2670 typedef struct LDKCResult_COption_ClosureReasonZDecodeErrorZ {
2672 * The contents of this CResult_COption_ClosureReasonZDecodeErrorZ, accessible via either
2673 * `err` or `result` depending on the state of `result_ok`.
2675 union LDKCResult_COption_ClosureReasonZDecodeErrorZPtr contents;
2677 * Whether this CResult_COption_ClosureReasonZDecodeErrorZ represents a success state.
2680 } LDKCResult_COption_ClosureReasonZDecodeErrorZ;
2683 * Intended destination of a failed HTLC as indicated in [`Event::HTLCHandlingFailed`].
2685 typedef enum LDKHTLCDestination_Tag {
2687 * We tried forwarding to a channel but failed to do so. An example of such an instance is when
2688 * there is insufficient capacity in our outbound channel.
2690 LDKHTLCDestination_NextHopChannel,
2692 * Scenario where we are unsure of the next node to forward the HTLC to.
2694 LDKHTLCDestination_UnknownNextHop,
2696 * Failure scenario where an HTLC may have been forwarded to be intended for us,
2697 * but is invalid for some reason, so we reject it.
2699 * Some of the reasons may include:
2701 * * Expected MPP amount to claim does not equal HTLC total
2702 * * Claimable amount does not match expected amount
2704 LDKHTLCDestination_FailedPayment,
2706 * Must be last for serialization purposes
2708 LDKHTLCDestination_Sentinel,
2709 } LDKHTLCDestination_Tag;
2711 typedef struct LDKHTLCDestination_LDKNextHopChannel_Body {
2713 * The `node_id` of the next node. For backwards compatibility, this field is
2714 * marked as optional, versions prior to 0.0.110 may not always be able to provide
2715 * counterparty node information.
2717 * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
2719 struct LDKPublicKey node_id;
2721 * The outgoing `channel_id` between us and the next node.
2723 struct LDKThirtyTwoBytes channel_id;
2724 } LDKHTLCDestination_LDKNextHopChannel_Body;
2726 typedef struct LDKHTLCDestination_LDKUnknownNextHop_Body {
2728 * Short channel id we are requesting to forward an HTLC to.
2730 uint64_t requested_forward_scid;
2731 } LDKHTLCDestination_LDKUnknownNextHop_Body;
2733 typedef struct LDKHTLCDestination_LDKFailedPayment_Body {
2735 * The payment hash of the payment we attempted to process.
2737 struct LDKThirtyTwoBytes payment_hash;
2738 } LDKHTLCDestination_LDKFailedPayment_Body;
2740 typedef struct MUST_USE_STRUCT LDKHTLCDestination {
2741 LDKHTLCDestination_Tag tag;
2743 LDKHTLCDestination_LDKNextHopChannel_Body next_hop_channel;
2744 LDKHTLCDestination_LDKUnknownNextHop_Body unknown_next_hop;
2745 LDKHTLCDestination_LDKFailedPayment_Body failed_payment;
2747 } LDKHTLCDestination;
2750 * An enum which can either contain a crate::lightning::util::events::HTLCDestination or not
2752 typedef enum LDKCOption_HTLCDestinationZ_Tag {
2754 * When we're in this state, this COption_HTLCDestinationZ contains a crate::lightning::util::events::HTLCDestination
2756 LDKCOption_HTLCDestinationZ_Some,
2758 * When we're in this state, this COption_HTLCDestinationZ contains nothing
2760 LDKCOption_HTLCDestinationZ_None,
2762 * Must be last for serialization purposes
2764 LDKCOption_HTLCDestinationZ_Sentinel,
2765 } LDKCOption_HTLCDestinationZ_Tag;
2767 typedef struct LDKCOption_HTLCDestinationZ {
2768 LDKCOption_HTLCDestinationZ_Tag tag;
2771 struct LDKHTLCDestination some;
2774 } LDKCOption_HTLCDestinationZ;
2777 * The contents of CResult_COption_HTLCDestinationZDecodeErrorZ
2779 typedef union LDKCResult_COption_HTLCDestinationZDecodeErrorZPtr {
2781 * A pointer to the contents in the success state.
2782 * Reading from this pointer when `result_ok` is not set is undefined.
2784 struct LDKCOption_HTLCDestinationZ *result;
2786 * A pointer to the contents in the error state.
2787 * Reading from this pointer when `result_ok` is set is undefined.
2789 struct LDKDecodeError *err;
2790 } LDKCResult_COption_HTLCDestinationZDecodeErrorZPtr;
2793 * A CResult_COption_HTLCDestinationZDecodeErrorZ represents the result of a fallible operation,
2794 * containing a crate::c_types::derived::COption_HTLCDestinationZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
2795 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
2797 typedef struct LDKCResult_COption_HTLCDestinationZDecodeErrorZ {
2799 * The contents of this CResult_COption_HTLCDestinationZDecodeErrorZ, accessible via either
2800 * `err` or `result` depending on the state of `result_ok`.
2802 union LDKCResult_COption_HTLCDestinationZDecodeErrorZPtr contents;
2804 * Whether this CResult_COption_HTLCDestinationZDecodeErrorZ represents a success state.
2807 } LDKCResult_COption_HTLCDestinationZDecodeErrorZ;
2812 * A channel_update message to be sent or received from a peer
2814 typedef struct MUST_USE_STRUCT LDKChannelUpdate {
2816 * A pointer to the opaque Rust object.
2817 * Nearly everywhere, inner must be non-null, however in places where
2818 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2820 LDKnativeChannelUpdate *inner;
2822 * Indicates that this is the only struct which contains the same pointer.
2823 * Rust functions which take ownership of an object provided via an argument require
2824 * this to be true and invalidate the object pointed to by inner.
2830 * Update to the [`NetworkGraph`] based on payment failure information conveyed via the Onion
2831 * return packet by a node along the route. See [BOLT #4] for details.
2833 * [BOLT #4]: https://github.com/lightning/bolts/blob/master/04-onion-routing.md
2835 typedef enum LDKNetworkUpdate_Tag {
2837 * An error indicating a `channel_update` messages should be applied via
2838 * [`NetworkGraph::update_channel`].
2840 LDKNetworkUpdate_ChannelUpdateMessage,
2842 * An error indicating that a channel failed to route a payment, which should be applied via
2843 * [`NetworkGraph::channel_failed`].
2845 LDKNetworkUpdate_ChannelFailure,
2847 * An error indicating that a node failed to route a payment, which should be applied via
2848 * [`NetworkGraph::node_failed`].
2850 LDKNetworkUpdate_NodeFailure,
2852 * Must be last for serialization purposes
2854 LDKNetworkUpdate_Sentinel,
2855 } LDKNetworkUpdate_Tag;
2857 typedef struct LDKNetworkUpdate_LDKChannelUpdateMessage_Body {
2859 * The update to apply via [`NetworkGraph::update_channel`].
2861 struct LDKChannelUpdate msg;
2862 } LDKNetworkUpdate_LDKChannelUpdateMessage_Body;
2864 typedef struct LDKNetworkUpdate_LDKChannelFailure_Body {
2866 * The short channel id of the closed channel.
2868 uint64_t short_channel_id;
2870 * Whether the channel should be permanently removed or temporarily disabled until a new
2871 * `channel_update` message is received.
2874 } LDKNetworkUpdate_LDKChannelFailure_Body;
2876 typedef struct LDKNetworkUpdate_LDKNodeFailure_Body {
2878 * The node id of the failed node.
2880 struct LDKPublicKey node_id;
2882 * Whether the node should be permanently removed from consideration or can be restored
2883 * when a new `channel_update` message is received.
2886 } LDKNetworkUpdate_LDKNodeFailure_Body;
2888 typedef struct MUST_USE_STRUCT LDKNetworkUpdate {
2889 LDKNetworkUpdate_Tag tag;
2891 LDKNetworkUpdate_LDKChannelUpdateMessage_Body channel_update_message;
2892 LDKNetworkUpdate_LDKChannelFailure_Body channel_failure;
2893 LDKNetworkUpdate_LDKNodeFailure_Body node_failure;
2898 * An enum which can either contain a crate::lightning::routing::gossip::NetworkUpdate or not
2900 typedef enum LDKCOption_NetworkUpdateZ_Tag {
2902 * When we're in this state, this COption_NetworkUpdateZ contains a crate::lightning::routing::gossip::NetworkUpdate
2904 LDKCOption_NetworkUpdateZ_Some,
2906 * When we're in this state, this COption_NetworkUpdateZ contains nothing
2908 LDKCOption_NetworkUpdateZ_None,
2910 * Must be last for serialization purposes
2912 LDKCOption_NetworkUpdateZ_Sentinel,
2913 } LDKCOption_NetworkUpdateZ_Tag;
2915 typedef struct LDKCOption_NetworkUpdateZ {
2916 LDKCOption_NetworkUpdateZ_Tag tag;
2919 struct LDKNetworkUpdate some;
2922 } LDKCOption_NetworkUpdateZ;
2927 * A reference to a transaction output.
2929 * Differs from bitcoin::blockdata::transaction::OutPoint as the index is a u16 instead of u32
2930 * due to LN's restrictions on index values. Should reduce (possibly) unsafe conversions this way.
2932 typedef struct MUST_USE_STRUCT LDKOutPoint {
2934 * A pointer to the opaque Rust object.
2935 * Nearly everywhere, inner must be non-null, however in places where
2936 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2938 LDKnativeOutPoint *inner;
2940 * Indicates that this is the only struct which contains the same pointer.
2941 * Rust functions which take ownership of an object provided via an argument require
2942 * this to be true and invalidate the object pointed to by inner.
2950 * Information about a spendable output to a P2WSH script. See
2951 * SpendableOutputDescriptor::DelayedPaymentOutput for more details on how to spend this.
2953 typedef struct MUST_USE_STRUCT LDKDelayedPaymentOutputDescriptor {
2955 * A pointer to the opaque Rust object.
2956 * Nearly everywhere, inner must be non-null, however in places where
2957 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2959 LDKnativeDelayedPaymentOutputDescriptor *inner;
2961 * Indicates that this is the only struct which contains the same pointer.
2962 * Rust functions which take ownership of an object provided via an argument require
2963 * this to be true and invalidate the object pointed to by inner.
2966 } LDKDelayedPaymentOutputDescriptor;
2971 * Information about a spendable output to our \"payment key\". See
2972 * SpendableOutputDescriptor::StaticPaymentOutput for more details on how to spend this.
2974 typedef struct MUST_USE_STRUCT LDKStaticPaymentOutputDescriptor {
2976 * A pointer to the opaque Rust object.
2977 * Nearly everywhere, inner must be non-null, however in places where
2978 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2980 LDKnativeStaticPaymentOutputDescriptor *inner;
2982 * Indicates that this is the only struct which contains the same pointer.
2983 * Rust functions which take ownership of an object provided via an argument require
2984 * this to be true and invalidate the object pointed to by inner.
2987 } LDKStaticPaymentOutputDescriptor;
2990 * When on-chain outputs are created by rust-lightning (which our counterparty is not able to
2991 * claim at any point in the future) an event is generated which you must track and be able to
2992 * spend on-chain. The information needed to do this is provided in this enum, including the
2993 * outpoint describing which txid and output index is available, the full output which exists at
2994 * that txid/index, and any keys or other information required to sign.
2996 typedef enum LDKSpendableOutputDescriptor_Tag {
2998 * An output to a script which was provided via KeysInterface directly, either from
2999 * `get_destination_script()` or `get_shutdown_scriptpubkey()`, thus you should already know
3000 * how to spend it. No secret keys are provided as rust-lightning was never given any key.
3001 * These may include outputs from a transaction punishing our counterparty or claiming an HTLC
3002 * on-chain using the payment preimage or after it has timed out.
3004 LDKSpendableOutputDescriptor_StaticOutput,
3006 * An output to a P2WSH script which can be spent with a single signature after a CSV delay.
3008 * The witness in the spending input should be:
3009 * <BIP 143 signature> <empty vector> (MINIMALIF standard rule) <provided witnessScript>
3011 * Note that the nSequence field in the spending input must be set to to_self_delay
3012 * (which means the transaction is not broadcastable until at least to_self_delay
3013 * blocks after the outpoint confirms).
3015 * These are generally the result of a \"revocable\" output to us, spendable only by us unless
3016 * it is an output from an old state which we broadcast (which should never happen).
3018 * To derive the delayed_payment key which is used to sign for this input, you must pass the
3019 * holder delayed_payment_base_key (ie the private key which corresponds to the pubkey in
3020 * Sign::pubkeys().delayed_payment_basepoint) and the provided per_commitment_point to
3021 * chan_utils::derive_private_key. The public key can be generated without the secret key
3022 * using chan_utils::derive_public_key and only the delayed_payment_basepoint which appears in
3025 * To derive the revocation_pubkey provided here (which is used in the witness
3026 * script generation), you must pass the counterparty revocation_basepoint (which appears in the
3027 * call to Sign::ready_channel) and the provided per_commitment point
3028 * to chan_utils::derive_public_revocation_key.
3030 * The witness script which is hashed and included in the output script_pubkey may be
3031 * regenerated by passing the revocation_pubkey (derived as above), our delayed_payment pubkey
3032 * (derived as above), and the to_self_delay contained here to
3033 * chan_utils::get_revokeable_redeemscript.
3035 LDKSpendableOutputDescriptor_DelayedPaymentOutput,
3037 * An output to a P2WPKH, spendable exclusively by our payment key (ie the private key which
3038 * corresponds to the public key in Sign::pubkeys().payment_point).
3039 * The witness in the spending input, is, thus, simply:
3040 * <BIP 143 signature> <payment key>
3042 * These are generally the result of our counterparty having broadcast the current state,
3043 * allowing us to claim the non-HTLC-encumbered outputs immediately.
3045 LDKSpendableOutputDescriptor_StaticPaymentOutput,
3047 * Must be last for serialization purposes
3049 LDKSpendableOutputDescriptor_Sentinel,
3050 } LDKSpendableOutputDescriptor_Tag;
3052 typedef struct LDKSpendableOutputDescriptor_LDKStaticOutput_Body {
3054 * The outpoint which is spendable
3056 struct LDKOutPoint outpoint;
3058 * The output which is referenced by the given outpoint.
3060 struct LDKTxOut output;
3061 } LDKSpendableOutputDescriptor_LDKStaticOutput_Body;
3063 typedef struct MUST_USE_STRUCT LDKSpendableOutputDescriptor {
3064 LDKSpendableOutputDescriptor_Tag tag;
3066 LDKSpendableOutputDescriptor_LDKStaticOutput_Body static_output;
3068 struct LDKDelayedPaymentOutputDescriptor delayed_payment_output;
3071 struct LDKStaticPaymentOutputDescriptor static_payment_output;
3074 } LDKSpendableOutputDescriptor;
3077 * A dynamically-allocated array of crate::lightning::chain::keysinterface::SpendableOutputDescriptors of arbitrary size.
3078 * This corresponds to std::vector in C++
3080 typedef struct LDKCVec_SpendableOutputDescriptorZ {
3082 * The elements in the array.
3083 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
3085 struct LDKSpendableOutputDescriptor *data;
3087 * The number of elements pointed to by `data`.
3090 } LDKCVec_SpendableOutputDescriptorZ;
3095 * Features used within the channel_type field in an OpenChannel message.
3097 * A channel is always of some known \"type\", describing the transaction formats used and the exact
3098 * semantics of our interaction with our peer.
3100 * Note that because a channel is a specific type which is proposed by the opener and accepted by
3101 * the counterparty, only required features are allowed here.
3103 * This is serialized differently from other feature types - it is not prefixed by a length, and
3104 * thus must only appear inside a TLV where its length is known in advance.
3106 typedef struct MUST_USE_STRUCT LDKChannelTypeFeatures {
3108 * A pointer to the opaque Rust object.
3109 * Nearly everywhere, inner must be non-null, however in places where
3110 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3112 LDKnativeChannelTypeFeatures *inner;
3114 * Indicates that this is the only struct which contains the same pointer.
3115 * Rust functions which take ownership of an object provided via an argument require
3116 * this to be true and invalidate the object pointed to by inner.
3119 } LDKChannelTypeFeatures;
3122 * An Event which you should probably take some action in response to.
3124 * Note that while Writeable and Readable are implemented for Event, you probably shouldn't use
3125 * them directly as they don't round-trip exactly (for example FundingGenerationReady is never
3126 * written as it makes no sense to respond to it after reconnecting to peers).
3128 typedef enum LDKEvent_Tag {
3130 * Used to indicate that the client should generate a funding transaction with the given
3131 * parameters and then call [`ChannelManager::funding_transaction_generated`].
3132 * Generated in [`ChannelManager`] message handling.
3133 * Note that *all inputs* in the funding transaction must spend SegWit outputs or your
3134 * counterparty can steal your funds!
3136 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
3137 * [`ChannelManager::funding_transaction_generated`]: crate::ln::channelmanager::ChannelManager::funding_transaction_generated
3139 LDKEvent_FundingGenerationReady,
3141 * Indicates we've received (an offer of) money! Just gotta dig out that payment preimage and
3142 * feed it to [`ChannelManager::claim_funds`] to get it....
3144 * Note that if the preimage is not known, you should call
3145 * [`ChannelManager::fail_htlc_backwards`] to free up resources for this HTLC and avoid
3146 * network congestion.
3147 * If you fail to call either [`ChannelManager::claim_funds`] or
3148 * [`ChannelManager::fail_htlc_backwards`] within the HTLC's timeout, the HTLC will be
3149 * automatically failed.
3152 * LDK will not stop an inbound payment from being paid multiple times, so multiple
3153 * `PaymentReceived` events may be generated for the same payment.
3155 * [`ChannelManager::claim_funds`]: crate::ln::channelmanager::ChannelManager::claim_funds
3156 * [`ChannelManager::fail_htlc_backwards`]: crate::ln::channelmanager::ChannelManager::fail_htlc_backwards
3158 LDKEvent_PaymentReceived,
3160 * Indicates a payment has been claimed and we've received money!
3162 * This most likely occurs when [`ChannelManager::claim_funds`] has been called in response
3163 * to an [`Event::PaymentReceived`]. However, if we previously crashed during a
3164 * [`ChannelManager::claim_funds`] call you may see this event without a corresponding
3165 * [`Event::PaymentReceived`] event.
3168 * LDK will not stop an inbound payment from being paid multiple times, so multiple
3169 * `PaymentReceived` events may be generated for the same payment. If you then call
3170 * [`ChannelManager::claim_funds`] twice for the same [`Event::PaymentReceived`] you may get
3171 * multiple `PaymentClaimed` events.
3173 * [`ChannelManager::claim_funds`]: crate::ln::channelmanager::ChannelManager::claim_funds
3175 LDKEvent_PaymentClaimed,
3177 * Indicates an outbound payment we made succeeded (i.e. it made it all the way to its target
3178 * and we got back the payment preimage for it).
3180 * Note for MPP payments: in rare cases, this event may be preceded by a `PaymentPathFailed`
3181 * event. In this situation, you SHOULD treat this payment as having succeeded.
3183 LDKEvent_PaymentSent,
3185 * Indicates an outbound payment failed. Individual [`Event::PaymentPathFailed`] events
3186 * provide failure information for each MPP part in the payment.
3188 * This event is provided once there are no further pending HTLCs for the payment and the
3189 * payment is no longer retryable, either due to a several-block timeout or because
3190 * [`ChannelManager::abandon_payment`] was previously called for the corresponding payment.
3192 * [`ChannelManager::abandon_payment`]: crate::ln::channelmanager::ChannelManager::abandon_payment
3194 LDKEvent_PaymentFailed,
3196 * Indicates that a path for an outbound payment was successful.
3198 * Always generated after [`Event::PaymentSent`] and thus useful for scoring channels. See
3199 * [`Event::PaymentSent`] for obtaining the payment preimage.
3201 LDKEvent_PaymentPathSuccessful,
3203 * Indicates an outbound HTLC we sent failed. Probably some intermediary node dropped
3204 * something. You may wish to retry with a different route.
3206 * Note that this does *not* indicate that all paths for an MPP payment have failed, see
3207 * [`Event::PaymentFailed`] and [`all_paths_failed`].
3209 * [`all_paths_failed`]: Self::PaymentPathFailed::all_paths_failed
3211 LDKEvent_PaymentPathFailed,
3213 * Indicates that a probe payment we sent returned successful, i.e., only failed at the destination.
3215 LDKEvent_ProbeSuccessful,
3217 * Indicates that a probe payment we sent failed at an intermediary node on the path.
3219 LDKEvent_ProbeFailed,
3221 * Used to indicate that [`ChannelManager::process_pending_htlc_forwards`] should be called at
3222 * a time in the future.
3224 * [`ChannelManager::process_pending_htlc_forwards`]: crate::ln::channelmanager::ChannelManager::process_pending_htlc_forwards
3226 LDKEvent_PendingHTLCsForwardable,
3228 * Used to indicate that an output which you should know how to spend was confirmed on chain
3229 * and is now spendable.
3230 * Such an output will *not* ever be spent by rust-lightning, and are not at risk of your
3231 * counterparty spending them due to some kind of timeout. Thus, you need to store them
3232 * somewhere and spend them when you create on-chain transactions.
3234 LDKEvent_SpendableOutputs,
3236 * This event is generated when a payment has been successfully forwarded through us and a
3237 * forwarding fee earned.
3239 LDKEvent_PaymentForwarded,
3241 * Used to indicate that a previously opened channel with the given `channel_id` is in the
3242 * process of closure.
3244 LDKEvent_ChannelClosed,
3246 * Used to indicate to the user that they can abandon the funding transaction and recycle the
3247 * inputs for another purpose.
3249 LDKEvent_DiscardFunding,
3251 * Indicates a request to open a new channel by a peer.
3253 * To accept the request, call [`ChannelManager::accept_inbound_channel`]. To reject the
3254 * request, call [`ChannelManager::force_close_without_broadcasting_txn`].
3256 * The event is only triggered when a new open channel request is received and the
3257 * [`UserConfig::manually_accept_inbound_channels`] config flag is set to true.
3259 * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
3260 * [`ChannelManager::force_close_without_broadcasting_txn`]: crate::ln::channelmanager::ChannelManager::force_close_without_broadcasting_txn
3261 * [`UserConfig::manually_accept_inbound_channels`]: crate::util::config::UserConfig::manually_accept_inbound_channels
3263 LDKEvent_OpenChannelRequest,
3265 * Indicates that the HTLC was accepted, but could not be processed when or after attempting to
3268 * Some scenarios where this event may be sent include:
3269 * * Insufficient capacity in the outbound channel
3270 * * While waiting to forward the HTLC, the channel it is meant to be forwarded through closes
3271 * * When an unknown SCID is requested for forwarding a payment.
3272 * * Claiming an amount for an MPP payment that exceeds the HTLC total
3273 * * The HTLC has timed out
3275 * This event, however, does not get generated if an HTLC fails to meet the forwarding
3276 * requirements (i.e. insufficient fees paid, or a CLTV that is too soon).
3278 LDKEvent_HTLCHandlingFailed,
3280 * Must be last for serialization purposes
3285 typedef struct LDKEvent_LDKFundingGenerationReady_Body {
3287 * The random channel_id we picked which you'll need to pass into
3288 * [`ChannelManager::funding_transaction_generated`].
3290 * [`ChannelManager::funding_transaction_generated`]: crate::ln::channelmanager::ChannelManager::funding_transaction_generated
3292 struct LDKThirtyTwoBytes temporary_channel_id;
3294 * The counterparty's node_id, which you'll need to pass back into
3295 * [`ChannelManager::funding_transaction_generated`].
3297 * [`ChannelManager::funding_transaction_generated`]: crate::ln::channelmanager::ChannelManager::funding_transaction_generated
3299 struct LDKPublicKey counterparty_node_id;
3301 * The value, in satoshis, that the output should have.
3303 uint64_t channel_value_satoshis;
3305 * The script which should be used in the transaction output.
3307 struct LDKCVec_u8Z output_script;
3309 * The `user_channel_id` value passed in to [`ChannelManager::create_channel`], or 0 for
3310 * an inbound channel.
3312 * [`ChannelManager::create_channel`]: crate::ln::channelmanager::ChannelManager::create_channel
3314 uint64_t user_channel_id;
3315 } LDKEvent_LDKFundingGenerationReady_Body;
3317 typedef struct LDKEvent_LDKPaymentReceived_Body {
3319 * The hash for which the preimage should be handed to the ChannelManager. Note that LDK will
3320 * not stop you from registering duplicate payment hashes for inbound payments.
3322 struct LDKThirtyTwoBytes payment_hash;
3324 * The value, in thousandths of a satoshi, that this payment is for.
3326 uint64_t amount_msat;
3328 * Information for claiming this received payment, based on whether the purpose of the
3329 * payment is to pay an invoice or to send a spontaneous payment.
3331 struct LDKPaymentPurpose purpose;
3332 } LDKEvent_LDKPaymentReceived_Body;
3334 typedef struct LDKEvent_LDKPaymentClaimed_Body {
3336 * The payment hash of the claimed payment. Note that LDK will not stop you from
3337 * registering duplicate payment hashes for inbound payments.
3339 struct LDKThirtyTwoBytes payment_hash;
3341 * The value, in thousandths of a satoshi, that this payment is for.
3343 uint64_t amount_msat;
3345 * The purpose of this claimed payment, i.e. whether the payment was for an invoice or a
3346 * spontaneous payment.
3348 struct LDKPaymentPurpose purpose;
3349 } LDKEvent_LDKPaymentClaimed_Body;
3351 typedef struct LDKEvent_LDKPaymentSent_Body {
3353 * The id returned by [`ChannelManager::send_payment`] and used with
3354 * [`ChannelManager::retry_payment`].
3356 * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
3357 * [`ChannelManager::retry_payment`]: crate::ln::channelmanager::ChannelManager::retry_payment
3359 * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
3361 struct LDKThirtyTwoBytes payment_id;
3363 * The preimage to the hash given to ChannelManager::send_payment.
3364 * Note that this serves as a payment receipt, if you wish to have such a thing, you must
3367 struct LDKThirtyTwoBytes payment_preimage;
3369 * The hash that was given to [`ChannelManager::send_payment`].
3371 * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
3373 struct LDKThirtyTwoBytes payment_hash;
3375 * The total fee which was spent at intermediate hops in this payment, across all paths.
3377 * Note that, like [`Route::get_total_fees`] this does *not* include any potential
3378 * overpayment to the recipient node.
3380 * If the recipient or an intermediate node misbehaves and gives us free money, this may
3381 * overstate the amount paid, though this is unlikely.
3383 * [`Route::get_total_fees`]: crate::routing::router::Route::get_total_fees
3385 struct LDKCOption_u64Z fee_paid_msat;
3386 } LDKEvent_LDKPaymentSent_Body;
3388 typedef struct LDKEvent_LDKPaymentFailed_Body {
3390 * The id returned by [`ChannelManager::send_payment`] and used with
3391 * [`ChannelManager::retry_payment`] and [`ChannelManager::abandon_payment`].
3393 * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
3394 * [`ChannelManager::retry_payment`]: crate::ln::channelmanager::ChannelManager::retry_payment
3395 * [`ChannelManager::abandon_payment`]: crate::ln::channelmanager::ChannelManager::abandon_payment
3397 struct LDKThirtyTwoBytes payment_id;
3399 * The hash that was given to [`ChannelManager::send_payment`].
3401 * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
3403 struct LDKThirtyTwoBytes payment_hash;
3404 } LDKEvent_LDKPaymentFailed_Body;
3406 typedef struct LDKEvent_LDKPaymentPathSuccessful_Body {
3408 * The id returned by [`ChannelManager::send_payment`] and used with
3409 * [`ChannelManager::retry_payment`].
3411 * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
3412 * [`ChannelManager::retry_payment`]: crate::ln::channelmanager::ChannelManager::retry_payment
3414 struct LDKThirtyTwoBytes payment_id;
3416 * The hash that was given to [`ChannelManager::send_payment`].
3418 * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
3420 * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
3422 struct LDKThirtyTwoBytes payment_hash;
3424 * The payment path that was successful.
3426 * May contain a closed channel if the HTLC sent along the path was fulfilled on chain.
3428 struct LDKCVec_RouteHopZ path;
3429 } LDKEvent_LDKPaymentPathSuccessful_Body;
3431 typedef struct LDKEvent_LDKPaymentPathFailed_Body {
3433 * The id returned by [`ChannelManager::send_payment`] and used with
3434 * [`ChannelManager::retry_payment`] and [`ChannelManager::abandon_payment`].
3436 * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
3437 * [`ChannelManager::retry_payment`]: crate::ln::channelmanager::ChannelManager::retry_payment
3438 * [`ChannelManager::abandon_payment`]: crate::ln::channelmanager::ChannelManager::abandon_payment
3440 * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
3442 struct LDKThirtyTwoBytes payment_id;
3444 * The hash that was given to [`ChannelManager::send_payment`].
3446 * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
3448 struct LDKThirtyTwoBytes payment_hash;
3450 * Indicates the payment was rejected for some reason by the recipient. This implies that
3451 * the payment has failed, not just the route in question. If this is not set, you may
3452 * retry the payment via a different route.
3454 bool payment_failed_permanently;
3456 * Any failure information conveyed via the Onion return packet by a node along the failed
3459 * Should be applied to the [`NetworkGraph`] so that routing decisions can take into
3460 * account the update.
3462 * [`NetworkGraph`]: crate::routing::gossip::NetworkGraph
3464 struct LDKCOption_NetworkUpdateZ network_update;
3466 * For both single-path and multi-path payments, this is set if all paths of the payment have
3467 * failed. This will be set to false if (1) this is an MPP payment and (2) other parts of the
3468 * larger MPP payment were still in flight when this event was generated.
3470 * Note that if you are retrying individual MPP parts, using this value to determine if a
3471 * payment has fully failed is race-y. Because multiple failures can happen prior to events
3472 * being processed, you may retry in response to a first failure, with a second failure
3473 * (with `all_paths_failed` set) still pending. Then, when the second failure is processed
3474 * you will see `all_paths_failed` set even though the retry of the first failure still
3475 * has an associated in-flight HTLC. See (1) for an example of such a failure.
3477 * If you wish to retry individual MPP parts and learn when a payment has failed, you must
3478 * call [`ChannelManager::abandon_payment`] and wait for a [`Event::PaymentFailed`] event.
3480 * (1) <https://github.com/lightningdevkit/rust-lightning/issues/1164>
3482 * [`ChannelManager::abandon_payment`]: crate::ln::channelmanager::ChannelManager::abandon_payment
3484 bool all_paths_failed;
3486 * The payment path that failed.
3488 struct LDKCVec_RouteHopZ path;
3490 * The channel responsible for the failed payment path.
3492 * Note that for route hints or for the first hop in a path this may be an SCID alias and
3493 * may not refer to a channel in the public network graph. These aliases may also collide
3494 * with channels in the public network graph.
3496 * If this is `Some`, then the corresponding channel should be avoided when the payment is
3497 * retried. May be `None` for older [`Event`] serializations.
3499 struct LDKCOption_u64Z short_channel_id;
3501 * Parameters needed to compute a new [`Route`] when retrying the failed payment path.
3503 * See [`find_route`] for details.
3505 * [`Route`]: crate::routing::router::Route
3506 * [`find_route`]: crate::routing::router::find_route
3508 * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
3510 struct LDKRouteParameters retry;
3511 } LDKEvent_LDKPaymentPathFailed_Body;
3513 typedef struct LDKEvent_LDKProbeSuccessful_Body {
3515 * The id returned by [`ChannelManager::send_probe`].
3517 * [`ChannelManager::send_probe`]: crate::ln::channelmanager::ChannelManager::send_probe
3519 struct LDKThirtyTwoBytes payment_id;
3521 * The hash generated by [`ChannelManager::send_probe`].
3523 * [`ChannelManager::send_probe`]: crate::ln::channelmanager::ChannelManager::send_probe
3525 struct LDKThirtyTwoBytes payment_hash;
3527 * The payment path that was successful.
3529 struct LDKCVec_RouteHopZ path;
3530 } LDKEvent_LDKProbeSuccessful_Body;
3532 typedef struct LDKEvent_LDKProbeFailed_Body {
3534 * The id returned by [`ChannelManager::send_probe`].
3536 * [`ChannelManager::send_probe`]: crate::ln::channelmanager::ChannelManager::send_probe
3538 struct LDKThirtyTwoBytes payment_id;
3540 * The hash generated by [`ChannelManager::send_probe`].
3542 * [`ChannelManager::send_probe`]: crate::ln::channelmanager::ChannelManager::send_probe
3544 struct LDKThirtyTwoBytes payment_hash;
3546 * The payment path that failed.
3548 struct LDKCVec_RouteHopZ path;
3550 * The channel responsible for the failed probe.
3552 * Note that for route hints or for the first hop in a path this may be an SCID alias and
3553 * may not refer to a channel in the public network graph. These aliases may also collide
3554 * with channels in the public network graph.
3556 struct LDKCOption_u64Z short_channel_id;
3557 } LDKEvent_LDKProbeFailed_Body;
3559 typedef struct LDKEvent_LDKPendingHTLCsForwardable_Body {
3561 * The minimum amount of time that should be waited prior to calling
3562 * process_pending_htlc_forwards. To increase the effort required to correlate payments,
3563 * you should wait a random amount of time in roughly the range (now + time_forwardable,
3564 * now + 5*time_forwardable).
3566 uint64_t time_forwardable;
3567 } LDKEvent_LDKPendingHTLCsForwardable_Body;
3569 typedef struct LDKEvent_LDKSpendableOutputs_Body {
3571 * The outputs which you should store as spendable by you.
3573 struct LDKCVec_SpendableOutputDescriptorZ outputs;
3574 } LDKEvent_LDKSpendableOutputs_Body;
3576 typedef struct LDKEvent_LDKPaymentForwarded_Body {
3578 * The incoming channel between the previous node and us. This is only `None` for events
3579 * generated or serialized by versions prior to 0.0.107.
3581 * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
3583 struct LDKThirtyTwoBytes prev_channel_id;
3585 * The outgoing channel between the next node and us. This is only `None` for events
3586 * generated or serialized by versions prior to 0.0.107.
3588 * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
3590 struct LDKThirtyTwoBytes next_channel_id;
3592 * The fee, in milli-satoshis, which was earned as a result of the payment.
3594 * Note that if we force-closed the channel over which we forwarded an HTLC while the HTLC
3595 * was pending, the amount the next hop claimed will have been rounded down to the nearest
3596 * whole satoshi. Thus, the fee calculated here may be higher than expected as we still
3597 * claimed the full value in millisatoshis from the source. In this case,
3598 * `claim_from_onchain_tx` will be set.
3600 * If the channel which sent us the payment has been force-closed, we will claim the funds
3601 * via an on-chain transaction. In that case we do not yet know the on-chain transaction
3602 * fees which we will spend and will instead set this to `None`. It is possible duplicate
3603 * `PaymentForwarded` events are generated for the same payment iff `fee_earned_msat` is
3606 struct LDKCOption_u64Z fee_earned_msat;
3608 * If this is `true`, the forwarded HTLC was claimed by our counterparty via an on-chain
3611 bool claim_from_onchain_tx;
3612 } LDKEvent_LDKPaymentForwarded_Body;
3614 typedef struct LDKEvent_LDKChannelClosed_Body {
3616 * The channel_id of the channel which has been closed. Note that on-chain transactions
3617 * resolving the channel are likely still awaiting confirmation.
3619 struct LDKThirtyTwoBytes channel_id;
3621 * The `user_channel_id` value passed in to [`ChannelManager::create_channel`] for outbound
3622 * channels, or to [`ChannelManager::accept_inbound_channel`] for inbound channels if
3623 * [`UserConfig::manually_accept_inbound_channels`] config flag is set to true. Otherwise
3624 * `user_channel_id` will be 0 for an inbound channel.
3625 * This will always be zero for objects serialized with LDK versions prior to 0.0.102.
3627 * [`ChannelManager::create_channel`]: crate::ln::channelmanager::ChannelManager::create_channel
3628 * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
3629 * [`UserConfig::manually_accept_inbound_channels`]: crate::util::config::UserConfig::manually_accept_inbound_channels
3631 uint64_t user_channel_id;
3633 * The reason the channel was closed.
3635 struct LDKClosureReason reason;
3636 } LDKEvent_LDKChannelClosed_Body;
3638 typedef struct LDKEvent_LDKDiscardFunding_Body {
3640 * The channel_id of the channel which has been closed.
3642 struct LDKThirtyTwoBytes channel_id;
3644 * The full transaction received from the user
3646 struct LDKTransaction transaction;
3647 } LDKEvent_LDKDiscardFunding_Body;
3649 typedef struct LDKEvent_LDKOpenChannelRequest_Body {
3651 * The temporary channel ID of the channel requested to be opened.
3653 * When responding to the request, the `temporary_channel_id` should be passed
3654 * back to the ChannelManager through [`ChannelManager::accept_inbound_channel`] to accept,
3655 * or through [`ChannelManager::force_close_without_broadcasting_txn`] to reject.
3657 * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
3658 * [`ChannelManager::force_close_without_broadcasting_txn`]: crate::ln::channelmanager::ChannelManager::force_close_without_broadcasting_txn
3660 struct LDKThirtyTwoBytes temporary_channel_id;
3662 * The node_id of the counterparty requesting to open the channel.
3664 * When responding to the request, the `counterparty_node_id` should be passed
3665 * back to the `ChannelManager` through [`ChannelManager::accept_inbound_channel`] to
3666 * accept the request, or through [`ChannelManager::force_close_without_broadcasting_txn`] to reject the
3669 * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
3670 * [`ChannelManager::force_close_without_broadcasting_txn`]: crate::ln::channelmanager::ChannelManager::force_close_without_broadcasting_txn
3672 struct LDKPublicKey counterparty_node_id;
3674 * The channel value of the requested channel.
3676 uint64_t funding_satoshis;
3678 * Our starting balance in the channel if the request is accepted, in milli-satoshi.
3682 * The features that this channel will operate with. If you reject the channel, a
3683 * well-behaved counterparty may automatically re-attempt the channel with a new set of
3686 * Note that if [`ChannelTypeFeatures::supports_scid_privacy`] returns true on this type,
3687 * the resulting [`ChannelManager`] will not be readable by versions of LDK prior to
3690 * Furthermore, note that if [`ChannelTypeFeatures::supports_zero_conf`] returns true on this type,
3691 * the resulting [`ChannelManager`] will not be readable by versions of LDK prior to
3692 * 0.0.107. Channels setting this type also need to get manually accepted via
3693 * [`crate::ln::channelmanager::ChannelManager::accept_inbound_channel_from_trusted_peer_0conf`],
3694 * or will be rejected otherwise.
3696 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
3698 struct LDKChannelTypeFeatures channel_type;
3699 } LDKEvent_LDKOpenChannelRequest_Body;
3701 typedef struct LDKEvent_LDKHTLCHandlingFailed_Body {
3703 * The channel over which the HTLC was received.
3705 struct LDKThirtyTwoBytes prev_channel_id;
3707 * Destination of the HTLC that failed to be processed.
3709 struct LDKHTLCDestination failed_next_destination;
3710 } LDKEvent_LDKHTLCHandlingFailed_Body;
3712 typedef struct MUST_USE_STRUCT LDKEvent {
3715 LDKEvent_LDKFundingGenerationReady_Body funding_generation_ready;
3716 LDKEvent_LDKPaymentReceived_Body payment_received;
3717 LDKEvent_LDKPaymentClaimed_Body payment_claimed;
3718 LDKEvent_LDKPaymentSent_Body payment_sent;
3719 LDKEvent_LDKPaymentFailed_Body payment_failed;
3720 LDKEvent_LDKPaymentPathSuccessful_Body payment_path_successful;
3721 LDKEvent_LDKPaymentPathFailed_Body payment_path_failed;
3722 LDKEvent_LDKProbeSuccessful_Body probe_successful;
3723 LDKEvent_LDKProbeFailed_Body probe_failed;
3724 LDKEvent_LDKPendingHTLCsForwardable_Body pending_htl_cs_forwardable;
3725 LDKEvent_LDKSpendableOutputs_Body spendable_outputs;
3726 LDKEvent_LDKPaymentForwarded_Body payment_forwarded;
3727 LDKEvent_LDKChannelClosed_Body channel_closed;
3728 LDKEvent_LDKDiscardFunding_Body discard_funding;
3729 LDKEvent_LDKOpenChannelRequest_Body open_channel_request;
3730 LDKEvent_LDKHTLCHandlingFailed_Body htlc_handling_failed;
3735 * An enum which can either contain a crate::lightning::util::events::Event or not
3737 typedef enum LDKCOption_EventZ_Tag {
3739 * When we're in this state, this COption_EventZ contains a crate::lightning::util::events::Event
3741 LDKCOption_EventZ_Some,
3743 * When we're in this state, this COption_EventZ contains nothing
3745 LDKCOption_EventZ_None,
3747 * Must be last for serialization purposes
3749 LDKCOption_EventZ_Sentinel,
3750 } LDKCOption_EventZ_Tag;
3752 typedef struct LDKCOption_EventZ {
3753 LDKCOption_EventZ_Tag tag;
3756 struct LDKEvent some;
3759 } LDKCOption_EventZ;
3762 * The contents of CResult_COption_EventZDecodeErrorZ
3764 typedef union LDKCResult_COption_EventZDecodeErrorZPtr {
3766 * A pointer to the contents in the success state.
3767 * Reading from this pointer when `result_ok` is not set is undefined.
3769 struct LDKCOption_EventZ *result;
3771 * A pointer to the contents in the error state.
3772 * Reading from this pointer when `result_ok` is set is undefined.
3774 struct LDKDecodeError *err;
3775 } LDKCResult_COption_EventZDecodeErrorZPtr;
3778 * A CResult_COption_EventZDecodeErrorZ represents the result of a fallible operation,
3779 * containing a crate::c_types::derived::COption_EventZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
3780 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
3782 typedef struct LDKCResult_COption_EventZDecodeErrorZ {
3784 * The contents of this CResult_COption_EventZDecodeErrorZ, accessible via either
3785 * `err` or `result` depending on the state of `result_ok`.
3787 union LDKCResult_COption_EventZDecodeErrorZPtr contents;
3789 * Whether this CResult_COption_EventZDecodeErrorZ represents a success state.
3792 } LDKCResult_COption_EventZDecodeErrorZ;
3797 * An accept_channel message to be sent or received from a peer
3799 typedef struct MUST_USE_STRUCT LDKAcceptChannel {
3801 * A pointer to the opaque Rust object.
3802 * Nearly everywhere, inner must be non-null, however in places where
3803 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3805 LDKnativeAcceptChannel *inner;
3807 * Indicates that this is the only struct which contains the same pointer.
3808 * Rust functions which take ownership of an object provided via an argument require
3809 * this to be true and invalidate the object pointed to by inner.
3817 * An open_channel message to be sent or received from a peer
3819 typedef struct MUST_USE_STRUCT LDKOpenChannel {
3821 * A pointer to the opaque Rust object.
3822 * Nearly everywhere, inner must be non-null, however in places where
3823 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3825 LDKnativeOpenChannel *inner;
3827 * Indicates that this is the only struct which contains the same pointer.
3828 * Rust functions which take ownership of an object provided via an argument require
3829 * this to be true and invalidate the object pointed to by inner.
3837 * A funding_created message to be sent or received from a peer
3839 typedef struct MUST_USE_STRUCT LDKFundingCreated {
3841 * A pointer to the opaque Rust object.
3842 * Nearly everywhere, inner must be non-null, however in places where
3843 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3845 LDKnativeFundingCreated *inner;
3847 * Indicates that this is the only struct which contains the same pointer.
3848 * Rust functions which take ownership of an object provided via an argument require
3849 * this to be true and invalidate the object pointed to by inner.
3852 } LDKFundingCreated;
3857 * A funding_signed message to be sent or received from a peer
3859 typedef struct MUST_USE_STRUCT LDKFundingSigned {
3861 * A pointer to the opaque Rust object.
3862 * Nearly everywhere, inner must be non-null, however in places where
3863 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3865 LDKnativeFundingSigned *inner;
3867 * Indicates that this is the only struct which contains the same pointer.
3868 * Rust functions which take ownership of an object provided via an argument require
3869 * this to be true and invalidate the object pointed to by inner.
3877 * A channel_ready message to be sent or received from a peer
3879 typedef struct MUST_USE_STRUCT LDKChannelReady {
3881 * A pointer to the opaque Rust object.
3882 * Nearly everywhere, inner must be non-null, however in places where
3883 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3885 LDKnativeChannelReady *inner;
3887 * Indicates that this is the only struct which contains the same pointer.
3888 * Rust functions which take ownership of an object provided via an argument require
3889 * this to be true and invalidate the object pointed to by inner.
3897 * An announcement_signatures message to be sent or received from a peer
3899 typedef struct MUST_USE_STRUCT LDKAnnouncementSignatures {
3901 * A pointer to the opaque Rust object.
3902 * Nearly everywhere, inner must be non-null, however in places where
3903 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3905 LDKnativeAnnouncementSignatures *inner;
3907 * Indicates that this is the only struct which contains the same pointer.
3908 * Rust functions which take ownership of an object provided via an argument require
3909 * this to be true and invalidate the object pointed to by inner.
3912 } LDKAnnouncementSignatures;
3917 * Struct used to return values from revoke_and_ack messages, containing a bunch of commitment
3918 * transaction updates if they were pending.
3920 typedef struct MUST_USE_STRUCT LDKCommitmentUpdate {
3922 * A pointer to the opaque Rust object.
3923 * Nearly everywhere, inner must be non-null, however in places where
3924 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3926 LDKnativeCommitmentUpdate *inner;
3928 * Indicates that this is the only struct which contains the same pointer.
3929 * Rust functions which take ownership of an object provided via an argument require
3930 * this to be true and invalidate the object pointed to by inner.
3933 } LDKCommitmentUpdate;
3938 * A revoke_and_ack message to be sent or received from a peer
3940 typedef struct MUST_USE_STRUCT LDKRevokeAndACK {
3942 * A pointer to the opaque Rust object.
3943 * Nearly everywhere, inner must be non-null, however in places where
3944 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3946 LDKnativeRevokeAndACK *inner;
3948 * Indicates that this is the only struct which contains the same pointer.
3949 * Rust functions which take ownership of an object provided via an argument require
3950 * this to be true and invalidate the object pointed to by inner.
3958 * A closing_signed message to be sent or received from a peer
3960 typedef struct MUST_USE_STRUCT LDKClosingSigned {
3962 * A pointer to the opaque Rust object.
3963 * Nearly everywhere, inner must be non-null, however in places where
3964 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3966 LDKnativeClosingSigned *inner;
3968 * Indicates that this is the only struct which contains the same pointer.
3969 * Rust functions which take ownership of an object provided via an argument require
3970 * this to be true and invalidate the object pointed to by inner.
3978 * A shutdown message to be sent or received from a peer
3980 typedef struct MUST_USE_STRUCT LDKShutdown {
3982 * A pointer to the opaque Rust object.
3983 * Nearly everywhere, inner must be non-null, however in places where
3984 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3986 LDKnativeShutdown *inner;
3988 * Indicates that this is the only struct which contains the same pointer.
3989 * Rust functions which take ownership of an object provided via an argument require
3990 * this to be true and invalidate the object pointed to by inner.
3998 * A channel_reestablish message to be sent or received from a peer
4000 typedef struct MUST_USE_STRUCT LDKChannelReestablish {
4002 * A pointer to the opaque Rust object.
4003 * Nearly everywhere, inner must be non-null, however in places where
4004 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4006 LDKnativeChannelReestablish *inner;
4008 * Indicates that this is the only struct which contains the same pointer.
4009 * Rust functions which take ownership of an object provided via an argument require
4010 * this to be true and invalidate the object pointed to by inner.
4013 } LDKChannelReestablish;
4018 * A channel_announcement message to be sent or received from a peer
4020 typedef struct MUST_USE_STRUCT LDKChannelAnnouncement {
4022 * A pointer to the opaque Rust object.
4023 * Nearly everywhere, inner must be non-null, however in places where
4024 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4026 LDKnativeChannelAnnouncement *inner;
4028 * Indicates that this is the only struct which contains the same pointer.
4029 * Rust functions which take ownership of an object provided via an argument require
4030 * this to be true and invalidate the object pointed to by inner.
4033 } LDKChannelAnnouncement;
4038 * An error message to be sent or received from a peer
4040 typedef struct MUST_USE_STRUCT LDKErrorMessage {
4042 * A pointer to the opaque Rust object.
4043 * Nearly everywhere, inner must be non-null, however in places where
4044 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4046 LDKnativeErrorMessage *inner;
4048 * Indicates that this is the only struct which contains the same pointer.
4049 * Rust functions which take ownership of an object provided via an argument require
4050 * this to be true and invalidate the object pointed to by inner.
4058 * A warning message to be sent or received from a peer
4060 typedef struct MUST_USE_STRUCT LDKWarningMessage {
4062 * A pointer to the opaque Rust object.
4063 * Nearly everywhere, inner must be non-null, however in places where
4064 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4066 LDKnativeWarningMessage *inner;
4068 * Indicates that this is the only struct which contains the same pointer.
4069 * Rust functions which take ownership of an object provided via an argument require
4070 * this to be true and invalidate the object pointed to by inner.
4073 } LDKWarningMessage;
4076 * Used to put an error message in a LightningError
4078 typedef enum LDKErrorAction_Tag {
4080 * The peer took some action which made us think they were useless. Disconnect them.
4082 LDKErrorAction_DisconnectPeer,
4084 * The peer did something harmless that we weren't able to process, just log and ignore
4086 LDKErrorAction_IgnoreError,
4088 * The peer did something harmless that we weren't able to meaningfully process.
4089 * If the error is logged, log it at the given level.
4091 LDKErrorAction_IgnoreAndLog,
4093 * The peer provided us with a gossip message which we'd already seen. In most cases this
4094 * should be ignored, but it may result in the message being forwarded if it is a duplicate of
4095 * our own channel announcements.
4097 LDKErrorAction_IgnoreDuplicateGossip,
4099 * The peer did something incorrect. Tell them.
4101 LDKErrorAction_SendErrorMessage,
4103 * The peer did something incorrect. Tell them without closing any channels.
4105 LDKErrorAction_SendWarningMessage,
4107 * Must be last for serialization purposes
4109 LDKErrorAction_Sentinel,
4110 } LDKErrorAction_Tag;
4112 typedef struct LDKErrorAction_LDKDisconnectPeer_Body {
4114 * An error message which we should make an effort to send before we disconnect.
4116 * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
4118 struct LDKErrorMessage msg;
4119 } LDKErrorAction_LDKDisconnectPeer_Body;
4121 typedef struct LDKErrorAction_LDKSendErrorMessage_Body {
4123 * The message to send.
4125 struct LDKErrorMessage msg;
4126 } LDKErrorAction_LDKSendErrorMessage_Body;
4128 typedef struct LDKErrorAction_LDKSendWarningMessage_Body {
4130 * The message to send.
4132 struct LDKWarningMessage msg;
4134 * The peer may have done something harmless that we weren't able to meaningfully process,
4135 * though we should still tell them about it.
4136 * If this event is logged, log it at the given level.
4138 enum LDKLevel log_level;
4139 } LDKErrorAction_LDKSendWarningMessage_Body;
4141 typedef struct MUST_USE_STRUCT LDKErrorAction {
4142 LDKErrorAction_Tag tag;
4144 LDKErrorAction_LDKDisconnectPeer_Body disconnect_peer;
4146 enum LDKLevel ignore_and_log;
4148 LDKErrorAction_LDKSendErrorMessage_Body send_error_message;
4149 LDKErrorAction_LDKSendWarningMessage_Body send_warning_message;
4156 * A query_channel_range message is used to query a peer for channel
4157 * UTXOs in a range of blocks. The recipient of a query makes a best
4158 * effort to reply to the query using one or more reply_channel_range
4161 typedef struct MUST_USE_STRUCT LDKQueryChannelRange {
4163 * A pointer to the opaque Rust object.
4164 * Nearly everywhere, inner must be non-null, however in places where
4165 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4167 LDKnativeQueryChannelRange *inner;
4169 * Indicates that this is the only struct which contains the same pointer.
4170 * Rust functions which take ownership of an object provided via an argument require
4171 * this to be true and invalidate the object pointed to by inner.
4174 } LDKQueryChannelRange;
4179 * A query_short_channel_ids message is used to query a peer for
4180 * routing gossip messages related to one or more short_channel_ids.
4181 * The query recipient will reply with the latest, if available,
4182 * channel_announcement, channel_update and node_announcement messages
4183 * it maintains for the requested short_channel_ids followed by a
4184 * reply_short_channel_ids_end message. The short_channel_ids sent in
4185 * this query are encoded. We only support encoding_type=0 uncompressed
4186 * serialization and do not support encoding_type=1 zlib serialization.
4188 typedef struct MUST_USE_STRUCT LDKQueryShortChannelIds {
4190 * A pointer to the opaque Rust object.
4191 * Nearly everywhere, inner must be non-null, however in places where
4192 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4194 LDKnativeQueryShortChannelIds *inner;
4196 * Indicates that this is the only struct which contains the same pointer.
4197 * Rust functions which take ownership of an object provided via an argument require
4198 * this to be true and invalidate the object pointed to by inner.
4201 } LDKQueryShortChannelIds;
4206 * A reply_channel_range message is a reply to a query_channel_range
4207 * message. Multiple reply_channel_range messages can be sent in reply
4208 * to a single query_channel_range message. The query recipient makes a
4209 * best effort to respond based on their local network view which may
4210 * not be a perfect view of the network. The short_channel_ids in the
4211 * reply are encoded. We only support encoding_type=0 uncompressed
4212 * serialization and do not support encoding_type=1 zlib serialization.
4214 typedef struct MUST_USE_STRUCT LDKReplyChannelRange {
4216 * A pointer to the opaque Rust object.
4217 * Nearly everywhere, inner must be non-null, however in places where
4218 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4220 LDKnativeReplyChannelRange *inner;
4222 * Indicates that this is the only struct which contains the same pointer.
4223 * Rust functions which take ownership of an object provided via an argument require
4224 * this to be true and invalidate the object pointed to by inner.
4227 } LDKReplyChannelRange;
4232 * A gossip_timestamp_filter message is used by a node to request
4233 * gossip relay for messages in the requested time range when the
4234 * gossip_queries feature has been negotiated.
4236 typedef struct MUST_USE_STRUCT LDKGossipTimestampFilter {
4238 * A pointer to the opaque Rust object.
4239 * Nearly everywhere, inner must be non-null, however in places where
4240 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4242 LDKnativeGossipTimestampFilter *inner;
4244 * Indicates that this is the only struct which contains the same pointer.
4245 * Rust functions which take ownership of an object provided via an argument require
4246 * this to be true and invalidate the object pointed to by inner.
4249 } LDKGossipTimestampFilter;
4252 * An event generated by ChannelManager which indicates a message should be sent to a peer (or
4253 * broadcast to most peers).
4254 * These events are handled by PeerManager::process_events if you are using a PeerManager.
4256 typedef enum LDKMessageSendEvent_Tag {
4258 * Used to indicate that we've accepted a channel open and should send the accept_channel
4259 * message provided to the given peer.
4261 LDKMessageSendEvent_SendAcceptChannel,
4263 * Used to indicate that we've initiated a channel open and should send the open_channel
4264 * message provided to the given peer.
4266 LDKMessageSendEvent_SendOpenChannel,
4268 * Used to indicate that a funding_created message should be sent to the peer with the given node_id.
4270 LDKMessageSendEvent_SendFundingCreated,
4272 * Used to indicate that a funding_signed message should be sent to the peer with the given node_id.
4274 LDKMessageSendEvent_SendFundingSigned,
4276 * Used to indicate that a channel_ready message should be sent to the peer with the given node_id.
4278 LDKMessageSendEvent_SendChannelReady,
4280 * Used to indicate that an announcement_signatures message should be sent to the peer with the given node_id.
4282 LDKMessageSendEvent_SendAnnouncementSignatures,
4284 * Used to indicate that a series of HTLC update messages, as well as a commitment_signed
4285 * message should be sent to the peer with the given node_id.
4287 LDKMessageSendEvent_UpdateHTLCs,
4289 * Used to indicate that a revoke_and_ack message should be sent to the peer with the given node_id.
4291 LDKMessageSendEvent_SendRevokeAndACK,
4293 * Used to indicate that a closing_signed message should be sent to the peer with the given node_id.
4295 LDKMessageSendEvent_SendClosingSigned,
4297 * Used to indicate that a shutdown message should be sent to the peer with the given node_id.
4299 LDKMessageSendEvent_SendShutdown,
4301 * Used to indicate that a channel_reestablish message should be sent to the peer with the given node_id.
4303 LDKMessageSendEvent_SendChannelReestablish,
4305 * Used to send a channel_announcement and channel_update to a specific peer, likely on
4306 * initial connection to ensure our peers know about our channels.
4308 LDKMessageSendEvent_SendChannelAnnouncement,
4310 * Used to indicate that a channel_announcement and channel_update should be broadcast to all
4311 * peers (except the peer with node_id either msg.contents.node_id_1 or msg.contents.node_id_2).
4313 * Note that after doing so, you very likely (unless you did so very recently) want to
4314 * broadcast a node_announcement (e.g. via [`PeerManager::broadcast_node_announcement`]). This
4315 * ensures that any nodes which see our channel_announcement also have a relevant
4316 * node_announcement, including relevant feature flags which may be important for routing
4319 * [`PeerManager::broadcast_node_announcement`]: crate::ln::peer_handler::PeerManager::broadcast_node_announcement
4321 LDKMessageSendEvent_BroadcastChannelAnnouncement,
4323 * Used to indicate that a channel_update should be broadcast to all peers.
4325 LDKMessageSendEvent_BroadcastChannelUpdate,
4327 * Used to indicate that a channel_update should be sent to a single peer.
4328 * In contrast to [`Self::BroadcastChannelUpdate`], this is used when the channel is a
4329 * private channel and we shouldn't be informing all of our peers of channel parameters.
4331 LDKMessageSendEvent_SendChannelUpdate,
4333 * Broadcast an error downstream to be handled
4335 LDKMessageSendEvent_HandleError,
4337 * Query a peer for channels with funding transaction UTXOs in a block range.
4339 LDKMessageSendEvent_SendChannelRangeQuery,
4341 * Request routing gossip messages from a peer for a list of channels identified by
4342 * their short_channel_ids.
4344 LDKMessageSendEvent_SendShortIdsQuery,
4346 * Sends a reply to a channel range query. This may be one of several SendReplyChannelRange events
4347 * emitted during processing of the query.
4349 LDKMessageSendEvent_SendReplyChannelRange,
4351 * Sends a timestamp filter for inbound gossip. This should be sent on each new connection to
4352 * enable receiving gossip messages from the peer.
4354 LDKMessageSendEvent_SendGossipTimestampFilter,
4356 * Must be last for serialization purposes
4358 LDKMessageSendEvent_Sentinel,
4359 } LDKMessageSendEvent_Tag;
4361 typedef struct LDKMessageSendEvent_LDKSendAcceptChannel_Body {
4363 * The node_id of the node which should receive this message
4365 struct LDKPublicKey node_id;
4367 * The message which should be sent.
4369 struct LDKAcceptChannel msg;
4370 } LDKMessageSendEvent_LDKSendAcceptChannel_Body;
4372 typedef struct LDKMessageSendEvent_LDKSendOpenChannel_Body {
4374 * The node_id of the node which should receive this message
4376 struct LDKPublicKey node_id;
4378 * The message which should be sent.
4380 struct LDKOpenChannel msg;
4381 } LDKMessageSendEvent_LDKSendOpenChannel_Body;
4383 typedef struct LDKMessageSendEvent_LDKSendFundingCreated_Body {
4385 * The node_id of the node which should receive this message
4387 struct LDKPublicKey node_id;
4389 * The message which should be sent.
4391 struct LDKFundingCreated msg;
4392 } LDKMessageSendEvent_LDKSendFundingCreated_Body;
4394 typedef struct LDKMessageSendEvent_LDKSendFundingSigned_Body {
4396 * The node_id of the node which should receive this message
4398 struct LDKPublicKey node_id;
4400 * The message which should be sent.
4402 struct LDKFundingSigned msg;
4403 } LDKMessageSendEvent_LDKSendFundingSigned_Body;
4405 typedef struct LDKMessageSendEvent_LDKSendChannelReady_Body {
4407 * The node_id of the node which should receive these message(s)
4409 struct LDKPublicKey node_id;
4411 * The channel_ready message which should be sent.
4413 struct LDKChannelReady msg;
4414 } LDKMessageSendEvent_LDKSendChannelReady_Body;
4416 typedef struct LDKMessageSendEvent_LDKSendAnnouncementSignatures_Body {
4418 * The node_id of the node which should receive these message(s)
4420 struct LDKPublicKey node_id;
4422 * The announcement_signatures message which should be sent.
4424 struct LDKAnnouncementSignatures msg;
4425 } LDKMessageSendEvent_LDKSendAnnouncementSignatures_Body;
4427 typedef struct LDKMessageSendEvent_LDKUpdateHTLCs_Body {
4429 * The node_id of the node which should receive these message(s)
4431 struct LDKPublicKey node_id;
4433 * The update messages which should be sent. ALL messages in the struct should be sent!
4435 struct LDKCommitmentUpdate updates;
4436 } LDKMessageSendEvent_LDKUpdateHTLCs_Body;
4438 typedef struct LDKMessageSendEvent_LDKSendRevokeAndACK_Body {
4440 * The node_id of the node which should receive this message
4442 struct LDKPublicKey node_id;
4444 * The message which should be sent.
4446 struct LDKRevokeAndACK msg;
4447 } LDKMessageSendEvent_LDKSendRevokeAndACK_Body;
4449 typedef struct LDKMessageSendEvent_LDKSendClosingSigned_Body {
4451 * The node_id of the node which should receive this message
4453 struct LDKPublicKey node_id;
4455 * The message which should be sent.
4457 struct LDKClosingSigned msg;
4458 } LDKMessageSendEvent_LDKSendClosingSigned_Body;
4460 typedef struct LDKMessageSendEvent_LDKSendShutdown_Body {
4462 * The node_id of the node which should receive this message
4464 struct LDKPublicKey node_id;
4466 * The message which should be sent.
4468 struct LDKShutdown msg;
4469 } LDKMessageSendEvent_LDKSendShutdown_Body;
4471 typedef struct LDKMessageSendEvent_LDKSendChannelReestablish_Body {
4473 * The node_id of the node which should receive this message
4475 struct LDKPublicKey node_id;
4477 * The message which should be sent.
4479 struct LDKChannelReestablish msg;
4480 } LDKMessageSendEvent_LDKSendChannelReestablish_Body;
4482 typedef struct LDKMessageSendEvent_LDKSendChannelAnnouncement_Body {
4484 * The node_id of the node which should receive this message
4486 struct LDKPublicKey node_id;
4488 * The channel_announcement which should be sent.
4490 struct LDKChannelAnnouncement msg;
4492 * The followup channel_update which should be sent.
4494 struct LDKChannelUpdate update_msg;
4495 } LDKMessageSendEvent_LDKSendChannelAnnouncement_Body;
4497 typedef struct LDKMessageSendEvent_LDKBroadcastChannelAnnouncement_Body {
4499 * The channel_announcement which should be sent.
4501 struct LDKChannelAnnouncement msg;
4503 * The followup channel_update which should be sent.
4505 struct LDKChannelUpdate update_msg;
4506 } LDKMessageSendEvent_LDKBroadcastChannelAnnouncement_Body;
4508 typedef struct LDKMessageSendEvent_LDKBroadcastChannelUpdate_Body {
4510 * The channel_update which should be sent.
4512 struct LDKChannelUpdate msg;
4513 } LDKMessageSendEvent_LDKBroadcastChannelUpdate_Body;
4515 typedef struct LDKMessageSendEvent_LDKSendChannelUpdate_Body {
4517 * The node_id of the node which should receive this message
4519 struct LDKPublicKey node_id;
4521 * The channel_update which should be sent.
4523 struct LDKChannelUpdate msg;
4524 } LDKMessageSendEvent_LDKSendChannelUpdate_Body;
4526 typedef struct LDKMessageSendEvent_LDKHandleError_Body {
4528 * The node_id of the node which should receive this message
4530 struct LDKPublicKey node_id;
4532 * The action which should be taken.
4534 struct LDKErrorAction action;
4535 } LDKMessageSendEvent_LDKHandleError_Body;
4537 typedef struct LDKMessageSendEvent_LDKSendChannelRangeQuery_Body {
4539 * The node_id of this message recipient
4541 struct LDKPublicKey node_id;
4543 * The query_channel_range which should be sent.
4545 struct LDKQueryChannelRange msg;
4546 } LDKMessageSendEvent_LDKSendChannelRangeQuery_Body;
4548 typedef struct LDKMessageSendEvent_LDKSendShortIdsQuery_Body {
4550 * The node_id of this message recipient
4552 struct LDKPublicKey node_id;
4554 * The query_short_channel_ids which should be sent.
4556 struct LDKQueryShortChannelIds msg;
4557 } LDKMessageSendEvent_LDKSendShortIdsQuery_Body;
4559 typedef struct LDKMessageSendEvent_LDKSendReplyChannelRange_Body {
4561 * The node_id of this message recipient
4563 struct LDKPublicKey node_id;
4565 * The reply_channel_range which should be sent.
4567 struct LDKReplyChannelRange msg;
4568 } LDKMessageSendEvent_LDKSendReplyChannelRange_Body;
4570 typedef struct LDKMessageSendEvent_LDKSendGossipTimestampFilter_Body {
4572 * The node_id of this message recipient
4574 struct LDKPublicKey node_id;
4576 * The gossip_timestamp_filter which should be sent.
4578 struct LDKGossipTimestampFilter msg;
4579 } LDKMessageSendEvent_LDKSendGossipTimestampFilter_Body;
4581 typedef struct MUST_USE_STRUCT LDKMessageSendEvent {
4582 LDKMessageSendEvent_Tag tag;
4584 LDKMessageSendEvent_LDKSendAcceptChannel_Body send_accept_channel;
4585 LDKMessageSendEvent_LDKSendOpenChannel_Body send_open_channel;
4586 LDKMessageSendEvent_LDKSendFundingCreated_Body send_funding_created;
4587 LDKMessageSendEvent_LDKSendFundingSigned_Body send_funding_signed;
4588 LDKMessageSendEvent_LDKSendChannelReady_Body send_channel_ready;
4589 LDKMessageSendEvent_LDKSendAnnouncementSignatures_Body send_announcement_signatures;
4590 LDKMessageSendEvent_LDKUpdateHTLCs_Body update_htl_cs;
4591 LDKMessageSendEvent_LDKSendRevokeAndACK_Body send_revoke_and_ack;
4592 LDKMessageSendEvent_LDKSendClosingSigned_Body send_closing_signed;
4593 LDKMessageSendEvent_LDKSendShutdown_Body send_shutdown;
4594 LDKMessageSendEvent_LDKSendChannelReestablish_Body send_channel_reestablish;
4595 LDKMessageSendEvent_LDKSendChannelAnnouncement_Body send_channel_announcement;
4596 LDKMessageSendEvent_LDKBroadcastChannelAnnouncement_Body broadcast_channel_announcement;
4597 LDKMessageSendEvent_LDKBroadcastChannelUpdate_Body broadcast_channel_update;
4598 LDKMessageSendEvent_LDKSendChannelUpdate_Body send_channel_update;
4599 LDKMessageSendEvent_LDKHandleError_Body handle_error;
4600 LDKMessageSendEvent_LDKSendChannelRangeQuery_Body send_channel_range_query;
4601 LDKMessageSendEvent_LDKSendShortIdsQuery_Body send_short_ids_query;
4602 LDKMessageSendEvent_LDKSendReplyChannelRange_Body send_reply_channel_range;
4603 LDKMessageSendEvent_LDKSendGossipTimestampFilter_Body send_gossip_timestamp_filter;
4605 } LDKMessageSendEvent;
4608 * A dynamically-allocated array of crate::lightning::util::events::MessageSendEvents of arbitrary size.
4609 * This corresponds to std::vector in C++
4611 typedef struct LDKCVec_MessageSendEventZ {
4613 * The elements in the array.
4614 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
4616 struct LDKMessageSendEvent *data;
4618 * The number of elements pointed to by `data`.
4621 } LDKCVec_MessageSendEventZ;
4624 * The contents of CResult_TxOutAccessErrorZ
4626 typedef union LDKCResult_TxOutAccessErrorZPtr {
4628 * A pointer to the contents in the success state.
4629 * Reading from this pointer when `result_ok` is not set is undefined.
4631 struct LDKTxOut *result;
4633 * A pointer to the contents in the error state.
4634 * Reading from this pointer when `result_ok` is set is undefined.
4636 enum LDKAccessError *err;
4637 } LDKCResult_TxOutAccessErrorZPtr;
4640 * A CResult_TxOutAccessErrorZ represents the result of a fallible operation,
4641 * containing a crate::c_types::TxOut on success and a crate::lightning::chain::AccessError on failure.
4642 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4644 typedef struct LDKCResult_TxOutAccessErrorZ {
4646 * The contents of this CResult_TxOutAccessErrorZ, accessible via either
4647 * `err` or `result` depending on the state of `result_ok`.
4649 union LDKCResult_TxOutAccessErrorZPtr contents;
4651 * Whether this CResult_TxOutAccessErrorZ represents a success state.
4654 } LDKCResult_TxOutAccessErrorZ;
4657 * A tuple of 2 elements. See the individual fields for the types contained.
4659 typedef struct LDKC2Tuple_usizeTransactionZ {
4661 * The element at position 0
4665 * The element at position 1
4667 struct LDKTransaction b;
4668 } LDKC2Tuple_usizeTransactionZ;
4671 * A dynamically-allocated array of crate::c_types::derived::C2Tuple_usizeTransactionZs of arbitrary size.
4672 * This corresponds to std::vector in C++
4674 typedef struct LDKCVec_C2Tuple_usizeTransactionZZ {
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 LDKC2Tuple_usizeTransactionZ *data;
4681 * The number of elements pointed to by `data`.
4684 } LDKCVec_C2Tuple_usizeTransactionZZ;
4687 * A dynamically-allocated array of crate::c_types::ThirtyTwoBytess of arbitrary size.
4688 * This corresponds to std::vector in C++
4690 typedef struct LDKCVec_TxidZ {
4692 * The elements in the array.
4693 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
4695 struct LDKThirtyTwoBytes *data;
4697 * The number of elements pointed to by `data`.
4703 * The contents of CResult_NoneChannelMonitorUpdateErrZ
4705 typedef union LDKCResult_NoneChannelMonitorUpdateErrZPtr {
4707 * Note that this value is always NULL, as there are no contents in the OK variant
4711 * A pointer to the contents in the error state.
4712 * Reading from this pointer when `result_ok` is set is undefined.
4714 enum LDKChannelMonitorUpdateErr *err;
4715 } LDKCResult_NoneChannelMonitorUpdateErrZPtr;
4718 * A CResult_NoneChannelMonitorUpdateErrZ represents the result of a fallible operation,
4719 * containing a () on success and a crate::lightning::chain::ChannelMonitorUpdateErr on failure.
4720 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4722 typedef struct LDKCResult_NoneChannelMonitorUpdateErrZ {
4724 * The contents of this CResult_NoneChannelMonitorUpdateErrZ, accessible via either
4725 * `err` or `result` depending on the state of `result_ok`.
4727 union LDKCResult_NoneChannelMonitorUpdateErrZPtr contents;
4729 * Whether this CResult_NoneChannelMonitorUpdateErrZ represents a success state.
4732 } LDKCResult_NoneChannelMonitorUpdateErrZ;
4737 * Simple structure sent back by `chain::Watch` when an HTLC from a forward channel is detected on
4738 * chain. Used to update the corresponding HTLC in the backward channel. Failing to pass the
4739 * preimage claim backward will lead to loss of funds.
4741 typedef struct MUST_USE_STRUCT LDKHTLCUpdate {
4743 * A pointer to the opaque Rust object.
4744 * Nearly everywhere, inner must be non-null, however in places where
4745 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4747 LDKnativeHTLCUpdate *inner;
4749 * Indicates that this is the only struct which contains the same pointer.
4750 * Rust functions which take ownership of an object provided via an argument require
4751 * this to be true and invalidate the object pointed to by inner.
4757 * An event to be processed by the ChannelManager.
4759 typedef enum LDKMonitorEvent_Tag {
4761 * A monitor event containing an HTLCUpdate.
4763 LDKMonitorEvent_HTLCEvent,
4765 * A monitor event that the Channel's commitment transaction was confirmed.
4767 LDKMonitorEvent_CommitmentTxConfirmed,
4769 * Indicates a [`ChannelMonitor`] update has completed. See
4770 * [`ChannelMonitorUpdateErr::TemporaryFailure`] for more information on how this is used.
4772 * [`ChannelMonitorUpdateErr::TemporaryFailure`]: super::ChannelMonitorUpdateErr::TemporaryFailure
4774 LDKMonitorEvent_UpdateCompleted,
4776 * Indicates a [`ChannelMonitor`] update has failed. See
4777 * [`ChannelMonitorUpdateErr::PermanentFailure`] for more information on how this is used.
4779 * [`ChannelMonitorUpdateErr::PermanentFailure`]: super::ChannelMonitorUpdateErr::PermanentFailure
4781 LDKMonitorEvent_UpdateFailed,
4783 * Must be last for serialization purposes
4785 LDKMonitorEvent_Sentinel,
4786 } LDKMonitorEvent_Tag;
4788 typedef struct LDKMonitorEvent_LDKUpdateCompleted_Body {
4790 * The funding outpoint of the [`ChannelMonitor`] that was updated
4792 struct LDKOutPoint funding_txo;
4794 * The Update ID from [`ChannelMonitorUpdate::update_id`] which was applied or
4795 * [`ChannelMonitor::get_latest_update_id`].
4797 * Note that this should only be set to a given update's ID if all previous updates for the
4798 * same [`ChannelMonitor`] have been applied and persisted.
4800 uint64_t monitor_update_id;
4801 } LDKMonitorEvent_LDKUpdateCompleted_Body;
4803 typedef struct MUST_USE_STRUCT LDKMonitorEvent {
4804 LDKMonitorEvent_Tag tag;
4807 struct LDKHTLCUpdate htlc_event;
4810 struct LDKOutPoint commitment_tx_confirmed;
4812 LDKMonitorEvent_LDKUpdateCompleted_Body update_completed;
4814 struct LDKOutPoint update_failed;
4820 * A dynamically-allocated array of crate::lightning::chain::channelmonitor::MonitorEvents of arbitrary size.
4821 * This corresponds to std::vector in C++
4823 typedef struct LDKCVec_MonitorEventZ {
4825 * The elements in the array.
4826 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
4828 struct LDKMonitorEvent *data;
4830 * The number of elements pointed to by `data`.
4833 } LDKCVec_MonitorEventZ;
4836 * A tuple of 3 elements. See the individual fields for the types contained.
4838 typedef struct LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ {
4840 * The element at position 0
4842 struct LDKOutPoint a;
4844 * The element at position 1
4846 struct LDKCVec_MonitorEventZ b;
4848 * The element at position 2
4850 struct LDKPublicKey c;
4851 } LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ;
4854 * A dynamically-allocated array of crate::c_types::derived::C3Tuple_OutPointCVec_MonitorEventZPublicKeyZs of arbitrary size.
4855 * This corresponds to std::vector in C++
4857 typedef struct LDKCVec_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZZ {
4859 * The elements in the array.
4860 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
4862 struct LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ *data;
4864 * The number of elements pointed to by `data`.
4867 } LDKCVec_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZZ;
4872 * [`Score`] implementation that uses a fixed penalty.
4874 typedef struct MUST_USE_STRUCT LDKFixedPenaltyScorer {
4876 * A pointer to the opaque Rust object.
4877 * Nearly everywhere, inner must be non-null, however in places where
4878 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4880 LDKnativeFixedPenaltyScorer *inner;
4882 * Indicates that this is the only struct which contains the same pointer.
4883 * Rust functions which take ownership of an object provided via an argument require
4884 * this to be true and invalidate the object pointed to by inner.
4887 } LDKFixedPenaltyScorer;
4890 * The contents of CResult_FixedPenaltyScorerDecodeErrorZ
4892 typedef union LDKCResult_FixedPenaltyScorerDecodeErrorZPtr {
4894 * A pointer to the contents in the success state.
4895 * Reading from this pointer when `result_ok` is not set is undefined.
4897 struct LDKFixedPenaltyScorer *result;
4899 * A pointer to the contents in the error state.
4900 * Reading from this pointer when `result_ok` is set is undefined.
4902 struct LDKDecodeError *err;
4903 } LDKCResult_FixedPenaltyScorerDecodeErrorZPtr;
4906 * A CResult_FixedPenaltyScorerDecodeErrorZ represents the result of a fallible operation,
4907 * containing a crate::lightning::routing::scoring::FixedPenaltyScorer on success and a crate::lightning::ln::msgs::DecodeError on failure.
4908 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4910 typedef struct LDKCResult_FixedPenaltyScorerDecodeErrorZ {
4912 * The contents of this CResult_FixedPenaltyScorerDecodeErrorZ, accessible via either
4913 * `err` or `result` depending on the state of `result_ok`.
4915 union LDKCResult_FixedPenaltyScorerDecodeErrorZPtr contents;
4917 * Whether this CResult_FixedPenaltyScorerDecodeErrorZ represents a success state.
4920 } LDKCResult_FixedPenaltyScorerDecodeErrorZ;
4923 * A tuple of 2 elements. See the individual fields for the types contained.
4925 typedef struct LDKC2Tuple_u64u64Z {
4927 * The element at position 0
4931 * The element at position 1
4934 } LDKC2Tuple_u64u64Z;
4937 * An enum which can either contain a crate::c_types::derived::C2Tuple_u64u64Z or not
4939 typedef enum LDKCOption_C2Tuple_u64u64ZZ_Tag {
4941 * When we're in this state, this COption_C2Tuple_u64u64ZZ contains a crate::c_types::derived::C2Tuple_u64u64Z
4943 LDKCOption_C2Tuple_u64u64ZZ_Some,
4945 * When we're in this state, this COption_C2Tuple_u64u64ZZ contains nothing
4947 LDKCOption_C2Tuple_u64u64ZZ_None,
4949 * Must be last for serialization purposes
4951 LDKCOption_C2Tuple_u64u64ZZ_Sentinel,
4952 } LDKCOption_C2Tuple_u64u64ZZ_Tag;
4954 typedef struct LDKCOption_C2Tuple_u64u64ZZ {
4955 LDKCOption_C2Tuple_u64u64ZZ_Tag tag;
4958 struct LDKC2Tuple_u64u64Z some;
4961 } LDKCOption_C2Tuple_u64u64ZZ;
4964 * A dynamically-allocated array of crate::lightning::routing::gossip::NodeIds of arbitrary size.
4965 * This corresponds to std::vector in C++
4967 typedef struct LDKCVec_NodeIdZ {
4969 * The elements in the array.
4970 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
4972 struct LDKNodeId *data;
4974 * The number of elements pointed to by `data`.
4982 * A Record, unit of logging output with Metadata to enable filtering
4983 * Module_path, file, line to inform on log's source
4985 typedef struct MUST_USE_STRUCT LDKRecord {
4987 * A pointer to the opaque Rust object.
4988 * Nearly everywhere, inner must be non-null, however in places where
4989 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4991 LDKnativeRecord *inner;
4993 * Indicates that this is the only struct which contains the same pointer.
4994 * Rust functions which take ownership of an object provided via an argument require
4995 * this to be true and invalidate the object pointed to by inner.
5001 * A trait encapsulating the operations required of a logger
5003 typedef struct LDKLogger {
5005 * An opaque pointer which is passed to your function implementations as an argument.
5006 * This has no meaning in the LDK, and can be NULL or any other value.
5012 void (*log)(const void *this_arg, const struct LDKRecord *NONNULL_PTR record);
5014 * Frees any resources associated with this object given its this_arg pointer.
5015 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
5017 void (*free)(void *this_arg);
5023 * Represents the network as nodes and channels between them
5025 typedef struct MUST_USE_STRUCT LDKNetworkGraph {
5027 * A pointer to the opaque Rust object.
5028 * Nearly everywhere, inner must be non-null, however in places where
5029 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5031 LDKnativeNetworkGraph *inner;
5033 * Indicates that this is the only struct which contains the same pointer.
5034 * Rust functions which take ownership of an object provided via an argument require
5035 * this to be true and invalidate the object pointed to by inner.
5043 * [`Score`] implementation using channel success probability distributions.
5045 * Based on *Optimally Reliable & Cheap Payment Flows on the Lightning Network* by Rene Pickhardt
5046 * and Stefan Richter [[1]]. Given the uncertainty of channel liquidity balances, probability
5047 * distributions are defined based on knowledge learned from successful and unsuccessful attempts.
5048 * Then the negative `log10` of the success probability is used to determine the cost of routing a
5049 * specific HTLC amount through a channel.
5051 * Knowledge about channel liquidity balances takes the form of upper and lower bounds on the
5052 * possible liquidity. Certainty of the bounds is decreased over time using a decay function. See
5053 * [`ProbabilisticScoringParameters`] for details.
5055 * Since the scorer aims to learn the current channel liquidity balances, it works best for nodes
5056 * with high payment volume or that actively probe the [`NetworkGraph`]. Nodes with low payment
5057 * volume are more likely to experience failed payment paths, which would need to be retried.
5061 * Mixing the `no-std` feature between serialization and deserialization results in undefined
5064 * [1]: https://arxiv.org/abs/2107.05322
5066 typedef struct MUST_USE_STRUCT LDKProbabilisticScorer {
5068 * A pointer to the opaque Rust object.
5069 * Nearly everywhere, inner must be non-null, however in places where
5070 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5072 LDKnativeProbabilisticScorer *inner;
5074 * Indicates that this is the only struct which contains the same pointer.
5075 * Rust functions which take ownership of an object provided via an argument require
5076 * this to be true and invalidate the object pointed to by inner.
5079 } LDKProbabilisticScorer;
5082 * The contents of CResult_ProbabilisticScorerDecodeErrorZ
5084 typedef union LDKCResult_ProbabilisticScorerDecodeErrorZPtr {
5086 * A pointer to the contents in the success state.
5087 * Reading from this pointer when `result_ok` is not set is undefined.
5089 struct LDKProbabilisticScorer *result;
5091 * A pointer to the contents in the error state.
5092 * Reading from this pointer when `result_ok` is set is undefined.
5094 struct LDKDecodeError *err;
5095 } LDKCResult_ProbabilisticScorerDecodeErrorZPtr;
5098 * A CResult_ProbabilisticScorerDecodeErrorZ represents the result of a fallible operation,
5099 * containing a crate::lightning::routing::scoring::ProbabilisticScorer on success and a crate::lightning::ln::msgs::DecodeError on failure.
5100 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5102 typedef struct LDKCResult_ProbabilisticScorerDecodeErrorZ {
5104 * The contents of this CResult_ProbabilisticScorerDecodeErrorZ, accessible via either
5105 * `err` or `result` depending on the state of `result_ok`.
5107 union LDKCResult_ProbabilisticScorerDecodeErrorZPtr contents;
5109 * Whether this CResult_ProbabilisticScorerDecodeErrorZ represents a success state.
5112 } LDKCResult_ProbabilisticScorerDecodeErrorZ;
5117 * Features used within an `init` message.
5119 typedef struct MUST_USE_STRUCT LDKInitFeatures {
5121 * A pointer to the opaque Rust object.
5122 * Nearly everywhere, inner must be non-null, however in places where
5123 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5125 LDKnativeInitFeatures *inner;
5127 * Indicates that this is the only struct which contains the same pointer.
5128 * Rust functions which take ownership of an object provided via an argument require
5129 * this to be true and invalidate the object pointed to by inner.
5135 * The contents of CResult_InitFeaturesDecodeErrorZ
5137 typedef union LDKCResult_InitFeaturesDecodeErrorZPtr {
5139 * A pointer to the contents in the success state.
5140 * Reading from this pointer when `result_ok` is not set is undefined.
5142 struct LDKInitFeatures *result;
5144 * A pointer to the contents in the error state.
5145 * Reading from this pointer when `result_ok` is set is undefined.
5147 struct LDKDecodeError *err;
5148 } LDKCResult_InitFeaturesDecodeErrorZPtr;
5151 * A CResult_InitFeaturesDecodeErrorZ represents the result of a fallible operation,
5152 * containing a crate::lightning::ln::features::InitFeatures on success and a crate::lightning::ln::msgs::DecodeError on failure.
5153 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5155 typedef struct LDKCResult_InitFeaturesDecodeErrorZ {
5157 * The contents of this CResult_InitFeaturesDecodeErrorZ, accessible via either
5158 * `err` or `result` depending on the state of `result_ok`.
5160 union LDKCResult_InitFeaturesDecodeErrorZPtr contents;
5162 * Whether this CResult_InitFeaturesDecodeErrorZ represents a success state.
5165 } LDKCResult_InitFeaturesDecodeErrorZ;
5170 * Features used within a `channel_announcement` message.
5172 typedef struct MUST_USE_STRUCT LDKChannelFeatures {
5174 * A pointer to the opaque Rust object.
5175 * Nearly everywhere, inner must be non-null, however in places where
5176 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5178 LDKnativeChannelFeatures *inner;
5180 * Indicates that this is the only struct which contains the same pointer.
5181 * Rust functions which take ownership of an object provided via an argument require
5182 * this to be true and invalidate the object pointed to by inner.
5185 } LDKChannelFeatures;
5188 * The contents of CResult_ChannelFeaturesDecodeErrorZ
5190 typedef union LDKCResult_ChannelFeaturesDecodeErrorZPtr {
5192 * A pointer to the contents in the success state.
5193 * Reading from this pointer when `result_ok` is not set is undefined.
5195 struct LDKChannelFeatures *result;
5197 * A pointer to the contents in the error state.
5198 * Reading from this pointer when `result_ok` is set is undefined.
5200 struct LDKDecodeError *err;
5201 } LDKCResult_ChannelFeaturesDecodeErrorZPtr;
5204 * A CResult_ChannelFeaturesDecodeErrorZ represents the result of a fallible operation,
5205 * containing a crate::lightning::ln::features::ChannelFeatures on success and a crate::lightning::ln::msgs::DecodeError on failure.
5206 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5208 typedef struct LDKCResult_ChannelFeaturesDecodeErrorZ {
5210 * The contents of this CResult_ChannelFeaturesDecodeErrorZ, accessible via either
5211 * `err` or `result` depending on the state of `result_ok`.
5213 union LDKCResult_ChannelFeaturesDecodeErrorZPtr contents;
5215 * Whether this CResult_ChannelFeaturesDecodeErrorZ represents a success state.
5218 } LDKCResult_ChannelFeaturesDecodeErrorZ;
5223 * Features used within a `node_announcement` message.
5225 typedef struct MUST_USE_STRUCT LDKNodeFeatures {
5227 * A pointer to the opaque Rust object.
5228 * Nearly everywhere, inner must be non-null, however in places where
5229 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5231 LDKnativeNodeFeatures *inner;
5233 * Indicates that this is the only struct which contains the same pointer.
5234 * Rust functions which take ownership of an object provided via an argument require
5235 * this to be true and invalidate the object pointed to by inner.
5241 * The contents of CResult_NodeFeaturesDecodeErrorZ
5243 typedef union LDKCResult_NodeFeaturesDecodeErrorZPtr {
5245 * A pointer to the contents in the success state.
5246 * Reading from this pointer when `result_ok` is not set is undefined.
5248 struct LDKNodeFeatures *result;
5250 * A pointer to the contents in the error state.
5251 * Reading from this pointer when `result_ok` is set is undefined.
5253 struct LDKDecodeError *err;
5254 } LDKCResult_NodeFeaturesDecodeErrorZPtr;
5257 * A CResult_NodeFeaturesDecodeErrorZ represents the result of a fallible operation,
5258 * containing a crate::lightning::ln::features::NodeFeatures on success and a crate::lightning::ln::msgs::DecodeError on failure.
5259 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5261 typedef struct LDKCResult_NodeFeaturesDecodeErrorZ {
5263 * The contents of this CResult_NodeFeaturesDecodeErrorZ, accessible via either
5264 * `err` or `result` depending on the state of `result_ok`.
5266 union LDKCResult_NodeFeaturesDecodeErrorZPtr contents;
5268 * Whether this CResult_NodeFeaturesDecodeErrorZ represents a success state.
5271 } LDKCResult_NodeFeaturesDecodeErrorZ;
5276 * Features used within an invoice.
5278 typedef struct MUST_USE_STRUCT LDKInvoiceFeatures {
5280 * A pointer to the opaque Rust object.
5281 * Nearly everywhere, inner must be non-null, however in places where
5282 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5284 LDKnativeInvoiceFeatures *inner;
5286 * Indicates that this is the only struct which contains the same pointer.
5287 * Rust functions which take ownership of an object provided via an argument require
5288 * this to be true and invalidate the object pointed to by inner.
5291 } LDKInvoiceFeatures;
5294 * The contents of CResult_InvoiceFeaturesDecodeErrorZ
5296 typedef union LDKCResult_InvoiceFeaturesDecodeErrorZPtr {
5298 * A pointer to the contents in the success state.
5299 * Reading from this pointer when `result_ok` is not set is undefined.
5301 struct LDKInvoiceFeatures *result;
5303 * A pointer to the contents in the error state.
5304 * Reading from this pointer when `result_ok` is set is undefined.
5306 struct LDKDecodeError *err;
5307 } LDKCResult_InvoiceFeaturesDecodeErrorZPtr;
5310 * A CResult_InvoiceFeaturesDecodeErrorZ represents the result of a fallible operation,
5311 * containing a crate::lightning::ln::features::InvoiceFeatures on success and a crate::lightning::ln::msgs::DecodeError on failure.
5312 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5314 typedef struct LDKCResult_InvoiceFeaturesDecodeErrorZ {
5316 * The contents of this CResult_InvoiceFeaturesDecodeErrorZ, accessible via either
5317 * `err` or `result` depending on the state of `result_ok`.
5319 union LDKCResult_InvoiceFeaturesDecodeErrorZPtr contents;
5321 * Whether this CResult_InvoiceFeaturesDecodeErrorZ represents a success state.
5324 } LDKCResult_InvoiceFeaturesDecodeErrorZ;
5327 * The contents of CResult_ChannelTypeFeaturesDecodeErrorZ
5329 typedef union LDKCResult_ChannelTypeFeaturesDecodeErrorZPtr {
5331 * A pointer to the contents in the success state.
5332 * Reading from this pointer when `result_ok` is not set is undefined.
5334 struct LDKChannelTypeFeatures *result;
5336 * A pointer to the contents in the error state.
5337 * Reading from this pointer when `result_ok` is set is undefined.
5339 struct LDKDecodeError *err;
5340 } LDKCResult_ChannelTypeFeaturesDecodeErrorZPtr;
5343 * A CResult_ChannelTypeFeaturesDecodeErrorZ represents the result of a fallible operation,
5344 * containing a crate::lightning::ln::features::ChannelTypeFeatures on success and a crate::lightning::ln::msgs::DecodeError on failure.
5345 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5347 typedef struct LDKCResult_ChannelTypeFeaturesDecodeErrorZ {
5349 * The contents of this CResult_ChannelTypeFeaturesDecodeErrorZ, accessible via either
5350 * `err` or `result` depending on the state of `result_ok`.
5352 union LDKCResult_ChannelTypeFeaturesDecodeErrorZPtr contents;
5354 * Whether this CResult_ChannelTypeFeaturesDecodeErrorZ represents a success state.
5357 } LDKCResult_ChannelTypeFeaturesDecodeErrorZ;
5360 * The contents of CResult_NodeIdDecodeErrorZ
5362 typedef union LDKCResult_NodeIdDecodeErrorZPtr {
5364 * A pointer to the contents in the success state.
5365 * Reading from this pointer when `result_ok` is not set is undefined.
5367 struct LDKNodeId *result;
5369 * A pointer to the contents in the error state.
5370 * Reading from this pointer when `result_ok` is set is undefined.
5372 struct LDKDecodeError *err;
5373 } LDKCResult_NodeIdDecodeErrorZPtr;
5376 * A CResult_NodeIdDecodeErrorZ represents the result of a fallible operation,
5377 * containing a crate::lightning::routing::gossip::NodeId on success and a crate::lightning::ln::msgs::DecodeError on failure.
5378 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5380 typedef struct LDKCResult_NodeIdDecodeErrorZ {
5382 * The contents of this CResult_NodeIdDecodeErrorZ, accessible via either
5383 * `err` or `result` depending on the state of `result_ok`.
5385 union LDKCResult_NodeIdDecodeErrorZPtr contents;
5387 * Whether this CResult_NodeIdDecodeErrorZ represents a success state.
5390 } LDKCResult_NodeIdDecodeErrorZ;
5393 * The contents of CResult_COption_NetworkUpdateZDecodeErrorZ
5395 typedef union LDKCResult_COption_NetworkUpdateZDecodeErrorZPtr {
5397 * A pointer to the contents in the success state.
5398 * Reading from this pointer when `result_ok` is not set is undefined.
5400 struct LDKCOption_NetworkUpdateZ *result;
5402 * A pointer to the contents in the error state.
5403 * Reading from this pointer when `result_ok` is set is undefined.
5405 struct LDKDecodeError *err;
5406 } LDKCResult_COption_NetworkUpdateZDecodeErrorZPtr;
5409 * A CResult_COption_NetworkUpdateZDecodeErrorZ represents the result of a fallible operation,
5410 * containing a crate::c_types::derived::COption_NetworkUpdateZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
5411 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5413 typedef struct LDKCResult_COption_NetworkUpdateZDecodeErrorZ {
5415 * The contents of this CResult_COption_NetworkUpdateZDecodeErrorZ, accessible via either
5416 * `err` or `result` depending on the state of `result_ok`.
5418 union LDKCResult_COption_NetworkUpdateZDecodeErrorZPtr contents;
5420 * Whether this CResult_COption_NetworkUpdateZDecodeErrorZ represents a success state.
5423 } LDKCResult_COption_NetworkUpdateZDecodeErrorZ;
5426 * The `Access` trait defines behavior for accessing chain data and state, such as blocks and
5429 typedef struct LDKAccess {
5431 * An opaque pointer which is passed to your function implementations as an argument.
5432 * This has no meaning in the LDK, and can be NULL or any other value.
5436 * Returns the transaction output of a funding transaction encoded by [`short_channel_id`].
5437 * Returns an error if `genesis_hash` is for a different chain or if such a transaction output
5440 * [`short_channel_id`]: https://github.com/lightning/bolts/blob/master/07-routing-gossip.md#definition-of-short_channel_id
5442 struct LDKCResult_TxOutAccessErrorZ (*get_utxo)(const void *this_arg, const uint8_t (*genesis_hash)[32], uint64_t short_channel_id);
5444 * Frees any resources associated with this object given its this_arg pointer.
5445 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
5447 void (*free)(void *this_arg);
5451 * An enum which can either contain a crate::lightning::chain::Access or not
5453 typedef enum LDKCOption_AccessZ_Tag {
5455 * When we're in this state, this COption_AccessZ contains a crate::lightning::chain::Access
5457 LDKCOption_AccessZ_Some,
5459 * When we're in this state, this COption_AccessZ contains nothing
5461 LDKCOption_AccessZ_None,
5463 * Must be last for serialization purposes
5465 LDKCOption_AccessZ_Sentinel,
5466 } LDKCOption_AccessZ_Tag;
5468 typedef struct LDKCOption_AccessZ {
5469 LDKCOption_AccessZ_Tag tag;
5472 struct LDKAccess some;
5475 } LDKCOption_AccessZ;
5478 * The contents of CResult_boolLightningErrorZ
5480 typedef union LDKCResult_boolLightningErrorZPtr {
5482 * A pointer to the contents in the success state.
5483 * Reading from this pointer when `result_ok` is not set is undefined.
5487 * A pointer to the contents in the error state.
5488 * Reading from this pointer when `result_ok` is set is undefined.
5490 struct LDKLightningError *err;
5491 } LDKCResult_boolLightningErrorZPtr;
5494 * A CResult_boolLightningErrorZ represents the result of a fallible operation,
5495 * containing a bool on success and a crate::lightning::ln::msgs::LightningError on failure.
5496 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5498 typedef struct LDKCResult_boolLightningErrorZ {
5500 * The contents of this CResult_boolLightningErrorZ, accessible via either
5501 * `err` or `result` depending on the state of `result_ok`.
5503 union LDKCResult_boolLightningErrorZPtr contents;
5505 * Whether this CResult_boolLightningErrorZ represents a success state.
5508 } LDKCResult_boolLightningErrorZ;
5511 * A tuple of 3 elements. See the individual fields for the types contained.
5513 typedef struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ {
5515 * The element at position 0
5517 struct LDKChannelAnnouncement a;
5519 * The element at position 1
5521 struct LDKChannelUpdate b;
5523 * The element at position 2
5525 struct LDKChannelUpdate c;
5526 } LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ;
5529 * An enum which can either contain a crate::c_types::derived::C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ or not
5531 typedef enum LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_Tag {
5533 * When we're in this state, this COption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ contains a crate::c_types::derived::C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ
5535 LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_Some,
5537 * When we're in this state, this COption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ contains nothing
5539 LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_None,
5541 * Must be last for serialization purposes
5543 LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_Sentinel,
5544 } LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_Tag;
5546 typedef struct LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ {
5547 LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_Tag tag;
5550 struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ some;
5553 } LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ;
5556 * The contents of CResult_NoneLightningErrorZ
5558 typedef union LDKCResult_NoneLightningErrorZPtr {
5560 * Note that this value is always NULL, as there are no contents in the OK variant
5564 * A pointer to the contents in the error state.
5565 * Reading from this pointer when `result_ok` is set is undefined.
5567 struct LDKLightningError *err;
5568 } LDKCResult_NoneLightningErrorZPtr;
5571 * A CResult_NoneLightningErrorZ represents the result of a fallible operation,
5572 * containing a () on success and a crate::lightning::ln::msgs::LightningError on failure.
5573 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5575 typedef struct LDKCResult_NoneLightningErrorZ {
5577 * The contents of this CResult_NoneLightningErrorZ, accessible via either
5578 * `err` or `result` depending on the state of `result_ok`.
5580 union LDKCResult_NoneLightningErrorZPtr contents;
5582 * Whether this CResult_NoneLightningErrorZ represents a success state.
5585 } LDKCResult_NoneLightningErrorZ;
5590 * Details about one direction of a channel as received within a [`ChannelUpdate`].
5592 typedef struct MUST_USE_STRUCT LDKChannelUpdateInfo {
5594 * A pointer to the opaque Rust object.
5595 * Nearly everywhere, inner must be non-null, however in places where
5596 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5598 LDKnativeChannelUpdateInfo *inner;
5600 * Indicates that this is the only struct which contains the same pointer.
5601 * Rust functions which take ownership of an object provided via an argument require
5602 * this to be true and invalidate the object pointed to by inner.
5605 } LDKChannelUpdateInfo;
5608 * The contents of CResult_ChannelUpdateInfoDecodeErrorZ
5610 typedef union LDKCResult_ChannelUpdateInfoDecodeErrorZPtr {
5612 * A pointer to the contents in the success state.
5613 * Reading from this pointer when `result_ok` is not set is undefined.
5615 struct LDKChannelUpdateInfo *result;
5617 * A pointer to the contents in the error state.
5618 * Reading from this pointer when `result_ok` is set is undefined.
5620 struct LDKDecodeError *err;
5621 } LDKCResult_ChannelUpdateInfoDecodeErrorZPtr;
5624 * A CResult_ChannelUpdateInfoDecodeErrorZ represents the result of a fallible operation,
5625 * containing a crate::lightning::routing::gossip::ChannelUpdateInfo on success and a crate::lightning::ln::msgs::DecodeError on failure.
5626 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5628 typedef struct LDKCResult_ChannelUpdateInfoDecodeErrorZ {
5630 * The contents of this CResult_ChannelUpdateInfoDecodeErrorZ, accessible via either
5631 * `err` or `result` depending on the state of `result_ok`.
5633 union LDKCResult_ChannelUpdateInfoDecodeErrorZPtr contents;
5635 * Whether this CResult_ChannelUpdateInfoDecodeErrorZ represents a success state.
5638 } LDKCResult_ChannelUpdateInfoDecodeErrorZ;
5643 * Details about a channel (both directions).
5644 * Received within a channel announcement.
5646 typedef struct MUST_USE_STRUCT LDKChannelInfo {
5648 * A pointer to the opaque Rust object.
5649 * Nearly everywhere, inner must be non-null, however in places where
5650 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5652 LDKnativeChannelInfo *inner;
5654 * Indicates that this is the only struct which contains the same pointer.
5655 * Rust functions which take ownership of an object provided via an argument require
5656 * this to be true and invalidate the object pointed to by inner.
5662 * The contents of CResult_ChannelInfoDecodeErrorZ
5664 typedef union LDKCResult_ChannelInfoDecodeErrorZPtr {
5666 * A pointer to the contents in the success state.
5667 * Reading from this pointer when `result_ok` is not set is undefined.
5669 struct LDKChannelInfo *result;
5671 * A pointer to the contents in the error state.
5672 * Reading from this pointer when `result_ok` is set is undefined.
5674 struct LDKDecodeError *err;
5675 } LDKCResult_ChannelInfoDecodeErrorZPtr;
5678 * A CResult_ChannelInfoDecodeErrorZ represents the result of a fallible operation,
5679 * containing a crate::lightning::routing::gossip::ChannelInfo on success and a crate::lightning::ln::msgs::DecodeError on failure.
5680 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5682 typedef struct LDKCResult_ChannelInfoDecodeErrorZ {
5684 * The contents of this CResult_ChannelInfoDecodeErrorZ, accessible via either
5685 * `err` or `result` depending on the state of `result_ok`.
5687 union LDKCResult_ChannelInfoDecodeErrorZPtr contents;
5689 * Whether this CResult_ChannelInfoDecodeErrorZ represents a success state.
5692 } LDKCResult_ChannelInfoDecodeErrorZ;
5697 * Fees for routing via a given channel or a node
5699 typedef struct MUST_USE_STRUCT LDKRoutingFees {
5701 * A pointer to the opaque Rust object.
5702 * Nearly everywhere, inner must be non-null, however in places where
5703 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5705 LDKnativeRoutingFees *inner;
5707 * Indicates that this is the only struct which contains the same pointer.
5708 * Rust functions which take ownership of an object provided via an argument require
5709 * this to be true and invalidate the object pointed to by inner.
5715 * The contents of CResult_RoutingFeesDecodeErrorZ
5717 typedef union LDKCResult_RoutingFeesDecodeErrorZPtr {
5719 * A pointer to the contents in the success state.
5720 * Reading from this pointer when `result_ok` is not set is undefined.
5722 struct LDKRoutingFees *result;
5724 * A pointer to the contents in the error state.
5725 * Reading from this pointer when `result_ok` is set is undefined.
5727 struct LDKDecodeError *err;
5728 } LDKCResult_RoutingFeesDecodeErrorZPtr;
5731 * A CResult_RoutingFeesDecodeErrorZ represents the result of a fallible operation,
5732 * containing a crate::lightning::routing::gossip::RoutingFees on success and a crate::lightning::ln::msgs::DecodeError on failure.
5733 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5735 typedef struct LDKCResult_RoutingFeesDecodeErrorZ {
5737 * The contents of this CResult_RoutingFeesDecodeErrorZ, accessible via either
5738 * `err` or `result` depending on the state of `result_ok`.
5740 union LDKCResult_RoutingFeesDecodeErrorZPtr contents;
5742 * Whether this CResult_RoutingFeesDecodeErrorZ represents a success state.
5745 } LDKCResult_RoutingFeesDecodeErrorZ;
5748 * A 4-byte byte array.
5750 typedef struct LDKFourBytes {
5758 * A 16-byte byte array.
5760 typedef struct LDKSixteenBytes {
5768 * A 12-byte byte array.
5770 typedef struct LDKTwelveBytes {
5780 * Represents a hostname for serialization purposes.
5781 * Only the character set and length will be validated.
5782 * The character set consists of ASCII alphanumeric characters, hyphens, and periods.
5783 * Its length is guaranteed to be representable by a single byte.
5784 * This serialization is used by BOLT 7 hostnames.
5786 typedef struct MUST_USE_STRUCT LDKHostname {
5788 * A pointer to the opaque Rust object.
5789 * Nearly everywhere, inner must be non-null, however in places where
5790 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5792 LDKnativeHostname *inner;
5794 * Indicates that this is the only struct which contains the same pointer.
5795 * Rust functions which take ownership of an object provided via an argument require
5796 * this to be true and invalidate the object pointed to by inner.
5802 * An address which can be used to connect to a remote peer
5804 typedef enum LDKNetAddress_Tag {
5806 * An IPv4 address/port on which the peer is listening.
5810 * An IPv6 address/port on which the peer is listening.
5814 * An old-style Tor onion address/port on which the peer is listening.
5816 * This field is deprecated and the Tor network generally no longer supports V2 Onion
5817 * addresses. Thus, the details are not parsed here.
5819 LDKNetAddress_OnionV2,
5821 * A new-style Tor onion address/port on which the peer is listening.
5822 * To create the human-readable \"hostname\", concatenate ed25519_pubkey, checksum, and version,
5823 * wrap as base32 and append \".onion\".
5825 LDKNetAddress_OnionV3,
5827 * A hostname/port on which the peer is listening.
5829 LDKNetAddress_Hostname,
5831 * Must be last for serialization purposes
5833 LDKNetAddress_Sentinel,
5834 } LDKNetAddress_Tag;
5836 typedef struct LDKNetAddress_LDKIPv4_Body {
5838 * The 4-byte IPv4 address
5840 struct LDKFourBytes addr;
5842 * The port on which the node is listening
5845 } LDKNetAddress_LDKIPv4_Body;
5847 typedef struct LDKNetAddress_LDKIPv6_Body {
5849 * The 16-byte IPv6 address
5851 struct LDKSixteenBytes addr;
5853 * The port on which the node is listening
5856 } LDKNetAddress_LDKIPv6_Body;
5858 typedef struct LDKNetAddress_LDKOnionV3_Body {
5860 * The ed25519 long-term public key of the peer
5862 struct LDKThirtyTwoBytes ed25519_pubkey;
5864 * The checksum of the pubkey and version, as included in the onion address
5868 * The version byte, as defined by the Tor Onion v3 spec.
5872 * The port on which the node is listening
5875 } LDKNetAddress_LDKOnionV3_Body;
5877 typedef struct LDKNetAddress_LDKHostname_Body {
5879 * The hostname on which the node is listening.
5881 struct LDKHostname hostname;
5883 * The port on which the node is listening.
5886 } LDKNetAddress_LDKHostname_Body;
5888 typedef struct MUST_USE_STRUCT LDKNetAddress {
5889 LDKNetAddress_Tag tag;
5891 LDKNetAddress_LDKIPv4_Body i_pv4;
5892 LDKNetAddress_LDKIPv6_Body i_pv6;
5894 struct LDKTwelveBytes onion_v2;
5896 LDKNetAddress_LDKOnionV3_Body onion_v3;
5897 LDKNetAddress_LDKHostname_Body hostname;
5902 * A dynamically-allocated array of crate::lightning::ln::msgs::NetAddresss of arbitrary size.
5903 * This corresponds to std::vector in C++
5905 typedef struct LDKCVec_NetAddressZ {
5907 * The elements in the array.
5908 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
5910 struct LDKNetAddress *data;
5912 * The number of elements pointed to by `data`.
5915 } LDKCVec_NetAddressZ;
5920 * Information received in the latest node_announcement from this node.
5922 typedef struct MUST_USE_STRUCT LDKNodeAnnouncementInfo {
5924 * A pointer to the opaque Rust object.
5925 * Nearly everywhere, inner must be non-null, however in places where
5926 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5928 LDKnativeNodeAnnouncementInfo *inner;
5930 * Indicates that this is the only struct which contains the same pointer.
5931 * Rust functions which take ownership of an object provided via an argument require
5932 * this to be true and invalidate the object pointed to by inner.
5935 } LDKNodeAnnouncementInfo;
5938 * The contents of CResult_NodeAnnouncementInfoDecodeErrorZ
5940 typedef union LDKCResult_NodeAnnouncementInfoDecodeErrorZPtr {
5942 * A pointer to the contents in the success state.
5943 * Reading from this pointer when `result_ok` is not set is undefined.
5945 struct LDKNodeAnnouncementInfo *result;
5947 * A pointer to the contents in the error state.
5948 * Reading from this pointer when `result_ok` is set is undefined.
5950 struct LDKDecodeError *err;
5951 } LDKCResult_NodeAnnouncementInfoDecodeErrorZPtr;
5954 * A CResult_NodeAnnouncementInfoDecodeErrorZ represents the result of a fallible operation,
5955 * containing a crate::lightning::routing::gossip::NodeAnnouncementInfo on success and a crate::lightning::ln::msgs::DecodeError on failure.
5956 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5958 typedef struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ {
5960 * The contents of this CResult_NodeAnnouncementInfoDecodeErrorZ, accessible via either
5961 * `err` or `result` depending on the state of `result_ok`.
5963 union LDKCResult_NodeAnnouncementInfoDecodeErrorZPtr contents;
5965 * Whether this CResult_NodeAnnouncementInfoDecodeErrorZ represents a success state.
5968 } LDKCResult_NodeAnnouncementInfoDecodeErrorZ;
5973 * A user-defined name for a node, which may be used when displaying the node in a graph.
5975 * Since node aliases are provided by third parties, they are a potential avenue for injection
5976 * attacks. Care must be taken when processing.
5978 typedef struct MUST_USE_STRUCT LDKNodeAlias {
5980 * A pointer to the opaque Rust object.
5981 * Nearly everywhere, inner must be non-null, however in places where
5982 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5984 LDKnativeNodeAlias *inner;
5986 * Indicates that this is the only struct which contains the same pointer.
5987 * Rust functions which take ownership of an object provided via an argument require
5988 * this to be true and invalidate the object pointed to by inner.
5994 * The contents of CResult_NodeAliasDecodeErrorZ
5996 typedef union LDKCResult_NodeAliasDecodeErrorZPtr {
5998 * A pointer to the contents in the success state.
5999 * Reading from this pointer when `result_ok` is not set is undefined.
6001 struct LDKNodeAlias *result;
6003 * A pointer to the contents in the error state.
6004 * Reading from this pointer when `result_ok` is set is undefined.
6006 struct LDKDecodeError *err;
6007 } LDKCResult_NodeAliasDecodeErrorZPtr;
6010 * A CResult_NodeAliasDecodeErrorZ represents the result of a fallible operation,
6011 * containing a crate::lightning::routing::gossip::NodeAlias on success and a crate::lightning::ln::msgs::DecodeError on failure.
6012 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6014 typedef struct LDKCResult_NodeAliasDecodeErrorZ {
6016 * The contents of this CResult_NodeAliasDecodeErrorZ, accessible via either
6017 * `err` or `result` depending on the state of `result_ok`.
6019 union LDKCResult_NodeAliasDecodeErrorZPtr contents;
6021 * Whether this CResult_NodeAliasDecodeErrorZ represents a success state.
6024 } LDKCResult_NodeAliasDecodeErrorZ;
6029 * Details about a node in the network, known from the network announcement.
6031 typedef struct MUST_USE_STRUCT LDKNodeInfo {
6033 * A pointer to the opaque Rust object.
6034 * Nearly everywhere, inner must be non-null, however in places where
6035 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6037 LDKnativeNodeInfo *inner;
6039 * Indicates that this is the only struct which contains the same pointer.
6040 * Rust functions which take ownership of an object provided via an argument require
6041 * this to be true and invalidate the object pointed to by inner.
6047 * The contents of CResult_NodeInfoDecodeErrorZ
6049 typedef union LDKCResult_NodeInfoDecodeErrorZPtr {
6051 * A pointer to the contents in the success state.
6052 * Reading from this pointer when `result_ok` is not set is undefined.
6054 struct LDKNodeInfo *result;
6056 * A pointer to the contents in the error state.
6057 * Reading from this pointer when `result_ok` is set is undefined.
6059 struct LDKDecodeError *err;
6060 } LDKCResult_NodeInfoDecodeErrorZPtr;
6063 * A CResult_NodeInfoDecodeErrorZ represents the result of a fallible operation,
6064 * containing a crate::lightning::routing::gossip::NodeInfo on success and a crate::lightning::ln::msgs::DecodeError on failure.
6065 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6067 typedef struct LDKCResult_NodeInfoDecodeErrorZ {
6069 * The contents of this CResult_NodeInfoDecodeErrorZ, accessible via either
6070 * `err` or `result` depending on the state of `result_ok`.
6072 union LDKCResult_NodeInfoDecodeErrorZPtr contents;
6074 * Whether this CResult_NodeInfoDecodeErrorZ represents a success state.
6077 } LDKCResult_NodeInfoDecodeErrorZ;
6080 * The contents of CResult_NetworkGraphDecodeErrorZ
6082 typedef union LDKCResult_NetworkGraphDecodeErrorZPtr {
6084 * A pointer to the contents in the success state.
6085 * Reading from this pointer when `result_ok` is not set is undefined.
6087 struct LDKNetworkGraph *result;
6089 * A pointer to the contents in the error state.
6090 * Reading from this pointer when `result_ok` is set is undefined.
6092 struct LDKDecodeError *err;
6093 } LDKCResult_NetworkGraphDecodeErrorZPtr;
6096 * A CResult_NetworkGraphDecodeErrorZ represents the result of a fallible operation,
6097 * containing a crate::lightning::routing::gossip::NetworkGraph on success and a crate::lightning::ln::msgs::DecodeError on failure.
6098 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6100 typedef struct LDKCResult_NetworkGraphDecodeErrorZ {
6102 * The contents of this CResult_NetworkGraphDecodeErrorZ, accessible via either
6103 * `err` or `result` depending on the state of `result_ok`.
6105 union LDKCResult_NetworkGraphDecodeErrorZPtr contents;
6107 * Whether this CResult_NetworkGraphDecodeErrorZ represents a success state.
6110 } LDKCResult_NetworkGraphDecodeErrorZ;
6113 * An enum which can either contain a crate::c_types::derived::CVec_NetAddressZ or not
6115 typedef enum LDKCOption_CVec_NetAddressZZ_Tag {
6117 * When we're in this state, this COption_CVec_NetAddressZZ contains a crate::c_types::derived::CVec_NetAddressZ
6119 LDKCOption_CVec_NetAddressZZ_Some,
6121 * When we're in this state, this COption_CVec_NetAddressZZ contains nothing
6123 LDKCOption_CVec_NetAddressZZ_None,
6125 * Must be last for serialization purposes
6127 LDKCOption_CVec_NetAddressZZ_Sentinel,
6128 } LDKCOption_CVec_NetAddressZZ_Tag;
6130 typedef struct LDKCOption_CVec_NetAddressZZ {
6131 LDKCOption_CVec_NetAddressZZ_Tag tag;
6134 struct LDKCVec_NetAddressZ some;
6137 } LDKCOption_CVec_NetAddressZZ;
6140 * The contents of CResult_DelayedPaymentOutputDescriptorDecodeErrorZ
6142 typedef union LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZPtr {
6144 * A pointer to the contents in the success state.
6145 * Reading from this pointer when `result_ok` is not set is undefined.
6147 struct LDKDelayedPaymentOutputDescriptor *result;
6149 * A pointer to the contents in the error state.
6150 * Reading from this pointer when `result_ok` is set is undefined.
6152 struct LDKDecodeError *err;
6153 } LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZPtr;
6156 * A CResult_DelayedPaymentOutputDescriptorDecodeErrorZ represents the result of a fallible operation,
6157 * containing a crate::lightning::chain::keysinterface::DelayedPaymentOutputDescriptor on success and a crate::lightning::ln::msgs::DecodeError on failure.
6158 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6160 typedef struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ {
6162 * The contents of this CResult_DelayedPaymentOutputDescriptorDecodeErrorZ, accessible via either
6163 * `err` or `result` depending on the state of `result_ok`.
6165 union LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZPtr contents;
6167 * Whether this CResult_DelayedPaymentOutputDescriptorDecodeErrorZ represents a success state.
6170 } LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ;
6173 * The contents of CResult_StaticPaymentOutputDescriptorDecodeErrorZ
6175 typedef union LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZPtr {
6177 * A pointer to the contents in the success state.
6178 * Reading from this pointer when `result_ok` is not set is undefined.
6180 struct LDKStaticPaymentOutputDescriptor *result;
6182 * A pointer to the contents in the error state.
6183 * Reading from this pointer when `result_ok` is set is undefined.
6185 struct LDKDecodeError *err;
6186 } LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZPtr;
6189 * A CResult_StaticPaymentOutputDescriptorDecodeErrorZ represents the result of a fallible operation,
6190 * containing a crate::lightning::chain::keysinterface::StaticPaymentOutputDescriptor on success and a crate::lightning::ln::msgs::DecodeError on failure.
6191 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6193 typedef struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ {
6195 * The contents of this CResult_StaticPaymentOutputDescriptorDecodeErrorZ, accessible via either
6196 * `err` or `result` depending on the state of `result_ok`.
6198 union LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZPtr contents;
6200 * Whether this CResult_StaticPaymentOutputDescriptorDecodeErrorZ represents a success state.
6203 } LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ;
6206 * The contents of CResult_SpendableOutputDescriptorDecodeErrorZ
6208 typedef union LDKCResult_SpendableOutputDescriptorDecodeErrorZPtr {
6210 * A pointer to the contents in the success state.
6211 * Reading from this pointer when `result_ok` is not set is undefined.
6213 struct LDKSpendableOutputDescriptor *result;
6215 * A pointer to the contents in the error state.
6216 * Reading from this pointer when `result_ok` is set is undefined.
6218 struct LDKDecodeError *err;
6219 } LDKCResult_SpendableOutputDescriptorDecodeErrorZPtr;
6222 * A CResult_SpendableOutputDescriptorDecodeErrorZ represents the result of a fallible operation,
6223 * containing a crate::lightning::chain::keysinterface::SpendableOutputDescriptor on success and a crate::lightning::ln::msgs::DecodeError on failure.
6224 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6226 typedef struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ {
6228 * The contents of this CResult_SpendableOutputDescriptorDecodeErrorZ, accessible via either
6229 * `err` or `result` depending on the state of `result_ok`.
6231 union LDKCResult_SpendableOutputDescriptorDecodeErrorZPtr contents;
6233 * Whether this CResult_SpendableOutputDescriptorDecodeErrorZ represents a success state.
6236 } LDKCResult_SpendableOutputDescriptorDecodeErrorZ;
6239 * A dynamically-allocated array of crate::c_types::ThirtyTwoBytess of arbitrary size.
6240 * This corresponds to std::vector in C++
6242 typedef struct LDKCVec_PaymentPreimageZ {
6244 * The elements in the array.
6245 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
6247 struct LDKThirtyTwoBytes *data;
6249 * The number of elements pointed to by `data`.
6252 } LDKCVec_PaymentPreimageZ;
6255 * A tuple of 2 elements. See the individual fields for the types contained.
6257 typedef struct LDKC2Tuple_SignatureCVec_SignatureZZ {
6259 * The element at position 0
6261 struct LDKSignature a;
6263 * The element at position 1
6265 struct LDKCVec_SignatureZ b;
6266 } LDKC2Tuple_SignatureCVec_SignatureZZ;
6269 * The contents of CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ
6271 typedef union LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZPtr {
6273 * A pointer to the contents in the success state.
6274 * Reading from this pointer when `result_ok` is not set is undefined.
6276 struct LDKC2Tuple_SignatureCVec_SignatureZZ *result;
6278 * Note that this value is always NULL, as there are no contents in the Err variant
6281 } LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZPtr;
6284 * A CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ represents the result of a fallible operation,
6285 * containing a crate::c_types::derived::C2Tuple_SignatureCVec_SignatureZZ on success and a () on failure.
6286 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6288 typedef struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ {
6290 * The contents of this CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ, accessible via either
6291 * `err` or `result` depending on the state of `result_ok`.
6293 union LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZPtr contents;
6295 * Whether this CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ represents a success state.
6298 } LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ;
6301 * The contents of CResult_SignatureNoneZ
6303 typedef union LDKCResult_SignatureNoneZPtr {
6305 * A pointer to the contents in the success state.
6306 * Reading from this pointer when `result_ok` is not set is undefined.
6308 struct LDKSignature *result;
6310 * Note that this value is always NULL, as there are no contents in the Err variant
6313 } LDKCResult_SignatureNoneZPtr;
6316 * A CResult_SignatureNoneZ represents the result of a fallible operation,
6317 * containing a crate::c_types::Signature on success and a () on failure.
6318 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6320 typedef struct LDKCResult_SignatureNoneZ {
6322 * The contents of this CResult_SignatureNoneZ, accessible via either
6323 * `err` or `result` depending on the state of `result_ok`.
6325 union LDKCResult_SignatureNoneZPtr contents;
6327 * Whether this CResult_SignatureNoneZ represents a success state.
6330 } LDKCResult_SignatureNoneZ;
6333 * A tuple of 2 elements. See the individual fields for the types contained.
6335 typedef struct LDKC2Tuple_SignatureSignatureZ {
6337 * The element at position 0
6339 struct LDKSignature a;
6341 * The element at position 1
6343 struct LDKSignature b;
6344 } LDKC2Tuple_SignatureSignatureZ;
6347 * The contents of CResult_C2Tuple_SignatureSignatureZNoneZ
6349 typedef union LDKCResult_C2Tuple_SignatureSignatureZNoneZPtr {
6351 * A pointer to the contents in the success state.
6352 * Reading from this pointer when `result_ok` is not set is undefined.
6354 struct LDKC2Tuple_SignatureSignatureZ *result;
6356 * Note that this value is always NULL, as there are no contents in the Err variant
6359 } LDKCResult_C2Tuple_SignatureSignatureZNoneZPtr;
6362 * A CResult_C2Tuple_SignatureSignatureZNoneZ represents the result of a fallible operation,
6363 * containing a crate::c_types::derived::C2Tuple_SignatureSignatureZ on success and a () on failure.
6364 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6366 typedef struct LDKCResult_C2Tuple_SignatureSignatureZNoneZ {
6368 * The contents of this CResult_C2Tuple_SignatureSignatureZNoneZ, accessible via either
6369 * `err` or `result` depending on the state of `result_ok`.
6371 union LDKCResult_C2Tuple_SignatureSignatureZNoneZPtr contents;
6373 * Whether this CResult_C2Tuple_SignatureSignatureZNoneZ represents a success state.
6376 } LDKCResult_C2Tuple_SignatureSignatureZNoneZ;
6379 * The contents of CResult_SecretKeyNoneZ
6381 typedef union LDKCResult_SecretKeyNoneZPtr {
6383 * A pointer to the contents in the success state.
6384 * Reading from this pointer when `result_ok` is not set is undefined.
6386 struct LDKSecretKey *result;
6388 * Note that this value is always NULL, as there are no contents in the Err variant
6391 } LDKCResult_SecretKeyNoneZPtr;
6394 * A CResult_SecretKeyNoneZ represents the result of a fallible operation,
6395 * containing a crate::c_types::SecretKey on success and a () on failure.
6396 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6398 typedef struct LDKCResult_SecretKeyNoneZ {
6400 * The contents of this CResult_SecretKeyNoneZ, accessible via either
6401 * `err` or `result` depending on the state of `result_ok`.
6403 union LDKCResult_SecretKeyNoneZPtr contents;
6405 * Whether this CResult_SecretKeyNoneZ represents a success state.
6408 } LDKCResult_SecretKeyNoneZ;
6411 * Represents a scalar value between zero and the secp256k1 curve order, in big endian.
6413 typedef struct LDKBigEndianScalar {
6415 * The bytes of the scalar value.
6417 uint8_t big_endian_bytes[32];
6418 } LDKBigEndianScalar;
6421 * An enum which can either contain a crate::c_types::BigEndianScalar or not
6423 typedef enum LDKCOption_ScalarZ_Tag {
6425 * When we're in this state, this COption_ScalarZ contains a crate::c_types::BigEndianScalar
6427 LDKCOption_ScalarZ_Some,
6429 * When we're in this state, this COption_ScalarZ contains nothing
6431 LDKCOption_ScalarZ_None,
6433 * Must be last for serialization purposes
6435 LDKCOption_ScalarZ_Sentinel,
6436 } LDKCOption_ScalarZ_Tag;
6438 typedef struct LDKCOption_ScalarZ {
6439 LDKCOption_ScalarZ_Tag tag;
6442 struct LDKBigEndianScalar some;
6445 } LDKCOption_ScalarZ;
6448 * The contents of CResult_SharedSecretNoneZ
6450 typedef union LDKCResult_SharedSecretNoneZPtr {
6452 * A pointer to the contents in the success state.
6453 * Reading from this pointer when `result_ok` is not set is undefined.
6455 struct LDKThirtyTwoBytes *result;
6457 * Note that this value is always NULL, as there are no contents in the Err variant
6460 } LDKCResult_SharedSecretNoneZPtr;
6463 * A CResult_SharedSecretNoneZ represents the result of a fallible operation,
6464 * containing a crate::c_types::ThirtyTwoBytes on success and a () on failure.
6465 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6467 typedef struct LDKCResult_SharedSecretNoneZ {
6469 * The contents of this CResult_SharedSecretNoneZ, accessible via either
6470 * `err` or `result` depending on the state of `result_ok`.
6472 union LDKCResult_SharedSecretNoneZPtr contents;
6474 * Whether this CResult_SharedSecretNoneZ represents a success state.
6477 } LDKCResult_SharedSecretNoneZ;
6482 * This class tracks the per-transaction information needed to build a closing transaction and will
6483 * actually build it and sign.
6485 * This class can be used inside a signer implementation to generate a signature given the relevant
6488 typedef struct MUST_USE_STRUCT LDKClosingTransaction {
6490 * A pointer to the opaque Rust object.
6491 * Nearly everywhere, inner must be non-null, however in places where
6492 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6494 LDKnativeClosingTransaction *inner;
6496 * Indicates that this is the only struct which contains the same pointer.
6497 * Rust functions which take ownership of an object provided via an argument require
6498 * this to be true and invalidate the object pointed to by inner.
6501 } LDKClosingTransaction;
6506 * The unsigned part of a channel_announcement
6508 typedef struct MUST_USE_STRUCT LDKUnsignedChannelAnnouncement {
6510 * A pointer to the opaque Rust object.
6511 * Nearly everywhere, inner must be non-null, however in places where
6512 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6514 LDKnativeUnsignedChannelAnnouncement *inner;
6516 * Indicates that this is the only struct which contains the same pointer.
6517 * Rust functions which take ownership of an object provided via an argument require
6518 * this to be true and invalidate the object pointed to by inner.
6521 } LDKUnsignedChannelAnnouncement;
6524 * A trait to sign lightning channel transactions as described in BOLT 3.
6526 * Signing services could be implemented on a hardware wallet. In this case,
6527 * the current Sign would be a front-end on top of a communication
6528 * channel connected to your secure device and lightning key material wouldn't
6529 * reside on a hot server. Nevertheless, a this deployment would still need
6530 * to trust the ChannelManager to avoid loss of funds as this latest component
6531 * could ask to sign commitment transaction with HTLCs paying to attacker pubkeys.
6533 * A more secure iteration would be to use hashlock (or payment points) to pair
6534 * invoice/incoming HTLCs with outgoing HTLCs to implement a no-trust-ChannelManager
6535 * at the price of more state and computation on the hardware wallet side. In the future,
6536 * we are looking forward to design such interface.
6538 * In any case, ChannelMonitor or fallback watchtowers are always going to be trusted
6539 * to act, as liveness and breach reply correctness are always going to be hard requirements
6540 * of LN security model, orthogonal of key management issues.
6542 typedef struct LDKBaseSign {
6544 * An opaque pointer which is passed to your function implementations as an argument.
6545 * This has no meaning in the LDK, and can be NULL or any other value.
6549 * Gets the per-commitment point for a specific commitment number
6551 * Note that the commitment number starts at (1 << 48) - 1 and counts backwards.
6553 struct LDKPublicKey (*get_per_commitment_point)(const void *this_arg, uint64_t idx);
6555 * Gets the commitment secret for a specific commitment number as part of the revocation process
6557 * An external signer implementation should error here if the commitment was already signed
6558 * and should refuse to sign it in the future.
6560 * May be called more than once for the same index.
6562 * Note that the commitment number starts at (1 << 48) - 1 and counts backwards.
6564 struct LDKThirtyTwoBytes (*release_commitment_secret)(const void *this_arg, uint64_t idx);
6566 * Validate the counterparty's signatures on the holder commitment transaction and HTLCs.
6568 * This is required in order for the signer to make sure that releasing a commitment
6569 * secret won't leave us without a broadcastable holder transaction.
6570 * Policy checks should be implemented in this function, including checking the amount
6571 * sent to us and checking the HTLCs.
6573 * The preimages of outgoing HTLCs that were fulfilled since the last commitment are provided.
6574 * A validating signer should ensure that an HTLC output is removed only when the matching
6575 * preimage is provided, or when the value to holder is restored.
6577 * NOTE: all the relevant preimages will be provided, but there may also be additional
6578 * irrelevant or duplicate preimages.
6580 struct LDKCResult_NoneNoneZ (*validate_holder_commitment)(const void *this_arg, const struct LDKHolderCommitmentTransaction *NONNULL_PTR holder_tx, struct LDKCVec_PaymentPreimageZ preimages);
6582 * Gets the holder's channel public keys and basepoints
6584 struct LDKChannelPublicKeys pubkeys;
6586 * Fill in the pubkeys field as a reference to it will be given to Rust after this returns
6587 * Note that this takes a pointer to this object, not the this_ptr like other methods do
6588 * This function pointer may be NULL if pubkeys is filled in when this object is created and never needs updating.
6590 void (*set_pubkeys)(const struct LDKBaseSign*NONNULL_PTR );
6592 * Gets an arbitrary identifier describing the set of keys which are provided back to you in
6593 * some SpendableOutputDescriptor types. This should be sufficient to identify this
6594 * Sign object uniquely and lookup or re-derive its keys.
6596 struct LDKThirtyTwoBytes (*channel_keys_id)(const void *this_arg);
6598 * Create a signature for a counterparty's commitment transaction and associated HTLC transactions.
6600 * Note that if signing fails or is rejected, the channel will be force-closed.
6602 * Policy checks should be implemented in this function, including checking the amount
6603 * sent to us and checking the HTLCs.
6605 * The preimages of outgoing HTLCs that were fulfilled since the last commitment are provided.
6606 * A validating signer should ensure that an HTLC output is removed only when the matching
6607 * preimage is provided, or when the value to holder is restored.
6609 * NOTE: all the relevant preimages will be provided, but there may also be additional
6610 * irrelevant or duplicate preimages.
6612 struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ (*sign_counterparty_commitment)(const void *this_arg, const struct LDKCommitmentTransaction *NONNULL_PTR commitment_tx, struct LDKCVec_PaymentPreimageZ preimages);
6614 * Validate the counterparty's revocation.
6616 * This is required in order for the signer to make sure that the state has moved
6617 * forward and it is safe to sign the next counterparty commitment.
6619 struct LDKCResult_NoneNoneZ (*validate_counterparty_revocation)(const void *this_arg, uint64_t idx, const uint8_t (*secret)[32]);
6621 * Create a signatures for a holder's commitment transaction and its claiming HTLC transactions.
6622 * This will only ever be called with a non-revoked commitment_tx. This will be called with the
6623 * latest commitment_tx when we initiate a force-close.
6624 * This will be called with the previous latest, just to get claiming HTLC signatures, if we are
6625 * reacting to a ChannelMonitor replica that decided to broadcast before it had been updated to
6627 * This may be called multiple times for the same transaction.
6629 * An external signer implementation should check that the commitment has not been revoked.
6631 * May return Err if key derivation fails. Callers, such as ChannelMonitor, will panic in such a case.
6633 struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ (*sign_holder_commitment_and_htlcs)(const void *this_arg, const struct LDKHolderCommitmentTransaction *NONNULL_PTR commitment_tx);
6635 * Create a signature for the given input in a transaction spending an HTLC transaction output
6636 * or a commitment transaction `to_local` output when our counterparty broadcasts an old state.
6638 * A justice transaction may claim multiple outputs at the same time if timelocks are
6639 * similar, but only a signature for the input at index `input` should be signed for here.
6640 * It may be called multiple times for same output(s) if a fee-bump is needed with regards
6641 * to an upcoming timelock expiration.
6643 * Amount is value of the output spent by this input, committed to in the BIP 143 signature.
6645 * per_commitment_key is revocation secret which was provided by our counterparty when they
6646 * revoked the state which they eventually broadcast. It's not a _holder_ secret key and does
6647 * not allow the spending of any funds by itself (you need our holder revocation_secret to do
6650 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]);
6652 * Create a signature for the given input in a transaction spending a commitment transaction
6653 * HTLC output when our counterparty broadcasts an old state.
6655 * A justice transaction may claim multiple outputs at the same time if timelocks are
6656 * similar, but only a signature for the input at index `input` should be signed for here.
6657 * It may be called multiple times for same output(s) if a fee-bump is needed with regards
6658 * to an upcoming timelock expiration.
6660 * Amount is value of the output spent by this input, committed to in the BIP 143 signature.
6662 * per_commitment_key is revocation secret which was provided by our counterparty when they
6663 * revoked the state which they eventually broadcast. It's not a _holder_ secret key and does
6664 * not allow the spending of any funds by itself (you need our holder revocation_secret to do
6667 * htlc holds HTLC elements (hash, timelock), thus changing the format of the witness script
6668 * (which is committed to in the BIP 143 signatures).
6670 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);
6672 * Create a signature for a claiming transaction for a HTLC output on a counterparty's commitment
6673 * transaction, either offered or received.
6675 * Such a transaction may claim multiples offered outputs at same time if we know the
6676 * preimage for each when we create it, but only the input at index `input` should be
6677 * signed for here. It may be called multiple times for same output(s) if a fee-bump is
6678 * needed with regards to an upcoming timelock expiration.
6680 * Witness_script is either a offered or received script as defined in BOLT3 for HTLC
6683 * Amount is value of the output spent by this input, committed to in the BIP 143 signature.
6685 * Per_commitment_point is the dynamic point corresponding to the channel state
6686 * detected onchain. It has been generated by our counterparty and is used to derive
6687 * channel state keys, which are then included in the witness script and committed to in the
6688 * BIP 143 signature.
6690 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);
6692 * Create a signature for a (proposed) closing transaction.
6694 * Note that, due to rounding, there may be one \"missing\" satoshi, and either party may have
6695 * chosen to forgo their output as dust.
6697 struct LDKCResult_SignatureNoneZ (*sign_closing_transaction)(const void *this_arg, const struct LDKClosingTransaction *NONNULL_PTR closing_tx);
6699 * Signs a channel announcement message with our funding key and our node secret key (aka
6700 * node_id or network_key), proving it comes from one of the channel participants.
6702 * The first returned signature should be from our node secret key, the second from our
6705 * Note that if this fails or is rejected, the channel will not be publicly announced and
6706 * our counterparty may (though likely will not) close the channel on us for violating the
6709 struct LDKCResult_C2Tuple_SignatureSignatureZNoneZ (*sign_channel_announcement)(const void *this_arg, const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR msg);
6711 * Set the counterparty static channel data, including basepoints,
6712 * counterparty_selected/holder_selected_contest_delay and funding outpoint.
6713 * This is done as soon as the funding outpoint is known. Since these are static channel data,
6714 * they MUST NOT be allowed to change to different values once set.
6716 * channel_parameters.is_populated() MUST be true.
6718 * We bind holder_selected_contest_delay late here for API convenience.
6720 * Will be called before any signatures are applied.
6722 void (*ready_channel)(void *this_arg, const struct LDKChannelTransactionParameters *NONNULL_PTR channel_parameters);
6724 * Frees any resources associated with this object given its this_arg pointer.
6725 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
6727 void (*free)(void *this_arg);
6731 * A cloneable signer.
6733 * Although we require signers to be cloneable, it may be useful for developers to be able to use
6734 * signers in an un-sized way, for example as `dyn BaseSign`. Therefore we separate the Clone trait,
6735 * which implies Sized, into this derived trait.
6737 typedef struct LDKSign {
6739 * An opaque pointer which is passed to your function implementations as an argument.
6740 * This has no meaning in the LDK, and can be NULL or any other value.
6744 * Implementation of BaseSign for this object.
6746 struct LDKBaseSign BaseSign;
6748 * Serialize the object into a byte array
6750 struct LDKCVec_u8Z (*write)(const void *this_arg);
6752 * Called, if set, after this Sign has been cloned into a duplicate object.
6753 * The new Sign is provided, and should be mutated as needed to perform a
6754 * deep copy of the object pointed to by this_arg or avoid any double-freeing.
6756 void (*cloned)(struct LDKSign *NONNULL_PTR new_Sign);
6758 * Frees any resources associated with this object given its this_arg pointer.
6759 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
6761 void (*free)(void *this_arg);
6765 * The contents of CResult_SignDecodeErrorZ
6767 typedef union LDKCResult_SignDecodeErrorZPtr {
6769 * A pointer to the contents in the success state.
6770 * Reading from this pointer when `result_ok` is not set is undefined.
6772 struct LDKSign *result;
6774 * A pointer to the contents in the error state.
6775 * Reading from this pointer when `result_ok` is set is undefined.
6777 struct LDKDecodeError *err;
6778 } LDKCResult_SignDecodeErrorZPtr;
6781 * A CResult_SignDecodeErrorZ represents the result of a fallible operation,
6782 * containing a crate::lightning::chain::keysinterface::Sign on success and a crate::lightning::ln::msgs::DecodeError on failure.
6783 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6785 typedef struct LDKCResult_SignDecodeErrorZ {
6787 * The contents of this CResult_SignDecodeErrorZ, accessible via either
6788 * `err` or `result` depending on the state of `result_ok`.
6790 union LDKCResult_SignDecodeErrorZPtr contents;
6792 * Whether this CResult_SignDecodeErrorZ represents a success state.
6795 } LDKCResult_SignDecodeErrorZ;
6798 * Integer in the range `0..32`
6800 typedef struct LDKu5 {
6805 * A dynamically-allocated array of crate::c_types::u5s of arbitrary size.
6806 * This corresponds to std::vector in C++
6808 typedef struct LDKCVec_u5Z {
6810 * The elements in the array.
6811 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
6815 * The number of elements pointed to by `data`.
6821 * Represents a secp256k1 signature serialized as two 32-byte numbers as well as a tag which
6822 * allows recovering the exact public key which created the signature given the message.
6824 typedef struct LDKRecoverableSignature {
6826 * The bytes of the signature in "compact" form plus a "Recovery ID" which allows for
6829 uint8_t serialized_form[68];
6830 } LDKRecoverableSignature;
6833 * The contents of CResult_RecoverableSignatureNoneZ
6835 typedef union LDKCResult_RecoverableSignatureNoneZPtr {
6837 * A pointer to the contents in the success state.
6838 * Reading from this pointer when `result_ok` is not set is undefined.
6840 struct LDKRecoverableSignature *result;
6842 * Note that this value is always NULL, as there are no contents in the Err variant
6845 } LDKCResult_RecoverableSignatureNoneZPtr;
6848 * A CResult_RecoverableSignatureNoneZ represents the result of a fallible operation,
6849 * containing a crate::c_types::RecoverableSignature on success and a () on failure.
6850 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6852 typedef struct LDKCResult_RecoverableSignatureNoneZ {
6854 * The contents of this CResult_RecoverableSignatureNoneZ, accessible via either
6855 * `err` or `result` depending on the state of `result_ok`.
6857 union LDKCResult_RecoverableSignatureNoneZPtr contents;
6859 * Whether this CResult_RecoverableSignatureNoneZ represents a success state.
6862 } LDKCResult_RecoverableSignatureNoneZ;
6865 * A dynamically-allocated array of crate::c_types::derived::CVec_u8Zs of arbitrary size.
6866 * This corresponds to std::vector in C++
6868 typedef struct LDKCVec_CVec_u8ZZ {
6870 * The elements in the array.
6871 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
6873 struct LDKCVec_u8Z *data;
6875 * The number of elements pointed to by `data`.
6878 } LDKCVec_CVec_u8ZZ;
6881 * The contents of CResult_CVec_CVec_u8ZZNoneZ
6883 typedef union LDKCResult_CVec_CVec_u8ZZNoneZPtr {
6885 * A pointer to the contents in the success state.
6886 * Reading from this pointer when `result_ok` is not set is undefined.
6888 struct LDKCVec_CVec_u8ZZ *result;
6890 * Note that this value is always NULL, as there are no contents in the Err variant
6893 } LDKCResult_CVec_CVec_u8ZZNoneZPtr;
6896 * A CResult_CVec_CVec_u8ZZNoneZ represents the result of a fallible operation,
6897 * containing a crate::c_types::derived::CVec_CVec_u8ZZ on success and a () on failure.
6898 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6900 typedef struct LDKCResult_CVec_CVec_u8ZZNoneZ {
6902 * The contents of this CResult_CVec_CVec_u8ZZNoneZ, accessible via either
6903 * `err` or `result` depending on the state of `result_ok`.
6905 union LDKCResult_CVec_CVec_u8ZZNoneZPtr contents;
6907 * Whether this CResult_CVec_CVec_u8ZZNoneZ represents a success state.
6910 } LDKCResult_CVec_CVec_u8ZZNoneZ;
6915 * A simple implementation of Sign that just keeps the private keys in memory.
6917 * This implementation performs no policy checks and is insufficient by itself as
6918 * a secure external signer.
6920 typedef struct MUST_USE_STRUCT LDKInMemorySigner {
6922 * A pointer to the opaque Rust object.
6923 * Nearly everywhere, inner must be non-null, however in places where
6924 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6926 LDKnativeInMemorySigner *inner;
6928 * Indicates that this is the only struct which contains the same pointer.
6929 * Rust functions which take ownership of an object provided via an argument require
6930 * this to be true and invalidate the object pointed to by inner.
6933 } LDKInMemorySigner;
6936 * The contents of CResult_InMemorySignerDecodeErrorZ
6938 typedef union LDKCResult_InMemorySignerDecodeErrorZPtr {
6940 * A pointer to the contents in the success state.
6941 * Reading from this pointer when `result_ok` is not set is undefined.
6943 struct LDKInMemorySigner *result;
6945 * A pointer to the contents in the error state.
6946 * Reading from this pointer when `result_ok` is set is undefined.
6948 struct LDKDecodeError *err;
6949 } LDKCResult_InMemorySignerDecodeErrorZPtr;
6952 * A CResult_InMemorySignerDecodeErrorZ represents the result of a fallible operation,
6953 * containing a crate::lightning::chain::keysinterface::InMemorySigner on success and a crate::lightning::ln::msgs::DecodeError on failure.
6954 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6956 typedef struct LDKCResult_InMemorySignerDecodeErrorZ {
6958 * The contents of this CResult_InMemorySignerDecodeErrorZ, accessible via either
6959 * `err` or `result` depending on the state of `result_ok`.
6961 union LDKCResult_InMemorySignerDecodeErrorZPtr contents;
6963 * Whether this CResult_InMemorySignerDecodeErrorZ represents a success state.
6966 } LDKCResult_InMemorySignerDecodeErrorZ;
6969 * A dynamically-allocated array of crate::c_types::TxOuts of arbitrary size.
6970 * This corresponds to std::vector in C++
6972 typedef struct LDKCVec_TxOutZ {
6974 * The elements in the array.
6975 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
6977 struct LDKTxOut *data;
6979 * The number of elements pointed to by `data`.
6985 * The contents of CResult_TransactionNoneZ
6987 typedef union LDKCResult_TransactionNoneZPtr {
6989 * A pointer to the contents in the success state.
6990 * Reading from this pointer when `result_ok` is not set is undefined.
6992 struct LDKTransaction *result;
6994 * Note that this value is always NULL, as there are no contents in the Err variant
6997 } LDKCResult_TransactionNoneZPtr;
7000 * A CResult_TransactionNoneZ represents the result of a fallible operation,
7001 * containing a crate::c_types::Transaction on success and a () on failure.
7002 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7004 typedef struct LDKCResult_TransactionNoneZ {
7006 * The contents of this CResult_TransactionNoneZ, accessible via either
7007 * `err` or `result` depending on the state of `result_ok`.
7009 union LDKCResult_TransactionNoneZPtr contents;
7011 * Whether this CResult_TransactionNoneZ represents a success state.
7014 } LDKCResult_TransactionNoneZ;
7019 * A ChannelMonitor handles chain events (blocks connected and disconnected) and generates
7020 * on-chain transactions to ensure no loss of funds occurs.
7022 * You MUST ensure that no ChannelMonitors for a given channel anywhere contain out-of-date
7023 * information and are actively monitoring the chain.
7025 * Pending Events or updated HTLCs which have not yet been read out by
7026 * get_and_clear_pending_monitor_events or get_and_clear_pending_events are serialized to disk and
7027 * reloaded at deserialize-time. Thus, you must ensure that, when handling events, all events
7028 * gotten are fully handled before re-serializing the new state.
7030 * Note that the deserializer is only implemented for (BlockHash, ChannelMonitor), which
7031 * tells you the last block hash which was block_connect()ed. You MUST rescan any blocks along
7032 * the \"reorg path\" (ie disconnecting blocks until you find a common ancestor from both the
7033 * returned block hash and the the current chain and then reconnecting blocks to get to the
7034 * best chain) upon deserializing the object!
7036 typedef struct MUST_USE_STRUCT LDKChannelMonitor {
7038 * A pointer to the opaque Rust object.
7039 * Nearly everywhere, inner must be non-null, however in places where
7040 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7042 LDKnativeChannelMonitor *inner;
7044 * Indicates that this is the only struct which contains the same pointer.
7045 * Rust functions which take ownership of an object provided via an argument require
7046 * this to be true and invalidate the object pointed to by inner.
7049 } LDKChannelMonitor;
7052 * A tuple of 2 elements. See the individual fields for the types contained.
7054 typedef struct LDKC2Tuple_BlockHashChannelMonitorZ {
7056 * The element at position 0
7058 struct LDKThirtyTwoBytes a;
7060 * The element at position 1
7062 struct LDKChannelMonitor b;
7063 } LDKC2Tuple_BlockHashChannelMonitorZ;
7066 * A dynamically-allocated array of crate::c_types::derived::C2Tuple_BlockHashChannelMonitorZs of arbitrary size.
7067 * This corresponds to std::vector in C++
7069 typedef struct LDKCVec_C2Tuple_BlockHashChannelMonitorZZ {
7071 * The elements in the array.
7072 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
7074 struct LDKC2Tuple_BlockHashChannelMonitorZ *data;
7076 * The number of elements pointed to by `data`.
7079 } LDKCVec_C2Tuple_BlockHashChannelMonitorZZ;
7082 * The contents of CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ
7084 typedef union LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZPtr {
7086 * A pointer to the contents in the success state.
7087 * Reading from this pointer when `result_ok` is not set is undefined.
7089 struct LDKCVec_C2Tuple_BlockHashChannelMonitorZZ *result;
7091 * A pointer to the contents in the error state.
7092 * Reading from this pointer when `result_ok` is set is undefined.
7094 enum LDKIOError *err;
7095 } LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZPtr;
7098 * A CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ represents the result of a fallible operation,
7099 * containing a crate::c_types::derived::CVec_C2Tuple_BlockHashChannelMonitorZZ on success and a crate::c_types::IOError on failure.
7100 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7102 typedef struct LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ {
7104 * The contents of this CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ, accessible via either
7105 * `err` or `result` depending on the state of `result_ok`.
7107 union LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZPtr contents;
7109 * Whether this CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ represents a success state.
7112 } LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ;
7115 * An enum which can either contain a u16 or not
7117 typedef enum LDKCOption_u16Z_Tag {
7119 * When we're in this state, this COption_u16Z contains a u16
7121 LDKCOption_u16Z_Some,
7123 * When we're in this state, this COption_u16Z contains nothing
7125 LDKCOption_u16Z_None,
7127 * Must be last for serialization purposes
7129 LDKCOption_u16Z_Sentinel,
7130 } LDKCOption_u16Z_Tag;
7132 typedef struct LDKCOption_u16Z {
7133 LDKCOption_u16Z_Tag tag;
7142 * Indicates an error on the client's part (usually some variant of attempting to use too-low or
7145 typedef enum LDKAPIError_Tag {
7147 * Indicates the API was wholly misused (see err for more). Cases where these can be returned
7148 * are documented, but generally indicates some precondition of a function was violated.
7150 LDKAPIError_APIMisuseError,
7152 * Due to a high feerate, we were unable to complete the request.
7153 * For example, this may be returned if the feerate implies we cannot open a channel at the
7154 * requested value, but opening a larger channel would succeed.
7156 LDKAPIError_FeeRateTooHigh,
7158 * A malformed Route was provided (eg overflowed value, node id mismatch, overly-looped route,
7159 * too-many-hops, etc).
7161 LDKAPIError_RouteError,
7163 * We were unable to complete the request as the Channel required to do so is unable to
7164 * complete the request (or was not found). This can take many forms, including disconnected
7165 * peer, channel at capacity, channel shutting down, etc.
7167 LDKAPIError_ChannelUnavailable,
7169 * An attempt to call watch/update_channel returned an Err (ie you did this!), causing the
7170 * attempted action to fail.
7172 LDKAPIError_MonitorUpdateFailed,
7174 * [`KeysInterface::get_shutdown_scriptpubkey`] returned a shutdown scriptpubkey incompatible
7175 * with the channel counterparty as negotiated in [`InitFeatures`].
7177 * Using a SegWit v0 script should resolve this issue. If you cannot, you won't be able to open
7178 * a channel or cooperatively close one with this peer (and will have to force-close instead).
7180 * [`KeysInterface::get_shutdown_scriptpubkey`]: crate::chain::keysinterface::KeysInterface::get_shutdown_scriptpubkey
7181 * [`InitFeatures`]: crate::ln::features::InitFeatures
7183 LDKAPIError_IncompatibleShutdownScript,
7185 * Must be last for serialization purposes
7187 LDKAPIError_Sentinel,
7190 typedef struct LDKAPIError_LDKAPIMisuseError_Body {
7192 * A human-readable error message
7195 } LDKAPIError_LDKAPIMisuseError_Body;
7197 typedef struct LDKAPIError_LDKFeeRateTooHigh_Body {
7199 * A human-readable error message
7203 * The feerate which was too high.
7206 } LDKAPIError_LDKFeeRateTooHigh_Body;
7208 typedef struct LDKAPIError_LDKRouteError_Body {
7210 * A human-readable error message
7213 } LDKAPIError_LDKRouteError_Body;
7215 typedef struct LDKAPIError_LDKChannelUnavailable_Body {
7217 * A human-readable error message
7220 } LDKAPIError_LDKChannelUnavailable_Body;
7222 typedef struct LDKAPIError_LDKIncompatibleShutdownScript_Body {
7224 * The incompatible shutdown script.
7226 struct LDKShutdownScript script;
7227 } LDKAPIError_LDKIncompatibleShutdownScript_Body;
7229 typedef struct MUST_USE_STRUCT LDKAPIError {
7230 LDKAPIError_Tag tag;
7232 LDKAPIError_LDKAPIMisuseError_Body api_misuse_error;
7233 LDKAPIError_LDKFeeRateTooHigh_Body fee_rate_too_high;
7234 LDKAPIError_LDKRouteError_Body route_error;
7235 LDKAPIError_LDKChannelUnavailable_Body channel_unavailable;
7236 LDKAPIError_LDKIncompatibleShutdownScript_Body incompatible_shutdown_script;
7241 * The contents of CResult_NoneAPIErrorZ
7243 typedef union LDKCResult_NoneAPIErrorZPtr {
7245 * Note that this value is always NULL, as there are no contents in the OK variant
7249 * A pointer to the contents in the error state.
7250 * Reading from this pointer when `result_ok` is set is undefined.
7252 struct LDKAPIError *err;
7253 } LDKCResult_NoneAPIErrorZPtr;
7256 * A CResult_NoneAPIErrorZ represents the result of a fallible operation,
7257 * containing a () on success and a crate::lightning::util::errors::APIError on failure.
7258 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7260 typedef struct LDKCResult_NoneAPIErrorZ {
7262 * The contents of this CResult_NoneAPIErrorZ, accessible via either
7263 * `err` or `result` depending on the state of `result_ok`.
7265 union LDKCResult_NoneAPIErrorZPtr contents;
7267 * Whether this CResult_NoneAPIErrorZ represents a success state.
7270 } LDKCResult_NoneAPIErrorZ;
7273 * A dynamically-allocated array of crate::c_types::derived::CResult_NoneAPIErrorZs of arbitrary size.
7274 * This corresponds to std::vector in C++
7276 typedef struct LDKCVec_CResult_NoneAPIErrorZZ {
7278 * The elements in the array.
7279 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
7281 struct LDKCResult_NoneAPIErrorZ *data;
7283 * The number of elements pointed to by `data`.
7286 } LDKCVec_CResult_NoneAPIErrorZZ;
7289 * A dynamically-allocated array of crate::lightning::util::errors::APIErrors of arbitrary size.
7290 * This corresponds to std::vector in C++
7292 typedef struct LDKCVec_APIErrorZ {
7294 * The elements in the array.
7295 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
7297 struct LDKAPIError *data;
7299 * The number of elements pointed to by `data`.
7302 } LDKCVec_APIErrorZ;
7305 * The contents of CResult__u832APIErrorZ
7307 typedef union LDKCResult__u832APIErrorZPtr {
7309 * A pointer to the contents in the success state.
7310 * Reading from this pointer when `result_ok` is not set is undefined.
7312 struct LDKThirtyTwoBytes *result;
7314 * A pointer to the contents in the error state.
7315 * Reading from this pointer when `result_ok` is set is undefined.
7317 struct LDKAPIError *err;
7318 } LDKCResult__u832APIErrorZPtr;
7321 * A CResult__u832APIErrorZ represents the result of a fallible operation,
7322 * containing a crate::c_types::ThirtyTwoBytes on success and a crate::lightning::util::errors::APIError on failure.
7323 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7325 typedef struct LDKCResult__u832APIErrorZ {
7327 * The contents of this CResult__u832APIErrorZ, accessible via either
7328 * `err` or `result` depending on the state of `result_ok`.
7330 union LDKCResult__u832APIErrorZPtr contents;
7332 * Whether this CResult__u832APIErrorZ represents a success state.
7335 } LDKCResult__u832APIErrorZ;
7338 * If a payment fails to send, it can be in one of several states. This enum is returned as the
7339 * Err() type describing which state the payment is in, see the description of individual enum
7342 typedef enum LDKPaymentSendFailure_Tag {
7344 * A parameter which was passed to send_payment was invalid, preventing us from attempting to
7345 * send the payment at all. No channel state has been changed or messages sent to peers, and
7346 * once you've changed the parameter at error, you can freely retry the payment in full.
7348 LDKPaymentSendFailure_ParameterError,
7350 * A parameter in a single path which was passed to send_payment was invalid, preventing us
7351 * from attempting to send the payment at all. No channel state has been changed or messages
7352 * sent to peers, and once you've changed the parameter at error, you can freely retry the
7355 * The results here are ordered the same as the paths in the route object which was passed to
7358 LDKPaymentSendFailure_PathParameterError,
7360 * All paths which were attempted failed to send, with no channel state change taking place.
7361 * You can freely retry the payment in full (though you probably want to do so over different
7362 * paths than the ones selected).
7364 LDKPaymentSendFailure_AllFailedRetrySafe,
7366 * Some paths which were attempted failed to send, though possibly not all. At least some
7367 * paths have irrevocably committed to the HTLC and retrying the payment in full would result
7368 * in over-/re-payment.
7370 * The results here are ordered the same as the paths in the route object which was passed to
7371 * send_payment, and any Errs which are not APIError::MonitorUpdateFailed can be safely
7372 * retried (though there is currently no API with which to do so).
7374 * Any entries which contain Err(APIError::MonitorUpdateFailed) or Ok(()) MUST NOT be retried
7375 * as they will result in over-/re-payment. These HTLCs all either successfully sent (in the
7376 * case of Ok(())) or will send once channel_monitor_updated is called on the next-hop channel
7377 * with the latest update_id.
7379 LDKPaymentSendFailure_PartialFailure,
7381 * Must be last for serialization purposes
7383 LDKPaymentSendFailure_Sentinel,
7384 } LDKPaymentSendFailure_Tag;
7386 typedef struct LDKPaymentSendFailure_LDKPartialFailure_Body {
7388 * The errors themselves, in the same order as the route hops.
7390 struct LDKCVec_CResult_NoneAPIErrorZZ results;
7392 * If some paths failed without irrevocably committing to the new HTLC(s), this will
7393 * contain a [`RouteParameters`] object which can be used to calculate a new route that
7394 * will pay all remaining unpaid balance.
7396 * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
7398 struct LDKRouteParameters failed_paths_retry;
7400 * The payment id for the payment, which is now at least partially pending.
7402 struct LDKThirtyTwoBytes payment_id;
7403 } LDKPaymentSendFailure_LDKPartialFailure_Body;
7405 typedef struct MUST_USE_STRUCT LDKPaymentSendFailure {
7406 LDKPaymentSendFailure_Tag tag;
7409 struct LDKAPIError parameter_error;
7412 struct LDKCVec_CResult_NoneAPIErrorZZ path_parameter_error;
7415 struct LDKCVec_APIErrorZ all_failed_retry_safe;
7417 LDKPaymentSendFailure_LDKPartialFailure_Body partial_failure;
7419 } LDKPaymentSendFailure;
7422 * The contents of CResult_PaymentIdPaymentSendFailureZ
7424 typedef union LDKCResult_PaymentIdPaymentSendFailureZPtr {
7426 * A pointer to the contents in the success state.
7427 * Reading from this pointer when `result_ok` is not set is undefined.
7429 struct LDKThirtyTwoBytes *result;
7431 * A pointer to the contents in the error state.
7432 * Reading from this pointer when `result_ok` is set is undefined.
7434 struct LDKPaymentSendFailure *err;
7435 } LDKCResult_PaymentIdPaymentSendFailureZPtr;
7438 * A CResult_PaymentIdPaymentSendFailureZ represents the result of a fallible operation,
7439 * containing a crate::c_types::ThirtyTwoBytes on success and a crate::lightning::ln::channelmanager::PaymentSendFailure on failure.
7440 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7442 typedef struct LDKCResult_PaymentIdPaymentSendFailureZ {
7444 * The contents of this CResult_PaymentIdPaymentSendFailureZ, accessible via either
7445 * `err` or `result` depending on the state of `result_ok`.
7447 union LDKCResult_PaymentIdPaymentSendFailureZPtr contents;
7449 * Whether this CResult_PaymentIdPaymentSendFailureZ represents a success state.
7452 } LDKCResult_PaymentIdPaymentSendFailureZ;
7455 * The contents of CResult_NonePaymentSendFailureZ
7457 typedef union LDKCResult_NonePaymentSendFailureZPtr {
7459 * Note that this value is always NULL, as there are no contents in the OK variant
7463 * A pointer to the contents in the error state.
7464 * Reading from this pointer when `result_ok` is set is undefined.
7466 struct LDKPaymentSendFailure *err;
7467 } LDKCResult_NonePaymentSendFailureZPtr;
7470 * A CResult_NonePaymentSendFailureZ represents the result of a fallible operation,
7471 * containing a () on success and a crate::lightning::ln::channelmanager::PaymentSendFailure on failure.
7472 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7474 typedef struct LDKCResult_NonePaymentSendFailureZ {
7476 * The contents of this CResult_NonePaymentSendFailureZ, accessible via either
7477 * `err` or `result` depending on the state of `result_ok`.
7479 union LDKCResult_NonePaymentSendFailureZPtr contents;
7481 * Whether this CResult_NonePaymentSendFailureZ represents a success state.
7484 } LDKCResult_NonePaymentSendFailureZ;
7487 * A tuple of 2 elements. See the individual fields for the types contained.
7489 typedef struct LDKC2Tuple_PaymentHashPaymentIdZ {
7491 * The element at position 0
7493 struct LDKThirtyTwoBytes a;
7495 * The element at position 1
7497 struct LDKThirtyTwoBytes b;
7498 } LDKC2Tuple_PaymentHashPaymentIdZ;
7501 * The contents of CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ
7503 typedef union LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZPtr {
7505 * A pointer to the contents in the success state.
7506 * Reading from this pointer when `result_ok` is not set is undefined.
7508 struct LDKC2Tuple_PaymentHashPaymentIdZ *result;
7510 * A pointer to the contents in the error state.
7511 * Reading from this pointer when `result_ok` is set is undefined.
7513 struct LDKPaymentSendFailure *err;
7514 } LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZPtr;
7517 * A CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ represents the result of a fallible operation,
7518 * containing a crate::c_types::derived::C2Tuple_PaymentHashPaymentIdZ on success and a crate::lightning::ln::channelmanager::PaymentSendFailure on failure.
7519 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7521 typedef struct LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ {
7523 * The contents of this CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ, accessible via either
7524 * `err` or `result` depending on the state of `result_ok`.
7526 union LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZPtr contents;
7528 * Whether this CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ represents a success state.
7531 } LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ;
7534 * A dynamically-allocated array of crate::c_types::ThirtyTwoBytess of arbitrary size.
7535 * This corresponds to std::vector in C++
7537 typedef struct LDKCVec_ThirtyTwoBytesZ {
7539 * The elements in the array.
7540 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
7542 struct LDKThirtyTwoBytes *data;
7544 * The number of elements pointed to by `data`.
7547 } LDKCVec_ThirtyTwoBytesZ;
7550 * A tuple of 2 elements. See the individual fields for the types contained.
7552 typedef struct LDKC2Tuple_PaymentHashPaymentSecretZ {
7554 * The element at position 0
7556 struct LDKThirtyTwoBytes a;
7558 * The element at position 1
7560 struct LDKThirtyTwoBytes b;
7561 } LDKC2Tuple_PaymentHashPaymentSecretZ;
7564 * The contents of CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ
7566 typedef union LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZPtr {
7568 * A pointer to the contents in the success state.
7569 * Reading from this pointer when `result_ok` is not set is undefined.
7571 struct LDKC2Tuple_PaymentHashPaymentSecretZ *result;
7573 * Note that this value is always NULL, as there are no contents in the Err variant
7576 } LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZPtr;
7579 * A CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ represents the result of a fallible operation,
7580 * containing a crate::c_types::derived::C2Tuple_PaymentHashPaymentSecretZ on success and a () on failure.
7581 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7583 typedef struct LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ {
7585 * The contents of this CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ, accessible via either
7586 * `err` or `result` depending on the state of `result_ok`.
7588 union LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZPtr contents;
7590 * Whether this CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ represents a success state.
7593 } LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ;
7596 * The contents of CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ
7598 typedef union LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZPtr {
7600 * A pointer to the contents in the success state.
7601 * Reading from this pointer when `result_ok` is not set is undefined.
7603 struct LDKC2Tuple_PaymentHashPaymentSecretZ *result;
7605 * A pointer to the contents in the error state.
7606 * Reading from this pointer when `result_ok` is set is undefined.
7608 struct LDKAPIError *err;
7609 } LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZPtr;
7612 * A CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ represents the result of a fallible operation,
7613 * containing a crate::c_types::derived::C2Tuple_PaymentHashPaymentSecretZ on success and a crate::lightning::util::errors::APIError on failure.
7614 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7616 typedef struct LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ {
7618 * The contents of this CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ, accessible via either
7619 * `err` or `result` depending on the state of `result_ok`.
7621 union LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZPtr contents;
7623 * Whether this CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ represents a success state.
7626 } LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ;
7629 * The contents of CResult_PaymentSecretNoneZ
7631 typedef union LDKCResult_PaymentSecretNoneZPtr {
7633 * A pointer to the contents in the success state.
7634 * Reading from this pointer when `result_ok` is not set is undefined.
7636 struct LDKThirtyTwoBytes *result;
7638 * Note that this value is always NULL, as there are no contents in the Err variant
7641 } LDKCResult_PaymentSecretNoneZPtr;
7644 * A CResult_PaymentSecretNoneZ represents the result of a fallible operation,
7645 * containing a crate::c_types::ThirtyTwoBytes on success and a () on failure.
7646 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7648 typedef struct LDKCResult_PaymentSecretNoneZ {
7650 * The contents of this CResult_PaymentSecretNoneZ, accessible via either
7651 * `err` or `result` depending on the state of `result_ok`.
7653 union LDKCResult_PaymentSecretNoneZPtr contents;
7655 * Whether this CResult_PaymentSecretNoneZ represents a success state.
7658 } LDKCResult_PaymentSecretNoneZ;
7661 * The contents of CResult_PaymentSecretAPIErrorZ
7663 typedef union LDKCResult_PaymentSecretAPIErrorZPtr {
7665 * A pointer to the contents in the success state.
7666 * Reading from this pointer when `result_ok` is not set is undefined.
7668 struct LDKThirtyTwoBytes *result;
7670 * A pointer to the contents in the error state.
7671 * Reading from this pointer when `result_ok` is set is undefined.
7673 struct LDKAPIError *err;
7674 } LDKCResult_PaymentSecretAPIErrorZPtr;
7677 * A CResult_PaymentSecretAPIErrorZ represents the result of a fallible operation,
7678 * containing a crate::c_types::ThirtyTwoBytes on success and a crate::lightning::util::errors::APIError on failure.
7679 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7681 typedef struct LDKCResult_PaymentSecretAPIErrorZ {
7683 * The contents of this CResult_PaymentSecretAPIErrorZ, accessible via either
7684 * `err` or `result` depending on the state of `result_ok`.
7686 union LDKCResult_PaymentSecretAPIErrorZPtr contents;
7688 * Whether this CResult_PaymentSecretAPIErrorZ represents a success state.
7691 } LDKCResult_PaymentSecretAPIErrorZ;
7694 * The contents of CResult_PaymentPreimageAPIErrorZ
7696 typedef union LDKCResult_PaymentPreimageAPIErrorZPtr {
7698 * A pointer to the contents in the success state.
7699 * Reading from this pointer when `result_ok` is not set is undefined.
7701 struct LDKThirtyTwoBytes *result;
7703 * A pointer to the contents in the error state.
7704 * Reading from this pointer when `result_ok` is set is undefined.
7706 struct LDKAPIError *err;
7707 } LDKCResult_PaymentPreimageAPIErrorZPtr;
7710 * A CResult_PaymentPreimageAPIErrorZ represents the result of a fallible operation,
7711 * containing a crate::c_types::ThirtyTwoBytes on success and a crate::lightning::util::errors::APIError on failure.
7712 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7714 typedef struct LDKCResult_PaymentPreimageAPIErrorZ {
7716 * The contents of this CResult_PaymentPreimageAPIErrorZ, accessible via either
7717 * `err` or `result` depending on the state of `result_ok`.
7719 union LDKCResult_PaymentPreimageAPIErrorZPtr contents;
7721 * Whether this CResult_PaymentPreimageAPIErrorZ represents a success state.
7724 } LDKCResult_PaymentPreimageAPIErrorZ;
7729 * Information needed for constructing an invoice route hint for this channel.
7731 typedef struct MUST_USE_STRUCT LDKCounterpartyForwardingInfo {
7733 * A pointer to the opaque Rust object.
7734 * Nearly everywhere, inner must be non-null, however in places where
7735 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7737 LDKnativeCounterpartyForwardingInfo *inner;
7739 * Indicates that this is the only struct which contains the same pointer.
7740 * Rust functions which take ownership of an object provided via an argument require
7741 * this to be true and invalidate the object pointed to by inner.
7744 } LDKCounterpartyForwardingInfo;
7747 * The contents of CResult_CounterpartyForwardingInfoDecodeErrorZ
7749 typedef union LDKCResult_CounterpartyForwardingInfoDecodeErrorZPtr {
7751 * A pointer to the contents in the success state.
7752 * Reading from this pointer when `result_ok` is not set is undefined.
7754 struct LDKCounterpartyForwardingInfo *result;
7756 * A pointer to the contents in the error state.
7757 * Reading from this pointer when `result_ok` is set is undefined.
7759 struct LDKDecodeError *err;
7760 } LDKCResult_CounterpartyForwardingInfoDecodeErrorZPtr;
7763 * A CResult_CounterpartyForwardingInfoDecodeErrorZ represents the result of a fallible operation,
7764 * containing a crate::lightning::ln::channelmanager::CounterpartyForwardingInfo on success and a crate::lightning::ln::msgs::DecodeError on failure.
7765 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7767 typedef struct LDKCResult_CounterpartyForwardingInfoDecodeErrorZ {
7769 * The contents of this CResult_CounterpartyForwardingInfoDecodeErrorZ, accessible via either
7770 * `err` or `result` depending on the state of `result_ok`.
7772 union LDKCResult_CounterpartyForwardingInfoDecodeErrorZPtr contents;
7774 * Whether this CResult_CounterpartyForwardingInfoDecodeErrorZ represents a success state.
7777 } LDKCResult_CounterpartyForwardingInfoDecodeErrorZ;
7782 * Channel parameters which apply to our counterparty. These are split out from [`ChannelDetails`]
7783 * to better separate parameters.
7785 typedef struct MUST_USE_STRUCT LDKChannelCounterparty {
7787 * A pointer to the opaque Rust object.
7788 * Nearly everywhere, inner must be non-null, however in places where
7789 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7791 LDKnativeChannelCounterparty *inner;
7793 * Indicates that this is the only struct which contains the same pointer.
7794 * Rust functions which take ownership of an object provided via an argument require
7795 * this to be true and invalidate the object pointed to by inner.
7798 } LDKChannelCounterparty;
7801 * The contents of CResult_ChannelCounterpartyDecodeErrorZ
7803 typedef union LDKCResult_ChannelCounterpartyDecodeErrorZPtr {
7805 * A pointer to the contents in the success state.
7806 * Reading from this pointer when `result_ok` is not set is undefined.
7808 struct LDKChannelCounterparty *result;
7810 * A pointer to the contents in the error state.
7811 * Reading from this pointer when `result_ok` is set is undefined.
7813 struct LDKDecodeError *err;
7814 } LDKCResult_ChannelCounterpartyDecodeErrorZPtr;
7817 * A CResult_ChannelCounterpartyDecodeErrorZ represents the result of a fallible operation,
7818 * containing a crate::lightning::ln::channelmanager::ChannelCounterparty on success and a crate::lightning::ln::msgs::DecodeError on failure.
7819 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7821 typedef struct LDKCResult_ChannelCounterpartyDecodeErrorZ {
7823 * The contents of this CResult_ChannelCounterpartyDecodeErrorZ, accessible via either
7824 * `err` or `result` depending on the state of `result_ok`.
7826 union LDKCResult_ChannelCounterpartyDecodeErrorZPtr contents;
7828 * Whether this CResult_ChannelCounterpartyDecodeErrorZ represents a success state.
7831 } LDKCResult_ChannelCounterpartyDecodeErrorZ;
7834 * The contents of CResult_ChannelDetailsDecodeErrorZ
7836 typedef union LDKCResult_ChannelDetailsDecodeErrorZPtr {
7838 * A pointer to the contents in the success state.
7839 * Reading from this pointer when `result_ok` is not set is undefined.
7841 struct LDKChannelDetails *result;
7843 * A pointer to the contents in the error state.
7844 * Reading from this pointer when `result_ok` is set is undefined.
7846 struct LDKDecodeError *err;
7847 } LDKCResult_ChannelDetailsDecodeErrorZPtr;
7850 * A CResult_ChannelDetailsDecodeErrorZ represents the result of a fallible operation,
7851 * containing a crate::lightning::ln::channelmanager::ChannelDetails on success and a crate::lightning::ln::msgs::DecodeError on failure.
7852 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7854 typedef struct LDKCResult_ChannelDetailsDecodeErrorZ {
7856 * The contents of this CResult_ChannelDetailsDecodeErrorZ, accessible via either
7857 * `err` or `result` depending on the state of `result_ok`.
7859 union LDKCResult_ChannelDetailsDecodeErrorZPtr contents;
7861 * Whether this CResult_ChannelDetailsDecodeErrorZ represents a success state.
7864 } LDKCResult_ChannelDetailsDecodeErrorZ;
7869 * Route hints used in constructing invoices for [phantom node payents].
7871 * [phantom node payments]: crate::chain::keysinterface::PhantomKeysManager
7873 typedef struct MUST_USE_STRUCT LDKPhantomRouteHints {
7875 * A pointer to the opaque Rust object.
7876 * Nearly everywhere, inner must be non-null, however in places where
7877 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7879 LDKnativePhantomRouteHints *inner;
7881 * Indicates that this is the only struct which contains the same pointer.
7882 * Rust functions which take ownership of an object provided via an argument require
7883 * this to be true and invalidate the object pointed to by inner.
7886 } LDKPhantomRouteHints;
7889 * The contents of CResult_PhantomRouteHintsDecodeErrorZ
7891 typedef union LDKCResult_PhantomRouteHintsDecodeErrorZPtr {
7893 * A pointer to the contents in the success state.
7894 * Reading from this pointer when `result_ok` is not set is undefined.
7896 struct LDKPhantomRouteHints *result;
7898 * A pointer to the contents in the error state.
7899 * Reading from this pointer when `result_ok` is set is undefined.
7901 struct LDKDecodeError *err;
7902 } LDKCResult_PhantomRouteHintsDecodeErrorZPtr;
7905 * A CResult_PhantomRouteHintsDecodeErrorZ represents the result of a fallible operation,
7906 * containing a crate::lightning::ln::channelmanager::PhantomRouteHints on success and a crate::lightning::ln::msgs::DecodeError on failure.
7907 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7909 typedef struct LDKCResult_PhantomRouteHintsDecodeErrorZ {
7911 * The contents of this CResult_PhantomRouteHintsDecodeErrorZ, accessible via either
7912 * `err` or `result` depending on the state of `result_ok`.
7914 union LDKCResult_PhantomRouteHintsDecodeErrorZPtr contents;
7916 * Whether this CResult_PhantomRouteHintsDecodeErrorZ represents a success state.
7919 } LDKCResult_PhantomRouteHintsDecodeErrorZ;
7922 * A dynamically-allocated array of crate::lightning::chain::channelmonitor::ChannelMonitors of arbitrary size.
7923 * This corresponds to std::vector in C++
7925 typedef struct LDKCVec_ChannelMonitorZ {
7927 * The elements in the array.
7928 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
7930 struct LDKChannelMonitor *data;
7932 * The number of elements pointed to by `data`.
7935 } LDKCVec_ChannelMonitorZ;
7940 * An update generated by the underlying channel itself which contains some new information the
7941 * [`ChannelMonitor`] should be made aware of.
7943 * Because this represents only a small number of updates to the underlying state, it is generally
7944 * much smaller than a full [`ChannelMonitor`]. However, for large single commitment transaction
7945 * updates (e.g. ones during which there are hundreds of HTLCs pending on the commitment
7946 * transaction), a single update may reach upwards of 1 MiB in serialized size.
7948 typedef struct MUST_USE_STRUCT LDKChannelMonitorUpdate {
7950 * A pointer to the opaque Rust object.
7951 * Nearly everywhere, inner must be non-null, however in places where
7952 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7954 LDKnativeChannelMonitorUpdate *inner;
7956 * Indicates that this is the only struct which contains the same pointer.
7957 * Rust functions which take ownership of an object provided via an argument require
7958 * this to be true and invalidate the object pointed to by inner.
7961 } LDKChannelMonitorUpdate;
7964 * The `Watch` trait defines behavior for watching on-chain activity pertaining to channels as
7965 * blocks are connected and disconnected.
7967 * Each channel is associated with a [`ChannelMonitor`]. Implementations of this trait are
7968 * responsible for maintaining a set of monitors such that they can be updated accordingly as
7969 * channel state changes and HTLCs are resolved. See method documentation for specific
7972 * Implementations **must** ensure that updates are successfully applied and persisted upon method
7973 * completion. If an update fails with a [`PermanentFailure`], then it must immediately shut down
7974 * without taking any further action such as persisting the current state.
7976 * If an implementation maintains multiple instances of a channel's monitor (e.g., by storing
7977 * backup copies), then it must ensure that updates are applied across all instances. Otherwise, it
7978 * could result in a revoked transaction being broadcast, allowing the counterparty to claim all
7979 * funds in the channel. See [`ChannelMonitorUpdateErr`] for more details about how to handle
7980 * multiple instances.
7982 * [`PermanentFailure`]: ChannelMonitorUpdateErr::PermanentFailure
7984 typedef struct LDKWatch {
7986 * An opaque pointer which is passed to your function implementations as an argument.
7987 * This has no meaning in the LDK, and can be NULL or any other value.
7991 * Watches a channel identified by `funding_txo` using `monitor`.
7993 * Implementations are responsible for watching the chain for the funding transaction along
7994 * with any spends of outputs returned by [`get_outputs_to_watch`]. In practice, this means
7995 * calling [`block_connected`] and [`block_disconnected`] on the monitor.
7997 * Note: this interface MUST error with `ChannelMonitorUpdateErr::PermanentFailure` if
7998 * the given `funding_txo` has previously been registered via `watch_channel`.
8000 * [`get_outputs_to_watch`]: channelmonitor::ChannelMonitor::get_outputs_to_watch
8001 * [`block_connected`]: channelmonitor::ChannelMonitor::block_connected
8002 * [`block_disconnected`]: channelmonitor::ChannelMonitor::block_disconnected
8004 struct LDKCResult_NoneChannelMonitorUpdateErrZ (*watch_channel)(const void *this_arg, struct LDKOutPoint funding_txo, struct LDKChannelMonitor monitor);
8006 * Updates a channel identified by `funding_txo` by applying `update` to its monitor.
8008 * Implementations must call [`update_monitor`] with the given update. See
8009 * [`ChannelMonitorUpdateErr`] for invariants around returning an error.
8011 * [`update_monitor`]: channelmonitor::ChannelMonitor::update_monitor
8013 struct LDKCResult_NoneChannelMonitorUpdateErrZ (*update_channel)(const void *this_arg, struct LDKOutPoint funding_txo, struct LDKChannelMonitorUpdate update);
8015 * Returns any monitor events since the last call. Subsequent calls must only return new
8018 * Note that after any block- or transaction-connection calls to a [`ChannelMonitor`], no
8019 * further events may be returned here until the [`ChannelMonitor`] has been fully persisted
8022 * For details on asynchronous [`ChannelMonitor`] updating and returning
8023 * [`MonitorEvent::UpdateCompleted`] here, see [`ChannelMonitorUpdateErr::TemporaryFailure`].
8025 struct LDKCVec_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZZ (*release_pending_monitor_events)(const void *this_arg);
8027 * Frees any resources associated with this object given its this_arg pointer.
8028 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
8030 void (*free)(void *this_arg);
8034 * An interface to send a transaction to the Bitcoin network.
8036 typedef struct LDKBroadcasterInterface {
8038 * An opaque pointer which is passed to your function implementations as an argument.
8039 * This has no meaning in the LDK, and can be NULL or any other value.
8043 * Sends a transaction out to (hopefully) be mined.
8045 void (*broadcast_transaction)(const void *this_arg, struct LDKTransaction tx);
8047 * Frees any resources associated with this object given its this_arg pointer.
8048 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
8050 void (*free)(void *this_arg);
8051 } LDKBroadcasterInterface;
8054 * A "slice" referencing some byte array. This is simply a length-tagged pointer which does not
8055 * own the memory pointed to by data.
8057 typedef struct LDKu8slice {
8059 * A pointer to the byte buffer
8061 const uint8_t *data;
8063 * The number of bytes pointed to by `data`.
8069 * A trait to describe an object which can get user secrets and key material.
8071 typedef struct LDKKeysInterface {
8073 * An opaque pointer which is passed to your function implementations as an argument.
8074 * This has no meaning in the LDK, and can be NULL or any other value.
8078 * Get node secret key based on the provided [`Recipient`].
8080 * The node_id/network_key is the public key that corresponds to this secret key.
8082 * This method must return the same value each time it is called with a given `Recipient`
8085 struct LDKCResult_SecretKeyNoneZ (*get_node_secret)(const void *this_arg, enum LDKRecipient recipient);
8087 * Gets the ECDH shared secret of our [`node secret`] and `other_key`, multiplying by `tweak` if
8088 * one is provided. Note that this tweak can be applied to `other_key` instead of our node
8089 * secret, though this is less efficient.
8091 * [`node secret`]: Self::get_node_secret
8093 struct LDKCResult_SharedSecretNoneZ (*ecdh)(const void *this_arg, enum LDKRecipient recipient, struct LDKPublicKey other_key, struct LDKCOption_ScalarZ tweak);
8095 * Get a script pubkey which we send funds to when claiming on-chain contestable outputs.
8097 * This method should return a different value each time it is called, to avoid linking
8098 * on-chain funds across channels as controlled to the same user.
8100 struct LDKCVec_u8Z (*get_destination_script)(const void *this_arg);
8102 * Get a script pubkey which we will send funds to when closing a channel.
8104 * This method should return a different value each time it is called, to avoid linking
8105 * on-chain funds across channels as controlled to the same user.
8107 struct LDKShutdownScript (*get_shutdown_scriptpubkey)(const void *this_arg);
8109 * Get a new set of Sign for per-channel secrets. These MUST be unique even if you
8110 * restarted with some stale data!
8112 * This method must return a different value each time it is called.
8114 struct LDKSign (*get_channel_signer)(const void *this_arg, bool inbound, uint64_t channel_value_satoshis);
8116 * Gets a unique, cryptographically-secure, random 32 byte value. This is used for encrypting
8117 * onion packets and for temporary channel IDs. There is no requirement that these be
8118 * persisted anywhere, though they must be unique across restarts.
8120 * This method must return a different value each time it is called.
8122 struct LDKThirtyTwoBytes (*get_secure_random_bytes)(const void *this_arg);
8124 * Reads a `Signer` for this `KeysInterface` from the given input stream.
8125 * This is only called during deserialization of other objects which contain
8126 * `Sign`-implementing objects (ie `ChannelMonitor`s and `ChannelManager`s).
8127 * The bytes are exactly those which `<Self::Signer as Writeable>::write()` writes, and
8128 * contain no versioning scheme. You may wish to include your own version prefix and ensure
8129 * you've read all of the provided bytes to ensure no corruption occurred.
8131 struct LDKCResult_SignDecodeErrorZ (*read_chan_signer)(const void *this_arg, struct LDKu8slice reader);
8134 * By parameterizing by the raw invoice bytes instead of the hash, we allow implementors of
8135 * this trait to parse the invoice and make sure they're signing what they expect, rather than
8136 * blindly signing the hash.
8137 * The hrp is ascii bytes, while the invoice data is base32.
8139 * The secret key used to sign the invoice is dependent on the [`Recipient`].
8141 struct LDKCResult_RecoverableSignatureNoneZ (*sign_invoice)(const void *this_arg, struct LDKu8slice hrp_bytes, struct LDKCVec_u5Z invoice_data, enum LDKRecipient receipient);
8143 * Get secret key material as bytes for use in encrypting and decrypting inbound payment data.
8145 * If the implementor of this trait supports [phantom node payments], then every node that is
8146 * intended to be included in the phantom invoice route hints must return the same value from
8149 * This method must return the same value each time it is called.
8151 * [phantom node payments]: PhantomKeysManager
8153 struct LDKThirtyTwoBytes (*get_inbound_payment_key_material)(const void *this_arg);
8155 * Frees any resources associated with this object given its this_arg pointer.
8156 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
8158 void (*free)(void *this_arg);
8162 * A trait which should be implemented to provide feerate information on a number of time
8165 * Note that all of the functions implemented here *must* be reentrant-safe (obviously - they're
8166 * called from inside the library in response to chain events, P2P events, or timer events).
8168 typedef struct LDKFeeEstimator {
8170 * An opaque pointer which is passed to your function implementations as an argument.
8171 * This has no meaning in the LDK, and can be NULL or any other value.
8175 * Gets estimated satoshis of fee required per 1000 Weight-Units.
8177 * LDK will wrap this method and ensure that the value returned is no smaller than 253
8178 * (ie 1 satoshi-per-byte rounded up to ensure later round-downs don't put us below 1 satoshi-per-byte).
8180 * The following unit conversions can be used to convert to sats/KW:
8181 * * satoshis-per-byte * 250
8182 * * satoshis-per-kbyte / 4
8184 uint32_t (*get_est_sat_per_1000_weight)(const void *this_arg, enum LDKConfirmationTarget confirmation_target);
8186 * Frees any resources associated with this object given its this_arg pointer.
8187 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
8189 void (*free)(void *this_arg);
8195 * Manager which keeps track of a number of channels and sends messages to the appropriate
8196 * channel, also tracking HTLC preimages and forwarding onion packets appropriately.
8198 * Implements ChannelMessageHandler, handling the multi-channel parts and passing things through
8199 * to individual Channels.
8201 * Implements Writeable to write out all channel state to disk. Implies peer_disconnected() for
8202 * all peers during write/read (though does not modify this instance, only the instance being
8203 * serialized). This will result in any channels which have not yet exchanged funding_created (ie
8204 * called funding_transaction_generated for outbound channels).
8206 * Note that you can be a bit lazier about writing out ChannelManager than you can be with
8207 * ChannelMonitors. With ChannelMonitors you MUST write each monitor update out to disk before
8208 * returning from chain::Watch::watch_/update_channel, with ChannelManagers, writing updates
8209 * happens out-of-band (and will prevent any other ChannelManager operations from occurring during
8210 * the serialization process). If the deserialized version is out-of-date compared to the
8211 * ChannelMonitors passed by reference to read(), those channels will be force-closed based on the
8212 * ChannelMonitor state and no funds will be lost (mod on-chain transaction fees).
8214 * Note that the deserializer is only implemented for (BlockHash, ChannelManager), which
8215 * tells you the last block hash which was block_connect()ed. You MUST rescan any blocks along
8216 * the \"reorg path\" (ie call block_disconnected() until you get to a common block and then call
8217 * block_connected() to step towards your best block) upon deserialization before using the
8220 * Note that ChannelManager is responsible for tracking liveness of its channels and generating
8221 * ChannelUpdate messages informing peers that the channel is temporarily disabled. To avoid
8222 * spam due to quick disconnection/reconnection, updates are not sent until the channel has been
8223 * offline for a full minute. In order to track this, you must call
8224 * timer_tick_occurred roughly once per minute, though it doesn't have to be perfect.
8226 * Rather than using a plain ChannelManager, it is preferable to use either a SimpleArcChannelManager
8227 * a SimpleRefChannelManager, for conciseness. See their documentation for more details, but
8228 * essentially you should default to using a SimpleRefChannelManager, and use a
8229 * SimpleArcChannelManager when you require a ChannelManager with a static lifetime, such as when
8230 * you're using lightning-net-tokio.
8232 typedef struct MUST_USE_STRUCT LDKChannelManager {
8234 * A pointer to the opaque Rust object.
8235 * Nearly everywhere, inner must be non-null, however in places where
8236 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8238 LDKnativeChannelManager *inner;
8240 * Indicates that this is the only struct which contains the same pointer.
8241 * Rust functions which take ownership of an object provided via an argument require
8242 * this to be true and invalidate the object pointed to by inner.
8245 } LDKChannelManager;
8248 * A tuple of 2 elements. See the individual fields for the types contained.
8250 typedef struct LDKC2Tuple_BlockHashChannelManagerZ {
8252 * The element at position 0
8254 struct LDKThirtyTwoBytes a;
8256 * The element at position 1
8258 struct LDKChannelManager b;
8259 } LDKC2Tuple_BlockHashChannelManagerZ;
8262 * The contents of CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ
8264 typedef union LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZPtr {
8266 * A pointer to the contents in the success state.
8267 * Reading from this pointer when `result_ok` is not set is undefined.
8269 struct LDKC2Tuple_BlockHashChannelManagerZ *result;
8271 * A pointer to the contents in the error state.
8272 * Reading from this pointer when `result_ok` is set is undefined.
8274 struct LDKDecodeError *err;
8275 } LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZPtr;
8278 * A CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ represents the result of a fallible operation,
8279 * containing a crate::c_types::derived::C2Tuple_BlockHashChannelManagerZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
8280 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8282 typedef struct LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ {
8284 * The contents of this CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ, accessible via either
8285 * `err` or `result` depending on the state of `result_ok`.
8287 union LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZPtr contents;
8289 * Whether this CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ represents a success state.
8292 } LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ;
8297 * Options which apply on a per-channel basis and may change at runtime or based on negotiation
8298 * with our counterparty.
8300 typedef struct MUST_USE_STRUCT LDKChannelConfig {
8302 * A pointer to the opaque Rust object.
8303 * Nearly everywhere, inner must be non-null, however in places where
8304 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8306 LDKnativeChannelConfig *inner;
8308 * Indicates that this is the only struct which contains the same pointer.
8309 * Rust functions which take ownership of an object provided via an argument require
8310 * this to be true and invalidate the object pointed to by inner.
8316 * The contents of CResult_ChannelConfigDecodeErrorZ
8318 typedef union LDKCResult_ChannelConfigDecodeErrorZPtr {
8320 * A pointer to the contents in the success state.
8321 * Reading from this pointer when `result_ok` is not set is undefined.
8323 struct LDKChannelConfig *result;
8325 * A pointer to the contents in the error state.
8326 * Reading from this pointer when `result_ok` is set is undefined.
8328 struct LDKDecodeError *err;
8329 } LDKCResult_ChannelConfigDecodeErrorZPtr;
8332 * A CResult_ChannelConfigDecodeErrorZ represents the result of a fallible operation,
8333 * containing a crate::lightning::util::config::ChannelConfig on success and a crate::lightning::ln::msgs::DecodeError on failure.
8334 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8336 typedef struct LDKCResult_ChannelConfigDecodeErrorZ {
8338 * The contents of this CResult_ChannelConfigDecodeErrorZ, accessible via either
8339 * `err` or `result` depending on the state of `result_ok`.
8341 union LDKCResult_ChannelConfigDecodeErrorZPtr contents;
8343 * Whether this CResult_ChannelConfigDecodeErrorZ represents a success state.
8346 } LDKCResult_ChannelConfigDecodeErrorZ;
8349 * The contents of CResult_OutPointDecodeErrorZ
8351 typedef union LDKCResult_OutPointDecodeErrorZPtr {
8353 * A pointer to the contents in the success state.
8354 * Reading from this pointer when `result_ok` is not set is undefined.
8356 struct LDKOutPoint *result;
8358 * A pointer to the contents in the error state.
8359 * Reading from this pointer when `result_ok` is set is undefined.
8361 struct LDKDecodeError *err;
8362 } LDKCResult_OutPointDecodeErrorZPtr;
8365 * A CResult_OutPointDecodeErrorZ represents the result of a fallible operation,
8366 * containing a crate::lightning::chain::transaction::OutPoint on success and a crate::lightning::ln::msgs::DecodeError on failure.
8367 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8369 typedef struct LDKCResult_OutPointDecodeErrorZ {
8371 * The contents of this CResult_OutPointDecodeErrorZ, accessible via either
8372 * `err` or `result` depending on the state of `result_ok`.
8374 union LDKCResult_OutPointDecodeErrorZPtr contents;
8376 * Whether this CResult_OutPointDecodeErrorZ represents a success state.
8379 } LDKCResult_OutPointDecodeErrorZ;
8382 * Defines a type identifier for sending messages over the wire.
8384 * Messages implementing this trait specify a type and must be [`Writeable`].
8386 typedef struct LDKType {
8388 * An opaque pointer which is passed to your function implementations as an argument.
8389 * This has no meaning in the LDK, and can be NULL or any other value.
8393 * Returns the type identifying the message payload.
8395 uint16_t (*type_id)(const void *this_arg);
8397 * Return a human-readable "debug" string describing this object
8399 struct LDKStr (*debug_str)(const void *this_arg);
8401 * Serialize the object into a byte array
8403 struct LDKCVec_u8Z (*write)(const void *this_arg);
8405 * Frees any resources associated with this object given its this_arg pointer.
8406 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
8408 void (*free)(void *this_arg);
8412 * An enum which can either contain a crate::lightning::ln::wire::Type or not
8414 typedef enum LDKCOption_TypeZ_Tag {
8416 * When we're in this state, this COption_TypeZ contains a crate::lightning::ln::wire::Type
8418 LDKCOption_TypeZ_Some,
8420 * When we're in this state, this COption_TypeZ contains nothing
8422 LDKCOption_TypeZ_None,
8424 * Must be last for serialization purposes
8426 LDKCOption_TypeZ_Sentinel,
8427 } LDKCOption_TypeZ_Tag;
8429 typedef struct LDKCOption_TypeZ {
8430 LDKCOption_TypeZ_Tag tag;
8433 struct LDKType some;
8439 * The contents of CResult_COption_TypeZDecodeErrorZ
8441 typedef union LDKCResult_COption_TypeZDecodeErrorZPtr {
8443 * A pointer to the contents in the success state.
8444 * Reading from this pointer when `result_ok` is not set is undefined.
8446 struct LDKCOption_TypeZ *result;
8448 * A pointer to the contents in the error state.
8449 * Reading from this pointer when `result_ok` is set is undefined.
8451 struct LDKDecodeError *err;
8452 } LDKCResult_COption_TypeZDecodeErrorZPtr;
8455 * A CResult_COption_TypeZDecodeErrorZ represents the result of a fallible operation,
8456 * containing a crate::c_types::derived::COption_TypeZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
8457 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8459 typedef struct LDKCResult_COption_TypeZDecodeErrorZ {
8461 * The contents of this CResult_COption_TypeZDecodeErrorZ, accessible via either
8462 * `err` or `result` depending on the state of `result_ok`.
8464 union LDKCResult_COption_TypeZDecodeErrorZPtr contents;
8466 * Whether this CResult_COption_TypeZDecodeErrorZ represents a success state.
8469 } LDKCResult_COption_TypeZDecodeErrorZ;
8472 * An error that may occur when making a payment.
8474 typedef enum LDKPaymentError_Tag {
8476 * An error resulting from the provided [`Invoice`] or payment hash.
8478 LDKPaymentError_Invoice,
8480 * An error occurring when finding a route.
8482 LDKPaymentError_Routing,
8484 * An error occurring when sending a payment.
8486 LDKPaymentError_Sending,
8488 * Must be last for serialization purposes
8490 LDKPaymentError_Sentinel,
8491 } LDKPaymentError_Tag;
8493 typedef struct MUST_USE_STRUCT LDKPaymentError {
8494 LDKPaymentError_Tag tag;
8497 struct LDKStr invoice;
8500 struct LDKLightningError routing;
8503 struct LDKPaymentSendFailure sending;
8509 * The contents of CResult_PaymentIdPaymentErrorZ
8511 typedef union LDKCResult_PaymentIdPaymentErrorZPtr {
8513 * A pointer to the contents in the success state.
8514 * Reading from this pointer when `result_ok` is not set is undefined.
8516 struct LDKThirtyTwoBytes *result;
8518 * A pointer to the contents in the error state.
8519 * Reading from this pointer when `result_ok` is set is undefined.
8521 struct LDKPaymentError *err;
8522 } LDKCResult_PaymentIdPaymentErrorZPtr;
8525 * A CResult_PaymentIdPaymentErrorZ represents the result of a fallible operation,
8526 * containing a crate::c_types::ThirtyTwoBytes on success and a crate::lightning_invoice::payment::PaymentError on failure.
8527 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8529 typedef struct LDKCResult_PaymentIdPaymentErrorZ {
8531 * The contents of this CResult_PaymentIdPaymentErrorZ, accessible via either
8532 * `err` or `result` depending on the state of `result_ok`.
8534 union LDKCResult_PaymentIdPaymentErrorZPtr contents;
8536 * Whether this CResult_PaymentIdPaymentErrorZ represents a success state.
8539 } LDKCResult_PaymentIdPaymentErrorZ;
8544 * A map with liquidity value (in msat) keyed by a short channel id and the direction the HTLC
8545 * is traveling in. The direction boolean is determined by checking if the HTLC source's public
8546 * key is less than its destination. See [`InFlightHtlcs::used_liquidity_msat`] for more
8549 typedef struct MUST_USE_STRUCT LDKInFlightHtlcs {
8551 * A pointer to the opaque Rust object.
8552 * Nearly everywhere, inner must be non-null, however in places where
8553 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8555 LDKnativeInFlightHtlcs *inner;
8557 * Indicates that this is the only struct which contains the same pointer.
8558 * Rust functions which take ownership of an object provided via an argument require
8559 * this to be true and invalidate the object pointed to by inner.
8565 * The contents of CResult_InFlightHtlcsDecodeErrorZ
8567 typedef union LDKCResult_InFlightHtlcsDecodeErrorZPtr {
8569 * A pointer to the contents in the success state.
8570 * Reading from this pointer when `result_ok` is not set is undefined.
8572 struct LDKInFlightHtlcs *result;
8574 * A pointer to the contents in the error state.
8575 * Reading from this pointer when `result_ok` is set is undefined.
8577 struct LDKDecodeError *err;
8578 } LDKCResult_InFlightHtlcsDecodeErrorZPtr;
8581 * A CResult_InFlightHtlcsDecodeErrorZ represents the result of a fallible operation,
8582 * containing a crate::lightning_invoice::payment::InFlightHtlcs on success and a crate::lightning::ln::msgs::DecodeError on failure.
8583 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8585 typedef struct LDKCResult_InFlightHtlcsDecodeErrorZ {
8587 * The contents of this CResult_InFlightHtlcsDecodeErrorZ, accessible via either
8588 * `err` or `result` depending on the state of `result_ok`.
8590 union LDKCResult_InFlightHtlcsDecodeErrorZPtr contents;
8592 * Whether this CResult_InFlightHtlcsDecodeErrorZ represents a success state.
8595 } LDKCResult_InFlightHtlcsDecodeErrorZ;
8598 * Sub-errors which don't have specific information in them use this type.
8600 typedef struct LDKError {
8602 * Zero-Sized_types aren't consistent across Rust/C/C++, so we add some size here
8608 * Errors that indicate what is wrong with the invoice. They have some granularity for debug
8609 * reasons, but should generally result in an \"invalid BOLT11 invoice\" message for the user.
8611 typedef enum LDKParseError_Tag {
8612 LDKParseError_Bech32Error,
8613 LDKParseError_ParseAmountError,
8614 LDKParseError_MalformedSignature,
8615 LDKParseError_BadPrefix,
8616 LDKParseError_UnknownCurrency,
8617 LDKParseError_UnknownSiPrefix,
8618 LDKParseError_MalformedHRP,
8619 LDKParseError_TooShortDataPart,
8620 LDKParseError_UnexpectedEndOfTaggedFields,
8621 LDKParseError_DescriptionDecodeError,
8622 LDKParseError_PaddingError,
8623 LDKParseError_IntegerOverflowError,
8624 LDKParseError_InvalidSegWitProgramLength,
8625 LDKParseError_InvalidPubKeyHashLength,
8626 LDKParseError_InvalidScriptHashLength,
8627 LDKParseError_InvalidRecoveryId,
8628 LDKParseError_InvalidSliceLength,
8630 * Not an error, but used internally to signal that a part of the invoice should be ignored
8631 * according to BOLT11
8635 * Must be last for serialization purposes
8637 LDKParseError_Sentinel,
8638 } LDKParseError_Tag;
8640 typedef struct MUST_USE_STRUCT LDKParseError {
8641 LDKParseError_Tag tag;
8644 struct LDKBech32Error bech32_error;
8647 struct LDKError parse_amount_error;
8650 enum LDKSecp256k1Error malformed_signature;
8653 struct LDKError description_decode_error;
8656 struct LDKStr invalid_slice_length;
8662 * The contents of CResult_SiPrefixParseErrorZ
8664 typedef union LDKCResult_SiPrefixParseErrorZPtr {
8666 * A pointer to the contents in the success state.
8667 * Reading from this pointer when `result_ok` is not set is undefined.
8669 enum LDKSiPrefix *result;
8671 * A pointer to the contents in the error state.
8672 * Reading from this pointer when `result_ok` is set is undefined.
8674 struct LDKParseError *err;
8675 } LDKCResult_SiPrefixParseErrorZPtr;
8678 * A CResult_SiPrefixParseErrorZ represents the result of a fallible operation,
8679 * containing a crate::lightning_invoice::SiPrefix on success and a crate::lightning_invoice::ParseError on failure.
8680 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8682 typedef struct LDKCResult_SiPrefixParseErrorZ {
8684 * The contents of this CResult_SiPrefixParseErrorZ, accessible via either
8685 * `err` or `result` depending on the state of `result_ok`.
8687 union LDKCResult_SiPrefixParseErrorZPtr contents;
8689 * Whether this CResult_SiPrefixParseErrorZ represents a success state.
8692 } LDKCResult_SiPrefixParseErrorZ;
8697 * Represents a syntactically and semantically correct lightning BOLT11 invoice.
8699 * There are three ways to construct an `Invoice`:
8700 * 1. using `InvoiceBuilder`
8701 * 2. using `Invoice::from_signed(SignedRawInvoice)`
8702 * 3. using `str::parse::<Invoice>(&str)`
8704 typedef struct MUST_USE_STRUCT LDKInvoice {
8706 * A pointer to the opaque Rust object.
8707 * Nearly everywhere, inner must be non-null, however in places where
8708 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8710 LDKnativeInvoice *inner;
8712 * Indicates that this is the only struct which contains the same pointer.
8713 * Rust functions which take ownership of an object provided via an argument require
8714 * this to be true and invalidate the object pointed to by inner.
8720 * Indicates that something went wrong while parsing or validating the invoice. Parsing errors
8721 * should be mostly seen as opaque and are only there for debugging reasons. Semantic errors
8722 * like wrong signatures, missing fields etc. could mean that someone tampered with the invoice.
8724 typedef enum LDKParseOrSemanticError_Tag {
8726 * The invoice couldn't be decoded
8728 LDKParseOrSemanticError_ParseError,
8730 * The invoice could be decoded but violates the BOLT11 standard
8732 LDKParseOrSemanticError_SemanticError,
8734 * Must be last for serialization purposes
8736 LDKParseOrSemanticError_Sentinel,
8737 } LDKParseOrSemanticError_Tag;
8739 typedef struct MUST_USE_STRUCT LDKParseOrSemanticError {
8740 LDKParseOrSemanticError_Tag tag;
8743 struct LDKParseError parse_error;
8746 enum LDKSemanticError semantic_error;
8749 } LDKParseOrSemanticError;
8752 * The contents of CResult_InvoiceParseOrSemanticErrorZ
8754 typedef union LDKCResult_InvoiceParseOrSemanticErrorZPtr {
8756 * A pointer to the contents in the success state.
8757 * Reading from this pointer when `result_ok` is not set is undefined.
8759 struct LDKInvoice *result;
8761 * A pointer to the contents in the error state.
8762 * Reading from this pointer when `result_ok` is set is undefined.
8764 struct LDKParseOrSemanticError *err;
8765 } LDKCResult_InvoiceParseOrSemanticErrorZPtr;
8768 * A CResult_InvoiceParseOrSemanticErrorZ represents the result of a fallible operation,
8769 * containing a crate::lightning_invoice::Invoice on success and a crate::lightning_invoice::ParseOrSemanticError on failure.
8770 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8772 typedef struct LDKCResult_InvoiceParseOrSemanticErrorZ {
8774 * The contents of this CResult_InvoiceParseOrSemanticErrorZ, accessible via either
8775 * `err` or `result` depending on the state of `result_ok`.
8777 union LDKCResult_InvoiceParseOrSemanticErrorZPtr contents;
8779 * Whether this CResult_InvoiceParseOrSemanticErrorZ represents a success state.
8782 } LDKCResult_InvoiceParseOrSemanticErrorZ;
8787 * Represents a signed `RawInvoice` with cached hash. The signature is not checked and may be
8791 * The hash has to be either from the deserialized invoice or from the serialized `raw_invoice`.
8793 typedef struct MUST_USE_STRUCT LDKSignedRawInvoice {
8795 * A pointer to the opaque Rust object.
8796 * Nearly everywhere, inner must be non-null, however in places where
8797 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8799 LDKnativeSignedRawInvoice *inner;
8801 * Indicates that this is the only struct which contains the same pointer.
8802 * Rust functions which take ownership of an object provided via an argument require
8803 * this to be true and invalidate the object pointed to by inner.
8806 } LDKSignedRawInvoice;
8809 * The contents of CResult_SignedRawInvoiceParseErrorZ
8811 typedef union LDKCResult_SignedRawInvoiceParseErrorZPtr {
8813 * A pointer to the contents in the success state.
8814 * Reading from this pointer when `result_ok` is not set is undefined.
8816 struct LDKSignedRawInvoice *result;
8818 * A pointer to the contents in the error state.
8819 * Reading from this pointer when `result_ok` is set is undefined.
8821 struct LDKParseError *err;
8822 } LDKCResult_SignedRawInvoiceParseErrorZPtr;
8825 * A CResult_SignedRawInvoiceParseErrorZ represents the result of a fallible operation,
8826 * containing a crate::lightning_invoice::SignedRawInvoice on success and a crate::lightning_invoice::ParseError on failure.
8827 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8829 typedef struct LDKCResult_SignedRawInvoiceParseErrorZ {
8831 * The contents of this CResult_SignedRawInvoiceParseErrorZ, accessible via either
8832 * `err` or `result` depending on the state of `result_ok`.
8834 union LDKCResult_SignedRawInvoiceParseErrorZPtr contents;
8836 * Whether this CResult_SignedRawInvoiceParseErrorZ represents a success state.
8839 } LDKCResult_SignedRawInvoiceParseErrorZ;
8844 * Represents an syntactically correct Invoice for a payment on the lightning network,
8845 * but without the signature information.
8846 * De- and encoding should not lead to information loss but may lead to different hashes.
8848 * For methods without docs see the corresponding methods in `Invoice`.
8850 typedef struct MUST_USE_STRUCT LDKRawInvoice {
8852 * A pointer to the opaque Rust object.
8853 * Nearly everywhere, inner must be non-null, however in places where
8854 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8856 LDKnativeRawInvoice *inner;
8858 * Indicates that this is the only struct which contains the same pointer.
8859 * Rust functions which take ownership of an object provided via an argument require
8860 * this to be true and invalidate the object pointed to by inner.
8868 * Recoverable signature
8870 typedef struct MUST_USE_STRUCT LDKInvoiceSignature {
8872 * A pointer to the opaque Rust object.
8873 * Nearly everywhere, inner must be non-null, however in places where
8874 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8876 LDKnativeInvoiceSignature *inner;
8878 * Indicates that this is the only struct which contains the same pointer.
8879 * Rust functions which take ownership of an object provided via an argument require
8880 * this to be true and invalidate the object pointed to by inner.
8883 } LDKInvoiceSignature;
8886 * A tuple of 3 elements. See the individual fields for the types contained.
8888 typedef struct LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ {
8890 * The element at position 0
8892 struct LDKRawInvoice a;
8894 * The element at position 1
8896 struct LDKThirtyTwoBytes b;
8898 * The element at position 2
8900 struct LDKInvoiceSignature c;
8901 } LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ;
8908 typedef struct MUST_USE_STRUCT LDKPayeePubKey {
8910 * A pointer to the opaque Rust object.
8911 * Nearly everywhere, inner must be non-null, however in places where
8912 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8914 LDKnativePayeePubKey *inner;
8916 * Indicates that this is the only struct which contains the same pointer.
8917 * Rust functions which take ownership of an object provided via an argument require
8918 * this to be true and invalidate the object pointed to by inner.
8924 * The contents of CResult_PayeePubKeyErrorZ
8926 typedef union LDKCResult_PayeePubKeyErrorZPtr {
8928 * A pointer to the contents in the success state.
8929 * Reading from this pointer when `result_ok` is not set is undefined.
8931 struct LDKPayeePubKey *result;
8933 * A pointer to the contents in the error state.
8934 * Reading from this pointer when `result_ok` is set is undefined.
8936 enum LDKSecp256k1Error *err;
8937 } LDKCResult_PayeePubKeyErrorZPtr;
8940 * A CResult_PayeePubKeyErrorZ represents the result of a fallible operation,
8941 * containing a crate::lightning_invoice::PayeePubKey on success and a crate::c_types::Secp256k1Error on failure.
8942 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8944 typedef struct LDKCResult_PayeePubKeyErrorZ {
8946 * The contents of this CResult_PayeePubKeyErrorZ, accessible via either
8947 * `err` or `result` depending on the state of `result_ok`.
8949 union LDKCResult_PayeePubKeyErrorZPtr contents;
8951 * Whether this CResult_PayeePubKeyErrorZ represents a success state.
8954 } LDKCResult_PayeePubKeyErrorZ;
8959 * Private routing information
8962 * The encoded route has to be <1024 5bit characters long (<=639 bytes or <=12 hops)
8965 typedef struct MUST_USE_STRUCT LDKPrivateRoute {
8967 * A pointer to the opaque Rust object.
8968 * Nearly everywhere, inner must be non-null, however in places where
8969 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8971 LDKnativePrivateRoute *inner;
8973 * Indicates that this is the only struct which contains the same pointer.
8974 * Rust functions which take ownership of an object provided via an argument require
8975 * this to be true and invalidate the object pointed to by inner.
8981 * A dynamically-allocated array of crate::lightning_invoice::PrivateRoutes of arbitrary size.
8982 * This corresponds to std::vector in C++
8984 typedef struct LDKCVec_PrivateRouteZ {
8986 * The elements in the array.
8987 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
8989 struct LDKPrivateRoute *data;
8991 * The number of elements pointed to by `data`.
8994 } LDKCVec_PrivateRouteZ;
8999 * A timestamp that refers to a date after 1 January 1970.
9003 * The Unix timestamp representing the stored time has to be positive and no greater than
9004 * [`MAX_TIMESTAMP`].
9006 typedef struct MUST_USE_STRUCT LDKPositiveTimestamp {
9008 * A pointer to the opaque Rust object.
9009 * Nearly everywhere, inner must be non-null, however in places where
9010 * the Rust equivalent takes an Option, it may be set to null to indicate None.
9012 LDKnativePositiveTimestamp *inner;
9014 * Indicates that this is the only struct which contains the same pointer.
9015 * Rust functions which take ownership of an object provided via an argument require
9016 * this to be true and invalidate the object pointed to by inner.
9019 } LDKPositiveTimestamp;
9022 * The contents of CResult_PositiveTimestampCreationErrorZ
9024 typedef union LDKCResult_PositiveTimestampCreationErrorZPtr {
9026 * A pointer to the contents in the success state.
9027 * Reading from this pointer when `result_ok` is not set is undefined.
9029 struct LDKPositiveTimestamp *result;
9031 * A pointer to the contents in the error state.
9032 * Reading from this pointer when `result_ok` is set is undefined.
9034 enum LDKCreationError *err;
9035 } LDKCResult_PositiveTimestampCreationErrorZPtr;
9038 * A CResult_PositiveTimestampCreationErrorZ represents the result of a fallible operation,
9039 * containing a crate::lightning_invoice::PositiveTimestamp on success and a crate::lightning_invoice::CreationError on failure.
9040 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9042 typedef struct LDKCResult_PositiveTimestampCreationErrorZ {
9044 * The contents of this CResult_PositiveTimestampCreationErrorZ, accessible via either
9045 * `err` or `result` depending on the state of `result_ok`.
9047 union LDKCResult_PositiveTimestampCreationErrorZPtr contents;
9049 * Whether this CResult_PositiveTimestampCreationErrorZ represents a success state.
9052 } LDKCResult_PositiveTimestampCreationErrorZ;
9055 * The contents of CResult_NoneSemanticErrorZ
9057 typedef union LDKCResult_NoneSemanticErrorZPtr {
9059 * Note that this value is always NULL, as there are no contents in the OK variant
9063 * A pointer to the contents in the error state.
9064 * Reading from this pointer when `result_ok` is set is undefined.
9066 enum LDKSemanticError *err;
9067 } LDKCResult_NoneSemanticErrorZPtr;
9070 * A CResult_NoneSemanticErrorZ represents the result of a fallible operation,
9071 * containing a () on success and a crate::lightning_invoice::SemanticError on failure.
9072 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9074 typedef struct LDKCResult_NoneSemanticErrorZ {
9076 * The contents of this CResult_NoneSemanticErrorZ, accessible via either
9077 * `err` or `result` depending on the state of `result_ok`.
9079 union LDKCResult_NoneSemanticErrorZPtr contents;
9081 * Whether this CResult_NoneSemanticErrorZ represents a success state.
9084 } LDKCResult_NoneSemanticErrorZ;
9087 * The contents of CResult_InvoiceSemanticErrorZ
9089 typedef union LDKCResult_InvoiceSemanticErrorZPtr {
9091 * A pointer to the contents in the success state.
9092 * Reading from this pointer when `result_ok` is not set is undefined.
9094 struct LDKInvoice *result;
9096 * A pointer to the contents in the error state.
9097 * Reading from this pointer when `result_ok` is set is undefined.
9099 enum LDKSemanticError *err;
9100 } LDKCResult_InvoiceSemanticErrorZPtr;
9103 * A CResult_InvoiceSemanticErrorZ represents the result of a fallible operation,
9104 * containing a crate::lightning_invoice::Invoice on success and a crate::lightning_invoice::SemanticError on failure.
9105 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9107 typedef struct LDKCResult_InvoiceSemanticErrorZ {
9109 * The contents of this CResult_InvoiceSemanticErrorZ, accessible via either
9110 * `err` or `result` depending on the state of `result_ok`.
9112 union LDKCResult_InvoiceSemanticErrorZPtr contents;
9114 * Whether this CResult_InvoiceSemanticErrorZ represents a success state.
9117 } LDKCResult_InvoiceSemanticErrorZ;
9122 * Description string
9125 * The description can be at most 639 __bytes__ long
9127 typedef struct MUST_USE_STRUCT LDKDescription {
9129 * A pointer to the opaque Rust object.
9130 * Nearly everywhere, inner must be non-null, however in places where
9131 * the Rust equivalent takes an Option, it may be set to null to indicate None.
9133 LDKnativeDescription *inner;
9135 * Indicates that this is the only struct which contains the same pointer.
9136 * Rust functions which take ownership of an object provided via an argument require
9137 * this to be true and invalidate the object pointed to by inner.
9143 * The contents of CResult_DescriptionCreationErrorZ
9145 typedef union LDKCResult_DescriptionCreationErrorZPtr {
9147 * A pointer to the contents in the success state.
9148 * Reading from this pointer when `result_ok` is not set is undefined.
9150 struct LDKDescription *result;
9152 * A pointer to the contents in the error state.
9153 * Reading from this pointer when `result_ok` is set is undefined.
9155 enum LDKCreationError *err;
9156 } LDKCResult_DescriptionCreationErrorZPtr;
9159 * A CResult_DescriptionCreationErrorZ represents the result of a fallible operation,
9160 * containing a crate::lightning_invoice::Description on success and a crate::lightning_invoice::CreationError on failure.
9161 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9163 typedef struct LDKCResult_DescriptionCreationErrorZ {
9165 * The contents of this CResult_DescriptionCreationErrorZ, accessible via either
9166 * `err` or `result` depending on the state of `result_ok`.
9168 union LDKCResult_DescriptionCreationErrorZPtr contents;
9170 * Whether this CResult_DescriptionCreationErrorZ represents a success state.
9173 } LDKCResult_DescriptionCreationErrorZ;
9176 * The contents of CResult_PrivateRouteCreationErrorZ
9178 typedef union LDKCResult_PrivateRouteCreationErrorZPtr {
9180 * A pointer to the contents in the success state.
9181 * Reading from this pointer when `result_ok` is not set is undefined.
9183 struct LDKPrivateRoute *result;
9185 * A pointer to the contents in the error state.
9186 * Reading from this pointer when `result_ok` is set is undefined.
9188 enum LDKCreationError *err;
9189 } LDKCResult_PrivateRouteCreationErrorZPtr;
9192 * A CResult_PrivateRouteCreationErrorZ represents the result of a fallible operation,
9193 * containing a crate::lightning_invoice::PrivateRoute on success and a crate::lightning_invoice::CreationError on failure.
9194 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9196 typedef struct LDKCResult_PrivateRouteCreationErrorZ {
9198 * The contents of this CResult_PrivateRouteCreationErrorZ, accessible via either
9199 * `err` or `result` depending on the state of `result_ok`.
9201 union LDKCResult_PrivateRouteCreationErrorZPtr contents;
9203 * Whether this CResult_PrivateRouteCreationErrorZ represents a success state.
9206 } LDKCResult_PrivateRouteCreationErrorZ;
9209 * The contents of CResult_StringErrorZ
9211 typedef union LDKCResult_StringErrorZPtr {
9213 * A pointer to the contents in the success state.
9214 * Reading from this pointer when `result_ok` is not set is undefined.
9216 struct LDKStr *result;
9218 * A pointer to the contents in the error state.
9219 * Reading from this pointer when `result_ok` is set is undefined.
9221 enum LDKSecp256k1Error *err;
9222 } LDKCResult_StringErrorZPtr;
9225 * A CResult_StringErrorZ represents the result of a fallible operation,
9226 * containing a crate::c_types::Str on success and a crate::c_types::Secp256k1Error on failure.
9227 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9229 typedef struct LDKCResult_StringErrorZ {
9231 * The contents of this CResult_StringErrorZ, accessible via either
9232 * `err` or `result` depending on the state of `result_ok`.
9234 union LDKCResult_StringErrorZPtr contents;
9236 * Whether this CResult_StringErrorZ represents a success state.
9239 } LDKCResult_StringErrorZ;
9242 * The contents of CResult_ChannelMonitorUpdateDecodeErrorZ
9244 typedef union LDKCResult_ChannelMonitorUpdateDecodeErrorZPtr {
9246 * A pointer to the contents in the success state.
9247 * Reading from this pointer when `result_ok` is not set is undefined.
9249 struct LDKChannelMonitorUpdate *result;
9251 * A pointer to the contents in the error state.
9252 * Reading from this pointer when `result_ok` is set is undefined.
9254 struct LDKDecodeError *err;
9255 } LDKCResult_ChannelMonitorUpdateDecodeErrorZPtr;
9258 * A CResult_ChannelMonitorUpdateDecodeErrorZ represents the result of a fallible operation,
9259 * containing a crate::lightning::chain::channelmonitor::ChannelMonitorUpdate on success and a crate::lightning::ln::msgs::DecodeError on failure.
9260 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9262 typedef struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ {
9264 * The contents of this CResult_ChannelMonitorUpdateDecodeErrorZ, accessible via either
9265 * `err` or `result` depending on the state of `result_ok`.
9267 union LDKCResult_ChannelMonitorUpdateDecodeErrorZPtr contents;
9269 * Whether this CResult_ChannelMonitorUpdateDecodeErrorZ represents a success state.
9272 } LDKCResult_ChannelMonitorUpdateDecodeErrorZ;
9275 * An enum which can either contain a crate::lightning::chain::channelmonitor::MonitorEvent or not
9277 typedef enum LDKCOption_MonitorEventZ_Tag {
9279 * When we're in this state, this COption_MonitorEventZ contains a crate::lightning::chain::channelmonitor::MonitorEvent
9281 LDKCOption_MonitorEventZ_Some,
9283 * When we're in this state, this COption_MonitorEventZ contains nothing
9285 LDKCOption_MonitorEventZ_None,
9287 * Must be last for serialization purposes
9289 LDKCOption_MonitorEventZ_Sentinel,
9290 } LDKCOption_MonitorEventZ_Tag;
9292 typedef struct LDKCOption_MonitorEventZ {
9293 LDKCOption_MonitorEventZ_Tag tag;
9296 struct LDKMonitorEvent some;
9299 } LDKCOption_MonitorEventZ;
9302 * The contents of CResult_COption_MonitorEventZDecodeErrorZ
9304 typedef union LDKCResult_COption_MonitorEventZDecodeErrorZPtr {
9306 * A pointer to the contents in the success state.
9307 * Reading from this pointer when `result_ok` is not set is undefined.
9309 struct LDKCOption_MonitorEventZ *result;
9311 * A pointer to the contents in the error state.
9312 * Reading from this pointer when `result_ok` is set is undefined.
9314 struct LDKDecodeError *err;
9315 } LDKCResult_COption_MonitorEventZDecodeErrorZPtr;
9318 * A CResult_COption_MonitorEventZDecodeErrorZ represents the result of a fallible operation,
9319 * containing a crate::c_types::derived::COption_MonitorEventZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
9320 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9322 typedef struct LDKCResult_COption_MonitorEventZDecodeErrorZ {
9324 * The contents of this CResult_COption_MonitorEventZDecodeErrorZ, accessible via either
9325 * `err` or `result` depending on the state of `result_ok`.
9327 union LDKCResult_COption_MonitorEventZDecodeErrorZPtr contents;
9329 * Whether this CResult_COption_MonitorEventZDecodeErrorZ represents a success state.
9332 } LDKCResult_COption_MonitorEventZDecodeErrorZ;
9335 * The contents of CResult_HTLCUpdateDecodeErrorZ
9337 typedef union LDKCResult_HTLCUpdateDecodeErrorZPtr {
9339 * A pointer to the contents in the success state.
9340 * Reading from this pointer when `result_ok` is not set is undefined.
9342 struct LDKHTLCUpdate *result;
9344 * A pointer to the contents in the error state.
9345 * Reading from this pointer when `result_ok` is set is undefined.
9347 struct LDKDecodeError *err;
9348 } LDKCResult_HTLCUpdateDecodeErrorZPtr;
9351 * A CResult_HTLCUpdateDecodeErrorZ represents the result of a fallible operation,
9352 * containing a crate::lightning::chain::channelmonitor::HTLCUpdate on success and a crate::lightning::ln::msgs::DecodeError on failure.
9353 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9355 typedef struct LDKCResult_HTLCUpdateDecodeErrorZ {
9357 * The contents of this CResult_HTLCUpdateDecodeErrorZ, accessible via either
9358 * `err` or `result` depending on the state of `result_ok`.
9360 union LDKCResult_HTLCUpdateDecodeErrorZPtr contents;
9362 * Whether this CResult_HTLCUpdateDecodeErrorZ represents a success state.
9365 } LDKCResult_HTLCUpdateDecodeErrorZ;
9368 * A tuple of 2 elements. See the individual fields for the types contained.
9370 typedef struct LDKC2Tuple_OutPointScriptZ {
9372 * The element at position 0
9374 struct LDKOutPoint a;
9376 * The element at position 1
9378 struct LDKCVec_u8Z b;
9379 } LDKC2Tuple_OutPointScriptZ;
9382 * A tuple of 2 elements. See the individual fields for the types contained.
9384 typedef struct LDKC2Tuple_u32ScriptZ {
9386 * The element at position 0
9390 * The element at position 1
9392 struct LDKCVec_u8Z b;
9393 } LDKC2Tuple_u32ScriptZ;
9396 * A dynamically-allocated array of crate::c_types::derived::C2Tuple_u32ScriptZs of arbitrary size.
9397 * This corresponds to std::vector in C++
9399 typedef struct LDKCVec_C2Tuple_u32ScriptZZ {
9401 * The elements in the array.
9402 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
9404 struct LDKC2Tuple_u32ScriptZ *data;
9406 * The number of elements pointed to by `data`.
9409 } LDKCVec_C2Tuple_u32ScriptZZ;
9412 * A tuple of 2 elements. See the individual fields for the types contained.
9414 typedef struct LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ {
9416 * The element at position 0
9418 struct LDKThirtyTwoBytes a;
9420 * The element at position 1
9422 struct LDKCVec_C2Tuple_u32ScriptZZ b;
9423 } LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ;
9426 * A dynamically-allocated array of crate::c_types::derived::C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZs of arbitrary size.
9427 * This corresponds to std::vector in C++
9429 typedef struct LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ {
9431 * The elements in the array.
9432 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
9434 struct LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ *data;
9436 * The number of elements pointed to by `data`.
9439 } LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ;
9442 * A dynamically-allocated array of crate::lightning::util::events::Events of arbitrary size.
9443 * This corresponds to std::vector in C++
9445 typedef struct LDKCVec_EventZ {
9447 * The elements in the array.
9448 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
9450 struct LDKEvent *data;
9452 * The number of elements pointed to by `data`.
9458 * A dynamically-allocated array of crate::c_types::Transactions of arbitrary size.
9459 * This corresponds to std::vector in C++
9461 typedef struct LDKCVec_TransactionZ {
9463 * The elements in the array.
9464 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
9466 struct LDKTransaction *data;
9468 * The number of elements pointed to by `data`.
9471 } LDKCVec_TransactionZ;
9474 * A tuple of 2 elements. See the individual fields for the types contained.
9476 typedef struct LDKC2Tuple_u32TxOutZ {
9478 * The element at position 0
9482 * The element at position 1
9485 } LDKC2Tuple_u32TxOutZ;
9488 * A dynamically-allocated array of crate::c_types::derived::C2Tuple_u32TxOutZs of arbitrary size.
9489 * This corresponds to std::vector in C++
9491 typedef struct LDKCVec_C2Tuple_u32TxOutZZ {
9493 * The elements in the array.
9494 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
9496 struct LDKC2Tuple_u32TxOutZ *data;
9498 * The number of elements pointed to by `data`.
9501 } LDKCVec_C2Tuple_u32TxOutZZ;
9504 * A tuple of 2 elements. See the individual fields for the types contained.
9506 typedef struct LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ {
9508 * The element at position 0
9510 struct LDKThirtyTwoBytes a;
9512 * The element at position 1
9514 struct LDKCVec_C2Tuple_u32TxOutZZ b;
9515 } LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ;
9518 * A dynamically-allocated array of crate::c_types::derived::C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZs of arbitrary size.
9519 * This corresponds to std::vector in C++
9521 typedef struct LDKCVec_TransactionOutputsZ {
9523 * The elements in the array.
9524 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
9526 struct LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ *data;
9528 * The number of elements pointed to by `data`.
9531 } LDKCVec_TransactionOutputsZ;
9534 * Details about the balance(s) available for spending once the channel appears on chain.
9536 * See [`ChannelMonitor::get_claimable_balances`] for more details on when these will or will not
9539 typedef enum LDKBalance_Tag {
9541 * The channel is not yet closed (or the commitment or closing transaction has not yet
9542 * appeared in a block). The given balance is claimable (less on-chain fees) if the channel is
9545 LDKBalance_ClaimableOnChannelClose,
9547 * The channel has been closed, and the given balance is ours but awaiting confirmations until
9548 * we consider it spendable.
9550 LDKBalance_ClaimableAwaitingConfirmations,
9552 * The channel has been closed, and the given balance should be ours but awaiting spending
9553 * transaction confirmation. If the spending transaction does not confirm in time, it is
9554 * possible our counterparty can take the funds by broadcasting an HTLC timeout on-chain.
9556 * Once the spending transaction confirms, before it has reached enough confirmations to be
9557 * considered safe from chain reorganizations, the balance will instead be provided via
9558 * [`Balance::ClaimableAwaitingConfirmations`].
9560 LDKBalance_ContentiousClaimable,
9562 * HTLCs which we sent to our counterparty which are claimable after a timeout (less on-chain
9563 * fees) if the counterparty does not know the preimage for the HTLCs. These are somewhat
9564 * likely to be claimed by our counterparty before we do.
9566 LDKBalance_MaybeTimeoutClaimableHTLC,
9568 * HTLCs which we received from our counterparty which are claimable with a preimage which we
9569 * do not currently have. This will only be claimable if we receive the preimage from the node
9570 * to which we forwarded this HTLC before the timeout.
9572 LDKBalance_MaybePreimageClaimableHTLC,
9574 * The channel has been closed, and our counterparty broadcasted a revoked commitment
9577 * Thus, we're able to claim all outputs in the commitment transaction, one of which has the
9580 LDKBalance_CounterpartyRevokedOutputClaimable,
9582 * Must be last for serialization purposes
9584 LDKBalance_Sentinel,
9587 typedef struct LDKBalance_LDKClaimableOnChannelClose_Body {
9589 * The amount available to claim, in satoshis, excluding the on-chain fees which will be
9590 * required to do so.
9592 uint64_t claimable_amount_satoshis;
9593 } LDKBalance_LDKClaimableOnChannelClose_Body;
9595 typedef struct LDKBalance_LDKClaimableAwaitingConfirmations_Body {
9597 * The amount available to claim, in satoshis, possibly excluding the on-chain fees which
9598 * were spent in broadcasting the transaction.
9600 uint64_t claimable_amount_satoshis;
9602 * The height at which an [`Event::SpendableOutputs`] event will be generated for this
9605 uint32_t confirmation_height;
9606 } LDKBalance_LDKClaimableAwaitingConfirmations_Body;
9608 typedef struct LDKBalance_LDKContentiousClaimable_Body {
9610 * The amount available to claim, in satoshis, excluding the on-chain fees which will be
9611 * required to do so.
9613 uint64_t claimable_amount_satoshis;
9615 * The height at which the counterparty may be able to claim the balance if we have not
9618 uint32_t timeout_height;
9619 } LDKBalance_LDKContentiousClaimable_Body;
9621 typedef struct LDKBalance_LDKMaybeTimeoutClaimableHTLC_Body {
9623 * The amount potentially available to claim, in satoshis, excluding the on-chain fees
9624 * which will be required to do so.
9626 uint64_t claimable_amount_satoshis;
9628 * The height at which we will be able to claim the balance if our counterparty has not
9631 uint32_t claimable_height;
9632 } LDKBalance_LDKMaybeTimeoutClaimableHTLC_Body;
9634 typedef struct LDKBalance_LDKMaybePreimageClaimableHTLC_Body {
9636 * The amount potentially available to claim, in satoshis, excluding the on-chain fees
9637 * which will be required to do so.
9639 uint64_t claimable_amount_satoshis;
9641 * The height at which our counterparty will be able to claim the balance if we have not
9642 * yet received the preimage and claimed it ourselves.
9644 uint32_t expiry_height;
9645 } LDKBalance_LDKMaybePreimageClaimableHTLC_Body;
9647 typedef struct LDKBalance_LDKCounterpartyRevokedOutputClaimable_Body {
9649 * The amount, in satoshis, of the output which we can claim.
9651 * Note that for outputs from HTLC balances this may be excluding some on-chain fees that
9652 * were already spent.
9654 uint64_t claimable_amount_satoshis;
9655 } LDKBalance_LDKCounterpartyRevokedOutputClaimable_Body;
9657 typedef struct MUST_USE_STRUCT LDKBalance {
9660 LDKBalance_LDKClaimableOnChannelClose_Body claimable_on_channel_close;
9661 LDKBalance_LDKClaimableAwaitingConfirmations_Body claimable_awaiting_confirmations;
9662 LDKBalance_LDKContentiousClaimable_Body contentious_claimable;
9663 LDKBalance_LDKMaybeTimeoutClaimableHTLC_Body maybe_timeout_claimable_htlc;
9664 LDKBalance_LDKMaybePreimageClaimableHTLC_Body maybe_preimage_claimable_htlc;
9665 LDKBalance_LDKCounterpartyRevokedOutputClaimable_Body counterparty_revoked_output_claimable;
9670 * A dynamically-allocated array of crate::lightning::chain::channelmonitor::Balances of arbitrary size.
9671 * This corresponds to std::vector in C++
9673 typedef struct LDKCVec_BalanceZ {
9675 * The elements in the array.
9676 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
9678 struct LDKBalance *data;
9680 * The number of elements pointed to by `data`.
9686 * The contents of CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ
9688 typedef union LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZPtr {
9690 * A pointer to the contents in the success state.
9691 * Reading from this pointer when `result_ok` is not set is undefined.
9693 struct LDKC2Tuple_BlockHashChannelMonitorZ *result;
9695 * A pointer to the contents in the error state.
9696 * Reading from this pointer when `result_ok` is set is undefined.
9698 struct LDKDecodeError *err;
9699 } LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZPtr;
9702 * A CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ represents the result of a fallible operation,
9703 * containing a crate::c_types::derived::C2Tuple_BlockHashChannelMonitorZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
9704 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9706 typedef struct LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ {
9708 * The contents of this CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ, accessible via either
9709 * `err` or `result` depending on the state of `result_ok`.
9711 union LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZPtr contents;
9713 * Whether this CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ represents a success state.
9716 } LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ;
9719 * A tuple of 2 elements. See the individual fields for the types contained.
9721 typedef struct LDKC2Tuple_PublicKeyTypeZ {
9723 * The element at position 0
9725 struct LDKPublicKey a;
9727 * The element at position 1
9730 } LDKC2Tuple_PublicKeyTypeZ;
9733 * A dynamically-allocated array of crate::c_types::derived::C2Tuple_PublicKeyTypeZs of arbitrary size.
9734 * This corresponds to std::vector in C++
9736 typedef struct LDKCVec_C2Tuple_PublicKeyTypeZZ {
9738 * The elements in the array.
9739 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
9741 struct LDKC2Tuple_PublicKeyTypeZ *data;
9743 * The number of elements pointed to by `data`.
9746 } LDKCVec_C2Tuple_PublicKeyTypeZZ;
9749 * An enum which can either contain a crate::lightning::ln::msgs::NetAddress or not
9751 typedef enum LDKCOption_NetAddressZ_Tag {
9753 * When we're in this state, this COption_NetAddressZ contains a crate::lightning::ln::msgs::NetAddress
9755 LDKCOption_NetAddressZ_Some,
9757 * When we're in this state, this COption_NetAddressZ contains nothing
9759 LDKCOption_NetAddressZ_None,
9761 * Must be last for serialization purposes
9763 LDKCOption_NetAddressZ_Sentinel,
9764 } LDKCOption_NetAddressZ_Tag;
9766 typedef struct LDKCOption_NetAddressZ {
9767 LDKCOption_NetAddressZ_Tag tag;
9770 struct LDKNetAddress some;
9773 } LDKCOption_NetAddressZ;
9778 * Error for PeerManager errors. If you get one of these, you must disconnect the socket and
9779 * generate no further read_event/write_buffer_space_avail/socket_disconnected calls for the
9782 typedef struct MUST_USE_STRUCT LDKPeerHandleError {
9784 * A pointer to the opaque Rust object.
9785 * Nearly everywhere, inner must be non-null, however in places where
9786 * the Rust equivalent takes an Option, it may be set to null to indicate None.
9788 LDKnativePeerHandleError *inner;
9790 * Indicates that this is the only struct which contains the same pointer.
9791 * Rust functions which take ownership of an object provided via an argument require
9792 * this to be true and invalidate the object pointed to by inner.
9795 } LDKPeerHandleError;
9798 * The contents of CResult_CVec_u8ZPeerHandleErrorZ
9800 typedef union LDKCResult_CVec_u8ZPeerHandleErrorZPtr {
9802 * A pointer to the contents in the success state.
9803 * Reading from this pointer when `result_ok` is not set is undefined.
9805 struct LDKCVec_u8Z *result;
9807 * A pointer to the contents in the error state.
9808 * Reading from this pointer when `result_ok` is set is undefined.
9810 struct LDKPeerHandleError *err;
9811 } LDKCResult_CVec_u8ZPeerHandleErrorZPtr;
9814 * A CResult_CVec_u8ZPeerHandleErrorZ represents the result of a fallible operation,
9815 * containing a crate::c_types::derived::CVec_u8Z on success and a crate::lightning::ln::peer_handler::PeerHandleError on failure.
9816 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9818 typedef struct LDKCResult_CVec_u8ZPeerHandleErrorZ {
9820 * The contents of this CResult_CVec_u8ZPeerHandleErrorZ, accessible via either
9821 * `err` or `result` depending on the state of `result_ok`.
9823 union LDKCResult_CVec_u8ZPeerHandleErrorZPtr contents;
9825 * Whether this CResult_CVec_u8ZPeerHandleErrorZ represents a success state.
9828 } LDKCResult_CVec_u8ZPeerHandleErrorZ;
9831 * The contents of CResult_NonePeerHandleErrorZ
9833 typedef union LDKCResult_NonePeerHandleErrorZPtr {
9835 * Note that this value is always NULL, as there are no contents in the OK variant
9839 * A pointer to the contents in the error state.
9840 * Reading from this pointer when `result_ok` is set is undefined.
9842 struct LDKPeerHandleError *err;
9843 } LDKCResult_NonePeerHandleErrorZPtr;
9846 * A CResult_NonePeerHandleErrorZ represents the result of a fallible operation,
9847 * containing a () on success and a crate::lightning::ln::peer_handler::PeerHandleError on failure.
9848 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9850 typedef struct LDKCResult_NonePeerHandleErrorZ {
9852 * The contents of this CResult_NonePeerHandleErrorZ, accessible via either
9853 * `err` or `result` depending on the state of `result_ok`.
9855 union LDKCResult_NonePeerHandleErrorZPtr contents;
9857 * Whether this CResult_NonePeerHandleErrorZ represents a success state.
9860 } LDKCResult_NonePeerHandleErrorZ;
9863 * The contents of CResult_boolPeerHandleErrorZ
9865 typedef union LDKCResult_boolPeerHandleErrorZPtr {
9867 * A pointer to the contents in the success state.
9868 * Reading from this pointer when `result_ok` is not set is undefined.
9872 * A pointer to the contents in the error state.
9873 * Reading from this pointer when `result_ok` is set is undefined.
9875 struct LDKPeerHandleError *err;
9876 } LDKCResult_boolPeerHandleErrorZPtr;
9879 * A CResult_boolPeerHandleErrorZ represents the result of a fallible operation,
9880 * containing a bool on success and a crate::lightning::ln::peer_handler::PeerHandleError on failure.
9881 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9883 typedef struct LDKCResult_boolPeerHandleErrorZ {
9885 * The contents of this CResult_boolPeerHandleErrorZ, accessible via either
9886 * `err` or `result` depending on the state of `result_ok`.
9888 union LDKCResult_boolPeerHandleErrorZPtr contents;
9890 * Whether this CResult_boolPeerHandleErrorZ represents a success state.
9893 } LDKCResult_boolPeerHandleErrorZ;
9896 * Errors that may occur when [sending an onion message].
9898 * [sending an onion message]: OnionMessenger::send_onion_message
9900 typedef enum LDKSendError_Tag {
9902 * Errored computing onion message packet keys.
9904 LDKSendError_Secp256k1,
9906 * Because implementations such as Eclair will drop onion messages where the message packet
9907 * exceeds 32834 bytes, we refuse to send messages where the packet exceeds this size.
9909 LDKSendError_TooBigPacket,
9911 * The provided [`Destination`] was an invalid [`BlindedRoute`], due to having fewer than two
9914 LDKSendError_TooFewBlindedHops,
9916 * Our next-hop peer was offline or does not support onion message forwarding.
9918 LDKSendError_InvalidFirstHop,
9920 * Our next-hop peer's buffer was full or our total outbound buffer was full.
9922 LDKSendError_BufferFull,
9924 * Must be last for serialization purposes
9926 LDKSendError_Sentinel,
9929 typedef struct MUST_USE_STRUCT LDKSendError {
9930 LDKSendError_Tag tag;
9933 enum LDKSecp256k1Error secp256k1;
9939 * The contents of CResult_NoneSendErrorZ
9941 typedef union LDKCResult_NoneSendErrorZPtr {
9943 * Note that this value is always NULL, as there are no contents in the OK variant
9947 * A pointer to the contents in the error state.
9948 * Reading from this pointer when `result_ok` is set is undefined.
9950 struct LDKSendError *err;
9951 } LDKCResult_NoneSendErrorZPtr;
9954 * A CResult_NoneSendErrorZ represents the result of a fallible operation,
9955 * containing a () on success and a crate::lightning::onion_message::messenger::SendError on failure.
9956 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9958 typedef struct LDKCResult_NoneSendErrorZ {
9960 * The contents of this CResult_NoneSendErrorZ, accessible via either
9961 * `err` or `result` depending on the state of `result_ok`.
9963 union LDKCResult_NoneSendErrorZPtr contents;
9965 * Whether this CResult_NoneSendErrorZ represents a success state.
9968 } LDKCResult_NoneSendErrorZ;
9971 * All-encompassing standard error type that processing can return
9973 typedef enum LDKGraphSyncError_Tag {
9975 * Error trying to read the update data, typically due to an erroneous data length indication
9976 * that is greater than the actual amount of data provided
9978 LDKGraphSyncError_DecodeError,
9980 * Error applying the patch to the network graph, usually the result of updates that are too
9981 * old or missing prerequisite data to the application of updates out of order
9983 LDKGraphSyncError_LightningError,
9985 * Must be last for serialization purposes
9987 LDKGraphSyncError_Sentinel,
9988 } LDKGraphSyncError_Tag;
9990 typedef struct MUST_USE_STRUCT LDKGraphSyncError {
9991 LDKGraphSyncError_Tag tag;
9994 struct LDKDecodeError decode_error;
9997 struct LDKLightningError lightning_error;
10000 } LDKGraphSyncError;
10003 * The contents of CResult_u32GraphSyncErrorZ
10005 typedef union LDKCResult_u32GraphSyncErrorZPtr {
10007 * A pointer to the contents in the success state.
10008 * Reading from this pointer when `result_ok` is not set is undefined.
10012 * A pointer to the contents in the error state.
10013 * Reading from this pointer when `result_ok` is set is undefined.
10015 struct LDKGraphSyncError *err;
10016 } LDKCResult_u32GraphSyncErrorZPtr;
10019 * A CResult_u32GraphSyncErrorZ represents the result of a fallible operation,
10020 * containing a u32 on success and a crate::lightning_rapid_gossip_sync::error::GraphSyncError on failure.
10021 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10023 typedef struct LDKCResult_u32GraphSyncErrorZ {
10025 * The contents of this CResult_u32GraphSyncErrorZ, accessible via either
10026 * `err` or `result` depending on the state of `result_ok`.
10028 union LDKCResult_u32GraphSyncErrorZPtr contents;
10030 * Whether this CResult_u32GraphSyncErrorZ represents a success state.
10033 } LDKCResult_u32GraphSyncErrorZ;
10036 * The contents of CResult_NetAddressDecodeErrorZ
10038 typedef union LDKCResult_NetAddressDecodeErrorZPtr {
10040 * A pointer to the contents in the success state.
10041 * Reading from this pointer when `result_ok` is not set is undefined.
10043 struct LDKNetAddress *result;
10045 * A pointer to the contents in the error state.
10046 * Reading from this pointer when `result_ok` is set is undefined.
10048 struct LDKDecodeError *err;
10049 } LDKCResult_NetAddressDecodeErrorZPtr;
10052 * A CResult_NetAddressDecodeErrorZ represents the result of a fallible operation,
10053 * containing a crate::lightning::ln::msgs::NetAddress on success and a crate::lightning::ln::msgs::DecodeError on failure.
10054 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10056 typedef struct LDKCResult_NetAddressDecodeErrorZ {
10058 * The contents of this CResult_NetAddressDecodeErrorZ, accessible via either
10059 * `err` or `result` depending on the state of `result_ok`.
10061 union LDKCResult_NetAddressDecodeErrorZPtr contents;
10063 * Whether this CResult_NetAddressDecodeErrorZ represents a success state.
10066 } LDKCResult_NetAddressDecodeErrorZ;
10071 * An update_add_htlc message to be sent or received from a peer
10073 typedef struct MUST_USE_STRUCT LDKUpdateAddHTLC {
10075 * A pointer to the opaque Rust object.
10076 * Nearly everywhere, inner must be non-null, however in places where
10077 * the Rust equivalent takes an Option, it may be set to null to indicate None.
10079 LDKnativeUpdateAddHTLC *inner;
10081 * Indicates that this is the only struct which contains the same pointer.
10082 * Rust functions which take ownership of an object provided via an argument require
10083 * this to be true and invalidate the object pointed to by inner.
10086 } LDKUpdateAddHTLC;
10089 * A dynamically-allocated array of crate::lightning::ln::msgs::UpdateAddHTLCs of arbitrary size.
10090 * This corresponds to std::vector in C++
10092 typedef struct LDKCVec_UpdateAddHTLCZ {
10094 * The elements in the array.
10095 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
10097 struct LDKUpdateAddHTLC *data;
10099 * The number of elements pointed to by `data`.
10102 } LDKCVec_UpdateAddHTLCZ;
10107 * An update_fulfill_htlc message to be sent or received from a peer
10109 typedef struct MUST_USE_STRUCT LDKUpdateFulfillHTLC {
10111 * A pointer to the opaque Rust object.
10112 * Nearly everywhere, inner must be non-null, however in places where
10113 * the Rust equivalent takes an Option, it may be set to null to indicate None.
10115 LDKnativeUpdateFulfillHTLC *inner;
10117 * Indicates that this is the only struct which contains the same pointer.
10118 * Rust functions which take ownership of an object provided via an argument require
10119 * this to be true and invalidate the object pointed to by inner.
10122 } LDKUpdateFulfillHTLC;
10125 * A dynamically-allocated array of crate::lightning::ln::msgs::UpdateFulfillHTLCs of arbitrary size.
10126 * This corresponds to std::vector in C++
10128 typedef struct LDKCVec_UpdateFulfillHTLCZ {
10130 * The elements in the array.
10131 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
10133 struct LDKUpdateFulfillHTLC *data;
10135 * The number of elements pointed to by `data`.
10138 } LDKCVec_UpdateFulfillHTLCZ;
10143 * An update_fail_htlc message to be sent or received from a peer
10145 typedef struct MUST_USE_STRUCT LDKUpdateFailHTLC {
10147 * A pointer to the opaque Rust object.
10148 * Nearly everywhere, inner must be non-null, however in places where
10149 * the Rust equivalent takes an Option, it may be set to null to indicate None.
10151 LDKnativeUpdateFailHTLC *inner;
10153 * Indicates that this is the only struct which contains the same pointer.
10154 * Rust functions which take ownership of an object provided via an argument require
10155 * this to be true and invalidate the object pointed to by inner.
10158 } LDKUpdateFailHTLC;
10161 * A dynamically-allocated array of crate::lightning::ln::msgs::UpdateFailHTLCs of arbitrary size.
10162 * This corresponds to std::vector in C++
10164 typedef struct LDKCVec_UpdateFailHTLCZ {
10166 * The elements in the array.
10167 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
10169 struct LDKUpdateFailHTLC *data;
10171 * The number of elements pointed to by `data`.
10174 } LDKCVec_UpdateFailHTLCZ;
10179 * An update_fail_malformed_htlc message to be sent or received from a peer
10181 typedef struct MUST_USE_STRUCT LDKUpdateFailMalformedHTLC {
10183 * A pointer to the opaque Rust object.
10184 * Nearly everywhere, inner must be non-null, however in places where
10185 * the Rust equivalent takes an Option, it may be set to null to indicate None.
10187 LDKnativeUpdateFailMalformedHTLC *inner;
10189 * Indicates that this is the only struct which contains the same pointer.
10190 * Rust functions which take ownership of an object provided via an argument require
10191 * this to be true and invalidate the object pointed to by inner.
10194 } LDKUpdateFailMalformedHTLC;
10197 * A dynamically-allocated array of crate::lightning::ln::msgs::UpdateFailMalformedHTLCs of arbitrary size.
10198 * This corresponds to std::vector in C++
10200 typedef struct LDKCVec_UpdateFailMalformedHTLCZ {
10202 * The elements in the array.
10203 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
10205 struct LDKUpdateFailMalformedHTLC *data;
10207 * The number of elements pointed to by `data`.
10210 } LDKCVec_UpdateFailMalformedHTLCZ;
10213 * The contents of CResult_AcceptChannelDecodeErrorZ
10215 typedef union LDKCResult_AcceptChannelDecodeErrorZPtr {
10217 * A pointer to the contents in the success state.
10218 * Reading from this pointer when `result_ok` is not set is undefined.
10220 struct LDKAcceptChannel *result;
10222 * A pointer to the contents in the error state.
10223 * Reading from this pointer when `result_ok` is set is undefined.
10225 struct LDKDecodeError *err;
10226 } LDKCResult_AcceptChannelDecodeErrorZPtr;
10229 * A CResult_AcceptChannelDecodeErrorZ represents the result of a fallible operation,
10230 * containing a crate::lightning::ln::msgs::AcceptChannel on success and a crate::lightning::ln::msgs::DecodeError on failure.
10231 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10233 typedef struct LDKCResult_AcceptChannelDecodeErrorZ {
10235 * The contents of this CResult_AcceptChannelDecodeErrorZ, accessible via either
10236 * `err` or `result` depending on the state of `result_ok`.
10238 union LDKCResult_AcceptChannelDecodeErrorZPtr contents;
10240 * Whether this CResult_AcceptChannelDecodeErrorZ represents a success state.
10243 } LDKCResult_AcceptChannelDecodeErrorZ;
10246 * The contents of CResult_AnnouncementSignaturesDecodeErrorZ
10248 typedef union LDKCResult_AnnouncementSignaturesDecodeErrorZPtr {
10250 * A pointer to the contents in the success state.
10251 * Reading from this pointer when `result_ok` is not set is undefined.
10253 struct LDKAnnouncementSignatures *result;
10255 * A pointer to the contents in the error state.
10256 * Reading from this pointer when `result_ok` is set is undefined.
10258 struct LDKDecodeError *err;
10259 } LDKCResult_AnnouncementSignaturesDecodeErrorZPtr;
10262 * A CResult_AnnouncementSignaturesDecodeErrorZ represents the result of a fallible operation,
10263 * containing a crate::lightning::ln::msgs::AnnouncementSignatures on success and a crate::lightning::ln::msgs::DecodeError on failure.
10264 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10266 typedef struct LDKCResult_AnnouncementSignaturesDecodeErrorZ {
10268 * The contents of this CResult_AnnouncementSignaturesDecodeErrorZ, accessible via either
10269 * `err` or `result` depending on the state of `result_ok`.
10271 union LDKCResult_AnnouncementSignaturesDecodeErrorZPtr contents;
10273 * Whether this CResult_AnnouncementSignaturesDecodeErrorZ represents a success state.
10276 } LDKCResult_AnnouncementSignaturesDecodeErrorZ;
10279 * The contents of CResult_ChannelReestablishDecodeErrorZ
10281 typedef union LDKCResult_ChannelReestablishDecodeErrorZPtr {
10283 * A pointer to the contents in the success state.
10284 * Reading from this pointer when `result_ok` is not set is undefined.
10286 struct LDKChannelReestablish *result;
10288 * A pointer to the contents in the error state.
10289 * Reading from this pointer when `result_ok` is set is undefined.
10291 struct LDKDecodeError *err;
10292 } LDKCResult_ChannelReestablishDecodeErrorZPtr;
10295 * A CResult_ChannelReestablishDecodeErrorZ represents the result of a fallible operation,
10296 * containing a crate::lightning::ln::msgs::ChannelReestablish on success and a crate::lightning::ln::msgs::DecodeError on failure.
10297 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10299 typedef struct LDKCResult_ChannelReestablishDecodeErrorZ {
10301 * The contents of this CResult_ChannelReestablishDecodeErrorZ, accessible via either
10302 * `err` or `result` depending on the state of `result_ok`.
10304 union LDKCResult_ChannelReestablishDecodeErrorZPtr contents;
10306 * Whether this CResult_ChannelReestablishDecodeErrorZ represents a success state.
10309 } LDKCResult_ChannelReestablishDecodeErrorZ;
10312 * The contents of CResult_ClosingSignedDecodeErrorZ
10314 typedef union LDKCResult_ClosingSignedDecodeErrorZPtr {
10316 * A pointer to the contents in the success state.
10317 * Reading from this pointer when `result_ok` is not set is undefined.
10319 struct LDKClosingSigned *result;
10321 * A pointer to the contents in the error state.
10322 * Reading from this pointer when `result_ok` is set is undefined.
10324 struct LDKDecodeError *err;
10325 } LDKCResult_ClosingSignedDecodeErrorZPtr;
10328 * A CResult_ClosingSignedDecodeErrorZ represents the result of a fallible operation,
10329 * containing a crate::lightning::ln::msgs::ClosingSigned on success and a crate::lightning::ln::msgs::DecodeError on failure.
10330 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10332 typedef struct LDKCResult_ClosingSignedDecodeErrorZ {
10334 * The contents of this CResult_ClosingSignedDecodeErrorZ, accessible via either
10335 * `err` or `result` depending on the state of `result_ok`.
10337 union LDKCResult_ClosingSignedDecodeErrorZPtr contents;
10339 * Whether this CResult_ClosingSignedDecodeErrorZ represents a success state.
10342 } LDKCResult_ClosingSignedDecodeErrorZ;
10347 * The minimum and maximum fees which the sender is willing to place on the closing transaction.
10348 * This is provided in [`ClosingSigned`] by both sides to indicate the fee range they are willing
10351 typedef struct MUST_USE_STRUCT LDKClosingSignedFeeRange {
10353 * A pointer to the opaque Rust object.
10354 * Nearly everywhere, inner must be non-null, however in places where
10355 * the Rust equivalent takes an Option, it may be set to null to indicate None.
10357 LDKnativeClosingSignedFeeRange *inner;
10359 * Indicates that this is the only struct which contains the same pointer.
10360 * Rust functions which take ownership of an object provided via an argument require
10361 * this to be true and invalidate the object pointed to by inner.
10364 } LDKClosingSignedFeeRange;
10367 * The contents of CResult_ClosingSignedFeeRangeDecodeErrorZ
10369 typedef union LDKCResult_ClosingSignedFeeRangeDecodeErrorZPtr {
10371 * A pointer to the contents in the success state.
10372 * Reading from this pointer when `result_ok` is not set is undefined.
10374 struct LDKClosingSignedFeeRange *result;
10376 * A pointer to the contents in the error state.
10377 * Reading from this pointer when `result_ok` is set is undefined.
10379 struct LDKDecodeError *err;
10380 } LDKCResult_ClosingSignedFeeRangeDecodeErrorZPtr;
10383 * A CResult_ClosingSignedFeeRangeDecodeErrorZ represents the result of a fallible operation,
10384 * containing a crate::lightning::ln::msgs::ClosingSignedFeeRange on success and a crate::lightning::ln::msgs::DecodeError on failure.
10385 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10387 typedef struct LDKCResult_ClosingSignedFeeRangeDecodeErrorZ {
10389 * The contents of this CResult_ClosingSignedFeeRangeDecodeErrorZ, accessible via either
10390 * `err` or `result` depending on the state of `result_ok`.
10392 union LDKCResult_ClosingSignedFeeRangeDecodeErrorZPtr contents;
10394 * Whether this CResult_ClosingSignedFeeRangeDecodeErrorZ represents a success state.
10397 } LDKCResult_ClosingSignedFeeRangeDecodeErrorZ;
10402 * A commitment_signed message to be sent or received from a peer
10404 typedef struct MUST_USE_STRUCT LDKCommitmentSigned {
10406 * A pointer to the opaque Rust object.
10407 * Nearly everywhere, inner must be non-null, however in places where
10408 * the Rust equivalent takes an Option, it may be set to null to indicate None.
10410 LDKnativeCommitmentSigned *inner;
10412 * Indicates that this is the only struct which contains the same pointer.
10413 * Rust functions which take ownership of an object provided via an argument require
10414 * this to be true and invalidate the object pointed to by inner.
10417 } LDKCommitmentSigned;
10420 * The contents of CResult_CommitmentSignedDecodeErrorZ
10422 typedef union LDKCResult_CommitmentSignedDecodeErrorZPtr {
10424 * A pointer to the contents in the success state.
10425 * Reading from this pointer when `result_ok` is not set is undefined.
10427 struct LDKCommitmentSigned *result;
10429 * A pointer to the contents in the error state.
10430 * Reading from this pointer when `result_ok` is set is undefined.
10432 struct LDKDecodeError *err;
10433 } LDKCResult_CommitmentSignedDecodeErrorZPtr;
10436 * A CResult_CommitmentSignedDecodeErrorZ represents the result of a fallible operation,
10437 * containing a crate::lightning::ln::msgs::CommitmentSigned on success and a crate::lightning::ln::msgs::DecodeError on failure.
10438 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10440 typedef struct LDKCResult_CommitmentSignedDecodeErrorZ {
10442 * The contents of this CResult_CommitmentSignedDecodeErrorZ, accessible via either
10443 * `err` or `result` depending on the state of `result_ok`.
10445 union LDKCResult_CommitmentSignedDecodeErrorZPtr contents;
10447 * Whether this CResult_CommitmentSignedDecodeErrorZ represents a success state.
10450 } LDKCResult_CommitmentSignedDecodeErrorZ;
10453 * The contents of CResult_FundingCreatedDecodeErrorZ
10455 typedef union LDKCResult_FundingCreatedDecodeErrorZPtr {
10457 * A pointer to the contents in the success state.
10458 * Reading from this pointer when `result_ok` is not set is undefined.
10460 struct LDKFundingCreated *result;
10462 * A pointer to the contents in the error state.
10463 * Reading from this pointer when `result_ok` is set is undefined.
10465 struct LDKDecodeError *err;
10466 } LDKCResult_FundingCreatedDecodeErrorZPtr;
10469 * A CResult_FundingCreatedDecodeErrorZ represents the result of a fallible operation,
10470 * containing a crate::lightning::ln::msgs::FundingCreated on success and a crate::lightning::ln::msgs::DecodeError on failure.
10471 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10473 typedef struct LDKCResult_FundingCreatedDecodeErrorZ {
10475 * The contents of this CResult_FundingCreatedDecodeErrorZ, accessible via either
10476 * `err` or `result` depending on the state of `result_ok`.
10478 union LDKCResult_FundingCreatedDecodeErrorZPtr contents;
10480 * Whether this CResult_FundingCreatedDecodeErrorZ represents a success state.
10483 } LDKCResult_FundingCreatedDecodeErrorZ;
10486 * The contents of CResult_FundingSignedDecodeErrorZ
10488 typedef union LDKCResult_FundingSignedDecodeErrorZPtr {
10490 * A pointer to the contents in the success state.
10491 * Reading from this pointer when `result_ok` is not set is undefined.
10493 struct LDKFundingSigned *result;
10495 * A pointer to the contents in the error state.
10496 * Reading from this pointer when `result_ok` is set is undefined.
10498 struct LDKDecodeError *err;
10499 } LDKCResult_FundingSignedDecodeErrorZPtr;
10502 * A CResult_FundingSignedDecodeErrorZ represents the result of a fallible operation,
10503 * containing a crate::lightning::ln::msgs::FundingSigned on success and a crate::lightning::ln::msgs::DecodeError on failure.
10504 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10506 typedef struct LDKCResult_FundingSignedDecodeErrorZ {
10508 * The contents of this CResult_FundingSignedDecodeErrorZ, accessible via either
10509 * `err` or `result` depending on the state of `result_ok`.
10511 union LDKCResult_FundingSignedDecodeErrorZPtr contents;
10513 * Whether this CResult_FundingSignedDecodeErrorZ represents a success state.
10516 } LDKCResult_FundingSignedDecodeErrorZ;
10519 * The contents of CResult_ChannelReadyDecodeErrorZ
10521 typedef union LDKCResult_ChannelReadyDecodeErrorZPtr {
10523 * A pointer to the contents in the success state.
10524 * Reading from this pointer when `result_ok` is not set is undefined.
10526 struct LDKChannelReady *result;
10528 * A pointer to the contents in the error state.
10529 * Reading from this pointer when `result_ok` is set is undefined.
10531 struct LDKDecodeError *err;
10532 } LDKCResult_ChannelReadyDecodeErrorZPtr;
10535 * A CResult_ChannelReadyDecodeErrorZ represents the result of a fallible operation,
10536 * containing a crate::lightning::ln::msgs::ChannelReady on success and a crate::lightning::ln::msgs::DecodeError on failure.
10537 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10539 typedef struct LDKCResult_ChannelReadyDecodeErrorZ {
10541 * The contents of this CResult_ChannelReadyDecodeErrorZ, accessible via either
10542 * `err` or `result` depending on the state of `result_ok`.
10544 union LDKCResult_ChannelReadyDecodeErrorZPtr contents;
10546 * Whether this CResult_ChannelReadyDecodeErrorZ represents a success state.
10549 } LDKCResult_ChannelReadyDecodeErrorZ;
10554 * An init message to be sent or received from a peer
10556 typedef struct MUST_USE_STRUCT LDKInit {
10558 * A pointer to the opaque Rust object.
10559 * Nearly everywhere, inner must be non-null, however in places where
10560 * the Rust equivalent takes an Option, it may be set to null to indicate None.
10562 LDKnativeInit *inner;
10564 * Indicates that this is the only struct which contains the same pointer.
10565 * Rust functions which take ownership of an object provided via an argument require
10566 * this to be true and invalidate the object pointed to by inner.
10572 * The contents of CResult_InitDecodeErrorZ
10574 typedef union LDKCResult_InitDecodeErrorZPtr {
10576 * A pointer to the contents in the success state.
10577 * Reading from this pointer when `result_ok` is not set is undefined.
10579 struct LDKInit *result;
10581 * A pointer to the contents in the error state.
10582 * Reading from this pointer when `result_ok` is set is undefined.
10584 struct LDKDecodeError *err;
10585 } LDKCResult_InitDecodeErrorZPtr;
10588 * A CResult_InitDecodeErrorZ represents the result of a fallible operation,
10589 * containing a crate::lightning::ln::msgs::Init on success and a crate::lightning::ln::msgs::DecodeError on failure.
10590 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10592 typedef struct LDKCResult_InitDecodeErrorZ {
10594 * The contents of this CResult_InitDecodeErrorZ, accessible via either
10595 * `err` or `result` depending on the state of `result_ok`.
10597 union LDKCResult_InitDecodeErrorZPtr contents;
10599 * Whether this CResult_InitDecodeErrorZ represents a success state.
10602 } LDKCResult_InitDecodeErrorZ;
10605 * The contents of CResult_OpenChannelDecodeErrorZ
10607 typedef union LDKCResult_OpenChannelDecodeErrorZPtr {
10609 * A pointer to the contents in the success state.
10610 * Reading from this pointer when `result_ok` is not set is undefined.
10612 struct LDKOpenChannel *result;
10614 * A pointer to the contents in the error state.
10615 * Reading from this pointer when `result_ok` is set is undefined.
10617 struct LDKDecodeError *err;
10618 } LDKCResult_OpenChannelDecodeErrorZPtr;
10621 * A CResult_OpenChannelDecodeErrorZ represents the result of a fallible operation,
10622 * containing a crate::lightning::ln::msgs::OpenChannel on success and a crate::lightning::ln::msgs::DecodeError on failure.
10623 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10625 typedef struct LDKCResult_OpenChannelDecodeErrorZ {
10627 * The contents of this CResult_OpenChannelDecodeErrorZ, accessible via either
10628 * `err` or `result` depending on the state of `result_ok`.
10630 union LDKCResult_OpenChannelDecodeErrorZPtr contents;
10632 * Whether this CResult_OpenChannelDecodeErrorZ represents a success state.
10635 } LDKCResult_OpenChannelDecodeErrorZ;
10638 * The contents of CResult_RevokeAndACKDecodeErrorZ
10640 typedef union LDKCResult_RevokeAndACKDecodeErrorZPtr {
10642 * A pointer to the contents in the success state.
10643 * Reading from this pointer when `result_ok` is not set is undefined.
10645 struct LDKRevokeAndACK *result;
10647 * A pointer to the contents in the error state.
10648 * Reading from this pointer when `result_ok` is set is undefined.
10650 struct LDKDecodeError *err;
10651 } LDKCResult_RevokeAndACKDecodeErrorZPtr;
10654 * A CResult_RevokeAndACKDecodeErrorZ represents the result of a fallible operation,
10655 * containing a crate::lightning::ln::msgs::RevokeAndACK on success and a crate::lightning::ln::msgs::DecodeError on failure.
10656 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10658 typedef struct LDKCResult_RevokeAndACKDecodeErrorZ {
10660 * The contents of this CResult_RevokeAndACKDecodeErrorZ, accessible via either
10661 * `err` or `result` depending on the state of `result_ok`.
10663 union LDKCResult_RevokeAndACKDecodeErrorZPtr contents;
10665 * Whether this CResult_RevokeAndACKDecodeErrorZ represents a success state.
10668 } LDKCResult_RevokeAndACKDecodeErrorZ;
10671 * The contents of CResult_ShutdownDecodeErrorZ
10673 typedef union LDKCResult_ShutdownDecodeErrorZPtr {
10675 * A pointer to the contents in the success state.
10676 * Reading from this pointer when `result_ok` is not set is undefined.
10678 struct LDKShutdown *result;
10680 * A pointer to the contents in the error state.
10681 * Reading from this pointer when `result_ok` is set is undefined.
10683 struct LDKDecodeError *err;
10684 } LDKCResult_ShutdownDecodeErrorZPtr;
10687 * A CResult_ShutdownDecodeErrorZ represents the result of a fallible operation,
10688 * containing a crate::lightning::ln::msgs::Shutdown on success and a crate::lightning::ln::msgs::DecodeError on failure.
10689 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10691 typedef struct LDKCResult_ShutdownDecodeErrorZ {
10693 * The contents of this CResult_ShutdownDecodeErrorZ, accessible via either
10694 * `err` or `result` depending on the state of `result_ok`.
10696 union LDKCResult_ShutdownDecodeErrorZPtr contents;
10698 * Whether this CResult_ShutdownDecodeErrorZ represents a success state.
10701 } LDKCResult_ShutdownDecodeErrorZ;
10704 * The contents of CResult_UpdateFailHTLCDecodeErrorZ
10706 typedef union LDKCResult_UpdateFailHTLCDecodeErrorZPtr {
10708 * A pointer to the contents in the success state.
10709 * Reading from this pointer when `result_ok` is not set is undefined.
10711 struct LDKUpdateFailHTLC *result;
10713 * A pointer to the contents in the error state.
10714 * Reading from this pointer when `result_ok` is set is undefined.
10716 struct LDKDecodeError *err;
10717 } LDKCResult_UpdateFailHTLCDecodeErrorZPtr;
10720 * A CResult_UpdateFailHTLCDecodeErrorZ represents the result of a fallible operation,
10721 * containing a crate::lightning::ln::msgs::UpdateFailHTLC on success and a crate::lightning::ln::msgs::DecodeError on failure.
10722 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10724 typedef struct LDKCResult_UpdateFailHTLCDecodeErrorZ {
10726 * The contents of this CResult_UpdateFailHTLCDecodeErrorZ, accessible via either
10727 * `err` or `result` depending on the state of `result_ok`.
10729 union LDKCResult_UpdateFailHTLCDecodeErrorZPtr contents;
10731 * Whether this CResult_UpdateFailHTLCDecodeErrorZ represents a success state.
10734 } LDKCResult_UpdateFailHTLCDecodeErrorZ;
10737 * The contents of CResult_UpdateFailMalformedHTLCDecodeErrorZ
10739 typedef union LDKCResult_UpdateFailMalformedHTLCDecodeErrorZPtr {
10741 * A pointer to the contents in the success state.
10742 * Reading from this pointer when `result_ok` is not set is undefined.
10744 struct LDKUpdateFailMalformedHTLC *result;
10746 * A pointer to the contents in the error state.
10747 * Reading from this pointer when `result_ok` is set is undefined.
10749 struct LDKDecodeError *err;
10750 } LDKCResult_UpdateFailMalformedHTLCDecodeErrorZPtr;
10753 * A CResult_UpdateFailMalformedHTLCDecodeErrorZ represents the result of a fallible operation,
10754 * containing a crate::lightning::ln::msgs::UpdateFailMalformedHTLC on success and a crate::lightning::ln::msgs::DecodeError on failure.
10755 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10757 typedef struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ {
10759 * The contents of this CResult_UpdateFailMalformedHTLCDecodeErrorZ, accessible via either
10760 * `err` or `result` depending on the state of `result_ok`.
10762 union LDKCResult_UpdateFailMalformedHTLCDecodeErrorZPtr contents;
10764 * Whether this CResult_UpdateFailMalformedHTLCDecodeErrorZ represents a success state.
10767 } LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ;
10772 * An update_fee message to be sent or received from a peer
10774 typedef struct MUST_USE_STRUCT LDKUpdateFee {
10776 * A pointer to the opaque Rust object.
10777 * Nearly everywhere, inner must be non-null, however in places where
10778 * the Rust equivalent takes an Option, it may be set to null to indicate None.
10780 LDKnativeUpdateFee *inner;
10782 * Indicates that this is the only struct which contains the same pointer.
10783 * Rust functions which take ownership of an object provided via an argument require
10784 * this to be true and invalidate the object pointed to by inner.
10790 * The contents of CResult_UpdateFeeDecodeErrorZ
10792 typedef union LDKCResult_UpdateFeeDecodeErrorZPtr {
10794 * A pointer to the contents in the success state.
10795 * Reading from this pointer when `result_ok` is not set is undefined.
10797 struct LDKUpdateFee *result;
10799 * A pointer to the contents in the error state.
10800 * Reading from this pointer when `result_ok` is set is undefined.
10802 struct LDKDecodeError *err;
10803 } LDKCResult_UpdateFeeDecodeErrorZPtr;
10806 * A CResult_UpdateFeeDecodeErrorZ represents the result of a fallible operation,
10807 * containing a crate::lightning::ln::msgs::UpdateFee on success and a crate::lightning::ln::msgs::DecodeError on failure.
10808 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10810 typedef struct LDKCResult_UpdateFeeDecodeErrorZ {
10812 * The contents of this CResult_UpdateFeeDecodeErrorZ, accessible via either
10813 * `err` or `result` depending on the state of `result_ok`.
10815 union LDKCResult_UpdateFeeDecodeErrorZPtr contents;
10817 * Whether this CResult_UpdateFeeDecodeErrorZ represents a success state.
10820 } LDKCResult_UpdateFeeDecodeErrorZ;
10823 * The contents of CResult_UpdateFulfillHTLCDecodeErrorZ
10825 typedef union LDKCResult_UpdateFulfillHTLCDecodeErrorZPtr {
10827 * A pointer to the contents in the success state.
10828 * Reading from this pointer when `result_ok` is not set is undefined.
10830 struct LDKUpdateFulfillHTLC *result;
10832 * A pointer to the contents in the error state.
10833 * Reading from this pointer when `result_ok` is set is undefined.
10835 struct LDKDecodeError *err;
10836 } LDKCResult_UpdateFulfillHTLCDecodeErrorZPtr;
10839 * A CResult_UpdateFulfillHTLCDecodeErrorZ represents the result of a fallible operation,
10840 * containing a crate::lightning::ln::msgs::UpdateFulfillHTLC on success and a crate::lightning::ln::msgs::DecodeError on failure.
10841 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10843 typedef struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ {
10845 * The contents of this CResult_UpdateFulfillHTLCDecodeErrorZ, accessible via either
10846 * `err` or `result` depending on the state of `result_ok`.
10848 union LDKCResult_UpdateFulfillHTLCDecodeErrorZPtr contents;
10850 * Whether this CResult_UpdateFulfillHTLCDecodeErrorZ represents a success state.
10853 } LDKCResult_UpdateFulfillHTLCDecodeErrorZ;
10856 * The contents of CResult_UpdateAddHTLCDecodeErrorZ
10858 typedef union LDKCResult_UpdateAddHTLCDecodeErrorZPtr {
10860 * A pointer to the contents in the success state.
10861 * Reading from this pointer when `result_ok` is not set is undefined.
10863 struct LDKUpdateAddHTLC *result;
10865 * A pointer to the contents in the error state.
10866 * Reading from this pointer when `result_ok` is set is undefined.
10868 struct LDKDecodeError *err;
10869 } LDKCResult_UpdateAddHTLCDecodeErrorZPtr;
10872 * A CResult_UpdateAddHTLCDecodeErrorZ represents the result of a fallible operation,
10873 * containing a crate::lightning::ln::msgs::UpdateAddHTLC on success and a crate::lightning::ln::msgs::DecodeError on failure.
10874 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10876 typedef struct LDKCResult_UpdateAddHTLCDecodeErrorZ {
10878 * The contents of this CResult_UpdateAddHTLCDecodeErrorZ, accessible via either
10879 * `err` or `result` depending on the state of `result_ok`.
10881 union LDKCResult_UpdateAddHTLCDecodeErrorZPtr contents;
10883 * Whether this CResult_UpdateAddHTLCDecodeErrorZ represents a success state.
10886 } LDKCResult_UpdateAddHTLCDecodeErrorZ;
10891 * An onion message to be sent or received from a peer
10893 typedef struct MUST_USE_STRUCT LDKOnionMessage {
10895 * A pointer to the opaque Rust object.
10896 * Nearly everywhere, inner must be non-null, however in places where
10897 * the Rust equivalent takes an Option, it may be set to null to indicate None.
10899 LDKnativeOnionMessage *inner;
10901 * Indicates that this is the only struct which contains the same pointer.
10902 * Rust functions which take ownership of an object provided via an argument require
10903 * this to be true and invalidate the object pointed to by inner.
10909 * The contents of CResult_OnionMessageDecodeErrorZ
10911 typedef union LDKCResult_OnionMessageDecodeErrorZPtr {
10913 * A pointer to the contents in the success state.
10914 * Reading from this pointer when `result_ok` is not set is undefined.
10916 struct LDKOnionMessage *result;
10918 * A pointer to the contents in the error state.
10919 * Reading from this pointer when `result_ok` is set is undefined.
10921 struct LDKDecodeError *err;
10922 } LDKCResult_OnionMessageDecodeErrorZPtr;
10925 * A CResult_OnionMessageDecodeErrorZ represents the result of a fallible operation,
10926 * containing a crate::lightning::ln::msgs::OnionMessage on success and a crate::lightning::ln::msgs::DecodeError on failure.
10927 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10929 typedef struct LDKCResult_OnionMessageDecodeErrorZ {
10931 * The contents of this CResult_OnionMessageDecodeErrorZ, accessible via either
10932 * `err` or `result` depending on the state of `result_ok`.
10934 union LDKCResult_OnionMessageDecodeErrorZPtr contents;
10936 * Whether this CResult_OnionMessageDecodeErrorZ represents a success state.
10939 } LDKCResult_OnionMessageDecodeErrorZ;
10944 * A ping message to be sent or received from a peer
10946 typedef struct MUST_USE_STRUCT LDKPing {
10948 * A pointer to the opaque Rust object.
10949 * Nearly everywhere, inner must be non-null, however in places where
10950 * the Rust equivalent takes an Option, it may be set to null to indicate None.
10952 LDKnativePing *inner;
10954 * Indicates that this is the only struct which contains the same pointer.
10955 * Rust functions which take ownership of an object provided via an argument require
10956 * this to be true and invalidate the object pointed to by inner.
10962 * The contents of CResult_PingDecodeErrorZ
10964 typedef union LDKCResult_PingDecodeErrorZPtr {
10966 * A pointer to the contents in the success state.
10967 * Reading from this pointer when `result_ok` is not set is undefined.
10969 struct LDKPing *result;
10971 * A pointer to the contents in the error state.
10972 * Reading from this pointer when `result_ok` is set is undefined.
10974 struct LDKDecodeError *err;
10975 } LDKCResult_PingDecodeErrorZPtr;
10978 * A CResult_PingDecodeErrorZ represents the result of a fallible operation,
10979 * containing a crate::lightning::ln::msgs::Ping on success and a crate::lightning::ln::msgs::DecodeError on failure.
10980 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10982 typedef struct LDKCResult_PingDecodeErrorZ {
10984 * The contents of this CResult_PingDecodeErrorZ, accessible via either
10985 * `err` or `result` depending on the state of `result_ok`.
10987 union LDKCResult_PingDecodeErrorZPtr contents;
10989 * Whether this CResult_PingDecodeErrorZ represents a success state.
10992 } LDKCResult_PingDecodeErrorZ;
10997 * A pong message to be sent or received from a peer
10999 typedef struct MUST_USE_STRUCT LDKPong {
11001 * A pointer to the opaque Rust object.
11002 * Nearly everywhere, inner must be non-null, however in places where
11003 * the Rust equivalent takes an Option, it may be set to null to indicate None.
11005 LDKnativePong *inner;
11007 * Indicates that this is the only struct which contains the same pointer.
11008 * Rust functions which take ownership of an object provided via an argument require
11009 * this to be true and invalidate the object pointed to by inner.
11015 * The contents of CResult_PongDecodeErrorZ
11017 typedef union LDKCResult_PongDecodeErrorZPtr {
11019 * A pointer to the contents in the success state.
11020 * Reading from this pointer when `result_ok` is not set is undefined.
11022 struct LDKPong *result;
11024 * A pointer to the contents in the error state.
11025 * Reading from this pointer when `result_ok` is set is undefined.
11027 struct LDKDecodeError *err;
11028 } LDKCResult_PongDecodeErrorZPtr;
11031 * A CResult_PongDecodeErrorZ represents the result of a fallible operation,
11032 * containing a crate::lightning::ln::msgs::Pong on success and a crate::lightning::ln::msgs::DecodeError on failure.
11033 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
11035 typedef struct LDKCResult_PongDecodeErrorZ {
11037 * The contents of this CResult_PongDecodeErrorZ, accessible via either
11038 * `err` or `result` depending on the state of `result_ok`.
11040 union LDKCResult_PongDecodeErrorZPtr contents;
11042 * Whether this CResult_PongDecodeErrorZ represents a success state.
11045 } LDKCResult_PongDecodeErrorZ;
11048 * The contents of CResult_UnsignedChannelAnnouncementDecodeErrorZ
11050 typedef union LDKCResult_UnsignedChannelAnnouncementDecodeErrorZPtr {
11052 * A pointer to the contents in the success state.
11053 * Reading from this pointer when `result_ok` is not set is undefined.
11055 struct LDKUnsignedChannelAnnouncement *result;
11057 * A pointer to the contents in the error state.
11058 * Reading from this pointer when `result_ok` is set is undefined.
11060 struct LDKDecodeError *err;
11061 } LDKCResult_UnsignedChannelAnnouncementDecodeErrorZPtr;
11064 * A CResult_UnsignedChannelAnnouncementDecodeErrorZ represents the result of a fallible operation,
11065 * containing a crate::lightning::ln::msgs::UnsignedChannelAnnouncement on success and a crate::lightning::ln::msgs::DecodeError on failure.
11066 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
11068 typedef struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ {
11070 * The contents of this CResult_UnsignedChannelAnnouncementDecodeErrorZ, accessible via either
11071 * `err` or `result` depending on the state of `result_ok`.
11073 union LDKCResult_UnsignedChannelAnnouncementDecodeErrorZPtr contents;
11075 * Whether this CResult_UnsignedChannelAnnouncementDecodeErrorZ represents a success state.
11078 } LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ;
11081 * The contents of CResult_ChannelAnnouncementDecodeErrorZ
11083 typedef union LDKCResult_ChannelAnnouncementDecodeErrorZPtr {
11085 * A pointer to the contents in the success state.
11086 * Reading from this pointer when `result_ok` is not set is undefined.
11088 struct LDKChannelAnnouncement *result;
11090 * A pointer to the contents in the error state.
11091 * Reading from this pointer when `result_ok` is set is undefined.
11093 struct LDKDecodeError *err;
11094 } LDKCResult_ChannelAnnouncementDecodeErrorZPtr;
11097 * A CResult_ChannelAnnouncementDecodeErrorZ represents the result of a fallible operation,
11098 * containing a crate::lightning::ln::msgs::ChannelAnnouncement on success and a crate::lightning::ln::msgs::DecodeError on failure.
11099 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
11101 typedef struct LDKCResult_ChannelAnnouncementDecodeErrorZ {
11103 * The contents of this CResult_ChannelAnnouncementDecodeErrorZ, accessible via either
11104 * `err` or `result` depending on the state of `result_ok`.
11106 union LDKCResult_ChannelAnnouncementDecodeErrorZPtr contents;
11108 * Whether this CResult_ChannelAnnouncementDecodeErrorZ represents a success state.
11111 } LDKCResult_ChannelAnnouncementDecodeErrorZ;
11116 * The unsigned part of a channel_update
11118 typedef struct MUST_USE_STRUCT LDKUnsignedChannelUpdate {
11120 * A pointer to the opaque Rust object.
11121 * Nearly everywhere, inner must be non-null, however in places where
11122 * the Rust equivalent takes an Option, it may be set to null to indicate None.
11124 LDKnativeUnsignedChannelUpdate *inner;
11126 * Indicates that this is the only struct which contains the same pointer.
11127 * Rust functions which take ownership of an object provided via an argument require
11128 * this to be true and invalidate the object pointed to by inner.
11131 } LDKUnsignedChannelUpdate;
11134 * The contents of CResult_UnsignedChannelUpdateDecodeErrorZ
11136 typedef union LDKCResult_UnsignedChannelUpdateDecodeErrorZPtr {
11138 * A pointer to the contents in the success state.
11139 * Reading from this pointer when `result_ok` is not set is undefined.
11141 struct LDKUnsignedChannelUpdate *result;
11143 * A pointer to the contents in the error state.
11144 * Reading from this pointer when `result_ok` is set is undefined.
11146 struct LDKDecodeError *err;
11147 } LDKCResult_UnsignedChannelUpdateDecodeErrorZPtr;
11150 * A CResult_UnsignedChannelUpdateDecodeErrorZ represents the result of a fallible operation,
11151 * containing a crate::lightning::ln::msgs::UnsignedChannelUpdate on success and a crate::lightning::ln::msgs::DecodeError on failure.
11152 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
11154 typedef struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ {
11156 * The contents of this CResult_UnsignedChannelUpdateDecodeErrorZ, accessible via either
11157 * `err` or `result` depending on the state of `result_ok`.
11159 union LDKCResult_UnsignedChannelUpdateDecodeErrorZPtr contents;
11161 * Whether this CResult_UnsignedChannelUpdateDecodeErrorZ represents a success state.
11164 } LDKCResult_UnsignedChannelUpdateDecodeErrorZ;
11167 * The contents of CResult_ChannelUpdateDecodeErrorZ
11169 typedef union LDKCResult_ChannelUpdateDecodeErrorZPtr {
11171 * A pointer to the contents in the success state.
11172 * Reading from this pointer when `result_ok` is not set is undefined.
11174 struct LDKChannelUpdate *result;
11176 * A pointer to the contents in the error state.
11177 * Reading from this pointer when `result_ok` is set is undefined.
11179 struct LDKDecodeError *err;
11180 } LDKCResult_ChannelUpdateDecodeErrorZPtr;
11183 * A CResult_ChannelUpdateDecodeErrorZ represents the result of a fallible operation,
11184 * containing a crate::lightning::ln::msgs::ChannelUpdate on success and a crate::lightning::ln::msgs::DecodeError on failure.
11185 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
11187 typedef struct LDKCResult_ChannelUpdateDecodeErrorZ {
11189 * The contents of this CResult_ChannelUpdateDecodeErrorZ, accessible via either
11190 * `err` or `result` depending on the state of `result_ok`.
11192 union LDKCResult_ChannelUpdateDecodeErrorZPtr contents;
11194 * Whether this CResult_ChannelUpdateDecodeErrorZ represents a success state.
11197 } LDKCResult_ChannelUpdateDecodeErrorZ;
11200 * The contents of CResult_ErrorMessageDecodeErrorZ
11202 typedef union LDKCResult_ErrorMessageDecodeErrorZPtr {
11204 * A pointer to the contents in the success state.
11205 * Reading from this pointer when `result_ok` is not set is undefined.
11207 struct LDKErrorMessage *result;
11209 * A pointer to the contents in the error state.
11210 * Reading from this pointer when `result_ok` is set is undefined.
11212 struct LDKDecodeError *err;
11213 } LDKCResult_ErrorMessageDecodeErrorZPtr;
11216 * A CResult_ErrorMessageDecodeErrorZ represents the result of a fallible operation,
11217 * containing a crate::lightning::ln::msgs::ErrorMessage on success and a crate::lightning::ln::msgs::DecodeError on failure.
11218 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
11220 typedef struct LDKCResult_ErrorMessageDecodeErrorZ {
11222 * The contents of this CResult_ErrorMessageDecodeErrorZ, accessible via either
11223 * `err` or `result` depending on the state of `result_ok`.
11225 union LDKCResult_ErrorMessageDecodeErrorZPtr contents;
11227 * Whether this CResult_ErrorMessageDecodeErrorZ represents a success state.
11230 } LDKCResult_ErrorMessageDecodeErrorZ;
11233 * The contents of CResult_WarningMessageDecodeErrorZ
11235 typedef union LDKCResult_WarningMessageDecodeErrorZPtr {
11237 * A pointer to the contents in the success state.
11238 * Reading from this pointer when `result_ok` is not set is undefined.
11240 struct LDKWarningMessage *result;
11242 * A pointer to the contents in the error state.
11243 * Reading from this pointer when `result_ok` is set is undefined.
11245 struct LDKDecodeError *err;
11246 } LDKCResult_WarningMessageDecodeErrorZPtr;
11249 * A CResult_WarningMessageDecodeErrorZ represents the result of a fallible operation,
11250 * containing a crate::lightning::ln::msgs::WarningMessage on success and a crate::lightning::ln::msgs::DecodeError on failure.
11251 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
11253 typedef struct LDKCResult_WarningMessageDecodeErrorZ {
11255 * The contents of this CResult_WarningMessageDecodeErrorZ, accessible via either
11256 * `err` or `result` depending on the state of `result_ok`.
11258 union LDKCResult_WarningMessageDecodeErrorZPtr contents;
11260 * Whether this CResult_WarningMessageDecodeErrorZ represents a success state.
11263 } LDKCResult_WarningMessageDecodeErrorZ;
11268 * The unsigned part of a node_announcement
11270 typedef struct MUST_USE_STRUCT LDKUnsignedNodeAnnouncement {
11272 * A pointer to the opaque Rust object.
11273 * Nearly everywhere, inner must be non-null, however in places where
11274 * the Rust equivalent takes an Option, it may be set to null to indicate None.
11276 LDKnativeUnsignedNodeAnnouncement *inner;
11278 * Indicates that this is the only struct which contains the same pointer.
11279 * Rust functions which take ownership of an object provided via an argument require
11280 * this to be true and invalidate the object pointed to by inner.
11283 } LDKUnsignedNodeAnnouncement;
11286 * The contents of CResult_UnsignedNodeAnnouncementDecodeErrorZ
11288 typedef union LDKCResult_UnsignedNodeAnnouncementDecodeErrorZPtr {
11290 * A pointer to the contents in the success state.
11291 * Reading from this pointer when `result_ok` is not set is undefined.
11293 struct LDKUnsignedNodeAnnouncement *result;
11295 * A pointer to the contents in the error state.
11296 * Reading from this pointer when `result_ok` is set is undefined.
11298 struct LDKDecodeError *err;
11299 } LDKCResult_UnsignedNodeAnnouncementDecodeErrorZPtr;
11302 * A CResult_UnsignedNodeAnnouncementDecodeErrorZ represents the result of a fallible operation,
11303 * containing a crate::lightning::ln::msgs::UnsignedNodeAnnouncement on success and a crate::lightning::ln::msgs::DecodeError on failure.
11304 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
11306 typedef struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ {
11308 * The contents of this CResult_UnsignedNodeAnnouncementDecodeErrorZ, accessible via either
11309 * `err` or `result` depending on the state of `result_ok`.
11311 union LDKCResult_UnsignedNodeAnnouncementDecodeErrorZPtr contents;
11313 * Whether this CResult_UnsignedNodeAnnouncementDecodeErrorZ represents a success state.
11316 } LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ;
11321 * A node_announcement message to be sent or received from a peer
11323 typedef struct MUST_USE_STRUCT LDKNodeAnnouncement {
11325 * A pointer to the opaque Rust object.
11326 * Nearly everywhere, inner must be non-null, however in places where
11327 * the Rust equivalent takes an Option, it may be set to null to indicate None.
11329 LDKnativeNodeAnnouncement *inner;
11331 * Indicates that this is the only struct which contains the same pointer.
11332 * Rust functions which take ownership of an object provided via an argument require
11333 * this to be true and invalidate the object pointed to by inner.
11336 } LDKNodeAnnouncement;
11339 * The contents of CResult_NodeAnnouncementDecodeErrorZ
11341 typedef union LDKCResult_NodeAnnouncementDecodeErrorZPtr {
11343 * A pointer to the contents in the success state.
11344 * Reading from this pointer when `result_ok` is not set is undefined.
11346 struct LDKNodeAnnouncement *result;
11348 * A pointer to the contents in the error state.
11349 * Reading from this pointer when `result_ok` is set is undefined.
11351 struct LDKDecodeError *err;
11352 } LDKCResult_NodeAnnouncementDecodeErrorZPtr;
11355 * A CResult_NodeAnnouncementDecodeErrorZ represents the result of a fallible operation,
11356 * containing a crate::lightning::ln::msgs::NodeAnnouncement on success and a crate::lightning::ln::msgs::DecodeError on failure.
11357 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
11359 typedef struct LDKCResult_NodeAnnouncementDecodeErrorZ {
11361 * The contents of this CResult_NodeAnnouncementDecodeErrorZ, accessible via either
11362 * `err` or `result` depending on the state of `result_ok`.
11364 union LDKCResult_NodeAnnouncementDecodeErrorZPtr contents;
11366 * Whether this CResult_NodeAnnouncementDecodeErrorZ represents a success state.
11369 } LDKCResult_NodeAnnouncementDecodeErrorZ;
11372 * The contents of CResult_QueryShortChannelIdsDecodeErrorZ
11374 typedef union LDKCResult_QueryShortChannelIdsDecodeErrorZPtr {
11376 * A pointer to the contents in the success state.
11377 * Reading from this pointer when `result_ok` is not set is undefined.
11379 struct LDKQueryShortChannelIds *result;
11381 * A pointer to the contents in the error state.
11382 * Reading from this pointer when `result_ok` is set is undefined.
11384 struct LDKDecodeError *err;
11385 } LDKCResult_QueryShortChannelIdsDecodeErrorZPtr;
11388 * A CResult_QueryShortChannelIdsDecodeErrorZ represents the result of a fallible operation,
11389 * containing a crate::lightning::ln::msgs::QueryShortChannelIds on success and a crate::lightning::ln::msgs::DecodeError on failure.
11390 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
11392 typedef struct LDKCResult_QueryShortChannelIdsDecodeErrorZ {
11394 * The contents of this CResult_QueryShortChannelIdsDecodeErrorZ, accessible via either
11395 * `err` or `result` depending on the state of `result_ok`.
11397 union LDKCResult_QueryShortChannelIdsDecodeErrorZPtr contents;
11399 * Whether this CResult_QueryShortChannelIdsDecodeErrorZ represents a success state.
11402 } LDKCResult_QueryShortChannelIdsDecodeErrorZ;
11407 * A reply_short_channel_ids_end message is sent as a reply to a
11408 * query_short_channel_ids message. The query recipient makes a best
11409 * effort to respond based on their local network view which may not be
11410 * a perfect view of the network.
11412 typedef struct MUST_USE_STRUCT LDKReplyShortChannelIdsEnd {
11414 * A pointer to the opaque Rust object.
11415 * Nearly everywhere, inner must be non-null, however in places where
11416 * the Rust equivalent takes an Option, it may be set to null to indicate None.
11418 LDKnativeReplyShortChannelIdsEnd *inner;
11420 * Indicates that this is the only struct which contains the same pointer.
11421 * Rust functions which take ownership of an object provided via an argument require
11422 * this to be true and invalidate the object pointed to by inner.
11425 } LDKReplyShortChannelIdsEnd;
11428 * The contents of CResult_ReplyShortChannelIdsEndDecodeErrorZ
11430 typedef union LDKCResult_ReplyShortChannelIdsEndDecodeErrorZPtr {
11432 * A pointer to the contents in the success state.
11433 * Reading from this pointer when `result_ok` is not set is undefined.
11435 struct LDKReplyShortChannelIdsEnd *result;
11437 * A pointer to the contents in the error state.
11438 * Reading from this pointer when `result_ok` is set is undefined.
11440 struct LDKDecodeError *err;
11441 } LDKCResult_ReplyShortChannelIdsEndDecodeErrorZPtr;
11444 * A CResult_ReplyShortChannelIdsEndDecodeErrorZ represents the result of a fallible operation,
11445 * containing a crate::lightning::ln::msgs::ReplyShortChannelIdsEnd on success and a crate::lightning::ln::msgs::DecodeError on failure.
11446 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
11448 typedef struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ {
11450 * The contents of this CResult_ReplyShortChannelIdsEndDecodeErrorZ, accessible via either
11451 * `err` or `result` depending on the state of `result_ok`.
11453 union LDKCResult_ReplyShortChannelIdsEndDecodeErrorZPtr contents;
11455 * Whether this CResult_ReplyShortChannelIdsEndDecodeErrorZ represents a success state.
11458 } LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ;
11461 * The contents of CResult_QueryChannelRangeDecodeErrorZ
11463 typedef union LDKCResult_QueryChannelRangeDecodeErrorZPtr {
11465 * A pointer to the contents in the success state.
11466 * Reading from this pointer when `result_ok` is not set is undefined.
11468 struct LDKQueryChannelRange *result;
11470 * A pointer to the contents in the error state.
11471 * Reading from this pointer when `result_ok` is set is undefined.
11473 struct LDKDecodeError *err;
11474 } LDKCResult_QueryChannelRangeDecodeErrorZPtr;
11477 * A CResult_QueryChannelRangeDecodeErrorZ represents the result of a fallible operation,
11478 * containing a crate::lightning::ln::msgs::QueryChannelRange on success and a crate::lightning::ln::msgs::DecodeError on failure.
11479 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
11481 typedef struct LDKCResult_QueryChannelRangeDecodeErrorZ {
11483 * The contents of this CResult_QueryChannelRangeDecodeErrorZ, accessible via either
11484 * `err` or `result` depending on the state of `result_ok`.
11486 union LDKCResult_QueryChannelRangeDecodeErrorZPtr contents;
11488 * Whether this CResult_QueryChannelRangeDecodeErrorZ represents a success state.
11491 } LDKCResult_QueryChannelRangeDecodeErrorZ;
11494 * The contents of CResult_ReplyChannelRangeDecodeErrorZ
11496 typedef union LDKCResult_ReplyChannelRangeDecodeErrorZPtr {
11498 * A pointer to the contents in the success state.
11499 * Reading from this pointer when `result_ok` is not set is undefined.
11501 struct LDKReplyChannelRange *result;
11503 * A pointer to the contents in the error state.
11504 * Reading from this pointer when `result_ok` is set is undefined.
11506 struct LDKDecodeError *err;
11507 } LDKCResult_ReplyChannelRangeDecodeErrorZPtr;
11510 * A CResult_ReplyChannelRangeDecodeErrorZ represents the result of a fallible operation,
11511 * containing a crate::lightning::ln::msgs::ReplyChannelRange on success and a crate::lightning::ln::msgs::DecodeError on failure.
11512 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
11514 typedef struct LDKCResult_ReplyChannelRangeDecodeErrorZ {
11516 * The contents of this CResult_ReplyChannelRangeDecodeErrorZ, accessible via either
11517 * `err` or `result` depending on the state of `result_ok`.
11519 union LDKCResult_ReplyChannelRangeDecodeErrorZPtr contents;
11521 * Whether this CResult_ReplyChannelRangeDecodeErrorZ represents a success state.
11524 } LDKCResult_ReplyChannelRangeDecodeErrorZ;
11527 * The contents of CResult_GossipTimestampFilterDecodeErrorZ
11529 typedef union LDKCResult_GossipTimestampFilterDecodeErrorZPtr {
11531 * A pointer to the contents in the success state.
11532 * Reading from this pointer when `result_ok` is not set is undefined.
11534 struct LDKGossipTimestampFilter *result;
11536 * A pointer to the contents in the error state.
11537 * Reading from this pointer when `result_ok` is set is undefined.
11539 struct LDKDecodeError *err;
11540 } LDKCResult_GossipTimestampFilterDecodeErrorZPtr;
11543 * A CResult_GossipTimestampFilterDecodeErrorZ represents the result of a fallible operation,
11544 * containing a crate::lightning::ln::msgs::GossipTimestampFilter on success and a crate::lightning::ln::msgs::DecodeError on failure.
11545 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
11547 typedef struct LDKCResult_GossipTimestampFilterDecodeErrorZ {
11549 * The contents of this CResult_GossipTimestampFilterDecodeErrorZ, accessible via either
11550 * `err` or `result` depending on the state of `result_ok`.
11552 union LDKCResult_GossipTimestampFilterDecodeErrorZPtr contents;
11554 * Whether this CResult_GossipTimestampFilterDecodeErrorZ represents a success state.
11557 } LDKCResult_GossipTimestampFilterDecodeErrorZ;
11560 * A dynamically-allocated array of crate::lightning::ln::channelmanager::PhantomRouteHintss of arbitrary size.
11561 * This corresponds to std::vector in C++
11563 typedef struct LDKCVec_PhantomRouteHintsZ {
11565 * The elements in the array.
11566 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
11568 struct LDKPhantomRouteHints *data;
11570 * The number of elements pointed to by `data`.
11573 } LDKCVec_PhantomRouteHintsZ;
11576 * When signing using a fallible method either an user-supplied `SignError` or a `CreationError`
11579 typedef enum LDKSignOrCreationError_Tag {
11581 * An error occurred during signing
11583 LDKSignOrCreationError_SignError,
11585 * An error occurred while building the transaction
11587 LDKSignOrCreationError_CreationError,
11589 * Must be last for serialization purposes
11591 LDKSignOrCreationError_Sentinel,
11592 } LDKSignOrCreationError_Tag;
11594 typedef struct MUST_USE_STRUCT LDKSignOrCreationError {
11595 LDKSignOrCreationError_Tag tag;
11598 enum LDKCreationError creation_error;
11601 } LDKSignOrCreationError;
11604 * The contents of CResult_InvoiceSignOrCreationErrorZ
11606 typedef union LDKCResult_InvoiceSignOrCreationErrorZPtr {
11608 * A pointer to the contents in the success state.
11609 * Reading from this pointer when `result_ok` is not set is undefined.
11611 struct LDKInvoice *result;
11613 * A pointer to the contents in the error state.
11614 * Reading from this pointer when `result_ok` is set is undefined.
11616 struct LDKSignOrCreationError *err;
11617 } LDKCResult_InvoiceSignOrCreationErrorZPtr;
11620 * A CResult_InvoiceSignOrCreationErrorZ represents the result of a fallible operation,
11621 * containing a crate::lightning_invoice::Invoice on success and a crate::lightning_invoice::SignOrCreationError on failure.
11622 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
11624 typedef struct LDKCResult_InvoiceSignOrCreationErrorZ {
11626 * The contents of this CResult_InvoiceSignOrCreationErrorZ, accessible via either
11627 * `err` or `result` depending on the state of `result_ok`.
11629 union LDKCResult_InvoiceSignOrCreationErrorZPtr contents;
11631 * Whether this CResult_InvoiceSignOrCreationErrorZ represents a success state.
11634 } LDKCResult_InvoiceSignOrCreationErrorZ;
11639 * A transaction output watched by a [`ChannelMonitor`] for spends on-chain.
11641 * Used to convey to a [`Filter`] such an output with a given spending condition. Any transaction
11642 * spending the output must be given to [`ChannelMonitor::block_connected`] either directly or via
11643 * [`Confirm::transactions_confirmed`].
11645 * If `block_hash` is `Some`, this indicates the output was created in the corresponding block and
11646 * may have been spent there. See [`Filter::register_output`] for details.
11648 * [`ChannelMonitor`]: channelmonitor::ChannelMonitor
11649 * [`ChannelMonitor::block_connected`]: channelmonitor::ChannelMonitor::block_connected
11651 typedef struct MUST_USE_STRUCT LDKWatchedOutput {
11653 * A pointer to the opaque Rust object.
11654 * Nearly everywhere, inner must be non-null, however in places where
11655 * the Rust equivalent takes an Option, it may be set to null to indicate None.
11657 LDKnativeWatchedOutput *inner;
11659 * Indicates that this is the only struct which contains the same pointer.
11660 * Rust functions which take ownership of an object provided via an argument require
11661 * this to be true and invalidate the object pointed to by inner.
11664 } LDKWatchedOutput;
11667 * The `Filter` trait defines behavior for indicating chain activity of interest pertaining to
11670 * This is useful in order to have a [`Watch`] implementation convey to a chain source which
11671 * transactions to be notified of. Notification may take the form of pre-filtering blocks or, in
11672 * the case of [BIP 157]/[BIP 158], only fetching a block if the compact filter matches. If
11673 * receiving full blocks from a chain source, any further filtering is unnecessary.
11675 * After an output has been registered, subsequent block retrievals from the chain source must not
11676 * exclude any transactions matching the new criteria nor any in-block descendants of such
11679 * Note that use as part of a [`Watch`] implementation involves reentrancy. Therefore, the `Filter`
11680 * should not block on I/O. Implementations should instead queue the newly monitored data to be
11681 * processed later. Then, in order to block until the data has been processed, any [`Watch`]
11682 * invocation that has called the `Filter` must return [`TemporaryFailure`].
11684 * [`TemporaryFailure`]: ChannelMonitorUpdateErr::TemporaryFailure
11685 * [BIP 157]: https://github.com/bitcoin/bips/blob/master/bip-0157.mediawiki
11686 * [BIP 158]: https://github.com/bitcoin/bips/blob/master/bip-0158.mediawiki
11688 typedef struct LDKFilter {
11690 * An opaque pointer which is passed to your function implementations as an argument.
11691 * This has no meaning in the LDK, and can be NULL or any other value.
11695 * Registers interest in a transaction with `txid` and having an output with `script_pubkey` as
11696 * a spending condition.
11698 void (*register_tx)(const void *this_arg, const uint8_t (*txid)[32], struct LDKu8slice script_pubkey);
11700 * Registers interest in spends of a transaction output.
11702 * Note that this method might be called during processing of a new block. You therefore need
11703 * to ensure that also dependent output spents within an already connected block are correctly
11704 * handled, e.g., by re-scanning the block in question whenever new outputs have been
11705 * registered mid-processing.
11707 void (*register_output)(const void *this_arg, struct LDKWatchedOutput output);
11709 * Frees any resources associated with this object given its this_arg pointer.
11710 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
11712 void (*free)(void *this_arg);
11716 * An enum which can either contain a crate::lightning::chain::Filter or not
11718 typedef enum LDKCOption_FilterZ_Tag {
11720 * When we're in this state, this COption_FilterZ contains a crate::lightning::chain::Filter
11722 LDKCOption_FilterZ_Some,
11724 * When we're in this state, this COption_FilterZ contains nothing
11726 LDKCOption_FilterZ_None,
11728 * Must be last for serialization purposes
11730 LDKCOption_FilterZ_Sentinel,
11731 } LDKCOption_FilterZ_Tag;
11733 typedef struct LDKCOption_FilterZ {
11734 LDKCOption_FilterZ_Tag tag;
11737 struct LDKFilter some;
11740 } LDKCOption_FilterZ;
11745 * A read-only reference to a current ChannelMonitor.
11747 * Note that this holds a mutex in [`ChainMonitor`] and may block other events until it is
11750 typedef struct MUST_USE_STRUCT LDKLockedChannelMonitor {
11752 * A pointer to the opaque Rust object.
11753 * Nearly everywhere, inner must be non-null, however in places where
11754 * the Rust equivalent takes an Option, it may be set to null to indicate None.
11756 LDKnativeLockedChannelMonitor *inner;
11758 * Indicates that this is the only struct which contains the same pointer.
11759 * Rust functions which take ownership of an object provided via an argument require
11760 * this to be true and invalidate the object pointed to by inner.
11763 } LDKLockedChannelMonitor;
11766 * The contents of CResult_LockedChannelMonitorNoneZ
11768 typedef union LDKCResult_LockedChannelMonitorNoneZPtr {
11770 * A pointer to the contents in the success state.
11771 * Reading from this pointer when `result_ok` is not set is undefined.
11773 struct LDKLockedChannelMonitor *result;
11775 * Note that this value is always NULL, as there are no contents in the Err variant
11778 } LDKCResult_LockedChannelMonitorNoneZPtr;
11781 * A CResult_LockedChannelMonitorNoneZ represents the result of a fallible operation,
11782 * containing a crate::lightning::chain::chainmonitor::LockedChannelMonitor on success and a () on failure.
11783 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
11785 typedef struct LDKCResult_LockedChannelMonitorNoneZ {
11787 * The contents of this CResult_LockedChannelMonitorNoneZ, accessible via either
11788 * `err` or `result` depending on the state of `result_ok`.
11790 union LDKCResult_LockedChannelMonitorNoneZPtr contents;
11792 * Whether this CResult_LockedChannelMonitorNoneZ represents a success state.
11795 } LDKCResult_LockedChannelMonitorNoneZ;
11798 * A dynamically-allocated array of crate::lightning::chain::transaction::OutPoints of arbitrary size.
11799 * This corresponds to std::vector in C++
11801 typedef struct LDKCVec_OutPointZ {
11803 * The elements in the array.
11804 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
11806 struct LDKOutPoint *data;
11808 * The number of elements pointed to by `data`.
11811 } LDKCVec_OutPointZ;
11814 * A trait indicating an object may generate message send events
11816 typedef struct LDKMessageSendEventsProvider {
11818 * An opaque pointer which is passed to your function implementations as an argument.
11819 * This has no meaning in the LDK, and can be NULL or any other value.
11823 * Gets the list of pending events which were generated by previous actions, clearing the list
11826 struct LDKCVec_MessageSendEventZ (*get_and_clear_pending_msg_events)(const void *this_arg);
11828 * Frees any resources associated with this object given its this_arg pointer.
11829 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
11831 void (*free)(void *this_arg);
11832 } LDKMessageSendEventsProvider;
11835 * A trait indicating an object may generate onion messages to send
11837 typedef struct LDKOnionMessageProvider {
11839 * An opaque pointer which is passed to your function implementations as an argument.
11840 * This has no meaning in the LDK, and can be NULL or any other value.
11844 * Gets the next pending onion message for the peer with the given node id.
11846 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
11848 struct LDKOnionMessage (*next_onion_message_for_peer)(const void *this_arg, struct LDKPublicKey peer_node_id);
11850 * Frees any resources associated with this object given its this_arg pointer.
11851 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
11853 void (*free)(void *this_arg);
11854 } LDKOnionMessageProvider;
11857 * A trait implemented for objects handling events from [`EventsProvider`].
11859 typedef struct LDKEventHandler {
11861 * An opaque pointer which is passed to your function implementations as an argument.
11862 * This has no meaning in the LDK, and can be NULL or any other value.
11866 * Handles the given [`Event`].
11868 * See [`EventsProvider`] for details that must be considered when implementing this method.
11870 void (*handle_event)(const void *this_arg, const struct LDKEvent *NONNULL_PTR event);
11872 * Frees any resources associated with this object given its this_arg pointer.
11873 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
11875 void (*free)(void *this_arg);
11879 * A trait indicating an object may generate events.
11881 * Events are processed by passing an [`EventHandler`] to [`process_pending_events`].
11885 * When using this trait, [`process_pending_events`] will call [`handle_event`] for each pending
11886 * event since the last invocation.
11888 * In order to ensure no [`Event`]s are lost, implementors of this trait will persist [`Event`]s
11889 * and replay any unhandled events on startup. An [`Event`] is considered handled when
11890 * [`process_pending_events`] returns, thus handlers MUST fully handle [`Event`]s and persist any
11891 * relevant changes to disk *before* returning.
11893 * Further, because an application may crash between an [`Event`] being handled and the
11894 * implementor of this trait being re-serialized, [`Event`] handling must be idempotent - in
11895 * effect, [`Event`]s may be replayed.
11897 * Note, handlers may call back into the provider and thus deadlocking must be avoided. Be sure to
11898 * consult the provider's documentation on the implication of processing events and how a handler
11899 * may safely use the provider (e.g., see [`ChannelManager::process_pending_events`] and
11900 * [`ChainMonitor::process_pending_events`]).
11902 * (C-not implementable) As there is likely no reason for a user to implement this trait on their
11905 * [`process_pending_events`]: Self::process_pending_events
11906 * [`handle_event`]: EventHandler::handle_event
11907 * [`ChannelManager::process_pending_events`]: crate::ln::channelmanager::ChannelManager#method.process_pending_events
11908 * [`ChainMonitor::process_pending_events`]: crate::chain::chainmonitor::ChainMonitor#method.process_pending_events
11910 typedef struct LDKEventsProvider {
11912 * An opaque pointer which is passed to your function implementations as an argument.
11913 * This has no meaning in the LDK, and can be NULL or any other value.
11917 * Processes any events generated since the last call using the given event handler.
11919 * See the trait-level documentation for requirements.
11921 void (*process_pending_events)(const void *this_arg, struct LDKEventHandler handler);
11923 * Frees any resources associated with this object given its this_arg pointer.
11924 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
11926 void (*free)(void *this_arg);
11927 } LDKEventsProvider;
11932 * Lightning TLV uses a custom variable-length integer called BigSize. It is similar to Bitcoin's
11933 * variable-length integers except that it is serialized in big-endian instead of little-endian.
11935 * Like Bitcoin's variable-length integer, it exhibits ambiguity in that certain values can be
11936 * encoded in several different ways, which we must check for at deserialization-time. Thus, if
11937 * you're looking for an example of a variable-length integer to use for your own project, move
11938 * along, this is a rather poor design.
11940 typedef struct MUST_USE_STRUCT LDKBigSize {
11942 * A pointer to the opaque Rust object.
11943 * Nearly everywhere, inner must be non-null, however in places where
11944 * the Rust equivalent takes an Option, it may be set to null to indicate None.
11946 LDKnativeBigSize *inner;
11948 * Indicates that this is the only struct which contains the same pointer.
11949 * Rust functions which take ownership of an object provided via an argument require
11950 * this to be true and invalidate the object pointed to by inner.
11956 * Trait that handles persisting a [`ChannelManager`], [`NetworkGraph`], and [`WriteableScore`] to disk.
11958 typedef struct LDKPersister {
11960 * An opaque pointer which is passed to your function implementations as an argument.
11961 * This has no meaning in the LDK, and can be NULL or any other value.
11965 * Persist the given ['ChannelManager'] to disk, returning an error if persistence failed.
11967 struct LDKCResult_NoneErrorZ (*persist_manager)(const void *this_arg, const struct LDKChannelManager *NONNULL_PTR channel_manager);
11969 * Persist the given [`NetworkGraph`] to disk, returning an error if persistence failed.
11971 struct LDKCResult_NoneErrorZ (*persist_graph)(const void *this_arg, const struct LDKNetworkGraph *NONNULL_PTR network_graph);
11973 * Persist the given [`WriteableScore`] to disk, returning an error if persistence failed.
11975 struct LDKCResult_NoneErrorZ (*persist_scorer)(const void *this_arg, const struct LDKWriteableScore *NONNULL_PTR scorer);
11977 * Frees any resources associated with this object given its this_arg pointer.
11978 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
11980 void (*free)(void *this_arg);
11984 * A callback which is called when a [`Future`] completes.
11986 * Note that this MUST NOT call back into LDK directly, it must instead schedule actions to be
11987 * taken later. Rust users should use the [`std::future::Future`] implementation for [`Future`]
11990 * Note that the [`std::future::Future`] implementation may only work for runtimes which schedule
11991 * futures when they receive a wake, rather than immediately executing them.
11993 typedef struct LDKFutureCallback {
11995 * An opaque pointer which is passed to your function implementations as an argument.
11996 * This has no meaning in the LDK, and can be NULL or any other value.
12000 * The method which is called.
12002 void (*call)(const void *this_arg);
12004 * Frees any resources associated with this object given its this_arg pointer.
12005 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
12007 void (*free)(void *this_arg);
12008 } LDKFutureCallback;
12013 * A simple future which can complete once, and calls some callback(s) when it does so.
12015 typedef struct MUST_USE_STRUCT LDKFuture {
12017 * A pointer to the opaque Rust object.
12018 * Nearly everywhere, inner must be non-null, however in places where
12019 * the Rust equivalent takes an Option, it may be set to null to indicate None.
12021 LDKnativeFuture *inner;
12023 * Indicates that this is the only struct which contains the same pointer.
12024 * Rust functions which take ownership of an object provided via an argument require
12025 * this to be true and invalidate the object pointed to by inner.
12033 * Configuration we set when applicable.
12035 * Default::default() provides sane defaults.
12037 typedef struct MUST_USE_STRUCT LDKChannelHandshakeConfig {
12039 * A pointer to the opaque Rust object.
12040 * Nearly everywhere, inner must be non-null, however in places where
12041 * the Rust equivalent takes an Option, it may be set to null to indicate None.
12043 LDKnativeChannelHandshakeConfig *inner;
12045 * Indicates that this is the only struct which contains the same pointer.
12046 * Rust functions which take ownership of an object provided via an argument require
12047 * this to be true and invalidate the object pointed to by inner.
12050 } LDKChannelHandshakeConfig;
12055 * Optional channel limits which are applied during channel creation.
12057 * These limits are only applied to our counterparty's limits, not our own.
12059 * Use 0/<type>::max_value() as appropriate to skip checking.
12061 * Provides sane defaults for most configurations.
12063 * Most additional limits are disabled except those with which specify a default in individual
12064 * field documentation. Note that this may result in barely-usable channels, but since they
12065 * are applied mostly only to incoming channels that's not much of a problem.
12067 typedef struct MUST_USE_STRUCT LDKChannelHandshakeLimits {
12069 * A pointer to the opaque Rust object.
12070 * Nearly everywhere, inner must be non-null, however in places where
12071 * the Rust equivalent takes an Option, it may be set to null to indicate None.
12073 LDKnativeChannelHandshakeLimits *inner;
12075 * Indicates that this is the only struct which contains the same pointer.
12076 * Rust functions which take ownership of an object provided via an argument require
12077 * this to be true and invalidate the object pointed to by inner.
12080 } LDKChannelHandshakeLimits;
12085 * Top-level config which holds ChannelHandshakeLimits and ChannelConfig.
12087 * Default::default() provides sane defaults for most configurations
12088 * (but currently with 0 relay fees!)
12090 typedef struct MUST_USE_STRUCT LDKUserConfig {
12092 * A pointer to the opaque Rust object.
12093 * Nearly everywhere, inner must be non-null, however in places where
12094 * the Rust equivalent takes an Option, it may be set to null to indicate None.
12096 LDKnativeUserConfig *inner;
12098 * Indicates that this is the only struct which contains the same pointer.
12099 * Rust functions which take ownership of an object provided via an argument require
12100 * this to be true and invalidate the object pointed to by inner.
12108 * The best known block as identified by its hash and height.
12110 typedef struct MUST_USE_STRUCT LDKBestBlock {
12112 * A pointer to the opaque Rust object.
12113 * Nearly everywhere, inner must be non-null, however in places where
12114 * the Rust equivalent takes an Option, it may be set to null to indicate None.
12116 LDKnativeBestBlock *inner;
12118 * Indicates that this is the only struct which contains the same pointer.
12119 * Rust functions which take ownership of an object provided via an argument require
12120 * this to be true and invalidate the object pointed to by inner.
12126 * The `Listen` trait is used to notify when blocks have been connected or disconnected from the
12129 * Useful when needing to replay chain data upon startup or as new chain events occur. Clients
12130 * sourcing chain data using a block-oriented API should prefer this interface over [`Confirm`].
12131 * Such clients fetch the entire header chain whereas clients using [`Confirm`] only fetch headers
12134 * By using [`Listen::filtered_block_connected`] this interface supports clients fetching the
12135 * entire header chain and only blocks with matching transaction data using BIP 157 filters or
12136 * other similar filtering.
12138 typedef struct LDKListen {
12140 * An opaque pointer which is passed to your function implementations as an argument.
12141 * This has no meaning in the LDK, and can be NULL or any other value.
12145 * Notifies the listener that a block was added at the given height, with the transaction data
12146 * possibly filtered.
12148 void (*filtered_block_connected)(const void *this_arg, const uint8_t (*header)[80], struct LDKCVec_C2Tuple_usizeTransactionZZ txdata, uint32_t height);
12150 * Notifies the listener that a block was added at the given height.
12152 void (*block_connected)(const void *this_arg, struct LDKu8slice block, uint32_t height);
12154 * Notifies the listener that a block was removed at the given height.
12156 void (*block_disconnected)(const void *this_arg, const uint8_t (*header)[80], uint32_t height);
12158 * Frees any resources associated with this object given its this_arg pointer.
12159 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
12161 void (*free)(void *this_arg);
12165 * The `Confirm` trait is used to notify when transactions have been confirmed on chain or
12166 * unconfirmed during a chain reorganization.
12168 * Clients sourcing chain data using a transaction-oriented API should prefer this interface over
12169 * [`Listen`]. For instance, an Electrum client may implement [`Filter`] by subscribing to activity
12170 * related to registered transactions and outputs. Upon notification, it would pass along the
12171 * matching transactions using this interface.
12175 * The intended use is as follows:
12176 * - Call [`transactions_confirmed`] to process any on-chain activity of interest.
12177 * - Call [`transaction_unconfirmed`] to process any transaction returned by [`get_relevant_txids`]
12178 * that has been reorganized out of the chain.
12179 * - Call [`best_block_updated`] whenever a new chain tip becomes available.
12183 * Clients must call these methods in chain order. Specifically:
12184 * - Transactions confirmed in a block must be given before transactions confirmed in a later
12186 * - Dependent transactions within the same block must be given in topological order, possibly in
12188 * - Unconfirmed transactions must be given after the original confirmations and before any
12191 * See individual method documentation for further details.
12193 * [`transactions_confirmed`]: Self::transactions_confirmed
12194 * [`transaction_unconfirmed`]: Self::transaction_unconfirmed
12195 * [`best_block_updated`]: Self::best_block_updated
12196 * [`get_relevant_txids`]: Self::get_relevant_txids
12198 typedef struct LDKConfirm {
12200 * An opaque pointer which is passed to your function implementations as an argument.
12201 * This has no meaning in the LDK, and can be NULL or any other value.
12205 * Processes transactions confirmed in a block with a given header and height.
12207 * Should be called for any transactions registered by [`Filter::register_tx`] or any
12208 * transactions spending an output registered by [`Filter::register_output`]. Such transactions
12209 * appearing in the same block do not need to be included in the same call; instead, multiple
12210 * calls with additional transactions may be made so long as they are made in [chain order].
12212 * May be called before or after [`best_block_updated`] for the corresponding block. However,
12213 * in the event of a chain reorganization, it must not be called with a `header` that is no
12214 * longer in the chain as of the last call to [`best_block_updated`].
12216 * [chain order]: Confirm#order
12217 * [`best_block_updated`]: Self::best_block_updated
12219 void (*transactions_confirmed)(const void *this_arg, const uint8_t (*header)[80], struct LDKCVec_C2Tuple_usizeTransactionZZ txdata, uint32_t height);
12221 * Processes a transaction that is no longer confirmed as result of a chain reorganization.
12223 * Should be called for any transaction returned by [`get_relevant_txids`] if it has been
12224 * reorganized out of the best chain. Once called, the given transaction will not be returned
12225 * by [`get_relevant_txids`], unless it has been reconfirmed via [`transactions_confirmed`].
12227 * [`get_relevant_txids`]: Self::get_relevant_txids
12228 * [`transactions_confirmed`]: Self::transactions_confirmed
12230 void (*transaction_unconfirmed)(const void *this_arg, const uint8_t (*txid)[32]);
12232 * Processes an update to the best header connected at the given height.
12234 * Should be called when a new header is available but may be skipped for intermediary blocks
12235 * if they become available at the same time.
12237 void (*best_block_updated)(const void *this_arg, const uint8_t (*header)[80], uint32_t height);
12239 * Returns transactions that should be monitored for reorganization out of the chain.
12241 * Will include any transactions passed to [`transactions_confirmed`] that have insufficient
12242 * confirmations to be safe from a chain reorganization. Will not include any transactions
12243 * passed to [`transaction_unconfirmed`], unless later reconfirmed.
12245 * May be called to determine the subset of transactions that must still be monitored for
12246 * reorganization. Will be idempotent between calls but may change as a result of calls to the
12247 * other interface methods. Thus, this is useful to determine which transactions may need to be
12248 * given to [`transaction_unconfirmed`].
12250 * [`transactions_confirmed`]: Self::transactions_confirmed
12251 * [`transaction_unconfirmed`]: Self::transaction_unconfirmed
12253 struct LDKCVec_TxidZ (*get_relevant_txids)(const void *this_arg);
12255 * Frees any resources associated with this object given its this_arg pointer.
12256 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
12258 void (*free)(void *this_arg);
12264 * An opaque identifier describing a specific [`Persist`] method call.
12266 typedef struct MUST_USE_STRUCT LDKMonitorUpdateId {
12268 * A pointer to the opaque Rust object.
12269 * Nearly everywhere, inner must be non-null, however in places where
12270 * the Rust equivalent takes an Option, it may be set to null to indicate None.
12272 LDKnativeMonitorUpdateId *inner;
12274 * Indicates that this is the only struct which contains the same pointer.
12275 * Rust functions which take ownership of an object provided via an argument require
12276 * this to be true and invalidate the object pointed to by inner.
12279 } LDKMonitorUpdateId;
12282 * `Persist` defines behavior for persisting channel monitors: this could mean
12283 * writing once to disk, and/or uploading to one or more backup services.
12285 * Each method can return three possible values:
12286 * * If persistence (including any relevant `fsync()` calls) happens immediately, the
12287 * implementation should return `Ok(())`, indicating normal channel operation should continue.
12288 * * If persistence happens asynchronously, implementations should first ensure the
12289 * [`ChannelMonitor`] or [`ChannelMonitorUpdate`] are written durably to disk, and then return
12290 * `Err(ChannelMonitorUpdateErr::TemporaryFailure)` while the update continues in the
12291 * background. Once the update completes, [`ChainMonitor::channel_monitor_updated`] should be
12292 * called with the corresponding [`MonitorUpdateId`].
12294 * Note that unlike the direct [`chain::Watch`] interface,
12295 * [`ChainMonitor::channel_monitor_updated`] must be called once for *each* update which occurs.
12297 * * If persistence fails for some reason, implementations should return
12298 * `Err(ChannelMonitorUpdateErr::PermanentFailure)`, in which case the channel will likely be
12299 * closed without broadcasting the latest state. See
12300 * [`ChannelMonitorUpdateErr::PermanentFailure`] for more details.
12302 typedef struct LDKPersist {
12304 * An opaque pointer which is passed to your function implementations as an argument.
12305 * This has no meaning in the LDK, and can be NULL or any other value.
12309 * Persist a new channel's data in response to a [`chain::Watch::watch_channel`] call. This is
12310 * called by [`ChannelManager`] for new channels, or may be called directly, e.g. on startup.
12312 * The data can be stored any way you want, but the identifier provided by LDK is the
12313 * channel's outpoint (and it is up to you to maintain a correct mapping between the outpoint
12314 * and the stored channel data). Note that you **must** persist every new monitor to disk.
12316 * The `update_id` is used to identify this call to [`ChainMonitor::channel_monitor_updated`],
12317 * if you return [`ChannelMonitorUpdateErr::TemporaryFailure`].
12319 * See [`Writeable::write`] on [`ChannelMonitor`] for writing out a `ChannelMonitor`
12320 * and [`ChannelMonitorUpdateErr`] for requirements when returning errors.
12322 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
12323 * [`Writeable::write`]: crate::util::ser::Writeable::write
12325 struct LDKCResult_NoneChannelMonitorUpdateErrZ (*persist_new_channel)(const void *this_arg, struct LDKOutPoint channel_id, const struct LDKChannelMonitor *NONNULL_PTR data, struct LDKMonitorUpdateId update_id);
12327 * Update one channel's data. The provided [`ChannelMonitor`] has already applied the given
12330 * Note that on every update, you **must** persist either the [`ChannelMonitorUpdate`] or the
12331 * updated monitor itself to disk/backups. See the [`Persist`] trait documentation for more
12334 * During blockchain synchronization operations, this may be called with no
12335 * [`ChannelMonitorUpdate`], in which case the full [`ChannelMonitor`] needs to be persisted.
12336 * Note that after the full [`ChannelMonitor`] is persisted any previous
12337 * [`ChannelMonitorUpdate`]s which were persisted should be discarded - they can no longer be
12338 * applied to the persisted [`ChannelMonitor`] as they were already applied.
12340 * If an implementer chooses to persist the updates only, they need to make
12341 * sure that all the updates are applied to the `ChannelMonitors` *before*
12342 * the set of channel monitors is given to the `ChannelManager`
12343 * deserialization routine. See [`ChannelMonitor::update_monitor`] for
12344 * applying a monitor update to a monitor. If full `ChannelMonitors` are
12345 * persisted, then there is no need to persist individual updates.
12347 * Note that there could be a performance tradeoff between persisting complete
12348 * channel monitors on every update vs. persisting only updates and applying
12349 * them in batches. The size of each monitor grows `O(number of state updates)`
12350 * whereas updates are small and `O(1)`.
12352 * The `update_id` is used to identify this call to [`ChainMonitor::channel_monitor_updated`],
12353 * if you return [`ChannelMonitorUpdateErr::TemporaryFailure`].
12355 * See [`Writeable::write`] on [`ChannelMonitor`] for writing out a `ChannelMonitor`,
12356 * [`Writeable::write`] on [`ChannelMonitorUpdate`] for writing out an update, and
12357 * [`ChannelMonitorUpdateErr`] for requirements when returning errors.
12359 * [`Writeable::write`]: crate::util::ser::Writeable::write
12361 * Note that update (or a relevant inner pointer) may be NULL or all-0s to represent None
12363 struct LDKCResult_NoneChannelMonitorUpdateErrZ (*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);
12365 * Frees any resources associated with this object given its this_arg pointer.
12366 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
12368 void (*free)(void *this_arg);
12374 * An implementation of [`chain::Watch`] for monitoring channels.
12376 * Connected and disconnected blocks must be provided to `ChainMonitor` as documented by
12377 * [`chain::Watch`]. May be used in conjunction with [`ChannelManager`] to monitor channels locally
12378 * or used independently to monitor channels remotely. See the [module-level documentation] for
12381 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
12382 * [module-level documentation]: crate::chain::chainmonitor
12384 typedef struct MUST_USE_STRUCT LDKChainMonitor {
12386 * A pointer to the opaque Rust object.
12387 * Nearly everywhere, inner must be non-null, however in places where
12388 * the Rust equivalent takes an Option, it may be set to null to indicate None.
12390 LDKnativeChainMonitor *inner;
12392 * Indicates that this is the only struct which contains the same pointer.
12393 * Rust functions which take ownership of an object provided via an argument require
12394 * this to be true and invalidate the object pointed to by inner.
12402 * Simple KeysInterface implementor that takes a 32-byte seed for use as a BIP 32 extended key
12403 * and derives keys from that.
12405 * Your node_id is seed/0'
12406 * ChannelMonitor closes may use seed/1'
12407 * Cooperative closes may use seed/2'
12408 * The two close keys may be needed to claim on-chain funds!
12410 * This struct cannot be used for nodes that wish to support receiving phantom payments;
12411 * [`PhantomKeysManager`] must be used instead.
12413 * Note that switching between this struct and [`PhantomKeysManager`] will invalidate any
12414 * previously issued invoices and attempts to pay previous invoices will fail.
12416 typedef struct MUST_USE_STRUCT LDKKeysManager {
12418 * A pointer to the opaque Rust object.
12419 * Nearly everywhere, inner must be non-null, however in places where
12420 * the Rust equivalent takes an Option, it may be set to null to indicate None.
12422 LDKnativeKeysManager *inner;
12424 * Indicates that this is the only struct which contains the same pointer.
12425 * Rust functions which take ownership of an object provided via an argument require
12426 * this to be true and invalidate the object pointed to by inner.
12434 * Similar to [`KeysManager`], but allows the node using this struct to receive phantom node
12437 * A phantom node payment is a payment made to a phantom invoice, which is an invoice that can be
12438 * paid to one of multiple nodes. This works because we encode the invoice route hints such that
12439 * LDK will recognize an incoming payment as destined for a phantom node, and collect the payment
12440 * itself without ever needing to forward to this fake node.
12442 * Phantom node payments are useful for load balancing between multiple LDK nodes. They also
12443 * provide some fault tolerance, because payers will automatically retry paying other provided
12444 * nodes in the case that one node goes down.
12446 * Note that multi-path payments are not supported in phantom invoices for security reasons.
12447 * Switching between this struct and [`KeysManager`] will invalidate any previously issued
12448 * invoices and attempts to pay previous invoices will fail.
12450 typedef struct MUST_USE_STRUCT LDKPhantomKeysManager {
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 LDKnativePhantomKeysManager *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 } LDKPhantomKeysManager;
12468 * Chain-related parameters used to construct a new `ChannelManager`.
12470 * Typically, the block-specific parameters are derived from the best block hash for the network,
12471 * as a newly constructed `ChannelManager` will not have created any channels yet. These parameters
12472 * are not needed when deserializing a previously constructed `ChannelManager`.
12474 typedef struct MUST_USE_STRUCT LDKChainParameters {
12476 * A pointer to the opaque Rust object.
12477 * Nearly everywhere, inner must be non-null, however in places where
12478 * the Rust equivalent takes an Option, it may be set to null to indicate None.
12480 LDKnativeChainParameters *inner;
12482 * Indicates that this is the only struct which contains the same pointer.
12483 * Rust functions which take ownership of an object provided via an argument require
12484 * this to be true and invalidate the object pointed to by inner.
12487 } LDKChainParameters;
12490 * A trait to describe an object which can receive channel messages.
12492 * Messages MAY be called in parallel when they originate from different their_node_ids, however
12493 * they MUST NOT be called in parallel when the two calls have the same their_node_id.
12495 typedef struct LDKChannelMessageHandler {
12497 * An opaque pointer which is passed to your function implementations as an argument.
12498 * This has no meaning in the LDK, and can be NULL or any other value.
12502 * Handle an incoming open_channel message from the given peer.
12504 void (*handle_open_channel)(const void *this_arg, struct LDKPublicKey their_node_id, struct LDKInitFeatures their_features, const struct LDKOpenChannel *NONNULL_PTR msg);
12506 * Handle an incoming accept_channel message from the given peer.
12508 void (*handle_accept_channel)(const void *this_arg, struct LDKPublicKey their_node_id, struct LDKInitFeatures their_features, const struct LDKAcceptChannel *NONNULL_PTR msg);
12510 * Handle an incoming funding_created message from the given peer.
12512 void (*handle_funding_created)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKFundingCreated *NONNULL_PTR msg);
12514 * Handle an incoming funding_signed message from the given peer.
12516 void (*handle_funding_signed)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKFundingSigned *NONNULL_PTR msg);
12518 * Handle an incoming channel_ready message from the given peer.
12520 void (*handle_channel_ready)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKChannelReady *NONNULL_PTR msg);
12522 * Handle an incoming shutdown message from the given peer.
12524 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);
12526 * Handle an incoming closing_signed message from the given peer.
12528 void (*handle_closing_signed)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKClosingSigned *NONNULL_PTR msg);
12530 * Handle an incoming update_add_htlc message from the given peer.
12532 void (*handle_update_add_htlc)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKUpdateAddHTLC *NONNULL_PTR msg);
12534 * Handle an incoming update_fulfill_htlc message from the given peer.
12536 void (*handle_update_fulfill_htlc)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKUpdateFulfillHTLC *NONNULL_PTR msg);
12538 * Handle an incoming update_fail_htlc message from the given peer.
12540 void (*handle_update_fail_htlc)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKUpdateFailHTLC *NONNULL_PTR msg);
12542 * Handle an incoming update_fail_malformed_htlc message from the given peer.
12544 void (*handle_update_fail_malformed_htlc)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR msg);
12546 * Handle an incoming commitment_signed message from the given peer.
12548 void (*handle_commitment_signed)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKCommitmentSigned *NONNULL_PTR msg);
12550 * Handle an incoming revoke_and_ack message from the given peer.
12552 void (*handle_revoke_and_ack)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKRevokeAndACK *NONNULL_PTR msg);
12554 * Handle an incoming update_fee message from the given peer.
12556 void (*handle_update_fee)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKUpdateFee *NONNULL_PTR msg);
12558 * Handle an incoming announcement_signatures message from the given peer.
12560 void (*handle_announcement_signatures)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKAnnouncementSignatures *NONNULL_PTR msg);
12562 * Indicates a connection to the peer failed/an existing connection was lost. If no connection
12563 * is believed to be possible in the future (eg they're sending us messages we don't
12564 * understand or indicate they require unknown feature bits), no_connection_possible is set
12565 * and any outstanding channels should be failed.
12567 void (*peer_disconnected)(const void *this_arg, struct LDKPublicKey their_node_id, bool no_connection_possible);
12569 * Handle a peer reconnecting, possibly generating channel_reestablish message(s).
12571 void (*peer_connected)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKInit *NONNULL_PTR msg);
12573 * Handle an incoming channel_reestablish message from the given peer.
12575 void (*handle_channel_reestablish)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKChannelReestablish *NONNULL_PTR msg);
12577 * Handle an incoming channel update from the given peer.
12579 void (*handle_channel_update)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKChannelUpdate *NONNULL_PTR msg);
12581 * Handle an incoming error message from the given peer.
12583 void (*handle_error)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKErrorMessage *NONNULL_PTR msg);
12585 * Gets the node feature flags which this handler itself supports. All available handlers are
12586 * queried similarly and their feature flags are OR'd together to form the [`NodeFeatures`]
12587 * which are broadcasted in our [`NodeAnnouncement`] message.
12589 struct LDKNodeFeatures (*provided_node_features)(const void *this_arg);
12591 * Gets the init feature flags which should be sent to the given peer. All available handlers
12592 * are queried similarly and their feature flags are OR'd together to form the [`InitFeatures`]
12593 * which are sent in our [`Init`] message.
12595 * Note that this method is called before [`Self::peer_connected`].
12597 struct LDKInitFeatures (*provided_init_features)(const void *this_arg, struct LDKPublicKey their_node_id);
12599 * Implementation of MessageSendEventsProvider for this object.
12601 struct LDKMessageSendEventsProvider MessageSendEventsProvider;
12603 * Frees any resources associated with this object given its this_arg pointer.
12604 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
12606 void (*free)(void *this_arg);
12607 } LDKChannelMessageHandler;
12612 * Arguments for the creation of a ChannelManager that are not deserialized.
12614 * At a high-level, the process for deserializing a ChannelManager and resuming normal operation
12616 * 1) Deserialize all stored [`ChannelMonitor`]s.
12617 * 2) Deserialize the [`ChannelManager`] by filling in this struct and calling:
12618 * `<(BlockHash, ChannelManager)>::read(reader, args)`
12619 * This may result in closing some channels if the [`ChannelMonitor`] is newer than the stored
12620 * [`ChannelManager`] state to ensure no loss of funds. Thus, transactions may be broadcasted.
12621 * 3) If you are not fetching full blocks, register all relevant [`ChannelMonitor`] outpoints the
12622 * same way you would handle a [`chain::Filter`] call using
12623 * [`ChannelMonitor::get_outputs_to_watch`] and [`ChannelMonitor::get_funding_txo`].
12624 * 4) Reconnect blocks on your [`ChannelMonitor`]s.
12625 * 5) Disconnect/connect blocks on the [`ChannelManager`].
12626 * 6) Re-persist the [`ChannelMonitor`]s to ensure the latest state is on disk.
12627 * Note that if you're using a [`ChainMonitor`] for your [`chain::Watch`] implementation, you
12628 * will likely accomplish this as a side-effect of calling [`chain::Watch::watch_channel`] in
12630 * 7) Move the [`ChannelMonitor`]s into your local [`chain::Watch`]. If you're using a
12631 * [`ChainMonitor`], this is done by calling [`chain::Watch::watch_channel`].
12633 * Note that the ordering of #4-7 is not of importance, however all four must occur before you
12634 * call any other methods on the newly-deserialized [`ChannelManager`].
12636 * Note that because some channels may be closed during deserialization, it is critical that you
12637 * always deserialize only the latest version of a ChannelManager and ChannelMonitors available to
12638 * you. If you deserialize an old ChannelManager (during which force-closure transactions may be
12639 * broadcast), and then later deserialize a newer version of the same ChannelManager (which will
12640 * not force-close the same channels but consider them live), you may end up revoking a state for
12641 * which you've already broadcasted the transaction.
12643 * [`ChainMonitor`]: crate::chain::chainmonitor::ChainMonitor
12645 typedef struct MUST_USE_STRUCT LDKChannelManagerReadArgs {
12647 * A pointer to the opaque Rust object.
12648 * Nearly everywhere, inner must be non-null, however in places where
12649 * the Rust equivalent takes an Option, it may be set to null to indicate None.
12651 LDKnativeChannelManagerReadArgs *inner;
12653 * Indicates that this is the only struct which contains the same pointer.
12654 * Rust functions which take ownership of an object provided via an argument require
12655 * this to be true and invalidate the object pointed to by inner.
12658 } LDKChannelManagerReadArgs;
12663 * A set of keys that were HKDF-expanded from an initial call to
12664 * [`KeysInterface::get_inbound_payment_key_material`].
12666 * [`KeysInterface::get_inbound_payment_key_material`]: crate::chain::keysinterface::KeysInterface::get_inbound_payment_key_material
12668 typedef struct MUST_USE_STRUCT LDKExpandedKey {
12670 * A pointer to the opaque Rust object.
12671 * Nearly everywhere, inner must be non-null, however in places where
12672 * the Rust equivalent takes an Option, it may be set to null to indicate None.
12674 LDKnativeExpandedKey *inner;
12676 * Indicates that this is the only struct which contains the same pointer.
12677 * Rust functions which take ownership of an object provided via an argument require
12678 * this to be true and invalidate the object pointed to by inner.
12686 * Proof that the sender knows the per-commitment secret of the previous commitment transaction.
12687 * This is used to convince the recipient that the channel is at a certain commitment
12688 * number even if they lost that data due to a local failure. Of course, the peer may lie
12689 * and even later commitments may have been revoked.
12691 typedef struct MUST_USE_STRUCT LDKDataLossProtect {
12693 * A pointer to the opaque Rust object.
12694 * Nearly everywhere, inner must be non-null, however in places where
12695 * the Rust equivalent takes an Option, it may be set to null to indicate None.
12697 LDKnativeDataLossProtect *inner;
12699 * Indicates that this is the only struct which contains the same pointer.
12700 * Rust functions which take ownership of an object provided via an argument require
12701 * this to be true and invalidate the object pointed to by inner.
12704 } LDKDataLossProtect;
12707 * A 3-byte byte array.
12709 typedef struct LDKThreeBytes {
12717 * A trait to describe an object which can receive routing messages.
12719 * # Implementor DoS Warnings
12721 * For `gossip_queries` messages there are potential DoS vectors when handling
12722 * inbound queries. Implementors using an on-disk network graph should be aware of
12723 * repeated disk I/O for queries accessing different parts of the network graph.
12725 typedef struct LDKRoutingMessageHandler {
12727 * An opaque pointer which is passed to your function implementations as an argument.
12728 * This has no meaning in the LDK, and can be NULL or any other value.
12732 * Handle an incoming node_announcement message, returning true if it should be forwarded on,
12733 * false or returning an Err otherwise.
12735 struct LDKCResult_boolLightningErrorZ (*handle_node_announcement)(const void *this_arg, const struct LDKNodeAnnouncement *NONNULL_PTR msg);
12737 * Handle a channel_announcement message, returning true if it should be forwarded on, false
12738 * or returning an Err otherwise.
12740 struct LDKCResult_boolLightningErrorZ (*handle_channel_announcement)(const void *this_arg, const struct LDKChannelAnnouncement *NONNULL_PTR msg);
12742 * Handle an incoming channel_update message, returning true if it should be forwarded on,
12743 * false or returning an Err otherwise.
12745 struct LDKCResult_boolLightningErrorZ (*handle_channel_update)(const void *this_arg, const struct LDKChannelUpdate *NONNULL_PTR msg);
12747 * Gets channel announcements and updates required to dump our routing table to a remote node,
12748 * starting at the short_channel_id indicated by starting_point and including announcements
12749 * for a single channel.
12751 struct LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ (*get_next_channel_announcement)(const void *this_arg, uint64_t starting_point);
12753 * Gets a node announcement required to dump our routing table to a remote node, starting at
12754 * the node *after* the provided pubkey and including up to one announcement immediately
12755 * higher (as defined by <PublicKey as Ord>::cmp) than starting_point.
12756 * If None is provided for starting_point, we start at the first node.
12758 * Note that starting_point (or a relevant inner pointer) may be NULL or all-0s to represent None
12759 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
12761 struct LDKNodeAnnouncement (*get_next_node_announcement)(const void *this_arg, struct LDKPublicKey starting_point);
12763 * Called when a connection is established with a peer. This can be used to
12764 * perform routing table synchronization using a strategy defined by the
12767 void (*peer_connected)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKInit *NONNULL_PTR init);
12769 * Handles the reply of a query we initiated to learn about channels
12770 * for a given range of blocks. We can expect to receive one or more
12771 * replies to a single query.
12773 struct LDKCResult_NoneLightningErrorZ (*handle_reply_channel_range)(const void *this_arg, struct LDKPublicKey their_node_id, struct LDKReplyChannelRange msg);
12775 * Handles the reply of a query we initiated asking for routing gossip
12776 * messages for a list of channels. We should receive this message when
12777 * a node has completed its best effort to send us the pertaining routing
12780 struct LDKCResult_NoneLightningErrorZ (*handle_reply_short_channel_ids_end)(const void *this_arg, struct LDKPublicKey their_node_id, struct LDKReplyShortChannelIdsEnd msg);
12782 * Handles when a peer asks us to send a list of short_channel_ids
12783 * for the requested range of blocks.
12785 struct LDKCResult_NoneLightningErrorZ (*handle_query_channel_range)(const void *this_arg, struct LDKPublicKey their_node_id, struct LDKQueryChannelRange msg);
12787 * Handles when a peer asks us to send routing gossip messages for a
12788 * list of short_channel_ids.
12790 struct LDKCResult_NoneLightningErrorZ (*handle_query_short_channel_ids)(const void *this_arg, struct LDKPublicKey their_node_id, struct LDKQueryShortChannelIds msg);
12792 * Gets the node feature flags which this handler itself supports. All available handlers are
12793 * queried similarly and their feature flags are OR'd together to form the [`NodeFeatures`]
12794 * which are broadcasted in our [`NodeAnnouncement`] message.
12796 struct LDKNodeFeatures (*provided_node_features)(const void *this_arg);
12798 * Gets the init feature flags which should be sent to the given peer. All available handlers
12799 * are queried similarly and their feature flags are OR'd together to form the [`InitFeatures`]
12800 * which are sent in our [`Init`] message.
12802 * Note that this method is called before [`Self::peer_connected`].
12804 struct LDKInitFeatures (*provided_init_features)(const void *this_arg, struct LDKPublicKey their_node_id);
12806 * Implementation of MessageSendEventsProvider for this object.
12808 struct LDKMessageSendEventsProvider MessageSendEventsProvider;
12810 * Frees any resources associated with this object given its this_arg pointer.
12811 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
12813 void (*free)(void *this_arg);
12814 } LDKRoutingMessageHandler;
12817 * A trait to describe an object that can receive onion messages.
12819 typedef struct LDKOnionMessageHandler {
12821 * An opaque pointer which is passed to your function implementations as an argument.
12822 * This has no meaning in the LDK, and can be NULL or any other value.
12826 * Handle an incoming onion_message message from the given peer.
12828 void (*handle_onion_message)(const void *this_arg, struct LDKPublicKey peer_node_id, const struct LDKOnionMessage *NONNULL_PTR msg);
12830 * Called when a connection is established with a peer. Can be used to track which peers
12831 * advertise onion message support and are online.
12833 void (*peer_connected)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKInit *NONNULL_PTR init);
12835 * Indicates a connection to the peer failed/an existing connection was lost. Allows handlers to
12836 * drop and refuse to forward onion messages to this peer.
12838 void (*peer_disconnected)(const void *this_arg, struct LDKPublicKey their_node_id, bool no_connection_possible);
12840 * Gets the node feature flags which this handler itself supports. All available handlers are
12841 * queried similarly and their feature flags are OR'd together to form the [`NodeFeatures`]
12842 * which are broadcasted in our [`NodeAnnouncement`] message.
12844 struct LDKNodeFeatures (*provided_node_features)(const void *this_arg);
12846 * Gets the init feature flags which should be sent to the given peer. All available handlers
12847 * are queried similarly and their feature flags are OR'd together to form the [`InitFeatures`]
12848 * which are sent in our [`Init`] message.
12850 * Note that this method is called before [`Self::peer_connected`].
12852 struct LDKInitFeatures (*provided_init_features)(const void *this_arg, struct LDKPublicKey their_node_id);
12854 * Implementation of OnionMessageProvider for this object.
12856 struct LDKOnionMessageProvider OnionMessageProvider;
12858 * Frees any resources associated with this object given its this_arg pointer.
12859 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
12861 void (*free)(void *this_arg);
12862 } LDKOnionMessageHandler;
12865 * Trait to be implemented by custom message (unrelated to the channel/gossip LN layers)
12868 typedef struct LDKCustomMessageReader {
12870 * An opaque pointer which is passed to your function implementations as an argument.
12871 * This has no meaning in the LDK, and can be NULL or any other value.
12875 * Decodes a custom message to `CustomMessageType`. If the given message type is known to the
12876 * implementation and the message could be decoded, must return `Ok(Some(message))`. If the
12877 * message type is unknown to the implementation, must return `Ok(None)`. If a decoding error
12878 * occur, must return `Err(DecodeError::X)` where `X` details the encountered error.
12880 struct LDKCResult_COption_TypeZDecodeErrorZ (*read)(const void *this_arg, uint16_t message_type, struct LDKu8slice buffer);
12882 * Frees any resources associated with this object given its this_arg pointer.
12883 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
12885 void (*free)(void *this_arg);
12886 } LDKCustomMessageReader;
12889 * Handler for BOLT1-compliant messages.
12891 typedef struct LDKCustomMessageHandler {
12893 * An opaque pointer which is passed to your function implementations as an argument.
12894 * This has no meaning in the LDK, and can be NULL or any other value.
12898 * Called with the message type that was received and the buffer to be read.
12899 * Can return a `MessageHandlingError` if the message could not be handled.
12901 struct LDKCResult_NoneLightningErrorZ (*handle_custom_message)(const void *this_arg, struct LDKType msg, struct LDKPublicKey sender_node_id);
12903 * Gets the list of pending messages which were generated by the custom message
12904 * handler, clearing the list in the process. The first tuple element must
12905 * correspond to the intended recipients node ids. If no connection to one of the
12906 * specified node does not exist, the message is simply not sent to it.
12908 struct LDKCVec_C2Tuple_PublicKeyTypeZZ (*get_and_clear_pending_msg)(const void *this_arg);
12910 * Implementation of CustomMessageReader for this object.
12912 struct LDKCustomMessageReader CustomMessageReader;
12914 * Frees any resources associated with this object given its this_arg pointer.
12915 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
12917 void (*free)(void *this_arg);
12918 } LDKCustomMessageHandler;
12923 * A dummy struct which implements `RoutingMessageHandler` without storing any routing information
12924 * or doing any processing. You can provide one of these as the route_handler in a MessageHandler.
12926 typedef struct MUST_USE_STRUCT LDKIgnoringMessageHandler {
12928 * A pointer to the opaque Rust object.
12929 * Nearly everywhere, inner must be non-null, however in places where
12930 * the Rust equivalent takes an Option, it may be set to null to indicate None.
12932 LDKnativeIgnoringMessageHandler *inner;
12934 * Indicates that this is the only struct which contains the same pointer.
12935 * Rust functions which take ownership of an object provided via an argument require
12936 * this to be true and invalidate the object pointed to by inner.
12939 } LDKIgnoringMessageHandler;
12944 * A dummy struct which implements `ChannelMessageHandler` without having any channels.
12945 * You can provide one of these as the route_handler in a MessageHandler.
12947 typedef struct MUST_USE_STRUCT LDKErroringMessageHandler {
12949 * A pointer to the opaque Rust object.
12950 * Nearly everywhere, inner must be non-null, however in places where
12951 * the Rust equivalent takes an Option, it may be set to null to indicate None.
12953 LDKnativeErroringMessageHandler *inner;
12955 * Indicates that this is the only struct which contains the same pointer.
12956 * Rust functions which take ownership of an object provided via an argument require
12957 * this to be true and invalidate the object pointed to by inner.
12960 } LDKErroringMessageHandler;
12965 * Provides references to trait impls which handle different types of messages.
12967 typedef struct MUST_USE_STRUCT LDKMessageHandler {
12969 * A pointer to the opaque Rust object.
12970 * Nearly everywhere, inner must be non-null, however in places where
12971 * the Rust equivalent takes an Option, it may be set to null to indicate None.
12973 LDKnativeMessageHandler *inner;
12975 * Indicates that this is the only struct which contains the same pointer.
12976 * Rust functions which take ownership of an object provided via an argument require
12977 * this to be true and invalidate the object pointed to by inner.
12980 } LDKMessageHandler;
12983 * Provides an object which can be used to send data to and which uniquely identifies a connection
12984 * to a remote host. You will need to be able to generate multiple of these which meet Eq and
12985 * implement Hash to meet the PeerManager API.
12987 * For efficiency, Clone should be relatively cheap for this type.
12989 * Two descriptors may compare equal (by [`cmp::Eq`] and [`hash::Hash`]) as long as the original
12990 * has been disconnected, the [`PeerManager`] has been informed of the disconnection (either by it
12991 * having triggered the disconnection or a call to [`PeerManager::socket_disconnected`]), and no
12992 * further calls to the [`PeerManager`] related to the original socket occur. This allows you to
12993 * use a file descriptor for your SocketDescriptor directly, however for simplicity you may wish
12994 * to simply use another value which is guaranteed to be globally unique instead.
12996 typedef struct LDKSocketDescriptor {
12998 * An opaque pointer which is passed to your function implementations as an argument.
12999 * This has no meaning in the LDK, and can be NULL or any other value.
13003 * Attempts to send some data from the given slice to the peer.
13005 * Returns the amount of data which was sent, possibly 0 if the socket has since disconnected.
13006 * Note that in the disconnected case, [`PeerManager::socket_disconnected`] must still be
13007 * called and further write attempts may occur until that time.
13009 * If the returned size is smaller than `data.len()`, a
13010 * [`PeerManager::write_buffer_space_avail`] call must be made the next time more data can be
13011 * written. Additionally, until a `send_data` event completes fully, no further
13012 * [`PeerManager::read_event`] calls should be made for the same peer! Because this is to
13013 * prevent denial-of-service issues, you should not read or buffer any data from the socket
13016 * If a [`PeerManager::read_event`] call on this descriptor had previously returned true
13017 * (indicating that read events should be paused to prevent DoS in the send buffer),
13018 * `resume_read` may be set indicating that read events on this descriptor should resume. A
13019 * `resume_read` of false carries no meaning, and should not cause any action.
13021 uintptr_t (*send_data)(void *this_arg, struct LDKu8slice data, bool resume_read);
13023 * Disconnect the socket pointed to by this SocketDescriptor.
13025 * You do *not* need to call [`PeerManager::socket_disconnected`] with this socket after this
13026 * call (doing so is a noop).
13028 void (*disconnect_socket)(void *this_arg);
13030 * Checks if two objects are equal given this object's this_arg pointer and another object.
13032 bool (*eq)(const void *this_arg, const struct LDKSocketDescriptor *NONNULL_PTR other_arg);
13034 * Calculate a succinct non-cryptographic hash for an object given its this_arg pointer.
13035 * This is used, for example, for inclusion of this object in a hash map.
13037 uint64_t (*hash)(const void *this_arg);
13039 * Called, if set, after this SocketDescriptor has been cloned into a duplicate object.
13040 * The new SocketDescriptor is provided, and should be mutated as needed to perform a
13041 * deep copy of the object pointed to by this_arg or avoid any double-freeing.
13043 void (*cloned)(struct LDKSocketDescriptor *NONNULL_PTR new_SocketDescriptor);
13045 * Frees any resources associated with this object given its this_arg pointer.
13046 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
13048 void (*free)(void *this_arg);
13049 } LDKSocketDescriptor;
13054 * A PeerManager manages a set of peers, described by their [`SocketDescriptor`] and marshalls
13055 * socket events into messages which it passes on to its [`MessageHandler`].
13057 * Locks are taken internally, so you must never assume that reentrancy from a
13058 * [`SocketDescriptor`] call back into [`PeerManager`] methods will not deadlock.
13060 * Calls to [`read_event`] will decode relevant messages and pass them to the
13061 * [`ChannelMessageHandler`], likely doing message processing in-line. Thus, the primary form of
13062 * parallelism in Rust-Lightning is in calls to [`read_event`]. Note, however, that calls to any
13063 * [`PeerManager`] functions related to the same connection must occur only in serial, making new
13064 * calls only after previous ones have returned.
13066 * Rather than using a plain PeerManager, it is preferable to use either a SimpleArcPeerManager
13067 * a SimpleRefPeerManager, for conciseness. See their documentation for more details, but
13068 * essentially you should default to using a SimpleRefPeerManager, and use a
13069 * SimpleArcPeerManager when you require a PeerManager with a static lifetime, such as when
13070 * you're using lightning-net-tokio.
13072 * [`read_event`]: PeerManager::read_event
13074 typedef struct MUST_USE_STRUCT LDKPeerManager {
13076 * A pointer to the opaque Rust object.
13077 * Nearly everywhere, inner must be non-null, however in places where
13078 * the Rust equivalent takes an Option, it may be set to null to indicate None.
13080 LDKnativePeerManager *inner;
13082 * Indicates that this is the only struct which contains the same pointer.
13083 * Rust functions which take ownership of an object provided via an argument require
13084 * this to be true and invalidate the object pointed to by inner.
13092 * Static channel fields used to build transactions given per-commitment fields, organized by
13093 * broadcaster/countersignatory.
13095 * This is derived from the holder/counterparty-organized ChannelTransactionParameters via the
13096 * as_holder_broadcastable and as_counterparty_broadcastable functions.
13098 typedef struct MUST_USE_STRUCT LDKDirectedChannelTransactionParameters {
13100 * A pointer to the opaque Rust object.
13101 * Nearly everywhere, inner must be non-null, however in places where
13102 * the Rust equivalent takes an Option, it may be set to null to indicate None.
13104 LDKnativeDirectedChannelTransactionParameters *inner;
13106 * Indicates that this is the only struct which contains the same pointer.
13107 * Rust functions which take ownership of an object provided via an argument require
13108 * this to be true and invalidate the object pointed to by inner.
13111 } LDKDirectedChannelTransactionParameters;
13114 * Integer in the range `0..=16`
13116 typedef struct LDKWitnessVersion {
13118 } LDKWitnessVersion;
13123 * A read-only view of [`NetworkGraph`].
13125 typedef struct MUST_USE_STRUCT LDKReadOnlyNetworkGraph {
13127 * A pointer to the opaque Rust object.
13128 * Nearly everywhere, inner must be non-null, however in places where
13129 * the Rust equivalent takes an Option, it may be set to null to indicate None.
13131 LDKnativeReadOnlyNetworkGraph *inner;
13133 * Indicates that this is the only struct which contains the same pointer.
13134 * Rust functions which take ownership of an object provided via an argument require
13135 * this to be true and invalidate the object pointed to by inner.
13138 } LDKReadOnlyNetworkGraph;
13143 * Receives and validates network updates from peers,
13144 * stores authentic and relevant data as a network graph.
13145 * This network graph is then used for routing payments.
13146 * Provides interface to help with initial routing sync by
13147 * serving historical announcements.
13149 * Serves as an [`EventHandler`] for applying updates from [`Event::PaymentPathFailed`] to the
13150 * [`NetworkGraph`].
13152 typedef struct MUST_USE_STRUCT LDKP2PGossipSync {
13154 * A pointer to the opaque Rust object.
13155 * Nearly everywhere, inner must be non-null, however in places where
13156 * the Rust equivalent takes an Option, it may be set to null to indicate None.
13158 LDKnativeP2PGossipSync *inner;
13160 * Indicates that this is the only struct which contains the same pointer.
13161 * Rust functions which take ownership of an object provided via an argument require
13162 * this to be true and invalidate the object pointed to by inner.
13165 } LDKP2PGossipSync;
13170 * A wrapper around [`ChannelInfo`] representing information about the channel as directed from a
13171 * source node to a target node.
13173 typedef struct MUST_USE_STRUCT LDKDirectedChannelInfo {
13175 * A pointer to the opaque Rust object.
13176 * Nearly everywhere, inner must be non-null, however in places where
13177 * the Rust equivalent takes an Option, it may be set to null to indicate None.
13179 LDKnativeDirectedChannelInfo *inner;
13181 * Indicates that this is the only struct which contains the same pointer.
13182 * Rust functions which take ownership of an object provided via an argument require
13183 * this to be true and invalidate the object pointed to by inner.
13186 } LDKDirectedChannelInfo;
13189 * The effective capacity of a channel for routing purposes.
13191 * While this may be smaller than the actual channel capacity, amounts greater than
13192 * [`Self::as_msat`] should not be routed through the channel.
13194 typedef enum LDKEffectiveCapacity_Tag {
13196 * The available liquidity in the channel known from being a channel counterparty, and thus a
13199 LDKEffectiveCapacity_ExactLiquidity,
13201 * The maximum HTLC amount in one direction as advertised on the gossip network.
13203 LDKEffectiveCapacity_MaximumHTLC,
13205 * The total capacity of the channel as determined by the funding transaction.
13207 LDKEffectiveCapacity_Total,
13209 * A capacity sufficient to route any payment, typically used for private channels provided by
13212 LDKEffectiveCapacity_Infinite,
13214 * A capacity that is unknown possibly because either the chain state is unavailable to know
13215 * the total capacity or the `htlc_maximum_msat` was not advertised on the gossip network.
13217 LDKEffectiveCapacity_Unknown,
13219 * Must be last for serialization purposes
13221 LDKEffectiveCapacity_Sentinel,
13222 } LDKEffectiveCapacity_Tag;
13224 typedef struct LDKEffectiveCapacity_LDKExactLiquidity_Body {
13226 * Either the inbound or outbound liquidity depending on the direction, denominated in
13229 uint64_t liquidity_msat;
13230 } LDKEffectiveCapacity_LDKExactLiquidity_Body;
13232 typedef struct LDKEffectiveCapacity_LDKMaximumHTLC_Body {
13234 * The maximum HTLC amount denominated in millisatoshi.
13236 uint64_t amount_msat;
13237 } LDKEffectiveCapacity_LDKMaximumHTLC_Body;
13239 typedef struct LDKEffectiveCapacity_LDKTotal_Body {
13241 * The funding amount denominated in millisatoshi.
13243 uint64_t capacity_msat;
13245 * The maximum HTLC amount denominated in millisatoshi.
13247 struct LDKCOption_u64Z htlc_maximum_msat;
13248 } LDKEffectiveCapacity_LDKTotal_Body;
13250 typedef struct MUST_USE_STRUCT LDKEffectiveCapacity {
13251 LDKEffectiveCapacity_Tag tag;
13253 LDKEffectiveCapacity_LDKExactLiquidity_Body exact_liquidity;
13254 LDKEffectiveCapacity_LDKMaximumHTLC_Body maximum_htlc;
13255 LDKEffectiveCapacity_LDKTotal_Body total;
13257 } LDKEffectiveCapacity;
13262 * A concrete implementation of [`LockableScore`] which supports multi-threading.
13264 typedef struct MUST_USE_STRUCT LDKMultiThreadedLockableScore {
13266 * A pointer to the opaque Rust object.
13267 * Nearly everywhere, inner must be non-null, however in places where
13268 * the Rust equivalent takes an Option, it may be set to null to indicate None.
13270 LDKnativeMultiThreadedLockableScore *inner;
13272 * Indicates that this is the only struct which contains the same pointer.
13273 * Rust functions which take ownership of an object provided via an argument require
13274 * this to be true and invalidate the object pointed to by inner.
13277 } LDKMultiThreadedLockableScore;
13282 * A locked `MultiThreadedLockableScore`.
13284 typedef struct MUST_USE_STRUCT LDKMultiThreadedScoreLock {
13286 * A pointer to the opaque Rust object.
13287 * Nearly everywhere, inner must be non-null, however in places where
13288 * the Rust equivalent takes an Option, it may be set to null to indicate None.
13290 LDKnativeMultiThreadedScoreLock *inner;
13292 * Indicates that this is the only struct which contains the same pointer.
13293 * Rust functions which take ownership of an object provided via an argument require
13294 * this to be true and invalidate the object pointed to by inner.
13297 } LDKMultiThreadedScoreLock;
13302 * Parameters for configuring [`ProbabilisticScorer`].
13304 * Used to configure base, liquidity, and amount penalties, the sum of which comprises the channel
13305 * penalty (i.e., the amount in msats willing to be paid to avoid routing through the channel).
13307 * The penalty applied to any channel by the [`ProbabilisticScorer`] is the sum of each of the
13310 typedef struct MUST_USE_STRUCT LDKProbabilisticScoringParameters {
13312 * A pointer to the opaque Rust object.
13313 * Nearly everywhere, inner must be non-null, however in places where
13314 * the Rust equivalent takes an Option, it may be set to null to indicate None.
13316 LDKnativeProbabilisticScoringParameters *inner;
13318 * Indicates that this is the only struct which contains the same pointer.
13319 * Rust functions which take ownership of an object provided via an argument require
13320 * this to be true and invalidate the object pointed to by inner.
13323 } LDKProbabilisticScoringParameters;
13328 * A sender, receiver and forwarder of onion messages. In upcoming releases, this object will be
13329 * used to retrieve invoices and fulfill invoice requests from [offers]. Currently, only sending
13330 * and receiving empty onion messages is supported.
13335 * # extern crate bitcoin;
13336 * # use bitcoin::hashes::_export::_core::time::Duration;
13337 * # use bitcoin::secp256k1::{PublicKey, Secp256k1, SecretKey};
13338 * # use lightning::chain::keysinterface::{InMemorySigner, KeysManager, KeysInterface};
13339 * # use lightning::onion_message::messenger::{Destination, OnionMessenger};
13340 * # use lightning::onion_message::blinded_route::BlindedRoute;
13341 * # use lightning::util::logger::{Logger, Record};
13342 * # use std::sync::Arc;
13343 * # struct FakeLogger {};
13344 * # impl Logger for FakeLogger {
13345 * # fn log(&self, record: &Record) { unimplemented!() }
13347 * # let seed = [42u8; 32];
13348 * # let time = Duration::from_secs(123456);
13349 * # let keys_manager = KeysManager::new(&seed, time.as_secs(), time.subsec_nanos());
13350 * # let logger = Arc::new(FakeLogger {});
13351 * # let node_secret = SecretKey::from_slice(&hex::decode(\"0101010101010101010101010101010101010101010101010101010101010101\").unwrap()[..]).unwrap();
13352 * # let secp_ctx = Secp256k1::new();
13353 * # let hop_node_id1 = PublicKey::from_secret_key(&secp_ctx, &node_secret);
13354 * # let (hop_node_id2, hop_node_id3, hop_node_id4) = (hop_node_id1, hop_node_id1,
13356 * # let destination_node_id = hop_node_id1;
13358 * // Create the onion messenger. This must use the same `keys_manager` as is passed to your
13359 * // ChannelManager.
13360 * let onion_messenger = OnionMessenger::new(&keys_manager, logger);
13362 * // Send an empty onion message to a node id.
13363 * let intermediate_hops = [hop_node_id1, hop_node_id2];
13364 * let reply_path = None;
13365 * onion_messenger.send_onion_message(&intermediate_hops, Destination::Node(destination_node_id), reply_path);
13367 * // Create a blinded route to yourself, for someone to send an onion message to.
13368 * # let your_node_id = hop_node_id1;
13369 * let hops = [hop_node_id3, hop_node_id4, your_node_id];
13370 * let blinded_route = BlindedRoute::new(&hops, &keys_manager, &secp_ctx).unwrap();
13372 * // Send an empty onion message to a blinded route.
13373 * # let intermediate_hops = [hop_node_id1, hop_node_id2];
13374 * let reply_path = None;
13375 * onion_messenger.send_onion_message(&intermediate_hops, Destination::BlindedRoute(blinded_route), reply_path);
13378 * [offers]: <https://github.com/lightning/bolts/pull/798>
13379 * [`OnionMessenger`]: crate::onion_message::OnionMessenger
13381 typedef struct MUST_USE_STRUCT LDKOnionMessenger {
13383 * A pointer to the opaque Rust object.
13384 * Nearly everywhere, inner must be non-null, however in places where
13385 * the Rust equivalent takes an Option, it may be set to null to indicate None.
13387 LDKnativeOnionMessenger *inner;
13389 * Indicates that this is the only struct which contains the same pointer.
13390 * Rust functions which take ownership of an object provided via an argument require
13391 * this to be true and invalidate the object pointed to by inner.
13394 } LDKOnionMessenger;
13397 * The destination of an onion message.
13399 typedef enum LDKDestination_Tag {
13401 * We're sending this onion message to a node.
13403 LDKDestination_Node,
13405 * We're sending this onion message to a blinded route.
13407 LDKDestination_BlindedRoute,
13409 * Must be last for serialization purposes
13411 LDKDestination_Sentinel,
13412 } LDKDestination_Tag;
13414 typedef struct MUST_USE_STRUCT LDKDestination {
13415 LDKDestination_Tag tag;
13418 struct LDKPublicKey node;
13421 struct LDKBlindedRoute blinded_route;
13429 * FilesystemPersister persists channel data on disk, where each channel's
13430 * data is stored in a file named after its funding outpoint.
13432 * Warning: this module does the best it can with calls to persist data, but it
13433 * can only guarantee that the data is passed to the drive. It is up to the
13434 * drive manufacturers to do the actual persistence properly, which they often
13435 * don't (especially on consumer-grade hardware). Therefore, it is up to the
13436 * user to validate their entire storage stack, to ensure the writes are
13438 * Corollary: especially when dealing with larger amounts of money, it is best
13439 * practice to have multiple channel data backups and not rely only on one
13440 * FilesystemPersister.
13442 typedef struct MUST_USE_STRUCT LDKFilesystemPersister {
13444 * A pointer to the opaque Rust object.
13445 * Nearly everywhere, inner must be non-null, however in places where
13446 * the Rust equivalent takes an Option, it may be set to null to indicate None.
13448 LDKnativeFilesystemPersister *inner;
13450 * Indicates that this is the only struct which contains the same pointer.
13451 * Rust functions which take ownership of an object provided via an argument require
13452 * this to be true and invalidate the object pointed to by inner.
13455 } LDKFilesystemPersister;
13460 * `BackgroundProcessor` takes care of tasks that (1) need to happen periodically to keep
13461 * Rust-Lightning running properly, and (2) either can or should be run in the background. Its
13462 * responsibilities are:
13463 * * Processing [`Event`]s with a user-provided [`EventHandler`].
13464 * * Monitoring whether the [`ChannelManager`] needs to be re-persisted to disk, and if so,
13465 * writing it to disk/backups by invoking the callback given to it at startup.
13466 * [`ChannelManager`] persistence should be done in the background.
13467 * * Calling [`ChannelManager::timer_tick_occurred`] and [`PeerManager::timer_tick_occurred`]
13468 * at the appropriate intervals.
13469 * * Calling [`NetworkGraph::remove_stale_channels`] (if a [`GossipSync`] with a [`NetworkGraph`]
13470 * is provided to [`BackgroundProcessor::start`]).
13472 * It will also call [`PeerManager::process_events`] periodically though this shouldn't be relied
13473 * upon as doing so may result in high latency.
13477 * If [`ChannelManager`] persistence fails and the persisted manager becomes out-of-date, then
13478 * there is a risk of channels force-closing on startup when the manager realizes it's outdated.
13479 * However, as long as [`ChannelMonitor`] backups are sound, no funds besides those used for
13480 * unilateral chain closure fees are at risk.
13482 * [`ChannelMonitor`]: lightning::chain::channelmonitor::ChannelMonitor
13483 * [`Event`]: lightning::util::events::Event
13484 *BackgroundProcessor will immediately stop on drop. It should be stored until shutdown.
13486 typedef struct MUST_USE_STRUCT LDKBackgroundProcessor {
13488 * A pointer to the opaque Rust object.
13489 * Nearly everywhere, inner must be non-null, however in places where
13490 * the Rust equivalent takes an Option, it may be set to null to indicate None.
13492 LDKnativeBackgroundProcessor *inner;
13494 * Indicates that this is the only struct which contains the same pointer.
13495 * Rust functions which take ownership of an object provided via an argument require
13496 * this to be true and invalidate the object pointed to by inner.
13499 } LDKBackgroundProcessor;
13504 * Rapid Gossip Sync struct
13505 * See [crate-level documentation] for usage.
13507 * [crate-level documentation]: crate
13509 typedef struct MUST_USE_STRUCT LDKRapidGossipSync {
13511 * A pointer to the opaque Rust object.
13512 * Nearly everywhere, inner must be non-null, however in places where
13513 * the Rust equivalent takes an Option, it may be set to null to indicate None.
13515 LDKnativeRapidGossipSync *inner;
13517 * Indicates that this is the only struct which contains the same pointer.
13518 * Rust functions which take ownership of an object provided via an argument require
13519 * this to be true and invalidate the object pointed to by inner.
13522 } LDKRapidGossipSync;
13525 * Either [`P2PGossipSync`] or [`RapidGossipSync`].
13527 typedef enum LDKGossipSync_Tag {
13529 * Gossip sync via the lightning peer-to-peer network as defined by BOLT 7.
13533 * Rapid gossip sync from a trusted server.
13535 LDKGossipSync_Rapid,
13539 LDKGossipSync_None,
13541 * Must be last for serialization purposes
13543 LDKGossipSync_Sentinel,
13544 } LDKGossipSync_Tag;
13546 typedef struct MUST_USE_STRUCT LDKGossipSync {
13547 LDKGossipSync_Tag tag;
13551 * Note that this field is expected to be a reference.
13553 struct LDKP2PGossipSync p2p;
13557 * Note that this field is expected to be a reference.
13559 struct LDKRapidGossipSync rapid;
13567 * Data of the `RawInvoice` that is encoded in the data part
13569 typedef struct MUST_USE_STRUCT LDKRawDataPart {
13571 * A pointer to the opaque Rust object.
13572 * Nearly everywhere, inner must be non-null, however in places where
13573 * the Rust equivalent takes an Option, it may be set to null to indicate None.
13575 LDKnativeRawDataPart *inner;
13577 * Indicates that this is the only struct which contains the same pointer.
13578 * Rust functions which take ownership of an object provided via an argument require
13579 * this to be true and invalidate the object pointed to by inner.
13589 typedef struct MUST_USE_STRUCT LDKSha256 {
13591 * A pointer to the opaque Rust object.
13592 * Nearly everywhere, inner must be non-null, however in places where
13593 * the Rust equivalent takes an Option, it may be set to null to indicate None.
13595 LDKnativeSha256 *inner;
13597 * Indicates that this is the only struct which contains the same pointer.
13598 * Rust functions which take ownership of an object provided via an argument require
13599 * this to be true and invalidate the object pointed to by inner.
13607 * Positive duration that defines when (relatively to the timestamp) in the future the invoice
13610 typedef struct MUST_USE_STRUCT LDKExpiryTime {
13612 * A pointer to the opaque Rust object.
13613 * Nearly everywhere, inner must be non-null, however in places where
13614 * the Rust equivalent takes an Option, it may be set to null to indicate None.
13616 LDKnativeExpiryTime *inner;
13618 * Indicates that this is the only struct which contains the same pointer.
13619 * Rust functions which take ownership of an object provided via an argument require
13620 * this to be true and invalidate the object pointed to by inner.
13628 * `min_final_cltv_expiry` to use for the last HTLC in the route
13630 typedef struct MUST_USE_STRUCT LDKMinFinalCltvExpiry {
13632 * A pointer to the opaque Rust object.
13633 * Nearly everywhere, inner must be non-null, however in places where
13634 * the Rust equivalent takes an Option, it may be set to null to indicate None.
13636 LDKnativeMinFinalCltvExpiry *inner;
13638 * Indicates that this is the only struct which contains the same pointer.
13639 * Rust functions which take ownership of an object provided via an argument require
13640 * this to be true and invalidate the object pointed to by inner.
13643 } LDKMinFinalCltvExpiry;
13646 * A 20-byte byte array.
13648 typedef struct LDKTwentyBytes {
13656 * Fallback address in case no LN payment is possible
13658 typedef enum LDKFallback_Tag {
13659 LDKFallback_SegWitProgram,
13660 LDKFallback_PubKeyHash,
13661 LDKFallback_ScriptHash,
13663 * Must be last for serialization purposes
13665 LDKFallback_Sentinel,
13668 typedef struct LDKFallback_LDKSegWitProgram_Body {
13669 struct LDKu5 version;
13670 struct LDKCVec_u8Z program;
13671 } LDKFallback_LDKSegWitProgram_Body;
13673 typedef struct MUST_USE_STRUCT LDKFallback {
13674 LDKFallback_Tag tag;
13676 LDKFallback_LDKSegWitProgram_Body seg_wit_program;
13678 struct LDKTwentyBytes pub_key_hash;
13681 struct LDKTwentyBytes script_hash;
13687 * A trait defining behavior of an [`Invoice`] payer.
13689 typedef struct LDKPayer {
13691 * An opaque pointer which is passed to your function implementations as an argument.
13692 * This has no meaning in the LDK, and can be NULL or any other value.
13696 * Returns the payer's node id.
13698 struct LDKPublicKey (*node_id)(const void *this_arg);
13700 * Returns the payer's channels.
13702 struct LDKCVec_ChannelDetailsZ (*first_hops)(const void *this_arg);
13704 * Sends a payment over the Lightning Network using the given [`Route`].
13706 * Note that payment_secret (or a relevant inner pointer) may be NULL or all-0s to represent None
13708 struct LDKCResult_PaymentIdPaymentSendFailureZ (*send_payment)(const void *this_arg, const struct LDKRoute *NONNULL_PTR route, struct LDKThirtyTwoBytes payment_hash, struct LDKThirtyTwoBytes payment_secret);
13710 * Sends a spontaneous payment over the Lightning Network using the given [`Route`].
13712 struct LDKCResult_PaymentIdPaymentSendFailureZ (*send_spontaneous_payment)(const void *this_arg, const struct LDKRoute *NONNULL_PTR route, struct LDKThirtyTwoBytes payment_preimage);
13714 * Retries a failed payment path for the [`PaymentId`] using the given [`Route`].
13716 struct LDKCResult_NonePaymentSendFailureZ (*retry_payment)(const void *this_arg, const struct LDKRoute *NONNULL_PTR route, struct LDKThirtyTwoBytes payment_id);
13718 * Signals that no further retries for the given payment will occur.
13720 void (*abandon_payment)(const void *this_arg, struct LDKThirtyTwoBytes payment_id);
13722 * Frees any resources associated with this object given its this_arg pointer.
13723 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
13725 void (*free)(void *this_arg);
13729 * A trait defining behavior for routing an [`Invoice`] payment.
13731 typedef struct LDKRouter {
13733 * An opaque pointer which is passed to your function implementations as an argument.
13734 * This has no meaning in the LDK, and can be NULL or any other value.
13738 * Finds a [`Route`] between `payer` and `payee` for a payment with the given values.
13740 * Note that first_hops (or a relevant inner pointer) may be NULL or all-0s to represent None
13742 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);
13744 * Lets the router know that payment through a specific path has failed.
13746 void (*notify_payment_path_failed)(const void *this_arg, struct LDKCVec_RouteHopZ path, uint64_t short_channel_id);
13748 * Lets the router know that payment through a specific path was successful.
13750 void (*notify_payment_path_successful)(const void *this_arg, struct LDKCVec_RouteHopZ path);
13752 * Lets the router know that a payment probe was successful.
13754 void (*notify_payment_probe_successful)(const void *this_arg, struct LDKCVec_RouteHopZ path);
13756 * Lets the router know that a payment probe failed.
13758 void (*notify_payment_probe_failed)(const void *this_arg, struct LDKCVec_RouteHopZ path, uint64_t short_channel_id);
13760 * Frees any resources associated with this object given its this_arg pointer.
13761 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
13763 void (*free)(void *this_arg);
13769 * A utility for paying [`Invoice`]s and sending spontaneous payments.
13771 * See [module-level documentation] for details.
13773 * [module-level documentation]: crate::payment
13775 typedef struct MUST_USE_STRUCT LDKInvoicePayer {
13777 * A pointer to the opaque Rust object.
13778 * Nearly everywhere, inner must be non-null, however in places where
13779 * the Rust equivalent takes an Option, it may be set to null to indicate None.
13781 LDKnativeInvoicePayer *inner;
13783 * Indicates that this is the only struct which contains the same pointer.
13784 * Rust functions which take ownership of an object provided via an argument require
13785 * this to be true and invalidate the object pointed to by inner.
13791 * Strategies available to retry payment path failures for an [`Invoice`].
13794 typedef enum LDKRetry_Tag {
13796 * Max number of attempts to retry payment.
13798 * Note that this is the number of *path* failures, not full payment retries. For multi-path
13799 * payments, if this is less than the total number of paths, we will never even retry all of the
13804 * Time elapsed before abandoning retries for a payment.
13808 * Must be last for serialization purposes
13813 typedef struct MUST_USE_STRUCT LDKRetry {
13817 uintptr_t attempts;
13828 * A [`Router`] implemented using [`find_route`].
13830 typedef struct MUST_USE_STRUCT LDKDefaultRouter {
13832 * A pointer to the opaque Rust object.
13833 * Nearly everywhere, inner must be non-null, however in places where
13834 * the Rust equivalent takes an Option, it may be set to null to indicate None.
13836 LDKnativeDefaultRouter *inner;
13838 * Indicates that this is the only struct which contains the same pointer.
13839 * Rust functions which take ownership of an object provided via an argument require
13840 * this to be true and invalidate the object pointed to by inner.
13843 } LDKDefaultRouter;
13845 extern const uintptr_t MAX_BUF_SIZE;
13847 extern const uint64_t MIN_RELAY_FEE_SAT_PER_1000_WEIGHT;
13849 extern const uint32_t FEERATE_FLOOR_SATS_PER_KW;
13851 extern const uint64_t CLOSED_CHANNEL_UPDATE_ID;
13853 extern const uint32_t ANTI_REORG_DELAY;
13855 extern const uint16_t BREAKDOWN_TIMEOUT;
13857 extern const uint16_t MIN_CLTV_EXPIRY_DELTA;
13859 extern const uint32_t MIN_FINAL_CLTV_EXPIRY;
13861 extern const uintptr_t REVOKEABLE_REDEEMSCRIPT_MAX_LENGTH;
13863 extern const uint64_t UNKNOWN_CHANNEL_CAPACITY_MSAT;
13865 extern const uint32_t DEFAULT_MAX_TOTAL_CLTV_EXPIRY_DELTA;
13867 extern const uint8_t DEFAULT_MAX_PATH_COUNT;
13869 extern const uint64_t MAX_TIMESTAMP;
13871 extern const uint64_t DEFAULT_EXPIRY_TIME;
13873 extern const uint64_t DEFAULT_MIN_FINAL_CLTV_EXPIRY;
13875 extern const uint8_t TAG_PAYMENT_HASH;
13877 extern const uint8_t TAG_DESCRIPTION;
13879 extern const uint8_t TAG_PAYEE_PUB_KEY;
13881 extern const uint8_t TAG_DESCRIPTION_HASH;
13883 extern const uint8_t TAG_EXPIRY_TIME;
13885 extern const uint8_t TAG_MIN_FINAL_CLTV_EXPIRY;
13887 extern const uint8_t TAG_FALLBACK;
13889 extern const uint8_t TAG_PRIVATE_ROUTE;
13891 extern const uint8_t TAG_PAYMENT_SECRET;
13893 extern const uint8_t TAG_FEATURES;
13895 struct LDKStr _ldk_get_compiled_version(void);
13897 struct LDKStr _ldk_c_bindings_get_compiled_version(void);
13900 * Creates a new Bech32Error which has the same data as `orig`
13902 struct LDKBech32Error Bech32Error_clone(const struct LDKBech32Error *NONNULL_PTR orig);
13905 * Releases any memory held by the given `Bech32Error` (which is currently none)
13907 void Bech32Error_free(struct LDKBech32Error o);
13910 * Frees the data buffer, if data_is_owned is set and datalen > 0.
13912 void Transaction_free(struct LDKTransaction _res);
13915 * Convenience function for constructing a new TxOut
13917 struct LDKTxOut TxOut_new(struct LDKCVec_u8Z script_pubkey, uint64_t value);
13920 * Frees the data pointed to by script_pubkey.
13922 void TxOut_free(struct LDKTxOut _res);
13925 * Creates a new TxOut which has the same data as `orig` but with a new script buffer.
13927 struct LDKTxOut TxOut_clone(const struct LDKTxOut *NONNULL_PTR orig);
13930 * Frees the data buffer, if chars_is_owned is set and len > 0.
13932 void Str_free(struct LDKStr _res);
13934 #if defined(LDK_DEBUG_BUILD)
13936 * This function exists for memory safety testing purposes. It should never be used in production
13939 const void *__unmangle_inner_ptr(const void *ptr);
13943 * Frees the buffer pointed to by `data` if `datalen` is non-0.
13945 void CVec_PublicKeyZ_free(struct LDKCVec_PublicKeyZ _res);
13948 * Creates a new CResult_BlindedRouteNoneZ in the success state.
13950 struct LDKCResult_BlindedRouteNoneZ CResult_BlindedRouteNoneZ_ok(struct LDKBlindedRoute o);
13953 * Creates a new CResult_BlindedRouteNoneZ in the error state.
13955 struct LDKCResult_BlindedRouteNoneZ CResult_BlindedRouteNoneZ_err(void);
13958 * Checks if the given object is currently in the success state
13960 bool CResult_BlindedRouteNoneZ_is_ok(const struct LDKCResult_BlindedRouteNoneZ *NONNULL_PTR o);
13963 * Frees any resources used by the CResult_BlindedRouteNoneZ.
13965 void CResult_BlindedRouteNoneZ_free(struct LDKCResult_BlindedRouteNoneZ _res);
13968 * Creates a new CResult_BlindedRouteDecodeErrorZ in the success state.
13970 struct LDKCResult_BlindedRouteDecodeErrorZ CResult_BlindedRouteDecodeErrorZ_ok(struct LDKBlindedRoute o);
13973 * Creates a new CResult_BlindedRouteDecodeErrorZ in the error state.
13975 struct LDKCResult_BlindedRouteDecodeErrorZ CResult_BlindedRouteDecodeErrorZ_err(struct LDKDecodeError e);
13978 * Checks if the given object is currently in the success state
13980 bool CResult_BlindedRouteDecodeErrorZ_is_ok(const struct LDKCResult_BlindedRouteDecodeErrorZ *NONNULL_PTR o);
13983 * Frees any resources used by the CResult_BlindedRouteDecodeErrorZ.
13985 void CResult_BlindedRouteDecodeErrorZ_free(struct LDKCResult_BlindedRouteDecodeErrorZ _res);
13988 * Creates a new CResult_BlindedHopDecodeErrorZ in the success state.
13990 struct LDKCResult_BlindedHopDecodeErrorZ CResult_BlindedHopDecodeErrorZ_ok(struct LDKBlindedHop o);
13993 * Creates a new CResult_BlindedHopDecodeErrorZ in the error state.
13995 struct LDKCResult_BlindedHopDecodeErrorZ CResult_BlindedHopDecodeErrorZ_err(struct LDKDecodeError e);
13998 * Checks if the given object is currently in the success state
14000 bool CResult_BlindedHopDecodeErrorZ_is_ok(const struct LDKCResult_BlindedHopDecodeErrorZ *NONNULL_PTR o);
14003 * Frees any resources used by the CResult_BlindedHopDecodeErrorZ.
14005 void CResult_BlindedHopDecodeErrorZ_free(struct LDKCResult_BlindedHopDecodeErrorZ _res);
14008 * Creates a new CResult_NoneNoneZ in the success state.
14010 struct LDKCResult_NoneNoneZ CResult_NoneNoneZ_ok(void);
14013 * Creates a new CResult_NoneNoneZ in the error state.
14015 struct LDKCResult_NoneNoneZ CResult_NoneNoneZ_err(void);
14018 * Checks if the given object is currently in the success state
14020 bool CResult_NoneNoneZ_is_ok(const struct LDKCResult_NoneNoneZ *NONNULL_PTR o);
14023 * Frees any resources used by the CResult_NoneNoneZ.
14025 void CResult_NoneNoneZ_free(struct LDKCResult_NoneNoneZ _res);
14028 * Creates a new CResult_NoneNoneZ which has the same data as `orig`
14029 * but with all dynamically-allocated buffers duplicated in new buffers.
14031 struct LDKCResult_NoneNoneZ CResult_NoneNoneZ_clone(const struct LDKCResult_NoneNoneZ *NONNULL_PTR orig);
14034 * Creates a new CResult_CounterpartyCommitmentSecretsDecodeErrorZ in the success state.
14036 struct LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ CResult_CounterpartyCommitmentSecretsDecodeErrorZ_ok(struct LDKCounterpartyCommitmentSecrets o);
14039 * Creates a new CResult_CounterpartyCommitmentSecretsDecodeErrorZ in the error state.
14041 struct LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ CResult_CounterpartyCommitmentSecretsDecodeErrorZ_err(struct LDKDecodeError e);
14044 * Checks if the given object is currently in the success state
14046 bool CResult_CounterpartyCommitmentSecretsDecodeErrorZ_is_ok(const struct LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ *NONNULL_PTR o);
14049 * Frees any resources used by the CResult_CounterpartyCommitmentSecretsDecodeErrorZ.
14051 void CResult_CounterpartyCommitmentSecretsDecodeErrorZ_free(struct LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ _res);
14054 * Creates a new CResult_CounterpartyCommitmentSecretsDecodeErrorZ which has the same data as `orig`
14055 * but with all dynamically-allocated buffers duplicated in new buffers.
14057 struct LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ CResult_CounterpartyCommitmentSecretsDecodeErrorZ_clone(const struct LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ *NONNULL_PTR orig);
14060 * Creates a new CResult_SecretKeyErrorZ in the success state.
14062 struct LDKCResult_SecretKeyErrorZ CResult_SecretKeyErrorZ_ok(struct LDKSecretKey o);
14065 * Creates a new CResult_SecretKeyErrorZ in the error state.
14067 struct LDKCResult_SecretKeyErrorZ CResult_SecretKeyErrorZ_err(enum LDKSecp256k1Error e);
14070 * Checks if the given object is currently in the success state
14072 bool CResult_SecretKeyErrorZ_is_ok(const struct LDKCResult_SecretKeyErrorZ *NONNULL_PTR o);
14075 * Frees any resources used by the CResult_SecretKeyErrorZ.
14077 void CResult_SecretKeyErrorZ_free(struct LDKCResult_SecretKeyErrorZ _res);
14080 * Creates a new CResult_SecretKeyErrorZ which has the same data as `orig`
14081 * but with all dynamically-allocated buffers duplicated in new buffers.
14083 struct LDKCResult_SecretKeyErrorZ CResult_SecretKeyErrorZ_clone(const struct LDKCResult_SecretKeyErrorZ *NONNULL_PTR orig);
14086 * Creates a new CResult_PublicKeyErrorZ in the success state.
14088 struct LDKCResult_PublicKeyErrorZ CResult_PublicKeyErrorZ_ok(struct LDKPublicKey o);
14091 * Creates a new CResult_PublicKeyErrorZ in the error state.
14093 struct LDKCResult_PublicKeyErrorZ CResult_PublicKeyErrorZ_err(enum LDKSecp256k1Error e);
14096 * Checks if the given object is currently in the success state
14098 bool CResult_PublicKeyErrorZ_is_ok(const struct LDKCResult_PublicKeyErrorZ *NONNULL_PTR o);
14101 * Frees any resources used by the CResult_PublicKeyErrorZ.
14103 void CResult_PublicKeyErrorZ_free(struct LDKCResult_PublicKeyErrorZ _res);
14106 * Creates a new CResult_PublicKeyErrorZ which has the same data as `orig`
14107 * but with all dynamically-allocated buffers duplicated in new buffers.
14109 struct LDKCResult_PublicKeyErrorZ CResult_PublicKeyErrorZ_clone(const struct LDKCResult_PublicKeyErrorZ *NONNULL_PTR orig);
14112 * Creates a new CResult_TxCreationKeysDecodeErrorZ in the success state.
14114 struct LDKCResult_TxCreationKeysDecodeErrorZ CResult_TxCreationKeysDecodeErrorZ_ok(struct LDKTxCreationKeys o);
14117 * Creates a new CResult_TxCreationKeysDecodeErrorZ in the error state.
14119 struct LDKCResult_TxCreationKeysDecodeErrorZ CResult_TxCreationKeysDecodeErrorZ_err(struct LDKDecodeError e);
14122 * Checks if the given object is currently in the success state
14124 bool CResult_TxCreationKeysDecodeErrorZ_is_ok(const struct LDKCResult_TxCreationKeysDecodeErrorZ *NONNULL_PTR o);
14127 * Frees any resources used by the CResult_TxCreationKeysDecodeErrorZ.
14129 void CResult_TxCreationKeysDecodeErrorZ_free(struct LDKCResult_TxCreationKeysDecodeErrorZ _res);
14132 * Creates a new CResult_TxCreationKeysDecodeErrorZ which has the same data as `orig`
14133 * but with all dynamically-allocated buffers duplicated in new buffers.
14135 struct LDKCResult_TxCreationKeysDecodeErrorZ CResult_TxCreationKeysDecodeErrorZ_clone(const struct LDKCResult_TxCreationKeysDecodeErrorZ *NONNULL_PTR orig);
14138 * Creates a new CResult_ChannelPublicKeysDecodeErrorZ in the success state.
14140 struct LDKCResult_ChannelPublicKeysDecodeErrorZ CResult_ChannelPublicKeysDecodeErrorZ_ok(struct LDKChannelPublicKeys o);
14143 * Creates a new CResult_ChannelPublicKeysDecodeErrorZ in the error state.
14145 struct LDKCResult_ChannelPublicKeysDecodeErrorZ CResult_ChannelPublicKeysDecodeErrorZ_err(struct LDKDecodeError e);
14148 * Checks if the given object is currently in the success state
14150 bool CResult_ChannelPublicKeysDecodeErrorZ_is_ok(const struct LDKCResult_ChannelPublicKeysDecodeErrorZ *NONNULL_PTR o);
14153 * Frees any resources used by the CResult_ChannelPublicKeysDecodeErrorZ.
14155 void CResult_ChannelPublicKeysDecodeErrorZ_free(struct LDKCResult_ChannelPublicKeysDecodeErrorZ _res);
14158 * Creates a new CResult_ChannelPublicKeysDecodeErrorZ which has the same data as `orig`
14159 * but with all dynamically-allocated buffers duplicated in new buffers.
14161 struct LDKCResult_ChannelPublicKeysDecodeErrorZ CResult_ChannelPublicKeysDecodeErrorZ_clone(const struct LDKCResult_ChannelPublicKeysDecodeErrorZ *NONNULL_PTR orig);
14164 * Creates a new CResult_TxCreationKeysErrorZ in the success state.
14166 struct LDKCResult_TxCreationKeysErrorZ CResult_TxCreationKeysErrorZ_ok(struct LDKTxCreationKeys o);
14169 * Creates a new CResult_TxCreationKeysErrorZ in the error state.
14171 struct LDKCResult_TxCreationKeysErrorZ CResult_TxCreationKeysErrorZ_err(enum LDKSecp256k1Error e);
14174 * Checks if the given object is currently in the success state
14176 bool CResult_TxCreationKeysErrorZ_is_ok(const struct LDKCResult_TxCreationKeysErrorZ *NONNULL_PTR o);
14179 * Frees any resources used by the CResult_TxCreationKeysErrorZ.
14181 void CResult_TxCreationKeysErrorZ_free(struct LDKCResult_TxCreationKeysErrorZ _res);
14184 * Creates a new CResult_TxCreationKeysErrorZ which has the same data as `orig`
14185 * but with all dynamically-allocated buffers duplicated in new buffers.
14187 struct LDKCResult_TxCreationKeysErrorZ CResult_TxCreationKeysErrorZ_clone(const struct LDKCResult_TxCreationKeysErrorZ *NONNULL_PTR orig);
14190 * Constructs a new COption_u32Z containing a u32
14192 struct LDKCOption_u32Z COption_u32Z_some(uint32_t o);
14195 * Constructs a new COption_u32Z containing nothing
14197 struct LDKCOption_u32Z COption_u32Z_none(void);
14200 * Frees any resources associated with the u32, if we are in the Some state
14202 void COption_u32Z_free(struct LDKCOption_u32Z _res);
14205 * Creates a new COption_u32Z which has the same data as `orig`
14206 * but with all dynamically-allocated buffers duplicated in new buffers.
14208 struct LDKCOption_u32Z COption_u32Z_clone(const struct LDKCOption_u32Z *NONNULL_PTR orig);
14211 * Creates a new CResult_HTLCOutputInCommitmentDecodeErrorZ in the success state.
14213 struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ CResult_HTLCOutputInCommitmentDecodeErrorZ_ok(struct LDKHTLCOutputInCommitment o);
14216 * Creates a new CResult_HTLCOutputInCommitmentDecodeErrorZ in the error state.
14218 struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ CResult_HTLCOutputInCommitmentDecodeErrorZ_err(struct LDKDecodeError e);
14221 * Checks if the given object is currently in the success state
14223 bool CResult_HTLCOutputInCommitmentDecodeErrorZ_is_ok(const struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ *NONNULL_PTR o);
14226 * Frees any resources used by the CResult_HTLCOutputInCommitmentDecodeErrorZ.
14228 void CResult_HTLCOutputInCommitmentDecodeErrorZ_free(struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ _res);
14231 * Creates a new CResult_HTLCOutputInCommitmentDecodeErrorZ which has the same data as `orig`
14232 * but with all dynamically-allocated buffers duplicated in new buffers.
14234 struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ CResult_HTLCOutputInCommitmentDecodeErrorZ_clone(const struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ *NONNULL_PTR orig);
14237 * Constructs a new COption_NoneZ containing a
14239 enum LDKCOption_NoneZ COption_NoneZ_some(void);
14242 * Constructs a new COption_NoneZ containing nothing
14244 enum LDKCOption_NoneZ COption_NoneZ_none(void);
14247 * Frees any resources associated with the , if we are in the Some state
14249 void COption_NoneZ_free(enum LDKCOption_NoneZ _res);
14252 * Creates a new CResult_CounterpartyChannelTransactionParametersDecodeErrorZ in the success state.
14254 struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_ok(struct LDKCounterpartyChannelTransactionParameters o);
14257 * Creates a new CResult_CounterpartyChannelTransactionParametersDecodeErrorZ in the error state.
14259 struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_err(struct LDKDecodeError e);
14262 * Checks if the given object is currently in the success state
14264 bool CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_is_ok(const struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ *NONNULL_PTR o);
14267 * Frees any resources used by the CResult_CounterpartyChannelTransactionParametersDecodeErrorZ.
14269 void CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_free(struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ _res);
14272 * Creates a new CResult_CounterpartyChannelTransactionParametersDecodeErrorZ which has the same data as `orig`
14273 * but with all dynamically-allocated buffers duplicated in new buffers.
14275 struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_clone(const struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ *NONNULL_PTR orig);
14278 * Creates a new CResult_ChannelTransactionParametersDecodeErrorZ in the success state.
14280 struct LDKCResult_ChannelTransactionParametersDecodeErrorZ CResult_ChannelTransactionParametersDecodeErrorZ_ok(struct LDKChannelTransactionParameters o);
14283 * Creates a new CResult_ChannelTransactionParametersDecodeErrorZ in the error state.
14285 struct LDKCResult_ChannelTransactionParametersDecodeErrorZ CResult_ChannelTransactionParametersDecodeErrorZ_err(struct LDKDecodeError e);
14288 * Checks if the given object is currently in the success state
14290 bool CResult_ChannelTransactionParametersDecodeErrorZ_is_ok(const struct LDKCResult_ChannelTransactionParametersDecodeErrorZ *NONNULL_PTR o);
14293 * Frees any resources used by the CResult_ChannelTransactionParametersDecodeErrorZ.
14295 void CResult_ChannelTransactionParametersDecodeErrorZ_free(struct LDKCResult_ChannelTransactionParametersDecodeErrorZ _res);
14298 * Creates a new CResult_ChannelTransactionParametersDecodeErrorZ which has the same data as `orig`
14299 * but with all dynamically-allocated buffers duplicated in new buffers.
14301 struct LDKCResult_ChannelTransactionParametersDecodeErrorZ CResult_ChannelTransactionParametersDecodeErrorZ_clone(const struct LDKCResult_ChannelTransactionParametersDecodeErrorZ *NONNULL_PTR orig);
14304 * Frees the buffer pointed to by `data` if `datalen` is non-0.
14306 void CVec_SignatureZ_free(struct LDKCVec_SignatureZ _res);
14309 * Creates a new CResult_HolderCommitmentTransactionDecodeErrorZ in the success state.
14311 struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ CResult_HolderCommitmentTransactionDecodeErrorZ_ok(struct LDKHolderCommitmentTransaction o);
14314 * Creates a new CResult_HolderCommitmentTransactionDecodeErrorZ in the error state.
14316 struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ CResult_HolderCommitmentTransactionDecodeErrorZ_err(struct LDKDecodeError e);
14319 * Checks if the given object is currently in the success state
14321 bool CResult_HolderCommitmentTransactionDecodeErrorZ_is_ok(const struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ *NONNULL_PTR o);
14324 * Frees any resources used by the CResult_HolderCommitmentTransactionDecodeErrorZ.
14326 void CResult_HolderCommitmentTransactionDecodeErrorZ_free(struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ _res);
14329 * Creates a new CResult_HolderCommitmentTransactionDecodeErrorZ which has the same data as `orig`
14330 * but with all dynamically-allocated buffers duplicated in new buffers.
14332 struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ CResult_HolderCommitmentTransactionDecodeErrorZ_clone(const struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ *NONNULL_PTR orig);
14335 * Creates a new CResult_BuiltCommitmentTransactionDecodeErrorZ in the success state.
14337 struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ CResult_BuiltCommitmentTransactionDecodeErrorZ_ok(struct LDKBuiltCommitmentTransaction o);
14340 * Creates a new CResult_BuiltCommitmentTransactionDecodeErrorZ in the error state.
14342 struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ CResult_BuiltCommitmentTransactionDecodeErrorZ_err(struct LDKDecodeError e);
14345 * Checks if the given object is currently in the success state
14347 bool CResult_BuiltCommitmentTransactionDecodeErrorZ_is_ok(const struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ *NONNULL_PTR o);
14350 * Frees any resources used by the CResult_BuiltCommitmentTransactionDecodeErrorZ.
14352 void CResult_BuiltCommitmentTransactionDecodeErrorZ_free(struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ _res);
14355 * Creates a new CResult_BuiltCommitmentTransactionDecodeErrorZ which has the same data as `orig`
14356 * but with all dynamically-allocated buffers duplicated in new buffers.
14358 struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ CResult_BuiltCommitmentTransactionDecodeErrorZ_clone(const struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ *NONNULL_PTR orig);
14361 * Creates a new CResult_TrustedClosingTransactionNoneZ in the success state.
14363 struct LDKCResult_TrustedClosingTransactionNoneZ CResult_TrustedClosingTransactionNoneZ_ok(struct LDKTrustedClosingTransaction o);
14366 * Creates a new CResult_TrustedClosingTransactionNoneZ in the error state.
14368 struct LDKCResult_TrustedClosingTransactionNoneZ CResult_TrustedClosingTransactionNoneZ_err(void);
14371 * Checks if the given object is currently in the success state
14373 bool CResult_TrustedClosingTransactionNoneZ_is_ok(const struct LDKCResult_TrustedClosingTransactionNoneZ *NONNULL_PTR o);
14376 * Frees any resources used by the CResult_TrustedClosingTransactionNoneZ.
14378 void CResult_TrustedClosingTransactionNoneZ_free(struct LDKCResult_TrustedClosingTransactionNoneZ _res);
14381 * Creates a new CResult_CommitmentTransactionDecodeErrorZ in the success state.
14383 struct LDKCResult_CommitmentTransactionDecodeErrorZ CResult_CommitmentTransactionDecodeErrorZ_ok(struct LDKCommitmentTransaction o);
14386 * Creates a new CResult_CommitmentTransactionDecodeErrorZ in the error state.
14388 struct LDKCResult_CommitmentTransactionDecodeErrorZ CResult_CommitmentTransactionDecodeErrorZ_err(struct LDKDecodeError e);
14391 * Checks if the given object is currently in the success state
14393 bool CResult_CommitmentTransactionDecodeErrorZ_is_ok(const struct LDKCResult_CommitmentTransactionDecodeErrorZ *NONNULL_PTR o);
14396 * Frees any resources used by the CResult_CommitmentTransactionDecodeErrorZ.
14398 void CResult_CommitmentTransactionDecodeErrorZ_free(struct LDKCResult_CommitmentTransactionDecodeErrorZ _res);
14401 * Creates a new CResult_CommitmentTransactionDecodeErrorZ which has the same data as `orig`
14402 * but with all dynamically-allocated buffers duplicated in new buffers.
14404 struct LDKCResult_CommitmentTransactionDecodeErrorZ CResult_CommitmentTransactionDecodeErrorZ_clone(const struct LDKCResult_CommitmentTransactionDecodeErrorZ *NONNULL_PTR orig);
14407 * Creates a new CResult_TrustedCommitmentTransactionNoneZ in the success state.
14409 struct LDKCResult_TrustedCommitmentTransactionNoneZ CResult_TrustedCommitmentTransactionNoneZ_ok(struct LDKTrustedCommitmentTransaction o);
14412 * Creates a new CResult_TrustedCommitmentTransactionNoneZ in the error state.
14414 struct LDKCResult_TrustedCommitmentTransactionNoneZ CResult_TrustedCommitmentTransactionNoneZ_err(void);
14417 * Checks if the given object is currently in the success state
14419 bool CResult_TrustedCommitmentTransactionNoneZ_is_ok(const struct LDKCResult_TrustedCommitmentTransactionNoneZ *NONNULL_PTR o);
14422 * Frees any resources used by the CResult_TrustedCommitmentTransactionNoneZ.
14424 void CResult_TrustedCommitmentTransactionNoneZ_free(struct LDKCResult_TrustedCommitmentTransactionNoneZ _res);
14427 * Creates a new CResult_CVec_SignatureZNoneZ in the success state.
14429 struct LDKCResult_CVec_SignatureZNoneZ CResult_CVec_SignatureZNoneZ_ok(struct LDKCVec_SignatureZ o);
14432 * Creates a new CResult_CVec_SignatureZNoneZ in the error state.
14434 struct LDKCResult_CVec_SignatureZNoneZ CResult_CVec_SignatureZNoneZ_err(void);
14437 * Checks if the given object is currently in the success state
14439 bool CResult_CVec_SignatureZNoneZ_is_ok(const struct LDKCResult_CVec_SignatureZNoneZ *NONNULL_PTR o);
14442 * Frees any resources used by the CResult_CVec_SignatureZNoneZ.
14444 void CResult_CVec_SignatureZNoneZ_free(struct LDKCResult_CVec_SignatureZNoneZ _res);
14447 * Creates a new CResult_CVec_SignatureZNoneZ which has the same data as `orig`
14448 * but with all dynamically-allocated buffers duplicated in new buffers.
14450 struct LDKCResult_CVec_SignatureZNoneZ CResult_CVec_SignatureZNoneZ_clone(const struct LDKCResult_CVec_SignatureZNoneZ *NONNULL_PTR orig);
14453 * Creates a new CResult_ShutdownScriptDecodeErrorZ in the success state.
14455 struct LDKCResult_ShutdownScriptDecodeErrorZ CResult_ShutdownScriptDecodeErrorZ_ok(struct LDKShutdownScript o);
14458 * Creates a new CResult_ShutdownScriptDecodeErrorZ in the error state.
14460 struct LDKCResult_ShutdownScriptDecodeErrorZ CResult_ShutdownScriptDecodeErrorZ_err(struct LDKDecodeError e);
14463 * Checks if the given object is currently in the success state
14465 bool CResult_ShutdownScriptDecodeErrorZ_is_ok(const struct LDKCResult_ShutdownScriptDecodeErrorZ *NONNULL_PTR o);
14468 * Frees any resources used by the CResult_ShutdownScriptDecodeErrorZ.
14470 void CResult_ShutdownScriptDecodeErrorZ_free(struct LDKCResult_ShutdownScriptDecodeErrorZ _res);
14473 * Creates a new CResult_ShutdownScriptDecodeErrorZ which has the same data as `orig`
14474 * but with all dynamically-allocated buffers duplicated in new buffers.
14476 struct LDKCResult_ShutdownScriptDecodeErrorZ CResult_ShutdownScriptDecodeErrorZ_clone(const struct LDKCResult_ShutdownScriptDecodeErrorZ *NONNULL_PTR orig);
14479 * Creates a new CResult_ShutdownScriptInvalidShutdownScriptZ in the success state.
14481 struct LDKCResult_ShutdownScriptInvalidShutdownScriptZ CResult_ShutdownScriptInvalidShutdownScriptZ_ok(struct LDKShutdownScript o);
14484 * Creates a new CResult_ShutdownScriptInvalidShutdownScriptZ in the error state.
14486 struct LDKCResult_ShutdownScriptInvalidShutdownScriptZ CResult_ShutdownScriptInvalidShutdownScriptZ_err(struct LDKInvalidShutdownScript e);
14489 * Checks if the given object is currently in the success state
14491 bool CResult_ShutdownScriptInvalidShutdownScriptZ_is_ok(const struct LDKCResult_ShutdownScriptInvalidShutdownScriptZ *NONNULL_PTR o);
14494 * Frees any resources used by the CResult_ShutdownScriptInvalidShutdownScriptZ.
14496 void CResult_ShutdownScriptInvalidShutdownScriptZ_free(struct LDKCResult_ShutdownScriptInvalidShutdownScriptZ _res);
14499 * Creates a new CResult_ShutdownScriptInvalidShutdownScriptZ which has the same data as `orig`
14500 * but with all dynamically-allocated buffers duplicated in new buffers.
14502 struct LDKCResult_ShutdownScriptInvalidShutdownScriptZ CResult_ShutdownScriptInvalidShutdownScriptZ_clone(const struct LDKCResult_ShutdownScriptInvalidShutdownScriptZ *NONNULL_PTR orig);
14505 * Constructs a new COption_WriteableScoreZ containing a crate::lightning::routing::scoring::WriteableScore
14507 struct LDKCOption_WriteableScoreZ COption_WriteableScoreZ_some(struct LDKWriteableScore o);
14510 * Constructs a new COption_WriteableScoreZ containing nothing
14512 struct LDKCOption_WriteableScoreZ COption_WriteableScoreZ_none(void);
14515 * Frees any resources associated with the crate::lightning::routing::scoring::WriteableScore, if we are in the Some state
14517 void COption_WriteableScoreZ_free(struct LDKCOption_WriteableScoreZ _res);
14520 * Creates a new CResult_NoneErrorZ in the success state.
14522 struct LDKCResult_NoneErrorZ CResult_NoneErrorZ_ok(void);
14525 * Creates a new CResult_NoneErrorZ in the error state.
14527 struct LDKCResult_NoneErrorZ CResult_NoneErrorZ_err(enum LDKIOError e);
14530 * Checks if the given object is currently in the success state
14532 bool CResult_NoneErrorZ_is_ok(const struct LDKCResult_NoneErrorZ *NONNULL_PTR o);
14535 * Frees any resources used by the CResult_NoneErrorZ.
14537 void CResult_NoneErrorZ_free(struct LDKCResult_NoneErrorZ _res);
14540 * Creates a new CResult_NoneErrorZ which has the same data as `orig`
14541 * but with all dynamically-allocated buffers duplicated in new buffers.
14543 struct LDKCResult_NoneErrorZ CResult_NoneErrorZ_clone(const struct LDKCResult_NoneErrorZ *NONNULL_PTR orig);
14546 * Creates a new CResult_RouteHopDecodeErrorZ in the success state.
14548 struct LDKCResult_RouteHopDecodeErrorZ CResult_RouteHopDecodeErrorZ_ok(struct LDKRouteHop o);
14551 * Creates a new CResult_RouteHopDecodeErrorZ in the error state.
14553 struct LDKCResult_RouteHopDecodeErrorZ CResult_RouteHopDecodeErrorZ_err(struct LDKDecodeError e);
14556 * Checks if the given object is currently in the success state
14558 bool CResult_RouteHopDecodeErrorZ_is_ok(const struct LDKCResult_RouteHopDecodeErrorZ *NONNULL_PTR o);
14561 * Frees any resources used by the CResult_RouteHopDecodeErrorZ.
14563 void CResult_RouteHopDecodeErrorZ_free(struct LDKCResult_RouteHopDecodeErrorZ _res);
14566 * Creates a new CResult_RouteHopDecodeErrorZ which has the same data as `orig`
14567 * but with all dynamically-allocated buffers duplicated in new buffers.
14569 struct LDKCResult_RouteHopDecodeErrorZ CResult_RouteHopDecodeErrorZ_clone(const struct LDKCResult_RouteHopDecodeErrorZ *NONNULL_PTR orig);
14572 * Frees the buffer pointed to by `data` if `datalen` is non-0.
14574 void CVec_RouteHopZ_free(struct LDKCVec_RouteHopZ _res);
14577 * Frees the buffer pointed to by `data` if `datalen` is non-0.
14579 void CVec_CVec_RouteHopZZ_free(struct LDKCVec_CVec_RouteHopZZ _res);
14582 * Creates a new CResult_RouteDecodeErrorZ in the success state.
14584 struct LDKCResult_RouteDecodeErrorZ CResult_RouteDecodeErrorZ_ok(struct LDKRoute o);
14587 * Creates a new CResult_RouteDecodeErrorZ in the error state.
14589 struct LDKCResult_RouteDecodeErrorZ CResult_RouteDecodeErrorZ_err(struct LDKDecodeError e);
14592 * Checks if the given object is currently in the success state
14594 bool CResult_RouteDecodeErrorZ_is_ok(const struct LDKCResult_RouteDecodeErrorZ *NONNULL_PTR o);
14597 * Frees any resources used by the CResult_RouteDecodeErrorZ.
14599 void CResult_RouteDecodeErrorZ_free(struct LDKCResult_RouteDecodeErrorZ _res);
14602 * Creates a new CResult_RouteDecodeErrorZ which has the same data as `orig`
14603 * but with all dynamically-allocated buffers duplicated in new buffers.
14605 struct LDKCResult_RouteDecodeErrorZ CResult_RouteDecodeErrorZ_clone(const struct LDKCResult_RouteDecodeErrorZ *NONNULL_PTR orig);
14608 * Creates a new CResult_RouteParametersDecodeErrorZ in the success state.
14610 struct LDKCResult_RouteParametersDecodeErrorZ CResult_RouteParametersDecodeErrorZ_ok(struct LDKRouteParameters o);
14613 * Creates a new CResult_RouteParametersDecodeErrorZ in the error state.
14615 struct LDKCResult_RouteParametersDecodeErrorZ CResult_RouteParametersDecodeErrorZ_err(struct LDKDecodeError e);
14618 * Checks if the given object is currently in the success state
14620 bool CResult_RouteParametersDecodeErrorZ_is_ok(const struct LDKCResult_RouteParametersDecodeErrorZ *NONNULL_PTR o);
14623 * Frees any resources used by the CResult_RouteParametersDecodeErrorZ.
14625 void CResult_RouteParametersDecodeErrorZ_free(struct LDKCResult_RouteParametersDecodeErrorZ _res);
14628 * Creates a new CResult_RouteParametersDecodeErrorZ which has the same data as `orig`
14629 * but with all dynamically-allocated buffers duplicated in new buffers.
14631 struct LDKCResult_RouteParametersDecodeErrorZ CResult_RouteParametersDecodeErrorZ_clone(const struct LDKCResult_RouteParametersDecodeErrorZ *NONNULL_PTR orig);
14634 * Frees the buffer pointed to by `data` if `datalen` is non-0.
14636 void CVec_RouteHintZ_free(struct LDKCVec_RouteHintZ _res);
14639 * Constructs a new COption_u64Z containing a u64
14641 struct LDKCOption_u64Z COption_u64Z_some(uint64_t o);
14644 * Constructs a new COption_u64Z containing nothing
14646 struct LDKCOption_u64Z COption_u64Z_none(void);
14649 * Frees any resources associated with the u64, if we are in the Some state
14651 void COption_u64Z_free(struct LDKCOption_u64Z _res);
14654 * Creates a new COption_u64Z which has the same data as `orig`
14655 * but with all dynamically-allocated buffers duplicated in new buffers.
14657 struct LDKCOption_u64Z COption_u64Z_clone(const struct LDKCOption_u64Z *NONNULL_PTR orig);
14660 * Frees the buffer pointed to by `data` if `datalen` is non-0.
14662 void CVec_u64Z_free(struct LDKCVec_u64Z _res);
14665 * Creates a new CResult_PaymentParametersDecodeErrorZ in the success state.
14667 struct LDKCResult_PaymentParametersDecodeErrorZ CResult_PaymentParametersDecodeErrorZ_ok(struct LDKPaymentParameters o);
14670 * Creates a new CResult_PaymentParametersDecodeErrorZ in the error state.
14672 struct LDKCResult_PaymentParametersDecodeErrorZ CResult_PaymentParametersDecodeErrorZ_err(struct LDKDecodeError e);
14675 * Checks if the given object is currently in the success state
14677 bool CResult_PaymentParametersDecodeErrorZ_is_ok(const struct LDKCResult_PaymentParametersDecodeErrorZ *NONNULL_PTR o);
14680 * Frees any resources used by the CResult_PaymentParametersDecodeErrorZ.
14682 void CResult_PaymentParametersDecodeErrorZ_free(struct LDKCResult_PaymentParametersDecodeErrorZ _res);
14685 * Creates a new CResult_PaymentParametersDecodeErrorZ which has the same data as `orig`
14686 * but with all dynamically-allocated buffers duplicated in new buffers.
14688 struct LDKCResult_PaymentParametersDecodeErrorZ CResult_PaymentParametersDecodeErrorZ_clone(const struct LDKCResult_PaymentParametersDecodeErrorZ *NONNULL_PTR orig);
14691 * Frees the buffer pointed to by `data` if `datalen` is non-0.
14693 void CVec_RouteHintHopZ_free(struct LDKCVec_RouteHintHopZ _res);
14696 * Creates a new CResult_RouteHintDecodeErrorZ in the success state.
14698 struct LDKCResult_RouteHintDecodeErrorZ CResult_RouteHintDecodeErrorZ_ok(struct LDKRouteHint o);
14701 * Creates a new CResult_RouteHintDecodeErrorZ in the error state.
14703 struct LDKCResult_RouteHintDecodeErrorZ CResult_RouteHintDecodeErrorZ_err(struct LDKDecodeError e);
14706 * Checks if the given object is currently in the success state
14708 bool CResult_RouteHintDecodeErrorZ_is_ok(const struct LDKCResult_RouteHintDecodeErrorZ *NONNULL_PTR o);
14711 * Frees any resources used by the CResult_RouteHintDecodeErrorZ.
14713 void CResult_RouteHintDecodeErrorZ_free(struct LDKCResult_RouteHintDecodeErrorZ _res);
14716 * Creates a new CResult_RouteHintDecodeErrorZ which has the same data as `orig`
14717 * but with all dynamically-allocated buffers duplicated in new buffers.
14719 struct LDKCResult_RouteHintDecodeErrorZ CResult_RouteHintDecodeErrorZ_clone(const struct LDKCResult_RouteHintDecodeErrorZ *NONNULL_PTR orig);
14722 * Creates a new CResult_RouteHintHopDecodeErrorZ in the success state.
14724 struct LDKCResult_RouteHintHopDecodeErrorZ CResult_RouteHintHopDecodeErrorZ_ok(struct LDKRouteHintHop o);
14727 * Creates a new CResult_RouteHintHopDecodeErrorZ in the error state.
14729 struct LDKCResult_RouteHintHopDecodeErrorZ CResult_RouteHintHopDecodeErrorZ_err(struct LDKDecodeError e);
14732 * Checks if the given object is currently in the success state
14734 bool CResult_RouteHintHopDecodeErrorZ_is_ok(const struct LDKCResult_RouteHintHopDecodeErrorZ *NONNULL_PTR o);
14737 * Frees any resources used by the CResult_RouteHintHopDecodeErrorZ.
14739 void CResult_RouteHintHopDecodeErrorZ_free(struct LDKCResult_RouteHintHopDecodeErrorZ _res);
14742 * Creates a new CResult_RouteHintHopDecodeErrorZ which has the same data as `orig`
14743 * but with all dynamically-allocated buffers duplicated in new buffers.
14745 struct LDKCResult_RouteHintHopDecodeErrorZ CResult_RouteHintHopDecodeErrorZ_clone(const struct LDKCResult_RouteHintHopDecodeErrorZ *NONNULL_PTR orig);
14748 * Frees the buffer pointed to by `data` if `datalen` is non-0.
14750 void CVec_ChannelDetailsZ_free(struct LDKCVec_ChannelDetailsZ _res);
14753 * Creates a new CResult_RouteLightningErrorZ in the success state.
14755 struct LDKCResult_RouteLightningErrorZ CResult_RouteLightningErrorZ_ok(struct LDKRoute o);
14758 * Creates a new CResult_RouteLightningErrorZ in the error state.
14760 struct LDKCResult_RouteLightningErrorZ CResult_RouteLightningErrorZ_err(struct LDKLightningError e);
14763 * Checks if the given object is currently in the success state
14765 bool CResult_RouteLightningErrorZ_is_ok(const struct LDKCResult_RouteLightningErrorZ *NONNULL_PTR o);
14768 * Frees any resources used by the CResult_RouteLightningErrorZ.
14770 void CResult_RouteLightningErrorZ_free(struct LDKCResult_RouteLightningErrorZ _res);
14773 * Creates a new CResult_RouteLightningErrorZ which has the same data as `orig`
14774 * but with all dynamically-allocated buffers duplicated in new buffers.
14776 struct LDKCResult_RouteLightningErrorZ CResult_RouteLightningErrorZ_clone(const struct LDKCResult_RouteLightningErrorZ *NONNULL_PTR orig);
14779 * Creates a new CResult_PaymentPurposeDecodeErrorZ in the success state.
14781 struct LDKCResult_PaymentPurposeDecodeErrorZ CResult_PaymentPurposeDecodeErrorZ_ok(struct LDKPaymentPurpose o);
14784 * Creates a new CResult_PaymentPurposeDecodeErrorZ in the error state.
14786 struct LDKCResult_PaymentPurposeDecodeErrorZ CResult_PaymentPurposeDecodeErrorZ_err(struct LDKDecodeError e);
14789 * Checks if the given object is currently in the success state
14791 bool CResult_PaymentPurposeDecodeErrorZ_is_ok(const struct LDKCResult_PaymentPurposeDecodeErrorZ *NONNULL_PTR o);
14794 * Frees any resources used by the CResult_PaymentPurposeDecodeErrorZ.
14796 void CResult_PaymentPurposeDecodeErrorZ_free(struct LDKCResult_PaymentPurposeDecodeErrorZ _res);
14799 * Creates a new CResult_PaymentPurposeDecodeErrorZ which has the same data as `orig`
14800 * but with all dynamically-allocated buffers duplicated in new buffers.
14802 struct LDKCResult_PaymentPurposeDecodeErrorZ CResult_PaymentPurposeDecodeErrorZ_clone(const struct LDKCResult_PaymentPurposeDecodeErrorZ *NONNULL_PTR orig);
14805 * Constructs a new COption_ClosureReasonZ containing a crate::lightning::util::events::ClosureReason
14807 struct LDKCOption_ClosureReasonZ COption_ClosureReasonZ_some(struct LDKClosureReason o);
14810 * Constructs a new COption_ClosureReasonZ containing nothing
14812 struct LDKCOption_ClosureReasonZ COption_ClosureReasonZ_none(void);
14815 * Frees any resources associated with the crate::lightning::util::events::ClosureReason, if we are in the Some state
14817 void COption_ClosureReasonZ_free(struct LDKCOption_ClosureReasonZ _res);
14820 * Creates a new COption_ClosureReasonZ which has the same data as `orig`
14821 * but with all dynamically-allocated buffers duplicated in new buffers.
14823 struct LDKCOption_ClosureReasonZ COption_ClosureReasonZ_clone(const struct LDKCOption_ClosureReasonZ *NONNULL_PTR orig);
14826 * Creates a new CResult_COption_ClosureReasonZDecodeErrorZ in the success state.
14828 struct LDKCResult_COption_ClosureReasonZDecodeErrorZ CResult_COption_ClosureReasonZDecodeErrorZ_ok(struct LDKCOption_ClosureReasonZ o);
14831 * Creates a new CResult_COption_ClosureReasonZDecodeErrorZ in the error state.
14833 struct LDKCResult_COption_ClosureReasonZDecodeErrorZ CResult_COption_ClosureReasonZDecodeErrorZ_err(struct LDKDecodeError e);
14836 * Checks if the given object is currently in the success state
14838 bool CResult_COption_ClosureReasonZDecodeErrorZ_is_ok(const struct LDKCResult_COption_ClosureReasonZDecodeErrorZ *NONNULL_PTR o);
14841 * Frees any resources used by the CResult_COption_ClosureReasonZDecodeErrorZ.
14843 void CResult_COption_ClosureReasonZDecodeErrorZ_free(struct LDKCResult_COption_ClosureReasonZDecodeErrorZ _res);
14846 * Creates a new CResult_COption_ClosureReasonZDecodeErrorZ which has the same data as `orig`
14847 * but with all dynamically-allocated buffers duplicated in new buffers.
14849 struct LDKCResult_COption_ClosureReasonZDecodeErrorZ CResult_COption_ClosureReasonZDecodeErrorZ_clone(const struct LDKCResult_COption_ClosureReasonZDecodeErrorZ *NONNULL_PTR orig);
14852 * Constructs a new COption_HTLCDestinationZ containing a crate::lightning::util::events::HTLCDestination
14854 struct LDKCOption_HTLCDestinationZ COption_HTLCDestinationZ_some(struct LDKHTLCDestination o);
14857 * Constructs a new COption_HTLCDestinationZ containing nothing
14859 struct LDKCOption_HTLCDestinationZ COption_HTLCDestinationZ_none(void);
14862 * Frees any resources associated with the crate::lightning::util::events::HTLCDestination, if we are in the Some state
14864 void COption_HTLCDestinationZ_free(struct LDKCOption_HTLCDestinationZ _res);
14867 * Creates a new COption_HTLCDestinationZ which has the same data as `orig`
14868 * but with all dynamically-allocated buffers duplicated in new buffers.
14870 struct LDKCOption_HTLCDestinationZ COption_HTLCDestinationZ_clone(const struct LDKCOption_HTLCDestinationZ *NONNULL_PTR orig);
14873 * Creates a new CResult_COption_HTLCDestinationZDecodeErrorZ in the success state.
14875 struct LDKCResult_COption_HTLCDestinationZDecodeErrorZ CResult_COption_HTLCDestinationZDecodeErrorZ_ok(struct LDKCOption_HTLCDestinationZ o);
14878 * Creates a new CResult_COption_HTLCDestinationZDecodeErrorZ in the error state.
14880 struct LDKCResult_COption_HTLCDestinationZDecodeErrorZ CResult_COption_HTLCDestinationZDecodeErrorZ_err(struct LDKDecodeError e);
14883 * Checks if the given object is currently in the success state
14885 bool CResult_COption_HTLCDestinationZDecodeErrorZ_is_ok(const struct LDKCResult_COption_HTLCDestinationZDecodeErrorZ *NONNULL_PTR o);
14888 * Frees any resources used by the CResult_COption_HTLCDestinationZDecodeErrorZ.
14890 void CResult_COption_HTLCDestinationZDecodeErrorZ_free(struct LDKCResult_COption_HTLCDestinationZDecodeErrorZ _res);
14893 * Creates a new CResult_COption_HTLCDestinationZDecodeErrorZ which has the same data as `orig`
14894 * but with all dynamically-allocated buffers duplicated in new buffers.
14896 struct LDKCResult_COption_HTLCDestinationZDecodeErrorZ CResult_COption_HTLCDestinationZDecodeErrorZ_clone(const struct LDKCResult_COption_HTLCDestinationZDecodeErrorZ *NONNULL_PTR orig);
14899 * Constructs a new COption_NetworkUpdateZ containing a crate::lightning::routing::gossip::NetworkUpdate
14901 struct LDKCOption_NetworkUpdateZ COption_NetworkUpdateZ_some(struct LDKNetworkUpdate o);
14904 * Constructs a new COption_NetworkUpdateZ containing nothing
14906 struct LDKCOption_NetworkUpdateZ COption_NetworkUpdateZ_none(void);
14909 * Frees any resources associated with the crate::lightning::routing::gossip::NetworkUpdate, if we are in the Some state
14911 void COption_NetworkUpdateZ_free(struct LDKCOption_NetworkUpdateZ _res);
14914 * Creates a new COption_NetworkUpdateZ which has the same data as `orig`
14915 * but with all dynamically-allocated buffers duplicated in new buffers.
14917 struct LDKCOption_NetworkUpdateZ COption_NetworkUpdateZ_clone(const struct LDKCOption_NetworkUpdateZ *NONNULL_PTR orig);
14920 * Frees the buffer pointed to by `data` if `datalen` is non-0.
14922 void CVec_SpendableOutputDescriptorZ_free(struct LDKCVec_SpendableOutputDescriptorZ _res);
14925 * Constructs a new COption_EventZ containing a crate::lightning::util::events::Event
14927 struct LDKCOption_EventZ COption_EventZ_some(struct LDKEvent o);
14930 * Constructs a new COption_EventZ containing nothing
14932 struct LDKCOption_EventZ COption_EventZ_none(void);
14935 * Frees any resources associated with the crate::lightning::util::events::Event, if we are in the Some state
14937 void COption_EventZ_free(struct LDKCOption_EventZ _res);
14940 * Creates a new COption_EventZ which has the same data as `orig`
14941 * but with all dynamically-allocated buffers duplicated in new buffers.
14943 struct LDKCOption_EventZ COption_EventZ_clone(const struct LDKCOption_EventZ *NONNULL_PTR orig);
14946 * Creates a new CResult_COption_EventZDecodeErrorZ in the success state.
14948 struct LDKCResult_COption_EventZDecodeErrorZ CResult_COption_EventZDecodeErrorZ_ok(struct LDKCOption_EventZ o);
14951 * Creates a new CResult_COption_EventZDecodeErrorZ in the error state.
14953 struct LDKCResult_COption_EventZDecodeErrorZ CResult_COption_EventZDecodeErrorZ_err(struct LDKDecodeError e);
14956 * Checks if the given object is currently in the success state
14958 bool CResult_COption_EventZDecodeErrorZ_is_ok(const struct LDKCResult_COption_EventZDecodeErrorZ *NONNULL_PTR o);
14961 * Frees any resources used by the CResult_COption_EventZDecodeErrorZ.
14963 void CResult_COption_EventZDecodeErrorZ_free(struct LDKCResult_COption_EventZDecodeErrorZ _res);
14966 * Creates a new CResult_COption_EventZDecodeErrorZ which has the same data as `orig`
14967 * but with all dynamically-allocated buffers duplicated in new buffers.
14969 struct LDKCResult_COption_EventZDecodeErrorZ CResult_COption_EventZDecodeErrorZ_clone(const struct LDKCResult_COption_EventZDecodeErrorZ *NONNULL_PTR orig);
14972 * Frees the buffer pointed to by `data` if `datalen` is non-0.
14974 void CVec_MessageSendEventZ_free(struct LDKCVec_MessageSendEventZ _res);
14977 * Creates a new CResult_TxOutAccessErrorZ in the success state.
14979 struct LDKCResult_TxOutAccessErrorZ CResult_TxOutAccessErrorZ_ok(struct LDKTxOut o);
14982 * Creates a new CResult_TxOutAccessErrorZ in the error state.
14984 struct LDKCResult_TxOutAccessErrorZ CResult_TxOutAccessErrorZ_err(enum LDKAccessError e);
14987 * Checks if the given object is currently in the success state
14989 bool CResult_TxOutAccessErrorZ_is_ok(const struct LDKCResult_TxOutAccessErrorZ *NONNULL_PTR o);
14992 * Frees any resources used by the CResult_TxOutAccessErrorZ.
14994 void CResult_TxOutAccessErrorZ_free(struct LDKCResult_TxOutAccessErrorZ _res);
14997 * Creates a new CResult_TxOutAccessErrorZ which has the same data as `orig`
14998 * but with all dynamically-allocated buffers duplicated in new buffers.
15000 struct LDKCResult_TxOutAccessErrorZ CResult_TxOutAccessErrorZ_clone(const struct LDKCResult_TxOutAccessErrorZ *NONNULL_PTR orig);
15003 * Creates a new tuple which has the same data as `orig`
15004 * but with all dynamically-allocated buffers duplicated in new buffers.
15006 struct LDKC2Tuple_usizeTransactionZ C2Tuple_usizeTransactionZ_clone(const struct LDKC2Tuple_usizeTransactionZ *NONNULL_PTR orig);
15009 * Creates a new C2Tuple_usizeTransactionZ from the contained elements.
15011 struct LDKC2Tuple_usizeTransactionZ C2Tuple_usizeTransactionZ_new(uintptr_t a, struct LDKTransaction b);
15014 * Frees any resources used by the C2Tuple_usizeTransactionZ.
15016 void C2Tuple_usizeTransactionZ_free(struct LDKC2Tuple_usizeTransactionZ _res);
15019 * Frees the buffer pointed to by `data` if `datalen` is non-0.
15021 void CVec_C2Tuple_usizeTransactionZZ_free(struct LDKCVec_C2Tuple_usizeTransactionZZ _res);
15024 * Frees the buffer pointed to by `data` if `datalen` is non-0.
15026 void CVec_TxidZ_free(struct LDKCVec_TxidZ _res);
15029 * Creates a new CResult_NoneChannelMonitorUpdateErrZ in the success state.
15031 struct LDKCResult_NoneChannelMonitorUpdateErrZ CResult_NoneChannelMonitorUpdateErrZ_ok(void);
15034 * Creates a new CResult_NoneChannelMonitorUpdateErrZ in the error state.
15036 struct LDKCResult_NoneChannelMonitorUpdateErrZ CResult_NoneChannelMonitorUpdateErrZ_err(enum LDKChannelMonitorUpdateErr e);
15039 * Checks if the given object is currently in the success state
15041 bool CResult_NoneChannelMonitorUpdateErrZ_is_ok(const struct LDKCResult_NoneChannelMonitorUpdateErrZ *NONNULL_PTR o);
15044 * Frees any resources used by the CResult_NoneChannelMonitorUpdateErrZ.
15046 void CResult_NoneChannelMonitorUpdateErrZ_free(struct LDKCResult_NoneChannelMonitorUpdateErrZ _res);
15049 * Creates a new CResult_NoneChannelMonitorUpdateErrZ which has the same data as `orig`
15050 * but with all dynamically-allocated buffers duplicated in new buffers.
15052 struct LDKCResult_NoneChannelMonitorUpdateErrZ CResult_NoneChannelMonitorUpdateErrZ_clone(const struct LDKCResult_NoneChannelMonitorUpdateErrZ *NONNULL_PTR orig);
15055 * Frees the buffer pointed to by `data` if `datalen` is non-0.
15057 void CVec_MonitorEventZ_free(struct LDKCVec_MonitorEventZ _res);
15060 * Creates a new tuple which has the same data as `orig`
15061 * but with all dynamically-allocated buffers duplicated in new buffers.
15063 struct LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_clone(const struct LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ *NONNULL_PTR orig);
15066 * Creates a new C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ from the contained elements.
15068 struct LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_new(struct LDKOutPoint a, struct LDKCVec_MonitorEventZ b, struct LDKPublicKey c);
15071 * Frees any resources used by the C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ.
15073 void C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_free(struct LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ _res);
15076 * Frees the buffer pointed to by `data` if `datalen` is non-0.
15078 void CVec_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZZ_free(struct LDKCVec_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZZ _res);
15081 * Creates a new CResult_FixedPenaltyScorerDecodeErrorZ in the success state.
15083 struct LDKCResult_FixedPenaltyScorerDecodeErrorZ CResult_FixedPenaltyScorerDecodeErrorZ_ok(struct LDKFixedPenaltyScorer o);
15086 * Creates a new CResult_FixedPenaltyScorerDecodeErrorZ in the error state.
15088 struct LDKCResult_FixedPenaltyScorerDecodeErrorZ CResult_FixedPenaltyScorerDecodeErrorZ_err(struct LDKDecodeError e);
15091 * Checks if the given object is currently in the success state
15093 bool CResult_FixedPenaltyScorerDecodeErrorZ_is_ok(const struct LDKCResult_FixedPenaltyScorerDecodeErrorZ *NONNULL_PTR o);
15096 * Frees any resources used by the CResult_FixedPenaltyScorerDecodeErrorZ.
15098 void CResult_FixedPenaltyScorerDecodeErrorZ_free(struct LDKCResult_FixedPenaltyScorerDecodeErrorZ _res);
15101 * Creates a new CResult_FixedPenaltyScorerDecodeErrorZ which has the same data as `orig`
15102 * but with all dynamically-allocated buffers duplicated in new buffers.
15104 struct LDKCResult_FixedPenaltyScorerDecodeErrorZ CResult_FixedPenaltyScorerDecodeErrorZ_clone(const struct LDKCResult_FixedPenaltyScorerDecodeErrorZ *NONNULL_PTR orig);
15107 * Creates a new tuple which has the same data as `orig`
15108 * but with all dynamically-allocated buffers duplicated in new buffers.
15110 struct LDKC2Tuple_u64u64Z C2Tuple_u64u64Z_clone(const struct LDKC2Tuple_u64u64Z *NONNULL_PTR orig);
15113 * Creates a new C2Tuple_u64u64Z from the contained elements.
15115 struct LDKC2Tuple_u64u64Z C2Tuple_u64u64Z_new(uint64_t a, uint64_t b);
15118 * Frees any resources used by the C2Tuple_u64u64Z.
15120 void C2Tuple_u64u64Z_free(struct LDKC2Tuple_u64u64Z _res);
15123 * Constructs a new COption_C2Tuple_u64u64ZZ containing a crate::c_types::derived::C2Tuple_u64u64Z
15125 struct LDKCOption_C2Tuple_u64u64ZZ COption_C2Tuple_u64u64ZZ_some(struct LDKC2Tuple_u64u64Z o);
15128 * Constructs a new COption_C2Tuple_u64u64ZZ containing nothing
15130 struct LDKCOption_C2Tuple_u64u64ZZ COption_C2Tuple_u64u64ZZ_none(void);
15133 * Frees any resources associated with the crate::c_types::derived::C2Tuple_u64u64Z, if we are in the Some state
15135 void COption_C2Tuple_u64u64ZZ_free(struct LDKCOption_C2Tuple_u64u64ZZ _res);
15138 * Creates a new COption_C2Tuple_u64u64ZZ which has the same data as `orig`
15139 * but with all dynamically-allocated buffers duplicated in new buffers.
15141 struct LDKCOption_C2Tuple_u64u64ZZ COption_C2Tuple_u64u64ZZ_clone(const struct LDKCOption_C2Tuple_u64u64ZZ *NONNULL_PTR orig);
15144 * Frees the buffer pointed to by `data` if `datalen` is non-0.
15146 void CVec_NodeIdZ_free(struct LDKCVec_NodeIdZ _res);
15149 * Creates a new CResult_ProbabilisticScorerDecodeErrorZ in the success state.
15151 struct LDKCResult_ProbabilisticScorerDecodeErrorZ CResult_ProbabilisticScorerDecodeErrorZ_ok(struct LDKProbabilisticScorer o);
15154 * Creates a new CResult_ProbabilisticScorerDecodeErrorZ in the error state.
15156 struct LDKCResult_ProbabilisticScorerDecodeErrorZ CResult_ProbabilisticScorerDecodeErrorZ_err(struct LDKDecodeError e);
15159 * Checks if the given object is currently in the success state
15161 bool CResult_ProbabilisticScorerDecodeErrorZ_is_ok(const struct LDKCResult_ProbabilisticScorerDecodeErrorZ *NONNULL_PTR o);
15164 * Frees any resources used by the CResult_ProbabilisticScorerDecodeErrorZ.
15166 void CResult_ProbabilisticScorerDecodeErrorZ_free(struct LDKCResult_ProbabilisticScorerDecodeErrorZ _res);
15169 * Creates a new CResult_InitFeaturesDecodeErrorZ in the success state.
15171 struct LDKCResult_InitFeaturesDecodeErrorZ CResult_InitFeaturesDecodeErrorZ_ok(struct LDKInitFeatures o);
15174 * Creates a new CResult_InitFeaturesDecodeErrorZ in the error state.
15176 struct LDKCResult_InitFeaturesDecodeErrorZ CResult_InitFeaturesDecodeErrorZ_err(struct LDKDecodeError e);
15179 * Checks if the given object is currently in the success state
15181 bool CResult_InitFeaturesDecodeErrorZ_is_ok(const struct LDKCResult_InitFeaturesDecodeErrorZ *NONNULL_PTR o);
15184 * Frees any resources used by the CResult_InitFeaturesDecodeErrorZ.
15186 void CResult_InitFeaturesDecodeErrorZ_free(struct LDKCResult_InitFeaturesDecodeErrorZ _res);
15189 * Creates a new CResult_InitFeaturesDecodeErrorZ which has the same data as `orig`
15190 * but with all dynamically-allocated buffers duplicated in new buffers.
15192 struct LDKCResult_InitFeaturesDecodeErrorZ CResult_InitFeaturesDecodeErrorZ_clone(const struct LDKCResult_InitFeaturesDecodeErrorZ *NONNULL_PTR orig);
15195 * Creates a new CResult_ChannelFeaturesDecodeErrorZ in the success state.
15197 struct LDKCResult_ChannelFeaturesDecodeErrorZ CResult_ChannelFeaturesDecodeErrorZ_ok(struct LDKChannelFeatures o);
15200 * Creates a new CResult_ChannelFeaturesDecodeErrorZ in the error state.
15202 struct LDKCResult_ChannelFeaturesDecodeErrorZ CResult_ChannelFeaturesDecodeErrorZ_err(struct LDKDecodeError e);
15205 * Checks if the given object is currently in the success state
15207 bool CResult_ChannelFeaturesDecodeErrorZ_is_ok(const struct LDKCResult_ChannelFeaturesDecodeErrorZ *NONNULL_PTR o);
15210 * Frees any resources used by the CResult_ChannelFeaturesDecodeErrorZ.
15212 void CResult_ChannelFeaturesDecodeErrorZ_free(struct LDKCResult_ChannelFeaturesDecodeErrorZ _res);
15215 * Creates a new CResult_ChannelFeaturesDecodeErrorZ which has the same data as `orig`
15216 * but with all dynamically-allocated buffers duplicated in new buffers.
15218 struct LDKCResult_ChannelFeaturesDecodeErrorZ CResult_ChannelFeaturesDecodeErrorZ_clone(const struct LDKCResult_ChannelFeaturesDecodeErrorZ *NONNULL_PTR orig);
15221 * Creates a new CResult_NodeFeaturesDecodeErrorZ in the success state.
15223 struct LDKCResult_NodeFeaturesDecodeErrorZ CResult_NodeFeaturesDecodeErrorZ_ok(struct LDKNodeFeatures o);
15226 * Creates a new CResult_NodeFeaturesDecodeErrorZ in the error state.
15228 struct LDKCResult_NodeFeaturesDecodeErrorZ CResult_NodeFeaturesDecodeErrorZ_err(struct LDKDecodeError e);
15231 * Checks if the given object is currently in the success state
15233 bool CResult_NodeFeaturesDecodeErrorZ_is_ok(const struct LDKCResult_NodeFeaturesDecodeErrorZ *NONNULL_PTR o);
15236 * Frees any resources used by the CResult_NodeFeaturesDecodeErrorZ.
15238 void CResult_NodeFeaturesDecodeErrorZ_free(struct LDKCResult_NodeFeaturesDecodeErrorZ _res);
15241 * Creates a new CResult_NodeFeaturesDecodeErrorZ which has the same data as `orig`
15242 * but with all dynamically-allocated buffers duplicated in new buffers.
15244 struct LDKCResult_NodeFeaturesDecodeErrorZ CResult_NodeFeaturesDecodeErrorZ_clone(const struct LDKCResult_NodeFeaturesDecodeErrorZ *NONNULL_PTR orig);
15247 * Creates a new CResult_InvoiceFeaturesDecodeErrorZ in the success state.
15249 struct LDKCResult_InvoiceFeaturesDecodeErrorZ CResult_InvoiceFeaturesDecodeErrorZ_ok(struct LDKInvoiceFeatures o);
15252 * Creates a new CResult_InvoiceFeaturesDecodeErrorZ in the error state.
15254 struct LDKCResult_InvoiceFeaturesDecodeErrorZ CResult_InvoiceFeaturesDecodeErrorZ_err(struct LDKDecodeError e);
15257 * Checks if the given object is currently in the success state
15259 bool CResult_InvoiceFeaturesDecodeErrorZ_is_ok(const struct LDKCResult_InvoiceFeaturesDecodeErrorZ *NONNULL_PTR o);
15262 * Frees any resources used by the CResult_InvoiceFeaturesDecodeErrorZ.
15264 void CResult_InvoiceFeaturesDecodeErrorZ_free(struct LDKCResult_InvoiceFeaturesDecodeErrorZ _res);
15267 * Creates a new CResult_InvoiceFeaturesDecodeErrorZ which has the same data as `orig`
15268 * but with all dynamically-allocated buffers duplicated in new buffers.
15270 struct LDKCResult_InvoiceFeaturesDecodeErrorZ CResult_InvoiceFeaturesDecodeErrorZ_clone(const struct LDKCResult_InvoiceFeaturesDecodeErrorZ *NONNULL_PTR orig);
15273 * Creates a new CResult_ChannelTypeFeaturesDecodeErrorZ in the success state.
15275 struct LDKCResult_ChannelTypeFeaturesDecodeErrorZ CResult_ChannelTypeFeaturesDecodeErrorZ_ok(struct LDKChannelTypeFeatures o);
15278 * Creates a new CResult_ChannelTypeFeaturesDecodeErrorZ in the error state.
15280 struct LDKCResult_ChannelTypeFeaturesDecodeErrorZ CResult_ChannelTypeFeaturesDecodeErrorZ_err(struct LDKDecodeError e);
15283 * Checks if the given object is currently in the success state
15285 bool CResult_ChannelTypeFeaturesDecodeErrorZ_is_ok(const struct LDKCResult_ChannelTypeFeaturesDecodeErrorZ *NONNULL_PTR o);
15288 * Frees any resources used by the CResult_ChannelTypeFeaturesDecodeErrorZ.
15290 void CResult_ChannelTypeFeaturesDecodeErrorZ_free(struct LDKCResult_ChannelTypeFeaturesDecodeErrorZ _res);
15293 * Creates a new CResult_ChannelTypeFeaturesDecodeErrorZ which has the same data as `orig`
15294 * but with all dynamically-allocated buffers duplicated in new buffers.
15296 struct LDKCResult_ChannelTypeFeaturesDecodeErrorZ CResult_ChannelTypeFeaturesDecodeErrorZ_clone(const struct LDKCResult_ChannelTypeFeaturesDecodeErrorZ *NONNULL_PTR orig);
15299 * Creates a new CResult_NodeIdDecodeErrorZ in the success state.
15301 struct LDKCResult_NodeIdDecodeErrorZ CResult_NodeIdDecodeErrorZ_ok(struct LDKNodeId o);
15304 * Creates a new CResult_NodeIdDecodeErrorZ in the error state.
15306 struct LDKCResult_NodeIdDecodeErrorZ CResult_NodeIdDecodeErrorZ_err(struct LDKDecodeError e);
15309 * Checks if the given object is currently in the success state
15311 bool CResult_NodeIdDecodeErrorZ_is_ok(const struct LDKCResult_NodeIdDecodeErrorZ *NONNULL_PTR o);
15314 * Frees any resources used by the CResult_NodeIdDecodeErrorZ.
15316 void CResult_NodeIdDecodeErrorZ_free(struct LDKCResult_NodeIdDecodeErrorZ _res);
15319 * Creates a new CResult_NodeIdDecodeErrorZ which has the same data as `orig`
15320 * but with all dynamically-allocated buffers duplicated in new buffers.
15322 struct LDKCResult_NodeIdDecodeErrorZ CResult_NodeIdDecodeErrorZ_clone(const struct LDKCResult_NodeIdDecodeErrorZ *NONNULL_PTR orig);
15325 * Creates a new CResult_COption_NetworkUpdateZDecodeErrorZ in the success state.
15327 struct LDKCResult_COption_NetworkUpdateZDecodeErrorZ CResult_COption_NetworkUpdateZDecodeErrorZ_ok(struct LDKCOption_NetworkUpdateZ o);
15330 * Creates a new CResult_COption_NetworkUpdateZDecodeErrorZ in the error state.
15332 struct LDKCResult_COption_NetworkUpdateZDecodeErrorZ CResult_COption_NetworkUpdateZDecodeErrorZ_err(struct LDKDecodeError e);
15335 * Checks if the given object is currently in the success state
15337 bool CResult_COption_NetworkUpdateZDecodeErrorZ_is_ok(const struct LDKCResult_COption_NetworkUpdateZDecodeErrorZ *NONNULL_PTR o);
15340 * Frees any resources used by the CResult_COption_NetworkUpdateZDecodeErrorZ.
15342 void CResult_COption_NetworkUpdateZDecodeErrorZ_free(struct LDKCResult_COption_NetworkUpdateZDecodeErrorZ _res);
15345 * Creates a new CResult_COption_NetworkUpdateZDecodeErrorZ which has the same data as `orig`
15346 * but with all dynamically-allocated buffers duplicated in new buffers.
15348 struct LDKCResult_COption_NetworkUpdateZDecodeErrorZ CResult_COption_NetworkUpdateZDecodeErrorZ_clone(const struct LDKCResult_COption_NetworkUpdateZDecodeErrorZ *NONNULL_PTR orig);
15351 * Constructs a new COption_AccessZ containing a crate::lightning::chain::Access
15353 struct LDKCOption_AccessZ COption_AccessZ_some(struct LDKAccess o);
15356 * Constructs a new COption_AccessZ containing nothing
15358 struct LDKCOption_AccessZ COption_AccessZ_none(void);
15361 * Frees any resources associated with the crate::lightning::chain::Access, if we are in the Some state
15363 void COption_AccessZ_free(struct LDKCOption_AccessZ _res);
15366 * Creates a new CResult_boolLightningErrorZ in the success state.
15368 struct LDKCResult_boolLightningErrorZ CResult_boolLightningErrorZ_ok(bool o);
15371 * Creates a new CResult_boolLightningErrorZ in the error state.
15373 struct LDKCResult_boolLightningErrorZ CResult_boolLightningErrorZ_err(struct LDKLightningError e);
15376 * Checks if the given object is currently in the success state
15378 bool CResult_boolLightningErrorZ_is_ok(const struct LDKCResult_boolLightningErrorZ *NONNULL_PTR o);
15381 * Frees any resources used by the CResult_boolLightningErrorZ.
15383 void CResult_boolLightningErrorZ_free(struct LDKCResult_boolLightningErrorZ _res);
15386 * Creates a new CResult_boolLightningErrorZ which has the same data as `orig`
15387 * but with all dynamically-allocated buffers duplicated in new buffers.
15389 struct LDKCResult_boolLightningErrorZ CResult_boolLightningErrorZ_clone(const struct LDKCResult_boolLightningErrorZ *NONNULL_PTR orig);
15392 * Creates a new tuple which has the same data as `orig`
15393 * but with all dynamically-allocated buffers duplicated in new buffers.
15395 struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_clone(const struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ *NONNULL_PTR orig);
15398 * Creates a new C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ from the contained elements.
15400 struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_new(struct LDKChannelAnnouncement a, struct LDKChannelUpdate b, struct LDKChannelUpdate c);
15403 * Frees any resources used by the C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ.
15405 void C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_free(struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ _res);
15408 * Constructs a new COption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ containing a crate::c_types::derived::C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ
15410 struct LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ COption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_some(struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ o);
15413 * Constructs a new COption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ containing nothing
15415 struct LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ COption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_none(void);
15418 * Frees any resources associated with the crate::c_types::derived::C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ, if we are in the Some state
15420 void COption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_free(struct LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ _res);
15423 * Creates a new COption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ which has the same data as `orig`
15424 * but with all dynamically-allocated buffers duplicated in new buffers.
15426 struct LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ COption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_clone(const struct LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ *NONNULL_PTR orig);
15429 * Creates a new CResult_NoneLightningErrorZ in the success state.
15431 struct LDKCResult_NoneLightningErrorZ CResult_NoneLightningErrorZ_ok(void);
15434 * Creates a new CResult_NoneLightningErrorZ in the error state.
15436 struct LDKCResult_NoneLightningErrorZ CResult_NoneLightningErrorZ_err(struct LDKLightningError e);
15439 * Checks if the given object is currently in the success state
15441 bool CResult_NoneLightningErrorZ_is_ok(const struct LDKCResult_NoneLightningErrorZ *NONNULL_PTR o);
15444 * Frees any resources used by the CResult_NoneLightningErrorZ.
15446 void CResult_NoneLightningErrorZ_free(struct LDKCResult_NoneLightningErrorZ _res);
15449 * Creates a new CResult_NoneLightningErrorZ which has the same data as `orig`
15450 * but with all dynamically-allocated buffers duplicated in new buffers.
15452 struct LDKCResult_NoneLightningErrorZ CResult_NoneLightningErrorZ_clone(const struct LDKCResult_NoneLightningErrorZ *NONNULL_PTR orig);
15455 * Creates a new CResult_ChannelUpdateInfoDecodeErrorZ in the success state.
15457 struct LDKCResult_ChannelUpdateInfoDecodeErrorZ CResult_ChannelUpdateInfoDecodeErrorZ_ok(struct LDKChannelUpdateInfo o);
15460 * Creates a new CResult_ChannelUpdateInfoDecodeErrorZ in the error state.
15462 struct LDKCResult_ChannelUpdateInfoDecodeErrorZ CResult_ChannelUpdateInfoDecodeErrorZ_err(struct LDKDecodeError e);
15465 * Checks if the given object is currently in the success state
15467 bool CResult_ChannelUpdateInfoDecodeErrorZ_is_ok(const struct LDKCResult_ChannelUpdateInfoDecodeErrorZ *NONNULL_PTR o);
15470 * Frees any resources used by the CResult_ChannelUpdateInfoDecodeErrorZ.
15472 void CResult_ChannelUpdateInfoDecodeErrorZ_free(struct LDKCResult_ChannelUpdateInfoDecodeErrorZ _res);
15475 * Creates a new CResult_ChannelUpdateInfoDecodeErrorZ which has the same data as `orig`
15476 * but with all dynamically-allocated buffers duplicated in new buffers.
15478 struct LDKCResult_ChannelUpdateInfoDecodeErrorZ CResult_ChannelUpdateInfoDecodeErrorZ_clone(const struct LDKCResult_ChannelUpdateInfoDecodeErrorZ *NONNULL_PTR orig);
15481 * Creates a new CResult_ChannelInfoDecodeErrorZ in the success state.
15483 struct LDKCResult_ChannelInfoDecodeErrorZ CResult_ChannelInfoDecodeErrorZ_ok(struct LDKChannelInfo o);
15486 * Creates a new CResult_ChannelInfoDecodeErrorZ in the error state.
15488 struct LDKCResult_ChannelInfoDecodeErrorZ CResult_ChannelInfoDecodeErrorZ_err(struct LDKDecodeError e);
15491 * Checks if the given object is currently in the success state
15493 bool CResult_ChannelInfoDecodeErrorZ_is_ok(const struct LDKCResult_ChannelInfoDecodeErrorZ *NONNULL_PTR o);
15496 * Frees any resources used by the CResult_ChannelInfoDecodeErrorZ.
15498 void CResult_ChannelInfoDecodeErrorZ_free(struct LDKCResult_ChannelInfoDecodeErrorZ _res);
15501 * Creates a new CResult_ChannelInfoDecodeErrorZ which has the same data as `orig`
15502 * but with all dynamically-allocated buffers duplicated in new buffers.
15504 struct LDKCResult_ChannelInfoDecodeErrorZ CResult_ChannelInfoDecodeErrorZ_clone(const struct LDKCResult_ChannelInfoDecodeErrorZ *NONNULL_PTR orig);
15507 * Creates a new CResult_RoutingFeesDecodeErrorZ in the success state.
15509 struct LDKCResult_RoutingFeesDecodeErrorZ CResult_RoutingFeesDecodeErrorZ_ok(struct LDKRoutingFees o);
15512 * Creates a new CResult_RoutingFeesDecodeErrorZ in the error state.
15514 struct LDKCResult_RoutingFeesDecodeErrorZ CResult_RoutingFeesDecodeErrorZ_err(struct LDKDecodeError e);
15517 * Checks if the given object is currently in the success state
15519 bool CResult_RoutingFeesDecodeErrorZ_is_ok(const struct LDKCResult_RoutingFeesDecodeErrorZ *NONNULL_PTR o);
15522 * Frees any resources used by the CResult_RoutingFeesDecodeErrorZ.
15524 void CResult_RoutingFeesDecodeErrorZ_free(struct LDKCResult_RoutingFeesDecodeErrorZ _res);
15527 * Creates a new CResult_RoutingFeesDecodeErrorZ which has the same data as `orig`
15528 * but with all dynamically-allocated buffers duplicated in new buffers.
15530 struct LDKCResult_RoutingFeesDecodeErrorZ CResult_RoutingFeesDecodeErrorZ_clone(const struct LDKCResult_RoutingFeesDecodeErrorZ *NONNULL_PTR orig);
15533 * Frees the buffer pointed to by `data` if `datalen` is non-0.
15535 void CVec_NetAddressZ_free(struct LDKCVec_NetAddressZ _res);
15538 * Creates a new CResult_NodeAnnouncementInfoDecodeErrorZ in the success state.
15540 struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ CResult_NodeAnnouncementInfoDecodeErrorZ_ok(struct LDKNodeAnnouncementInfo o);
15543 * Creates a new CResult_NodeAnnouncementInfoDecodeErrorZ in the error state.
15545 struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ CResult_NodeAnnouncementInfoDecodeErrorZ_err(struct LDKDecodeError e);
15548 * Checks if the given object is currently in the success state
15550 bool CResult_NodeAnnouncementInfoDecodeErrorZ_is_ok(const struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ *NONNULL_PTR o);
15553 * Frees any resources used by the CResult_NodeAnnouncementInfoDecodeErrorZ.
15555 void CResult_NodeAnnouncementInfoDecodeErrorZ_free(struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ _res);
15558 * Creates a new CResult_NodeAnnouncementInfoDecodeErrorZ which has the same data as `orig`
15559 * but with all dynamically-allocated buffers duplicated in new buffers.
15561 struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ CResult_NodeAnnouncementInfoDecodeErrorZ_clone(const struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ *NONNULL_PTR orig);
15564 * Creates a new CResult_NodeAliasDecodeErrorZ in the success state.
15566 struct LDKCResult_NodeAliasDecodeErrorZ CResult_NodeAliasDecodeErrorZ_ok(struct LDKNodeAlias o);
15569 * Creates a new CResult_NodeAliasDecodeErrorZ in the error state.
15571 struct LDKCResult_NodeAliasDecodeErrorZ CResult_NodeAliasDecodeErrorZ_err(struct LDKDecodeError e);
15574 * Checks if the given object is currently in the success state
15576 bool CResult_NodeAliasDecodeErrorZ_is_ok(const struct LDKCResult_NodeAliasDecodeErrorZ *NONNULL_PTR o);
15579 * Frees any resources used by the CResult_NodeAliasDecodeErrorZ.
15581 void CResult_NodeAliasDecodeErrorZ_free(struct LDKCResult_NodeAliasDecodeErrorZ _res);
15584 * Creates a new CResult_NodeAliasDecodeErrorZ which has the same data as `orig`
15585 * but with all dynamically-allocated buffers duplicated in new buffers.
15587 struct LDKCResult_NodeAliasDecodeErrorZ CResult_NodeAliasDecodeErrorZ_clone(const struct LDKCResult_NodeAliasDecodeErrorZ *NONNULL_PTR orig);
15590 * Creates a new CResult_NodeInfoDecodeErrorZ in the success state.
15592 struct LDKCResult_NodeInfoDecodeErrorZ CResult_NodeInfoDecodeErrorZ_ok(struct LDKNodeInfo o);
15595 * Creates a new CResult_NodeInfoDecodeErrorZ in the error state.
15597 struct LDKCResult_NodeInfoDecodeErrorZ CResult_NodeInfoDecodeErrorZ_err(struct LDKDecodeError e);
15600 * Checks if the given object is currently in the success state
15602 bool CResult_NodeInfoDecodeErrorZ_is_ok(const struct LDKCResult_NodeInfoDecodeErrorZ *NONNULL_PTR o);
15605 * Frees any resources used by the CResult_NodeInfoDecodeErrorZ.
15607 void CResult_NodeInfoDecodeErrorZ_free(struct LDKCResult_NodeInfoDecodeErrorZ _res);
15610 * Creates a new CResult_NodeInfoDecodeErrorZ which has the same data as `orig`
15611 * but with all dynamically-allocated buffers duplicated in new buffers.
15613 struct LDKCResult_NodeInfoDecodeErrorZ CResult_NodeInfoDecodeErrorZ_clone(const struct LDKCResult_NodeInfoDecodeErrorZ *NONNULL_PTR orig);
15616 * Creates a new CResult_NetworkGraphDecodeErrorZ in the success state.
15618 struct LDKCResult_NetworkGraphDecodeErrorZ CResult_NetworkGraphDecodeErrorZ_ok(struct LDKNetworkGraph o);
15621 * Creates a new CResult_NetworkGraphDecodeErrorZ in the error state.
15623 struct LDKCResult_NetworkGraphDecodeErrorZ CResult_NetworkGraphDecodeErrorZ_err(struct LDKDecodeError e);
15626 * Checks if the given object is currently in the success state
15628 bool CResult_NetworkGraphDecodeErrorZ_is_ok(const struct LDKCResult_NetworkGraphDecodeErrorZ *NONNULL_PTR o);
15631 * Frees any resources used by the CResult_NetworkGraphDecodeErrorZ.
15633 void CResult_NetworkGraphDecodeErrorZ_free(struct LDKCResult_NetworkGraphDecodeErrorZ _res);
15636 * Constructs a new COption_CVec_NetAddressZZ containing a crate::c_types::derived::CVec_NetAddressZ
15638 struct LDKCOption_CVec_NetAddressZZ COption_CVec_NetAddressZZ_some(struct LDKCVec_NetAddressZ o);
15641 * Constructs a new COption_CVec_NetAddressZZ containing nothing
15643 struct LDKCOption_CVec_NetAddressZZ COption_CVec_NetAddressZZ_none(void);
15646 * Frees any resources associated with the crate::c_types::derived::CVec_NetAddressZ, if we are in the Some state
15648 void COption_CVec_NetAddressZZ_free(struct LDKCOption_CVec_NetAddressZZ _res);
15651 * Creates a new COption_CVec_NetAddressZZ which has the same data as `orig`
15652 * but with all dynamically-allocated buffers duplicated in new buffers.
15654 struct LDKCOption_CVec_NetAddressZZ COption_CVec_NetAddressZZ_clone(const struct LDKCOption_CVec_NetAddressZZ *NONNULL_PTR orig);
15657 * Creates a new CResult_DelayedPaymentOutputDescriptorDecodeErrorZ in the success state.
15659 struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_ok(struct LDKDelayedPaymentOutputDescriptor o);
15662 * Creates a new CResult_DelayedPaymentOutputDescriptorDecodeErrorZ in the error state.
15664 struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_err(struct LDKDecodeError e);
15667 * Checks if the given object is currently in the success state
15669 bool CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_is_ok(const struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ *NONNULL_PTR o);
15672 * Frees any resources used by the CResult_DelayedPaymentOutputDescriptorDecodeErrorZ.
15674 void CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_free(struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ _res);
15677 * Creates a new CResult_DelayedPaymentOutputDescriptorDecodeErrorZ which has the same data as `orig`
15678 * but with all dynamically-allocated buffers duplicated in new buffers.
15680 struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_clone(const struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ *NONNULL_PTR orig);
15683 * Creates a new CResult_StaticPaymentOutputDescriptorDecodeErrorZ in the success state.
15685 struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ CResult_StaticPaymentOutputDescriptorDecodeErrorZ_ok(struct LDKStaticPaymentOutputDescriptor o);
15688 * Creates a new CResult_StaticPaymentOutputDescriptorDecodeErrorZ in the error state.
15690 struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ CResult_StaticPaymentOutputDescriptorDecodeErrorZ_err(struct LDKDecodeError e);
15693 * Checks if the given object is currently in the success state
15695 bool CResult_StaticPaymentOutputDescriptorDecodeErrorZ_is_ok(const struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ *NONNULL_PTR o);
15698 * Frees any resources used by the CResult_StaticPaymentOutputDescriptorDecodeErrorZ.
15700 void CResult_StaticPaymentOutputDescriptorDecodeErrorZ_free(struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ _res);
15703 * Creates a new CResult_StaticPaymentOutputDescriptorDecodeErrorZ which has the same data as `orig`
15704 * but with all dynamically-allocated buffers duplicated in new buffers.
15706 struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ CResult_StaticPaymentOutputDescriptorDecodeErrorZ_clone(const struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ *NONNULL_PTR orig);
15709 * Creates a new CResult_SpendableOutputDescriptorDecodeErrorZ in the success state.
15711 struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ CResult_SpendableOutputDescriptorDecodeErrorZ_ok(struct LDKSpendableOutputDescriptor o);
15714 * Creates a new CResult_SpendableOutputDescriptorDecodeErrorZ in the error state.
15716 struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ CResult_SpendableOutputDescriptorDecodeErrorZ_err(struct LDKDecodeError e);
15719 * Checks if the given object is currently in the success state
15721 bool CResult_SpendableOutputDescriptorDecodeErrorZ_is_ok(const struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ *NONNULL_PTR o);
15724 * Frees any resources used by the CResult_SpendableOutputDescriptorDecodeErrorZ.
15726 void CResult_SpendableOutputDescriptorDecodeErrorZ_free(struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ _res);
15729 * Creates a new CResult_SpendableOutputDescriptorDecodeErrorZ which has the same data as `orig`
15730 * but with all dynamically-allocated buffers duplicated in new buffers.
15732 struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ CResult_SpendableOutputDescriptorDecodeErrorZ_clone(const struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ *NONNULL_PTR orig);
15735 * Frees the buffer pointed to by `data` if `datalen` is non-0.
15737 void CVec_PaymentPreimageZ_free(struct LDKCVec_PaymentPreimageZ _res);
15740 * Creates a new tuple which has the same data as `orig`
15741 * but with all dynamically-allocated buffers duplicated in new buffers.
15743 struct LDKC2Tuple_SignatureCVec_SignatureZZ C2Tuple_SignatureCVec_SignatureZZ_clone(const struct LDKC2Tuple_SignatureCVec_SignatureZZ *NONNULL_PTR orig);
15746 * Creates a new C2Tuple_SignatureCVec_SignatureZZ from the contained elements.
15748 struct LDKC2Tuple_SignatureCVec_SignatureZZ C2Tuple_SignatureCVec_SignatureZZ_new(struct LDKSignature a, struct LDKCVec_SignatureZ b);
15751 * Frees any resources used by the C2Tuple_SignatureCVec_SignatureZZ.
15753 void C2Tuple_SignatureCVec_SignatureZZ_free(struct LDKC2Tuple_SignatureCVec_SignatureZZ _res);
15756 * Creates a new CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ in the success state.
15758 struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_ok(struct LDKC2Tuple_SignatureCVec_SignatureZZ o);
15761 * Creates a new CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ in the error state.
15763 struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_err(void);
15766 * Checks if the given object is currently in the success state
15768 bool CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_is_ok(const struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ *NONNULL_PTR o);
15771 * Frees any resources used by the CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ.
15773 void CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_free(struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ _res);
15776 * Creates a new CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ which has the same data as `orig`
15777 * but with all dynamically-allocated buffers duplicated in new buffers.
15779 struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_clone(const struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ *NONNULL_PTR orig);
15782 * Creates a new CResult_SignatureNoneZ in the success state.
15784 struct LDKCResult_SignatureNoneZ CResult_SignatureNoneZ_ok(struct LDKSignature o);
15787 * Creates a new CResult_SignatureNoneZ in the error state.
15789 struct LDKCResult_SignatureNoneZ CResult_SignatureNoneZ_err(void);
15792 * Checks if the given object is currently in the success state
15794 bool CResult_SignatureNoneZ_is_ok(const struct LDKCResult_SignatureNoneZ *NONNULL_PTR o);
15797 * Frees any resources used by the CResult_SignatureNoneZ.
15799 void CResult_SignatureNoneZ_free(struct LDKCResult_SignatureNoneZ _res);
15802 * Creates a new CResult_SignatureNoneZ which has the same data as `orig`
15803 * but with all dynamically-allocated buffers duplicated in new buffers.
15805 struct LDKCResult_SignatureNoneZ CResult_SignatureNoneZ_clone(const struct LDKCResult_SignatureNoneZ *NONNULL_PTR orig);
15808 * Creates a new tuple which has the same data as `orig`
15809 * but with all dynamically-allocated buffers duplicated in new buffers.
15811 struct LDKC2Tuple_SignatureSignatureZ C2Tuple_SignatureSignatureZ_clone(const struct LDKC2Tuple_SignatureSignatureZ *NONNULL_PTR orig);
15814 * Creates a new C2Tuple_SignatureSignatureZ from the contained elements.
15816 struct LDKC2Tuple_SignatureSignatureZ C2Tuple_SignatureSignatureZ_new(struct LDKSignature a, struct LDKSignature b);
15819 * Frees any resources used by the C2Tuple_SignatureSignatureZ.
15821 void C2Tuple_SignatureSignatureZ_free(struct LDKC2Tuple_SignatureSignatureZ _res);
15824 * Creates a new CResult_C2Tuple_SignatureSignatureZNoneZ in the success state.
15826 struct LDKCResult_C2Tuple_SignatureSignatureZNoneZ CResult_C2Tuple_SignatureSignatureZNoneZ_ok(struct LDKC2Tuple_SignatureSignatureZ o);
15829 * Creates a new CResult_C2Tuple_SignatureSignatureZNoneZ in the error state.
15831 struct LDKCResult_C2Tuple_SignatureSignatureZNoneZ CResult_C2Tuple_SignatureSignatureZNoneZ_err(void);
15834 * Checks if the given object is currently in the success state
15836 bool CResult_C2Tuple_SignatureSignatureZNoneZ_is_ok(const struct LDKCResult_C2Tuple_SignatureSignatureZNoneZ *NONNULL_PTR o);
15839 * Frees any resources used by the CResult_C2Tuple_SignatureSignatureZNoneZ.
15841 void CResult_C2Tuple_SignatureSignatureZNoneZ_free(struct LDKCResult_C2Tuple_SignatureSignatureZNoneZ _res);
15844 * Creates a new CResult_C2Tuple_SignatureSignatureZNoneZ which has the same data as `orig`
15845 * but with all dynamically-allocated buffers duplicated in new buffers.
15847 struct LDKCResult_C2Tuple_SignatureSignatureZNoneZ CResult_C2Tuple_SignatureSignatureZNoneZ_clone(const struct LDKCResult_C2Tuple_SignatureSignatureZNoneZ *NONNULL_PTR orig);
15850 * Creates a new CResult_SecretKeyNoneZ in the success state.
15852 struct LDKCResult_SecretKeyNoneZ CResult_SecretKeyNoneZ_ok(struct LDKSecretKey o);
15855 * Creates a new CResult_SecretKeyNoneZ in the error state.
15857 struct LDKCResult_SecretKeyNoneZ CResult_SecretKeyNoneZ_err(void);
15860 * Checks if the given object is currently in the success state
15862 bool CResult_SecretKeyNoneZ_is_ok(const struct LDKCResult_SecretKeyNoneZ *NONNULL_PTR o);
15865 * Frees any resources used by the CResult_SecretKeyNoneZ.
15867 void CResult_SecretKeyNoneZ_free(struct LDKCResult_SecretKeyNoneZ _res);
15870 * Creates a new CResult_SecretKeyNoneZ which has the same data as `orig`
15871 * but with all dynamically-allocated buffers duplicated in new buffers.
15873 struct LDKCResult_SecretKeyNoneZ CResult_SecretKeyNoneZ_clone(const struct LDKCResult_SecretKeyNoneZ *NONNULL_PTR orig);
15876 * Constructs a new COption_ScalarZ containing a crate::c_types::BigEndianScalar
15878 struct LDKCOption_ScalarZ COption_ScalarZ_some(struct LDKBigEndianScalar o);
15881 * Constructs a new COption_ScalarZ containing nothing
15883 struct LDKCOption_ScalarZ COption_ScalarZ_none(void);
15886 * Frees any resources associated with the crate::c_types::BigEndianScalar, if we are in the Some state
15888 void COption_ScalarZ_free(struct LDKCOption_ScalarZ _res);
15891 * Creates a new CResult_SharedSecretNoneZ in the success state.
15893 struct LDKCResult_SharedSecretNoneZ CResult_SharedSecretNoneZ_ok(struct LDKThirtyTwoBytes o);
15896 * Creates a new CResult_SharedSecretNoneZ in the error state.
15898 struct LDKCResult_SharedSecretNoneZ CResult_SharedSecretNoneZ_err(void);
15901 * Checks if the given object is currently in the success state
15903 bool CResult_SharedSecretNoneZ_is_ok(const struct LDKCResult_SharedSecretNoneZ *NONNULL_PTR o);
15906 * Frees any resources used by the CResult_SharedSecretNoneZ.
15908 void CResult_SharedSecretNoneZ_free(struct LDKCResult_SharedSecretNoneZ _res);
15911 * Creates a new CResult_SharedSecretNoneZ which has the same data as `orig`
15912 * but with all dynamically-allocated buffers duplicated in new buffers.
15914 struct LDKCResult_SharedSecretNoneZ CResult_SharedSecretNoneZ_clone(const struct LDKCResult_SharedSecretNoneZ *NONNULL_PTR orig);
15917 * Creates a new CResult_SignDecodeErrorZ in the success state.
15919 struct LDKCResult_SignDecodeErrorZ CResult_SignDecodeErrorZ_ok(struct LDKSign o);
15922 * Creates a new CResult_SignDecodeErrorZ in the error state.
15924 struct LDKCResult_SignDecodeErrorZ CResult_SignDecodeErrorZ_err(struct LDKDecodeError e);
15927 * Checks if the given object is currently in the success state
15929 bool CResult_SignDecodeErrorZ_is_ok(const struct LDKCResult_SignDecodeErrorZ *NONNULL_PTR o);
15932 * Frees any resources used by the CResult_SignDecodeErrorZ.
15934 void CResult_SignDecodeErrorZ_free(struct LDKCResult_SignDecodeErrorZ _res);
15937 * Creates a new CResult_SignDecodeErrorZ which has the same data as `orig`
15938 * but with all dynamically-allocated buffers duplicated in new buffers.
15940 struct LDKCResult_SignDecodeErrorZ CResult_SignDecodeErrorZ_clone(const struct LDKCResult_SignDecodeErrorZ *NONNULL_PTR orig);
15943 * Frees the buffer pointed to by `data` if `datalen` is non-0.
15945 void CVec_u5Z_free(struct LDKCVec_u5Z _res);
15948 * Creates a new CResult_RecoverableSignatureNoneZ in the success state.
15950 struct LDKCResult_RecoverableSignatureNoneZ CResult_RecoverableSignatureNoneZ_ok(struct LDKRecoverableSignature o);
15953 * Creates a new CResult_RecoverableSignatureNoneZ in the error state.
15955 struct LDKCResult_RecoverableSignatureNoneZ CResult_RecoverableSignatureNoneZ_err(void);
15958 * Checks if the given object is currently in the success state
15960 bool CResult_RecoverableSignatureNoneZ_is_ok(const struct LDKCResult_RecoverableSignatureNoneZ *NONNULL_PTR o);
15963 * Frees any resources used by the CResult_RecoverableSignatureNoneZ.
15965 void CResult_RecoverableSignatureNoneZ_free(struct LDKCResult_RecoverableSignatureNoneZ _res);
15968 * Creates a new CResult_RecoverableSignatureNoneZ which has the same data as `orig`
15969 * but with all dynamically-allocated buffers duplicated in new buffers.
15971 struct LDKCResult_RecoverableSignatureNoneZ CResult_RecoverableSignatureNoneZ_clone(const struct LDKCResult_RecoverableSignatureNoneZ *NONNULL_PTR orig);
15974 * Frees the buffer pointed to by `data` if `datalen` is non-0.
15976 void CVec_u8Z_free(struct LDKCVec_u8Z _res);
15979 * Frees the buffer pointed to by `data` if `datalen` is non-0.
15981 void CVec_CVec_u8ZZ_free(struct LDKCVec_CVec_u8ZZ _res);
15984 * Creates a new CResult_CVec_CVec_u8ZZNoneZ in the success state.
15986 struct LDKCResult_CVec_CVec_u8ZZNoneZ CResult_CVec_CVec_u8ZZNoneZ_ok(struct LDKCVec_CVec_u8ZZ o);
15989 * Creates a new CResult_CVec_CVec_u8ZZNoneZ in the error state.
15991 struct LDKCResult_CVec_CVec_u8ZZNoneZ CResult_CVec_CVec_u8ZZNoneZ_err(void);
15994 * Checks if the given object is currently in the success state
15996 bool CResult_CVec_CVec_u8ZZNoneZ_is_ok(const struct LDKCResult_CVec_CVec_u8ZZNoneZ *NONNULL_PTR o);
15999 * Frees any resources used by the CResult_CVec_CVec_u8ZZNoneZ.
16001 void CResult_CVec_CVec_u8ZZNoneZ_free(struct LDKCResult_CVec_CVec_u8ZZNoneZ _res);
16004 * Creates a new CResult_CVec_CVec_u8ZZNoneZ which has the same data as `orig`
16005 * but with all dynamically-allocated buffers duplicated in new buffers.
16007 struct LDKCResult_CVec_CVec_u8ZZNoneZ CResult_CVec_CVec_u8ZZNoneZ_clone(const struct LDKCResult_CVec_CVec_u8ZZNoneZ *NONNULL_PTR orig);
16010 * Creates a new CResult_InMemorySignerDecodeErrorZ in the success state.
16012 struct LDKCResult_InMemorySignerDecodeErrorZ CResult_InMemorySignerDecodeErrorZ_ok(struct LDKInMemorySigner o);
16015 * Creates a new CResult_InMemorySignerDecodeErrorZ in the error state.
16017 struct LDKCResult_InMemorySignerDecodeErrorZ CResult_InMemorySignerDecodeErrorZ_err(struct LDKDecodeError e);
16020 * Checks if the given object is currently in the success state
16022 bool CResult_InMemorySignerDecodeErrorZ_is_ok(const struct LDKCResult_InMemorySignerDecodeErrorZ *NONNULL_PTR o);
16025 * Frees any resources used by the CResult_InMemorySignerDecodeErrorZ.
16027 void CResult_InMemorySignerDecodeErrorZ_free(struct LDKCResult_InMemorySignerDecodeErrorZ _res);
16030 * Creates a new CResult_InMemorySignerDecodeErrorZ which has the same data as `orig`
16031 * but with all dynamically-allocated buffers duplicated in new buffers.
16033 struct LDKCResult_InMemorySignerDecodeErrorZ CResult_InMemorySignerDecodeErrorZ_clone(const struct LDKCResult_InMemorySignerDecodeErrorZ *NONNULL_PTR orig);
16036 * Frees the buffer pointed to by `data` if `datalen` is non-0.
16038 void CVec_TxOutZ_free(struct LDKCVec_TxOutZ _res);
16041 * Creates a new CResult_TransactionNoneZ in the success state.
16043 struct LDKCResult_TransactionNoneZ CResult_TransactionNoneZ_ok(struct LDKTransaction o);
16046 * Creates a new CResult_TransactionNoneZ in the error state.
16048 struct LDKCResult_TransactionNoneZ CResult_TransactionNoneZ_err(void);
16051 * Checks if the given object is currently in the success state
16053 bool CResult_TransactionNoneZ_is_ok(const struct LDKCResult_TransactionNoneZ *NONNULL_PTR o);
16056 * Frees any resources used by the CResult_TransactionNoneZ.
16058 void CResult_TransactionNoneZ_free(struct LDKCResult_TransactionNoneZ _res);
16061 * Creates a new CResult_TransactionNoneZ which has the same data as `orig`
16062 * but with all dynamically-allocated buffers duplicated in new buffers.
16064 struct LDKCResult_TransactionNoneZ CResult_TransactionNoneZ_clone(const struct LDKCResult_TransactionNoneZ *NONNULL_PTR orig);
16067 * Creates a new C2Tuple_BlockHashChannelMonitorZ from the contained elements.
16069 struct LDKC2Tuple_BlockHashChannelMonitorZ C2Tuple_BlockHashChannelMonitorZ_new(struct LDKThirtyTwoBytes a, struct LDKChannelMonitor b);
16072 * Frees any resources used by the C2Tuple_BlockHashChannelMonitorZ.
16074 void C2Tuple_BlockHashChannelMonitorZ_free(struct LDKC2Tuple_BlockHashChannelMonitorZ _res);
16077 * Frees the buffer pointed to by `data` if `datalen` is non-0.
16079 void CVec_C2Tuple_BlockHashChannelMonitorZZ_free(struct LDKCVec_C2Tuple_BlockHashChannelMonitorZZ _res);
16082 * Creates a new CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ in the success state.
16084 struct LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_ok(struct LDKCVec_C2Tuple_BlockHashChannelMonitorZZ o);
16087 * Creates a new CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ in the error state.
16089 struct LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_err(enum LDKIOError e);
16092 * Checks if the given object is currently in the success state
16094 bool CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_is_ok(const struct LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ *NONNULL_PTR o);
16097 * Frees any resources used by the CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ.
16099 void CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_free(struct LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ _res);
16102 * Constructs a new COption_u16Z containing a u16
16104 struct LDKCOption_u16Z COption_u16Z_some(uint16_t o);
16107 * Constructs a new COption_u16Z containing nothing
16109 struct LDKCOption_u16Z COption_u16Z_none(void);
16112 * Frees any resources associated with the u16, if we are in the Some state
16114 void COption_u16Z_free(struct LDKCOption_u16Z _res);
16117 * Creates a new COption_u16Z which has the same data as `orig`
16118 * but with all dynamically-allocated buffers duplicated in new buffers.
16120 struct LDKCOption_u16Z COption_u16Z_clone(const struct LDKCOption_u16Z *NONNULL_PTR orig);
16123 * Creates a new CResult_NoneAPIErrorZ in the success state.
16125 struct LDKCResult_NoneAPIErrorZ CResult_NoneAPIErrorZ_ok(void);
16128 * Creates a new CResult_NoneAPIErrorZ in the error state.
16130 struct LDKCResult_NoneAPIErrorZ CResult_NoneAPIErrorZ_err(struct LDKAPIError e);
16133 * Checks if the given object is currently in the success state
16135 bool CResult_NoneAPIErrorZ_is_ok(const struct LDKCResult_NoneAPIErrorZ *NONNULL_PTR o);
16138 * Frees any resources used by the CResult_NoneAPIErrorZ.
16140 void CResult_NoneAPIErrorZ_free(struct LDKCResult_NoneAPIErrorZ _res);
16143 * Creates a new CResult_NoneAPIErrorZ which has the same data as `orig`
16144 * but with all dynamically-allocated buffers duplicated in new buffers.
16146 struct LDKCResult_NoneAPIErrorZ CResult_NoneAPIErrorZ_clone(const struct LDKCResult_NoneAPIErrorZ *NONNULL_PTR orig);
16149 * Frees the buffer pointed to by `data` if `datalen` is non-0.
16151 void CVec_CResult_NoneAPIErrorZZ_free(struct LDKCVec_CResult_NoneAPIErrorZZ _res);
16154 * Frees the buffer pointed to by `data` if `datalen` is non-0.
16156 void CVec_APIErrorZ_free(struct LDKCVec_APIErrorZ _res);
16159 * Creates a new CResult__u832APIErrorZ in the success state.
16161 struct LDKCResult__u832APIErrorZ CResult__u832APIErrorZ_ok(struct LDKThirtyTwoBytes o);
16164 * Creates a new CResult__u832APIErrorZ in the error state.
16166 struct LDKCResult__u832APIErrorZ CResult__u832APIErrorZ_err(struct LDKAPIError e);
16169 * Checks if the given object is currently in the success state
16171 bool CResult__u832APIErrorZ_is_ok(const struct LDKCResult__u832APIErrorZ *NONNULL_PTR o);
16174 * Frees any resources used by the CResult__u832APIErrorZ.
16176 void CResult__u832APIErrorZ_free(struct LDKCResult__u832APIErrorZ _res);
16179 * Creates a new CResult__u832APIErrorZ which has the same data as `orig`
16180 * but with all dynamically-allocated buffers duplicated in new buffers.
16182 struct LDKCResult__u832APIErrorZ CResult__u832APIErrorZ_clone(const struct LDKCResult__u832APIErrorZ *NONNULL_PTR orig);
16185 * Creates a new CResult_PaymentIdPaymentSendFailureZ in the success state.
16187 struct LDKCResult_PaymentIdPaymentSendFailureZ CResult_PaymentIdPaymentSendFailureZ_ok(struct LDKThirtyTwoBytes o);
16190 * Creates a new CResult_PaymentIdPaymentSendFailureZ in the error state.
16192 struct LDKCResult_PaymentIdPaymentSendFailureZ CResult_PaymentIdPaymentSendFailureZ_err(struct LDKPaymentSendFailure e);
16195 * Checks if the given object is currently in the success state
16197 bool CResult_PaymentIdPaymentSendFailureZ_is_ok(const struct LDKCResult_PaymentIdPaymentSendFailureZ *NONNULL_PTR o);
16200 * Frees any resources used by the CResult_PaymentIdPaymentSendFailureZ.
16202 void CResult_PaymentIdPaymentSendFailureZ_free(struct LDKCResult_PaymentIdPaymentSendFailureZ _res);
16205 * Creates a new CResult_PaymentIdPaymentSendFailureZ which has the same data as `orig`
16206 * but with all dynamically-allocated buffers duplicated in new buffers.
16208 struct LDKCResult_PaymentIdPaymentSendFailureZ CResult_PaymentIdPaymentSendFailureZ_clone(const struct LDKCResult_PaymentIdPaymentSendFailureZ *NONNULL_PTR orig);
16211 * Creates a new CResult_NonePaymentSendFailureZ in the success state.
16213 struct LDKCResult_NonePaymentSendFailureZ CResult_NonePaymentSendFailureZ_ok(void);
16216 * Creates a new CResult_NonePaymentSendFailureZ in the error state.
16218 struct LDKCResult_NonePaymentSendFailureZ CResult_NonePaymentSendFailureZ_err(struct LDKPaymentSendFailure e);
16221 * Checks if the given object is currently in the success state
16223 bool CResult_NonePaymentSendFailureZ_is_ok(const struct LDKCResult_NonePaymentSendFailureZ *NONNULL_PTR o);
16226 * Frees any resources used by the CResult_NonePaymentSendFailureZ.
16228 void CResult_NonePaymentSendFailureZ_free(struct LDKCResult_NonePaymentSendFailureZ _res);
16231 * Creates a new CResult_NonePaymentSendFailureZ which has the same data as `orig`
16232 * but with all dynamically-allocated buffers duplicated in new buffers.
16234 struct LDKCResult_NonePaymentSendFailureZ CResult_NonePaymentSendFailureZ_clone(const struct LDKCResult_NonePaymentSendFailureZ *NONNULL_PTR orig);
16237 * Creates a new tuple which has the same data as `orig`
16238 * but with all dynamically-allocated buffers duplicated in new buffers.
16240 struct LDKC2Tuple_PaymentHashPaymentIdZ C2Tuple_PaymentHashPaymentIdZ_clone(const struct LDKC2Tuple_PaymentHashPaymentIdZ *NONNULL_PTR orig);
16243 * Creates a new C2Tuple_PaymentHashPaymentIdZ from the contained elements.
16245 struct LDKC2Tuple_PaymentHashPaymentIdZ C2Tuple_PaymentHashPaymentIdZ_new(struct LDKThirtyTwoBytes a, struct LDKThirtyTwoBytes b);
16248 * Frees any resources used by the C2Tuple_PaymentHashPaymentIdZ.
16250 void C2Tuple_PaymentHashPaymentIdZ_free(struct LDKC2Tuple_PaymentHashPaymentIdZ _res);
16253 * Creates a new CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ in the success state.
16255 struct LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_ok(struct LDKC2Tuple_PaymentHashPaymentIdZ o);
16258 * Creates a new CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ in the error state.
16260 struct LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_err(struct LDKPaymentSendFailure e);
16263 * Checks if the given object is currently in the success state
16265 bool CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_is_ok(const struct LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ *NONNULL_PTR o);
16268 * Frees any resources used by the CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ.
16270 void CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_free(struct LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ _res);
16273 * Creates a new CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ which has the same data as `orig`
16274 * but with all dynamically-allocated buffers duplicated in new buffers.
16276 struct LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_clone(const struct LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ *NONNULL_PTR orig);
16279 * Frees the buffer pointed to by `data` if `datalen` is non-0.
16281 void CVec_ThirtyTwoBytesZ_free(struct LDKCVec_ThirtyTwoBytesZ _res);
16284 * Creates a new tuple which has the same data as `orig`
16285 * but with all dynamically-allocated buffers duplicated in new buffers.
16287 struct LDKC2Tuple_PaymentHashPaymentSecretZ C2Tuple_PaymentHashPaymentSecretZ_clone(const struct LDKC2Tuple_PaymentHashPaymentSecretZ *NONNULL_PTR orig);
16290 * Creates a new C2Tuple_PaymentHashPaymentSecretZ from the contained elements.
16292 struct LDKC2Tuple_PaymentHashPaymentSecretZ C2Tuple_PaymentHashPaymentSecretZ_new(struct LDKThirtyTwoBytes a, struct LDKThirtyTwoBytes b);
16295 * Frees any resources used by the C2Tuple_PaymentHashPaymentSecretZ.
16297 void C2Tuple_PaymentHashPaymentSecretZ_free(struct LDKC2Tuple_PaymentHashPaymentSecretZ _res);
16300 * Creates a new CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ in the success state.
16302 struct LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_ok(struct LDKC2Tuple_PaymentHashPaymentSecretZ o);
16305 * Creates a new CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ in the error state.
16307 struct LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_err(void);
16310 * Checks if the given object is currently in the success state
16312 bool CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_is_ok(const struct LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ *NONNULL_PTR o);
16315 * Frees any resources used by the CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ.
16317 void CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_free(struct LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ _res);
16320 * Creates a new CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ which has the same data as `orig`
16321 * but with all dynamically-allocated buffers duplicated in new buffers.
16323 struct LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_clone(const struct LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ *NONNULL_PTR orig);
16326 * Creates a new CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ in the success state.
16328 struct LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_ok(struct LDKC2Tuple_PaymentHashPaymentSecretZ o);
16331 * Creates a new CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ in the error state.
16333 struct LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_err(struct LDKAPIError e);
16336 * Checks if the given object is currently in the success state
16338 bool CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_is_ok(const struct LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ *NONNULL_PTR o);
16341 * Frees any resources used by the CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ.
16343 void CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_free(struct LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ _res);
16346 * Creates a new CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ which has the same data as `orig`
16347 * but with all dynamically-allocated buffers duplicated in new buffers.
16349 struct LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_clone(const struct LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ *NONNULL_PTR orig);
16352 * Creates a new CResult_PaymentSecretNoneZ in the success state.
16354 struct LDKCResult_PaymentSecretNoneZ CResult_PaymentSecretNoneZ_ok(struct LDKThirtyTwoBytes o);
16357 * Creates a new CResult_PaymentSecretNoneZ in the error state.
16359 struct LDKCResult_PaymentSecretNoneZ CResult_PaymentSecretNoneZ_err(void);
16362 * Checks if the given object is currently in the success state
16364 bool CResult_PaymentSecretNoneZ_is_ok(const struct LDKCResult_PaymentSecretNoneZ *NONNULL_PTR o);
16367 * Frees any resources used by the CResult_PaymentSecretNoneZ.
16369 void CResult_PaymentSecretNoneZ_free(struct LDKCResult_PaymentSecretNoneZ _res);
16372 * Creates a new CResult_PaymentSecretNoneZ which has the same data as `orig`
16373 * but with all dynamically-allocated buffers duplicated in new buffers.
16375 struct LDKCResult_PaymentSecretNoneZ CResult_PaymentSecretNoneZ_clone(const struct LDKCResult_PaymentSecretNoneZ *NONNULL_PTR orig);
16378 * Creates a new CResult_PaymentSecretAPIErrorZ in the success state.
16380 struct LDKCResult_PaymentSecretAPIErrorZ CResult_PaymentSecretAPIErrorZ_ok(struct LDKThirtyTwoBytes o);
16383 * Creates a new CResult_PaymentSecretAPIErrorZ in the error state.
16385 struct LDKCResult_PaymentSecretAPIErrorZ CResult_PaymentSecretAPIErrorZ_err(struct LDKAPIError e);
16388 * Checks if the given object is currently in the success state
16390 bool CResult_PaymentSecretAPIErrorZ_is_ok(const struct LDKCResult_PaymentSecretAPIErrorZ *NONNULL_PTR o);
16393 * Frees any resources used by the CResult_PaymentSecretAPIErrorZ.
16395 void CResult_PaymentSecretAPIErrorZ_free(struct LDKCResult_PaymentSecretAPIErrorZ _res);
16398 * Creates a new CResult_PaymentSecretAPIErrorZ which has the same data as `orig`
16399 * but with all dynamically-allocated buffers duplicated in new buffers.
16401 struct LDKCResult_PaymentSecretAPIErrorZ CResult_PaymentSecretAPIErrorZ_clone(const struct LDKCResult_PaymentSecretAPIErrorZ *NONNULL_PTR orig);
16404 * Creates a new CResult_PaymentPreimageAPIErrorZ in the success state.
16406 struct LDKCResult_PaymentPreimageAPIErrorZ CResult_PaymentPreimageAPIErrorZ_ok(struct LDKThirtyTwoBytes o);
16409 * Creates a new CResult_PaymentPreimageAPIErrorZ in the error state.
16411 struct LDKCResult_PaymentPreimageAPIErrorZ CResult_PaymentPreimageAPIErrorZ_err(struct LDKAPIError e);
16414 * Checks if the given object is currently in the success state
16416 bool CResult_PaymentPreimageAPIErrorZ_is_ok(const struct LDKCResult_PaymentPreimageAPIErrorZ *NONNULL_PTR o);
16419 * Frees any resources used by the CResult_PaymentPreimageAPIErrorZ.
16421 void CResult_PaymentPreimageAPIErrorZ_free(struct LDKCResult_PaymentPreimageAPIErrorZ _res);
16424 * Creates a new CResult_PaymentPreimageAPIErrorZ which has the same data as `orig`
16425 * but with all dynamically-allocated buffers duplicated in new buffers.
16427 struct LDKCResult_PaymentPreimageAPIErrorZ CResult_PaymentPreimageAPIErrorZ_clone(const struct LDKCResult_PaymentPreimageAPIErrorZ *NONNULL_PTR orig);
16430 * Creates a new CResult_CounterpartyForwardingInfoDecodeErrorZ in the success state.
16432 struct LDKCResult_CounterpartyForwardingInfoDecodeErrorZ CResult_CounterpartyForwardingInfoDecodeErrorZ_ok(struct LDKCounterpartyForwardingInfo o);
16435 * Creates a new CResult_CounterpartyForwardingInfoDecodeErrorZ in the error state.
16437 struct LDKCResult_CounterpartyForwardingInfoDecodeErrorZ CResult_CounterpartyForwardingInfoDecodeErrorZ_err(struct LDKDecodeError e);
16440 * Checks if the given object is currently in the success state
16442 bool CResult_CounterpartyForwardingInfoDecodeErrorZ_is_ok(const struct LDKCResult_CounterpartyForwardingInfoDecodeErrorZ *NONNULL_PTR o);
16445 * Frees any resources used by the CResult_CounterpartyForwardingInfoDecodeErrorZ.
16447 void CResult_CounterpartyForwardingInfoDecodeErrorZ_free(struct LDKCResult_CounterpartyForwardingInfoDecodeErrorZ _res);
16450 * Creates a new CResult_CounterpartyForwardingInfoDecodeErrorZ which has the same data as `orig`
16451 * but with all dynamically-allocated buffers duplicated in new buffers.
16453 struct LDKCResult_CounterpartyForwardingInfoDecodeErrorZ CResult_CounterpartyForwardingInfoDecodeErrorZ_clone(const struct LDKCResult_CounterpartyForwardingInfoDecodeErrorZ *NONNULL_PTR orig);
16456 * Creates a new CResult_ChannelCounterpartyDecodeErrorZ in the success state.
16458 struct LDKCResult_ChannelCounterpartyDecodeErrorZ CResult_ChannelCounterpartyDecodeErrorZ_ok(struct LDKChannelCounterparty o);
16461 * Creates a new CResult_ChannelCounterpartyDecodeErrorZ in the error state.
16463 struct LDKCResult_ChannelCounterpartyDecodeErrorZ CResult_ChannelCounterpartyDecodeErrorZ_err(struct LDKDecodeError e);
16466 * Checks if the given object is currently in the success state
16468 bool CResult_ChannelCounterpartyDecodeErrorZ_is_ok(const struct LDKCResult_ChannelCounterpartyDecodeErrorZ *NONNULL_PTR o);
16471 * Frees any resources used by the CResult_ChannelCounterpartyDecodeErrorZ.
16473 void CResult_ChannelCounterpartyDecodeErrorZ_free(struct LDKCResult_ChannelCounterpartyDecodeErrorZ _res);
16476 * Creates a new CResult_ChannelCounterpartyDecodeErrorZ which has the same data as `orig`
16477 * but with all dynamically-allocated buffers duplicated in new buffers.
16479 struct LDKCResult_ChannelCounterpartyDecodeErrorZ CResult_ChannelCounterpartyDecodeErrorZ_clone(const struct LDKCResult_ChannelCounterpartyDecodeErrorZ *NONNULL_PTR orig);
16482 * Creates a new CResult_ChannelDetailsDecodeErrorZ in the success state.
16484 struct LDKCResult_ChannelDetailsDecodeErrorZ CResult_ChannelDetailsDecodeErrorZ_ok(struct LDKChannelDetails o);
16487 * Creates a new CResult_ChannelDetailsDecodeErrorZ in the error state.
16489 struct LDKCResult_ChannelDetailsDecodeErrorZ CResult_ChannelDetailsDecodeErrorZ_err(struct LDKDecodeError e);
16492 * Checks if the given object is currently in the success state
16494 bool CResult_ChannelDetailsDecodeErrorZ_is_ok(const struct LDKCResult_ChannelDetailsDecodeErrorZ *NONNULL_PTR o);
16497 * Frees any resources used by the CResult_ChannelDetailsDecodeErrorZ.
16499 void CResult_ChannelDetailsDecodeErrorZ_free(struct LDKCResult_ChannelDetailsDecodeErrorZ _res);
16502 * Creates a new CResult_ChannelDetailsDecodeErrorZ which has the same data as `orig`
16503 * but with all dynamically-allocated buffers duplicated in new buffers.
16505 struct LDKCResult_ChannelDetailsDecodeErrorZ CResult_ChannelDetailsDecodeErrorZ_clone(const struct LDKCResult_ChannelDetailsDecodeErrorZ *NONNULL_PTR orig);
16508 * Creates a new CResult_PhantomRouteHintsDecodeErrorZ in the success state.
16510 struct LDKCResult_PhantomRouteHintsDecodeErrorZ CResult_PhantomRouteHintsDecodeErrorZ_ok(struct LDKPhantomRouteHints o);
16513 * Creates a new CResult_PhantomRouteHintsDecodeErrorZ in the error state.
16515 struct LDKCResult_PhantomRouteHintsDecodeErrorZ CResult_PhantomRouteHintsDecodeErrorZ_err(struct LDKDecodeError e);
16518 * Checks if the given object is currently in the success state
16520 bool CResult_PhantomRouteHintsDecodeErrorZ_is_ok(const struct LDKCResult_PhantomRouteHintsDecodeErrorZ *NONNULL_PTR o);
16523 * Frees any resources used by the CResult_PhantomRouteHintsDecodeErrorZ.
16525 void CResult_PhantomRouteHintsDecodeErrorZ_free(struct LDKCResult_PhantomRouteHintsDecodeErrorZ _res);
16528 * Creates a new CResult_PhantomRouteHintsDecodeErrorZ which has the same data as `orig`
16529 * but with all dynamically-allocated buffers duplicated in new buffers.
16531 struct LDKCResult_PhantomRouteHintsDecodeErrorZ CResult_PhantomRouteHintsDecodeErrorZ_clone(const struct LDKCResult_PhantomRouteHintsDecodeErrorZ *NONNULL_PTR orig);
16534 * Frees the buffer pointed to by `data` if `datalen` is non-0.
16536 void CVec_ChannelMonitorZ_free(struct LDKCVec_ChannelMonitorZ _res);
16539 * Creates a new C2Tuple_BlockHashChannelManagerZ from the contained elements.
16541 struct LDKC2Tuple_BlockHashChannelManagerZ C2Tuple_BlockHashChannelManagerZ_new(struct LDKThirtyTwoBytes a, struct LDKChannelManager b);
16544 * Frees any resources used by the C2Tuple_BlockHashChannelManagerZ.
16546 void C2Tuple_BlockHashChannelManagerZ_free(struct LDKC2Tuple_BlockHashChannelManagerZ _res);
16549 * Creates a new CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ in the success state.
16551 struct LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_ok(struct LDKC2Tuple_BlockHashChannelManagerZ o);
16554 * Creates a new CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ in the error state.
16556 struct LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_err(struct LDKDecodeError e);
16559 * Checks if the given object is currently in the success state
16561 bool CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_is_ok(const struct LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ *NONNULL_PTR o);
16564 * Frees any resources used by the CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ.
16566 void CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_free(struct LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ _res);
16569 * Creates a new CResult_ChannelConfigDecodeErrorZ in the success state.
16571 struct LDKCResult_ChannelConfigDecodeErrorZ CResult_ChannelConfigDecodeErrorZ_ok(struct LDKChannelConfig o);
16574 * Creates a new CResult_ChannelConfigDecodeErrorZ in the error state.
16576 struct LDKCResult_ChannelConfigDecodeErrorZ CResult_ChannelConfigDecodeErrorZ_err(struct LDKDecodeError e);
16579 * Checks if the given object is currently in the success state
16581 bool CResult_ChannelConfigDecodeErrorZ_is_ok(const struct LDKCResult_ChannelConfigDecodeErrorZ *NONNULL_PTR o);
16584 * Frees any resources used by the CResult_ChannelConfigDecodeErrorZ.
16586 void CResult_ChannelConfigDecodeErrorZ_free(struct LDKCResult_ChannelConfigDecodeErrorZ _res);
16589 * Creates a new CResult_ChannelConfigDecodeErrorZ which has the same data as `orig`
16590 * but with all dynamically-allocated buffers duplicated in new buffers.
16592 struct LDKCResult_ChannelConfigDecodeErrorZ CResult_ChannelConfigDecodeErrorZ_clone(const struct LDKCResult_ChannelConfigDecodeErrorZ *NONNULL_PTR orig);
16595 * Creates a new CResult_OutPointDecodeErrorZ in the success state.
16597 struct LDKCResult_OutPointDecodeErrorZ CResult_OutPointDecodeErrorZ_ok(struct LDKOutPoint o);
16600 * Creates a new CResult_OutPointDecodeErrorZ in the error state.
16602 struct LDKCResult_OutPointDecodeErrorZ CResult_OutPointDecodeErrorZ_err(struct LDKDecodeError e);
16605 * Checks if the given object is currently in the success state
16607 bool CResult_OutPointDecodeErrorZ_is_ok(const struct LDKCResult_OutPointDecodeErrorZ *NONNULL_PTR o);
16610 * Frees any resources used by the CResult_OutPointDecodeErrorZ.
16612 void CResult_OutPointDecodeErrorZ_free(struct LDKCResult_OutPointDecodeErrorZ _res);
16615 * Creates a new CResult_OutPointDecodeErrorZ which has the same data as `orig`
16616 * but with all dynamically-allocated buffers duplicated in new buffers.
16618 struct LDKCResult_OutPointDecodeErrorZ CResult_OutPointDecodeErrorZ_clone(const struct LDKCResult_OutPointDecodeErrorZ *NONNULL_PTR orig);
16621 * Constructs a new COption_TypeZ containing a crate::lightning::ln::wire::Type
16623 struct LDKCOption_TypeZ COption_TypeZ_some(struct LDKType o);
16626 * Constructs a new COption_TypeZ containing nothing
16628 struct LDKCOption_TypeZ COption_TypeZ_none(void);
16631 * Frees any resources associated with the crate::lightning::ln::wire::Type, if we are in the Some state
16633 void COption_TypeZ_free(struct LDKCOption_TypeZ _res);
16636 * Creates a new CResult_COption_TypeZDecodeErrorZ in the success state.
16638 struct LDKCResult_COption_TypeZDecodeErrorZ CResult_COption_TypeZDecodeErrorZ_ok(struct LDKCOption_TypeZ o);
16641 * Creates a new CResult_COption_TypeZDecodeErrorZ in the error state.
16643 struct LDKCResult_COption_TypeZDecodeErrorZ CResult_COption_TypeZDecodeErrorZ_err(struct LDKDecodeError e);
16646 * Checks if the given object is currently in the success state
16648 bool CResult_COption_TypeZDecodeErrorZ_is_ok(const struct LDKCResult_COption_TypeZDecodeErrorZ *NONNULL_PTR o);
16651 * Frees any resources used by the CResult_COption_TypeZDecodeErrorZ.
16653 void CResult_COption_TypeZDecodeErrorZ_free(struct LDKCResult_COption_TypeZDecodeErrorZ _res);
16656 * Creates a new CResult_PaymentIdPaymentErrorZ in the success state.
16658 struct LDKCResult_PaymentIdPaymentErrorZ CResult_PaymentIdPaymentErrorZ_ok(struct LDKThirtyTwoBytes o);
16661 * Creates a new CResult_PaymentIdPaymentErrorZ in the error state.
16663 struct LDKCResult_PaymentIdPaymentErrorZ CResult_PaymentIdPaymentErrorZ_err(struct LDKPaymentError e);
16666 * Checks if the given object is currently in the success state
16668 bool CResult_PaymentIdPaymentErrorZ_is_ok(const struct LDKCResult_PaymentIdPaymentErrorZ *NONNULL_PTR o);
16671 * Frees any resources used by the CResult_PaymentIdPaymentErrorZ.
16673 void CResult_PaymentIdPaymentErrorZ_free(struct LDKCResult_PaymentIdPaymentErrorZ _res);
16676 * Creates a new CResult_PaymentIdPaymentErrorZ which has the same data as `orig`
16677 * but with all dynamically-allocated buffers duplicated in new buffers.
16679 struct LDKCResult_PaymentIdPaymentErrorZ CResult_PaymentIdPaymentErrorZ_clone(const struct LDKCResult_PaymentIdPaymentErrorZ *NONNULL_PTR orig);
16682 * Creates a new CResult_InFlightHtlcsDecodeErrorZ in the success state.
16684 struct LDKCResult_InFlightHtlcsDecodeErrorZ CResult_InFlightHtlcsDecodeErrorZ_ok(struct LDKInFlightHtlcs o);
16687 * Creates a new CResult_InFlightHtlcsDecodeErrorZ in the error state.
16689 struct LDKCResult_InFlightHtlcsDecodeErrorZ CResult_InFlightHtlcsDecodeErrorZ_err(struct LDKDecodeError e);
16692 * Checks if the given object is currently in the success state
16694 bool CResult_InFlightHtlcsDecodeErrorZ_is_ok(const struct LDKCResult_InFlightHtlcsDecodeErrorZ *NONNULL_PTR o);
16697 * Frees any resources used by the CResult_InFlightHtlcsDecodeErrorZ.
16699 void CResult_InFlightHtlcsDecodeErrorZ_free(struct LDKCResult_InFlightHtlcsDecodeErrorZ _res);
16702 * Creates a new CResult_SiPrefixParseErrorZ in the success state.
16704 struct LDKCResult_SiPrefixParseErrorZ CResult_SiPrefixParseErrorZ_ok(enum LDKSiPrefix o);
16707 * Creates a new CResult_SiPrefixParseErrorZ in the error state.
16709 struct LDKCResult_SiPrefixParseErrorZ CResult_SiPrefixParseErrorZ_err(struct LDKParseError e);
16712 * Checks if the given object is currently in the success state
16714 bool CResult_SiPrefixParseErrorZ_is_ok(const struct LDKCResult_SiPrefixParseErrorZ *NONNULL_PTR o);
16717 * Frees any resources used by the CResult_SiPrefixParseErrorZ.
16719 void CResult_SiPrefixParseErrorZ_free(struct LDKCResult_SiPrefixParseErrorZ _res);
16722 * Creates a new CResult_SiPrefixParseErrorZ which has the same data as `orig`
16723 * but with all dynamically-allocated buffers duplicated in new buffers.
16725 struct LDKCResult_SiPrefixParseErrorZ CResult_SiPrefixParseErrorZ_clone(const struct LDKCResult_SiPrefixParseErrorZ *NONNULL_PTR orig);
16728 * Creates a new CResult_InvoiceParseOrSemanticErrorZ in the success state.
16730 struct LDKCResult_InvoiceParseOrSemanticErrorZ CResult_InvoiceParseOrSemanticErrorZ_ok(struct LDKInvoice o);
16733 * Creates a new CResult_InvoiceParseOrSemanticErrorZ in the error state.
16735 struct LDKCResult_InvoiceParseOrSemanticErrorZ CResult_InvoiceParseOrSemanticErrorZ_err(struct LDKParseOrSemanticError e);
16738 * Checks if the given object is currently in the success state
16740 bool CResult_InvoiceParseOrSemanticErrorZ_is_ok(const struct LDKCResult_InvoiceParseOrSemanticErrorZ *NONNULL_PTR o);
16743 * Frees any resources used by the CResult_InvoiceParseOrSemanticErrorZ.
16745 void CResult_InvoiceParseOrSemanticErrorZ_free(struct LDKCResult_InvoiceParseOrSemanticErrorZ _res);
16748 * Creates a new CResult_InvoiceParseOrSemanticErrorZ which has the same data as `orig`
16749 * but with all dynamically-allocated buffers duplicated in new buffers.
16751 struct LDKCResult_InvoiceParseOrSemanticErrorZ CResult_InvoiceParseOrSemanticErrorZ_clone(const struct LDKCResult_InvoiceParseOrSemanticErrorZ *NONNULL_PTR orig);
16754 * Creates a new CResult_SignedRawInvoiceParseErrorZ in the success state.
16756 struct LDKCResult_SignedRawInvoiceParseErrorZ CResult_SignedRawInvoiceParseErrorZ_ok(struct LDKSignedRawInvoice o);
16759 * Creates a new CResult_SignedRawInvoiceParseErrorZ in the error state.
16761 struct LDKCResult_SignedRawInvoiceParseErrorZ CResult_SignedRawInvoiceParseErrorZ_err(struct LDKParseError e);
16764 * Checks if the given object is currently in the success state
16766 bool CResult_SignedRawInvoiceParseErrorZ_is_ok(const struct LDKCResult_SignedRawInvoiceParseErrorZ *NONNULL_PTR o);
16769 * Frees any resources used by the CResult_SignedRawInvoiceParseErrorZ.
16771 void CResult_SignedRawInvoiceParseErrorZ_free(struct LDKCResult_SignedRawInvoiceParseErrorZ _res);
16774 * Creates a new CResult_SignedRawInvoiceParseErrorZ which has the same data as `orig`
16775 * but with all dynamically-allocated buffers duplicated in new buffers.
16777 struct LDKCResult_SignedRawInvoiceParseErrorZ CResult_SignedRawInvoiceParseErrorZ_clone(const struct LDKCResult_SignedRawInvoiceParseErrorZ *NONNULL_PTR orig);
16780 * Creates a new tuple which has the same data as `orig`
16781 * but with all dynamically-allocated buffers duplicated in new buffers.
16783 struct LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ C3Tuple_RawInvoice_u832InvoiceSignatureZ_clone(const struct LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ *NONNULL_PTR orig);
16786 * Creates a new C3Tuple_RawInvoice_u832InvoiceSignatureZ from the contained elements.
16788 struct LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ C3Tuple_RawInvoice_u832InvoiceSignatureZ_new(struct LDKRawInvoice a, struct LDKThirtyTwoBytes b, struct LDKInvoiceSignature c);
16791 * Frees any resources used by the C3Tuple_RawInvoice_u832InvoiceSignatureZ.
16793 void C3Tuple_RawInvoice_u832InvoiceSignatureZ_free(struct LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ _res);
16796 * Creates a new CResult_PayeePubKeyErrorZ in the success state.
16798 struct LDKCResult_PayeePubKeyErrorZ CResult_PayeePubKeyErrorZ_ok(struct LDKPayeePubKey o);
16801 * Creates a new CResult_PayeePubKeyErrorZ in the error state.
16803 struct LDKCResult_PayeePubKeyErrorZ CResult_PayeePubKeyErrorZ_err(enum LDKSecp256k1Error e);
16806 * Checks if the given object is currently in the success state
16808 bool CResult_PayeePubKeyErrorZ_is_ok(const struct LDKCResult_PayeePubKeyErrorZ *NONNULL_PTR o);
16811 * Frees any resources used by the CResult_PayeePubKeyErrorZ.
16813 void CResult_PayeePubKeyErrorZ_free(struct LDKCResult_PayeePubKeyErrorZ _res);
16816 * Creates a new CResult_PayeePubKeyErrorZ which has the same data as `orig`
16817 * but with all dynamically-allocated buffers duplicated in new buffers.
16819 struct LDKCResult_PayeePubKeyErrorZ CResult_PayeePubKeyErrorZ_clone(const struct LDKCResult_PayeePubKeyErrorZ *NONNULL_PTR orig);
16822 * Frees the buffer pointed to by `data` if `datalen` is non-0.
16824 void CVec_PrivateRouteZ_free(struct LDKCVec_PrivateRouteZ _res);
16827 * Creates a new CResult_PositiveTimestampCreationErrorZ in the success state.
16829 struct LDKCResult_PositiveTimestampCreationErrorZ CResult_PositiveTimestampCreationErrorZ_ok(struct LDKPositiveTimestamp o);
16832 * Creates a new CResult_PositiveTimestampCreationErrorZ in the error state.
16834 struct LDKCResult_PositiveTimestampCreationErrorZ CResult_PositiveTimestampCreationErrorZ_err(enum LDKCreationError e);
16837 * Checks if the given object is currently in the success state
16839 bool CResult_PositiveTimestampCreationErrorZ_is_ok(const struct LDKCResult_PositiveTimestampCreationErrorZ *NONNULL_PTR o);
16842 * Frees any resources used by the CResult_PositiveTimestampCreationErrorZ.
16844 void CResult_PositiveTimestampCreationErrorZ_free(struct LDKCResult_PositiveTimestampCreationErrorZ _res);
16847 * Creates a new CResult_PositiveTimestampCreationErrorZ which has the same data as `orig`
16848 * but with all dynamically-allocated buffers duplicated in new buffers.
16850 struct LDKCResult_PositiveTimestampCreationErrorZ CResult_PositiveTimestampCreationErrorZ_clone(const struct LDKCResult_PositiveTimestampCreationErrorZ *NONNULL_PTR orig);
16853 * Creates a new CResult_NoneSemanticErrorZ in the success state.
16855 struct LDKCResult_NoneSemanticErrorZ CResult_NoneSemanticErrorZ_ok(void);
16858 * Creates a new CResult_NoneSemanticErrorZ in the error state.
16860 struct LDKCResult_NoneSemanticErrorZ CResult_NoneSemanticErrorZ_err(enum LDKSemanticError e);
16863 * Checks if the given object is currently in the success state
16865 bool CResult_NoneSemanticErrorZ_is_ok(const struct LDKCResult_NoneSemanticErrorZ *NONNULL_PTR o);
16868 * Frees any resources used by the CResult_NoneSemanticErrorZ.
16870 void CResult_NoneSemanticErrorZ_free(struct LDKCResult_NoneSemanticErrorZ _res);
16873 * Creates a new CResult_NoneSemanticErrorZ which has the same data as `orig`
16874 * but with all dynamically-allocated buffers duplicated in new buffers.
16876 struct LDKCResult_NoneSemanticErrorZ CResult_NoneSemanticErrorZ_clone(const struct LDKCResult_NoneSemanticErrorZ *NONNULL_PTR orig);
16879 * Creates a new CResult_InvoiceSemanticErrorZ in the success state.
16881 struct LDKCResult_InvoiceSemanticErrorZ CResult_InvoiceSemanticErrorZ_ok(struct LDKInvoice o);
16884 * Creates a new CResult_InvoiceSemanticErrorZ in the error state.
16886 struct LDKCResult_InvoiceSemanticErrorZ CResult_InvoiceSemanticErrorZ_err(enum LDKSemanticError e);
16889 * Checks if the given object is currently in the success state
16891 bool CResult_InvoiceSemanticErrorZ_is_ok(const struct LDKCResult_InvoiceSemanticErrorZ *NONNULL_PTR o);
16894 * Frees any resources used by the CResult_InvoiceSemanticErrorZ.
16896 void CResult_InvoiceSemanticErrorZ_free(struct LDKCResult_InvoiceSemanticErrorZ _res);
16899 * Creates a new CResult_InvoiceSemanticErrorZ which has the same data as `orig`
16900 * but with all dynamically-allocated buffers duplicated in new buffers.
16902 struct LDKCResult_InvoiceSemanticErrorZ CResult_InvoiceSemanticErrorZ_clone(const struct LDKCResult_InvoiceSemanticErrorZ *NONNULL_PTR orig);
16905 * Creates a new CResult_DescriptionCreationErrorZ in the success state.
16907 struct LDKCResult_DescriptionCreationErrorZ CResult_DescriptionCreationErrorZ_ok(struct LDKDescription o);
16910 * Creates a new CResult_DescriptionCreationErrorZ in the error state.
16912 struct LDKCResult_DescriptionCreationErrorZ CResult_DescriptionCreationErrorZ_err(enum LDKCreationError e);
16915 * Checks if the given object is currently in the success state
16917 bool CResult_DescriptionCreationErrorZ_is_ok(const struct LDKCResult_DescriptionCreationErrorZ *NONNULL_PTR o);
16920 * Frees any resources used by the CResult_DescriptionCreationErrorZ.
16922 void CResult_DescriptionCreationErrorZ_free(struct LDKCResult_DescriptionCreationErrorZ _res);
16925 * Creates a new CResult_DescriptionCreationErrorZ which has the same data as `orig`
16926 * but with all dynamically-allocated buffers duplicated in new buffers.
16928 struct LDKCResult_DescriptionCreationErrorZ CResult_DescriptionCreationErrorZ_clone(const struct LDKCResult_DescriptionCreationErrorZ *NONNULL_PTR orig);
16931 * Creates a new CResult_PrivateRouteCreationErrorZ in the success state.
16933 struct LDKCResult_PrivateRouteCreationErrorZ CResult_PrivateRouteCreationErrorZ_ok(struct LDKPrivateRoute o);
16936 * Creates a new CResult_PrivateRouteCreationErrorZ in the error state.
16938 struct LDKCResult_PrivateRouteCreationErrorZ CResult_PrivateRouteCreationErrorZ_err(enum LDKCreationError e);
16941 * Checks if the given object is currently in the success state
16943 bool CResult_PrivateRouteCreationErrorZ_is_ok(const struct LDKCResult_PrivateRouteCreationErrorZ *NONNULL_PTR o);
16946 * Frees any resources used by the CResult_PrivateRouteCreationErrorZ.
16948 void CResult_PrivateRouteCreationErrorZ_free(struct LDKCResult_PrivateRouteCreationErrorZ _res);
16951 * Creates a new CResult_PrivateRouteCreationErrorZ which has the same data as `orig`
16952 * but with all dynamically-allocated buffers duplicated in new buffers.
16954 struct LDKCResult_PrivateRouteCreationErrorZ CResult_PrivateRouteCreationErrorZ_clone(const struct LDKCResult_PrivateRouteCreationErrorZ *NONNULL_PTR orig);
16957 * Creates a new CResult_StringErrorZ in the success state.
16959 struct LDKCResult_StringErrorZ CResult_StringErrorZ_ok(struct LDKStr o);
16962 * Creates a new CResult_StringErrorZ in the error state.
16964 struct LDKCResult_StringErrorZ CResult_StringErrorZ_err(enum LDKSecp256k1Error e);
16967 * Checks if the given object is currently in the success state
16969 bool CResult_StringErrorZ_is_ok(const struct LDKCResult_StringErrorZ *NONNULL_PTR o);
16972 * Frees any resources used by the CResult_StringErrorZ.
16974 void CResult_StringErrorZ_free(struct LDKCResult_StringErrorZ _res);
16977 * Creates a new CResult_StringErrorZ which has the same data as `orig`
16978 * but with all dynamically-allocated buffers duplicated in new buffers.
16980 struct LDKCResult_StringErrorZ CResult_StringErrorZ_clone(const struct LDKCResult_StringErrorZ *NONNULL_PTR orig);
16983 * Creates a new CResult_ChannelMonitorUpdateDecodeErrorZ in the success state.
16985 struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ CResult_ChannelMonitorUpdateDecodeErrorZ_ok(struct LDKChannelMonitorUpdate o);
16988 * Creates a new CResult_ChannelMonitorUpdateDecodeErrorZ in the error state.
16990 struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ CResult_ChannelMonitorUpdateDecodeErrorZ_err(struct LDKDecodeError e);
16993 * Checks if the given object is currently in the success state
16995 bool CResult_ChannelMonitorUpdateDecodeErrorZ_is_ok(const struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ *NONNULL_PTR o);
16998 * Frees any resources used by the CResult_ChannelMonitorUpdateDecodeErrorZ.
17000 void CResult_ChannelMonitorUpdateDecodeErrorZ_free(struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ _res);
17003 * Creates a new CResult_ChannelMonitorUpdateDecodeErrorZ which has the same data as `orig`
17004 * but with all dynamically-allocated buffers duplicated in new buffers.
17006 struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ CResult_ChannelMonitorUpdateDecodeErrorZ_clone(const struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ *NONNULL_PTR orig);
17009 * Constructs a new COption_MonitorEventZ containing a crate::lightning::chain::channelmonitor::MonitorEvent
17011 struct LDKCOption_MonitorEventZ COption_MonitorEventZ_some(struct LDKMonitorEvent o);
17014 * Constructs a new COption_MonitorEventZ containing nothing
17016 struct LDKCOption_MonitorEventZ COption_MonitorEventZ_none(void);
17019 * Frees any resources associated with the crate::lightning::chain::channelmonitor::MonitorEvent, if we are in the Some state
17021 void COption_MonitorEventZ_free(struct LDKCOption_MonitorEventZ _res);
17024 * Creates a new COption_MonitorEventZ which has the same data as `orig`
17025 * but with all dynamically-allocated buffers duplicated in new buffers.
17027 struct LDKCOption_MonitorEventZ COption_MonitorEventZ_clone(const struct LDKCOption_MonitorEventZ *NONNULL_PTR orig);
17030 * Creates a new CResult_COption_MonitorEventZDecodeErrorZ in the success state.
17032 struct LDKCResult_COption_MonitorEventZDecodeErrorZ CResult_COption_MonitorEventZDecodeErrorZ_ok(struct LDKCOption_MonitorEventZ o);
17035 * Creates a new CResult_COption_MonitorEventZDecodeErrorZ in the error state.
17037 struct LDKCResult_COption_MonitorEventZDecodeErrorZ CResult_COption_MonitorEventZDecodeErrorZ_err(struct LDKDecodeError e);
17040 * Checks if the given object is currently in the success state
17042 bool CResult_COption_MonitorEventZDecodeErrorZ_is_ok(const struct LDKCResult_COption_MonitorEventZDecodeErrorZ *NONNULL_PTR o);
17045 * Frees any resources used by the CResult_COption_MonitorEventZDecodeErrorZ.
17047 void CResult_COption_MonitorEventZDecodeErrorZ_free(struct LDKCResult_COption_MonitorEventZDecodeErrorZ _res);
17050 * Creates a new CResult_COption_MonitorEventZDecodeErrorZ which has the same data as `orig`
17051 * but with all dynamically-allocated buffers duplicated in new buffers.
17053 struct LDKCResult_COption_MonitorEventZDecodeErrorZ CResult_COption_MonitorEventZDecodeErrorZ_clone(const struct LDKCResult_COption_MonitorEventZDecodeErrorZ *NONNULL_PTR orig);
17056 * Creates a new CResult_HTLCUpdateDecodeErrorZ in the success state.
17058 struct LDKCResult_HTLCUpdateDecodeErrorZ CResult_HTLCUpdateDecodeErrorZ_ok(struct LDKHTLCUpdate o);
17061 * Creates a new CResult_HTLCUpdateDecodeErrorZ in the error state.
17063 struct LDKCResult_HTLCUpdateDecodeErrorZ CResult_HTLCUpdateDecodeErrorZ_err(struct LDKDecodeError e);
17066 * Checks if the given object is currently in the success state
17068 bool CResult_HTLCUpdateDecodeErrorZ_is_ok(const struct LDKCResult_HTLCUpdateDecodeErrorZ *NONNULL_PTR o);
17071 * Frees any resources used by the CResult_HTLCUpdateDecodeErrorZ.
17073 void CResult_HTLCUpdateDecodeErrorZ_free(struct LDKCResult_HTLCUpdateDecodeErrorZ _res);
17076 * Creates a new CResult_HTLCUpdateDecodeErrorZ which has the same data as `orig`
17077 * but with all dynamically-allocated buffers duplicated in new buffers.
17079 struct LDKCResult_HTLCUpdateDecodeErrorZ CResult_HTLCUpdateDecodeErrorZ_clone(const struct LDKCResult_HTLCUpdateDecodeErrorZ *NONNULL_PTR orig);
17082 * Creates a new tuple which has the same data as `orig`
17083 * but with all dynamically-allocated buffers duplicated in new buffers.
17085 struct LDKC2Tuple_OutPointScriptZ C2Tuple_OutPointScriptZ_clone(const struct LDKC2Tuple_OutPointScriptZ *NONNULL_PTR orig);
17088 * Creates a new C2Tuple_OutPointScriptZ from the contained elements.
17090 struct LDKC2Tuple_OutPointScriptZ C2Tuple_OutPointScriptZ_new(struct LDKOutPoint a, struct LDKCVec_u8Z b);
17093 * Frees any resources used by the C2Tuple_OutPointScriptZ.
17095 void C2Tuple_OutPointScriptZ_free(struct LDKC2Tuple_OutPointScriptZ _res);
17098 * Creates a new tuple which has the same data as `orig`
17099 * but with all dynamically-allocated buffers duplicated in new buffers.
17101 struct LDKC2Tuple_u32ScriptZ C2Tuple_u32ScriptZ_clone(const struct LDKC2Tuple_u32ScriptZ *NONNULL_PTR orig);
17104 * Creates a new C2Tuple_u32ScriptZ from the contained elements.
17106 struct LDKC2Tuple_u32ScriptZ C2Tuple_u32ScriptZ_new(uint32_t a, struct LDKCVec_u8Z b);
17109 * Frees any resources used by the C2Tuple_u32ScriptZ.
17111 void C2Tuple_u32ScriptZ_free(struct LDKC2Tuple_u32ScriptZ _res);
17114 * Frees the buffer pointed to by `data` if `datalen` is non-0.
17116 void CVec_C2Tuple_u32ScriptZZ_free(struct LDKCVec_C2Tuple_u32ScriptZZ _res);
17119 * Creates a new tuple which has the same data as `orig`
17120 * but with all dynamically-allocated buffers duplicated in new buffers.
17122 struct LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_clone(const struct LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ *NONNULL_PTR orig);
17125 * Creates a new C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ from the contained elements.
17127 struct LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_new(struct LDKThirtyTwoBytes a, struct LDKCVec_C2Tuple_u32ScriptZZ b);
17130 * Frees any resources used by the C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ.
17132 void C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_free(struct LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ _res);
17135 * Frees the buffer pointed to by `data` if `datalen` is non-0.
17137 void CVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ_free(struct LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ _res);
17140 * Frees the buffer pointed to by `data` if `datalen` is non-0.
17142 void CVec_EventZ_free(struct LDKCVec_EventZ _res);
17145 * Frees the buffer pointed to by `data` if `datalen` is non-0.
17147 void CVec_TransactionZ_free(struct LDKCVec_TransactionZ _res);
17150 * Creates a new tuple which has the same data as `orig`
17151 * but with all dynamically-allocated buffers duplicated in new buffers.
17153 struct LDKC2Tuple_u32TxOutZ C2Tuple_u32TxOutZ_clone(const struct LDKC2Tuple_u32TxOutZ *NONNULL_PTR orig);
17156 * Creates a new C2Tuple_u32TxOutZ from the contained elements.
17158 struct LDKC2Tuple_u32TxOutZ C2Tuple_u32TxOutZ_new(uint32_t a, struct LDKTxOut b);
17161 * Frees any resources used by the C2Tuple_u32TxOutZ.
17163 void C2Tuple_u32TxOutZ_free(struct LDKC2Tuple_u32TxOutZ _res);
17166 * Frees the buffer pointed to by `data` if `datalen` is non-0.
17168 void CVec_C2Tuple_u32TxOutZZ_free(struct LDKCVec_C2Tuple_u32TxOutZZ _res);
17171 * Creates a new tuple which has the same data as `orig`
17172 * but with all dynamically-allocated buffers duplicated in new buffers.
17174 struct LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_clone(const struct LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ *NONNULL_PTR orig);
17177 * Creates a new C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ from the contained elements.
17179 struct LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_new(struct LDKThirtyTwoBytes a, struct LDKCVec_C2Tuple_u32TxOutZZ b);
17182 * Frees any resources used by the C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ.
17184 void C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_free(struct LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ _res);
17187 * Frees the buffer pointed to by `data` if `datalen` is non-0.
17189 void CVec_TransactionOutputsZ_free(struct LDKCVec_TransactionOutputsZ _res);
17192 * Frees the buffer pointed to by `data` if `datalen` is non-0.
17194 void CVec_BalanceZ_free(struct LDKCVec_BalanceZ _res);
17197 * Creates a new CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ in the success state.
17199 struct LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_ok(struct LDKC2Tuple_BlockHashChannelMonitorZ o);
17202 * Creates a new CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ in the error state.
17204 struct LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_err(struct LDKDecodeError e);
17207 * Checks if the given object is currently in the success state
17209 bool CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_is_ok(const struct LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ *NONNULL_PTR o);
17212 * Frees any resources used by the CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ.
17214 void CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_free(struct LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ _res);
17217 * Creates a new C2Tuple_PublicKeyTypeZ from the contained elements.
17219 struct LDKC2Tuple_PublicKeyTypeZ C2Tuple_PublicKeyTypeZ_new(struct LDKPublicKey a, struct LDKType b);
17222 * Frees any resources used by the C2Tuple_PublicKeyTypeZ.
17224 void C2Tuple_PublicKeyTypeZ_free(struct LDKC2Tuple_PublicKeyTypeZ _res);
17227 * Frees the buffer pointed to by `data` if `datalen` is non-0.
17229 void CVec_C2Tuple_PublicKeyTypeZZ_free(struct LDKCVec_C2Tuple_PublicKeyTypeZZ _res);
17232 * Constructs a new COption_NetAddressZ containing a crate::lightning::ln::msgs::NetAddress
17234 struct LDKCOption_NetAddressZ COption_NetAddressZ_some(struct LDKNetAddress o);
17237 * Constructs a new COption_NetAddressZ containing nothing
17239 struct LDKCOption_NetAddressZ COption_NetAddressZ_none(void);
17242 * Frees any resources associated with the crate::lightning::ln::msgs::NetAddress, if we are in the Some state
17244 void COption_NetAddressZ_free(struct LDKCOption_NetAddressZ _res);
17247 * Creates a new COption_NetAddressZ which has the same data as `orig`
17248 * but with all dynamically-allocated buffers duplicated in new buffers.
17250 struct LDKCOption_NetAddressZ COption_NetAddressZ_clone(const struct LDKCOption_NetAddressZ *NONNULL_PTR orig);
17253 * Creates a new CResult_CVec_u8ZPeerHandleErrorZ in the success state.
17255 struct LDKCResult_CVec_u8ZPeerHandleErrorZ CResult_CVec_u8ZPeerHandleErrorZ_ok(struct LDKCVec_u8Z o);
17258 * Creates a new CResult_CVec_u8ZPeerHandleErrorZ in the error state.
17260 struct LDKCResult_CVec_u8ZPeerHandleErrorZ CResult_CVec_u8ZPeerHandleErrorZ_err(struct LDKPeerHandleError e);
17263 * Checks if the given object is currently in the success state
17265 bool CResult_CVec_u8ZPeerHandleErrorZ_is_ok(const struct LDKCResult_CVec_u8ZPeerHandleErrorZ *NONNULL_PTR o);
17268 * Frees any resources used by the CResult_CVec_u8ZPeerHandleErrorZ.
17270 void CResult_CVec_u8ZPeerHandleErrorZ_free(struct LDKCResult_CVec_u8ZPeerHandleErrorZ _res);
17273 * Creates a new CResult_CVec_u8ZPeerHandleErrorZ which has the same data as `orig`
17274 * but with all dynamically-allocated buffers duplicated in new buffers.
17276 struct LDKCResult_CVec_u8ZPeerHandleErrorZ CResult_CVec_u8ZPeerHandleErrorZ_clone(const struct LDKCResult_CVec_u8ZPeerHandleErrorZ *NONNULL_PTR orig);
17279 * Creates a new CResult_NonePeerHandleErrorZ in the success state.
17281 struct LDKCResult_NonePeerHandleErrorZ CResult_NonePeerHandleErrorZ_ok(void);
17284 * Creates a new CResult_NonePeerHandleErrorZ in the error state.
17286 struct LDKCResult_NonePeerHandleErrorZ CResult_NonePeerHandleErrorZ_err(struct LDKPeerHandleError e);
17289 * Checks if the given object is currently in the success state
17291 bool CResult_NonePeerHandleErrorZ_is_ok(const struct LDKCResult_NonePeerHandleErrorZ *NONNULL_PTR o);
17294 * Frees any resources used by the CResult_NonePeerHandleErrorZ.
17296 void CResult_NonePeerHandleErrorZ_free(struct LDKCResult_NonePeerHandleErrorZ _res);
17299 * Creates a new CResult_NonePeerHandleErrorZ which has the same data as `orig`
17300 * but with all dynamically-allocated buffers duplicated in new buffers.
17302 struct LDKCResult_NonePeerHandleErrorZ CResult_NonePeerHandleErrorZ_clone(const struct LDKCResult_NonePeerHandleErrorZ *NONNULL_PTR orig);
17305 * Creates a new CResult_boolPeerHandleErrorZ in the success state.
17307 struct LDKCResult_boolPeerHandleErrorZ CResult_boolPeerHandleErrorZ_ok(bool o);
17310 * Creates a new CResult_boolPeerHandleErrorZ in the error state.
17312 struct LDKCResult_boolPeerHandleErrorZ CResult_boolPeerHandleErrorZ_err(struct LDKPeerHandleError e);
17315 * Checks if the given object is currently in the success state
17317 bool CResult_boolPeerHandleErrorZ_is_ok(const struct LDKCResult_boolPeerHandleErrorZ *NONNULL_PTR o);
17320 * Frees any resources used by the CResult_boolPeerHandleErrorZ.
17322 void CResult_boolPeerHandleErrorZ_free(struct LDKCResult_boolPeerHandleErrorZ _res);
17325 * Creates a new CResult_boolPeerHandleErrorZ which has the same data as `orig`
17326 * but with all dynamically-allocated buffers duplicated in new buffers.
17328 struct LDKCResult_boolPeerHandleErrorZ CResult_boolPeerHandleErrorZ_clone(const struct LDKCResult_boolPeerHandleErrorZ *NONNULL_PTR orig);
17331 * Creates a new CResult_NoneSendErrorZ in the success state.
17333 struct LDKCResult_NoneSendErrorZ CResult_NoneSendErrorZ_ok(void);
17336 * Creates a new CResult_NoneSendErrorZ in the error state.
17338 struct LDKCResult_NoneSendErrorZ CResult_NoneSendErrorZ_err(struct LDKSendError e);
17341 * Checks if the given object is currently in the success state
17343 bool CResult_NoneSendErrorZ_is_ok(const struct LDKCResult_NoneSendErrorZ *NONNULL_PTR o);
17346 * Frees any resources used by the CResult_NoneSendErrorZ.
17348 void CResult_NoneSendErrorZ_free(struct LDKCResult_NoneSendErrorZ _res);
17351 * Creates a new CResult_u32GraphSyncErrorZ in the success state.
17353 struct LDKCResult_u32GraphSyncErrorZ CResult_u32GraphSyncErrorZ_ok(uint32_t o);
17356 * Creates a new CResult_u32GraphSyncErrorZ in the error state.
17358 struct LDKCResult_u32GraphSyncErrorZ CResult_u32GraphSyncErrorZ_err(struct LDKGraphSyncError e);
17361 * Checks if the given object is currently in the success state
17363 bool CResult_u32GraphSyncErrorZ_is_ok(const struct LDKCResult_u32GraphSyncErrorZ *NONNULL_PTR o);
17366 * Frees any resources used by the CResult_u32GraphSyncErrorZ.
17368 void CResult_u32GraphSyncErrorZ_free(struct LDKCResult_u32GraphSyncErrorZ _res);
17371 * Creates a new CResult_NetAddressDecodeErrorZ in the success state.
17373 struct LDKCResult_NetAddressDecodeErrorZ CResult_NetAddressDecodeErrorZ_ok(struct LDKNetAddress o);
17376 * Creates a new CResult_NetAddressDecodeErrorZ in the error state.
17378 struct LDKCResult_NetAddressDecodeErrorZ CResult_NetAddressDecodeErrorZ_err(struct LDKDecodeError e);
17381 * Checks if the given object is currently in the success state
17383 bool CResult_NetAddressDecodeErrorZ_is_ok(const struct LDKCResult_NetAddressDecodeErrorZ *NONNULL_PTR o);
17386 * Frees any resources used by the CResult_NetAddressDecodeErrorZ.
17388 void CResult_NetAddressDecodeErrorZ_free(struct LDKCResult_NetAddressDecodeErrorZ _res);
17391 * Creates a new CResult_NetAddressDecodeErrorZ which has the same data as `orig`
17392 * but with all dynamically-allocated buffers duplicated in new buffers.
17394 struct LDKCResult_NetAddressDecodeErrorZ CResult_NetAddressDecodeErrorZ_clone(const struct LDKCResult_NetAddressDecodeErrorZ *NONNULL_PTR orig);
17397 * Frees the buffer pointed to by `data` if `datalen` is non-0.
17399 void CVec_UpdateAddHTLCZ_free(struct LDKCVec_UpdateAddHTLCZ _res);
17402 * Frees the buffer pointed to by `data` if `datalen` is non-0.
17404 void CVec_UpdateFulfillHTLCZ_free(struct LDKCVec_UpdateFulfillHTLCZ _res);
17407 * Frees the buffer pointed to by `data` if `datalen` is non-0.
17409 void CVec_UpdateFailHTLCZ_free(struct LDKCVec_UpdateFailHTLCZ _res);
17412 * Frees the buffer pointed to by `data` if `datalen` is non-0.
17414 void CVec_UpdateFailMalformedHTLCZ_free(struct LDKCVec_UpdateFailMalformedHTLCZ _res);
17417 * Creates a new CResult_AcceptChannelDecodeErrorZ in the success state.
17419 struct LDKCResult_AcceptChannelDecodeErrorZ CResult_AcceptChannelDecodeErrorZ_ok(struct LDKAcceptChannel o);
17422 * Creates a new CResult_AcceptChannelDecodeErrorZ in the error state.
17424 struct LDKCResult_AcceptChannelDecodeErrorZ CResult_AcceptChannelDecodeErrorZ_err(struct LDKDecodeError e);
17427 * Checks if the given object is currently in the success state
17429 bool CResult_AcceptChannelDecodeErrorZ_is_ok(const struct LDKCResult_AcceptChannelDecodeErrorZ *NONNULL_PTR o);
17432 * Frees any resources used by the CResult_AcceptChannelDecodeErrorZ.
17434 void CResult_AcceptChannelDecodeErrorZ_free(struct LDKCResult_AcceptChannelDecodeErrorZ _res);
17437 * Creates a new CResult_AcceptChannelDecodeErrorZ which has the same data as `orig`
17438 * but with all dynamically-allocated buffers duplicated in new buffers.
17440 struct LDKCResult_AcceptChannelDecodeErrorZ CResult_AcceptChannelDecodeErrorZ_clone(const struct LDKCResult_AcceptChannelDecodeErrorZ *NONNULL_PTR orig);
17443 * Creates a new CResult_AnnouncementSignaturesDecodeErrorZ in the success state.
17445 struct LDKCResult_AnnouncementSignaturesDecodeErrorZ CResult_AnnouncementSignaturesDecodeErrorZ_ok(struct LDKAnnouncementSignatures o);
17448 * Creates a new CResult_AnnouncementSignaturesDecodeErrorZ in the error state.
17450 struct LDKCResult_AnnouncementSignaturesDecodeErrorZ CResult_AnnouncementSignaturesDecodeErrorZ_err(struct LDKDecodeError e);
17453 * Checks if the given object is currently in the success state
17455 bool CResult_AnnouncementSignaturesDecodeErrorZ_is_ok(const struct LDKCResult_AnnouncementSignaturesDecodeErrorZ *NONNULL_PTR o);
17458 * Frees any resources used by the CResult_AnnouncementSignaturesDecodeErrorZ.
17460 void CResult_AnnouncementSignaturesDecodeErrorZ_free(struct LDKCResult_AnnouncementSignaturesDecodeErrorZ _res);
17463 * Creates a new CResult_AnnouncementSignaturesDecodeErrorZ which has the same data as `orig`
17464 * but with all dynamically-allocated buffers duplicated in new buffers.
17466 struct LDKCResult_AnnouncementSignaturesDecodeErrorZ CResult_AnnouncementSignaturesDecodeErrorZ_clone(const struct LDKCResult_AnnouncementSignaturesDecodeErrorZ *NONNULL_PTR orig);
17469 * Creates a new CResult_ChannelReestablishDecodeErrorZ in the success state.
17471 struct LDKCResult_ChannelReestablishDecodeErrorZ CResult_ChannelReestablishDecodeErrorZ_ok(struct LDKChannelReestablish o);
17474 * Creates a new CResult_ChannelReestablishDecodeErrorZ in the error state.
17476 struct LDKCResult_ChannelReestablishDecodeErrorZ CResult_ChannelReestablishDecodeErrorZ_err(struct LDKDecodeError e);
17479 * Checks if the given object is currently in the success state
17481 bool CResult_ChannelReestablishDecodeErrorZ_is_ok(const struct LDKCResult_ChannelReestablishDecodeErrorZ *NONNULL_PTR o);
17484 * Frees any resources used by the CResult_ChannelReestablishDecodeErrorZ.
17486 void CResult_ChannelReestablishDecodeErrorZ_free(struct LDKCResult_ChannelReestablishDecodeErrorZ _res);
17489 * Creates a new CResult_ChannelReestablishDecodeErrorZ which has the same data as `orig`
17490 * but with all dynamically-allocated buffers duplicated in new buffers.
17492 struct LDKCResult_ChannelReestablishDecodeErrorZ CResult_ChannelReestablishDecodeErrorZ_clone(const struct LDKCResult_ChannelReestablishDecodeErrorZ *NONNULL_PTR orig);
17495 * Creates a new CResult_ClosingSignedDecodeErrorZ in the success state.
17497 struct LDKCResult_ClosingSignedDecodeErrorZ CResult_ClosingSignedDecodeErrorZ_ok(struct LDKClosingSigned o);
17500 * Creates a new CResult_ClosingSignedDecodeErrorZ in the error state.
17502 struct LDKCResult_ClosingSignedDecodeErrorZ CResult_ClosingSignedDecodeErrorZ_err(struct LDKDecodeError e);
17505 * Checks if the given object is currently in the success state
17507 bool CResult_ClosingSignedDecodeErrorZ_is_ok(const struct LDKCResult_ClosingSignedDecodeErrorZ *NONNULL_PTR o);
17510 * Frees any resources used by the CResult_ClosingSignedDecodeErrorZ.
17512 void CResult_ClosingSignedDecodeErrorZ_free(struct LDKCResult_ClosingSignedDecodeErrorZ _res);
17515 * Creates a new CResult_ClosingSignedDecodeErrorZ which has the same data as `orig`
17516 * but with all dynamically-allocated buffers duplicated in new buffers.
17518 struct LDKCResult_ClosingSignedDecodeErrorZ CResult_ClosingSignedDecodeErrorZ_clone(const struct LDKCResult_ClosingSignedDecodeErrorZ *NONNULL_PTR orig);
17521 * Creates a new CResult_ClosingSignedFeeRangeDecodeErrorZ in the success state.
17523 struct LDKCResult_ClosingSignedFeeRangeDecodeErrorZ CResult_ClosingSignedFeeRangeDecodeErrorZ_ok(struct LDKClosingSignedFeeRange o);
17526 * Creates a new CResult_ClosingSignedFeeRangeDecodeErrorZ in the error state.
17528 struct LDKCResult_ClosingSignedFeeRangeDecodeErrorZ CResult_ClosingSignedFeeRangeDecodeErrorZ_err(struct LDKDecodeError e);
17531 * Checks if the given object is currently in the success state
17533 bool CResult_ClosingSignedFeeRangeDecodeErrorZ_is_ok(const struct LDKCResult_ClosingSignedFeeRangeDecodeErrorZ *NONNULL_PTR o);
17536 * Frees any resources used by the CResult_ClosingSignedFeeRangeDecodeErrorZ.
17538 void CResult_ClosingSignedFeeRangeDecodeErrorZ_free(struct LDKCResult_ClosingSignedFeeRangeDecodeErrorZ _res);
17541 * Creates a new CResult_ClosingSignedFeeRangeDecodeErrorZ which has the same data as `orig`
17542 * but with all dynamically-allocated buffers duplicated in new buffers.
17544 struct LDKCResult_ClosingSignedFeeRangeDecodeErrorZ CResult_ClosingSignedFeeRangeDecodeErrorZ_clone(const struct LDKCResult_ClosingSignedFeeRangeDecodeErrorZ *NONNULL_PTR orig);
17547 * Creates a new CResult_CommitmentSignedDecodeErrorZ in the success state.
17549 struct LDKCResult_CommitmentSignedDecodeErrorZ CResult_CommitmentSignedDecodeErrorZ_ok(struct LDKCommitmentSigned o);
17552 * Creates a new CResult_CommitmentSignedDecodeErrorZ in the error state.
17554 struct LDKCResult_CommitmentSignedDecodeErrorZ CResult_CommitmentSignedDecodeErrorZ_err(struct LDKDecodeError e);
17557 * Checks if the given object is currently in the success state
17559 bool CResult_CommitmentSignedDecodeErrorZ_is_ok(const struct LDKCResult_CommitmentSignedDecodeErrorZ *NONNULL_PTR o);
17562 * Frees any resources used by the CResult_CommitmentSignedDecodeErrorZ.
17564 void CResult_CommitmentSignedDecodeErrorZ_free(struct LDKCResult_CommitmentSignedDecodeErrorZ _res);
17567 * Creates a new CResult_CommitmentSignedDecodeErrorZ which has the same data as `orig`
17568 * but with all dynamically-allocated buffers duplicated in new buffers.
17570 struct LDKCResult_CommitmentSignedDecodeErrorZ CResult_CommitmentSignedDecodeErrorZ_clone(const struct LDKCResult_CommitmentSignedDecodeErrorZ *NONNULL_PTR orig);
17573 * Creates a new CResult_FundingCreatedDecodeErrorZ in the success state.
17575 struct LDKCResult_FundingCreatedDecodeErrorZ CResult_FundingCreatedDecodeErrorZ_ok(struct LDKFundingCreated o);
17578 * Creates a new CResult_FundingCreatedDecodeErrorZ in the error state.
17580 struct LDKCResult_FundingCreatedDecodeErrorZ CResult_FundingCreatedDecodeErrorZ_err(struct LDKDecodeError e);
17583 * Checks if the given object is currently in the success state
17585 bool CResult_FundingCreatedDecodeErrorZ_is_ok(const struct LDKCResult_FundingCreatedDecodeErrorZ *NONNULL_PTR o);
17588 * Frees any resources used by the CResult_FundingCreatedDecodeErrorZ.
17590 void CResult_FundingCreatedDecodeErrorZ_free(struct LDKCResult_FundingCreatedDecodeErrorZ _res);
17593 * Creates a new CResult_FundingCreatedDecodeErrorZ which has the same data as `orig`
17594 * but with all dynamically-allocated buffers duplicated in new buffers.
17596 struct LDKCResult_FundingCreatedDecodeErrorZ CResult_FundingCreatedDecodeErrorZ_clone(const struct LDKCResult_FundingCreatedDecodeErrorZ *NONNULL_PTR orig);
17599 * Creates a new CResult_FundingSignedDecodeErrorZ in the success state.
17601 struct LDKCResult_FundingSignedDecodeErrorZ CResult_FundingSignedDecodeErrorZ_ok(struct LDKFundingSigned o);
17604 * Creates a new CResult_FundingSignedDecodeErrorZ in the error state.
17606 struct LDKCResult_FundingSignedDecodeErrorZ CResult_FundingSignedDecodeErrorZ_err(struct LDKDecodeError e);
17609 * Checks if the given object is currently in the success state
17611 bool CResult_FundingSignedDecodeErrorZ_is_ok(const struct LDKCResult_FundingSignedDecodeErrorZ *NONNULL_PTR o);
17614 * Frees any resources used by the CResult_FundingSignedDecodeErrorZ.
17616 void CResult_FundingSignedDecodeErrorZ_free(struct LDKCResult_FundingSignedDecodeErrorZ _res);
17619 * Creates a new CResult_FundingSignedDecodeErrorZ which has the same data as `orig`
17620 * but with all dynamically-allocated buffers duplicated in new buffers.
17622 struct LDKCResult_FundingSignedDecodeErrorZ CResult_FundingSignedDecodeErrorZ_clone(const struct LDKCResult_FundingSignedDecodeErrorZ *NONNULL_PTR orig);
17625 * Creates a new CResult_ChannelReadyDecodeErrorZ in the success state.
17627 struct LDKCResult_ChannelReadyDecodeErrorZ CResult_ChannelReadyDecodeErrorZ_ok(struct LDKChannelReady o);
17630 * Creates a new CResult_ChannelReadyDecodeErrorZ in the error state.
17632 struct LDKCResult_ChannelReadyDecodeErrorZ CResult_ChannelReadyDecodeErrorZ_err(struct LDKDecodeError e);
17635 * Checks if the given object is currently in the success state
17637 bool CResult_ChannelReadyDecodeErrorZ_is_ok(const struct LDKCResult_ChannelReadyDecodeErrorZ *NONNULL_PTR o);
17640 * Frees any resources used by the CResult_ChannelReadyDecodeErrorZ.
17642 void CResult_ChannelReadyDecodeErrorZ_free(struct LDKCResult_ChannelReadyDecodeErrorZ _res);
17645 * Creates a new CResult_ChannelReadyDecodeErrorZ which has the same data as `orig`
17646 * but with all dynamically-allocated buffers duplicated in new buffers.
17648 struct LDKCResult_ChannelReadyDecodeErrorZ CResult_ChannelReadyDecodeErrorZ_clone(const struct LDKCResult_ChannelReadyDecodeErrorZ *NONNULL_PTR orig);
17651 * Creates a new CResult_InitDecodeErrorZ in the success state.
17653 struct LDKCResult_InitDecodeErrorZ CResult_InitDecodeErrorZ_ok(struct LDKInit o);
17656 * Creates a new CResult_InitDecodeErrorZ in the error state.
17658 struct LDKCResult_InitDecodeErrorZ CResult_InitDecodeErrorZ_err(struct LDKDecodeError e);
17661 * Checks if the given object is currently in the success state
17663 bool CResult_InitDecodeErrorZ_is_ok(const struct LDKCResult_InitDecodeErrorZ *NONNULL_PTR o);
17666 * Frees any resources used by the CResult_InitDecodeErrorZ.
17668 void CResult_InitDecodeErrorZ_free(struct LDKCResult_InitDecodeErrorZ _res);
17671 * Creates a new CResult_InitDecodeErrorZ which has the same data as `orig`
17672 * but with all dynamically-allocated buffers duplicated in new buffers.
17674 struct LDKCResult_InitDecodeErrorZ CResult_InitDecodeErrorZ_clone(const struct LDKCResult_InitDecodeErrorZ *NONNULL_PTR orig);
17677 * Creates a new CResult_OpenChannelDecodeErrorZ in the success state.
17679 struct LDKCResult_OpenChannelDecodeErrorZ CResult_OpenChannelDecodeErrorZ_ok(struct LDKOpenChannel o);
17682 * Creates a new CResult_OpenChannelDecodeErrorZ in the error state.
17684 struct LDKCResult_OpenChannelDecodeErrorZ CResult_OpenChannelDecodeErrorZ_err(struct LDKDecodeError e);
17687 * Checks if the given object is currently in the success state
17689 bool CResult_OpenChannelDecodeErrorZ_is_ok(const struct LDKCResult_OpenChannelDecodeErrorZ *NONNULL_PTR o);
17692 * Frees any resources used by the CResult_OpenChannelDecodeErrorZ.
17694 void CResult_OpenChannelDecodeErrorZ_free(struct LDKCResult_OpenChannelDecodeErrorZ _res);
17697 * Creates a new CResult_OpenChannelDecodeErrorZ which has the same data as `orig`
17698 * but with all dynamically-allocated buffers duplicated in new buffers.
17700 struct LDKCResult_OpenChannelDecodeErrorZ CResult_OpenChannelDecodeErrorZ_clone(const struct LDKCResult_OpenChannelDecodeErrorZ *NONNULL_PTR orig);
17703 * Creates a new CResult_RevokeAndACKDecodeErrorZ in the success state.
17705 struct LDKCResult_RevokeAndACKDecodeErrorZ CResult_RevokeAndACKDecodeErrorZ_ok(struct LDKRevokeAndACK o);
17708 * Creates a new CResult_RevokeAndACKDecodeErrorZ in the error state.
17710 struct LDKCResult_RevokeAndACKDecodeErrorZ CResult_RevokeAndACKDecodeErrorZ_err(struct LDKDecodeError e);
17713 * Checks if the given object is currently in the success state
17715 bool CResult_RevokeAndACKDecodeErrorZ_is_ok(const struct LDKCResult_RevokeAndACKDecodeErrorZ *NONNULL_PTR o);
17718 * Frees any resources used by the CResult_RevokeAndACKDecodeErrorZ.
17720 void CResult_RevokeAndACKDecodeErrorZ_free(struct LDKCResult_RevokeAndACKDecodeErrorZ _res);
17723 * Creates a new CResult_RevokeAndACKDecodeErrorZ which has the same data as `orig`
17724 * but with all dynamically-allocated buffers duplicated in new buffers.
17726 struct LDKCResult_RevokeAndACKDecodeErrorZ CResult_RevokeAndACKDecodeErrorZ_clone(const struct LDKCResult_RevokeAndACKDecodeErrorZ *NONNULL_PTR orig);
17729 * Creates a new CResult_ShutdownDecodeErrorZ in the success state.
17731 struct LDKCResult_ShutdownDecodeErrorZ CResult_ShutdownDecodeErrorZ_ok(struct LDKShutdown o);
17734 * Creates a new CResult_ShutdownDecodeErrorZ in the error state.
17736 struct LDKCResult_ShutdownDecodeErrorZ CResult_ShutdownDecodeErrorZ_err(struct LDKDecodeError e);
17739 * Checks if the given object is currently in the success state
17741 bool CResult_ShutdownDecodeErrorZ_is_ok(const struct LDKCResult_ShutdownDecodeErrorZ *NONNULL_PTR o);
17744 * Frees any resources used by the CResult_ShutdownDecodeErrorZ.
17746 void CResult_ShutdownDecodeErrorZ_free(struct LDKCResult_ShutdownDecodeErrorZ _res);
17749 * Creates a new CResult_ShutdownDecodeErrorZ which has the same data as `orig`
17750 * but with all dynamically-allocated buffers duplicated in new buffers.
17752 struct LDKCResult_ShutdownDecodeErrorZ CResult_ShutdownDecodeErrorZ_clone(const struct LDKCResult_ShutdownDecodeErrorZ *NONNULL_PTR orig);
17755 * Creates a new CResult_UpdateFailHTLCDecodeErrorZ in the success state.
17757 struct LDKCResult_UpdateFailHTLCDecodeErrorZ CResult_UpdateFailHTLCDecodeErrorZ_ok(struct LDKUpdateFailHTLC o);
17760 * Creates a new CResult_UpdateFailHTLCDecodeErrorZ in the error state.
17762 struct LDKCResult_UpdateFailHTLCDecodeErrorZ CResult_UpdateFailHTLCDecodeErrorZ_err(struct LDKDecodeError e);
17765 * Checks if the given object is currently in the success state
17767 bool CResult_UpdateFailHTLCDecodeErrorZ_is_ok(const struct LDKCResult_UpdateFailHTLCDecodeErrorZ *NONNULL_PTR o);
17770 * Frees any resources used by the CResult_UpdateFailHTLCDecodeErrorZ.
17772 void CResult_UpdateFailHTLCDecodeErrorZ_free(struct LDKCResult_UpdateFailHTLCDecodeErrorZ _res);
17775 * Creates a new CResult_UpdateFailHTLCDecodeErrorZ which has the same data as `orig`
17776 * but with all dynamically-allocated buffers duplicated in new buffers.
17778 struct LDKCResult_UpdateFailHTLCDecodeErrorZ CResult_UpdateFailHTLCDecodeErrorZ_clone(const struct LDKCResult_UpdateFailHTLCDecodeErrorZ *NONNULL_PTR orig);
17781 * Creates a new CResult_UpdateFailMalformedHTLCDecodeErrorZ in the success state.
17783 struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ CResult_UpdateFailMalformedHTLCDecodeErrorZ_ok(struct LDKUpdateFailMalformedHTLC o);
17786 * Creates a new CResult_UpdateFailMalformedHTLCDecodeErrorZ in the error state.
17788 struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ CResult_UpdateFailMalformedHTLCDecodeErrorZ_err(struct LDKDecodeError e);
17791 * Checks if the given object is currently in the success state
17793 bool CResult_UpdateFailMalformedHTLCDecodeErrorZ_is_ok(const struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ *NONNULL_PTR o);
17796 * Frees any resources used by the CResult_UpdateFailMalformedHTLCDecodeErrorZ.
17798 void CResult_UpdateFailMalformedHTLCDecodeErrorZ_free(struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ _res);
17801 * Creates a new CResult_UpdateFailMalformedHTLCDecodeErrorZ which has the same data as `orig`
17802 * but with all dynamically-allocated buffers duplicated in new buffers.
17804 struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ CResult_UpdateFailMalformedHTLCDecodeErrorZ_clone(const struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ *NONNULL_PTR orig);
17807 * Creates a new CResult_UpdateFeeDecodeErrorZ in the success state.
17809 struct LDKCResult_UpdateFeeDecodeErrorZ CResult_UpdateFeeDecodeErrorZ_ok(struct LDKUpdateFee o);
17812 * Creates a new CResult_UpdateFeeDecodeErrorZ in the error state.
17814 struct LDKCResult_UpdateFeeDecodeErrorZ CResult_UpdateFeeDecodeErrorZ_err(struct LDKDecodeError e);
17817 * Checks if the given object is currently in the success state
17819 bool CResult_UpdateFeeDecodeErrorZ_is_ok(const struct LDKCResult_UpdateFeeDecodeErrorZ *NONNULL_PTR o);
17822 * Frees any resources used by the CResult_UpdateFeeDecodeErrorZ.
17824 void CResult_UpdateFeeDecodeErrorZ_free(struct LDKCResult_UpdateFeeDecodeErrorZ _res);
17827 * Creates a new CResult_UpdateFeeDecodeErrorZ which has the same data as `orig`
17828 * but with all dynamically-allocated buffers duplicated in new buffers.
17830 struct LDKCResult_UpdateFeeDecodeErrorZ CResult_UpdateFeeDecodeErrorZ_clone(const struct LDKCResult_UpdateFeeDecodeErrorZ *NONNULL_PTR orig);
17833 * Creates a new CResult_UpdateFulfillHTLCDecodeErrorZ in the success state.
17835 struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ CResult_UpdateFulfillHTLCDecodeErrorZ_ok(struct LDKUpdateFulfillHTLC o);
17838 * Creates a new CResult_UpdateFulfillHTLCDecodeErrorZ in the error state.
17840 struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ CResult_UpdateFulfillHTLCDecodeErrorZ_err(struct LDKDecodeError e);
17843 * Checks if the given object is currently in the success state
17845 bool CResult_UpdateFulfillHTLCDecodeErrorZ_is_ok(const struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ *NONNULL_PTR o);
17848 * Frees any resources used by the CResult_UpdateFulfillHTLCDecodeErrorZ.
17850 void CResult_UpdateFulfillHTLCDecodeErrorZ_free(struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ _res);
17853 * Creates a new CResult_UpdateFulfillHTLCDecodeErrorZ which has the same data as `orig`
17854 * but with all dynamically-allocated buffers duplicated in new buffers.
17856 struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ CResult_UpdateFulfillHTLCDecodeErrorZ_clone(const struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ *NONNULL_PTR orig);
17859 * Creates a new CResult_UpdateAddHTLCDecodeErrorZ in the success state.
17861 struct LDKCResult_UpdateAddHTLCDecodeErrorZ CResult_UpdateAddHTLCDecodeErrorZ_ok(struct LDKUpdateAddHTLC o);
17864 * Creates a new CResult_UpdateAddHTLCDecodeErrorZ in the error state.
17866 struct LDKCResult_UpdateAddHTLCDecodeErrorZ CResult_UpdateAddHTLCDecodeErrorZ_err(struct LDKDecodeError e);
17869 * Checks if the given object is currently in the success state
17871 bool CResult_UpdateAddHTLCDecodeErrorZ_is_ok(const struct LDKCResult_UpdateAddHTLCDecodeErrorZ *NONNULL_PTR o);
17874 * Frees any resources used by the CResult_UpdateAddHTLCDecodeErrorZ.
17876 void CResult_UpdateAddHTLCDecodeErrorZ_free(struct LDKCResult_UpdateAddHTLCDecodeErrorZ _res);
17879 * Creates a new CResult_UpdateAddHTLCDecodeErrorZ which has the same data as `orig`
17880 * but with all dynamically-allocated buffers duplicated in new buffers.
17882 struct LDKCResult_UpdateAddHTLCDecodeErrorZ CResult_UpdateAddHTLCDecodeErrorZ_clone(const struct LDKCResult_UpdateAddHTLCDecodeErrorZ *NONNULL_PTR orig);
17885 * Creates a new CResult_OnionMessageDecodeErrorZ in the success state.
17887 struct LDKCResult_OnionMessageDecodeErrorZ CResult_OnionMessageDecodeErrorZ_ok(struct LDKOnionMessage o);
17890 * Creates a new CResult_OnionMessageDecodeErrorZ in the error state.
17892 struct LDKCResult_OnionMessageDecodeErrorZ CResult_OnionMessageDecodeErrorZ_err(struct LDKDecodeError e);
17895 * Checks if the given object is currently in the success state
17897 bool CResult_OnionMessageDecodeErrorZ_is_ok(const struct LDKCResult_OnionMessageDecodeErrorZ *NONNULL_PTR o);
17900 * Frees any resources used by the CResult_OnionMessageDecodeErrorZ.
17902 void CResult_OnionMessageDecodeErrorZ_free(struct LDKCResult_OnionMessageDecodeErrorZ _res);
17905 * Creates a new CResult_OnionMessageDecodeErrorZ which has the same data as `orig`
17906 * but with all dynamically-allocated buffers duplicated in new buffers.
17908 struct LDKCResult_OnionMessageDecodeErrorZ CResult_OnionMessageDecodeErrorZ_clone(const struct LDKCResult_OnionMessageDecodeErrorZ *NONNULL_PTR orig);
17911 * Creates a new CResult_PingDecodeErrorZ in the success state.
17913 struct LDKCResult_PingDecodeErrorZ CResult_PingDecodeErrorZ_ok(struct LDKPing o);
17916 * Creates a new CResult_PingDecodeErrorZ in the error state.
17918 struct LDKCResult_PingDecodeErrorZ CResult_PingDecodeErrorZ_err(struct LDKDecodeError e);
17921 * Checks if the given object is currently in the success state
17923 bool CResult_PingDecodeErrorZ_is_ok(const struct LDKCResult_PingDecodeErrorZ *NONNULL_PTR o);
17926 * Frees any resources used by the CResult_PingDecodeErrorZ.
17928 void CResult_PingDecodeErrorZ_free(struct LDKCResult_PingDecodeErrorZ _res);
17931 * Creates a new CResult_PingDecodeErrorZ which has the same data as `orig`
17932 * but with all dynamically-allocated buffers duplicated in new buffers.
17934 struct LDKCResult_PingDecodeErrorZ CResult_PingDecodeErrorZ_clone(const struct LDKCResult_PingDecodeErrorZ *NONNULL_PTR orig);
17937 * Creates a new CResult_PongDecodeErrorZ in the success state.
17939 struct LDKCResult_PongDecodeErrorZ CResult_PongDecodeErrorZ_ok(struct LDKPong o);
17942 * Creates a new CResult_PongDecodeErrorZ in the error state.
17944 struct LDKCResult_PongDecodeErrorZ CResult_PongDecodeErrorZ_err(struct LDKDecodeError e);
17947 * Checks if the given object is currently in the success state
17949 bool CResult_PongDecodeErrorZ_is_ok(const struct LDKCResult_PongDecodeErrorZ *NONNULL_PTR o);
17952 * Frees any resources used by the CResult_PongDecodeErrorZ.
17954 void CResult_PongDecodeErrorZ_free(struct LDKCResult_PongDecodeErrorZ _res);
17957 * Creates a new CResult_PongDecodeErrorZ which has the same data as `orig`
17958 * but with all dynamically-allocated buffers duplicated in new buffers.
17960 struct LDKCResult_PongDecodeErrorZ CResult_PongDecodeErrorZ_clone(const struct LDKCResult_PongDecodeErrorZ *NONNULL_PTR orig);
17963 * Creates a new CResult_UnsignedChannelAnnouncementDecodeErrorZ in the success state.
17965 struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ CResult_UnsignedChannelAnnouncementDecodeErrorZ_ok(struct LDKUnsignedChannelAnnouncement o);
17968 * Creates a new CResult_UnsignedChannelAnnouncementDecodeErrorZ in the error state.
17970 struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ CResult_UnsignedChannelAnnouncementDecodeErrorZ_err(struct LDKDecodeError e);
17973 * Checks if the given object is currently in the success state
17975 bool CResult_UnsignedChannelAnnouncementDecodeErrorZ_is_ok(const struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ *NONNULL_PTR o);
17978 * Frees any resources used by the CResult_UnsignedChannelAnnouncementDecodeErrorZ.
17980 void CResult_UnsignedChannelAnnouncementDecodeErrorZ_free(struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ _res);
17983 * Creates a new CResult_UnsignedChannelAnnouncementDecodeErrorZ which has the same data as `orig`
17984 * but with all dynamically-allocated buffers duplicated in new buffers.
17986 struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ CResult_UnsignedChannelAnnouncementDecodeErrorZ_clone(const struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ *NONNULL_PTR orig);
17989 * Creates a new CResult_ChannelAnnouncementDecodeErrorZ in the success state.
17991 struct LDKCResult_ChannelAnnouncementDecodeErrorZ CResult_ChannelAnnouncementDecodeErrorZ_ok(struct LDKChannelAnnouncement o);
17994 * Creates a new CResult_ChannelAnnouncementDecodeErrorZ in the error state.
17996 struct LDKCResult_ChannelAnnouncementDecodeErrorZ CResult_ChannelAnnouncementDecodeErrorZ_err(struct LDKDecodeError e);
17999 * Checks if the given object is currently in the success state
18001 bool CResult_ChannelAnnouncementDecodeErrorZ_is_ok(const struct LDKCResult_ChannelAnnouncementDecodeErrorZ *NONNULL_PTR o);
18004 * Frees any resources used by the CResult_ChannelAnnouncementDecodeErrorZ.
18006 void CResult_ChannelAnnouncementDecodeErrorZ_free(struct LDKCResult_ChannelAnnouncementDecodeErrorZ _res);
18009 * Creates a new CResult_ChannelAnnouncementDecodeErrorZ which has the same data as `orig`
18010 * but with all dynamically-allocated buffers duplicated in new buffers.
18012 struct LDKCResult_ChannelAnnouncementDecodeErrorZ CResult_ChannelAnnouncementDecodeErrorZ_clone(const struct LDKCResult_ChannelAnnouncementDecodeErrorZ *NONNULL_PTR orig);
18015 * Creates a new CResult_UnsignedChannelUpdateDecodeErrorZ in the success state.
18017 struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ CResult_UnsignedChannelUpdateDecodeErrorZ_ok(struct LDKUnsignedChannelUpdate o);
18020 * Creates a new CResult_UnsignedChannelUpdateDecodeErrorZ in the error state.
18022 struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ CResult_UnsignedChannelUpdateDecodeErrorZ_err(struct LDKDecodeError e);
18025 * Checks if the given object is currently in the success state
18027 bool CResult_UnsignedChannelUpdateDecodeErrorZ_is_ok(const struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ *NONNULL_PTR o);
18030 * Frees any resources used by the CResult_UnsignedChannelUpdateDecodeErrorZ.
18032 void CResult_UnsignedChannelUpdateDecodeErrorZ_free(struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ _res);
18035 * Creates a new CResult_UnsignedChannelUpdateDecodeErrorZ which has the same data as `orig`
18036 * but with all dynamically-allocated buffers duplicated in new buffers.
18038 struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ CResult_UnsignedChannelUpdateDecodeErrorZ_clone(const struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ *NONNULL_PTR orig);
18041 * Creates a new CResult_ChannelUpdateDecodeErrorZ in the success state.
18043 struct LDKCResult_ChannelUpdateDecodeErrorZ CResult_ChannelUpdateDecodeErrorZ_ok(struct LDKChannelUpdate o);
18046 * Creates a new CResult_ChannelUpdateDecodeErrorZ in the error state.
18048 struct LDKCResult_ChannelUpdateDecodeErrorZ CResult_ChannelUpdateDecodeErrorZ_err(struct LDKDecodeError e);
18051 * Checks if the given object is currently in the success state
18053 bool CResult_ChannelUpdateDecodeErrorZ_is_ok(const struct LDKCResult_ChannelUpdateDecodeErrorZ *NONNULL_PTR o);
18056 * Frees any resources used by the CResult_ChannelUpdateDecodeErrorZ.
18058 void CResult_ChannelUpdateDecodeErrorZ_free(struct LDKCResult_ChannelUpdateDecodeErrorZ _res);
18061 * Creates a new CResult_ChannelUpdateDecodeErrorZ which has the same data as `orig`
18062 * but with all dynamically-allocated buffers duplicated in new buffers.
18064 struct LDKCResult_ChannelUpdateDecodeErrorZ CResult_ChannelUpdateDecodeErrorZ_clone(const struct LDKCResult_ChannelUpdateDecodeErrorZ *NONNULL_PTR orig);
18067 * Creates a new CResult_ErrorMessageDecodeErrorZ in the success state.
18069 struct LDKCResult_ErrorMessageDecodeErrorZ CResult_ErrorMessageDecodeErrorZ_ok(struct LDKErrorMessage o);
18072 * Creates a new CResult_ErrorMessageDecodeErrorZ in the error state.
18074 struct LDKCResult_ErrorMessageDecodeErrorZ CResult_ErrorMessageDecodeErrorZ_err(struct LDKDecodeError e);
18077 * Checks if the given object is currently in the success state
18079 bool CResult_ErrorMessageDecodeErrorZ_is_ok(const struct LDKCResult_ErrorMessageDecodeErrorZ *NONNULL_PTR o);
18082 * Frees any resources used by the CResult_ErrorMessageDecodeErrorZ.
18084 void CResult_ErrorMessageDecodeErrorZ_free(struct LDKCResult_ErrorMessageDecodeErrorZ _res);
18087 * Creates a new CResult_ErrorMessageDecodeErrorZ which has the same data as `orig`
18088 * but with all dynamically-allocated buffers duplicated in new buffers.
18090 struct LDKCResult_ErrorMessageDecodeErrorZ CResult_ErrorMessageDecodeErrorZ_clone(const struct LDKCResult_ErrorMessageDecodeErrorZ *NONNULL_PTR orig);
18093 * Creates a new CResult_WarningMessageDecodeErrorZ in the success state.
18095 struct LDKCResult_WarningMessageDecodeErrorZ CResult_WarningMessageDecodeErrorZ_ok(struct LDKWarningMessage o);
18098 * Creates a new CResult_WarningMessageDecodeErrorZ in the error state.
18100 struct LDKCResult_WarningMessageDecodeErrorZ CResult_WarningMessageDecodeErrorZ_err(struct LDKDecodeError e);
18103 * Checks if the given object is currently in the success state
18105 bool CResult_WarningMessageDecodeErrorZ_is_ok(const struct LDKCResult_WarningMessageDecodeErrorZ *NONNULL_PTR o);
18108 * Frees any resources used by the CResult_WarningMessageDecodeErrorZ.
18110 void CResult_WarningMessageDecodeErrorZ_free(struct LDKCResult_WarningMessageDecodeErrorZ _res);
18113 * Creates a new CResult_WarningMessageDecodeErrorZ which has the same data as `orig`
18114 * but with all dynamically-allocated buffers duplicated in new buffers.
18116 struct LDKCResult_WarningMessageDecodeErrorZ CResult_WarningMessageDecodeErrorZ_clone(const struct LDKCResult_WarningMessageDecodeErrorZ *NONNULL_PTR orig);
18119 * Creates a new CResult_UnsignedNodeAnnouncementDecodeErrorZ in the success state.
18121 struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ CResult_UnsignedNodeAnnouncementDecodeErrorZ_ok(struct LDKUnsignedNodeAnnouncement o);
18124 * Creates a new CResult_UnsignedNodeAnnouncementDecodeErrorZ in the error state.
18126 struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ CResult_UnsignedNodeAnnouncementDecodeErrorZ_err(struct LDKDecodeError e);
18129 * Checks if the given object is currently in the success state
18131 bool CResult_UnsignedNodeAnnouncementDecodeErrorZ_is_ok(const struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ *NONNULL_PTR o);
18134 * Frees any resources used by the CResult_UnsignedNodeAnnouncementDecodeErrorZ.
18136 void CResult_UnsignedNodeAnnouncementDecodeErrorZ_free(struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ _res);
18139 * Creates a new CResult_UnsignedNodeAnnouncementDecodeErrorZ which has the same data as `orig`
18140 * but with all dynamically-allocated buffers duplicated in new buffers.
18142 struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ CResult_UnsignedNodeAnnouncementDecodeErrorZ_clone(const struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ *NONNULL_PTR orig);
18145 * Creates a new CResult_NodeAnnouncementDecodeErrorZ in the success state.
18147 struct LDKCResult_NodeAnnouncementDecodeErrorZ CResult_NodeAnnouncementDecodeErrorZ_ok(struct LDKNodeAnnouncement o);
18150 * Creates a new CResult_NodeAnnouncementDecodeErrorZ in the error state.
18152 struct LDKCResult_NodeAnnouncementDecodeErrorZ CResult_NodeAnnouncementDecodeErrorZ_err(struct LDKDecodeError e);
18155 * Checks if the given object is currently in the success state
18157 bool CResult_NodeAnnouncementDecodeErrorZ_is_ok(const struct LDKCResult_NodeAnnouncementDecodeErrorZ *NONNULL_PTR o);
18160 * Frees any resources used by the CResult_NodeAnnouncementDecodeErrorZ.
18162 void CResult_NodeAnnouncementDecodeErrorZ_free(struct LDKCResult_NodeAnnouncementDecodeErrorZ _res);
18165 * Creates a new CResult_NodeAnnouncementDecodeErrorZ which has the same data as `orig`
18166 * but with all dynamically-allocated buffers duplicated in new buffers.
18168 struct LDKCResult_NodeAnnouncementDecodeErrorZ CResult_NodeAnnouncementDecodeErrorZ_clone(const struct LDKCResult_NodeAnnouncementDecodeErrorZ *NONNULL_PTR orig);
18171 * Creates a new CResult_QueryShortChannelIdsDecodeErrorZ in the success state.
18173 struct LDKCResult_QueryShortChannelIdsDecodeErrorZ CResult_QueryShortChannelIdsDecodeErrorZ_ok(struct LDKQueryShortChannelIds o);
18176 * Creates a new CResult_QueryShortChannelIdsDecodeErrorZ in the error state.
18178 struct LDKCResult_QueryShortChannelIdsDecodeErrorZ CResult_QueryShortChannelIdsDecodeErrorZ_err(struct LDKDecodeError e);
18181 * Checks if the given object is currently in the success state
18183 bool CResult_QueryShortChannelIdsDecodeErrorZ_is_ok(const struct LDKCResult_QueryShortChannelIdsDecodeErrorZ *NONNULL_PTR o);
18186 * Frees any resources used by the CResult_QueryShortChannelIdsDecodeErrorZ.
18188 void CResult_QueryShortChannelIdsDecodeErrorZ_free(struct LDKCResult_QueryShortChannelIdsDecodeErrorZ _res);
18191 * Creates a new CResult_QueryShortChannelIdsDecodeErrorZ which has the same data as `orig`
18192 * but with all dynamically-allocated buffers duplicated in new buffers.
18194 struct LDKCResult_QueryShortChannelIdsDecodeErrorZ CResult_QueryShortChannelIdsDecodeErrorZ_clone(const struct LDKCResult_QueryShortChannelIdsDecodeErrorZ *NONNULL_PTR orig);
18197 * Creates a new CResult_ReplyShortChannelIdsEndDecodeErrorZ in the success state.
18199 struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ CResult_ReplyShortChannelIdsEndDecodeErrorZ_ok(struct LDKReplyShortChannelIdsEnd o);
18202 * Creates a new CResult_ReplyShortChannelIdsEndDecodeErrorZ in the error state.
18204 struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ CResult_ReplyShortChannelIdsEndDecodeErrorZ_err(struct LDKDecodeError e);
18207 * Checks if the given object is currently in the success state
18209 bool CResult_ReplyShortChannelIdsEndDecodeErrorZ_is_ok(const struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ *NONNULL_PTR o);
18212 * Frees any resources used by the CResult_ReplyShortChannelIdsEndDecodeErrorZ.
18214 void CResult_ReplyShortChannelIdsEndDecodeErrorZ_free(struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ _res);
18217 * Creates a new CResult_ReplyShortChannelIdsEndDecodeErrorZ which has the same data as `orig`
18218 * but with all dynamically-allocated buffers duplicated in new buffers.
18220 struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ CResult_ReplyShortChannelIdsEndDecodeErrorZ_clone(const struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ *NONNULL_PTR orig);
18223 * Creates a new CResult_QueryChannelRangeDecodeErrorZ in the success state.
18225 struct LDKCResult_QueryChannelRangeDecodeErrorZ CResult_QueryChannelRangeDecodeErrorZ_ok(struct LDKQueryChannelRange o);
18228 * Creates a new CResult_QueryChannelRangeDecodeErrorZ in the error state.
18230 struct LDKCResult_QueryChannelRangeDecodeErrorZ CResult_QueryChannelRangeDecodeErrorZ_err(struct LDKDecodeError e);
18233 * Checks if the given object is currently in the success state
18235 bool CResult_QueryChannelRangeDecodeErrorZ_is_ok(const struct LDKCResult_QueryChannelRangeDecodeErrorZ *NONNULL_PTR o);
18238 * Frees any resources used by the CResult_QueryChannelRangeDecodeErrorZ.
18240 void CResult_QueryChannelRangeDecodeErrorZ_free(struct LDKCResult_QueryChannelRangeDecodeErrorZ _res);
18243 * Creates a new CResult_QueryChannelRangeDecodeErrorZ which has the same data as `orig`
18244 * but with all dynamically-allocated buffers duplicated in new buffers.
18246 struct LDKCResult_QueryChannelRangeDecodeErrorZ CResult_QueryChannelRangeDecodeErrorZ_clone(const struct LDKCResult_QueryChannelRangeDecodeErrorZ *NONNULL_PTR orig);
18249 * Creates a new CResult_ReplyChannelRangeDecodeErrorZ in the success state.
18251 struct LDKCResult_ReplyChannelRangeDecodeErrorZ CResult_ReplyChannelRangeDecodeErrorZ_ok(struct LDKReplyChannelRange o);
18254 * Creates a new CResult_ReplyChannelRangeDecodeErrorZ in the error state.
18256 struct LDKCResult_ReplyChannelRangeDecodeErrorZ CResult_ReplyChannelRangeDecodeErrorZ_err(struct LDKDecodeError e);
18259 * Checks if the given object is currently in the success state
18261 bool CResult_ReplyChannelRangeDecodeErrorZ_is_ok(const struct LDKCResult_ReplyChannelRangeDecodeErrorZ *NONNULL_PTR o);
18264 * Frees any resources used by the CResult_ReplyChannelRangeDecodeErrorZ.
18266 void CResult_ReplyChannelRangeDecodeErrorZ_free(struct LDKCResult_ReplyChannelRangeDecodeErrorZ _res);
18269 * Creates a new CResult_ReplyChannelRangeDecodeErrorZ which has the same data as `orig`
18270 * but with all dynamically-allocated buffers duplicated in new buffers.
18272 struct LDKCResult_ReplyChannelRangeDecodeErrorZ CResult_ReplyChannelRangeDecodeErrorZ_clone(const struct LDKCResult_ReplyChannelRangeDecodeErrorZ *NONNULL_PTR orig);
18275 * Creates a new CResult_GossipTimestampFilterDecodeErrorZ in the success state.
18277 struct LDKCResult_GossipTimestampFilterDecodeErrorZ CResult_GossipTimestampFilterDecodeErrorZ_ok(struct LDKGossipTimestampFilter o);
18280 * Creates a new CResult_GossipTimestampFilterDecodeErrorZ in the error state.
18282 struct LDKCResult_GossipTimestampFilterDecodeErrorZ CResult_GossipTimestampFilterDecodeErrorZ_err(struct LDKDecodeError e);
18285 * Checks if the given object is currently in the success state
18287 bool CResult_GossipTimestampFilterDecodeErrorZ_is_ok(const struct LDKCResult_GossipTimestampFilterDecodeErrorZ *NONNULL_PTR o);
18290 * Frees any resources used by the CResult_GossipTimestampFilterDecodeErrorZ.
18292 void CResult_GossipTimestampFilterDecodeErrorZ_free(struct LDKCResult_GossipTimestampFilterDecodeErrorZ _res);
18295 * Creates a new CResult_GossipTimestampFilterDecodeErrorZ which has the same data as `orig`
18296 * but with all dynamically-allocated buffers duplicated in new buffers.
18298 struct LDKCResult_GossipTimestampFilterDecodeErrorZ CResult_GossipTimestampFilterDecodeErrorZ_clone(const struct LDKCResult_GossipTimestampFilterDecodeErrorZ *NONNULL_PTR orig);
18301 * Frees the buffer pointed to by `data` if `datalen` is non-0.
18303 void CVec_PhantomRouteHintsZ_free(struct LDKCVec_PhantomRouteHintsZ _res);
18306 * Creates a new CResult_InvoiceSignOrCreationErrorZ in the success state.
18308 struct LDKCResult_InvoiceSignOrCreationErrorZ CResult_InvoiceSignOrCreationErrorZ_ok(struct LDKInvoice o);
18311 * Creates a new CResult_InvoiceSignOrCreationErrorZ in the error state.
18313 struct LDKCResult_InvoiceSignOrCreationErrorZ CResult_InvoiceSignOrCreationErrorZ_err(struct LDKSignOrCreationError e);
18316 * Checks if the given object is currently in the success state
18318 bool CResult_InvoiceSignOrCreationErrorZ_is_ok(const struct LDKCResult_InvoiceSignOrCreationErrorZ *NONNULL_PTR o);
18321 * Frees any resources used by the CResult_InvoiceSignOrCreationErrorZ.
18323 void CResult_InvoiceSignOrCreationErrorZ_free(struct LDKCResult_InvoiceSignOrCreationErrorZ _res);
18326 * Creates a new CResult_InvoiceSignOrCreationErrorZ which has the same data as `orig`
18327 * but with all dynamically-allocated buffers duplicated in new buffers.
18329 struct LDKCResult_InvoiceSignOrCreationErrorZ CResult_InvoiceSignOrCreationErrorZ_clone(const struct LDKCResult_InvoiceSignOrCreationErrorZ *NONNULL_PTR orig);
18332 * Constructs a new COption_FilterZ containing a crate::lightning::chain::Filter
18334 struct LDKCOption_FilterZ COption_FilterZ_some(struct LDKFilter o);
18337 * Constructs a new COption_FilterZ containing nothing
18339 struct LDKCOption_FilterZ COption_FilterZ_none(void);
18342 * Frees any resources associated with the crate::lightning::chain::Filter, if we are in the Some state
18344 void COption_FilterZ_free(struct LDKCOption_FilterZ _res);
18347 * Creates a new CResult_LockedChannelMonitorNoneZ in the success state.
18349 struct LDKCResult_LockedChannelMonitorNoneZ CResult_LockedChannelMonitorNoneZ_ok(struct LDKLockedChannelMonitor o);
18352 * Creates a new CResult_LockedChannelMonitorNoneZ in the error state.
18354 struct LDKCResult_LockedChannelMonitorNoneZ CResult_LockedChannelMonitorNoneZ_err(void);
18357 * Checks if the given object is currently in the success state
18359 bool CResult_LockedChannelMonitorNoneZ_is_ok(const struct LDKCResult_LockedChannelMonitorNoneZ *NONNULL_PTR o);
18362 * Frees any resources used by the CResult_LockedChannelMonitorNoneZ.
18364 void CResult_LockedChannelMonitorNoneZ_free(struct LDKCResult_LockedChannelMonitorNoneZ _res);
18367 * Frees the buffer pointed to by `data` if `datalen` is non-0.
18369 void CVec_OutPointZ_free(struct LDKCVec_OutPointZ _res);
18372 * Frees any resources used by the PaymentPurpose
18374 void PaymentPurpose_free(struct LDKPaymentPurpose this_ptr);
18377 * Creates a copy of the PaymentPurpose
18379 struct LDKPaymentPurpose PaymentPurpose_clone(const struct LDKPaymentPurpose *NONNULL_PTR orig);
18382 * Utility method to constructs a new InvoicePayment-variant PaymentPurpose
18384 struct LDKPaymentPurpose PaymentPurpose_invoice_payment(struct LDKThirtyTwoBytes payment_preimage, struct LDKThirtyTwoBytes payment_secret);
18387 * Utility method to constructs a new SpontaneousPayment-variant PaymentPurpose
18389 struct LDKPaymentPurpose PaymentPurpose_spontaneous_payment(struct LDKThirtyTwoBytes a);
18392 * Serialize the PaymentPurpose object into a byte array which can be read by PaymentPurpose_read
18394 struct LDKCVec_u8Z PaymentPurpose_write(const struct LDKPaymentPurpose *NONNULL_PTR obj);
18397 * Read a PaymentPurpose from a byte array, created by PaymentPurpose_write
18399 struct LDKCResult_PaymentPurposeDecodeErrorZ PaymentPurpose_read(struct LDKu8slice ser);
18402 * Frees any resources used by the ClosureReason
18404 void ClosureReason_free(struct LDKClosureReason this_ptr);
18407 * Creates a copy of the ClosureReason
18409 struct LDKClosureReason ClosureReason_clone(const struct LDKClosureReason *NONNULL_PTR orig);
18412 * Utility method to constructs a new CounterpartyForceClosed-variant ClosureReason
18414 struct LDKClosureReason ClosureReason_counterparty_force_closed(struct LDKStr peer_msg);
18417 * Utility method to constructs a new HolderForceClosed-variant ClosureReason
18419 struct LDKClosureReason ClosureReason_holder_force_closed(void);
18422 * Utility method to constructs a new CooperativeClosure-variant ClosureReason
18424 struct LDKClosureReason ClosureReason_cooperative_closure(void);
18427 * Utility method to constructs a new CommitmentTxConfirmed-variant ClosureReason
18429 struct LDKClosureReason ClosureReason_commitment_tx_confirmed(void);
18432 * Utility method to constructs a new FundingTimedOut-variant ClosureReason
18434 struct LDKClosureReason ClosureReason_funding_timed_out(void);
18437 * Utility method to constructs a new ProcessingError-variant ClosureReason
18439 struct LDKClosureReason ClosureReason_processing_error(struct LDKStr err);
18442 * Utility method to constructs a new DisconnectedPeer-variant ClosureReason
18444 struct LDKClosureReason ClosureReason_disconnected_peer(void);
18447 * Utility method to constructs a new OutdatedChannelManager-variant ClosureReason
18449 struct LDKClosureReason ClosureReason_outdated_channel_manager(void);
18452 * Serialize the ClosureReason object into a byte array which can be read by ClosureReason_read
18454 struct LDKCVec_u8Z ClosureReason_write(const struct LDKClosureReason *NONNULL_PTR obj);
18457 * Read a ClosureReason from a byte array, created by ClosureReason_write
18459 struct LDKCResult_COption_ClosureReasonZDecodeErrorZ ClosureReason_read(struct LDKu8slice ser);
18462 * Frees any resources used by the HTLCDestination
18464 void HTLCDestination_free(struct LDKHTLCDestination this_ptr);
18467 * Creates a copy of the HTLCDestination
18469 struct LDKHTLCDestination HTLCDestination_clone(const struct LDKHTLCDestination *NONNULL_PTR orig);
18472 * Utility method to constructs a new NextHopChannel-variant HTLCDestination
18474 struct LDKHTLCDestination HTLCDestination_next_hop_channel(struct LDKPublicKey node_id, struct LDKThirtyTwoBytes channel_id);
18477 * Utility method to constructs a new UnknownNextHop-variant HTLCDestination
18479 struct LDKHTLCDestination HTLCDestination_unknown_next_hop(uint64_t requested_forward_scid);
18482 * Utility method to constructs a new FailedPayment-variant HTLCDestination
18484 struct LDKHTLCDestination HTLCDestination_failed_payment(struct LDKThirtyTwoBytes payment_hash);
18487 * Serialize the HTLCDestination object into a byte array which can be read by HTLCDestination_read
18489 struct LDKCVec_u8Z HTLCDestination_write(const struct LDKHTLCDestination *NONNULL_PTR obj);
18492 * Read a HTLCDestination from a byte array, created by HTLCDestination_write
18494 struct LDKCResult_COption_HTLCDestinationZDecodeErrorZ HTLCDestination_read(struct LDKu8slice ser);
18497 * Frees any resources used by the Event
18499 void Event_free(struct LDKEvent this_ptr);
18502 * Creates a copy of the Event
18504 struct LDKEvent Event_clone(const struct LDKEvent *NONNULL_PTR orig);
18507 * Utility method to constructs a new FundingGenerationReady-variant Event
18509 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);
18512 * Utility method to constructs a new PaymentReceived-variant Event
18514 struct LDKEvent Event_payment_received(struct LDKThirtyTwoBytes payment_hash, uint64_t amount_msat, struct LDKPaymentPurpose purpose);
18517 * Utility method to constructs a new PaymentClaimed-variant Event
18519 struct LDKEvent Event_payment_claimed(struct LDKThirtyTwoBytes payment_hash, uint64_t amount_msat, struct LDKPaymentPurpose purpose);
18522 * Utility method to constructs a new PaymentSent-variant Event
18524 struct LDKEvent Event_payment_sent(struct LDKThirtyTwoBytes payment_id, struct LDKThirtyTwoBytes payment_preimage, struct LDKThirtyTwoBytes payment_hash, struct LDKCOption_u64Z fee_paid_msat);
18527 * Utility method to constructs a new PaymentFailed-variant Event
18529 struct LDKEvent Event_payment_failed(struct LDKThirtyTwoBytes payment_id, struct LDKThirtyTwoBytes payment_hash);
18532 * Utility method to constructs a new PaymentPathSuccessful-variant Event
18534 struct LDKEvent Event_payment_path_successful(struct LDKThirtyTwoBytes payment_id, struct LDKThirtyTwoBytes payment_hash, struct LDKCVec_RouteHopZ path);
18537 * Utility method to constructs a new PaymentPathFailed-variant Event
18539 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);
18542 * Utility method to constructs a new ProbeSuccessful-variant Event
18544 struct LDKEvent Event_probe_successful(struct LDKThirtyTwoBytes payment_id, struct LDKThirtyTwoBytes payment_hash, struct LDKCVec_RouteHopZ path);
18547 * Utility method to constructs a new ProbeFailed-variant Event
18549 struct LDKEvent Event_probe_failed(struct LDKThirtyTwoBytes payment_id, struct LDKThirtyTwoBytes payment_hash, struct LDKCVec_RouteHopZ path, struct LDKCOption_u64Z short_channel_id);
18552 * Utility method to constructs a new PendingHTLCsForwardable-variant Event
18554 struct LDKEvent Event_pending_htlcs_forwardable(uint64_t time_forwardable);
18557 * Utility method to constructs a new SpendableOutputs-variant Event
18559 struct LDKEvent Event_spendable_outputs(struct LDKCVec_SpendableOutputDescriptorZ outputs);
18562 * Utility method to constructs a new PaymentForwarded-variant Event
18564 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);
18567 * Utility method to constructs a new ChannelClosed-variant Event
18569 struct LDKEvent Event_channel_closed(struct LDKThirtyTwoBytes channel_id, uint64_t user_channel_id, struct LDKClosureReason reason);
18572 * Utility method to constructs a new DiscardFunding-variant Event
18574 struct LDKEvent Event_discard_funding(struct LDKThirtyTwoBytes channel_id, struct LDKTransaction transaction);
18577 * Utility method to constructs a new OpenChannelRequest-variant Event
18579 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);
18582 * Utility method to constructs a new HTLCHandlingFailed-variant Event
18584 struct LDKEvent Event_htlchandling_failed(struct LDKThirtyTwoBytes prev_channel_id, struct LDKHTLCDestination failed_next_destination);
18587 * Serialize the Event object into a byte array which can be read by Event_read
18589 struct LDKCVec_u8Z Event_write(const struct LDKEvent *NONNULL_PTR obj);
18592 * Read a Event from a byte array, created by Event_write
18594 struct LDKCResult_COption_EventZDecodeErrorZ Event_read(struct LDKu8slice ser);
18597 * Frees any resources used by the MessageSendEvent
18599 void MessageSendEvent_free(struct LDKMessageSendEvent this_ptr);
18602 * Creates a copy of the MessageSendEvent
18604 struct LDKMessageSendEvent MessageSendEvent_clone(const struct LDKMessageSendEvent *NONNULL_PTR orig);
18607 * Utility method to constructs a new SendAcceptChannel-variant MessageSendEvent
18609 struct LDKMessageSendEvent MessageSendEvent_send_accept_channel(struct LDKPublicKey node_id, struct LDKAcceptChannel msg);
18612 * Utility method to constructs a new SendOpenChannel-variant MessageSendEvent
18614 struct LDKMessageSendEvent MessageSendEvent_send_open_channel(struct LDKPublicKey node_id, struct LDKOpenChannel msg);
18617 * Utility method to constructs a new SendFundingCreated-variant MessageSendEvent
18619 struct LDKMessageSendEvent MessageSendEvent_send_funding_created(struct LDKPublicKey node_id, struct LDKFundingCreated msg);
18622 * Utility method to constructs a new SendFundingSigned-variant MessageSendEvent
18624 struct LDKMessageSendEvent MessageSendEvent_send_funding_signed(struct LDKPublicKey node_id, struct LDKFundingSigned msg);
18627 * Utility method to constructs a new SendChannelReady-variant MessageSendEvent
18629 struct LDKMessageSendEvent MessageSendEvent_send_channel_ready(struct LDKPublicKey node_id, struct LDKChannelReady msg);
18632 * Utility method to constructs a new SendAnnouncementSignatures-variant MessageSendEvent
18634 struct LDKMessageSendEvent MessageSendEvent_send_announcement_signatures(struct LDKPublicKey node_id, struct LDKAnnouncementSignatures msg);
18637 * Utility method to constructs a new UpdateHTLCs-variant MessageSendEvent
18639 struct LDKMessageSendEvent MessageSendEvent_update_htlcs(struct LDKPublicKey node_id, struct LDKCommitmentUpdate updates);
18642 * Utility method to constructs a new SendRevokeAndACK-variant MessageSendEvent
18644 struct LDKMessageSendEvent MessageSendEvent_send_revoke_and_ack(struct LDKPublicKey node_id, struct LDKRevokeAndACK msg);
18647 * Utility method to constructs a new SendClosingSigned-variant MessageSendEvent
18649 struct LDKMessageSendEvent MessageSendEvent_send_closing_signed(struct LDKPublicKey node_id, struct LDKClosingSigned msg);
18652 * Utility method to constructs a new SendShutdown-variant MessageSendEvent
18654 struct LDKMessageSendEvent MessageSendEvent_send_shutdown(struct LDKPublicKey node_id, struct LDKShutdown msg);
18657 * Utility method to constructs a new SendChannelReestablish-variant MessageSendEvent
18659 struct LDKMessageSendEvent MessageSendEvent_send_channel_reestablish(struct LDKPublicKey node_id, struct LDKChannelReestablish msg);
18662 * Utility method to constructs a new SendChannelAnnouncement-variant MessageSendEvent
18664 struct LDKMessageSendEvent MessageSendEvent_send_channel_announcement(struct LDKPublicKey node_id, struct LDKChannelAnnouncement msg, struct LDKChannelUpdate update_msg);
18667 * Utility method to constructs a new BroadcastChannelAnnouncement-variant MessageSendEvent
18669 struct LDKMessageSendEvent MessageSendEvent_broadcast_channel_announcement(struct LDKChannelAnnouncement msg, struct LDKChannelUpdate update_msg);
18672 * Utility method to constructs a new BroadcastChannelUpdate-variant MessageSendEvent
18674 struct LDKMessageSendEvent MessageSendEvent_broadcast_channel_update(struct LDKChannelUpdate msg);
18677 * Utility method to constructs a new SendChannelUpdate-variant MessageSendEvent
18679 struct LDKMessageSendEvent MessageSendEvent_send_channel_update(struct LDKPublicKey node_id, struct LDKChannelUpdate msg);
18682 * Utility method to constructs a new HandleError-variant MessageSendEvent
18684 struct LDKMessageSendEvent MessageSendEvent_handle_error(struct LDKPublicKey node_id, struct LDKErrorAction action);
18687 * Utility method to constructs a new SendChannelRangeQuery-variant MessageSendEvent
18689 struct LDKMessageSendEvent MessageSendEvent_send_channel_range_query(struct LDKPublicKey node_id, struct LDKQueryChannelRange msg);
18692 * Utility method to constructs a new SendShortIdsQuery-variant MessageSendEvent
18694 struct LDKMessageSendEvent MessageSendEvent_send_short_ids_query(struct LDKPublicKey node_id, struct LDKQueryShortChannelIds msg);
18697 * Utility method to constructs a new SendReplyChannelRange-variant MessageSendEvent
18699 struct LDKMessageSendEvent MessageSendEvent_send_reply_channel_range(struct LDKPublicKey node_id, struct LDKReplyChannelRange msg);
18702 * Utility method to constructs a new SendGossipTimestampFilter-variant MessageSendEvent
18704 struct LDKMessageSendEvent MessageSendEvent_send_gossip_timestamp_filter(struct LDKPublicKey node_id, struct LDKGossipTimestampFilter msg);
18707 * Calls the free function if one is set
18709 void MessageSendEventsProvider_free(struct LDKMessageSendEventsProvider this_ptr);
18712 * Calls the free function if one is set
18714 void OnionMessageProvider_free(struct LDKOnionMessageProvider this_ptr);
18717 * Calls the free function if one is set
18719 void EventsProvider_free(struct LDKEventsProvider this_ptr);
18722 * Calls the free function if one is set
18724 void EventHandler_free(struct LDKEventHandler this_ptr);
18727 * Frees any resources used by the APIError
18729 void APIError_free(struct LDKAPIError this_ptr);
18732 * Creates a copy of the APIError
18734 struct LDKAPIError APIError_clone(const struct LDKAPIError *NONNULL_PTR orig);
18737 * Utility method to constructs a new APIMisuseError-variant APIError
18739 struct LDKAPIError APIError_apimisuse_error(struct LDKStr err);
18742 * Utility method to constructs a new FeeRateTooHigh-variant APIError
18744 struct LDKAPIError APIError_fee_rate_too_high(struct LDKStr err, uint32_t feerate);
18747 * Utility method to constructs a new RouteError-variant APIError
18749 struct LDKAPIError APIError_route_error(struct LDKStr err);
18752 * Utility method to constructs a new ChannelUnavailable-variant APIError
18754 struct LDKAPIError APIError_channel_unavailable(struct LDKStr err);
18757 * Utility method to constructs a new MonitorUpdateFailed-variant APIError
18759 struct LDKAPIError APIError_monitor_update_failed(void);
18762 * Utility method to constructs a new IncompatibleShutdownScript-variant APIError
18764 struct LDKAPIError APIError_incompatible_shutdown_script(struct LDKShutdownScript script);
18767 * Frees any resources used by the BigSize, if is_owned is set and inner is non-NULL.
18769 void BigSize_free(struct LDKBigSize this_obj);
18771 uint64_t BigSize_get_a(const struct LDKBigSize *NONNULL_PTR this_ptr);
18773 void BigSize_set_a(struct LDKBigSize *NONNULL_PTR this_ptr, uint64_t val);
18776 * Constructs a new BigSize given each field
18778 MUST_USE_RES struct LDKBigSize BigSize_new(uint64_t a_arg);
18781 * Frees any resources used by the Hostname, if is_owned is set and inner is non-NULL.
18783 void Hostname_free(struct LDKHostname this_obj);
18786 * Creates a copy of the Hostname
18788 struct LDKHostname Hostname_clone(const struct LDKHostname *NONNULL_PTR orig);
18791 * Returns the length of the hostname.
18793 MUST_USE_RES uint8_t Hostname_len(const struct LDKHostname *NONNULL_PTR this_arg);
18796 * Creates a digital signature of a message given a SecretKey, like the node's secret.
18797 * 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.
18798 * Signatures are EC recoverable, meaning that given the message and the signature the PublicKey of the signer can be extracted.
18800 struct LDKCResult_StringErrorZ sign(struct LDKu8slice msg, const uint8_t (*sk)[32]);
18803 * Recovers the PublicKey of the signer of the message given the message and the signature.
18805 struct LDKCResult_PublicKeyErrorZ recover_pk(struct LDKu8slice msg, struct LDKStr sig);
18808 * Verifies a message was signed by a PrivateKey that derives to a given PublicKey, given a message, a signature,
18809 * and the PublicKey.
18811 bool verify(struct LDKu8slice msg, struct LDKStr sig, struct LDKPublicKey pk);
18814 * Construct the invoice's HRP and signatureless data into a preimage to be hashed.
18816 struct LDKCVec_u8Z construct_invoice_preimage(struct LDKu8slice hrp_bytes, struct LDKCVec_u5Z data_without_signature);
18819 * Calls the free function if one is set
18821 void Persister_free(struct LDKPersister this_ptr);
18824 * Calls the free function if one is set
18826 void FutureCallback_free(struct LDKFutureCallback this_ptr);
18829 * Frees any resources used by the Future, if is_owned is set and inner is non-NULL.
18831 void Future_free(struct LDKFuture this_obj);
18834 * Registers a callback to be called upon completion of this future. If the future has already
18835 * completed, the callback will be called immediately.
18837 void Future_register_callback_fn(const struct LDKFuture *NONNULL_PTR this_arg, struct LDKFutureCallback callback);
18840 * Creates a copy of the Level
18842 enum LDKLevel Level_clone(const enum LDKLevel *NONNULL_PTR orig);
18845 * Utility method to constructs a new Gossip-variant Level
18847 enum LDKLevel Level_gossip(void);
18850 * Utility method to constructs a new Trace-variant Level
18852 enum LDKLevel Level_trace(void);
18855 * Utility method to constructs a new Debug-variant Level
18857 enum LDKLevel Level_debug(void);
18860 * Utility method to constructs a new Info-variant Level
18862 enum LDKLevel Level_info(void);
18865 * Utility method to constructs a new Warn-variant Level
18867 enum LDKLevel Level_warn(void);
18870 * Utility method to constructs a new Error-variant Level
18872 enum LDKLevel Level_error(void);
18875 * Checks if two Levels contain equal inner contents.
18876 * This ignores pointers and is_owned flags and looks at the values in fields.
18878 bool Level_eq(const enum LDKLevel *NONNULL_PTR a, const enum LDKLevel *NONNULL_PTR b);
18881 * Checks if two Levels contain equal inner contents.
18883 uint64_t Level_hash(const enum LDKLevel *NONNULL_PTR o);
18886 * Returns the most verbose logging level.
18888 MUST_USE_RES enum LDKLevel Level_max(void);
18891 * Frees any resources used by the Record, if is_owned is set and inner is non-NULL.
18893 void Record_free(struct LDKRecord this_obj);
18896 * The verbosity level of the message.
18898 enum LDKLevel Record_get_level(const struct LDKRecord *NONNULL_PTR this_ptr);
18901 * The verbosity level of the message.
18903 void Record_set_level(struct LDKRecord *NONNULL_PTR this_ptr, enum LDKLevel val);
18906 * The message body.
18908 struct LDKStr Record_get_args(const struct LDKRecord *NONNULL_PTR this_ptr);
18911 * The message body.
18913 void Record_set_args(struct LDKRecord *NONNULL_PTR this_ptr, struct LDKStr val);
18916 * The module path of the message.
18918 struct LDKStr Record_get_module_path(const struct LDKRecord *NONNULL_PTR this_ptr);
18921 * The module path of the message.
18923 void Record_set_module_path(struct LDKRecord *NONNULL_PTR this_ptr, struct LDKStr val);
18926 * The source file containing the message.
18928 struct LDKStr Record_get_file(const struct LDKRecord *NONNULL_PTR this_ptr);
18931 * The source file containing the message.
18933 void Record_set_file(struct LDKRecord *NONNULL_PTR this_ptr, struct LDKStr val);
18936 * The line containing the message.
18938 uint32_t Record_get_line(const struct LDKRecord *NONNULL_PTR this_ptr);
18941 * The line containing the message.
18943 void Record_set_line(struct LDKRecord *NONNULL_PTR this_ptr, uint32_t val);
18946 * Creates a copy of the Record
18948 struct LDKRecord Record_clone(const struct LDKRecord *NONNULL_PTR orig);
18951 * Calls the free function if one is set
18953 void Logger_free(struct LDKLogger this_ptr);
18956 * Frees any resources used by the ChannelHandshakeConfig, if is_owned is set and inner is non-NULL.
18958 void ChannelHandshakeConfig_free(struct LDKChannelHandshakeConfig this_obj);
18961 * Confirmations we will wait for before considering the channel locked in.
18962 * Applied only for inbound channels (see ChannelHandshakeLimits::max_minimum_depth for the
18963 * equivalent limit applied to outbound channels).
18965 * A lower-bound of 1 is applied, requiring all channels to have a confirmed commitment
18966 * transaction before operation. If you wish to accept channels with zero confirmations, see
18967 * [`UserConfig::manually_accept_inbound_channels`] and
18968 * [`ChannelManager::accept_inbound_channel_from_trusted_peer_0conf`].
18970 * Default value: 6.
18972 * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
18973 * [`ChannelManager::accept_inbound_channel_from_trusted_peer_0conf`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel_from_trusted_peer_0conf
18975 uint32_t ChannelHandshakeConfig_get_minimum_depth(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr);
18978 * Confirmations we will wait for before considering the channel locked in.
18979 * Applied only for inbound channels (see ChannelHandshakeLimits::max_minimum_depth for the
18980 * equivalent limit applied to outbound channels).
18982 * A lower-bound of 1 is applied, requiring all channels to have a confirmed commitment
18983 * transaction before operation. If you wish to accept channels with zero confirmations, see
18984 * [`UserConfig::manually_accept_inbound_channels`] and
18985 * [`ChannelManager::accept_inbound_channel_from_trusted_peer_0conf`].
18987 * Default value: 6.
18989 * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
18990 * [`ChannelManager::accept_inbound_channel_from_trusted_peer_0conf`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel_from_trusted_peer_0conf
18992 void ChannelHandshakeConfig_set_minimum_depth(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, uint32_t val);
18995 * Set to the number of blocks we require our counterparty to wait to claim their money (ie
18996 * the number of blocks we have to punish our counterparty if they broadcast a revoked
18999 * This is one of the main parameters of our security model. We (or one of our watchtowers) MUST
19000 * be online to check for revoked transactions on-chain at least once every our_to_self_delay
19001 * blocks (minus some margin to allow us enough time to broadcast and confirm a transaction,
19002 * possibly with time in between to RBF the spending transaction).
19004 * Meanwhile, asking for a too high delay, we bother peer to freeze funds for nothing in
19005 * case of an honest unilateral channel close, which implicitly decrease the economic value of
19008 * Default value: [`BREAKDOWN_TIMEOUT`], we enforce it as a minimum at channel opening so you
19009 * can tweak config to ask for more security, not less.
19011 uint16_t ChannelHandshakeConfig_get_our_to_self_delay(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr);
19014 * Set to the number of blocks we require our counterparty to wait to claim their money (ie
19015 * the number of blocks we have to punish our counterparty if they broadcast a revoked
19018 * This is one of the main parameters of our security model. We (or one of our watchtowers) MUST
19019 * be online to check for revoked transactions on-chain at least once every our_to_self_delay
19020 * blocks (minus some margin to allow us enough time to broadcast and confirm a transaction,
19021 * possibly with time in between to RBF the spending transaction).
19023 * Meanwhile, asking for a too high delay, we bother peer to freeze funds for nothing in
19024 * case of an honest unilateral channel close, which implicitly decrease the economic value of
19027 * Default value: [`BREAKDOWN_TIMEOUT`], we enforce it as a minimum at channel opening so you
19028 * can tweak config to ask for more security, not less.
19030 void ChannelHandshakeConfig_set_our_to_self_delay(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, uint16_t val);
19033 * Set to the smallest value HTLC we will accept to process.
19035 * This value is sent to our counterparty on channel-open and we close the channel any time
19036 * our counterparty misbehaves by sending us an HTLC with a value smaller than this.
19038 * Default value: 1. If the value is less than 1, it is ignored and set to 1, as is required
19041 uint64_t ChannelHandshakeConfig_get_our_htlc_minimum_msat(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr);
19044 * Set to the smallest value HTLC we will accept to process.
19046 * This value is sent to our counterparty on channel-open and we close the channel any time
19047 * our counterparty misbehaves by sending us an HTLC with a value smaller than this.
19049 * Default value: 1. If the value is less than 1, it is ignored and set to 1, as is required
19052 void ChannelHandshakeConfig_set_our_htlc_minimum_msat(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, uint64_t val);
19055 * Sets the percentage of the channel value we will cap the total value of outstanding inbound
19058 * This can be set to a value between 1-100, where the value corresponds to the percent of the
19059 * channel value in whole percentages.
19062 * * If configured to another value than the default value 10, any new channels created with
19063 * the non default value will cause versions of LDK prior to 0.0.104 to refuse to read the
19064 * `ChannelManager`.
19066 * * This caps the total value for inbound HTLCs in-flight only, and there's currently
19067 * no way to configure the cap for the total value of outbound HTLCs in-flight.
19069 * * The requirements for your node being online to ensure the safety of HTLC-encumbered funds
19070 * are different from the non-HTLC-encumbered funds. This makes this an important knob to
19071 * restrict exposure to loss due to being offline for too long.
19072 * See [`ChannelHandshakeConfig::our_to_self_delay`] and [`ChannelConfig::cltv_expiry_delta`]
19073 * for more information.
19075 * Default value: 10.
19076 * Minimum value: 1, any values less than 1 will be treated as 1 instead.
19077 * Maximum value: 100, any values larger than 100 will be treated as 100 instead.
19079 uint8_t ChannelHandshakeConfig_get_max_inbound_htlc_value_in_flight_percent_of_channel(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr);
19082 * Sets the percentage of the channel value we will cap the total value of outstanding inbound
19085 * This can be set to a value between 1-100, where the value corresponds to the percent of the
19086 * channel value in whole percentages.
19089 * * If configured to another value than the default value 10, any new channels created with
19090 * the non default value will cause versions of LDK prior to 0.0.104 to refuse to read the
19091 * `ChannelManager`.
19093 * * This caps the total value for inbound HTLCs in-flight only, and there's currently
19094 * no way to configure the cap for the total value of outbound HTLCs in-flight.
19096 * * The requirements for your node being online to ensure the safety of HTLC-encumbered funds
19097 * are different from the non-HTLC-encumbered funds. This makes this an important knob to
19098 * restrict exposure to loss due to being offline for too long.
19099 * See [`ChannelHandshakeConfig::our_to_self_delay`] and [`ChannelConfig::cltv_expiry_delta`]
19100 * for more information.
19102 * Default value: 10.
19103 * Minimum value: 1, any values less than 1 will be treated as 1 instead.
19104 * Maximum value: 100, any values larger than 100 will be treated as 100 instead.
19106 void ChannelHandshakeConfig_set_max_inbound_htlc_value_in_flight_percent_of_channel(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, uint8_t val);
19109 * If set, we attempt to negotiate the `scid_privacy` (referred to as `scid_alias` in the
19110 * BOLTs) option for outbound private channels. This provides better privacy by not including
19111 * our real on-chain channel UTXO in each invoice and requiring that our counterparty only
19112 * relay HTLCs to us using the channel's SCID alias.
19114 * If this option is set, channels may be created that will not be readable by LDK versions
19115 * prior to 0.0.106, causing [`ChannelManager`]'s read method to return a
19116 * [`DecodeError::InvalidValue`].
19118 * Note that setting this to true does *not* prevent us from opening channels with
19119 * counterparties that do not support the `scid_alias` option; we will simply fall back to a
19120 * private channel without that option.
19122 * Ignored if the channel is negotiated to be announced, see
19123 * [`ChannelHandshakeConfig::announced_channel`] and
19124 * [`ChannelHandshakeLimits::force_announced_channel_preference`] for more.
19126 * Default value: false. This value is likely to change to true in the future.
19128 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
19129 * [`DecodeError::InvalidValue`]: crate::ln::msgs::DecodeError::InvalidValue
19131 bool ChannelHandshakeConfig_get_negotiate_scid_privacy(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr);
19134 * If set, we attempt to negotiate the `scid_privacy` (referred to as `scid_alias` in the
19135 * BOLTs) option for outbound private channels. This provides better privacy by not including
19136 * our real on-chain channel UTXO in each invoice and requiring that our counterparty only
19137 * relay HTLCs to us using the channel's SCID alias.
19139 * If this option is set, channels may be created that will not be readable by LDK versions
19140 * prior to 0.0.106, causing [`ChannelManager`]'s read method to return a
19141 * [`DecodeError::InvalidValue`].
19143 * Note that setting this to true does *not* prevent us from opening channels with
19144 * counterparties that do not support the `scid_alias` option; we will simply fall back to a
19145 * private channel without that option.
19147 * Ignored if the channel is negotiated to be announced, see
19148 * [`ChannelHandshakeConfig::announced_channel`] and
19149 * [`ChannelHandshakeLimits::force_announced_channel_preference`] for more.
19151 * Default value: false. This value is likely to change to true in the future.
19153 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
19154 * [`DecodeError::InvalidValue`]: crate::ln::msgs::DecodeError::InvalidValue
19156 void ChannelHandshakeConfig_set_negotiate_scid_privacy(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, bool val);
19159 * Set to announce the channel publicly and notify all nodes that they can route via this
19162 * This should only be set to true for nodes which expect to be online reliably.
19164 * As the node which funds a channel picks this value this will only apply for new outbound
19165 * channels unless [`ChannelHandshakeLimits::force_announced_channel_preference`] is set.
19167 * Default value: false.
19169 bool ChannelHandshakeConfig_get_announced_channel(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr);
19172 * Set to announce the channel publicly and notify all nodes that they can route via this
19175 * This should only be set to true for nodes which expect to be online reliably.
19177 * As the node which funds a channel picks this value this will only apply for new outbound
19178 * channels unless [`ChannelHandshakeLimits::force_announced_channel_preference`] is set.
19180 * Default value: false.
19182 void ChannelHandshakeConfig_set_announced_channel(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, bool val);
19185 * When set, we commit to an upfront shutdown_pubkey at channel open. If our counterparty
19186 * supports it, they will then enforce the mutual-close output to us matches what we provided
19187 * at intialization, preventing us from closing to an alternate pubkey.
19189 * This is set to true by default to provide a slight increase in security, though ultimately
19190 * any attacker who is able to take control of a channel can just as easily send the funds via
19191 * lightning payments, so we never require that our counterparties support this option.
19193 * The upfront key committed is provided from [`KeysInterface::get_shutdown_scriptpubkey`].
19195 * Default value: true.
19197 * [`KeysInterface::get_shutdown_scriptpubkey`]: crate::chain::keysinterface::KeysInterface::get_shutdown_scriptpubkey
19199 bool ChannelHandshakeConfig_get_commit_upfront_shutdown_pubkey(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr);
19202 * When set, we commit to an upfront shutdown_pubkey at channel open. If our counterparty
19203 * supports it, they will then enforce the mutual-close output to us matches what we provided
19204 * at intialization, preventing us from closing to an alternate pubkey.
19206 * This is set to true by default to provide a slight increase in security, though ultimately
19207 * any attacker who is able to take control of a channel can just as easily send the funds via
19208 * lightning payments, so we never require that our counterparties support this option.
19210 * The upfront key committed is provided from [`KeysInterface::get_shutdown_scriptpubkey`].
19212 * Default value: true.
19214 * [`KeysInterface::get_shutdown_scriptpubkey`]: crate::chain::keysinterface::KeysInterface::get_shutdown_scriptpubkey
19216 void ChannelHandshakeConfig_set_commit_upfront_shutdown_pubkey(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, bool val);
19219 * The Proportion of the channel value to configure as counterparty's channel reserve,
19220 * i.e., `their_channel_reserve_satoshis` for both outbound and inbound channels.
19222 * `their_channel_reserve_satoshis` is the minimum balance that the other node has to maintain
19223 * on their side, at all times.
19224 * This ensures that if our counterparty broadcasts a revoked state, we can punish them by
19225 * claiming at least this value on chain.
19227 * Channel reserve values greater than 30% could be considered highly unreasonable, since that
19228 * amount can never be used for payments.
19229 * Also, if our selected channel reserve for counterparty and counterparty's selected
19230 * channel reserve for us sum up to equal or greater than channel value, channel negotiations
19233 * Note: Versions of LDK earlier than v0.0.104 will fail to read channels with any channel reserve
19234 * other than the default value.
19236 * Default value: 1% of channel value, i.e., configured as 10,000 millionths.
19237 * Minimum value: If the calculated proportional value is less than 1000 sats, it will be treated
19238 * as 1000 sats instead, which is a safe implementation-specific lower bound.
19239 * Maximum value: 1,000,000, any values larger than 1 Million will be treated as 1 Million (or 100%)
19240 * instead, although channel negotiations will fail in that case.
19242 uint32_t ChannelHandshakeConfig_get_their_channel_reserve_proportional_millionths(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr);
19245 * The Proportion of the channel value to configure as counterparty's channel reserve,
19246 * i.e., `their_channel_reserve_satoshis` for both outbound and inbound channels.
19248 * `their_channel_reserve_satoshis` is the minimum balance that the other node has to maintain
19249 * on their side, at all times.
19250 * This ensures that if our counterparty broadcasts a revoked state, we can punish them by
19251 * claiming at least this value on chain.
19253 * Channel reserve values greater than 30% could be considered highly unreasonable, since that
19254 * amount can never be used for payments.
19255 * Also, if our selected channel reserve for counterparty and counterparty's selected
19256 * channel reserve for us sum up to equal or greater than channel value, channel negotiations
19259 * Note: Versions of LDK earlier than v0.0.104 will fail to read channels with any channel reserve
19260 * other than the default value.
19262 * Default value: 1% of channel value, i.e., configured as 10,000 millionths.
19263 * Minimum value: If the calculated proportional value is less than 1000 sats, it will be treated
19264 * as 1000 sats instead, which is a safe implementation-specific lower bound.
19265 * Maximum value: 1,000,000, any values larger than 1 Million will be treated as 1 Million (or 100%)
19266 * instead, although channel negotiations will fail in that case.
19268 void ChannelHandshakeConfig_set_their_channel_reserve_proportional_millionths(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, uint32_t val);
19271 * Constructs a new ChannelHandshakeConfig given each field
19273 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);
19276 * Creates a copy of the ChannelHandshakeConfig
19278 struct LDKChannelHandshakeConfig ChannelHandshakeConfig_clone(const struct LDKChannelHandshakeConfig *NONNULL_PTR orig);
19281 * Creates a "default" ChannelHandshakeConfig. See struct and individual field documentaiton for details on which values are used.
19283 MUST_USE_RES struct LDKChannelHandshakeConfig ChannelHandshakeConfig_default(void);
19286 * Frees any resources used by the ChannelHandshakeLimits, if is_owned is set and inner is non-NULL.
19288 void ChannelHandshakeLimits_free(struct LDKChannelHandshakeLimits this_obj);
19291 * Minimum allowed satoshis when a channel is funded. This is supplied by the sender and so
19292 * only applies to inbound channels.
19294 * Default value: 0.
19296 uint64_t ChannelHandshakeLimits_get_min_funding_satoshis(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
19299 * Minimum allowed satoshis when a channel is funded. This is supplied by the sender and so
19300 * only applies to inbound channels.
19302 * Default value: 0.
19304 void ChannelHandshakeLimits_set_min_funding_satoshis(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint64_t val);
19307 * Maximum allowed satoshis when a channel is funded. This is supplied by the sender and so
19308 * only applies to inbound channels.
19310 * Default value: 2^24 - 1.
19312 uint64_t ChannelHandshakeLimits_get_max_funding_satoshis(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
19315 * Maximum allowed satoshis when a channel is funded. This is supplied by the sender and so
19316 * only applies to inbound channels.
19318 * Default value: 2^24 - 1.
19320 void ChannelHandshakeLimits_set_max_funding_satoshis(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint64_t val);
19323 * The remote node sets a limit on the minimum size of HTLCs we can send to them. This allows
19324 * you to limit the maximum minimum-size they can require.
19326 * Default value: u64::max_value.
19328 uint64_t ChannelHandshakeLimits_get_max_htlc_minimum_msat(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
19331 * The remote node sets a limit on the minimum size of HTLCs we can send to them. This allows
19332 * you to limit the maximum minimum-size they can require.
19334 * Default value: u64::max_value.
19336 void ChannelHandshakeLimits_set_max_htlc_minimum_msat(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint64_t val);
19339 * The remote node sets a limit on the maximum value of pending HTLCs to them at any given
19340 * time to limit their funds exposure to HTLCs. This allows you to set a minimum such value.
19342 * Default value: 0.
19344 uint64_t ChannelHandshakeLimits_get_min_max_htlc_value_in_flight_msat(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
19347 * The remote node sets a limit on the maximum value of pending HTLCs to them at any given
19348 * time to limit their funds exposure to HTLCs. This allows you to set a minimum such value.
19350 * Default value: 0.
19352 void ChannelHandshakeLimits_set_min_max_htlc_value_in_flight_msat(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint64_t val);
19355 * The remote node will require we keep a certain amount in direct payment to ourselves at all
19356 * time, ensuring that we are able to be punished if we broadcast an old state. This allows to
19357 * you limit the amount which we will have to keep to ourselves (and cannot use for HTLCs).
19359 * Default value: u64::max_value.
19361 uint64_t ChannelHandshakeLimits_get_max_channel_reserve_satoshis(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
19364 * The remote node will require we keep a certain amount in direct payment to ourselves at all
19365 * time, ensuring that we are able to be punished if we broadcast an old state. This allows to
19366 * you limit the amount which we will have to keep to ourselves (and cannot use for HTLCs).
19368 * Default value: u64::max_value.
19370 void ChannelHandshakeLimits_set_max_channel_reserve_satoshis(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint64_t val);
19373 * The remote node sets a limit on the maximum number of pending HTLCs to them at any given
19374 * time. This allows you to set a minimum such value.
19376 * Default value: 0.
19378 uint16_t ChannelHandshakeLimits_get_min_max_accepted_htlcs(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
19381 * The remote node sets a limit on the maximum number of pending HTLCs to them at any given
19382 * time. This allows you to set a minimum such value.
19384 * Default value: 0.
19386 void ChannelHandshakeLimits_set_min_max_accepted_htlcs(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint16_t val);
19389 * Before a channel is usable the funding transaction will need to be confirmed by at least a
19390 * certain number of blocks, specified by the node which is not the funder (as the funder can
19391 * assume they aren't going to double-spend themselves).
19392 * This config allows you to set a limit on the maximum amount of time to wait.
19394 * Default value: 144, or roughly one day and only applies to outbound channels.
19396 uint32_t ChannelHandshakeLimits_get_max_minimum_depth(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
19399 * Before a channel is usable the funding transaction will need to be confirmed by at least a
19400 * certain number of blocks, specified by the node which is not the funder (as the funder can
19401 * assume they aren't going to double-spend themselves).
19402 * This config allows you to set a limit on the maximum amount of time to wait.
19404 * Default value: 144, or roughly one day and only applies to outbound channels.
19406 void ChannelHandshakeLimits_set_max_minimum_depth(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint32_t val);
19409 * Whether we implicitly trust funding transactions generated by us for our own outbound
19410 * channels to not be double-spent.
19412 * If this is set, we assume that our own funding transactions are *never* double-spent, and
19413 * thus we can trust them without any confirmations. This is generally a reasonable
19414 * assumption, given we're the only ones who could ever double-spend it (assuming we have sole
19415 * control of the signing keys).
19417 * You may wish to un-set this if you allow the user to (or do in an automated fashion)
19418 * double-spend the funding transaction to RBF with an alternative channel open.
19420 * This only applies if our counterparty set their confirmations-required value to 0, and we
19421 * always trust our own funding transaction at 1 confirmation irrespective of this value.
19422 * Thus, this effectively acts as a `min_minimum_depth`, with the only possible values being
19423 * `true` (0) and `false` (1).
19425 * Default value: true
19427 bool ChannelHandshakeLimits_get_trust_own_funding_0conf(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
19430 * Whether we implicitly trust funding transactions generated by us for our own outbound
19431 * channels to not be double-spent.
19433 * If this is set, we assume that our own funding transactions are *never* double-spent, and
19434 * thus we can trust them without any confirmations. This is generally a reasonable
19435 * assumption, given we're the only ones who could ever double-spend it (assuming we have sole
19436 * control of the signing keys).
19438 * You may wish to un-set this if you allow the user to (or do in an automated fashion)
19439 * double-spend the funding transaction to RBF with an alternative channel open.
19441 * This only applies if our counterparty set their confirmations-required value to 0, and we
19442 * always trust our own funding transaction at 1 confirmation irrespective of this value.
19443 * Thus, this effectively acts as a `min_minimum_depth`, with the only possible values being
19444 * `true` (0) and `false` (1).
19446 * Default value: true
19448 void ChannelHandshakeLimits_set_trust_own_funding_0conf(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, bool val);
19451 * Set to force an incoming channel to match our announced channel preference in
19452 * [`ChannelHandshakeConfig::announced_channel`].
19454 * For a node which is not online reliably, this should be set to true and
19455 * [`ChannelHandshakeConfig::announced_channel`] set to false, ensuring that no announced (aka public)
19456 * channels will ever be opened.
19458 * Default value: true.
19460 bool ChannelHandshakeLimits_get_force_announced_channel_preference(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
19463 * Set to force an incoming channel to match our announced channel preference in
19464 * [`ChannelHandshakeConfig::announced_channel`].
19466 * For a node which is not online reliably, this should be set to true and
19467 * [`ChannelHandshakeConfig::announced_channel`] set to false, ensuring that no announced (aka public)
19468 * channels will ever be opened.
19470 * Default value: true.
19472 void ChannelHandshakeLimits_set_force_announced_channel_preference(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, bool val);
19475 * Set to the amount of time we're willing to wait to claim money back to us.
19477 * Not checking this value would be a security issue, as our peer would be able to set it to
19478 * max relative lock-time (a year) and we would \"lose\" money as it would be locked for a long time.
19480 * Default value: 2016, which we also enforce as a maximum value so you can tweak config to
19481 * reduce the loss of having useless locked funds (if your peer accepts)
19483 uint16_t ChannelHandshakeLimits_get_their_to_self_delay(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
19486 * Set to the amount of time we're willing to wait to claim money back to us.
19488 * Not checking this value would be a security issue, as our peer would be able to set it to
19489 * max relative lock-time (a year) and we would \"lose\" money as it would be locked for a long time.
19491 * Default value: 2016, which we also enforce as a maximum value so you can tweak config to
19492 * reduce the loss of having useless locked funds (if your peer accepts)
19494 void ChannelHandshakeLimits_set_their_to_self_delay(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint16_t val);
19497 * Constructs a new ChannelHandshakeLimits given each field
19499 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);
19502 * Creates a copy of the ChannelHandshakeLimits
19504 struct LDKChannelHandshakeLimits ChannelHandshakeLimits_clone(const struct LDKChannelHandshakeLimits *NONNULL_PTR orig);
19507 * Creates a "default" ChannelHandshakeLimits. See struct and individual field documentaiton for details on which values are used.
19509 MUST_USE_RES struct LDKChannelHandshakeLimits ChannelHandshakeLimits_default(void);
19512 * Frees any resources used by the ChannelConfig, if is_owned is set and inner is non-NULL.
19514 void ChannelConfig_free(struct LDKChannelConfig this_obj);
19517 * Amount (in millionths of a satoshi) charged per satoshi for payments forwarded outbound
19518 * over the channel.
19519 * This may be allowed to change at runtime in a later update, however doing so must result in
19520 * update messages sent to notify all nodes of our updated relay fee.
19522 * Default value: 0.
19524 uint32_t ChannelConfig_get_forwarding_fee_proportional_millionths(const struct LDKChannelConfig *NONNULL_PTR this_ptr);
19527 * Amount (in millionths of a satoshi) charged per satoshi for payments forwarded outbound
19528 * over the channel.
19529 * This may be allowed to change at runtime in a later update, however doing so must result in
19530 * update messages sent to notify all nodes of our updated relay fee.
19532 * Default value: 0.
19534 void ChannelConfig_set_forwarding_fee_proportional_millionths(struct LDKChannelConfig *NONNULL_PTR this_ptr, uint32_t val);
19537 * Amount (in milli-satoshi) charged for payments forwarded outbound over the channel, in
19538 * excess of [`forwarding_fee_proportional_millionths`].
19539 * This may be allowed to change at runtime in a later update, however doing so must result in
19540 * update messages sent to notify all nodes of our updated relay fee.
19542 * The default value of a single satoshi roughly matches the market rate on many routing nodes
19543 * as of July 2021. Adjusting it upwards or downwards may change whether nodes route through
19546 * Default value: 1000.
19548 * [`forwarding_fee_proportional_millionths`]: ChannelConfig::forwarding_fee_proportional_millionths
19550 uint32_t ChannelConfig_get_forwarding_fee_base_msat(const struct LDKChannelConfig *NONNULL_PTR this_ptr);
19553 * Amount (in milli-satoshi) charged for payments forwarded outbound over the channel, in
19554 * excess of [`forwarding_fee_proportional_millionths`].
19555 * This may be allowed to change at runtime in a later update, however doing so must result in
19556 * update messages sent to notify all nodes of our updated relay fee.
19558 * The default value of a single satoshi roughly matches the market rate on many routing nodes
19559 * as of July 2021. Adjusting it upwards or downwards may change whether nodes route through
19562 * Default value: 1000.
19564 * [`forwarding_fee_proportional_millionths`]: ChannelConfig::forwarding_fee_proportional_millionths
19566 void ChannelConfig_set_forwarding_fee_base_msat(struct LDKChannelConfig *NONNULL_PTR this_ptr, uint32_t val);
19569 * The difference in the CLTV value between incoming HTLCs and an outbound HTLC forwarded over
19570 * the channel this config applies to.
19572 * This is analogous to [`ChannelHandshakeConfig::our_to_self_delay`] but applies to in-flight
19573 * HTLC balance when a channel appears on-chain whereas
19574 * [`ChannelHandshakeConfig::our_to_self_delay`] applies to the remaining
19575 * (non-HTLC-encumbered) balance.
19577 * Thus, for HTLC-encumbered balances to be enforced on-chain when a channel is force-closed,
19578 * we (or one of our watchtowers) MUST be online to check for broadcast of the current
19579 * commitment transaction at least once per this many blocks (minus some margin to allow us
19580 * enough time to broadcast and confirm a transaction, possibly with time in between to RBF
19581 * the spending transaction).
19583 * Default value: 72 (12 hours at an average of 6 blocks/hour).
19584 * Minimum value: [`MIN_CLTV_EXPIRY_DELTA`], any values less than this will be treated as
19585 * [`MIN_CLTV_EXPIRY_DELTA`] instead.
19587 * [`MIN_CLTV_EXPIRY_DELTA`]: crate::ln::channelmanager::MIN_CLTV_EXPIRY_DELTA
19589 uint16_t ChannelConfig_get_cltv_expiry_delta(const struct LDKChannelConfig *NONNULL_PTR this_ptr);
19592 * The difference in the CLTV value between incoming HTLCs and an outbound HTLC forwarded over
19593 * the channel this config applies to.
19595 * This is analogous to [`ChannelHandshakeConfig::our_to_self_delay`] but applies to in-flight
19596 * HTLC balance when a channel appears on-chain whereas
19597 * [`ChannelHandshakeConfig::our_to_self_delay`] applies to the remaining
19598 * (non-HTLC-encumbered) balance.
19600 * Thus, for HTLC-encumbered balances to be enforced on-chain when a channel is force-closed,
19601 * we (or one of our watchtowers) MUST be online to check for broadcast of the current
19602 * commitment transaction at least once per this many blocks (minus some margin to allow us
19603 * enough time to broadcast and confirm a transaction, possibly with time in between to RBF
19604 * the spending transaction).
19606 * Default value: 72 (12 hours at an average of 6 blocks/hour).
19607 * Minimum value: [`MIN_CLTV_EXPIRY_DELTA`], any values less than this will be treated as
19608 * [`MIN_CLTV_EXPIRY_DELTA`] instead.
19610 * [`MIN_CLTV_EXPIRY_DELTA`]: crate::ln::channelmanager::MIN_CLTV_EXPIRY_DELTA
19612 void ChannelConfig_set_cltv_expiry_delta(struct LDKChannelConfig *NONNULL_PTR this_ptr, uint16_t val);
19615 * Limit our total exposure to in-flight HTLCs which are burned to fees as they are too
19616 * small to claim on-chain.
19618 * When an HTLC present in one of our channels is below a \"dust\" threshold, the HTLC will
19619 * not be claimable on-chain, instead being turned into additional miner fees if either
19620 * party force-closes the channel. Because the threshold is per-HTLC, our total exposure
19621 * to such payments may be sustantial if there are many dust HTLCs present when the
19622 * channel is force-closed.
19624 * This limit is applied for sent, forwarded, and received HTLCs and limits the total
19625 * exposure across all three types per-channel. Setting this too low may prevent the
19626 * sending or receipt of low-value HTLCs on high-traffic nodes, and this limit is very
19627 * important to prevent stealing of dust HTLCs by miners.
19629 * Default value: 5_000_000 msat.
19631 uint64_t ChannelConfig_get_max_dust_htlc_exposure_msat(const struct LDKChannelConfig *NONNULL_PTR this_ptr);
19634 * Limit our total exposure to in-flight HTLCs which are burned to fees as they are too
19635 * small to claim on-chain.
19637 * When an HTLC present in one of our channels is below a \"dust\" threshold, the HTLC will
19638 * not be claimable on-chain, instead being turned into additional miner fees if either
19639 * party force-closes the channel. Because the threshold is per-HTLC, our total exposure
19640 * to such payments may be sustantial if there are many dust HTLCs present when the
19641 * channel is force-closed.
19643 * This limit is applied for sent, forwarded, and received HTLCs and limits the total
19644 * exposure across all three types per-channel. Setting this too low may prevent the
19645 * sending or receipt of low-value HTLCs on high-traffic nodes, and this limit is very
19646 * important to prevent stealing of dust HTLCs by miners.
19648 * Default value: 5_000_000 msat.
19650 void ChannelConfig_set_max_dust_htlc_exposure_msat(struct LDKChannelConfig *NONNULL_PTR this_ptr, uint64_t val);
19653 * The additional fee we're willing to pay to avoid waiting for the counterparty's
19654 * `to_self_delay` to reclaim funds.
19656 * When we close a channel cooperatively with our counterparty, we negotiate a fee for the
19657 * closing transaction which both sides find acceptable, ultimately paid by the channel
19658 * funder/initiator.
19660 * When we are the funder, because we have to pay the channel closing fee, we bound the
19661 * acceptable fee by our [`Background`] and [`Normal`] fees, with the upper bound increased by
19662 * this value. Because the on-chain fee we'd pay to force-close the channel is kept near our
19663 * [`Normal`] feerate during normal operation, this value represents the additional fee we're
19664 * willing to pay in order to avoid waiting for our counterparty's to_self_delay to reclaim our
19667 * When we are not the funder, we require the closing transaction fee pay at least our
19668 * [`Background`] fee estimate, but allow our counterparty to pay as much fee as they like.
19669 * Thus, this value is ignored when we are not the funder.
19671 * Default value: 1000 satoshis.
19673 * [`Normal`]: crate::chain::chaininterface::ConfirmationTarget::Normal
19674 * [`Background`]: crate::chain::chaininterface::ConfirmationTarget::Background
19676 uint64_t ChannelConfig_get_force_close_avoidance_max_fee_satoshis(const struct LDKChannelConfig *NONNULL_PTR this_ptr);
19679 * The additional fee we're willing to pay to avoid waiting for the counterparty's
19680 * `to_self_delay` to reclaim funds.
19682 * When we close a channel cooperatively with our counterparty, we negotiate a fee for the
19683 * closing transaction which both sides find acceptable, ultimately paid by the channel
19684 * funder/initiator.
19686 * When we are the funder, because we have to pay the channel closing fee, we bound the
19687 * acceptable fee by our [`Background`] and [`Normal`] fees, with the upper bound increased by
19688 * this value. Because the on-chain fee we'd pay to force-close the channel is kept near our
19689 * [`Normal`] feerate during normal operation, this value represents the additional fee we're
19690 * willing to pay in order to avoid waiting for our counterparty's to_self_delay to reclaim our
19693 * When we are not the funder, we require the closing transaction fee pay at least our
19694 * [`Background`] fee estimate, but allow our counterparty to pay as much fee as they like.
19695 * Thus, this value is ignored when we are not the funder.
19697 * Default value: 1000 satoshis.
19699 * [`Normal`]: crate::chain::chaininterface::ConfirmationTarget::Normal
19700 * [`Background`]: crate::chain::chaininterface::ConfirmationTarget::Background
19702 void ChannelConfig_set_force_close_avoidance_max_fee_satoshis(struct LDKChannelConfig *NONNULL_PTR this_ptr, uint64_t val);
19705 * Constructs a new ChannelConfig given each field
19707 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);
19710 * Creates a copy of the ChannelConfig
19712 struct LDKChannelConfig ChannelConfig_clone(const struct LDKChannelConfig *NONNULL_PTR orig);
19715 * Creates a "default" ChannelConfig. See struct and individual field documentaiton for details on which values are used.
19717 MUST_USE_RES struct LDKChannelConfig ChannelConfig_default(void);
19720 * Serialize the ChannelConfig object into a byte array which can be read by ChannelConfig_read
19722 struct LDKCVec_u8Z ChannelConfig_write(const struct LDKChannelConfig *NONNULL_PTR obj);
19725 * Read a ChannelConfig from a byte array, created by ChannelConfig_write
19727 struct LDKCResult_ChannelConfigDecodeErrorZ ChannelConfig_read(struct LDKu8slice ser);
19730 * Frees any resources used by the UserConfig, if is_owned is set and inner is non-NULL.
19732 void UserConfig_free(struct LDKUserConfig this_obj);
19735 * Channel handshake config that we propose to our counterparty.
19737 struct LDKChannelHandshakeConfig UserConfig_get_channel_handshake_config(const struct LDKUserConfig *NONNULL_PTR this_ptr);
19740 * Channel handshake config that we propose to our counterparty.
19742 void UserConfig_set_channel_handshake_config(struct LDKUserConfig *NONNULL_PTR this_ptr, struct LDKChannelHandshakeConfig val);
19745 * Limits applied to our counterparty's proposed channel handshake config settings.
19747 struct LDKChannelHandshakeLimits UserConfig_get_channel_handshake_limits(const struct LDKUserConfig *NONNULL_PTR this_ptr);
19750 * Limits applied to our counterparty's proposed channel handshake config settings.
19752 void UserConfig_set_channel_handshake_limits(struct LDKUserConfig *NONNULL_PTR this_ptr, struct LDKChannelHandshakeLimits val);
19755 * Channel config which affects behavior during channel lifetime.
19757 struct LDKChannelConfig UserConfig_get_channel_config(const struct LDKUserConfig *NONNULL_PTR this_ptr);
19760 * Channel config which affects behavior during channel lifetime.
19762 void UserConfig_set_channel_config(struct LDKUserConfig *NONNULL_PTR this_ptr, struct LDKChannelConfig val);
19765 * If this is set to false, we will reject any HTLCs which were to be forwarded over private
19766 * channels. This prevents us from taking on HTLC-forwarding risk when we intend to run as a
19767 * node which is not online reliably.
19769 * For nodes which are not online reliably, you should set all channels to *not* be announced
19770 * (using [`ChannelHandshakeConfig::announced_channel`] and
19771 * [`ChannelHandshakeLimits::force_announced_channel_preference`]) and set this to false to
19772 * ensure you are not exposed to any forwarding risk.
19774 * Note that because you cannot change a channel's announced state after creation, there is no
19775 * way to disable forwarding on public channels retroactively. Thus, in order to change a node
19776 * from a publicly-announced forwarding node to a private non-forwarding node you must close
19777 * all your channels and open new ones. For privacy, you should also change your node_id
19778 * (swapping all private and public key material for new ones) at that time.
19780 * Default value: false.
19782 bool UserConfig_get_accept_forwards_to_priv_channels(const struct LDKUserConfig *NONNULL_PTR this_ptr);
19785 * If this is set to false, we will reject any HTLCs which were to be forwarded over private
19786 * channels. This prevents us from taking on HTLC-forwarding risk when we intend to run as a
19787 * node which is not online reliably.
19789 * For nodes which are not online reliably, you should set all channels to *not* be announced
19790 * (using [`ChannelHandshakeConfig::announced_channel`] and
19791 * [`ChannelHandshakeLimits::force_announced_channel_preference`]) and set this to false to
19792 * ensure you are not exposed to any forwarding risk.
19794 * Note that because you cannot change a channel's announced state after creation, there is no
19795 * way to disable forwarding on public channels retroactively. Thus, in order to change a node
19796 * from a publicly-announced forwarding node to a private non-forwarding node you must close
19797 * all your channels and open new ones. For privacy, you should also change your node_id
19798 * (swapping all private and public key material for new ones) at that time.
19800 * Default value: false.
19802 void UserConfig_set_accept_forwards_to_priv_channels(struct LDKUserConfig *NONNULL_PTR this_ptr, bool val);
19805 * If this is set to false, we do not accept inbound requests to open a new channel.
19806 * Default value: true.
19808 bool UserConfig_get_accept_inbound_channels(const struct LDKUserConfig *NONNULL_PTR this_ptr);
19811 * If this is set to false, we do not accept inbound requests to open a new channel.
19812 * Default value: true.
19814 void UserConfig_set_accept_inbound_channels(struct LDKUserConfig *NONNULL_PTR this_ptr, bool val);
19817 * If this is set to true, the user needs to manually accept inbound requests to open a new
19820 * When set to true, [`Event::OpenChannelRequest`] will be triggered once a request to open a
19821 * new inbound channel is received through a [`msgs::OpenChannel`] message. In that case, a
19822 * [`msgs::AcceptChannel`] message will not be sent back to the counterparty node unless the
19823 * user explicitly chooses to accept the request.
19825 * Default value: false.
19827 * [`Event::OpenChannelRequest`]: crate::util::events::Event::OpenChannelRequest
19828 * [`msgs::OpenChannel`]: crate::ln::msgs::OpenChannel
19829 * [`msgs::AcceptChannel`]: crate::ln::msgs::AcceptChannel
19831 bool UserConfig_get_manually_accept_inbound_channels(const struct LDKUserConfig *NONNULL_PTR this_ptr);
19834 * If this is set to true, the user needs to manually accept inbound requests to open a new
19837 * When set to true, [`Event::OpenChannelRequest`] will be triggered once a request to open a
19838 * new inbound channel is received through a [`msgs::OpenChannel`] message. In that case, a
19839 * [`msgs::AcceptChannel`] message will not be sent back to the counterparty node unless the
19840 * user explicitly chooses to accept the request.
19842 * Default value: false.
19844 * [`Event::OpenChannelRequest`]: crate::util::events::Event::OpenChannelRequest
19845 * [`msgs::OpenChannel`]: crate::ln::msgs::OpenChannel
19846 * [`msgs::AcceptChannel`]: crate::ln::msgs::AcceptChannel
19848 void UserConfig_set_manually_accept_inbound_channels(struct LDKUserConfig *NONNULL_PTR this_ptr, bool val);
19851 * Constructs a new UserConfig given each field
19853 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);
19856 * Creates a copy of the UserConfig
19858 struct LDKUserConfig UserConfig_clone(const struct LDKUserConfig *NONNULL_PTR orig);
19861 * Creates a "default" UserConfig. See struct and individual field documentaiton for details on which values are used.
19863 MUST_USE_RES struct LDKUserConfig UserConfig_default(void);
19866 * Frees any resources used by the BestBlock, if is_owned is set and inner is non-NULL.
19868 void BestBlock_free(struct LDKBestBlock this_obj);
19871 * Creates a copy of the BestBlock
19873 struct LDKBestBlock BestBlock_clone(const struct LDKBestBlock *NONNULL_PTR orig);
19876 * Constructs a `BestBlock` that represents the genesis block at height 0 of the given
19879 MUST_USE_RES struct LDKBestBlock BestBlock_from_genesis(enum LDKNetwork network);
19882 * Returns a `BestBlock` as identified by the given block hash and height.
19884 MUST_USE_RES struct LDKBestBlock BestBlock_new(struct LDKThirtyTwoBytes block_hash, uint32_t height);
19887 * Returns the best block hash.
19889 MUST_USE_RES struct LDKThirtyTwoBytes BestBlock_block_hash(const struct LDKBestBlock *NONNULL_PTR this_arg);
19892 * Returns the best block height.
19894 MUST_USE_RES uint32_t BestBlock_height(const struct LDKBestBlock *NONNULL_PTR this_arg);
19897 * Creates a copy of the AccessError
19899 enum LDKAccessError AccessError_clone(const enum LDKAccessError *NONNULL_PTR orig);
19902 * Utility method to constructs a new UnknownChain-variant AccessError
19904 enum LDKAccessError AccessError_unknown_chain(void);
19907 * Utility method to constructs a new UnknownTx-variant AccessError
19909 enum LDKAccessError AccessError_unknown_tx(void);
19912 * Calls the free function if one is set
19914 void Access_free(struct LDKAccess this_ptr);
19917 * Calls the free function if one is set
19919 void Listen_free(struct LDKListen this_ptr);
19922 * Calls the free function if one is set
19924 void Confirm_free(struct LDKConfirm this_ptr);
19927 * Creates a copy of the ChannelMonitorUpdateErr
19929 enum LDKChannelMonitorUpdateErr ChannelMonitorUpdateErr_clone(const enum LDKChannelMonitorUpdateErr *NONNULL_PTR orig);
19932 * Utility method to constructs a new TemporaryFailure-variant ChannelMonitorUpdateErr
19934 enum LDKChannelMonitorUpdateErr ChannelMonitorUpdateErr_temporary_failure(void);
19937 * Utility method to constructs a new PermanentFailure-variant ChannelMonitorUpdateErr
19939 enum LDKChannelMonitorUpdateErr ChannelMonitorUpdateErr_permanent_failure(void);
19942 * Calls the free function if one is set
19944 void Watch_free(struct LDKWatch this_ptr);
19947 * Calls the free function if one is set
19949 void Filter_free(struct LDKFilter this_ptr);
19952 * Frees any resources used by the WatchedOutput, if is_owned is set and inner is non-NULL.
19954 void WatchedOutput_free(struct LDKWatchedOutput this_obj);
19957 * First block where the transaction output may have been spent.
19959 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
19961 struct LDKThirtyTwoBytes WatchedOutput_get_block_hash(const struct LDKWatchedOutput *NONNULL_PTR this_ptr);
19964 * First block where the transaction output may have been spent.
19966 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
19968 void WatchedOutput_set_block_hash(struct LDKWatchedOutput *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
19971 * Outpoint identifying the transaction output.
19973 struct LDKOutPoint WatchedOutput_get_outpoint(const struct LDKWatchedOutput *NONNULL_PTR this_ptr);
19976 * Outpoint identifying the transaction output.
19978 void WatchedOutput_set_outpoint(struct LDKWatchedOutput *NONNULL_PTR this_ptr, struct LDKOutPoint val);
19981 * Spending condition of the transaction output.
19983 struct LDKu8slice WatchedOutput_get_script_pubkey(const struct LDKWatchedOutput *NONNULL_PTR this_ptr);
19986 * Spending condition of the transaction output.
19988 void WatchedOutput_set_script_pubkey(struct LDKWatchedOutput *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val);
19991 * Constructs a new WatchedOutput given each field
19993 MUST_USE_RES struct LDKWatchedOutput WatchedOutput_new(struct LDKThirtyTwoBytes block_hash_arg, struct LDKOutPoint outpoint_arg, struct LDKCVec_u8Z script_pubkey_arg);
19996 * Creates a copy of the WatchedOutput
19998 struct LDKWatchedOutput WatchedOutput_clone(const struct LDKWatchedOutput *NONNULL_PTR orig);
20001 * Checks if two WatchedOutputs contain equal inner contents.
20003 uint64_t WatchedOutput_hash(const struct LDKWatchedOutput *NONNULL_PTR o);
20006 * Calls the free function if one is set
20008 void BroadcasterInterface_free(struct LDKBroadcasterInterface this_ptr);
20011 * Creates a copy of the ConfirmationTarget
20013 enum LDKConfirmationTarget ConfirmationTarget_clone(const enum LDKConfirmationTarget *NONNULL_PTR orig);
20016 * Utility method to constructs a new Background-variant ConfirmationTarget
20018 enum LDKConfirmationTarget ConfirmationTarget_background(void);
20021 * Utility method to constructs a new Normal-variant ConfirmationTarget
20023 enum LDKConfirmationTarget ConfirmationTarget_normal(void);
20026 * Utility method to constructs a new HighPriority-variant ConfirmationTarget
20028 enum LDKConfirmationTarget ConfirmationTarget_high_priority(void);
20031 * Checks if two ConfirmationTargets contain equal inner contents.
20032 * This ignores pointers and is_owned flags and looks at the values in fields.
20034 bool ConfirmationTarget_eq(const enum LDKConfirmationTarget *NONNULL_PTR a, const enum LDKConfirmationTarget *NONNULL_PTR b);
20037 * Calls the free function if one is set
20039 void FeeEstimator_free(struct LDKFeeEstimator this_ptr);
20042 * Frees any resources used by the MonitorUpdateId, if is_owned is set and inner is non-NULL.
20044 void MonitorUpdateId_free(struct LDKMonitorUpdateId this_obj);
20047 * Creates a copy of the MonitorUpdateId
20049 struct LDKMonitorUpdateId MonitorUpdateId_clone(const struct LDKMonitorUpdateId *NONNULL_PTR orig);
20052 * Checks if two MonitorUpdateIds contain equal inner contents.
20054 uint64_t MonitorUpdateId_hash(const struct LDKMonitorUpdateId *NONNULL_PTR o);
20057 * Checks if two MonitorUpdateIds contain equal inner contents.
20058 * This ignores pointers and is_owned flags and looks at the values in fields.
20059 * Two objects with NULL inner values will be considered "equal" here.
20061 bool MonitorUpdateId_eq(const struct LDKMonitorUpdateId *NONNULL_PTR a, const struct LDKMonitorUpdateId *NONNULL_PTR b);
20064 * Calls the free function if one is set
20066 void Persist_free(struct LDKPersist this_ptr);
20069 * Frees any resources used by the LockedChannelMonitor, if is_owned is set and inner is non-NULL.
20071 void LockedChannelMonitor_free(struct LDKLockedChannelMonitor this_obj);
20074 * Frees any resources used by the ChainMonitor, if is_owned is set and inner is non-NULL.
20076 void ChainMonitor_free(struct LDKChainMonitor this_obj);
20079 * Creates a new `ChainMonitor` used to watch on-chain activity pertaining to channels.
20081 * When an optional chain source implementing [`chain::Filter`] is provided, the chain monitor
20082 * will call back to it indicating transactions and outputs of interest. This allows clients to
20083 * pre-filter blocks or only fetch blocks matching a compact filter. Otherwise, clients may
20084 * always need to fetch full blocks absent another means for determining which blocks contain
20085 * transactions relevant to the watched channels.
20087 MUST_USE_RES struct LDKChainMonitor ChainMonitor_new(struct LDKCOption_FilterZ chain_source, struct LDKBroadcasterInterface broadcaster, struct LDKLogger logger, struct LDKFeeEstimator feeest, struct LDKPersist persister);
20090 * Gets the balances in the contained [`ChannelMonitor`]s which are claimable on-chain or
20091 * claims which are awaiting confirmation.
20093 * Includes the balances from each [`ChannelMonitor`] *except* those included in
20094 * `ignored_channels`, allowing you to filter out balances from channels which are still open
20095 * (and whose balance should likely be pulled from the [`ChannelDetails`]).
20097 * See [`ChannelMonitor::get_claimable_balances`] for more details on the exact criteria for
20098 * inclusion in the return value.
20100 MUST_USE_RES struct LDKCVec_BalanceZ ChainMonitor_get_claimable_balances(const struct LDKChainMonitor *NONNULL_PTR this_arg, struct LDKCVec_ChannelDetailsZ ignored_channels);
20103 * Gets the [`LockedChannelMonitor`] for a given funding outpoint, returning an `Err` if no
20104 * such [`ChannelMonitor`] is currently being monitored for.
20106 * Note that the result holds a mutex over our monitor set, and should not be held
20109 MUST_USE_RES struct LDKCResult_LockedChannelMonitorNoneZ ChainMonitor_get_monitor(const struct LDKChainMonitor *NONNULL_PTR this_arg, struct LDKOutPoint funding_txo);
20112 * Lists the funding outpoint of each [`ChannelMonitor`] being monitored.
20114 * Note that [`ChannelMonitor`]s are not removed when a channel is closed as they are always
20115 * monitoring for on-chain state resolutions.
20117 MUST_USE_RES struct LDKCVec_OutPointZ ChainMonitor_list_monitors(const struct LDKChainMonitor *NONNULL_PTR this_arg);
20120 * Indicates the persistence of a [`ChannelMonitor`] has completed after
20121 * [`ChannelMonitorUpdateErr::TemporaryFailure`] was returned from an update operation.
20123 * Thus, the anticipated use is, at a high level:
20124 * 1) This [`ChainMonitor`] calls [`Persist::update_persisted_channel`] which stores the
20125 * update to disk and begins updating any remote (e.g. watchtower/backup) copies,
20126 * returning [`ChannelMonitorUpdateErr::TemporaryFailure`],
20127 * 2) once all remote copies are updated, you call this function with the
20128 * `completed_update_id` that completed, and once all pending updates have completed the
20129 * channel will be re-enabled.
20131 * Returns an [`APIError::APIMisuseError`] if `funding_txo` does not match any currently
20132 * registered [`ChannelMonitor`]s.
20134 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);
20137 * Constructs a new Listen which calls the relevant methods on this_arg.
20138 * This copies the `inner` pointer in this_arg and thus the returned Listen must be freed before this_arg is
20140 struct LDKListen ChainMonitor_as_Listen(const struct LDKChainMonitor *NONNULL_PTR this_arg);
20143 * Constructs a new Confirm which calls the relevant methods on this_arg.
20144 * This copies the `inner` pointer in this_arg and thus the returned Confirm must be freed before this_arg is
20146 struct LDKConfirm ChainMonitor_as_Confirm(const struct LDKChainMonitor *NONNULL_PTR this_arg);
20149 * Constructs a new Watch which calls the relevant methods on this_arg.
20150 * This copies the `inner` pointer in this_arg and thus the returned Watch must be freed before this_arg is
20152 struct LDKWatch ChainMonitor_as_Watch(const struct LDKChainMonitor *NONNULL_PTR this_arg);
20155 * Constructs a new EventsProvider which calls the relevant methods on this_arg.
20156 * This copies the `inner` pointer in this_arg and thus the returned EventsProvider must be freed before this_arg is
20158 struct LDKEventsProvider ChainMonitor_as_EventsProvider(const struct LDKChainMonitor *NONNULL_PTR this_arg);
20161 * Frees any resources used by the ChannelMonitorUpdate, if is_owned is set and inner is non-NULL.
20163 void ChannelMonitorUpdate_free(struct LDKChannelMonitorUpdate this_obj);
20166 * The sequence number of this update. Updates *must* be replayed in-order according to this
20167 * sequence number (and updates may panic if they are not). The update_id values are strictly
20168 * increasing and increase by one for each new update, with one exception specified below.
20170 * This sequence number is also used to track up to which points updates which returned
20171 * ChannelMonitorUpdateErr::TemporaryFailure have been applied to all copies of a given
20172 * ChannelMonitor when ChannelManager::channel_monitor_updated is called.
20174 * The only instance where update_id values are not strictly increasing is the case where we
20175 * allow post-force-close updates with a special update ID of [`CLOSED_CHANNEL_UPDATE_ID`]. See
20176 * its docs for more details.
20178 uint64_t ChannelMonitorUpdate_get_update_id(const struct LDKChannelMonitorUpdate *NONNULL_PTR this_ptr);
20181 * The sequence number of this update. Updates *must* be replayed in-order according to this
20182 * sequence number (and updates may panic if they are not). The update_id values are strictly
20183 * increasing and increase by one for each new update, with one exception specified below.
20185 * This sequence number is also used to track up to which points updates which returned
20186 * ChannelMonitorUpdateErr::TemporaryFailure have been applied to all copies of a given
20187 * ChannelMonitor when ChannelManager::channel_monitor_updated is called.
20189 * The only instance where update_id values are not strictly increasing is the case where we
20190 * allow post-force-close updates with a special update ID of [`CLOSED_CHANNEL_UPDATE_ID`]. See
20191 * its docs for more details.
20193 void ChannelMonitorUpdate_set_update_id(struct LDKChannelMonitorUpdate *NONNULL_PTR this_ptr, uint64_t val);
20196 * Creates a copy of the ChannelMonitorUpdate
20198 struct LDKChannelMonitorUpdate ChannelMonitorUpdate_clone(const struct LDKChannelMonitorUpdate *NONNULL_PTR orig);
20201 * Serialize the ChannelMonitorUpdate object into a byte array which can be read by ChannelMonitorUpdate_read
20203 struct LDKCVec_u8Z ChannelMonitorUpdate_write(const struct LDKChannelMonitorUpdate *NONNULL_PTR obj);
20206 * Read a ChannelMonitorUpdate from a byte array, created by ChannelMonitorUpdate_write
20208 struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ ChannelMonitorUpdate_read(struct LDKu8slice ser);
20211 * Frees any resources used by the MonitorEvent
20213 void MonitorEvent_free(struct LDKMonitorEvent this_ptr);
20216 * Creates a copy of the MonitorEvent
20218 struct LDKMonitorEvent MonitorEvent_clone(const struct LDKMonitorEvent *NONNULL_PTR orig);
20221 * Utility method to constructs a new HTLCEvent-variant MonitorEvent
20223 struct LDKMonitorEvent MonitorEvent_htlcevent(struct LDKHTLCUpdate a);
20226 * Utility method to constructs a new CommitmentTxConfirmed-variant MonitorEvent
20228 struct LDKMonitorEvent MonitorEvent_commitment_tx_confirmed(struct LDKOutPoint a);
20231 * Utility method to constructs a new UpdateCompleted-variant MonitorEvent
20233 struct LDKMonitorEvent MonitorEvent_update_completed(struct LDKOutPoint funding_txo, uint64_t monitor_update_id);
20236 * Utility method to constructs a new UpdateFailed-variant MonitorEvent
20238 struct LDKMonitorEvent MonitorEvent_update_failed(struct LDKOutPoint a);
20241 * Serialize the MonitorEvent object into a byte array which can be read by MonitorEvent_read
20243 struct LDKCVec_u8Z MonitorEvent_write(const struct LDKMonitorEvent *NONNULL_PTR obj);
20246 * Read a MonitorEvent from a byte array, created by MonitorEvent_write
20248 struct LDKCResult_COption_MonitorEventZDecodeErrorZ MonitorEvent_read(struct LDKu8slice ser);
20251 * Frees any resources used by the HTLCUpdate, if is_owned is set and inner is non-NULL.
20253 void HTLCUpdate_free(struct LDKHTLCUpdate this_obj);
20256 * Creates a copy of the HTLCUpdate
20258 struct LDKHTLCUpdate HTLCUpdate_clone(const struct LDKHTLCUpdate *NONNULL_PTR orig);
20261 * Serialize the HTLCUpdate object into a byte array which can be read by HTLCUpdate_read
20263 struct LDKCVec_u8Z HTLCUpdate_write(const struct LDKHTLCUpdate *NONNULL_PTR obj);
20266 * Read a HTLCUpdate from a byte array, created by HTLCUpdate_write
20268 struct LDKCResult_HTLCUpdateDecodeErrorZ HTLCUpdate_read(struct LDKu8slice ser);
20271 * Frees any resources used by the Balance
20273 void Balance_free(struct LDKBalance this_ptr);
20276 * Creates a copy of the Balance
20278 struct LDKBalance Balance_clone(const struct LDKBalance *NONNULL_PTR orig);
20281 * Utility method to constructs a new ClaimableOnChannelClose-variant Balance
20283 struct LDKBalance Balance_claimable_on_channel_close(uint64_t claimable_amount_satoshis);
20286 * Utility method to constructs a new ClaimableAwaitingConfirmations-variant Balance
20288 struct LDKBalance Balance_claimable_awaiting_confirmations(uint64_t claimable_amount_satoshis, uint32_t confirmation_height);
20291 * Utility method to constructs a new ContentiousClaimable-variant Balance
20293 struct LDKBalance Balance_contentious_claimable(uint64_t claimable_amount_satoshis, uint32_t timeout_height);
20296 * Utility method to constructs a new MaybeTimeoutClaimableHTLC-variant Balance
20298 struct LDKBalance Balance_maybe_timeout_claimable_htlc(uint64_t claimable_amount_satoshis, uint32_t claimable_height);
20301 * Utility method to constructs a new MaybePreimageClaimableHTLC-variant Balance
20303 struct LDKBalance Balance_maybe_preimage_claimable_htlc(uint64_t claimable_amount_satoshis, uint32_t expiry_height);
20306 * Utility method to constructs a new CounterpartyRevokedOutputClaimable-variant Balance
20308 struct LDKBalance Balance_counterparty_revoked_output_claimable(uint64_t claimable_amount_satoshis);
20311 * Checks if two Balances contain equal inner contents.
20312 * This ignores pointers and is_owned flags and looks at the values in fields.
20314 bool Balance_eq(const struct LDKBalance *NONNULL_PTR a, const struct LDKBalance *NONNULL_PTR b);
20317 * Frees any resources used by the ChannelMonitor, if is_owned is set and inner is non-NULL.
20319 void ChannelMonitor_free(struct LDKChannelMonitor this_obj);
20322 * Serialize the ChannelMonitor object into a byte array which can be read by ChannelMonitor_read
20324 struct LDKCVec_u8Z ChannelMonitor_write(const struct LDKChannelMonitor *NONNULL_PTR obj);
20327 * Updates a ChannelMonitor on the basis of some new information provided by the Channel
20330 * panics if the given update is not the next update by update_id.
20332 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);
20335 * Gets the update_id from the latest ChannelMonitorUpdate which was applied to this
20338 MUST_USE_RES uint64_t ChannelMonitor_get_latest_update_id(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
20341 * Gets the funding transaction outpoint of the channel this ChannelMonitor is monitoring for.
20343 MUST_USE_RES struct LDKC2Tuple_OutPointScriptZ ChannelMonitor_get_funding_txo(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
20346 * Gets a list of txids, with their output scripts (in the order they appear in the
20347 * transaction), which we must learn about spends of via block_connected().
20349 MUST_USE_RES struct LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ ChannelMonitor_get_outputs_to_watch(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
20352 * Loads the funding txo and outputs to watch into the given `chain::Filter` by repeatedly
20353 * calling `chain::Filter::register_output` and `chain::Filter::register_tx` until all outputs
20354 * have been registered.
20356 void ChannelMonitor_load_outputs_to_watch(const struct LDKChannelMonitor *NONNULL_PTR this_arg, const struct LDKFilter *NONNULL_PTR filter);
20359 * Get the list of HTLCs who's status has been updated on chain. This should be called by
20360 * ChannelManager via [`chain::Watch::release_pending_monitor_events`].
20362 MUST_USE_RES struct LDKCVec_MonitorEventZ ChannelMonitor_get_and_clear_pending_monitor_events(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
20365 * Gets the list of pending events which were generated by previous actions, clearing the list
20368 * This is called by ChainMonitor::get_and_clear_pending_events() and is equivalent to
20369 * EventsProvider::get_and_clear_pending_events() except that it requires &mut self as we do
20370 * no internal locking in ChannelMonitors.
20372 MUST_USE_RES struct LDKCVec_EventZ ChannelMonitor_get_and_clear_pending_events(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
20375 * Gets the `node_id` of the counterparty for this channel.
20377 * Will be `None` for channels constructed on LDK versions prior to 0.0.110 and always `Some`
20380 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
20382 MUST_USE_RES struct LDKPublicKey ChannelMonitor_get_counterparty_node_id(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
20385 * Used by ChannelManager deserialization to broadcast the latest holder state if its copy of
20386 * the Channel was out-of-date. You may use it to get a broadcastable holder toxic tx in case of
20387 * fallen-behind, i.e when receiving a channel_reestablish with a proof that our counterparty side knows
20388 * a higher revocation secret than the holder commitment number we are aware of. Broadcasting these
20389 * transactions are UNSAFE, as they allow counterparty side to punish you. Nevertheless you may want to
20390 * broadcast them if counterparty don't close channel with his higher commitment transaction after a
20391 * substantial amount of time (a month or even a year) to get back funds. Best may be to contact
20392 * out-of-band the other node operator to coordinate with him if option is available to you.
20393 * In any-case, choice is up to the user.
20395 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);
20398 * Processes transactions in a newly connected block, which may result in any of the following:
20399 * - update the monitor's state against resolved HTLCs
20400 * - punish the counterparty in the case of seeing a revoked commitment transaction
20401 * - force close the channel and claim/timeout incoming/outgoing HTLCs if near expiration
20402 * - detect settled outputs for later spending
20403 * - schedule and bump any in-flight claims
20405 * Returns any new outputs to watch from `txdata`; after called, these are also included in
20406 * [`get_outputs_to_watch`].
20408 * [`get_outputs_to_watch`]: #method.get_outputs_to_watch
20410 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);
20413 * Determines if the disconnected block contained any transactions of interest and updates
20416 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);
20419 * Processes transactions confirmed in a block with the given header and height, returning new
20420 * outputs to watch. See [`block_connected`] for details.
20422 * Used instead of [`block_connected`] by clients that are notified of transactions rather than
20423 * blocks. See [`chain::Confirm`] for calling expectations.
20425 * [`block_connected`]: Self::block_connected
20427 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);
20430 * Processes a transaction that was reorganized out of the chain.
20432 * Used instead of [`block_disconnected`] by clients that are notified of transactions rather
20433 * than blocks. See [`chain::Confirm`] for calling expectations.
20435 * [`block_disconnected`]: Self::block_disconnected
20437 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);
20440 * Updates the monitor with the current best chain tip, returning new outputs to watch. See
20441 * [`block_connected`] for details.
20443 * Used instead of [`block_connected`] by clients that are notified of transactions rather than
20444 * blocks. See [`chain::Confirm`] for calling expectations.
20446 * [`block_connected`]: Self::block_connected
20448 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);
20451 * Returns the set of txids that should be monitored for re-organization out of the chain.
20453 MUST_USE_RES struct LDKCVec_TxidZ ChannelMonitor_get_relevant_txids(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
20456 * Gets the latest best block which was connected either via the [`chain::Listen`] or
20457 * [`chain::Confirm`] interfaces.
20459 MUST_USE_RES struct LDKBestBlock ChannelMonitor_current_best_block(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
20462 * Gets the balances in this channel which are either claimable by us if we were to
20463 * force-close the channel now or which are claimable on-chain (possibly awaiting
20466 * Any balances in the channel which are available on-chain (excluding on-chain fees) are
20467 * included here until an [`Event::SpendableOutputs`] event has been generated for the
20468 * balance, or until our counterparty has claimed the balance and accrued several
20469 * confirmations on the claim transaction.
20471 * Note that for `ChannelMonitors` which track a channel which went on-chain with versions of
20472 * LDK prior to 0.0.111, balances may not be fully captured if our counterparty broadcasted
20475 * See [`Balance`] for additional details on the types of claimable balances which
20476 * may be returned here and their meanings.
20478 MUST_USE_RES struct LDKCVec_BalanceZ ChannelMonitor_get_claimable_balances(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
20481 * Read a C2Tuple_BlockHashChannelMonitorZ from a byte array, created by C2Tuple_BlockHashChannelMonitorZ_write
20483 struct LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ C2Tuple_BlockHashChannelMonitorZ_read(struct LDKu8slice ser, const struct LDKKeysInterface *NONNULL_PTR arg);
20486 * Frees any resources used by the OutPoint, if is_owned is set and inner is non-NULL.
20488 void OutPoint_free(struct LDKOutPoint this_obj);
20491 * The referenced transaction's txid.
20493 const uint8_t (*OutPoint_get_txid(const struct LDKOutPoint *NONNULL_PTR this_ptr))[32];
20496 * The referenced transaction's txid.
20498 void OutPoint_set_txid(struct LDKOutPoint *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
20501 * The index of the referenced output in its transaction's vout.
20503 uint16_t OutPoint_get_index(const struct LDKOutPoint *NONNULL_PTR this_ptr);
20506 * The index of the referenced output in its transaction's vout.
20508 void OutPoint_set_index(struct LDKOutPoint *NONNULL_PTR this_ptr, uint16_t val);
20511 * Constructs a new OutPoint given each field
20513 MUST_USE_RES struct LDKOutPoint OutPoint_new(struct LDKThirtyTwoBytes txid_arg, uint16_t index_arg);
20516 * Creates a copy of the OutPoint
20518 struct LDKOutPoint OutPoint_clone(const struct LDKOutPoint *NONNULL_PTR orig);
20521 * Checks if two OutPoints contain equal inner contents.
20522 * This ignores pointers and is_owned flags and looks at the values in fields.
20523 * Two objects with NULL inner values will be considered "equal" here.
20525 bool OutPoint_eq(const struct LDKOutPoint *NONNULL_PTR a, const struct LDKOutPoint *NONNULL_PTR b);
20528 * Checks if two OutPoints contain equal inner contents.
20530 uint64_t OutPoint_hash(const struct LDKOutPoint *NONNULL_PTR o);
20533 * Convert an `OutPoint` to a lightning channel id.
20535 MUST_USE_RES struct LDKThirtyTwoBytes OutPoint_to_channel_id(const struct LDKOutPoint *NONNULL_PTR this_arg);
20538 * Serialize the OutPoint object into a byte array which can be read by OutPoint_read
20540 struct LDKCVec_u8Z OutPoint_write(const struct LDKOutPoint *NONNULL_PTR obj);
20543 * Read a OutPoint from a byte array, created by OutPoint_write
20545 struct LDKCResult_OutPointDecodeErrorZ OutPoint_read(struct LDKu8slice ser);
20548 * Frees any resources used by the DelayedPaymentOutputDescriptor, if is_owned is set and inner is non-NULL.
20550 void DelayedPaymentOutputDescriptor_free(struct LDKDelayedPaymentOutputDescriptor this_obj);
20553 * The outpoint which is spendable
20555 struct LDKOutPoint DelayedPaymentOutputDescriptor_get_outpoint(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr);
20558 * The outpoint which is spendable
20560 void DelayedPaymentOutputDescriptor_set_outpoint(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKOutPoint val);
20563 * Per commitment point to derive delayed_payment_key by key holder
20565 struct LDKPublicKey DelayedPaymentOutputDescriptor_get_per_commitment_point(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr);
20568 * Per commitment point to derive delayed_payment_key by key holder
20570 void DelayedPaymentOutputDescriptor_set_per_commitment_point(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKPublicKey val);
20573 * The nSequence value which must be set in the spending input to satisfy the OP_CSV in
20574 * the witness_script.
20576 uint16_t DelayedPaymentOutputDescriptor_get_to_self_delay(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr);
20579 * The nSequence value which must be set in the spending input to satisfy the OP_CSV in
20580 * the witness_script.
20582 void DelayedPaymentOutputDescriptor_set_to_self_delay(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, uint16_t val);
20585 * The output which is referenced by the given outpoint
20587 * Returns a copy of the field.
20589 struct LDKTxOut DelayedPaymentOutputDescriptor_get_output(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr);
20592 * The output which is referenced by the given outpoint
20594 void DelayedPaymentOutputDescriptor_set_output(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKTxOut val);
20597 * The revocation point specific to the commitment transaction which was broadcast. Used to
20598 * derive the witnessScript for this output.
20600 struct LDKPublicKey DelayedPaymentOutputDescriptor_get_revocation_pubkey(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr);
20603 * The revocation point specific to the commitment transaction which was broadcast. Used to
20604 * derive the witnessScript for this output.
20606 void DelayedPaymentOutputDescriptor_set_revocation_pubkey(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKPublicKey val);
20609 * Arbitrary identification information returned by a call to
20610 * `Sign::channel_keys_id()`. This may be useful in re-deriving keys used in
20611 * the channel to spend the output.
20613 const uint8_t (*DelayedPaymentOutputDescriptor_get_channel_keys_id(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr))[32];
20616 * Arbitrary identification information returned by a call to
20617 * `Sign::channel_keys_id()`. This may be useful in re-deriving keys used in
20618 * the channel to spend the output.
20620 void DelayedPaymentOutputDescriptor_set_channel_keys_id(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
20623 * The value of the channel which this output originated from, possibly indirectly.
20625 uint64_t DelayedPaymentOutputDescriptor_get_channel_value_satoshis(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr);
20628 * The value of the channel which this output originated from, possibly indirectly.
20630 void DelayedPaymentOutputDescriptor_set_channel_value_satoshis(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, uint64_t val);
20633 * Constructs a new DelayedPaymentOutputDescriptor given each field
20635 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);
20638 * Creates a copy of the DelayedPaymentOutputDescriptor
20640 struct LDKDelayedPaymentOutputDescriptor DelayedPaymentOutputDescriptor_clone(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR orig);
20643 * Serialize the DelayedPaymentOutputDescriptor object into a byte array which can be read by DelayedPaymentOutputDescriptor_read
20645 struct LDKCVec_u8Z DelayedPaymentOutputDescriptor_write(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR obj);
20648 * Read a DelayedPaymentOutputDescriptor from a byte array, created by DelayedPaymentOutputDescriptor_write
20650 struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ DelayedPaymentOutputDescriptor_read(struct LDKu8slice ser);
20653 * Frees any resources used by the StaticPaymentOutputDescriptor, if is_owned is set and inner is non-NULL.
20655 void StaticPaymentOutputDescriptor_free(struct LDKStaticPaymentOutputDescriptor this_obj);
20658 * The outpoint which is spendable
20660 struct LDKOutPoint StaticPaymentOutputDescriptor_get_outpoint(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr);
20663 * The outpoint which is spendable
20665 void StaticPaymentOutputDescriptor_set_outpoint(struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKOutPoint val);
20668 * The output which is referenced by the given outpoint
20670 * Returns a copy of the field.
20672 struct LDKTxOut StaticPaymentOutputDescriptor_get_output(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr);
20675 * The output which is referenced by the given outpoint
20677 void StaticPaymentOutputDescriptor_set_output(struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKTxOut val);
20680 * Arbitrary identification information returned by a call to
20681 * `Sign::channel_keys_id()`. This may be useful in re-deriving keys used in
20682 * the channel to spend the output.
20684 const uint8_t (*StaticPaymentOutputDescriptor_get_channel_keys_id(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr))[32];
20687 * Arbitrary identification information returned by a call to
20688 * `Sign::channel_keys_id()`. This may be useful in re-deriving keys used in
20689 * the channel to spend the output.
20691 void StaticPaymentOutputDescriptor_set_channel_keys_id(struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
20694 * The value of the channel which this transactions spends.
20696 uint64_t StaticPaymentOutputDescriptor_get_channel_value_satoshis(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr);
20699 * The value of the channel which this transactions spends.
20701 void StaticPaymentOutputDescriptor_set_channel_value_satoshis(struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr, uint64_t val);
20704 * Constructs a new StaticPaymentOutputDescriptor given each field
20706 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);
20709 * Creates a copy of the StaticPaymentOutputDescriptor
20711 struct LDKStaticPaymentOutputDescriptor StaticPaymentOutputDescriptor_clone(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR orig);
20714 * Serialize the StaticPaymentOutputDescriptor object into a byte array which can be read by StaticPaymentOutputDescriptor_read
20716 struct LDKCVec_u8Z StaticPaymentOutputDescriptor_write(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR obj);
20719 * Read a StaticPaymentOutputDescriptor from a byte array, created by StaticPaymentOutputDescriptor_write
20721 struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ StaticPaymentOutputDescriptor_read(struct LDKu8slice ser);
20724 * Frees any resources used by the SpendableOutputDescriptor
20726 void SpendableOutputDescriptor_free(struct LDKSpendableOutputDescriptor this_ptr);
20729 * Creates a copy of the SpendableOutputDescriptor
20731 struct LDKSpendableOutputDescriptor SpendableOutputDescriptor_clone(const struct LDKSpendableOutputDescriptor *NONNULL_PTR orig);
20734 * Utility method to constructs a new StaticOutput-variant SpendableOutputDescriptor
20736 struct LDKSpendableOutputDescriptor SpendableOutputDescriptor_static_output(struct LDKOutPoint outpoint, struct LDKTxOut output);
20739 * Utility method to constructs a new DelayedPaymentOutput-variant SpendableOutputDescriptor
20741 struct LDKSpendableOutputDescriptor SpendableOutputDescriptor_delayed_payment_output(struct LDKDelayedPaymentOutputDescriptor a);
20744 * Utility method to constructs a new StaticPaymentOutput-variant SpendableOutputDescriptor
20746 struct LDKSpendableOutputDescriptor SpendableOutputDescriptor_static_payment_output(struct LDKStaticPaymentOutputDescriptor a);
20749 * Serialize the SpendableOutputDescriptor object into a byte array which can be read by SpendableOutputDescriptor_read
20751 struct LDKCVec_u8Z SpendableOutputDescriptor_write(const struct LDKSpendableOutputDescriptor *NONNULL_PTR obj);
20754 * Read a SpendableOutputDescriptor from a byte array, created by SpendableOutputDescriptor_write
20756 struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ SpendableOutputDescriptor_read(struct LDKu8slice ser);
20759 * Calls the free function if one is set
20761 void BaseSign_free(struct LDKBaseSign this_ptr);
20764 * Creates a copy of a Sign
20766 struct LDKSign Sign_clone(const struct LDKSign *NONNULL_PTR orig);
20769 * Calls the free function if one is set
20771 void Sign_free(struct LDKSign this_ptr);
20774 * Creates a copy of the Recipient
20776 enum LDKRecipient Recipient_clone(const enum LDKRecipient *NONNULL_PTR orig);
20779 * Utility method to constructs a new Node-variant Recipient
20781 enum LDKRecipient Recipient_node(void);
20784 * Utility method to constructs a new PhantomNode-variant Recipient
20786 enum LDKRecipient Recipient_phantom_node(void);
20789 * Calls the free function if one is set
20791 void KeysInterface_free(struct LDKKeysInterface this_ptr);
20794 * Frees any resources used by the InMemorySigner, if is_owned is set and inner is non-NULL.
20796 void InMemorySigner_free(struct LDKInMemorySigner this_obj);
20799 * Private key of anchor tx
20801 const uint8_t (*InMemorySigner_get_funding_key(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32];
20804 * Private key of anchor tx
20806 void InMemorySigner_set_funding_key(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKSecretKey val);
20809 * Holder secret key for blinded revocation pubkey
20811 const uint8_t (*InMemorySigner_get_revocation_base_key(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32];
20814 * Holder secret key for blinded revocation pubkey
20816 void InMemorySigner_set_revocation_base_key(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKSecretKey val);
20819 * Holder secret key used for our balance in counterparty-broadcasted commitment transactions
20821 const uint8_t (*InMemorySigner_get_payment_key(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32];
20824 * Holder secret key used for our balance in counterparty-broadcasted commitment transactions
20826 void InMemorySigner_set_payment_key(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKSecretKey val);
20829 * Holder secret key used in HTLC tx
20831 const uint8_t (*InMemorySigner_get_delayed_payment_base_key(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32];
20834 * Holder secret key used in HTLC tx
20836 void InMemorySigner_set_delayed_payment_base_key(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKSecretKey val);
20839 * Holder htlc secret key used in commitment tx htlc outputs
20841 const uint8_t (*InMemorySigner_get_htlc_base_key(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32];
20844 * Holder htlc secret key used in commitment tx htlc outputs
20846 void InMemorySigner_set_htlc_base_key(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKSecretKey val);
20851 const uint8_t (*InMemorySigner_get_commitment_seed(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32];
20856 void InMemorySigner_set_commitment_seed(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
20859 * Creates a copy of the InMemorySigner
20861 struct LDKInMemorySigner InMemorySigner_clone(const struct LDKInMemorySigner *NONNULL_PTR orig);
20864 * Create a new InMemorySigner
20866 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);
20869 * Counterparty pubkeys.
20870 * Will panic if ready_channel wasn't called.
20872 MUST_USE_RES struct LDKChannelPublicKeys InMemorySigner_counterparty_pubkeys(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
20875 * The contest_delay value specified by our counterparty and applied on holder-broadcastable
20876 * transactions, ie the amount of time that we have to wait to recover our funds if we
20877 * broadcast a transaction.
20878 * Will panic if ready_channel wasn't called.
20880 MUST_USE_RES uint16_t InMemorySigner_counterparty_selected_contest_delay(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
20883 * The contest_delay value specified by us and applied on transactions broadcastable
20884 * by our counterparty, ie the amount of time that they have to wait to recover their funds
20885 * if they broadcast a transaction.
20886 * Will panic if ready_channel wasn't called.
20888 MUST_USE_RES uint16_t InMemorySigner_holder_selected_contest_delay(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
20891 * Whether the holder is the initiator
20892 * Will panic if ready_channel wasn't called.
20894 MUST_USE_RES bool InMemorySigner_is_outbound(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
20898 * Will panic if ready_channel wasn't called.
20900 MUST_USE_RES struct LDKOutPoint InMemorySigner_funding_outpoint(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
20903 * Obtain a ChannelTransactionParameters for this channel, to be used when verifying or
20904 * building transactions.
20906 * Will panic if ready_channel wasn't called.
20908 MUST_USE_RES struct LDKChannelTransactionParameters InMemorySigner_get_channel_parameters(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
20911 * Whether anchors should be used.
20912 * Will panic if ready_channel wasn't called.
20914 MUST_USE_RES bool InMemorySigner_opt_anchors(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
20917 * Sign the single input of spend_tx at index `input_idx` which spends the output
20918 * described by descriptor, returning the witness stack for the input.
20920 * Returns an Err if the input at input_idx does not exist, has a non-empty script_sig,
20921 * is not spending the outpoint described by `descriptor.outpoint`,
20922 * or if an output descriptor script_pubkey does not match the one we can spend.
20924 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);
20927 * Sign the single input of spend_tx at index `input_idx` which spends the output
20928 * described by descriptor, returning the witness stack for the input.
20930 * Returns an Err if the input at input_idx does not exist, has a non-empty script_sig,
20931 * is not spending the outpoint described by `descriptor.outpoint`, does not have a
20932 * sequence set to `descriptor.to_self_delay`, or if an output descriptor
20933 * script_pubkey does not match the one we can spend.
20935 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);
20938 * Constructs a new BaseSign which calls the relevant methods on this_arg.
20939 * This copies the `inner` pointer in this_arg and thus the returned BaseSign must be freed before this_arg is
20941 struct LDKBaseSign InMemorySigner_as_BaseSign(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
20944 * Constructs a new Sign which calls the relevant methods on this_arg.
20945 * This copies the `inner` pointer in this_arg and thus the returned Sign must be freed before this_arg is
20947 struct LDKSign InMemorySigner_as_Sign(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
20950 * Serialize the InMemorySigner object into a byte array which can be read by InMemorySigner_read
20952 struct LDKCVec_u8Z InMemorySigner_write(const struct LDKInMemorySigner *NONNULL_PTR obj);
20955 * Read a InMemorySigner from a byte array, created by InMemorySigner_write
20957 struct LDKCResult_InMemorySignerDecodeErrorZ InMemorySigner_read(struct LDKu8slice ser, struct LDKSecretKey arg);
20960 * Frees any resources used by the KeysManager, if is_owned is set and inner is non-NULL.
20962 void KeysManager_free(struct LDKKeysManager this_obj);
20965 * Constructs a KeysManager from a 32-byte seed. If the seed is in some way biased (eg your
20966 * CSRNG is busted) this may panic (but more importantly, you will possibly lose funds).
20967 * starting_time isn't strictly required to actually be a time, but it must absolutely,
20968 * without a doubt, be unique to this instance. ie if you start multiple times with the same
20969 * seed, starting_time must be unique to each run. Thus, the easiest way to achieve this is to
20970 * simply use the current time (with very high precision).
20972 * The seed MUST be backed up safely prior to use so that the keys can be re-created, however,
20973 * obviously, starting_time should be unique every time you reload the library - it is only
20974 * used to generate new ephemeral key data (which will be stored by the individual channel if
20977 * Note that the seed is required to recover certain on-chain funds independent of
20978 * ChannelMonitor data, though a current copy of ChannelMonitor data is also required for any
20979 * channel, and some on-chain during-closing funds.
20981 * Note that until the 0.1 release there is no guarantee of backward compatibility between
20982 * versions. Once the library is more fully supported, the docs will be updated to include a
20983 * detailed description of the guarantee.
20985 MUST_USE_RES struct LDKKeysManager KeysManager_new(const uint8_t (*seed)[32], uint64_t starting_time_secs, uint32_t starting_time_nanos);
20988 * Derive an old Sign containing per-channel secrets based on a key derivation parameters.
20990 * Key derivation parameters are accessible through a per-channel secrets
20991 * Sign::channel_keys_id and is provided inside DynamicOuputP2WSH in case of
20992 * onchain output detection for which a corresponding delayed_payment_key must be derived.
20994 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]);
20997 * Creates a Transaction which spends the given descriptors to the given outputs, plus an
20998 * output to the given change destination (if sufficient change value remains). The
20999 * transaction will have a feerate, at least, of the given value.
21001 * Returns `Err(())` if the output value is greater than the input value minus required fee,
21002 * if a descriptor was duplicated, or if an output descriptor `script_pubkey`
21003 * does not match the one we can spend.
21005 * We do not enforce that outputs meet the dust limit or that any output scripts are standard.
21007 * May panic if the `SpendableOutputDescriptor`s were not generated by Channels which used
21008 * this KeysManager or one of the `InMemorySigner` created by this KeysManager.
21010 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);
21013 * Constructs a new KeysInterface which calls the relevant methods on this_arg.
21014 * This copies the `inner` pointer in this_arg and thus the returned KeysInterface must be freed before this_arg is
21016 struct LDKKeysInterface KeysManager_as_KeysInterface(const struct LDKKeysManager *NONNULL_PTR this_arg);
21019 * Frees any resources used by the PhantomKeysManager, if is_owned is set and inner is non-NULL.
21021 void PhantomKeysManager_free(struct LDKPhantomKeysManager this_obj);
21024 * Constructs a new KeysInterface which calls the relevant methods on this_arg.
21025 * This copies the `inner` pointer in this_arg and thus the returned KeysInterface must be freed before this_arg is
21027 struct LDKKeysInterface PhantomKeysManager_as_KeysInterface(const struct LDKPhantomKeysManager *NONNULL_PTR this_arg);
21030 * Constructs a `PhantomKeysManager` given a 32-byte seed and an additional `cross_node_seed`
21031 * that is shared across all nodes that intend to participate in [phantom node payments] together.
21033 * See [`KeysManager::new`] for more information on `seed`, `starting_time_secs`, and
21034 * `starting_time_nanos`.
21036 * `cross_node_seed` must be the same across all phantom payment-receiving nodes and also the
21037 * same across restarts, or else inbound payments may fail.
21039 * [phantom node payments]: PhantomKeysManager
21041 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]);
21044 * See [`KeysManager::spend_spendable_outputs`] for documentation on this method.
21046 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);
21049 * See [`KeysManager::derive_channel_keys`] for documentation on this method.
21051 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]);
21054 * Frees any resources used by the ChannelManager, if is_owned is set and inner is non-NULL.
21056 void ChannelManager_free(struct LDKChannelManager this_obj);
21059 * Frees any resources used by the ChainParameters, if is_owned is set and inner is non-NULL.
21061 void ChainParameters_free(struct LDKChainParameters this_obj);
21064 * The network for determining the `chain_hash` in Lightning messages.
21066 enum LDKNetwork ChainParameters_get_network(const struct LDKChainParameters *NONNULL_PTR this_ptr);
21069 * The network for determining the `chain_hash` in Lightning messages.
21071 void ChainParameters_set_network(struct LDKChainParameters *NONNULL_PTR this_ptr, enum LDKNetwork val);
21074 * The hash and height of the latest block successfully connected.
21076 * Used to track on-chain channel funding outputs and send payments with reliable timelocks.
21078 struct LDKBestBlock ChainParameters_get_best_block(const struct LDKChainParameters *NONNULL_PTR this_ptr);
21081 * The hash and height of the latest block successfully connected.
21083 * Used to track on-chain channel funding outputs and send payments with reliable timelocks.
21085 void ChainParameters_set_best_block(struct LDKChainParameters *NONNULL_PTR this_ptr, struct LDKBestBlock val);
21088 * Constructs a new ChainParameters given each field
21090 MUST_USE_RES struct LDKChainParameters ChainParameters_new(enum LDKNetwork network_arg, struct LDKBestBlock best_block_arg);
21093 * Creates a copy of the ChainParameters
21095 struct LDKChainParameters ChainParameters_clone(const struct LDKChainParameters *NONNULL_PTR orig);
21098 * Frees any resources used by the CounterpartyForwardingInfo, if is_owned is set and inner is non-NULL.
21100 void CounterpartyForwardingInfo_free(struct LDKCounterpartyForwardingInfo this_obj);
21103 * Base routing fee in millisatoshis.
21105 uint32_t CounterpartyForwardingInfo_get_fee_base_msat(const struct LDKCounterpartyForwardingInfo *NONNULL_PTR this_ptr);
21108 * Base routing fee in millisatoshis.
21110 void CounterpartyForwardingInfo_set_fee_base_msat(struct LDKCounterpartyForwardingInfo *NONNULL_PTR this_ptr, uint32_t val);
21113 * Amount in millionths of a satoshi the channel will charge per transferred satoshi.
21115 uint32_t CounterpartyForwardingInfo_get_fee_proportional_millionths(const struct LDKCounterpartyForwardingInfo *NONNULL_PTR this_ptr);
21118 * Amount in millionths of a satoshi the channel will charge per transferred satoshi.
21120 void CounterpartyForwardingInfo_set_fee_proportional_millionths(struct LDKCounterpartyForwardingInfo *NONNULL_PTR this_ptr, uint32_t val);
21123 * The minimum difference in cltv_expiry between an ingoing HTLC and its outgoing counterpart,
21124 * such that the outgoing HTLC is forwardable to this counterparty. See `msgs::ChannelUpdate`'s
21125 * `cltv_expiry_delta` for more details.
21127 uint16_t CounterpartyForwardingInfo_get_cltv_expiry_delta(const struct LDKCounterpartyForwardingInfo *NONNULL_PTR this_ptr);
21130 * The minimum difference in cltv_expiry between an ingoing HTLC and its outgoing counterpart,
21131 * such that the outgoing HTLC is forwardable to this counterparty. See `msgs::ChannelUpdate`'s
21132 * `cltv_expiry_delta` for more details.
21134 void CounterpartyForwardingInfo_set_cltv_expiry_delta(struct LDKCounterpartyForwardingInfo *NONNULL_PTR this_ptr, uint16_t val);
21137 * Constructs a new CounterpartyForwardingInfo given each field
21139 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);
21142 * Creates a copy of the CounterpartyForwardingInfo
21144 struct LDKCounterpartyForwardingInfo CounterpartyForwardingInfo_clone(const struct LDKCounterpartyForwardingInfo *NONNULL_PTR orig);
21147 * Frees any resources used by the ChannelCounterparty, if is_owned is set and inner is non-NULL.
21149 void ChannelCounterparty_free(struct LDKChannelCounterparty this_obj);
21152 * The node_id of our counterparty
21154 struct LDKPublicKey ChannelCounterparty_get_node_id(const struct LDKChannelCounterparty *NONNULL_PTR this_ptr);
21157 * The node_id of our counterparty
21159 void ChannelCounterparty_set_node_id(struct LDKChannelCounterparty *NONNULL_PTR this_ptr, struct LDKPublicKey val);
21162 * The Features the channel counterparty provided upon last connection.
21163 * Useful for routing as it is the most up-to-date copy of the counterparty's features and
21164 * many routing-relevant features are present in the init context.
21166 struct LDKInitFeatures ChannelCounterparty_get_features(const struct LDKChannelCounterparty *NONNULL_PTR this_ptr);
21169 * The Features the channel counterparty provided upon last connection.
21170 * Useful for routing as it is the most up-to-date copy of the counterparty's features and
21171 * many routing-relevant features are present in the init context.
21173 void ChannelCounterparty_set_features(struct LDKChannelCounterparty *NONNULL_PTR this_ptr, struct LDKInitFeatures val);
21176 * The value, in satoshis, that must always be held in the channel for our counterparty. This
21177 * value ensures that if our counterparty broadcasts a revoked state, we can punish them by
21178 * claiming at least this value on chain.
21180 * This value is not included in [`inbound_capacity_msat`] as it can never be spent.
21182 * [`inbound_capacity_msat`]: ChannelDetails::inbound_capacity_msat
21184 uint64_t ChannelCounterparty_get_unspendable_punishment_reserve(const struct LDKChannelCounterparty *NONNULL_PTR this_ptr);
21187 * The value, in satoshis, that must always be held in the channel for our counterparty. This
21188 * value ensures that if our counterparty broadcasts a revoked state, we can punish them by
21189 * claiming at least this value on chain.
21191 * This value is not included in [`inbound_capacity_msat`] as it can never be spent.
21193 * [`inbound_capacity_msat`]: ChannelDetails::inbound_capacity_msat
21195 void ChannelCounterparty_set_unspendable_punishment_reserve(struct LDKChannelCounterparty *NONNULL_PTR this_ptr, uint64_t val);
21198 * Information on the fees and requirements that the counterparty requires when forwarding
21199 * payments to us through this channel.
21201 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
21203 struct LDKCounterpartyForwardingInfo ChannelCounterparty_get_forwarding_info(const struct LDKChannelCounterparty *NONNULL_PTR this_ptr);
21206 * Information on the fees and requirements that the counterparty requires when forwarding
21207 * payments to us through this channel.
21209 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
21211 void ChannelCounterparty_set_forwarding_info(struct LDKChannelCounterparty *NONNULL_PTR this_ptr, struct LDKCounterpartyForwardingInfo val);
21214 * The smallest value HTLC (in msat) the remote peer will accept, for this channel. This field
21215 * is only `None` before we have received either the `OpenChannel` or `AcceptChannel` message
21216 * from the remote peer, or for `ChannelCounterparty` objects serialized prior to LDK 0.0.107.
21218 struct LDKCOption_u64Z ChannelCounterparty_get_outbound_htlc_minimum_msat(const struct LDKChannelCounterparty *NONNULL_PTR this_ptr);
21221 * The smallest value HTLC (in msat) the remote peer will accept, for this channel. This field
21222 * is only `None` before we have received either the `OpenChannel` or `AcceptChannel` message
21223 * from the remote peer, or for `ChannelCounterparty` objects serialized prior to LDK 0.0.107.
21225 void ChannelCounterparty_set_outbound_htlc_minimum_msat(struct LDKChannelCounterparty *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
21228 * The largest value HTLC (in msat) the remote peer currently will accept, for this channel.
21230 struct LDKCOption_u64Z ChannelCounterparty_get_outbound_htlc_maximum_msat(const struct LDKChannelCounterparty *NONNULL_PTR this_ptr);
21233 * The largest value HTLC (in msat) the remote peer currently will accept, for this channel.
21235 void ChannelCounterparty_set_outbound_htlc_maximum_msat(struct LDKChannelCounterparty *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
21238 * Constructs a new ChannelCounterparty given each field
21240 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);
21243 * Creates a copy of the ChannelCounterparty
21245 struct LDKChannelCounterparty ChannelCounterparty_clone(const struct LDKChannelCounterparty *NONNULL_PTR orig);
21248 * Frees any resources used by the ChannelDetails, if is_owned is set and inner is non-NULL.
21250 void ChannelDetails_free(struct LDKChannelDetails this_obj);
21253 * The channel's ID (prior to funding transaction generation, this is a random 32 bytes,
21254 * thereafter this is the txid of the funding transaction xor the funding transaction output).
21255 * Note that this means this value is *not* persistent - it can change once during the
21256 * lifetime of the channel.
21258 const uint8_t (*ChannelDetails_get_channel_id(const struct LDKChannelDetails *NONNULL_PTR this_ptr))[32];
21261 * The channel's ID (prior to funding transaction generation, this is a random 32 bytes,
21262 * thereafter this is the txid of the funding transaction xor the funding transaction output).
21263 * Note that this means this value is *not* persistent - it can change once during the
21264 * lifetime of the channel.
21266 void ChannelDetails_set_channel_id(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
21269 * Parameters which apply to our counterparty. See individual fields for more information.
21271 struct LDKChannelCounterparty ChannelDetails_get_counterparty(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
21274 * Parameters which apply to our counterparty. See individual fields for more information.
21276 void ChannelDetails_set_counterparty(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKChannelCounterparty val);
21279 * The Channel's funding transaction output, if we've negotiated the funding transaction with
21280 * our counterparty already.
21282 * Note that, if this has been set, `channel_id` will be equivalent to
21283 * `funding_txo.unwrap().to_channel_id()`.
21285 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
21287 struct LDKOutPoint ChannelDetails_get_funding_txo(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
21290 * The Channel's funding transaction output, if we've negotiated the funding transaction with
21291 * our counterparty already.
21293 * Note that, if this has been set, `channel_id` will be equivalent to
21294 * `funding_txo.unwrap().to_channel_id()`.
21296 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
21298 void ChannelDetails_set_funding_txo(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKOutPoint val);
21301 * The features which this channel operates with. See individual features for more info.
21303 * `None` until negotiation completes and the channel type is finalized.
21305 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
21307 struct LDKChannelTypeFeatures ChannelDetails_get_channel_type(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
21310 * The features which this channel operates with. See individual features for more info.
21312 * `None` until negotiation completes and the channel type is finalized.
21314 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
21316 void ChannelDetails_set_channel_type(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKChannelTypeFeatures val);
21319 * The position of the funding transaction in the chain. None if the funding transaction has
21320 * not yet been confirmed and the channel fully opened.
21322 * Note that if [`inbound_scid_alias`] is set, it must be used for invoices and inbound
21323 * payments instead of this. See [`get_inbound_payment_scid`].
21325 * For channels with [`confirmations_required`] set to `Some(0)`, [`outbound_scid_alias`] may
21326 * be used in place of this in outbound routes. See [`get_outbound_payment_scid`].
21328 * [`inbound_scid_alias`]: Self::inbound_scid_alias
21329 * [`outbound_scid_alias`]: Self::outbound_scid_alias
21330 * [`get_inbound_payment_scid`]: Self::get_inbound_payment_scid
21331 * [`get_outbound_payment_scid`]: Self::get_outbound_payment_scid
21332 * [`confirmations_required`]: Self::confirmations_required
21334 struct LDKCOption_u64Z ChannelDetails_get_short_channel_id(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
21337 * The position of the funding transaction in the chain. None if the funding transaction has
21338 * not yet been confirmed and the channel fully opened.
21340 * Note that if [`inbound_scid_alias`] is set, it must be used for invoices and inbound
21341 * payments instead of this. See [`get_inbound_payment_scid`].
21343 * For channels with [`confirmations_required`] set to `Some(0)`, [`outbound_scid_alias`] may
21344 * be used in place of this in outbound routes. See [`get_outbound_payment_scid`].
21346 * [`inbound_scid_alias`]: Self::inbound_scid_alias
21347 * [`outbound_scid_alias`]: Self::outbound_scid_alias
21348 * [`get_inbound_payment_scid`]: Self::get_inbound_payment_scid
21349 * [`get_outbound_payment_scid`]: Self::get_outbound_payment_scid
21350 * [`confirmations_required`]: Self::confirmations_required
21352 void ChannelDetails_set_short_channel_id(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
21355 * An optional [`short_channel_id`] alias for this channel, randomly generated by us and
21356 * usable in place of [`short_channel_id`] to reference the channel in outbound routes when
21357 * the channel has not yet been confirmed (as long as [`confirmations_required`] is
21360 * This will be `None` as long as the channel is not available for routing outbound payments.
21362 * [`short_channel_id`]: Self::short_channel_id
21363 * [`confirmations_required`]: Self::confirmations_required
21365 struct LDKCOption_u64Z ChannelDetails_get_outbound_scid_alias(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
21368 * An optional [`short_channel_id`] alias for this channel, randomly generated by us and
21369 * usable in place of [`short_channel_id`] to reference the channel in outbound routes when
21370 * the channel has not yet been confirmed (as long as [`confirmations_required`] is
21373 * This will be `None` as long as the channel is not available for routing outbound payments.
21375 * [`short_channel_id`]: Self::short_channel_id
21376 * [`confirmations_required`]: Self::confirmations_required
21378 void ChannelDetails_set_outbound_scid_alias(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
21381 * An optional [`short_channel_id`] alias for this channel, randomly generated by our
21382 * counterparty and usable in place of [`short_channel_id`] in invoice route hints. Our
21383 * counterparty will recognize the alias provided here in place of the [`short_channel_id`]
21384 * when they see a payment to be routed to us.
21386 * Our counterparty may choose to rotate this value at any time, though will always recognize
21387 * previous values for inbound payment forwarding.
21389 * [`short_channel_id`]: Self::short_channel_id
21391 struct LDKCOption_u64Z ChannelDetails_get_inbound_scid_alias(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
21394 * An optional [`short_channel_id`] alias for this channel, randomly generated by our
21395 * counterparty and usable in place of [`short_channel_id`] in invoice route hints. Our
21396 * counterparty will recognize the alias provided here in place of the [`short_channel_id`]
21397 * when they see a payment to be routed to us.
21399 * Our counterparty may choose to rotate this value at any time, though will always recognize
21400 * previous values for inbound payment forwarding.
21402 * [`short_channel_id`]: Self::short_channel_id
21404 void ChannelDetails_set_inbound_scid_alias(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
21407 * The value, in satoshis, of this channel as appears in the funding output
21409 uint64_t ChannelDetails_get_channel_value_satoshis(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
21412 * The value, in satoshis, of this channel as appears in the funding output
21414 void ChannelDetails_set_channel_value_satoshis(struct LDKChannelDetails *NONNULL_PTR this_ptr, uint64_t val);
21417 * The value, in satoshis, that must always be held in the channel for us. This value ensures
21418 * that if we broadcast a revoked state, our counterparty can punish us by claiming at least
21419 * this value on chain.
21421 * This value is not included in [`outbound_capacity_msat`] as it can never be spent.
21423 * This value will be `None` for outbound channels until the counterparty accepts the channel.
21425 * [`outbound_capacity_msat`]: ChannelDetails::outbound_capacity_msat
21427 struct LDKCOption_u64Z ChannelDetails_get_unspendable_punishment_reserve(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
21430 * The value, in satoshis, that must always be held in the channel for us. This value ensures
21431 * that if we broadcast a revoked state, our counterparty can punish us by claiming at least
21432 * this value on chain.
21434 * This value is not included in [`outbound_capacity_msat`] as it can never be spent.
21436 * This value will be `None` for outbound channels until the counterparty accepts the channel.
21438 * [`outbound_capacity_msat`]: ChannelDetails::outbound_capacity_msat
21440 void ChannelDetails_set_unspendable_punishment_reserve(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
21443 * The `user_channel_id` passed in to create_channel, or 0 if the channel was inbound.
21445 uint64_t ChannelDetails_get_user_channel_id(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
21448 * The `user_channel_id` passed in to create_channel, or 0 if the channel was inbound.
21450 void ChannelDetails_set_user_channel_id(struct LDKChannelDetails *NONNULL_PTR this_ptr, uint64_t val);
21453 * Our total balance. This is the amount we would get if we close the channel.
21454 * This value is not exact. Due to various in-flight changes and feerate changes, exactly this
21455 * amount is not likely to be recoverable on close.
21457 * This does not include any pending HTLCs which are not yet fully resolved (and, thus, whose
21458 * balance is not available for inclusion in new outbound HTLCs). This further does not include
21459 * any pending outgoing HTLCs which are awaiting some other resolution to be sent.
21460 * This does not consider any on-chain fees.
21462 * See also [`ChannelDetails::outbound_capacity_msat`]
21464 uint64_t ChannelDetails_get_balance_msat(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
21467 * Our total balance. This is the amount we would get if we close the channel.
21468 * This value is not exact. Due to various in-flight changes and feerate changes, exactly this
21469 * amount is not likely to be recoverable on close.
21471 * This does not include any pending HTLCs which are not yet fully resolved (and, thus, whose
21472 * balance is not available for inclusion in new outbound HTLCs). This further does not include
21473 * any pending outgoing HTLCs which are awaiting some other resolution to be sent.
21474 * This does not consider any on-chain fees.
21476 * See also [`ChannelDetails::outbound_capacity_msat`]
21478 void ChannelDetails_set_balance_msat(struct LDKChannelDetails *NONNULL_PTR this_ptr, uint64_t val);
21481 * The available outbound capacity for sending HTLCs to the remote peer. This does not include
21482 * any pending HTLCs which are not yet fully resolved (and, thus, whose balance is not
21483 * available for inclusion in new outbound HTLCs). This further does not include any pending
21484 * outgoing HTLCs which are awaiting some other resolution to be sent.
21486 * See also [`ChannelDetails::balance_msat`]
21488 * This value is not exact. Due to various in-flight changes, feerate changes, and our
21489 * conflict-avoidance policy, exactly this amount is not likely to be spendable. However, we
21490 * should be able to spend nearly this amount.
21492 uint64_t ChannelDetails_get_outbound_capacity_msat(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
21495 * The available outbound capacity for sending HTLCs to the remote peer. This does not include
21496 * any pending HTLCs which are not yet fully resolved (and, thus, whose balance is not
21497 * available for inclusion in new outbound HTLCs). This further does not include any pending
21498 * outgoing HTLCs which are awaiting some other resolution to be sent.
21500 * See also [`ChannelDetails::balance_msat`]
21502 * This value is not exact. Due to various in-flight changes, feerate changes, and our
21503 * conflict-avoidance policy, exactly this amount is not likely to be spendable. However, we
21504 * should be able to spend nearly this amount.
21506 void ChannelDetails_set_outbound_capacity_msat(struct LDKChannelDetails *NONNULL_PTR this_ptr, uint64_t val);
21509 * The available outbound capacity for sending a single HTLC to the remote peer. This is
21510 * similar to [`ChannelDetails::outbound_capacity_msat`] but it may be further restricted by
21511 * the current state and per-HTLC limit(s). This is intended for use when routing, allowing us
21512 * to use a limit as close as possible to the HTLC limit we can currently send.
21514 * See also [`ChannelDetails::balance_msat`] and [`ChannelDetails::outbound_capacity_msat`].
21516 uint64_t ChannelDetails_get_next_outbound_htlc_limit_msat(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
21519 * The available outbound capacity for sending a single HTLC to the remote peer. This is
21520 * similar to [`ChannelDetails::outbound_capacity_msat`] but it may be further restricted by
21521 * the current state and per-HTLC limit(s). This is intended for use when routing, allowing us
21522 * to use a limit as close as possible to the HTLC limit we can currently send.
21524 * See also [`ChannelDetails::balance_msat`] and [`ChannelDetails::outbound_capacity_msat`].
21526 void ChannelDetails_set_next_outbound_htlc_limit_msat(struct LDKChannelDetails *NONNULL_PTR this_ptr, uint64_t val);
21529 * The available inbound capacity for the remote peer to send HTLCs to us. This does not
21530 * include any pending HTLCs which are not yet fully resolved (and, thus, whose balance is not
21531 * available for inclusion in new inbound HTLCs).
21532 * Note that there are some corner cases not fully handled here, so the actual available
21533 * inbound capacity may be slightly higher than this.
21535 * This value is not exact. Due to various in-flight changes, feerate changes, and our
21536 * counterparty's conflict-avoidance policy, exactly this amount is not likely to be spendable.
21537 * However, our counterparty should be able to spend nearly this amount.
21539 uint64_t ChannelDetails_get_inbound_capacity_msat(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
21542 * The available inbound capacity for the remote peer to send HTLCs to us. This does not
21543 * include any pending HTLCs which are not yet fully resolved (and, thus, whose balance is not
21544 * available for inclusion in new inbound HTLCs).
21545 * Note that there are some corner cases not fully handled here, so the actual available
21546 * inbound capacity may be slightly higher than this.
21548 * This value is not exact. Due to various in-flight changes, feerate changes, and our
21549 * counterparty's conflict-avoidance policy, exactly this amount is not likely to be spendable.
21550 * However, our counterparty should be able to spend nearly this amount.
21552 void ChannelDetails_set_inbound_capacity_msat(struct LDKChannelDetails *NONNULL_PTR this_ptr, uint64_t val);
21555 * The number of required confirmations on the funding transaction before the funding will be
21556 * considered \"locked\". This number is selected by the channel fundee (i.e. us if
21557 * [`is_outbound`] is *not* set), and can be selected for inbound channels with
21558 * [`ChannelHandshakeConfig::minimum_depth`] or limited for outbound channels with
21559 * [`ChannelHandshakeLimits::max_minimum_depth`].
21561 * This value will be `None` for outbound channels until the counterparty accepts the channel.
21563 * [`is_outbound`]: ChannelDetails::is_outbound
21564 * [`ChannelHandshakeConfig::minimum_depth`]: crate::util::config::ChannelHandshakeConfig::minimum_depth
21565 * [`ChannelHandshakeLimits::max_minimum_depth`]: crate::util::config::ChannelHandshakeLimits::max_minimum_depth
21567 struct LDKCOption_u32Z ChannelDetails_get_confirmations_required(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
21570 * The number of required confirmations on the funding transaction before the funding will be
21571 * considered \"locked\". This number is selected by the channel fundee (i.e. us if
21572 * [`is_outbound`] is *not* set), and can be selected for inbound channels with
21573 * [`ChannelHandshakeConfig::minimum_depth`] or limited for outbound channels with
21574 * [`ChannelHandshakeLimits::max_minimum_depth`].
21576 * This value will be `None` for outbound channels until the counterparty accepts the channel.
21578 * [`is_outbound`]: ChannelDetails::is_outbound
21579 * [`ChannelHandshakeConfig::minimum_depth`]: crate::util::config::ChannelHandshakeConfig::minimum_depth
21580 * [`ChannelHandshakeLimits::max_minimum_depth`]: crate::util::config::ChannelHandshakeLimits::max_minimum_depth
21582 void ChannelDetails_set_confirmations_required(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u32Z val);
21585 * The number of blocks (after our commitment transaction confirms) that we will need to wait
21586 * until we can claim our funds after we force-close the channel. During this time our
21587 * counterparty is allowed to punish us if we broadcasted a stale state. If our counterparty
21588 * force-closes the channel and broadcasts a commitment transaction we do not have to wait any
21589 * time to claim our non-HTLC-encumbered funds.
21591 * This value will be `None` for outbound channels until the counterparty accepts the channel.
21593 struct LDKCOption_u16Z ChannelDetails_get_force_close_spend_delay(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
21596 * The number of blocks (after our commitment transaction confirms) that we will need to wait
21597 * until we can claim our funds after we force-close the channel. During this time our
21598 * counterparty is allowed to punish us if we broadcasted a stale state. If our counterparty
21599 * force-closes the channel and broadcasts a commitment transaction we do not have to wait any
21600 * time to claim our non-HTLC-encumbered funds.
21602 * This value will be `None` for outbound channels until the counterparty accepts the channel.
21604 void ChannelDetails_set_force_close_spend_delay(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u16Z val);
21607 * True if the channel was initiated (and thus funded) by us.
21609 bool ChannelDetails_get_is_outbound(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
21612 * True if the channel was initiated (and thus funded) by us.
21614 void ChannelDetails_set_is_outbound(struct LDKChannelDetails *NONNULL_PTR this_ptr, bool val);
21617 * True if the channel is confirmed, channel_ready messages have been exchanged, and the
21618 * channel is not currently being shut down. `channel_ready` message exchange implies the
21619 * required confirmation count has been reached (and we were connected to the peer at some
21620 * point after the funding transaction received enough confirmations). The required
21621 * confirmation count is provided in [`confirmations_required`].
21623 * [`confirmations_required`]: ChannelDetails::confirmations_required
21625 bool ChannelDetails_get_is_channel_ready(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
21628 * True if the channel is confirmed, channel_ready messages have been exchanged, and the
21629 * channel is not currently being shut down. `channel_ready` message exchange implies the
21630 * required confirmation count has been reached (and we were connected to the peer at some
21631 * point after the funding transaction received enough confirmations). The required
21632 * confirmation count is provided in [`confirmations_required`].
21634 * [`confirmations_required`]: ChannelDetails::confirmations_required
21636 void ChannelDetails_set_is_channel_ready(struct LDKChannelDetails *NONNULL_PTR this_ptr, bool val);
21639 * True if the channel is (a) confirmed and channel_ready messages have been exchanged, (b)
21640 * the peer is connected, and (c) the channel is not currently negotiating a shutdown.
21642 * This is a strict superset of `is_channel_ready`.
21644 bool ChannelDetails_get_is_usable(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
21647 * True if the channel is (a) confirmed and channel_ready messages have been exchanged, (b)
21648 * the peer is connected, and (c) the channel is not currently negotiating a shutdown.
21650 * This is a strict superset of `is_channel_ready`.
21652 void ChannelDetails_set_is_usable(struct LDKChannelDetails *NONNULL_PTR this_ptr, bool val);
21655 * True if this channel is (or will be) publicly-announced.
21657 bool ChannelDetails_get_is_public(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
21660 * True if this channel is (or will be) publicly-announced.
21662 void ChannelDetails_set_is_public(struct LDKChannelDetails *NONNULL_PTR this_ptr, bool val);
21665 * The smallest value HTLC (in msat) we will accept, for this channel. This field
21666 * is only `None` for `ChannelDetails` objects serialized prior to LDK 0.0.107
21668 struct LDKCOption_u64Z ChannelDetails_get_inbound_htlc_minimum_msat(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
21671 * The smallest value HTLC (in msat) we will accept, for this channel. This field
21672 * is only `None` for `ChannelDetails` objects serialized prior to LDK 0.0.107
21674 void ChannelDetails_set_inbound_htlc_minimum_msat(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
21677 * The largest value HTLC (in msat) we currently will accept, for this channel.
21679 struct LDKCOption_u64Z ChannelDetails_get_inbound_htlc_maximum_msat(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
21682 * The largest value HTLC (in msat) we currently will accept, for this channel.
21684 void ChannelDetails_set_inbound_htlc_maximum_msat(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
21687 * Set of configurable parameters that affect channel operation.
21689 * This field is only `None` for `ChannelDetails` objects serialized prior to LDK 0.0.109.
21691 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
21693 struct LDKChannelConfig ChannelDetails_get_config(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
21696 * Set of configurable parameters that affect channel operation.
21698 * This field is only `None` for `ChannelDetails` objects serialized prior to LDK 0.0.109.
21700 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
21702 void ChannelDetails_set_config(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKChannelConfig val);
21705 * Constructs a new ChannelDetails given each field
21707 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);
21710 * Creates a copy of the ChannelDetails
21712 struct LDKChannelDetails ChannelDetails_clone(const struct LDKChannelDetails *NONNULL_PTR orig);
21715 * Gets the current SCID which should be used to identify this channel for inbound payments.
21716 * This should be used for providing invoice hints or in any other context where our
21717 * counterparty will forward a payment to us.
21719 * This is either the [`ChannelDetails::inbound_scid_alias`], if set, or the
21720 * [`ChannelDetails::short_channel_id`]. See those for more information.
21722 MUST_USE_RES struct LDKCOption_u64Z ChannelDetails_get_inbound_payment_scid(const struct LDKChannelDetails *NONNULL_PTR this_arg);
21725 * Gets the current SCID which should be used to identify this channel for outbound payments.
21726 * This should be used in [`Route`]s to describe the first hop or in other contexts where
21727 * we're sending or forwarding a payment outbound over this channel.
21729 * This is either the [`ChannelDetails::short_channel_id`], if set, or the
21730 * [`ChannelDetails::outbound_scid_alias`]. See those for more information.
21732 MUST_USE_RES struct LDKCOption_u64Z ChannelDetails_get_outbound_payment_scid(const struct LDKChannelDetails *NONNULL_PTR this_arg);
21735 * Frees any resources used by the PaymentSendFailure
21737 void PaymentSendFailure_free(struct LDKPaymentSendFailure this_ptr);
21740 * Creates a copy of the PaymentSendFailure
21742 struct LDKPaymentSendFailure PaymentSendFailure_clone(const struct LDKPaymentSendFailure *NONNULL_PTR orig);
21745 * Utility method to constructs a new ParameterError-variant PaymentSendFailure
21747 struct LDKPaymentSendFailure PaymentSendFailure_parameter_error(struct LDKAPIError a);
21750 * Utility method to constructs a new PathParameterError-variant PaymentSendFailure
21752 struct LDKPaymentSendFailure PaymentSendFailure_path_parameter_error(struct LDKCVec_CResult_NoneAPIErrorZZ a);
21755 * Utility method to constructs a new AllFailedRetrySafe-variant PaymentSendFailure
21757 struct LDKPaymentSendFailure PaymentSendFailure_all_failed_retry_safe(struct LDKCVec_APIErrorZ a);
21760 * Utility method to constructs a new PartialFailure-variant PaymentSendFailure
21762 struct LDKPaymentSendFailure PaymentSendFailure_partial_failure(struct LDKCVec_CResult_NoneAPIErrorZZ results, struct LDKRouteParameters failed_paths_retry, struct LDKThirtyTwoBytes payment_id);
21765 * Frees any resources used by the PhantomRouteHints, if is_owned is set and inner is non-NULL.
21767 void PhantomRouteHints_free(struct LDKPhantomRouteHints this_obj);
21770 * The list of channels to be included in the invoice route hints.
21772 struct LDKCVec_ChannelDetailsZ PhantomRouteHints_get_channels(const struct LDKPhantomRouteHints *NONNULL_PTR this_ptr);
21775 * The list of channels to be included in the invoice route hints.
21777 void PhantomRouteHints_set_channels(struct LDKPhantomRouteHints *NONNULL_PTR this_ptr, struct LDKCVec_ChannelDetailsZ val);
21780 * A fake scid used for representing the phantom node's fake channel in generating the invoice
21783 uint64_t PhantomRouteHints_get_phantom_scid(const struct LDKPhantomRouteHints *NONNULL_PTR this_ptr);
21786 * A fake scid used for representing the phantom node's fake channel in generating the invoice
21789 void PhantomRouteHints_set_phantom_scid(struct LDKPhantomRouteHints *NONNULL_PTR this_ptr, uint64_t val);
21792 * The pubkey of the real backing node that would ultimately receive the payment.
21794 struct LDKPublicKey PhantomRouteHints_get_real_node_pubkey(const struct LDKPhantomRouteHints *NONNULL_PTR this_ptr);
21797 * The pubkey of the real backing node that would ultimately receive the payment.
21799 void PhantomRouteHints_set_real_node_pubkey(struct LDKPhantomRouteHints *NONNULL_PTR this_ptr, struct LDKPublicKey val);
21802 * Constructs a new PhantomRouteHints given each field
21804 MUST_USE_RES struct LDKPhantomRouteHints PhantomRouteHints_new(struct LDKCVec_ChannelDetailsZ channels_arg, uint64_t phantom_scid_arg, struct LDKPublicKey real_node_pubkey_arg);
21807 * Creates a copy of the PhantomRouteHints
21809 struct LDKPhantomRouteHints PhantomRouteHints_clone(const struct LDKPhantomRouteHints *NONNULL_PTR orig);
21812 * Constructs a new ChannelManager to hold several channels and route between them.
21814 * This is the main \"logic hub\" for all channel-related actions, and implements
21815 * ChannelMessageHandler.
21817 * Non-proportional fees are fixed according to our risk using the provided fee estimator.
21819 * Users need to notify the new ChannelManager when a new block is connected or
21820 * disconnected using its `block_connected` and `block_disconnected` methods, starting
21821 * from after `params.latest_hash`.
21823 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);
21826 * Gets the current configuration applied to all new channels.
21828 MUST_USE_RES struct LDKUserConfig ChannelManager_get_current_default_configuration(const struct LDKChannelManager *NONNULL_PTR this_arg);
21831 * Creates a new outbound channel to the given remote node and with the given value.
21833 * `user_channel_id` will be provided back as in
21834 * [`Event::FundingGenerationReady::user_channel_id`] to allow tracking of which events
21835 * correspond with which `create_channel` call. Note that the `user_channel_id` defaults to 0
21836 * for inbound channels, so you may wish to avoid using 0 for `user_channel_id` here.
21837 * `user_channel_id` has no meaning inside of LDK, it is simply copied to events and otherwise
21840 * Raises [`APIError::APIMisuseError`] when `channel_value_satoshis` > 2**24 or `push_msat` is
21841 * greater than `channel_value_satoshis * 1k` or `channel_value_satoshis < 1000`.
21843 * Note that we do not check if you are currently connected to the given peer. If no
21844 * connection is available, the outbound `open_channel` message may fail to send, resulting in
21845 * the channel eventually being silently forgotten (dropped on reload).
21847 * Returns the new Channel's temporary `channel_id`. This ID will appear as
21848 * [`Event::FundingGenerationReady::temporary_channel_id`] and in
21849 * [`ChannelDetails::channel_id`] until after
21850 * [`ChannelManager::funding_transaction_generated`] is called, swapping the Channel's ID for
21851 * one derived from the funding transaction's TXID. If the counterparty rejects the channel
21852 * immediately, this temporary ID will appear in [`Event::ChannelClosed::channel_id`].
21854 * [`Event::FundingGenerationReady::user_channel_id`]: events::Event::FundingGenerationReady::user_channel_id
21855 * [`Event::FundingGenerationReady::temporary_channel_id`]: events::Event::FundingGenerationReady::temporary_channel_id
21856 * [`Event::ChannelClosed::channel_id`]: events::Event::ChannelClosed::channel_id
21858 * Note that override_config (or a relevant inner pointer) may be NULL or all-0s to represent None
21860 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);
21863 * Gets the list of open channels, in random order. See ChannelDetail field documentation for
21864 * more information.
21866 MUST_USE_RES struct LDKCVec_ChannelDetailsZ ChannelManager_list_channels(const struct LDKChannelManager *NONNULL_PTR this_arg);
21869 * Gets the list of usable channels, in random order. Useful as an argument to [`find_route`]
21870 * to ensure non-announced channels are used.
21872 * These are guaranteed to have their [`ChannelDetails::is_usable`] value set to true, see the
21873 * documentation for [`ChannelDetails::is_usable`] for more info on exactly what the criteria
21876 * [`find_route`]: crate::routing::router::find_route
21878 MUST_USE_RES struct LDKCVec_ChannelDetailsZ ChannelManager_list_usable_channels(const struct LDKChannelManager *NONNULL_PTR this_arg);
21881 * Begins the process of closing a channel. After this call (plus some timeout), no new HTLCs
21882 * will be accepted on the given channel, and after additional timeout/the closing of all
21883 * pending HTLCs, the channel will be closed on chain.
21885 * * If we are the channel initiator, we will pay between our [`Background`] and
21886 * [`ChannelConfig::force_close_avoidance_max_fee_satoshis`] plus our [`Normal`] fee
21888 * * If our counterparty is the channel initiator, we will require a channel closing
21889 * transaction feerate of at least our [`Background`] feerate or the feerate which
21890 * would appear on a force-closure transaction, whichever is lower. We will allow our
21891 * counterparty to pay as much fee as they'd like, however.
21893 * May generate a SendShutdown message event on success, which should be relayed.
21895 * [`ChannelConfig::force_close_avoidance_max_fee_satoshis`]: crate::util::config::ChannelConfig::force_close_avoidance_max_fee_satoshis
21896 * [`Background`]: crate::chain::chaininterface::ConfirmationTarget::Background
21897 * [`Normal`]: crate::chain::chaininterface::ConfirmationTarget::Normal
21899 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);
21902 * Begins the process of closing a channel. After this call (plus some timeout), no new HTLCs
21903 * will be accepted on the given channel, and after additional timeout/the closing of all
21904 * pending HTLCs, the channel will be closed on chain.
21906 * `target_feerate_sat_per_1000_weight` has different meanings depending on if we initiated
21907 * the channel being closed or not:
21908 * * If we are the channel initiator, we will pay at least this feerate on the closing
21909 * transaction. The upper-bound is set by
21910 * [`ChannelConfig::force_close_avoidance_max_fee_satoshis`] plus our [`Normal`] fee
21911 * estimate (or `target_feerate_sat_per_1000_weight`, if it is greater).
21912 * * If our counterparty is the channel initiator, we will refuse to accept a channel closure
21913 * transaction feerate below `target_feerate_sat_per_1000_weight` (or the feerate which
21914 * will appear on a force-closure transaction, whichever is lower).
21916 * May generate a SendShutdown message event on success, which should be relayed.
21918 * [`ChannelConfig::force_close_avoidance_max_fee_satoshis`]: crate::util::config::ChannelConfig::force_close_avoidance_max_fee_satoshis
21919 * [`Background`]: crate::chain::chaininterface::ConfirmationTarget::Background
21920 * [`Normal`]: crate::chain::chaininterface::ConfirmationTarget::Normal
21922 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);
21925 * Force closes a channel, immediately broadcasting the latest local transaction(s) and
21926 * rejecting new HTLCs on the given channel. Fails if `channel_id` is unknown to
21927 * the manager, or if the `counterparty_node_id` isn't the counterparty of the corresponding
21930 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);
21933 * Force closes a channel, rejecting new HTLCs on the given channel but skips broadcasting
21934 * the latest local transaction(s). Fails if `channel_id` is unknown to the manager, or if the
21935 * `counterparty_node_id` isn't the counterparty of the corresponding channel.
21937 * You can always get the latest local transaction(s) to broadcast from
21938 * [`ChannelMonitor::get_latest_holder_commitment_txn`].
21940 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);
21943 * Force close all channels, immediately broadcasting the latest local commitment transaction
21944 * for each to the chain and rejecting new HTLCs on each.
21946 void ChannelManager_force_close_all_channels_broadcasting_latest_txn(const struct LDKChannelManager *NONNULL_PTR this_arg);
21949 * Force close all channels rejecting new HTLCs on each but without broadcasting the latest
21950 * local transaction(s).
21952 void ChannelManager_force_close_all_channels_without_broadcasting_txn(const struct LDKChannelManager *NONNULL_PTR this_arg);
21955 * Sends a payment along a given route.
21957 * Value parameters are provided via the last hop in route, see documentation for RouteHop
21958 * fields for more info.
21960 * Note that if the payment_hash already exists elsewhere (eg you're sending a duplicative
21961 * payment), we don't do anything to stop you! We always try to ensure that if the provided
21962 * next hop knows the preimage to payment_hash they can claim an additional amount as
21963 * specified in the last hop in the route! Thus, you should probably do your own
21964 * payment_preimage tracking (which you should already be doing as they represent \"proof of
21965 * payment\") and prevent double-sends yourself.
21967 * May generate SendHTLCs message(s) event on success, which should be relayed.
21969 * Each path may have a different return value, and PaymentSendValue may return a Vec with
21970 * each entry matching the corresponding-index entry in the route paths, see
21971 * PaymentSendFailure for more info.
21973 * In general, a path may raise:
21974 * * APIError::RouteError when an invalid route or forwarding parameter (cltv_delta, fee,
21975 * node public key) is specified.
21976 * * APIError::ChannelUnavailable if the next-hop channel is not available for updates
21977 * (including due to previous monitor update failure or new permanent monitor update
21979 * * APIError::MonitorUpdateFailed if a new monitor update failure prevented sending the
21980 * relevant updates.
21982 * Note that depending on the type of the PaymentSendFailure the HTLC may have been
21983 * irrevocably committed to on our end. In such a case, do NOT retry the payment with a
21984 * different route unless you intend to pay twice!
21986 * payment_secret is unrelated to payment_hash (or PaymentPreimage) and exists to authenticate
21987 * the sender to the recipient and prevent payment-probing (deanonymization) attacks. For
21988 * newer nodes, it will be provided to you in the invoice. If you do not have one, the Route
21989 * must not contain multiple paths as multi-path payments require a recipient-provided
21991 * If a payment_secret *is* provided, we assume that the invoice had the payment_secret feature
21992 * bit set (either as required or as available). If multiple paths are present in the Route,
21993 * we assume the invoice had the basic_mpp feature set.
21995 * Note that payment_secret (or a relevant inner pointer) may be NULL or all-0s to represent None
21997 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);
22000 * Retries a payment along the given [`Route`].
22002 * Errors returned are a superset of those returned from [`send_payment`], so see
22003 * [`send_payment`] documentation for more details on errors. This method will also error if the
22004 * retry amount puts the payment more than 10% over the payment's total amount, if the payment
22005 * for the given `payment_id` cannot be found (likely due to timeout or success), or if
22006 * further retries have been disabled with [`abandon_payment`].
22008 * [`send_payment`]: [`ChannelManager::send_payment`]
22009 * [`abandon_payment`]: [`ChannelManager::abandon_payment`]
22011 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);
22014 * Signals that no further retries for the given payment will occur.
22016 * After this method returns, any future calls to [`retry_payment`] for the given `payment_id`
22017 * will fail with [`PaymentSendFailure::ParameterError`]. If no such event has been generated,
22018 * an [`Event::PaymentFailed`] event will be generated as soon as there are no remaining
22019 * pending HTLCs for this payment.
22021 * Note that calling this method does *not* prevent a payment from succeeding. You must still
22022 * wait until you receive either a [`Event::PaymentFailed`] or [`Event::PaymentSent`] event to
22023 * determine the ultimate status of a payment.
22025 * [`retry_payment`]: Self::retry_payment
22026 * [`Event::PaymentFailed`]: events::Event::PaymentFailed
22027 * [`Event::PaymentSent`]: events::Event::PaymentSent
22029 void ChannelManager_abandon_payment(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKThirtyTwoBytes payment_id);
22032 * Send a spontaneous payment, which is a payment that does not require the recipient to have
22033 * generated an invoice. Optionally, you may specify the preimage. If you do choose to specify
22034 * the preimage, it must be a cryptographically secure random value that no intermediate node
22035 * would be able to guess -- otherwise, an intermediate node may claim the payment and it will
22036 * never reach the recipient.
22038 * See [`send_payment`] documentation for more details on the return value of this function.
22040 * Similar to regular payments, you MUST NOT reuse a `payment_preimage` value. See
22041 * [`send_payment`] for more information about the risks of duplicate preimage usage.
22043 * Note that `route` must have exactly one path.
22045 * [`send_payment`]: Self::send_payment
22047 * Note that payment_preimage (or a relevant inner pointer) may be NULL or all-0s to represent None
22049 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);
22052 * Send a payment that is probing the given route for liquidity. We calculate the
22053 * [`PaymentHash`] of probes based on a static secret and a random [`PaymentId`], which allows
22054 * us to easily discern them from real payments.
22056 MUST_USE_RES struct LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ ChannelManager_send_probe(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKCVec_RouteHopZ hops);
22059 * Call this upon creation of a funding transaction for the given channel.
22061 * Returns an [`APIError::APIMisuseError`] if the funding_transaction spent non-SegWit outputs
22062 * or if no output was found which matches the parameters in [`Event::FundingGenerationReady`].
22064 * Returns [`APIError::APIMisuseError`] if the funding transaction is not final for propagation
22065 * across the p2p network.
22067 * Returns [`APIError::ChannelUnavailable`] if a funding transaction has already been provided
22068 * for the channel or if the channel has been closed as indicated by [`Event::ChannelClosed`].
22070 * May panic if the output found in the funding transaction is duplicative with some other
22071 * channel (note that this should be trivially prevented by using unique funding transaction
22072 * keys per-channel).
22074 * Do NOT broadcast the funding transaction yourself. When we have safely received our
22075 * counterparty's signature the funding transaction will automatically be broadcast via the
22076 * [`BroadcasterInterface`] provided when this `ChannelManager` was constructed.
22078 * Note that this includes RBF or similar transaction replacement strategies - lightning does
22079 * not currently support replacing a funding transaction on an existing channel. Instead,
22080 * create a new channel with a conflicting funding transaction.
22082 * Note to keep the miner incentives aligned in moving the blockchain forward, we recommend
22083 * the wallet software generating the funding transaction to apply anti-fee sniping as
22084 * implemented by Bitcoin Core wallet. See <https://bitcoinops.org/en/topics/fee-sniping/>
22085 * for more details.
22087 * [`Event::FundingGenerationReady`]: crate::util::events::Event::FundingGenerationReady
22088 * [`Event::ChannelClosed`]: crate::util::events::Event::ChannelClosed
22090 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);
22093 * Atomically updates the [`ChannelConfig`] for the given channels.
22095 * Once the updates are applied, each eligible channel (advertised with a known short channel
22096 * ID and a change in [`forwarding_fee_proportional_millionths`], [`forwarding_fee_base_msat`],
22097 * or [`cltv_expiry_delta`]) has a [`BroadcastChannelUpdate`] event message generated
22098 * containing the new [`ChannelUpdate`] message which should be broadcast to the network.
22100 * Returns [`ChannelUnavailable`] when a channel is not found or an incorrect
22101 * `counterparty_node_id` is provided.
22103 * Returns [`APIMisuseError`] when a [`cltv_expiry_delta`] update is to be applied with a value
22104 * below [`MIN_CLTV_EXPIRY_DELTA`].
22106 * If an error is returned, none of the updates should be considered applied.
22108 * [`forwarding_fee_proportional_millionths`]: ChannelConfig::forwarding_fee_proportional_millionths
22109 * [`forwarding_fee_base_msat`]: ChannelConfig::forwarding_fee_base_msat
22110 * [`cltv_expiry_delta`]: ChannelConfig::cltv_expiry_delta
22111 * [`BroadcastChannelUpdate`]: events::MessageSendEvent::BroadcastChannelUpdate
22112 * [`ChannelUpdate`]: msgs::ChannelUpdate
22113 * [`ChannelUnavailable`]: APIError::ChannelUnavailable
22114 * [`APIMisuseError`]: APIError::APIMisuseError
22116 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);
22119 * Processes HTLCs which are pending waiting on random forward delay.
22121 * Should only really ever be called in response to a PendingHTLCsForwardable event.
22122 * Will likely generate further events.
22124 void ChannelManager_process_pending_htlc_forwards(const struct LDKChannelManager *NONNULL_PTR this_arg);
22127 * Performs actions which should happen on startup and roughly once per minute thereafter.
22129 * This currently includes:
22130 * * Increasing or decreasing the on-chain feerate estimates for our outbound channels,
22131 * * Broadcasting `ChannelUpdate` messages if we've been disconnected from our peer for more
22132 * than a minute, informing the network that they should no longer attempt to route over
22134 * * Expiring a channel's previous `ChannelConfig` if necessary to only allow forwarding HTLCs
22135 * with the current `ChannelConfig`.
22137 * Note that this may cause reentrancy through `chain::Watch::update_channel` calls or feerate
22138 * estimate fetches.
22140 void ChannelManager_timer_tick_occurred(const struct LDKChannelManager *NONNULL_PTR this_arg);
22143 * Indicates that the preimage for payment_hash is unknown or the received amount is incorrect
22144 * after a PaymentReceived event, failing the HTLC back to its origin and freeing resources
22145 * along the path (including in our own channel on which we received it).
22147 * Note that in some cases around unclean shutdown, it is possible the payment may have
22148 * already been claimed by you via [`ChannelManager::claim_funds`] prior to you seeing (a
22149 * second copy of) the [`events::Event::PaymentReceived`] event. Alternatively, the payment
22150 * may have already been failed automatically by LDK if it was nearing its expiration time.
22152 * While LDK will never claim a payment automatically on your behalf (i.e. without you calling
22153 * [`ChannelManager::claim_funds`]), you should still monitor for
22154 * [`events::Event::PaymentClaimed`] events even for payments you intend to fail, especially on
22155 * startup during which time claims that were in-progress at shutdown may be replayed.
22157 void ChannelManager_fail_htlc_backwards(const struct LDKChannelManager *NONNULL_PTR this_arg, const uint8_t (*payment_hash)[32]);
22160 * Provides a payment preimage in response to [`Event::PaymentReceived`], generating any
22161 * [`MessageSendEvent`]s needed to claim the payment.
22163 * Note that calling this method does *not* guarantee that the payment has been claimed. You
22164 * *must* wait for an [`Event::PaymentClaimed`] event which upon a successful claim will be
22165 * provided to your [`EventHandler`] when [`process_pending_events`] is next called.
22167 * Note that if you did not set an `amount_msat` when calling [`create_inbound_payment`] or
22168 * [`create_inbound_payment_for_hash`] you must check that the amount in the `PaymentReceived`
22169 * event matches your expectation. If you fail to do so and call this method, you may provide
22170 * the sender \"proof-of-payment\" when they did not fulfill the full expected payment.
22172 * [`Event::PaymentReceived`]: crate::util::events::Event::PaymentReceived
22173 * [`Event::PaymentClaimed`]: crate::util::events::Event::PaymentClaimed
22174 * [`process_pending_events`]: EventsProvider::process_pending_events
22175 * [`create_inbound_payment`]: Self::create_inbound_payment
22176 * [`create_inbound_payment_for_hash`]: Self::create_inbound_payment_for_hash
22177 * [`get_and_clear_pending_msg_events`]: MessageSendEventsProvider::get_and_clear_pending_msg_events
22179 void ChannelManager_claim_funds(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKThirtyTwoBytes payment_preimage);
22182 * Gets the node_id held by this ChannelManager
22184 MUST_USE_RES struct LDKPublicKey ChannelManager_get_our_node_id(const struct LDKChannelManager *NONNULL_PTR this_arg);
22187 * Accepts a request to open a channel after a [`Event::OpenChannelRequest`].
22189 * The `temporary_channel_id` parameter indicates which inbound channel should be accepted,
22190 * and the `counterparty_node_id` parameter is the id of the peer which has requested to open
22193 * The `user_channel_id` parameter will be provided back in
22194 * [`Event::ChannelClosed::user_channel_id`] to allow tracking of which events correspond
22195 * with which `accept_inbound_channel`/`accept_inbound_channel_from_trusted_peer_0conf` call.
22197 * Note that this method will return an error and reject the channel, if it requires support
22198 * for zero confirmations. Instead, `accept_inbound_channel_from_trusted_peer_0conf` must be
22199 * used to accept such channels.
22201 * [`Event::OpenChannelRequest`]: events::Event::OpenChannelRequest
22202 * [`Event::ChannelClosed::user_channel_id`]: events::Event::ChannelClosed::user_channel_id
22204 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);
22207 * Accepts a request to open a channel after a [`events::Event::OpenChannelRequest`], treating
22208 * it as confirmed immediately.
22210 * The `user_channel_id` parameter will be provided back in
22211 * [`Event::ChannelClosed::user_channel_id`] to allow tracking of which events correspond
22212 * with which `accept_inbound_channel`/`accept_inbound_channel_from_trusted_peer_0conf` call.
22214 * Unlike [`ChannelManager::accept_inbound_channel`], this method accepts the incoming channel
22215 * and (if the counterparty agrees), enables forwarding of payments immediately.
22217 * This fully trusts that the counterparty has honestly and correctly constructed the funding
22218 * transaction and blindly assumes that it will eventually confirm.
22220 * If it does not confirm before we decide to close the channel, or if the funding transaction
22221 * does not pay to the correct script the correct amount, *you will lose funds*.
22223 * [`Event::OpenChannelRequest`]: events::Event::OpenChannelRequest
22224 * [`Event::ChannelClosed::user_channel_id`]: events::Event::ChannelClosed::user_channel_id
22226 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);
22229 * Gets a payment secret and payment hash for use in an invoice given to a third party wishing
22232 * This differs from [`create_inbound_payment_for_hash`] only in that it generates the
22233 * [`PaymentHash`] and [`PaymentPreimage`] for you.
22235 * The [`PaymentPreimage`] will ultimately be returned to you in the [`PaymentReceived`], which
22236 * will have the [`PaymentReceived::payment_preimage`] field filled in. That should then be
22237 * passed directly to [`claim_funds`].
22239 * See [`create_inbound_payment_for_hash`] for detailed documentation on behavior and requirements.
22241 * Note that a malicious eavesdropper can intuit whether an inbound payment was created by
22242 * `create_inbound_payment` or `create_inbound_payment_for_hash` based on runtime.
22246 * If you register an inbound payment with this method, then serialize the `ChannelManager`, then
22247 * deserialize it with a node running 0.0.103 and earlier, the payment will fail to be received.
22249 * Errors if `min_value_msat` is greater than total bitcoin supply.
22251 * [`claim_funds`]: Self::claim_funds
22252 * [`PaymentReceived`]: events::Event::PaymentReceived
22253 * [`PaymentReceived::payment_preimage`]: events::Event::PaymentReceived::payment_preimage
22254 * [`create_inbound_payment_for_hash`]: Self::create_inbound_payment_for_hash
22256 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);
22259 * Legacy version of [`create_inbound_payment`]. Use this method if you wish to share
22260 * serialized state with LDK node(s) running 0.0.103 and earlier.
22262 * May panic if `invoice_expiry_delta_secs` is greater than one year.
22265 * This method is deprecated and will be removed soon.
22267 * [`create_inbound_payment`]: Self::create_inbound_payment
22269 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);
22272 * Gets a [`PaymentSecret`] for a given [`PaymentHash`], for which the payment preimage is
22273 * stored external to LDK.
22275 * A [`PaymentReceived`] event will only be generated if the [`PaymentSecret`] matches a
22276 * payment secret fetched via this method or [`create_inbound_payment`], and which is at least
22277 * the `min_value_msat` provided here, if one is provided.
22279 * The [`PaymentHash`] (and corresponding [`PaymentPreimage`]) should be globally unique, though
22280 * note that LDK will not stop you from registering duplicate payment hashes for inbound
22283 * `min_value_msat` should be set if the invoice being generated contains a value. Any payment
22284 * received for the returned [`PaymentHash`] will be required to be at least `min_value_msat`
22285 * before a [`PaymentReceived`] event will be generated, ensuring that we do not provide the
22286 * sender \"proof-of-payment\" unless they have paid the required amount.
22288 * `invoice_expiry_delta_secs` describes the number of seconds that the invoice is valid for
22289 * in excess of the current time. This should roughly match the expiry time set in the invoice.
22290 * After this many seconds, we will remove the inbound payment, resulting in any attempts to
22291 * pay the invoice failing. The BOLT spec suggests 3,600 secs as a default validity time for
22292 * invoices when no timeout is set.
22294 * Note that we use block header time to time-out pending inbound payments (with some margin
22295 * to compensate for the inaccuracy of block header timestamps). Thus, in practice we will
22296 * accept a payment and generate a [`PaymentReceived`] event for some time after the expiry.
22297 * If you need exact expiry semantics, you should enforce them upon receipt of
22298 * [`PaymentReceived`].
22300 * Note that invoices generated for inbound payments should have their `min_final_cltv_expiry`
22301 * set to at least [`MIN_FINAL_CLTV_EXPIRY`].
22303 * Note that a malicious eavesdropper can intuit whether an inbound payment was created by
22304 * `create_inbound_payment` or `create_inbound_payment_for_hash` based on runtime.
22308 * If you register an inbound payment with this method, then serialize the `ChannelManager`, then
22309 * deserialize it with a node running 0.0.103 and earlier, the payment will fail to be received.
22311 * Errors if `min_value_msat` is greater than total bitcoin supply.
22313 * [`create_inbound_payment`]: Self::create_inbound_payment
22314 * [`PaymentReceived`]: events::Event::PaymentReceived
22316 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);
22319 * Legacy version of [`create_inbound_payment_for_hash`]. Use this method if you wish to share
22320 * serialized state with LDK node(s) running 0.0.103 and earlier.
22322 * May panic if `invoice_expiry_delta_secs` is greater than one year.
22325 * This method is deprecated and will be removed soon.
22327 * [`create_inbound_payment_for_hash`]: Self::create_inbound_payment_for_hash
22329 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);
22332 * Gets an LDK-generated payment preimage from a payment hash and payment secret that were
22333 * previously returned from [`create_inbound_payment`].
22335 * [`create_inbound_payment`]: Self::create_inbound_payment
22337 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);
22340 * Gets a fake short channel id for use in receiving [phantom node payments]. These fake scids
22341 * are used when constructing the phantom invoice's route hints.
22343 * [phantom node payments]: crate::chain::keysinterface::PhantomKeysManager
22345 MUST_USE_RES uint64_t ChannelManager_get_phantom_scid(const struct LDKChannelManager *NONNULL_PTR this_arg);
22348 * Gets route hints for use in receiving [phantom node payments].
22350 * [phantom node payments]: crate::chain::keysinterface::PhantomKeysManager
22352 MUST_USE_RES struct LDKPhantomRouteHints ChannelManager_get_phantom_route_hints(const struct LDKChannelManager *NONNULL_PTR this_arg);
22355 * Constructs a new MessageSendEventsProvider which calls the relevant methods on this_arg.
22356 * This copies the `inner` pointer in this_arg and thus the returned MessageSendEventsProvider must be freed before this_arg is
22358 struct LDKMessageSendEventsProvider ChannelManager_as_MessageSendEventsProvider(const struct LDKChannelManager *NONNULL_PTR this_arg);
22361 * Constructs a new EventsProvider which calls the relevant methods on this_arg.
22362 * This copies the `inner` pointer in this_arg and thus the returned EventsProvider must be freed before this_arg is
22364 struct LDKEventsProvider ChannelManager_as_EventsProvider(const struct LDKChannelManager *NONNULL_PTR this_arg);
22367 * Constructs a new Listen which calls the relevant methods on this_arg.
22368 * This copies the `inner` pointer in this_arg and thus the returned Listen must be freed before this_arg is
22370 struct LDKListen ChannelManager_as_Listen(const struct LDKChannelManager *NONNULL_PTR this_arg);
22373 * Constructs a new Confirm which calls the relevant methods on this_arg.
22374 * This copies the `inner` pointer in this_arg and thus the returned Confirm must be freed before this_arg is
22376 struct LDKConfirm ChannelManager_as_Confirm(const struct LDKChannelManager *NONNULL_PTR this_arg);
22379 * Blocks until ChannelManager needs to be persisted or a timeout is reached. It returns a bool
22380 * indicating whether persistence is necessary. Only one listener on
22381 * `await_persistable_update` or `await_persistable_update_timeout` is guaranteed to be woken
22384 * Note that this method is not available with the `no-std` feature.
22386 MUST_USE_RES bool ChannelManager_await_persistable_update_timeout(const struct LDKChannelManager *NONNULL_PTR this_arg, uint64_t max_wait);
22389 * Blocks until ChannelManager needs to be persisted. Only one listener on
22390 * `await_persistable_update` or `await_persistable_update_timeout` is guaranteed to be woken
22393 void ChannelManager_await_persistable_update(const struct LDKChannelManager *NONNULL_PTR this_arg);
22396 * Gets a [`Future`] that completes when a persistable update is available. Note that
22397 * callbacks registered on the [`Future`] MUST NOT call back into this [`ChannelManager`] and
22398 * should instead register actions to be taken later.
22400 MUST_USE_RES struct LDKFuture ChannelManager_get_persistable_update_future(const struct LDKChannelManager *NONNULL_PTR this_arg);
22403 * Gets the latest best block which was connected either via the [`chain::Listen`] or
22404 * [`chain::Confirm`] interfaces.
22406 MUST_USE_RES struct LDKBestBlock ChannelManager_current_best_block(const struct LDKChannelManager *NONNULL_PTR this_arg);
22409 * Constructs a new ChannelMessageHandler which calls the relevant methods on this_arg.
22410 * This copies the `inner` pointer in this_arg and thus the returned ChannelMessageHandler must be freed before this_arg is
22412 struct LDKChannelMessageHandler ChannelManager_as_ChannelMessageHandler(const struct LDKChannelManager *NONNULL_PTR this_arg);
22415 * Serialize the CounterpartyForwardingInfo object into a byte array which can be read by CounterpartyForwardingInfo_read
22417 struct LDKCVec_u8Z CounterpartyForwardingInfo_write(const struct LDKCounterpartyForwardingInfo *NONNULL_PTR obj);
22420 * Read a CounterpartyForwardingInfo from a byte array, created by CounterpartyForwardingInfo_write
22422 struct LDKCResult_CounterpartyForwardingInfoDecodeErrorZ CounterpartyForwardingInfo_read(struct LDKu8slice ser);
22425 * Serialize the ChannelCounterparty object into a byte array which can be read by ChannelCounterparty_read
22427 struct LDKCVec_u8Z ChannelCounterparty_write(const struct LDKChannelCounterparty *NONNULL_PTR obj);
22430 * Read a ChannelCounterparty from a byte array, created by ChannelCounterparty_write
22432 struct LDKCResult_ChannelCounterpartyDecodeErrorZ ChannelCounterparty_read(struct LDKu8slice ser);
22435 * Serialize the ChannelDetails object into a byte array which can be read by ChannelDetails_read
22437 struct LDKCVec_u8Z ChannelDetails_write(const struct LDKChannelDetails *NONNULL_PTR obj);
22440 * Read a ChannelDetails from a byte array, created by ChannelDetails_write
22442 struct LDKCResult_ChannelDetailsDecodeErrorZ ChannelDetails_read(struct LDKu8slice ser);
22445 * Serialize the PhantomRouteHints object into a byte array which can be read by PhantomRouteHints_read
22447 struct LDKCVec_u8Z PhantomRouteHints_write(const struct LDKPhantomRouteHints *NONNULL_PTR obj);
22450 * Read a PhantomRouteHints from a byte array, created by PhantomRouteHints_write
22452 struct LDKCResult_PhantomRouteHintsDecodeErrorZ PhantomRouteHints_read(struct LDKu8slice ser);
22455 * Serialize the ChannelManager object into a byte array which can be read by ChannelManager_read
22457 struct LDKCVec_u8Z ChannelManager_write(const struct LDKChannelManager *NONNULL_PTR obj);
22460 * Frees any resources used by the ChannelManagerReadArgs, if is_owned is set and inner is non-NULL.
22462 void ChannelManagerReadArgs_free(struct LDKChannelManagerReadArgs this_obj);
22465 * The keys provider which will give us relevant keys. Some keys will be loaded during
22466 * deserialization and KeysInterface::read_chan_signer will be used to read per-Channel
22469 const struct LDKKeysInterface *ChannelManagerReadArgs_get_keys_manager(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
22472 * The keys provider which will give us relevant keys. Some keys will be loaded during
22473 * deserialization and KeysInterface::read_chan_signer will be used to read per-Channel
22476 void ChannelManagerReadArgs_set_keys_manager(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKKeysInterface val);
22479 * The fee_estimator for use in the ChannelManager in the future.
22481 * No calls to the FeeEstimator will be made during deserialization.
22483 const struct LDKFeeEstimator *ChannelManagerReadArgs_get_fee_estimator(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
22486 * The fee_estimator for use in the ChannelManager in the future.
22488 * No calls to the FeeEstimator will be made during deserialization.
22490 void ChannelManagerReadArgs_set_fee_estimator(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKFeeEstimator val);
22493 * The chain::Watch for use in the ChannelManager in the future.
22495 * No calls to the chain::Watch will be made during deserialization. It is assumed that
22496 * you have deserialized ChannelMonitors separately and will add them to your
22497 * chain::Watch after deserializing this ChannelManager.
22499 const struct LDKWatch *ChannelManagerReadArgs_get_chain_monitor(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
22502 * The chain::Watch for use in the ChannelManager in the future.
22504 * No calls to the chain::Watch will be made during deserialization. It is assumed that
22505 * you have deserialized ChannelMonitors separately and will add them to your
22506 * chain::Watch after deserializing this ChannelManager.
22508 void ChannelManagerReadArgs_set_chain_monitor(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKWatch val);
22511 * The BroadcasterInterface which will be used in the ChannelManager in the future and may be
22512 * used to broadcast the latest local commitment transactions of channels which must be
22513 * force-closed during deserialization.
22515 const struct LDKBroadcasterInterface *ChannelManagerReadArgs_get_tx_broadcaster(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
22518 * The BroadcasterInterface which will be used in the ChannelManager in the future and may be
22519 * used to broadcast the latest local commitment transactions of channels which must be
22520 * force-closed during deserialization.
22522 void ChannelManagerReadArgs_set_tx_broadcaster(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKBroadcasterInterface val);
22525 * The Logger for use in the ChannelManager and which may be used to log information during
22528 const struct LDKLogger *ChannelManagerReadArgs_get_logger(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
22531 * The Logger for use in the ChannelManager and which may be used to log information during
22534 void ChannelManagerReadArgs_set_logger(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKLogger val);
22537 * Default settings used for new channels. Any existing channels will continue to use the
22538 * runtime settings which were stored when the ChannelManager was serialized.
22540 struct LDKUserConfig ChannelManagerReadArgs_get_default_config(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
22543 * Default settings used for new channels. Any existing channels will continue to use the
22544 * runtime settings which were stored when the ChannelManager was serialized.
22546 void ChannelManagerReadArgs_set_default_config(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKUserConfig val);
22549 * Simple utility function to create a ChannelManagerReadArgs which creates the monitor
22550 * HashMap for you. This is primarily useful for C bindings where it is not practical to
22551 * populate a HashMap directly from C.
22553 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);
22556 * Read a C2Tuple_BlockHashChannelManagerZ from a byte array, created by C2Tuple_BlockHashChannelManagerZ_write
22558 struct LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ C2Tuple_BlockHashChannelManagerZ_read(struct LDKu8slice ser, struct LDKChannelManagerReadArgs arg);
22561 * Frees any resources used by the ExpandedKey, if is_owned is set and inner is non-NULL.
22563 void ExpandedKey_free(struct LDKExpandedKey this_obj);
22566 * Create a new [`ExpandedKey`] for generating an inbound payment hash and secret.
22568 * It is recommended to cache this value and not regenerate it for each new inbound payment.
22570 MUST_USE_RES struct LDKExpandedKey ExpandedKey_new(const uint8_t (*key_material)[32]);
22573 * Equivalent to [`crate::ln::channelmanager::ChannelManager::create_inbound_payment`], but no
22574 * `ChannelManager` is required. Useful for generating invoices for [phantom node payments] without
22575 * a `ChannelManager`.
22577 * `keys` is generated by calling [`KeysInterface::get_inbound_payment_key_material`] and then
22578 * calling [`ExpandedKey::new`] with its result. It is recommended to cache this value and not
22579 * regenerate it for each new inbound payment.
22581 * `current_time` is a Unix timestamp representing the current time.
22583 * [phantom node payments]: crate::chain::keysinterface::PhantomKeysManager
22585 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);
22588 * Equivalent to [`crate::ln::channelmanager::ChannelManager::create_inbound_payment_for_hash`],
22589 * but no `ChannelManager` is required. Useful for generating invoices for [phantom node payments]
22590 * without a `ChannelManager`.
22592 * See [`create`] for information on the `keys` and `current_time` parameters.
22594 * [phantom node payments]: crate::chain::keysinterface::PhantomKeysManager
22596 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);
22599 * Frees any resources used by the DecodeError, if is_owned is set and inner is non-NULL.
22601 void DecodeError_free(struct LDKDecodeError this_obj);
22604 * Creates a copy of the DecodeError
22606 struct LDKDecodeError DecodeError_clone(const struct LDKDecodeError *NONNULL_PTR orig);
22609 * Frees any resources used by the Init, if is_owned is set and inner is non-NULL.
22611 void Init_free(struct LDKInit this_obj);
22614 * The relevant features which the sender supports
22616 struct LDKInitFeatures Init_get_features(const struct LDKInit *NONNULL_PTR this_ptr);
22619 * The relevant features which the sender supports
22621 void Init_set_features(struct LDKInit *NONNULL_PTR this_ptr, struct LDKInitFeatures val);
22624 * The receipient's network address. This adds the option to report a remote IP address
22625 * back to a connecting peer using the init message. A node can decide to use that information
22626 * to discover a potential update to its public IPv4 address (NAT) and use
22627 * that for a node_announcement update message containing the new address.
22629 struct LDKCOption_NetAddressZ Init_get_remote_network_address(const struct LDKInit *NONNULL_PTR this_ptr);
22632 * The receipient's network address. This adds the option to report a remote IP address
22633 * back to a connecting peer using the init message. A node can decide to use that information
22634 * to discover a potential update to its public IPv4 address (NAT) and use
22635 * that for a node_announcement update message containing the new address.
22637 void Init_set_remote_network_address(struct LDKInit *NONNULL_PTR this_ptr, struct LDKCOption_NetAddressZ val);
22640 * Constructs a new Init given each field
22642 MUST_USE_RES struct LDKInit Init_new(struct LDKInitFeatures features_arg, struct LDKCOption_NetAddressZ remote_network_address_arg);
22645 * Creates a copy of the Init
22647 struct LDKInit Init_clone(const struct LDKInit *NONNULL_PTR orig);
22650 * Frees any resources used by the ErrorMessage, if is_owned is set and inner is non-NULL.
22652 void ErrorMessage_free(struct LDKErrorMessage this_obj);
22655 * The channel ID involved in the error.
22657 * All-0s indicates a general error unrelated to a specific channel, after which all channels
22658 * with the sending peer should be closed.
22660 const uint8_t (*ErrorMessage_get_channel_id(const struct LDKErrorMessage *NONNULL_PTR this_ptr))[32];
22663 * The channel ID involved in the error.
22665 * All-0s indicates a general error unrelated to a specific channel, after which all channels
22666 * with the sending peer should be closed.
22668 void ErrorMessage_set_channel_id(struct LDKErrorMessage *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
22671 * A possibly human-readable error description.
22672 * The string should be sanitized before it is used (e.g. emitted to logs or printed to
22673 * stdout). Otherwise, a well crafted error message may trigger a security vulnerability in
22674 * the terminal emulator or the logging subsystem.
22676 struct LDKStr ErrorMessage_get_data(const struct LDKErrorMessage *NONNULL_PTR this_ptr);
22679 * A possibly human-readable error description.
22680 * The string should be sanitized before it is used (e.g. emitted to logs or printed to
22681 * stdout). Otherwise, a well crafted error message may trigger a security vulnerability in
22682 * the terminal emulator or the logging subsystem.
22684 void ErrorMessage_set_data(struct LDKErrorMessage *NONNULL_PTR this_ptr, struct LDKStr val);
22687 * Constructs a new ErrorMessage given each field
22689 MUST_USE_RES struct LDKErrorMessage ErrorMessage_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKStr data_arg);
22692 * Creates a copy of the ErrorMessage
22694 struct LDKErrorMessage ErrorMessage_clone(const struct LDKErrorMessage *NONNULL_PTR orig);
22697 * Frees any resources used by the WarningMessage, if is_owned is set and inner is non-NULL.
22699 void WarningMessage_free(struct LDKWarningMessage this_obj);
22702 * The channel ID involved in the warning.
22704 * All-0s indicates a warning unrelated to a specific channel.
22706 const uint8_t (*WarningMessage_get_channel_id(const struct LDKWarningMessage *NONNULL_PTR this_ptr))[32];
22709 * The channel ID involved in the warning.
22711 * All-0s indicates a warning unrelated to a specific channel.
22713 void WarningMessage_set_channel_id(struct LDKWarningMessage *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
22716 * A possibly human-readable warning description.
22717 * The string should be sanitized before it is used (e.g. emitted to logs or printed to
22718 * stdout). Otherwise, a well crafted error message may trigger a security vulnerability in
22719 * the terminal emulator or the logging subsystem.
22721 struct LDKStr WarningMessage_get_data(const struct LDKWarningMessage *NONNULL_PTR this_ptr);
22724 * A possibly human-readable warning description.
22725 * The string should be sanitized before it is used (e.g. emitted to logs or printed to
22726 * stdout). Otherwise, a well crafted error message may trigger a security vulnerability in
22727 * the terminal emulator or the logging subsystem.
22729 void WarningMessage_set_data(struct LDKWarningMessage *NONNULL_PTR this_ptr, struct LDKStr val);
22732 * Constructs a new WarningMessage given each field
22734 MUST_USE_RES struct LDKWarningMessage WarningMessage_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKStr data_arg);
22737 * Creates a copy of the WarningMessage
22739 struct LDKWarningMessage WarningMessage_clone(const struct LDKWarningMessage *NONNULL_PTR orig);
22742 * Frees any resources used by the Ping, if is_owned is set and inner is non-NULL.
22744 void Ping_free(struct LDKPing this_obj);
22747 * The desired response length
22749 uint16_t Ping_get_ponglen(const struct LDKPing *NONNULL_PTR this_ptr);
22752 * The desired response length
22754 void Ping_set_ponglen(struct LDKPing *NONNULL_PTR this_ptr, uint16_t val);
22757 * The ping packet size.
22758 * This field is not sent on the wire. byteslen zeros are sent.
22760 uint16_t Ping_get_byteslen(const struct LDKPing *NONNULL_PTR this_ptr);
22763 * The ping packet size.
22764 * This field is not sent on the wire. byteslen zeros are sent.
22766 void Ping_set_byteslen(struct LDKPing *NONNULL_PTR this_ptr, uint16_t val);
22769 * Constructs a new Ping given each field
22771 MUST_USE_RES struct LDKPing Ping_new(uint16_t ponglen_arg, uint16_t byteslen_arg);
22774 * Creates a copy of the Ping
22776 struct LDKPing Ping_clone(const struct LDKPing *NONNULL_PTR orig);
22779 * Frees any resources used by the Pong, if is_owned is set and inner is non-NULL.
22781 void Pong_free(struct LDKPong this_obj);
22784 * The pong packet size.
22785 * This field is not sent on the wire. byteslen zeros are sent.
22787 uint16_t Pong_get_byteslen(const struct LDKPong *NONNULL_PTR this_ptr);
22790 * The pong packet size.
22791 * This field is not sent on the wire. byteslen zeros are sent.
22793 void Pong_set_byteslen(struct LDKPong *NONNULL_PTR this_ptr, uint16_t val);
22796 * Constructs a new Pong given each field
22798 MUST_USE_RES struct LDKPong Pong_new(uint16_t byteslen_arg);
22801 * Creates a copy of the Pong
22803 struct LDKPong Pong_clone(const struct LDKPong *NONNULL_PTR orig);
22806 * Frees any resources used by the OpenChannel, if is_owned is set and inner is non-NULL.
22808 void OpenChannel_free(struct LDKOpenChannel this_obj);
22811 * The genesis hash of the blockchain where the channel is to be opened
22813 const uint8_t (*OpenChannel_get_chain_hash(const struct LDKOpenChannel *NONNULL_PTR this_ptr))[32];
22816 * The genesis hash of the blockchain where the channel is to be opened
22818 void OpenChannel_set_chain_hash(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
22821 * A temporary channel ID, until the funding outpoint is announced
22823 const uint8_t (*OpenChannel_get_temporary_channel_id(const struct LDKOpenChannel *NONNULL_PTR this_ptr))[32];
22826 * A temporary channel ID, until the funding outpoint is announced
22828 void OpenChannel_set_temporary_channel_id(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
22831 * The channel value
22833 uint64_t OpenChannel_get_funding_satoshis(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
22836 * The channel value
22838 void OpenChannel_set_funding_satoshis(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint64_t val);
22841 * The amount to push to the counterparty as part of the open, in milli-satoshi
22843 uint64_t OpenChannel_get_push_msat(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
22846 * The amount to push to the counterparty as part of the open, in milli-satoshi
22848 void OpenChannel_set_push_msat(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint64_t val);
22851 * The threshold below which outputs on transactions broadcast by sender will be omitted
22853 uint64_t OpenChannel_get_dust_limit_satoshis(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
22856 * The threshold below which outputs on transactions broadcast by sender will be omitted
22858 void OpenChannel_set_dust_limit_satoshis(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint64_t val);
22861 * The maximum inbound HTLC value in flight towards sender, in milli-satoshi
22863 uint64_t OpenChannel_get_max_htlc_value_in_flight_msat(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
22866 * The maximum inbound HTLC value in flight towards sender, in milli-satoshi
22868 void OpenChannel_set_max_htlc_value_in_flight_msat(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint64_t val);
22871 * The minimum value unencumbered by HTLCs for the counterparty to keep in the channel
22873 uint64_t OpenChannel_get_channel_reserve_satoshis(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
22876 * The minimum value unencumbered by HTLCs for the counterparty to keep in the channel
22878 void OpenChannel_set_channel_reserve_satoshis(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint64_t val);
22881 * The minimum HTLC size incoming to sender, in milli-satoshi
22883 uint64_t OpenChannel_get_htlc_minimum_msat(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
22886 * The minimum HTLC size incoming to sender, in milli-satoshi
22888 void OpenChannel_set_htlc_minimum_msat(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint64_t val);
22891 * The feerate per 1000-weight of sender generated transactions, until updated by update_fee
22893 uint32_t OpenChannel_get_feerate_per_kw(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
22896 * The feerate per 1000-weight of sender generated transactions, until updated by update_fee
22898 void OpenChannel_set_feerate_per_kw(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint32_t val);
22901 * The number of blocks which the counterparty will have to wait to claim on-chain funds if they broadcast a commitment transaction
22903 uint16_t OpenChannel_get_to_self_delay(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
22906 * The number of blocks which the counterparty will have to wait to claim on-chain funds if they broadcast a commitment transaction
22908 void OpenChannel_set_to_self_delay(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint16_t val);
22911 * The maximum number of inbound HTLCs towards sender
22913 uint16_t OpenChannel_get_max_accepted_htlcs(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
22916 * The maximum number of inbound HTLCs towards sender
22918 void OpenChannel_set_max_accepted_htlcs(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint16_t val);
22921 * The sender's key controlling the funding transaction
22923 struct LDKPublicKey OpenChannel_get_funding_pubkey(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
22926 * The sender's key controlling the funding transaction
22928 void OpenChannel_set_funding_pubkey(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
22931 * Used to derive a revocation key for transactions broadcast by counterparty
22933 struct LDKPublicKey OpenChannel_get_revocation_basepoint(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
22936 * Used to derive a revocation key for transactions broadcast by counterparty
22938 void OpenChannel_set_revocation_basepoint(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
22941 * A payment key to sender for transactions broadcast by counterparty
22943 struct LDKPublicKey OpenChannel_get_payment_point(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
22946 * A payment key to sender for transactions broadcast by counterparty
22948 void OpenChannel_set_payment_point(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
22951 * Used to derive a payment key to sender for transactions broadcast by sender
22953 struct LDKPublicKey OpenChannel_get_delayed_payment_basepoint(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
22956 * Used to derive a payment key to sender for transactions broadcast by sender
22958 void OpenChannel_set_delayed_payment_basepoint(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
22961 * Used to derive an HTLC payment key to sender
22963 struct LDKPublicKey OpenChannel_get_htlc_basepoint(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
22966 * Used to derive an HTLC payment key to sender
22968 void OpenChannel_set_htlc_basepoint(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
22971 * The first to-be-broadcast-by-sender transaction's per commitment point
22973 struct LDKPublicKey OpenChannel_get_first_per_commitment_point(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
22976 * The first to-be-broadcast-by-sender transaction's per commitment point
22978 void OpenChannel_set_first_per_commitment_point(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
22983 uint8_t OpenChannel_get_channel_flags(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
22988 void OpenChannel_set_channel_flags(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint8_t val);
22991 * The channel type that this channel will represent. If none is set, we derive the channel
22992 * type from the intersection of our feature bits with our counterparty's feature bits from
22993 * the Init message.
22995 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
22997 struct LDKChannelTypeFeatures OpenChannel_get_channel_type(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
23000 * The channel type that this channel will represent. If none is set, we derive the channel
23001 * type from the intersection of our feature bits with our counterparty's feature bits from
23002 * the Init message.
23004 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
23006 void OpenChannel_set_channel_type(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKChannelTypeFeatures val);
23009 * Creates a copy of the OpenChannel
23011 struct LDKOpenChannel OpenChannel_clone(const struct LDKOpenChannel *NONNULL_PTR orig);
23014 * Frees any resources used by the AcceptChannel, if is_owned is set and inner is non-NULL.
23016 void AcceptChannel_free(struct LDKAcceptChannel this_obj);
23019 * A temporary channel ID, until the funding outpoint is announced
23021 const uint8_t (*AcceptChannel_get_temporary_channel_id(const struct LDKAcceptChannel *NONNULL_PTR this_ptr))[32];
23024 * A temporary channel ID, until the funding outpoint is announced
23026 void AcceptChannel_set_temporary_channel_id(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
23029 * The threshold below which outputs on transactions broadcast by sender will be omitted
23031 uint64_t AcceptChannel_get_dust_limit_satoshis(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
23034 * The threshold below which outputs on transactions broadcast by sender will be omitted
23036 void AcceptChannel_set_dust_limit_satoshis(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint64_t val);
23039 * The maximum inbound HTLC value in flight towards sender, in milli-satoshi
23041 uint64_t AcceptChannel_get_max_htlc_value_in_flight_msat(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
23044 * The maximum inbound HTLC value in flight towards sender, in milli-satoshi
23046 void AcceptChannel_set_max_htlc_value_in_flight_msat(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint64_t val);
23049 * The minimum value unencumbered by HTLCs for the counterparty to keep in the channel
23051 uint64_t AcceptChannel_get_channel_reserve_satoshis(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
23054 * The minimum value unencumbered by HTLCs for the counterparty to keep in the channel
23056 void AcceptChannel_set_channel_reserve_satoshis(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint64_t val);
23059 * The minimum HTLC size incoming to sender, in milli-satoshi
23061 uint64_t AcceptChannel_get_htlc_minimum_msat(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
23064 * The minimum HTLC size incoming to sender, in milli-satoshi
23066 void AcceptChannel_set_htlc_minimum_msat(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint64_t val);
23069 * Minimum depth of the funding transaction before the channel is considered open
23071 uint32_t AcceptChannel_get_minimum_depth(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
23074 * Minimum depth of the funding transaction before the channel is considered open
23076 void AcceptChannel_set_minimum_depth(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint32_t val);
23079 * The number of blocks which the counterparty will have to wait to claim on-chain funds if they broadcast a commitment transaction
23081 uint16_t AcceptChannel_get_to_self_delay(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
23084 * The number of blocks which the counterparty will have to wait to claim on-chain funds if they broadcast a commitment transaction
23086 void AcceptChannel_set_to_self_delay(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint16_t val);
23089 * The maximum number of inbound HTLCs towards sender
23091 uint16_t AcceptChannel_get_max_accepted_htlcs(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
23094 * The maximum number of inbound HTLCs towards sender
23096 void AcceptChannel_set_max_accepted_htlcs(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint16_t val);
23099 * The sender's key controlling the funding transaction
23101 struct LDKPublicKey AcceptChannel_get_funding_pubkey(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
23104 * The sender's key controlling the funding transaction
23106 void AcceptChannel_set_funding_pubkey(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
23109 * Used to derive a revocation key for transactions broadcast by counterparty
23111 struct LDKPublicKey AcceptChannel_get_revocation_basepoint(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
23114 * Used to derive a revocation key for transactions broadcast by counterparty
23116 void AcceptChannel_set_revocation_basepoint(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
23119 * A payment key to sender for transactions broadcast by counterparty
23121 struct LDKPublicKey AcceptChannel_get_payment_point(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
23124 * A payment key to sender for transactions broadcast by counterparty
23126 void AcceptChannel_set_payment_point(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
23129 * Used to derive a payment key to sender for transactions broadcast by sender
23131 struct LDKPublicKey AcceptChannel_get_delayed_payment_basepoint(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
23134 * Used to derive a payment key to sender for transactions broadcast by sender
23136 void AcceptChannel_set_delayed_payment_basepoint(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
23139 * Used to derive an HTLC payment key to sender for transactions broadcast by counterparty
23141 struct LDKPublicKey AcceptChannel_get_htlc_basepoint(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
23144 * Used to derive an HTLC payment key to sender for transactions broadcast by counterparty
23146 void AcceptChannel_set_htlc_basepoint(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
23149 * The first to-be-broadcast-by-sender transaction's per commitment point
23151 struct LDKPublicKey AcceptChannel_get_first_per_commitment_point(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
23154 * The first to-be-broadcast-by-sender transaction's per commitment point
23156 void AcceptChannel_set_first_per_commitment_point(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
23159 * The channel type that this channel will represent. If none is set, we derive the channel
23160 * type from the intersection of our feature bits with our counterparty's feature bits from
23161 * the Init message.
23163 * This is required to match the equivalent field in [`OpenChannel::channel_type`].
23165 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
23167 struct LDKChannelTypeFeatures AcceptChannel_get_channel_type(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
23170 * The channel type that this channel will represent. If none is set, we derive the channel
23171 * type from the intersection of our feature bits with our counterparty's feature bits from
23172 * the Init message.
23174 * This is required to match the equivalent field in [`OpenChannel::channel_type`].
23176 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
23178 void AcceptChannel_set_channel_type(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKChannelTypeFeatures val);
23181 * Creates a copy of the AcceptChannel
23183 struct LDKAcceptChannel AcceptChannel_clone(const struct LDKAcceptChannel *NONNULL_PTR orig);
23186 * Frees any resources used by the FundingCreated, if is_owned is set and inner is non-NULL.
23188 void FundingCreated_free(struct LDKFundingCreated this_obj);
23191 * A temporary channel ID, until the funding is established
23193 const uint8_t (*FundingCreated_get_temporary_channel_id(const struct LDKFundingCreated *NONNULL_PTR this_ptr))[32];
23196 * A temporary channel ID, until the funding is established
23198 void FundingCreated_set_temporary_channel_id(struct LDKFundingCreated *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
23201 * The funding transaction ID
23203 const uint8_t (*FundingCreated_get_funding_txid(const struct LDKFundingCreated *NONNULL_PTR this_ptr))[32];
23206 * The funding transaction ID
23208 void FundingCreated_set_funding_txid(struct LDKFundingCreated *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
23211 * The specific output index funding this channel
23213 uint16_t FundingCreated_get_funding_output_index(const struct LDKFundingCreated *NONNULL_PTR this_ptr);
23216 * The specific output index funding this channel
23218 void FundingCreated_set_funding_output_index(struct LDKFundingCreated *NONNULL_PTR this_ptr, uint16_t val);
23221 * The signature of the channel initiator (funder) on the initial commitment transaction
23223 struct LDKSignature FundingCreated_get_signature(const struct LDKFundingCreated *NONNULL_PTR this_ptr);
23226 * The signature of the channel initiator (funder) on the initial commitment transaction
23228 void FundingCreated_set_signature(struct LDKFundingCreated *NONNULL_PTR this_ptr, struct LDKSignature val);
23231 * Constructs a new FundingCreated given each field
23233 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);
23236 * Creates a copy of the FundingCreated
23238 struct LDKFundingCreated FundingCreated_clone(const struct LDKFundingCreated *NONNULL_PTR orig);
23241 * Frees any resources used by the FundingSigned, if is_owned is set and inner is non-NULL.
23243 void FundingSigned_free(struct LDKFundingSigned this_obj);
23248 const uint8_t (*FundingSigned_get_channel_id(const struct LDKFundingSigned *NONNULL_PTR this_ptr))[32];
23253 void FundingSigned_set_channel_id(struct LDKFundingSigned *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
23256 * The signature of the channel acceptor (fundee) on the initial commitment transaction
23258 struct LDKSignature FundingSigned_get_signature(const struct LDKFundingSigned *NONNULL_PTR this_ptr);
23261 * The signature of the channel acceptor (fundee) on the initial commitment transaction
23263 void FundingSigned_set_signature(struct LDKFundingSigned *NONNULL_PTR this_ptr, struct LDKSignature val);
23266 * Constructs a new FundingSigned given each field
23268 MUST_USE_RES struct LDKFundingSigned FundingSigned_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKSignature signature_arg);
23271 * Creates a copy of the FundingSigned
23273 struct LDKFundingSigned FundingSigned_clone(const struct LDKFundingSigned *NONNULL_PTR orig);
23276 * Frees any resources used by the ChannelReady, if is_owned is set and inner is non-NULL.
23278 void ChannelReady_free(struct LDKChannelReady this_obj);
23283 const uint8_t (*ChannelReady_get_channel_id(const struct LDKChannelReady *NONNULL_PTR this_ptr))[32];
23288 void ChannelReady_set_channel_id(struct LDKChannelReady *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
23291 * The per-commitment point of the second commitment transaction
23293 struct LDKPublicKey ChannelReady_get_next_per_commitment_point(const struct LDKChannelReady *NONNULL_PTR this_ptr);
23296 * The per-commitment point of the second commitment transaction
23298 void ChannelReady_set_next_per_commitment_point(struct LDKChannelReady *NONNULL_PTR this_ptr, struct LDKPublicKey val);
23301 * If set, provides a short_channel_id alias for this channel. The sender will accept payments
23302 * to be forwarded over this SCID and forward them to this messages' recipient.
23304 struct LDKCOption_u64Z ChannelReady_get_short_channel_id_alias(const struct LDKChannelReady *NONNULL_PTR this_ptr);
23307 * If set, provides a short_channel_id alias for this channel. The sender will accept payments
23308 * to be forwarded over this SCID and forward them to this messages' recipient.
23310 void ChannelReady_set_short_channel_id_alias(struct LDKChannelReady *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
23313 * Constructs a new ChannelReady given each field
23315 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);
23318 * Creates a copy of the ChannelReady
23320 struct LDKChannelReady ChannelReady_clone(const struct LDKChannelReady *NONNULL_PTR orig);
23323 * Frees any resources used by the Shutdown, if is_owned is set and inner is non-NULL.
23325 void Shutdown_free(struct LDKShutdown this_obj);
23330 const uint8_t (*Shutdown_get_channel_id(const struct LDKShutdown *NONNULL_PTR this_ptr))[32];
23335 void Shutdown_set_channel_id(struct LDKShutdown *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
23338 * The destination of this peer's funds on closing.
23339 * Must be in one of these forms: p2pkh, p2sh, p2wpkh, p2wsh.
23341 struct LDKu8slice Shutdown_get_scriptpubkey(const struct LDKShutdown *NONNULL_PTR this_ptr);
23344 * The destination of this peer's funds on closing.
23345 * Must be in one of these forms: p2pkh, p2sh, p2wpkh, p2wsh.
23347 void Shutdown_set_scriptpubkey(struct LDKShutdown *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val);
23350 * Constructs a new Shutdown given each field
23352 MUST_USE_RES struct LDKShutdown Shutdown_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKCVec_u8Z scriptpubkey_arg);
23355 * Creates a copy of the Shutdown
23357 struct LDKShutdown Shutdown_clone(const struct LDKShutdown *NONNULL_PTR orig);
23360 * Frees any resources used by the ClosingSignedFeeRange, if is_owned is set and inner is non-NULL.
23362 void ClosingSignedFeeRange_free(struct LDKClosingSignedFeeRange this_obj);
23365 * The minimum absolute fee, in satoshis, which the sender is willing to place on the closing
23368 uint64_t ClosingSignedFeeRange_get_min_fee_satoshis(const struct LDKClosingSignedFeeRange *NONNULL_PTR this_ptr);
23371 * The minimum absolute fee, in satoshis, which the sender is willing to place on the closing
23374 void ClosingSignedFeeRange_set_min_fee_satoshis(struct LDKClosingSignedFeeRange *NONNULL_PTR this_ptr, uint64_t val);
23377 * The maximum absolute fee, in satoshis, which the sender is willing to place on the closing
23380 uint64_t ClosingSignedFeeRange_get_max_fee_satoshis(const struct LDKClosingSignedFeeRange *NONNULL_PTR this_ptr);
23383 * The maximum absolute fee, in satoshis, which the sender is willing to place on the closing
23386 void ClosingSignedFeeRange_set_max_fee_satoshis(struct LDKClosingSignedFeeRange *NONNULL_PTR this_ptr, uint64_t val);
23389 * Constructs a new ClosingSignedFeeRange given each field
23391 MUST_USE_RES struct LDKClosingSignedFeeRange ClosingSignedFeeRange_new(uint64_t min_fee_satoshis_arg, uint64_t max_fee_satoshis_arg);
23394 * Creates a copy of the ClosingSignedFeeRange
23396 struct LDKClosingSignedFeeRange ClosingSignedFeeRange_clone(const struct LDKClosingSignedFeeRange *NONNULL_PTR orig);
23399 * Frees any resources used by the ClosingSigned, if is_owned is set and inner is non-NULL.
23401 void ClosingSigned_free(struct LDKClosingSigned this_obj);
23406 const uint8_t (*ClosingSigned_get_channel_id(const struct LDKClosingSigned *NONNULL_PTR this_ptr))[32];
23411 void ClosingSigned_set_channel_id(struct LDKClosingSigned *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
23414 * The proposed total fee for the closing transaction
23416 uint64_t ClosingSigned_get_fee_satoshis(const struct LDKClosingSigned *NONNULL_PTR this_ptr);
23419 * The proposed total fee for the closing transaction
23421 void ClosingSigned_set_fee_satoshis(struct LDKClosingSigned *NONNULL_PTR this_ptr, uint64_t val);
23424 * A signature on the closing transaction
23426 struct LDKSignature ClosingSigned_get_signature(const struct LDKClosingSigned *NONNULL_PTR this_ptr);
23429 * A signature on the closing transaction
23431 void ClosingSigned_set_signature(struct LDKClosingSigned *NONNULL_PTR this_ptr, struct LDKSignature val);
23434 * The minimum and maximum fees which the sender is willing to accept, provided only by new
23437 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
23439 struct LDKClosingSignedFeeRange ClosingSigned_get_fee_range(const struct LDKClosingSigned *NONNULL_PTR this_ptr);
23442 * The minimum and maximum fees which the sender is willing to accept, provided only by new
23445 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
23447 void ClosingSigned_set_fee_range(struct LDKClosingSigned *NONNULL_PTR this_ptr, struct LDKClosingSignedFeeRange val);
23450 * Constructs a new ClosingSigned given each field
23452 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);
23455 * Creates a copy of the ClosingSigned
23457 struct LDKClosingSigned ClosingSigned_clone(const struct LDKClosingSigned *NONNULL_PTR orig);
23460 * Frees any resources used by the UpdateAddHTLC, if is_owned is set and inner is non-NULL.
23462 void UpdateAddHTLC_free(struct LDKUpdateAddHTLC this_obj);
23467 const uint8_t (*UpdateAddHTLC_get_channel_id(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr))[32];
23472 void UpdateAddHTLC_set_channel_id(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
23477 uint64_t UpdateAddHTLC_get_htlc_id(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr);
23482 void UpdateAddHTLC_set_htlc_id(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, uint64_t val);
23485 * The HTLC value in milli-satoshi
23487 uint64_t UpdateAddHTLC_get_amount_msat(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr);
23490 * The HTLC value in milli-satoshi
23492 void UpdateAddHTLC_set_amount_msat(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, uint64_t val);
23495 * The payment hash, the pre-image of which controls HTLC redemption
23497 const uint8_t (*UpdateAddHTLC_get_payment_hash(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr))[32];
23500 * The payment hash, the pre-image of which controls HTLC redemption
23502 void UpdateAddHTLC_set_payment_hash(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
23505 * The expiry height of the HTLC
23507 uint32_t UpdateAddHTLC_get_cltv_expiry(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr);
23510 * The expiry height of the HTLC
23512 void UpdateAddHTLC_set_cltv_expiry(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, uint32_t val);
23515 * Creates a copy of the UpdateAddHTLC
23517 struct LDKUpdateAddHTLC UpdateAddHTLC_clone(const struct LDKUpdateAddHTLC *NONNULL_PTR orig);
23520 * Frees any resources used by the OnionMessage, if is_owned is set and inner is non-NULL.
23522 void OnionMessage_free(struct LDKOnionMessage this_obj);
23525 * Used in decrypting the onion packet's payload.
23527 struct LDKPublicKey OnionMessage_get_blinding_point(const struct LDKOnionMessage *NONNULL_PTR this_ptr);
23530 * Used in decrypting the onion packet's payload.
23532 void OnionMessage_set_blinding_point(struct LDKOnionMessage *NONNULL_PTR this_ptr, struct LDKPublicKey val);
23535 * Creates a copy of the OnionMessage
23537 struct LDKOnionMessage OnionMessage_clone(const struct LDKOnionMessage *NONNULL_PTR orig);
23540 * Frees any resources used by the UpdateFulfillHTLC, if is_owned is set and inner is non-NULL.
23542 void UpdateFulfillHTLC_free(struct LDKUpdateFulfillHTLC this_obj);
23547 const uint8_t (*UpdateFulfillHTLC_get_channel_id(const struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr))[32];
23552 void UpdateFulfillHTLC_set_channel_id(struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
23557 uint64_t UpdateFulfillHTLC_get_htlc_id(const struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr);
23562 void UpdateFulfillHTLC_set_htlc_id(struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr, uint64_t val);
23565 * The pre-image of the payment hash, allowing HTLC redemption
23567 const uint8_t (*UpdateFulfillHTLC_get_payment_preimage(const struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr))[32];
23570 * The pre-image of the payment hash, allowing HTLC redemption
23572 void UpdateFulfillHTLC_set_payment_preimage(struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
23575 * Constructs a new UpdateFulfillHTLC given each field
23577 MUST_USE_RES struct LDKUpdateFulfillHTLC UpdateFulfillHTLC_new(struct LDKThirtyTwoBytes channel_id_arg, uint64_t htlc_id_arg, struct LDKThirtyTwoBytes payment_preimage_arg);
23580 * Creates a copy of the UpdateFulfillHTLC
23582 struct LDKUpdateFulfillHTLC UpdateFulfillHTLC_clone(const struct LDKUpdateFulfillHTLC *NONNULL_PTR orig);
23585 * Frees any resources used by the UpdateFailHTLC, if is_owned is set and inner is non-NULL.
23587 void UpdateFailHTLC_free(struct LDKUpdateFailHTLC this_obj);
23592 const uint8_t (*UpdateFailHTLC_get_channel_id(const struct LDKUpdateFailHTLC *NONNULL_PTR this_ptr))[32];
23597 void UpdateFailHTLC_set_channel_id(struct LDKUpdateFailHTLC *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
23602 uint64_t UpdateFailHTLC_get_htlc_id(const struct LDKUpdateFailHTLC *NONNULL_PTR this_ptr);
23607 void UpdateFailHTLC_set_htlc_id(struct LDKUpdateFailHTLC *NONNULL_PTR this_ptr, uint64_t val);
23610 * Creates a copy of the UpdateFailHTLC
23612 struct LDKUpdateFailHTLC UpdateFailHTLC_clone(const struct LDKUpdateFailHTLC *NONNULL_PTR orig);
23615 * Frees any resources used by the UpdateFailMalformedHTLC, if is_owned is set and inner is non-NULL.
23617 void UpdateFailMalformedHTLC_free(struct LDKUpdateFailMalformedHTLC this_obj);
23622 const uint8_t (*UpdateFailMalformedHTLC_get_channel_id(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr))[32];
23627 void UpdateFailMalformedHTLC_set_channel_id(struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
23632 uint64_t UpdateFailMalformedHTLC_get_htlc_id(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr);
23637 void UpdateFailMalformedHTLC_set_htlc_id(struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr, uint64_t val);
23642 uint16_t UpdateFailMalformedHTLC_get_failure_code(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr);
23647 void UpdateFailMalformedHTLC_set_failure_code(struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr, uint16_t val);
23650 * Creates a copy of the UpdateFailMalformedHTLC
23652 struct LDKUpdateFailMalformedHTLC UpdateFailMalformedHTLC_clone(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR orig);
23655 * Frees any resources used by the CommitmentSigned, if is_owned is set and inner is non-NULL.
23657 void CommitmentSigned_free(struct LDKCommitmentSigned this_obj);
23662 const uint8_t (*CommitmentSigned_get_channel_id(const struct LDKCommitmentSigned *NONNULL_PTR this_ptr))[32];
23667 void CommitmentSigned_set_channel_id(struct LDKCommitmentSigned *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
23670 * A signature on the commitment transaction
23672 struct LDKSignature CommitmentSigned_get_signature(const struct LDKCommitmentSigned *NONNULL_PTR this_ptr);
23675 * A signature on the commitment transaction
23677 void CommitmentSigned_set_signature(struct LDKCommitmentSigned *NONNULL_PTR this_ptr, struct LDKSignature val);
23680 * Signatures on the HTLC transactions
23682 * Returns a copy of the field.
23684 struct LDKCVec_SignatureZ CommitmentSigned_get_htlc_signatures(const struct LDKCommitmentSigned *NONNULL_PTR this_ptr);
23687 * Signatures on the HTLC transactions
23689 void CommitmentSigned_set_htlc_signatures(struct LDKCommitmentSigned *NONNULL_PTR this_ptr, struct LDKCVec_SignatureZ val);
23692 * Constructs a new CommitmentSigned given each field
23694 MUST_USE_RES struct LDKCommitmentSigned CommitmentSigned_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKSignature signature_arg, struct LDKCVec_SignatureZ htlc_signatures_arg);
23697 * Creates a copy of the CommitmentSigned
23699 struct LDKCommitmentSigned CommitmentSigned_clone(const struct LDKCommitmentSigned *NONNULL_PTR orig);
23702 * Frees any resources used by the RevokeAndACK, if is_owned is set and inner is non-NULL.
23704 void RevokeAndACK_free(struct LDKRevokeAndACK this_obj);
23709 const uint8_t (*RevokeAndACK_get_channel_id(const struct LDKRevokeAndACK *NONNULL_PTR this_ptr))[32];
23714 void RevokeAndACK_set_channel_id(struct LDKRevokeAndACK *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
23717 * The secret corresponding to the per-commitment point
23719 const uint8_t (*RevokeAndACK_get_per_commitment_secret(const struct LDKRevokeAndACK *NONNULL_PTR this_ptr))[32];
23722 * The secret corresponding to the per-commitment point
23724 void RevokeAndACK_set_per_commitment_secret(struct LDKRevokeAndACK *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
23727 * The next sender-broadcast commitment transaction's per-commitment point
23729 struct LDKPublicKey RevokeAndACK_get_next_per_commitment_point(const struct LDKRevokeAndACK *NONNULL_PTR this_ptr);
23732 * The next sender-broadcast commitment transaction's per-commitment point
23734 void RevokeAndACK_set_next_per_commitment_point(struct LDKRevokeAndACK *NONNULL_PTR this_ptr, struct LDKPublicKey val);
23737 * Constructs a new RevokeAndACK given each field
23739 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);
23742 * Creates a copy of the RevokeAndACK
23744 struct LDKRevokeAndACK RevokeAndACK_clone(const struct LDKRevokeAndACK *NONNULL_PTR orig);
23747 * Frees any resources used by the UpdateFee, if is_owned is set and inner is non-NULL.
23749 void UpdateFee_free(struct LDKUpdateFee this_obj);
23754 const uint8_t (*UpdateFee_get_channel_id(const struct LDKUpdateFee *NONNULL_PTR this_ptr))[32];
23759 void UpdateFee_set_channel_id(struct LDKUpdateFee *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
23762 * Fee rate per 1000-weight of the transaction
23764 uint32_t UpdateFee_get_feerate_per_kw(const struct LDKUpdateFee *NONNULL_PTR this_ptr);
23767 * Fee rate per 1000-weight of the transaction
23769 void UpdateFee_set_feerate_per_kw(struct LDKUpdateFee *NONNULL_PTR this_ptr, uint32_t val);
23772 * Constructs a new UpdateFee given each field
23774 MUST_USE_RES struct LDKUpdateFee UpdateFee_new(struct LDKThirtyTwoBytes channel_id_arg, uint32_t feerate_per_kw_arg);
23777 * Creates a copy of the UpdateFee
23779 struct LDKUpdateFee UpdateFee_clone(const struct LDKUpdateFee *NONNULL_PTR orig);
23782 * Frees any resources used by the DataLossProtect, if is_owned is set and inner is non-NULL.
23784 void DataLossProtect_free(struct LDKDataLossProtect this_obj);
23787 * Proof that the sender knows the per-commitment secret of a specific commitment transaction
23788 * belonging to the recipient
23790 const uint8_t (*DataLossProtect_get_your_last_per_commitment_secret(const struct LDKDataLossProtect *NONNULL_PTR this_ptr))[32];
23793 * Proof that the sender knows the per-commitment secret of a specific commitment transaction
23794 * belonging to the recipient
23796 void DataLossProtect_set_your_last_per_commitment_secret(struct LDKDataLossProtect *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
23799 * The sender's per-commitment point for their current commitment transaction
23801 struct LDKPublicKey DataLossProtect_get_my_current_per_commitment_point(const struct LDKDataLossProtect *NONNULL_PTR this_ptr);
23804 * The sender's per-commitment point for their current commitment transaction
23806 void DataLossProtect_set_my_current_per_commitment_point(struct LDKDataLossProtect *NONNULL_PTR this_ptr, struct LDKPublicKey val);
23809 * Constructs a new DataLossProtect given each field
23811 MUST_USE_RES struct LDKDataLossProtect DataLossProtect_new(struct LDKThirtyTwoBytes your_last_per_commitment_secret_arg, struct LDKPublicKey my_current_per_commitment_point_arg);
23814 * Creates a copy of the DataLossProtect
23816 struct LDKDataLossProtect DataLossProtect_clone(const struct LDKDataLossProtect *NONNULL_PTR orig);
23819 * Frees any resources used by the ChannelReestablish, if is_owned is set and inner is non-NULL.
23821 void ChannelReestablish_free(struct LDKChannelReestablish this_obj);
23826 const uint8_t (*ChannelReestablish_get_channel_id(const struct LDKChannelReestablish *NONNULL_PTR this_ptr))[32];
23831 void ChannelReestablish_set_channel_id(struct LDKChannelReestablish *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
23834 * The next commitment number for the sender
23836 uint64_t ChannelReestablish_get_next_local_commitment_number(const struct LDKChannelReestablish *NONNULL_PTR this_ptr);
23839 * The next commitment number for the sender
23841 void ChannelReestablish_set_next_local_commitment_number(struct LDKChannelReestablish *NONNULL_PTR this_ptr, uint64_t val);
23844 * The next commitment number for the recipient
23846 uint64_t ChannelReestablish_get_next_remote_commitment_number(const struct LDKChannelReestablish *NONNULL_PTR this_ptr);
23849 * The next commitment number for the recipient
23851 void ChannelReestablish_set_next_remote_commitment_number(struct LDKChannelReestablish *NONNULL_PTR this_ptr, uint64_t val);
23854 * Creates a copy of the ChannelReestablish
23856 struct LDKChannelReestablish ChannelReestablish_clone(const struct LDKChannelReestablish *NONNULL_PTR orig);
23859 * Frees any resources used by the AnnouncementSignatures, if is_owned is set and inner is non-NULL.
23861 void AnnouncementSignatures_free(struct LDKAnnouncementSignatures this_obj);
23866 const uint8_t (*AnnouncementSignatures_get_channel_id(const struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr))[32];
23871 void AnnouncementSignatures_set_channel_id(struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
23874 * The short channel ID
23876 uint64_t AnnouncementSignatures_get_short_channel_id(const struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr);
23879 * The short channel ID
23881 void AnnouncementSignatures_set_short_channel_id(struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr, uint64_t val);
23884 * A signature by the node key
23886 struct LDKSignature AnnouncementSignatures_get_node_signature(const struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr);
23889 * A signature by the node key
23891 void AnnouncementSignatures_set_node_signature(struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr, struct LDKSignature val);
23894 * A signature by the funding key
23896 struct LDKSignature AnnouncementSignatures_get_bitcoin_signature(const struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr);
23899 * A signature by the funding key
23901 void AnnouncementSignatures_set_bitcoin_signature(struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr, struct LDKSignature val);
23904 * Constructs a new AnnouncementSignatures given each field
23906 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);
23909 * Creates a copy of the AnnouncementSignatures
23911 struct LDKAnnouncementSignatures AnnouncementSignatures_clone(const struct LDKAnnouncementSignatures *NONNULL_PTR orig);
23914 * Frees any resources used by the NetAddress
23916 void NetAddress_free(struct LDKNetAddress this_ptr);
23919 * Creates a copy of the NetAddress
23921 struct LDKNetAddress NetAddress_clone(const struct LDKNetAddress *NONNULL_PTR orig);
23924 * Utility method to constructs a new IPv4-variant NetAddress
23926 struct LDKNetAddress NetAddress_ipv4(struct LDKFourBytes addr, uint16_t port);
23929 * Utility method to constructs a new IPv6-variant NetAddress
23931 struct LDKNetAddress NetAddress_ipv6(struct LDKSixteenBytes addr, uint16_t port);
23934 * Utility method to constructs a new OnionV2-variant NetAddress
23936 struct LDKNetAddress NetAddress_onion_v2(struct LDKTwelveBytes a);
23939 * Utility method to constructs a new OnionV3-variant NetAddress
23941 struct LDKNetAddress NetAddress_onion_v3(struct LDKThirtyTwoBytes ed25519_pubkey, uint16_t checksum, uint8_t version, uint16_t port);
23944 * Utility method to constructs a new Hostname-variant NetAddress
23946 struct LDKNetAddress NetAddress_hostname(struct LDKHostname hostname, uint16_t port);
23949 * Serialize the NetAddress object into a byte array which can be read by NetAddress_read
23951 struct LDKCVec_u8Z NetAddress_write(const struct LDKNetAddress *NONNULL_PTR obj);
23954 * Read a NetAddress from a byte array, created by NetAddress_write
23956 struct LDKCResult_NetAddressDecodeErrorZ NetAddress_read(struct LDKu8slice ser);
23959 * Frees any resources used by the UnsignedNodeAnnouncement, if is_owned is set and inner is non-NULL.
23961 void UnsignedNodeAnnouncement_free(struct LDKUnsignedNodeAnnouncement this_obj);
23964 * The advertised features
23966 struct LDKNodeFeatures UnsignedNodeAnnouncement_get_features(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr);
23969 * The advertised features
23971 void UnsignedNodeAnnouncement_set_features(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKNodeFeatures val);
23974 * A strictly monotonic announcement counter, with gaps allowed
23976 uint32_t UnsignedNodeAnnouncement_get_timestamp(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr);
23979 * A strictly monotonic announcement counter, with gaps allowed
23981 void UnsignedNodeAnnouncement_set_timestamp(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, uint32_t val);
23984 * The node_id this announcement originated from (don't rebroadcast the node_announcement back
23987 struct LDKPublicKey UnsignedNodeAnnouncement_get_node_id(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr);
23990 * The node_id this announcement originated from (don't rebroadcast the node_announcement back
23993 void UnsignedNodeAnnouncement_set_node_id(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKPublicKey val);
23996 * An RGB color for UI purposes
23998 const uint8_t (*UnsignedNodeAnnouncement_get_rgb(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr))[3];
24001 * An RGB color for UI purposes
24003 void UnsignedNodeAnnouncement_set_rgb(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKThreeBytes val);
24006 * An alias, for UI purposes. This should be sanitized before use. There is no guarantee
24009 const uint8_t (*UnsignedNodeAnnouncement_get_alias(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr))[32];
24012 * An alias, for UI purposes. This should be sanitized before use. There is no guarantee
24015 void UnsignedNodeAnnouncement_set_alias(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
24018 * List of addresses on which this node is reachable
24020 * Returns a copy of the field.
24022 struct LDKCVec_NetAddressZ UnsignedNodeAnnouncement_get_addresses(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr);
24025 * List of addresses on which this node is reachable
24027 void UnsignedNodeAnnouncement_set_addresses(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKCVec_NetAddressZ val);
24030 * Creates a copy of the UnsignedNodeAnnouncement
24032 struct LDKUnsignedNodeAnnouncement UnsignedNodeAnnouncement_clone(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR orig);
24035 * Frees any resources used by the NodeAnnouncement, if is_owned is set and inner is non-NULL.
24037 void NodeAnnouncement_free(struct LDKNodeAnnouncement this_obj);
24040 * The signature by the node key
24042 struct LDKSignature NodeAnnouncement_get_signature(const struct LDKNodeAnnouncement *NONNULL_PTR this_ptr);
24045 * The signature by the node key
24047 void NodeAnnouncement_set_signature(struct LDKNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKSignature val);
24050 * The actual content of the announcement
24052 struct LDKUnsignedNodeAnnouncement NodeAnnouncement_get_contents(const struct LDKNodeAnnouncement *NONNULL_PTR this_ptr);
24055 * The actual content of the announcement
24057 void NodeAnnouncement_set_contents(struct LDKNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKUnsignedNodeAnnouncement val);
24060 * Constructs a new NodeAnnouncement given each field
24062 MUST_USE_RES struct LDKNodeAnnouncement NodeAnnouncement_new(struct LDKSignature signature_arg, struct LDKUnsignedNodeAnnouncement contents_arg);
24065 * Creates a copy of the NodeAnnouncement
24067 struct LDKNodeAnnouncement NodeAnnouncement_clone(const struct LDKNodeAnnouncement *NONNULL_PTR orig);
24070 * Frees any resources used by the UnsignedChannelAnnouncement, if is_owned is set and inner is non-NULL.
24072 void UnsignedChannelAnnouncement_free(struct LDKUnsignedChannelAnnouncement this_obj);
24075 * The advertised channel features
24077 struct LDKChannelFeatures UnsignedChannelAnnouncement_get_features(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
24080 * The advertised channel features
24082 void UnsignedChannelAnnouncement_set_features(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKChannelFeatures val);
24085 * The genesis hash of the blockchain where the channel is to be opened
24087 const uint8_t (*UnsignedChannelAnnouncement_get_chain_hash(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr))[32];
24090 * The genesis hash of the blockchain where the channel is to be opened
24092 void UnsignedChannelAnnouncement_set_chain_hash(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
24095 * The short channel ID
24097 uint64_t UnsignedChannelAnnouncement_get_short_channel_id(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
24100 * The short channel ID
24102 void UnsignedChannelAnnouncement_set_short_channel_id(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, uint64_t val);
24105 * One of the two node_ids which are endpoints of this channel
24107 struct LDKPublicKey UnsignedChannelAnnouncement_get_node_id_1(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
24110 * One of the two node_ids which are endpoints of this channel
24112 void UnsignedChannelAnnouncement_set_node_id_1(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKPublicKey val);
24115 * The other of the two node_ids which are endpoints of this channel
24117 struct LDKPublicKey UnsignedChannelAnnouncement_get_node_id_2(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
24120 * The other of the two node_ids which are endpoints of this channel
24122 void UnsignedChannelAnnouncement_set_node_id_2(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKPublicKey val);
24125 * The funding key for the first node
24127 struct LDKPublicKey UnsignedChannelAnnouncement_get_bitcoin_key_1(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
24130 * The funding key for the first node
24132 void UnsignedChannelAnnouncement_set_bitcoin_key_1(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKPublicKey val);
24135 * The funding key for the second node
24137 struct LDKPublicKey UnsignedChannelAnnouncement_get_bitcoin_key_2(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
24140 * The funding key for the second node
24142 void UnsignedChannelAnnouncement_set_bitcoin_key_2(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKPublicKey val);
24145 * Creates a copy of the UnsignedChannelAnnouncement
24147 struct LDKUnsignedChannelAnnouncement UnsignedChannelAnnouncement_clone(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR orig);
24150 * Frees any resources used by the ChannelAnnouncement, if is_owned is set and inner is non-NULL.
24152 void ChannelAnnouncement_free(struct LDKChannelAnnouncement this_obj);
24155 * Authentication of the announcement by the first public node
24157 struct LDKSignature ChannelAnnouncement_get_node_signature_1(const struct LDKChannelAnnouncement *NONNULL_PTR this_ptr);
24160 * Authentication of the announcement by the first public node
24162 void ChannelAnnouncement_set_node_signature_1(struct LDKChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKSignature val);
24165 * Authentication of the announcement by the second public node
24167 struct LDKSignature ChannelAnnouncement_get_node_signature_2(const struct LDKChannelAnnouncement *NONNULL_PTR this_ptr);
24170 * Authentication of the announcement by the second public node
24172 void ChannelAnnouncement_set_node_signature_2(struct LDKChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKSignature val);
24175 * Proof of funding UTXO ownership by the first public node
24177 struct LDKSignature ChannelAnnouncement_get_bitcoin_signature_1(const struct LDKChannelAnnouncement *NONNULL_PTR this_ptr);
24180 * Proof of funding UTXO ownership by the first public node
24182 void ChannelAnnouncement_set_bitcoin_signature_1(struct LDKChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKSignature val);
24185 * Proof of funding UTXO ownership by the second public node
24187 struct LDKSignature ChannelAnnouncement_get_bitcoin_signature_2(const struct LDKChannelAnnouncement *NONNULL_PTR this_ptr);
24190 * Proof of funding UTXO ownership by the second public node
24192 void ChannelAnnouncement_set_bitcoin_signature_2(struct LDKChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKSignature val);
24195 * The actual announcement
24197 struct LDKUnsignedChannelAnnouncement ChannelAnnouncement_get_contents(const struct LDKChannelAnnouncement *NONNULL_PTR this_ptr);
24200 * The actual announcement
24202 void ChannelAnnouncement_set_contents(struct LDKChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKUnsignedChannelAnnouncement val);
24205 * Constructs a new ChannelAnnouncement given each field
24207 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);
24210 * Creates a copy of the ChannelAnnouncement
24212 struct LDKChannelAnnouncement ChannelAnnouncement_clone(const struct LDKChannelAnnouncement *NONNULL_PTR orig);
24215 * Frees any resources used by the UnsignedChannelUpdate, if is_owned is set and inner is non-NULL.
24217 void UnsignedChannelUpdate_free(struct LDKUnsignedChannelUpdate this_obj);
24220 * The genesis hash of the blockchain where the channel is to be opened
24222 const uint8_t (*UnsignedChannelUpdate_get_chain_hash(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr))[32];
24225 * The genesis hash of the blockchain where the channel is to be opened
24227 void UnsignedChannelUpdate_set_chain_hash(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
24230 * The short channel ID
24232 uint64_t UnsignedChannelUpdate_get_short_channel_id(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
24235 * The short channel ID
24237 void UnsignedChannelUpdate_set_short_channel_id(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint64_t val);
24240 * A strictly monotonic announcement counter, with gaps allowed, specific to this channel
24242 uint32_t UnsignedChannelUpdate_get_timestamp(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
24245 * A strictly monotonic announcement counter, with gaps allowed, specific to this channel
24247 void UnsignedChannelUpdate_set_timestamp(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint32_t val);
24252 uint8_t UnsignedChannelUpdate_get_flags(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
24257 void UnsignedChannelUpdate_set_flags(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint8_t val);
24260 * The number of blocks such that if:
24261 * `incoming_htlc.cltv_expiry < outgoing_htlc.cltv_expiry + cltv_expiry_delta`
24262 * then we need to fail the HTLC backwards. When forwarding an HTLC, cltv_expiry_delta determines
24263 * the outgoing HTLC's minimum cltv_expiry value -- so, if an incoming HTLC comes in with a
24264 * cltv_expiry of 100000, and the node we're forwarding to has a cltv_expiry_delta value of 10,
24265 * then we'll check that the outgoing HTLC's cltv_expiry value is at least 100010 before
24266 * forwarding. Note that the HTLC sender is the one who originally sets this value when
24267 * constructing the route.
24269 uint16_t UnsignedChannelUpdate_get_cltv_expiry_delta(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
24272 * The number of blocks such that if:
24273 * `incoming_htlc.cltv_expiry < outgoing_htlc.cltv_expiry + cltv_expiry_delta`
24274 * then we need to fail the HTLC backwards. When forwarding an HTLC, cltv_expiry_delta determines
24275 * the outgoing HTLC's minimum cltv_expiry value -- so, if an incoming HTLC comes in with a
24276 * cltv_expiry of 100000, and the node we're forwarding to has a cltv_expiry_delta value of 10,
24277 * then we'll check that the outgoing HTLC's cltv_expiry value is at least 100010 before
24278 * forwarding. Note that the HTLC sender is the one who originally sets this value when
24279 * constructing the route.
24281 void UnsignedChannelUpdate_set_cltv_expiry_delta(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint16_t val);
24284 * The minimum HTLC size incoming to sender, in milli-satoshi
24286 uint64_t UnsignedChannelUpdate_get_htlc_minimum_msat(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
24289 * The minimum HTLC size incoming to sender, in milli-satoshi
24291 void UnsignedChannelUpdate_set_htlc_minimum_msat(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint64_t val);
24294 * The maximum HTLC value incoming to sender, in milli-satoshi. Used to be optional.
24296 uint64_t UnsignedChannelUpdate_get_htlc_maximum_msat(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
24299 * The maximum HTLC value incoming to sender, in milli-satoshi. Used to be optional.
24301 void UnsignedChannelUpdate_set_htlc_maximum_msat(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint64_t val);
24304 * The base HTLC fee charged by sender, in milli-satoshi
24306 uint32_t UnsignedChannelUpdate_get_fee_base_msat(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
24309 * The base HTLC fee charged by sender, in milli-satoshi
24311 void UnsignedChannelUpdate_set_fee_base_msat(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint32_t val);
24314 * The amount to fee multiplier, in micro-satoshi
24316 uint32_t UnsignedChannelUpdate_get_fee_proportional_millionths(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
24319 * The amount to fee multiplier, in micro-satoshi
24321 void UnsignedChannelUpdate_set_fee_proportional_millionths(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint32_t val);
24324 * Excess data which was signed as a part of the message which we do not (yet) understand how
24325 * to decode. This is stored to ensure forward-compatibility as new fields are added to the
24328 * Returns a copy of the field.
24330 struct LDKCVec_u8Z UnsignedChannelUpdate_get_excess_data(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
24333 * Excess data which was signed as a part of the message which we do not (yet) understand how
24334 * to decode. This is stored to ensure forward-compatibility as new fields are added to the
24337 void UnsignedChannelUpdate_set_excess_data(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val);
24340 * Constructs a new UnsignedChannelUpdate given each field
24342 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);
24345 * Creates a copy of the UnsignedChannelUpdate
24347 struct LDKUnsignedChannelUpdate UnsignedChannelUpdate_clone(const struct LDKUnsignedChannelUpdate *NONNULL_PTR orig);
24350 * Frees any resources used by the ChannelUpdate, if is_owned is set and inner is non-NULL.
24352 void ChannelUpdate_free(struct LDKChannelUpdate this_obj);
24355 * A signature of the channel update
24357 struct LDKSignature ChannelUpdate_get_signature(const struct LDKChannelUpdate *NONNULL_PTR this_ptr);
24360 * A signature of the channel update
24362 void ChannelUpdate_set_signature(struct LDKChannelUpdate *NONNULL_PTR this_ptr, struct LDKSignature val);
24365 * The actual channel update
24367 struct LDKUnsignedChannelUpdate ChannelUpdate_get_contents(const struct LDKChannelUpdate *NONNULL_PTR this_ptr);
24370 * The actual channel update
24372 void ChannelUpdate_set_contents(struct LDKChannelUpdate *NONNULL_PTR this_ptr, struct LDKUnsignedChannelUpdate val);
24375 * Constructs a new ChannelUpdate given each field
24377 MUST_USE_RES struct LDKChannelUpdate ChannelUpdate_new(struct LDKSignature signature_arg, struct LDKUnsignedChannelUpdate contents_arg);
24380 * Creates a copy of the ChannelUpdate
24382 struct LDKChannelUpdate ChannelUpdate_clone(const struct LDKChannelUpdate *NONNULL_PTR orig);
24385 * Frees any resources used by the QueryChannelRange, if is_owned is set and inner is non-NULL.
24387 void QueryChannelRange_free(struct LDKQueryChannelRange this_obj);
24390 * The genesis hash of the blockchain being queried
24392 const uint8_t (*QueryChannelRange_get_chain_hash(const struct LDKQueryChannelRange *NONNULL_PTR this_ptr))[32];
24395 * The genesis hash of the blockchain being queried
24397 void QueryChannelRange_set_chain_hash(struct LDKQueryChannelRange *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
24400 * The height of the first block for the channel UTXOs being queried
24402 uint32_t QueryChannelRange_get_first_blocknum(const struct LDKQueryChannelRange *NONNULL_PTR this_ptr);
24405 * The height of the first block for the channel UTXOs being queried
24407 void QueryChannelRange_set_first_blocknum(struct LDKQueryChannelRange *NONNULL_PTR this_ptr, uint32_t val);
24410 * The number of blocks to include in the query results
24412 uint32_t QueryChannelRange_get_number_of_blocks(const struct LDKQueryChannelRange *NONNULL_PTR this_ptr);
24415 * The number of blocks to include in the query results
24417 void QueryChannelRange_set_number_of_blocks(struct LDKQueryChannelRange *NONNULL_PTR this_ptr, uint32_t val);
24420 * Constructs a new QueryChannelRange given each field
24422 MUST_USE_RES struct LDKQueryChannelRange QueryChannelRange_new(struct LDKThirtyTwoBytes chain_hash_arg, uint32_t first_blocknum_arg, uint32_t number_of_blocks_arg);
24425 * Creates a copy of the QueryChannelRange
24427 struct LDKQueryChannelRange QueryChannelRange_clone(const struct LDKQueryChannelRange *NONNULL_PTR orig);
24430 * Frees any resources used by the ReplyChannelRange, if is_owned is set and inner is non-NULL.
24432 void ReplyChannelRange_free(struct LDKReplyChannelRange this_obj);
24435 * The genesis hash of the blockchain being queried
24437 const uint8_t (*ReplyChannelRange_get_chain_hash(const struct LDKReplyChannelRange *NONNULL_PTR this_ptr))[32];
24440 * The genesis hash of the blockchain being queried
24442 void ReplyChannelRange_set_chain_hash(struct LDKReplyChannelRange *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
24445 * The height of the first block in the range of the reply
24447 uint32_t ReplyChannelRange_get_first_blocknum(const struct LDKReplyChannelRange *NONNULL_PTR this_ptr);
24450 * The height of the first block in the range of the reply
24452 void ReplyChannelRange_set_first_blocknum(struct LDKReplyChannelRange *NONNULL_PTR this_ptr, uint32_t val);
24455 * The number of blocks included in the range of the reply
24457 uint32_t ReplyChannelRange_get_number_of_blocks(const struct LDKReplyChannelRange *NONNULL_PTR this_ptr);
24460 * The number of blocks included in the range of the reply
24462 void ReplyChannelRange_set_number_of_blocks(struct LDKReplyChannelRange *NONNULL_PTR this_ptr, uint32_t val);
24465 * True when this is the final reply for a query
24467 bool ReplyChannelRange_get_sync_complete(const struct LDKReplyChannelRange *NONNULL_PTR this_ptr);
24470 * True when this is the final reply for a query
24472 void ReplyChannelRange_set_sync_complete(struct LDKReplyChannelRange *NONNULL_PTR this_ptr, bool val);
24475 * The short_channel_ids in the channel range
24477 * Returns a copy of the field.
24479 struct LDKCVec_u64Z ReplyChannelRange_get_short_channel_ids(const struct LDKReplyChannelRange *NONNULL_PTR this_ptr);
24482 * The short_channel_ids in the channel range
24484 void ReplyChannelRange_set_short_channel_ids(struct LDKReplyChannelRange *NONNULL_PTR this_ptr, struct LDKCVec_u64Z val);
24487 * Constructs a new ReplyChannelRange given each field
24489 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);
24492 * Creates a copy of the ReplyChannelRange
24494 struct LDKReplyChannelRange ReplyChannelRange_clone(const struct LDKReplyChannelRange *NONNULL_PTR orig);
24497 * Frees any resources used by the QueryShortChannelIds, if is_owned is set and inner is non-NULL.
24499 void QueryShortChannelIds_free(struct LDKQueryShortChannelIds this_obj);
24502 * The genesis hash of the blockchain being queried
24504 const uint8_t (*QueryShortChannelIds_get_chain_hash(const struct LDKQueryShortChannelIds *NONNULL_PTR this_ptr))[32];
24507 * The genesis hash of the blockchain being queried
24509 void QueryShortChannelIds_set_chain_hash(struct LDKQueryShortChannelIds *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
24512 * The short_channel_ids that are being queried
24514 * Returns a copy of the field.
24516 struct LDKCVec_u64Z QueryShortChannelIds_get_short_channel_ids(const struct LDKQueryShortChannelIds *NONNULL_PTR this_ptr);
24519 * The short_channel_ids that are being queried
24521 void QueryShortChannelIds_set_short_channel_ids(struct LDKQueryShortChannelIds *NONNULL_PTR this_ptr, struct LDKCVec_u64Z val);
24524 * Constructs a new QueryShortChannelIds given each field
24526 MUST_USE_RES struct LDKQueryShortChannelIds QueryShortChannelIds_new(struct LDKThirtyTwoBytes chain_hash_arg, struct LDKCVec_u64Z short_channel_ids_arg);
24529 * Creates a copy of the QueryShortChannelIds
24531 struct LDKQueryShortChannelIds QueryShortChannelIds_clone(const struct LDKQueryShortChannelIds *NONNULL_PTR orig);
24534 * Frees any resources used by the ReplyShortChannelIdsEnd, if is_owned is set and inner is non-NULL.
24536 void ReplyShortChannelIdsEnd_free(struct LDKReplyShortChannelIdsEnd this_obj);
24539 * The genesis hash of the blockchain that was queried
24541 const uint8_t (*ReplyShortChannelIdsEnd_get_chain_hash(const struct LDKReplyShortChannelIdsEnd *NONNULL_PTR this_ptr))[32];
24544 * The genesis hash of the blockchain that was queried
24546 void ReplyShortChannelIdsEnd_set_chain_hash(struct LDKReplyShortChannelIdsEnd *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
24549 * Indicates if the query recipient maintains up-to-date channel
24550 * information for the chain_hash
24552 bool ReplyShortChannelIdsEnd_get_full_information(const struct LDKReplyShortChannelIdsEnd *NONNULL_PTR this_ptr);
24555 * Indicates if the query recipient maintains up-to-date channel
24556 * information for the chain_hash
24558 void ReplyShortChannelIdsEnd_set_full_information(struct LDKReplyShortChannelIdsEnd *NONNULL_PTR this_ptr, bool val);
24561 * Constructs a new ReplyShortChannelIdsEnd given each field
24563 MUST_USE_RES struct LDKReplyShortChannelIdsEnd ReplyShortChannelIdsEnd_new(struct LDKThirtyTwoBytes chain_hash_arg, bool full_information_arg);
24566 * Creates a copy of the ReplyShortChannelIdsEnd
24568 struct LDKReplyShortChannelIdsEnd ReplyShortChannelIdsEnd_clone(const struct LDKReplyShortChannelIdsEnd *NONNULL_PTR orig);
24571 * Frees any resources used by the GossipTimestampFilter, if is_owned is set and inner is non-NULL.
24573 void GossipTimestampFilter_free(struct LDKGossipTimestampFilter this_obj);
24576 * The genesis hash of the blockchain for channel and node information
24578 const uint8_t (*GossipTimestampFilter_get_chain_hash(const struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr))[32];
24581 * The genesis hash of the blockchain for channel and node information
24583 void GossipTimestampFilter_set_chain_hash(struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
24586 * The starting unix timestamp
24588 uint32_t GossipTimestampFilter_get_first_timestamp(const struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr);
24591 * The starting unix timestamp
24593 void GossipTimestampFilter_set_first_timestamp(struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr, uint32_t val);
24596 * The range of information in seconds
24598 uint32_t GossipTimestampFilter_get_timestamp_range(const struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr);
24601 * The range of information in seconds
24603 void GossipTimestampFilter_set_timestamp_range(struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr, uint32_t val);
24606 * Constructs a new GossipTimestampFilter given each field
24608 MUST_USE_RES struct LDKGossipTimestampFilter GossipTimestampFilter_new(struct LDKThirtyTwoBytes chain_hash_arg, uint32_t first_timestamp_arg, uint32_t timestamp_range_arg);
24611 * Creates a copy of the GossipTimestampFilter
24613 struct LDKGossipTimestampFilter GossipTimestampFilter_clone(const struct LDKGossipTimestampFilter *NONNULL_PTR orig);
24616 * Frees any resources used by the ErrorAction
24618 void ErrorAction_free(struct LDKErrorAction this_ptr);
24621 * Creates a copy of the ErrorAction
24623 struct LDKErrorAction ErrorAction_clone(const struct LDKErrorAction *NONNULL_PTR orig);
24626 * Utility method to constructs a new DisconnectPeer-variant ErrorAction
24628 struct LDKErrorAction ErrorAction_disconnect_peer(struct LDKErrorMessage msg);
24631 * Utility method to constructs a new IgnoreError-variant ErrorAction
24633 struct LDKErrorAction ErrorAction_ignore_error(void);
24636 * Utility method to constructs a new IgnoreAndLog-variant ErrorAction
24638 struct LDKErrorAction ErrorAction_ignore_and_log(enum LDKLevel a);
24641 * Utility method to constructs a new IgnoreDuplicateGossip-variant ErrorAction
24643 struct LDKErrorAction ErrorAction_ignore_duplicate_gossip(void);
24646 * Utility method to constructs a new SendErrorMessage-variant ErrorAction
24648 struct LDKErrorAction ErrorAction_send_error_message(struct LDKErrorMessage msg);
24651 * Utility method to constructs a new SendWarningMessage-variant ErrorAction
24653 struct LDKErrorAction ErrorAction_send_warning_message(struct LDKWarningMessage msg, enum LDKLevel log_level);
24656 * Frees any resources used by the LightningError, if is_owned is set and inner is non-NULL.
24658 void LightningError_free(struct LDKLightningError this_obj);
24661 * A human-readable message describing the error
24663 struct LDKStr LightningError_get_err(const struct LDKLightningError *NONNULL_PTR this_ptr);
24666 * A human-readable message describing the error
24668 void LightningError_set_err(struct LDKLightningError *NONNULL_PTR this_ptr, struct LDKStr val);
24671 * The action which should be taken against the offending peer.
24673 struct LDKErrorAction LightningError_get_action(const struct LDKLightningError *NONNULL_PTR this_ptr);
24676 * The action which should be taken against the offending peer.
24678 void LightningError_set_action(struct LDKLightningError *NONNULL_PTR this_ptr, struct LDKErrorAction val);
24681 * Constructs a new LightningError given each field
24683 MUST_USE_RES struct LDKLightningError LightningError_new(struct LDKStr err_arg, struct LDKErrorAction action_arg);
24686 * Creates a copy of the LightningError
24688 struct LDKLightningError LightningError_clone(const struct LDKLightningError *NONNULL_PTR orig);
24691 * Frees any resources used by the CommitmentUpdate, if is_owned is set and inner is non-NULL.
24693 void CommitmentUpdate_free(struct LDKCommitmentUpdate this_obj);
24696 * update_add_htlc messages which should be sent
24698 struct LDKCVec_UpdateAddHTLCZ CommitmentUpdate_get_update_add_htlcs(const struct LDKCommitmentUpdate *NONNULL_PTR this_ptr);
24701 * update_add_htlc messages which should be sent
24703 void CommitmentUpdate_set_update_add_htlcs(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKCVec_UpdateAddHTLCZ val);
24706 * update_fulfill_htlc messages which should be sent
24708 struct LDKCVec_UpdateFulfillHTLCZ CommitmentUpdate_get_update_fulfill_htlcs(const struct LDKCommitmentUpdate *NONNULL_PTR this_ptr);
24711 * update_fulfill_htlc messages which should be sent
24713 void CommitmentUpdate_set_update_fulfill_htlcs(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKCVec_UpdateFulfillHTLCZ val);
24716 * update_fail_htlc messages which should be sent
24718 struct LDKCVec_UpdateFailHTLCZ CommitmentUpdate_get_update_fail_htlcs(const struct LDKCommitmentUpdate *NONNULL_PTR this_ptr);
24721 * update_fail_htlc messages which should be sent
24723 void CommitmentUpdate_set_update_fail_htlcs(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKCVec_UpdateFailHTLCZ val);
24726 * update_fail_malformed_htlc messages which should be sent
24728 struct LDKCVec_UpdateFailMalformedHTLCZ CommitmentUpdate_get_update_fail_malformed_htlcs(const struct LDKCommitmentUpdate *NONNULL_PTR this_ptr);
24731 * update_fail_malformed_htlc messages which should be sent
24733 void CommitmentUpdate_set_update_fail_malformed_htlcs(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKCVec_UpdateFailMalformedHTLCZ val);
24736 * An update_fee message which should be sent
24738 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
24740 struct LDKUpdateFee CommitmentUpdate_get_update_fee(const struct LDKCommitmentUpdate *NONNULL_PTR this_ptr);
24743 * An update_fee message which should be sent
24745 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
24747 void CommitmentUpdate_set_update_fee(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKUpdateFee val);
24750 * Finally, the commitment_signed message which should be sent
24752 struct LDKCommitmentSigned CommitmentUpdate_get_commitment_signed(const struct LDKCommitmentUpdate *NONNULL_PTR this_ptr);
24755 * Finally, the commitment_signed message which should be sent
24757 void CommitmentUpdate_set_commitment_signed(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKCommitmentSigned val);
24760 * Constructs a new CommitmentUpdate given each field
24762 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);
24765 * Creates a copy of the CommitmentUpdate
24767 struct LDKCommitmentUpdate CommitmentUpdate_clone(const struct LDKCommitmentUpdate *NONNULL_PTR orig);
24770 * Calls the free function if one is set
24772 void ChannelMessageHandler_free(struct LDKChannelMessageHandler this_ptr);
24775 * Calls the free function if one is set
24777 void RoutingMessageHandler_free(struct LDKRoutingMessageHandler this_ptr);
24780 * Calls the free function if one is set
24782 void OnionMessageHandler_free(struct LDKOnionMessageHandler this_ptr);
24785 * Serialize the AcceptChannel object into a byte array which can be read by AcceptChannel_read
24787 struct LDKCVec_u8Z AcceptChannel_write(const struct LDKAcceptChannel *NONNULL_PTR obj);
24790 * Read a AcceptChannel from a byte array, created by AcceptChannel_write
24792 struct LDKCResult_AcceptChannelDecodeErrorZ AcceptChannel_read(struct LDKu8slice ser);
24795 * Serialize the AnnouncementSignatures object into a byte array which can be read by AnnouncementSignatures_read
24797 struct LDKCVec_u8Z AnnouncementSignatures_write(const struct LDKAnnouncementSignatures *NONNULL_PTR obj);
24800 * Read a AnnouncementSignatures from a byte array, created by AnnouncementSignatures_write
24802 struct LDKCResult_AnnouncementSignaturesDecodeErrorZ AnnouncementSignatures_read(struct LDKu8slice ser);
24805 * Serialize the ChannelReestablish object into a byte array which can be read by ChannelReestablish_read
24807 struct LDKCVec_u8Z ChannelReestablish_write(const struct LDKChannelReestablish *NONNULL_PTR obj);
24810 * Read a ChannelReestablish from a byte array, created by ChannelReestablish_write
24812 struct LDKCResult_ChannelReestablishDecodeErrorZ ChannelReestablish_read(struct LDKu8slice ser);
24815 * Serialize the ClosingSigned object into a byte array which can be read by ClosingSigned_read
24817 struct LDKCVec_u8Z ClosingSigned_write(const struct LDKClosingSigned *NONNULL_PTR obj);
24820 * Read a ClosingSigned from a byte array, created by ClosingSigned_write
24822 struct LDKCResult_ClosingSignedDecodeErrorZ ClosingSigned_read(struct LDKu8slice ser);
24825 * Serialize the ClosingSignedFeeRange object into a byte array which can be read by ClosingSignedFeeRange_read
24827 struct LDKCVec_u8Z ClosingSignedFeeRange_write(const struct LDKClosingSignedFeeRange *NONNULL_PTR obj);
24830 * Read a ClosingSignedFeeRange from a byte array, created by ClosingSignedFeeRange_write
24832 struct LDKCResult_ClosingSignedFeeRangeDecodeErrorZ ClosingSignedFeeRange_read(struct LDKu8slice ser);
24835 * Serialize the CommitmentSigned object into a byte array which can be read by CommitmentSigned_read
24837 struct LDKCVec_u8Z CommitmentSigned_write(const struct LDKCommitmentSigned *NONNULL_PTR obj);
24840 * Read a CommitmentSigned from a byte array, created by CommitmentSigned_write
24842 struct LDKCResult_CommitmentSignedDecodeErrorZ CommitmentSigned_read(struct LDKu8slice ser);
24845 * Serialize the FundingCreated object into a byte array which can be read by FundingCreated_read
24847 struct LDKCVec_u8Z FundingCreated_write(const struct LDKFundingCreated *NONNULL_PTR obj);
24850 * Read a FundingCreated from a byte array, created by FundingCreated_write
24852 struct LDKCResult_FundingCreatedDecodeErrorZ FundingCreated_read(struct LDKu8slice ser);
24855 * Serialize the FundingSigned object into a byte array which can be read by FundingSigned_read
24857 struct LDKCVec_u8Z FundingSigned_write(const struct LDKFundingSigned *NONNULL_PTR obj);
24860 * Read a FundingSigned from a byte array, created by FundingSigned_write
24862 struct LDKCResult_FundingSignedDecodeErrorZ FundingSigned_read(struct LDKu8slice ser);
24865 * Serialize the ChannelReady object into a byte array which can be read by ChannelReady_read
24867 struct LDKCVec_u8Z ChannelReady_write(const struct LDKChannelReady *NONNULL_PTR obj);
24870 * Read a ChannelReady from a byte array, created by ChannelReady_write
24872 struct LDKCResult_ChannelReadyDecodeErrorZ ChannelReady_read(struct LDKu8slice ser);
24875 * Serialize the Init object into a byte array which can be read by Init_read
24877 struct LDKCVec_u8Z Init_write(const struct LDKInit *NONNULL_PTR obj);
24880 * Read a Init from a byte array, created by Init_write
24882 struct LDKCResult_InitDecodeErrorZ Init_read(struct LDKu8slice ser);
24885 * Serialize the OpenChannel object into a byte array which can be read by OpenChannel_read
24887 struct LDKCVec_u8Z OpenChannel_write(const struct LDKOpenChannel *NONNULL_PTR obj);
24890 * Read a OpenChannel from a byte array, created by OpenChannel_write
24892 struct LDKCResult_OpenChannelDecodeErrorZ OpenChannel_read(struct LDKu8slice ser);
24895 * Serialize the RevokeAndACK object into a byte array which can be read by RevokeAndACK_read
24897 struct LDKCVec_u8Z RevokeAndACK_write(const struct LDKRevokeAndACK *NONNULL_PTR obj);
24900 * Read a RevokeAndACK from a byte array, created by RevokeAndACK_write
24902 struct LDKCResult_RevokeAndACKDecodeErrorZ RevokeAndACK_read(struct LDKu8slice ser);
24905 * Serialize the Shutdown object into a byte array which can be read by Shutdown_read
24907 struct LDKCVec_u8Z Shutdown_write(const struct LDKShutdown *NONNULL_PTR obj);
24910 * Read a Shutdown from a byte array, created by Shutdown_write
24912 struct LDKCResult_ShutdownDecodeErrorZ Shutdown_read(struct LDKu8slice ser);
24915 * Serialize the UpdateFailHTLC object into a byte array which can be read by UpdateFailHTLC_read
24917 struct LDKCVec_u8Z UpdateFailHTLC_write(const struct LDKUpdateFailHTLC *NONNULL_PTR obj);
24920 * Read a UpdateFailHTLC from a byte array, created by UpdateFailHTLC_write
24922 struct LDKCResult_UpdateFailHTLCDecodeErrorZ UpdateFailHTLC_read(struct LDKu8slice ser);
24925 * Serialize the UpdateFailMalformedHTLC object into a byte array which can be read by UpdateFailMalformedHTLC_read
24927 struct LDKCVec_u8Z UpdateFailMalformedHTLC_write(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR obj);
24930 * Read a UpdateFailMalformedHTLC from a byte array, created by UpdateFailMalformedHTLC_write
24932 struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ UpdateFailMalformedHTLC_read(struct LDKu8slice ser);
24935 * Serialize the UpdateFee object into a byte array which can be read by UpdateFee_read
24937 struct LDKCVec_u8Z UpdateFee_write(const struct LDKUpdateFee *NONNULL_PTR obj);
24940 * Read a UpdateFee from a byte array, created by UpdateFee_write
24942 struct LDKCResult_UpdateFeeDecodeErrorZ UpdateFee_read(struct LDKu8slice ser);
24945 * Serialize the UpdateFulfillHTLC object into a byte array which can be read by UpdateFulfillHTLC_read
24947 struct LDKCVec_u8Z UpdateFulfillHTLC_write(const struct LDKUpdateFulfillHTLC *NONNULL_PTR obj);
24950 * Read a UpdateFulfillHTLC from a byte array, created by UpdateFulfillHTLC_write
24952 struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ UpdateFulfillHTLC_read(struct LDKu8slice ser);
24955 * Serialize the UpdateAddHTLC object into a byte array which can be read by UpdateAddHTLC_read
24957 struct LDKCVec_u8Z UpdateAddHTLC_write(const struct LDKUpdateAddHTLC *NONNULL_PTR obj);
24960 * Read a UpdateAddHTLC from a byte array, created by UpdateAddHTLC_write
24962 struct LDKCResult_UpdateAddHTLCDecodeErrorZ UpdateAddHTLC_read(struct LDKu8slice ser);
24965 * Read a OnionMessage from a byte array, created by OnionMessage_write
24967 struct LDKCResult_OnionMessageDecodeErrorZ OnionMessage_read(struct LDKu8slice ser);
24970 * Serialize the OnionMessage object into a byte array which can be read by OnionMessage_read
24972 struct LDKCVec_u8Z OnionMessage_write(const struct LDKOnionMessage *NONNULL_PTR obj);
24975 * Serialize the Ping object into a byte array which can be read by Ping_read
24977 struct LDKCVec_u8Z Ping_write(const struct LDKPing *NONNULL_PTR obj);
24980 * Read a Ping from a byte array, created by Ping_write
24982 struct LDKCResult_PingDecodeErrorZ Ping_read(struct LDKu8slice ser);
24985 * Serialize the Pong object into a byte array which can be read by Pong_read
24987 struct LDKCVec_u8Z Pong_write(const struct LDKPong *NONNULL_PTR obj);
24990 * Read a Pong from a byte array, created by Pong_write
24992 struct LDKCResult_PongDecodeErrorZ Pong_read(struct LDKu8slice ser);
24995 * Serialize the UnsignedChannelAnnouncement object into a byte array which can be read by UnsignedChannelAnnouncement_read
24997 struct LDKCVec_u8Z UnsignedChannelAnnouncement_write(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR obj);
25000 * Read a UnsignedChannelAnnouncement from a byte array, created by UnsignedChannelAnnouncement_write
25002 struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ UnsignedChannelAnnouncement_read(struct LDKu8slice ser);
25005 * Serialize the ChannelAnnouncement object into a byte array which can be read by ChannelAnnouncement_read
25007 struct LDKCVec_u8Z ChannelAnnouncement_write(const struct LDKChannelAnnouncement *NONNULL_PTR obj);
25010 * Read a ChannelAnnouncement from a byte array, created by ChannelAnnouncement_write
25012 struct LDKCResult_ChannelAnnouncementDecodeErrorZ ChannelAnnouncement_read(struct LDKu8slice ser);
25015 * Serialize the UnsignedChannelUpdate object into a byte array which can be read by UnsignedChannelUpdate_read
25017 struct LDKCVec_u8Z UnsignedChannelUpdate_write(const struct LDKUnsignedChannelUpdate *NONNULL_PTR obj);
25020 * Read a UnsignedChannelUpdate from a byte array, created by UnsignedChannelUpdate_write
25022 struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ UnsignedChannelUpdate_read(struct LDKu8slice ser);
25025 * Serialize the ChannelUpdate object into a byte array which can be read by ChannelUpdate_read
25027 struct LDKCVec_u8Z ChannelUpdate_write(const struct LDKChannelUpdate *NONNULL_PTR obj);
25030 * Read a ChannelUpdate from a byte array, created by ChannelUpdate_write
25032 struct LDKCResult_ChannelUpdateDecodeErrorZ ChannelUpdate_read(struct LDKu8slice ser);
25035 * Serialize the ErrorMessage object into a byte array which can be read by ErrorMessage_read
25037 struct LDKCVec_u8Z ErrorMessage_write(const struct LDKErrorMessage *NONNULL_PTR obj);
25040 * Read a ErrorMessage from a byte array, created by ErrorMessage_write
25042 struct LDKCResult_ErrorMessageDecodeErrorZ ErrorMessage_read(struct LDKu8slice ser);
25045 * Serialize the WarningMessage object into a byte array which can be read by WarningMessage_read
25047 struct LDKCVec_u8Z WarningMessage_write(const struct LDKWarningMessage *NONNULL_PTR obj);
25050 * Read a WarningMessage from a byte array, created by WarningMessage_write
25052 struct LDKCResult_WarningMessageDecodeErrorZ WarningMessage_read(struct LDKu8slice ser);
25055 * Serialize the UnsignedNodeAnnouncement object into a byte array which can be read by UnsignedNodeAnnouncement_read
25057 struct LDKCVec_u8Z UnsignedNodeAnnouncement_write(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR obj);
25060 * Read a UnsignedNodeAnnouncement from a byte array, created by UnsignedNodeAnnouncement_write
25062 struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ UnsignedNodeAnnouncement_read(struct LDKu8slice ser);
25065 * Serialize the NodeAnnouncement object into a byte array which can be read by NodeAnnouncement_read
25067 struct LDKCVec_u8Z NodeAnnouncement_write(const struct LDKNodeAnnouncement *NONNULL_PTR obj);
25070 * Read a NodeAnnouncement from a byte array, created by NodeAnnouncement_write
25072 struct LDKCResult_NodeAnnouncementDecodeErrorZ NodeAnnouncement_read(struct LDKu8slice ser);
25075 * Read a QueryShortChannelIds from a byte array, created by QueryShortChannelIds_write
25077 struct LDKCResult_QueryShortChannelIdsDecodeErrorZ QueryShortChannelIds_read(struct LDKu8slice ser);
25080 * Serialize the QueryShortChannelIds object into a byte array which can be read by QueryShortChannelIds_read
25082 struct LDKCVec_u8Z QueryShortChannelIds_write(const struct LDKQueryShortChannelIds *NONNULL_PTR obj);
25085 * Serialize the ReplyShortChannelIdsEnd object into a byte array which can be read by ReplyShortChannelIdsEnd_read
25087 struct LDKCVec_u8Z ReplyShortChannelIdsEnd_write(const struct LDKReplyShortChannelIdsEnd *NONNULL_PTR obj);
25090 * Read a ReplyShortChannelIdsEnd from a byte array, created by ReplyShortChannelIdsEnd_write
25092 struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ ReplyShortChannelIdsEnd_read(struct LDKu8slice ser);
25095 *\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
25097 MUST_USE_RES uint32_t QueryChannelRange_end_blocknum(const struct LDKQueryChannelRange *NONNULL_PTR this_arg);
25100 * Serialize the QueryChannelRange object into a byte array which can be read by QueryChannelRange_read
25102 struct LDKCVec_u8Z QueryChannelRange_write(const struct LDKQueryChannelRange *NONNULL_PTR obj);
25105 * Read a QueryChannelRange from a byte array, created by QueryChannelRange_write
25107 struct LDKCResult_QueryChannelRangeDecodeErrorZ QueryChannelRange_read(struct LDKu8slice ser);
25110 * Read a ReplyChannelRange from a byte array, created by ReplyChannelRange_write
25112 struct LDKCResult_ReplyChannelRangeDecodeErrorZ ReplyChannelRange_read(struct LDKu8slice ser);
25115 * Serialize the ReplyChannelRange object into a byte array which can be read by ReplyChannelRange_read
25117 struct LDKCVec_u8Z ReplyChannelRange_write(const struct LDKReplyChannelRange *NONNULL_PTR obj);
25120 * Serialize the GossipTimestampFilter object into a byte array which can be read by GossipTimestampFilter_read
25122 struct LDKCVec_u8Z GossipTimestampFilter_write(const struct LDKGossipTimestampFilter *NONNULL_PTR obj);
25125 * Read a GossipTimestampFilter from a byte array, created by GossipTimestampFilter_write
25127 struct LDKCResult_GossipTimestampFilterDecodeErrorZ GossipTimestampFilter_read(struct LDKu8slice ser);
25130 * Calls the free function if one is set
25132 void CustomMessageHandler_free(struct LDKCustomMessageHandler this_ptr);
25135 * Frees any resources used by the IgnoringMessageHandler, if is_owned is set and inner is non-NULL.
25137 void IgnoringMessageHandler_free(struct LDKIgnoringMessageHandler this_obj);
25140 * Constructs a new IgnoringMessageHandler given each field
25142 MUST_USE_RES struct LDKIgnoringMessageHandler IgnoringMessageHandler_new(void);
25145 * Constructs a new MessageSendEventsProvider which calls the relevant methods on this_arg.
25146 * This copies the `inner` pointer in this_arg and thus the returned MessageSendEventsProvider must be freed before this_arg is
25148 struct LDKMessageSendEventsProvider IgnoringMessageHandler_as_MessageSendEventsProvider(const struct LDKIgnoringMessageHandler *NONNULL_PTR this_arg);
25151 * Constructs a new RoutingMessageHandler which calls the relevant methods on this_arg.
25152 * This copies the `inner` pointer in this_arg and thus the returned RoutingMessageHandler must be freed before this_arg is
25154 struct LDKRoutingMessageHandler IgnoringMessageHandler_as_RoutingMessageHandler(const struct LDKIgnoringMessageHandler *NONNULL_PTR this_arg);
25157 * Constructs a new OnionMessageProvider which calls the relevant methods on this_arg.
25158 * This copies the `inner` pointer in this_arg and thus the returned OnionMessageProvider must be freed before this_arg is
25160 struct LDKOnionMessageProvider IgnoringMessageHandler_as_OnionMessageProvider(const struct LDKIgnoringMessageHandler *NONNULL_PTR this_arg);
25163 * Constructs a new OnionMessageHandler which calls the relevant methods on this_arg.
25164 * This copies the `inner` pointer in this_arg and thus the returned OnionMessageHandler must be freed before this_arg is
25166 struct LDKOnionMessageHandler IgnoringMessageHandler_as_OnionMessageHandler(const struct LDKIgnoringMessageHandler *NONNULL_PTR this_arg);
25169 * Constructs a new CustomMessageReader which calls the relevant methods on this_arg.
25170 * This copies the `inner` pointer in this_arg and thus the returned CustomMessageReader must be freed before this_arg is
25172 struct LDKCustomMessageReader IgnoringMessageHandler_as_CustomMessageReader(const struct LDKIgnoringMessageHandler *NONNULL_PTR this_arg);
25175 * Constructs a new CustomMessageHandler which calls the relevant methods on this_arg.
25176 * This copies the `inner` pointer in this_arg and thus the returned CustomMessageHandler must be freed before this_arg is
25178 struct LDKCustomMessageHandler IgnoringMessageHandler_as_CustomMessageHandler(const struct LDKIgnoringMessageHandler *NONNULL_PTR this_arg);
25181 * Frees any resources used by the ErroringMessageHandler, if is_owned is set and inner is non-NULL.
25183 void ErroringMessageHandler_free(struct LDKErroringMessageHandler this_obj);
25186 * Constructs a new ErroringMessageHandler
25188 MUST_USE_RES struct LDKErroringMessageHandler ErroringMessageHandler_new(void);
25191 * Constructs a new MessageSendEventsProvider which calls the relevant methods on this_arg.
25192 * This copies the `inner` pointer in this_arg and thus the returned MessageSendEventsProvider must be freed before this_arg is
25194 struct LDKMessageSendEventsProvider ErroringMessageHandler_as_MessageSendEventsProvider(const struct LDKErroringMessageHandler *NONNULL_PTR this_arg);
25197 * Constructs a new ChannelMessageHandler which calls the relevant methods on this_arg.
25198 * This copies the `inner` pointer in this_arg and thus the returned ChannelMessageHandler must be freed before this_arg is
25200 struct LDKChannelMessageHandler ErroringMessageHandler_as_ChannelMessageHandler(const struct LDKErroringMessageHandler *NONNULL_PTR this_arg);
25203 * Frees any resources used by the MessageHandler, if is_owned is set and inner is non-NULL.
25205 void MessageHandler_free(struct LDKMessageHandler this_obj);
25208 * A message handler which handles messages specific to channels. Usually this is just a
25209 * [`ChannelManager`] object or an [`ErroringMessageHandler`].
25211 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
25213 const struct LDKChannelMessageHandler *MessageHandler_get_chan_handler(const struct LDKMessageHandler *NONNULL_PTR this_ptr);
25216 * A message handler which handles messages specific to channels. Usually this is just a
25217 * [`ChannelManager`] object or an [`ErroringMessageHandler`].
25219 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
25221 void MessageHandler_set_chan_handler(struct LDKMessageHandler *NONNULL_PTR this_ptr, struct LDKChannelMessageHandler val);
25224 * A message handler which handles messages updating our knowledge of the network channel
25225 * graph. Usually this is just a [`P2PGossipSync`] object or an [`IgnoringMessageHandler`].
25227 * [`P2PGossipSync`]: crate::routing::gossip::P2PGossipSync
25229 const struct LDKRoutingMessageHandler *MessageHandler_get_route_handler(const struct LDKMessageHandler *NONNULL_PTR this_ptr);
25232 * A message handler which handles messages updating our knowledge of the network channel
25233 * graph. Usually this is just a [`P2PGossipSync`] object or an [`IgnoringMessageHandler`].
25235 * [`P2PGossipSync`]: crate::routing::gossip::P2PGossipSync
25237 void MessageHandler_set_route_handler(struct LDKMessageHandler *NONNULL_PTR this_ptr, struct LDKRoutingMessageHandler val);
25240 * A message handler which handles onion messages. For now, this can only be an
25241 * [`IgnoringMessageHandler`].
25243 const struct LDKOnionMessageHandler *MessageHandler_get_onion_message_handler(const struct LDKMessageHandler *NONNULL_PTR this_ptr);
25246 * A message handler which handles onion messages. For now, this can only be an
25247 * [`IgnoringMessageHandler`].
25249 void MessageHandler_set_onion_message_handler(struct LDKMessageHandler *NONNULL_PTR this_ptr, struct LDKOnionMessageHandler val);
25252 * Constructs a new MessageHandler given each field
25254 MUST_USE_RES struct LDKMessageHandler MessageHandler_new(struct LDKChannelMessageHandler chan_handler_arg, struct LDKRoutingMessageHandler route_handler_arg, struct LDKOnionMessageHandler onion_message_handler_arg);
25257 * Creates a copy of a SocketDescriptor
25259 struct LDKSocketDescriptor SocketDescriptor_clone(const struct LDKSocketDescriptor *NONNULL_PTR orig);
25262 * Calls the free function if one is set
25264 void SocketDescriptor_free(struct LDKSocketDescriptor this_ptr);
25267 * Frees any resources used by the PeerHandleError, if is_owned is set and inner is non-NULL.
25269 void PeerHandleError_free(struct LDKPeerHandleError this_obj);
25272 * Used to indicate that we probably can't make any future connections to this peer (e.g.
25273 * because we required features that our peer was missing, or vice versa).
25275 * While LDK's [`ChannelManager`] will not do it automatically, you likely wish to force-close
25276 * any channels with this peer or check for new versions of LDK.
25278 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
25280 bool PeerHandleError_get_no_connection_possible(const struct LDKPeerHandleError *NONNULL_PTR this_ptr);
25283 * Used to indicate that we probably can't make any future connections to this peer (e.g.
25284 * because we required features that our peer was missing, or vice versa).
25286 * While LDK's [`ChannelManager`] will not do it automatically, you likely wish to force-close
25287 * any channels with this peer or check for new versions of LDK.
25289 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
25291 void PeerHandleError_set_no_connection_possible(struct LDKPeerHandleError *NONNULL_PTR this_ptr, bool val);
25294 * Constructs a new PeerHandleError given each field
25296 MUST_USE_RES struct LDKPeerHandleError PeerHandleError_new(bool no_connection_possible_arg);
25299 * Creates a copy of the PeerHandleError
25301 struct LDKPeerHandleError PeerHandleError_clone(const struct LDKPeerHandleError *NONNULL_PTR orig);
25304 * Frees any resources used by the PeerManager, if is_owned is set and inner is non-NULL.
25306 void PeerManager_free(struct LDKPeerManager this_obj);
25309 * Constructs a new PeerManager with the given message handlers and node_id secret key
25310 * ephemeral_random_data is used to derive per-connection ephemeral keys and must be
25311 * cryptographically secure random bytes.
25313 * `current_time` is used as an always-increasing counter that survives across restarts and is
25314 * incremented irregularly internally. In general it is best to simply use the current UNIX
25315 * timestamp, however if it is not available a persistent counter that increases once per
25316 * minute should suffice.
25318 MUST_USE_RES struct LDKPeerManager PeerManager_new(struct LDKMessageHandler message_handler, struct LDKSecretKey our_node_secret, uint64_t current_time, const uint8_t (*ephemeral_random_data)[32], struct LDKLogger logger, struct LDKCustomMessageHandler custom_message_handler);
25321 * Get the list of node ids for peers which have completed the initial handshake.
25323 * For outbound connections, this will be the same as the their_node_id parameter passed in to
25324 * new_outbound_connection, however entries will only appear once the initial handshake has
25325 * completed and we are sure the remote peer has the private key for the given node_id.
25327 MUST_USE_RES struct LDKCVec_PublicKeyZ PeerManager_get_peer_node_ids(const struct LDKPeerManager *NONNULL_PTR this_arg);
25330 * Indicates a new outbound connection has been established to a node with the given node_id
25331 * and an optional remote network address.
25333 * The remote network address adds the option to report a remote IP address back to a connecting
25334 * peer using the init message.
25335 * The user should pass the remote network address of the host they are connected to.
25337 * If an `Err` is returned here you must disconnect the connection immediately.
25339 * Returns a small number of bytes to send to the remote node (currently always 50).
25341 * Panics if descriptor is duplicative with some other descriptor which has not yet been
25342 * [`socket_disconnected()`].
25344 * [`socket_disconnected()`]: PeerManager::socket_disconnected
25346 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);
25349 * Indicates a new inbound connection has been established to a node with an optional remote
25352 * The remote network address adds the option to report a remote IP address back to a connecting
25353 * peer using the init message.
25354 * The user should pass the remote network address of the host they are connected to.
25356 * May refuse the connection by returning an Err, but will never write bytes to the remote end
25357 * (outbound connector always speaks first). If an `Err` is returned here you must disconnect
25358 * the connection immediately.
25360 * Panics if descriptor is duplicative with some other descriptor which has not yet been
25361 * [`socket_disconnected()`].
25363 * [`socket_disconnected()`]: PeerManager::socket_disconnected
25365 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);
25368 * Indicates that there is room to write data to the given socket descriptor.
25370 * May return an Err to indicate that the connection should be closed.
25372 * May call [`send_data`] on the descriptor passed in (or an equal descriptor) before
25373 * returning. Thus, be very careful with reentrancy issues! The invariants around calling
25374 * [`write_buffer_space_avail`] in case a write did not fully complete must still hold - be
25375 * ready to call `[write_buffer_space_avail`] again if a write call generated here isn't
25378 * [`send_data`]: SocketDescriptor::send_data
25379 * [`write_buffer_space_avail`]: PeerManager::write_buffer_space_avail
25381 MUST_USE_RES struct LDKCResult_NonePeerHandleErrorZ PeerManager_write_buffer_space_avail(const struct LDKPeerManager *NONNULL_PTR this_arg, struct LDKSocketDescriptor *NONNULL_PTR descriptor);
25384 * Indicates that data was read from the given socket descriptor.
25386 * May return an Err to indicate that the connection should be closed.
25388 * Will *not* call back into [`send_data`] on any descriptors to avoid reentrancy complexity.
25389 * Thus, however, you should call [`process_events`] after any `read_event` to generate
25390 * [`send_data`] calls to handle responses.
25392 * If `Ok(true)` is returned, further read_events should not be triggered until a
25393 * [`send_data`] call on this descriptor has `resume_read` set (preventing DoS issues in the
25396 * [`send_data`]: SocketDescriptor::send_data
25397 * [`process_events`]: PeerManager::process_events
25399 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);
25402 * Checks for any events generated by our handlers and processes them. Includes sending most
25403 * response messages as well as messages generated by calls to handler functions directly (eg
25404 * functions like [`ChannelManager::process_pending_htlc_forwards`] or [`send_payment`]).
25406 * May call [`send_data`] on [`SocketDescriptor`]s. Thus, be very careful with reentrancy
25409 * You don't have to call this function explicitly if you are using [`lightning-net-tokio`]
25410 * or one of the other clients provided in our language bindings.
25412 * Note that if there are any other calls to this function waiting on lock(s) this may return
25413 * without doing any work. All available events that need handling will be handled before the
25414 * other calls return.
25416 * [`send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
25417 * [`ChannelManager::process_pending_htlc_forwards`]: crate::ln::channelmanager::ChannelManager::process_pending_htlc_forwards
25418 * [`send_data`]: SocketDescriptor::send_data
25420 void PeerManager_process_events(const struct LDKPeerManager *NONNULL_PTR this_arg);
25423 * Indicates that the given socket descriptor's connection is now closed.
25425 void PeerManager_socket_disconnected(const struct LDKPeerManager *NONNULL_PTR this_arg, const struct LDKSocketDescriptor *NONNULL_PTR descriptor);
25428 * Disconnect a peer given its node id.
25430 * Set `no_connection_possible` to true to prevent any further connection with this peer,
25431 * force-closing any channels we have with it.
25433 * If a peer is connected, this will call [`disconnect_socket`] on the descriptor for the
25434 * peer. Thus, be very careful about reentrancy issues.
25436 * [`disconnect_socket`]: SocketDescriptor::disconnect_socket
25438 void PeerManager_disconnect_by_node_id(const struct LDKPeerManager *NONNULL_PTR this_arg, struct LDKPublicKey node_id, bool no_connection_possible);
25441 * Disconnects all currently-connected peers. This is useful on platforms where there may be
25442 * an indication that TCP sockets have stalled even if we weren't around to time them out
25443 * using regular ping/pongs.
25445 void PeerManager_disconnect_all_peers(const struct LDKPeerManager *NONNULL_PTR this_arg);
25448 * Send pings to each peer and disconnect those which did not respond to the last round of
25451 * This may be called on any timescale you want, however, roughly once every ten seconds is
25452 * preferred. The call rate determines both how often we send a ping to our peers and how much
25453 * time they have to respond before we disconnect them.
25455 * May call [`send_data`] on all [`SocketDescriptor`]s. Thus, be very careful with reentrancy
25458 * [`send_data`]: SocketDescriptor::send_data
25460 void PeerManager_timer_tick_occurred(const struct LDKPeerManager *NONNULL_PTR this_arg);
25463 * Generates a signed node_announcement from the given arguments, sending it to all connected
25464 * peers. Note that peers will likely ignore this message unless we have at least one public
25465 * channel which has at least six confirmations on-chain.
25467 * `rgb` is a node \"color\" and `alias` is a printable human-readable string to describe this
25468 * node to humans. They carry no in-protocol meaning.
25470 * `addresses` represent the set (possibly empty) of socket addresses on which this node
25471 * accepts incoming connections. These will be included in the node_announcement, publicly
25472 * tying these addresses together and to this node. If you wish to preserve user privacy,
25473 * addresses should likely contain only Tor Onion addresses.
25475 * Panics if `addresses` is absurdly large (more than 100).
25477 * [`get_and_clear_pending_msg_events`]: MessageSendEventsProvider::get_and_clear_pending_msg_events
25479 void PeerManager_broadcast_node_announcement(const struct LDKPeerManager *NONNULL_PTR this_arg, struct LDKThreeBytes rgb, struct LDKThirtyTwoBytes alias, struct LDKCVec_NetAddressZ addresses);
25482 * Gets the weight for an HTLC-Success transaction.
25484 uint64_t htlc_success_tx_weight(bool opt_anchors);
25487 * Gets the weight for an HTLC-Timeout transaction.
25489 uint64_t htlc_timeout_tx_weight(bool opt_anchors);
25492 * Build the commitment secret from the seed and the commitment number
25494 struct LDKThirtyTwoBytes build_commitment_secret(const uint8_t (*commitment_seed)[32], uint64_t idx);
25497 * Build a closing transaction
25499 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);
25502 * Frees any resources used by the CounterpartyCommitmentSecrets, if is_owned is set and inner is non-NULL.
25504 void CounterpartyCommitmentSecrets_free(struct LDKCounterpartyCommitmentSecrets this_obj);
25507 * Creates a copy of the CounterpartyCommitmentSecrets
25509 struct LDKCounterpartyCommitmentSecrets CounterpartyCommitmentSecrets_clone(const struct LDKCounterpartyCommitmentSecrets *NONNULL_PTR orig);
25512 * Creates a new empty `CounterpartyCommitmentSecrets` structure.
25514 MUST_USE_RES struct LDKCounterpartyCommitmentSecrets CounterpartyCommitmentSecrets_new(void);
25517 * Returns the minimum index of all stored secrets. Note that indexes start
25518 * at 1 << 48 and get decremented by one for each new secret.
25520 MUST_USE_RES uint64_t CounterpartyCommitmentSecrets_get_min_seen_secret(const struct LDKCounterpartyCommitmentSecrets *NONNULL_PTR this_arg);
25523 * Inserts the `secret` at `idx`. Returns `Ok(())` if the secret
25524 * was generated in accordance with BOLT 3 and is consistent with previous secrets.
25526 MUST_USE_RES struct LDKCResult_NoneNoneZ CounterpartyCommitmentSecrets_provide_secret(struct LDKCounterpartyCommitmentSecrets *NONNULL_PTR this_arg, uint64_t idx, struct LDKThirtyTwoBytes secret);
25529 * Returns the secret at `idx`.
25530 * Returns `None` if `idx` is < [`CounterpartyCommitmentSecrets::get_min_seen_secret`].
25532 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
25534 MUST_USE_RES struct LDKThirtyTwoBytes CounterpartyCommitmentSecrets_get_secret(const struct LDKCounterpartyCommitmentSecrets *NONNULL_PTR this_arg, uint64_t idx);
25537 * Serialize the CounterpartyCommitmentSecrets object into a byte array which can be read by CounterpartyCommitmentSecrets_read
25539 struct LDKCVec_u8Z CounterpartyCommitmentSecrets_write(const struct LDKCounterpartyCommitmentSecrets *NONNULL_PTR obj);
25542 * Read a CounterpartyCommitmentSecrets from a byte array, created by CounterpartyCommitmentSecrets_write
25544 struct LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ CounterpartyCommitmentSecrets_read(struct LDKu8slice ser);
25547 * Derives a per-commitment-transaction private key (eg an htlc key or delayed_payment key)
25548 * from the base secret and the per_commitment_point.
25550 * Note that this is infallible iff we trust that at least one of the two input keys are randomly
25551 * generated (ie our own).
25553 struct LDKCResult_SecretKeyErrorZ derive_private_key(struct LDKPublicKey per_commitment_point, const uint8_t (*base_secret)[32]);
25556 * Derives a per-commitment-transaction public key (eg an htlc key or a delayed_payment key)
25557 * from the base point and the per_commitment_key. This is the public equivalent of
25558 * derive_private_key - using only public keys to derive a public key instead of private keys.
25560 * Note that this is infallible iff we trust that at least one of the two input keys are randomly
25561 * generated (ie our own).
25563 struct LDKCResult_PublicKeyErrorZ derive_public_key(struct LDKPublicKey per_commitment_point, struct LDKPublicKey base_point);
25566 * Derives a per-commitment-transaction revocation key from its constituent parts.
25568 * Only the cheating participant owns a valid witness to propagate a revoked
25569 * commitment transaction, thus per_commitment_secret always come from cheater
25570 * and revocation_base_secret always come from punisher, which is the broadcaster
25571 * of the transaction spending with this key knowledge.
25573 * Note that this is infallible iff we trust that at least one of the two input keys are randomly
25574 * generated (ie our own).
25576 struct LDKCResult_SecretKeyErrorZ derive_private_revocation_key(const uint8_t (*per_commitment_secret)[32], const uint8_t (*countersignatory_revocation_base_secret)[32]);
25579 * Derives a per-commitment-transaction revocation public key from its constituent parts. This is
25580 * the public equivalend of derive_private_revocation_key - using only public keys to derive a
25581 * public key instead of private keys.
25583 * Only the cheating participant owns a valid witness to propagate a revoked
25584 * commitment transaction, thus per_commitment_point always come from cheater
25585 * and revocation_base_point always come from punisher, which is the broadcaster
25586 * of the transaction spending with this key knowledge.
25588 * Note that this is infallible iff we trust that at least one of the two input keys are randomly
25589 * generated (ie our own).
25591 struct LDKCResult_PublicKeyErrorZ derive_public_revocation_key(struct LDKPublicKey per_commitment_point, struct LDKPublicKey countersignatory_revocation_base_point);
25594 * Frees any resources used by the TxCreationKeys, if is_owned is set and inner is non-NULL.
25596 void TxCreationKeys_free(struct LDKTxCreationKeys this_obj);
25599 * The broadcaster's per-commitment public key which was used to derive the other keys.
25601 struct LDKPublicKey TxCreationKeys_get_per_commitment_point(const struct LDKTxCreationKeys *NONNULL_PTR this_ptr);
25604 * The broadcaster's per-commitment public key which was used to derive the other keys.
25606 void TxCreationKeys_set_per_commitment_point(struct LDKTxCreationKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
25609 * The revocation key which is used to allow the broadcaster of the commitment
25610 * transaction to provide their counterparty the ability to punish them if they broadcast
25613 struct LDKPublicKey TxCreationKeys_get_revocation_key(const struct LDKTxCreationKeys *NONNULL_PTR this_ptr);
25616 * The revocation key which is used to allow the broadcaster of the commitment
25617 * transaction to provide their counterparty the ability to punish them if they broadcast
25620 void TxCreationKeys_set_revocation_key(struct LDKTxCreationKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
25623 * Broadcaster's HTLC Key
25625 struct LDKPublicKey TxCreationKeys_get_broadcaster_htlc_key(const struct LDKTxCreationKeys *NONNULL_PTR this_ptr);
25628 * Broadcaster's HTLC Key
25630 void TxCreationKeys_set_broadcaster_htlc_key(struct LDKTxCreationKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
25633 * Countersignatory's HTLC Key
25635 struct LDKPublicKey TxCreationKeys_get_countersignatory_htlc_key(const struct LDKTxCreationKeys *NONNULL_PTR this_ptr);
25638 * Countersignatory's HTLC Key
25640 void TxCreationKeys_set_countersignatory_htlc_key(struct LDKTxCreationKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
25643 * Broadcaster's Payment Key (which isn't allowed to be spent from for some delay)
25645 struct LDKPublicKey TxCreationKeys_get_broadcaster_delayed_payment_key(const struct LDKTxCreationKeys *NONNULL_PTR this_ptr);
25648 * Broadcaster's Payment Key (which isn't allowed to be spent from for some delay)
25650 void TxCreationKeys_set_broadcaster_delayed_payment_key(struct LDKTxCreationKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
25653 * Constructs a new TxCreationKeys given each field
25655 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);
25658 * Creates a copy of the TxCreationKeys
25660 struct LDKTxCreationKeys TxCreationKeys_clone(const struct LDKTxCreationKeys *NONNULL_PTR orig);
25663 * Serialize the TxCreationKeys object into a byte array which can be read by TxCreationKeys_read
25665 struct LDKCVec_u8Z TxCreationKeys_write(const struct LDKTxCreationKeys *NONNULL_PTR obj);
25668 * Read a TxCreationKeys from a byte array, created by TxCreationKeys_write
25670 struct LDKCResult_TxCreationKeysDecodeErrorZ TxCreationKeys_read(struct LDKu8slice ser);
25673 * Frees any resources used by the ChannelPublicKeys, if is_owned is set and inner is non-NULL.
25675 void ChannelPublicKeys_free(struct LDKChannelPublicKeys this_obj);
25678 * The public key which is used to sign all commitment transactions, as it appears in the
25679 * on-chain channel lock-in 2-of-2 multisig output.
25681 struct LDKPublicKey ChannelPublicKeys_get_funding_pubkey(const struct LDKChannelPublicKeys *NONNULL_PTR this_ptr);
25684 * The public key which is used to sign all commitment transactions, as it appears in the
25685 * on-chain channel lock-in 2-of-2 multisig output.
25687 void ChannelPublicKeys_set_funding_pubkey(struct LDKChannelPublicKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
25690 * The base point which is used (with derive_public_revocation_key) to derive per-commitment
25691 * revocation keys. This is combined with the per-commitment-secret generated by the
25692 * counterparty to create a secret which the counterparty can reveal to revoke previous
25695 struct LDKPublicKey ChannelPublicKeys_get_revocation_basepoint(const struct LDKChannelPublicKeys *NONNULL_PTR this_ptr);
25698 * The base point which is used (with derive_public_revocation_key) to derive per-commitment
25699 * revocation keys. This is combined with the per-commitment-secret generated by the
25700 * counterparty to create a secret which the counterparty can reveal to revoke previous
25703 void ChannelPublicKeys_set_revocation_basepoint(struct LDKChannelPublicKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
25706 * The public key on which the non-broadcaster (ie the countersignatory) receives an immediately
25707 * spendable primary channel balance on the broadcaster's commitment transaction. This key is
25708 * static across every commitment transaction.
25710 struct LDKPublicKey ChannelPublicKeys_get_payment_point(const struct LDKChannelPublicKeys *NONNULL_PTR this_ptr);
25713 * The public key on which the non-broadcaster (ie the countersignatory) receives an immediately
25714 * spendable primary channel balance on the broadcaster's commitment transaction. This key is
25715 * static across every commitment transaction.
25717 void ChannelPublicKeys_set_payment_point(struct LDKChannelPublicKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
25720 * The base point which is used (with derive_public_key) to derive a per-commitment payment
25721 * public key which receives non-HTLC-encumbered funds which are only available for spending
25722 * after some delay (or can be claimed via the revocation path).
25724 struct LDKPublicKey ChannelPublicKeys_get_delayed_payment_basepoint(const struct LDKChannelPublicKeys *NONNULL_PTR this_ptr);
25727 * The base point which is used (with derive_public_key) to derive a per-commitment payment
25728 * public key which receives non-HTLC-encumbered funds which are only available for spending
25729 * after some delay (or can be claimed via the revocation path).
25731 void ChannelPublicKeys_set_delayed_payment_basepoint(struct LDKChannelPublicKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
25734 * The base point which is used (with derive_public_key) to derive a per-commitment public key
25735 * which is used to encumber HTLC-in-flight outputs.
25737 struct LDKPublicKey ChannelPublicKeys_get_htlc_basepoint(const struct LDKChannelPublicKeys *NONNULL_PTR this_ptr);
25740 * The base point which is used (with derive_public_key) to derive a per-commitment public key
25741 * which is used to encumber HTLC-in-flight outputs.
25743 void ChannelPublicKeys_set_htlc_basepoint(struct LDKChannelPublicKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
25746 * Constructs a new ChannelPublicKeys given each field
25748 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);
25751 * Creates a copy of the ChannelPublicKeys
25753 struct LDKChannelPublicKeys ChannelPublicKeys_clone(const struct LDKChannelPublicKeys *NONNULL_PTR orig);
25756 * Serialize the ChannelPublicKeys object into a byte array which can be read by ChannelPublicKeys_read
25758 struct LDKCVec_u8Z ChannelPublicKeys_write(const struct LDKChannelPublicKeys *NONNULL_PTR obj);
25761 * Read a ChannelPublicKeys from a byte array, created by ChannelPublicKeys_write
25763 struct LDKCResult_ChannelPublicKeysDecodeErrorZ ChannelPublicKeys_read(struct LDKu8slice ser);
25766 * Create per-state keys from channel base points and the per-commitment point.
25767 * Key set is asymmetric and can't be used as part of counter-signatory set of transactions.
25769 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);
25772 * Generate per-state keys from channel static keys.
25773 * Key set is asymmetric and can't be used as part of counter-signatory set of transactions.
25775 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);
25778 * A script either spendable by the revocation
25779 * key or the broadcaster_delayed_payment_key and satisfying the relative-locktime OP_CSV constrain.
25780 * Encumbering a `to_holder` output on a commitment transaction or 2nd-stage HTLC transactions.
25782 struct LDKCVec_u8Z get_revokeable_redeemscript(struct LDKPublicKey revocation_key, uint16_t contest_delay, struct LDKPublicKey broadcaster_delayed_payment_key);
25785 * Frees any resources used by the HTLCOutputInCommitment, if is_owned is set and inner is non-NULL.
25787 void HTLCOutputInCommitment_free(struct LDKHTLCOutputInCommitment this_obj);
25790 * Whether the HTLC was \"offered\" (ie outbound in relation to this commitment transaction).
25791 * Note that this is not the same as whether it is ountbound *from us*. To determine that you
25792 * need to compare this value to whether the commitment transaction in question is that of
25793 * the counterparty or our own.
25795 bool HTLCOutputInCommitment_get_offered(const struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr);
25798 * Whether the HTLC was \"offered\" (ie outbound in relation to this commitment transaction).
25799 * Note that this is not the same as whether it is ountbound *from us*. To determine that you
25800 * need to compare this value to whether the commitment transaction in question is that of
25801 * the counterparty or our own.
25803 void HTLCOutputInCommitment_set_offered(struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr, bool val);
25806 * The value, in msat, of the HTLC. The value as it appears in the commitment transaction is
25807 * this divided by 1000.
25809 uint64_t HTLCOutputInCommitment_get_amount_msat(const struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr);
25812 * The value, in msat, of the HTLC. The value as it appears in the commitment transaction is
25813 * this divided by 1000.
25815 void HTLCOutputInCommitment_set_amount_msat(struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr, uint64_t val);
25818 * The CLTV lock-time at which this HTLC expires.
25820 uint32_t HTLCOutputInCommitment_get_cltv_expiry(const struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr);
25823 * The CLTV lock-time at which this HTLC expires.
25825 void HTLCOutputInCommitment_set_cltv_expiry(struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr, uint32_t val);
25828 * The hash of the preimage which unlocks this HTLC.
25830 const uint8_t (*HTLCOutputInCommitment_get_payment_hash(const struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr))[32];
25833 * The hash of the preimage which unlocks this HTLC.
25835 void HTLCOutputInCommitment_set_payment_hash(struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
25838 * The position within the commitment transactions' outputs. This may be None if the value is
25839 * below the dust limit (in which case no output appears in the commitment transaction and the
25840 * value is spent to additional transaction fees).
25842 struct LDKCOption_u32Z HTLCOutputInCommitment_get_transaction_output_index(const struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr);
25845 * The position within the commitment transactions' outputs. This may be None if the value is
25846 * below the dust limit (in which case no output appears in the commitment transaction and the
25847 * value is spent to additional transaction fees).
25849 void HTLCOutputInCommitment_set_transaction_output_index(struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr, struct LDKCOption_u32Z val);
25852 * Constructs a new HTLCOutputInCommitment given each field
25854 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);
25857 * Creates a copy of the HTLCOutputInCommitment
25859 struct LDKHTLCOutputInCommitment HTLCOutputInCommitment_clone(const struct LDKHTLCOutputInCommitment *NONNULL_PTR orig);
25862 * Serialize the HTLCOutputInCommitment object into a byte array which can be read by HTLCOutputInCommitment_read
25864 struct LDKCVec_u8Z HTLCOutputInCommitment_write(const struct LDKHTLCOutputInCommitment *NONNULL_PTR obj);
25867 * Read a HTLCOutputInCommitment from a byte array, created by HTLCOutputInCommitment_write
25869 struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ HTLCOutputInCommitment_read(struct LDKu8slice ser);
25872 * Gets the witness redeemscript for an HTLC output in a commitment transaction. Note that htlc
25873 * does not need to have its previous_output_index filled.
25875 struct LDKCVec_u8Z get_htlc_redeemscript(const struct LDKHTLCOutputInCommitment *NONNULL_PTR htlc, bool opt_anchors, const struct LDKTxCreationKeys *NONNULL_PTR keys);
25878 * Gets the redeemscript for a funding output from the two funding public keys.
25879 * Note that the order of funding public keys does not matter.
25881 struct LDKCVec_u8Z make_funding_redeemscript(struct LDKPublicKey broadcaster, struct LDKPublicKey countersignatory);
25884 * Builds an unsigned HTLC-Success or HTLC-Timeout transaction from the given channel and HTLC
25885 * parameters. This is used by [`TrustedCommitmentTransaction::get_htlc_sigs`] to fetch the
25886 * transaction which needs signing, and can be used to construct an HTLC transaction which is
25887 * broadcastable given a counterparty HTLC signature.
25889 * Panics if htlc.transaction_output_index.is_none() (as such HTLCs do not appear in the
25890 * commitment transaction).
25892 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);
25895 * Gets the witnessScript for an anchor output from the funding public key.
25896 * The witness in the spending input must be:
25897 * <BIP 143 funding_signature>
25898 * After 16 blocks of confirmation, an alternative satisfying witness could be:
25900 * (empty vector required to satisfy compliance with MINIMALIF-standard rule)
25902 struct LDKCVec_u8Z get_anchor_redeemscript(struct LDKPublicKey funding_pubkey);
25905 * Frees any resources used by the ChannelTransactionParameters, if is_owned is set and inner is non-NULL.
25907 void ChannelTransactionParameters_free(struct LDKChannelTransactionParameters this_obj);
25910 * Holder public keys
25912 struct LDKChannelPublicKeys ChannelTransactionParameters_get_holder_pubkeys(const struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr);
25915 * Holder public keys
25917 void ChannelTransactionParameters_set_holder_pubkeys(struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr, struct LDKChannelPublicKeys val);
25920 * The contest delay selected by the holder, which applies to counterparty-broadcast transactions
25922 uint16_t ChannelTransactionParameters_get_holder_selected_contest_delay(const struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr);
25925 * The contest delay selected by the holder, which applies to counterparty-broadcast transactions
25927 void ChannelTransactionParameters_set_holder_selected_contest_delay(struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr, uint16_t val);
25930 * Whether the holder is the initiator of this channel.
25931 * This is an input to the commitment number obscure factor computation.
25933 bool ChannelTransactionParameters_get_is_outbound_from_holder(const struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr);
25936 * Whether the holder is the initiator of this channel.
25937 * This is an input to the commitment number obscure factor computation.
25939 void ChannelTransactionParameters_set_is_outbound_from_holder(struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr, bool val);
25942 * The late-bound counterparty channel transaction parameters.
25943 * These parameters are populated at the point in the protocol where the counterparty provides them.
25945 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
25947 struct LDKCounterpartyChannelTransactionParameters ChannelTransactionParameters_get_counterparty_parameters(const struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr);
25950 * The late-bound counterparty channel transaction parameters.
25951 * These parameters are populated at the point in the protocol where the counterparty provides them.
25953 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
25955 void ChannelTransactionParameters_set_counterparty_parameters(struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr, struct LDKCounterpartyChannelTransactionParameters val);
25958 * The late-bound funding outpoint
25960 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
25962 struct LDKOutPoint ChannelTransactionParameters_get_funding_outpoint(const struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr);
25965 * The late-bound funding outpoint
25967 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
25969 void ChannelTransactionParameters_set_funding_outpoint(struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr, struct LDKOutPoint val);
25972 * Are anchors used for this channel. Boolean is serialization backwards-compatible
25974 enum LDKCOption_NoneZ ChannelTransactionParameters_get_opt_anchors(const struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr);
25977 * Are anchors used for this channel. Boolean is serialization backwards-compatible
25979 void ChannelTransactionParameters_set_opt_anchors(struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr, enum LDKCOption_NoneZ val);
25982 * Constructs a new ChannelTransactionParameters given each field
25984 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);
25987 * Creates a copy of the ChannelTransactionParameters
25989 struct LDKChannelTransactionParameters ChannelTransactionParameters_clone(const struct LDKChannelTransactionParameters *NONNULL_PTR orig);
25992 * Frees any resources used by the CounterpartyChannelTransactionParameters, if is_owned is set and inner is non-NULL.
25994 void CounterpartyChannelTransactionParameters_free(struct LDKCounterpartyChannelTransactionParameters this_obj);
25997 * Counter-party public keys
25999 struct LDKChannelPublicKeys CounterpartyChannelTransactionParameters_get_pubkeys(const struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR this_ptr);
26002 * Counter-party public keys
26004 void CounterpartyChannelTransactionParameters_set_pubkeys(struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR this_ptr, struct LDKChannelPublicKeys val);
26007 * The contest delay selected by the counterparty, which applies to holder-broadcast transactions
26009 uint16_t CounterpartyChannelTransactionParameters_get_selected_contest_delay(const struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR this_ptr);
26012 * The contest delay selected by the counterparty, which applies to holder-broadcast transactions
26014 void CounterpartyChannelTransactionParameters_set_selected_contest_delay(struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR this_ptr, uint16_t val);
26017 * Constructs a new CounterpartyChannelTransactionParameters given each field
26019 MUST_USE_RES struct LDKCounterpartyChannelTransactionParameters CounterpartyChannelTransactionParameters_new(struct LDKChannelPublicKeys pubkeys_arg, uint16_t selected_contest_delay_arg);
26022 * Creates a copy of the CounterpartyChannelTransactionParameters
26024 struct LDKCounterpartyChannelTransactionParameters CounterpartyChannelTransactionParameters_clone(const struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR orig);
26027 * Whether the late bound parameters are populated.
26029 MUST_USE_RES bool ChannelTransactionParameters_is_populated(const struct LDKChannelTransactionParameters *NONNULL_PTR this_arg);
26032 * Convert the holder/counterparty parameters to broadcaster/countersignatory-organized parameters,
26033 * given that the holder is the broadcaster.
26035 * self.is_populated() must be true before calling this function.
26037 MUST_USE_RES struct LDKDirectedChannelTransactionParameters ChannelTransactionParameters_as_holder_broadcastable(const struct LDKChannelTransactionParameters *NONNULL_PTR this_arg);
26040 * Convert the holder/counterparty parameters to broadcaster/countersignatory-organized parameters,
26041 * given that the counterparty is the broadcaster.
26043 * self.is_populated() must be true before calling this function.
26045 MUST_USE_RES struct LDKDirectedChannelTransactionParameters ChannelTransactionParameters_as_counterparty_broadcastable(const struct LDKChannelTransactionParameters *NONNULL_PTR this_arg);
26048 * Serialize the CounterpartyChannelTransactionParameters object into a byte array which can be read by CounterpartyChannelTransactionParameters_read
26050 struct LDKCVec_u8Z CounterpartyChannelTransactionParameters_write(const struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR obj);
26053 * Read a CounterpartyChannelTransactionParameters from a byte array, created by CounterpartyChannelTransactionParameters_write
26055 struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ CounterpartyChannelTransactionParameters_read(struct LDKu8slice ser);
26058 * Serialize the ChannelTransactionParameters object into a byte array which can be read by ChannelTransactionParameters_read
26060 struct LDKCVec_u8Z ChannelTransactionParameters_write(const struct LDKChannelTransactionParameters *NONNULL_PTR obj);
26063 * Read a ChannelTransactionParameters from a byte array, created by ChannelTransactionParameters_write
26065 struct LDKCResult_ChannelTransactionParametersDecodeErrorZ ChannelTransactionParameters_read(struct LDKu8slice ser);
26068 * Frees any resources used by the DirectedChannelTransactionParameters, if is_owned is set and inner is non-NULL.
26070 void DirectedChannelTransactionParameters_free(struct LDKDirectedChannelTransactionParameters this_obj);
26073 * Get the channel pubkeys for the broadcaster
26075 MUST_USE_RES struct LDKChannelPublicKeys DirectedChannelTransactionParameters_broadcaster_pubkeys(const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR this_arg);
26078 * Get the channel pubkeys for the countersignatory
26080 MUST_USE_RES struct LDKChannelPublicKeys DirectedChannelTransactionParameters_countersignatory_pubkeys(const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR this_arg);
26083 * Get the contest delay applicable to the transactions.
26084 * Note that the contest delay was selected by the countersignatory.
26086 MUST_USE_RES uint16_t DirectedChannelTransactionParameters_contest_delay(const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR this_arg);
26089 * Whether the channel is outbound from the broadcaster.
26091 * The boolean representing the side that initiated the channel is
26092 * an input to the commitment number obscure factor computation.
26094 MUST_USE_RES bool DirectedChannelTransactionParameters_is_outbound(const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR this_arg);
26097 * The funding outpoint
26099 MUST_USE_RES struct LDKOutPoint DirectedChannelTransactionParameters_funding_outpoint(const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR this_arg);
26102 * Whether to use anchors for this channel
26104 MUST_USE_RES bool DirectedChannelTransactionParameters_opt_anchors(const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR this_arg);
26107 * Frees any resources used by the HolderCommitmentTransaction, if is_owned is set and inner is non-NULL.
26109 void HolderCommitmentTransaction_free(struct LDKHolderCommitmentTransaction this_obj);
26112 * Our counterparty's signature for the transaction
26114 struct LDKSignature HolderCommitmentTransaction_get_counterparty_sig(const struct LDKHolderCommitmentTransaction *NONNULL_PTR this_ptr);
26117 * Our counterparty's signature for the transaction
26119 void HolderCommitmentTransaction_set_counterparty_sig(struct LDKHolderCommitmentTransaction *NONNULL_PTR this_ptr, struct LDKSignature val);
26122 * All non-dust counterparty HTLC signatures, in the order they appear in the transaction
26124 * Returns a copy of the field.
26126 struct LDKCVec_SignatureZ HolderCommitmentTransaction_get_counterparty_htlc_sigs(const struct LDKHolderCommitmentTransaction *NONNULL_PTR this_ptr);
26129 * All non-dust counterparty HTLC signatures, in the order they appear in the transaction
26131 void HolderCommitmentTransaction_set_counterparty_htlc_sigs(struct LDKHolderCommitmentTransaction *NONNULL_PTR this_ptr, struct LDKCVec_SignatureZ val);
26134 * Creates a copy of the HolderCommitmentTransaction
26136 struct LDKHolderCommitmentTransaction HolderCommitmentTransaction_clone(const struct LDKHolderCommitmentTransaction *NONNULL_PTR orig);
26139 * Serialize the HolderCommitmentTransaction object into a byte array which can be read by HolderCommitmentTransaction_read
26141 struct LDKCVec_u8Z HolderCommitmentTransaction_write(const struct LDKHolderCommitmentTransaction *NONNULL_PTR obj);
26144 * Read a HolderCommitmentTransaction from a byte array, created by HolderCommitmentTransaction_write
26146 struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ HolderCommitmentTransaction_read(struct LDKu8slice ser);
26149 * Create a new holder transaction with the given counterparty signatures.
26150 * The funding keys are used to figure out which signature should go first when building the transaction for broadcast.
26152 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);
26155 * Frees any resources used by the BuiltCommitmentTransaction, if is_owned is set and inner is non-NULL.
26157 void BuiltCommitmentTransaction_free(struct LDKBuiltCommitmentTransaction this_obj);
26160 * The commitment transaction
26162 struct LDKTransaction BuiltCommitmentTransaction_get_transaction(const struct LDKBuiltCommitmentTransaction *NONNULL_PTR this_ptr);
26165 * The commitment transaction
26167 void BuiltCommitmentTransaction_set_transaction(struct LDKBuiltCommitmentTransaction *NONNULL_PTR this_ptr, struct LDKTransaction val);
26170 * The txid for the commitment transaction.
26172 * This is provided as a performance optimization, instead of calling transaction.txid()
26175 const uint8_t (*BuiltCommitmentTransaction_get_txid(const struct LDKBuiltCommitmentTransaction *NONNULL_PTR this_ptr))[32];
26178 * The txid for the commitment transaction.
26180 * This is provided as a performance optimization, instead of calling transaction.txid()
26183 void BuiltCommitmentTransaction_set_txid(struct LDKBuiltCommitmentTransaction *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
26186 * Constructs a new BuiltCommitmentTransaction given each field
26188 MUST_USE_RES struct LDKBuiltCommitmentTransaction BuiltCommitmentTransaction_new(struct LDKTransaction transaction_arg, struct LDKThirtyTwoBytes txid_arg);
26191 * Creates a copy of the BuiltCommitmentTransaction
26193 struct LDKBuiltCommitmentTransaction BuiltCommitmentTransaction_clone(const struct LDKBuiltCommitmentTransaction *NONNULL_PTR orig);
26196 * Serialize the BuiltCommitmentTransaction object into a byte array which can be read by BuiltCommitmentTransaction_read
26198 struct LDKCVec_u8Z BuiltCommitmentTransaction_write(const struct LDKBuiltCommitmentTransaction *NONNULL_PTR obj);
26201 * Read a BuiltCommitmentTransaction from a byte array, created by BuiltCommitmentTransaction_write
26203 struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ BuiltCommitmentTransaction_read(struct LDKu8slice ser);
26206 * Get the SIGHASH_ALL sighash value of the transaction.
26208 * This can be used to verify a signature.
26210 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);
26213 * Sign a transaction, either because we are counter-signing the counterparty's transaction or
26214 * because we are about to broadcast a holder transaction.
26216 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);
26219 * Frees any resources used by the ClosingTransaction, if is_owned is set and inner is non-NULL.
26221 void ClosingTransaction_free(struct LDKClosingTransaction this_obj);
26224 * Creates a copy of the ClosingTransaction
26226 struct LDKClosingTransaction ClosingTransaction_clone(const struct LDKClosingTransaction *NONNULL_PTR orig);
26229 * Checks if two ClosingTransactions contain equal inner contents.
26231 uint64_t ClosingTransaction_hash(const struct LDKClosingTransaction *NONNULL_PTR o);
26234 * Construct an object of the class
26236 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);
26239 * Trust our pre-built transaction.
26241 * Applies a wrapper which allows access to the transaction.
26243 * This should only be used if you fully trust the builder of this object. It should not
26244 * be used by an external signer - instead use the verify function.
26246 MUST_USE_RES struct LDKTrustedClosingTransaction ClosingTransaction_trust(const struct LDKClosingTransaction *NONNULL_PTR this_arg);
26249 * Verify our pre-built transaction.
26251 * Applies a wrapper which allows access to the transaction.
26253 * An external validating signer must call this method before signing
26254 * or using the built transaction.
26256 MUST_USE_RES struct LDKCResult_TrustedClosingTransactionNoneZ ClosingTransaction_verify(const struct LDKClosingTransaction *NONNULL_PTR this_arg, struct LDKOutPoint funding_outpoint);
26259 * The value to be sent to the holder, or zero if the output will be omitted
26261 MUST_USE_RES uint64_t ClosingTransaction_to_holder_value_sat(const struct LDKClosingTransaction *NONNULL_PTR this_arg);
26264 * The value to be sent to the counterparty, or zero if the output will be omitted
26266 MUST_USE_RES uint64_t ClosingTransaction_to_counterparty_value_sat(const struct LDKClosingTransaction *NONNULL_PTR this_arg);
26269 * The destination of the holder's output
26271 MUST_USE_RES struct LDKu8slice ClosingTransaction_to_holder_script(const struct LDKClosingTransaction *NONNULL_PTR this_arg);
26274 * The destination of the counterparty's output
26276 MUST_USE_RES struct LDKu8slice ClosingTransaction_to_counterparty_script(const struct LDKClosingTransaction *NONNULL_PTR this_arg);
26279 * Frees any resources used by the TrustedClosingTransaction, if is_owned is set and inner is non-NULL.
26281 void TrustedClosingTransaction_free(struct LDKTrustedClosingTransaction this_obj);
26284 * The pre-built Bitcoin commitment transaction
26286 MUST_USE_RES struct LDKTransaction TrustedClosingTransaction_built_transaction(const struct LDKTrustedClosingTransaction *NONNULL_PTR this_arg);
26289 * Get the SIGHASH_ALL sighash value of the transaction.
26291 * This can be used to verify a signature.
26293 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);
26296 * Sign a transaction, either because we are counter-signing the counterparty's transaction or
26297 * because we are about to broadcast a holder transaction.
26299 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);
26302 * Frees any resources used by the CommitmentTransaction, if is_owned is set and inner is non-NULL.
26304 void CommitmentTransaction_free(struct LDKCommitmentTransaction this_obj);
26307 * Creates a copy of the CommitmentTransaction
26309 struct LDKCommitmentTransaction CommitmentTransaction_clone(const struct LDKCommitmentTransaction *NONNULL_PTR orig);
26312 * Serialize the CommitmentTransaction object into a byte array which can be read by CommitmentTransaction_read
26314 struct LDKCVec_u8Z CommitmentTransaction_write(const struct LDKCommitmentTransaction *NONNULL_PTR obj);
26317 * Read a CommitmentTransaction from a byte array, created by CommitmentTransaction_write
26319 struct LDKCResult_CommitmentTransactionDecodeErrorZ CommitmentTransaction_read(struct LDKu8slice ser);
26322 * The backwards-counting commitment number
26324 MUST_USE_RES uint64_t CommitmentTransaction_commitment_number(const struct LDKCommitmentTransaction *NONNULL_PTR this_arg);
26327 * The value to be sent to the broadcaster
26329 MUST_USE_RES uint64_t CommitmentTransaction_to_broadcaster_value_sat(const struct LDKCommitmentTransaction *NONNULL_PTR this_arg);
26332 * The value to be sent to the counterparty
26334 MUST_USE_RES uint64_t CommitmentTransaction_to_countersignatory_value_sat(const struct LDKCommitmentTransaction *NONNULL_PTR this_arg);
26337 * The feerate paid per 1000-weight-unit in this commitment transaction.
26339 MUST_USE_RES uint32_t CommitmentTransaction_feerate_per_kw(const struct LDKCommitmentTransaction *NONNULL_PTR this_arg);
26342 * Trust our pre-built transaction and derived transaction creation public keys.
26344 * Applies a wrapper which allows access to these fields.
26346 * This should only be used if you fully trust the builder of this object. It should not
26347 * be used by an external signer - instead use the verify function.
26349 MUST_USE_RES struct LDKTrustedCommitmentTransaction CommitmentTransaction_trust(const struct LDKCommitmentTransaction *NONNULL_PTR this_arg);
26352 * Verify our pre-built transaction and derived transaction creation public keys.
26354 * Applies a wrapper which allows access to these fields.
26356 * An external validating signer must call this method before signing
26357 * or using the built transaction.
26359 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);
26362 * Frees any resources used by the TrustedCommitmentTransaction, if is_owned is set and inner is non-NULL.
26364 void TrustedCommitmentTransaction_free(struct LDKTrustedCommitmentTransaction this_obj);
26367 * The transaction ID of the built Bitcoin transaction
26369 MUST_USE_RES struct LDKThirtyTwoBytes TrustedCommitmentTransaction_txid(const struct LDKTrustedCommitmentTransaction *NONNULL_PTR this_arg);
26372 * The pre-built Bitcoin commitment transaction
26374 MUST_USE_RES struct LDKBuiltCommitmentTransaction TrustedCommitmentTransaction_built_transaction(const struct LDKTrustedCommitmentTransaction *NONNULL_PTR this_arg);
26377 * The pre-calculated transaction creation public keys.
26379 MUST_USE_RES struct LDKTxCreationKeys TrustedCommitmentTransaction_keys(const struct LDKTrustedCommitmentTransaction *NONNULL_PTR this_arg);
26382 * Should anchors be used.
26384 MUST_USE_RES bool TrustedCommitmentTransaction_opt_anchors(const struct LDKTrustedCommitmentTransaction *NONNULL_PTR this_arg);
26387 * Get a signature for each HTLC which was included in the commitment transaction (ie for
26388 * which HTLCOutputInCommitment::transaction_output_index.is_some()).
26390 * The returned Vec has one entry for each HTLC, and in the same order.
26392 * This function is only valid in the holder commitment context, it always uses EcdsaSighashType::All.
26394 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);
26397 * Commitment transaction numbers which appear in the transactions themselves are XOR'd with a
26398 * shared secret first. This prevents on-chain observers from discovering how many commitment
26399 * transactions occurred in a channel before it was closed.
26401 * This function gets the shared secret from relevant channel public keys and can be used to
26402 * \"decrypt\" the commitment transaction number given a commitment transaction on-chain.
26404 uint64_t get_commitment_transaction_number_obscure_factor(struct LDKPublicKey broadcaster_payment_basepoint, struct LDKPublicKey countersignatory_payment_basepoint, bool outbound_from_broadcaster);
26407 * Checks if two InitFeaturess contain equal inner contents.
26408 * This ignores pointers and is_owned flags and looks at the values in fields.
26409 * Two objects with NULL inner values will be considered "equal" here.
26411 bool InitFeatures_eq(const struct LDKInitFeatures *NONNULL_PTR a, const struct LDKInitFeatures *NONNULL_PTR b);
26414 * Checks if two NodeFeaturess contain equal inner contents.
26415 * This ignores pointers and is_owned flags and looks at the values in fields.
26416 * Two objects with NULL inner values will be considered "equal" here.
26418 bool NodeFeatures_eq(const struct LDKNodeFeatures *NONNULL_PTR a, const struct LDKNodeFeatures *NONNULL_PTR b);
26421 * Checks if two ChannelFeaturess contain equal inner contents.
26422 * This ignores pointers and is_owned flags and looks at the values in fields.
26423 * Two objects with NULL inner values will be considered "equal" here.
26425 bool ChannelFeatures_eq(const struct LDKChannelFeatures *NONNULL_PTR a, const struct LDKChannelFeatures *NONNULL_PTR b);
26428 * Checks if two InvoiceFeaturess contain equal inner contents.
26429 * This ignores pointers and is_owned flags and looks at the values in fields.
26430 * Two objects with NULL inner values will be considered "equal" here.
26432 bool InvoiceFeatures_eq(const struct LDKInvoiceFeatures *NONNULL_PTR a, const struct LDKInvoiceFeatures *NONNULL_PTR b);
26435 * Checks if two ChannelTypeFeaturess contain equal inner contents.
26436 * This ignores pointers and is_owned flags and looks at the values in fields.
26437 * Two objects with NULL inner values will be considered "equal" here.
26439 bool ChannelTypeFeatures_eq(const struct LDKChannelTypeFeatures *NONNULL_PTR a, const struct LDKChannelTypeFeatures *NONNULL_PTR b);
26442 * Creates a copy of the InitFeatures
26444 struct LDKInitFeatures InitFeatures_clone(const struct LDKInitFeatures *NONNULL_PTR orig);
26447 * Creates a copy of the NodeFeatures
26449 struct LDKNodeFeatures NodeFeatures_clone(const struct LDKNodeFeatures *NONNULL_PTR orig);
26452 * Creates a copy of the ChannelFeatures
26454 struct LDKChannelFeatures ChannelFeatures_clone(const struct LDKChannelFeatures *NONNULL_PTR orig);
26457 * Creates a copy of the InvoiceFeatures
26459 struct LDKInvoiceFeatures InvoiceFeatures_clone(const struct LDKInvoiceFeatures *NONNULL_PTR orig);
26462 * Creates a copy of the ChannelTypeFeatures
26464 struct LDKChannelTypeFeatures ChannelTypeFeatures_clone(const struct LDKChannelTypeFeatures *NONNULL_PTR orig);
26467 * Frees any resources used by the InitFeatures, if is_owned is set and inner is non-NULL.
26469 void InitFeatures_free(struct LDKInitFeatures this_obj);
26472 * Frees any resources used by the NodeFeatures, if is_owned is set and inner is non-NULL.
26474 void NodeFeatures_free(struct LDKNodeFeatures this_obj);
26477 * Frees any resources used by the ChannelFeatures, if is_owned is set and inner is non-NULL.
26479 void ChannelFeatures_free(struct LDKChannelFeatures this_obj);
26482 * Frees any resources used by the InvoiceFeatures, if is_owned is set and inner is non-NULL.
26484 void InvoiceFeatures_free(struct LDKInvoiceFeatures this_obj);
26487 * Frees any resources used by the ChannelTypeFeatures, if is_owned is set and inner is non-NULL.
26489 void ChannelTypeFeatures_free(struct LDKChannelTypeFeatures this_obj);
26492 * Returns the set of known init features that are related to channels. At least some of
26493 * these features are likely required for peers to talk to us.
26495 MUST_USE_RES struct LDKInitFeatures InitFeatures_known_channel_features(void);
26498 * Returns the set of known node features that are related to channels.
26500 MUST_USE_RES struct LDKNodeFeatures NodeFeatures_known_channel_features(void);
26503 * Create a blank Features with no features set
26505 MUST_USE_RES struct LDKInitFeatures InitFeatures_empty(void);
26508 * Creates a Features with the bits set which are known by the implementation
26510 MUST_USE_RES struct LDKInitFeatures InitFeatures_known(void);
26513 * Returns true if this `Features` object contains unknown feature flags which are set as
26516 MUST_USE_RES bool InitFeatures_requires_unknown_bits(const struct LDKInitFeatures *NONNULL_PTR this_arg);
26519 * Create a blank Features with no features set
26521 MUST_USE_RES struct LDKNodeFeatures NodeFeatures_empty(void);
26524 * Creates a Features with the bits set which are known by the implementation
26526 MUST_USE_RES struct LDKNodeFeatures NodeFeatures_known(void);
26529 * Returns true if this `Features` object contains unknown feature flags which are set as
26532 MUST_USE_RES bool NodeFeatures_requires_unknown_bits(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
26535 * Create a blank Features with no features set
26537 MUST_USE_RES struct LDKChannelFeatures ChannelFeatures_empty(void);
26540 * Creates a Features with the bits set which are known by the implementation
26542 MUST_USE_RES struct LDKChannelFeatures ChannelFeatures_known(void);
26545 * Returns true if this `Features` object contains unknown feature flags which are set as
26548 MUST_USE_RES bool ChannelFeatures_requires_unknown_bits(const struct LDKChannelFeatures *NONNULL_PTR this_arg);
26551 * Create a blank Features with no features set
26553 MUST_USE_RES struct LDKInvoiceFeatures InvoiceFeatures_empty(void);
26556 * Creates a Features with the bits set which are known by the implementation
26558 MUST_USE_RES struct LDKInvoiceFeatures InvoiceFeatures_known(void);
26561 * Returns true if this `Features` object contains unknown feature flags which are set as
26564 MUST_USE_RES bool InvoiceFeatures_requires_unknown_bits(const struct LDKInvoiceFeatures *NONNULL_PTR this_arg);
26567 * Create a blank Features with no features set
26569 MUST_USE_RES struct LDKChannelTypeFeatures ChannelTypeFeatures_empty(void);
26572 * Creates a Features with the bits set which are known by the implementation
26574 MUST_USE_RES struct LDKChannelTypeFeatures ChannelTypeFeatures_known(void);
26577 * Returns true if this `Features` object contains unknown feature flags which are set as
26580 MUST_USE_RES bool ChannelTypeFeatures_requires_unknown_bits(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
26583 * Serialize the InitFeatures object into a byte array which can be read by InitFeatures_read
26585 struct LDKCVec_u8Z InitFeatures_write(const struct LDKInitFeatures *NONNULL_PTR obj);
26588 * Read a InitFeatures from a byte array, created by InitFeatures_write
26590 struct LDKCResult_InitFeaturesDecodeErrorZ InitFeatures_read(struct LDKu8slice ser);
26593 * Serialize the ChannelFeatures object into a byte array which can be read by ChannelFeatures_read
26595 struct LDKCVec_u8Z ChannelFeatures_write(const struct LDKChannelFeatures *NONNULL_PTR obj);
26598 * Read a ChannelFeatures from a byte array, created by ChannelFeatures_write
26600 struct LDKCResult_ChannelFeaturesDecodeErrorZ ChannelFeatures_read(struct LDKu8slice ser);
26603 * Serialize the NodeFeatures object into a byte array which can be read by NodeFeatures_read
26605 struct LDKCVec_u8Z NodeFeatures_write(const struct LDKNodeFeatures *NONNULL_PTR obj);
26608 * Read a NodeFeatures from a byte array, created by NodeFeatures_write
26610 struct LDKCResult_NodeFeaturesDecodeErrorZ NodeFeatures_read(struct LDKu8slice ser);
26613 * Serialize the InvoiceFeatures object into a byte array which can be read by InvoiceFeatures_read
26615 struct LDKCVec_u8Z InvoiceFeatures_write(const struct LDKInvoiceFeatures *NONNULL_PTR obj);
26618 * Read a InvoiceFeatures from a byte array, created by InvoiceFeatures_write
26620 struct LDKCResult_InvoiceFeaturesDecodeErrorZ InvoiceFeatures_read(struct LDKu8slice ser);
26623 * Serialize the ChannelTypeFeatures object into a byte array which can be read by ChannelTypeFeatures_read
26625 struct LDKCVec_u8Z ChannelTypeFeatures_write(const struct LDKChannelTypeFeatures *NONNULL_PTR obj);
26628 * Read a ChannelTypeFeatures from a byte array, created by ChannelTypeFeatures_write
26630 struct LDKCResult_ChannelTypeFeaturesDecodeErrorZ ChannelTypeFeatures_read(struct LDKu8slice ser);
26633 * Set this feature as optional.
26635 void InitFeatures_set_data_loss_protect_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
26638 * Set this feature as required.
26640 void InitFeatures_set_data_loss_protect_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
26643 * Checks if this feature is supported.
26645 MUST_USE_RES bool InitFeatures_supports_data_loss_protect(const struct LDKInitFeatures *NONNULL_PTR this_arg);
26648 * Set this feature as optional.
26650 void NodeFeatures_set_data_loss_protect_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
26653 * Set this feature as required.
26655 void NodeFeatures_set_data_loss_protect_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
26658 * Checks if this feature is supported.
26660 MUST_USE_RES bool NodeFeatures_supports_data_loss_protect(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
26663 * Checks if this feature is required.
26665 MUST_USE_RES bool InitFeatures_requires_data_loss_protect(const struct LDKInitFeatures *NONNULL_PTR this_arg);
26668 * Checks if this feature is required.
26670 MUST_USE_RES bool NodeFeatures_requires_data_loss_protect(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
26673 * Set this feature as optional.
26675 void InitFeatures_set_initial_routing_sync_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
26678 * Set this feature as required.
26680 void InitFeatures_set_initial_routing_sync_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
26683 * Checks if this feature is supported.
26685 MUST_USE_RES bool InitFeatures_initial_routing_sync(const struct LDKInitFeatures *NONNULL_PTR this_arg);
26688 * Set this feature as optional.
26690 void InitFeatures_set_upfront_shutdown_script_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
26693 * Set this feature as required.
26695 void InitFeatures_set_upfront_shutdown_script_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
26698 * Checks if this feature is supported.
26700 MUST_USE_RES bool InitFeatures_supports_upfront_shutdown_script(const struct LDKInitFeatures *NONNULL_PTR this_arg);
26703 * Set this feature as optional.
26705 void NodeFeatures_set_upfront_shutdown_script_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
26708 * Set this feature as required.
26710 void NodeFeatures_set_upfront_shutdown_script_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
26713 * Checks if this feature is supported.
26715 MUST_USE_RES bool NodeFeatures_supports_upfront_shutdown_script(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
26718 * Checks if this feature is required.
26720 MUST_USE_RES bool InitFeatures_requires_upfront_shutdown_script(const struct LDKInitFeatures *NONNULL_PTR this_arg);
26723 * Checks if this feature is required.
26725 MUST_USE_RES bool NodeFeatures_requires_upfront_shutdown_script(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
26728 * Set this feature as optional.
26730 void InitFeatures_set_gossip_queries_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
26733 * Set this feature as required.
26735 void InitFeatures_set_gossip_queries_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
26738 * Checks if this feature is supported.
26740 MUST_USE_RES bool InitFeatures_supports_gossip_queries(const struct LDKInitFeatures *NONNULL_PTR this_arg);
26743 * Set this feature as optional.
26745 void NodeFeatures_set_gossip_queries_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
26748 * Set this feature as required.
26750 void NodeFeatures_set_gossip_queries_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
26753 * Checks if this feature is supported.
26755 MUST_USE_RES bool NodeFeatures_supports_gossip_queries(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
26758 * Checks if this feature is required.
26760 MUST_USE_RES bool InitFeatures_requires_gossip_queries(const struct LDKInitFeatures *NONNULL_PTR this_arg);
26763 * Checks if this feature is required.
26765 MUST_USE_RES bool NodeFeatures_requires_gossip_queries(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
26768 * Set this feature as optional.
26770 void InitFeatures_set_variable_length_onion_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
26773 * Set this feature as required.
26775 void InitFeatures_set_variable_length_onion_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
26778 * Checks if this feature is supported.
26780 MUST_USE_RES bool InitFeatures_supports_variable_length_onion(const struct LDKInitFeatures *NONNULL_PTR this_arg);
26783 * Set this feature as optional.
26785 void NodeFeatures_set_variable_length_onion_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
26788 * Set this feature as required.
26790 void NodeFeatures_set_variable_length_onion_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
26793 * Checks if this feature is supported.
26795 MUST_USE_RES bool NodeFeatures_supports_variable_length_onion(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
26798 * Set this feature as optional.
26800 void InvoiceFeatures_set_variable_length_onion_optional(struct LDKInvoiceFeatures *NONNULL_PTR this_arg);
26803 * Set this feature as required.
26805 void InvoiceFeatures_set_variable_length_onion_required(struct LDKInvoiceFeatures *NONNULL_PTR this_arg);
26808 * Checks if this feature is supported.
26810 MUST_USE_RES bool InvoiceFeatures_supports_variable_length_onion(const struct LDKInvoiceFeatures *NONNULL_PTR this_arg);
26813 * Checks if this feature is required.
26815 MUST_USE_RES bool InitFeatures_requires_variable_length_onion(const struct LDKInitFeatures *NONNULL_PTR this_arg);
26818 * Checks if this feature is required.
26820 MUST_USE_RES bool NodeFeatures_requires_variable_length_onion(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
26823 * Checks if this feature is required.
26825 MUST_USE_RES bool InvoiceFeatures_requires_variable_length_onion(const struct LDKInvoiceFeatures *NONNULL_PTR this_arg);
26828 * Set this feature as optional.
26830 void InitFeatures_set_static_remote_key_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
26833 * Set this feature as required.
26835 void InitFeatures_set_static_remote_key_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
26838 * Checks if this feature is supported.
26840 MUST_USE_RES bool InitFeatures_supports_static_remote_key(const struct LDKInitFeatures *NONNULL_PTR this_arg);
26843 * Set this feature as optional.
26845 void NodeFeatures_set_static_remote_key_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
26848 * Set this feature as required.
26850 void NodeFeatures_set_static_remote_key_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
26853 * Checks if this feature is supported.
26855 MUST_USE_RES bool NodeFeatures_supports_static_remote_key(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
26858 * Set this feature as optional.
26860 void ChannelTypeFeatures_set_static_remote_key_optional(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
26863 * Set this feature as required.
26865 void ChannelTypeFeatures_set_static_remote_key_required(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
26868 * Checks if this feature is supported.
26870 MUST_USE_RES bool ChannelTypeFeatures_supports_static_remote_key(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
26873 * Checks if this feature is required.
26875 MUST_USE_RES bool InitFeatures_requires_static_remote_key(const struct LDKInitFeatures *NONNULL_PTR this_arg);
26878 * Checks if this feature is required.
26880 MUST_USE_RES bool NodeFeatures_requires_static_remote_key(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
26883 * Checks if this feature is required.
26885 MUST_USE_RES bool ChannelTypeFeatures_requires_static_remote_key(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
26888 * Set this feature as optional.
26890 void InitFeatures_set_payment_secret_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
26893 * Set this feature as required.
26895 void InitFeatures_set_payment_secret_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
26898 * Checks if this feature is supported.
26900 MUST_USE_RES bool InitFeatures_supports_payment_secret(const struct LDKInitFeatures *NONNULL_PTR this_arg);
26903 * Set this feature as optional.
26905 void NodeFeatures_set_payment_secret_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
26908 * Set this feature as required.
26910 void NodeFeatures_set_payment_secret_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
26913 * Checks if this feature is supported.
26915 MUST_USE_RES bool NodeFeatures_supports_payment_secret(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
26918 * Set this feature as optional.
26920 void InvoiceFeatures_set_payment_secret_optional(struct LDKInvoiceFeatures *NONNULL_PTR this_arg);
26923 * Set this feature as required.
26925 void InvoiceFeatures_set_payment_secret_required(struct LDKInvoiceFeatures *NONNULL_PTR this_arg);
26928 * Checks if this feature is supported.
26930 MUST_USE_RES bool InvoiceFeatures_supports_payment_secret(const struct LDKInvoiceFeatures *NONNULL_PTR this_arg);
26933 * Checks if this feature is required.
26935 MUST_USE_RES bool InitFeatures_requires_payment_secret(const struct LDKInitFeatures *NONNULL_PTR this_arg);
26938 * Checks if this feature is required.
26940 MUST_USE_RES bool NodeFeatures_requires_payment_secret(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
26943 * Checks if this feature is required.
26945 MUST_USE_RES bool InvoiceFeatures_requires_payment_secret(const struct LDKInvoiceFeatures *NONNULL_PTR this_arg);
26948 * Set this feature as optional.
26950 void InitFeatures_set_basic_mpp_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
26953 * Set this feature as required.
26955 void InitFeatures_set_basic_mpp_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
26958 * Checks if this feature is supported.
26960 MUST_USE_RES bool InitFeatures_supports_basic_mpp(const struct LDKInitFeatures *NONNULL_PTR this_arg);
26963 * Set this feature as optional.
26965 void NodeFeatures_set_basic_mpp_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
26968 * Set this feature as required.
26970 void NodeFeatures_set_basic_mpp_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
26973 * Checks if this feature is supported.
26975 MUST_USE_RES bool NodeFeatures_supports_basic_mpp(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
26978 * Set this feature as optional.
26980 void InvoiceFeatures_set_basic_mpp_optional(struct LDKInvoiceFeatures *NONNULL_PTR this_arg);
26983 * Set this feature as required.
26985 void InvoiceFeatures_set_basic_mpp_required(struct LDKInvoiceFeatures *NONNULL_PTR this_arg);
26988 * Checks if this feature is supported.
26990 MUST_USE_RES bool InvoiceFeatures_supports_basic_mpp(const struct LDKInvoiceFeatures *NONNULL_PTR this_arg);
26993 * Checks if this feature is required.
26995 MUST_USE_RES bool InitFeatures_requires_basic_mpp(const struct LDKInitFeatures *NONNULL_PTR this_arg);
26998 * Checks if this feature is required.
27000 MUST_USE_RES bool NodeFeatures_requires_basic_mpp(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
27003 * Checks if this feature is required.
27005 MUST_USE_RES bool InvoiceFeatures_requires_basic_mpp(const struct LDKInvoiceFeatures *NONNULL_PTR this_arg);
27008 * Set this feature as optional.
27010 void InitFeatures_set_wumbo_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
27013 * Set this feature as required.
27015 void InitFeatures_set_wumbo_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
27018 * Checks if this feature is supported.
27020 MUST_USE_RES bool InitFeatures_supports_wumbo(const struct LDKInitFeatures *NONNULL_PTR this_arg);
27023 * Set this feature as optional.
27025 void NodeFeatures_set_wumbo_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
27028 * Set this feature as required.
27030 void NodeFeatures_set_wumbo_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
27033 * Checks if this feature is supported.
27035 MUST_USE_RES bool NodeFeatures_supports_wumbo(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
27038 * Checks if this feature is required.
27040 MUST_USE_RES bool InitFeatures_requires_wumbo(const struct LDKInitFeatures *NONNULL_PTR this_arg);
27043 * Checks if this feature is required.
27045 MUST_USE_RES bool NodeFeatures_requires_wumbo(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
27048 * Set this feature as optional.
27050 void InitFeatures_set_shutdown_any_segwit_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
27053 * Set this feature as required.
27055 void InitFeatures_set_shutdown_any_segwit_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
27058 * Checks if this feature is supported.
27060 MUST_USE_RES bool InitFeatures_supports_shutdown_anysegwit(const struct LDKInitFeatures *NONNULL_PTR this_arg);
27063 * Set this feature as optional.
27065 void NodeFeatures_set_shutdown_any_segwit_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
27068 * Set this feature as required.
27070 void NodeFeatures_set_shutdown_any_segwit_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
27073 * Checks if this feature is supported.
27075 MUST_USE_RES bool NodeFeatures_supports_shutdown_anysegwit(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
27078 * Checks if this feature is required.
27080 MUST_USE_RES bool InitFeatures_requires_shutdown_anysegwit(const struct LDKInitFeatures *NONNULL_PTR this_arg);
27083 * Checks if this feature is required.
27085 MUST_USE_RES bool NodeFeatures_requires_shutdown_anysegwit(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
27088 * Set this feature as optional.
27090 void InitFeatures_set_onion_messages_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
27093 * Set this feature as required.
27095 void InitFeatures_set_onion_messages_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
27098 * Checks if this feature is supported.
27100 MUST_USE_RES bool InitFeatures_supports_onion_messages(const struct LDKInitFeatures *NONNULL_PTR this_arg);
27103 * Set this feature as optional.
27105 void NodeFeatures_set_onion_messages_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
27108 * Set this feature as required.
27110 void NodeFeatures_set_onion_messages_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
27113 * Checks if this feature is supported.
27115 MUST_USE_RES bool NodeFeatures_supports_onion_messages(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
27118 * Checks if this feature is required.
27120 MUST_USE_RES bool InitFeatures_requires_onion_messages(const struct LDKInitFeatures *NONNULL_PTR this_arg);
27123 * Checks if this feature is required.
27125 MUST_USE_RES bool NodeFeatures_requires_onion_messages(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
27128 * Set this feature as optional.
27130 void InitFeatures_set_channel_type_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
27133 * Set this feature as required.
27135 void InitFeatures_set_channel_type_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
27138 * Checks if this feature is supported.
27140 MUST_USE_RES bool InitFeatures_supports_channel_type(const struct LDKInitFeatures *NONNULL_PTR this_arg);
27143 * Set this feature as optional.
27145 void NodeFeatures_set_channel_type_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
27148 * Set this feature as required.
27150 void NodeFeatures_set_channel_type_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
27153 * Checks if this feature is supported.
27155 MUST_USE_RES bool NodeFeatures_supports_channel_type(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
27158 * Checks if this feature is required.
27160 MUST_USE_RES bool InitFeatures_requires_channel_type(const struct LDKInitFeatures *NONNULL_PTR this_arg);
27163 * Checks if this feature is required.
27165 MUST_USE_RES bool NodeFeatures_requires_channel_type(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
27168 * Set this feature as optional.
27170 void InitFeatures_set_scid_privacy_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
27173 * Set this feature as required.
27175 void InitFeatures_set_scid_privacy_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
27178 * Checks if this feature is supported.
27180 MUST_USE_RES bool InitFeatures_supports_scid_privacy(const struct LDKInitFeatures *NONNULL_PTR this_arg);
27183 * Set this feature as optional.
27185 void NodeFeatures_set_scid_privacy_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
27188 * Set this feature as required.
27190 void NodeFeatures_set_scid_privacy_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
27193 * Checks if this feature is supported.
27195 MUST_USE_RES bool NodeFeatures_supports_scid_privacy(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
27198 * Set this feature as optional.
27200 void ChannelTypeFeatures_set_scid_privacy_optional(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
27203 * Set this feature as required.
27205 void ChannelTypeFeatures_set_scid_privacy_required(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
27208 * Checks if this feature is supported.
27210 MUST_USE_RES bool ChannelTypeFeatures_supports_scid_privacy(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
27213 * Checks if this feature is required.
27215 MUST_USE_RES bool InitFeatures_requires_scid_privacy(const struct LDKInitFeatures *NONNULL_PTR this_arg);
27218 * Checks if this feature is required.
27220 MUST_USE_RES bool NodeFeatures_requires_scid_privacy(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
27223 * Checks if this feature is required.
27225 MUST_USE_RES bool ChannelTypeFeatures_requires_scid_privacy(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
27228 * Set this feature as optional.
27230 void InitFeatures_set_zero_conf_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
27233 * Set this feature as required.
27235 void InitFeatures_set_zero_conf_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
27238 * Checks if this feature is supported.
27240 MUST_USE_RES bool InitFeatures_supports_zero_conf(const struct LDKInitFeatures *NONNULL_PTR this_arg);
27243 * Set this feature as optional.
27245 void NodeFeatures_set_zero_conf_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
27248 * Set this feature as required.
27250 void NodeFeatures_set_zero_conf_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
27253 * Checks if this feature is supported.
27255 MUST_USE_RES bool NodeFeatures_supports_zero_conf(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
27258 * Set this feature as optional.
27260 void ChannelTypeFeatures_set_zero_conf_optional(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
27263 * Set this feature as required.
27265 void ChannelTypeFeatures_set_zero_conf_required(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
27268 * Checks if this feature is supported.
27270 MUST_USE_RES bool ChannelTypeFeatures_supports_zero_conf(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
27273 * Checks if this feature is required.
27275 MUST_USE_RES bool InitFeatures_requires_zero_conf(const struct LDKInitFeatures *NONNULL_PTR this_arg);
27278 * Checks if this feature is required.
27280 MUST_USE_RES bool NodeFeatures_requires_zero_conf(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
27283 * Checks if this feature is required.
27285 MUST_USE_RES bool ChannelTypeFeatures_requires_zero_conf(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
27288 * Set this feature as optional.
27290 void NodeFeatures_set_keysend_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
27293 * Set this feature as required.
27295 void NodeFeatures_set_keysend_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
27298 * Checks if this feature is supported.
27300 MUST_USE_RES bool NodeFeatures_supports_keysend(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
27303 * Checks if this feature is required.
27305 MUST_USE_RES bool NodeFeatures_requires_keysend(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
27308 * Frees any resources used by the ShutdownScript, if is_owned is set and inner is non-NULL.
27310 void ShutdownScript_free(struct LDKShutdownScript this_obj);
27313 * Creates a copy of the ShutdownScript
27315 struct LDKShutdownScript ShutdownScript_clone(const struct LDKShutdownScript *NONNULL_PTR orig);
27318 * Frees any resources used by the InvalidShutdownScript, if is_owned is set and inner is non-NULL.
27320 void InvalidShutdownScript_free(struct LDKInvalidShutdownScript this_obj);
27323 * The script that did not meet the requirements from [BOLT #2].
27325 * [BOLT #2]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md
27327 struct LDKu8slice InvalidShutdownScript_get_script(const struct LDKInvalidShutdownScript *NONNULL_PTR this_ptr);
27330 * The script that did not meet the requirements from [BOLT #2].
27332 * [BOLT #2]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md
27334 void InvalidShutdownScript_set_script(struct LDKInvalidShutdownScript *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val);
27337 * Constructs a new InvalidShutdownScript given each field
27339 MUST_USE_RES struct LDKInvalidShutdownScript InvalidShutdownScript_new(struct LDKCVec_u8Z script_arg);
27342 * Creates a copy of the InvalidShutdownScript
27344 struct LDKInvalidShutdownScript InvalidShutdownScript_clone(const struct LDKInvalidShutdownScript *NONNULL_PTR orig);
27347 * Serialize the ShutdownScript object into a byte array which can be read by ShutdownScript_read
27349 struct LDKCVec_u8Z ShutdownScript_write(const struct LDKShutdownScript *NONNULL_PTR obj);
27352 * Read a ShutdownScript from a byte array, created by ShutdownScript_write
27354 struct LDKCResult_ShutdownScriptDecodeErrorZ ShutdownScript_read(struct LDKu8slice ser);
27357 * Generates a P2WPKH script pubkey from the given [`WPubkeyHash`].
27359 MUST_USE_RES struct LDKShutdownScript ShutdownScript_new_p2wpkh(const uint8_t (*pubkey_hash)[20]);
27362 * Generates a P2WSH script pubkey from the given [`WScriptHash`].
27364 MUST_USE_RES struct LDKShutdownScript ShutdownScript_new_p2wsh(const uint8_t (*script_hash)[32]);
27367 * Generates a witness script pubkey from the given segwit version and program.
27369 * Note for version-zero witness scripts you must use [`ShutdownScript::new_p2wpkh`] or
27370 * [`ShutdownScript::new_p2wsh`] instead.
27374 * This function may return an error if `program` is invalid for the segwit `version`.
27376 MUST_USE_RES struct LDKCResult_ShutdownScriptInvalidShutdownScriptZ ShutdownScript_new_witness_program(struct LDKWitnessVersion version, struct LDKu8slice program);
27379 * Converts the shutdown script into the underlying [`Script`].
27381 MUST_USE_RES struct LDKCVec_u8Z ShutdownScript_into_inner(struct LDKShutdownScript this_arg);
27384 * Returns the [`PublicKey`] used for a P2WPKH shutdown script if constructed directly from it.
27386 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
27388 MUST_USE_RES struct LDKPublicKey ShutdownScript_as_legacy_pubkey(const struct LDKShutdownScript *NONNULL_PTR this_arg);
27391 * Returns whether the shutdown script is compatible with the features as defined by BOLT #2.
27393 * Specifically, checks for compliance with feature `option_shutdown_anysegwit`.
27395 MUST_USE_RES bool ShutdownScript_is_compatible(const struct LDKShutdownScript *NONNULL_PTR this_arg, const struct LDKInitFeatures *NONNULL_PTR features);
27398 * Calls the free function if one is set
27400 void CustomMessageReader_free(struct LDKCustomMessageReader this_ptr);
27403 * Calls the free function if one is set
27405 void Type_free(struct LDKType this_ptr);
27408 * Frees any resources used by the NodeId, if is_owned is set and inner is non-NULL.
27410 void NodeId_free(struct LDKNodeId this_obj);
27413 * Creates a copy of the NodeId
27415 struct LDKNodeId NodeId_clone(const struct LDKNodeId *NONNULL_PTR orig);
27418 * Create a new NodeId from a public key
27420 MUST_USE_RES struct LDKNodeId NodeId_from_pubkey(struct LDKPublicKey pubkey);
27423 * Get the public key slice from this NodeId
27425 MUST_USE_RES struct LDKu8slice NodeId_as_slice(const struct LDKNodeId *NONNULL_PTR this_arg);
27428 * Checks if two NodeIds contain equal inner contents.
27430 uint64_t NodeId_hash(const struct LDKNodeId *NONNULL_PTR o);
27433 * Serialize the NodeId object into a byte array which can be read by NodeId_read
27435 struct LDKCVec_u8Z NodeId_write(const struct LDKNodeId *NONNULL_PTR obj);
27438 * Read a NodeId from a byte array, created by NodeId_write
27440 struct LDKCResult_NodeIdDecodeErrorZ NodeId_read(struct LDKu8slice ser);
27443 * Frees any resources used by the NetworkGraph, if is_owned is set and inner is non-NULL.
27445 void NetworkGraph_free(struct LDKNetworkGraph this_obj);
27448 * Frees any resources used by the ReadOnlyNetworkGraph, if is_owned is set and inner is non-NULL.
27450 void ReadOnlyNetworkGraph_free(struct LDKReadOnlyNetworkGraph this_obj);
27453 * Frees any resources used by the NetworkUpdate
27455 void NetworkUpdate_free(struct LDKNetworkUpdate this_ptr);
27458 * Creates a copy of the NetworkUpdate
27460 struct LDKNetworkUpdate NetworkUpdate_clone(const struct LDKNetworkUpdate *NONNULL_PTR orig);
27463 * Utility method to constructs a new ChannelUpdateMessage-variant NetworkUpdate
27465 struct LDKNetworkUpdate NetworkUpdate_channel_update_message(struct LDKChannelUpdate msg);
27468 * Utility method to constructs a new ChannelFailure-variant NetworkUpdate
27470 struct LDKNetworkUpdate NetworkUpdate_channel_failure(uint64_t short_channel_id, bool is_permanent);
27473 * Utility method to constructs a new NodeFailure-variant NetworkUpdate
27475 struct LDKNetworkUpdate NetworkUpdate_node_failure(struct LDKPublicKey node_id, bool is_permanent);
27478 * Serialize the NetworkUpdate object into a byte array which can be read by NetworkUpdate_read
27480 struct LDKCVec_u8Z NetworkUpdate_write(const struct LDKNetworkUpdate *NONNULL_PTR obj);
27483 * Read a NetworkUpdate from a byte array, created by NetworkUpdate_write
27485 struct LDKCResult_COption_NetworkUpdateZDecodeErrorZ NetworkUpdate_read(struct LDKu8slice ser);
27488 * Frees any resources used by the P2PGossipSync, if is_owned is set and inner is non-NULL.
27490 void P2PGossipSync_free(struct LDKP2PGossipSync this_obj);
27493 * Creates a new tracker of the actual state of the network of channels and nodes,
27494 * assuming an existing Network Graph.
27495 * Chain monitor is used to make sure announced channels exist on-chain,
27496 * channel data is correct, and that the announcement is signed with
27497 * channel owners' keys.
27499 MUST_USE_RES struct LDKP2PGossipSync P2PGossipSync_new(const struct LDKNetworkGraph *NONNULL_PTR network_graph, struct LDKCOption_AccessZ chain_access, struct LDKLogger logger);
27502 * Adds a provider used to check new announcements. Does not affect
27503 * existing announcements unless they are updated.
27504 * Add, update or remove the provider would replace the current one.
27506 void P2PGossipSync_add_chain_access(struct LDKP2PGossipSync *NONNULL_PTR this_arg, struct LDKCOption_AccessZ chain_access);
27509 * Constructs a new EventHandler which calls the relevant methods on this_arg.
27510 * This copies the `inner` pointer in this_arg and thus the returned EventHandler must be freed before this_arg is
27512 struct LDKEventHandler NetworkGraph_as_EventHandler(const struct LDKNetworkGraph *NONNULL_PTR this_arg);
27515 * Constructs a new RoutingMessageHandler which calls the relevant methods on this_arg.
27516 * This copies the `inner` pointer in this_arg and thus the returned RoutingMessageHandler must be freed before this_arg is
27518 struct LDKRoutingMessageHandler P2PGossipSync_as_RoutingMessageHandler(const struct LDKP2PGossipSync *NONNULL_PTR this_arg);
27521 * Constructs a new MessageSendEventsProvider which calls the relevant methods on this_arg.
27522 * This copies the `inner` pointer in this_arg and thus the returned MessageSendEventsProvider must be freed before this_arg is
27524 struct LDKMessageSendEventsProvider P2PGossipSync_as_MessageSendEventsProvider(const struct LDKP2PGossipSync *NONNULL_PTR this_arg);
27527 * Frees any resources used by the ChannelUpdateInfo, if is_owned is set and inner is non-NULL.
27529 void ChannelUpdateInfo_free(struct LDKChannelUpdateInfo this_obj);
27532 * When the last update to the channel direction was issued.
27533 * Value is opaque, as set in the announcement.
27535 uint32_t ChannelUpdateInfo_get_last_update(const struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr);
27538 * When the last update to the channel direction was issued.
27539 * Value is opaque, as set in the announcement.
27541 void ChannelUpdateInfo_set_last_update(struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr, uint32_t val);
27544 * Whether the channel can be currently used for payments (in this one direction).
27546 bool ChannelUpdateInfo_get_enabled(const struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr);
27549 * Whether the channel can be currently used for payments (in this one direction).
27551 void ChannelUpdateInfo_set_enabled(struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr, bool val);
27554 * The difference in CLTV values that you must have when routing through this channel.
27556 uint16_t ChannelUpdateInfo_get_cltv_expiry_delta(const struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr);
27559 * The difference in CLTV values that you must have when routing through this channel.
27561 void ChannelUpdateInfo_set_cltv_expiry_delta(struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr, uint16_t val);
27564 * The minimum value, which must be relayed to the next hop via the channel
27566 uint64_t ChannelUpdateInfo_get_htlc_minimum_msat(const struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr);
27569 * The minimum value, which must be relayed to the next hop via the channel
27571 void ChannelUpdateInfo_set_htlc_minimum_msat(struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr, uint64_t val);
27574 * The maximum value which may be relayed to the next hop via the channel.
27576 uint64_t ChannelUpdateInfo_get_htlc_maximum_msat(const struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr);
27579 * The maximum value which may be relayed to the next hop via the channel.
27581 void ChannelUpdateInfo_set_htlc_maximum_msat(struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr, uint64_t val);
27584 * Fees charged when the channel is used for routing
27586 struct LDKRoutingFees ChannelUpdateInfo_get_fees(const struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr);
27589 * Fees charged when the channel is used for routing
27591 void ChannelUpdateInfo_set_fees(struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr, struct LDKRoutingFees val);
27594 * Most recent update for the channel received from the network
27595 * Mostly redundant with the data we store in fields explicitly.
27596 * Everything else is useful only for sending out for initial routing sync.
27597 * Not stored if contains excess data to prevent DoS.
27599 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
27601 struct LDKChannelUpdate ChannelUpdateInfo_get_last_update_message(const struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr);
27604 * Most recent update for the channel received from the network
27605 * Mostly redundant with the data we store in fields explicitly.
27606 * Everything else is useful only for sending out for initial routing sync.
27607 * Not stored if contains excess data to prevent DoS.
27609 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
27611 void ChannelUpdateInfo_set_last_update_message(struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr, struct LDKChannelUpdate val);
27614 * Constructs a new ChannelUpdateInfo given each field
27616 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);
27619 * Creates a copy of the ChannelUpdateInfo
27621 struct LDKChannelUpdateInfo ChannelUpdateInfo_clone(const struct LDKChannelUpdateInfo *NONNULL_PTR orig);
27624 * Serialize the ChannelUpdateInfo object into a byte array which can be read by ChannelUpdateInfo_read
27626 struct LDKCVec_u8Z ChannelUpdateInfo_write(const struct LDKChannelUpdateInfo *NONNULL_PTR obj);
27629 * Read a ChannelUpdateInfo from a byte array, created by ChannelUpdateInfo_write
27631 struct LDKCResult_ChannelUpdateInfoDecodeErrorZ ChannelUpdateInfo_read(struct LDKu8slice ser);
27634 * Frees any resources used by the ChannelInfo, if is_owned is set and inner is non-NULL.
27636 void ChannelInfo_free(struct LDKChannelInfo this_obj);
27639 * Protocol features of a channel communicated during its announcement
27641 struct LDKChannelFeatures ChannelInfo_get_features(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
27644 * Protocol features of a channel communicated during its announcement
27646 void ChannelInfo_set_features(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKChannelFeatures val);
27649 * Source node of the first direction of a channel
27651 struct LDKNodeId ChannelInfo_get_node_one(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
27654 * Source node of the first direction of a channel
27656 void ChannelInfo_set_node_one(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKNodeId val);
27659 * Details about the first direction of a channel
27661 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
27663 struct LDKChannelUpdateInfo ChannelInfo_get_one_to_two(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
27666 * Details about the first direction of a channel
27668 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
27670 void ChannelInfo_set_one_to_two(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKChannelUpdateInfo val);
27673 * Source node of the second direction of a channel
27675 struct LDKNodeId ChannelInfo_get_node_two(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
27678 * Source node of the second direction of a channel
27680 void ChannelInfo_set_node_two(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKNodeId val);
27683 * Details about the second direction of a channel
27685 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
27687 struct LDKChannelUpdateInfo ChannelInfo_get_two_to_one(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
27690 * Details about the second direction of a channel
27692 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
27694 void ChannelInfo_set_two_to_one(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKChannelUpdateInfo val);
27697 * The channel capacity as seen on-chain, if chain lookup is available.
27699 struct LDKCOption_u64Z ChannelInfo_get_capacity_sats(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
27702 * The channel capacity as seen on-chain, if chain lookup is available.
27704 void ChannelInfo_set_capacity_sats(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
27707 * An initial announcement of the channel
27708 * Mostly redundant with the data we store in fields explicitly.
27709 * Everything else is useful only for sending out for initial routing sync.
27710 * Not stored if contains excess data to prevent DoS.
27712 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
27714 struct LDKChannelAnnouncement ChannelInfo_get_announcement_message(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
27717 * An initial announcement of the channel
27718 * Mostly redundant with the data we store in fields explicitly.
27719 * Everything else is useful only for sending out for initial routing sync.
27720 * Not stored if contains excess data to prevent DoS.
27722 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
27724 void ChannelInfo_set_announcement_message(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKChannelAnnouncement val);
27727 * Creates a copy of the ChannelInfo
27729 struct LDKChannelInfo ChannelInfo_clone(const struct LDKChannelInfo *NONNULL_PTR orig);
27732 * Returns a [`ChannelUpdateInfo`] based on the direction implied by the channel_flag.
27734 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
27736 MUST_USE_RES struct LDKChannelUpdateInfo ChannelInfo_get_directional_info(const struct LDKChannelInfo *NONNULL_PTR this_arg, uint8_t channel_flags);
27739 * Serialize the ChannelInfo object into a byte array which can be read by ChannelInfo_read
27741 struct LDKCVec_u8Z ChannelInfo_write(const struct LDKChannelInfo *NONNULL_PTR obj);
27744 * Read a ChannelInfo from a byte array, created by ChannelInfo_write
27746 struct LDKCResult_ChannelInfoDecodeErrorZ ChannelInfo_read(struct LDKu8slice ser);
27749 * Frees any resources used by the DirectedChannelInfo, if is_owned is set and inner is non-NULL.
27751 void DirectedChannelInfo_free(struct LDKDirectedChannelInfo this_obj);
27754 * Creates a copy of the DirectedChannelInfo
27756 struct LDKDirectedChannelInfo DirectedChannelInfo_clone(const struct LDKDirectedChannelInfo *NONNULL_PTR orig);
27759 * Returns information for the channel.
27761 MUST_USE_RES struct LDKChannelInfo DirectedChannelInfo_channel(const struct LDKDirectedChannelInfo *NONNULL_PTR this_arg);
27764 * Returns information for the direction.
27766 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
27768 MUST_USE_RES struct LDKChannelUpdateInfo DirectedChannelInfo_direction(const struct LDKDirectedChannelInfo *NONNULL_PTR this_arg);
27771 * Returns the maximum HTLC amount allowed over the channel in the direction.
27773 MUST_USE_RES uint64_t DirectedChannelInfo_htlc_maximum_msat(const struct LDKDirectedChannelInfo *NONNULL_PTR this_arg);
27776 * Returns the [`EffectiveCapacity`] of the channel in the direction.
27778 * This is either the total capacity from the funding transaction, if known, or the
27779 * `htlc_maximum_msat` for the direction as advertised by the gossip network, if known,
27782 MUST_USE_RES struct LDKEffectiveCapacity DirectedChannelInfo_effective_capacity(const struct LDKDirectedChannelInfo *NONNULL_PTR this_arg);
27785 * Frees any resources used by the EffectiveCapacity
27787 void EffectiveCapacity_free(struct LDKEffectiveCapacity this_ptr);
27790 * Creates a copy of the EffectiveCapacity
27792 struct LDKEffectiveCapacity EffectiveCapacity_clone(const struct LDKEffectiveCapacity *NONNULL_PTR orig);
27795 * Utility method to constructs a new ExactLiquidity-variant EffectiveCapacity
27797 struct LDKEffectiveCapacity EffectiveCapacity_exact_liquidity(uint64_t liquidity_msat);
27800 * Utility method to constructs a new MaximumHTLC-variant EffectiveCapacity
27802 struct LDKEffectiveCapacity EffectiveCapacity_maximum_htlc(uint64_t amount_msat);
27805 * Utility method to constructs a new Total-variant EffectiveCapacity
27807 struct LDKEffectiveCapacity EffectiveCapacity_total(uint64_t capacity_msat, struct LDKCOption_u64Z htlc_maximum_msat);
27810 * Utility method to constructs a new Infinite-variant EffectiveCapacity
27812 struct LDKEffectiveCapacity EffectiveCapacity_infinite(void);
27815 * Utility method to constructs a new Unknown-variant EffectiveCapacity
27817 struct LDKEffectiveCapacity EffectiveCapacity_unknown(void);
27820 * Returns the effective capacity denominated in millisatoshi.
27822 MUST_USE_RES uint64_t EffectiveCapacity_as_msat(const struct LDKEffectiveCapacity *NONNULL_PTR this_arg);
27825 * Frees any resources used by the RoutingFees, if is_owned is set and inner is non-NULL.
27827 void RoutingFees_free(struct LDKRoutingFees this_obj);
27830 * Flat routing fee in satoshis
27832 uint32_t RoutingFees_get_base_msat(const struct LDKRoutingFees *NONNULL_PTR this_ptr);
27835 * Flat routing fee in satoshis
27837 void RoutingFees_set_base_msat(struct LDKRoutingFees *NONNULL_PTR this_ptr, uint32_t val);
27840 * Liquidity-based routing fee in millionths of a routed amount.
27841 * In other words, 10000 is 1%.
27843 uint32_t RoutingFees_get_proportional_millionths(const struct LDKRoutingFees *NONNULL_PTR this_ptr);
27846 * Liquidity-based routing fee in millionths of a routed amount.
27847 * In other words, 10000 is 1%.
27849 void RoutingFees_set_proportional_millionths(struct LDKRoutingFees *NONNULL_PTR this_ptr, uint32_t val);
27852 * Constructs a new RoutingFees given each field
27854 MUST_USE_RES struct LDKRoutingFees RoutingFees_new(uint32_t base_msat_arg, uint32_t proportional_millionths_arg);
27857 * Checks if two RoutingFeess contain equal inner contents.
27858 * This ignores pointers and is_owned flags and looks at the values in fields.
27859 * Two objects with NULL inner values will be considered "equal" here.
27861 bool RoutingFees_eq(const struct LDKRoutingFees *NONNULL_PTR a, const struct LDKRoutingFees *NONNULL_PTR b);
27864 * Creates a copy of the RoutingFees
27866 struct LDKRoutingFees RoutingFees_clone(const struct LDKRoutingFees *NONNULL_PTR orig);
27869 * Checks if two RoutingFeess contain equal inner contents.
27871 uint64_t RoutingFees_hash(const struct LDKRoutingFees *NONNULL_PTR o);
27874 * Serialize the RoutingFees object into a byte array which can be read by RoutingFees_read
27876 struct LDKCVec_u8Z RoutingFees_write(const struct LDKRoutingFees *NONNULL_PTR obj);
27879 * Read a RoutingFees from a byte array, created by RoutingFees_write
27881 struct LDKCResult_RoutingFeesDecodeErrorZ RoutingFees_read(struct LDKu8slice ser);
27884 * Frees any resources used by the NodeAnnouncementInfo, if is_owned is set and inner is non-NULL.
27886 void NodeAnnouncementInfo_free(struct LDKNodeAnnouncementInfo this_obj);
27889 * Protocol features the node announced support for
27891 struct LDKNodeFeatures NodeAnnouncementInfo_get_features(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr);
27894 * Protocol features the node announced support for
27896 void NodeAnnouncementInfo_set_features(struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr, struct LDKNodeFeatures val);
27899 * When the last known update to the node state was issued.
27900 * Value is opaque, as set in the announcement.
27902 uint32_t NodeAnnouncementInfo_get_last_update(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr);
27905 * When the last known update to the node state was issued.
27906 * Value is opaque, as set in the announcement.
27908 void NodeAnnouncementInfo_set_last_update(struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr, uint32_t val);
27911 * Color assigned to the node
27913 const uint8_t (*NodeAnnouncementInfo_get_rgb(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr))[3];
27916 * Color assigned to the node
27918 void NodeAnnouncementInfo_set_rgb(struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr, struct LDKThreeBytes val);
27921 * Moniker assigned to the node.
27922 * May be invalid or malicious (eg control chars),
27923 * should not be exposed to the user.
27925 struct LDKNodeAlias NodeAnnouncementInfo_get_alias(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr);
27928 * Moniker assigned to the node.
27929 * May be invalid or malicious (eg control chars),
27930 * should not be exposed to the user.
27932 void NodeAnnouncementInfo_set_alias(struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr, struct LDKNodeAlias val);
27935 * Internet-level addresses via which one can connect to the node
27937 * Returns a copy of the field.
27939 struct LDKCVec_NetAddressZ NodeAnnouncementInfo_get_addresses(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr);
27942 * Internet-level addresses via which one can connect to the node
27944 void NodeAnnouncementInfo_set_addresses(struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr, struct LDKCVec_NetAddressZ val);
27947 * An initial announcement of the node
27948 * Mostly redundant with the data we store in fields explicitly.
27949 * Everything else is useful only for sending out for initial routing sync.
27950 * Not stored if contains excess data to prevent DoS.
27952 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
27954 struct LDKNodeAnnouncement NodeAnnouncementInfo_get_announcement_message(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr);
27957 * An initial announcement of the node
27958 * Mostly redundant with the data we store in fields explicitly.
27959 * Everything else is useful only for sending out for initial routing sync.
27960 * Not stored if contains excess data to prevent DoS.
27962 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
27964 void NodeAnnouncementInfo_set_announcement_message(struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr, struct LDKNodeAnnouncement val);
27967 * Constructs a new NodeAnnouncementInfo given each field
27969 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);
27972 * Creates a copy of the NodeAnnouncementInfo
27974 struct LDKNodeAnnouncementInfo NodeAnnouncementInfo_clone(const struct LDKNodeAnnouncementInfo *NONNULL_PTR orig);
27977 * Serialize the NodeAnnouncementInfo object into a byte array which can be read by NodeAnnouncementInfo_read
27979 struct LDKCVec_u8Z NodeAnnouncementInfo_write(const struct LDKNodeAnnouncementInfo *NONNULL_PTR obj);
27982 * Read a NodeAnnouncementInfo from a byte array, created by NodeAnnouncementInfo_write
27984 struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ NodeAnnouncementInfo_read(struct LDKu8slice ser);
27987 * Frees any resources used by the NodeAlias, if is_owned is set and inner is non-NULL.
27989 void NodeAlias_free(struct LDKNodeAlias this_obj);
27991 const uint8_t (*NodeAlias_get_a(const struct LDKNodeAlias *NONNULL_PTR this_ptr))[32];
27993 void NodeAlias_set_a(struct LDKNodeAlias *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
27996 * Constructs a new NodeAlias given each field
27998 MUST_USE_RES struct LDKNodeAlias NodeAlias_new(struct LDKThirtyTwoBytes a_arg);
28001 * Creates a copy of the NodeAlias
28003 struct LDKNodeAlias NodeAlias_clone(const struct LDKNodeAlias *NONNULL_PTR orig);
28006 * Serialize the NodeAlias object into a byte array which can be read by NodeAlias_read
28008 struct LDKCVec_u8Z NodeAlias_write(const struct LDKNodeAlias *NONNULL_PTR obj);
28011 * Read a NodeAlias from a byte array, created by NodeAlias_write
28013 struct LDKCResult_NodeAliasDecodeErrorZ NodeAlias_read(struct LDKu8slice ser);
28016 * Frees any resources used by the NodeInfo, if is_owned is set and inner is non-NULL.
28018 void NodeInfo_free(struct LDKNodeInfo this_obj);
28021 * All valid channels a node has announced
28023 * Returns a copy of the field.
28025 struct LDKCVec_u64Z NodeInfo_get_channels(const struct LDKNodeInfo *NONNULL_PTR this_ptr);
28028 * All valid channels a node has announced
28030 void NodeInfo_set_channels(struct LDKNodeInfo *NONNULL_PTR this_ptr, struct LDKCVec_u64Z val);
28033 * Lowest fees enabling routing via any of the enabled, known channels to a node.
28034 * The two fields (flat and proportional fee) are independent,
28035 * meaning they don't have to refer to the same channel.
28037 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
28039 struct LDKRoutingFees NodeInfo_get_lowest_inbound_channel_fees(const struct LDKNodeInfo *NONNULL_PTR this_ptr);
28042 * Lowest fees enabling routing via any of the enabled, known channels to a node.
28043 * The two fields (flat and proportional fee) are independent,
28044 * meaning they don't have to refer to the same channel.
28046 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
28048 void NodeInfo_set_lowest_inbound_channel_fees(struct LDKNodeInfo *NONNULL_PTR this_ptr, struct LDKRoutingFees val);
28051 * More information about a node from node_announcement.
28052 * Optional because we store a Node entry after learning about it from
28053 * a channel announcement, but before receiving a node announcement.
28055 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
28057 struct LDKNodeAnnouncementInfo NodeInfo_get_announcement_info(const struct LDKNodeInfo *NONNULL_PTR this_ptr);
28060 * More information about a node from node_announcement.
28061 * Optional because we store a Node entry after learning about it from
28062 * a channel announcement, but before receiving a node announcement.
28064 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
28066 void NodeInfo_set_announcement_info(struct LDKNodeInfo *NONNULL_PTR this_ptr, struct LDKNodeAnnouncementInfo val);
28069 * Constructs a new NodeInfo given each field
28071 MUST_USE_RES struct LDKNodeInfo NodeInfo_new(struct LDKCVec_u64Z channels_arg, struct LDKRoutingFees lowest_inbound_channel_fees_arg, struct LDKNodeAnnouncementInfo announcement_info_arg);
28074 * Creates a copy of the NodeInfo
28076 struct LDKNodeInfo NodeInfo_clone(const struct LDKNodeInfo *NONNULL_PTR orig);
28079 * Serialize the NodeInfo object into a byte array which can be read by NodeInfo_read
28081 struct LDKCVec_u8Z NodeInfo_write(const struct LDKNodeInfo *NONNULL_PTR obj);
28084 * Read a NodeInfo from a byte array, created by NodeInfo_write
28086 struct LDKCResult_NodeInfoDecodeErrorZ NodeInfo_read(struct LDKu8slice ser);
28089 * Serialize the NetworkGraph object into a byte array which can be read by NetworkGraph_read
28091 struct LDKCVec_u8Z NetworkGraph_write(const struct LDKNetworkGraph *NONNULL_PTR obj);
28094 * Read a NetworkGraph from a byte array, created by NetworkGraph_write
28096 struct LDKCResult_NetworkGraphDecodeErrorZ NetworkGraph_read(struct LDKu8slice ser, struct LDKLogger arg);
28099 * Creates a new, empty, network graph.
28101 MUST_USE_RES struct LDKNetworkGraph NetworkGraph_new(struct LDKThirtyTwoBytes genesis_hash, struct LDKLogger logger);
28104 * Returns a read-only view of the network graph.
28106 MUST_USE_RES struct LDKReadOnlyNetworkGraph NetworkGraph_read_only(const struct LDKNetworkGraph *NONNULL_PTR this_arg);
28109 * The unix timestamp provided by the most recent rapid gossip sync.
28110 * It will be set by the rapid sync process after every sync completion.
28112 MUST_USE_RES struct LDKCOption_u32Z NetworkGraph_get_last_rapid_gossip_sync_timestamp(const struct LDKNetworkGraph *NONNULL_PTR this_arg);
28115 * Update the unix timestamp provided by the most recent rapid gossip sync.
28116 * This should be done automatically by the rapid sync process after every sync completion.
28118 void NetworkGraph_set_last_rapid_gossip_sync_timestamp(const struct LDKNetworkGraph *NONNULL_PTR this_arg, uint32_t last_rapid_gossip_sync_timestamp);
28121 * For an already known node (from channel announcements), update its stored properties from a
28122 * given node announcement.
28124 * You probably don't want to call this directly, instead relying on a P2PGossipSync's
28125 * RoutingMessageHandler implementation to call it indirectly. This may be useful to accept
28126 * routing messages from a source using a protocol other than the lightning P2P protocol.
28128 MUST_USE_RES struct LDKCResult_NoneLightningErrorZ NetworkGraph_update_node_from_announcement(const struct LDKNetworkGraph *NONNULL_PTR this_arg, const struct LDKNodeAnnouncement *NONNULL_PTR msg);
28131 * For an already known node (from channel announcements), update its stored properties from a
28132 * given node announcement without verifying the associated signatures. Because we aren't
28133 * given the associated signatures here we cannot relay the node announcement to any of our
28136 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);
28139 * Store or update channel info from a channel announcement.
28141 * You probably don't want to call this directly, instead relying on a P2PGossipSync's
28142 * RoutingMessageHandler implementation to call it indirectly. This may be useful to accept
28143 * routing messages from a source using a protocol other than the lightning P2P protocol.
28145 * If a `chain::Access` object is provided via `chain_access`, it will be called to verify
28146 * the corresponding UTXO exists on chain and is correctly-formatted.
28148 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);
28151 * Store or update channel info from a channel announcement without verifying the associated
28152 * signatures. Because we aren't given the associated signatures here we cannot relay the
28153 * channel announcement to any of our peers.
28155 * If a `chain::Access` object is provided via `chain_access`, it will be called to verify
28156 * the corresponding UTXO exists on chain and is correctly-formatted.
28158 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);
28161 * Update channel from partial announcement data received via rapid gossip sync
28163 * `timestamp: u64`: Timestamp emulating the backdated original announcement receipt (by the
28164 * rapid gossip sync server)
28166 * All other parameters as used in [`msgs::UnsignedChannelAnnouncement`] fields.
28168 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);
28171 * Marks a channel in the graph as failed if a corresponding HTLC fail was sent.
28172 * If permanent, removes a channel from the local storage.
28173 * May cause the removal of nodes too, if this was their last channel.
28174 * If not permanent, makes channels unavailable for routing.
28176 void NetworkGraph_channel_failed(const struct LDKNetworkGraph *NONNULL_PTR this_arg, uint64_t short_channel_id, bool is_permanent);
28179 * Marks a node in the graph as failed.
28181 void NetworkGraph_node_failed(const struct LDKNetworkGraph *NONNULL_PTR this_arg, struct LDKPublicKey _node_id, bool is_permanent);
28184 * Removes information about channels that we haven't heard any updates about in some time.
28185 * This can be used regularly to prune the network graph of channels that likely no longer
28188 * While there is no formal requirement that nodes regularly re-broadcast their channel
28189 * updates every two weeks, the non-normative section of BOLT 7 currently suggests that
28190 * pruning occur for updates which are at least two weeks old, which we implement here.
28192 * Note that for users of the `lightning-background-processor` crate this method may be
28193 * automatically called regularly for you.
28195 * This method is only available with the `std` feature. See
28196 * [`NetworkGraph::remove_stale_channels_with_time`] for `no-std` use.
28198 void NetworkGraph_remove_stale_channels(const struct LDKNetworkGraph *NONNULL_PTR this_arg);
28201 * Removes information about channels that we haven't heard any updates about in some time.
28202 * This can be used regularly to prune the network graph of channels that likely no longer
28205 * While there is no formal requirement that nodes regularly re-broadcast their channel
28206 * updates every two weeks, the non-normative section of BOLT 7 currently suggests that
28207 * pruning occur for updates which are at least two weeks old, which we implement here.
28209 * This function takes the current unix time as an argument. For users with the `std` feature
28210 * enabled, [`NetworkGraph::remove_stale_channels`] may be preferable.
28212 void NetworkGraph_remove_stale_channels_with_time(const struct LDKNetworkGraph *NONNULL_PTR this_arg, uint64_t current_time_unix);
28215 * For an already known (from announcement) channel, update info about one of the directions
28218 * You probably don't want to call this directly, instead relying on a P2PGossipSync's
28219 * RoutingMessageHandler implementation to call it indirectly. This may be useful to accept
28220 * routing messages from a source using a protocol other than the lightning P2P protocol.
28222 * If built with `no-std`, any updates with a timestamp more than two weeks in the past or
28223 * materially in the future will be rejected.
28225 MUST_USE_RES struct LDKCResult_NoneLightningErrorZ NetworkGraph_update_channel(const struct LDKNetworkGraph *NONNULL_PTR this_arg, const struct LDKChannelUpdate *NONNULL_PTR msg);
28228 * For an already known (from announcement) channel, update info about one of the directions
28229 * of the channel without verifying the associated signatures. Because we aren't given the
28230 * associated signatures here we cannot relay the channel update to any of our peers.
28232 * If built with `no-std`, any updates with a timestamp more than two weeks in the past or
28233 * materially in the future will be rejected.
28235 MUST_USE_RES struct LDKCResult_NoneLightningErrorZ NetworkGraph_update_channel_unsigned(const struct LDKNetworkGraph *NONNULL_PTR this_arg, const struct LDKUnsignedChannelUpdate *NONNULL_PTR msg);
28238 * Returns information on a channel with the given id.
28240 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
28242 MUST_USE_RES struct LDKChannelInfo ReadOnlyNetworkGraph_channel(const struct LDKReadOnlyNetworkGraph *NONNULL_PTR this_arg, uint64_t short_channel_id);
28245 * Returns the list of channels in the graph
28247 MUST_USE_RES struct LDKCVec_u64Z ReadOnlyNetworkGraph_list_channels(const struct LDKReadOnlyNetworkGraph *NONNULL_PTR this_arg);
28250 * Returns information on a node with the given id.
28252 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
28254 MUST_USE_RES struct LDKNodeInfo ReadOnlyNetworkGraph_node(const struct LDKReadOnlyNetworkGraph *NONNULL_PTR this_arg, const struct LDKNodeId *NONNULL_PTR node_id);
28257 * Returns the list of nodes in the graph
28259 MUST_USE_RES struct LDKCVec_NodeIdZ ReadOnlyNetworkGraph_list_nodes(const struct LDKReadOnlyNetworkGraph *NONNULL_PTR this_arg);
28262 * Get network addresses by node id.
28263 * Returns None if the requested node is completely unknown,
28264 * or if node announcement for the node was never received.
28266 MUST_USE_RES struct LDKCOption_CVec_NetAddressZZ ReadOnlyNetworkGraph_get_addresses(const struct LDKReadOnlyNetworkGraph *NONNULL_PTR this_arg, struct LDKPublicKey pubkey);
28269 * Frees any resources used by the RouteHop, if is_owned is set and inner is non-NULL.
28271 void RouteHop_free(struct LDKRouteHop this_obj);
28274 * The node_id of the node at this hop.
28276 struct LDKPublicKey RouteHop_get_pubkey(const struct LDKRouteHop *NONNULL_PTR this_ptr);
28279 * The node_id of the node at this hop.
28281 void RouteHop_set_pubkey(struct LDKRouteHop *NONNULL_PTR this_ptr, struct LDKPublicKey val);
28284 * The node_announcement features of the node at this hop. For the last hop, these may be
28285 * amended to match the features present in the invoice this node generated.
28287 struct LDKNodeFeatures RouteHop_get_node_features(const struct LDKRouteHop *NONNULL_PTR this_ptr);
28290 * The node_announcement features of the node at this hop. For the last hop, these may be
28291 * amended to match the features present in the invoice this node generated.
28293 void RouteHop_set_node_features(struct LDKRouteHop *NONNULL_PTR this_ptr, struct LDKNodeFeatures val);
28296 * The channel that should be used from the previous hop to reach this node.
28298 uint64_t RouteHop_get_short_channel_id(const struct LDKRouteHop *NONNULL_PTR this_ptr);
28301 * The channel that should be used from the previous hop to reach this node.
28303 void RouteHop_set_short_channel_id(struct LDKRouteHop *NONNULL_PTR this_ptr, uint64_t val);
28306 * The channel_announcement features of the channel that should be used from the previous hop
28307 * to reach this node.
28309 struct LDKChannelFeatures RouteHop_get_channel_features(const struct LDKRouteHop *NONNULL_PTR this_ptr);
28312 * The channel_announcement features of the channel that should be used from the previous hop
28313 * to reach this node.
28315 void RouteHop_set_channel_features(struct LDKRouteHop *NONNULL_PTR this_ptr, struct LDKChannelFeatures val);
28318 * The fee taken on this hop (for paying for the use of the *next* channel in the path).
28319 * For the last hop, this should be the full value of the payment (might be more than
28320 * requested if we had to match htlc_minimum_msat).
28322 uint64_t RouteHop_get_fee_msat(const struct LDKRouteHop *NONNULL_PTR this_ptr);
28325 * The fee taken on this hop (for paying for the use of the *next* channel in the path).
28326 * For the last hop, this should be the full value of the payment (might be more than
28327 * requested if we had to match htlc_minimum_msat).
28329 void RouteHop_set_fee_msat(struct LDKRouteHop *NONNULL_PTR this_ptr, uint64_t val);
28332 * The CLTV delta added for this hop. For the last hop, this should be the full CLTV value
28333 * expected at the destination, in excess of the current block height.
28335 uint32_t RouteHop_get_cltv_expiry_delta(const struct LDKRouteHop *NONNULL_PTR this_ptr);
28338 * The CLTV delta added for this hop. For the last hop, this should be the full CLTV value
28339 * expected at the destination, in excess of the current block height.
28341 void RouteHop_set_cltv_expiry_delta(struct LDKRouteHop *NONNULL_PTR this_ptr, uint32_t val);
28344 * Constructs a new RouteHop given each field
28346 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);
28349 * Creates a copy of the RouteHop
28351 struct LDKRouteHop RouteHop_clone(const struct LDKRouteHop *NONNULL_PTR orig);
28354 * Checks if two RouteHops contain equal inner contents.
28356 uint64_t RouteHop_hash(const struct LDKRouteHop *NONNULL_PTR o);
28359 * Checks if two RouteHops contain equal inner contents.
28360 * This ignores pointers and is_owned flags and looks at the values in fields.
28361 * Two objects with NULL inner values will be considered "equal" here.
28363 bool RouteHop_eq(const struct LDKRouteHop *NONNULL_PTR a, const struct LDKRouteHop *NONNULL_PTR b);
28366 * Serialize the RouteHop object into a byte array which can be read by RouteHop_read
28368 struct LDKCVec_u8Z RouteHop_write(const struct LDKRouteHop *NONNULL_PTR obj);
28371 * Read a RouteHop from a byte array, created by RouteHop_write
28373 struct LDKCResult_RouteHopDecodeErrorZ RouteHop_read(struct LDKu8slice ser);
28376 * Frees any resources used by the Route, if is_owned is set and inner is non-NULL.
28378 void Route_free(struct LDKRoute this_obj);
28381 * The list of routes taken for a single (potentially-)multi-part payment. The pubkey of the
28382 * last RouteHop in each path must be the same. Each entry represents a list of hops, NOT
28383 * INCLUDING our own, where the last hop is the destination. Thus, this must always be at
28384 * least length one. While the maximum length of any given path is variable, keeping the length
28385 * of any path less or equal to 19 should currently ensure it is viable.
28387 struct LDKCVec_CVec_RouteHopZZ Route_get_paths(const struct LDKRoute *NONNULL_PTR this_ptr);
28390 * The list of routes taken for a single (potentially-)multi-part payment. The pubkey of the
28391 * last RouteHop in each path must be the same. Each entry represents a list of hops, NOT
28392 * INCLUDING our own, where the last hop is the destination. Thus, this must always be at
28393 * least length one. While the maximum length of any given path is variable, keeping the length
28394 * of any path less or equal to 19 should currently ensure it is viable.
28396 void Route_set_paths(struct LDKRoute *NONNULL_PTR this_ptr, struct LDKCVec_CVec_RouteHopZZ val);
28399 * The `payment_params` parameter passed to [`find_route`].
28400 * This is used by `ChannelManager` to track information which may be required for retries,
28401 * provided back to you via [`Event::PaymentPathFailed`].
28403 * [`Event::PaymentPathFailed`]: crate::util::events::Event::PaymentPathFailed
28405 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
28407 struct LDKPaymentParameters Route_get_payment_params(const struct LDKRoute *NONNULL_PTR this_ptr);
28410 * The `payment_params` parameter passed to [`find_route`].
28411 * This is used by `ChannelManager` to track information which may be required for retries,
28412 * provided back to you via [`Event::PaymentPathFailed`].
28414 * [`Event::PaymentPathFailed`]: crate::util::events::Event::PaymentPathFailed
28416 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
28418 void Route_set_payment_params(struct LDKRoute *NONNULL_PTR this_ptr, struct LDKPaymentParameters val);
28421 * Constructs a new Route given each field
28423 MUST_USE_RES struct LDKRoute Route_new(struct LDKCVec_CVec_RouteHopZZ paths_arg, struct LDKPaymentParameters payment_params_arg);
28426 * Creates a copy of the Route
28428 struct LDKRoute Route_clone(const struct LDKRoute *NONNULL_PTR orig);
28431 * Checks if two Routes contain equal inner contents.
28433 uint64_t Route_hash(const struct LDKRoute *NONNULL_PTR o);
28436 * Checks if two Routes contain equal inner contents.
28437 * This ignores pointers and is_owned flags and looks at the values in fields.
28438 * Two objects with NULL inner values will be considered "equal" here.
28440 bool Route_eq(const struct LDKRoute *NONNULL_PTR a, const struct LDKRoute *NONNULL_PTR b);
28443 * Returns the total amount of fees paid on this [`Route`].
28445 * This doesn't include any extra payment made to the recipient, which can happen in excess of
28446 * the amount passed to [`find_route`]'s `params.final_value_msat`.
28448 MUST_USE_RES uint64_t Route_get_total_fees(const struct LDKRoute *NONNULL_PTR this_arg);
28451 * Returns the total amount paid on this [`Route`], excluding the fees.
28453 MUST_USE_RES uint64_t Route_get_total_amount(const struct LDKRoute *NONNULL_PTR this_arg);
28456 * Serialize the Route object into a byte array which can be read by Route_read
28458 struct LDKCVec_u8Z Route_write(const struct LDKRoute *NONNULL_PTR obj);
28461 * Read a Route from a byte array, created by Route_write
28463 struct LDKCResult_RouteDecodeErrorZ Route_read(struct LDKu8slice ser);
28466 * Frees any resources used by the RouteParameters, if is_owned is set and inner is non-NULL.
28468 void RouteParameters_free(struct LDKRouteParameters this_obj);
28471 * The parameters of the failed payment path.
28473 struct LDKPaymentParameters RouteParameters_get_payment_params(const struct LDKRouteParameters *NONNULL_PTR this_ptr);
28476 * The parameters of the failed payment path.
28478 void RouteParameters_set_payment_params(struct LDKRouteParameters *NONNULL_PTR this_ptr, struct LDKPaymentParameters val);
28481 * The amount in msats sent on the failed payment path.
28483 uint64_t RouteParameters_get_final_value_msat(const struct LDKRouteParameters *NONNULL_PTR this_ptr);
28486 * The amount in msats sent on the failed payment path.
28488 void RouteParameters_set_final_value_msat(struct LDKRouteParameters *NONNULL_PTR this_ptr, uint64_t val);
28491 * The CLTV on the final hop of the failed payment path.
28493 uint32_t RouteParameters_get_final_cltv_expiry_delta(const struct LDKRouteParameters *NONNULL_PTR this_ptr);
28496 * The CLTV on the final hop of the failed payment path.
28498 void RouteParameters_set_final_cltv_expiry_delta(struct LDKRouteParameters *NONNULL_PTR this_ptr, uint32_t val);
28501 * Constructs a new RouteParameters given each field
28503 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);
28506 * Creates a copy of the RouteParameters
28508 struct LDKRouteParameters RouteParameters_clone(const struct LDKRouteParameters *NONNULL_PTR orig);
28511 * Serialize the RouteParameters object into a byte array which can be read by RouteParameters_read
28513 struct LDKCVec_u8Z RouteParameters_write(const struct LDKRouteParameters *NONNULL_PTR obj);
28516 * Read a RouteParameters from a byte array, created by RouteParameters_write
28518 struct LDKCResult_RouteParametersDecodeErrorZ RouteParameters_read(struct LDKu8slice ser);
28521 * Frees any resources used by the PaymentParameters, if is_owned is set and inner is non-NULL.
28523 void PaymentParameters_free(struct LDKPaymentParameters this_obj);
28526 * The node id of the payee.
28528 struct LDKPublicKey PaymentParameters_get_payee_pubkey(const struct LDKPaymentParameters *NONNULL_PTR this_ptr);
28531 * The node id of the payee.
28533 void PaymentParameters_set_payee_pubkey(struct LDKPaymentParameters *NONNULL_PTR this_ptr, struct LDKPublicKey val);
28536 * Features supported by the payee.
28538 * May be set from the payee's invoice or via [`for_keysend`]. May be `None` if the invoice
28539 * does not contain any features.
28541 * [`for_keysend`]: Self::for_keysend
28543 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
28545 struct LDKInvoiceFeatures PaymentParameters_get_features(const struct LDKPaymentParameters *NONNULL_PTR this_ptr);
28548 * Features supported by the payee.
28550 * May be set from the payee's invoice or via [`for_keysend`]. May be `None` if the invoice
28551 * does not contain any features.
28553 * [`for_keysend`]: Self::for_keysend
28555 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
28557 void PaymentParameters_set_features(struct LDKPaymentParameters *NONNULL_PTR this_ptr, struct LDKInvoiceFeatures val);
28560 * Hints for routing to the payee, containing channels connecting the payee to public nodes.
28562 struct LDKCVec_RouteHintZ PaymentParameters_get_route_hints(const struct LDKPaymentParameters *NONNULL_PTR this_ptr);
28565 * Hints for routing to the payee, containing channels connecting the payee to public nodes.
28567 void PaymentParameters_set_route_hints(struct LDKPaymentParameters *NONNULL_PTR this_ptr, struct LDKCVec_RouteHintZ val);
28570 * Expiration of a payment to the payee, in seconds relative to the UNIX epoch.
28572 struct LDKCOption_u64Z PaymentParameters_get_expiry_time(const struct LDKPaymentParameters *NONNULL_PTR this_ptr);
28575 * Expiration of a payment to the payee, in seconds relative to the UNIX epoch.
28577 void PaymentParameters_set_expiry_time(struct LDKPaymentParameters *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
28580 * The maximum total CLTV delta we accept for the route.
28581 * Defaults to [`DEFAULT_MAX_TOTAL_CLTV_EXPIRY_DELTA`].
28583 uint32_t PaymentParameters_get_max_total_cltv_expiry_delta(const struct LDKPaymentParameters *NONNULL_PTR this_ptr);
28586 * The maximum total CLTV delta we accept for the route.
28587 * Defaults to [`DEFAULT_MAX_TOTAL_CLTV_EXPIRY_DELTA`].
28589 void PaymentParameters_set_max_total_cltv_expiry_delta(struct LDKPaymentParameters *NONNULL_PTR this_ptr, uint32_t val);
28592 * The maximum number of paths that may be used by (MPP) payments.
28593 * Defaults to [`DEFAULT_MAX_PATH_COUNT`].
28595 uint8_t PaymentParameters_get_max_path_count(const struct LDKPaymentParameters *NONNULL_PTR this_ptr);
28598 * The maximum number of paths that may be used by (MPP) payments.
28599 * Defaults to [`DEFAULT_MAX_PATH_COUNT`].
28601 void PaymentParameters_set_max_path_count(struct LDKPaymentParameters *NONNULL_PTR this_ptr, uint8_t val);
28604 * Selects the maximum share of a channel's total capacity which will be sent over a channel,
28605 * as a power of 1/2. A higher value prefers to send the payment using more MPP parts whereas
28606 * a lower value prefers to send larger MPP parts, potentially saturating channels and
28607 * increasing failure probability for those paths.
28609 * Note that this restriction will be relaxed during pathfinding after paths which meet this
28610 * restriction have been found. While paths which meet this criteria will be searched for, it
28611 * is ultimately up to the scorer to select them over other paths.
28613 * A value of 0 will allow payments up to and including a channel's total announced usable
28614 * capacity, a value of one will only use up to half its capacity, two 1/4, etc.
28618 uint8_t PaymentParameters_get_max_channel_saturation_power_of_half(const struct LDKPaymentParameters *NONNULL_PTR this_ptr);
28621 * Selects the maximum share of a channel's total capacity which will be sent over a channel,
28622 * as a power of 1/2. A higher value prefers to send the payment using more MPP parts whereas
28623 * a lower value prefers to send larger MPP parts, potentially saturating channels and
28624 * increasing failure probability for those paths.
28626 * Note that this restriction will be relaxed during pathfinding after paths which meet this
28627 * restriction have been found. While paths which meet this criteria will be searched for, it
28628 * is ultimately up to the scorer to select them over other paths.
28630 * A value of 0 will allow payments up to and including a channel's total announced usable
28631 * capacity, a value of one will only use up to half its capacity, two 1/4, etc.
28635 void PaymentParameters_set_max_channel_saturation_power_of_half(struct LDKPaymentParameters *NONNULL_PTR this_ptr, uint8_t val);
28638 * A list of SCIDs which this payment was previously attempted over and which caused the
28639 * payment to fail. Future attempts for the same payment shouldn't be relayed through any of
28642 * Returns a copy of the field.
28644 struct LDKCVec_u64Z PaymentParameters_get_previously_failed_channels(const struct LDKPaymentParameters *NONNULL_PTR this_ptr);
28647 * A list of SCIDs which this payment was previously attempted over and which caused the
28648 * payment to fail. Future attempts for the same payment shouldn't be relayed through any of
28651 void PaymentParameters_set_previously_failed_channels(struct LDKPaymentParameters *NONNULL_PTR this_ptr, struct LDKCVec_u64Z val);
28654 * Constructs a new PaymentParameters given each field
28656 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);
28659 * Creates a copy of the PaymentParameters
28661 struct LDKPaymentParameters PaymentParameters_clone(const struct LDKPaymentParameters *NONNULL_PTR orig);
28664 * Checks if two PaymentParameterss contain equal inner contents.
28666 uint64_t PaymentParameters_hash(const struct LDKPaymentParameters *NONNULL_PTR o);
28669 * Checks if two PaymentParameterss contain equal inner contents.
28670 * This ignores pointers and is_owned flags and looks at the values in fields.
28671 * Two objects with NULL inner values will be considered "equal" here.
28673 bool PaymentParameters_eq(const struct LDKPaymentParameters *NONNULL_PTR a, const struct LDKPaymentParameters *NONNULL_PTR b);
28676 * Serialize the PaymentParameters object into a byte array which can be read by PaymentParameters_read
28678 struct LDKCVec_u8Z PaymentParameters_write(const struct LDKPaymentParameters *NONNULL_PTR obj);
28681 * Read a PaymentParameters from a byte array, created by PaymentParameters_write
28683 struct LDKCResult_PaymentParametersDecodeErrorZ PaymentParameters_read(struct LDKu8slice ser);
28686 * Creates a payee with the node id of the given `pubkey`.
28688 MUST_USE_RES struct LDKPaymentParameters PaymentParameters_from_node_id(struct LDKPublicKey payee_pubkey);
28691 * Creates a payee with the node id of the given `pubkey` to use for keysend payments.
28693 MUST_USE_RES struct LDKPaymentParameters PaymentParameters_for_keysend(struct LDKPublicKey payee_pubkey);
28696 * Frees any resources used by the RouteHint, if is_owned is set and inner is non-NULL.
28698 void RouteHint_free(struct LDKRouteHint this_obj);
28700 struct LDKCVec_RouteHintHopZ RouteHint_get_a(const struct LDKRouteHint *NONNULL_PTR this_ptr);
28702 void RouteHint_set_a(struct LDKRouteHint *NONNULL_PTR this_ptr, struct LDKCVec_RouteHintHopZ val);
28705 * Constructs a new RouteHint given each field
28707 MUST_USE_RES struct LDKRouteHint RouteHint_new(struct LDKCVec_RouteHintHopZ a_arg);
28710 * Creates a copy of the RouteHint
28712 struct LDKRouteHint RouteHint_clone(const struct LDKRouteHint *NONNULL_PTR orig);
28715 * Checks if two RouteHints contain equal inner contents.
28717 uint64_t RouteHint_hash(const struct LDKRouteHint *NONNULL_PTR o);
28720 * Checks if two RouteHints contain equal inner contents.
28721 * This ignores pointers and is_owned flags and looks at the values in fields.
28722 * Two objects with NULL inner values will be considered "equal" here.
28724 bool RouteHint_eq(const struct LDKRouteHint *NONNULL_PTR a, const struct LDKRouteHint *NONNULL_PTR b);
28727 * Serialize the RouteHint object into a byte array which can be read by RouteHint_read
28729 struct LDKCVec_u8Z RouteHint_write(const struct LDKRouteHint *NONNULL_PTR obj);
28732 * Read a RouteHint from a byte array, created by RouteHint_write
28734 struct LDKCResult_RouteHintDecodeErrorZ RouteHint_read(struct LDKu8slice ser);
28737 * Frees any resources used by the RouteHintHop, if is_owned is set and inner is non-NULL.
28739 void RouteHintHop_free(struct LDKRouteHintHop this_obj);
28742 * The node_id of the non-target end of the route
28744 struct LDKPublicKey RouteHintHop_get_src_node_id(const struct LDKRouteHintHop *NONNULL_PTR this_ptr);
28747 * The node_id of the non-target end of the route
28749 void RouteHintHop_set_src_node_id(struct LDKRouteHintHop *NONNULL_PTR this_ptr, struct LDKPublicKey val);
28752 * The short_channel_id of this channel
28754 uint64_t RouteHintHop_get_short_channel_id(const struct LDKRouteHintHop *NONNULL_PTR this_ptr);
28757 * The short_channel_id of this channel
28759 void RouteHintHop_set_short_channel_id(struct LDKRouteHintHop *NONNULL_PTR this_ptr, uint64_t val);
28762 * The fees which must be paid to use this channel
28764 struct LDKRoutingFees RouteHintHop_get_fees(const struct LDKRouteHintHop *NONNULL_PTR this_ptr);
28767 * The fees which must be paid to use this channel
28769 void RouteHintHop_set_fees(struct LDKRouteHintHop *NONNULL_PTR this_ptr, struct LDKRoutingFees val);
28772 * The difference in CLTV values between this node and the next node.
28774 uint16_t RouteHintHop_get_cltv_expiry_delta(const struct LDKRouteHintHop *NONNULL_PTR this_ptr);
28777 * The difference in CLTV values between this node and the next node.
28779 void RouteHintHop_set_cltv_expiry_delta(struct LDKRouteHintHop *NONNULL_PTR this_ptr, uint16_t val);
28782 * The minimum value, in msat, which must be relayed to the next hop.
28784 struct LDKCOption_u64Z RouteHintHop_get_htlc_minimum_msat(const struct LDKRouteHintHop *NONNULL_PTR this_ptr);
28787 * The minimum value, in msat, which must be relayed to the next hop.
28789 void RouteHintHop_set_htlc_minimum_msat(struct LDKRouteHintHop *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
28792 * The maximum value in msat available for routing with a single HTLC.
28794 struct LDKCOption_u64Z RouteHintHop_get_htlc_maximum_msat(const struct LDKRouteHintHop *NONNULL_PTR this_ptr);
28797 * The maximum value in msat available for routing with a single HTLC.
28799 void RouteHintHop_set_htlc_maximum_msat(struct LDKRouteHintHop *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
28802 * Constructs a new RouteHintHop given each field
28804 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);
28807 * Creates a copy of the RouteHintHop
28809 struct LDKRouteHintHop RouteHintHop_clone(const struct LDKRouteHintHop *NONNULL_PTR orig);
28812 * Checks if two RouteHintHops contain equal inner contents.
28814 uint64_t RouteHintHop_hash(const struct LDKRouteHintHop *NONNULL_PTR o);
28817 * Checks if two RouteHintHops contain equal inner contents.
28818 * This ignores pointers and is_owned flags and looks at the values in fields.
28819 * Two objects with NULL inner values will be considered "equal" here.
28821 bool RouteHintHop_eq(const struct LDKRouteHintHop *NONNULL_PTR a, const struct LDKRouteHintHop *NONNULL_PTR b);
28824 * Serialize the RouteHintHop object into a byte array which can be read by RouteHintHop_read
28826 struct LDKCVec_u8Z RouteHintHop_write(const struct LDKRouteHintHop *NONNULL_PTR obj);
28829 * Read a RouteHintHop from a byte array, created by RouteHintHop_write
28831 struct LDKCResult_RouteHintHopDecodeErrorZ RouteHintHop_read(struct LDKu8slice ser);
28834 * Finds a route from us (payer) to the given target node (payee).
28836 * If the payee provided features in their invoice, they should be provided via `params.payee`.
28837 * Without this, MPP will only be used if the payee's features are available in the network graph.
28839 * Private routing paths between a public node and the target may be included in `params.payee`.
28841 * If some channels aren't announced, it may be useful to fill in `first_hops` with the results
28842 * from [`ChannelManager::list_usable_channels`]. If it is filled in, the view of these channels
28843 * from `network_graph` will be ignored, and only those in `first_hops` will be used.
28845 * The fees on channels from us to the next hop are ignored as they are assumed to all be equal.
28846 * However, the enabled/disabled bit on such channels as well as the `htlc_minimum_msat` /
28847 * `htlc_maximum_msat` *are* checked as they may change based on the receiving node.
28851 * May be used to re-compute a [`Route`] when handling a [`Event::PaymentPathFailed`]. Any
28852 * adjustments to the [`NetworkGraph`] and channel scores should be made prior to calling this
28857 * Panics if first_hops contains channels without short_channel_ids;
28858 * [`ChannelManager::list_usable_channels`] will never include such channels.
28860 * [`ChannelManager::list_usable_channels`]: crate::ln::channelmanager::ChannelManager::list_usable_channels
28861 * [`Event::PaymentPathFailed`]: crate::util::events::Event::PaymentPathFailed
28862 * [`NetworkGraph`]: crate::routing::gossip::NetworkGraph
28864 * Note that first_hops (or a relevant inner pointer) may be NULL or all-0s to represent None
28866 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]);
28869 * Construct a route from us (payer) to the target node (payee) via the given hops (which should
28870 * exclude the payer, but include the payee). This may be useful, e.g., for probing the chosen path.
28872 * Re-uses logic from `find_route`, so the restrictions described there also apply here.
28874 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]);
28877 * Calls the free function if one is set
28879 void Score_free(struct LDKScore this_ptr);
28882 * Calls the free function if one is set
28884 void LockableScore_free(struct LDKLockableScore this_ptr);
28887 * Calls the free function if one is set
28889 void WriteableScore_free(struct LDKWriteableScore this_ptr);
28892 * Frees any resources used by the MultiThreadedLockableScore, if is_owned is set and inner is non-NULL.
28894 void MultiThreadedLockableScore_free(struct LDKMultiThreadedLockableScore this_obj);
28897 * Frees any resources used by the MultiThreadedScoreLock, if is_owned is set and inner is non-NULL.
28899 void MultiThreadedScoreLock_free(struct LDKMultiThreadedScoreLock this_obj);
28902 * Constructs a new Score which calls the relevant methods on this_arg.
28903 * This copies the `inner` pointer in this_arg and thus the returned Score must be freed before this_arg is
28905 struct LDKScore MultiThreadedScoreLock_as_Score(const struct LDKMultiThreadedScoreLock *NONNULL_PTR this_arg);
28908 * Serialize the MultiThreadedScoreLock object into a byte array which can be read by MultiThreadedScoreLock_read
28910 struct LDKCVec_u8Z MultiThreadedScoreLock_write(const struct LDKMultiThreadedScoreLock *NONNULL_PTR obj);
28913 * Constructs a new LockableScore which calls the relevant methods on this_arg.
28914 * This copies the `inner` pointer in this_arg and thus the returned LockableScore must be freed before this_arg is
28916 struct LDKLockableScore MultiThreadedLockableScore_as_LockableScore(const struct LDKMultiThreadedLockableScore *NONNULL_PTR this_arg);
28919 * Creates a new [`MultiThreadedLockableScore`] given an underlying [`Score`].
28921 MUST_USE_RES struct LDKMultiThreadedLockableScore MultiThreadedLockableScore_new(struct LDKScore score);
28924 * Frees any resources used by the ChannelUsage, if is_owned is set and inner is non-NULL.
28926 void ChannelUsage_free(struct LDKChannelUsage this_obj);
28929 * The amount to send through the channel, denominated in millisatoshis.
28931 uint64_t ChannelUsage_get_amount_msat(const struct LDKChannelUsage *NONNULL_PTR this_ptr);
28934 * The amount to send through the channel, denominated in millisatoshis.
28936 void ChannelUsage_set_amount_msat(struct LDKChannelUsage *NONNULL_PTR this_ptr, uint64_t val);
28939 * Total amount, denominated in millisatoshis, already allocated to send through the channel
28940 * as part of a multi-path payment.
28942 uint64_t ChannelUsage_get_inflight_htlc_msat(const struct LDKChannelUsage *NONNULL_PTR this_ptr);
28945 * Total amount, denominated in millisatoshis, already allocated to send through the channel
28946 * as part of a multi-path payment.
28948 void ChannelUsage_set_inflight_htlc_msat(struct LDKChannelUsage *NONNULL_PTR this_ptr, uint64_t val);
28951 * The effective capacity of the channel.
28953 struct LDKEffectiveCapacity ChannelUsage_get_effective_capacity(const struct LDKChannelUsage *NONNULL_PTR this_ptr);
28956 * The effective capacity of the channel.
28958 void ChannelUsage_set_effective_capacity(struct LDKChannelUsage *NONNULL_PTR this_ptr, struct LDKEffectiveCapacity val);
28961 * Constructs a new ChannelUsage given each field
28963 MUST_USE_RES struct LDKChannelUsage ChannelUsage_new(uint64_t amount_msat_arg, uint64_t inflight_htlc_msat_arg, struct LDKEffectiveCapacity effective_capacity_arg);
28966 * Creates a copy of the ChannelUsage
28968 struct LDKChannelUsage ChannelUsage_clone(const struct LDKChannelUsage *NONNULL_PTR orig);
28971 * Frees any resources used by the FixedPenaltyScorer, if is_owned is set and inner is non-NULL.
28973 void FixedPenaltyScorer_free(struct LDKFixedPenaltyScorer this_obj);
28976 * Creates a copy of the FixedPenaltyScorer
28978 struct LDKFixedPenaltyScorer FixedPenaltyScorer_clone(const struct LDKFixedPenaltyScorer *NONNULL_PTR orig);
28981 * Creates a new scorer using `penalty_msat`.
28983 MUST_USE_RES struct LDKFixedPenaltyScorer FixedPenaltyScorer_with_penalty(uint64_t penalty_msat);
28986 * Constructs a new Score which calls the relevant methods on this_arg.
28987 * This copies the `inner` pointer in this_arg and thus the returned Score must be freed before this_arg is
28989 struct LDKScore FixedPenaltyScorer_as_Score(const struct LDKFixedPenaltyScorer *NONNULL_PTR this_arg);
28992 * Serialize the FixedPenaltyScorer object into a byte array which can be read by FixedPenaltyScorer_read
28994 struct LDKCVec_u8Z FixedPenaltyScorer_write(const struct LDKFixedPenaltyScorer *NONNULL_PTR obj);
28997 * Read a FixedPenaltyScorer from a byte array, created by FixedPenaltyScorer_write
28999 struct LDKCResult_FixedPenaltyScorerDecodeErrorZ FixedPenaltyScorer_read(struct LDKu8slice ser, uint64_t arg);
29002 * Frees any resources used by the ProbabilisticScorer, if is_owned is set and inner is non-NULL.
29004 void ProbabilisticScorer_free(struct LDKProbabilisticScorer this_obj);
29007 * Frees any resources used by the ProbabilisticScoringParameters, if is_owned is set and inner is non-NULL.
29009 void ProbabilisticScoringParameters_free(struct LDKProbabilisticScoringParameters this_obj);
29012 * A fixed penalty in msats to apply to each channel.
29014 * Default value: 500 msat
29016 uint64_t ProbabilisticScoringParameters_get_base_penalty_msat(const struct LDKProbabilisticScoringParameters *NONNULL_PTR this_ptr);
29019 * A fixed penalty in msats to apply to each channel.
29021 * Default value: 500 msat
29023 void ProbabilisticScoringParameters_set_base_penalty_msat(struct LDKProbabilisticScoringParameters *NONNULL_PTR this_ptr, uint64_t val);
29026 * A multiplier used with the payment amount to calculate a fixed penalty applied to each
29027 * channel, in excess of the [`base_penalty_msat`].
29029 * The purpose of the amount penalty is to avoid having fees dominate the channel cost (i.e.,
29030 * fees plus penalty) for large payments. The penalty is computed as the product of this
29031 * multiplier and `2^30`ths of the payment amount.
29033 * ie `base_penalty_amount_multiplier_msat * amount_msat / 2^30`
29035 * Default value: 8,192 msat
29037 * [`base_penalty_msat`]: Self::base_penalty_msat
29039 uint64_t ProbabilisticScoringParameters_get_base_penalty_amount_multiplier_msat(const struct LDKProbabilisticScoringParameters *NONNULL_PTR this_ptr);
29042 * A multiplier used with the payment amount to calculate a fixed penalty applied to each
29043 * channel, in excess of the [`base_penalty_msat`].
29045 * The purpose of the amount penalty is to avoid having fees dominate the channel cost (i.e.,
29046 * fees plus penalty) for large payments. The penalty is computed as the product of this
29047 * multiplier and `2^30`ths of the payment amount.
29049 * ie `base_penalty_amount_multiplier_msat * amount_msat / 2^30`
29051 * Default value: 8,192 msat
29053 * [`base_penalty_msat`]: Self::base_penalty_msat
29055 void ProbabilisticScoringParameters_set_base_penalty_amount_multiplier_msat(struct LDKProbabilisticScoringParameters *NONNULL_PTR this_ptr, uint64_t val);
29058 * A multiplier used in conjunction with the negative `log10` of the channel's success
29059 * probability for a payment to determine the liquidity penalty.
29061 * The penalty is based in part on the knowledge learned from prior successful and unsuccessful
29062 * payments. This knowledge is decayed over time based on [`liquidity_offset_half_life`]. The
29063 * penalty is effectively limited to `2 * liquidity_penalty_multiplier_msat` (corresponding to
29064 * lower bounding the success probability to `0.01`) when the amount falls within the
29065 * uncertainty bounds of the channel liquidity balance. Amounts above the upper bound will
29066 * result in a `u64::max_value` penalty, however.
29068 * Default value: 40,000 msat
29070 * [`liquidity_offset_half_life`]: Self::liquidity_offset_half_life
29072 uint64_t ProbabilisticScoringParameters_get_liquidity_penalty_multiplier_msat(const struct LDKProbabilisticScoringParameters *NONNULL_PTR this_ptr);
29075 * A multiplier used in conjunction with the negative `log10` of the channel's success
29076 * probability for a payment to determine the liquidity penalty.
29078 * The penalty is based in part on the knowledge learned from prior successful and unsuccessful
29079 * payments. This knowledge is decayed over time based on [`liquidity_offset_half_life`]. The
29080 * penalty is effectively limited to `2 * liquidity_penalty_multiplier_msat` (corresponding to
29081 * lower bounding the success probability to `0.01`) when the amount falls within the
29082 * uncertainty bounds of the channel liquidity balance. Amounts above the upper bound will
29083 * result in a `u64::max_value` penalty, however.
29085 * Default value: 40,000 msat
29087 * [`liquidity_offset_half_life`]: Self::liquidity_offset_half_life
29089 void ProbabilisticScoringParameters_set_liquidity_penalty_multiplier_msat(struct LDKProbabilisticScoringParameters *NONNULL_PTR this_ptr, uint64_t val);
29092 * The time required to elapse before any knowledge learned about channel liquidity balances is
29095 * The bounds are defined in terms of offsets and are initially zero. Increasing the offsets
29096 * gives tighter bounds on the channel liquidity balance. Thus, halving the offsets decreases
29097 * the certainty of the channel liquidity balance.
29099 * Default value: 1 hour
29103 * When built with the `no-std` feature, time will never elapse. Therefore, the channel
29104 * liquidity knowledge will never decay except when the bounds cross.
29106 uint64_t ProbabilisticScoringParameters_get_liquidity_offset_half_life(const struct LDKProbabilisticScoringParameters *NONNULL_PTR this_ptr);
29109 * The time required to elapse before any knowledge learned about channel liquidity balances is
29112 * The bounds are defined in terms of offsets and are initially zero. Increasing the offsets
29113 * gives tighter bounds on the channel liquidity balance. Thus, halving the offsets decreases
29114 * the certainty of the channel liquidity balance.
29116 * Default value: 1 hour
29120 * When built with the `no-std` feature, time will never elapse. Therefore, the channel
29121 * liquidity knowledge will never decay except when the bounds cross.
29123 void ProbabilisticScoringParameters_set_liquidity_offset_half_life(struct LDKProbabilisticScoringParameters *NONNULL_PTR this_ptr, uint64_t val);
29126 * A multiplier used in conjunction with a payment amount and the negative `log10` of the
29127 * channel's success probability for the payment to determine the amount penalty.
29129 * The purpose of the amount penalty is to avoid having fees dominate the channel cost (i.e.,
29130 * fees plus penalty) for large payments. The penalty is computed as the product of this
29131 * multiplier and `2^20`ths of the payment amount, weighted by the negative `log10` of the
29132 * success probability.
29134 * `-log10(success_probability) * liquidity_penalty_amount_multiplier_msat * amount_msat / 2^20`
29136 * In practice, this means for 0.1 success probability (`-log10(0.1) == 1`) each `2^20`th of
29137 * the amount will result in a penalty of the multiplier. And, as the success probability
29138 * decreases, the negative `log10` weighting will increase dramatically. For higher success
29139 * probabilities, the multiplier will have a decreasing effect as the negative `log10` will
29142 * Default value: 256 msat
29144 uint64_t ProbabilisticScoringParameters_get_liquidity_penalty_amount_multiplier_msat(const struct LDKProbabilisticScoringParameters *NONNULL_PTR this_ptr);
29147 * A multiplier used in conjunction with a payment amount and the negative `log10` of the
29148 * channel's success probability for the payment to determine the amount penalty.
29150 * The purpose of the amount penalty is to avoid having fees dominate the channel cost (i.e.,
29151 * fees plus penalty) for large payments. The penalty is computed as the product of this
29152 * multiplier and `2^20`ths of the payment amount, weighted by the negative `log10` of the
29153 * success probability.
29155 * `-log10(success_probability) * liquidity_penalty_amount_multiplier_msat * amount_msat / 2^20`
29157 * In practice, this means for 0.1 success probability (`-log10(0.1) == 1`) each `2^20`th of
29158 * the amount will result in a penalty of the multiplier. And, as the success probability
29159 * decreases, the negative `log10` weighting will increase dramatically. For higher success
29160 * probabilities, the multiplier will have a decreasing effect as the negative `log10` will
29163 * Default value: 256 msat
29165 void ProbabilisticScoringParameters_set_liquidity_penalty_amount_multiplier_msat(struct LDKProbabilisticScoringParameters *NONNULL_PTR this_ptr, uint64_t val);
29168 * This penalty is applied when `htlc_maximum_msat` is equal to or larger than half of the
29169 * channel's capacity, which makes us prefer nodes with a smaller `htlc_maximum_msat`. We
29170 * treat such nodes preferentially as this makes balance discovery attacks harder to execute,
29171 * thereby creating an incentive to restrict `htlc_maximum_msat` and improve privacy.
29173 * Default value: 250 msat
29175 uint64_t ProbabilisticScoringParameters_get_anti_probing_penalty_msat(const struct LDKProbabilisticScoringParameters *NONNULL_PTR this_ptr);
29178 * This penalty is applied when `htlc_maximum_msat` is equal to or larger than half of the
29179 * channel's capacity, which makes us prefer nodes with a smaller `htlc_maximum_msat`. We
29180 * treat such nodes preferentially as this makes balance discovery attacks harder to execute,
29181 * thereby creating an incentive to restrict `htlc_maximum_msat` and improve privacy.
29183 * Default value: 250 msat
29185 void ProbabilisticScoringParameters_set_anti_probing_penalty_msat(struct LDKProbabilisticScoringParameters *NONNULL_PTR this_ptr, uint64_t val);
29188 * This penalty is applied when the amount we're attempting to send over a channel exceeds our
29189 * current estimate of the channel's available liquidity.
29191 * Note that in this case all other penalties, including the
29192 * [`liquidity_penalty_multiplier_msat`] and [`liquidity_penalty_amount_multiplier_msat`]-based
29193 * penalties, as well as the [`base_penalty_msat`] and the [`anti_probing_penalty_msat`], if
29194 * applicable, are still included in the overall penalty.
29196 * If you wish to avoid creating paths with such channels entirely, setting this to a value of
29197 * `u64::max_value()` will guarantee that.
29199 * Default value: 1_0000_0000_000 msat (1 Bitcoin)
29201 * [`liquidity_penalty_multiplier_msat`]: Self::liquidity_penalty_multiplier_msat
29202 * [`liquidity_penalty_amount_multiplier_msat`]: Self::liquidity_penalty_amount_multiplier_msat
29203 * [`base_penalty_msat`]: Self::base_penalty_msat
29204 * [`anti_probing_penalty_msat`]: Self::anti_probing_penalty_msat
29206 uint64_t ProbabilisticScoringParameters_get_considered_impossible_penalty_msat(const struct LDKProbabilisticScoringParameters *NONNULL_PTR this_ptr);
29209 * This penalty is applied when the amount we're attempting to send over a channel exceeds our
29210 * current estimate of the channel's available liquidity.
29212 * Note that in this case all other penalties, including the
29213 * [`liquidity_penalty_multiplier_msat`] and [`liquidity_penalty_amount_multiplier_msat`]-based
29214 * penalties, as well as the [`base_penalty_msat`] and the [`anti_probing_penalty_msat`], if
29215 * applicable, are still included in the overall penalty.
29217 * If you wish to avoid creating paths with such channels entirely, setting this to a value of
29218 * `u64::max_value()` will guarantee that.
29220 * Default value: 1_0000_0000_000 msat (1 Bitcoin)
29222 * [`liquidity_penalty_multiplier_msat`]: Self::liquidity_penalty_multiplier_msat
29223 * [`liquidity_penalty_amount_multiplier_msat`]: Self::liquidity_penalty_amount_multiplier_msat
29224 * [`base_penalty_msat`]: Self::base_penalty_msat
29225 * [`anti_probing_penalty_msat`]: Self::anti_probing_penalty_msat
29227 void ProbabilisticScoringParameters_set_considered_impossible_penalty_msat(struct LDKProbabilisticScoringParameters *NONNULL_PTR this_ptr, uint64_t val);
29230 * Creates a copy of the ProbabilisticScoringParameters
29232 struct LDKProbabilisticScoringParameters ProbabilisticScoringParameters_clone(const struct LDKProbabilisticScoringParameters *NONNULL_PTR orig);
29235 * Creates a new scorer using the given scoring parameters for sending payments from a node
29236 * through a network graph.
29238 MUST_USE_RES struct LDKProbabilisticScorer ProbabilisticScorer_new(struct LDKProbabilisticScoringParameters params, const struct LDKNetworkGraph *NONNULL_PTR network_graph, struct LDKLogger logger);
29241 * Dump the contents of this scorer into the configured logger.
29243 * Note that this writes roughly one line per channel for which we have a liquidity estimate,
29244 * which may be a substantial amount of log output.
29246 void ProbabilisticScorer_debug_log_liquidity_stats(const struct LDKProbabilisticScorer *NONNULL_PTR this_arg);
29249 * Query the estimated minimum and maximum liquidity available for sending a payment over the
29250 * channel with `scid` towards the given `target` node.
29252 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);
29255 * Marks the node with the given `node_id` as banned, i.e.,
29256 * it will be avoided during path finding.
29258 void ProbabilisticScorer_add_banned(struct LDKProbabilisticScorer *NONNULL_PTR this_arg, const struct LDKNodeId *NONNULL_PTR node_id);
29261 * Removes the node with the given `node_id` from the list of nodes to avoid.
29263 void ProbabilisticScorer_remove_banned(struct LDKProbabilisticScorer *NONNULL_PTR this_arg, const struct LDKNodeId *NONNULL_PTR node_id);
29266 * Sets a manual penalty for the given node.
29268 void ProbabilisticScorer_set_manual_penalty(struct LDKProbabilisticScorer *NONNULL_PTR this_arg, const struct LDKNodeId *NONNULL_PTR node_id, uint64_t penalty);
29271 * Removes the node with the given `node_id` from the list of manual penalties.
29273 void ProbabilisticScorer_remove_manual_penalty(struct LDKProbabilisticScorer *NONNULL_PTR this_arg, const struct LDKNodeId *NONNULL_PTR node_id);
29276 * Clears the list of manual penalties that are applied during path finding.
29278 void ProbabilisticScorer_clear_manual_penalties(struct LDKProbabilisticScorer *NONNULL_PTR this_arg);
29281 * Marks all nodes in the given list as banned, i.e.,
29282 * they will be avoided during path finding.
29284 void ProbabilisticScoringParameters_add_banned_from_list(struct LDKProbabilisticScoringParameters *NONNULL_PTR this_arg, struct LDKCVec_NodeIdZ node_ids);
29287 * Creates a "default" ProbabilisticScoringParameters. See struct and individual field documentaiton for details on which values are used.
29289 MUST_USE_RES struct LDKProbabilisticScoringParameters ProbabilisticScoringParameters_default(void);
29292 * Constructs a new Score which calls the relevant methods on this_arg.
29293 * This copies the `inner` pointer in this_arg and thus the returned Score must be freed before this_arg is
29295 struct LDKScore ProbabilisticScorer_as_Score(const struct LDKProbabilisticScorer *NONNULL_PTR this_arg);
29298 * Serialize the ProbabilisticScorer object into a byte array which can be read by ProbabilisticScorer_read
29300 struct LDKCVec_u8Z ProbabilisticScorer_write(const struct LDKProbabilisticScorer *NONNULL_PTR obj);
29303 * Read a ProbabilisticScorer from a byte array, created by ProbabilisticScorer_write
29305 struct LDKCResult_ProbabilisticScorerDecodeErrorZ ProbabilisticScorer_read(struct LDKu8slice ser, struct LDKProbabilisticScoringParameters arg_a, const struct LDKNetworkGraph *NONNULL_PTR arg_b, struct LDKLogger arg_c);
29308 * Frees any resources used by the BlindedRoute, if is_owned is set and inner is non-NULL.
29310 void BlindedRoute_free(struct LDKBlindedRoute this_obj);
29313 * Frees any resources used by the BlindedHop, if is_owned is set and inner is non-NULL.
29315 void BlindedHop_free(struct LDKBlindedHop this_obj);
29318 * Create a blinded route to be forwarded along `node_pks`. The last node pubkey in `node_pks`
29319 * will be the destination node.
29321 * Errors if less than two hops are provided or if `node_pk`(s) are invalid.
29323 MUST_USE_RES struct LDKCResult_BlindedRouteNoneZ BlindedRoute_new(struct LDKCVec_PublicKeyZ node_pks, const struct LDKKeysInterface *NONNULL_PTR keys_manager);
29326 * Serialize the BlindedRoute object into a byte array which can be read by BlindedRoute_read
29328 struct LDKCVec_u8Z BlindedRoute_write(const struct LDKBlindedRoute *NONNULL_PTR obj);
29331 * Read a BlindedRoute from a byte array, created by BlindedRoute_write
29333 struct LDKCResult_BlindedRouteDecodeErrorZ BlindedRoute_read(struct LDKu8slice ser);
29336 * Serialize the BlindedHop object into a byte array which can be read by BlindedHop_read
29338 struct LDKCVec_u8Z BlindedHop_write(const struct LDKBlindedHop *NONNULL_PTR obj);
29341 * Read a BlindedHop from a byte array, created by BlindedHop_write
29343 struct LDKCResult_BlindedHopDecodeErrorZ BlindedHop_read(struct LDKu8slice ser);
29346 * Frees any resources used by the OnionMessenger, if is_owned is set and inner is non-NULL.
29348 void OnionMessenger_free(struct LDKOnionMessenger this_obj);
29351 * Frees any resources used by the Destination
29353 void Destination_free(struct LDKDestination this_ptr);
29356 * Utility method to constructs a new Node-variant Destination
29358 struct LDKDestination Destination_node(struct LDKPublicKey a);
29361 * Utility method to constructs a new BlindedRoute-variant Destination
29363 struct LDKDestination Destination_blinded_route(struct LDKBlindedRoute a);
29366 * Frees any resources used by the SendError
29368 void SendError_free(struct LDKSendError this_ptr);
29371 * Creates a copy of the SendError
29373 struct LDKSendError SendError_clone(const struct LDKSendError *NONNULL_PTR orig);
29376 * Utility method to constructs a new Secp256k1-variant SendError
29378 struct LDKSendError SendError_secp256k1(enum LDKSecp256k1Error a);
29381 * Utility method to constructs a new TooBigPacket-variant SendError
29383 struct LDKSendError SendError_too_big_packet(void);
29386 * Utility method to constructs a new TooFewBlindedHops-variant SendError
29388 struct LDKSendError SendError_too_few_blinded_hops(void);
29391 * Utility method to constructs a new InvalidFirstHop-variant SendError
29393 struct LDKSendError SendError_invalid_first_hop(void);
29396 * Utility method to constructs a new BufferFull-variant SendError
29398 struct LDKSendError SendError_buffer_full(void);
29401 * Constructs a new `OnionMessenger` to send, forward, and delegate received onion messages to
29402 * their respective handlers.
29404 MUST_USE_RES struct LDKOnionMessenger OnionMessenger_new(struct LDKKeysInterface keys_manager, struct LDKLogger logger);
29407 * Send an empty onion message to `destination`, routing it through `intermediate_nodes`.
29408 * See [`OnionMessenger`] for example usage.
29410 * Note that reply_path (or a relevant inner pointer) may be NULL or all-0s to represent None
29412 MUST_USE_RES struct LDKCResult_NoneSendErrorZ OnionMessenger_send_onion_message(const struct LDKOnionMessenger *NONNULL_PTR this_arg, struct LDKCVec_PublicKeyZ intermediate_nodes, struct LDKDestination destination, struct LDKBlindedRoute reply_path);
29415 * Constructs a new OnionMessageHandler which calls the relevant methods on this_arg.
29416 * This copies the `inner` pointer in this_arg and thus the returned OnionMessageHandler must be freed before this_arg is
29418 struct LDKOnionMessageHandler OnionMessenger_as_OnionMessageHandler(const struct LDKOnionMessenger *NONNULL_PTR this_arg);
29421 * Constructs a new OnionMessageProvider which calls the relevant methods on this_arg.
29422 * This copies the `inner` pointer in this_arg and thus the returned OnionMessageProvider must be freed before this_arg is
29424 struct LDKOnionMessageProvider OnionMessenger_as_OnionMessageProvider(const struct LDKOnionMessenger *NONNULL_PTR this_arg);
29427 * Frees any resources used by the FilesystemPersister, if is_owned is set and inner is non-NULL.
29429 void FilesystemPersister_free(struct LDKFilesystemPersister this_obj);
29432 * Initialize a new FilesystemPersister and set the path to the individual channels'
29435 MUST_USE_RES struct LDKFilesystemPersister FilesystemPersister_new(struct LDKStr path_to_channel_data);
29438 * Get the directory which was provided when this persister was initialized.
29440 MUST_USE_RES struct LDKStr FilesystemPersister_get_data_dir(const struct LDKFilesystemPersister *NONNULL_PTR this_arg);
29443 * Read `ChannelMonitor`s from disk.
29445 MUST_USE_RES struct LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ FilesystemPersister_read_channelmonitors(const struct LDKFilesystemPersister *NONNULL_PTR this_arg, struct LDKKeysInterface keys_manager);
29448 * Frees any resources used by the BackgroundProcessor, if is_owned is set and inner is non-NULL.
29450 void BackgroundProcessor_free(struct LDKBackgroundProcessor this_obj);
29453 * Frees any resources used by the GossipSync
29455 void GossipSync_free(struct LDKGossipSync this_ptr);
29458 * Utility method to constructs a new P2P-variant GossipSync
29460 struct LDKGossipSync GossipSync_p2_p(const struct LDKP2PGossipSync *NONNULL_PTR a);
29463 * Utility method to constructs a new Rapid-variant GossipSync
29465 struct LDKGossipSync GossipSync_rapid(const struct LDKRapidGossipSync *NONNULL_PTR a);
29468 * Utility method to constructs a new None-variant GossipSync
29470 struct LDKGossipSync GossipSync_none(void);
29473 * Start a background thread that takes care of responsibilities enumerated in the [top-level
29476 * The thread runs indefinitely unless the object is dropped, [`stop`] is called, or
29477 * [`Persister::persist_manager`] returns an error. In case of an error, the error is retrieved by calling
29478 * either [`join`] or [`stop`].
29480 * # Data Persistence
29482 * [`Persister::persist_manager`] is responsible for writing out the [`ChannelManager`] to disk, and/or
29483 * uploading to one or more backup services. See [`ChannelManager::write`] for writing out a
29484 * [`ChannelManager`]. See the `lightning-persister` crate for LDK's
29485 * provided implementation.
29487 * [`Persister::persist_graph`] is responsible for writing out the [`NetworkGraph`] to disk, if
29488 * [`GossipSync`] is supplied. See [`NetworkGraph::write`] for writing out a [`NetworkGraph`].
29489 * See the `lightning-persister` crate for LDK's provided implementation.
29491 * Typically, users should either implement [`Persister::persist_manager`] to never return an
29492 * error or call [`join`] and handle any error that may arise. For the latter case,
29493 * `BackgroundProcessor` must be restarted by calling `start` again after handling the error.
29497 * `event_handler` is responsible for handling events that users should be notified of (e.g.,
29498 * payment failed). [`BackgroundProcessor`] may decorate the given [`EventHandler`] with common
29499 * functionality implemented by other handlers.
29500 * * [`P2PGossipSync`] if given will update the [`NetworkGraph`] based on payment failures.
29502 * # Rapid Gossip Sync
29504 * If rapid gossip sync is meant to run at startup, pass [`RapidGossipSync`] via `gossip_sync`
29505 * to indicate that the [`BackgroundProcessor`] should not prune the [`NetworkGraph`] instance
29506 * until the [`RapidGossipSync`] instance completes its first sync.
29508 * [top-level documentation]: BackgroundProcessor
29509 * [`join`]: Self::join
29510 * [`stop`]: Self::stop
29511 * [`ChannelManager`]: lightning::ln::channelmanager::ChannelManager
29512 * [`ChannelManager::write`]: lightning::ln::channelmanager::ChannelManager#impl-Writeable
29513 * [`Persister::persist_manager`]: lightning::util::persist::Persister::persist_manager
29514 * [`Persister::persist_graph`]: lightning::util::persist::Persister::persist_graph
29515 * [`NetworkGraph`]: lightning::routing::gossip::NetworkGraph
29516 * [`NetworkGraph::write`]: lightning::routing::gossip::NetworkGraph#impl-Writeable
29518 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);
29521 * Join `BackgroundProcessor`'s thread, returning any error that occurred while persisting
29522 * [`ChannelManager`].
29526 * This function panics if the background thread has panicked such as while persisting or
29529 * [`ChannelManager`]: lightning::ln::channelmanager::ChannelManager
29531 MUST_USE_RES struct LDKCResult_NoneErrorZ BackgroundProcessor_join(struct LDKBackgroundProcessor this_arg);
29534 * Stop `BackgroundProcessor`'s thread, returning any error that occurred while persisting
29535 * [`ChannelManager`].
29539 * This function panics if the background thread has panicked such as while persisting or
29542 * [`ChannelManager`]: lightning::ln::channelmanager::ChannelManager
29544 MUST_USE_RES struct LDKCResult_NoneErrorZ BackgroundProcessor_stop(struct LDKBackgroundProcessor this_arg);
29547 * Frees any resources used by the ParseError
29549 void ParseError_free(struct LDKParseError this_ptr);
29552 * Creates a copy of the ParseError
29554 struct LDKParseError ParseError_clone(const struct LDKParseError *NONNULL_PTR orig);
29557 * Utility method to constructs a new Bech32Error-variant ParseError
29559 struct LDKParseError ParseError_bech32_error(struct LDKBech32Error a);
29562 * Utility method to constructs a new ParseAmountError-variant ParseError
29564 struct LDKParseError ParseError_parse_amount_error(struct LDKError a);
29567 * Utility method to constructs a new MalformedSignature-variant ParseError
29569 struct LDKParseError ParseError_malformed_signature(enum LDKSecp256k1Error a);
29572 * Utility method to constructs a new BadPrefix-variant ParseError
29574 struct LDKParseError ParseError_bad_prefix(void);
29577 * Utility method to constructs a new UnknownCurrency-variant ParseError
29579 struct LDKParseError ParseError_unknown_currency(void);
29582 * Utility method to constructs a new UnknownSiPrefix-variant ParseError
29584 struct LDKParseError ParseError_unknown_si_prefix(void);
29587 * Utility method to constructs a new MalformedHRP-variant ParseError
29589 struct LDKParseError ParseError_malformed_hrp(void);
29592 * Utility method to constructs a new TooShortDataPart-variant ParseError
29594 struct LDKParseError ParseError_too_short_data_part(void);
29597 * Utility method to constructs a new UnexpectedEndOfTaggedFields-variant ParseError
29599 struct LDKParseError ParseError_unexpected_end_of_tagged_fields(void);
29602 * Utility method to constructs a new DescriptionDecodeError-variant ParseError
29604 struct LDKParseError ParseError_description_decode_error(struct LDKError a);
29607 * Utility method to constructs a new PaddingError-variant ParseError
29609 struct LDKParseError ParseError_padding_error(void);
29612 * Utility method to constructs a new IntegerOverflowError-variant ParseError
29614 struct LDKParseError ParseError_integer_overflow_error(void);
29617 * Utility method to constructs a new InvalidSegWitProgramLength-variant ParseError
29619 struct LDKParseError ParseError_invalid_seg_wit_program_length(void);
29622 * Utility method to constructs a new InvalidPubKeyHashLength-variant ParseError
29624 struct LDKParseError ParseError_invalid_pub_key_hash_length(void);
29627 * Utility method to constructs a new InvalidScriptHashLength-variant ParseError
29629 struct LDKParseError ParseError_invalid_script_hash_length(void);
29632 * Utility method to constructs a new InvalidRecoveryId-variant ParseError
29634 struct LDKParseError ParseError_invalid_recovery_id(void);
29637 * Utility method to constructs a new InvalidSliceLength-variant ParseError
29639 struct LDKParseError ParseError_invalid_slice_length(struct LDKStr a);
29642 * Utility method to constructs a new Skip-variant ParseError
29644 struct LDKParseError ParseError_skip(void);
29647 * Frees any resources used by the ParseOrSemanticError
29649 void ParseOrSemanticError_free(struct LDKParseOrSemanticError this_ptr);
29652 * Creates a copy of the ParseOrSemanticError
29654 struct LDKParseOrSemanticError ParseOrSemanticError_clone(const struct LDKParseOrSemanticError *NONNULL_PTR orig);
29657 * Utility method to constructs a new ParseError-variant ParseOrSemanticError
29659 struct LDKParseOrSemanticError ParseOrSemanticError_parse_error(struct LDKParseError a);
29662 * Utility method to constructs a new SemanticError-variant ParseOrSemanticError
29664 struct LDKParseOrSemanticError ParseOrSemanticError_semantic_error(enum LDKSemanticError a);
29667 * Frees any resources used by the Invoice, if is_owned is set and inner is non-NULL.
29669 void Invoice_free(struct LDKInvoice this_obj);
29672 * Checks if two Invoices contain equal inner contents.
29673 * This ignores pointers and is_owned flags and looks at the values in fields.
29674 * Two objects with NULL inner values will be considered "equal" here.
29676 bool Invoice_eq(const struct LDKInvoice *NONNULL_PTR a, const struct LDKInvoice *NONNULL_PTR b);
29679 * Creates a copy of the Invoice
29681 struct LDKInvoice Invoice_clone(const struct LDKInvoice *NONNULL_PTR orig);
29684 * Checks if two Invoices contain equal inner contents.
29686 uint64_t Invoice_hash(const struct LDKInvoice *NONNULL_PTR o);
29689 * Frees any resources used by the SignedRawInvoice, if is_owned is set and inner is non-NULL.
29691 void SignedRawInvoice_free(struct LDKSignedRawInvoice this_obj);
29694 * Checks if two SignedRawInvoices contain equal inner contents.
29695 * This ignores pointers and is_owned flags and looks at the values in fields.
29696 * Two objects with NULL inner values will be considered "equal" here.
29698 bool SignedRawInvoice_eq(const struct LDKSignedRawInvoice *NONNULL_PTR a, const struct LDKSignedRawInvoice *NONNULL_PTR b);
29701 * Creates a copy of the SignedRawInvoice
29703 struct LDKSignedRawInvoice SignedRawInvoice_clone(const struct LDKSignedRawInvoice *NONNULL_PTR orig);
29706 * Checks if two SignedRawInvoices contain equal inner contents.
29708 uint64_t SignedRawInvoice_hash(const struct LDKSignedRawInvoice *NONNULL_PTR o);
29711 * Frees any resources used by the RawInvoice, if is_owned is set and inner is non-NULL.
29713 void RawInvoice_free(struct LDKRawInvoice this_obj);
29718 struct LDKRawDataPart RawInvoice_get_data(const struct LDKRawInvoice *NONNULL_PTR this_ptr);
29723 void RawInvoice_set_data(struct LDKRawInvoice *NONNULL_PTR this_ptr, struct LDKRawDataPart val);
29726 * Checks if two RawInvoices contain equal inner contents.
29727 * This ignores pointers and is_owned flags and looks at the values in fields.
29728 * Two objects with NULL inner values will be considered "equal" here.
29730 bool RawInvoice_eq(const struct LDKRawInvoice *NONNULL_PTR a, const struct LDKRawInvoice *NONNULL_PTR b);
29733 * Creates a copy of the RawInvoice
29735 struct LDKRawInvoice RawInvoice_clone(const struct LDKRawInvoice *NONNULL_PTR orig);
29738 * Checks if two RawInvoices contain equal inner contents.
29740 uint64_t RawInvoice_hash(const struct LDKRawInvoice *NONNULL_PTR o);
29743 * Frees any resources used by the RawDataPart, if is_owned is set and inner is non-NULL.
29745 void RawDataPart_free(struct LDKRawDataPart this_obj);
29748 * generation time of the invoice
29750 struct LDKPositiveTimestamp RawDataPart_get_timestamp(const struct LDKRawDataPart *NONNULL_PTR this_ptr);
29753 * generation time of the invoice
29755 void RawDataPart_set_timestamp(struct LDKRawDataPart *NONNULL_PTR this_ptr, struct LDKPositiveTimestamp val);
29758 * Checks if two RawDataParts contain equal inner contents.
29759 * This ignores pointers and is_owned flags and looks at the values in fields.
29760 * Two objects with NULL inner values will be considered "equal" here.
29762 bool RawDataPart_eq(const struct LDKRawDataPart *NONNULL_PTR a, const struct LDKRawDataPart *NONNULL_PTR b);
29765 * Creates a copy of the RawDataPart
29767 struct LDKRawDataPart RawDataPart_clone(const struct LDKRawDataPart *NONNULL_PTR orig);
29770 * Checks if two RawDataParts contain equal inner contents.
29772 uint64_t RawDataPart_hash(const struct LDKRawDataPart *NONNULL_PTR o);
29775 * Frees any resources used by the PositiveTimestamp, if is_owned is set and inner is non-NULL.
29777 void PositiveTimestamp_free(struct LDKPositiveTimestamp this_obj);
29780 * Checks if two PositiveTimestamps contain equal inner contents.
29781 * This ignores pointers and is_owned flags and looks at the values in fields.
29782 * Two objects with NULL inner values will be considered "equal" here.
29784 bool PositiveTimestamp_eq(const struct LDKPositiveTimestamp *NONNULL_PTR a, const struct LDKPositiveTimestamp *NONNULL_PTR b);
29787 * Creates a copy of the PositiveTimestamp
29789 struct LDKPositiveTimestamp PositiveTimestamp_clone(const struct LDKPositiveTimestamp *NONNULL_PTR orig);
29792 * Checks if two PositiveTimestamps contain equal inner contents.
29794 uint64_t PositiveTimestamp_hash(const struct LDKPositiveTimestamp *NONNULL_PTR o);
29797 * Creates a copy of the SiPrefix
29799 enum LDKSiPrefix SiPrefix_clone(const enum LDKSiPrefix *NONNULL_PTR orig);
29802 * Utility method to constructs a new Milli-variant SiPrefix
29804 enum LDKSiPrefix SiPrefix_milli(void);
29807 * Utility method to constructs a new Micro-variant SiPrefix
29809 enum LDKSiPrefix SiPrefix_micro(void);
29812 * Utility method to constructs a new Nano-variant SiPrefix
29814 enum LDKSiPrefix SiPrefix_nano(void);
29817 * Utility method to constructs a new Pico-variant SiPrefix
29819 enum LDKSiPrefix SiPrefix_pico(void);
29822 * Checks if two SiPrefixs contain equal inner contents.
29823 * This ignores pointers and is_owned flags and looks at the values in fields.
29825 bool SiPrefix_eq(const enum LDKSiPrefix *NONNULL_PTR a, const enum LDKSiPrefix *NONNULL_PTR b);
29828 * Checks if two SiPrefixs contain equal inner contents.
29830 uint64_t SiPrefix_hash(const enum LDKSiPrefix *NONNULL_PTR o);
29833 * Returns the multiplier to go from a BTC value to picoBTC implied by this SiPrefix.
29834 * This is effectively 10^12 * the prefix multiplier
29836 MUST_USE_RES uint64_t SiPrefix_multiplier(const enum LDKSiPrefix *NONNULL_PTR this_arg);
29839 * Creates a copy of the Currency
29841 enum LDKCurrency Currency_clone(const enum LDKCurrency *NONNULL_PTR orig);
29844 * Utility method to constructs a new Bitcoin-variant Currency
29846 enum LDKCurrency Currency_bitcoin(void);
29849 * Utility method to constructs a new BitcoinTestnet-variant Currency
29851 enum LDKCurrency Currency_bitcoin_testnet(void);
29854 * Utility method to constructs a new Regtest-variant Currency
29856 enum LDKCurrency Currency_regtest(void);
29859 * Utility method to constructs a new Simnet-variant Currency
29861 enum LDKCurrency Currency_simnet(void);
29864 * Utility method to constructs a new Signet-variant Currency
29866 enum LDKCurrency Currency_signet(void);
29869 * Checks if two Currencys contain equal inner contents.
29871 uint64_t Currency_hash(const enum LDKCurrency *NONNULL_PTR o);
29874 * Checks if two Currencys contain equal inner contents.
29875 * This ignores pointers and is_owned flags and looks at the values in fields.
29877 bool Currency_eq(const enum LDKCurrency *NONNULL_PTR a, const enum LDKCurrency *NONNULL_PTR b);
29880 * Frees any resources used by the Sha256, if is_owned is set and inner is non-NULL.
29882 void Sha256_free(struct LDKSha256 this_obj);
29885 * Creates a copy of the Sha256
29887 struct LDKSha256 Sha256_clone(const struct LDKSha256 *NONNULL_PTR orig);
29890 * Checks if two Sha256s contain equal inner contents.
29892 uint64_t Sha256_hash(const struct LDKSha256 *NONNULL_PTR o);
29895 * Checks if two Sha256s contain equal inner contents.
29896 * This ignores pointers and is_owned flags and looks at the values in fields.
29897 * Two objects with NULL inner values will be considered "equal" here.
29899 bool Sha256_eq(const struct LDKSha256 *NONNULL_PTR a, const struct LDKSha256 *NONNULL_PTR b);
29902 * Frees any resources used by the Description, if is_owned is set and inner is non-NULL.
29904 void Description_free(struct LDKDescription this_obj);
29907 * Creates a copy of the Description
29909 struct LDKDescription Description_clone(const struct LDKDescription *NONNULL_PTR orig);
29912 * Checks if two Descriptions contain equal inner contents.
29914 uint64_t Description_hash(const struct LDKDescription *NONNULL_PTR o);
29917 * Checks if two Descriptions contain equal inner contents.
29918 * This ignores pointers and is_owned flags and looks at the values in fields.
29919 * Two objects with NULL inner values will be considered "equal" here.
29921 bool Description_eq(const struct LDKDescription *NONNULL_PTR a, const struct LDKDescription *NONNULL_PTR b);
29924 * Frees any resources used by the PayeePubKey, if is_owned is set and inner is non-NULL.
29926 void PayeePubKey_free(struct LDKPayeePubKey this_obj);
29928 struct LDKPublicKey PayeePubKey_get_a(const struct LDKPayeePubKey *NONNULL_PTR this_ptr);
29930 void PayeePubKey_set_a(struct LDKPayeePubKey *NONNULL_PTR this_ptr, struct LDKPublicKey val);
29933 * Constructs a new PayeePubKey given each field
29935 MUST_USE_RES struct LDKPayeePubKey PayeePubKey_new(struct LDKPublicKey a_arg);
29938 * Creates a copy of the PayeePubKey
29940 struct LDKPayeePubKey PayeePubKey_clone(const struct LDKPayeePubKey *NONNULL_PTR orig);
29943 * Checks if two PayeePubKeys contain equal inner contents.
29945 uint64_t PayeePubKey_hash(const struct LDKPayeePubKey *NONNULL_PTR o);
29948 * Checks if two PayeePubKeys contain equal inner contents.
29949 * This ignores pointers and is_owned flags and looks at the values in fields.
29950 * Two objects with NULL inner values will be considered "equal" here.
29952 bool PayeePubKey_eq(const struct LDKPayeePubKey *NONNULL_PTR a, const struct LDKPayeePubKey *NONNULL_PTR b);
29955 * Frees any resources used by the ExpiryTime, if is_owned is set and inner is non-NULL.
29957 void ExpiryTime_free(struct LDKExpiryTime this_obj);
29960 * Creates a copy of the ExpiryTime
29962 struct LDKExpiryTime ExpiryTime_clone(const struct LDKExpiryTime *NONNULL_PTR orig);
29965 * Checks if two ExpiryTimes contain equal inner contents.
29967 uint64_t ExpiryTime_hash(const struct LDKExpiryTime *NONNULL_PTR o);
29970 * Checks if two ExpiryTimes contain equal inner contents.
29971 * This ignores pointers and is_owned flags and looks at the values in fields.
29972 * Two objects with NULL inner values will be considered "equal" here.
29974 bool ExpiryTime_eq(const struct LDKExpiryTime *NONNULL_PTR a, const struct LDKExpiryTime *NONNULL_PTR b);
29977 * Frees any resources used by the MinFinalCltvExpiry, if is_owned is set and inner is non-NULL.
29979 void MinFinalCltvExpiry_free(struct LDKMinFinalCltvExpiry this_obj);
29981 uint64_t MinFinalCltvExpiry_get_a(const struct LDKMinFinalCltvExpiry *NONNULL_PTR this_ptr);
29983 void MinFinalCltvExpiry_set_a(struct LDKMinFinalCltvExpiry *NONNULL_PTR this_ptr, uint64_t val);
29986 * Constructs a new MinFinalCltvExpiry given each field
29988 MUST_USE_RES struct LDKMinFinalCltvExpiry MinFinalCltvExpiry_new(uint64_t a_arg);
29991 * Creates a copy of the MinFinalCltvExpiry
29993 struct LDKMinFinalCltvExpiry MinFinalCltvExpiry_clone(const struct LDKMinFinalCltvExpiry *NONNULL_PTR orig);
29996 * Checks if two MinFinalCltvExpirys contain equal inner contents.
29998 uint64_t MinFinalCltvExpiry_hash(const struct LDKMinFinalCltvExpiry *NONNULL_PTR o);
30001 * Checks if two MinFinalCltvExpirys contain equal inner contents.
30002 * This ignores pointers and is_owned flags and looks at the values in fields.
30003 * Two objects with NULL inner values will be considered "equal" here.
30005 bool MinFinalCltvExpiry_eq(const struct LDKMinFinalCltvExpiry *NONNULL_PTR a, const struct LDKMinFinalCltvExpiry *NONNULL_PTR b);
30008 * Frees any resources used by the Fallback
30010 void Fallback_free(struct LDKFallback this_ptr);
30013 * Creates a copy of the Fallback
30015 struct LDKFallback Fallback_clone(const struct LDKFallback *NONNULL_PTR orig);
30018 * Utility method to constructs a new SegWitProgram-variant Fallback
30020 struct LDKFallback Fallback_seg_wit_program(struct LDKu5 version, struct LDKCVec_u8Z program);
30023 * Utility method to constructs a new PubKeyHash-variant Fallback
30025 struct LDKFallback Fallback_pub_key_hash(struct LDKTwentyBytes a);
30028 * Utility method to constructs a new ScriptHash-variant Fallback
30030 struct LDKFallback Fallback_script_hash(struct LDKTwentyBytes a);
30033 * Checks if two Fallbacks contain equal inner contents.
30035 uint64_t Fallback_hash(const struct LDKFallback *NONNULL_PTR o);
30038 * Checks if two Fallbacks contain equal inner contents.
30039 * This ignores pointers and is_owned flags and looks at the values in fields.
30041 bool Fallback_eq(const struct LDKFallback *NONNULL_PTR a, const struct LDKFallback *NONNULL_PTR b);
30044 * Frees any resources used by the InvoiceSignature, if is_owned is set and inner is non-NULL.
30046 void InvoiceSignature_free(struct LDKInvoiceSignature this_obj);
30049 * Creates a copy of the InvoiceSignature
30051 struct LDKInvoiceSignature InvoiceSignature_clone(const struct LDKInvoiceSignature *NONNULL_PTR orig);
30054 * Checks if two InvoiceSignatures contain equal inner contents.
30056 uint64_t InvoiceSignature_hash(const struct LDKInvoiceSignature *NONNULL_PTR o);
30059 * Checks if two InvoiceSignatures contain equal inner contents.
30060 * This ignores pointers and is_owned flags and looks at the values in fields.
30061 * Two objects with NULL inner values will be considered "equal" here.
30063 bool InvoiceSignature_eq(const struct LDKInvoiceSignature *NONNULL_PTR a, const struct LDKInvoiceSignature *NONNULL_PTR b);
30066 * Frees any resources used by the PrivateRoute, if is_owned is set and inner is non-NULL.
30068 void PrivateRoute_free(struct LDKPrivateRoute this_obj);
30071 * Creates a copy of the PrivateRoute
30073 struct LDKPrivateRoute PrivateRoute_clone(const struct LDKPrivateRoute *NONNULL_PTR orig);
30076 * Checks if two PrivateRoutes contain equal inner contents.
30078 uint64_t PrivateRoute_hash(const struct LDKPrivateRoute *NONNULL_PTR o);
30081 * Checks if two PrivateRoutes contain equal inner contents.
30082 * This ignores pointers and is_owned flags and looks at the values in fields.
30083 * Two objects with NULL inner values will be considered "equal" here.
30085 bool PrivateRoute_eq(const struct LDKPrivateRoute *NONNULL_PTR a, const struct LDKPrivateRoute *NONNULL_PTR b);
30088 * Disassembles the `SignedRawInvoice` into its three parts:
30090 * 2. hash of the raw invoice
30093 MUST_USE_RES struct LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ SignedRawInvoice_into_parts(struct LDKSignedRawInvoice this_arg);
30096 * The `RawInvoice` which was signed.
30098 MUST_USE_RES struct LDKRawInvoice SignedRawInvoice_raw_invoice(const struct LDKSignedRawInvoice *NONNULL_PTR this_arg);
30101 * The hash of the `RawInvoice` that was signed.
30103 MUST_USE_RES const uint8_t (*SignedRawInvoice_signable_hash(const struct LDKSignedRawInvoice *NONNULL_PTR this_arg))[32];
30106 * InvoiceSignature for the invoice.
30108 MUST_USE_RES struct LDKInvoiceSignature SignedRawInvoice_signature(const struct LDKSignedRawInvoice *NONNULL_PTR this_arg);
30111 * Recovers the public key used for signing the invoice from the recoverable signature.
30113 MUST_USE_RES struct LDKCResult_PayeePubKeyErrorZ SignedRawInvoice_recover_payee_pub_key(const struct LDKSignedRawInvoice *NONNULL_PTR this_arg);
30116 * Checks if the signature is valid for the included payee public key or if none exists if it's
30117 * valid for the recovered signature (which should always be true?).
30119 MUST_USE_RES bool SignedRawInvoice_check_signature(const struct LDKSignedRawInvoice *NONNULL_PTR this_arg);
30122 * Calculate the hash of the encoded `RawInvoice` which should be signed.
30124 MUST_USE_RES struct LDKThirtyTwoBytes RawInvoice_signable_hash(const struct LDKRawInvoice *NONNULL_PTR this_arg);
30128 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
30130 MUST_USE_RES struct LDKSha256 RawInvoice_payment_hash(const struct LDKRawInvoice *NONNULL_PTR this_arg);
30134 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
30136 MUST_USE_RES struct LDKDescription RawInvoice_description(const struct LDKRawInvoice *NONNULL_PTR this_arg);
30140 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
30142 MUST_USE_RES struct LDKPayeePubKey RawInvoice_payee_pub_key(const struct LDKRawInvoice *NONNULL_PTR this_arg);
30146 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
30148 MUST_USE_RES struct LDKSha256 RawInvoice_description_hash(const struct LDKRawInvoice *NONNULL_PTR this_arg);
30152 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
30154 MUST_USE_RES struct LDKExpiryTime RawInvoice_expiry_time(const struct LDKRawInvoice *NONNULL_PTR this_arg);
30158 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
30160 MUST_USE_RES struct LDKMinFinalCltvExpiry RawInvoice_min_final_cltv_expiry(const struct LDKRawInvoice *NONNULL_PTR this_arg);
30164 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
30166 MUST_USE_RES struct LDKThirtyTwoBytes RawInvoice_payment_secret(const struct LDKRawInvoice *NONNULL_PTR this_arg);
30170 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
30172 MUST_USE_RES struct LDKInvoiceFeatures RawInvoice_features(const struct LDKRawInvoice *NONNULL_PTR this_arg);
30174 MUST_USE_RES struct LDKCVec_PrivateRouteZ RawInvoice_private_routes(const struct LDKRawInvoice *NONNULL_PTR this_arg);
30176 MUST_USE_RES struct LDKCOption_u64Z RawInvoice_amount_pico_btc(const struct LDKRawInvoice *NONNULL_PTR this_arg);
30178 MUST_USE_RES enum LDKCurrency RawInvoice_currency(const struct LDKRawInvoice *NONNULL_PTR this_arg);
30181 * Creates a `PositiveTimestamp` from a Unix timestamp in the range `0..=MAX_TIMESTAMP`.
30183 * Otherwise, returns a [`CreationError::TimestampOutOfBounds`].
30185 MUST_USE_RES struct LDKCResult_PositiveTimestampCreationErrorZ PositiveTimestamp_from_unix_timestamp(uint64_t unix_seconds);
30188 * Creates a `PositiveTimestamp` from a [`SystemTime`] with a corresponding Unix timestamp in
30189 * the range `0..=MAX_TIMESTAMP`.
30191 * Otherwise, returns a [`CreationError::TimestampOutOfBounds`].
30193 MUST_USE_RES struct LDKCResult_PositiveTimestampCreationErrorZ PositiveTimestamp_from_system_time(uint64_t time);
30196 * Creates a `PositiveTimestamp` from a [`Duration`] since the Unix epoch in the range
30197 * `0..=MAX_TIMESTAMP`.
30199 * Otherwise, returns a [`CreationError::TimestampOutOfBounds`].
30201 MUST_USE_RES struct LDKCResult_PositiveTimestampCreationErrorZ PositiveTimestamp_from_duration_since_epoch(uint64_t duration);
30204 * Returns the Unix timestamp representing the stored time
30206 MUST_USE_RES uint64_t PositiveTimestamp_as_unix_timestamp(const struct LDKPositiveTimestamp *NONNULL_PTR this_arg);
30209 * Returns the duration of the stored time since the Unix epoch
30211 MUST_USE_RES uint64_t PositiveTimestamp_as_duration_since_epoch(const struct LDKPositiveTimestamp *NONNULL_PTR this_arg);
30214 * Returns the [`SystemTime`] representing the stored time
30216 MUST_USE_RES uint64_t PositiveTimestamp_as_time(const struct LDKPositiveTimestamp *NONNULL_PTR this_arg);
30219 * Transform the `Invoice` into it's unchecked version
30221 MUST_USE_RES struct LDKSignedRawInvoice Invoice_into_signed_raw(struct LDKInvoice this_arg);
30224 * Check that the invoice is signed correctly and that key recovery works
30226 MUST_USE_RES struct LDKCResult_NoneSemanticErrorZ Invoice_check_signature(const struct LDKInvoice *NONNULL_PTR this_arg);
30229 * Constructs an `Invoice` from a `SignedRawInvoice` by checking all its invariants.
30231 * use lightning_invoice::*;
30233 * let invoice = \"lnbc100p1psj9jhxdqud3jxktt5w46x7unfv9kz6mn0v3jsnp4q0d3p2sfluzdx45tqcs\\
30234 * h2pu5qc7lgq0xs578ngs6s0s68ua4h7cvspp5q6rmq35js88zp5dvwrv9m459tnk2zunwj5jalqtyxqulh0l\\
30235 * 5gflssp5nf55ny5gcrfl30xuhzj3nphgj27rstekmr9fw3ny5989s300gyus9qyysgqcqpcrzjqw2sxwe993\\
30236 * h5pcm4dxzpvttgza8zhkqxpgffcrf5v25nwpr3cmfg7z54kuqq8rgqqqqqqqq2qqqqq9qq9qrzjqd0ylaqcl\\
30237 * j9424x9m8h2vcukcgnm6s56xfgu3j78zyqzhgs4hlpzvznlugqq9vsqqqqqqqlgqqqqqeqq9qrzjqwldmj9d\\
30238 * ha74df76zhx6l9we0vjdquygcdt3kssupehe64g6yyp5yz5rhuqqwccqqyqqqqlgqqqqjcqq9qrzjqf9e58a\\
30239 * guqr0rcun0ajlvmzq3ek63cw2w282gv3z5uupmuwvgjtq2z55qsqqg6qqqyqqqrtnqqqzq3cqygrzjqvphms\\
30240 * ywntrrhqjcraumvc4y6r8v4z5v593trte429v4hredj7ms5z52usqq9ngqqqqqqqlgqqqqqqgq9qrzjq2v0v\\
30241 * p62g49p7569ev48cmulecsxe59lvaw3wlxm7r982zxa9zzj7z5l0cqqxusqqyqqqqlgqqqqqzsqygarl9fh3\\
30242 * 8s0gyuxjjgux34w75dnc6xp2l35j7es3jd4ugt3lu0xzre26yg5m7ke54n2d5sym4xcmxtl8238xxvw5h5h5\\
30243 * j5r6drg6k6zcqj0fcwg\";
30245 * let signed = invoice.parse::<SignedRawInvoice>().unwrap();
30247 * assert!(Invoice::from_signed(signed).is_ok());
30250 MUST_USE_RES struct LDKCResult_InvoiceSemanticErrorZ Invoice_from_signed(struct LDKSignedRawInvoice signed_invoice);
30253 * Returns the `Invoice`'s timestamp (should equal its creation time)
30255 MUST_USE_RES uint64_t Invoice_timestamp(const struct LDKInvoice *NONNULL_PTR this_arg);
30258 * Returns the `Invoice`'s timestamp as a duration since the Unix epoch
30260 MUST_USE_RES uint64_t Invoice_duration_since_epoch(const struct LDKInvoice *NONNULL_PTR this_arg);
30263 * Returns the hash to which we will receive the preimage on completion of the payment
30265 MUST_USE_RES const uint8_t (*Invoice_payment_hash(const struct LDKInvoice *NONNULL_PTR this_arg))[32];
30268 * Get the payee's public key if one was included in the invoice
30270 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
30272 MUST_USE_RES struct LDKPublicKey Invoice_payee_pub_key(const struct LDKInvoice *NONNULL_PTR this_arg);
30275 * Get the payment secret if one was included in the invoice
30277 MUST_USE_RES const uint8_t (*Invoice_payment_secret(const struct LDKInvoice *NONNULL_PTR this_arg))[32];
30280 * Get the invoice features if they were included in the invoice
30282 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
30284 MUST_USE_RES struct LDKInvoiceFeatures Invoice_features(const struct LDKInvoice *NONNULL_PTR this_arg);
30287 * Recover the payee's public key (only to be used if none was included in the invoice)
30289 MUST_USE_RES struct LDKPublicKey Invoice_recover_payee_pub_key(const struct LDKInvoice *NONNULL_PTR this_arg);
30292 * Returns the invoice's expiry time, if present, otherwise [`DEFAULT_EXPIRY_TIME`].
30294 MUST_USE_RES uint64_t Invoice_expiry_time(const struct LDKInvoice *NONNULL_PTR this_arg);
30297 * Returns whether the invoice has expired.
30299 MUST_USE_RES bool Invoice_is_expired(const struct LDKInvoice *NONNULL_PTR this_arg);
30302 * Returns whether the expiry time would pass at the given point in time.
30303 * `at_time` is the timestamp as a duration since the Unix epoch.
30305 MUST_USE_RES bool Invoice_would_expire(const struct LDKInvoice *NONNULL_PTR this_arg, uint64_t at_time);
30308 * Returns the invoice's `min_final_cltv_expiry` time, if present, otherwise
30309 * [`DEFAULT_MIN_FINAL_CLTV_EXPIRY`].
30311 MUST_USE_RES uint64_t Invoice_min_final_cltv_expiry(const struct LDKInvoice *NONNULL_PTR this_arg);
30314 * Returns a list of all routes included in the invoice
30316 MUST_USE_RES struct LDKCVec_PrivateRouteZ Invoice_private_routes(const struct LDKInvoice *NONNULL_PTR this_arg);
30319 * Returns a list of all routes included in the invoice as the underlying hints
30321 MUST_USE_RES struct LDKCVec_RouteHintZ Invoice_route_hints(const struct LDKInvoice *NONNULL_PTR this_arg);
30324 * Returns the currency for which the invoice was issued
30326 MUST_USE_RES enum LDKCurrency Invoice_currency(const struct LDKInvoice *NONNULL_PTR this_arg);
30329 * Returns the amount if specified in the invoice as millisatoshis.
30331 MUST_USE_RES struct LDKCOption_u64Z Invoice_amount_milli_satoshis(const struct LDKInvoice *NONNULL_PTR this_arg);
30334 * Creates a new `Description` if `description` is at most 1023 __bytes__ long,
30335 * returns `CreationError::DescriptionTooLong` otherwise
30337 * Please note that single characters may use more than one byte due to UTF8 encoding.
30339 MUST_USE_RES struct LDKCResult_DescriptionCreationErrorZ Description_new(struct LDKStr description);
30342 * Returns the underlying description `String`
30344 MUST_USE_RES struct LDKStr Description_into_inner(struct LDKDescription this_arg);
30347 * Construct an `ExpiryTime` from seconds.
30349 MUST_USE_RES struct LDKExpiryTime ExpiryTime_from_seconds(uint64_t seconds);
30352 * Construct an `ExpiryTime` from a `Duration`.
30354 MUST_USE_RES struct LDKExpiryTime ExpiryTime_from_duration(uint64_t duration);
30357 * Returns the expiry time in seconds
30359 MUST_USE_RES uint64_t ExpiryTime_as_seconds(const struct LDKExpiryTime *NONNULL_PTR this_arg);
30362 * Returns a reference to the underlying `Duration` (=expiry time)
30364 MUST_USE_RES uint64_t ExpiryTime_as_duration(const struct LDKExpiryTime *NONNULL_PTR this_arg);
30367 * Creates a new (partial) route from a list of hops
30369 MUST_USE_RES struct LDKCResult_PrivateRouteCreationErrorZ PrivateRoute_new(struct LDKRouteHint hops);
30372 * Returns the underlying list of hops
30374 MUST_USE_RES struct LDKRouteHint PrivateRoute_into_inner(struct LDKPrivateRoute this_arg);
30377 * Creates a copy of the CreationError
30379 enum LDKCreationError CreationError_clone(const enum LDKCreationError *NONNULL_PTR orig);
30382 * Utility method to constructs a new DescriptionTooLong-variant CreationError
30384 enum LDKCreationError CreationError_description_too_long(void);
30387 * Utility method to constructs a new RouteTooLong-variant CreationError
30389 enum LDKCreationError CreationError_route_too_long(void);
30392 * Utility method to constructs a new TimestampOutOfBounds-variant CreationError
30394 enum LDKCreationError CreationError_timestamp_out_of_bounds(void);
30397 * Utility method to constructs a new InvalidAmount-variant CreationError
30399 enum LDKCreationError CreationError_invalid_amount(void);
30402 * Utility method to constructs a new MissingRouteHints-variant CreationError
30404 enum LDKCreationError CreationError_missing_route_hints(void);
30407 * Checks if two CreationErrors contain equal inner contents.
30408 * This ignores pointers and is_owned flags and looks at the values in fields.
30410 bool CreationError_eq(const enum LDKCreationError *NONNULL_PTR a, const enum LDKCreationError *NONNULL_PTR b);
30413 * Get the string representation of a CreationError object
30415 struct LDKStr CreationError_to_str(const enum LDKCreationError *NONNULL_PTR o);
30418 * Creates a copy of the SemanticError
30420 enum LDKSemanticError SemanticError_clone(const enum LDKSemanticError *NONNULL_PTR orig);
30423 * Utility method to constructs a new NoPaymentHash-variant SemanticError
30425 enum LDKSemanticError SemanticError_no_payment_hash(void);
30428 * Utility method to constructs a new MultiplePaymentHashes-variant SemanticError
30430 enum LDKSemanticError SemanticError_multiple_payment_hashes(void);
30433 * Utility method to constructs a new NoDescription-variant SemanticError
30435 enum LDKSemanticError SemanticError_no_description(void);
30438 * Utility method to constructs a new MultipleDescriptions-variant SemanticError
30440 enum LDKSemanticError SemanticError_multiple_descriptions(void);
30443 * Utility method to constructs a new NoPaymentSecret-variant SemanticError
30445 enum LDKSemanticError SemanticError_no_payment_secret(void);
30448 * Utility method to constructs a new MultiplePaymentSecrets-variant SemanticError
30450 enum LDKSemanticError SemanticError_multiple_payment_secrets(void);
30453 * Utility method to constructs a new InvalidFeatures-variant SemanticError
30455 enum LDKSemanticError SemanticError_invalid_features(void);
30458 * Utility method to constructs a new InvalidRecoveryId-variant SemanticError
30460 enum LDKSemanticError SemanticError_invalid_recovery_id(void);
30463 * Utility method to constructs a new InvalidSignature-variant SemanticError
30465 enum LDKSemanticError SemanticError_invalid_signature(void);
30468 * Utility method to constructs a new ImpreciseAmount-variant SemanticError
30470 enum LDKSemanticError SemanticError_imprecise_amount(void);
30473 * Checks if two SemanticErrors contain equal inner contents.
30474 * This ignores pointers and is_owned flags and looks at the values in fields.
30476 bool SemanticError_eq(const enum LDKSemanticError *NONNULL_PTR a, const enum LDKSemanticError *NONNULL_PTR b);
30479 * Get the string representation of a SemanticError object
30481 struct LDKStr SemanticError_to_str(const enum LDKSemanticError *NONNULL_PTR o);
30484 * Frees any resources used by the SignOrCreationError
30486 void SignOrCreationError_free(struct LDKSignOrCreationError this_ptr);
30489 * Creates a copy of the SignOrCreationError
30491 struct LDKSignOrCreationError SignOrCreationError_clone(const struct LDKSignOrCreationError *NONNULL_PTR orig);
30494 * Utility method to constructs a new SignError-variant SignOrCreationError
30496 struct LDKSignOrCreationError SignOrCreationError_sign_error(void);
30499 * Utility method to constructs a new CreationError-variant SignOrCreationError
30501 struct LDKSignOrCreationError SignOrCreationError_creation_error(enum LDKCreationError a);
30504 * Checks if two SignOrCreationErrors contain equal inner contents.
30505 * This ignores pointers and is_owned flags and looks at the values in fields.
30507 bool SignOrCreationError_eq(const struct LDKSignOrCreationError *NONNULL_PTR a, const struct LDKSignOrCreationError *NONNULL_PTR b);
30510 * Get the string representation of a SignOrCreationError object
30512 struct LDKStr SignOrCreationError_to_str(const struct LDKSignOrCreationError *NONNULL_PTR o);
30515 * Frees any resources used by the InvoicePayer, if is_owned is set and inner is non-NULL.
30517 void InvoicePayer_free(struct LDKInvoicePayer this_obj);
30520 * Calls the free function if one is set
30522 void Payer_free(struct LDKPayer this_ptr);
30525 * Calls the free function if one is set
30527 void Router_free(struct LDKRouter this_ptr);
30530 * Frees any resources used by the Retry
30532 void Retry_free(struct LDKRetry this_ptr);
30535 * Creates a copy of the Retry
30537 struct LDKRetry Retry_clone(const struct LDKRetry *NONNULL_PTR orig);
30540 * Utility method to constructs a new Attempts-variant Retry
30542 struct LDKRetry Retry_attempts(uintptr_t a);
30545 * Utility method to constructs a new Timeout-variant Retry
30547 struct LDKRetry Retry_timeout(uint64_t a);
30550 * Checks if two Retrys contain equal inner contents.
30551 * This ignores pointers and is_owned flags and looks at the values in fields.
30553 bool Retry_eq(const struct LDKRetry *NONNULL_PTR a, const struct LDKRetry *NONNULL_PTR b);
30556 * Checks if two Retrys contain equal inner contents.
30558 uint64_t Retry_hash(const struct LDKRetry *NONNULL_PTR o);
30561 * Frees any resources used by the PaymentError
30563 void PaymentError_free(struct LDKPaymentError this_ptr);
30566 * Creates a copy of the PaymentError
30568 struct LDKPaymentError PaymentError_clone(const struct LDKPaymentError *NONNULL_PTR orig);
30571 * Utility method to constructs a new Invoice-variant PaymentError
30573 struct LDKPaymentError PaymentError_invoice(struct LDKStr a);
30576 * Utility method to constructs a new Routing-variant PaymentError
30578 struct LDKPaymentError PaymentError_routing(struct LDKLightningError a);
30581 * Utility method to constructs a new Sending-variant PaymentError
30583 struct LDKPaymentError PaymentError_sending(struct LDKPaymentSendFailure a);
30586 * Creates an invoice payer that retries failed payment paths.
30588 * Will forward any [`Event::PaymentPathFailed`] events to the decorated `event_handler` once
30589 * `retry` has been exceeded for a given [`Invoice`].
30591 MUST_USE_RES struct LDKInvoicePayer InvoicePayer_new(struct LDKPayer payer, struct LDKRouter router, struct LDKLogger logger, struct LDKEventHandler event_handler, struct LDKRetry retry);
30594 * Pays the given [`Invoice`], caching it for later use in case a retry is needed.
30596 * You should ensure that the `invoice.payment_hash()` is unique and the same payment_hash has
30597 * never been paid before. Because [`InvoicePayer`] is stateless no effort is made to do so
30600 MUST_USE_RES struct LDKCResult_PaymentIdPaymentErrorZ InvoicePayer_pay_invoice(const struct LDKInvoicePayer *NONNULL_PTR this_arg, const struct LDKInvoice *NONNULL_PTR invoice);
30603 * Pays the given zero-value [`Invoice`] using the given amount, caching it for later use in
30604 * case a retry is needed.
30606 * You should ensure that the `invoice.payment_hash()` is unique and the same payment_hash has
30607 * never been paid before. Because [`InvoicePayer`] is stateless no effort is made to do so
30610 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);
30613 * Pays `pubkey` an amount using the hash of the given preimage, caching it for later use in
30614 * case a retry is needed.
30616 * You should ensure that `payment_preimage` is unique and that its `payment_hash` has never
30617 * been paid before. Because [`InvoicePayer`] is stateless no effort is made to do so for you.
30619 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);
30622 * Removes the payment cached by the given payment hash.
30624 * Should be called once a payment has failed or succeeded if not using [`InvoicePayer`] as an
30625 * [`EventHandler`]. Otherwise, calling this method is unnecessary.
30627 void InvoicePayer_remove_cached_payment(const struct LDKInvoicePayer *NONNULL_PTR this_arg, const uint8_t (*payment_hash)[32]);
30630 * Constructs a new EventHandler which calls the relevant methods on this_arg.
30631 * This copies the `inner` pointer in this_arg and thus the returned EventHandler must be freed before this_arg is
30633 struct LDKEventHandler InvoicePayer_as_EventHandler(const struct LDKInvoicePayer *NONNULL_PTR this_arg);
30636 * Frees any resources used by the InFlightHtlcs, if is_owned is set and inner is non-NULL.
30638 void InFlightHtlcs_free(struct LDKInFlightHtlcs this_obj);
30641 * Returns liquidity in msat given the public key of the HTLC source, target, and short channel
30644 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);
30647 * Serialize the InFlightHtlcs object into a byte array which can be read by InFlightHtlcs_read
30649 struct LDKCVec_u8Z InFlightHtlcs_write(const struct LDKInFlightHtlcs *NONNULL_PTR obj);
30652 * Read a InFlightHtlcs from a byte array, created by InFlightHtlcs_write
30654 struct LDKCResult_InFlightHtlcsDecodeErrorZ InFlightHtlcs_read(struct LDKu8slice ser);
30657 * Utility to create an invoice that can be paid to one of multiple nodes, or a \"phantom invoice.\"
30658 * See [`PhantomKeysManager`] for more information on phantom node payments.
30660 * `phantom_route_hints` parameter:
30661 * * Contains channel info for all nodes participating in the phantom invoice
30662 * * Entries are retrieved from a call to [`ChannelManager::get_phantom_route_hints`] on each
30663 * participating node
30664 * * It is fine to cache `phantom_route_hints` and reuse it across invoices, as long as the data is
30665 * updated when a channel becomes disabled or closes
30666 * * Note that if too many channels are included in [`PhantomRouteHints::channels`], the invoice
30667 * may be too long for QR code scanning. To fix this, `PhantomRouteHints::channels` may be pared
30670 * `payment_hash` can be specified if you have a specific need for a custom payment hash (see the difference
30671 * between [`ChannelManager::create_inbound_payment`] and [`ChannelManager::create_inbound_payment_for_hash`]).
30672 * If `None` is provided for `payment_hash`, then one will be created.
30674 * `invoice_expiry_delta_secs` describes the number of seconds that the invoice is valid for
30675 * in excess of the current time.
30677 * Note that the provided `keys_manager`'s `KeysInterface` implementation must support phantom
30678 * invoices in its `sign_invoice` implementation ([`PhantomKeysManager`] satisfies this
30681 * [`PhantomKeysManager`]: lightning::chain::keysinterface::PhantomKeysManager
30682 * [`ChannelManager::get_phantom_route_hints`]: lightning::ln::channelmanager::ChannelManager::get_phantom_route_hints
30683 * [`ChannelManager::create_inbound_payment`]: lightning::ln::channelmanager::ChannelManager::create_inbound_payment
30684 * [`ChannelManager::create_inbound_payment_for_hash`]: lightning::ln::channelmanager::ChannelManager::create_inbound_payment_for_hash
30685 * [`PhantomRouteHints::channels`]: lightning::ln::channelmanager::PhantomRouteHints::channels
30687 * Note that payment_hash (or a relevant inner pointer) may be NULL or all-0s to represent None
30689 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, enum LDKCurrency network);
30692 * Utility to create an invoice that can be paid to one of multiple nodes, or a \"phantom invoice.\"
30693 * See [`PhantomKeysManager`] for more information on phantom node payments.
30695 * `phantom_route_hints` parameter:
30696 * * Contains channel info for all nodes participating in the phantom invoice
30697 * * Entries are retrieved from a call to [`ChannelManager::get_phantom_route_hints`] on each
30698 * participating node
30699 * * It is fine to cache `phantom_route_hints` and reuse it across invoices, as long as the data is
30700 * updated when a channel becomes disabled or closes
30701 * * Note that if too many channels are included in [`PhantomRouteHints::channels`], the invoice
30702 * may be too long for QR code scanning. To fix this, `PhantomRouteHints::channels` may be pared
30705 * `description_hash` is a SHA-256 hash of the description text
30707 * `payment_hash` can be specified if you have a specific need for a custom payment hash (see the difference
30708 * between [`ChannelManager::create_inbound_payment`] and [`ChannelManager::create_inbound_payment_for_hash`]).
30709 * If `None` is provided for `payment_hash`, then one will be created.
30711 * `invoice_expiry_delta_secs` describes the number of seconds that the invoice is valid for
30712 * in excess of the current time.
30714 * Note that the provided `keys_manager`'s `KeysInterface` implementation must support phantom
30715 * invoices in its `sign_invoice` implementation ([`PhantomKeysManager`] satisfies this
30718 * [`PhantomKeysManager`]: lightning::chain::keysinterface::PhantomKeysManager
30719 * [`ChannelManager::get_phantom_route_hints`]: lightning::ln::channelmanager::ChannelManager::get_phantom_route_hints
30720 * [`ChannelManager::create_inbound_payment`]: lightning::ln::channelmanager::ChannelManager::create_inbound_payment
30721 * [`ChannelManager::create_inbound_payment_for_hash`]: lightning::ln::channelmanager::ChannelManager::create_inbound_payment_for_hash
30722 * [`PhantomRouteHints::channels`]: lightning::ln::channelmanager::PhantomRouteHints::channels
30724 * Note that payment_hash (or a relevant inner pointer) may be NULL or all-0s to represent None
30726 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, enum LDKCurrency network);
30729 * Utility to construct an invoice. Generally, unless you want to do something like a custom
30730 * cltv_expiry, this is what you should be using to create an invoice. The reason being, this
30731 * method stores the invoice's payment secret and preimage in `ChannelManager`, so (a) the user
30732 * doesn't have to store preimage/payment secret information and (b) `ChannelManager` can verify
30733 * that the payment secret is valid when the invoice is paid.
30735 * `invoice_expiry_delta_secs` describes the number of seconds that the invoice is valid for
30736 * in excess of the current time.
30738 struct LDKCResult_InvoiceSignOrCreationErrorZ create_invoice_from_channelmanager(const struct LDKChannelManager *NONNULL_PTR channelmanager, struct LDKKeysInterface keys_manager, enum LDKCurrency network, struct LDKCOption_u64Z amt_msat, struct LDKStr description, uint32_t invoice_expiry_delta_secs);
30741 * Utility to construct an invoice. Generally, unless you want to do something like a custom
30742 * cltv_expiry, this is what you should be using to create an invoice. The reason being, this
30743 * method stores the invoice's payment secret and preimage in `ChannelManager`, so (a) the user
30744 * doesn't have to store preimage/payment secret information and (b) `ChannelManager` can verify
30745 * that the payment secret is valid when the invoice is paid.
30746 * Use this variant if you want to pass the `description_hash` to the invoice.
30748 * `invoice_expiry_delta_secs` describes the number of seconds that the invoice is valid for
30749 * in excess of the current time.
30751 struct LDKCResult_InvoiceSignOrCreationErrorZ create_invoice_from_channelmanager_with_description_hash(const struct LDKChannelManager *NONNULL_PTR channelmanager, struct LDKKeysInterface keys_manager, enum LDKCurrency network, struct LDKCOption_u64Z amt_msat, struct LDKSha256 description_hash, uint32_t invoice_expiry_delta_secs);
30754 * See [`create_invoice_from_channelmanager_with_description_hash`]
30755 * This version can be used in a `no_std` environment, where [`std::time::SystemTime`] is not
30756 * available and the current time is supplied by the caller.
30758 struct LDKCResult_InvoiceSignOrCreationErrorZ create_invoice_from_channelmanager_with_description_hash_and_duration_since_epoch(const struct LDKChannelManager *NONNULL_PTR channelmanager, struct LDKKeysInterface keys_manager, enum LDKCurrency network, struct LDKCOption_u64Z amt_msat, struct LDKSha256 description_hash, uint64_t duration_since_epoch, uint32_t invoice_expiry_delta_secs);
30761 * See [`create_invoice_from_channelmanager`]
30762 * This version can be used in a `no_std` environment, where [`std::time::SystemTime`] is not
30763 * available and the current time is supplied by the caller.
30765 struct LDKCResult_InvoiceSignOrCreationErrorZ create_invoice_from_channelmanager_and_duration_since_epoch(const struct LDKChannelManager *NONNULL_PTR channelmanager, struct LDKKeysInterface keys_manager, enum LDKCurrency network, struct LDKCOption_u64Z amt_msat, struct LDKStr description, uint64_t duration_since_epoch, uint32_t invoice_expiry_delta_secs);
30768 * Frees any resources used by the DefaultRouter, if is_owned is set and inner is non-NULL.
30770 void DefaultRouter_free(struct LDKDefaultRouter this_obj);
30773 * Creates a new router using the given [`NetworkGraph`], a [`Logger`], and a randomness source
30774 * `random_seed_bytes`.
30776 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);
30779 * Constructs a new Router which calls the relevant methods on this_arg.
30780 * This copies the `inner` pointer in this_arg and thus the returned Router must be freed before this_arg is
30782 struct LDKRouter DefaultRouter_as_Router(const struct LDKDefaultRouter *NONNULL_PTR this_arg);
30785 * Constructs a new Payer which calls the relevant methods on this_arg.
30786 * This copies the `inner` pointer in this_arg and thus the returned Payer must be freed before this_arg is
30788 struct LDKPayer ChannelManager_as_Payer(const struct LDKChannelManager *NONNULL_PTR this_arg);
30791 * Read a SiPrefix object from a string
30793 struct LDKCResult_SiPrefixParseErrorZ SiPrefix_from_str(struct LDKStr s);
30796 * Read a Invoice object from a string
30798 struct LDKCResult_InvoiceParseOrSemanticErrorZ Invoice_from_str(struct LDKStr s);
30801 * Read a SignedRawInvoice object from a string
30803 struct LDKCResult_SignedRawInvoiceParseErrorZ SignedRawInvoice_from_str(struct LDKStr s);
30806 * Get the string representation of a ParseError object
30808 struct LDKStr ParseError_to_str(const struct LDKParseError *NONNULL_PTR o);
30811 * Get the string representation of a ParseOrSemanticError object
30813 struct LDKStr ParseOrSemanticError_to_str(const struct LDKParseOrSemanticError *NONNULL_PTR o);
30816 * Get the string representation of a Invoice object
30818 struct LDKStr Invoice_to_str(const struct LDKInvoice *NONNULL_PTR o);
30821 * Get the string representation of a SignedRawInvoice object
30823 struct LDKStr SignedRawInvoice_to_str(const struct LDKSignedRawInvoice *NONNULL_PTR o);
30826 * Get the string representation of a Currency object
30828 struct LDKStr Currency_to_str(const enum LDKCurrency *NONNULL_PTR o);
30831 * Get the string representation of a SiPrefix object
30833 struct LDKStr SiPrefix_to_str(const enum LDKSiPrefix *NONNULL_PTR o);
30836 * Frees any resources used by the RapidGossipSync, if is_owned is set and inner is non-NULL.
30838 void RapidGossipSync_free(struct LDKRapidGossipSync this_obj);
30841 * Instantiate a new [`RapidGossipSync`] instance
30843 MUST_USE_RES struct LDKRapidGossipSync RapidGossipSync_new(const struct LDKNetworkGraph *NONNULL_PTR network_graph);
30846 * Sync gossip data from a file
30847 * Returns the last sync timestamp to be used the next time rapid sync data is queried.
30849 * `network_graph`: The network graph to apply the updates to
30851 * `sync_path`: Path to the file where the gossip update data is located
30854 MUST_USE_RES struct LDKCResult_u32GraphSyncErrorZ RapidGossipSync_sync_network_graph_with_file_path(const struct LDKRapidGossipSync *NONNULL_PTR this_arg, struct LDKStr sync_path);
30857 * Returns whether a rapid gossip sync has completed at least once
30859 MUST_USE_RES bool RapidGossipSync_is_initial_sync_complete(const struct LDKRapidGossipSync *NONNULL_PTR this_arg);
30862 * Frees any resources used by the GraphSyncError
30864 void GraphSyncError_free(struct LDKGraphSyncError this_ptr);
30867 * Creates a copy of the GraphSyncError
30869 struct LDKGraphSyncError GraphSyncError_clone(const struct LDKGraphSyncError *NONNULL_PTR orig);
30872 * Utility method to constructs a new DecodeError-variant GraphSyncError
30874 struct LDKGraphSyncError GraphSyncError_decode_error(struct LDKDecodeError a);
30877 * Utility method to constructs a new LightningError-variant GraphSyncError
30879 struct LDKGraphSyncError GraphSyncError_lightning_error(struct LDKLightningError a);
30882 * Update network graph from binary data.
30883 * Returns the last sync timestamp to be used the next time rapid sync data is queried.
30885 * `network_graph`: network graph to be updated
30887 * `update_data`: `&[u8]` binary stream that comprises the update data
30889 MUST_USE_RES struct LDKCResult_u32GraphSyncErrorZ RapidGossipSync_update_network_graph(const struct LDKRapidGossipSync *NONNULL_PTR this_arg, struct LDKu8slice update_data);
30891 #endif /* LDK_C_BINDINGS_H */
30893 #include "ldk_ver.h"